diff options
author | Brian Paul <[email protected]> | 2016-10-18 10:20:55 -0600 |
---|---|---|
committer | Brian Paul <[email protected]> | 2016-10-18 16:16:26 -0600 |
commit | 8b731b8b0364a19917a62d69ebd106423555ec27 (patch) | |
tree | 9595934aa579a70d1079c176813d2f5f0a15f077 /src/gallium | |
parent | 0ca134aa9f71b7a27b81caa78f9477aea948f0d7 (diff) |
svga: minor code improvements in svga_validate_pipe_sampler_view()
Use the 'texture' local var in more places.
Rename 'pFormat' to 'viewFormat'.
Reviewed-by: Charmaine Lee <[email protected]>
Diffstat (limited to 'src/gallium')
-rw-r--r-- | src/gallium/drivers/svga/svga_state_sampler.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/gallium/drivers/svga/svga_state_sampler.c b/src/gallium/drivers/svga/svga_state_sampler.c index 53bb80f0e5b..445afcc8d28 100644 --- a/src/gallium/drivers/svga/svga_state_sampler.c +++ b/src/gallium/drivers/svga/svga_state_sampler.c @@ -135,21 +135,21 @@ svga_validate_pipe_sampler_view(struct svga_context *svga, SVGA3dSurfaceFormat format; SVGA3dResourceType resourceDim; SVGA3dShaderResourceViewDesc viewDesc; - enum pipe_format pformat = sv->base.format; + enum pipe_format viewFormat = sv->base.format; /* vgpu10 cannot create a BGRX view for a BGRA resource, so force it to * create a BGRA view (and vice versa). */ - if (pformat == PIPE_FORMAT_B8G8R8X8_UNORM && - sv->base.texture->format == PIPE_FORMAT_B8G8R8A8_UNORM) { - pformat = PIPE_FORMAT_B8G8R8A8_UNORM; + if (viewFormat == PIPE_FORMAT_B8G8R8X8_UNORM && + texture->format == PIPE_FORMAT_B8G8R8A8_UNORM) { + viewFormat = PIPE_FORMAT_B8G8R8A8_UNORM; } - else if (pformat == PIPE_FORMAT_B8G8R8A8_UNORM && - sv->base.texture->format == PIPE_FORMAT_B8G8R8X8_UNORM) { - pformat = PIPE_FORMAT_B8G8R8X8_UNORM; + else if (viewFormat == PIPE_FORMAT_B8G8R8A8_UNORM && + texture->format == PIPE_FORMAT_B8G8R8X8_UNORM) { + viewFormat = PIPE_FORMAT_B8G8R8X8_UNORM; } - format = svga_translate_format(ss, pformat, + format = svga_translate_format(ss, viewFormat, PIPE_BIND_SAMPLER_VIEW); assert(format != SVGA3D_FORMAT_INVALID); |