summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers
diff options
context:
space:
mode:
authorTopi Pohjolainen <[email protected]>2016-11-26 18:03:56 +0200
committerTopi Pohjolainen <[email protected]>2017-01-27 08:57:26 +0200
commita283a4ee2fba6c8efa4f4e4eeea6b3d7b21df4d0 (patch)
treef6729e86b366ace5de0dfd91a8cc2b10fdb284f3 /src/mesa/drivers
parent542bb8504991c91d50f2b0302c2d04f58003030f (diff)
meta: Refactor texture format translation
Reviewed-by: Anuj Phogat <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Signed-off-by: Topi Pohjolainen <[email protected]>
Diffstat (limited to 'src/mesa/drivers')
-rw-r--r--src/mesa/drivers/common/meta_tex_subimage.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/mesa/drivers/common/meta_tex_subimage.c b/src/mesa/drivers/common/meta_tex_subimage.c
index 703efcd669b..b8c422bfb72 100644
--- a/src/mesa/drivers/common/meta_tex_subimage.c
+++ b/src/mesa/drivers/common/meta_tex_subimage.c
@@ -72,7 +72,8 @@ create_texture_for_pbo(struct gl_context *ctx,
const struct gl_pixelstore_attrib *packing,
struct gl_buffer_object **tmp_pbo, GLuint *tmp_tex)
{
- uint32_t pbo_format;
+ const mesa_format pbo_format =
+ _mesa_tex_format_from_format_and_type(ctx, format, type);
GLenum internal_format;
unsigned row_stride;
struct gl_buffer_object *buffer_obj;
@@ -85,11 +86,7 @@ create_texture_for_pbo(struct gl_context *ctx,
packing->Invert)
return NULL;
- pbo_format = _mesa_format_from_format_and_type(format, type);
- if (_mesa_format_is_mesa_array_format(pbo_format))
- pbo_format = _mesa_format_from_array_format(pbo_format);
-
- if (!pbo_format || !ctx->TextureFormatSupported[pbo_format])
+ if (pbo_format == MESA_FORMAT_NONE)
return NULL;
/* Account for SKIP_PIXELS, SKIP_ROWS, ALIGNMENT, and SKIP_IMAGES */