diff options
author | Alejandro PiƱeiro <[email protected]> | 2015-09-01 17:02:20 +0200 |
---|---|---|
committer | Emil Velikov <[email protected]> | 2015-09-17 15:04:52 +0100 |
commit | eb06d2b6496159a505c8d290e51b14ed2ba36718 (patch) | |
tree | c01aeed3f0aa020d585852fee84da9efcecbb441 /src | |
parent | 0fe894db48f96a4c8db72e83b30f6d4965ba5eeb (diff) |
i965/vec4: fill src_reg type using the constructor type parameter
The src_reg constructor that received the glsl_type was using it
only to build the swizzle, but not to fill this->type as dst_reg
is doing.
This caused some type mismatch between movs and alu operations
on the NIR path, so copy propagation optimization was not applied
to remove unneeded movs if negate modifier was involved. This was
first detected on minus (negate+add) operations.
Shader DB results (taking into account only vec4):
total instructions in shared programs: 20019 -> 19934 (-0.42%)
instructions in affected programs: 2918 -> 2833 (-2.91%)
helped: 79
HURT: 0
GAINED: 0
LOST: 0
Reviewed-by: Matt Turner <[email protected]>
(cherry picked from commit 4de86e1371b0d59a5b9a787b726be3d373024647)
Nominated-by: Christoph Brill <[email protected]>
Diffstat (limited to 'src')
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_vec4.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_vec4.cpp b/src/mesa/drivers/dri/i965/brw_vec4.cpp index 729d081967f..aaf4e4323ba 100644 --- a/src/mesa/drivers/dri/i965/brw_vec4.cpp +++ b/src/mesa/drivers/dri/i965/brw_vec4.cpp @@ -60,6 +60,8 @@ src_reg::src_reg(register_file file, int reg, const glsl_type *type) this->swizzle = brw_swizzle_for_size(type->vector_elements); else this->swizzle = BRW_SWIZZLE_XYZW; + if (type) + this->type = brw_type_for_base_type(type); } /** Generic unset register constructor. */ |