intel/brw/gfx12: Setup PS thread payload registers required for ALU-based pixel interpolation.

Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28306>
This commit is contained in:
Francisco Jerez 2022-08-08 13:53:04 -07:00 committed by Jordan Justen
parent 2df6d208c8
commit 6427f16074
3 changed files with 31 additions and 4 deletions

View file

@ -640,6 +640,9 @@ struct brw_wm_prog_data {
bool uses_src_depth;
bool uses_src_w;
bool uses_depth_w_coefficients;
bool uses_pc_bary_coefficients;
bool uses_npc_bary_coefficients;
bool uses_sample_offsets;
bool uses_sample_mask;
bool uses_vmask;
bool has_side_effects;

View file

@ -151,8 +151,12 @@ struct fs_thread_payload : public thread_payload {
uint8_t dest_depth_reg[2];
uint8_t sample_pos_reg[2];
uint8_t sample_mask_in_reg[2];
uint8_t depth_w_coef_reg;
uint8_t barycentric_coord_reg[BRW_BARYCENTRIC_MODE_COUNT][2];
uint8_t depth_w_coef_reg;
uint8_t pc_bary_coef_reg;
uint8_t npc_bary_coef_reg;
uint8_t sample_offsets_reg;
};
struct cs_thread_payload : public thread_payload {

View file

@ -290,10 +290,27 @@ setup_fs_payload_gfx9(fs_thread_payload &payload,
}
}
/* R66: Source Depth and/or W Attribute Vertex Deltas */
/* R66: Source Depth and/or W Attribute Vertex Deltas. */
if (prog_data->uses_depth_w_coefficients) {
assert(v.max_polygons == 1);
payload.depth_w_coef_reg = payload.num_regs;
payload.num_regs += v.max_polygons;
}
/* R68: Perspective bary planes. */
if (prog_data->uses_pc_bary_coefficients) {
payload.pc_bary_coef_reg = payload.num_regs;
payload.num_regs += v.max_polygons;
}
/* R70: Non-perspective bary planes. */
if (prog_data->uses_npc_bary_coefficients) {
payload.npc_bary_coef_reg = payload.num_regs;
payload.num_regs += v.max_polygons;
}
/* R72: Sample offsets. */
if (prog_data->uses_sample_offsets) {
payload.sample_offsets_reg = payload.num_regs;
payload.num_regs++;
}
@ -311,8 +328,11 @@ fs_thread_payload::fs_thread_payload(const fs_visitor &v,
dest_depth_reg(),
sample_pos_reg(),
sample_mask_in_reg(),
barycentric_coord_reg(),
depth_w_coef_reg(),
barycentric_coord_reg()
pc_bary_coef_reg(),
npc_bary_coef_reg(),
sample_offsets_reg()
{
if (v.devinfo->ver >= 20)
setup_fs_payload_gfx20(*this, v, source_depth_to_render_target);