From e42950fe96408c4addcc31990787dc5cca537476 Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Thu, 21 May 2020 17:01:38 -0400 Subject: [PATCH] panfrost: Use internal_format throughout Fixes R32F_S8 texturing. Signed-off-by: Alyssa Rosenzweig Part-of: --- .gitlab-ci/deqp-panfrost-t860-fails.txt | 49 --------------------- src/gallium/drivers/panfrost/pan_resource.c | 17 +++---- 2 files changed, 9 insertions(+), 57 deletions(-) diff --git a/.gitlab-ci/deqp-panfrost-t860-fails.txt b/.gitlab-ci/deqp-panfrost-t860-fails.txt index 89dc6bcae3f..a3485c445db 100644 --- a/.gitlab-ci/deqp-panfrost-t860-fails.txt +++ b/.gitlab-ci/deqp-panfrost-t860-fails.txt @@ -561,26 +561,6 @@ dEQP-GLES3.functional.shaders.texture_functions.texture.samplercubeshadow_fragme dEQP-GLES3.functional.shaders.texture_functions.texture.samplercubeshadow_vertex dEQP-GLES3.functional.state_query.integers.max_samples_getfloat dEQP-GLES3.functional.state_query.integers.max_samples_getinteger64 -dEQP-GLES3.functional.texture.format.sized.2d_array.depth24_stencil8_npot -dEQP-GLES3.functional.texture.format.sized.2d_array.depth24_stencil8_pot -dEQP-GLES3.functional.texture.format.sized.2d_array.depth_component16_npot -dEQP-GLES3.functional.texture.format.sized.2d_array.depth_component16_pot -dEQP-GLES3.functional.texture.format.sized.2d_array.depth_component24_npot -dEQP-GLES3.functional.texture.format.sized.2d_array.depth_component24_pot -dEQP-GLES3.functional.texture.format.sized.2d.depth24_stencil8_npot -dEQP-GLES3.functional.texture.format.sized.2d.depth24_stencil8_pot -dEQP-GLES3.functional.texture.format.sized.2d.depth32f_stencil8_npot -dEQP-GLES3.functional.texture.format.sized.2d.depth32f_stencil8_pot -dEQP-GLES3.functional.texture.format.sized.2d.depth_component16_npot -dEQP-GLES3.functional.texture.format.sized.2d.depth_component16_pot -dEQP-GLES3.functional.texture.format.sized.2d.depth_component24_npot -dEQP-GLES3.functional.texture.format.sized.2d.depth_component24_pot -dEQP-GLES3.functional.texture.format.sized.cube.depth24_stencil8_npot -dEQP-GLES3.functional.texture.format.sized.cube.depth24_stencil8_pot -dEQP-GLES3.functional.texture.format.sized.cube.depth_component16_npot -dEQP-GLES3.functional.texture.format.sized.cube.depth_component16_pot -dEQP-GLES3.functional.texture.format.sized.cube.depth_component24_npot -dEQP-GLES3.functional.texture.format.sized.cube.depth_component24_pot dEQP-GLES3.functional.texture.shadow.2d_array.linear.greater_depth24_stencil8 dEQP-GLES3.functional.texture.shadow.2d_array.linear.greater_depth_component16 dEQP-GLES3.functional.texture.shadow.2d_array.linear.greater_or_equal_depth24_stencil8 @@ -696,32 +676,3 @@ dEQP-GLES3.functional.texture.shadow.cube.nearest_mipmap_nearest.greater_or_equa dEQP-GLES3.functional.texture.shadow.cube.nearest_mipmap_nearest.less_depth_component16 dEQP-GLES3.functional.texture.shadow.cube.nearest_mipmap_nearest.less_or_equal_depth24_stencil8 dEQP-GLES3.functional.texture.shadow.cube.nearest_mipmap_nearest.less_or_equal_depth_component16 -dEQP-GLES3.functional.texture.specification.teximage2d_depth.depth24_stencil8 -dEQP-GLES3.functional.texture.specification.teximage2d_depth.depth32f_stencil8 -dEQP-GLES3.functional.texture.specification.teximage2d_depth.depth_component16 -dEQP-GLES3.functional.texture.specification.teximage2d_depth.depth_component24 -dEQP-GLES3.functional.texture.specification.teximage2d_depth_pbo.depth24_stencil8 -dEQP-GLES3.functional.texture.specification.teximage2d_depth_pbo.depth32f_stencil8 -dEQP-GLES3.functional.texture.specification.teximage2d_depth_pbo.depth_component16 -dEQP-GLES3.functional.texture.specification.teximage2d_depth_pbo.depth_component24 -dEQP-GLES3.functional.texture.specification.teximage3d_depth.depth24_stencil8_2d_array -dEQP-GLES3.functional.texture.specification.teximage3d_depth.depth_component16_2d_array -dEQP-GLES3.functional.texture.specification.teximage3d_depth_pbo.depth24_stencil8_2d_array -dEQP-GLES3.functional.texture.specification.teximage3d_depth_pbo.depth_component16_2d_array -dEQP-GLES3.functional.texture.specification.texstorage2d.format.depth24_stencil8_2d -dEQP-GLES3.functional.texture.specification.texstorage2d.format.depth24_stencil8_cube -dEQP-GLES3.functional.texture.specification.texstorage2d.format.depth32f_stencil8_2d -dEQP-GLES3.functional.texture.specification.texstorage2d.format.depth_component16_2d -dEQP-GLES3.functional.texture.specification.texstorage2d.format.depth_component24_2d -dEQP-GLES3.functional.texture.specification.texstorage2d.format.depth_component24_cube -dEQP-GLES3.functional.texture.specification.texstorage3d.format.depth24_stencil8_2d_array -dEQP-GLES3.functional.texture.specification.texstorage3d.format.depth_component16_2d_array -dEQP-GLES3.functional.texture.specification.texstorage3d.format.depth_component24_2d_array -dEQP-GLES3.functional.texture.specification.texsubimage2d_depth.depth24_stencil8 -dEQP-GLES3.functional.texture.specification.texsubimage2d_depth.depth32f_stencil8 -dEQP-GLES3.functional.texture.specification.texsubimage2d_depth.depth_component16 -dEQP-GLES3.functional.texture.specification.texsubimage2d_depth.depth_component24 -dEQP-GLES3.functional.texture.specification.texsubimage3d_depth.depth24_stencil8_2d_array -dEQP-GLES3.functional.texture.specification.texsubimage3d_depth.depth32f_stencil8_2d_array -dEQP-GLES3.functional.texture.specification.texsubimage3d_depth.depth_component16_2d_array -dEQP-GLES3.functional.texture.specification.texsubimage3d_depth.depth_component24_2d_array diff --git a/src/gallium/drivers/panfrost/pan_resource.c b/src/gallium/drivers/panfrost/pan_resource.c index 2e0a2953de8..5ae67ede233 100644 --- a/src/gallium/drivers/panfrost/pan_resource.c +++ b/src/gallium/drivers/panfrost/pan_resource.c @@ -270,7 +270,7 @@ panfrost_setup_slices(struct panfrost_resource *pres, size_t *bo_size) unsigned width = res->width0; unsigned height = res->height0; unsigned depth = res->depth0; - unsigned bytes_per_pixel = util_format_get_blocksize(res->format); + unsigned bytes_per_pixel = util_format_get_blocksize(pres->internal_format); assert(depth > 0); @@ -319,7 +319,7 @@ panfrost_setup_slices(struct panfrost_resource *pres, size_t *bo_size) /* Compute the would-be stride */ unsigned stride = bytes_per_pixel * effective_width; - if (util_format_is_compressed(res->format)) + if (util_format_is_compressed(pres->internal_format)) stride /= 4; /* ..but cache-line align it for performance */ @@ -409,7 +409,7 @@ panfrost_resource_create_bo(struct panfrost_device *dev, struct panfrost_resourc PIPE_BIND_SAMPLER_VIEW | PIPE_BIND_DISPLAY_TARGET; - unsigned bpp = util_format_get_blocksizebits(res->format); + unsigned bpp = util_format_get_blocksizebits(pres->internal_format); bool is_2d = (res->target == PIPE_TEXTURE_2D) || (res->target == PIPE_TEXTURE_RECT); bool is_sane_bpp = bpp == 8 || bpp == 16 || bpp == 24 || bpp == 32 || bpp == 64 || bpp == 128; bool should_tile = (res->usage != PIPE_USAGE_STREAM); @@ -576,8 +576,8 @@ panfrost_transfer_map(struct pipe_context *pctx, struct pipe_transfer **out_transfer) { struct panfrost_context *ctx = pan_context(pctx); - int bytes_per_pixel = util_format_get_blocksize(resource->format); struct panfrost_resource *rsrc = pan_resource(resource); + int bytes_per_pixel = util_format_get_blocksize(rsrc->internal_format); struct panfrost_bo *bo = rsrc->bo; struct panfrost_gtransfer *transfer = rzalloc(pctx, struct panfrost_gtransfer); @@ -666,7 +666,7 @@ panfrost_transfer_map(struct pipe_context *pctx, box->x, box->y, box->width, box->height, transfer->base.stride, rsrc->slices[level].stride, - resource->format); + rsrc->internal_format); } } @@ -731,7 +731,7 @@ panfrost_transfer_unmap(struct pipe_context *pctx, transfer->box.width, transfer->box.height, prsrc->slices[transfer->level].stride, transfer->stride, - prsrc->base.format); + prsrc->internal_format); } } } @@ -774,7 +774,8 @@ panfrost_invalidate_resource(struct pipe_context *pctx, struct pipe_resource *pr } static enum pipe_format -panfrost_resource_get_internal_format(struct pipe_resource *rsrc) { +panfrost_resource_get_internal_format(struct pipe_resource *rsrc) +{ struct panfrost_resource *prsrc = (struct panfrost_resource *) rsrc; return prsrc->internal_format; } @@ -865,7 +866,7 @@ panfrost_resource_hint_layout( /* Check if the preferred layout is legal for this buffer */ if (layout == MALI_TEXTURE_AFBC) { - bool can_afbc = panfrost_format_supports_afbc(rsrc->base.format); + bool can_afbc = panfrost_format_supports_afbc(rsrc->internal_format); bool is_scanout = rsrc->base.bind & (PIPE_BIND_DISPLAY_TARGET | PIPE_BIND_SCANOUT | PIPE_BIND_SHARED); -- 2.30.2