diff options
author | Brian Paul <[email protected]> | 2016-06-27 11:16:03 -0600 |
---|---|---|
committer | Brian Paul <[email protected]> | 2016-06-30 14:32:07 -0600 |
commit | 68388043f3280bbac9383721e37f8ca7685b7f01 (patch) | |
tree | 74bb7dfadf3d779070c82aad2ec9fed535c9ec3e | |
parent | 1049002eaeb39e1dfa728894b3681534a0142ba8 (diff) |
svga: adjust sampler view format for RGBX
We previously handled the case of a RGBX sampler view of a RGBA surface.
Add the reverse case too. For GL_ARB_copy_image.
Acked-by: Roland Scheidegger <[email protected]>
Reviewed-by: Charmaine Lee <[email protected]>
-rw-r--r-- | src/gallium/drivers/svga/svga_state_sampler.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/gallium/drivers/svga/svga_state_sampler.c b/src/gallium/drivers/svga/svga_state_sampler.c index 6e78825954f..00e8fc0e6c8 100644 --- a/src/gallium/drivers/svga/svga_state_sampler.c +++ b/src/gallium/drivers/svga/svga_state_sampler.c @@ -106,12 +106,16 @@ svga_validate_pipe_sampler_view(struct svga_context *svga, enum pipe_format pformat = sv->base.format; /* vgpu10 cannot create a BGRX view for a BGRA resource, so force it to - * create a BGRA view. + * create a BGRA view (and vice versa). */ if (pformat == PIPE_FORMAT_B8G8R8X8_UNORM && sv->base.texture->format == PIPE_FORMAT_B8G8R8A8_UNORM) { pformat = PIPE_FORMAT_B8G8R8A8_UNORM; } + else if (pformat == PIPE_FORMAT_B8G8R8A8_UNORM && + sv->base.texture->format == PIPE_FORMAT_B8G8R8X8_UNORM) { + pformat = PIPE_FORMAT_B8G8R8X8_UNORM; + } format = svga_translate_format(ss, pformat, PIPE_BIND_SAMPLER_VIEW); |