asahi,hk: disentangle logicop_enable

logicop_func=COPY is different from logicop_enable due to overriding blending.
maintain the info we need to implement properly. fixes

dEQP-VK.pipeline.shader_object_unlinked_binary.logic_op_na_formats.r32g32b32a32_sfloat.copy_blend

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34426>
This commit is contained in:
Alyssa Rosenzweig 2025-04-06 14:40:31 -04:00 committed by Marge Bot
parent 045880c8a6
commit 924075cd56
4 changed files with 6 additions and 7 deletions

View file

@ -107,7 +107,7 @@ struct agx_blend_key {
struct agx_blend_rt_key rt[8]; struct agx_blend_rt_key rt[8];
uint8_t logicop_func; uint8_t logicop_func;
bool alpha_to_coverage, alpha_to_one; bool alpha_to_coverage, alpha_to_one;
bool padding; bool logicop_enable;
}; };
static_assert(sizeof(struct agx_blend_key) == 36, "packed"); static_assert(sizeof(struct agx_blend_key) == 36, "packed");

View file

@ -392,7 +392,7 @@ agx_nir_fs_epilog(nir_builder *b, const void *key_)
bool force_translucent = false; bool force_translucent = false;
nir_lower_blend_options opts = { nir_lower_blend_options opts = {
.scalar_blend_const = true, .scalar_blend_const = true,
.logicop_enable = key->blend.logicop_func != PIPE_LOGICOP_COPY, .logicop_enable = key->blend.logicop_enable,
.logicop_func = key->blend.logicop_func, .logicop_func = key->blend.logicop_func,
}; };

View file

@ -2738,9 +2738,8 @@ hk_flush_dynamic_state(struct hk_cmd_buffer *cmd, struct hk_cs *cs,
.nr_samples = MAX2(dyn->ms.rasterization_samples, 1), .nr_samples = MAX2(dyn->ms.rasterization_samples, 1),
.blend.alpha_to_coverage = dyn->ms.alpha_to_coverage_enable, .blend.alpha_to_coverage = dyn->ms.alpha_to_coverage_enable,
.blend.alpha_to_one = dyn->ms.alpha_to_one_enable, .blend.alpha_to_one = dyn->ms.alpha_to_one_enable,
.blend.logicop_func = dyn->cb.logic_op_enable .blend.logicop_enable = dyn->cb.logic_op_enable,
? vk_logic_op_to_pipe(dyn->cb.logic_op) .blend.logicop_func = vk_logic_op_to_pipe(dyn->cb.logic_op),
: PIPE_LOGICOP_COPY,
}; };
for (unsigned rt = 0; rt < ARRAY_SIZE(dyn->cal.color_map); ++rt) { for (unsigned rt = 0; rt < ARRAY_SIZE(dyn->cal.color_map); ++rt) {

View file

@ -209,8 +209,8 @@ agx_create_blend_state(struct pipe_context *ctx,
key->alpha_to_coverage = state->alpha_to_coverage; key->alpha_to_coverage = state->alpha_to_coverage;
key->alpha_to_one = state->alpha_to_one; key->alpha_to_one = state->alpha_to_one;
key->logicop_func = key->logicop_enable = state->logicop_enable;
state->logicop_enable ? state->logicop_func : PIPE_LOGICOP_COPY; key->logicop_func = state->logicop_func;
for (unsigned i = 0; i < PIPE_MAX_COLOR_BUFS; ++i) { for (unsigned i = 0; i < PIPE_MAX_COLOR_BUFS; ++i) {
unsigned rti = state->independent_blend_enable ? i : 0; unsigned rti = state->independent_blend_enable ? i : 0;