summaryrefslogtreecommitdiffstats
path: root/src/mesa/shader/slang/slang_link.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/shader/slang/slang_link.h')
-rw-r--r--src/mesa/shader/slang/slang_link.h276
1 files changed, 143 insertions, 133 deletions
diff --git a/src/mesa/shader/slang/slang_link.h b/src/mesa/shader/slang/slang_link.h
index a7898530318..2195ec5bdfa 100644
--- a/src/mesa/shader/slang/slang_link.h
+++ b/src/mesa/shader/slang/slang_link.h
@@ -1,6 +1,6 @@
/*
* Mesa 3-D graphics library
- * Version: 6.5
+ * Version: 6.6
*
* Copyright (C) 2006 Brian Paul All Rights Reserved.
*
@@ -33,27 +33,28 @@ extern "C" {
enum
{
- SLANG_SHADER_VERTEX,
- SLANG_SHADER_FRAGMENT,
- SLANG_SHADER_MAX
+ SLANG_SHADER_VERTEX,
+ SLANG_SHADER_FRAGMENT,
+ SLANG_SHADER_MAX
};
-/* Active variables.
+/*
+ * Active variables.
*
- * Active uniforms or attribs can be queried by the application to get a list of uniforms
- * or attribs actually used by shaders (uniforms) or vertex shader (attribs).
+ * Active uniforms/attribs can be queried by the application to get a list of
+ * uniforms/attribs actually used by shaders (uniforms) or vertex shader only (attribs).
*/
typedef struct
{
- slang_export_data_quant *quant;
- char *name;
+ slang_export_data_quant *quant;
+ GLchar *name;
} slang_active_variable;
typedef struct
{
- slang_active_variable *table;
- GLuint count;
+ slang_active_variable *table;
+ GLuint count;
} slang_active_variables;
/*
@@ -65,17 +66,18 @@ typedef struct
typedef struct
{
- GLuint index;
- GLchar *name;
+ GLuint index;
+ GLchar *name;
} slang_attrib_override;
typedef struct
{
- slang_attrib_override *table;
- GLuint count;
+ slang_attrib_override *table;
+ GLuint count;
} slang_attrib_overrides;
-GLboolean slang_attrib_overrides_add (slang_attrib_overrides *, GLuint, const GLchar *);
+extern GLboolean
+_slang_attrib_overrides_add (slang_attrib_overrides *, GLuint, const GLchar *);
/*
* Uniform bindings.
@@ -95,15 +97,15 @@ GLboolean slang_attrib_overrides_add (slang_attrib_overrides *, GLuint, const GL
typedef struct
{
- slang_export_data_quant *quant;
- char *name;
- GLuint address[SLANG_SHADER_MAX];
+ slang_export_data_quant *quant;
+ GLchar *name;
+ GLuint address[SLANG_SHADER_MAX];
} slang_uniform_binding;
typedef struct
{
- slang_uniform_binding *table;
- GLuint count;
+ slang_uniform_binding *table;
+ GLuint count;
} slang_uniform_bindings;
/*
@@ -117,9 +119,9 @@ typedef struct
typedef struct
{
- slang_export_data_quant *quant;
- char *name;
- GLuint first_slot_index;
+ slang_export_data_quant *quant;
+ GLchar *name;
+ GLuint first_slot_index;
} slang_attrib_binding;
typedef struct
@@ -130,9 +132,9 @@ typedef struct
typedef struct
{
- slang_attrib_binding bindings[MAX_VERTEX_ATTRIBS];
- GLuint binding_count;
- slang_attrib_slot slots[MAX_VERTEX_ATTRIBS];
+ slang_attrib_binding bindings[MAX_VERTEX_ATTRIBS];
+ GLuint binding_count;
+ slang_attrib_slot slots[MAX_VERTEX_ATTRIBS];
} slang_attrib_bindings;
/*
@@ -146,23 +148,23 @@ typedef struct
typedef struct
{
- GLuint vert_addr;
- GLuint frag_addr;
+ GLuint vert_addr;
+ GLuint frag_addr;
} slang_varying_slot;
typedef struct
{
- slang_export_data_quant *quant;
- char *name;
- GLuint first_slot_index;
+ slang_export_data_quant *quant;
+ GLchar *name;
+ GLuint first_slot_index;
} slang_varying_binding;
typedef struct
{
- slang_varying_binding bindings[MAX_VARYING_FLOATS];
- GLuint binding_count;
- slang_varying_slot slots[MAX_VARYING_FLOATS];
- GLuint slot_count;
+ slang_varying_binding bindings[MAX_VARYING_FLOATS];
+ GLuint binding_count;
+ slang_varying_slot slots[MAX_VARYING_FLOATS];
+ GLuint slot_count;
} slang_varying_bindings;
/*
@@ -180,130 +182,138 @@ typedef struct
typedef struct
{
- slang_export_data_quant *quant;
- GLuint frag_address;
+ slang_export_data_quant *quant;
+ GLuint frag_address;
} slang_texture_usage;
typedef struct
{
- slang_texture_usage *table;
- GLuint count;
+ slang_texture_usage *table;
+ GLuint count;
} slang_texture_usages;
-GLvoid slang_texture_usages_ctr (slang_texture_usages *);
-GLvoid slang_texture_usages_dtr (slang_texture_usages *);
+extern GLvoid
+_slang_texture_usages_ctr (slang_texture_usages *);
+
+extern GLvoid
+_slang_texture_usages_dtr (slang_texture_usages *);
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
+ 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
};
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
+ 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
};
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
+ 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
};
enum
{
- SLANG_COMMON_CODE_MAIN,
- SLANG_COMMON_CODE_MAX
+ SLANG_COMMON_CODE_MAIN,
+ SLANG_COMMON_CODE_MAX
};
typedef struct
{
- slang_active_variables active_uniforms;
- slang_active_variables active_attribs;
- slang_attrib_overrides attrib_overrides;
- slang_uniform_bindings uniforms;
- slang_attrib_bindings attribs;
- slang_varying_bindings varyings;
- slang_texture_usages texture_usage;
- GLuint common_fixed_entries[SLANG_SHADER_MAX][SLANG_COMMON_FIXED_MAX];
- GLuint vertex_fixed_entries[SLANG_VERTEX_FIXED_MAX];
- GLuint fragment_fixed_entries[SLANG_FRAGMENT_FIXED_MAX];
- GLuint code[SLANG_SHADER_MAX][SLANG_COMMON_CODE_MAX];
- slang_machine *machines[SLANG_SHADER_MAX];
- slang_assembly_file *assemblies[SLANG_SHADER_MAX];
+ slang_active_variables active_uniforms;
+ slang_active_variables active_attribs;
+ slang_attrib_overrides attrib_overrides;
+ slang_uniform_bindings uniforms;
+ slang_attrib_bindings attribs;
+ slang_varying_bindings varyings;
+ slang_texture_usages texture_usage;
+ GLuint common_fixed_entries[SLANG_SHADER_MAX][SLANG_COMMON_FIXED_MAX];
+ GLuint vertex_fixed_entries[SLANG_VERTEX_FIXED_MAX];
+ GLuint fragment_fixed_entries[SLANG_FRAGMENT_FIXED_MAX];
+ GLuint code[SLANG_SHADER_MAX][SLANG_COMMON_CODE_MAX];
+ slang_machine *machines[SLANG_SHADER_MAX];
+ slang_assembly_file *assemblies[SLANG_SHADER_MAX];
} slang_program;
-GLvoid slang_program_ctr (slang_program *);
-GLvoid slang_program_dtr (slang_program *);
-GLvoid slang_program_rst (slang_program *);
+extern GLvoid
+_slang_program_ctr (slang_program *);
+
+extern GLvoid
+_slang_program_dtr (slang_program *);
+
+extern GLvoid
+_slang_program_rst (slang_program *);
extern GLboolean
_slang_link (slang_program *, slang_code_object **, GLuint);