diff options
author | Jason Ekstrand <[email protected]> | 2015-08-03 14:37:41 -0700 |
---|---|---|
committer | Jason Ekstrand <[email protected]> | 2015-08-10 11:45:43 -0700 |
commit | 1d658cf8795383dbef127e46f3740b516bfe21b9 (patch) | |
tree | 2661ba1b59776b32e63ebbc95d60c4910a8d7e23 /src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp | |
parent | 5e1c1c2fcbdfb96a973ae3fd196e341ab2d41833 (diff) |
i965/vec4_nir: Do boolean source modifier resolves on BDW+
On BDW+, the negation source modifier on NOT, AND, OR, and XOR, is actually
a boolean negate and not an integer negate. However, NIR's soruce
modifiers are the integer version. We have to resolve it with a MOV prior
to emitting the actual instruction. This is basically the same thing we do
in the FS backend.
Reviewed-by: Matt Turner <[email protected]>
Diffstat (limited to 'src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp')
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp b/src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp index ba352be3ad5..57d98c9b6b3 100644 --- a/src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp +++ b/src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp @@ -313,6 +313,19 @@ vec4_visitor::fix_3src_operand(src_reg src) } src_reg +vec4_visitor::resolve_source_modifiers(const src_reg& src) +{ + if (!src.abs && !src.negate) + return src; + + dst_reg resolved = dst_reg(this, glsl_type::ivec4_type); + resolved.type = src.type; + emit(MOV(resolved, src)); + + return src_reg(resolved); +} + +src_reg vec4_visitor::fix_math_operand(src_reg src) { if (devinfo->gen < 6 || devinfo->gen >= 8 || src.file == BAD_FILE) |