diff options
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/cross-compile/geometry-shader.slang | 5 | ||||
| -rw-r--r-- | tests/cross-compile/geometry-shader.slang.glsl | 16 |
2 files changed, 12 insertions, 9 deletions
diff --git a/tests/cross-compile/geometry-shader.slang b/tests/cross-compile/geometry-shader.slang index 614d71db9..8666b739a 100644 --- a/tests/cross-compile/geometry-shader.slang +++ b/tests/cross-compile/geometry-shader.slang @@ -19,7 +19,8 @@ struct RasterVertex [maxvertexcount(3)] void main( triangle CoarseVertex coarseVertices[3], - inout TriangleStream<RasterVertex> outputStream) + inout TriangleStream<RasterVertex> outputStream, + uint primitiveID : SV_PrimitiveID) { for(int ii = 0; ii < 3; ++ii) { @@ -27,7 +28,7 @@ void main( RasterVertex rasterVertex; rasterVertex.position = coarseVertex.position; rasterVertex.color = coarseVertex.color; - rasterVertex.id = coarseVertex.id; + rasterVertex.id = coarseVertex.id + primitiveID; outputStream.Append(rasterVertex); } } diff --git a/tests/cross-compile/geometry-shader.slang.glsl b/tests/cross-compile/geometry-shader.slang.glsl index cdd0f94de..2dd9d35bc 100644 --- a/tests/cross-compile/geometry-shader.slang.glsl +++ b/tests/cross-compile/geometry-shader.slang.glsl @@ -52,13 +52,15 @@ void main() { int ii_0; + uint _S6 = uint(gl_PrimitiveIDIn); + // TODO: Having to make this copy to transpose things is unfortunate. // // The front-end should be able to generate code using aggregate // types for the input, and/or eliminate the redundant temporary // by indexing directly into the sub-arrays. // - CoarseVertex_0 _S6[3] = { + CoarseVertex_0 _S7[3] = { CoarseVertex_0(input_position[0], input_color[0], input_id[0]), CoarseVertex_0(input_position[1], input_color[1], input_id[1]), CoarseVertex_0(input_position[2], input_color[2], input_id[2]) @@ -74,18 +76,18 @@ void main() break; } - CoarseVertex_0 coarseVertex_0 = _S6[ii_0]; + CoarseVertex_0 coarseVertex_0 = _S7[ii_0]; RasterVertex_0 rasterVertex_0; rasterVertex_0.position_0 = coarseVertex_0.position_1; rasterVertex_0.color_0 = coarseVertex_0.color_1; - rasterVertex_0.id_0 = coarseVertex_0.id_1; + rasterVertex_0.id_0 = coarseVertex_0.id_1 + _S6; - RasterVertex_0 _S7 = rasterVertex_0; + RasterVertex_0 _S8 = rasterVertex_0; - output_position = _S7.position_0; - output_color = _S7.color_0; - gl_Layer = int(_S7.id_0); + output_position = _S8.position_0; + output_color = _S8.color_0; + gl_Layer = int(_S8.id_0); EmitVertex(); |
