diff options
author | Jordan Justen <[email protected]> | 2016-05-22 16:33:44 -0700 |
---|---|---|
committer | Jordan Justen <[email protected]> | 2016-06-01 19:29:02 -0700 |
commit | 8f48d23e0fcc0809f6397a67c26751a45a95e076 (patch) | |
tree | 8973802e0750be43d252facf97cb4a5dd29d0bec /src/mesa/drivers/dri | |
parent | 6f316c9d8658e870b0140b0f601d35d1fcf133b9 (diff) |
i965: Add nir channel_num system value
v2:
* simd16/32 fixes (curro)
Cc: "12.0" <[email protected]>
Signed-off-by: Jordan Justen <[email protected]>
Reviewed-by: Jason Ekstrand <[email protected]>
Diffstat (limited to 'src/mesa/drivers/dri')
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_fs_nir.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_fs_nir.cpp b/src/mesa/drivers/dri/i965/brw_fs_nir.cpp index 9b6093ca1b8..81c72047e25 100644 --- a/src/mesa/drivers/dri/i965/brw_fs_nir.cpp +++ b/src/mesa/drivers/dri/i965/brw_fs_nir.cpp @@ -3876,6 +3876,21 @@ fs_visitor::nir_emit_intrinsic(const fs_builder &bld, nir_intrinsic_instr *instr break; } + case nir_intrinsic_load_channel_num: { + fs_reg tmp = bld.vgrf(BRW_REGISTER_TYPE_UW); + dest = retype(dest, BRW_REGISTER_TYPE_UD); + const fs_builder allbld8 = bld.group(8, 0).exec_all(); + allbld8.MOV(tmp, brw_imm_v(0x76543210)); + if (dispatch_width > 8) + allbld8.ADD(byte_offset(tmp, 16), tmp, brw_imm_uw(8u)); + if (dispatch_width > 16) { + const fs_builder allbld16 = bld.group(16, 0).exec_all(); + allbld16.ADD(byte_offset(tmp, 32), tmp, brw_imm_uw(16u)); + } + bld.MOV(dest, tmp); + break; + } + default: unreachable("unknown intrinsic"); } |