diff --git a/src/intel/compiler/brw_compile_vs.cpp b/src/intel/compiler/brw_compile_vs.cpp index be7e9456b74..0e3c20ed213 100644 --- a/src/intel/compiler/brw_compile_vs.cpp +++ b/src/intel/compiler/brw_compile_vs.cpp @@ -93,7 +93,6 @@ brw_compile_vs(const struct brw_compiler *compiler, nir->info.clip_distance_array_size; unsigned nr_attribute_slots = util_bitcount64(prog_data->inputs_read); - /* gl_VertexID and gl_InstanceID are system values, but arrive via an * incoming vertex attribute. So, add an extra slot. */ @@ -129,14 +128,15 @@ brw_compile_vs(const struct brw_compiler *compiler, prog_data->uses_drawid = true; prog_data->base.urb_read_length = DIV_ROUND_UP(nr_attribute_slots, 2); - prog_data->nr_attribute_slots = nr_attribute_slots; + unsigned nr_attribute_regs = 4 * nr_attribute_slots; /* Since vertex shaders reuse the same VUE entry for inputs and outputs * (overwriting the original contents), we need to make sure the size is * the larger of the two. */ const unsigned vue_entries = - MAX2(nr_attribute_slots, (unsigned)prog_data->base.vue_map.num_slots); + MAX2(DIV_ROUND_UP(nr_attribute_regs, 4), + (unsigned)prog_data->base.vue_map.num_slots); prog_data->base.urb_entry_size = DIV_ROUND_UP(vue_entries, 4); diff --git a/src/intel/compiler/brw_compiler.h b/src/intel/compiler/brw_compiler.h index 3908730b9b6..cd903b6f64e 100644 --- a/src/intel/compiler/brw_compiler.h +++ b/src/intel/compiler/brw_compiler.h @@ -1021,8 +1021,6 @@ struct brw_vs_prog_data { uint64_t inputs_read; uint64_t double_inputs_read; - unsigned nr_attribute_slots; - bool uses_vertexid; bool uses_instanceid; bool uses_is_indexed_draw;