diff options
Diffstat (limited to 'src/gallium/drivers')
-rw-r--r-- | src/gallium/drivers/vc4/vc4_screen.c | 39 |
1 files changed, 13 insertions, 26 deletions
diff --git a/src/gallium/drivers/vc4/vc4_screen.c b/src/gallium/drivers/vc4/vc4_screen.c index 5339864f7f8..5b944bf030b 100644 --- a/src/gallium/drivers/vc4/vc4_screen.c +++ b/src/gallium/drivers/vc4/vc4_screen.c @@ -464,7 +464,6 @@ vc4_screen_is_format_supported(struct pipe_screen *pscreen, unsigned usage) { struct vc4_screen *screen = vc4_screen(pscreen); - unsigned retval = 0; if (sample_count > 1 && sample_count != VC4_MAX_SAMPLES) return FALSE; @@ -520,48 +519,36 @@ vc4_screen_is_format_supported(struct pipe_screen *pscreen, case PIPE_FORMAT_R8G8B8_SSCALED: case PIPE_FORMAT_R8G8_SSCALED: case PIPE_FORMAT_R8_SSCALED: - retval |= PIPE_BIND_VERTEX_BUFFER; break; default: - break; + return FALSE; } } if ((usage & PIPE_BIND_RENDER_TARGET) && - vc4_rt_format_supported(format)) { - retval |= PIPE_BIND_RENDER_TARGET; + !vc4_rt_format_supported(format)) { + return FALSE; } if ((usage & PIPE_BIND_SAMPLER_VIEW) && - vc4_tex_format_supported(format) && - (format != PIPE_FORMAT_ETC1_RGB8 || screen->has_etc1)) { - retval |= PIPE_BIND_SAMPLER_VIEW; + (!vc4_tex_format_supported(format) || + (format == PIPE_FORMAT_ETC1_RGB8 && !screen->has_etc1))) { + return FALSE; } if ((usage & PIPE_BIND_DEPTH_STENCIL) && - (format == PIPE_FORMAT_S8_UINT_Z24_UNORM || - format == PIPE_FORMAT_X8Z24_UNORM)) { - retval |= PIPE_BIND_DEPTH_STENCIL; + format != PIPE_FORMAT_S8_UINT_Z24_UNORM && + format != PIPE_FORMAT_X8Z24_UNORM) { + return FALSE; } if ((usage & PIPE_BIND_INDEX_BUFFER) && - (format == PIPE_FORMAT_I8_UINT || - format == PIPE_FORMAT_I16_UINT)) { - retval |= PIPE_BIND_INDEX_BUFFER; - } - - retval |= usage & PIPE_BIND_DISPLAY_TARGET; - -#if 0 - if (retval != usage) { - fprintf(stderr, - "not supported: format=%s, target=%d, sample_count=%d, " - "usage=0x%x, retval=0x%x\n", util_format_name(format), - target, sample_count, usage, retval); + format != PIPE_FORMAT_I8_UINT && + format != PIPE_FORMAT_I16_UINT) { + return FALSE; } -#endif - return retval == usage; + return TRUE; } static void |