[Mesa-dev] [PATCH 21/21] mesa: Eliminate gl_shader_program::InternalSeparateShader

Ian Romanick idr at freedesktop.org
Tue Apr 29 17:52:24 PDT 2014


From: Ian Romanick <ian.d.romanick at intel.com>

This was a work-around to allow linking a program with only a fragment
shader in a GLES context.  Now that we have GL_EXT_separate_shader_objects
in GLES contexts, we can just use that.

Signed-off-by: Ian Romanick <ian.d.romanick at intel.com>
---
 src/glsl/linker.cpp                  |  3 +--
 src/mesa/main/ff_fragment_shader.cpp |  2 +-
 src/mesa/main/mtypes.h               | 11 -----------
 3 files changed, 2 insertions(+), 14 deletions(-)

diff --git a/src/glsl/linker.cpp b/src/glsl/linker.cpp
index 7273951..78a8416 100644
--- a/src/glsl/linker.cpp
+++ b/src/glsl/linker.cpp
@@ -2468,8 +2468,7 @@ link_shaders(struct gl_context *ctx, struct gl_shader_program *prog)
     * fragment shader) is absent. So, the extension shouldn't change the
     * behavior specified in GLSL specification.
     */
-   if (!prog->InternalSeparateShader && !prog->SeparateShader
-       && ctx->API == API_OPENGLES2) {
+   if (!prog->SeparateShader && ctx->API == API_OPENGLES2) {
       if (prog->_LinkedShaders[MESA_SHADER_VERTEX] == NULL) {
 	 linker_error(prog, "program lacks a vertex shader\n");
       } else if (prog->_LinkedShaders[MESA_SHADER_FRAGMENT] == NULL) {
diff --git a/src/mesa/main/ff_fragment_shader.cpp b/src/mesa/main/ff_fragment_shader.cpp
index 66c18fa..6e5fd6f 100644
--- a/src/mesa/main/ff_fragment_shader.cpp
+++ b/src/mesa/main/ff_fragment_shader.cpp
@@ -1310,7 +1310,7 @@ create_new_program(struct gl_context *ctx, struct state_key *key)
     * fixed function program in a GLES2 context at all, but that's a
     * big mess to clean up.
     */
-   p.shader_program->InternalSeparateShader = GL_TRUE;
+   p.shader_program->SeparateShader = GL_TRUE;
 
    state->language_version = 130;
    state->es_shader = false;
diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h
index 3009fda..84e8320 100644
--- a/src/mesa/main/mtypes.h
+++ b/src/mesa/main/mtypes.h
@@ -2596,17 +2596,6 @@ struct gl_shader_program
    GLboolean BinaryRetreivableHint;
 
    /**
-    * Flags that the linker should not reject the program if it lacks
-    * a vertex or fragment shader.  GLES2 doesn't allow separate
-    * shader objects, and would reject them.  However, we internally
-    * build separate shader objects for fixed function programs, which
-    * we use for drivers/common/meta.c and for handling
-    * _mesa_update_state with no program bound (for example in
-    * glClear()).
-    */
-   GLboolean InternalSeparateShader;
-
-   /**
     * Indicates whether program can be bound for individual pipeline stages
     * using UseProgramStages after it is next linked.
     */
-- 
1.8.1.4



More information about the mesa-dev mailing list