summaryrefslogtreecommitdiffstats
path: root/src/mesa/shader/slang/slang_link.h
diff options
context:
space:
mode:
authorMichal Krol <[email protected]>2006-02-27 14:41:41 +0000
committerMichal Krol <[email protected]>2006-02-27 14:41:41 +0000
commit9ac9605de156408580b81ba7e2780bd3f5372c6d (patch)
treee0dfe1127ed3b7f9674c450dea59b921e84c4dfc /src/mesa/shader/slang/slang_link.h
parentc56f2c49a51e7ad1106c46e3e86dfe2756ef87c4 (diff)
More GLSL code:
- add x86 code generator; - add full support for uniforms in ARB_shader_objects; - add assembly instruction: global_addr; - reorganize #includes; - built-in uniforms accessed by index, rather than by name; - add some entries to x86sse rtasm; - add configurations to VC6 projects: 'Release x86' and 'Debug x86'; - #define SLANG_X86 active only on VC6 x86 builds; - introduce code export table for a shader; - remove GNU license from the noise library;
Diffstat (limited to 'src/mesa/shader/slang/slang_link.h')
-rw-r--r--src/mesa/shader/slang/slang_link.h115
1 files changed, 110 insertions, 5 deletions
diff --git a/src/mesa/shader/slang/slang_link.h b/src/mesa/shader/slang/slang_link.h
index 7395c77c5df..2f4fd254cec 100644
--- a/src/mesa/shader/slang/slang_link.h
+++ b/src/mesa/shader/slang/slang_link.h
@@ -25,16 +25,18 @@
#if !defined SLANG_LINK_H
#define SLANG_LINK_H
-#include "slang_assemble.h"
-#include "slang_execute.h"
+#include "slang_compile.h"
#if defined __cplusplus
extern "C" {
#endif
-#define SLANG_UNIFORM_BINDING_VERTEX 0
-#define SLANG_UNIFORM_BINDING_FRAGMENT 1
-#define SLANG_UNIFORM_BINDING_MAX 2
+typedef enum
+{
+ SLANG_UNIFORM_BINDING_VERTEX,
+ SLANG_UNIFORM_BINDING_FRAGMENT,
+ SLANG_UNIFORM_BINDING_MAX
+};
typedef struct
{
@@ -51,8 +53,111 @@ typedef struct
typedef struct
{
+ slang_export_data_quant *quant;
+ char *name;
+} slang_active_uniform;
+
+typedef struct
+{
+ slang_active_uniform *table;
+ GLuint count;
+} slang_active_uniforms;
+
+typedef enum
+{
+ SLANG_COMMON_FIXED_MODELVIEWMATRIX,
+ SLANG_COMMON_FIXED_PROJECTIONMATRIX,
+ SLANG_COMMON_FIXED_MODELVIEWPROJECTIONMATRIX,
+ SLANG_COMMON_FIXED_TEXTUREMATRIX,
+ SLANG_COMMON_FIXED_NORMALMATRIX,
+ SLANG_COMMON_FIXED_MODELVIEWMATRIXINVERSE,
+ SLANG_COMMON_FIXED_PROJECTIONMATRIXINVERSE,
+ SLANG_COMMON_FIXED_MODELVIEWPROJECTIONMATRIXINVERSE,
+ SLANG_COMMON_FIXED_TEXTUREMATRIXINVERSE,
+ SLANG_COMMON_FIXED_MODELVIEWMATRIXTRANSPOSE,
+ SLANG_COMMON_FIXED_PROJECTIONMATRIXTRANSPOSE,
+ SLANG_COMMON_FIXED_MODELVIEWPROJECTIONMATRIXTRANSPOSE,
+ SLANG_COMMON_FIXED_TEXTUREMATRIXTRANSPOSE,
+ SLANG_COMMON_FIXED_MODELVIEWMATRIXINVERSETRANSPOSE,
+ SLANG_COMMON_FIXED_PROJECTIONMATRIXINVERSETRANSPOSE,
+ SLANG_COMMON_FIXED_MODELVIEWPROJECTIONMATRIXINVERSETRANSPOSE,
+ SLANG_COMMON_FIXED_TEXTUREMATRIXINVERSETRANSPOSE,
+ SLANG_COMMON_FIXED_NORMALSCALE,
+ SLANG_COMMON_FIXED_DEPTHRANGE,
+ SLANG_COMMON_FIXED_CLIPPLANE,
+ SLANG_COMMON_FIXED_POINT,
+ SLANG_COMMON_FIXED_FRONTMATERIAL,
+ SLANG_COMMON_FIXED_BACKMATERIAL,
+ SLANG_COMMON_FIXED_LIGHTSOURCE,
+ SLANG_COMMON_FIXED_LIGHTMODEL,
+ SLANG_COMMON_FIXED_FRONTLIGHTMODELPRODUCT,
+ SLANG_COMMON_FIXED_BACKLIGHTMODELPRODUCT,
+ SLANG_COMMON_FIXED_FRONTLIGHTPRODUCT,
+ SLANG_COMMON_FIXED_BACKLIGHTPRODUCT,
+ SLANG_COMMON_FIXED_TEXTUREENVCOLOR,
+ SLANG_COMMON_FIXED_EYEPLANES,
+ SLANG_COMMON_FIXED_EYEPLANET,
+ SLANG_COMMON_FIXED_EYEPLANER,
+ SLANG_COMMON_FIXED_EYEPLANEQ,
+ SLANG_COMMON_FIXED_OBJECTPLANES,
+ SLANG_COMMON_FIXED_OBJECTPLANET,
+ SLANG_COMMON_FIXED_OBJECTPLANER,
+ SLANG_COMMON_FIXED_OBJECTPLANEQ,
+ SLANG_COMMON_FIXED_FOG,
+ SLANG_COMMON_FIXED_MAX
+};
+
+typedef enum
+{
+ SLANG_VERTEX_FIXED_POSITION,
+ SLANG_VERTEX_FIXED_POINTSIZE,
+ SLANG_VERTEX_FIXED_CLIPVERTEX,
+ SLANG_VERTEX_FIXED_COLOR,
+ SLANG_VERTEX_FIXED_SECONDARYCOLOR,
+ SLANG_VERTEX_FIXED_NORMAL,
+ SLANG_VERTEX_FIXED_VERTEX,
+ SLANG_VERTEX_FIXED_MULTITEXCOORD0,
+ SLANG_VERTEX_FIXED_MULTITEXCOORD1,
+ SLANG_VERTEX_FIXED_MULTITEXCOORD2,
+ SLANG_VERTEX_FIXED_MULTITEXCOORD3,
+ SLANG_VERTEX_FIXED_MULTITEXCOORD4,
+ SLANG_VERTEX_FIXED_MULTITEXCOORD5,
+ SLANG_VERTEX_FIXED_MULTITEXCOORD6,
+ SLANG_VERTEX_FIXED_MULTITEXCOORD7,
+ SLANG_VERTEX_FIXED_FOGCOORD,
+ SLANG_VERTEX_FIXED_FRONTCOLOR,
+ SLANG_VERTEX_FIXED_BACKCOLOR,
+ SLANG_VERTEX_FIXED_FRONTSECONDARYCOLOR,
+ SLANG_VERTEX_FIXED_BACKSECONDARYCOLOR,
+ SLANG_VERTEX_FIXED_TEXCOORD,
+ SLANG_VERTEX_FIXED_FOGFRAGCOORD,
+ SLANG_VERTEX_FIXED_MAX
+};
+
+typedef enum
+{
+ SLANG_FRAGMENT_FIXED_FRAGCOORD,
+ SLANG_FRAGMENT_FIXED_FRONTFACING,
+ SLANG_FRAGMENT_FIXED_FRAGCOLOR,
+ SLANG_FRAGMENT_FIXED_FRAGDATA,
+ SLANG_FRAGMENT_FIXED_FRAGDEPTH,
+ SLANG_FRAGMENT_FIXED_COLOR,
+ SLANG_FRAGMENT_FIXED_SECONDARYCOLOR,
+ SLANG_FRAGMENT_FIXED_TEXCOORD,
+ SLANG_FRAGMENT_FIXED_FOGFRAGCOORD,
+ SLANG_FRAGMENT_FIXED_MAX
+};
+
+typedef struct
+{
slang_uniform_bindings uniforms;
+ slang_active_uniforms active_uniforms;
+ GLuint common_fixed_entries[SLANG_UNIFORM_BINDING_MAX][SLANG_COMMON_FIXED_MAX];
+ GLuint vertex_fixed_entries[SLANG_VERTEX_FIXED_MAX];
+ GLuint fragment_fixed_entries[SLANG_FRAGMENT_FIXED_MAX];
+ GLuint code[SLANG_UNIFORM_BINDING_MAX];
slang_machine *machines[SLANG_UNIFORM_BINDING_MAX];
+ slang_assembly_file *assemblies[SLANG_UNIFORM_BINDING_MAX];
} slang_program;
GLvoid slang_program_ctr (slang_program *);