SPIRV-Cross/shaders-msl/tese/in-array-of-struct.raw-tess-in.tese
Chip Davis a171087180 MSL: Support "raw" buffer input in tessellation evaluation shaders.
Using vertex-style stage input is complex, and it doesn't support
nesting of structures or arrays. By using raw buffer input instead, we
get this support "for free," and everything becomes much simpler.
Arguably, this is the way I should've done this in the first place.

Eventually, I'd like to make this the default, and then remove the
option altogether. (And I still need to do that with
`multi_patch_workgroup`...)

Should help fix 66 tests in the Vulkan CTS, under the following trees:

 - `dEQP-VK.pipeline.*.interface_matching.*`
 - `dEQP-VK.tessellation.user_defined_io.*`
 - `dEQP-VK.clipping.user_defined.*`
2022-10-18 14:58:59 -07:00

20 lines
645 B
GLSL

#version 450
#extension GL_EXT_tessellation_shader : require
layout(triangles) in;
layout(location = 0) in struct {
float dummy;
vec4 variableInStruct;
} testStructArray[][3];
layout(location = 0) out float outResult;
void main(void)
{
gl_Position = vec4(gl_TessCoord.xy * 2.0 - 1.0, 0.0, 1.0);
float result;
result = float(abs(testStructArray[0][2].variableInStruct.x - -4.0) < 0.001) *
float(abs(testStructArray[0][2].variableInStruct.y - -9.0) < 0.001) *
float(abs(testStructArray[0][2].variableInStruct.z - 3.0) < 0.001) *
float(abs(testStructArray[0][2].variableInStruct.w - 7.0) < 0.001);
outResult = result;
}