radv: do not translate blend op/factor during gfx info initialization

For switching to the common graphics pipeline state.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18015>
This commit is contained in:
Samuel Pitoiset
2022-08-09 18:14:47 +02:00
parent 0f2ca61dcc
commit e34440a1bf
2 changed files with 97 additions and 142 deletions

View File

@@ -369,18 +369,18 @@ si_translate_blend_factor(enum amd_gfx_level gfx_level, VkBlendFactor factor)
} }
static uint32_t static uint32_t
si_translate_blend_opt_function(unsigned op) si_translate_blend_opt_function(VkBlendOp op)
{ {
switch (op) { switch (op) {
case V_028780_COMB_DST_PLUS_SRC: case VK_BLEND_OP_ADD:
return V_028760_OPT_COMB_ADD; return V_028760_OPT_COMB_ADD;
case V_028780_COMB_SRC_MINUS_DST: case VK_BLEND_OP_SUBTRACT:
return V_028760_OPT_COMB_SUBTRACT; return V_028760_OPT_COMB_SUBTRACT;
case V_028780_COMB_DST_MINUS_SRC: case VK_BLEND_OP_REVERSE_SUBTRACT:
return V_028760_OPT_COMB_REVSUBTRACT; return V_028760_OPT_COMB_REVSUBTRACT;
case V_028780_COMB_MIN_DST_SRC: case VK_BLEND_OP_MIN:
return V_028760_OPT_COMB_MIN; return V_028760_OPT_COMB_MIN;
case V_028780_COMB_MAX_DST_SRC: case VK_BLEND_OP_MAX:
return V_028760_OPT_COMB_MAX; return V_028760_OPT_COMB_MAX;
default: default:
return V_028760_OPT_COMB_BLEND_DISABLED; return V_028760_OPT_COMB_BLEND_DISABLED;
@@ -388,24 +388,24 @@ si_translate_blend_opt_function(unsigned op)
} }
static uint32_t static uint32_t
si_translate_blend_opt_factor(unsigned factor, bool is_alpha) si_translate_blend_opt_factor(VkBlendFactor factor, bool is_alpha)
{ {
switch (factor) { switch (factor) {
case V_028780_BLEND_ZERO: case VK_BLEND_FACTOR_ZERO:
return V_028760_BLEND_OPT_PRESERVE_NONE_IGNORE_ALL; return V_028760_BLEND_OPT_PRESERVE_NONE_IGNORE_ALL;
case V_028780_BLEND_ONE: case VK_BLEND_FACTOR_ONE:
return V_028760_BLEND_OPT_PRESERVE_ALL_IGNORE_NONE; return V_028760_BLEND_OPT_PRESERVE_ALL_IGNORE_NONE;
case V_028780_BLEND_SRC_COLOR: case VK_BLEND_FACTOR_SRC_COLOR:
return is_alpha ? V_028760_BLEND_OPT_PRESERVE_A1_IGNORE_A0 return is_alpha ? V_028760_BLEND_OPT_PRESERVE_A1_IGNORE_A0
: V_028760_BLEND_OPT_PRESERVE_C1_IGNORE_C0; : V_028760_BLEND_OPT_PRESERVE_C1_IGNORE_C0;
case V_028780_BLEND_ONE_MINUS_SRC_COLOR: case VK_BLEND_FACTOR_ONE_MINUS_SRC_COLOR:
return is_alpha ? V_028760_BLEND_OPT_PRESERVE_A0_IGNORE_A1 return is_alpha ? V_028760_BLEND_OPT_PRESERVE_A0_IGNORE_A1
: V_028760_BLEND_OPT_PRESERVE_C0_IGNORE_C1; : V_028760_BLEND_OPT_PRESERVE_C0_IGNORE_C1;
case V_028780_BLEND_SRC_ALPHA: case VK_BLEND_FACTOR_SRC_ALPHA:
return V_028760_BLEND_OPT_PRESERVE_A1_IGNORE_A0; return V_028760_BLEND_OPT_PRESERVE_A1_IGNORE_A0;
case V_028780_BLEND_ONE_MINUS_SRC_ALPHA: case VK_BLEND_FACTOR_ONE_MINUS_SRC_ALPHA:
return V_028760_BLEND_OPT_PRESERVE_A0_IGNORE_A1; return V_028760_BLEND_OPT_PRESERVE_A0_IGNORE_A1;
case V_028780_BLEND_SRC_ALPHA_SATURATE: case VK_BLEND_FACTOR_SRC_ALPHA_SATURATE:
return is_alpha ? V_028760_BLEND_OPT_PRESERVE_ALL_IGNORE_NONE return is_alpha ? V_028760_BLEND_OPT_PRESERVE_ALL_IGNORE_NONE
: V_028760_BLEND_OPT_PRESERVE_NONE_IGNORE_A0; : V_028760_BLEND_OPT_PRESERVE_NONE_IGNORE_A0;
default: default:
@@ -418,54 +418,41 @@ si_translate_blend_opt_factor(unsigned factor, bool is_alpha)
* func(src * DST, dst * 0) ---> func(src * 0, dst * SRC) * func(src * DST, dst * 0) ---> func(src * 0, dst * SRC)
*/ */
static void static void
si_blend_remove_dst(unsigned *func, unsigned *src_factor, unsigned *dst_factor, si_blend_remove_dst(VkBlendOp *func, VkBlendFactor *src_factor, VkBlendFactor *dst_factor,
unsigned expected_dst, unsigned replacement_src) VkBlendFactor expected_dst, VkBlendFactor replacement_src)
{ {
if (*src_factor == expected_dst && *dst_factor == V_028780_BLEND_ZERO) { if (*src_factor == expected_dst && *dst_factor == VK_BLEND_FACTOR_ZERO) {
*src_factor = V_028780_BLEND_ZERO; *src_factor = VK_BLEND_FACTOR_ZERO;
*dst_factor = replacement_src; *dst_factor = replacement_src;
/* Commuting the operands requires reversing subtractions. */ /* Commuting the operands requires reversing subtractions. */
if (*func == V_028780_COMB_SRC_MINUS_DST) if (*func == VK_BLEND_OP_SUBTRACT)
*func = V_028780_COMB_DST_MINUS_SRC; *func = VK_BLEND_OP_REVERSE_SUBTRACT;
else if (*func == V_028780_COMB_DST_MINUS_SRC) else if (*func == VK_BLEND_OP_REVERSE_SUBTRACT)
*func = V_028780_COMB_SRC_MINUS_DST; *func = VK_BLEND_OP_SUBTRACT;
} }
} }
static bool static bool
si_blend_factor_uses_dst(unsigned factor) si_blend_factor_uses_dst(VkBlendFactor factor)
{ {
return factor == V_028780_BLEND_DST_COLOR || return factor == VK_BLEND_FACTOR_DST_COLOR || factor == VK_BLEND_FACTOR_DST_ALPHA ||
factor == V_028780_BLEND_DST_ALPHA || factor == VK_BLEND_FACTOR_SRC_ALPHA_SATURATE ||
factor == V_028780_BLEND_SRC_ALPHA_SATURATE || factor == VK_BLEND_FACTOR_ONE_MINUS_DST_ALPHA ||
factor == V_028780_BLEND_ONE_MINUS_DST_ALPHA || factor == VK_BLEND_FACTOR_ONE_MINUS_DST_COLOR;
factor == V_028780_BLEND_ONE_MINUS_DST_COLOR;
} }
static bool static bool
is_dual_src(enum amd_gfx_level gfx_level, unsigned factor) is_dual_src(VkBlendFactor factor)
{ {
if (gfx_level >= GFX11) { switch (factor) {
switch (factor) { case VK_BLEND_FACTOR_SRC1_COLOR:
case V_028780_BLEND_SRC1_COLOR_GFX11: case VK_BLEND_FACTOR_ONE_MINUS_SRC1_COLOR:
case V_028780_BLEND_INV_SRC1_COLOR_GFX11: case VK_BLEND_FACTOR_SRC1_ALPHA:
case V_028780_BLEND_SRC1_ALPHA_GFX11: case VK_BLEND_FACTOR_ONE_MINUS_SRC1_ALPHA:
case V_028780_BLEND_INV_SRC1_ALPHA_GFX11: return true;
return true; default:
default: return false;
return false;
}
} else {
switch (factor) {
case V_028780_BLEND_SRC1_COLOR_GFX6:
case V_028780_BLEND_INV_SRC1_COLOR_GFX6:
case V_028780_BLEND_SRC1_ALPHA_GFX6:
case V_028780_BLEND_INV_SRC1_ALPHA_GFX6:
return true;
default:
return false;
}
} }
} }
@@ -639,52 +626,27 @@ radv_format_meta_fs_key(struct radv_device *device, VkFormat format)
} }
static void static void
radv_blend_check_commutativity(enum amd_gfx_level gfx_level, struct radv_blend_state *blend, radv_blend_check_commutativity(struct radv_blend_state *blend, VkBlendOp op, VkBlendFactor src,
unsigned op, unsigned src, unsigned dst, unsigned chanmask) VkBlendFactor dst, unsigned chanmask)
{ {
bool is_src_allowed = false;
/* Src factor is allowed when it does not depend on Dst. */ /* Src factor is allowed when it does not depend on Dst. */
if (src == V_028780_BLEND_ZERO || static const uint32_t src_allowed =
src == V_028780_BLEND_ONE || (1u << VK_BLEND_FACTOR_ONE) | (1u << VK_BLEND_FACTOR_SRC_COLOR) |
src == V_028780_BLEND_SRC_COLOR || (1u << VK_BLEND_FACTOR_SRC_ALPHA) | (1u << VK_BLEND_FACTOR_SRC_ALPHA_SATURATE) |
src == V_028780_BLEND_SRC_ALPHA || (1u << VK_BLEND_FACTOR_CONSTANT_COLOR) | (1u << VK_BLEND_FACTOR_CONSTANT_ALPHA) |
src == V_028780_BLEND_SRC_ALPHA_SATURATE || (1u << VK_BLEND_FACTOR_SRC1_COLOR) | (1u << VK_BLEND_FACTOR_SRC1_ALPHA) |
src == V_028780_BLEND_ONE_MINUS_SRC_COLOR || (1u << VK_BLEND_FACTOR_ZERO) | (1u << VK_BLEND_FACTOR_ONE_MINUS_SRC_COLOR) |
src == V_028780_BLEND_ONE_MINUS_SRC_ALPHA) { (1u << VK_BLEND_FACTOR_ONE_MINUS_SRC_ALPHA) |
is_src_allowed = true; (1u << VK_BLEND_FACTOR_ONE_MINUS_CONSTANT_COLOR) |
} (1u << VK_BLEND_FACTOR_ONE_MINUS_CONSTANT_ALPHA) |
(1u << VK_BLEND_FACTOR_ONE_MINUS_SRC1_COLOR) | (1u << VK_BLEND_FACTOR_ONE_MINUS_SRC1_ALPHA);
if (gfx_level >= GFX11) { if (dst == VK_BLEND_FACTOR_ONE && (src_allowed & (1u << src))) {
if (src == V_028780_BLEND_CONSTANT_COLOR_GFX11 ||
src == V_028780_BLEND_CONSTANT_ALPHA_GFX11 ||
src == V_028780_BLEND_SRC1_COLOR_GFX11 ||
src == V_028780_BLEND_SRC1_ALPHA_GFX11 ||
src == V_028780_BLEND_ONE_MINUS_CONSTANT_COLOR_GFX11 ||
src == V_028780_BLEND_ONE_MINUS_CONSTANT_ALPHA_GFX11 ||
src == V_028780_BLEND_INV_SRC1_COLOR_GFX11 ||
src == V_028780_BLEND_INV_SRC1_ALPHA_GFX11) {
is_src_allowed = true;
}
} else {
if (src == V_028780_BLEND_CONSTANT_COLOR_GFX6 ||
src == V_028780_BLEND_CONSTANT_ALPHA_GFX6 ||
src == V_028780_BLEND_SRC1_COLOR_GFX6 ||
src == V_028780_BLEND_SRC1_ALPHA_GFX6 ||
src == V_028780_BLEND_ONE_MINUS_CONSTANT_COLOR_GFX6 ||
src == V_028780_BLEND_ONE_MINUS_CONSTANT_ALPHA_GFX6 ||
src == V_028780_BLEND_INV_SRC1_COLOR_GFX6 ||
src == V_028780_BLEND_INV_SRC1_ALPHA_GFX6) {
is_src_allowed = true;
}
}
if (dst == V_028780_BLEND_ONE && is_src_allowed) {
/* Addition is commutative, but floating point addition isn't /* Addition is commutative, but floating point addition isn't
* associative: subtle changes can be introduced via different * associative: subtle changes can be introduced via different
* rounding. Be conservative, only enable for min and max. * rounding. Be conservative, only enable for min and max.
*/ */
if (op == V_028780_COMB_MAX_DST_SRC || op == V_028780_COMB_MIN_DST_SRC) if (op == VK_BLEND_OP_MAX || op == VK_BLEND_OP_MIN)
blend->commutative_4bit |= chanmask; blend->commutative_4bit |= chanmask;
} }
} }
@@ -727,12 +689,12 @@ radv_pipeline_init_blend_state(struct radv_graphics_pipeline *pipeline,
for (i = 0; i < info->cb.att_count; i++) { for (i = 0; i < info->cb.att_count; i++) {
unsigned blend_cntl = 0; unsigned blend_cntl = 0;
unsigned srcRGB_opt, dstRGB_opt, srcA_opt, dstA_opt; unsigned srcRGB_opt, dstRGB_opt, srcA_opt, dstA_opt;
unsigned eqRGB = info->cb.att[i].color_blend_op; VkBlendOp eqRGB = info->cb.att[i].color_blend_op;
unsigned srcRGB = info->cb.att[i].src_color_blend_factor; VkBlendFactor srcRGB = info->cb.att[i].src_color_blend_factor;
unsigned dstRGB = info->cb.att[i].dst_color_blend_factor; VkBlendFactor dstRGB = info->cb.att[i].dst_color_blend_factor;
unsigned eqA = info->cb.att[i].alpha_blend_op; VkBlendOp eqA = info->cb.att[i].alpha_blend_op;
unsigned srcA = info->cb.att[i].src_alpha_blend_factor; VkBlendFactor srcA = info->cb.att[i].src_alpha_blend_factor;
unsigned dstA = info->cb.att[i].dst_alpha_blend_factor; VkBlendFactor dstA = info->cb.att[i].dst_alpha_blend_factor;
blend.sx_mrt_blend_opt[i] = S_028760_COLOR_COMB_FCN(V_028760_OPT_COMB_BLEND_DISABLED) | blend.sx_mrt_blend_opt[i] = S_028760_COLOR_COMB_FCN(V_028760_OPT_COMB_BLEND_DISABLED) |
S_028760_ALPHA_COMB_FCN(V_028760_OPT_COMB_BLEND_DISABLED); S_028760_ALPHA_COMB_FCN(V_028760_OPT_COMB_BLEND_DISABLED);
@@ -753,23 +715,21 @@ radv_pipeline_init_blend_state(struct radv_graphics_pipeline *pipeline,
continue; continue;
} }
if (is_dual_src(gfx_level, srcRGB) || is_dual_src(gfx_level, dstRGB) || if (is_dual_src(srcRGB) || is_dual_src(dstRGB) || is_dual_src(srcA) || is_dual_src(dstA))
is_dual_src(gfx_level, srcA) || is_dual_src(gfx_level, dstA))
if (i == 0) if (i == 0)
blend.mrt0_is_dual_src = true; blend.mrt0_is_dual_src = true;
if (eqRGB == VK_BLEND_OP_MIN || eqRGB == VK_BLEND_OP_MAX) {
if (eqRGB == V_028780_COMB_MIN_DST_SRC || eqRGB == V_028780_COMB_MAX_DST_SRC) { srcRGB = VK_BLEND_FACTOR_ONE;
srcRGB = V_028780_BLEND_ONE; dstRGB = VK_BLEND_FACTOR_ONE;
dstRGB = V_028780_BLEND_ONE;
} }
if (eqA == V_028780_COMB_MIN_DST_SRC || eqA == V_028780_COMB_MAX_DST_SRC) { if (eqA == VK_BLEND_OP_MIN || eqA == VK_BLEND_OP_MAX) {
srcA = V_028780_BLEND_ONE; srcA = VK_BLEND_FACTOR_ONE;
dstA = V_028780_BLEND_ONE; dstA = VK_BLEND_FACTOR_ONE;
} }
radv_blend_check_commutativity(gfx_level, &blend, eqRGB, srcRGB, dstRGB, 0x7u << (4 * i)); radv_blend_check_commutativity(&blend, eqRGB, srcRGB, dstRGB, 0x7u << (4 * i));
radv_blend_check_commutativity(gfx_level, &blend, eqA, srcA, dstA, 0x8u << (4 * i)); radv_blend_check_commutativity(&blend, eqA, srcA, dstA, 0x8u << (4 * i));
/* Blending optimizations for RB+. /* Blending optimizations for RB+.
* These transformations don't change the behavior. * These transformations don't change the behavior.
@@ -777,14 +737,14 @@ radv_pipeline_init_blend_state(struct radv_graphics_pipeline *pipeline,
* First, get rid of DST in the blend factors: * First, get rid of DST in the blend factors:
* func(src * DST, dst * 0) ---> func(src * 0, dst * SRC) * func(src * DST, dst * 0) ---> func(src * 0, dst * SRC)
*/ */
si_blend_remove_dst(&eqRGB, &srcRGB, &dstRGB, V_028780_BLEND_DST_COLOR, si_blend_remove_dst(&eqRGB, &srcRGB, &dstRGB, VK_BLEND_FACTOR_DST_COLOR,
V_028780_BLEND_SRC_COLOR); VK_BLEND_FACTOR_SRC_COLOR);
si_blend_remove_dst(&eqA, &srcA, &dstA, V_028780_BLEND_DST_COLOR, si_blend_remove_dst(&eqA, &srcA, &dstA, VK_BLEND_FACTOR_DST_COLOR,
V_028780_BLEND_SRC_COLOR); VK_BLEND_FACTOR_SRC_COLOR);
si_blend_remove_dst(&eqA, &srcA, &dstA, V_028780_BLEND_DST_ALPHA, si_blend_remove_dst(&eqA, &srcA, &dstA, VK_BLEND_FACTOR_DST_ALPHA,
V_028780_BLEND_SRC_ALPHA); VK_BLEND_FACTOR_SRC_ALPHA);
/* Look up the ideal settings from tables. */ /* Look up the ideal settings from tables. */
srcRGB_opt = si_translate_blend_opt_factor(srcRGB, false); srcRGB_opt = si_translate_blend_opt_factor(srcRGB, false);
@@ -798,9 +758,9 @@ radv_pipeline_init_blend_state(struct radv_graphics_pipeline *pipeline,
if (si_blend_factor_uses_dst(srcA)) if (si_blend_factor_uses_dst(srcA))
dstA_opt = V_028760_BLEND_OPT_PRESERVE_NONE_IGNORE_NONE; dstA_opt = V_028760_BLEND_OPT_PRESERVE_NONE_IGNORE_NONE;
if (srcRGB == V_028780_BLEND_SRC_ALPHA_SATURATE && if (srcRGB == VK_BLEND_FACTOR_SRC_ALPHA_SATURATE &&
(dstRGB == V_028780_BLEND_ZERO || dstRGB == V_028780_BLEND_SRC_ALPHA || (dstRGB == VK_BLEND_FACTOR_ZERO || dstRGB == VK_BLEND_FACTOR_SRC_ALPHA ||
dstRGB == V_028780_BLEND_SRC_ALPHA_SATURATE)) dstRGB == VK_BLEND_FACTOR_SRC_ALPHA_SATURATE))
dstRGB_opt = V_028760_BLEND_OPT_PRESERVE_NONE_IGNORE_A0; dstRGB_opt = V_028760_BLEND_OPT_PRESERVE_NONE_IGNORE_A0;
/* Set the final value. */ /* Set the final value. */
@@ -811,24 +771,24 @@ radv_pipeline_init_blend_state(struct radv_graphics_pipeline *pipeline,
S_028760_ALPHA_COMB_FCN(si_translate_blend_opt_function(eqA)); S_028760_ALPHA_COMB_FCN(si_translate_blend_opt_function(eqA));
blend_cntl |= S_028780_ENABLE(1); blend_cntl |= S_028780_ENABLE(1);
blend_cntl |= S_028780_COLOR_COMB_FCN(eqRGB); blend_cntl |= S_028780_COLOR_COMB_FCN(si_translate_blend_function(eqRGB));
blend_cntl |= S_028780_COLOR_SRCBLEND(srcRGB); blend_cntl |= S_028780_COLOR_SRCBLEND(si_translate_blend_factor(gfx_level, srcRGB));
blend_cntl |= S_028780_COLOR_DESTBLEND(dstRGB); blend_cntl |= S_028780_COLOR_DESTBLEND(si_translate_blend_factor(gfx_level, dstRGB));
if (srcA != srcRGB || dstA != dstRGB || eqA != eqRGB) { if (srcA != srcRGB || dstA != dstRGB || eqA != eqRGB) {
blend_cntl |= S_028780_SEPARATE_ALPHA_BLEND(1); blend_cntl |= S_028780_SEPARATE_ALPHA_BLEND(1);
blend_cntl |= S_028780_ALPHA_COMB_FCN(eqA); blend_cntl |= S_028780_ALPHA_COMB_FCN(si_translate_blend_function(eqA));
blend_cntl |= S_028780_ALPHA_SRCBLEND(srcA); blend_cntl |= S_028780_ALPHA_SRCBLEND(si_translate_blend_factor(gfx_level, srcA));
blend_cntl |= S_028780_ALPHA_DESTBLEND(dstA); blend_cntl |= S_028780_ALPHA_DESTBLEND(si_translate_blend_factor(gfx_level, dstA));
} }
blend.cb_blend_control[i] = blend_cntl; blend.cb_blend_control[i] = blend_cntl;
blend.blend_enable_4bit |= 0xfu << (i * 4); blend.blend_enable_4bit |= 0xfu << (i * 4);
if (srcRGB == V_028780_BLEND_SRC_ALPHA || dstRGB == V_028780_BLEND_SRC_ALPHA || if (srcRGB == VK_BLEND_FACTOR_SRC_ALPHA || dstRGB == VK_BLEND_FACTOR_SRC_ALPHA ||
srcRGB == V_028780_BLEND_SRC_ALPHA_SATURATE || srcRGB == VK_BLEND_FACTOR_SRC_ALPHA_SATURATE ||
dstRGB == V_028780_BLEND_SRC_ALPHA_SATURATE || dstRGB == VK_BLEND_FACTOR_SRC_ALPHA_SATURATE ||
srcRGB == V_028780_BLEND_ONE_MINUS_SRC_ALPHA || srcRGB == VK_BLEND_FACTOR_ONE_MINUS_SRC_ALPHA ||
dstRGB == V_028780_BLEND_ONE_MINUS_SRC_ALPHA) dstRGB == VK_BLEND_FACTOR_ONE_MINUS_SRC_ALPHA)
blend.need_src_alpha |= 1 << i; blend.need_src_alpha |= 1 << i;
} }
for (i = info->cb.att_count; i < 8; i++) { for (i = info->cb.att_count; i < 8; i++) {
@@ -1879,7 +1839,6 @@ static struct radv_color_blend_info
radv_pipeline_init_color_blend_info(struct radv_graphics_pipeline *pipeline, radv_pipeline_init_color_blend_info(struct radv_graphics_pipeline *pipeline,
const VkGraphicsPipelineCreateInfo *pCreateInfo) const VkGraphicsPipelineCreateInfo *pCreateInfo)
{ {
const struct radv_physical_device *pdevice = pipeline->base.device->physical_device;
const VkPipelineColorBlendStateCreateInfo *cb = pCreateInfo->pColorBlendState; const VkPipelineColorBlendStateCreateInfo *cb = pCreateInfo->pColorBlendState;
const VkPipelineRenderingCreateInfo *ri = const VkPipelineRenderingCreateInfo *ri =
vk_find_struct_const(pCreateInfo->pNext, PIPELINE_RENDERING_CREATE_INFO); vk_find_struct_const(pCreateInfo->pNext, PIPELINE_RENDERING_CREATE_INFO);
@@ -1899,16 +1858,12 @@ radv_pipeline_init_color_blend_info(struct radv_graphics_pipeline *pipeline,
info.att[i].color_write_mask = att->colorWriteMask; info.att[i].color_write_mask = att->colorWriteMask;
info.att[i].blend_enable = att->blendEnable; info.att[i].blend_enable = att->blendEnable;
info.att[i].color_blend_op = si_translate_blend_function(att->colorBlendOp); info.att[i].color_blend_op = att->colorBlendOp;
info.att[i].alpha_blend_op = si_translate_blend_function(att->alphaBlendOp); info.att[i].alpha_blend_op = att->alphaBlendOp;
info.att[i].src_color_blend_factor = info.att[i].src_color_blend_factor = att->srcColorBlendFactor;
si_translate_blend_factor(pdevice->rad_info.gfx_level, att->srcColorBlendFactor); info.att[i].dst_color_blend_factor = att->dstColorBlendFactor;
info.att[i].dst_color_blend_factor = info.att[i].src_alpha_blend_factor = att->srcAlphaBlendFactor;
si_translate_blend_factor(pdevice->rad_info.gfx_level, att->dstColorBlendFactor); info.att[i].dst_alpha_blend_factor = att->dstAlphaBlendFactor;
info.att[i].src_alpha_blend_factor =
si_translate_blend_factor(pdevice->rad_info.gfx_level, att->srcAlphaBlendFactor);
info.att[i].dst_alpha_blend_factor =
si_translate_blend_factor(pdevice->rad_info.gfx_level, att->dstAlphaBlendFactor);
} }
info.att_count = cb->attachmentCount; info.att_count = cb->attachmentCount;

View File

@@ -2061,12 +2061,12 @@ struct radv_color_blend_info {
struct { struct {
uint8_t color_write_mask; uint8_t color_write_mask;
bool blend_enable; bool blend_enable;
uint16_t color_blend_op; VkBlendOp color_blend_op;
uint16_t alpha_blend_op; VkBlendOp alpha_blend_op;
uint16_t src_color_blend_factor; VkBlendFactor src_color_blend_factor;
uint16_t dst_color_blend_factor; VkBlendFactor dst_color_blend_factor;
uint16_t src_alpha_blend_factor; VkBlendFactor src_alpha_blend_factor;
uint16_t dst_alpha_blend_factor; VkBlendFactor dst_alpha_blend_factor;
} att[MAX_RTS]; } att[MAX_RTS];
}; };