v3d/compiler: remove requirement for format information for fbfetch

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34742>
This commit is contained in:
Ella Stanforth 2025-05-01 09:04:40 +01:00 committed by Marge Bot
parent 9a71e6dcc2
commit b3cc871b7c
4 changed files with 4 additions and 10 deletions

View file

@ -2595,9 +2595,8 @@ vir_emit_tlb_color_read(struct v3d_compile *c, nir_intrinsic_instr *instr)
&c->color_reads[(rt * V3D_MAX_SAMPLES + sample_index) * 4];
if (color_reads_for_sample[component].file == QFILE_NULL) {
enum pipe_format rt_format = c->fs_key->color_fmt[rt].format;
int num_components =
util_format_get_nr_components(rt_format);
nir_variable *var = c->output_color_var[rt];
int num_components = glsl_get_vector_elements(var->type);
const bool swap_rb = c->fs_key->swap_color_rb & (1 << rt);
if (swap_rb)

View file

@ -6,18 +6,15 @@
nir_def *
v3d_nir_get_tlb_color(nir_builder *b, struct v3d_compile *c, int rt, int sample)
{
uint32_t num_components =
util_format_get_nr_components(c->fs_key->color_fmt[rt].format);
nir_def *color[4];
for (int i = 0; i < num_components; i++) {
for (int i = 0; i < 4; i++) {
color[i] =
nir_load_tlb_color_brcm(b, 1, 32,
nir_imm_int(b, rt),
.base = sample,
.component = i);
}
return nir_pad_vec4(b, nir_vec(b, color, num_components));
return nir_vec(b, color, 4);
}
static bool

View file

@ -1107,7 +1107,6 @@ v3d_fs_key_set_color_attachment(struct v3d_fs_key *key,
* need to know the color buffer format and swizzle for that
*/
if (key->logicop_func != PIPE_LOGICOP_COPY ||
p_stage->nir->info.fs.uses_fbfetch_output ||
key->software_blend) {
/* Framebuffer formats should be single plane */
assert(vk_format_get_plane_count(fb_format) == 1);

View file

@ -646,7 +646,6 @@ v3d_update_compiled_fs(struct v3d_context *v3d, uint8_t prim_mode)
* swizzle.
*/
if (key->logicop_func != PIPE_LOGICOP_COPY ||
s->info.fs.uses_fbfetch_output ||
key->software_blend) {
key->color_fmt[i].format = cbuf->format;