radeonsi: update dirty_level_mask only when flushing or unbinding framebuffer
authorMarek Olšák <marek.olsak@amd.com>
Tue, 4 Jul 2017 14:11:16 +0000 (16:11 +0200)
committerMarek Olšák <marek.olsak@amd.com>
Fri, 28 Jul 2017 14:34:24 +0000 (16:34 +0200)
commitf4d095cc651af005d5760aa9dd06e6ae7007fab6
tree241e7d2bf363cec5ee7e4247c145aa28d47b6e6c
parent221fdae38b32df8d5761ec1fdc61707a025afec6
radeonsi: update dirty_level_mask only when flushing or unbinding framebuffer

This fixes corruption with bindless textures in Dawn Of War 3.

The do_update_surf_dirtiness mechanism was complicated and dirty_level_mask
was only updated after the first draw call. The problem is bindless textures
are checked for decompression every draw call and we would only decompress
after the first draw call. The solution is to set dirtiness after the last
draw call to the framebuffer, so the (unconditional) decompression of
bindless textures happens at the right time.

Cc: 17.2 <mesa-stable@lists.freedesktop.org>
Tested-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
src/gallium/drivers/radeonsi/si_blit.c
src/gallium/drivers/radeonsi/si_pipe.h
src/gallium/drivers/radeonsi/si_state.c
src/gallium/drivers/radeonsi/si_state.h
src/gallium/drivers/radeonsi/si_state_draw.c