diff options
author | Kenneth Graunke <[email protected]> | 2015-02-26 22:49:04 -0800 |
---|---|---|
committer | Emil Velikov <[email protected]> | 2015-03-11 18:23:15 +0000 |
commit | e9e182658dbb329e6a8e5b54794d173a878c9151 (patch) | |
tree | ffa691e5625d990654580add546683e98458e92b /src | |
parent | 82ef4994ddc0222241b101bcda8e729e729d93b0 (diff) |
i965/fs: Make emit_shader_time_write return rather than emit.
Instead of emit_shader_time_write, we now do emit(SHADER_TIME_ADD(...)).
The advantage is that we can also insert a shader time write at an
arbitrary location in the instruction stream, rather than being
restricted to emitting at the end.
Signed-off-by: Kenneth Graunke <[email protected]>
Reviewed-by: Topi Pohjolainen <[email protected]>
Reviewed-by: Matt Turner <[email protected]>
Cc: [email protected]
(cherry picked from commit bea854c7f33cc10b8292f931f114afc4f88a8dd4)
Diffstat (limited to 'src')
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_fs.cpp | 15 | ||||
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_fs.h | 3 |
2 files changed, 8 insertions, 10 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_fs.cpp b/src/mesa/drivers/dri/i965/brw_fs.cpp index 5caea5a50e6..347bdb9852e 100644 --- a/src/mesa/drivers/dri/i965/brw_fs.cpp +++ b/src/mesa/drivers/dri/i965/brw_fs.cpp @@ -779,16 +779,15 @@ fs_visitor::emit_shader_time_end() add->force_writemask_all = true; emit(add); - emit_shader_time_write(type, diff); - emit_shader_time_write(written_type, fs_reg(1u)); + emit(SHADER_TIME_ADD(type, diff)); + emit(SHADER_TIME_ADD(written_type, fs_reg(1u))); emit(BRW_OPCODE_ELSE); - emit_shader_time_write(reset_type, fs_reg(1u)); + emit(SHADER_TIME_ADD(reset_type, fs_reg(1u))); emit(BRW_OPCODE_ENDIF); } -void -fs_visitor::emit_shader_time_write(enum shader_time_shader_type type, - fs_reg value) +fs_inst * +fs_visitor::SHADER_TIME_ADD(enum shader_time_shader_type type, fs_reg value) { int shader_time_index = brw_get_shader_time_index(brw, shader_prog, prog, type); @@ -800,8 +799,8 @@ fs_visitor::emit_shader_time_write(enum shader_time_shader_type type, else payload = vgrf(glsl_type::uint_type); - emit(new(mem_ctx) fs_inst(SHADER_OPCODE_SHADER_TIME_ADD, - fs_reg(), payload, offset, value)); + return new(mem_ctx) fs_inst(SHADER_OPCODE_SHADER_TIME_ADD, + fs_reg(), payload, offset, value); } void diff --git a/src/mesa/drivers/dri/i965/brw_fs.h b/src/mesa/drivers/dri/i965/brw_fs.h index b95e2c03e13..fcc8a5aca2a 100644 --- a/src/mesa/drivers/dri/i965/brw_fs.h +++ b/src/mesa/drivers/dri/i965/brw_fs.h @@ -601,8 +601,7 @@ public: void emit_shader_time_begin(); void emit_shader_time_end(); - void emit_shader_time_write(enum shader_time_shader_type type, - fs_reg value); + fs_inst *SHADER_TIME_ADD(enum shader_time_shader_type type, fs_reg value); void emit_untyped_atomic(unsigned atomic_op, unsigned surf_index, fs_reg dst, fs_reg offset, fs_reg src0, |