From 29340d02dc38a9cc352d44412871dc9d4e3f878a Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Wed, 7 Nov 2012 10:42:34 -0800 Subject: [PATCH] i965/fs: Rename the existing pull constant load opcode. We're going to use another send message for handling loads with a varying per-fragment array index. --- src/mesa/drivers/dri/i965/brw_defines.h | 2 +- src/mesa/drivers/dri/i965/brw_fs.cpp | 7 ++++--- src/mesa/drivers/dri/i965/brw_fs.h | 6 +++--- src/mesa/drivers/dri/i965/brw_fs_copy_propagation.cpp | 2 +- src/mesa/drivers/dri/i965/brw_fs_emit.cpp | 11 ++++++----- src/mesa/drivers/dri/i965/brw_fs_visitor.cpp | 2 +- 6 files changed, 16 insertions(+), 14 deletions(-) diff --git a/src/mesa/drivers/dri/i965/brw_defines.h b/src/mesa/drivers/dri/i965/brw_defines.h index 6dc470768a2..6e4fb134b30 100644 --- a/src/mesa/drivers/dri/i965/brw_defines.h +++ b/src/mesa/drivers/dri/i965/brw_defines.h @@ -674,7 +674,7 @@ enum opcode { FS_OPCODE_DISCARD, FS_OPCODE_SPILL, FS_OPCODE_UNSPILL, - FS_OPCODE_PULL_CONSTANT_LOAD, + FS_OPCODE_UNIFORM_PULL_CONSTANT_LOAD, FS_OPCODE_MOV_DISPATCH_TO_FLAGS, VS_OPCODE_URB_WRITE, diff --git a/src/mesa/drivers/dri/i965/brw_fs.cpp b/src/mesa/drivers/dri/i965/brw_fs.cpp index e143e7adbdd..21473e94c63 100644 --- a/src/mesa/drivers/dri/i965/brw_fs.cpp +++ b/src/mesa/drivers/dri/i965/brw_fs.cpp @@ -515,7 +515,7 @@ fs_visitor::implied_mrf_writes(fs_inst *inst) return 1; case FS_OPCODE_FB_WRITE: return 2; - case FS_OPCODE_PULL_CONSTANT_LOAD: + case FS_OPCODE_UNIFORM_PULL_CONSTANT_LOAD: case FS_OPCODE_UNSPILL: return 1; case FS_OPCODE_SPILL: @@ -1411,8 +1411,9 @@ fs_visitor::setup_pull_constants() fs_reg index = fs_reg((unsigned)SURF_INDEX_FRAG_CONST_BUFFER); fs_reg offset = fs_reg((unsigned)(((uniform_nr - pull_uniform_base) * 4) & ~15)); - fs_inst *pull = new(mem_ctx) fs_inst(FS_OPCODE_PULL_CONSTANT_LOAD, - dst, index, offset); + fs_inst *pull = + new(mem_ctx) fs_inst(FS_OPCODE_UNIFORM_PULL_CONSTANT_LOAD, + dst, index, offset); pull->ir = inst->ir; pull->annotation = inst->annotation; pull->base_mrf = 14; diff --git a/src/mesa/drivers/dri/i965/brw_fs.h b/src/mesa/drivers/dri/i965/brw_fs.h index 86c33bc8b0f..c14e779a0ed 100644 --- a/src/mesa/drivers/dri/i965/brw_fs.h +++ b/src/mesa/drivers/dri/i965/brw_fs.h @@ -481,9 +481,9 @@ private: bool negate_value); void generate_spill(fs_inst *inst, struct brw_reg src); void generate_unspill(fs_inst *inst, struct brw_reg dst); - void generate_pull_constant_load(fs_inst *inst, struct brw_reg dst, - struct brw_reg index, - struct brw_reg offset); + void generate_uniform_pull_constant_load(fs_inst *inst, struct brw_reg dst, + struct brw_reg index, + struct brw_reg offset); void generate_mov_dispatch_to_flags(); struct brw_context *brw; diff --git a/src/mesa/drivers/dri/i965/brw_fs_copy_propagation.cpp b/src/mesa/drivers/dri/i965/brw_fs_copy_propagation.cpp index dec3dcaef5b..d296e48c038 100644 --- a/src/mesa/drivers/dri/i965/brw_fs_copy_propagation.cpp +++ b/src/mesa/drivers/dri/i965/brw_fs_copy_propagation.cpp @@ -336,7 +336,7 @@ fs_visitor::try_constant_propagate(fs_inst *inst, acp_entry *entry) } break; - case FS_OPCODE_PULL_CONSTANT_LOAD: + case FS_OPCODE_UNIFORM_PULL_CONSTANT_LOAD: inst->src[i] = entry->src; progress = true; break; diff --git a/src/mesa/drivers/dri/i965/brw_fs_emit.cpp b/src/mesa/drivers/dri/i965/brw_fs_emit.cpp index 9a1f360f86a..87a5e53c3a6 100644 --- a/src/mesa/drivers/dri/i965/brw_fs_emit.cpp +++ b/src/mesa/drivers/dri/i965/brw_fs_emit.cpp @@ -608,9 +608,10 @@ fs_generator::generate_unspill(fs_inst *inst, struct brw_reg dst) } void -fs_generator::generate_pull_constant_load(fs_inst *inst, struct brw_reg dst, - struct brw_reg index, - struct brw_reg offset) +fs_generator::generate_uniform_pull_constant_load(fs_inst *inst, + struct brw_reg dst, + struct brw_reg index, + struct brw_reg offset) { assert(inst->mlen != 0); @@ -1016,8 +1017,8 @@ fs_generator::generate_code(exec_list *instructions) generate_unspill(inst, dst); break; - case FS_OPCODE_PULL_CONSTANT_LOAD: - generate_pull_constant_load(inst, dst, src[0], src[1]); + case FS_OPCODE_UNIFORM_PULL_CONSTANT_LOAD: + generate_uniform_pull_constant_load(inst, dst, src[0], src[1]); break; case FS_OPCODE_FB_WRITE: diff --git a/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp b/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp index 571489c1db8..7a913534cd4 100644 --- a/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp +++ b/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp @@ -557,7 +557,7 @@ fs_visitor::visit(ir_expression *ir) fs_reg packed_consts = fs_reg(this, glsl_type::float_type); packed_consts.type = result.type; fs_reg surf_index = fs_reg((unsigned)SURF_INDEX_WM_UBO(uniform_block->value.u[0])); - fs_inst *pull = emit(fs_inst(FS_OPCODE_PULL_CONSTANT_LOAD, + fs_inst *pull = emit(fs_inst(FS_OPCODE_UNIFORM_PULL_CONSTANT_LOAD, packed_consts, surf_index, fs_reg(offset->value.u[0]))); -- 2.30.2