summaryrefslogtreecommitdiffstats
path: root/src/glsl
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2010-06-30 11:49:17 -0700
committerEric Anholt <[email protected]>2010-06-30 12:01:42 -0700
commit849e18153cd91d812f694b806a84008498860bc3 (patch)
tree7a8df32990a8c3dd9697c641369d1f125a038afa /src/glsl
parent0eda9ae0a6bcd6a7e014df046c87fac5caee0e9e (diff)
glsl2: Use Mesa's gl_shader_program instead of our own struct glsl_program.
This avoids more allocation and shuffling of data around.
Diffstat (limited to 'src/glsl')
-rw-r--r--src/glsl/linker.cpp16
-rw-r--r--src/glsl/main.cpp4
-rw-r--r--src/glsl/program.h34
3 files changed, 11 insertions, 43 deletions
diff --git a/src/glsl/linker.cpp b/src/glsl/linker.cpp
index df71f21b546..719cae2f274 100644
--- a/src/glsl/linker.cpp
+++ b/src/glsl/linker.cpp
@@ -116,7 +116,7 @@ private:
void
-linker_error_printf(glsl_program *prog, const char *fmt, ...)
+linker_error_printf(gl_shader_program *prog, const char *fmt, ...)
{
va_list ap;
@@ -186,7 +186,7 @@ count_attribute_slots(const glsl_type *t)
* \param shader Vertex shader executable to be verified
*/
bool
-validate_vertex_shader_executable(struct glsl_program *prog,
+validate_vertex_shader_executable(struct gl_shader_program *prog,
struct gl_shader *shader)
{
if (shader == NULL)
@@ -215,7 +215,7 @@ validate_vertex_shader_executable(struct glsl_program *prog,
* \param shader Fragment shader executable to be verified
*/
bool
-validate_fragment_shader_executable(struct glsl_program *prog,
+validate_fragment_shader_executable(struct gl_shader_program *prog,
struct gl_shader *shader)
{
if (shader == NULL)
@@ -252,7 +252,7 @@ validate_fragment_shader_executable(struct glsl_program *prog,
* Perform validation of uniforms used across multiple shader stages
*/
bool
-cross_validate_uniforms(struct glsl_program *prog)
+cross_validate_uniforms(struct gl_shader_program *prog)
{
/* Examine all of the uniforms in all of the shaders and cross validate
* them.
@@ -308,7 +308,7 @@ cross_validate_uniforms(struct glsl_program *prog)
* Validate that outputs from one stage match inputs of another
*/
bool
-cross_validate_outputs_to_inputs(struct glsl_program *prog,
+cross_validate_outputs_to_inputs(struct gl_shader_program *prog,
gl_shader *producer, gl_shader *consumer)
{
glsl_symbol_table parameters;
@@ -412,7 +412,7 @@ struct uniform_node {
};
void
-assign_uniform_locations(struct glsl_program *prog)
+assign_uniform_locations(struct gl_shader_program *prog)
{
/* */
exec_list uniforms;
@@ -533,7 +533,7 @@ find_available_slots(unsigned used_mask, unsigned needed_count)
bool
-assign_attribute_locations(glsl_program *prog, unsigned max_attribute_index)
+assign_attribute_locations(gl_shader_program *prog, unsigned max_attribute_index)
{
/* Mark invalid attribute locations as being used.
*/
@@ -767,7 +767,7 @@ assign_varying_locations(gl_shader *producer, gl_shader *consumer)
void
-link_shaders(struct glsl_program *prog)
+link_shaders(struct gl_shader_program *prog)
{
prog->LinkStatus = false;
prog->Validated = false;
diff --git a/src/glsl/main.cpp b/src/glsl/main.cpp
index e78af42ac65..1ed22e1f33b 100644
--- a/src/glsl/main.cpp
+++ b/src/glsl/main.cpp
@@ -206,9 +206,9 @@ main(int argc, char **argv)
if (argc <= optind)
usage_fail(argv[0]);
- struct glsl_program *whole_program;
+ struct gl_shader_program *whole_program;
- whole_program = talloc_zero (NULL, struct glsl_program);
+ whole_program = talloc_zero (NULL, struct gl_shader_program);
assert(whole_program != NULL);
for (/* empty */; argc > optind; optind++) {
diff --git a/src/glsl/program.h b/src/glsl/program.h
index 19c3a3e611b..bb1cd919cd6 100644
--- a/src/glsl/program.h
+++ b/src/glsl/program.h
@@ -29,37 +29,5 @@ extern "C" {
#include "shader/prog_uniform.h"
}
-/**
- * Based on gl_shader_program in Mesa's mtypes.h.
- */
-struct glsl_program {
- GLenum Type; /**< Always GL_SHADER_PROGRAM (internal token) */
- GLuint Name; /**< aka handle or ID */
- GLint RefCount; /**< Reference count */
- GLboolean DeletePending;
-
- GLuint NumShaders; /**< number of attached shaders */
- struct gl_shader **Shaders; /**< List of attached the shaders */
-
- /**
- * Per-stage shaders resulting from the first stage of linking.
- */
- /*@{*/
- unsigned _NumLinkedShaders;
- struct gl_shader **_LinkedShaders;
- /*@}*/
-
- /** User-defined attribute bindings (glBindAttribLocation) */
- struct gl_program_parameter_list *Attributes;
-
- /* post-link info: */
- struct gl_uniform_list *Uniforms;
- struct gl_program_parameter_list *Varying;
- GLboolean LinkStatus; /**< GL_LINK_STATUS */
- GLboolean Validated;
- GLboolean _Used; /**< Ever used for drawing? */
- GLchar *InfoLog;
-};
-
extern void
-link_shaders(struct glsl_program *prog);
+link_shaders(struct gl_shader_program *prog);