From: Brian Paul Date: Mon, 27 Jun 2016 17:18:10 +0000 (-0600) Subject: svga: set render target flag for snorm surfaces X-Git-Tag: upstream/17.1.0~8394 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=3a3c3d124aced6444cd637d21c5d723c8417b0b9;p=platform%2Fupstream%2Fmesa.git svga: set render target flag for snorm surfaces We don't normally support rendering to SNORM surfaces, but with GL_ARB_copy_image we can copy to them if we treat them as typeless and use a UNORM surface view. Acked-by: Roland Scheidegger Reviewed-by: Charmaine Lee --- diff --git a/src/gallium/drivers/svga/svga_resource_texture.c b/src/gallium/drivers/svga/svga_resource_texture.c index 3f91c86..9e1aaab 100644 --- a/src/gallium/drivers/svga/svga_resource_texture.c +++ b/src/gallium/drivers/svga/svga_resource_texture.c @@ -963,6 +963,16 @@ svga_texture_create(struct pipe_screen *screen, svga_format_name(typeless), bindings); } + + if (svga_format_is_uncompressed_snorm(tex->key.format)) { + /* We can't normally render to snorm surfaces, but once we + * substitute a typeless format, we can if the rendertarget view + * is unorm. This can happen with GL_ARB_copy_image. + */ + tex->key.flags |= SVGA3D_SURFACE_HINT_RENDERTARGET; + tex->key.flags |= SVGA3D_SURFACE_BIND_RENDER_TARGET; + } + tex->key.format = typeless; }