aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium
diff options
context:
space:
mode:
authorGurchetan Singh <[email protected]>2019-08-06 19:04:25 -0700
committerGurchetan Singh <[email protected]>2019-08-08 16:21:57 -0700
commitbf0ca99ec708518e7f5242680e52508c8708362c (patch)
tree9167974fd7d18012bea7b40f597a386895112f74 /src/gallium
parent5a898e2a652843dbb9b013437b0715c3563cafdb (diff)
virgl: access caps in a less verbose way in virgl_is_format_supported
Reviewed-by: Erik Faye-Lund <[email protected]>
Diffstat (limited to 'src/gallium')
-rw-r--r--src/gallium/drivers/virgl/virgl_screen.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/gallium/drivers/virgl/virgl_screen.c b/src/gallium/drivers/virgl/virgl_screen.c
index 37e75b5e048..7153383e9a1 100644
--- a/src/gallium/drivers/virgl/virgl_screen.c
+++ b/src/gallium/drivers/virgl/virgl_screen.c
@@ -651,7 +651,10 @@ virgl_is_format_supported( struct pipe_screen *screen,
const struct util_format_description *format_desc;
int i;
- boolean may_emulate_bgra = false;
+ union virgl_caps *caps = &vscreen->caps.caps;
+ boolean may_emulate_bgra = (caps->v2.capability_bits &
+ VIRGL_CAP_APP_TWEAK_SUPPORT) &&
+ vscreen->tweak_gles_emulate_bgra;
if (MAX2(1, sample_count) != MAX2(1, storage_sample_count))
return false;
@@ -674,15 +677,15 @@ virgl_is_format_supported( struct pipe_screen *screen,
return false;
if (sample_count > 1) {
- if (!vscreen->caps.caps.v1.bset.texture_multisample)
+ if (!caps->v1.bset.texture_multisample)
return false;
if (bind & PIPE_BIND_SHADER_IMAGE) {
- if (sample_count > vscreen->caps.caps.v2.max_image_samples)
+ if (sample_count > caps->v2.max_image_samples)
return false;
}
- if (sample_count > vscreen->caps.caps.v1.max_samples)
+ if (sample_count > caps->v1.max_samples)
return false;
}
@@ -706,9 +709,6 @@ virgl_is_format_supported( struct pipe_screen *screen,
target == PIPE_TEXTURE_3D)
return false;
- may_emulate_bgra = (vscreen->caps.caps.v2.capability_bits &
- VIRGL_CAP_APP_TWEAK_SUPPORT) &&
- vscreen->tweak_gles_emulate_bgra;
if (bind & PIPE_BIND_RENDER_TARGET) {
/* For ARB_framebuffer_no_attachments. */
@@ -728,7 +728,7 @@ virgl_is_format_supported( struct pipe_screen *screen,
return false;
if (!virgl_format_check_bitmask(format,
- vscreen->caps.caps.v1.render.bitmask,
+ caps->v1.render.bitmask,
may_emulate_bgra))
return false;
}
@@ -774,7 +774,7 @@ virgl_is_format_supported( struct pipe_screen *screen,
out_lookup:
return virgl_format_check_bitmask(format,
- vscreen->caps.caps.v1.sampler.bitmask,
+ caps->v1.sampler.bitmask,
may_emulate_bgra);
}