Commit be82fb58 authored by Gert Wollny's avatar Gert Wollny
Browse files

virgl: Allow RGB32* textures only as buffer object

When requesting a textur of the internal format GL_RGB32F Gallium will
try to allocate a renderable texture and returns RGBA32F or RGBX32F, but
when one requests GL_RGB32I or GL_RGB32UI the according 3-component
texture will be returned. This leads to problems later, when one wants
to use glCopyImageSubData to copy data between these textures that
should be compatible, but way virgl and Gallium  handle this the latter
fails with an assertion, because the per-texel bit size is different.

By allowing the GL_RGB32* only for texture buffers these problems are
avoided without losing the ARB_tbo_rgb32 extension (thanks Ilia Mirkin).
parent 24c92876
......@@ -557,6 +557,13 @@ virgl_is_format_supported( struct pipe_screen *screen,
return TRUE;
/* Allow 3-comp 32 bit texturs only for TBOs (needed for ARB_tbo_rgb32) */
if ((format == PIPE_FORMAT_R32G32B32_FLOAT ||
format == PIPE_FORMAT_R32G32B32_SINT ||
format == PIPE_FORMAT_R32G32B32_UINT) &&
target != PIPE_BUFFER)
return false;
if (format_desc->colorspace == UTIL_FORMAT_COLORSPACE_ZS)
return FALSE;
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment