Skip to content

Commit

Permalink
Added missing writes to gl_Position in vertex shaders
Browse files Browse the repository at this point in the history
Some vertex shaders are not writing a value to gl_Position, which can cause
unintended run-time behavior (including termination or system instability).

Components: Vulkan
VK-GL-CTS issue: 1579

Affects:
dEQP-VK.binding_model.descriptorset_random.*
dEQP-VK.memory_model.message_passing.*

Change-Id: I3f2f21f23508bda3062a4480e9fac78748bab32b
  • Loading branch information
da3k authored and alegal-arm committed Jan 29, 2019
1 parent f24a15d commit 30a3335
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -700,6 +700,7 @@ void DescriptorSetRandomTestCase::initPrograms (SourceCollections& programCollec
" uvec4 color = (accum != 0) ? uvec4(0,0,0,0) : uvec4(1,0,0,1);\n"
" imageStore(image0_0, ivec2(gl_VertexIndex % " << DIM << ", gl_VertexIndex / " << DIM << "), color);\n"
" gl_PointSize = 1.0f;\n"
" gl_Position = vec4(0.0f, 0.0f, 0.0f, 1.0f);\n"
"}\n";

programCollection.glslSources.add("test") << glu::VertexSource(vss.str());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -406,8 +406,9 @@ void MemoryModelTestCase::initPrograms (SourceCollections& programCollection) co
" uint bufferCoord = gl_VertexIndex;\n"
" uint partnerBufferCoord = subgroupShuffleXor(gl_VertexIndex, gl_SubgroupSize-1);\n"
" ivec2 imageCoord = ivec2(gl_VertexIndex % (DIM*NUM_WORKGROUP_EACH_DIM), gl_VertexIndex / (DIM*NUM_WORKGROUP_EACH_DIM));\n"
" ivec2 partnerImageCoord = subgroupShuffleXor(imageCoord, gl_SubgroupSize-1);\n\n"
" gl_PointSize = 1.0f;\n\n";
" ivec2 partnerImageCoord = subgroupShuffleXor(imageCoord, gl_SubgroupSize-1);\n"
" gl_PointSize = 1.0f;\n"
" gl_Position = vec4(0.0f, 0.0f, 0.0f, 1.0f);\n\n";
break;
case STAGE_FRAGMENT:
css <<
Expand Down Expand Up @@ -456,8 +457,9 @@ void MemoryModelTestCase::initPrograms (SourceCollections& programCollection) co
" uint bufferCoord = globalId.y * DIM*NUM_WORKGROUP_EACH_DIM + globalId.x;\n"
" uint partnerBufferCoord = partnerGlobalId.y * DIM*NUM_WORKGROUP_EACH_DIM + partnerGlobalId.x;\n"
" ivec2 imageCoord = globalId;\n"
" ivec2 partnerImageCoord = partnerGlobalId;\n\n"
" gl_PointSize = 1.0f;\n\n";
" ivec2 partnerImageCoord = partnerGlobalId;\n"
" gl_PointSize = 1.0f;\n"
" gl_Position = vec4(0.0f, 0.0f, 0.0f, 1.0f);\n\n";
break;
case STAGE_FRAGMENT:
css <<
Expand Down

0 comments on commit 30a3335

Please sign in to comment.