summaryrefslogtreecommitdiff
path: root/main
diff options
context:
space:
mode:
authorEric Anholt <eric@anholt.net>2010-04-29 09:02:09 -0700
committerEric Anholt <eric@anholt.net>2010-06-24 15:05:19 -0700
commit84771df82ed2ed8718013795089edd38cf5bd84d (patch)
tree44ef28d26546dc7375a22c357f350acc40b77a69 /main
parent9290e0dd28e646c3dc810e0a6405582f8bf643b6 (diff)
ir_to_mesa: Start building GLSL IR to Mesa IR conversion.
There are major missing pieces here. Most operations aren't supported. Matrices need to be broken down to vector ops before we get here. Scalar operations (RSQ, RCP) are handled incorrectly. Arrays and structures are not even considered.
Diffstat (limited to 'main')
-rw-r--r--main/mtypes.h32
1 files changed, 32 insertions, 0 deletions
diff --git a/main/mtypes.h b/main/mtypes.h
index f168b6605b..cab5ffde6c 100644
--- a/main/mtypes.h
+++ b/main/mtypes.h
@@ -36,6 +36,8 @@
#define MAX_DRAW_BUFFERS 8
#define MAX_VARYING 16
+#include <GL/gl.h>
+
/**
* Indexes for vertex program attributes.
* GL_NV_vertex_program aliases generic attributes over the conventional
@@ -218,4 +220,34 @@ typedef enum
FRAG_RESULT_MAX = (FRAG_RESULT_DATA0 + MAX_DRAW_BUFFERS)
} gl_frag_result;
+/**
+ * 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_ENV_PARAM, PROGRAM_STATE_VAR, PROGRAM_NAMED_PARAM,
+ * 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_INPUT, /**< machine->Inputs[] */
+ PROGRAM_OUTPUT, /**< machine->Outputs[] */
+ PROGRAM_VARYING, /**< machine->Inputs[]/Outputs[] */
+ PROGRAM_LOCAL_PARAM, /**< gl_program->LocalParams[] */
+ PROGRAM_ENV_PARAM, /**< gl_program->Parameters[] */
+ PROGRAM_STATE_VAR, /**< gl_program->Parameters[] */
+ PROGRAM_NAMED_PARAM, /**< 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_UNDEFINED, /**< Invalid/TBD value */
+ PROGRAM_FILE_MAX
+} gl_register_file;
+
#endif