coarse.comp: don't write Cmd_End to tiles out of bounds

If WIDTH_IN_TILES or HEIGHT_IN_TILES are not divisible by N_TILE_X or N_TILE_Y
respectively, the previously unconditional Cmd_End_write would write out of
bounds.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
Elias Naur 2020-12-18 00:29:25 +01:00
parent 4de67d9081
commit c67696714b
3 changed files with 4 additions and 2 deletions

View file

@ -370,5 +370,7 @@ void main() {
rd_ix += N_TILE;
if (rd_ix >= ready_ix && partition_ix >= n_partitions) break;
}
Cmd_End_write(cmd_ref);
if (bin_tile_x + tile_x < WIDTH_IN_TILES && bin_tile_y + tile_y < HEIGHT_IN_TILES) {
Cmd_End_write(cmd_ref);
}
}

Binary file not shown.

View file

@ -404,7 +404,7 @@ impl Renderer {
cmd_buf.dispatch(
&self.coarse_pipeline,
&self.coarse_ds,
(WIDTH as u32 / 256, HEIGHT as u32 / 256, 1),
((WIDTH as u32 + 255) / 256, (HEIGHT as u32 + 255) / 256, 1),
);
cmd_buf.write_timestamp(&query_pool, 6);
cmd_buf.memory_barrier();