immediate args to tex ops
nir-to-tgsi emits more compact code than glsl-to-tgsi does, which triggers a virglrenderer bug.
Previously, on dEQP-GLES3.functional.shaders.random.texture.fragment.26
we would get:
FRAG
DCL OUT[0], COLOR
DCL SAMP[0]
DCL SVIEW[0], 2D, FLOAT
DCL TEMP[0], LOCAL
IMM[0] FLT32 { 4.0000, -5.0000, 0.0000, 0.0000}
0: MOV TEMP[0].xy, IMM[0].xyyy
1: MOV TEMP[0].w, IMM[0].zzzz
2: TXB TEMP[0], TEMP[0], SAMP[0], 2D
3: MOV OUT[0], TEMP[0]
4: END
VERT
PROPERTY NEXT_SHADER VERT
DCL IN[0]
DCL OUT[0], POSITION
0: MOV OUT[0], IN[0]
1: END
Pass (Pass)
But now we get:
TGSI after translation from NIR:
FRAG
DCL OUT[0], COLOR
DCL SAMP[0]
IMM[0] UINT32 {1082130432, 3231711232, 0, 0}
0: TXB OUT[0], IMM[0].xyxz, SAMP[0], 2D
1: END
Fail (Image comparison failed)
and virglrenderer fails with:
vtest_client_dispatch_commands: client context created.
GLSL feature level 450
GLSL feature level 450
vrend_compile_shader: context error reported 1 "deqp-gles3" Illegal shader 0
shader failed to compile
0:8(166): error: syntax error, unexpected ';', expecting ')' or ','
fs: 2 GLSL:
1: #version 140
2: #extension GL_ARB_shader_bit_encoding : require
3:
4:
5: out vec4 fsout_c0;
6: uniform sampler2D fssamp0;
7:
8: void main(void)
9: {
10: fsout_c0 = vec4((texture(fssamp0, uintBitsToFloat(uvec4(1082130432U,3231711232U,1082130432U,0U)).xy, uintBitsToFloat(uvec4(1082130432U,3231711232U,1082130432U,0U))));
11: }
12:
dropping rendering due to missing shaders: deqp-gles3
Mesa: User error: GL_INVALID_VALUE in glDeleteShader
free(): double free detected in tcache 2
(virglrenderer 08e11a49)