diff options
| author | Dan Goodliffe <dan@randomdan.homeip.net> | 2026-01-23 19:20:10 +0000 |
|---|---|---|
| committer | Dan Goodliffe <dan@randomdan.homeip.net> | 2026-01-23 19:20:10 +0000 |
| commit | aa3850946c9c3155fb7cabeeea3bcf99fbfd02d0 (patch) | |
| tree | 135de68ab1813a0b562dfe7a3ef6bc40779c06f3 /gfx | |
| parent | Add glDebugScope (diff) | |
| download | ilt-glmax.tar.bz2 ilt-glmax.tar.xz ilt-glmax.zip | |
Include GL_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS in networkCurve output calcglmax
Diffstat (limited to 'gfx')
| -rw-r--r-- | gfx/gl/shader.cpp | 3 | ||||
| -rw-r--r-- | gfx/gl/shaders/networkCurve.gs | 5 |
2 files changed, 5 insertions, 3 deletions
diff --git a/gfx/gl/shader.cpp b/gfx/gl/shader.cpp index 9a4c270..21edadb 100644 --- a/gfx/gl/shader.cpp +++ b/gfx/gl/shader.cpp @@ -16,8 +16,9 @@ namespace { } using LookUpFunction = std::string (*)(GLenum); - constexpr std::array<std::tuple<std::string_view, GLenum, LookUpFunction>, 1> LOOKUPS {{ + constexpr std::array<std::tuple<std::string_view, GLenum, LookUpFunction>, 2> LOOKUPS {{ {"GL_MAX_GEOMETRY_OUTPUT_VERTICES", GL_MAX_GEOMETRY_OUTPUT_VERTICES, getInt}, + {"GL_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS", GL_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS, getInt}, }}; struct ShaderCompileError : public MsgException<std::invalid_argument> { diff --git a/gfx/gl/shaders/networkCurve.gs b/gfx/gl/shaders/networkCurve.gs index 7cb6c42..ba93542 100644 --- a/gfx/gl/shaders/networkCurve.gs +++ b/gfx/gl/shaders/networkCurve.gs @@ -24,8 +24,9 @@ getRot(float angle) void main() { - float segs = clamp( - round(reps[0] * radius[0] / 1000), 4, floor(uint(GL_MAX_GEOMETRY_OUTPUT_VERTICES) / (profileLength * 2u))); + float segs = clamp(round(reps[0] * radius[0] / 1000), 4, + min(floor(uint(GL_MAX_GEOMETRY_OUTPUT_VERTICES) / (profileLength * 2u)), + floor(uint(GL_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS) / 5u))); vec3 arcstep = vec3((bangle[0] - aangle[0]), // angle reps[0], // texture (bpos[0].z - apos[0].z)) // height |
