summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/vc4/vc4_screen.c
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2018-02-22 17:52:03 -0800
committerEric Anholt <[email protected]>2018-02-23 08:42:13 -0800
commit5980a41c0f3481aef2a4bc644d8a3a6c8618da46 (patch)
tree162cbae4df2c87bf789f78d713c16af801f2900f /src/gallium/drivers/vc4/vc4_screen.c
parentbc3d16e633fd27b05dfdcda0b7efb000b2c35ed6 (diff)
broadcom/vc4: Remove the retval==usage check in is_format_supported().
This got us into trouble recently, so just remove it entirely.
Diffstat (limited to 'src/gallium/drivers/vc4/vc4_screen.c')
-rw-r--r--src/gallium/drivers/vc4/vc4_screen.c39
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