Will be used to simplify the handling of large virtual GRFs in SSA form.
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
SHADER_OPCODE_TG4,
SHADER_OPCODE_TG4_OFFSET,
+ /**
+ * Combines multiple sources of size 1 into a larger virtual GRF.
+ * For example, parameters for a send-from-GRF message. Or, updating
+ * channels of a size 4 VGRF used to store vec4s such as texturing results.
+ *
+ * This will be lowered into MOVs from each source to consecutive reg_offsets
+ * of the destination VGRF.
+ *
+ * src[0] may be BAD_FILE. If so, the lowering pass skips emitting the MOV,
+ * but still reserves the first channel of the destination VGRF. This can be
+ * used to reserve space for, say, a message header set up by the generators.
+ */
+ SHADER_OPCODE_LOAD_PAYLOAD,
+
SHADER_OPCODE_SHADER_TIME_ADD,
SHADER_OPCODE_UNTYPED_ATOMIC,
return inst;
}
+fs_inst *
+fs_visitor::LOAD_PAYLOAD(const fs_reg &dst, fs_reg *src, int sources)
+{
+ fs_inst *inst = new(mem_ctx) fs_inst(SHADER_OPCODE_LOAD_PAYLOAD, dst, src,
+ sources);
+ inst->regs_written = sources;
+
+ return inst;
+}
+
exec_list
fs_visitor::VARYING_PULL_CONSTANT_LOAD(const fs_reg &dst,
const fs_reg &surf_index,
fs_inst *end,
const fs_reg ®);
+ fs_inst *LOAD_PAYLOAD(const fs_reg &dst, fs_reg *src, int sources);
+
exec_list VARYING_PULL_CONSTANT_LOAD(const fs_reg &dst,
const fs_reg &surf_index,
const fs_reg &varying_offset,
_mesa_problem(ctx, "Unsupported opcode %d in FS", inst->opcode);
}
abort();
+
+ case SHADER_OPCODE_LOAD_PAYLOAD:
+ assert(!"Should be lowered by lower_load_payload()");
+ break;
}
if (inst->conditional_mod) {
case SHADER_OPCODE_SHADER_TIME_ADD:
return "shader_time_add";
+ case SHADER_OPCODE_LOAD_PAYLOAD:
+ return "load_payload";
+
case SHADER_OPCODE_GEN4_SCRATCH_READ:
return "gen4_scratch_read";
case SHADER_OPCODE_GEN4_SCRATCH_WRITE: