From: Francisco Jerez Date: Thu, 19 Mar 2015 13:11:28 +0000 (+0200) Subject: i965: Pass the number of components as a source of the untyped surface read opcode. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=ac747ca5f72332b1ff97041cc808be551596a26f;p=mesa.git i965: Pass the number of components as a source of the untyped surface read opcode. Reviewed-by: Topi Pohjolainen Acked-by: Kenneth Graunke --- diff --git a/src/mesa/drivers/dri/i965/brw_fs_generator.cpp b/src/mesa/drivers/dri/i965/brw_fs_generator.cpp index 5b6633a7fa1..876fdd23d86 100644 --- a/src/mesa/drivers/dri/i965/brw_fs_generator.cpp +++ b/src/mesa/drivers/dri/i965/brw_fs_generator.cpp @@ -2023,9 +2023,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 eba188c3844..809011750b4 100644 --- a/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp +++ b/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp @@ -3335,7 +3335,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 9a74728de02..6189f1db5cc 100644 --- a/src/mesa/drivers/dri/i965/brw_vec4_generator.cpp +++ b/src/mesa/drivers/dri/i965/brw_vec4_generator.cpp @@ -1477,8 +1477,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 bef17cc9102..ca2a9988f6c 100644 --- a/src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp +++ b/src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp @@ -2978,7 +2978,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->mlen = 1; }