Mesa (master): st/mesa: don't load state parameters if there are none
Marek Olšák
mareko at kemper.freedesktop.org
Fri Oct 23 22:03:23 UTC 2015
Module: Mesa
Branch: master
Commit: dd05824b8968c723fba767698b496691e8dc81e3
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=dd05824b8968c723fba767698b496691e8dc81e3
Author: Marek Olšák <marek.olsak at amd.com>
Date: Thu Oct 22 19:46:07 2015 +0200
st/mesa: don't load state parameters if there are none
Out of 7063 shaders from my shader-db:
- 6564 (93%) shaders don't have any state parameters.
- 347 (5%) shaders have 1 state parameter for WPOS lowering.
- The remaining 2% have more state parameters, usually matrices.
Reviewed-by: Brian Paul <brianp at vmware.com>
---
src/mesa/state_tracker/st_atom_constbuf.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/mesa/state_tracker/st_atom_constbuf.c b/src/mesa/state_tracker/st_atom_constbuf.c
index acaa85d..20f8b3d 100644
--- a/src/mesa/state_tracker/st_atom_constbuf.c
+++ b/src/mesa/state_tracker/st_atom_constbuf.c
@@ -73,7 +73,8 @@ void st_upload_constants( struct st_context *st,
* the parameters list are explicitly set by the user with glUniform,
* glProgramParameter(), etc.
*/
- _mesa_load_state_parameters(st->ctx, params);
+ if (params->StateFlags)
+ _mesa_load_state_parameters(st->ctx, params);
/* We always need to get a new buffer, to keep the drivers simple and
* avoid gratuitous rendering synchronization.
More information about the mesa-commit
mailing list