[Mesa-dev] [PATCH 11/11] gallium/compute: Drop TGSI dependency.

Francisco Jerez currojerez at riseup.net
Thu Mar 22 17:40:40 PDT 2012


This is mainly to accomodate AMD's LLVM compiler back-end by letting
it bypass the TGSI representation.  Other drivers will keep using the
common TGSI instruction set for compute shaders.
---
 src/gallium/docs/source/screen.rst   |    5 +++++
 src/gallium/include/pipe/p_defines.h |    1 +
 src/gallium/include/pipe/p_state.h   |    2 +-
 3 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/src/gallium/docs/source/screen.rst b/src/gallium/docs/source/screen.rst
index 622731f..0bce307 100644
--- a/src/gallium/docs/source/screen.rst
+++ b/src/gallium/docs/source/screen.rst
@@ -183,6 +183,11 @@ PIPE_COMPUTE_CAP_*
 Compute-specific capabilities. They can be queried using
 pipe_screen::get_compute_param.
 
+* ``PIPE_COMPUTE_CAP_IR_TARGET``: Desired representation of the
+  compute program.  Its value should be a target triple specification
+  of the form ``processor-manufacturer-os`` that will be passed on to
+  the compiler, or ``tgsi`` if the driver accepts compute programs in
+  the common TGSI representation.  Value type: null-terminated string.
 * ``PIPE_COMPUTE_CAP_GRID_DIMENSION``: Number of supported dimensions
   for grid and block coordinates.  Value type: ``uint64_t``.
 * ``PIPE_COMPUTE_CAP_MAX_GRID_SIZE``: Maximum grid size in block
diff --git a/src/gallium/include/pipe/p_defines.h b/src/gallium/include/pipe/p_defines.h
index ec708b7..89e247e 100644
--- a/src/gallium/include/pipe/p_defines.h
+++ b/src/gallium/include/pipe/p_defines.h
@@ -529,6 +529,7 @@ enum pipe_shader_cap
  */
 enum pipe_compute_cap
 {
+   PIPE_COMPUTE_CAP_IR_TARGET,
    PIPE_COMPUTE_CAP_GRID_DIMENSION,
    PIPE_COMPUTE_CAP_MAX_GRID_SIZE,
    PIPE_COMPUTE_CAP_MAX_BLOCK_SIZE,
diff --git a/src/gallium/include/pipe/p_state.h b/src/gallium/include/pipe/p_state.h
index 8b6dc7e..bffe46f 100644
--- a/src/gallium/include/pipe/p_state.h
+++ b/src/gallium/include/pipe/p_state.h
@@ -580,7 +580,7 @@ struct pipe_resolve_info
 
 struct pipe_compute_state
 {
-   const struct tgsi_token *tokens; /**< Compute program to be executed. */
+   const void *prog; /**< Compute program to be executed. */
    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. */
-- 
1.7.9.2



More information about the mesa-dev mailing list