aboutsummaryrefslogtreecommitdiff
path: root/src/mesa/tnl/t_vtx_api.c
diff options
context:
space:
mode:
authorRadosław Kujawa <radoslaw.kujawa@c0ff33.net>2026-08-02 22:04:06 +0200
committerRadosław Kujawa <radoslaw.kujawa@c0ff33.net>2026-08-02 22:04:32 +0200
commit56e89c9e4fb00b5c2af4536d4c50294608d0c46c (patch)
treeb247c62b317ce11e8c26e5b311a16cfae2f7d9c9 /src/mesa/tnl/t_vtx_api.c
parentafc74a01283fad7dfbbd670a535e68d90de7ed9a (diff)
Performance improvements, support userspace simulatorsHEADmaster
Diffstat (limited to 'src/mesa/tnl/t_vtx_api.c')
-rw-r--r--src/mesa/tnl/t_vtx_api.c33
1 files changed, 29 insertions, 4 deletions
diff --git a/src/mesa/tnl/t_vtx_api.c b/src/mesa/tnl/t_vtx_api.c
index 56b1e9f..f2e7857 100644
--- a/src/mesa/tnl/t_vtx_api.c
+++ b/src/mesa/tnl/t_vtx_api.c
@@ -312,14 +312,20 @@ static void _tnl_wrap_upgrade_vertex( GLcontext *ctx,
* codegen. Might be a reasonable place to try & detect attributes
* in the vertex which aren't being submitted any more.
*/
- for (i = 0 ; i < _TNL_ATTRIB_MAX ; i++)
+ for (i = 0 ; i < _TNL_ATTRIB_MAX ; i++) {
+ /* Force the generic entrypoints through _tnl_choose_attr() again
+ * so shrunken attributes get their identity components refilled
+ * (mirrors the tabfv reset below).
+ */
+ tnl->vtx.active_sz[i] = 0;
+
if (tnl->vtx.attrsz[i]) {
GLuint j = tnl->vtx.attrsz[i] - 1;
if (i < _TNL_MAX_ATTR_CODEGEN)
tnl->vtx.tabfv[i][j] = choose[i][j];
}
-
+ }
}
@@ -440,6 +446,22 @@ static tnl_attrfv_func do_choose( GLuint attr, GLuint sz )
+/* Helper for the single-dispatch generic entrypoints
+ */
+void _tnl_choose_attr( GLcontext *ctx, GLuint attr, GLuint sz )
+{
+ TNLcontext *tnl = TNL_CONTEXT(ctx);
+
+ assert(attr < _TNL_ATTRIB_MAX);
+ assert(sz >= 1 && sz <= 4);
+
+ if (tnl->vtx.attrsz[attr] != sz)
+ _tnl_fixup_vertex( ctx, attr, sz );
+
+ tnl->vtx.active_sz[attr] = (GLubyte) sz;
+}
+
+
#define CHOOSE( ATTR, N ) \
static void choose_##ATTR##_##N( const GLfloat *v ) \
{ \
@@ -487,10 +509,12 @@ static void error_attrib( const GLfloat *unused )
static void reset_attrfv( TNLcontext *tnl )
-{
+{
GLuint i;
- for (i = 0 ; i < _TNL_ATTRIB_MAX ; i++)
+ for (i = 0 ; i < _TNL_ATTRIB_MAX ; i++) {
+ tnl->vtx.active_sz[i] = 0;
+
if (tnl->vtx.attrsz[i]) {
GLint j = tnl->vtx.attrsz[i] - 1;
tnl->vtx.attrsz[i] = 0;
@@ -502,6 +526,7 @@ static void reset_attrfv( TNLcontext *tnl )
}
}
}
+ }
tnl->vtx.vertex_size = 0;
tnl->vtx.have_materials = 0;