[13/15] gallium: add entry_point field to pipe_compute_state

Submitted by Karol Herbst on May 11, 2019, 2:07 p.m.

Details

Message ID 20190511140712.27095-14-kherbst@redhat.com
State New
Headers show
Series "Clover: support CL through SPIR-V" ( rev: 1 ) in Mesa

Not browsing as part of any series.

Commit Message

Karol Herbst May 11, 2019, 2:07 p.m.
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@redhat.com>
---
 src/gallium/include/pipe/p_state.h                | 1 +
 src/gallium/state_trackers/clover/core/kernel.cpp | 1 +
 2 files changed, 2 insertions(+)

Patch hide | download patch | download mbox

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