svga: Apply texcoord scale factors only if there is sampler view
authorNeha Bhende <bhenden@vmware.com>
Thu, 30 Aug 2018 21:46:56 +0000 (14:46 -0700)
committerBrian Paul <brianp@vmware.com>
Thu, 20 Sep 2018 19:20:10 +0000 (13:20 -0600)
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 <brianp@vmware.com>
Reviewed-by: Charmaine Lee <charmainel@vmware.com>
src/gallium/drivers/svga/svga_tgsi_vgpu10.c

index b9aaeba0bb961f24ff87ec93e2f5ed320d101c69..a5bbb4d0f2a307658e75fd4c59cdd75f98721b29 100644 (file)
@@ -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);