diff options
author | Lukas Taparauskas <lukas.taparauskas@unity3d.com> | 2021-04-29 21:01:26 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-04-29 21:01:26 +0300 |
commit | 72a2ec4c1b56ce233e0da97a36f87af98927256c (patch) | |
tree | 6ec325a51ddfb3b42c7d5442475f6d1e001cfa5d /reference/opt/shaders-msl/asm | |
parent | 995c7981cc3ec0cbd1e5a07321cfdee3d1219524 (diff) |
MSL: Fix '--msl-multi-patch-workgroup' out of bounds reads when dispatching more threads than control points (#1662)
* Fix '--msl-multi-patch-workgroup' cases where thread count exceeds data bounds
*Fix gl_PrimitiveID off by one error when computing last valid index
*Point gl_out to the last patch's data when threads exceed input data bounds
*Point patchOut to the last patch's data when threads exceed input data bounds
* Update MSL test expectations.
* Undo change to MSL multi-patch hull output bound checks
* Update MSL multi-patch test expectations.
Diffstat (limited to 'reference/opt/shaders-msl/asm')
-rw-r--r-- | reference/opt/shaders-msl/asm/tesc/tess-level-overrun.multi-patch.asm.tesc | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/reference/opt/shaders-msl/asm/tesc/tess-level-overrun.multi-patch.asm.tesc b/reference/opt/shaders-msl/asm/tesc/tess-level-overrun.multi-patch.asm.tesc index a5f316dd..79395a4b 100644 --- a/reference/opt/shaders-msl/asm/tesc/tess-level-overrun.multi-patch.asm.tesc +++ b/reference/opt/shaders-msl/asm/tesc/tess-level-overrun.multi-patch.asm.tesc @@ -15,7 +15,7 @@ struct TessLevels kernel void main0(const device TessLevels& sb_levels [[buffer(0)]], uint3 gl_GlobalInvocationID [[thread_position_in_grid]], constant uint* spvIndirectParams [[buffer(29)]], device MTLTriangleTessellationFactorsHalf* spvTessLevel [[buffer(26)]]) { - uint gl_PrimitiveID = min(gl_GlobalInvocationID.x / 1, spvIndirectParams[1]); + uint gl_PrimitiveID = min(gl_GlobalInvocationID.x / 1, spvIndirectParams[1] - 1); spvTessLevel[gl_PrimitiveID].insideTessellationFactor = half(sb_levels.inner0); spvTessLevel[gl_PrimitiveID].edgeTessellationFactor[0] = half(sb_levels.outer0); spvTessLevel[gl_PrimitiveID].edgeTessellationFactor[1] = half(sb_levels.outer1); |