summaryrefslogtreecommitdiff
path: root/src/mesa/state_tracker/st_cb_texture.c
diff options
context:
space:
mode:
authorMarek Olšák <marek.olsak@amd.com>2022-04-27 07:35:48 -0400
committerMarek Olšák <marek.olsak@amd.com>2022-05-05 19:46:17 -0400
commit89c94502b6650fed222abd3588e9c927811580aa (patch)
treec5963cadc1c918924b9def25cc5ee175c43d6b11 /src/mesa/state_tracker/st_cb_texture.c
parentdd3179aff0c1d38060836f926e9d5d21edbd3eae (diff)
mesa: consider the sample count when choosing a texture format
The set of supported MSAA formats can be smaller than the set of supported non-MSAA formats. Reviewed-by: Adam Jackson <ajax@redhat.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16326>
Diffstat (limited to 'src/mesa/state_tracker/st_cb_texture.c')
-rw-r--r--src/mesa/state_tracker/st_cb_texture.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/mesa/state_tracker/st_cb_texture.c b/src/mesa/state_tracker/st_cb_texture.c
index d3b041616bb..facf0584ad9 100644
--- a/src/mesa/state_tracker/st_cb_texture.c
+++ b/src/mesa/state_tracker/st_cb_texture.c
@@ -295,7 +295,7 @@ st_pbo_get_dst_format(struct gl_context *ctx, enum pipe_texture_target target,
/* Choose the destination format by finding the best match
* for the format+type combo. */
enum pipe_format dst_format = st_choose_matching_format(st, bind, format, type,
- ctx->Pack.SwapBytes);
+ 0, 0, ctx->Pack.SwapBytes);
if (dst_format == PIPE_FORMAT_NONE) {
GLenum dst_glformat;
@@ -1032,7 +1032,7 @@ prep_teximage(struct gl_context *ctx, struct gl_texture_image *texImage,
/* oops, need to init this image again */
texFormat = _mesa_choose_texture_format(ctx, texObj, target, level,
texImage->InternalFormat, format,
- type);
+ type, texImage->NumSamples);
_mesa_init_teximage_fields(ctx, texImage,
texImage->Width, texImage->Height,
@@ -1623,7 +1623,7 @@ try_pbo_upload(struct gl_context *ctx, GLuint dims,
* support at all because of the remapping we later perform and because
* at least the Radeon driver actually supports some formats for texture
* buffers which it doesn't support for regular textures. */
- src_format = st_choose_matching_format(st, 0, format, type,
+ src_format = st_choose_matching_format(st, 0, format, type, 0, 0,
unpack->SwapBytes);
if (!src_format) {
return false;
@@ -2001,7 +2001,7 @@ st_TexSubImage(struct gl_context *ctx, GLuint dims,
/* Choose the source format. */
src_format = st_choose_matching_format(st, PIPE_BIND_SAMPLER_VIEW,
- format, type, unpack->SwapBytes);
+ format, type, 0, 0, unpack->SwapBytes);
if (!src_format) {
goto fallback;
}