[virglrenderer-devel] [PATCH] make sure both shift-operands are the same size
Dave Airlie
airlied at gmail.com
Tue Jul 3 20:44:59 UTC 2018
On 3 July 2018 at 19:59, Erik Faye-Lund <erik.faye-lund at collabora.com> wrote:
> Differing operand-sizes are illegal in GLSL, so we should make them all [iu]vec4
> instead.
This causes a bunch of piglit regressions.
generated_tests/spec/glsl-1.30/execution/built-in-functions/fs-op-assign-lshift-ivec3-int.shader_test
vrend_compile_shader: context error reported 1
"/home/airlied/devel/piglit/generated_tests/spec/glsl-1.30/execu"
Illegal shader 0
shader failed to compile
0:15(21): error: no matching function for call to
`uintBitsToFloat(ivec4)'; candidates are:
0:15(21): error: float uintBitsToFloat(uint)
0:15(21): error: vec2 uintBitsToFloat(uvec2)
0:15(21): error: vec3 uintBitsToFloat(uvec3)
0:15(21): error: vec4 uintBitsToFloat(uvec4)
0:15(21): error: type mismatch
0:15(16): error: cannot construct `vec3' from a non-numeric data type
GLSL:
#version 140
#extension GL_ARB_shader_bit_encoding : require
out vec4 fsout_c0;
out vec4 fsout_c1;
out vec4 fsout_c2;
out vec4 fsout_c3;
out vec4 fsout_c4;
out vec4 fsout_c5;
out vec4 fsout_c6;
out vec4 fsout_c7;
vec4 temp0[1];
uniform uvec4 fsconst0[3];
void main(void)
{
temp0[0].xyz = vec3(uintBitsToFloat(ivec4((uvec4((fsconst0[0].xyzz))
<< uvec4((fsconst0[1].xxxx))))).xyz);
temp0[0].xyz = vec3(uintBitsToFloat(uvec3(equal(uvec4(floatBitsToUint(temp0[0].xyzz)),
uvec4((fsconst0[2].xyzz))).xyz) * uvec3(0xffffffff)));
temp0[0].y = float(uintBitsToFloat((floatBitsToUint(temp0[0].yyyy) &
floatBitsToUint(temp0[0].zzzz))).y);
temp0[0].x = float(uintBitsToFloat((floatBitsToUint(temp0[0].xxxx) &
floatBitsToUint(temp0[0].yyyy))).x);
if (any(bvec4(floatBitsToUint(temp0[0].xxxx)))) {
temp0[0] = vec4(((vec4(0,1,0,1))));
} else {
temp0[0] = vec4(((vec4(1,0,0,1))));
}
fsout_c0 = vec4(( temp0[0] ));
fsout_c1 = fsout_c0;
fsout_c2 = fsout_c0;
fsout_c3 = fsout_c0;
fsout_c4 = fsout_c0;
fsout_c5 = fsout_c0;
fsout_c6 = fsout_c0;
fsout_c7 = fsout_c0;
}
Dave.
More information about the virglrenderer-devel
mailing list