mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 00:58:05 +02:00
i965/gs: Stop storing an input VUE map in the GS program key.
Now that the vertex shader output VUE map is determined solely by a 64-bit bitfield, we don't have to store it in its entirety in the geometry shader program key; instead, we can just store the bitfield, and let the geometry shader infer the VUE map at compile time. This dramatically reduces the size of the geometry shader program key, which we want to keep small since it gets recomputed whenever the active program changes. Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
This commit is contained in:
parent
d1ad447f01
commit
8a36f4382b
3 changed files with 8 additions and 5 deletions
|
|
@ -200,10 +200,12 @@ do_gs_prog(struct brw_context *brw,
|
|||
|
||||
c.prog_data.output_topology = prim_to_hw_prim[gp->program.OutputType];
|
||||
|
||||
brw_compute_vue_map(brw, &c.input_vue_map, c.key.input_varyings);
|
||||
|
||||
/* GS inputs are read from the VUE 256 bits (2 vec4's) at a time, so we
|
||||
* need to program a URB read length of ceiling(num_slots / 2).
|
||||
*/
|
||||
c.prog_data.base.urb_read_length = (c.key.input_vue_map.num_slots + 1) / 2;
|
||||
c.prog_data.base.urb_read_length = (c.input_vue_map.num_slots + 1) / 2;
|
||||
|
||||
void *mem_ctx = ralloc_context(NULL);
|
||||
unsigned program_size;
|
||||
|
|
@ -272,7 +274,7 @@ brw_upload_gs_prog(struct brw_context *brw)
|
|||
&key.base.tex);
|
||||
|
||||
/* BRW_NEW_VUE_MAP_VS */
|
||||
key.input_vue_map = brw->vue_map_vs;
|
||||
key.input_varyings = brw->vue_map_vs.slots_valid;
|
||||
|
||||
if (!brw_search_cache(&brw->cache, BRW_GS_PROG,
|
||||
&key, sizeof(key),
|
||||
|
|
|
|||
|
|
@ -70,8 +70,8 @@ vec4_gs_visitor::setup_varying_inputs(int payload_reg, int *attribute_map)
|
|||
assert(num_input_vertices <= MAX_GS_INPUT_VERTICES);
|
||||
unsigned input_array_stride = c->prog_data.base.urb_read_length * 2;
|
||||
|
||||
for (int slot = 0; slot < c->key.input_vue_map.num_slots; slot++) {
|
||||
int varying = c->key.input_vue_map.slot_to_varying[slot];
|
||||
for (int slot = 0; slot < c->input_vue_map.num_slots; slot++) {
|
||||
int varying = c->input_vue_map.slot_to_varying[slot];
|
||||
for (unsigned vertex = 0; vertex < num_input_vertices; vertex++) {
|
||||
attribute_map[BRW_VARYING_SLOT_COUNT * vertex + varying] =
|
||||
payload_reg + input_array_stride * vertex + slot;
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@ struct brw_gs_prog_key
|
|||
{
|
||||
struct brw_vec4_prog_key base;
|
||||
|
||||
struct brw_vue_map input_vue_map;
|
||||
GLbitfield64 input_varyings;
|
||||
};
|
||||
|
||||
|
||||
|
|
@ -49,6 +49,7 @@ struct brw_gs_compile
|
|||
struct brw_vec4_compile base;
|
||||
struct brw_gs_prog_key key;
|
||||
struct brw_gs_prog_data prog_data;
|
||||
struct brw_vue_map input_vue_map;
|
||||
|
||||
struct brw_geometry_program *gp;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue