added GL_CURRENT_PROGRAM
authorBrian <brian@yutani.localnet.net>
Fri, 9 Mar 2007 22:41:25 +0000 (15:41 -0700)
committerBrian <brian@yutani.localnet.net>
Fri, 9 Mar 2007 22:41:25 +0000 (15:41 -0700)
src/mesa/main/get.c
src/mesa/main/get_gen.py

index 4cd07cb7b11680eef9789df08d989d07437212b3..d09e0610ab0ed12cf086c73f268e473daceb7c49 100644 (file)
@@ -1888,6 +1888,10 @@ _mesa_GetBooleanv( GLenum pname, GLboolean *params )
          CHECK_EXT1(ARB_vertex_shader, "GetBooleanv");
          params[0] = INT_TO_BOOLEAN(MAX_COMBINED_TEXTURE_IMAGE_UNITS);
          break;
+      case GL_CURRENT_PROGRAM:
+         CHECK_EXT1(ARB_shader_objects, "GetBooleanv");
+         params[0] = INT_TO_BOOLEAN(ctx->Shader.CurrentProgram ? ctx->Shader.CurrentProgram->Name : 0);
+         break;
       default:
          _mesa_error(ctx, GL_INVALID_ENUM, "glGetBooleanv(pname=0x%x)", pname);
    }
@@ -3715,6 +3719,10 @@ _mesa_GetFloatv( GLenum pname, GLfloat *params )
          CHECK_EXT1(ARB_vertex_shader, "GetFloatv");
          params[0] = (GLfloat)(MAX_COMBINED_TEXTURE_IMAGE_UNITS);
          break;
+      case GL_CURRENT_PROGRAM:
+         CHECK_EXT1(ARB_shader_objects, "GetFloatv");
+         params[0] = (GLfloat)(ctx->Shader.CurrentProgram ? ctx->Shader.CurrentProgram->Name : 0);
+         break;
       default:
          _mesa_error(ctx, GL_INVALID_ENUM, "glGetFloatv(pname=0x%x)", pname);
    }
@@ -5542,6 +5550,10 @@ _mesa_GetIntegerv( GLenum pname, GLint *params )
          CHECK_EXT1(ARB_vertex_shader, "GetIntegerv");
          params[0] = MAX_COMBINED_TEXTURE_IMAGE_UNITS;
          break;
+      case GL_CURRENT_PROGRAM:
+         CHECK_EXT1(ARB_shader_objects, "GetIntegerv");
+         params[0] = ctx->Shader.CurrentProgram ? ctx->Shader.CurrentProgram->Name : 0;
+         break;
       default:
          _mesa_error(ctx, GL_INVALID_ENUM, "glGetIntegerv(pname=0x%x)", pname);
    }
index 2f07cc51926dc8b392226c1210e3eba8a987afb2..3e66946b92f5092c34ccdd1efd444bbbd64ffe94 100644 (file)
@@ -993,7 +993,14 @@ StateVars = [
        ( "GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB", GLint,
          ["ctx->Const.MaxVertexTextureImageUnits"], "", ["ARB_vertex_shader"] ),
        ( "GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS_ARB", GLint,
-         ["MAX_COMBINED_TEXTURE_IMAGE_UNITS"], "", ["ARB_vertex_shader"] )
+         ["MAX_COMBINED_TEXTURE_IMAGE_UNITS"], "", ["ARB_vertex_shader"] ),
+
+       # GL_ARB_shader_objects
+       # Actually, this token isn't part of GL_ARB_shader_objects, but is
+       # close enough for now.
+       ( "GL_CURRENT_PROGRAM", GLint,
+         ["ctx->Shader.CurrentProgram ? ctx->Shader.CurrentProgram->Name : 0"],
+         "", ["ARB_shader_objects"] )
 ]