OSDN Git Service

st/glsl_to_tgsi: fix st_src_reg_for_double constant.
authorDave Airlie <airlied@redhat.com>
Tue, 5 Jul 2016 00:26:14 +0000 (10:26 +1000)
committerEmil Velikov <emil.l.velikov@gmail.com>
Thu, 1 Sep 2016 10:39:44 +0000 (11:39 +0100)
This needs to set the src swizzle so it doesn't access the .zw
members ever when we are just emitting a 0 constant here.

This fixes:
vert-conversion-explicit-dvec3-bvec3.shader_test
and a bunch of other fp64 tests on softpipe and radeonsi.

Cc: <mesa-stable@lists.freedesktop.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
(cherry picked from commit 26187f3890cd92d6871ffb431763b27cacd8d4fe)

src/mesa/state_tracker/st_glsl_to_tgsi.cpp

index 4587eda..54db9b1 100644 (file)
@@ -1136,7 +1136,7 @@ glsl_to_tgsi_visitor::st_src_reg_for_double(double val)
    uval[0].u = *(uint32_t *)&val;
    uval[1].u = *(((uint32_t *)&val) + 1);
    src.index = add_constant(src.file, uval, 1, GL_DOUBLE, &src.swizzle);
-
+   src.swizzle = MAKE_SWIZZLE4(SWIZZLE_X, SWIZZLE_Y, SWIZZLE_X, SWIZZLE_Y);
    return src;
 }