[Mesa-dev] [PATCH 5/6] gallium: expose GLSL 1.3 if PIPE_CAP_SM4 is exposed (new cap)

Marek Olšák maraeo at gmail.com
Fri Nov 18 11:27:51 PST 2011


---
 src/gallium/include/pipe/p_defines.h   |    3 ++-
 src/mesa/state_tracker/st_extensions.c |    5 +++++
 2 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/src/gallium/include/pipe/p_defines.h b/src/gallium/include/pipe/p_defines.h
index 3e55d22..e51132a 100644
--- a/src/gallium/include/pipe/p_defines.h
+++ b/src/gallium/include/pipe/p_defines.h
@@ -475,7 +475,8 @@ enum pipe_cap {
    PIPE_CAP_MIN_TEXEL_OFFSET = 50,
    PIPE_CAP_MAX_TEXEL_OFFSET = 51,
    PIPE_CAP_CONDITIONAL_RENDER = 52,
-   PIPE_CAP_TEXTURE_BARRIER = 53
+   PIPE_CAP_TEXTURE_BARRIER = 53,
+   PIPE_CAP_SM4 = 54 /* Shader Model 4.0 (roughly equivalent to GLSL 1.3) */
 };
 
 /* Shader caps not specific to any single stage */
diff --git a/src/mesa/state_tracker/st_extensions.c b/src/mesa/state_tracker/st_extensions.c
index 544f0b6..96a1059 100644
--- a/src/mesa/state_tracker/st_extensions.c
+++ b/src/mesa/state_tracker/st_extensions.c
@@ -245,6 +245,11 @@ void st_init_extensions(struct st_context *st)
    int i;
 
    ctx->Const.GLSLVersion = 120;
+
+   if (screen->get_param(screen, PIPE_CAP_SM4)) {
+      ctx->Const.GLSLVersion = 130;
+   }
+
    _mesa_override_glsl_version(st->ctx);
 
    /*
-- 
1.7.5.4



More information about the mesa-dev mailing list