-
Notifications
You must be signed in to change notification settings - Fork 863
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1592 from KhronosGroup/subgroupBroadcast-const-id
GLSL: Fix #1591: Require the id in subgroupBroadcast to be constant.
- Loading branch information
Showing
6 changed files
with
403 additions
and
373 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
spv.subgroupBallotNeg.comp | ||
ERROR: 0:32: 'id' : argument must be compile-time constant | ||
ERROR: 1 compilation errors. No code generated. | ||
|
||
|
||
SPIR-V is not generated for failed compile or link |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
#version 450 | ||
|
||
#extension GL_KHR_shader_subgroup_ballot: enable | ||
|
||
layout (local_size_x = 8, local_size_y = 8, local_size_z = 1) in; | ||
|
||
layout(binding = 0) buffer Buffers | ||
{ | ||
vec4 f4; | ||
ivec4 i4; | ||
uvec4 u4; | ||
dvec4 d4; | ||
} data[4]; | ||
|
||
void main() | ||
{ | ||
uint invocation = (gl_SubgroupInvocationID + gl_SubgroupSize) % 4; | ||
|
||
uvec4 relMask = gl_SubgroupEqMask + | ||
gl_SubgroupGeMask + | ||
gl_SubgroupGtMask + | ||
gl_SubgroupLeMask + | ||
gl_SubgroupLtMask; | ||
|
||
uvec4 result = subgroupBallot(true); | ||
|
||
data[invocation].u4.x = subgroupBallotBitCount(result); | ||
data[invocation].u4.y = subgroupBallotBitExtract(result, 0) ? 1 : 0; | ||
data[invocation].u4.z = subgroupBallotInclusiveBitCount(result) + subgroupBallotExclusiveBitCount(result); | ||
data[invocation].u4.w = subgroupBallotFindLSB(result) + subgroupBallotFindMSB(result); | ||
|
||
data[invocation].f4.x = subgroupBroadcast(data[0].f4.x, invocation); // ERROR: not constant | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters