diff options
author | Hans-Kristian Arntzen <post@arntzen-software.no> | 2019-01-09 12:47:16 +0300 |
---|---|---|
committer | Hans-Kristian Arntzen <post@arntzen-software.no> | 2019-01-09 12:47:16 +0300 |
commit | ddfd2617765b9b99516c5cb9db279046fe198ce8 (patch) | |
tree | eee3d82874d7ad2476df7b04c051f8364be06f28 | |
parent | ff7c4838f993209608b3b962600f188f141663f9 (diff) |
Fix input array size in tessellation evaluation shaders.
-rw-r--r-- | reference/opt/shaders/tese/input-array.tese | 11 | ||||
-rw-r--r-- | reference/shaders/tese/input-array.tese | 11 | ||||
-rw-r--r-- | shaders/tese/input-array.tese | 10 | ||||
-rw-r--r-- | spirv_glsl.cpp | 5 |
4 files changed, 35 insertions, 2 deletions
diff --git a/reference/opt/shaders/tese/input-array.tese b/reference/opt/shaders/tese/input-array.tese new file mode 100644 index 00000000..8a1aaf9f --- /dev/null +++ b/reference/opt/shaders/tese/input-array.tese @@ -0,0 +1,11 @@ +#version 450 +layout(quads, ccw, fractional_odd_spacing) in; + +layout(location = 0) in vec4 Floats[]; +layout(location = 2) in vec4 Floats2[]; + +void main() +{ + gl_Position = (Floats[0] * gl_TessCoord.x) + (Floats2[1] * gl_TessCoord.y); +} + diff --git a/reference/shaders/tese/input-array.tese b/reference/shaders/tese/input-array.tese new file mode 100644 index 00000000..8a1aaf9f --- /dev/null +++ b/reference/shaders/tese/input-array.tese @@ -0,0 +1,11 @@ +#version 450 +layout(quads, ccw, fractional_odd_spacing) in; + +layout(location = 0) in vec4 Floats[]; +layout(location = 2) in vec4 Floats2[]; + +void main() +{ + gl_Position = (Floats[0] * gl_TessCoord.x) + (Floats2[1] * gl_TessCoord.y); +} + diff --git a/shaders/tese/input-array.tese b/shaders/tese/input-array.tese new file mode 100644 index 00000000..f1014ca5 --- /dev/null +++ b/shaders/tese/input-array.tese @@ -0,0 +1,10 @@ +#version 450 + +layout(ccw, quads, fractional_odd_spacing) in; +layout(location = 0) in vec4 Floats[]; +layout(location = 2) in vec4 Floats2[gl_MaxPatchVertices]; + +void main() +{ + gl_Position = Floats[0] * gl_TessCoord.x + Floats2[1] * gl_TessCoord.y; +} diff --git a/spirv_glsl.cpp b/spirv_glsl.cpp index b3bfe3da..e3b7f408 100644 --- a/spirv_glsl.cpp +++ b/spirv_glsl.cpp @@ -9093,9 +9093,10 @@ string CompilerGLSL::to_array_size(const SPIRType &type, uint32_t index) { assert(type.array.size() == type.array_size_literal.size()); - // Tessellation control shaders must have either gl_MaxPatchVertices or unsized arrays for input arrays. + // Tessellation control and evaluation shaders must have either gl_MaxPatchVertices or unsized arrays for input arrays. // Opt for unsized as it's the more "correct" variant to use. - if (type.storage == StorageClassInput && get_entry_point().model == ExecutionModelTessellationControl) + if (type.storage == StorageClassInput && (get_entry_point().model == ExecutionModelTessellationControl || + get_entry_point().model == ExecutionModelTessellationEvaluation)) return ""; auto &size = type.array[index]; |