summaryrefslogtreecommitdiffstats
path: root/ComputeShaders/addRepeatEx.hlsl
diff options
context:
space:
mode:
authorKonstantin <const@const.me>2023-02-03 13:03:36 +0100
committerKonstantin <const@const.me>2023-02-03 13:03:36 +0100
commit9cfdfc7a49f038b8ac806e0413c1a22e49191604 (patch)
treebc5121a17c809bf57e24f99b0e47737510f965c7 /ComputeShaders/addRepeatEx.hlsl
parent85cf1096fb1c2d18f06a3f87af648c7bc3dbb487 (diff)
Bugfix, addRepeatEx compute shader
Diffstat (limited to 'ComputeShaders/addRepeatEx.hlsl')
-rw-r--r--ComputeShaders/addRepeatEx.hlsl8
1 files changed, 7 insertions, 1 deletions
diff --git a/ComputeShaders/addRepeatEx.hlsl b/ComputeShaders/addRepeatEx.hlsl
index ea510b3..0d5ed78 100644
--- a/ComputeShaders/addRepeatEx.hlsl
+++ b/ComputeShaders/addRepeatEx.hlsl
@@ -70,7 +70,13 @@ void main( uint3 group: SV_GroupID, uint thread : SV_GroupIndex )
rsi3.z = pat + thread * patternStrides.x;
const uint3 rsiInc = uint3( stridesX, patternStrides.x ) * THREADS;
- for( ; rsi3.x < rsiEnd; rsi3 += rsiInc )
+ while( rsi3.x < rsiEnd )
+ {
add2( rsi3.xy, pattern[ rsi3.z ] );
+
+ rsi3 += rsiInc;
+ if( rsi3.z >= patternSize.x )
+ rsi3.z -= patternSize.x;
+ }
}
} \ No newline at end of file