diff options
author | Daniel Stone <daniels@collabora.com> | 2023-08-04 12:39:40 +0100 |
---|---|---|
committer | Marge Bot <emma+marge@anholt.net> | 2023-08-07 10:39:37 +0000 |
commit | cfa23e66901300a2572dfef54c9bf2a1e2233740 (patch) | |
tree | 5441c8fcefeb9ba269508cfcdc08e6f4974a0f91 | |
parent | f5074adeb52eaf4bd34f1f7534d52ce16800e200 (diff) |
panfrost/vk: Use correct sampler dimensions for MSAA
2D-MS samplers are SAMPLER_DIM_MS, not SAMPLER_DIM_2D. There is no MSAA
for non-2D textures.
Signed-off-by: Daniel Stone <daniels@collabora.com>
Closes: mesa/mesa#9474
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24494>
-rw-r--r-- | src/panfrost/vulkan/panvk_vX_meta_copy.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/panfrost/vulkan/panvk_vX_meta_copy.c b/src/panfrost/vulkan/panvk_vX_meta_copy.c index befcc2cbbab..7256231af56 100644 --- a/src/panfrost/vulkan/panvk_vX_meta_copy.c +++ b/src/panfrost/vulkan/panvk_vX_meta_copy.c @@ -314,12 +314,14 @@ panvk_meta_copy_img2img_shader(struct panfrost_device *pdev, switch (texdim) { case 1: + assert(!is_ms); tex->sampler_dim = GLSL_SAMPLER_DIM_1D; break; case 2: - tex->sampler_dim = GLSL_SAMPLER_DIM_2D; + tex->sampler_dim = is_ms ? GLSL_SAMPLER_DIM_MS : GLSL_SAMPLER_DIM_2D; break; case 3: + assert(!is_ms); tex->sampler_dim = GLSL_SAMPLER_DIM_3D; break; default: @@ -702,8 +704,8 @@ panvk_meta_copy_img2img_init(struct panvk_physical_device *dev, bool is_ms) unsigned texdimidx = panvk_meta_copy_tex_type(texdim, false); assert(texdimidx < ARRAY_SIZE(dev->meta.copy.img2img[0])); - /* No MSAA on 3D textures */ - if (texdim == 3 && is_ms) + /* No MSAA on 1D/3D textures */ + if (texdim != 2 && is_ms) continue; struct pan_shader_info shader_info; |