[Mesa-dev] [PATCH 03/11] util: Add function for querying LLVM triple based on preferred IR

Tom Stellard tstellar at gmail.com
Tue May 22 10:25:14 PDT 2012


---
 src/gallium/auxiliary/util/u_inlines.h |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/src/gallium/auxiliary/util/u_inlines.h b/src/gallium/auxiliary/util/u_inlines.h
index 2ec153c..b647c8b 100644
--- a/src/gallium/auxiliary/util/u_inlines.h
+++ b/src/gallium/auxiliary/util/u_inlines.h
@@ -545,6 +545,18 @@ util_query_clear_result(union pipe_query_result *result, unsigned type)
    }
 }
 
+static INLINE const char *
+util_get_llvm_triple(struct pipe_screen *pipe, unsigned shader)
+{
+   int ir = pipe->get_shader_param(pipe, shader, PIPE_SHADER_CAP_PREFERRED_IR);
+   switch (ir) {
+   default:
+   /* Fall through */
+   case PIPE_SHADER_IR_TGSI: return "TGSI--";
+   case PIPE_SHADER_IR_LLVM_R600: return "r600--";
+   }
+}
+
 #ifdef __cplusplus
 }
 #endif
-- 
1.7.3.4



More information about the mesa-dev mailing list