Commit 65511e5f authored by Paul Berry's avatar Paul Berry

mesa: Store gl_shader_stage enum in gl_shader objects.

Reviewed-by: default avatarBrian Paul <brianp@vmware.com>
Reviewed-by: default avatarKenneth Graunke <kenneth@whitecape.org>
parent 1722f5e7
......@@ -362,6 +362,7 @@ main(int argc, char **argv)
shader->Type = GL_FRAGMENT_SHADER;
else
usage_fail(argv[0]);
shader->Stage = _mesa_shader_enum_to_shader_stage(shader->Type);
shader->Source = load_text_file(whole_program, argv[optind]);
if (shader->Source == NULL) {
......
......@@ -76,6 +76,7 @@ _mesa_new_shader(struct gl_context *ctx, GLuint name, GLenum type)
shader = rzalloc(NULL, struct gl_shader);
if (shader) {
shader->Type = type;
shader->Stage = _mesa_shader_enum_to_shader_stage(type);
shader->Name = name;
shader->RefCount = 1;
}
......
......@@ -204,6 +204,7 @@ int test_optpass(int argc, char **argv)
struct gl_shader *shader = rzalloc(NULL, struct gl_shader);
shader->Type = shader_type;
shader->Stage = _mesa_shader_enum_to_shader_stage(shader_type);
string input = read_stdin_to_eof();
......
......@@ -65,6 +65,7 @@ common_builtin::SetUp()
this->shader = rzalloc(this->mem_ctx, gl_shader);
this->shader->Type = this->shader_type;
this->shader->Stage = _mesa_shader_enum_to_shader_stage(this->shader_type);
this->state =
new(mem_ctx) _mesa_glsl_parse_state(&this->ctx, this->shader->Type,
......
......@@ -40,6 +40,7 @@ brw_new_shader(struct gl_context *ctx, GLuint name, GLuint type)
shader = rzalloc(NULL, struct brw_shader);
if (shader) {
shader->base.Type = type;
shader->base.Stage = _mesa_shader_enum_to_shader_stage(type);
shader->base.Name = name;
_mesa_init_shader(ctx, &shader->base);
}
......
......@@ -2319,6 +2319,7 @@ struct gl_shader
* Must be the first field.
*/
GLenum Type;
gl_shader_stage Stage;
GLuint Name; /**< AKA the handle */
GLchar *Label; /**< GL_KHR_debug */
GLint RefCount; /**< Reference count */
......
......@@ -110,6 +110,7 @@ _mesa_new_shader(struct gl_context *ctx, GLuint name, GLenum type)
shader = rzalloc(NULL, struct gl_shader);
if (shader) {
shader->Type = type;
shader->Stage = _mesa_shader_enum_to_shader_stage(type);
shader->Name = name;
_mesa_init_shader(ctx, shader);
}
......
......@@ -5207,6 +5207,7 @@ st_new_shader(struct gl_context *ctx, GLuint name, GLuint type)
shader = rzalloc(NULL, struct gl_shader);
if (shader) {
shader->Type = type;
shader->Stage = _mesa_shader_enum_to_shader_stage(type);
shader->Name = name;
_mesa_init_shader(ctx, shader);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment