mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-04-06 08:00:34 +02:00
st: Fix 64-bit vertex attrib index for TGSI path
Patch77c2b022a0removed lowering of 64-bit vertex attribs to 32bits. This has thrown TGSI translation off the guard for 64bit attrib. This lead to fail/crash of 1000+ piglit tests. This patch basically fixes 64 bit attrib index for TGSI shader by adding placeholder for second part of a double attribute. It fixes all regressed piglit tests. A big help from Charmaine to fix this regression Reviewed-by: Charmaine Lee <charmainel@vmware.com> Reviewed-by: Marek Olšák <marek.olsak@amd.com> Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu> Fixes:77c2b022a0("st/mesa: remove lowering of 64-bit vertex attribs to 32 bits") Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13363>
This commit is contained in:
parent
e65d6f45d2
commit
be6d584de4
1 changed files with 23 additions and 1 deletions
|
|
@ -6650,7 +6650,7 @@ st_translate_program(
|
|||
glsl_to_tgsi_visitor *program,
|
||||
const struct gl_program *proginfo,
|
||||
GLuint numInputs,
|
||||
const ubyte inputMapping[],
|
||||
const ubyte attrToIndex[],
|
||||
const ubyte inputSlotToAttr[],
|
||||
const ubyte inputSemanticName[],
|
||||
const ubyte inputSemanticIndex[],
|
||||
|
|
@ -6666,6 +6666,7 @@ st_translate_program(
|
|||
struct gl_program_constants *prog_const =
|
||||
&ctx->Const.Program[program->shader->Stage];
|
||||
enum pipe_error ret = PIPE_OK;
|
||||
uint8_t inputMapping[VARYING_SLOT_TESS_MAX] = {0};
|
||||
|
||||
assert(numInputs <= ARRAY_SIZE(t->inputs));
|
||||
assert(numOutputs <= ARRAY_SIZE(t->outputs));
|
||||
|
|
@ -6683,6 +6684,27 @@ st_translate_program(
|
|||
ASSERT_BITFIELD_SIZE(glsl_to_tgsi_instruction, op,
|
||||
(enum tgsi_opcode) (TGSI_OPCODE_LAST - 1));
|
||||
|
||||
if (proginfo->DualSlotInputs != 0) {
|
||||
/* adjust attrToIndex to include placeholder for second
|
||||
* part of a double attribute
|
||||
*/
|
||||
numInputs = 0;
|
||||
for (unsigned attr = 0; attr < VERT_ATTRIB_MAX; attr++) {
|
||||
if ((proginfo->info.inputs_read & BITFIELD64_BIT(attr)) != 0) {
|
||||
inputMapping[attr] = numInputs++;
|
||||
|
||||
if ((proginfo->DualSlotInputs & BITFIELD64_BIT(attr)) != 0) {
|
||||
/* add placeholder for second part of a double attribute */
|
||||
numInputs++;
|
||||
}
|
||||
}
|
||||
}
|
||||
inputMapping[VERT_ATTRIB_EDGEFLAG] = numInputs;
|
||||
}
|
||||
else {
|
||||
memcpy(inputMapping, attrToIndex, sizeof(inputMapping));
|
||||
}
|
||||
|
||||
t = CALLOC_STRUCT(st_translate);
|
||||
if (!t) {
|
||||
ret = PIPE_ERROR_OUT_OF_MEMORY;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue