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 <kher...@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

_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to