st/mesa: store state that affects sampler views per context

This fixes sequences like:

1. Context 1 samples from texture with sRGB decode enabled
2. Context 2 samples from texture with sRGB decode disabled
3. Context 1 samples from texture with sRGB decode disabled

Previously, step 3 would see the prev_sRGBDecode value from context 2
and would incorrectly use the old sampler view with sRGB decode enabled.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
This commit is contained in:
Nicolai Hähnle
2017-10-05 14:08:04 +02:00
parent e484805352
commit bce3055c69
4 changed files with 44 additions and 41 deletions

View File

@@ -170,8 +170,8 @@ st_convert_sampler(const struct st_context *st,
swizzle is per-texture, not per context. */
/* XXX: clean that up to not use the sampler view at all */
for (unsigned i = 0; i < stobj->num_sampler_views; ++i) {
if (stobj->sampler_views[i]) {
sv = stobj->sampler_views[i];
if (stobj->sampler_views[i].view) {
sv = stobj->sampler_views[i].view;
break;
}
}