summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri/i965/brw_vs.c
diff options
context:
space:
mode:
authorPaul Berry <[email protected]>2013-10-23 10:17:30 -0700
committerPaul Berry <[email protected]>2013-10-24 22:00:25 -0700
commite0f34301b29ecf3fb7118b2e05872510c104a49b (patch)
tree04ced98b32c68e17662497aeef21421369c9f48f /src/mesa/drivers/dri/i965/brw_vs.c
parent068df64ba6a8309427612836e5eb384721ca6d40 (diff)
i965/vec4: Extract function to set up vec4 prog key for precompiling.
This will allow us to re-use it for precompiling geometry shaders. Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Matt Turner <[email protected]>
Diffstat (limited to 'src/mesa/drivers/dri/i965/brw_vs.c')
-rw-r--r--src/mesa/drivers/dri/i965/brw_vs.c15
1 files changed, 1 insertions, 14 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_vs.c b/src/mesa/drivers/dri/i965/brw_vs.c
index 407d3976adf..b5c8b6300d3 100644
--- a/src/mesa/drivers/dri/i965/brw_vs.c
+++ b/src/mesa/drivers/dri/i965/brw_vs.c
@@ -534,20 +534,7 @@ brw_vs_precompile(struct gl_context *ctx, struct gl_shader_program *prog)
memset(&key, 0, sizeof(key));
- key.base.program_string_id = bvp->id;
- key.base.clamp_vertex_color = ctx->API == API_OPENGL_COMPAT;
-
- unsigned sampler_count = _mesa_fls(vp->Base.SamplersUsed);
- for (unsigned i = 0; i < sampler_count; i++) {
- if (vp->Base.ShadowSamplers & (1 << i)) {
- /* Assume DEPTH_TEXTURE_MODE is the default: X, X, X, 1 */
- key.base.tex.swizzles[i] =
- MAKE_SWIZZLE4(SWIZZLE_X, SWIZZLE_X, SWIZZLE_X, SWIZZLE_ONE);
- } else {
- /* Color sampler: assume no swizzling. */
- key.base.tex.swizzles[i] = SWIZZLE_XYZW;
- }
- }
+ brw_vec4_setup_prog_key_for_precompile(ctx, &key.base, bvp->id, &vp->Base);
success = do_vs_prog(brw, prog, bvp, &key);