Mesa (master): etnaviv: Cannot render to rb-swapped formats

Christian Gmeiner austriancoder at kemper.freedesktop.org
Tue Jan 31 08:29:10 UTC 2017


Module: Mesa
Branch: master
Commit: 658568941d5e232d690e1ffbcddbd6ea9685693a
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=658568941d5e232d690e1ffbcddbd6ea9685693a

Author: Wladimir J. van der Laan <laanwj at gmail.com>
Date:   Wed Dec  7 12:59:54 2016 +0000

etnaviv: Cannot render to rb-swapped formats

Exposing rb swapped (or other swizzled) formats for rendering would
involve swizzing in the pixel shader. This is not the case at the
moment, so reject requests for creating such surfaces.

(GPUs that need an extra resolve step anyway due to multiple pixel
pipes, such as gc2000, might also do this swap in the resolve operation.
But this would be tricky to keep track of)

CC: <mesa-stable at lists.freedesktop.org>
Signed-off-by: Wladimir J. van der Laan <laanwj at gmail.com>
Acked-by: Christian Gmeiner <christian.gmeiner at gmail.com>

---

 src/gallium/drivers/etnaviv/etnaviv_screen.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/src/gallium/drivers/etnaviv/etnaviv_screen.c b/src/gallium/drivers/etnaviv/etnaviv_screen.c
index c045f7e..7c1609f 100644
--- a/src/gallium/drivers/etnaviv/etnaviv_screen.c
+++ b/src/gallium/drivers/etnaviv/etnaviv_screen.c
@@ -471,8 +471,11 @@ etna_screen_is_format_supported(struct pipe_screen *pscreen,
       return FALSE;
 
    if (usage & PIPE_BIND_RENDER_TARGET) {
-      /* if render target, must be RS-supported format */
-      if (translate_rs_format(format) != ETNA_NO_MATCH) {
+      /* If render target, must be RS-supported format that is not rb swapped.
+       * Exposing rb swapped (or other swizzled) formats for rendering would
+       * involve swizzing in the pixel shader.
+       */
+      if (translate_rs_format(format) != ETNA_NO_MATCH && !translate_rs_format_rb_swap(format)) {
          /* Validate MSAA; number of samples must be allowed, and render target
           * must have MSAA'able format. */
          if (sample_count > 1) {




More information about the mesa-commit mailing list