i965: Use brw.vue_map_geom_out instead of VS output VUE map where appropriate.

This patch modifies post-GS pipeline stages (transform feedback, clip,
sf, fs) to refer to the VUE map through brw->vue_map_geom_out rather
than brw->vs.prog_data->vue_map.  This ensures that when geometry
shader support is added, these pipeline stages will consult the
geometry shader output VUE map when appropriate, rather than the
vertex shader output VUE map.

v2: Fixed some stale "CACHE_NEW_VS_PROG" comments.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
This commit is contained in:
Paul Berry
2013-03-17 11:29:28 -07:00
parent 463ef47b16
commit bf9bfe838e
7 changed files with 29 additions and 31 deletions
+4 -5
View File
@@ -69,7 +69,7 @@ static void compile_clip_prog( struct brw_context *brw,
c.func.single_program_flow = 1;
c.key = *key;
c.vue_map = brw->vs.prog_data->vue_map;
c.vue_map = brw->vue_map_geom_out;
/* nr_regs is the number of registers filled by reading data from the VUE.
* This program accesses the entire VUE, so nr_regs needs to be the size of
@@ -145,8 +145,8 @@ brw_upload_clip_prog(struct brw_context *brw)
*/
/* BRW_NEW_REDUCED_PRIMITIVE */
key.primitive = brw->intel.reduced_primitive;
/* CACHE_NEW_VS_PROG (also part of VUE map) */
key.attrs = brw->vs.prog_data->vue_map.slots_valid;
/* BRW_NEW_VUE_MAP_GEOM_OUT */
key.attrs = brw->vue_map_geom_out.slots_valid;
/* _NEW_LIGHT */
key.do_flat_shading = (ctx->Light.ShadeModel == GL_FLAT);
key.pv_first = (ctx->Light.ProvokingVertex == GL_FIRST_VERTEX_CONVENTION);
@@ -258,8 +258,7 @@ const struct brw_tracked_state brw_clip_prog = {
_NEW_TRANSFORM |
_NEW_POLYGON |
_NEW_BUFFERS),
.brw = (BRW_NEW_REDUCED_PRIMITIVE),
.cache = CACHE_NEW_VS_PROG
.brw = (BRW_NEW_REDUCED_PRIMITIVE | BRW_NEW_VUE_MAP_GEOM_OUT)
},
.emit = brw_upload_clip_prog
};
+4 -5
View File
@@ -65,7 +65,7 @@ static void compile_sf_prog( struct brw_context *brw,
brw_init_compile(brw, &c.func, mem_ctx);
c.key = *key;
c.vue_map = brw->vs.prog_data->vue_map;
c.vue_map = brw->vue_map_geom_out;
if (c.key.do_point_coord) {
/*
* gl_PointCoord is a FS instead of VS builtin variable, thus it's
@@ -144,8 +144,8 @@ brw_upload_sf_prog(struct brw_context *brw)
/* Populate the key, noting state dependencies:
*/
/* CACHE_NEW_VS_PROG */
key.attrs = brw->vs.prog_data->vue_map.slots_valid;
/* BRW_NEW_VUE_MAP_GEOM_OUT */
key.attrs = brw->vue_map_geom_out.slots_valid;
/* BRW_NEW_REDUCED_PRIMITIVE */
switch (brw->intel.reduced_primitive) {
@@ -216,8 +216,7 @@ const struct brw_tracked_state brw_sf_prog = {
.dirty = {
.mesa = (_NEW_HINT | _NEW_LIGHT | _NEW_POLYGON | _NEW_POINT |
_NEW_TRANSFORM | _NEW_BUFFERS | _NEW_PROGRAM),
.brw = (BRW_NEW_REDUCED_PRIMITIVE),
.cache = CACHE_NEW_VS_PROG
.brw = (BRW_NEW_REDUCED_PRIMITIVE | BRW_NEW_VUE_MAP_GEOM_OUT)
},
.emit = brw_upload_sf_prog
};
+1 -1
View File
@@ -227,7 +227,7 @@ void upload_default_color(struct brw_context *brw,
/* gen6_sf_state.c */
uint32_t
get_attr_override(struct brw_vue_map *vue_map, int urb_entry_read_offset,
get_attr_override(const struct brw_vue_map *vue_map, int urb_entry_read_offset,
int fs_attr, bool two_side_color, uint32_t *max_source_attr);
#ifdef __cplusplus
+4 -4
View File
@@ -479,9 +479,9 @@ static void brw_wm_populate_key( struct brw_context *brw,
/* _NEW_MULTISAMPLE */
key->sample_alpha_to_coverage = ctx->Multisample.SampleAlphaToCoverage;
/* CACHE_NEW_VS_PROG */
/* BRW_NEW_VUE_MAP_GEOM_OUT */
if (intel->gen < 6)
key->vp_outputs_written = brw->vs.prog_data->vue_map.slots_valid;
key->vp_outputs_written = brw->vue_map_geom_out.slots_valid;
/* The unique fragment program ID */
key->program_string_id = fp->id;
@@ -524,8 +524,8 @@ const struct brw_tracked_state brw_wm_prog = {
_NEW_MULTISAMPLE),
.brw = (BRW_NEW_FRAGMENT_PROGRAM |
BRW_NEW_WM_INPUT_DIMENSIONS |
BRW_NEW_REDUCED_PRIMITIVE),
.cache = CACHE_NEW_VS_PROG,
BRW_NEW_REDUCED_PRIMITIVE |
BRW_NEW_VUE_MAP_GEOM_OUT)
},
.emit = brw_upload_wm_prog
};
+5 -5
View File
@@ -53,7 +53,7 @@
* 256-bit increments.
*/
uint32_t
get_attr_override(struct brw_vue_map *vue_map, int urb_entry_read_offset,
get_attr_override(const struct brw_vue_map *vue_map, int urb_entry_read_offset,
int fs_attr, bool two_side_color, uint32_t *max_source_attr)
{
if (fs_attr == VARYING_SLOT_POS) {
@@ -312,9 +312,9 @@ upload_sf_state(struct brw_context *brw)
*/
assert(input_index < 16 || attr == input_index);
/* CACHE_NEW_VS_PROG | _NEW_LIGHT | _NEW_PROGRAM */
/* BRW_NEW_VUE_MAP_GEOM_OUT | _NEW_LIGHT | _NEW_PROGRAM */
attr_overrides[input_index++] =
get_attr_override(&brw->vs.prog_data->vue_map,
get_attr_override(&brw->vue_map_geom_out,
urb_entry_read_offset, attr,
ctx->VertexProgram._TwoSideEnabled,
&max_source_attr);
@@ -370,8 +370,8 @@ const struct brw_tracked_state gen6_sf_state = {
_NEW_POINT |
_NEW_MULTISAMPLE),
.brw = (BRW_NEW_CONTEXT |
BRW_NEW_FRAGMENT_PROGRAM),
.cache = CACHE_NEW_VS_PROG
BRW_NEW_FRAGMENT_PROGRAM |
BRW_NEW_VUE_MAP_GEOM_OUT)
},
.emit = upload_sf_state,
};
+4 -4
View File
@@ -100,9 +100,9 @@ upload_sbe_state(struct brw_context *brw)
*/
assert(input_index < 16 || attr == input_index);
/* CACHE_NEW_VS_PROG | _NEW_LIGHT | _NEW_PROGRAM */
/* BRW_NEW_VUE_MAP_GEOM_OUT | _NEW_LIGHT | _NEW_PROGRAM */
attr_overrides[input_index++] =
get_attr_override(&brw->vs.prog_data->vue_map,
get_attr_override(&brw->vue_map_geom_out,
urb_entry_read_offset, attr,
ctx->VertexProgram._TwoSideEnabled,
&max_source_attr);
@@ -149,8 +149,8 @@ const struct brw_tracked_state gen7_sbe_state = {
_NEW_POINT |
_NEW_PROGRAM),
.brw = (BRW_NEW_CONTEXT |
BRW_NEW_FRAGMENT_PROGRAM),
.cache = CACHE_NEW_VS_PROG
BRW_NEW_FRAGMENT_PROGRAM |
BRW_NEW_VUE_MAP_GEOM_OUT)
},
.emit = upload_sbe_state,
};
+7 -7
View File
@@ -107,7 +107,7 @@ upload_3dstate_so_buffers(struct brw_context *brw)
*/
static void
upload_3dstate_so_decl_list(struct brw_context *brw,
struct brw_vue_map *vue_map)
const struct brw_vue_map *vue_map)
{
struct intel_context *intel = &brw->intel;
struct gl_context *ctx = &intel->ctx;
@@ -183,7 +183,7 @@ upload_3dstate_so_decl_list(struct brw_context *brw,
static void
upload_3dstate_streamout(struct brw_context *brw, bool active,
struct brw_vue_map *vue_map)
const struct brw_vue_map *vue_map)
{
struct intel_context *intel = &brw->intel;
struct gl_context *ctx = &intel->ctx;
@@ -241,8 +241,8 @@ upload_sol_state(struct brw_context *brw)
if (active) {
upload_3dstate_so_buffers(brw);
/* CACHE_NEW_VS_PROG */
upload_3dstate_so_decl_list(brw, &brw->vs.prog_data->vue_map);
/* BRW_NEW_VUE_MAP_GEOM_OUT */
upload_3dstate_so_decl_list(brw, &brw->vue_map_geom_out);
intel->batch.needs_sol_reset = true;
}
@@ -252,7 +252,7 @@ upload_sol_state(struct brw_context *brw)
* MMIO register updates (current performed by the kernel at each batch
* emit).
*/
upload_3dstate_streamout(brw, active, &brw->vs.prog_data->vue_map);
upload_3dstate_streamout(brw, active, &brw->vue_map_geom_out);
}
const struct brw_tracked_state gen7_sol_state = {
@@ -261,8 +261,8 @@ const struct brw_tracked_state gen7_sol_state = {
_NEW_LIGHT |
_NEW_TRANSFORM_FEEDBACK),
.brw = (BRW_NEW_BATCH |
BRW_NEW_VERTEX_PROGRAM),
.cache = CACHE_NEW_VS_PROG,
BRW_NEW_VERTEX_PROGRAM |
BRW_NEW_VUE_MAP_GEOM_OUT)
},
.emit = upload_sol_state,
};