diff options
author | Gert Wollny <[email protected]> | 2018-07-12 12:55:36 +0200 |
---|---|---|
committer | Gert Wollny <[email protected]> | 2018-07-20 19:12:49 +0200 |
commit | 0bde9739c069fe24b5e5000f1b569b911847a940 (patch) | |
tree | 561768d79370ed34dfd519dcd21385e179ae34c3 /src/gallium/drivers | |
parent | feb43ef674593ad94e962be194cb67dfc97c4e2e (diff) |
virgl: Allow RGB32* textures only as buffer objects
When requesting a texture 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 given the 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).
v2: Correct spelling (Gurchetan Singh)
Signed-off-by: Gert Wollny <[email protected]>
Reviewed-by: Gurchetan Singh <[email protected]>
Diffstat (limited to 'src/gallium/drivers')
-rw-r--r-- | src/gallium/drivers/virgl/virgl_screen.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/gallium/drivers/virgl/virgl_screen.c b/src/gallium/drivers/virgl/virgl_screen.c index e32d454d19b..e2fe2209fe1 100644 --- a/src/gallium/drivers/virgl/virgl_screen.c +++ b/src/gallium/drivers/virgl/virgl_screen.c @@ -496,6 +496,13 @@ virgl_is_format_supported( struct pipe_screen *screen, return virgl_is_vertex_format_supported(screen, format); } + /* Allow 3-comp 32 bit textures 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 (bind & PIPE_BIND_RENDER_TARGET) { if (format_desc->colorspace == UTIL_FORMAT_COLORSPACE_ZS) return FALSE; |