summaryrefslogtreecommitdiff
path: root/mesa/shader
diff options
context:
space:
mode:
Diffstat (limited to 'mesa/shader')
-rw-r--r--mesa/shader/prog_instruction.h9
-rw-r--r--mesa/shader/prog_optimize.h45
-rw-r--r--mesa/shader/prog_parameter.h3
-rw-r--r--mesa/shader/prog_print.h11
-rw-r--r--mesa/shader/program.h2
-rw-r--r--mesa/shader/shader_api.h8
6 files changed, 73 insertions, 5 deletions
diff --git a/mesa/shader/prog_instruction.h b/mesa/shader/prog_instruction.h
index 40ad998..39a221e 100644
--- a/mesa/shader/prog_instruction.h
+++ b/mesa/shader/prog_instruction.h
@@ -133,6 +133,7 @@
#define NEGATE_Y 0x2
#define NEGATE_Z 0x4
#define NEGATE_W 0x8
+#define NEGATE_XYZ 0x7
#define NEGATE_XYZW 0xf
#define NEGATE_NONE 0x0
/*@}*/
@@ -303,11 +304,11 @@ struct prog_dst_register
* Condition code swizzle value.
*/
GLuint CondSwizzle:12;
-
+
/**
* Selects the condition code register to use for conditional destination
* update masking. In NV_fragmnet_program or NV_vertex_program2 mode, only
- * condition code register 0 is available. In NV_vertex_program3 mode,
+ * condition code register 0 is available. In NV_vertex_program3 mode,
* condition code registers 0 and 1 are available.
*/
GLuint CondSrc:1;
@@ -359,7 +360,7 @@ struct prog_instruction
* NV_fragment_program, NV_fragment_program_option, NV_vertex_program3.
*/
GLuint SaturateMode:2;
-
+
/**
* Per-instruction selectable precision: FLOAT32, FLOAT16, FIXED12.
*
@@ -374,7 +375,7 @@ struct prog_instruction
/*@{*/
/** Source texture unit. */
GLuint TexSrcUnit:5;
-
+
/** Source texture target, one of TEXTURE_{1D,2D,3D,CUBE,RECT}_INDEX */
GLuint TexSrcTarget:3;
diff --git a/mesa/shader/prog_optimize.h b/mesa/shader/prog_optimize.h
new file mode 100644
index 0000000..43894a2
--- /dev/null
+++ b/mesa/shader/prog_optimize.h
@@ -0,0 +1,45 @@
+/*
+ * Mesa 3-D graphics library
+ * Version: 7.5
+ *
+ * Copyright (C) 2009 VMware, Inc. All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * VMWARE BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+ * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+#ifndef PROG_OPT_H
+#define PROG_OPT_H
+
+
+#include "main/config.h"
+
+
+struct gl_program;
+struct prog_instruction;
+
+
+extern GLboolean
+_mesa_find_temp_intervals(const struct prog_instruction *instructions,
+ GLuint numInstructions,
+ GLint intBegin[MAX_PROGRAM_TEMPS],
+ GLint intEnd[MAX_PROGRAM_TEMPS]);
+
+extern void
+_mesa_optimize_program(GLcontext *ctx, struct gl_program *program);
+
+#endif
diff --git a/mesa/shader/prog_parameter.h b/mesa/shader/prog_parameter.h
index 01f5a0e..d1fcf47 100644
--- a/mesa/shader/prog_parameter.h
+++ b/mesa/shader/prog_parameter.h
@@ -84,6 +84,9 @@ struct gl_program_parameter_list
extern struct gl_program_parameter_list *
_mesa_new_parameter_list(void);
+extern struct gl_program_parameter_list *
+_mesa_new_parameter_list_sized(unsigned size);
+
extern void
_mesa_free_parameter_list(struct gl_program_parameter_list *paramList);
diff --git a/mesa/shader/prog_print.h b/mesa/shader/prog_print.h
index d55661c..fc286de 100644
--- a/mesa/shader/prog_print.h
+++ b/mesa/shader/prog_print.h
@@ -57,6 +57,13 @@ extern void
_mesa_print_instruction(const struct prog_instruction *inst);
extern GLint
+_mesa_fprint_instruction_opt(FILE *f,
+ const struct prog_instruction *inst,
+ GLint indent,
+ gl_prog_print_mode mode,
+ const struct gl_program *prog);
+
+extern GLint
_mesa_print_instruction_opt(const struct prog_instruction *inst, GLint indent,
gl_prog_print_mode mode,
const struct gl_program *prog);
@@ -79,5 +86,9 @@ _mesa_print_parameter_list(const struct gl_program_parameter_list *list);
extern void
_mesa_write_shader_to_file(const struct gl_shader *shader);
+extern void
+_mesa_append_uniforms_to_file(const struct gl_shader *shader,
+ const struct gl_program *prog);
+
#endif /* PROG_PRINT_H */
diff --git a/mesa/shader/program.h b/mesa/shader/program.h
index 4817616..56a4191 100644
--- a/mesa/shader/program.h
+++ b/mesa/shader/program.h
@@ -122,6 +122,8 @@ _mesa_combine_programs(GLcontext *ctx,
extern GLint
_mesa_find_free_register(const struct gl_program *prog, GLuint regFile);
+extern void
+_mesa_postprocess_program(GLcontext *ctx, struct gl_program *prog);
#endif /* PROGRAM_H */
diff --git a/mesa/shader/shader_api.h b/mesa/shader/shader_api.h
index ec1996e..d08d473 100644
--- a/mesa/shader/shader_api.h
+++ b/mesa/shader/shader_api.h
@@ -1,8 +1,9 @@
/*
* Mesa 3-D graphics library
- * Version: 6.5
+ * Version: 7.6
*
* Copyright (C) 2004-2006 Brian Paul All Rights Reserved.
+ * Copyright (C) 2009 VMware, Inc. All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
@@ -87,6 +88,11 @@ extern void
_mesa_use_program(GLcontext *ctx, GLuint program);
+extern GLboolean
+_mesa_validate_shader_program(GLcontext *ctx,
+ const struct gl_shader_program *shProg,
+ char *errMsg);
+
extern void
_mesa_init_glsl_driver_functions(struct dd_function_table *driver);