[Mesa-dev] [PATCH 09/13] i965: Pass the number of components as a source of the untyped surface read opcode.
Francisco Jerez
currojerez at riseup.net
Fri Feb 27 07:34:52 PST 2015
---
src/mesa/drivers/dri/i965/brw_fs_generator.cpp | 5 +++--
src/mesa/drivers/dri/i965/brw_fs_visitor.cpp | 2 +-
src/mesa/drivers/dri/i965/brw_vec4_generator.cpp | 6 ++++--
src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp | 3 ++-
4 files changed, 10 insertions(+), 6 deletions(-)
diff --git a/src/mesa/drivers/dri/i965/brw_fs_generator.cpp b/src/mesa/drivers/dri/i965/brw_fs_generator.cpp
index 48eee18..bd07008 100644
--- a/src/mesa/drivers/dri/i965/brw_fs_generator.cpp
+++ b/src/mesa/drivers/dri/i965/brw_fs_generator.cpp
@@ -1892,9 +1892,10 @@ fs_generator::generate_code(const cfg_t *cfg, int dispatch_width)
break;
case SHADER_OPCODE_UNTYPED_SURFACE_READ:
- assert(src[1].file == BRW_IMMEDIATE_VALUE);
+ assert(src[1].file == BRW_IMMEDIATE_VALUE &&
+ src[2].file == BRW_IMMEDIATE_VALUE);
brw_untyped_surface_read(p, dst, src[0], src[1],
- inst->mlen, 1);
+ inst->mlen, src[2].dw1.ud);
brw_mark_surface_used(prog_data, src[1].dw1.ud);
break;
diff --git a/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp b/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp
index 2d5bef8..6c401f4 100644
--- a/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp
+++ b/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp
@@ -3208,7 +3208,7 @@ fs_visitor::emit_untyped_surface_read(unsigned surf_index, fs_reg dst,
/* Emit the instruction. */
inst = emit(SHADER_OPCODE_UNTYPED_SURFACE_READ, dst, src_payload,
- fs_reg(surf_index));
+ fs_reg(surf_index), fs_reg(1));
inst->mlen = mlen;
}
diff --git a/src/mesa/drivers/dri/i965/brw_vec4_generator.cpp b/src/mesa/drivers/dri/i965/brw_vec4_generator.cpp
index ef0cde9..c97a5ba 100644
--- a/src/mesa/drivers/dri/i965/brw_vec4_generator.cpp
+++ b/src/mesa/drivers/dri/i965/brw_vec4_generator.cpp
@@ -1467,8 +1467,10 @@ vec4_generator::generate_code(const cfg_t *cfg)
break;
case SHADER_OPCODE_UNTYPED_SURFACE_READ:
- assert(src[1].file == BRW_IMMEDIATE_VALUE);
- brw_untyped_surface_read(p, dst, src[0], src[1], inst->mlen, 1);
+ assert(src[1].file == BRW_IMMEDIATE_VALUE &&
+ src[2].file == BRW_IMMEDIATE_VALUE);
+ brw_untyped_surface_read(p, dst, src[0], src[1], inst->mlen,
+ src[2].dw1.ud);
brw_mark_surface_used(&prog_data->base, src[1].dw1.ud);
break;
diff --git a/src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp b/src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp
index b8cfe8f..ebd02c6 100644
--- a/src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp
+++ b/src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp
@@ -2971,7 +2971,8 @@ vec4_visitor::emit_untyped_surface_read(unsigned surf_index, dst_reg dst,
* channels will be masked out.
*/
vec4_instruction *inst = emit(SHADER_OPCODE_UNTYPED_SURFACE_READ, dst,
- brw_message_reg(0), src_reg(surf_index));
+ brw_message_reg(0),
+ src_reg(surf_index), src_reg(1));
inst->base_mrf = 0;
inst->mlen = 1;
}
--
2.1.3
More information about the mesa-dev
mailing list