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

2011-11-18 Thread Marek Olšák
---
 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

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


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

2011-11-18 Thread Marek Olšák
Please disregard this patch and the last one too. GLSL 1.3 in st/mesa
is not as complete and usable as I thought.

Marek

On Fri, Nov 18, 2011 at 8:27 PM, Marek Olšák mar...@gmail.com wrote:
 ---
  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


___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev