mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-20 09:30:13 +01:00
pan/lib: prepare for pixel local storage support
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com> Reviewed-by: Eric R. Smith <eric.smith@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37110>
This commit is contained in:
parent
dfddcae916
commit
c15a43cce0
2 changed files with 13 additions and 4 deletions
|
|
@ -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) {
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue