aboutsummaryrefslogtreecommitdiffstats
path: root/src/panfrost
diff options
context:
space:
mode:
authorAlyssa Rosenzweig <[email protected]>2020-06-30 16:43:32 -0400
committerMarge Bot <[email protected]>2020-07-07 01:13:39 +0000
commit41c06deb63036181df5db8e3e6011211ac874d5c (patch)
tree74f67876e54dd8894a24f8886912a8d8fb61b04e /src/panfrost
parent95afda39a667553db1e8089a99fbcd40537efd2d (diff)
panfrost: Index texture by sample
This will allow MSAA to route through. Signed-off-by: Alyssa Rosenzweig <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5782>
Diffstat (limited to 'src/panfrost')
-rw-r--r--src/panfrost/encoder/pan_texture.c9
-rw-r--r--src/panfrost/encoder/pan_texture.h4
2 files changed, 10 insertions, 3 deletions
diff --git a/src/panfrost/encoder/pan_texture.c b/src/panfrost/encoder/pan_texture.c
index d51ff0dff72..54a5398e299 100644
--- a/src/panfrost/encoder/pan_texture.c
+++ b/src/panfrost/encoder/pan_texture.c
@@ -197,6 +197,7 @@ panfrost_emit_texture_payload(
unsigned width, unsigned height,
unsigned first_level, unsigned last_level,
unsigned first_layer, unsigned last_layer,
+ unsigned nr_samples,
unsigned cube_stride,
bool manual_stride,
mali_ptr base,
@@ -246,6 +247,7 @@ panfrost_new_texture(
enum mali_texture_layout layout,
unsigned first_level, unsigned last_level,
unsigned first_layer, unsigned last_layer,
+ unsigned nr_samples,
unsigned cube_stride,
unsigned swizzle,
mali_ptr base,
@@ -293,6 +295,7 @@ panfrost_new_texture(
width, height,
first_level, last_level,
first_layer, last_layer,
+ nr_samples,
cube_stride,
manual_stride,
base,
@@ -309,6 +312,7 @@ panfrost_new_texture_bifrost(
enum mali_texture_layout layout,
unsigned first_level, unsigned last_level,
unsigned first_layer, unsigned last_layer,
+ unsigned nr_samples,
unsigned cube_stride,
unsigned swizzle,
mali_ptr base,
@@ -330,6 +334,7 @@ panfrost_new_texture_bifrost(
width, height,
first_level, last_level,
first_layer, last_layer,
+ nr_samples,
cube_stride,
true, /* Stride explicit on Bifrost */
base,
@@ -390,8 +395,8 @@ panfrost_get_layer_stride(struct panfrost_slice *slices, bool is_3d, unsigned cu
* the base address of a texture to get the address to that level/face */
unsigned
-panfrost_texture_offset(struct panfrost_slice *slices, bool is_3d, unsigned cube_stride, unsigned level, unsigned face)
+panfrost_texture_offset(struct panfrost_slice *slices, bool is_3d, unsigned cube_stride, unsigned level, unsigned face, unsigned sample)
{
unsigned layer_stride = panfrost_get_layer_stride(slices, is_3d, cube_stride, level);
- return slices[level].offset + (face * layer_stride);
+ return slices[level].offset + (face * layer_stride) + (sample * slices[level].size0);
}
diff --git a/src/panfrost/encoder/pan_texture.h b/src/panfrost/encoder/pan_texture.h
index f84e0a484a5..e8c68c005bb 100644
--- a/src/panfrost/encoder/pan_texture.h
+++ b/src/panfrost/encoder/pan_texture.h
@@ -84,6 +84,7 @@ panfrost_new_texture(
enum mali_texture_layout layout,
unsigned first_level, unsigned last_level,
unsigned first_layer, unsigned last_layer,
+ unsigned nr_samples,
unsigned cube_stride,
unsigned swizzle,
mali_ptr base,
@@ -99,6 +100,7 @@ panfrost_new_texture_bifrost(
enum mali_texture_layout layout,
unsigned first_level, unsigned last_level,
unsigned first_layer, unsigned last_layer,
+ unsigned nr_samples,
unsigned cube_stride,
unsigned swizzle,
mali_ptr base,
@@ -110,7 +112,7 @@ unsigned
panfrost_get_layer_stride(struct panfrost_slice *slices, bool is_3d, unsigned cube_stride, unsigned level);
unsigned
-panfrost_texture_offset(struct panfrost_slice *slices, bool is_3d, unsigned cube_stride, unsigned level, unsigned face);
+panfrost_texture_offset(struct panfrost_slice *slices, bool is_3d, unsigned cube_stride, unsigned level, unsigned face, unsigned sample);
/* Formats */