diff options
author | Alyssa Rosenzweig <[email protected]> | 2020-07-15 11:39:08 -0400 |
---|---|---|
committer | Marge Bot <[email protected]> | 2020-07-15 22:19:37 +0000 |
commit | 6088891ef79e4a1a2111ffc76ae10697005df3dd (patch) | |
tree | 2fc526938edcebc8c7396fe3d66af522d80e320b /src/panfrost | |
parent | 5c65a27adc69e24cda053cfad85c0973926348aa (diff) |
panfrost: Include sample count in payload estimates
Otherwise we might not reserve enough space.
Signed-off-by: Alyssa Rosenzweig <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5929>
Diffstat (limited to 'src/panfrost')
-rw-r--r-- | src/panfrost/encoder/pan_texture.c | 5 | ||||
-rw-r--r-- | src/panfrost/encoder/pan_texture.h | 1 |
2 files changed, 5 insertions, 1 deletions
diff --git a/src/panfrost/encoder/pan_texture.c b/src/panfrost/encoder/pan_texture.c index c270ececd45..da436ea7318 100644 --- a/src/panfrost/encoder/pan_texture.c +++ b/src/panfrost/encoder/pan_texture.c @@ -125,6 +125,7 @@ static unsigned panfrost_texture_num_elements( unsigned first_level, unsigned last_level, unsigned first_layer, unsigned last_layer, + unsigned nr_samples, bool is_cube, bool manual_stride) { unsigned first_face = 0, last_face = 0; @@ -137,7 +138,7 @@ panfrost_texture_num_elements( unsigned levels = 1 + last_level - first_level; unsigned layers = 1 + last_layer - first_layer; unsigned faces = 1 + last_face - first_face; - unsigned num_elements = levels * layers * faces; + unsigned num_elements = levels * layers * faces * MAX2(nr_samples, 1); if (manual_stride) num_elements *= 2; @@ -155,6 +156,7 @@ unsigned panfrost_estimate_texture_payload_size( unsigned first_level, unsigned last_level, unsigned first_layer, unsigned last_layer, + unsigned nr_samples, enum mali_texture_type type, enum mali_texture_layout layout) { /* Assume worst case */ @@ -163,6 +165,7 @@ panfrost_estimate_texture_payload_size( unsigned elements = panfrost_texture_num_elements( first_level, last_level, first_layer, last_layer, + nr_samples, type == MALI_TEX_CUBE, manual_stride); return sizeof(mali_ptr) * elements; diff --git a/src/panfrost/encoder/pan_texture.h b/src/panfrost/encoder/pan_texture.h index e8c68c005bb..ea1a1ff0fe1 100644 --- a/src/panfrost/encoder/pan_texture.h +++ b/src/panfrost/encoder/pan_texture.h @@ -72,6 +72,7 @@ unsigned panfrost_estimate_texture_payload_size( unsigned first_level, unsigned last_level, unsigned first_layer, unsigned last_layer, + unsigned nr_samples, enum mali_texture_type type, enum mali_texture_layout layout); void |