renderer/sampler views: use view->format instead of format

I want to change the incoming format to use some bits for texture
view support, so this is precursor to avoid causing problems.

Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
macos/master
Dave Airlie 6 years ago
parent eb1a230d7c
commit cb50e8cff9
  1. 12
      src/vrend_renderer.c

@ -1436,7 +1436,7 @@ int vrend_create_sampler_view(struct vrend_context *ctx,
view->srgb_decode = GL_SKIP_DECODE_EXT;
}
if (!(util_format_has_alpha(format) || util_format_is_depth_or_stencil(format))) {
if (!(util_format_has_alpha(view->format) || util_format_is_depth_or_stencil(view->format))) {
if (swizzle[0] == PIPE_SWIZZLE_ALPHA)
swizzle[0] = PIPE_SWIZZLE_ONE;
if (swizzle[1] == PIPE_SWIZZLE_ALPHA)
@ -1447,15 +1447,15 @@ int vrend_create_sampler_view(struct vrend_context *ctx,
swizzle[3] = PIPE_SWIZZLE_ONE;
}
if (tex_conv_table[format].flags & VREND_BIND_NEED_SWIZZLE) {
if (tex_conv_table[view->format].flags & VREND_BIND_NEED_SWIZZLE) {
if (swizzle[0] <= PIPE_SWIZZLE_ALPHA)
swizzle[0] = tex_conv_table[format].swizzle[swizzle[0]];
swizzle[0] = tex_conv_table[view->format].swizzle[swizzle[0]];
if (swizzle[1] <= PIPE_SWIZZLE_ALPHA)
swizzle[1] = tex_conv_table[format].swizzle[swizzle[1]];
swizzle[1] = tex_conv_table[view->format].swizzle[swizzle[1]];
if (swizzle[2] <= PIPE_SWIZZLE_ALPHA)
swizzle[2] = tex_conv_table[format].swizzle[swizzle[2]];
swizzle[2] = tex_conv_table[view->format].swizzle[swizzle[2]];
if (swizzle[3] <= PIPE_SWIZZLE_ALPHA)
swizzle[3] = tex_conv_table[format].swizzle[swizzle[3]];
swizzle[3] = tex_conv_table[view->format].swizzle[swizzle[3]];
}
view->gl_swizzle_r = to_gl_swizzle(swizzle[0]);

Loading…
Cancel
Save