diff options
author | Rob Clark <[email protected]> | 2019-01-29 12:23:28 -0500 |
---|---|---|
committer | Rob Clark <[email protected]> | 2019-01-29 12:30:50 -0500 |
commit | c3baa077bf6db9f9d46be62ed7cbbc3167e68c8f (patch) | |
tree | 46574f846c6339b611b6eda72c12757e61170423 /src/gallium/drivers/freedreno/freedreno_texture.c | |
parent | 1a6ddfe5ee1fc4b850f82f9cc3b0248101cae55a (diff) |
freedreno: stop frob'ing pipe_resource::nr_samples
Previously we tried to normalize nr_samples to MAX2(1, nr_samples) to
avoid having to deal with 0 vs 1 everywhere. But this causes problems
in mesa/st, for example st_finalize_texture() will think there is a
nr_samples mismatch and recreate the texture. Somehow this manifests
as corrupt x11 font rendering on generations that do not support MSAA
(but apparently works fine on a5xx and a6xx which do support MSAA.)
Fixes: cf0c7258ee0 freedreno/a5xx: MSAA
Signed-off-by: Rob Clark <[email protected]>
Diffstat (limited to 'src/gallium/drivers/freedreno/freedreno_texture.c')
-rw-r--r-- | src/gallium/drivers/freedreno/freedreno_texture.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/gallium/drivers/freedreno/freedreno_texture.c b/src/gallium/drivers/freedreno/freedreno_texture.c index d92298d2ea5..84b4df6c1dc 100644 --- a/src/gallium/drivers/freedreno/freedreno_texture.c +++ b/src/gallium/drivers/freedreno/freedreno_texture.c @@ -31,6 +31,7 @@ #include "freedreno_texture.h" #include "freedreno_context.h" +#include "freedreno_resource.h" #include "freedreno_util.h" static void @@ -83,7 +84,7 @@ static void set_sampler_views(struct fd_texture_stateobj *tex, tex->num_textures = util_last_bit(tex->valid_textures); for (i = 0; i < tex->num_textures; i++) { - uint nr_samples = tex->textures[i]->texture->nr_samples; + uint nr_samples = fd_resource_nr_samples(tex->textures[i]->texture); samplers |= (nr_samples >> 1) << (i * 2); } |