From: Neha Bhende Date: Thu, 30 Aug 2018 21:46:56 +0000 (-0700) Subject: svga: Apply texcoord scale factors only if there is sampler view X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=ede805dd190fd3cd8e326e9b3191d2ed8ac14826;p=mesa.git svga: Apply texcoord scale factors only if there is sampler view We need to convert unnormalized texcoords to normalized texcoords when we are sampling from texture. We don't need this conversion if there is no sampler view. Tested with piglit, glretrace Fixes vmware bug 2101970 Reviewed-by: Brian Paul Reviewed-by: Charmaine Lee --- diff --git a/src/gallium/drivers/svga/svga_tgsi_vgpu10.c b/src/gallium/drivers/svga/svga_tgsi_vgpu10.c index b9aaeba0bb9..a5bbb4d0f2a 100644 --- a/src/gallium/drivers/svga/svga_tgsi_vgpu10.c +++ b/src/gallium/drivers/svga/svga_tgsi_vgpu10.c @@ -4967,7 +4967,7 @@ setup_texcoord(struct svga_shader_emitter_v10 *emit, unsigned unit, const struct tgsi_full_src_register *coord) { - if (emit->key.tex[unit].unnormalized) { + if (emit->sampler_view[unit] && emit->key.tex[unit].unnormalized) { unsigned scale_index = emit->texcoord_scale_index[unit]; unsigned tmp = get_temp_index(emit); struct tgsi_full_src_register tmp_src = make_src_temp_reg(tmp);