summaryrefslogtreecommitdiffstats
path: root/src/mesa/program
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/program')
-rw-r--r--src/mesa/program/ir_to_mesa.h2
-rw-r--r--src/mesa/program/prog_execute.c2
-rw-r--r--src/mesa/program/prog_execute.h4
-rw-r--r--src/mesa/program/prog_instruction.c2
-rw-r--r--src/mesa/program/prog_parameter.h33
-rw-r--r--src/mesa/program/prog_print.h2
-rw-r--r--src/mesa/program/prog_to_nir.c1
-rw-r--r--src/mesa/program/program.h2
-rw-r--r--src/mesa/program/program_parse.y1
-rw-r--r--src/mesa/program/programopt.h5
-rw-r--r--src/mesa/program/symbol_table.c1
11 files changed, 49 insertions, 6 deletions
diff --git a/src/mesa/program/ir_to_mesa.h b/src/mesa/program/ir_to_mesa.h
index 9714f50443a..7a4911cd74a 100644
--- a/src/mesa/program/ir_to_mesa.h
+++ b/src/mesa/program/ir_to_mesa.h
@@ -33,6 +33,8 @@ extern "C" {
struct gl_context;
struct gl_shader;
struct gl_shader_program;
+struct gl_linked_shader;
+struct gl_program_parameter_list;
void _mesa_glsl_link_shader(struct gl_context *ctx, struct gl_shader_program *prog);
GLboolean _mesa_ir_link_shader(struct gl_context *ctx, struct gl_shader_program *prog);
diff --git a/src/mesa/program/prog_execute.c b/src/mesa/program/prog_execute.c
index b5a7a692aeb..c50465dfc49 100644
--- a/src/mesa/program/prog_execute.c
+++ b/src/mesa/program/prog_execute.c
@@ -36,8 +36,10 @@
#include "c99_math.h"
+#include "main/errors.h"
#include "main/glheader.h"
#include "main/macros.h"
+#include "main/mtypes.h"
#include "prog_execute.h"
#include "prog_instruction.h"
#include "prog_parameter.h"
diff --git a/src/mesa/program/prog_execute.h b/src/mesa/program/prog_execute.h
index 3603e3bdddf..ef04087301e 100644
--- a/src/mesa/program/prog_execute.h
+++ b/src/mesa/program/prog_execute.h
@@ -26,8 +26,10 @@
#define PROG_EXECUTE_H
#include "main/config.h"
-#include "main/mtypes.h"
+#include "main/glheader.h"
+#include "compiler/shader_enums.h"
+struct gl_context;
typedef void (*FetchTexelLodFunc)(struct gl_context *ctx, const GLfloat texcoord[4],
GLfloat lambda, GLuint unit, GLfloat color[4]);
diff --git a/src/mesa/program/prog_instruction.c b/src/mesa/program/prog_instruction.c
index 9f03867f0b0..91830d87f25 100644
--- a/src/mesa/program/prog_instruction.c
+++ b/src/mesa/program/prog_instruction.c
@@ -26,8 +26,8 @@
#include "main/glheader.h"
#include "main/imports.h"
-#include "main/mtypes.h"
#include "prog_instruction.h"
+#include "prog_parameter.h"
/**
diff --git a/src/mesa/program/prog_parameter.h b/src/mesa/program/prog_parameter.h
index 8e36a1c5904..cc551c18910 100644
--- a/src/mesa/program/prog_parameter.h
+++ b/src/mesa/program/prog_parameter.h
@@ -31,7 +31,6 @@
#ifndef PROG_PARAMETER_H
#define PROG_PARAMETER_H
-#include "main/mtypes.h"
#include "prog_statevars.h"
#include <string.h>
@@ -40,6 +39,38 @@
extern "C" {
#endif
+/**
+ * Names of the various vertex/fragment program register files, etc.
+ *
+ * NOTE: first four tokens must fit into 2 bits (see t_vb_arbprogram.c)
+ * All values should fit in a 4-bit field.
+ *
+ * NOTE: PROGRAM_STATE_VAR, PROGRAM_CONSTANT, and PROGRAM_UNIFORM can all be
+ * considered to be "uniform" variables since they can only be set outside
+ * glBegin/End. They're also all stored in the same Parameters array.
+ */
+typedef enum
+{
+ PROGRAM_TEMPORARY, /**< machine->Temporary[] */
+ PROGRAM_ARRAY, /**< Arrays & Matrixes */
+ PROGRAM_INPUT, /**< machine->Inputs[] */
+ PROGRAM_OUTPUT, /**< machine->Outputs[] */
+ PROGRAM_STATE_VAR, /**< gl_program->Parameters[] */
+ PROGRAM_CONSTANT, /**< gl_program->Parameters[] */
+ PROGRAM_UNIFORM, /**< gl_program->Parameters[] */
+ PROGRAM_WRITE_ONLY, /**< A dummy, write-only register */
+ PROGRAM_ADDRESS, /**< machine->AddressReg */
+ PROGRAM_SAMPLER, /**< for shader samplers, compile-time only */
+ PROGRAM_SYSTEM_VALUE,/**< InstanceId, PrimitiveID, etc. */
+ PROGRAM_UNDEFINED, /**< Invalid/TBD value */
+ PROGRAM_IMMEDIATE, /**< Immediate value, used by TGSI */
+ PROGRAM_BUFFER, /**< for shader buffers, compile-time only */
+ PROGRAM_MEMORY, /**< for shared, global and local memory */
+ PROGRAM_IMAGE, /**< for shader images, compile-time only */
+ PROGRAM_HW_ATOMIC, /**< for hw atomic counters, compile-time only */
+ PROGRAM_FILE_MAX
+} gl_register_file;
+
/**
* Actual data for constant values of parameters.
diff --git a/src/mesa/program/prog_print.h b/src/mesa/program/prog_print.h
index 98a43e63a00..89fc42363cd 100644
--- a/src/mesa/program/prog_print.h
+++ b/src/mesa/program/prog_print.h
@@ -29,7 +29,7 @@
#include <stdio.h>
#include "main/glheader.h"
-#include "main/mtypes.h"
+#include "prog_parameter.h"
#ifdef __cplusplus
diff --git a/src/mesa/program/prog_to_nir.c b/src/mesa/program/prog_to_nir.c
index 3ee44ce489e..cd874e489f3 100644
--- a/src/mesa/program/prog_to_nir.c
+++ b/src/mesa/program/prog_to_nir.c
@@ -27,6 +27,7 @@
#include "compiler/nir/nir_builder.h"
#include "compiler/glsl/list.h"
#include "main/imports.h"
+#include "main/mtypes.h"
#include "util/ralloc.h"
#include "prog_to_nir.h"
diff --git a/src/mesa/program/program.h b/src/mesa/program/program.h
index 659385f55b1..49e888e57df 100644
--- a/src/mesa/program/program.h
+++ b/src/mesa/program/program.h
@@ -40,7 +40,7 @@
#ifndef PROGRAM_H
#define PROGRAM_H
-#include "main/mtypes.h"
+#include "prog_parameter.h"
#ifdef __cplusplus
diff --git a/src/mesa/program/program_parse.y b/src/mesa/program/program_parse.y
index 9b63764f752..415ff2a28ec 100644
--- a/src/mesa/program/program_parse.y
+++ b/src/mesa/program/program_parse.y
@@ -27,6 +27,7 @@
#include <stdlib.h>
#include <string.h>
+#include "main/errors.h"
#include "main/mtypes.h"
#include "main/imports.h"
#include "program/program.h"
diff --git a/src/mesa/program/programopt.h b/src/mesa/program/programopt.h
index 5d70e57bc33..70a820ae0ea 100644
--- a/src/mesa/program/programopt.h
+++ b/src/mesa/program/programopt.h
@@ -26,13 +26,16 @@
#ifndef PROGRAMOPT_H
#define PROGRAMOPT_H 1
-#include "main/mtypes.h"
+#include "main/glheader.h"
+#include "prog_parameter.h"
#ifdef __cplusplus
extern "C" {
#endif
+struct gl_context;
+struct gl_program;
extern void
_mesa_insert_mvp_code(struct gl_context *ctx, struct gl_program *vprog);
diff --git a/src/mesa/program/symbol_table.c b/src/mesa/program/symbol_table.c
index f5dacbbf1ed..e01faa5c6e1 100644
--- a/src/mesa/program/symbol_table.c
+++ b/src/mesa/program/symbol_table.c
@@ -22,6 +22,7 @@
*/
#include "main/imports.h"
+#include "main/errors.h"
#include "symbol_table.h"
#include "../../util/hash_table.h"
#include "util/u_string.h"