diff options
author | Kenneth Graunke <[email protected]> | 2018-12-03 22:26:47 -0800 |
---|---|---|
committer | Kenneth Graunke <[email protected]> | 2018-12-21 15:29:25 -0800 |
commit | ed1a356c5e21a8d19287fea2512d3b3a82171e9f (patch) | |
tree | 9cdc82a30096c0e474503b20401b07d99b5d3e14 /src/mesa/state_tracker/st_context.h | |
parent | 42d31e0516d64bca45a45f73e6a2f7f40e6daa4b (diff) |
st/mesa: Drop !passColor optimization in drawpixels shaders.
The glDrawPixels passthrough vertex shader copies position and texcoord
vertex attributes to varying outputs. It also optionally copies a third
gl_Color attribute, which sometimes is unnecessary. Until now, we've
compiled separate variants of the shader, one of which does this extra
copy, and the other of which doesn't. We have done this since 2007.
But, the vertex shader runs for a whopping four vertices, and so the
cost of a copying a single input to output is likely inconsequential.
In theory, we could bind one fewer vertex element - but we always bind
all three regardless. So, we don't even get that savings.
This patch unifies the two, so we always copy the optional color,
and save having to compile the variant. It also makes the VS input
interface match up with the vertex element state without any dead
(unused) input attributes.
Reviewed-by: Marek Olšák <[email protected]>
Diffstat (limited to 'src/mesa/state_tracker/st_context.h')
-rw-r--r-- | src/mesa/state_tracker/st_context.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/mesa/state_tracker/st_context.h b/src/mesa/state_tracker/st_context.h index 78e962dec00..622b7a40dc4 100644 --- a/src/mesa/state_tracker/st_context.h +++ b/src/mesa/state_tracker/st_context.h @@ -231,7 +231,7 @@ struct st_context /** for glDraw/CopyPixels */ struct { void *zs_shaders[4]; - void *vert_shaders[2]; /**< ureg shaders */ + void *vert_shader; /**< ureg shader */ } drawpix; /** Cache of glDrawPixels images */ |