mesa/st: simplify format usage in st_bind_egl_image
the formats handled in the switch statement will always return an unknown mesa format, so process them directly and leave the default case for other/unknown formats no functional changes Reviewed-by: Eric Anholt <eric@anholt.net> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
This commit is contained in:
parent
9b1b971491
commit
2cc85670a7
|
@ -196,12 +196,9 @@ st_bind_egl_image(struct gl_context *ctx,
|
||||||
stObj->surface_based = GL_TRUE;
|
stObj->surface_based = GL_TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
texFormat = st_pipe_format_to_mesa_format(stimg->format);
|
|
||||||
|
|
||||||
/* TODO RequiredTextureImageUnits should probably be reset back
|
/* TODO RequiredTextureImageUnits should probably be reset back
|
||||||
* to 1 somewhere if different texture is bound??
|
* to 1 somewhere if different texture is bound??
|
||||||
*/
|
*/
|
||||||
if (texFormat == MESA_FORMAT_NONE) {
|
|
||||||
switch (stimg->format) {
|
switch (stimg->format) {
|
||||||
case PIPE_FORMAT_NV12:
|
case PIPE_FORMAT_NV12:
|
||||||
texFormat = MESA_FORMAT_R_UNORM8;
|
texFormat = MESA_FORMAT_R_UNORM8;
|
||||||
|
@ -212,9 +209,10 @@ st_bind_egl_image(struct gl_context *ctx,
|
||||||
texObj->RequiredTextureImageUnits = 3;
|
texObj->RequiredTextureImageUnits = 3;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
unreachable("bad YUV format!");
|
texFormat = st_pipe_format_to_mesa_format(stimg->format);
|
||||||
}
|
break;
|
||||||
}
|
}
|
||||||
|
assert(texFormat != MESA_FORMAT_NONE);
|
||||||
|
|
||||||
_mesa_init_teximage_fields(ctx, texImage,
|
_mesa_init_teximage_fields(ctx, texImage,
|
||||||
stimg->texture->width0, stimg->texture->height0,
|
stimg->texture->width0, stimg->texture->height0,
|
||||||
|
|
Loading…
Reference in New Issue