[Mesa-dev] [PATCH 13/15] gallium: add entry_point field to pipe_compute_state
Karol Herbst
kherbst at redhat.com
Sat May 11 14:07:10 UTC 2019
for binaries containing multiple entry_points the driver can if this field is
set, optimize the binary in order to save memory.
For spir-v it can be used to compile against a specific entry_point. It is
guarenteed that the pc field can be ignored by the driver later if it decides
to do so.
Signed-off-by: Karol Herbst <kherbst at redhat.com>
---
src/gallium/include/pipe/p_state.h | 1 +
src/gallium/state_trackers/clover/core/kernel.cpp | 1 +
2 files changed, 2 insertions(+)
diff --git a/src/gallium/include/pipe/p_state.h b/src/gallium/include/pipe/p_state.h
index c94dfb0ba78..d043f0d19af 100644
--- a/src/gallium/include/pipe/p_state.h
+++ b/src/gallium/include/pipe/p_state.h
@@ -894,6 +894,7 @@ struct pipe_compute_state
unsigned req_local_mem; /**< Required size of the LOCAL resource. */
unsigned req_private_mem; /**< Required size of the PRIVATE resource. */
unsigned req_input_mem; /**< Required size of the INPUT resource. */
+ const char *entry_point; /**< name of the entry point. */
};
/**
diff --git a/src/gallium/state_trackers/clover/core/kernel.cpp b/src/gallium/state_trackers/clover/core/kernel.cpp
index 7fe66ae4ea2..5ac66ab91c7 100644
--- a/src/gallium/state_trackers/clover/core/kernel.cpp
+++ b/src/gallium/state_trackers/clover/core/kernel.cpp
@@ -230,6 +230,7 @@ kernel::exec_context::bind(intrusive_ptr<command_queue> _q,
cs.prog = &(msec.data[0]);
cs.req_local_mem = mem_local;
cs.req_input_mem = input.size();
+ cs.entry_point = kern.name().c_str();
st = q->pipe->create_compute_state(q->pipe, &cs);
if (!st) {
unbind(); // Cleanup
--
2.21.0
More information about the mesa-dev
mailing list