projects
/
mesa.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
1cdc232
)
st/mesa: small optimization in swizzle_swizzle()
author
Brian Paul
<brianp@vmware.com>
Thu, 22 Sep 2016 22:10:02 +0000
(16:10 -0600)
committer
Brian Paul
<brianp@vmware.com>
Sat, 24 Sep 2016 01:54:42 +0000
(19:54 -0600)
Usually, there's no user-specified texture swizzle so we can optimize
the swizzle_swizzle() function and skip the loop/switch.
Reviewed-by: Charmaine Lee <charmainel@vmware.com>
src/mesa/state_tracker/st_atom_texture.c
patch
|
blob
|
history
diff --git
a/src/mesa/state_tracker/st_atom_texture.c
b/src/mesa/state_tracker/st_atom_texture.c
index a6135333b3e72fe8ea42f1a5897517769f1bb56b..19df6622ef115109abbda29a7c1b0a5739b4faa9 100644
(file)
--- a/
src/mesa/state_tracker/st_atom_texture.c
+++ b/
src/mesa/state_tracker/st_atom_texture.c
@@
-59,6
+59,11
@@
swizzle_swizzle(unsigned swizzle1, unsigned swizzle2)
{
unsigned i, swz[4];
+ if (swizzle1 == SWIZZLE_XYZW) {
+ /* identity swizzle, no change to swizzle2 */
+ return swizzle2;
+ }
+
for (i = 0; i < 4; i++) {
unsigned s = GET_SWZ(swizzle1, i);
switch (s) {