virtual void nir_emit_jump(nir_jump_instr *instr);
virtual void nir_emit_texture(nir_tex_instr *instr);
+ virtual dst_reg *make_reg_for_system_value(int location,
+ const glsl_type *type) = 0;
+
src_reg *nir_inputs;
unsigned *nir_uniform_driver_location;
bool interleaved);
void setup_payload_interference(struct ra_graph *g, int first_payload_node,
int reg_node_count);
- virtual dst_reg *make_reg_for_system_value(ir_variable *ir) = 0;
virtual void assign_binding_table_offsets();
virtual void setup_payload() = 0;
virtual void emit_prolog() = 0;
dst_reg *
-vec4_gs_visitor::make_reg_for_system_value(ir_variable *ir)
+vec4_gs_visitor::make_reg_for_system_value(int location,
+ const glsl_type *type)
{
- dst_reg *reg = new(mem_ctx) dst_reg(this, ir->type);
+ dst_reg *reg = new(mem_ctx) dst_reg(this, type);
- switch (ir->data.location) {
+ switch (location) {
case SYSTEM_VALUE_INVOCATION_ID:
this->current_annotation = "initialize gl_InvocationID";
emit(GS_OPCODE_GET_INSTANCE_ID, *reg);
int shader_time_index);
protected:
- virtual dst_reg *make_reg_for_system_value(ir_variable *ir);
+ virtual dst_reg *make_reg_for_system_value(int location,
+ const glsl_type *type);
virtual void setup_payload();
virtual void emit_prolog();
virtual void emit_program_code();
break;
case ir_var_system_value:
- reg = make_reg_for_system_value(ir);
+ reg = make_reg_for_system_value(ir->data.location, ir->type);
break;
default:
dst_reg *
-vec4_vs_visitor::make_reg_for_system_value(ir_variable *ir)
+vec4_vs_visitor::make_reg_for_system_value(int location,
+ const glsl_type *type)
{
/* VertexID is stored by the VF as the last vertex element, but
* we don't represent it with a flag in inputs_read, so we call
*/
dst_reg *reg = new(mem_ctx) dst_reg(ATTR, VERT_ATTRIB_MAX);
- switch (ir->data.location) {
+ switch (location) {
case SYSTEM_VALUE_BASE_VERTEX:
reg->writemask = WRITEMASK_X;
vs_prog_data->uses_vertexid = true;
bool use_legacy_snorm_formula);
protected:
- virtual dst_reg *make_reg_for_system_value(ir_variable *ir);
+ virtual dst_reg *make_reg_for_system_value(int location,
+ const glsl_type *type);
virtual void setup_payload();
virtual void emit_prolog();
virtual void emit_program_code();
}
protected:
- virtual dst_reg *make_reg_for_system_value(ir_variable *ir)
+ virtual dst_reg *make_reg_for_system_value(int location,
+ const glsl_type *type)
{
unreachable("Not reached");
}
}
protected:
- virtual dst_reg *make_reg_for_system_value(ir_variable *ir)
+ virtual dst_reg *make_reg_for_system_value(int location,
+ const glsl_type *type)
{
unreachable("Not reached");
}