Mesa (main): panfrost: Inline pan_prepare_shader_descriptor
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Wed May 26 18:19:23 UTC 2021
Module: Mesa
Branch: main
Commit: 7b4a76f493f4e28017b911ad64b2f2c70d2c1a03
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=7b4a76f493f4e28017b911ad64b2f2c70d2c1a03
Author: Alyssa Rosenzweig <alyssa at collabora.com>
Date: Mon May 24 17:24:52 2021 -0400
panfrost: Inline pan_prepare_shader_descriptor
Complicates the next patch.
Signed-off-by: Alyssa Rosenzweig <alyssa at collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10976>
---
src/gallium/drivers/panfrost/pan_assemble.c | 40 ++++++++++++-----------------
1 file changed, 16 insertions(+), 24 deletions(-)
diff --git a/src/gallium/drivers/panfrost/pan_assemble.c b/src/gallium/drivers/panfrost/pan_assemble.c
index 79fbc9614dc..de9cbc76bd5 100644
--- a/src/gallium/drivers/panfrost/pan_assemble.c
+++ b/src/gallium/drivers/panfrost/pan_assemble.c
@@ -39,28 +39,6 @@
#include "tgsi/tgsi_dump.h"
-static void
-pan_prepare_shader_descriptor(struct panfrost_context *ctx,
- struct panfrost_shader_state *state,
- bool upload)
-{
- const struct panfrost_device *dev = pan_device(ctx->base.screen);
- struct mali_renderer_state_packed *out = &state->partial_rsd;
-
- if (upload) {
- struct panfrost_ptr ptr =
- panfrost_pool_alloc_desc(&ctx->descs, RENDERER_STATE);
-
- state->state = pan_take_ref(&ctx->descs, ptr.gpu);
- out = ptr.cpu;
- }
-
- pan_pack(out, RENDERER_STATE, cfg) {
- pan_shader_prepare_rsd(dev, &state->info, state->bin.gpu,
- &cfg);
- }
-}
-
void
panfrost_shader_compile(struct panfrost_context *ctx,
enum pipe_shader_ir ir_type,
@@ -104,8 +82,22 @@ panfrost_shader_compile(struct panfrost_context *ctx,
binary.data, binary.size, 128));
}
- pan_prepare_shader_descriptor(ctx, state,
- stage != MESA_SHADER_FRAGMENT);
+ struct mali_renderer_state_packed *out = &state->partial_rsd;
+
+ /* Upload RSDs for non-fragment shaders. Fragment shaders need draw
+ * time finalization based on the renderer state. */
+ if (stage != MESA_SHADER_FRAGMENT) {
+ struct panfrost_ptr ptr =
+ panfrost_pool_alloc_desc(&ctx->descs, RENDERER_STATE);
+
+ state->state = pan_take_ref(&ctx->descs, ptr.gpu);
+ out = ptr.cpu;
+ }
+
+ pan_pack(out, RENDERER_STATE, cfg) {
+ pan_shader_prepare_rsd(dev, &state->info, state->bin.gpu,
+ &cfg);
+ }
util_dynarray_fini(&binary);
More information about the mesa-commit
mailing list