#include "texstate.h"
#include "texenvprogram.h"
#include "mtypes.h"
-#include "math/m_xform.h"
+#include "math/m_xform.h"\r
+#include "shaderobjects.h"
}
}
}
-
+\r
+\r
+static void\r
+texture_override( struct gl_texture_object *texObj, GLuint textureBit, GLcontext *ctx,\r
+ GLbitfield enableBits, struct gl_texture_unit *texUnit )\r
+{\r
+ if (!texUnit->_ReallyEnabled && (enableBits & textureBit)) {\r
+ if (!texObj->Complete) {\r
+ _mesa_test_texobj_completeness(ctx, texObj);\r
+ }\r
+ if (texObj->Complete) {\r
+ texUnit->_ReallyEnabled = textureBit;\r
+ texUnit->_Current = texObj;\r
+ }\r
+ }\r
+}
/**
* \note This routine refers to derived texture matrix values to
static void
update_texture_state( GLcontext *ctx )
{
- GLuint unit;
+ GLuint unit;\r
+ struct gl2_program_intf **prog = ctx->ShaderObjects.CurrentProgram;\r
+ GLbitfield progteximageusage[MAX_TEXTURE_IMAGE_UNITS];\r
ctx->NewState |= _NEW_TEXTURE; /* TODO: only set this if there are
* actual changes.
ctx->Texture._EnabledUnits = 0;
ctx->Texture._GenFlags = 0;
ctx->Texture._TexMatEnabled = 0;
- ctx->Texture._TexGenEnabled = 0;
+ ctx->Texture._TexGenEnabled = 0;\r
+\r
+ /*\r
+ * Grab texture image usage state from shader program. It must be grabbed every time\r
+ * uniform sampler changes, so maybe there is a better place to perform these rather\r
+ * expensive computations.\r
+ */\r
+ if (prog != NULL) {\r
+ (**prog).GetTextureImageUsage (prog, progteximageusage);\r
+ }
/* Update texture unit state.
* XXX this loop should probably be broken into separate loops for
texUnit->_ReallyEnabled = 0;
texUnit->_GenFlags = 0;
- /* Get the bitmask of texture enables */
- if (ctx->FragmentProgram._Enabled) {
+ /* Get the bitmask of texture enables */\r
+ if (prog != NULL) {\r
+ enableBits = progteximageusage[unit];
+ }\r
+ else if (ctx->FragmentProgram._Enabled) {
enableBits = ctx->FragmentProgram.Current->TexturesUsed[unit];
}
else {
/* Look for the highest-priority texture target that's enabled and
* complete. That's the one we'll use for texturing. If we're using
* a fragment program we're guaranteed that bitcount(enabledBits) <= 1.
- */
- if (enableBits & TEXTURE_CUBE_BIT) {
- struct gl_texture_object *texObj = texUnit->CurrentCubeMap;
- if (!texObj->Complete) {
- _mesa_test_texobj_completeness(ctx, texObj);
- }
- if (texObj->Complete) {
- texUnit->_ReallyEnabled = TEXTURE_CUBE_BIT;
- texUnit->_Current = texObj;
- }
- }
-
- if (!texUnit->_ReallyEnabled && (enableBits & TEXTURE_3D_BIT)) {
- struct gl_texture_object *texObj = texUnit->Current3D;
- if (!texObj->Complete) {
- _mesa_test_texobj_completeness(ctx, texObj);
- }
- if (texObj->Complete) {
- texUnit->_ReallyEnabled = TEXTURE_3D_BIT;
- texUnit->_Current = texObj;
- }
- }
-
- if (!texUnit->_ReallyEnabled && (enableBits & TEXTURE_RECT_BIT)) {
- struct gl_texture_object *texObj = texUnit->CurrentRect;
- if (!texObj->Complete) {
- _mesa_test_texobj_completeness(ctx, texObj);
- }
- if (texObj->Complete) {
- texUnit->_ReallyEnabled = TEXTURE_RECT_BIT;
- texUnit->_Current = texObj;
- }
- }
-
- if (!texUnit->_ReallyEnabled && (enableBits & TEXTURE_2D_BIT)) {
- struct gl_texture_object *texObj = texUnit->Current2D;
- if (!texObj->Complete) {
- _mesa_test_texobj_completeness(ctx, texObj);
- }
- if (texObj->Complete) {
- texUnit->_ReallyEnabled = TEXTURE_2D_BIT;
- texUnit->_Current = texObj;
- }
- }
-
- if (!texUnit->_ReallyEnabled && (enableBits & TEXTURE_1D_BIT)) {
- struct gl_texture_object *texObj = texUnit->Current1D;
- if (!texObj->Complete) {
- _mesa_test_texobj_completeness(ctx, texObj);
- }
- if (texObj->Complete) {
- texUnit->_ReallyEnabled = TEXTURE_1D_BIT;
- texUnit->_Current = texObj;
- }
- }
+ */\r
+ texture_override(texUnit->CurrentCubeMap, TEXTURE_CUBE_BIT, ctx, enableBits, texUnit);\r
+ texture_override(texUnit->Current3D, TEXTURE_3D_BIT, ctx, enableBits, texUnit);
+ texture_override(texUnit->CurrentRect, TEXTURE_RECT_BIT, ctx, enableBits, texUnit);\r
+ texture_override(texUnit->Current2D, TEXTURE_2D_BIT, ctx, enableBits, texUnit);
+ texture_override(texUnit->Current1D, TEXTURE_1D_BIT, ctx, enableBits, texUnit);
if (!texUnit->_ReallyEnabled) {
continue;
/* Fragment programs may need texture coordinates but not the
* corresponding texture images.
*/\r
- if (ctx->ShaderObjects.CurrentProgram != NULL) {\r
- ctx->Texture._EnabledCoordUnits |= (1 << 8) - 1;\r
+ if (prog != NULL) {\r
+ ctx->Texture._EnabledCoordUnits |= (1 << ctx->Const.MaxTextureCoordUnits) - 1;\r
}
else if (ctx->FragmentProgram._Enabled) {
ctx->Texture._EnabledCoordUnits |=
}
}
-/*
-Errors TODO
-
- The error INVALID_OPERATION is generated by the Uniform*ARB if the
- number of values loaded results in exceeding the declared extent of a
- uniform.
-
- The error INVALID_OPERATION is generated by the Uniform*ARB commands if
- the size does not match the size of the uniform declared in the shader.
-
- The error INVALID_OPERATION is generated by the Uniform*ARB commands if
- the type does not match the type of the uniform declared in the shader,
- if the uniform is not of type Boolean.
-
- The error INVALID_OPERATION is generated by the Uniform*ARB commands if
- <location> does not exist for the program object currently in use.
-
- The error INVALID_OPERATION is generated if a uniform command other than
- Uniform1i{v}ARB is used to load a sampler value.
-
-
-*/
-
GLvoid GLAPIENTRY
_mesa_Uniform1fARB (GLint location, GLfloat v0)
{
GET_CURRENT_CONTEXT(ctx);
- GET_CURRENT_LINKED_PROGRAM(pro, "glUniform1fARB");
+ GET_CURRENT_LINKED_PROGRAM(pro, "glUniform1fARB");\r
+\r
+ FLUSH_VERTICES(ctx, _NEW_PROGRAM);
if (pro != NULL)
{
_mesa_Uniform2fARB (GLint location, GLfloat v0, GLfloat v1)
{
GET_CURRENT_CONTEXT(ctx);
- GET_CURRENT_LINKED_PROGRAM(pro, "glUniform2fARB");
+ GET_CURRENT_LINKED_PROGRAM(pro, "glUniform2fARB");\r
+\r
+ FLUSH_VERTICES(ctx, _NEW_PROGRAM);
if (pro != NULL)
{
_mesa_Uniform3fARB (GLint location, GLfloat v0, GLfloat v1, GLfloat v2)
{
GET_CURRENT_CONTEXT(ctx);
- GET_CURRENT_LINKED_PROGRAM(pro, "glUniform3fARB");
+ GET_CURRENT_LINKED_PROGRAM(pro, "glUniform3fARB");\r
+\r
+ FLUSH_VERTICES(ctx, _NEW_PROGRAM);
if (pro != NULL)
{
_mesa_Uniform4fARB (GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3)
{
GET_CURRENT_CONTEXT(ctx);
- GET_CURRENT_LINKED_PROGRAM(pro, "glUniform4fARB");
+ GET_CURRENT_LINKED_PROGRAM(pro, "glUniform4fARB");\r
+\r
+ FLUSH_VERTICES(ctx, _NEW_PROGRAM);
if (pro != NULL)
{
_mesa_Uniform1iARB (GLint location, GLint v0)
{
GET_CURRENT_CONTEXT(ctx);
- GET_CURRENT_LINKED_PROGRAM(pro, "glUniform1iARB");
+ GET_CURRENT_LINKED_PROGRAM(pro, "glUniform1iARB");\r
+\r
+ FLUSH_VERTICES(ctx, _NEW_PROGRAM);
if (pro != NULL)
{
_mesa_Uniform2iARB (GLint location, GLint v0, GLint v1)
{
GET_CURRENT_CONTEXT(ctx);
- GET_CURRENT_LINKED_PROGRAM(pro, "glUniform2iARB");
+ GET_CURRENT_LINKED_PROGRAM(pro, "glUniform2iARB");\r
+\r
+ FLUSH_VERTICES(ctx, _NEW_PROGRAM);
if (pro != NULL)
{
_mesa_Uniform3iARB (GLint location, GLint v0, GLint v1, GLint v2)
{
GET_CURRENT_CONTEXT(ctx);
- GET_CURRENT_LINKED_PROGRAM(pro, "glUniform3iARB");
+ GET_CURRENT_LINKED_PROGRAM(pro, "glUniform3iARB");\r
+\r
+ FLUSH_VERTICES(ctx, _NEW_PROGRAM);
if (pro != NULL)
{
_mesa_Uniform4iARB (GLint location, GLint v0, GLint v1, GLint v2, GLint v3)
{
GET_CURRENT_CONTEXT(ctx);
- GET_CURRENT_LINKED_PROGRAM(pro, "glUniform4iARB");
+ GET_CURRENT_LINKED_PROGRAM(pro, "glUniform4iARB");\r
+\r
+ FLUSH_VERTICES(ctx, _NEW_PROGRAM);
if (pro != NULL)
{
_mesa_Uniform1fvARB (GLint location, GLsizei count, const GLfloat *value)
{
GET_CURRENT_CONTEXT(ctx);
- GET_CURRENT_LINKED_PROGRAM(pro, "glUniform1fvARB");
+ GET_CURRENT_LINKED_PROGRAM(pro, "glUniform1fvARB");\r
+\r
+ FLUSH_VERTICES(ctx, _NEW_PROGRAM);
if (pro != NULL)
{
_mesa_Uniform2fvARB (GLint location, GLsizei count, const GLfloat *value)
{
GET_CURRENT_CONTEXT(ctx);
- GET_CURRENT_LINKED_PROGRAM(pro, "glUniform2fvARB");
+ GET_CURRENT_LINKED_PROGRAM(pro, "glUniform2fvARB");\r
+\r
+ FLUSH_VERTICES(ctx, _NEW_PROGRAM);
if (pro != NULL)
{
_mesa_Uniform3fvARB (GLint location, GLsizei count, const GLfloat *value)
{
GET_CURRENT_CONTEXT(ctx);
- GET_CURRENT_LINKED_PROGRAM(pro, "glUniform3fvARB");
+ GET_CURRENT_LINKED_PROGRAM(pro, "glUniform3fvARB");\r
+\r
+ FLUSH_VERTICES(ctx, _NEW_PROGRAM);
if (pro != NULL)
{
_mesa_Uniform4fvARB (GLint location, GLsizei count, const GLfloat *value)
{
GET_CURRENT_CONTEXT(ctx);
- GET_CURRENT_LINKED_PROGRAM(pro, "glUniform4fvARB");
+ GET_CURRENT_LINKED_PROGRAM(pro, "glUniform4fvARB");\r
+\r
+ FLUSH_VERTICES(ctx, _NEW_PROGRAM);
if (pro != NULL)
{
_mesa_Uniform1ivARB (GLint location, GLsizei count, const GLint *value)
{
GET_CURRENT_CONTEXT(ctx);
- GET_CURRENT_LINKED_PROGRAM(pro, "glUniform1ivARB");
+ GET_CURRENT_LINKED_PROGRAM(pro, "glUniform1ivARB");\r
+\r
+ FLUSH_VERTICES(ctx, _NEW_PROGRAM);
if (pro != NULL)
{
_mesa_Uniform2ivARB (GLint location, GLsizei count, const GLint *value)
{
GET_CURRENT_CONTEXT(ctx);
- GET_CURRENT_LINKED_PROGRAM(pro, "glUniform2ivARB");
+ GET_CURRENT_LINKED_PROGRAM(pro, "glUniform2ivARB");\r
+\r
+ FLUSH_VERTICES(ctx, _NEW_PROGRAM);
if (pro != NULL)
{
_mesa_Uniform3ivARB (GLint location, GLsizei count, const GLint *value)
{
GET_CURRENT_CONTEXT(ctx);
- GET_CURRENT_LINKED_PROGRAM(pro, "glUniform3ivARB");
+ GET_CURRENT_LINKED_PROGRAM(pro, "glUniform3ivARB");\r
+\r
+ FLUSH_VERTICES(ctx, _NEW_PROGRAM);
if (pro != NULL)
{
_mesa_Uniform4ivARB (GLint location, GLsizei count, const GLint *value)
{
GET_CURRENT_CONTEXT(ctx);
- GET_CURRENT_LINKED_PROGRAM(pro, "glUniform4ivARB");
+ GET_CURRENT_LINKED_PROGRAM(pro, "glUniform4ivARB");\r
+\r
+ FLUSH_VERTICES(ctx, _NEW_PROGRAM);
if (pro != NULL)
{
_mesa_UniformMatrix2fvARB (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value)
{
GET_CURRENT_CONTEXT(ctx);
- GET_CURRENT_LINKED_PROGRAM(pro, "glUniformMatrix2fvARB");
+ GET_CURRENT_LINKED_PROGRAM(pro, "glUniformMatrix2fvARB");\r
+\r
+ FLUSH_VERTICES(ctx, _NEW_PROGRAM);
if (pro != NULL)
{
_mesa_UniformMatrix3fvARB (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value)
{
GET_CURRENT_CONTEXT(ctx);
- GET_CURRENT_LINKED_PROGRAM(pro, "glUniformMatrix3fvARB");
+ GET_CURRENT_LINKED_PROGRAM(pro, "glUniformMatrix3fvARB");\r
+\r
+ FLUSH_VERTICES(ctx, _NEW_PROGRAM);
if (pro != NULL)
{
_mesa_UniformMatrix4fvARB (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value)
{
GET_CURRENT_CONTEXT(ctx);
- GET_CURRENT_LINKED_PROGRAM(pro, "glUniformMatrix4fvARB");
+ GET_CURRENT_LINKED_PROGRAM(pro, "glUniformMatrix4fvARB");\r
+\r
+ FLUSH_VERTICES(ctx, _NEW_PROGRAM);
if (pro != NULL)
{
GLvoid (* Validate) (struct gl2_program_intf **);\r
GLvoid (* UpdateFixedUniforms) (struct gl2_program_intf **);\r
GLvoid (* UpdateFixedAttribute) (struct gl2_program_intf **, GLuint, GLvoid *, GLuint, GLuint,\r
- GLboolean);\r
+ GLboolean);\r
GLvoid (* UpdateFixedVarying) (struct gl2_program_intf **, GLuint, GLvoid *, GLuint, GLuint,\r
- GLboolean);
+ GLboolean);\r
+ GLvoid (* GetTextureImageUsage) (struct gl2_program_intf **, GLbitfield *);
};
struct gl2_fragment_shader_intf
{\r
GLuint i;\r
\r
- for (i = 0; i < SLANG_UNIFORM_BINDING_MAX; i++)\r
+ for (i = 0; i < SLANG_SHADER_MAX; i++)\r
{\r
GLuint addr;\r
\r
{\r
GLubyte *mem;\r
\r
- mem = (GLubyte *) pro->machines[SLANG_UNIFORM_BINDING_VERTEX]->mem + addr + offset * size;\r
+ mem = (GLubyte *) pro->machines[SLANG_SHADER_VERTEX]->mem + addr + offset * size;\r
if (write)\r
_mesa_memcpy (mem, data, size);\r
else\r
{\r
GLubyte *mem;\r
\r
- mem = (GLubyte *) pro->machines[SLANG_UNIFORM_BINDING_FRAGMENT]->mem + addr + offset * size;\r
+ mem = (GLubyte *) pro->machines[SLANG_SHADER_FRAGMENT]->mem + addr + offset * size;\r
if (write)\r
_mesa_memcpy (mem, data, size);\r
else\r
}\r
}\r
\r
+static GLvoid\r
+_program_GetTextureImageUsage (struct gl2_program_intf **intf, GLbitfield *teximageusage)\r
+{\r
+ GET_CURRENT_CONTEXT(ctx);\r
+ struct gl2_program_impl *impl = (struct gl2_program_impl *) intf;\r
+ slang_program *pro = &impl->_obj.prog;\r
+ GLuint i;\r
+\r
+ for (i = 0; i < ctx->Const.MaxTextureImageUnits; i++)\r
+ teximageusage[i] = 0;\r
+\r
+ for (i = 0; i < pro->texture_usage.count; i++)\r
+ {\r
+ GLuint n, addr, j;\r
+\r
+ n = pro->texture_usage.table[i].quant->array_len;\r
+ if (n == 0)\r
+ n = 1;\r
+ addr = pro->texture_usage.table[i].frag_address;\r
+ for (j = 0; j < n; j++)\r
+ {\r
+ GLubyte *mem;\r
+ GLuint image;\r
+\r
+ mem = (GLubyte *) pro->machines[SLANG_SHADER_FRAGMENT]->mem + addr + j * 4;\r
+ image = (GLuint) *((GLfloat *) mem);\r
+ if (image >= 0 && image < ctx->Const.MaxTextureImageUnits)\r
+ {\r
+ switch (pro->texture_usage.table[i].quant->u.basic_type)\r
+ {\r
+ case GL_SAMPLER_1D_ARB:\r
+ case GL_SAMPLER_1D_SHADOW_ARB:\r
+ teximageusage[image] |= TEXTURE_1D_BIT;\r
+ break;\r
+ case GL_SAMPLER_2D_ARB:\r
+ case GL_SAMPLER_2D_SHADOW_ARB:\r
+ teximageusage[image] |= TEXTURE_2D_BIT;\r
+ break;\r
+ case GL_SAMPLER_3D_ARB:\r
+ teximageusage[image] |= TEXTURE_3D_BIT;\r
+ break;\r
+ case GL_SAMPLER_CUBE_ARB:\r
+ teximageusage[image] |= TEXTURE_CUBE_BIT;\r
+ break;\r
+ }\r
+ }\r
+ }\r
+ }\r
+\r
+ /* TODO: make sure that for 0<=i<=MaxTextureImageUint bitcount(teximageuint[i])<=0 */\r
+}\r
+\r
static struct gl2_program_intf _program_vftbl = {\r
{\r
{\r
_program_Validate,\r
_program_UpdateFixedUniforms,\r
_program_UpdateFixedAttribute,\r
- _program_UpdateFixedVarying\r
+ _program_UpdateFixedVarying,\r
+ _program_GetTextureImageUsage\r
};\r
\r
static void\r
struct gl2_program_impl *impl;\r
\r
impl = (struct gl2_program_impl *) pro;\r
- *val = impl->_obj.prog.machines[SLANG_UNIFORM_BINDING_FRAGMENT]->kill ? GL_TRUE : GL_FALSE;\r
+ *val = impl->_obj.prog.machines[SLANG_SHADER_FRAGMENT]->kill ? GL_TRUE : GL_FALSE;\r
return 1;\r
}\r
\r
p = &impl->_obj.prog;\r
\r
slang_machine_init (p->machines[i]);\r
- p->machines[i]->ip = p->code[i];\r
+ p->machines[i]->ip = p->code[i][SLANG_COMMON_CODE_MAIN];\r
\r
_slang_execute2 (p->assemblies[i], p->machines[i]);\r
}\r
\r
GLvoid _slang_exec_fragment_shader (struct gl2_program_intf **pro)\r
{\r
- exec_shader (pro, SLANG_UNIFORM_BINDING_FRAGMENT);\r
+ exec_shader (pro, SLANG_SHADER_FRAGMENT);\r
}\r
\r
GLvoid _slang_exec_vertex_shader (struct gl2_program_intf **pro)\r
{\r
- exec_shader (pro, SLANG_UNIFORM_BINDING_VERTEX);\r
+ exec_shader (pro, SLANG_SHADER_VERTEX);\r
}\r
\r
GLint _slang_get_uniform_location (struct gl2_program_intf **pro, const char *name)\r
slang_uniform_bindings *bind;\r
slang_uniform_binding *b;\r
GLuint i;\r
+ GLboolean convert_float_to_bool = GL_FALSE;\r
+ GLboolean convert_int_to_bool = GL_FALSE;\r
+ GLboolean convert_int_to_float = GL_FALSE;\r
+ GLboolean types_match = GL_FALSE;\r
\r
if (loc == -1)\r
return GL_TRUE;\r
\r
b = &bind->table[loc];\r
/* TODO: check sizes */\r
- /* TODO: check if not structure */\r
- if (b->quant->u.basic_type != type)\r
+ if (b->quant->structure != NULL)\r
return GL_FALSE;\r
\r
- for (i = 0; i < SLANG_UNIFORM_BINDING_MAX; i++)\r
- if (b->address[i] != ~0)\r
- {\r
- _mesa_memcpy (&impl->_obj.prog.machines[i]->mem[b->address[i] / 4], data,\r
- count * b->quant->size);\r
- }\r
+ switch (b->quant->u.basic_type)\r
+ {\r
+ case GL_BOOL_ARB:\r
+ types_match = (type == GL_FLOAT) || (type == GL_INT);\r
+ if (type == GL_FLOAT)\r
+ convert_float_to_bool = GL_TRUE;\r
+ else\r
+ convert_int_to_bool = GL_TRUE;\r
+ break;\r
+ case GL_BOOL_VEC2_ARB:\r
+ types_match = (type == GL_FLOAT_VEC2_ARB) || (type == GL_INT_VEC2_ARB);\r
+ if (type == GL_FLOAT_VEC2_ARB)\r
+ convert_float_to_bool = GL_TRUE;\r
+ else\r
+ convert_int_to_bool = GL_TRUE;\r
+ break;\r
+ case GL_BOOL_VEC3_ARB:\r
+ types_match = (type == GL_FLOAT_VEC3_ARB) || (type == GL_INT_VEC3_ARB);\r
+ if (type == GL_FLOAT_VEC3_ARB)\r
+ convert_float_to_bool = GL_TRUE;\r
+ else\r
+ convert_int_to_bool = GL_TRUE;\r
+ break;\r
+ case GL_BOOL_VEC4_ARB:\r
+ types_match = (type == GL_FLOAT_VEC4_ARB) || (type == GL_INT_VEC4_ARB);\r
+ if (type == GL_FLOAT_VEC4_ARB)\r
+ convert_float_to_bool = GL_TRUE;\r
+ else\r
+ convert_int_to_bool = GL_TRUE;\r
+ break;\r
+ case GL_SAMPLER_1D_ARB:\r
+ case GL_SAMPLER_2D_ARB:\r
+ case GL_SAMPLER_3D_ARB:\r
+ case GL_SAMPLER_CUBE_ARB:\r
+ case GL_SAMPLER_1D_SHADOW_ARB:\r
+ case GL_SAMPLER_2D_SHADOW_ARB:\r
+ types_match = (type == GL_INT);\r
+ break;\r
+ default:\r
+ types_match = (type == b->quant->u.basic_type);\r
+ break;\r
+ }\r
+\r
+ if (!types_match)\r
+ return GL_FALSE;\r
+\r
+ switch (type)\r
+ {\r
+ case GL_INT:\r
+ case GL_INT_VEC2_ARB:\r
+ case GL_INT_VEC3_ARB:\r
+ case GL_INT_VEC4_ARB:\r
+ convert_int_to_float = GL_TRUE;\r
+ break;\r
+ }\r
+\r
+ if (convert_float_to_bool)\r
+ {\r
+ for (i = 0; i < SLANG_SHADER_MAX; i++)\r
+ if (b->address[i] != ~0)\r
+ {\r
+ const GLfloat *src = (GLfloat *) (data);\r
+ GLfloat *dst = (GLfloat *) (&impl->_obj.prog.machines[i]->mem[b->address[i] / 4]);\r
+ GLuint j;\r
+\r
+ for (j = 0; j < count * b->quant->size / 4; j++)\r
+ dst[j] = src[j] != 0.0f ? 1.0f : 0.0f;\r
+ }\r
+ }\r
+ else if (convert_int_to_bool)\r
+ {\r
+ for (i = 0; i < SLANG_SHADER_MAX; i++)\r
+ if (b->address[i] != ~0)\r
+ {\r
+ const GLuint *src = (GLuint *) (data);\r
+ GLfloat *dst = (GLfloat *) (&impl->_obj.prog.machines[i]->mem[b->address[i] / 4]);\r
+ GLuint j;\r
+\r
+ for (j = 0; j < count * b->quant->size / 4; j++)\r
+ dst[j] = src[j] ? 1.0f : 0.0f;\r
+ }\r
+ }\r
+ else if (convert_int_to_float)\r
+ {\r
+ for (i = 0; i < SLANG_SHADER_MAX; i++)\r
+ if (b->address[i] != ~0)\r
+ {\r
+ const GLuint *src = (GLuint *) (data);\r
+ GLfloat *dst = (GLfloat *) (&impl->_obj.prog.machines[i]->mem[b->address[i] / 4]);\r
+ GLuint j;\r
+\r
+ for (j = 0; j < count * b->quant->size / 4; j++)\r
+ dst[j] = (GLfloat) src[j];\r
+ }\r
+ }\r
+ else\r
+ {\r
+ for (i = 0; i < SLANG_SHADER_MAX; i++)\r
+ if (b->address[i] != ~0)\r
+ {\r
+ _mesa_memcpy (&impl->_obj.prog.machines[i]->mem[b->address[i] / 4], data,\r
+ count * b->quant->size);\r
+ }\r
+ }\r
return GL_TRUE;\r
}\r
\r
-
-//
-// TODO:
-// - implement texture1D, texture3D, textureCube,
-// - implement shadow1D, shadow2D,
-//
-
+/*\r
+ * Mesa 3-D graphics library\r
+ * Version: 6.5\r
+ *\r
+ * Copyright (C) 2006 Brian Paul All Rights Reserved.\r
+ *\r
+ * Permission is hereby granted, free of charge, to any person obtaining a\r
+ * copy of this software and associated documentation files (the "Software"),\r
+ * to deal in the Software without restriction, including without limitation\r
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,\r
+ * and/or sell copies of the Software, and to permit persons to whom the\r
+ * Software is furnished to do so, subject to the following conditions:\r
+ *\r
+ * The above copyright notice and this permission notice shall be included\r
+ * in all copies or substantial portions of the Software.\r
+ *\r
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS\r
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\r
+ * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN\r
+ * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\r
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r
+ */\r
+\r
//
// From Shader Spec, ver. 1.10, rev. 59
//
//
vec4 texture1D (sampler1D sampler, float coord) {\r
- // XXX:
- return vec4 (0.0);
+ vec4 texel;\r
+ __asm vec4_tex1d texel, sampler, coord, 0.0;\r
+ return texel;
}\r
vec4 texture1DProj (sampler1D sampler, vec2 coord) {
vec4 texture2D (sampler2D sampler, vec2 coord) {\r
vec4 texel;\r
- __asm vec4_tex2d texel, sampler, coord;\r
+ __asm vec4_tex2d texel, sampler, coord, 0.0;\r
return texel;
}\r
}
vec4 texture3D (sampler3D sampler, vec3 coord) {\r
- // XXX:
- return vec4 (0.0);
+ vec4 texel;\r
+ __asm vec4_tex3d texel, sampler, coord, 0.0;\r
+ return texel;
}\r
vec4 texture3DProj (sampler3D sampler, vec4 coord) {\r
}
vec4 textureCube (samplerCube sampler, vec3 coord) {\r
- // XXX:
- return vec4 (0.0);
+ vec4 texel;\r
+ __asm vec4_texcube texel, sampler, coord, 0.0;\r
+ return texel;
}
vec4 shadow1D (sampler1DShadow sampler, vec3 coord) {\r
- // XXX:
- return vec4 (0.0);
+ vec4 texel;\r
+ __asm vec4_shad1d texel, sampler, coord, 0.0;\r
+ return texel;
}
-vec4 shadow2D (sampler2DShadow sampler, vec3 coord) {\r
- // XXX:
- return vec4 (0.0);
-}\r
-
vec4 shadow1DProj (sampler1DShadow sampler, vec4 coord) {\r
- return shadow1D (sampler, vec3 (coord.s / coord.q, 0.0, coord.p / coord.q));
+ return shadow1D (sampler, vec3 (coord.s / coord.q, 0.0, coord.p / coord.q));\r
+}\r
+\r
+vec4 shadow2D (sampler2DShadow sampler, vec3 coord) {\r
+ vec4 texel;\r
+ __asm vec4_shad2d texel, sampler, coord, 0.0;\r
+ return texel;
}\r
vec4 shadow2DProj (sampler2DShadow sampler, vec4 coord) {\r
0,56,0,18,118,0,59,121,0,56,0,18,118,0,59,122,0,56,0,0,0,0,1,0,4,0,110,111,116,0,1,0,0,4,118,0,0,0,\r
1,8,58,98,118,101,99,52,0,18,118,0,59,120,0,56,0,18,118,0,59,121,0,56,0,18,118,0,59,122,0,56,0,18,\r
118,0,59,119,0,56,0,0,0,0,1,0,12,0,116,101,120,116,117,114,101,49,68,0,1,0,0,16,115,97,109,112,108,\r
-101,114,0,0,1,0,0,9,99,111,111,114,100,0,0,0,1,8,58,118,101,99,52,0,17,48,0,48,0,0,0,0,0,0,1,0,12,\r
-0,116,101,120,116,117,114,101,49,68,80,114,111,106,0,1,0,0,16,115,97,109,112,108,101,114,0,0,1,0,0,\r
-10,99,111,111,114,100,0,0,0,1,8,58,116,101,120,116,117,114,101,49,68,0,18,115,97,109,112,108,101,\r
-114,0,0,18,99,111,111,114,100,0,59,115,0,18,99,111,111,114,100,0,59,116,0,49,0,0,0,0,1,0,12,0,116,\r
-101,120,116,117,114,101,49,68,80,114,111,106,0,1,0,0,16,115,97,109,112,108,101,114,0,0,1,0,0,12,99,\r
-111,111,114,100,0,0,0,1,8,58,116,101,120,116,117,114,101,49,68,0,18,115,97,109,112,108,101,114,0,0,\r
-18,99,111,111,114,100,0,59,115,0,18,99,111,111,114,100,0,59,113,0,49,0,0,0,0,1,0,12,0,116,101,120,\r
-116,117,114,101,50,68,0,1,0,0,17,115,97,109,112,108,101,114,0,0,1,0,0,10,99,111,111,114,100,0,0,0,\r
-1,3,2,0,12,1,116,101,120,101,108,0,0,0,4,118,101,99,52,95,116,101,120,50,100,0,18,116,101,120,101,\r
-108,0,0,18,115,97,109,112,108,101,114,0,0,18,99,111,111,114,100,0,0,0,8,18,116,101,120,101,108,0,0,\r
-0,1,0,12,0,116,101,120,116,117,114,101,50,68,80,114,111,106,0,1,0,0,17,115,97,109,112,108,101,114,\r
-0,0,1,0,0,11,99,111,111,114,100,0,0,0,1,8,58,116,101,120,116,117,114,101,50,68,0,18,115,97,109,112,\r
-108,101,114,0,0,58,118,101,99,50,0,18,99,111,111,114,100,0,59,115,0,18,99,111,111,114,100,0,59,112,\r
-0,49,0,18,99,111,111,114,100,0,59,116,0,18,99,111,111,114,100,0,59,112,0,49,0,0,0,0,0,0,1,0,12,0,\r
-116,101,120,116,117,114,101,50,68,80,114,111,106,0,1,0,0,17,115,97,109,112,108,101,114,0,0,1,0,0,\r
-12,99,111,111,114,100,0,0,0,1,8,58,116,101,120,116,117,114,101,50,68,0,18,115,97,109,112,108,101,\r
-114,0,0,58,118,101,99,50,0,18,99,111,111,114,100,0,59,115,0,18,99,111,111,114,100,0,59,113,0,49,0,\r
-18,99,111,111,114,100,0,59,116,0,18,99,111,111,114,100,0,59,113,0,49,0,0,0,0,0,0,1,0,12,0,116,101,\r
-120,116,117,114,101,51,68,0,1,0,0,18,115,97,109,112,108,101,114,0,0,1,0,0,11,99,111,111,114,100,0,\r
-0,0,1,8,58,118,101,99,52,0,17,48,0,48,0,0,0,0,0,0,1,0,12,0,116,101,120,116,117,114,101,51,68,80,\r
-114,111,106,0,1,0,0,18,115,97,109,112,108,101,114,0,0,1,0,0,12,99,111,111,114,100,0,0,0,1,8,58,116,\r
-101,120,116,117,114,101,51,68,0,18,115,97,109,112,108,101,114,0,0,58,118,101,99,51,0,18,99,111,111,\r
-114,100,0,59,115,0,18,99,111,111,114,100,0,59,113,0,49,0,18,99,111,111,114,100,0,59,116,0,18,99,\r
-111,111,114,100,0,59,113,0,49,0,18,99,111,111,114,100,0,59,112,0,18,99,111,111,114,100,0,59,113,0,\r
-49,0,0,0,0,0,0,1,0,12,0,116,101,120,116,117,114,101,67,117,98,101,0,1,0,0,19,115,97,109,112,108,\r
-101,114,0,0,1,0,0,11,99,111,111,114,100,0,0,0,1,8,58,118,101,99,52,0,17,48,0,48,0,0,0,0,0,0,1,0,12,\r
-0,115,104,97,100,111,119,49,68,0,1,0,0,20,115,97,109,112,108,101,114,0,0,1,0,0,11,99,111,111,114,\r
-100,0,0,0,1,8,58,118,101,99,52,0,17,48,0,48,0,0,0,0,0,0,1,0,12,0,115,104,97,100,111,119,50,68,0,1,\r
-0,0,21,115,97,109,112,108,101,114,0,0,1,0,0,11,99,111,111,114,100,0,0,0,1,8,58,118,101,99,52,0,17,\r
-48,0,48,0,0,0,0,0,0,1,0,12,0,115,104,97,100,111,119,49,68,80,114,111,106,0,1,0,0,20,115,97,109,112,\r
-108,101,114,0,0,1,0,0,12,99,111,111,114,100,0,0,0,1,8,58,115,104,97,100,111,119,49,68,0,18,115,97,\r
-109,112,108,101,114,0,0,58,118,101,99,51,0,18,99,111,111,114,100,0,59,115,0,18,99,111,111,114,100,\r
-0,59,113,0,49,0,17,48,0,48,0,0,0,18,99,111,111,114,100,0,59,112,0,18,99,111,111,114,100,0,59,113,0,\r
-49,0,0,0,0,0,0,1,0,12,0,115,104,97,100,111,119,50,68,80,114,111,106,0,1,0,0,21,115,97,109,112,108,\r
-101,114,0,0,1,0,0,12,99,111,111,114,100,0,0,0,1,8,58,115,104,97,100,111,119,50,68,0,18,115,97,109,\r
-112,108,101,114,0,0,58,118,101,99,51,0,18,99,111,111,114,100,0,59,115,0,18,99,111,111,114,100,0,59,\r
-113,0,49,0,18,99,111,111,114,100,0,59,116,0,18,99,111,111,114,100,0,59,113,0,49,0,18,99,111,111,\r
-114,100,0,59,112,0,18,99,111,111,114,100,0,59,113,0,49,0,0,0,0,0,0,1,0,9,0,110,111,105,115,101,49,\r
-0,1,0,0,9,120,0,0,0,1,3,2,0,9,1,97,0,0,0,4,102,108,111,97,116,95,110,111,105,115,101,49,0,18,97,0,\r
-0,18,120,0,0,0,8,18,97,0,0,0,1,0,9,0,110,111,105,115,101,49,0,1,0,0,10,120,0,0,0,1,3,2,0,9,1,97,0,\r
-0,0,4,102,108,111,97,116,95,110,111,105,115,101,50,0,18,97,0,0,18,120,0,0,0,8,18,97,0,0,0,1,0,9,0,\r
-110,111,105,115,101,49,0,1,0,0,11,120,0,0,0,1,3,2,0,9,1,97,0,0,0,4,102,108,111,97,116,95,110,111,\r
-105,115,101,51,0,18,97,0,0,18,120,0,0,0,8,18,97,0,0,0,1,0,9,0,110,111,105,115,101,49,0,1,0,0,12,\r
-120,0,0,0,1,3,2,0,9,1,97,0,0,0,4,102,108,111,97,116,95,110,111,105,115,101,52,0,18,97,0,0,18,120,0,\r
-0,0,8,18,97,0,0,0,1,0,10,0,110,111,105,115,101,50,0,1,0,0,9,120,0,0,0,1,8,58,118,101,99,50,0,58,\r
-110,111,105,115,101,49,0,18,120,0,0,0,0,58,110,111,105,115,101,49,0,18,120,0,17,49,57,0,51,52,0,0,\r
-46,0,0,0,0,0,0,1,0,10,0,110,111,105,115,101,50,0,1,0,0,10,120,0,0,0,1,8,58,118,101,99,50,0,58,110,\r
-111,105,115,101,49,0,18,120,0,0,0,0,58,110,111,105,115,101,49,0,18,120,0,58,118,101,99,50,0,17,49,\r
-57,0,51,52,0,0,0,17,55,0,54,54,0,0,0,0,46,0,0,0,0,0,0,1,0,10,0,110,111,105,115,101,50,0,1,0,0,11,\r
-120,0,0,0,1,8,58,118,101,99,50,0,58,110,111,105,115,101,49,0,18,120,0,0,0,0,58,110,111,105,115,101,\r
-49,0,18,120,0,58,118,101,99,51,0,17,49,57,0,51,52,0,0,0,17,55,0,54,54,0,0,0,17,51,0,50,51,0,0,0,0,\r
-46,0,0,0,0,0,0,1,0,10,0,110,111,105,115,101,50,0,1,0,0,12,120,0,0,0,1,8,58,118,101,99,50,0,58,110,\r
-111,105,115,101,49,0,18,120,0,0,0,0,58,110,111,105,115,101,49,0,18,120,0,58,118,101,99,52,0,17,49,\r
-57,0,51,52,0,0,0,17,55,0,54,54,0,0,0,17,51,0,50,51,0,0,0,17,50,0,55,55,0,0,0,0,46,0,0,0,0,0,0,1,0,\r
-11,0,110,111,105,115,101,51,0,1,0,0,9,120,0,0,0,1,8,58,118,101,99,51,0,58,110,111,105,115,101,49,0,\r
-18,120,0,0,0,0,58,110,111,105,115,101,49,0,18,120,0,17,49,57,0,51,52,0,0,46,0,0,0,58,110,111,105,\r
+101,114,0,0,1,0,0,9,99,111,111,114,100,0,0,0,1,3,2,0,12,1,116,101,120,101,108,0,0,0,4,118,101,99,\r
+52,95,116,101,120,49,100,0,18,116,101,120,101,108,0,0,18,115,97,109,112,108,101,114,0,0,18,99,111,\r
+111,114,100,0,0,17,48,0,48,0,0,0,0,8,18,116,101,120,101,108,0,0,0,1,0,12,0,116,101,120,116,117,114,\r
+101,49,68,80,114,111,106,0,1,0,0,16,115,97,109,112,108,101,114,0,0,1,0,0,10,99,111,111,114,100,0,0,\r
+0,1,8,58,116,101,120,116,117,114,101,49,68,0,18,115,97,109,112,108,101,114,0,0,18,99,111,111,114,\r
+100,0,59,115,0,18,99,111,111,114,100,0,59,116,0,49,0,0,0,0,1,0,12,0,116,101,120,116,117,114,101,49,\r
+68,80,114,111,106,0,1,0,0,16,115,97,109,112,108,101,114,0,0,1,0,0,12,99,111,111,114,100,0,0,0,1,8,\r
+58,116,101,120,116,117,114,101,49,68,0,18,115,97,109,112,108,101,114,0,0,18,99,111,111,114,100,0,\r
+59,115,0,18,99,111,111,114,100,0,59,113,0,49,0,0,0,0,1,0,12,0,116,101,120,116,117,114,101,50,68,0,\r
+1,0,0,17,115,97,109,112,108,101,114,0,0,1,0,0,10,99,111,111,114,100,0,0,0,1,3,2,0,12,1,116,101,120,\r
+101,108,0,0,0,4,118,101,99,52,95,116,101,120,50,100,0,18,116,101,120,101,108,0,0,18,115,97,109,112,\r
+108,101,114,0,0,18,99,111,111,114,100,0,0,17,48,0,48,0,0,0,0,8,18,116,101,120,101,108,0,0,0,1,0,12,\r
+0,116,101,120,116,117,114,101,50,68,80,114,111,106,0,1,0,0,17,115,97,109,112,108,101,114,0,0,1,0,0,\r
+11,99,111,111,114,100,0,0,0,1,8,58,116,101,120,116,117,114,101,50,68,0,18,115,97,109,112,108,101,\r
+114,0,0,58,118,101,99,50,0,18,99,111,111,114,100,0,59,115,0,18,99,111,111,114,100,0,59,112,0,49,0,\r
+18,99,111,111,114,100,0,59,116,0,18,99,111,111,114,100,0,59,112,0,49,0,0,0,0,0,0,1,0,12,0,116,101,\r
+120,116,117,114,101,50,68,80,114,111,106,0,1,0,0,17,115,97,109,112,108,101,114,0,0,1,0,0,12,99,111,\r
+111,114,100,0,0,0,1,8,58,116,101,120,116,117,114,101,50,68,0,18,115,97,109,112,108,101,114,0,0,58,\r
+118,101,99,50,0,18,99,111,111,114,100,0,59,115,0,18,99,111,111,114,100,0,59,113,0,49,0,18,99,111,\r
+111,114,100,0,59,116,0,18,99,111,111,114,100,0,59,113,0,49,0,0,0,0,0,0,1,0,12,0,116,101,120,116,\r
+117,114,101,51,68,0,1,0,0,18,115,97,109,112,108,101,114,0,0,1,0,0,11,99,111,111,114,100,0,0,0,1,3,\r
+2,0,12,1,116,101,120,101,108,0,0,0,4,118,101,99,52,95,116,101,120,51,100,0,18,116,101,120,101,108,\r
+0,0,18,115,97,109,112,108,101,114,0,0,18,99,111,111,114,100,0,0,17,48,0,48,0,0,0,0,8,18,116,101,\r
+120,101,108,0,0,0,1,0,12,0,116,101,120,116,117,114,101,51,68,80,114,111,106,0,1,0,0,18,115,97,109,\r
+112,108,101,114,0,0,1,0,0,12,99,111,111,114,100,0,0,0,1,8,58,116,101,120,116,117,114,101,51,68,0,\r
+18,115,97,109,112,108,101,114,0,0,58,118,101,99,51,0,18,99,111,111,114,100,0,59,115,0,18,99,111,\r
+111,114,100,0,59,113,0,49,0,18,99,111,111,114,100,0,59,116,0,18,99,111,111,114,100,0,59,113,0,49,0,\r
+18,99,111,111,114,100,0,59,112,0,18,99,111,111,114,100,0,59,113,0,49,0,0,0,0,0,0,1,0,12,0,116,101,\r
+120,116,117,114,101,67,117,98,101,0,1,0,0,19,115,97,109,112,108,101,114,0,0,1,0,0,11,99,111,111,\r
+114,100,0,0,0,1,3,2,0,12,1,116,101,120,101,108,0,0,0,4,118,101,99,52,95,116,101,120,99,117,98,101,\r
+0,18,116,101,120,101,108,0,0,18,115,97,109,112,108,101,114,0,0,18,99,111,111,114,100,0,0,17,48,0,\r
+48,0,0,0,0,8,18,116,101,120,101,108,0,0,0,1,0,12,0,115,104,97,100,111,119,49,68,0,1,0,0,20,115,97,\r
+109,112,108,101,114,0,0,1,0,0,11,99,111,111,114,100,0,0,0,1,3,2,0,12,1,116,101,120,101,108,0,0,0,4,\r
+118,101,99,52,95,115,104,97,100,49,100,0,18,116,101,120,101,108,0,0,18,115,97,109,112,108,101,114,\r
+0,0,18,99,111,111,114,100,0,0,17,48,0,48,0,0,0,0,8,18,116,101,120,101,108,0,0,0,1,0,12,0,115,104,\r
+97,100,111,119,49,68,80,114,111,106,0,1,0,0,20,115,97,109,112,108,101,114,0,0,1,0,0,12,99,111,111,\r
+114,100,0,0,0,1,8,58,115,104,97,100,111,119,49,68,0,18,115,97,109,112,108,101,114,0,0,58,118,101,\r
+99,51,0,18,99,111,111,114,100,0,59,115,0,18,99,111,111,114,100,0,59,113,0,49,0,17,48,0,48,0,0,0,18,\r
+99,111,111,114,100,0,59,112,0,18,99,111,111,114,100,0,59,113,0,49,0,0,0,0,0,0,1,0,12,0,115,104,97,\r
+100,111,119,50,68,0,1,0,0,21,115,97,109,112,108,101,114,0,0,1,0,0,11,99,111,111,114,100,0,0,0,1,3,\r
+2,0,12,1,116,101,120,101,108,0,0,0,4,118,101,99,52,95,115,104,97,100,50,100,0,18,116,101,120,101,\r
+108,0,0,18,115,97,109,112,108,101,114,0,0,18,99,111,111,114,100,0,0,17,48,0,48,0,0,0,0,8,18,116,\r
+101,120,101,108,0,0,0,1,0,12,0,115,104,97,100,111,119,50,68,80,114,111,106,0,1,0,0,21,115,97,109,\r
+112,108,101,114,0,0,1,0,0,12,99,111,111,114,100,0,0,0,1,8,58,115,104,97,100,111,119,50,68,0,18,115,\r
+97,109,112,108,101,114,0,0,58,118,101,99,51,0,18,99,111,111,114,100,0,59,115,0,18,99,111,111,114,\r
+100,0,59,113,0,49,0,18,99,111,111,114,100,0,59,116,0,18,99,111,111,114,100,0,59,113,0,49,0,18,99,\r
+111,111,114,100,0,59,112,0,18,99,111,111,114,100,0,59,113,0,49,0,0,0,0,0,0,1,0,9,0,110,111,105,115,\r
+101,49,0,1,0,0,9,120,0,0,0,1,3,2,0,9,1,97,0,0,0,4,102,108,111,97,116,95,110,111,105,115,101,49,0,\r
+18,97,0,0,18,120,0,0,0,8,18,97,0,0,0,1,0,9,0,110,111,105,115,101,49,0,1,0,0,10,120,0,0,0,1,3,2,0,9,\r
+1,97,0,0,0,4,102,108,111,97,116,95,110,111,105,115,101,50,0,18,97,0,0,18,120,0,0,0,8,18,97,0,0,0,1,\r
+0,9,0,110,111,105,115,101,49,0,1,0,0,11,120,0,0,0,1,3,2,0,9,1,97,0,0,0,4,102,108,111,97,116,95,110,\r
+111,105,115,101,51,0,18,97,0,0,18,120,0,0,0,8,18,97,0,0,0,1,0,9,0,110,111,105,115,101,49,0,1,0,0,\r
+12,120,0,0,0,1,3,2,0,9,1,97,0,0,0,4,102,108,111,97,116,95,110,111,105,115,101,52,0,18,97,0,0,18,\r
+120,0,0,0,8,18,97,0,0,0,1,0,10,0,110,111,105,115,101,50,0,1,0,0,9,120,0,0,0,1,8,58,118,101,99,50,0,\r
+58,110,111,105,115,101,49,0,18,120,0,0,0,0,58,110,111,105,115,101,49,0,18,120,0,17,49,57,0,51,52,0,\r
+0,46,0,0,0,0,0,0,1,0,10,0,110,111,105,115,101,50,0,1,0,0,10,120,0,0,0,1,8,58,118,101,99,50,0,58,\r
+110,111,105,115,101,49,0,18,120,0,0,0,0,58,110,111,105,115,101,49,0,18,120,0,58,118,101,99,50,0,17,\r
+49,57,0,51,52,0,0,0,17,55,0,54,54,0,0,0,0,46,0,0,0,0,0,0,1,0,10,0,110,111,105,115,101,50,0,1,0,0,\r
+11,120,0,0,0,1,8,58,118,101,99,50,0,58,110,111,105,115,101,49,0,18,120,0,0,0,0,58,110,111,105,115,\r
+101,49,0,18,120,0,58,118,101,99,51,0,17,49,57,0,51,52,0,0,0,17,55,0,54,54,0,0,0,17,51,0,50,51,0,0,\r
+0,0,46,0,0,0,0,0,0,1,0,10,0,110,111,105,115,101,50,0,1,0,0,12,120,0,0,0,1,8,58,118,101,99,50,0,58,\r
+110,111,105,115,101,49,0,18,120,0,0,0,0,58,110,111,105,115,101,49,0,18,120,0,58,118,101,99,52,0,17,\r
+49,57,0,51,52,0,0,0,17,55,0,54,54,0,0,0,17,51,0,50,51,0,0,0,17,50,0,55,55,0,0,0,0,46,0,0,0,0,0,0,1,\r
+0,11,0,110,111,105,115,101,51,0,1,0,0,9,120,0,0,0,1,8,58,118,101,99,51,0,58,110,111,105,115,101,49,\r
+0,18,120,0,0,0,0,58,110,111,105,115,101,49,0,18,120,0,17,49,57,0,51,52,0,0,46,0,0,0,58,110,111,105,\r
115,101,49,0,18,120,0,17,53,0,52,55,0,0,46,0,0,0,0,0,0,1,0,11,0,110,111,105,115,101,51,0,1,0,0,10,\r
120,0,0,0,1,8,58,118,101,99,51,0,58,110,111,105,115,101,49,0,18,120,0,0,0,0,58,110,111,105,115,101,\r
49,0,18,120,0,58,118,101,99,50,0,17,49,57,0,51,52,0,0,0,17,55,0,54,54,0,0,0,0,46,0,0,0,58,110,111,\r
+/*\r
+ * Mesa 3-D graphics library\r
+ * Version: 6.5\r
+ *\r
+ * Copyright (C) 2006 Brian Paul All Rights Reserved.\r
+ *\r
+ * Permission is hereby granted, free of charge, to any person obtaining a\r
+ * copy of this software and associated documentation files (the "Software"),\r
+ * to deal in the Software without restriction, including without limitation\r
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,\r
+ * and/or sell copies of the Software, and to permit persons to whom the\r
+ * Software is furnished to do so, subject to the following conditions:\r
+ *\r
+ * The above copyright notice and this permission notice shall be included\r
+ * in all copies or substantial portions of the Software.\r
+ *\r
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS\r
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\r
+ * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN\r
+ * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\r
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r
+ */\r
//
// TODO:
-// - implement texture1D, texture2D, texture3D, textureCube,
-// - implement shadow1D, shadow2D,
// - implement dFdx, dFdy,
//
//
vec4 texture1D (sampler1D sampler, float coord, float bias) {\r
- // XXX:
- return vec4 (0.0);
+ vec4 texel;\r
+ __asm vec4_tex1d texel, sampler, coord, bias;\r
+ return texel;
}\r
vec4 texture1DProj (sampler1D sampler, vec2 coord, float bias) {
}
vec4 texture2D (sampler2D sampler, vec2 coord, float bias) {\r
- // XXX:
- return vec4 (0.0);
+ vec4 texel;\r
+ __asm vec4_tex2d texel, sampler, coord, bias;\r
+ return texel;
}\r
vec4 texture2DProj (sampler2D sampler, vec3 coord, float bias) {\r
}
vec4 texture3D (sampler3D sampler, vec3 coord, float bias) {\r
- // XXX:
- return vec4 (0.0);
+ vec4 texel;\r
+ __asm vec4_tex3d texel, sampler, coord, bias;\r
+ return texel;
}\r
vec4 texture3DProj (sampler3D sampler, vec4 coord, float bias) {\r
}
vec4 textureCube (samplerCube sampler, vec3 coord, float bias) {\r
- // XXX:
- return vec4 (0.0);
+ vec4 texel;\r
+ __asm vec4_texcube texel, sampler, coord, bias;\r
+ return texel;
}
vec4 shadow1D (sampler1DShadow sampler, vec3 coord, float bias) {\r
- // XXX:
- return vec4 (0.0);
-}\r
-
-vec4 shadow2D (sampler2DShadow sampler, vec3 coord, float bias) {\r
- // XXX:
- return vec4 (0.0);
+ vec4 texel;\r
+ __asm vec4_shad1d texel, sampler, coord, bias;\r
+ return texel;
}\r
vec4 shadow1DProj (sampler1DShadow sampler, vec4 coord, float bias) {\r
- return shadow1D (sampler, vec3 (coord.s / coord.q, 0.0, coord.p / coord.q), bias);
+ return shadow1D (sampler, vec3 (coord.s / coord.q, 0.0, coord.p / coord.q), bias);\r
+}\r
+\r
+vec4 shadow2D (sampler2DShadow sampler, vec3 coord, float bias) {\r
+ vec4 texel;\r
+ __asm vec4_shad2d texel, sampler, coord, bias;\r
+ return texel;
}\r
vec4 shadow2DProj (sampler2DShadow sampler, vec4 coord, float bias) {\r
111,114,0,0,0,2,2,3,12,1,103,108,95,84,101,120,67,111,111,114,100,0,3,18,103,108,95,77,97,120,84,\r
101,120,116,117,114,101,67,111,111,114,100,115,0,0,0,2,2,3,9,1,103,108,95,70,111,103,70,114,97,103,\r
67,111,111,114,100,0,0,0,1,0,12,0,116,101,120,116,117,114,101,49,68,0,1,0,0,16,115,97,109,112,108,\r
-101,114,0,0,1,0,0,9,99,111,111,114,100,0,0,1,0,0,9,98,105,97,115,0,0,0,1,8,58,118,101,99,52,0,17,\r
-48,0,48,0,0,0,0,0,0,1,0,12,0,116,101,120,116,117,114,101,49,68,80,114,111,106,0,1,0,0,16,115,97,\r
-109,112,108,101,114,0,0,1,0,0,10,99,111,111,114,100,0,0,1,0,0,9,98,105,97,115,0,0,0,1,8,58,116,101,\r
-120,116,117,114,101,49,68,0,18,115,97,109,112,108,101,114,0,0,18,99,111,111,114,100,0,59,115,0,18,\r
-99,111,111,114,100,0,59,116,0,49,0,18,98,105,97,115,0,0,0,0,0,1,0,12,0,116,101,120,116,117,114,101,\r
-49,68,80,114,111,106,0,1,0,0,16,115,97,109,112,108,101,114,0,0,1,0,0,12,99,111,111,114,100,0,0,1,0,\r
-0,9,98,105,97,115,0,0,0,1,8,58,116,101,120,116,117,114,101,49,68,0,18,115,97,109,112,108,101,114,0,\r
-0,18,99,111,111,114,100,0,59,115,0,18,99,111,111,114,100,0,59,113,0,49,0,18,98,105,97,115,0,0,0,0,\r
-0,1,0,12,0,116,101,120,116,117,114,101,50,68,0,1,0,0,17,115,97,109,112,108,101,114,0,0,1,0,0,10,99,\r
-111,111,114,100,0,0,1,0,0,9,98,105,97,115,0,0,0,1,8,58,118,101,99,52,0,17,48,0,48,0,0,0,0,0,0,1,0,\r
-12,0,116,101,120,116,117,114,101,50,68,80,114,111,106,0,1,0,0,17,115,97,109,112,108,101,114,0,0,1,\r
-0,0,11,99,111,111,114,100,0,0,1,0,0,9,98,105,97,115,0,0,0,1,8,58,116,101,120,116,117,114,101,50,68,\r
-0,18,115,97,109,112,108,101,114,0,0,58,118,101,99,50,0,18,99,111,111,114,100,0,59,115,0,18,99,111,\r
-111,114,100,0,59,112,0,49,0,18,99,111,111,114,100,0,59,116,0,18,99,111,111,114,100,0,59,112,0,49,0,\r
-0,0,18,98,105,97,115,0,0,0,0,0,1,0,12,0,116,101,120,116,117,114,101,50,68,80,114,111,106,0,1,0,0,\r
-17,115,97,109,112,108,101,114,0,0,1,0,0,12,99,111,111,114,100,0,0,1,0,0,9,98,105,97,115,0,0,0,1,8,\r
-58,116,101,120,116,117,114,101,50,68,0,18,115,97,109,112,108,101,114,0,0,58,118,101,99,50,0,18,99,\r
-111,111,114,100,0,59,115,0,18,99,111,111,114,100,0,59,113,0,49,0,18,99,111,111,114,100,0,59,116,0,\r
-18,99,111,111,114,100,0,59,113,0,49,0,0,0,18,98,105,97,115,0,0,0,0,0,1,0,12,0,116,101,120,116,117,\r
-114,101,51,68,0,1,0,0,18,115,97,109,112,108,101,114,0,0,1,0,0,11,99,111,111,114,100,0,0,1,0,0,9,98,\r
-105,97,115,0,0,0,1,8,58,118,101,99,52,0,17,48,0,48,0,0,0,0,0,0,1,0,12,0,116,101,120,116,117,114,\r
-101,51,68,80,114,111,106,0,1,0,0,18,115,97,109,112,108,101,114,0,0,1,0,0,12,99,111,111,114,100,0,0,\r
-1,0,0,9,98,105,97,115,0,0,0,1,8,58,116,101,120,116,117,114,101,51,68,0,18,115,97,109,112,108,101,\r
-114,0,0,58,118,101,99,51,0,18,99,111,111,114,100,0,59,115,0,18,99,111,111,114,100,0,59,113,0,49,0,\r
-18,99,111,111,114,100,0,59,116,0,18,99,111,111,114,100,0,59,113,0,49,0,18,99,111,111,114,100,0,59,\r
-112,0,18,99,111,111,114,100,0,59,113,0,49,0,0,0,18,98,105,97,115,0,0,0,0,0,1,0,12,0,116,101,120,\r
-116,117,114,101,67,117,98,101,0,1,0,0,19,115,97,109,112,108,101,114,0,0,1,0,0,11,99,111,111,114,\r
-100,0,0,1,0,0,9,98,105,97,115,0,0,0,1,8,58,118,101,99,52,0,17,48,0,48,0,0,0,0,0,0,1,0,12,0,115,104,\r
-97,100,111,119,49,68,0,1,0,0,20,115,97,109,112,108,101,114,0,0,1,0,0,11,99,111,111,114,100,0,0,1,0,\r
-0,9,98,105,97,115,0,0,0,1,8,58,118,101,99,52,0,17,48,0,48,0,0,0,0,0,0,1,0,12,0,115,104,97,100,111,\r
-119,50,68,0,1,0,0,21,115,97,109,112,108,101,114,0,0,1,0,0,11,99,111,111,114,100,0,0,1,0,0,9,98,105,\r
-97,115,0,0,0,1,8,58,118,101,99,52,0,17,48,0,48,0,0,0,0,0,0,1,0,12,0,115,104,97,100,111,119,49,68,\r
-80,114,111,106,0,1,0,0,20,115,97,109,112,108,101,114,0,0,1,0,0,12,99,111,111,114,100,0,0,1,0,0,9,\r
-98,105,97,115,0,0,0,1,8,58,115,104,97,100,111,119,49,68,0,18,115,97,109,112,108,101,114,0,0,58,118,\r
-101,99,51,0,18,99,111,111,114,100,0,59,115,0,18,99,111,111,114,100,0,59,113,0,49,0,17,48,0,48,0,0,\r
-0,18,99,111,111,114,100,0,59,112,0,18,99,111,111,114,100,0,59,113,0,49,0,0,0,18,98,105,97,115,0,0,\r
-0,0,0,1,0,12,0,115,104,97,100,111,119,50,68,80,114,111,106,0,1,0,0,21,115,97,109,112,108,101,114,0,\r
-0,1,0,0,12,99,111,111,114,100,0,0,1,0,0,9,98,105,97,115,0,0,0,1,8,58,115,104,97,100,111,119,50,68,\r
-0,18,115,97,109,112,108,101,114,0,0,58,118,101,99,51,0,18,99,111,111,114,100,0,59,115,0,18,99,111,\r
-111,114,100,0,59,113,0,49,0,18,99,111,111,114,100,0,59,116,0,18,99,111,111,114,100,0,59,113,0,49,0,\r
-18,99,111,111,114,100,0,59,112,0,18,99,111,111,114,100,0,59,113,0,49,0,0,0,18,98,105,97,115,0,0,0,\r
-0,0,1,0,9,0,100,70,100,120,0,1,0,0,9,112,0,0,0,1,8,17,48,0,48,0,0,0,0,1,0,10,0,100,70,100,120,0,1,\r
-0,0,10,112,0,0,0,1,8,58,118,101,99,50,0,17,48,0,48,0,0,0,0,0,0,1,0,11,0,100,70,100,120,0,1,0,0,11,\r
-112,0,0,0,1,8,58,118,101,99,51,0,17,48,0,48,0,0,0,0,0,0,1,0,12,0,100,70,100,120,0,1,0,0,12,112,0,0,\r
-0,1,8,58,118,101,99,52,0,17,48,0,48,0,0,0,0,0,0,1,0,9,0,100,70,100,121,0,1,0,0,9,112,0,0,0,1,8,17,\r
-48,0,48,0,0,0,0,1,0,10,0,100,70,100,121,0,1,0,0,10,112,0,0,0,1,8,58,118,101,99,50,0,17,48,0,48,0,0,\r
-0,0,0,0,1,0,11,0,100,70,100,121,0,1,0,0,11,112,0,0,0,1,8,58,118,101,99,51,0,17,48,0,48,0,0,0,0,0,0,\r
-1,0,12,0,100,70,100,121,0,1,0,0,12,112,0,0,0,1,8,58,118,101,99,52,0,17,48,0,48,0,0,0,0,0,0,1,0,9,0,\r
-102,119,105,100,116,104,0,1,0,0,9,112,0,0,0,1,8,58,97,98,115,0,58,100,70,100,120,0,18,112,0,0,0,0,\r
-0,58,97,98,115,0,58,100,70,100,121,0,18,112,0,0,0,0,0,46,0,0,1,0,10,0,102,119,105,100,116,104,0,1,\r
-0,0,10,112,0,0,0,1,8,58,97,98,115,0,58,100,70,100,120,0,18,112,0,0,0,0,0,58,97,98,115,0,58,100,70,\r
-100,121,0,18,112,0,0,0,0,0,46,0,0,1,0,11,0,102,119,105,100,116,104,0,1,0,0,11,112,0,0,0,1,8,58,97,\r
-98,115,0,58,100,70,100,120,0,18,112,0,0,0,0,0,58,97,98,115,0,58,100,70,100,121,0,18,112,0,0,0,0,0,\r
-46,0,0,1,0,12,0,102,119,105,100,116,104,0,1,0,0,12,112,0,0,0,1,8,58,97,98,115,0,58,100,70,100,120,\r
-0,18,112,0,0,0,0,0,58,97,98,115,0,58,100,70,100,121,0,18,112,0,0,0,0,0,46,0,0,0\r
+101,114,0,0,1,0,0,9,99,111,111,114,100,0,0,1,0,0,9,98,105,97,115,0,0,0,1,3,2,0,12,1,116,101,120,\r
+101,108,0,0,0,4,118,101,99,52,95,116,101,120,49,100,0,18,116,101,120,101,108,0,0,18,115,97,109,112,\r
+108,101,114,0,0,18,99,111,111,114,100,0,0,18,98,105,97,115,0,0,0,8,18,116,101,120,101,108,0,0,0,1,\r
+0,12,0,116,101,120,116,117,114,101,49,68,80,114,111,106,0,1,0,0,16,115,97,109,112,108,101,114,0,0,\r
+1,0,0,10,99,111,111,114,100,0,0,1,0,0,9,98,105,97,115,0,0,0,1,8,58,116,101,120,116,117,114,101,49,\r
+68,0,18,115,97,109,112,108,101,114,0,0,18,99,111,111,114,100,0,59,115,0,18,99,111,111,114,100,0,59,\r
+116,0,49,0,18,98,105,97,115,0,0,0,0,0,1,0,12,0,116,101,120,116,117,114,101,49,68,80,114,111,106,0,\r
+1,0,0,16,115,97,109,112,108,101,114,0,0,1,0,0,12,99,111,111,114,100,0,0,1,0,0,9,98,105,97,115,0,0,\r
+0,1,8,58,116,101,120,116,117,114,101,49,68,0,18,115,97,109,112,108,101,114,0,0,18,99,111,111,114,\r
+100,0,59,115,0,18,99,111,111,114,100,0,59,113,0,49,0,18,98,105,97,115,0,0,0,0,0,1,0,12,0,116,101,\r
+120,116,117,114,101,50,68,0,1,0,0,17,115,97,109,112,108,101,114,0,0,1,0,0,10,99,111,111,114,100,0,\r
+0,1,0,0,9,98,105,97,115,0,0,0,1,3,2,0,12,1,116,101,120,101,108,0,0,0,4,118,101,99,52,95,116,101,\r
+120,50,100,0,18,116,101,120,101,108,0,0,18,115,97,109,112,108,101,114,0,0,18,99,111,111,114,100,0,\r
+0,18,98,105,97,115,0,0,0,8,18,116,101,120,101,108,0,0,0,1,0,12,0,116,101,120,116,117,114,101,50,68,\r
+80,114,111,106,0,1,0,0,17,115,97,109,112,108,101,114,0,0,1,0,0,11,99,111,111,114,100,0,0,1,0,0,9,\r
+98,105,97,115,0,0,0,1,8,58,116,101,120,116,117,114,101,50,68,0,18,115,97,109,112,108,101,114,0,0,\r
+58,118,101,99,50,0,18,99,111,111,114,100,0,59,115,0,18,99,111,111,114,100,0,59,112,0,49,0,18,99,\r
+111,111,114,100,0,59,116,0,18,99,111,111,114,100,0,59,112,0,49,0,0,0,18,98,105,97,115,0,0,0,0,0,1,\r
+0,12,0,116,101,120,116,117,114,101,50,68,80,114,111,106,0,1,0,0,17,115,97,109,112,108,101,114,0,0,\r
+1,0,0,12,99,111,111,114,100,0,0,1,0,0,9,98,105,97,115,0,0,0,1,8,58,116,101,120,116,117,114,101,50,\r
+68,0,18,115,97,109,112,108,101,114,0,0,58,118,101,99,50,0,18,99,111,111,114,100,0,59,115,0,18,99,\r
+111,111,114,100,0,59,113,0,49,0,18,99,111,111,114,100,0,59,116,0,18,99,111,111,114,100,0,59,113,0,\r
+49,0,0,0,18,98,105,97,115,0,0,0,0,0,1,0,12,0,116,101,120,116,117,114,101,51,68,0,1,0,0,18,115,97,\r
+109,112,108,101,114,0,0,1,0,0,11,99,111,111,114,100,0,0,1,0,0,9,98,105,97,115,0,0,0,1,3,2,0,12,1,\r
+116,101,120,101,108,0,0,0,4,118,101,99,52,95,116,101,120,51,100,0,18,116,101,120,101,108,0,0,18,\r
+115,97,109,112,108,101,114,0,0,18,99,111,111,114,100,0,0,18,98,105,97,115,0,0,0,8,18,116,101,120,\r
+101,108,0,0,0,1,0,12,0,116,101,120,116,117,114,101,51,68,80,114,111,106,0,1,0,0,18,115,97,109,112,\r
+108,101,114,0,0,1,0,0,12,99,111,111,114,100,0,0,1,0,0,9,98,105,97,115,0,0,0,1,8,58,116,101,120,116,\r
+117,114,101,51,68,0,18,115,97,109,112,108,101,114,0,0,58,118,101,99,51,0,18,99,111,111,114,100,0,\r
+59,115,0,18,99,111,111,114,100,0,59,113,0,49,0,18,99,111,111,114,100,0,59,116,0,18,99,111,111,114,\r
+100,0,59,113,0,49,0,18,99,111,111,114,100,0,59,112,0,18,99,111,111,114,100,0,59,113,0,49,0,0,0,18,\r
+98,105,97,115,0,0,0,0,0,1,0,12,0,116,101,120,116,117,114,101,67,117,98,101,0,1,0,0,19,115,97,109,\r
+112,108,101,114,0,0,1,0,0,11,99,111,111,114,100,0,0,1,0,0,9,98,105,97,115,0,0,0,1,3,2,0,12,1,116,\r
+101,120,101,108,0,0,0,4,118,101,99,52,95,116,101,120,99,117,98,101,0,18,116,101,120,101,108,0,0,18,\r
+115,97,109,112,108,101,114,0,0,18,99,111,111,114,100,0,0,18,98,105,97,115,0,0,0,8,18,116,101,120,\r
+101,108,0,0,0,1,0,12,0,115,104,97,100,111,119,49,68,0,1,0,0,20,115,97,109,112,108,101,114,0,0,1,0,\r
+0,11,99,111,111,114,100,0,0,1,0,0,9,98,105,97,115,0,0,0,1,3,2,0,12,1,116,101,120,101,108,0,0,0,4,\r
+118,101,99,52,95,115,104,97,100,49,100,0,18,116,101,120,101,108,0,0,18,115,97,109,112,108,101,114,\r
+0,0,18,99,111,111,114,100,0,0,18,98,105,97,115,0,0,0,8,18,116,101,120,101,108,0,0,0,1,0,12,0,115,\r
+104,97,100,111,119,49,68,80,114,111,106,0,1,0,0,20,115,97,109,112,108,101,114,0,0,1,0,0,12,99,111,\r
+111,114,100,0,0,1,0,0,9,98,105,97,115,0,0,0,1,8,58,115,104,97,100,111,119,49,68,0,18,115,97,109,\r
+112,108,101,114,0,0,58,118,101,99,51,0,18,99,111,111,114,100,0,59,115,0,18,99,111,111,114,100,0,59,\r
+113,0,49,0,17,48,0,48,0,0,0,18,99,111,111,114,100,0,59,112,0,18,99,111,111,114,100,0,59,113,0,49,0,\r
+0,0,18,98,105,97,115,0,0,0,0,0,1,0,12,0,115,104,97,100,111,119,50,68,0,1,0,0,21,115,97,109,112,108,\r
+101,114,0,0,1,0,0,11,99,111,111,114,100,0,0,1,0,0,9,98,105,97,115,0,0,0,1,3,2,0,12,1,116,101,120,\r
+101,108,0,0,0,4,118,101,99,52,95,115,104,97,100,50,100,0,18,116,101,120,101,108,0,0,18,115,97,109,\r
+112,108,101,114,0,0,18,99,111,111,114,100,0,0,18,98,105,97,115,0,0,0,8,18,116,101,120,101,108,0,0,\r
+0,1,0,12,0,115,104,97,100,111,119,50,68,80,114,111,106,0,1,0,0,21,115,97,109,112,108,101,114,0,0,1,\r
+0,0,12,99,111,111,114,100,0,0,1,0,0,9,98,105,97,115,0,0,0,1,8,58,115,104,97,100,111,119,50,68,0,18,\r
+115,97,109,112,108,101,114,0,0,58,118,101,99,51,0,18,99,111,111,114,100,0,59,115,0,18,99,111,111,\r
+114,100,0,59,113,0,49,0,18,99,111,111,114,100,0,59,116,0,18,99,111,111,114,100,0,59,113,0,49,0,18,\r
+99,111,111,114,100,0,59,112,0,18,99,111,111,114,100,0,59,113,0,49,0,0,0,18,98,105,97,115,0,0,0,0,0,\r
+1,0,9,0,100,70,100,120,0,1,0,0,9,112,0,0,0,1,8,17,48,0,48,0,0,0,0,1,0,10,0,100,70,100,120,0,1,0,0,\r
+10,112,0,0,0,1,8,58,118,101,99,50,0,17,48,0,48,0,0,0,0,0,0,1,0,11,0,100,70,100,120,0,1,0,0,11,112,\r
+0,0,0,1,8,58,118,101,99,51,0,17,48,0,48,0,0,0,0,0,0,1,0,12,0,100,70,100,120,0,1,0,0,12,112,0,0,0,1,\r
+8,58,118,101,99,52,0,17,48,0,48,0,0,0,0,0,0,1,0,9,0,100,70,100,121,0,1,0,0,9,112,0,0,0,1,8,17,48,0,\r
+48,0,0,0,0,1,0,10,0,100,70,100,121,0,1,0,0,10,112,0,0,0,1,8,58,118,101,99,50,0,17,48,0,48,0,0,0,0,\r
+0,0,1,0,11,0,100,70,100,121,0,1,0,0,11,112,0,0,0,1,8,58,118,101,99,51,0,17,48,0,48,0,0,0,0,0,0,1,0,\r
+12,0,100,70,100,121,0,1,0,0,12,112,0,0,0,1,8,58,118,101,99,52,0,17,48,0,48,0,0,0,0,0,0,1,0,9,0,102,\r
+119,105,100,116,104,0,1,0,0,9,112,0,0,0,1,8,58,97,98,115,0,58,100,70,100,120,0,18,112,0,0,0,0,0,58,\r
+97,98,115,0,58,100,70,100,121,0,18,112,0,0,0,0,0,46,0,0,1,0,10,0,102,119,105,100,116,104,0,1,0,0,\r
+10,112,0,0,0,1,8,58,97,98,115,0,58,100,70,100,120,0,18,112,0,0,0,0,0,58,97,98,115,0,58,100,70,100,\r
+121,0,18,112,0,0,0,0,0,46,0,0,1,0,11,0,102,119,105,100,116,104,0,1,0,0,11,112,0,0,0,1,8,58,97,98,\r
+115,0,58,100,70,100,120,0,18,112,0,0,0,0,0,58,97,98,115,0,58,100,70,100,121,0,18,112,0,0,0,0,0,46,\r
+0,0,1,0,12,0,102,119,105,100,116,104,0,1,0,0,12,112,0,0,0,1,8,58,97,98,115,0,58,100,70,100,120,0,\r
+18,112,0,0,0,0,0,58,97,98,115,0,58,100,70,100,121,0,18,112,0,0,0,0,0,46,0,0,0\r
"__asm" .and space .and identifier .and space .and asm_arguments .and semicolon .emit OP_END;\r
\r
/*\r
- <asm_arguments> ::= <identifier>\r
- | <asm_arguments> "," <identifier>\r
+ <asm_arguments> ::= <asm_argument>\r
+ | <asm_arguments> "," <asm_argument>\r
\r
note: this is an extension to the standard language specification - normally slang disallows\r
__asm statements\r
*/\r
asm_arguments\r
- variable_identifier .and .true .emit OP_END .and .loop asm_arguments_1;\r
+ asm_argument .and .true .emit OP_END .and .loop asm_arguments_1;\r
asm_arguments_1\r
- comma .and variable_identifier .and .true .emit OP_END;\r
+ comma .and asm_argument .and .true .emit OP_END;\r
+\r
+/*\r
+ <asm_argument> ::= <variable_identifier>\r
+ | <floatconstant>\r
+\r
+note: this is an extension to the standard language specification - normally slang disallows\r
+ __asm statements\r
+*/\r
+asm_argument\r
+ variable_identifier .or floatconstant;\r
\r
/*\r
<translation_unit> ::= <external_declaration>\r
"__asm_statement\n"\r
" \"__asm\" .and space .and identifier .and space .and asm_arguments .and semicolon .emit OP_END;\n"\r
"asm_arguments\n"\r
-" variable_identifier .and .true .emit OP_END .and .loop asm_arguments_1;\n"\r
+" asm_argument .and .true .emit OP_END .and .loop asm_arguments_1;\n"\r
"asm_arguments_1\n"\r
-" comma .and variable_identifier .and .true .emit OP_END;\n"\r
+" comma .and asm_argument .and .true .emit OP_END;\n"\r
+"asm_argument\n"\r
+" variable_identifier .or floatconstant;\n"\r
"translation_unit\n"\r
" optional_space .emit REVISION .and external_declaration .error INVALID_EXTERNAL_DECLARATION .and\n"\r
" .loop external_declaration .and optional_space .and\n"\r
" '\\'' .or '<' .or ',' .or '>' .or '.' .or '/' .or '?' .or err_identifier;\n"\r
"err_identifier\n"\r
" id_character_first .and .loop id_character_next;\n"\r
-""\r
+""
\ No newline at end of file
--- /dev/null
+/*\r
+ * Mesa 3-D graphics library\r
+ * Version: 6.5\r
+ *\r
+ * Copyright (C) 2006 Brian Paul All Rights Reserved.\r
+ *\r
+ * Permission is hereby granted, free of charge, to any person obtaining a\r
+ * copy of this software and associated documentation files (the "Software"),\r
+ * to deal in the Software without restriction, including without limitation\r
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,\r
+ * and/or sell copies of the Software, and to permit persons to whom the\r
+ * Software is furnished to do so, subject to the following conditions:\r
+ *\r
+ * The above copyright notice and this permission notice shall be included\r
+ * in all copies or substantial portions of the Software.\r
+ *\r
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS\r
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\r
+ * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN\r
+ * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\r
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r
+ */\r
+\r
+/**\r
+ * \file slang_analyse.c\r
+ * slang assembly code analysis\r
+ * \author Michal Krol\r
+ */\r
+\r
+#include "imports.h"\r
+#include "slang_analyse.h"\r
+#include "slang_utility.h"\r
+\r
+GLboolean _slang_analyse_texture_usage (slang_program *prog)\r
+{\r
+ GLuint i, count = 0;\r
+\r
+ slang_texture_usages_dtr (&prog->texture_usage);\r
+ slang_texture_usages_ctr (&prog->texture_usage);\r
+\r
+ /*\r
+ * We could do a full code analysis to find out which uniforms are actually used.\r
+ * For now, we are very conservative and extract them from uniform binding table, which\r
+ * in turn also do not come from code analysis.\r
+ */\r
+\r
+ for (i = 0; i < prog->uniforms.count; i++)\r
+ {\r
+ slang_uniform_binding *b = &prog->uniforms.table[i];\r
+\r
+ if (b->address[SLANG_SHADER_FRAGMENT] != ~0 && b->quant->structure == NULL)\r
+ {\r
+ switch (b->quant->u.basic_type)\r
+ {\r
+ case GL_SAMPLER_1D_ARB:\r
+ case GL_SAMPLER_2D_ARB:\r
+ case GL_SAMPLER_3D_ARB:\r
+ case GL_SAMPLER_CUBE_ARB:\r
+ case GL_SAMPLER_1D_SHADOW_ARB:\r
+ case GL_SAMPLER_2D_SHADOW_ARB:\r
+ count++;\r
+ break;\r
+ }\r
+ }\r
+ }\r
+\r
+ if (count == 0)\r
+ return GL_TRUE;\r
+ prog->texture_usage.table = (slang_texture_usage *) slang_alloc_malloc (\r
+ count * sizeof (slang_texture_usage));\r
+ if (prog->texture_usage.table == NULL)\r
+ return GL_FALSE;\r
+ prog->texture_usage.count = count;\r
+\r
+ for (count = i = 0; i < prog->uniforms.count; i++)\r
+ {\r
+ slang_uniform_binding *b = &prog->uniforms.table[i];\r
+\r
+ if (b->address[SLANG_SHADER_FRAGMENT] != ~0 && b->quant->structure == NULL)\r
+ {\r
+ switch (b->quant->u.basic_type)\r
+ {\r
+ case GL_SAMPLER_1D_ARB:\r
+ case GL_SAMPLER_2D_ARB:\r
+ case GL_SAMPLER_3D_ARB:\r
+ case GL_SAMPLER_CUBE_ARB:\r
+ case GL_SAMPLER_1D_SHADOW_ARB:\r
+ case GL_SAMPLER_2D_SHADOW_ARB:\r
+ prog->texture_usage.table[count].quant = b->quant;\r
+ prog->texture_usage.table[count].frag_address = b->address[SLANG_SHADER_FRAGMENT];\r
+ count++;\r
+ break;\r
+ }\r
+ }\r
+ }\r
+\r
+ return GL_TRUE;\r
+}\r
+\r
--- /dev/null
+/*\r
+ * Mesa 3-D graphics library\r
+ * Version: 6.5\r
+ *\r
+ * Copyright (C) 2006 Brian Paul All Rights Reserved.\r
+ *\r
+ * Permission is hereby granted, free of charge, to any person obtaining a\r
+ * copy of this software and associated documentation files (the "Software"),\r
+ * to deal in the Software without restriction, including without limitation\r
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,\r
+ * and/or sell copies of the Software, and to permit persons to whom the\r
+ * Software is furnished to do so, subject to the following conditions:\r
+ *\r
+ * The above copyright notice and this permission notice shall be included\r
+ * in all copies or substantial portions of the Software.\r
+ *\r
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS\r
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\r
+ * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN\r
+ * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\r
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r
+ */\r
+\r
+#if !defined SLANG_ANALYSE_H\r
+#define SLANG_ANALYSE_H\r
+\r
+#include "slang_link.h"\r
+\r
+#if defined __cplusplus\r
+extern "C" {\r
+#endif\r
+\r
+/*\r
+ * Texture usage analysis is a bit more difficult than for fragment programs. While fragment\r
+ * programs statically link to texture targets and texture units, shaders statically link\r
+ * only to texture targets. The texture unit linkage is determined just before the execution\r
+ * of a given primitive by reading active uniform samplers.\r
+ *\r
+ * This procedure retrieves a list of uniforms that reach texture sample instructions.\r
+ */\r
+\r
+GLboolean _slang_analyse_texture_usage (slang_program *);\r
+\r
+#ifdef __cplusplus\r
+}\r
+#endif\r
+\r
+#endif\r
+\r
{ "float_noise3", slang_asm_float_noise3, slang_asm_float_copy },\r
{ "float_noise4", slang_asm_float_noise4, slang_asm_float_copy },\r
{ "int_to_float", slang_asm_int_to_float, slang_asm_float_copy },\r
+ { "vec4_tex1d", slang_asm_vec4_tex1d, slang_asm_none },\r
{ "vec4_tex2d", slang_asm_vec4_tex2d, slang_asm_none },\r
+ { "vec4_tex3d", slang_asm_vec4_tex3d, slang_asm_none },\r
+ { "vec4_texcube", slang_asm_vec4_texcube, slang_asm_none },\r
+ { "vec4_shad1d", slang_asm_vec4_shad1d, slang_asm_none },\r
+ { "vec4_shad2d", slang_asm_vec4_shad2d, slang_asm_none },\r
/* mesa-specific extensions */\r
{ "float_print", slang_asm_float_deref, slang_asm_float_print },\r
{ "int_print", slang_asm_int_deref, slang_asm_int_print },\r
else\r
{\r
GLuint i, struct_size = 0, field_offset = 0, field_size = 0;\r
+ GLboolean relocate, shrink;\r
\r
+ /* calculate struct size, field offset and field size */\r
for (i = 0; i < tib->spec._struct->fields->num_variables; i++)\r
{\r
slang_variable *field;\r
field_offset += size;\r
}\r
\r
- if (!PLAB (A->file, slang_asm_addr_push, field_offset))\r
- return GL_FALSE;\r
+ /*\r
+ * OPTIMIZATION: If selecting the last field, no relocation is needed.\r
+ */\r
+ relocate = field_offset != struct_size - field_size;\r
\r
- if (ref == slang_ref_force)\r
+ /*\r
+ * OPTIMIZATION: If field and struct sizes are equal, no partial free is needed.\r
+ */\r
+ shrink = field_size != struct_size;\r
+\r
+ if (relocate)\r
{\r
- if (!PUSH (A->file, slang_asm_addr_add))\r
+ if (!PLAB (A->file, slang_asm_addr_push, field_offset))\r
return GL_FALSE;\r
}\r
+\r
+ if (ref == slang_ref_force)\r
+ {\r
+ if (relocate)\r
+ {\r
+ if (!PUSH (A->file, slang_asm_addr_add))\r
+ return GL_FALSE;\r
+ }\r
+ }\r
else\r
{\r
- GLuint i;\r
+ GLuint free_b = 0;\r
\r
- /* move the selected element to the beginning of the master expression */\r
- for (i = 0; i < field_size; i += 4)\r
- if (!PLAB2 (A->file, slang_asm_float_move, struct_size - field_size + i + 4, i + 4))\r
- return GL_FALSE;\r
- if (!PLAB (A->file, slang_asm_local_free, 4))\r
- return GL_FALSE;\r
+ if (relocate)\r
+ {\r
+ GLuint i;\r
\r
- /* free the rest of the master expression */\r
- if (!PLAB (A->file, slang_asm_local_free, struct_size - field_size))\r
- return GL_FALSE;\r
+ /* move the selected element to the beginning of the master expression */\r
+ for (i = 0; i < field_size; i += 4)\r
+ if (!PLAB2 (A->file, slang_asm_float_move, struct_size - field_size + i + 4, i + 4))\r
+ return GL_FALSE;\r
+ free_b += 4;\r
+ }\r
+\r
+ if (shrink)\r
+ {\r
+ /* free the rest of the master expression */\r
+ free_b += struct_size - field_size;\r
+ }\r
+\r
+ if (free_b)\r
+ {\r
+ if (!PLAB (A->file, slang_asm_local_free, free_b))\r
+ return GL_FALSE;\r
+ }\r
}\r
}\r
\r
case slang_oper_addassign:\r
if (!_slang_assemble_assign (A, op, "+=", ref))\r
return GL_FALSE;\r
+ A->ref = ref;\r
break;\r
case slang_oper_subassign:\r
if (!_slang_assemble_assign (A, op, "-=", ref))\r
return GL_FALSE;\r
+ A->ref = ref;\r
break;\r
case slang_oper_mulassign:\r
if (!_slang_assemble_assign (A, op, "*=", ref))\r
return GL_FALSE;\r
+ A->ref = ref;\r
break;\r
/*case slang_oper_modassign:*/\r
/*case slang_oper_lshassign:*/\r
case slang_oper_divassign:\r
if (!_slang_assemble_assign (A, op, "/=", ref))\r
return GL_FALSE;\r
+ A->ref = ref;\r
break;\r
case slang_oper_select:\r
if (!_slang_assemble_select (A, op))\r
case slang_oper_preincrement:\r
if (!_slang_assemble_assign (A, op, "++", ref))\r
return GL_FALSE;\r
+ A->ref = ref;\r
break;\r
case slang_oper_predecrement:\r
if (!_slang_assemble_assign (A, op, "--", ref))\r
return GL_FALSE;\r
+ A->ref = ref;\r
break;\r
case slang_oper_plus:\r
if (!_slang_dereference (A, op))\r
slang_asm_addr_deref,\r
slang_asm_addr_add,\r
slang_asm_addr_multiply,\r
+ slang_asm_vec4_tex1d,\r
slang_asm_vec4_tex2d,\r
+ slang_asm_vec4_tex3d,\r
+ slang_asm_vec4_texcube,\r
+ slang_asm_vec4_shad1d,\r
+ slang_asm_vec4_shad2d,\r
slang_asm_jump,\r
slang_asm_jump_if_zero,\r
slang_asm_enter,\r
*/\r
\r
#include "imports.h"\r
-#include "context.h"\r
-#include "swrast/s_context.h"\r
-#include "colormac.h"\r
#include "slang_execute.h"\r
#include "slang_library_noise.h"\r
+#include "slang_library_texsample.h"\r
\r
#define DEBUG_SLANG 0\r
\r
GLvoid slang_machine_dtr (slang_machine *self)\r
{\r
#if defined(USE_X86_ASM) || defined(SLANG_X86)\r
- /* TODO: free self->x86.compiled_func */\r
+ if (self->x86.compiled_func != NULL)\r
+ _mesa_exec_free (self->x86.compiled_func);\r
#endif\r
}\r
\r
case slang_asm_addr_multiply:\r
fprintf (f, "addr_multiply");\r
break;\r
- case slang_vec4_tex2d:\r
+ case slang_asm_vec4_tex1d:\r
+ fprintf (f, "vec4_tex1d");\r
+ break;\r
+ case slang_asm_vec4_tex2d:\r
fprintf (f, "vec4_tex2d");\r
break;\r
+ case slang_asm_vec4_tex3d:\r
+ fprintf (f, "vec4_tex3d");\r
+ break;\r
+ case slang_asm_vec4_texcube:\r
+ fprintf (f, "vec4_texcube");\r
+ break;\r
+ case slang_asm_vec4_shad1d:\r
+ fprintf (f, "vec4_shad1d");\r
+ break;\r
+ case slang_asm_vec4_shad2d:\r
+ fprintf (f, "vec4_shad2d");\r
+ break;\r
case slang_asm_jump:\r
fprintf (f, "jump\t%u", a->param[0]);\r
break;\r
\r
#endif\r
\r
-static void fetch_texel (GLuint sampler, const GLfloat texcoord[4], GLfloat lambda, GLfloat color[4])\r
-{\r
- GET_CURRENT_CONTEXT(ctx);\r
- SWcontext *swrast = SWRAST_CONTEXT(ctx);\r
- GLchan rgba[4];\r
-\r
- /* XXX: the function pointer is NULL! */\r
- swrast->TextureSample[sampler] (ctx, ctx->Texture.Unit[sampler]._Current, 1,\r
- (const GLfloat (*)[4]) texcoord, &lambda, &rgba);\r
- color[0] = CHAN_TO_FLOAT(rgba[0]);\r
- color[1] = CHAN_TO_FLOAT(rgba[1]);\r
- color[2] = CHAN_TO_FLOAT(rgba[2]);\r
- color[3] = CHAN_TO_FLOAT(rgba[3]);\r
-}\r
-\r
int _slang_execute2 (const slang_assembly_file *file, slang_machine *mach)\r
{\r
slang_machine_slot *stack;\r
stack[mach->sp + 1]._addr *= stack[mach->sp]._addr;\r
mach->sp++;\r
break;\r
- case slang_asm_vec4_tex2d:\r
- {\r
- GLfloat st[4] = { stack[mach->sp]._float, stack[mach->sp + 1]._float, 0.0f, 1.0f };\r
- GLuint sampler = (GLuint) stack[mach->sp + 2]._float;\r
- GLfloat *rgba = &mach->mem[stack[mach->sp + 3]._addr / 4]._float;\r
-\r
- fetch_texel (sampler, st, 0.0f, rgba);\r
- }\r
+ case slang_asm_vec4_tex1d:\r
+ _slang_library_tex1d (stack[mach->sp]._float, stack[mach->sp + 1]._float,\r
+ stack[mach->sp + 2]._float, &mach->mem[stack[mach->sp + 3]._addr / 4]._float);\r
mach->sp += 3;\r
break;\r
+ case slang_asm_vec4_tex2d:\r
+ _slang_library_tex2d (stack[mach->sp]._float, stack[mach->sp + 1]._float,\r
+ stack[mach->sp + 2]._float, stack[mach->sp + 3]._float,\r
+ &mach->mem[stack[mach->sp + 4]._addr / 4]._float);\r
+ mach->sp += 4;\r
+ break;\r
+ case slang_asm_vec4_tex3d:\r
+ _slang_library_tex3d (stack[mach->sp]._float, stack[mach->sp + 1]._float,\r
+ stack[mach->sp + 2]._float, stack[mach->sp + 3]._float, stack[mach->sp + 4]._float,\r
+ &mach->mem[stack[mach->sp + 5]._addr / 4]._float);\r
+ mach->sp += 5;\r
+ break;\r
+ case slang_asm_vec4_texcube:\r
+ _slang_library_texcube (stack[mach->sp]._float, stack[mach->sp + 1]._float,\r
+ stack[mach->sp + 2]._float, stack[mach->sp + 3]._float, stack[mach->sp + 4]._float,\r
+ &mach->mem[stack[mach->sp + 5]._addr / 4]._float);\r
+ mach->sp += 5;\r
+ break;\r
+ case slang_asm_vec4_shad1d:\r
+ _slang_library_shad1d (stack[mach->sp]._float, stack[mach->sp + 1]._float,\r
+ stack[mach->sp + 2]._float, stack[mach->sp + 3]._float, stack[mach->sp + 4]._float,\r
+ &mach->mem[stack[mach->sp + 5]._addr / 4]._float);\r
+ mach->sp += 5;\r
+ break;\r
+ case slang_asm_vec4_shad2d:\r
+ _slang_library_shad2d (stack[mach->sp]._float, stack[mach->sp + 1]._float,\r
+ stack[mach->sp + 2]._float, stack[mach->sp + 3]._float, stack[mach->sp + 4]._float,\r
+ &mach->mem[stack[mach->sp + 5]._addr / 4]._float);\r
+ mach->sp += 5;\r
+ break;\r
case slang_asm_jump:\r
mach->ip = a->param[0];\r
break;\r
* Mesa 3-D graphics library\r
* Version: 6.5\r
*\r
- * Copyright (C) 2005-2006 Brian Paul All Rights Reserved.\r
+ * Copyright (C) 2006 Brian Paul All Rights Reserved.\r
*\r
* Permission is hereby granted, free of charge, to any person obtaining a\r
* copy of this software and associated documentation files (the "Software"),\r
*/\r
\r
#include "imports.h"\r
-#include "context.h"\r
-#include "colormac.h"\r
-#include "swrast/s_context.h"\r
#include "slang_execute.h"\r
#include "slang_library_noise.h"\r
+#include "slang_library_texsample.h"\r
\r
#if defined(USE_X86_ASM) || defined(SLANG_X86)\r
\r
return CEILF (x);\r
}\r
\r
-static void fetch_texel (GLuint sampler, const GLfloat texcoord[4], GLfloat lambda, GLfloat color[4])\r
-{\r
- GET_CURRENT_CONTEXT(ctx);\r
- SWcontext *swrast = SWRAST_CONTEXT(ctx);\r
- GLchan rgba[4];\r
-\r
- /* XXX: the function pointer is NULL! */\r
- swrast->TextureSample[sampler] (ctx, ctx->Texture.Unit[sampler]._Current, 1,\r
- (const GLfloat (*)[4]) texcoord, &lambda, &rgba);\r
- color[0] = CHAN_TO_FLOAT(rgba[0]);\r
- color[1] = CHAN_TO_FLOAT(rgba[1]);\r
- color[2] = CHAN_TO_FLOAT(rgba[2]);\r
- color[3] = CHAN_TO_FLOAT(rgba[3]);\r
-}\r
-\r
-static GLvoid do_vec4_tex2d (GLfloat s, GLfloat t, GLuint sampler, GLfloat *rgba)\r
-{\r
- GLfloat st[4] = { s, t, 0.0f, 1.0f };\r
-\r
- fetch_texel (sampler, st, 0.0f, rgba);\r
-}\r
-\r
static GLvoid do_print_float (GLfloat x)\r
{\r
_mesa_printf ("slang print: %f\n", x);\r
x86_mul (&G->f, G->r_ecx);\r
x86_mov (&G->f, x86_deref (G->r_esp), G->r_eax);\r
break;\r
+ case slang_asm_vec4_tex1d:\r
+ x86_call (&G->f, (GLubyte *) _slang_library_tex1d);\r
+ x86_lea (&G->f, G->r_esp, x86_make_disp (G->r_esp, 12));\r
+ break;\r
case slang_asm_vec4_tex2d:\r
- x86_call (&G->f, (GLubyte *) do_vec4_tex2d);\r
- x86_lea (&G->f, G->r_ebp, x86_make_disp (G->r_esp, 12));\r
+ x86_call (&G->f, (GLubyte *) _slang_library_tex2d);\r
+ x86_lea (&G->f, G->r_esp, x86_make_disp (G->r_esp, 16));\r
+ break;\r
+ case slang_asm_vec4_tex3d:\r
+ x86_call (&G->f, (GLubyte *) _slang_library_tex3d);\r
+ x86_lea (&G->f, G->r_esp, x86_make_disp (G->r_esp, 20));\r
+ break;\r
+ case slang_asm_vec4_texcube:\r
+ x86_call (&G->f, (GLubyte *) _slang_library_texcube);\r
+ x86_lea (&G->f, G->r_esp, x86_make_disp (G->r_esp, 20));\r
+ break;\r
+ case slang_asm_vec4_shad1d:\r
+ x86_call (&G->f, (GLubyte *) _slang_library_shad1d);\r
+ x86_lea (&G->f, G->r_esp, x86_make_disp (G->r_esp, 20));\r
+ break;\r
+ case slang_asm_vec4_shad2d:\r
+ x86_call (&G->f, (GLubyte *) _slang_library_shad2d);\r
+ x86_lea (&G->f, G->r_esp, x86_make_disp (G->r_esp, 20));\r
break;\r
case slang_asm_jump:\r
add_fixup (G, a->param[0], x86_jmp_forward (&G->f));\r
GLubyte *j_body, *j_exit;\r
GLuint i;\r
\r
- x86_init_func_size (&G.f, 4*1048576);\r
+ /*\r
+ * We need as much as 1M because *all* assembly, including built-in library, is\r
+ * being translated to x86.\r
+ * The built-in library occupies 450K, so we can be safe for now.\r
+ * It is going to change in the future, when we get assembly analysis running.\r
+ */\r
+ x86_init_func_size (&G.f, 1048576);\r
G.r_eax = x86_make_reg (file_REG32, reg_AX);\r
G.r_ecx = x86_make_reg (file_REG32, reg_CX);\r
G.r_edx = x86_make_reg (file_REG32, reg_DX);\r
x86_mov (&G.f, x86_deref (G.r_eax), G.r_ecx);\r
j_body = x86_jmp_forward (&G.f);\r
\r
- /* discard keywords go here */\r
+ /* "discard" instructions jump to this label */\r
G.l_discard = x86_get_label (&G.f);\r
x86_mov_reg_imm (&G.f, G.r_eax, (GLint) &G.mach->kill);\r
x86_mov_reg_imm (&G.f, G.r_ecx, 1);\r
codegen_assem (&G, &file->code[i]);\r
}\r
\r
- /* restore stack and return */\r
+ /*\r
+ * Restore stack and return.\r
+ * This must be handled this way, because "discard" can be invoked from any\r
+ * place in the code.\r
+ */\r
x86_fixup_fwd_jump (&G.f, j_exit);\r
x86_mov_reg_imm (&G.f, G.r_eax, (GLint) &mach->x86.esp_restore);\r
x86_mov (&G.f, G.r_esp, x86_deref (G.r_eax));\r
slang_alloc_free (G.fixups);\r
slang_alloc_free (G.labels);\r
\r
- /* TODO: free previous instance, if not NULL */\r
+ /* install new code */\r
+ if (mach->x86.compiled_func != NULL)\r
+ _mesa_exec_free (mach->x86.compiled_func);\r
mach->x86.compiled_func = (GLvoid (*) (slang_machine *)) x86_get_func (&G.f);\r
\r
return GL_TRUE;\r
--- /dev/null
+/*\r
+ * Mesa 3-D graphics library\r
+ * Version: 6.5\r
+ *\r
+ * Copyright (C) 2006 Brian Paul All Rights Reserved.\r
+ *\r
+ * Permission is hereby granted, free of charge, to any person obtaining a\r
+ * copy of this software and associated documentation files (the "Software"),\r
+ * to deal in the Software without restriction, including without limitation\r
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,\r
+ * and/or sell copies of the Software, and to permit persons to whom the\r
+ * Software is furnished to do so, subject to the following conditions:\r
+ *\r
+ * The above copyright notice and this permission notice shall be included\r
+ * in all copies or substantial portions of the Software.\r
+ *\r
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS\r
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\r
+ * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN\r
+ * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\r
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r
+ */\r
+\r
+/**\r
+ * \file slang_library_texsample.c\r
+ * built-in library functions for texture and shadow sampling\r
+ * \author Michal Krol\r
+ */\r
+\r
+#include "imports.h"\r
+#include "context.h"\r
+#include "colormac.h"\r
+#include "swrast/s_context.h"\r
+#include "slang_library_texsample.h"\r
+\r
+GLvoid _slang_library_tex1d (GLfloat bias, GLfloat s, GLfloat sampler, GLfloat *color)\r
+{\r
+ GET_CURRENT_CONTEXT(ctx);\r
+ SWcontext *swrast = SWRAST_CONTEXT(ctx);\r
+ GLuint unit = (GLuint) sampler;\r
+ GLfloat texcoord[4] = { s, 0.0f, 0.0f, 1.0f };\r
+ GLfloat lambda = bias;\r
+ GLchan rgba[4];\r
+\r
+ swrast->TextureSample[unit] (ctx, ctx->Texture.Unit[unit]._Current, 1,\r
+ (const GLfloat (*)[4]) texcoord, &lambda, &rgba);\r
+ color[0] = CHAN_TO_FLOAT(rgba[0]);\r
+ color[1] = CHAN_TO_FLOAT(rgba[1]);\r
+ color[2] = CHAN_TO_FLOAT(rgba[2]);\r
+ color[3] = CHAN_TO_FLOAT(rgba[3]);\r
+}\r
+\r
+GLvoid _slang_library_tex2d (GLfloat bias, GLfloat s, GLfloat t, GLfloat sampler, GLfloat *color)\r
+{\r
+ GET_CURRENT_CONTEXT(ctx);\r
+ SWcontext *swrast = SWRAST_CONTEXT(ctx);\r
+ GLuint unit = (GLuint) sampler;\r
+ GLfloat texcoord[4] = { s, t, 0.0f, 1.0f };\r
+ GLfloat lambda = bias;\r
+ GLchan rgba[4];\r
+\r
+ swrast->TextureSample[unit] (ctx, ctx->Texture.Unit[unit]._Current, 1,\r
+ (const GLfloat (*)[4]) texcoord, &lambda, &rgba);\r
+ color[0] = CHAN_TO_FLOAT(rgba[0]);\r
+ color[1] = CHAN_TO_FLOAT(rgba[1]);\r
+ color[2] = CHAN_TO_FLOAT(rgba[2]);\r
+ color[3] = CHAN_TO_FLOAT(rgba[3]);\r
+}\r
+\r
+GLvoid _slang_library_tex3d (GLfloat bias, GLfloat s, GLfloat t, GLfloat r, GLfloat sampler,\r
+ GLfloat *color)\r
+{\r
+ GET_CURRENT_CONTEXT(ctx);\r
+ SWcontext *swrast = SWRAST_CONTEXT(ctx);\r
+ GLuint unit = (GLuint) sampler;\r
+ GLfloat texcoord[4] = { s, t, r, 1.0f };\r
+ GLfloat lambda = bias;\r
+ GLchan rgba[4];\r
+\r
+ swrast->TextureSample[unit] (ctx, ctx->Texture.Unit[unit]._Current, 1,\r
+ (const GLfloat (*)[4]) texcoord, &lambda, &rgba);\r
+ color[0] = CHAN_TO_FLOAT(rgba[0]);\r
+ color[1] = CHAN_TO_FLOAT(rgba[1]);\r
+ color[2] = CHAN_TO_FLOAT(rgba[2]);\r
+ color[3] = CHAN_TO_FLOAT(rgba[3]);\r
+}\r
+\r
+GLvoid _slang_library_texcube (GLfloat bias, GLfloat s, GLfloat t, GLfloat r, GLfloat sampler,\r
+ GLfloat *color)\r
+{\r
+ GET_CURRENT_CONTEXT(ctx);\r
+ SWcontext *swrast = SWRAST_CONTEXT(ctx);\r
+ GLuint unit = (GLuint) sampler;\r
+ GLfloat texcoord[4] = { s, t, r, 1.0f };\r
+ GLfloat lambda = bias;\r
+ GLchan rgba[4];\r
+\r
+ swrast->TextureSample[unit] (ctx, ctx->Texture.Unit[unit]._Current, 1,\r
+ (const GLfloat (*)[4]) texcoord, &lambda, &rgba);\r
+ color[0] = CHAN_TO_FLOAT(rgba[0]);\r
+ color[1] = CHAN_TO_FLOAT(rgba[1]);\r
+ color[2] = CHAN_TO_FLOAT(rgba[2]);\r
+ color[3] = CHAN_TO_FLOAT(rgba[3]);\r
+}\r
+\r
+GLvoid _slang_library_shad1d (GLfloat bias, GLfloat s, GLfloat t, GLfloat r, GLfloat sampler,\r
+ GLfloat *color)\r
+{\r
+ GET_CURRENT_CONTEXT(ctx);\r
+ SWcontext *swrast = SWRAST_CONTEXT(ctx);\r
+ GLuint unit = (GLuint) sampler;\r
+ GLfloat texcoord[4] = { s, t, r, 1.0f };\r
+ GLfloat lambda = bias;\r
+ GLchan rgba[4];\r
+\r
+ swrast->TextureSample[unit] (ctx, ctx->Texture.Unit[unit]._Current, 1,\r
+ (const GLfloat (*)[4]) texcoord, &lambda, &rgba);\r
+ color[0] = CHAN_TO_FLOAT(rgba[0]);\r
+ color[1] = CHAN_TO_FLOAT(rgba[1]);\r
+ color[2] = CHAN_TO_FLOAT(rgba[2]);\r
+ color[3] = CHAN_TO_FLOAT(rgba[3]);\r
+}\r
+\r
+GLvoid _slang_library_shad2d (GLfloat bias, GLfloat s, GLfloat t, GLfloat r, GLfloat sampler,\r
+ GLfloat *color)\r
+{\r
+ GET_CURRENT_CONTEXT(ctx);\r
+ SWcontext *swrast = SWRAST_CONTEXT(ctx);\r
+ GLuint unit = (GLuint) sampler;\r
+ GLfloat texcoord[4] = { s, t, r, 1.0f };\r
+ GLfloat lambda = bias;\r
+ GLchan rgba[4];\r
+\r
+ swrast->TextureSample[unit] (ctx, ctx->Texture.Unit[unit]._Current, 1,\r
+ (const GLfloat (*)[4]) texcoord, &lambda, &rgba);\r
+ color[0] = CHAN_TO_FLOAT(rgba[0]);\r
+ color[1] = CHAN_TO_FLOAT(rgba[1]);\r
+ color[2] = CHAN_TO_FLOAT(rgba[2]);\r
+ color[3] = CHAN_TO_FLOAT(rgba[3]);\r
+}\r
+\r
--- /dev/null
+/*\r
+ * Mesa 3-D graphics library\r
+ * Version: 6.5\r
+ *\r
+ * Copyright (C) 2006 Brian Paul All Rights Reserved.\r
+ *\r
+ * Permission is hereby granted, free of charge, to any person obtaining a\r
+ * copy of this software and associated documentation files (the "Software"),\r
+ * to deal in the Software without restriction, including without limitation\r
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,\r
+ * and/or sell copies of the Software, and to permit persons to whom the\r
+ * Software is furnished to do so, subject to the following conditions:\r
+ *\r
+ * The above copyright notice and this permission notice shall be included\r
+ * in all copies or substantial portions of the Software.\r
+ *\r
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS\r
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\r
+ * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN\r
+ * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\r
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r
+ */\r
+\r
+#if !defined SLANG_LIBRARY_TEXSAMPLE_H\r
+#define SLANG_LIBRARY_TEXSAMPLE_H\r
+\r
+#if defined __cplusplus\r
+extern "C" {\r
+#endif\r
+\r
+GLvoid _slang_library_tex1d (GLfloat, GLfloat, GLfloat, GLfloat *);\r
+GLvoid _slang_library_tex2d (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat *);\r
+GLvoid _slang_library_tex3d (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat *);\r
+GLvoid _slang_library_texcube (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat *);\r
+GLvoid _slang_library_shad1d (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat *);\r
+GLvoid _slang_library_shad2d (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat *);\r
+\r
+#ifdef __cplusplus\r
+}\r
+#endif\r
+\r
+#endif\r
+\r
\r
#include "imports.h"\r
#include "slang_link.h"\r
+#include "slang_analyse.h"\r
\r
/*\r
* slang_uniform_bindings\r
return GL_FALSE;\r
self->table[n].quant = q;\r
self->table[n].name = slang_string_duplicate (name);\r
- for (i = 0; i < SLANG_UNIFORM_BINDING_MAX; i++)\r
+ for (i = 0; i < SLANG_SHADER_MAX; i++)\r
self->table[n].address[i] = ~0;\r
self->table[n].address[index] = address;\r
if (self->table[n].name == NULL)\r
return GL_TRUE;\r
}\r
\r
+/*\r
+ * slang_texture_bindings\r
+ */\r
+\r
+GLvoid slang_texture_usages_ctr (slang_texture_usages *self)\r
+{\r
+ self->table = NULL;\r
+ self->count = 0;\r
+}\r
+\r
+GLvoid slang_texture_usages_dtr (slang_texture_usages *self)\r
+{\r
+ slang_alloc_free (self->table);\r
+}\r
+\r
/*\r
* slang_program\r
*/\r
\r
slang_uniform_bindings_ctr (&self->uniforms);\r
slang_active_uniforms_ctr (&self->active_uniforms);\r
- for (i = 0; i < SLANG_UNIFORM_BINDING_MAX; i++)\r
+ slang_texture_usages_ctr (&self->texture_usage);\r
+ for (i = 0; i < SLANG_SHADER_MAX; i++)\r
{\r
GLuint j;\r
\r
for (j = 0; j < SLANG_COMMON_FIXED_MAX; j++)\r
self->common_fixed_entries[i][j] = ~0;\r
- self->code[i] = ~0;\r
+ for (j = 0; j < SLANG_COMMON_CODE_MAX; j++)\r
+ self->code[i][j] = ~0;\r
self->machines[i] = NULL;\r
self->assemblies[i] = NULL;\r
}\r
{\r
slang_uniform_bindings_dtr (&self->uniforms);\r
slang_active_uniforms_dtr (&self->active_uniforms);\r
+ slang_texture_usages_dtr (&self->texture_usage);\r
}\r
\r
/*\r
return ~0;\r
}\r
\r
-static GLvoid fill_common_fixed_entries (GLuint e[], slang_export_data_table *tbl)\r
+static GLvoid resolve_common_fixed (GLuint e[], slang_export_data_table *tbl)\r
{\r
e[SLANG_COMMON_FIXED_MODELVIEWMATRIX] = gd (tbl, "gl_ModelViewMatrix");\r
e[SLANG_COMMON_FIXED_PROJECTIONMATRIX] = gd (tbl, "gl_ProjectionMatrix");\r
e[SLANG_COMMON_FIXED_FOG] = gd (tbl, "gl_Fog");\r
}\r
\r
-static GLvoid fill_vertex_fixed_entries (GLuint e[], slang_export_data_table *tbl)\r
+static GLvoid resolve_vertex_fixed (GLuint e[], slang_export_data_table *tbl)\r
{\r
e[SLANG_VERTEX_FIXED_POSITION] = gd (tbl, "gl_Position");\r
e[SLANG_VERTEX_FIXED_POINTSIZE] = gd (tbl, "gl_PointSize");\r
e[SLANG_VERTEX_FIXED_FOGFRAGCOORD] = gd (tbl, "gl_FogFragCoord");\r
}\r
\r
-static GLvoid fill_fragment_fixed_entries (GLuint e[], slang_export_data_table *tbl)\r
+static GLvoid resolve_fragment_fixed (GLuint e[], slang_export_data_table *tbl)\r
{\r
e[SLANG_FRAGMENT_FIXED_FRAGCOORD] = gd (tbl, "gl_FragCoord");\r
e[SLANG_FRAGMENT_FIXED_FRONTFACING] = gd (tbl, "gl_FrontFacing");\r
return ~0;\r
}\r
\r
-static GLvoid resolve_code (GLuint code[], slang_export_code_table *tbl)\r
+static GLvoid resolve_common_code (GLuint code[], slang_export_code_table *tbl)\r
{\r
- code[0] = gc (tbl, "@main");\r
+ code[SLANG_COMMON_CODE_MAIN] = gc (tbl, "@main");\r
}\r
\r
GLboolean _slang_link (slang_program *prog, slang_translation_unit **units, GLuint count)\r
\r
if (units[i]->type == slang_unit_fragment_shader)\r
{\r
- index = SLANG_UNIFORM_BINDING_FRAGMENT;\r
- fill_fragment_fixed_entries (prog->fragment_fixed_entries, &units[i]->exp_data);\r
+ index = SLANG_SHADER_FRAGMENT;\r
+ resolve_fragment_fixed (prog->fragment_fixed_entries, &units[i]->exp_data);\r
}\r
else\r
{\r
- index = SLANG_UNIFORM_BINDING_VERTEX;\r
- fill_vertex_fixed_entries (prog->vertex_fixed_entries, &units[i]->exp_data);\r
+ index = SLANG_SHADER_VERTEX;\r
+ resolve_vertex_fixed (prog->vertex_fixed_entries, &units[i]->exp_data);\r
}\r
\r
if (!gather_uniform_bindings (&prog->uniforms, &units[i]->exp_data, index))\r
return GL_FALSE;\r
if (!gather_active_uniforms (&prog->active_uniforms, &units[i]->exp_data))\r
return GL_FALSE;\r
- fill_common_fixed_entries (prog->common_fixed_entries[index], &units[i]->exp_data);\r
- resolve_code (&prog->code[index], &units[i]->exp_code);\r
+ resolve_common_fixed (prog->common_fixed_entries[index], &units[i]->exp_data);\r
+ resolve_common_code (prog->code[index], &units[i]->exp_code);\r
prog->machines[index] = units[i]->machine;\r
prog->assemblies[index] = units[i]->assembly;\r
}\r
\r
+ if (!_slang_analyse_texture_usage (prog))\r
+ return GL_FALSE;\r
+\r
return GL_TRUE;\r
}\r
\r
{\r
slang_export_data_quant *quant;\r
char *name;\r
- GLuint address[SLANG_UNIFORM_BINDING_MAX];\r
+ GLuint address[SLANG_SHADER_MAX];\r
} slang_uniform_binding;\r
\r
typedef struct\r
GLuint count;\r
} slang_active_uniforms;\r
\r
+typedef struct\r
+{\r
+ slang_export_data_quant *quant;\r
+ GLuint frag_address;\r
+} slang_texture_usage;\r
+\r
+typedef struct\r
+{\r
+ slang_texture_usage *table;\r
+ GLuint count;\r
+} slang_texture_usages;\r
+\r
+GLvoid slang_texture_usages_ctr (slang_texture_usages *);\r
+GLvoid slang_texture_usages_dtr (slang_texture_usages *);\r
+\r
enum\r
{\r
SLANG_COMMON_FIXED_MODELVIEWMATRIX,\r
SLANG_FRAGMENT_FIXED_MAX\r
};\r
\r
+enum\r
+{\r
+ SLANG_COMMON_CODE_MAIN,\r
+ SLANG_COMMON_CODE_MAX\r
+};\r
+\r
typedef struct\r
{\r
slang_uniform_bindings uniforms;\r
slang_active_uniforms active_uniforms;\r
- GLuint common_fixed_entries[SLANG_UNIFORM_BINDING_MAX][SLANG_COMMON_FIXED_MAX];\r
+ slang_texture_usages texture_usage;\r
+ GLuint common_fixed_entries[SLANG_SHADER_MAX][SLANG_COMMON_FIXED_MAX];\r
GLuint vertex_fixed_entries[SLANG_VERTEX_FIXED_MAX];\r
GLuint fragment_fixed_entries[SLANG_FRAGMENT_FIXED_MAX];\r
- GLuint code[SLANG_UNIFORM_BINDING_MAX];\r
- slang_machine *machines[SLANG_UNIFORM_BINDING_MAX];\r
- slang_assembly_file *assemblies[SLANG_UNIFORM_BINDING_MAX];\r
+ GLuint code[SLANG_SHADER_MAX][SLANG_COMMON_CODE_MAX];\r
+ slang_machine *machines[SLANG_SHADER_MAX];\r
+ slang_assembly_file *assemblies[SLANG_SHADER_MAX];\r
} slang_program;\r
\r
GLvoid slang_program_ctr (slang_program *);\r
# Begin Source File\r
\r
SOURCE=..\..\..\..\src\mesa\main\imports.c\r
+\r
+!IF "$(CFG)" == "mesa - Win32 Release"\r
+\r
+!ELSEIF "$(CFG)" == "mesa - Win32 Debug"\r
+\r
+!ELSEIF "$(CFG)" == "mesa - Win32 Release x86"\r
+\r
+# ADD CPP /YX\r
+\r
+!ELSEIF "$(CFG)" == "mesa - Win32 Debug x86"\r
+\r
+!ENDIF \r
+\r
# End Source File\r
# Begin Source File\r
\r
# End Source File\r
# Begin Source File\r
\r
+SOURCE=..\..\..\..\src\mesa\shader\slang\slang_analyse.c\r
+# End Source File\r
+# Begin Source File\r
+\r
SOURCE=..\..\..\..\src\mesa\shader\slang\slang_assemble.c\r
# End Source File\r
# Begin Source File\r
# End Source File\r
# Begin Source File\r
\r
+SOURCE=..\..\..\..\src\mesa\shader\slang\slang_library_texsample.c\r
+# End Source File\r
+# Begin Source File\r
+\r
SOURCE=..\..\..\..\src\mesa\shader\slang\slang_link.c\r
# End Source File\r
# Begin Source File\r
# End Source File\r
# Begin Source File\r
\r
+SOURCE=..\..\..\..\src\mesa\shader\slang\slang_analyse.h\r
+# End Source File\r
+# Begin Source File\r
+\r
SOURCE=..\..\..\..\src\mesa\shader\slang\slang_assemble.h\r
# End Source File\r
# Begin Source File\r
# End Source File\r
# Begin Source File\r
\r
+SOURCE=..\..\..\..\src\mesa\shader\slang\slang_library_texsample.h\r
+# End Source File\r
+# Begin Source File\r
+\r
SOURCE=..\..\..\..\src\mesa\shader\slang\slang_link.h\r
# End Source File\r
# Begin Source File\r