unsigned usage)
{
struct vc4_screen *screen = vc4_screen(pscreen);
- unsigned retval = 0;
if (sample_count > 1 && sample_count != VC4_MAX_SAMPLES)
return FALSE;
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