From: Steinar H. Gunderson Date: Sun, 24 Sep 2017 16:42:10 +0000 (+0200) Subject: Stop hardcoding blocks per row in the shader. X-Git-Url: https://git.sesse.net/?p=narabu;a=commitdiff_plain;h=df875b27feed0684ef6b469ceda368fdbf2a2043 Stop hardcoding blocks per row in the shader. --- 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;