diff options
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 |
