svga: Always emit VGPU10_OPCODE_DCL_GLOBAL_FLAGS for VGPU10

The NOP that sometimes gets emitted when no flags are set was causing
problems with the TC shader declarations on the device side causing the
arb_tesselation_shader@execution@built-in-functions piglit test to fail.

We can always emit the declaration and leave the flags as zero if they
are not enabled rather than outputting the problematic NOP.

Signed-off-by: Ian Forbes <ian.forbes@broadcom.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39660>
This commit is contained in:
Ian Forbes 2026-02-02 14:11:19 -06:00 committed by Marge Bot
parent a3f022d0a2
commit 27474b2ce3
2 changed files with 16 additions and 161 deletions

View file

@ -1095,121 +1095,4 @@ spec@arb_texture_view@tex-view,Fail
spec@egl_chromium_sync_control@conformance,Fail
spec@egl_chromium_sync_control@conformance@eglGetSyncValuesCHROMIUM_msc_and_sbc_test,Fail
spec@ext_texture_integer@fbo-integer-attachments,Fail
spec@arb_tessellation_shader@execution@built-in-functions@tcs-all-bvec4,Fail
spec@arb_tessellation_shader@execution@built-in-functions@tcs-equal-bvec2-bvec2,Fail
spec@arb_tessellation_shader@execution@built-in-functions@tcs-equal-bvec3-bvec3,Fail
spec@arb_tessellation_shader@execution@built-in-functions@tcs-equal-uvec3-uvec3,Fail
spec@arb_tessellation_shader@execution@built-in-functions@tcs-equal-vec3-vec3,Fail
spec@arb_tessellation_shader@execution@built-in-functions@tcs-greaterthan-uvec2-uvec2,Fail
spec@arb_tessellation_shader@execution@built-in-functions@tcs-greaterthanequal-ivec2-ivec2,Fail
spec@arb_tessellation_shader@execution@built-in-functions@tcs-lessthan-uvec2-uvec2,Fail
spec@arb_tessellation_shader@execution@built-in-functions@tcs-lessthanequal-vec3-vec3,Fail
spec@arb_tessellation_shader@execution@built-in-functions@tcs-notequal-bvec2-bvec2,Fail
spec@arb_tessellation_shader@execution@built-in-functions@tcs-op-eq-bvec3-bvec3,Fail
spec@arb_tessellation_shader@execution@built-in-functions@tcs-op-eq-float-float,Fail
spec@arb_tessellation_shader@execution@built-in-functions@tcs-op-eq-mat2x3-mat2x3,Fail
spec@arb_tessellation_shader@execution@built-in-functions@tcs-op-eq-mat3x2-mat3x2,Fail
spec@arb_tessellation_shader@execution@built-in-functions@tcs-op-eq-uint-uint,Fail
spec@arb_tessellation_shader@execution@built-in-functions@tcs-op-eq-uvec3-uvec3,Fail
spec@arb_tessellation_shader@execution@built-in-functions@tcs-op-eq-uvec4-uvec4,Fail
spec@arb_tessellation_shader@execution@built-in-functions@tcs-op-eq-vec3-vec3,Fail
spec@arb_tessellation_shader@execution@built-in-functions@tcs-op-le-float-float,Fail
spec@arb_tessellation_shader@execution@built-in-functions@tcs-op-le-uint-uint,Fail
spec@arb_tessellation_shader@execution@built-in-functions@tcs-op-lt-float-float,Fail
spec@arb_tessellation_shader@execution@built-in-functions@tcs-op-ne-bvec2-bvec2,Fail
spec@arb_tessellation_shader@execution@built-in-functions@tcs-op-ne-bvec4-bvec4,Fail
spec@arb_tessellation_shader@execution@built-in-functions@tcs-op-ne-ivec3-ivec3,Fail
spec@arb_tessellation_shader@execution@built-in-functions@tcs-op-ne-mat3-mat3,Fail
spec@arb_tessellation_shader@execution@built-in-functions@tcs-op-ne-mat4-mat4,Fail
spec@arb_tessellation_shader@execution@built-in-functions@tcs-op-ne-mat4x3-mat4x3,Fail
spec@arb_tessellation_shader@execution@built-in-functions@tcs-op-selection-bool-bvec2-bvec2,Fail
spec@arb_tessellation_shader@execution@built-in-functions@tcs-any-bvec3,Fail
spec@arb_tessellation_shader@execution@built-in-functions@tcs-equal-uvec2-uvec2,Fail
spec@arb_tessellation_shader@execution@built-in-functions@tcs-greaterthanequal-uvec2-uvec2,Fail
spec@arb_tessellation_shader@execution@built-in-functions@tcs-greaterthanequal-uvec3-uvec3,Fail
spec@arb_tessellation_shader@execution@built-in-functions@tcs-lessthan-ivec3-ivec3,Fail
spec@arb_tessellation_shader@execution@built-in-functions@tcs-lessthanequal-ivec3-ivec3,Fail
spec@arb_tessellation_shader@execution@built-in-functions@tcs-not-bvec3,Fail
spec@arb_tessellation_shader@execution@built-in-functions@tcs-op-and-bool-bool,Fail
spec@arb_tessellation_shader@execution@built-in-functions@tcs-op-eq-bool-bool,Fail
spec@arb_tessellation_shader@execution@built-in-functions@tcs-op-eq-bvec2-bvec2,Fail
spec@arb_tessellation_shader@execution@built-in-functions@tcs-op-eq-mat2x4-mat2x4,Fail
spec@arb_tessellation_shader@execution@built-in-functions@tcs-op-eq-mat3x4-mat3x4,Fail
spec@arb_tessellation_shader@execution@built-in-functions@tcs-op-eq-mat4-mat4,Fail
spec@arb_tessellation_shader@execution@built-in-functions@tcs-op-eq-uvec2-uvec2,Fail
spec@arb_tessellation_shader@execution@built-in-functions@tcs-op-gt-float-float,Fail
spec@arb_tessellation_shader@execution@built-in-functions@tcs-op-lt-uint-uint,Fail
spec@arb_tessellation_shader@execution@built-in-functions@tcs-op-ne-int-int,Fail
spec@arb_tessellation_shader@execution@built-in-functions@tcs-op-ne-ivec2-ivec2,Fail
spec@arb_tessellation_shader@execution@built-in-functions@tcs-op-ne-mat3x2-mat3x2,Fail
spec@arb_tessellation_shader@execution@built-in-functions@tcs-op-ne-mat4x2-mat4x2,Fail
spec@arb_tessellation_shader@execution@built-in-functions@tcs-op-ne-uvec3-uvec3,Fail
spec@arb_tessellation_shader@execution@built-in-functions@tcs-op-ne-uvec4-uvec4,Fail
spec@arb_tessellation_shader@execution@built-in-functions@tcs-op-ne-vec2-vec2,Fail
spec@arb_tessellation_shader@execution@built-in-functions@tcs-op-ne-vec3-vec3,Fail
spec@arb_tessellation_shader@execution@built-in-functions@tcs-op-selection-bool-bvec3-bvec3,Fail
spec@arb_tessellation_shader@execution@built-in-functions@tcs-all-bvec2,Fail
spec@arb_tessellation_shader@execution@built-in-functions@tcs-all-bvec3,Fail
spec@arb_tessellation_shader@execution@built-in-functions@tcs-any-bvec2,Fail
spec@arb_tessellation_shader@execution@built-in-functions@tcs-equal-ivec2-ivec2,Fail
spec@arb_tessellation_shader@execution@built-in-functions@tcs-equal-ivec3-ivec3,Fail
spec@arb_tessellation_shader@execution@built-in-functions@tcs-equal-vec2-vec2,Fail
spec@arb_tessellation_shader@execution@built-in-functions@tcs-greaterthan-ivec2-ivec2,Fail
spec@arb_tessellation_shader@execution@built-in-functions@tcs-greaterthan-uvec3-uvec3,Fail
spec@arb_tessellation_shader@execution@built-in-functions@tcs-greaterthan-vec3-vec3,Fail
spec@arb_tessellation_shader@execution@built-in-functions@tcs-greaterthanequal-ivec3-ivec3,Fail
spec@arb_tessellation_shader@execution@built-in-functions@tcs-greaterthanequal-vec3-vec3,Fail
spec@arb_tessellation_shader@execution@built-in-functions@tcs-lessthan-ivec2-ivec2,Fail
spec@arb_tessellation_shader@execution@built-in-functions@tcs-lessthan-vec2-vec2,Fail
spec@arb_tessellation_shader@execution@built-in-functions@tcs-lessthan-vec3-vec3,Fail
spec@arb_tessellation_shader@execution@built-in-functions@tcs-lessthanequal-uvec2-uvec2,Fail
spec@arb_tessellation_shader@execution@built-in-functions@tcs-lessthanequal-vec2-vec2,Fail
spec@arb_tessellation_shader@execution@built-in-functions@tcs-notequal-bvec3-bvec3,Fail
spec@arb_tessellation_shader@execution@built-in-functions@tcs-notequal-ivec3-ivec3,Fail
spec@arb_tessellation_shader@execution@built-in-functions@tcs-notequal-vec2-vec2,Fail
spec@arb_tessellation_shader@execution@built-in-functions@tcs-notequal-vec3-vec3,Fail
spec@arb_tessellation_shader@execution@built-in-functions@tcs-op-eq-bvec4-bvec4,Fail
spec@arb_tessellation_shader@execution@built-in-functions@tcs-op-eq-int-int,Fail
spec@arb_tessellation_shader@execution@built-in-functions@tcs-op-eq-mat2-mat2,Fail
spec@arb_tessellation_shader@execution@built-in-functions@tcs-op-eq-mat4x3-mat4x3,Fail
spec@arb_tessellation_shader@execution@built-in-functions@tcs-op-eq-vec4-vec4,Fail
spec@arb_tessellation_shader@execution@built-in-functions@tcs-op-gt-uint-uint,Fail
spec@arb_tessellation_shader@execution@built-in-functions@tcs-op-lt-int-int,Fail
spec@arb_tessellation_shader@execution@built-in-functions@tcs-op-ne-bool-bool,Fail
spec@arb_tessellation_shader@execution@built-in-functions@tcs-op-ne-bvec3-bvec3,Fail
spec@arb_tessellation_shader@execution@built-in-functions@tcs-op-ne-float-float,Fail
spec@arb_tessellation_shader@execution@built-in-functions@tcs-op-ne-mat2x3-mat2x3,Fail
spec@arb_tessellation_shader@execution@built-in-functions@tcs-op-ne-mat2x4-mat2x4,Fail
spec@arb_tessellation_shader@execution@built-in-functions@tcs-op-ne-uint-uint,Fail
spec@arb_tessellation_shader@execution@built-in-functions@tcs-op-ne-vec4-vec4,Fail
spec@arb_tessellation_shader@execution@built-in-functions@tcs-op-or-bool-bool,Fail
spec@arb_tessellation_shader@execution@built-in-functions@tcs-op-selection-bool-bool-bool,Fail
spec@arb_tessellation_shader@execution@built-in-functions@tcs-op-xor-bool-bool,Fail
spec@ext_image_dma_buf_import@ext_image_dma_buf_import-tex-modifier,Fail
spec@arb_tessellation_shader@execution@built-in-functions@tcs-any-bvec4,Fail
spec@arb_tessellation_shader@execution@built-in-functions@tcs-greaterthan-ivec3-ivec3,Fail
spec@arb_tessellation_shader@execution@built-in-functions@tcs-greaterthan-vec2-vec2,Fail
spec@arb_tessellation_shader@execution@built-in-functions@tcs-greaterthanequal-vec2-vec2,Fail
spec@arb_tessellation_shader@execution@built-in-functions@tcs-lessthan-uvec3-uvec3,Fail
spec@arb_tessellation_shader@execution@built-in-functions@tcs-lessthanequal-ivec2-ivec2,Fail
spec@arb_tessellation_shader@execution@built-in-functions@tcs-lessthanequal-uvec3-uvec3,Fail
spec@arb_tessellation_shader@execution@built-in-functions@tcs-not-bvec2,Fail
spec@arb_tessellation_shader@execution@built-in-functions@tcs-notequal-ivec2-ivec2,Fail
spec@arb_tessellation_shader@execution@built-in-functions@tcs-notequal-uvec2-uvec2,Fail
spec@arb_tessellation_shader@execution@built-in-functions@tcs-notequal-uvec3-uvec3,Fail
spec@arb_tessellation_shader@execution@built-in-functions@tcs-op-eq-ivec2-ivec2,Fail
spec@arb_tessellation_shader@execution@built-in-functions@tcs-op-eq-ivec3-ivec3,Fail
spec@arb_tessellation_shader@execution@built-in-functions@tcs-op-eq-ivec4-ivec4,Fail
spec@arb_tessellation_shader@execution@built-in-functions@tcs-op-eq-mat3-mat3,Fail
spec@arb_tessellation_shader@execution@built-in-functions@tcs-op-eq-mat4x2-mat4x2,Fail
spec@arb_tessellation_shader@execution@built-in-functions@tcs-op-eq-vec2-vec2,Fail
spec@arb_tessellation_shader@execution@built-in-functions@tcs-op-ge-float-float,Fail
spec@arb_tessellation_shader@execution@built-in-functions@tcs-op-ge-int-int,Fail
spec@arb_tessellation_shader@execution@built-in-functions@tcs-op-ge-uint-uint,Fail
spec@arb_tessellation_shader@execution@built-in-functions@tcs-op-gt-int-int,Fail
spec@arb_tessellation_shader@execution@built-in-functions@tcs-op-le-int-int,Fail
spec@arb_tessellation_shader@execution@built-in-functions@tcs-op-ne-ivec4-ivec4,Fail
spec@arb_tessellation_shader@execution@built-in-functions@tcs-op-ne-mat2-mat2,Fail
spec@arb_tessellation_shader@execution@built-in-functions@tcs-op-ne-mat3x4-mat3x4,Fail
spec@arb_tessellation_shader@execution@built-in-functions@tcs-op-not-bool,Fail

