mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-19 06:40:32 +01:00
do full swizzled matching in _mesa_lookup_parameter_constant()
This commit is contained in:
parent
bd9615bbc5
commit
5e6908944b
1 changed files with 16 additions and 5 deletions
|
|
@ -493,17 +493,28 @@ _mesa_lookup_parameter_constant(const struct gl_program_parameter_list *list,
|
|||
}
|
||||
}
|
||||
}
|
||||
else if (list->Parameters[i].Size >= vSize) {
|
||||
/* see if we can match this constant */
|
||||
GLuint match = 0, j;
|
||||
else if (vSize <= list->Parameters[i].Size) {
|
||||
/* see if we can match this constant (with a swizzle) */
|
||||
GLuint swz[4];
|
||||
GLuint match = 0, j, k;
|
||||
for (j = 0; j < vSize; j++) {
|
||||
if (list->ParameterValues[i][j] == v[j]) {
|
||||
if (v[j] == list->ParameterValues[i][j]) {
|
||||
swz[j] = j;
|
||||
match++;
|
||||
}
|
||||
else {
|
||||
for (k = 0; k < list->Parameters[i].Size; k++) {
|
||||
if (v[j] == list->ParameterValues[i][k]) {
|
||||
swz[j] = k;
|
||||
match++;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (match == vSize) {
|
||||
*posOut = i;
|
||||
*swizzleOut = SWIZZLE_NOOP;
|
||||
*swizzleOut = MAKE_SWIZZLE4(swz[0], swz[1], swz[2], swz[3]);
|
||||
return GL_TRUE;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue