mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-02-24 16:00:29 +01:00
vbo: fix current attribs not updating gallium vertex elements
An initial workaround that helped discover this was written by:
Illia Polishchuk illia.a.polishchuk@globallogic.com
Closes: #8440
Fixes: a18b9d07 ("st/mesa: optimize uploading zero-stride vertex attribs")
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21805>
This commit is contained in:
parent
e6f9444567
commit
3bc374ca93
2 changed files with 10 additions and 1 deletions
|
|
@ -230,6 +230,11 @@ vbo_exec_copy_to_current(struct vbo_exec_context *exec)
|
|||
vbo_set_vertex_format(&vbo->current[i].Format,
|
||||
exec->vtx.attr[i].size >> dmul_shift,
|
||||
exec->vtx.attr[i].type);
|
||||
/* The format changed. We need to update gallium vertex elements.
|
||||
* Material attributes don't need this because they don't have formats.
|
||||
*/
|
||||
if (i <= VBO_ATTRIB_EDGEFLAG)
|
||||
ctx->NewState |= _NEW_CURRENT_ATTRIB;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -86,8 +86,12 @@ copy_vao(struct gl_context *ctx, const struct gl_vertex_array_object *vao,
|
|||
}
|
||||
|
||||
if (type != currval->Format.User.Type ||
|
||||
(size >> dmul_shift) != currval->Format.User.Size)
|
||||
(size >> dmul_shift) != currval->Format.User.Size) {
|
||||
vbo_set_vertex_format(&currval->Format, size >> dmul_shift, type);
|
||||
/* The format changed. We need to update gallium vertex elements. */
|
||||
if (state == _NEW_CURRENT_ATTRIB)
|
||||
ctx->NewState |= state;
|
||||
}
|
||||
|
||||
*data += size;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue