From 4bf53f7cf9eb9ef754e72fe4f957fcecea11f90e Mon Sep 17 00:00:00 2001 From: Ben Widawsky Date: Sun, 15 Feb 2015 20:06:59 -0800 Subject: [PATCH] emit correct channels for atomic message on vs --- src/mesa/drivers/dri/i965/brw_defines.h | 1 + src/mesa/drivers/dri/i965/brw_fs_visitor.cpp | 2 ++ src/mesa/drivers/dri/i965/brw_reg.h | 16 ++++++++++++++++ 3 files changed, 19 insertions(+) diff --git a/src/mesa/drivers/dri/i965/brw_defines.h b/src/mesa/drivers/dri/i965/brw_defines.h index a597d6b..81839dd 100644 --- a/src/mesa/drivers/dri/i965/brw_defines.h +++ b/src/mesa/drivers/dri/i965/brw_defines.h @@ -1236,6 +1236,7 @@ enum PACKED brw_predicate { #define BRW_ARF_ADDRESS 0x10 #define BRW_ARF_ACCUMULATOR 0x20 #define BRW_ARF_FLAG 0x30 +#define BRW_ARF_CE 0x40 #define BRW_ARF_MASK 0x40 #define BRW_ARF_MASK_STACK 0x50 #define BRW_ARF_MASK_STACK_DEPTH 0x60 diff --git a/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp b/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp index 2a36d94..d495958 100644 --- a/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp +++ b/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp @@ -2994,6 +2994,8 @@ fs_visitor::emit_untyped_atomic(unsigned atomic_op, unsigned surf_index, if (uses_kill) { emit(MOV(component(sources[0], 7), brw_flag_reg(0, 1))) ->force_writemask_all = true; + } else if (stage == MESA_SHADER_VERTEX) { + emit(MOV(component(sources[0], 7), brw_ce_reg()))->force_writemask_all = true; } else { emit(MOV(component(sources[0], 7), retype(brw_vec1_grf(1, 7), BRW_REGISTER_TYPE_UD))) diff --git a/src/mesa/drivers/dri/i965/brw_reg.h b/src/mesa/drivers/dri/i965/brw_reg.h index 782cae1..19e40f8 100644 --- a/src/mesa/drivers/dri/i965/brw_reg.h +++ b/src/mesa/drivers/dri/i965/brw_reg.h @@ -660,6 +660,22 @@ brw_ip_reg(void) } static inline struct brw_reg +brw_ce_reg(void) +{ + return brw_reg(BRW_ARCHITECTURE_REGISTER_FILE, + BRW_ARF_CE, + 0, + 0, + 0, + BRW_REGISTER_TYPE_UD, + BRW_VERTICAL_STRIDE_4, /* ? */ + BRW_WIDTH_1, + BRW_HORIZONTAL_STRIDE_0, + BRW_SWIZZLE_XYZW, /* NOTE! */ + WRITEMASK_XYZW); /* NOTE! */ +} + +static inline struct brw_reg brw_acc_reg(unsigned width) { return brw_vecn_reg(width, BRW_ARCHITECTURE_REGISTER_FILE, -- 2.3.0