i965: Pass the number of components as a source of the untyped surface read opcode.
authorFrancisco Jerez <currojerez@riseup.net>
Thu, 19 Mar 2015 13:11:28 +0000 (15:11 +0200)
committerFrancisco Jerez <currojerez@riseup.net>
Mon, 4 May 2015 12:05:20 +0000 (15:05 +0300)
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
src/mesa/drivers/dri/i965/brw_fs_generator.cpp
src/mesa/drivers/dri/i965/brw_fs_visitor.cpp
src/mesa/drivers/dri/i965/brw_vec4_generator.cpp
src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp

index 5b6633a7fa1e5e35dadfc2e406969c44afdd3517..876fdd23d868ea79f93921eec2092d6c53ce64f6 100644 (file)
@@ -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;
 
index eba188c3844dfca61ed33aba45b8e30fc74eec24..809011750b44a28168f8438e7719dc92f290c4fe 100644 (file)
@@ -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;
 }
 
index 9a74728de022c48a75277c698c8804d098faba80..6189f1db5ccb27940e4fa710533798a79072e1a4 100644 (file)
@@ -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;
 
index bef17cc9102884bca12c5c9031ae8c08c0c1c82e..ca2a9988f6c8956687c0e16711016155368db1e9 100644 (file)
@@ -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;
 }