summaryrefslogtreecommitdiff
path: root/src/mesa/drivers/dri/i965/gen6_gs_visitor.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/drivers/dri/i965/gen6_gs_visitor.cpp')
-rw-r--r--src/mesa/drivers/dri/i965/gen6_gs_visitor.cpp39
1 files changed, 16 insertions, 23 deletions
diff --git a/src/mesa/drivers/dri/i965/gen6_gs_visitor.cpp b/src/mesa/drivers/dri/i965/gen6_gs_visitor.cpp
index 31cdc96d186..2fef188c17e 100644
--- a/src/mesa/drivers/dri/i965/gen6_gs_visitor.cpp
+++ b/src/mesa/drivers/dri/i965/gen6_gs_visitor.cpp
@@ -95,7 +95,7 @@ gen6_gs_visitor::emit_prolog()
this->prim_count = src_reg(this, glsl_type::uint_type);
emit(MOV(dst_reg(this->prim_count), 0u));
- if (c->prog_data.gen6_xfb_enabled) {
+ if (gs_prog_data->gen6_xfb_enabled) {
/* Create a virtual register to hold destination indices in SOL */
this->destination_indices = src_reg(this, glsl_type::uvec4_type);
/* Create a virtual register to hold number of written primitives */
@@ -128,7 +128,7 @@ gen6_gs_visitor::emit_prolog()
* in the 3DSTATE_GS state packet. That information can be obtained by other
* means though, so we can safely use r1 for this purpose.
*/
- if (c->prog_data.include_primitive_id) {
+ if (gs_prog_data->include_primitive_id) {
this->primitive_id =
src_reg(retype(brw_vec8_grf(1, 0), BRW_REGISTER_TYPE_UD));
emit(GS_OPCODE_SET_PRIMITIVE_ID, dst_reg(this->primitive_id));
@@ -191,7 +191,7 @@ gen6_gs_visitor::gs_emit_vertex(int stream_id)
* vertex.
*/
emit(OR(dst, this->first_vertex,
- (c->prog_data.output_topology << URB_WRITE_PRIM_TYPE_SHIFT)));
+ (gs_prog_data->output_topology << URB_WRITE_PRIM_TYPE_SHIFT)));
emit(MOV(dst_reg(this->first_vertex), 0u));
}
emit(ADD(dst_reg(this->vertex_output_offset),
@@ -353,7 +353,7 @@ gen6_gs_visitor::emit_thread_end()
this->current_annotation = "gen6 thread end: ff_sync";
vec4_instruction *inst;
- if (c->prog_data.gen6_xfb_enabled) {
+ if (gs_prog_data->gen6_xfb_enabled) {
src_reg sol_temp(this, glsl_type::uvec4_type);
emit(GS_OPCODE_FF_SYNC_SET_PRIMITIVES,
dst_reg(this->svbi),
@@ -443,7 +443,7 @@ gen6_gs_visitor::emit_thread_end()
}
emit(BRW_OPCODE_WHILE);
- if (c->prog_data.gen6_xfb_enabled)
+ if (gs_prog_data->gen6_xfb_enabled)
xfb_write();
}
emit(BRW_OPCODE_ENDIF);
@@ -465,7 +465,7 @@ gen6_gs_visitor::emit_thread_end()
*/
this->current_annotation = "gen6 thread end: EOT";
- if (c->prog_data.gen6_xfb_enabled) {
+ if (gs_prog_data->gen6_xfb_enabled) {
/* When emitting EOT, set SONumPrimsWritten Increment Value. */
src_reg data(this, glsl_type::uint_type);
emit(AND(dst_reg(data), this->sol_prim_written, src_reg(0xffffu)));
@@ -507,7 +507,7 @@ gen6_gs_visitor::setup_payload()
* information (and move the original value to a virtual register if
* necessary).
*/
- if (c->prog_data.include_primitive_id)
+ if (gs_prog_data->include_primitive_id)
attribute_map[VARYING_SLOT_PRIMITIVE_ID] = attributes_per_reg * reg;
reg++;
@@ -530,9 +530,6 @@ gen6_gs_visitor::xfb_setup()
BRW_SWIZZLE4(3, 3, 3, 3)
};
- struct brw_gs_prog_data *prog_data =
- (struct brw_gs_prog_data *) &c->prog_data;
-
const struct gl_transform_feedback_info *linked_xfb_info =
&this->shader_prog->LinkedTransformFeedback;
int i;
@@ -548,11 +545,11 @@ gen6_gs_visitor::xfb_setup()
*/
assert(linked_xfb_info->NumOutputs <= BRW_MAX_SOL_BINDINGS);
- prog_data->num_transform_feedback_bindings = linked_xfb_info->NumOutputs;
- for (i = 0; i < prog_data->num_transform_feedback_bindings; i++) {
- prog_data->transform_feedback_bindings[i] =
+ gs_prog_data->num_transform_feedback_bindings = linked_xfb_info->NumOutputs;
+ for (i = 0; i < gs_prog_data->num_transform_feedback_bindings; i++) {
+ gs_prog_data->transform_feedback_bindings[i] =
linked_xfb_info->Outputs[i].OutputRegister;
- prog_data->transform_feedback_swizzles[i] =
+ gs_prog_data->transform_feedback_swizzles[i] =
swizzle_for_offset[linked_xfb_info->Outputs[i].ComponentOffset];
}
}
@@ -561,13 +558,11 @@ void
gen6_gs_visitor::xfb_write()
{
unsigned num_verts;
- struct brw_gs_prog_data *prog_data =
- (struct brw_gs_prog_data *) &c->prog_data;
- if (!prog_data->num_transform_feedback_bindings)
+ if (!gs_prog_data->num_transform_feedback_bindings)
return;
- switch (c->prog_data.output_topology) {
+ switch (gs_prog_data->output_topology) {
case _3DPRIM_POINTLIST:
num_verts = 1;
break;
@@ -642,10 +637,8 @@ gen6_gs_visitor::xfb_write()
void
gen6_gs_visitor::xfb_program(unsigned vertex, unsigned num_verts)
{
- struct brw_gs_prog_data *prog_data =
- (struct brw_gs_prog_data *) &c->prog_data;
unsigned binding;
- unsigned num_bindings = prog_data->num_transform_feedback_bindings;
+ unsigned num_bindings = gs_prog_data->num_transform_feedback_bindings;
src_reg sol_temp(this, glsl_type::uvec4_type);
/* Check for buffer overflow: we need room to write the complete primitive
@@ -666,7 +659,7 @@ gen6_gs_visitor::xfb_program(unsigned vertex, unsigned num_verts)
*/
for (binding = 0; binding < num_bindings; ++binding) {
unsigned char varying =
- prog_data->transform_feedback_bindings[binding];
+ gs_prog_data->transform_feedback_bindings[binding];
/* Set up the correct destination index for this vertex */
vec4_instruction *inst = emit(GS_OPCODE_SVB_SET_DST_INDEX,
@@ -704,7 +697,7 @@ gen6_gs_visitor::xfb_program(unsigned vertex, unsigned num_verts)
else if (varying == VARYING_SLOT_VIEWPORT)
data.swizzle = BRW_SWIZZLE_ZZZZ;
else
- data.swizzle = prog_data->transform_feedback_swizzles[binding];
+ data.swizzle = gs_prog_data->transform_feedback_swizzles[binding];
/* Write data */
inst = emit(GS_OPCODE_SVB_WRITE, mrf_reg, data, sol_temp);