Skip to content

v3d: Update TEXTURE_SHADER_STATE after creating a new buffer when mapping a texture with DISCARD_WHOLE_RESOURCE

Neil Roberts requested to merge nroberts/mesa:map-tex-discard-fix into master

When a texture is mapped with the DISCARD_WHOLE_RESOURCE flag set, v3d_map_usage_prep will try to allocate a new buffer for the resource. Previously, if the resource was used in a bound texture then nothing would cause it to update the sampler view with the offset for the new buffer. This commit just adds that in by looking at all sampler views and calling v3d_setup_texture_shader_state_for_so for each one that references this resource.

This fixes Mesa issue 1950.

Merge request reports