View file

@ -444,8 +444,8 @@ struct svga_shader_emitter_v10
bool uses_flat_interp;
unsigned reserved_token; /* index to the reserved token */
bool uses_precise_qualifier;
unsigned reserved_token; /* index to the reserved token */
/* For all shaders: const reg index for RECT coord scaling */
unsigned texcoord_scale_index[PIPE_MAX_SAMPLERS];
@ -12641,6 +12641,7 @@ done:
static bool
emit_vgpu10_header(struct svga_shader_emitter_v10 *emit)
{
VGPU10OpcodeToken0 token;
VGPU10ProgramToken ptoken;
/* First token: VGPU10ProgramToken (version info, program type (VS,GS,PS)) */
@ -12662,7 +12663,6 @@ emit_vgpu10_header(struct svga_shader_emitter_v10 *emit)
return false;
if (emit->version >= 50) {
VGPU10OpcodeToken0 token;
if (emit->unit == MESA_SHADER_TESS_CTRL) {
/* For hull shader, we need to start the declarations phase first before
@ -12674,33 +12674,18 @@ emit_vgpu10_header(struct svga_shader_emitter_v10 *emit)
emit_dword(emit, token.value);
end_emit_instruction(emit);
}
/* Emit global flags */
token.value = 0; /* init whole token to zero */
token.opcodeType = VGPU10_OPCODE_DCL_GLOBAL_FLAGS;
token.enableDoublePrecisionFloatOps = 1; /* set bit */
token.instructionLength = 1;
if (!emit_dword(emit, token.value))
return false;
}
if (emit->version >= 40) {
VGPU10OpcodeToken0 token;
/* Reserve token for global flags such as refactoringAllowed that we
* determine as we scan through the shader. Fixed up in emit_vgpu10_tail.
*/
emit->reserved_token = (emit->ptr - emit->buf) / sizeof(VGPU10OpcodeToken0);
/* Reserved for global flag such as refactoringAllowed.
* If the shader does not use the precise qualifier, we will set the
* refactoringAllowed global flag; otherwise, we will leave the reserved
* token to NOP.
*/
emit->reserved_token = (emit->ptr - emit->buf) / sizeof(VGPU10OpcodeToken0);
token.value = 0;
token.opcodeType = VGPU10_OPCODE_NOP;
token.instructionLength = 1;
if (!emit_dword(emit, token.value))
return false;
}
return true;
token.value = 0;
token.opcodeType = VGPU10_OPCODE_DCL_GLOBAL_FLAGS;
token.instructionLength = 1;
token.enableDoublePrecisionFloatOps = (version >= 50);
return emit_dword(emit, token.value);
}
@ -12713,24 +12698,11 @@ emit_vgpu10_tail(struct svga_shader_emitter_v10 *emit)
tokens = (VGPU10ProgramToken *) emit->buf;
tokens[1].value = emit_get_num_tokens(emit);
if (emit->version >= 40 && !emit->uses_precise_qualifier) {
/* Replace the reserved token with the RefactoringAllowed global flag */
VGPU10OpcodeToken0 *ptoken;
ptoken = (VGPU10OpcodeToken0 *)&tokens[emit->reserved_token];
assert(ptoken->opcodeType == VGPU10_OPCODE_NOP);
ptoken->opcodeType = VGPU10_OPCODE_DCL_GLOBAL_FLAGS;
ptoken->refactoringAllowed = 1;
}
if (emit->version >= 50 && emit->fs.forceEarlyDepthStencil) {
/* Replace the reserved token with the forceEarlyDepthStencil global flag */
VGPU10OpcodeToken0 *ptoken;
ptoken = (VGPU10OpcodeToken0 *)&tokens[emit->reserved_token];
ptoken->opcodeType = VGPU10_OPCODE_DCL_GLOBAL_FLAGS;
ptoken->forceEarlyDepthStencil = 1;
}
/* Fixup global decls flags token with the RefactoringAllowed global flag */
VGPU10OpcodeToken0 *ptoken;
ptoken = (VGPU10OpcodeToken0 *)&tokens[emit->reserved_token];
ptoken->refactoringAllowed = !emit->uses_precise_qualifier;
ptoken->forceEarlyDepthStencil = (emit->version >= 50 && emit->fs.forceEarlyDepthStencil);
return true;
}