From df875b27feed0684ef6b469ceda368fdbf2a2043 Mon Sep 17 00:00:00 2001 From: "Steinar H. Gunderson" Date: Sun, 24 Sep 2017 18:42:10 +0200 Subject: [PATCH] Stop hardcoding blocks per row in the shader. --- decoder.shader | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/decoder.shader b/decoder.shader index 7136e03..724a2f5 100644 --- a/decoder.shader +++ b/decoder.shader @@ -203,6 +203,8 @@ void main() local_timing[0] = start; #endif + const uint blocks_per_row = (imageSize(out_tex).x + 7) / 8; + const uint local_x = gl_LocalInvocationID.x % 8; const uint local_y = (gl_LocalInvocationID.x / 8) % 8; const uint local_z = gl_LocalInvocationID.x / 64; @@ -306,8 +308,8 @@ void main() pick_timer(start, local_timing[6]); uint global_block_idx = (block_row * 40 + block_idx) * 8 + local_y; - uint block_x = global_block_idx % 160; - uint block_y = global_block_idx / 160; + uint block_x = global_block_idx % blocks_per_row; + uint block_y = global_block_idx / blocks_per_row; uint y = block_y * 8; uint x = block_x * 8 + local_x; -- 2.39.2