mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-04 18:28:12 +02:00
st/mesa: Ignore internal_format in st_context_teximage.
When internal_format and tex->format differ, st_finailize_texture will surface_copy between surfaces with different formats. This commit works around the issue by ignoring internal_format. A sane fix is needed here.
This commit is contained in:
parent
8ad3e0b55d
commit
913d7c388d
1 changed files with 10 additions and 1 deletions
|
|
@ -541,7 +541,16 @@ st_context_teximage(struct st_context_iface *stctxi, enum st_texture_type target
|
|||
texImage = _mesa_get_tex_image(ctx, texObj, target, level);
|
||||
stImage = st_texture_image(texImage);
|
||||
if (tex) {
|
||||
if (util_format_get_component_bits(internal_format,
|
||||
/*
|
||||
* XXX When internal_format and tex->format differ, st_finalize_texture
|
||||
* needs to allocate a new texture with internal_format and copy the
|
||||
* texture here into the new one. It will result in surface_copy being
|
||||
* called on surfaces whose formats differ.
|
||||
*
|
||||
* To avoid that, internal_format is (wrongly) ignored here. A sane fix
|
||||
* is to use a sampler view.
|
||||
*/
|
||||
if (util_format_get_component_bits(tex->format,
|
||||
UTIL_FORMAT_COLORSPACE_RGB, 3) > 0)
|
||||
internalFormat = GL_RGBA;
|
||||
else
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue