summaryrefslogtreecommitdiff
path: root/src/gallium/drivers/i965/brw_vs.c
diff options
context:
space:
mode:
authorKeith Whitwell <keithw@vmware.com>2009-11-10 18:07:11 -0800
committerKeith Whitwell <keithw@vmware.com>2009-11-11 18:51:58 -0800
commit2f54d02d205468a840b35a3554f2ad8ffc31ec9c (patch)
treeac443da5e09a40acf67fa83905f6494e82685207 /src/gallium/drivers/i965/brw_vs.c
parent0c547d63c497f06c38f7a3c000e478bdcf2594b6 (diff)
i965g: consult fs inputs when laying out vs output regs
Vertex shader now emits just the FS inputs, in the positions and order expected by the fragment shader. This means potentially regenerating the vertex shader to match different fragment shader's input layouts.
Diffstat (limited to 'src/gallium/drivers/i965/brw_vs.c')
-rw-r--r--src/gallium/drivers/i965/brw_vs.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/gallium/drivers/i965/brw_vs.c b/src/gallium/drivers/i965/brw_vs.c
index 966940ceac..05a62ed974 100644
--- a/src/gallium/drivers/i965/brw_vs.c
+++ b/src/gallium/drivers/i965/brw_vs.c
@@ -90,22 +90,24 @@ static enum pipe_error brw_upload_vs_prog(struct brw_context *brw)
{
struct brw_vs_prog_key key;
struct brw_vertex_shader *vp = brw->curr.vertex_shader;
+ struct brw_fragment_shader *fs = brw->curr.fragment_shader;
enum pipe_error ret;
memset(&key, 0, sizeof(key));
- /* Just upload the program verbatim for now. Always send it all
- * the inputs it asks for, whether they are varying or not.
- */
key.program_string_id = vp->id;
key.nr_userclip = brw->curr.ucp.nr;
key.copy_edgeflag = (brw->curr.rast->templ.fill_ccw != PIPE_POLYGON_MODE_FILL ||
brw->curr.rast->templ.fill_cw != PIPE_POLYGON_MODE_FILL);
+ memcpy(&key.fs_signature, &fs->signature,
+ brw_fs_signature_size(&fs->signature));
+
+
/* Make an early check for the key.
*/
if (brw_search_cache(&brw->cache, BRW_VS_PROG,
- &key, sizeof(key),
+ &key, brw_vs_prog_key_size(&key),
NULL, 0,
&brw->vs.prog_data,
&brw->vs.prog_bo))
@@ -123,7 +125,9 @@ static enum pipe_error brw_upload_vs_prog(struct brw_context *brw)
*/
const struct brw_tracked_state brw_vs_prog = {
.dirty = {
- .mesa = PIPE_NEW_CLIP | PIPE_NEW_RAST,
+ .mesa = (PIPE_NEW_CLIP |
+ PIPE_NEW_RAST |
+ PIPE_NEW_FRAGMENT_SHADER),
.brw = BRW_NEW_VERTEX_PROGRAM,
.cache = 0
},