diff --git a/src/panfrost/lib/pan_desc.c b/src/panfrost/lib/pan_desc.c index e3d3915f111..bfd2d572b3f 100644 --- a/src/panfrost/lib/pan_desc.c +++ b/src/panfrost/lib/pan_desc.c @@ -490,6 +490,11 @@ pan_cbuf_bytes_per_pixel(const struct pan_fb_info *fb) sum += rt_size; } + if (fb->pls_enabled) { + /* need at least 16 bytes per pixel for pixel local storage */ + sum = MAX2(sum, 16); + } + return sum; } @@ -639,7 +644,7 @@ static bool pan_force_clean_write_on(const struct pan_image *img, unsigned tile_ static struct MALI_RT_CLEAR rt_clear(const struct pan_fb_color_attachment *rt) { - if (!rt->clear) + if (!rt || !rt->clear) return (struct MALI_RT_CLEAR){0}; return (struct MALI_RT_CLEAR){ @@ -927,10 +932,8 @@ pan_emit_rt(const struct pan_fb_info *fb, unsigned layer_idx, unsigned idx, cfg.clear = rt_clear(&fb->rts[idx]); cfg.dithering_enable = true; cfg.internal_format = MALI_COLOR_BUFFER_INTERNAL_FORMAT_R8G8B8A8; - cfg.internal_buffer_offset = cbuf_offset; #if PAN_ARCH >= 7 cfg.writeback_block_format = MALI_BLOCK_FORMAT_TILED_U_INTERLEAVED; - cfg.dithering_enable = true; #endif } @@ -1121,7 +1124,10 @@ GENX(pan_emit_fbd)(const struct pan_fb_info *fb, unsigned layer_idx, * This can be used to read SYSTEM_VALUE_SAMPLE_MASK_IN from the * fragment shader, even when performing single-sampled rendering. */ - if (!fb->force_samples) { + if (fb->pls_enabled) { + cfg.sample_count = 4; + cfg.sample_pattern = pan_sample_pattern(1); + } else if (!fb->force_samples) { cfg.sample_count = fb->nr_samples; cfg.sample_pattern = pan_sample_pattern(fb->nr_samples); } else if (fb->force_samples == 1) { diff --git a/src/panfrost/lib/pan_desc.h b/src/panfrost/lib/pan_desc.h index b021ebc523a..af067b0cad5 100644 --- a/src/panfrost/lib/pan_desc.h +++ b/src/panfrost/lib/pan_desc.h @@ -170,6 +170,9 @@ struct pan_fb_info { /* Only used on Valhall */ bool sprite_coord_origin; bool first_provoking_vertex; + + /* indicates whether pixel local storage is enabled */ + bool pls_enabled; }; static inline unsigned