mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-07 02:48:06 +02:00
i965/brw_reg: struct constructor now needs explicit negate and abs values.
We were assuming, when constructing a new brw_reg struct, that the
negate and abs register modifiers would not be present by default in
the new register.
Now, we force explicitly setting these values when constructing a new
register.
This will avoid problems like forgetting to properly set them when we
are using a previous register to generate this new register, as it was
happening in the dFdx and dFdy generation functions.
Fixes piglit test shaders/glsl-deriv-varyings
Cc: "10.4 10.3" <mesa-stable@lists.freedesktop.org>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=82991
Reviewed-by: Matt Turner <mattst88@gmail.com>
(cherry picked from commit 8517e665bc)
This commit is contained in:
parent
bccfe7ae0f
commit
2d669f6583
3 changed files with 28 additions and 2 deletions
|
|
@ -718,12 +718,14 @@ fs_generator::generate_ddx(fs_inst *inst, struct brw_reg dst, struct brw_reg src
|
|||
}
|
||||
|
||||
struct brw_reg src0 = brw_reg(src.file, src.nr, 1,
|
||||
src.negate, src.abs,
|
||||
BRW_REGISTER_TYPE_F,
|
||||
vstride,
|
||||
width,
|
||||
BRW_HORIZONTAL_STRIDE_0,
|
||||
BRW_SWIZZLE_XYZW, WRITEMASK_XYZW);
|
||||
struct brw_reg src1 = brw_reg(src.file, src.nr, 0,
|
||||
src.negate, src.abs,
|
||||
BRW_REGISTER_TYPE_F,
|
||||
vstride,
|
||||
width,
|
||||
|
|
@ -776,12 +778,14 @@ fs_generator::generate_ddy(fs_inst *inst, struct brw_reg dst, struct brw_reg src
|
|||
|
||||
/* produce accurate derivatives */
|
||||
struct brw_reg src0 = brw_reg(src.file, src.nr, 0,
|
||||
src.negate, src.abs,
|
||||
BRW_REGISTER_TYPE_F,
|
||||
BRW_VERTICAL_STRIDE_4,
|
||||
BRW_WIDTH_4,
|
||||
BRW_HORIZONTAL_STRIDE_1,
|
||||
BRW_SWIZZLE_XYXY, WRITEMASK_XYZW);
|
||||
struct brw_reg src1 = brw_reg(src.file, src.nr, 0,
|
||||
src.negate, src.abs,
|
||||
BRW_REGISTER_TYPE_F,
|
||||
BRW_VERTICAL_STRIDE_4,
|
||||
BRW_WIDTH_4,
|
||||
|
|
@ -810,12 +814,14 @@ fs_generator::generate_ddy(fs_inst *inst, struct brw_reg dst, struct brw_reg src
|
|||
} else {
|
||||
/* replicate the derivative at the top-left pixel to other pixels */
|
||||
struct brw_reg src0 = brw_reg(src.file, src.nr, 0,
|
||||
src.negate, src.abs,
|
||||
BRW_REGISTER_TYPE_F,
|
||||
BRW_VERTICAL_STRIDE_4,
|
||||
BRW_WIDTH_4,
|
||||
BRW_HORIZONTAL_STRIDE_0,
|
||||
BRW_SWIZZLE_XYZW, WRITEMASK_XYZW);
|
||||
struct brw_reg src1 = brw_reg(src.file, src.nr, 2,
|
||||
src.negate, src.abs,
|
||||
BRW_REGISTER_TYPE_F,
|
||||
BRW_VERTICAL_STRIDE_4,
|
||||
BRW_WIDTH_4,
|
||||
|
|
|
|||
|
|
@ -218,6 +218,8 @@ type_is_signed(unsigned type)
|
|||
* \param file one of the BRW_x_REGISTER_FILE values
|
||||
* \param nr register number/index
|
||||
* \param subnr register sub number
|
||||
* \param negate register negate modifier
|
||||
* \param abs register abs modifier
|
||||
* \param type one of BRW_REGISTER_TYPE_x
|
||||
* \param vstride one of BRW_VERTICAL_STRIDE_x
|
||||
* \param width one of BRW_WIDTH_x
|
||||
|
|
@ -229,6 +231,8 @@ static inline struct brw_reg
|
|||
brw_reg(unsigned file,
|
||||
unsigned nr,
|
||||
unsigned subnr,
|
||||
unsigned negate,
|
||||
unsigned abs,
|
||||
enum brw_reg_type type,
|
||||
unsigned vstride,
|
||||
unsigned width,
|
||||
|
|
@ -248,8 +252,8 @@ brw_reg(unsigned file,
|
|||
reg.file = file;
|
||||
reg.nr = nr;
|
||||
reg.subnr = subnr * type_sz(type);
|
||||
reg.negate = 0;
|
||||
reg.abs = 0;
|
||||
reg.negate = negate;
|
||||
reg.abs = abs;
|
||||
reg.vstride = vstride;
|
||||
reg.width = width;
|
||||
reg.hstride = hstride;
|
||||
|
|
@ -276,6 +280,8 @@ brw_vec16_reg(unsigned file, unsigned nr, unsigned subnr)
|
|||
return brw_reg(file,
|
||||
nr,
|
||||
subnr,
|
||||
0,
|
||||
0,
|
||||
BRW_REGISTER_TYPE_F,
|
||||
BRW_VERTICAL_STRIDE_16,
|
||||
BRW_WIDTH_16,
|
||||
|
|
@ -291,6 +297,8 @@ brw_vec8_reg(unsigned file, unsigned nr, unsigned subnr)
|
|||
return brw_reg(file,
|
||||
nr,
|
||||
subnr,
|
||||
0,
|
||||
0,
|
||||
BRW_REGISTER_TYPE_F,
|
||||
BRW_VERTICAL_STRIDE_8,
|
||||
BRW_WIDTH_8,
|
||||
|
|
@ -306,6 +314,8 @@ brw_vec4_reg(unsigned file, unsigned nr, unsigned subnr)
|
|||
return brw_reg(file,
|
||||
nr,
|
||||
subnr,
|
||||
0,
|
||||
0,
|
||||
BRW_REGISTER_TYPE_F,
|
||||
BRW_VERTICAL_STRIDE_4,
|
||||
BRW_WIDTH_4,
|
||||
|
|
@ -321,6 +331,8 @@ brw_vec2_reg(unsigned file, unsigned nr, unsigned subnr)
|
|||
return brw_reg(file,
|
||||
nr,
|
||||
subnr,
|
||||
0,
|
||||
0,
|
||||
BRW_REGISTER_TYPE_F,
|
||||
BRW_VERTICAL_STRIDE_2,
|
||||
BRW_WIDTH_2,
|
||||
|
|
@ -336,6 +348,8 @@ brw_vec1_reg(unsigned file, unsigned nr, unsigned subnr)
|
|||
return brw_reg(file,
|
||||
nr,
|
||||
subnr,
|
||||
0,
|
||||
0,
|
||||
BRW_REGISTER_TYPE_F,
|
||||
BRW_VERTICAL_STRIDE_0,
|
||||
BRW_WIDTH_1,
|
||||
|
|
@ -435,6 +449,8 @@ static inline struct brw_reg
|
|||
brw_imm_reg(enum brw_reg_type type)
|
||||
{
|
||||
return brw_reg(BRW_IMMEDIATE_VALUE,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
type,
|
||||
|
|
@ -630,6 +646,8 @@ brw_ip_reg(void)
|
|||
return brw_reg(BRW_ARCHITECTURE_REGISTER_FILE,
|
||||
BRW_ARF_IP,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
BRW_REGISTER_TYPE_UD,
|
||||
BRW_VERTICAL_STRIDE_4, /* ? */
|
||||
BRW_WIDTH_1,
|
||||
|
|
|
|||
|
|
@ -1630,6 +1630,8 @@ vec4_visitor::get_timestamp()
|
|||
src_reg ts = src_reg(brw_reg(BRW_ARCHITECTURE_REGISTER_FILE,
|
||||
BRW_ARF_TIMESTAMP,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
BRW_REGISTER_TYPE_UD,
|
||||
BRW_VERTICAL_STRIDE_0,
|
||||
BRW_WIDTH_4,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue