Commit 4e33fd4b authored by Mike Gabriel's avatar Mike Gabriel

Mesa: Convert some files with MSDOS EOL style to Unix EOL style.

parent 4146d1aa
......@@ -109,18 +109,18 @@ _mesa_Hint( GLenum target, GLenum mode )
return;
FLUSH_VERTICES(ctx, _NEW_HINT);
ctx->Hint.GenerateMipmap = mode;
break;
/* GL_ARB_fragment_shader */
case GL_FRAGMENT_SHADER_DERIVATIVE_HINT_ARB:
if (!ctx->Extensions.ARB_fragment_shader) {
_mesa_error(ctx, GL_INVALID_ENUM, "glHint(target)");
return;
}
if (ctx->Hint.FragmentShaderDerivative == mode)
return;
FLUSH_VERTICES(ctx, _NEW_HINT);
ctx->Hint.FragmentShaderDerivative = mode;
break;
/* GL_ARB_fragment_shader */
case GL_FRAGMENT_SHADER_DERIVATIVE_HINT_ARB:
if (!ctx->Extensions.ARB_fragment_shader) {
_mesa_error(ctx, GL_INVALID_ENUM, "glHint(target)");
return;
}
if (ctx->Hint.FragmentShaderDerivative == mode)
return;
FLUSH_VERTICES(ctx, _NEW_HINT);
ctx->Hint.FragmentShaderDerivative = mode;
break;
default:
......@@ -148,6 +148,6 @@ void _mesa_init_hint( GLcontext * ctx )
ctx->Hint.Fog = GL_DONT_CARE;
ctx->Hint.ClipVolumeClipping = GL_DONT_CARE;
ctx->Hint.TextureCompression = GL_DONT_CARE;
ctx->Hint.GenerateMipmap = GL_DONT_CARE;
ctx->Hint.GenerateMipmap = GL_DONT_CARE;
ctx->Hint.FragmentShaderDerivative = GL_DONT_CARE;
}
......@@ -155,14 +155,14 @@ extern void GLAPIENTRY
_mesa_GetActiveAttribARB (GLhandleARB, GLuint, GLsizei, GLsizei *, GLint *, GLenum *, GLcharARB *);
extern GLint GLAPIENTRY
_mesa_GetAttribLocationARB (GLhandleARB, const GLcharARB *);
_mesa_GetAttribLocationARB (GLhandleARB, const GLcharARB *);
#endif
extern void
extern void
_mesa_init_shaderobjects (GLcontext *ctx);
#endif
#endif
/*
* Mesa 3-D graphics library
* Version: 6.3
*
* Copyright (C) 2005 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
* AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#ifndef SHADEROBJECTS_3DLABS_H
#define SHADEROBJECTS_3DLABS_H
#include "mtypes.h"
extern GLhandleARB
_mesa_3dlabs_create_shader_object (GLenum);
extern GLhandleARB
_mesa_3dlabs_create_program_object (void);
extern void
_mesa_init_shaderobjects_3dlabs (GLcontext *ctx);
#endif
/*
* Mesa 3-D graphics library
* Version: 6.3
*
* Copyright (C) 2005 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
* AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#ifndef SHADEROBJECTS_3DLABS_H
#define SHADEROBJECTS_3DLABS_H
#include "mtypes.h"
extern GLhandleARB
_mesa_3dlabs_create_shader_object (GLenum);
extern GLhandleARB
_mesa_3dlabs_create_program_object (void);
extern void
_mesa_init_shaderobjects_3dlabs (GLcontext *ctx);
#endif
".syntax version_directive;\n"
"version_directive\n"
" version_directive_1 .and .loop version_directive_2;\n"
"version_directive_1\n"
" prior_optional_spaces .and optional_version_directive .and .true .emit $;\n"
"version_directive_2\n"
" prior_optional_spaces .and version_directive_body .and .true .emit $;\n"
"optional_version_directive\n"
" version_directive_body .or .true .emit 10 .emit 1;\n"
"version_directive_body\n"
" '#' .and optional_space .and \"version\" .and space .and version_number .and optional_space .and\n"
" new_line;\n"
"version_number\n"
" version_number_110;\n"
"version_number_110\n"
" leading_zeroes .and \"110\" .emit 10 .emit 1;\n"
"leading_zeroes\n"
" .loop zero;\n"
"zero\n"
" '0';\n"
"space\n"
" single_space .and .loop single_space;\n"
"optional_space\n"
" .loop single_space;\n"
"single_space\n"
" ' ' .or '\\t';\n"
"prior_optional_spaces\n"
" .loop prior_space;\n"
"prior_space\n"
" c_style_comment_block .or cpp_style_comment_block .or space .or new_line;\n"
"c_style_comment_block\n"
" '/' .and '*' .and c_style_comment_rest;\n"
"c_style_comment_rest\n"
" .loop c_style_comment_char_no_star .and c_style_comment_rest_1;\n"
"c_style_comment_rest_1\n"
" c_style_comment_end .or c_style_comment_rest_2;\n"
"c_style_comment_rest_2\n"
" '*' .and c_style_comment_rest;\n"
"c_style_comment_char_no_star\n"
" '\\x2B'-'\\xFF' .or '\\x01'-'\\x29';\n"
"c_style_comment_end\n"
" '*' .and '/';\n"
"cpp_style_comment_block\n"
" '/' .and '/' .and cpp_style_comment_block_1;\n"
"cpp_style_comment_block_1\n"
" cpp_style_comment_block_2 .or cpp_style_comment_block_3;\n"
"cpp_style_comment_block_2\n"
" .loop cpp_style_comment_char .and new_line;\n"
"cpp_style_comment_block_3\n"
" .loop cpp_style_comment_char;\n"
"cpp_style_comment_char\n"
" '\\x0E'-'\\xFF' .or '\\x01'-'\\x09' .or '\\x0B'-'\\x0C';\n"
"new_line\n"
" cr_lf .or lf_cr .or '\\n' .or '\\r';\n"
"cr_lf\n"
" '\\r' .and '\\n';\n"
"lf_cr\n"
" '\\n' .and '\\r';\n"
".string __string_filter;\n"
"__string_filter\n"
" .loop __identifier_char;\n"
"__identifier_char\n"
" 'a'-'z' .or 'A'-'Z' .or '_' .or '0'-'9';\n"
""
".syntax version_directive;\n"
"version_directive\n"
" version_directive_1 .and .loop version_directive_2;\n"
"version_directive_1\n"
" prior_optional_spaces .and optional_version_directive .and .true .emit $;\n"
"version_directive_2\n"
" prior_optional_spaces .and version_directive_body .and .true .emit $;\n"
"optional_version_directive\n"
" version_directive_body .or .true .emit 10 .emit 1;\n"
"version_directive_body\n"
" '#' .and optional_space .and \"version\" .and space .and version_number .and optional_space .and\n"
" new_line;\n"
"version_number\n"
" version_number_110;\n"
"version_number_110\n"
" leading_zeroes .and \"110\" .emit 10 .emit 1;\n"
"leading_zeroes\n"
" .loop zero;\n"
"zero\n"
" '0';\n"
"space\n"
" single_space .and .loop single_space;\n"
"optional_space\n"
" .loop single_space;\n"
"single_space\n"
" ' ' .or '\\t';\n"
"prior_optional_spaces\n"
" .loop prior_space;\n"
"prior_space\n"
" c_style_comment_block .or cpp_style_comment_block .or space .or new_line;\n"
"c_style_comment_block\n"
" '/' .and '*' .and c_style_comment_rest;\n"
"c_style_comment_rest\n"
" .loop c_style_comment_char_no_star .and c_style_comment_rest_1;\n"
"c_style_comment_rest_1\n"
" c_style_comment_end .or c_style_comment_rest_2;\n"
"c_style_comment_rest_2\n"
" '*' .and c_style_comment_rest;\n"
"c_style_comment_char_no_star\n"
" '\\x2B'-'\\xFF' .or '\\x01'-'\\x29';\n"
"c_style_comment_end\n"
" '*' .and '/';\n"
"cpp_style_comment_block\n"
" '/' .and '/' .and cpp_style_comment_block_1;\n"
"cpp_style_comment_block_1\n"
" cpp_style_comment_block_2 .or cpp_style_comment_block_3;\n"
"cpp_style_comment_block_2\n"
" .loop cpp_style_comment_char .and new_line;\n"
"cpp_style_comment_block_3\n"
" .loop cpp_style_comment_char;\n"
"cpp_style_comment_char\n"
" '\\x0E'-'\\xFF' .or '\\x01'-'\\x09' .or '\\x0B'-'\\x0C';\n"
"new_line\n"
" cr_lf .or lf_cr .or '\\n' .or '\\r';\n"
"cr_lf\n"
" '\\r' .and '\\n';\n"
"lf_cr\n"
" '\\n' .and '\\r';\n"
".string __string_filter;\n"
"__string_filter\n"
" .loop __identifier_char;\n"
"__identifier_char\n"
" 'a'-'z' .or 'A'-'Z' .or '_' .or '0'-'9';\n"
""
/*
* Mesa 3-D graphics library
* Version: 6.3
*
* Copyright (C) 2005 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
* AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#if !defined SLANG_ASSEMBLE_H
#define SLANG_ASSEMBLE_H
#include "slang_compile.h"
#if defined __cplusplus
extern "C" {
#endif
typedef enum slang_assembly_type_
{
/* core */
slang_asm_none,
slang_asm_float_copy,
slang_asm_float_move,
slang_asm_float_push,
slang_asm_float_deref,
slang_asm_float_add,
slang_asm_float_multiply,
slang_asm_float_divide,
slang_asm_float_negate,
slang_asm_float_less,
slang_asm_float_equal,
slang_asm_float_to_int,
slang_asm_int_copy,
slang_asm_int_move,
slang_asm_int_push,
slang_asm_int_deref,
slang_asm_int_to_float,
slang_asm_int_to_addr,
slang_asm_bool_copy,
slang_asm_bool_move,
slang_asm_bool_push,
slang_asm_bool_deref,
slang_asm_addr_copy,
slang_asm_addr_push,
slang_asm_addr_deref,
slang_asm_addr_add,
slang_asm_addr_multiply,
slang_asm_jump,
slang_asm_jump_if_zero,
slang_asm_enter,
slang_asm_leave,
slang_asm_local_alloc,
slang_asm_local_free,
slang_asm_local_addr,
slang_asm_call,
slang_asm_return,
slang_asm_discard,
slang_asm_exit,
slang_asm__last
} slang_assembly_type;
typedef struct slang_assembly_
{
slang_assembly_type type;
GLfloat literal;
GLuint param[2];
} slang_assembly;
typedef struct slang_assembly_file_
{
slang_assembly *code;
unsigned int count;
} slang_assembly_file;
void slang_assembly_file_construct (slang_assembly_file *);
void slang_assembly_file_destruct (slang_assembly_file *);
int slang_assembly_file_push (slang_assembly_file *, slang_assembly_type);
int slang_assembly_file_push_label (slang_assembly_file *, slang_assembly_type, GLuint);
int slang_assembly_file_push_label2 (slang_assembly_file *, slang_assembly_type, GLuint, GLuint);
int slang_assembly_file_push_literal (slang_assembly_file *, slang_assembly_type, GLfloat);
typedef struct slang_assembly_flow_control_
{
unsigned int loop_start; /* for "continue" statement */
unsigned int loop_end; /* for "break" statement */
unsigned int function_end; /* for "return" statement */
} slang_assembly_flow_control;
typedef struct slang_assembly_name_space_
{
struct slang_function_scope_ *funcs;
struct slang_struct_scope_ *structs;
struct slang_variable_scope_ *vars;
} slang_assembly_name_space;
slang_function *_slang_locate_function (const char *name, slang_operation *params,
unsigned int num_params, slang_assembly_name_space *space);
int _slang_assemble_function (slang_assembly_file *, struct slang_function_ *,
slang_assembly_name_space *);
typedef struct slang_assembly_stack_info_
{
unsigned int swizzle_mask;
} slang_assembly_stack_info;
int _slang_cleanup_stack (slang_assembly_file *, slang_operation *, int ref,
slang_assembly_name_space *);
typedef struct slang_assembly_local_info_
{
unsigned int ret_size;
unsigned int addr_tmp;
unsigned int swizzle_tmp;
} slang_assembly_local_info;
int _slang_assemble_operation (slang_assembly_file *, struct slang_operation_ *, int reference,
slang_assembly_flow_control *, slang_assembly_name_space *, slang_assembly_local_info *,
slang_assembly_stack_info *);
void xxx_first (slang_assembly_file *);
void xxx_prolog (slang_assembly_file *, unsigned int);
#ifdef __cplusplus
}
#endif
#endif
/*
* Mesa 3-D graphics library
* Version: 6.3
*
* Copyright (C) 2005 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
* AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#if !defined SLANG_ASSEMBLE_H
#define SLANG_ASSEMBLE_H
#include "slang_compile.h"
#if defined __cplusplus
extern "C" {
#endif
typedef enum slang_assembly_type_
{
/* core */
slang_asm_none,
slang_asm_float_copy,
slang_asm_float_move,
slang_asm_float_push,
slang_asm_float_deref,
slang_asm_float_add,
slang_asm_float_multiply,
slang_asm_float_divide,
slang_asm_float_negate,
slang_asm_float_less,
slang_asm_float_equal,
slang_asm_float_to_int,
slang_asm_int_copy,
slang_asm_int_move,
slang_asm_int_push,
slang_asm_int_deref,
slang_asm_int_to_float,
slang_asm_int_to_addr,
slang_asm_bool_copy,
slang_asm_bool_move,
slang_asm_bool_push,
slang_asm_bool_deref,
slang_asm_addr_copy,
slang_asm_addr_push,
slang_asm_addr_deref,
slang_asm_addr_add,
slang_asm_addr_multiply,
slang_asm_jump,
slang_asm_jump_if_zero,
slang_asm_enter,
slang_asm_leave,
slang_asm_local_alloc,
slang_asm_local_free,
slang_asm_local_addr,
slang_asm_call,
slang_asm_return,
slang_asm_discard,
slang_asm_exit,
slang_asm__last
} slang_assembly_type;
typedef struct slang_assembly_
{
slang_assembly_type type;
GLfloat literal;
GLuint param[2];
} slang_assembly;
typedef struct slang_assembly_file_
{
slang_assembly *code;
unsigned int count;
} slang_assembly_file;
void slang_assembly_file_construct (slang_assembly_file *);
void slang_assembly_file_destruct (slang_assembly_file *);
int slang_assembly_file_push (slang_assembly_file *, slang_assembly_type);
int slang_assembly_file_push_label (slang_assembly_file *, slang_assembly_type, GLuint);
int slang_assembly_file_push_label2 (slang_assembly_file *, slang_assembly_type, GLuint, GLuint);
int slang_assembly_file_push_literal (slang_assembly_file *, slang_assembly_type, GLfloat);
typedef struct slang_assembly_flow_control_
{
unsigned int loop_start; /* for "continue" statement */
unsigned int loop_end; /* for "break" statement */
unsigned int function_end; /* for "return" statement */
} slang_assembly_flow_control;
typedef struct slang_assembly_name_space_
{
struct slang_function_scope_ *funcs;
struct slang_struct_scope_ *structs;
struct slang_variable_scope_ *vars;
} slang_assembly_name_space;
slang_function *_slang_locate_function (const char *name, slang_operation *params,
unsigned int num_params, slang_assembly_name_space *space);
int _slang_assemble_function (slang_assembly_file *, struct slang_function_ *,
slang_assembly_name_space *);
typedef struct slang_assembly_stack_info_
{
unsigned int swizzle_mask;
} slang_assembly_stack_info;
int _slang_cleanup_stack (slang_assembly_file *, slang_operation *, int ref,
slang_assembly_name_space *);
typedef struct slang_assembly_local_info_
{
unsigned int ret_size;
unsigned int addr_tmp;
unsigned int swizzle_tmp;
} slang_assembly_local_info;
int _slang_assemble_operation (slang_assembly_file *, struct slang_operation_ *, int reference,
slang_assembly_flow_control *, slang_assembly_name_space *, slang_assembly_local_info *,
slang_assembly_stack_info *);
void xxx_first (slang_assembly_file *);
void xxx_prolog (slang_assembly_file *, unsigned int);
#ifdef __cplusplus
}
#endif
#endif
/*
* Mesa 3-D graphics library
* Version: 6.3
*
* Copyright (C) 2005 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
* AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#if !defined SLANG_ASSEMBLE_ASSIGNMENT_H
#define SLANG_ASSEMBLE_ASSIGNMENT_H
#include "slang_assemble.h"
#if defined __cplusplus
extern "C" {
#endif
int _slang_assemble_assignment (slang_assembly_file *, slang_operation *,
slang_assembly_name_space *, slang_assembly_local_info *);
int _slang_assemble_assign (slang_assembly_file *, slang_operation *, const char *, int ref,
slang_assembly_name_space *, slang_assembly_local_info *);
#ifdef __cplusplus
}
#endif
#endif
/*
* Mesa 3-D graphics library
* Version: 6.3
*
* Copyright (C) 2005 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
* AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#if !defined SLANG_ASSEMBLE_ASSIGNMENT_H
#define SLANG_ASSEMBLE_ASSIGNMENT_H
#include "slang_assemble.h"
#if defined __cplusplus
extern "C" {
#endif
int _slang_assemble_assignment (slang_assembly_file *, slang_operation *,
slang_assembly_name_space *, slang_assembly_local_info *);
int _slang_assemble_assign (slang_assembly_file *, slang_operation *, const char *, int ref,
slang_assembly_name_space *, slang_assembly_local_info *);
#ifdef __cplusplus
}
#endif
#endif
/*
* Mesa 3-D graphics library
* Version: 6.3
*
* Copyright (C) 2005 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
* AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#if !defined SLANG_ASSEMBLE_CONDITIONAL_H
#define SLANG_ASSEMBLE_CONDITIONAL_H
#include "slang_assemble.h"
#if defined __cplusplus
extern "C" {
#endif
int _slang_assemble_logicaland (slang_assembly_file *file, slang_operation *op,
slang_assembly_flow_control *flow, slang_assembly_name_space *space,
slang_assembly_local_info *info);
int _slang_assemble_logicalor (slang_assembly_file *file, slang_operation *op,
slang_assembly_flow_control *flow, slang_assembly_name_space *space,
slang_assembly_local_info *info);
int _slang_assemble_select (slang_assembly_file *file, slang_operation *op,
slang_assembly_flow_control *flow, slang_assembly_name_space *space,
slang_assembly_local_info *info);
int _slang_assemble_for (slang_assembly_file *file, slang_operation *op,
slang_assembly_flow_control *flow, slang_assembly_name_space *space,
slang_assembly_local_info *info);
int _slang_assemble_do (slang_assembly_file *file, slang_operation *op,
slang_assembly_flow_control *flow, slang_assembly_name_space *space,
slang_assembly_local_info *info);
int _slang_assemble_while (slang_assembly_file *file, slang_operation *op,
slang_assembly_flow_control *flow, slang_assembly_name_space *space,
slang_assembly_local_info *info);
int _slang_assemble_if (slang_assembly_file *file, slang_operation *op,
slang_assembly_flow_control *flow, slang_assembly_name_space *space,
slang_assembly_local_info *info);
#ifdef __cplusplus
}
#endif
#endif
/*
* Mesa 3-D graphics library
* Version: 6.3
*
* Copyright (C) 2005 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
* AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#if !defined SLANG_ASSEMBLE_CONDITIONAL_H
#define SLANG_ASSEMBLE_CONDITIONAL_H
#include "slang_assemble.h"
#if defined __cplusplus
extern "C" {
#endif
int _slang_assemble_logicaland (slang_assembly_file *file, slang_operation *op,
slang_assembly_flow_control *flow, slang_assembly_name_space *space,
slang_assembly_local_info *info);
int _slang_assemble_logicalor (slang_assembly_file *file, slang_operation *op,
slang_assembly_flow_control *flow, slang_assembly_name_space *space,
slang_assembly_local_info *info);
int _slang_assemble_select (slang_assembly_file *file, slang_operation *op,
slang_assembly_flow_control *flow, slang_assembly_name_space *space,
slang_assembly_local_info *info);
int _slang_assemble_for (slang_assembly_file *file, slang_operation *op,
slang_assembly_flow_control *flow, slang_assembly_name_space *space,
slang_assembly_local_info *info);
int _slang_assemble_do (slang_assembly_file *file, slang_operation *op,
slang_assembly_flow_control *flow, slang_assembly_name_space *space,
slang_assembly_local_info *info);
int _slang_assemble_while (slang_assembly_file *file, slang_operation *op,
slang_assembly_flow_control *flow, slang_assembly_name_space *space,
slang_assembly_local_info *info);
int _slang_assemble_if (slang_assembly_file *file, slang_operation *op,
slang_assembly_flow_control *flow, slang_assembly_name_space *space,
slang_assembly_local_info *info);
#ifdef __cplusplus
}
#endif
#endif
/*
* Mesa 3-D graphics library
* Version: 6.3
*
* Copyright (C) 2005 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
* AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#if !defined SLANG_ASSEMBLE_CONSTRUCTOR_H
#define SLANG_ASSEMBLE_CONSTRUCTOR_H
#include "slang_assemble.h"
#include "slang_compile.h"
#if defined __cplusplus
extern "C" {
#endif
/*
holds a complete information about vector swizzle - the <swizzle> array contains
vector component sources indices, where 0 is "x", 1 is "y", ...
example: "xwz" --> { 3, { 0, 3, 2, n/u } }
*/
typedef struct slang_swizzle_
{
unsigned int num_components;
unsigned int swizzle[4];
} slang_swizzle;
/*
checks if a field selector is a general swizzle (an r-value swizzle with replicated
components or an l-value swizzle mask) for a vector
returns 1 if this is the case, <swz> is filled with swizzle information
returns 0 otherwise
*/
int _slang_is_swizzle (const char *field, unsigned int rows, slang_swizzle *swz);
/*
checks if a general swizzle is an l-value swizzle - these swizzles do not have
duplicated fields and they are specified in order
returns 1 if this is a swizzle mask
returns 0 otherwise
*/
int _slang_is_swizzle_mask (const slang_swizzle *swz, unsigned int rows);
/*
combines two swizzles to form single swizzle
example: "wzyx.yx" --> "zw"
*/
void _slang_multiply_swizzles (slang_swizzle *, const slang_swizzle *, const slang_swizzle *);
int _slang_assemble_constructor (slang_assembly_file *file, slang_operation *op,
slang_assembly_flow_control *flow, slang_assembly_name_space *space,
slang_assembly_local_info *info);
int _slang_assemble_constructor_from_swizzle (slang_assembly_file *file, const slang_swizzle *swz,
slang_type_specifier *spec, slang_type_specifier *master_spec, slang_assembly_local_info *info);
#ifdef __cplusplus
}
#endif
#endif
/*
* Mesa 3-D graphics library
* Version: 6.3
*
* Copyright (C) 2005 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
* AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#if !defined SLANG_ASSEMBLE_CONSTRUCTOR_H
#define SLANG_ASSEMBLE_CONSTRUCTOR_H
#include "slang_assemble.h"
#include "slang_compile.h"
#if defined __cplusplus
extern "C" {
#endif
/*
holds a complete information about vector swizzle - the <swizzle> array contains
vector component sources indices, where 0 is "x", 1 is "y", ...
example: "xwz" --> { 3, { 0, 3, 2, n/u } }
*/
typedef struct slang_swizzle_
{
unsigned int num_components;
unsigned int swizzle[4];
} slang_swizzle;
/*
checks if a field selector is a general swizzle (an r-value swizzle with replicated
components or an l-value swizzle mask) for a vector
returns 1 if this is the case, <swz> is filled with swizzle information
returns 0 otherwise
*/
int _slang_is_swizzle (const char *field, unsigned int rows, slang_swizzle *swz);
/*
checks if a general swizzle is an l-value swizzle - these swizzles do not have
duplicated fields and they are specified in order
returns 1 if this is a swizzle mask
returns 0 otherwise
*/
int _slang_is_swizzle_mask (const slang_swizzle *swz, unsigned int rows);
/*
combines two swizzles to form single swizzle
example: "wzyx.yx" --> "zw"
*/
void _slang_multiply_swizzles (slang_swizzle *, const slang_swizzle *, const slang_swizzle *);
int _slang_assemble_constructor (slang_assembly_file *file, slang_operation *op,
slang_assembly_flow_control *flow, slang_assembly_name_space *space,
slang_assembly_local_info *info);
int _slang_assemble_constructor_from_swizzle (slang_assembly_file *file, const slang_swizzle *swz,
slang_type_specifier *spec, slang_type_specifier *master_spec, slang_assembly_local_info *info);
#ifdef __cplusplus
}
#endif
#endif
/*
* Mesa 3-D graphics library
* Version: 6.3
*
* Copyright (C) 2005 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
* AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#if !defined SLANG_ASSEMBLE_TYPEINFO_H
#define SLANG_ASSEMBLE_TYPEINFO_H
#include "slang_assemble_constructor.h"
#include "slang_compile.h"
#if defined __cplusplus
extern "C" {
#endif
typedef struct slang_assembly_typeinfo_
{
int can_be_referenced;
int is_swizzled;
slang_swizzle swz;
slang_type_specifier spec;
} slang_assembly_typeinfo;
void slang_assembly_typeinfo_construct (slang_assembly_typeinfo *);
void slang_assembly_typeinfo_destruct (slang_assembly_typeinfo *);
/*
retrieves type information about an operation
returns 1 on success
returns 0 otherwise
*/
int _slang_typeof_operation (slang_operation *, slang_assembly_name_space *,
slang_assembly_typeinfo *);
/*
retrieves type of a function prototype, if one exists
returns 1 on success, even if the function was not found
returns 0 otherwise
*/
int _slang_typeof_function (const char *name, slang_operation *params, unsigned int num_params,
slang_assembly_name_space *space, slang_type_specifier *spec, int *exists);
#ifdef __cplusplus
}
#endif
#endif
/*
* Mesa 3-D graphics library
* Version: 6.3
*
* Copyright (C) 2005 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
* AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#if !defined SLANG_ASSEMBLE_TYPEINFO_H
#define SLANG_ASSEMBLE_TYPEINFO_H
#include "slang_assemble_constructor.h"
#include "slang_compile.h"
#if defined __cplusplus
extern "C" {
#endif
typedef struct slang_assembly_typeinfo_
{
int can_be_referenced;
int is_swizzled;
slang_swizzle swz;
slang_type_specifier spec;
} slang_assembly_typeinfo;
void slang_assembly_typeinfo_construct (slang_assembly_typeinfo *);
void slang_assembly_typeinfo_destruct (slang_assembly_typeinfo *);
/*
retrieves type information about an operation
returns 1 on success
returns 0 otherwise
*/
int _slang_typeof_operation (slang_operation *, slang_assembly_name_space *,
slang_assembly_typeinfo *);
/*
retrieves type of a function prototype, if one exists
returns 1 on success, even if the function was not found
returns 0 otherwise
*/
int _slang_typeof_function (const char *name, slang_operation *params, unsigned int num_params,
slang_assembly_name_space *space, slang_type_specifier *spec, int *exists);
#ifdef __cplusplus
}
#endif
#endif
......@@ -68,8 +68,8 @@ typedef enum slang_type_specifier_type_
slang_spec_sampler2DShadow,
slang_spec_struct,
slang_spec_array
} slang_type_specifier_type;
} slang_type_specifier_type;
slang_type_specifier_type slang_type_specifier_type_from_string (const char *);
typedef struct slang_type_specifier_
......@@ -77,11 +77,11 @@ typedef struct slang_type_specifier_
slang_type_specifier_type type;
struct slang_struct_ *_struct; /* spec_struct */
struct slang_type_specifier_ *_array; /* spec_array */
} slang_type_specifier;
void slang_type_specifier_construct (slang_type_specifier *);
void slang_type_specifier_destruct (slang_type_specifier *);
int slang_type_specifier_copy (slang_type_specifier *, const slang_type_specifier *);
} slang_type_specifier;
void slang_type_specifier_construct (slang_type_specifier *);
void slang_type_specifier_destruct (slang_type_specifier *);
int slang_type_specifier_copy (slang_type_specifier *, const slang_type_specifier *);
int slang_type_specifier_equal (const slang_type_specifier *, const slang_type_specifier *);
typedef struct slang_fully_specified_type_
......@@ -171,9 +171,9 @@ typedef struct slang_operation_
float literal; /* bool, literal_int, literal_float */
char *identifier; /* asm, identifier, call, field */
slang_variable_scope *locals;
} slang_operation;
int slang_operation_construct_a (slang_operation *);
} slang_operation;
int slang_operation_construct_a (slang_operation *);
void slang_operation_destruct (slang_operation *);
typedef struct slang_variable_
......@@ -181,10 +181,10 @@ typedef struct slang_variable_
slang_fully_specified_type type;
char *name;
slang_operation *array_size; /* spec_array */
slang_operation *initializer;
slang_operation *initializer;
unsigned int address;
} slang_variable;
} slang_variable;
slang_variable *_slang_locate_variable (slang_variable_scope *scope, const char *name, int all);
typedef struct slang_struct_scope_
......@@ -192,8 +192,8 @@ typedef struct slang_struct_scope_
struct slang_struct_ *structs;
unsigned int num_structs;
struct slang_struct_scope_ *outer_scope;
} slang_struct_scope;
} slang_struct_scope;
struct slang_struct_ *slang_struct_scope_find (slang_struct_scope *, const char *, int);
typedef struct slang_struct_
......@@ -201,9 +201,9 @@ typedef struct slang_struct_
char *name;
slang_variable_scope *fields;
slang_struct_scope *structs;
} slang_struct;
int slang_struct_construct_a (slang_struct *);
} slang_struct;
int slang_struct_construct_a (slang_struct *);
int slang_struct_copy (slang_struct *, const slang_struct *);
typedef enum slang_function_kind_
......@@ -219,7 +219,7 @@ typedef struct slang_function_
slang_variable header;
slang_variable_scope *parameters;
unsigned int param_count;
slang_operation *body;
slang_operation *body;
unsigned int address;
} slang_function;
......
/*
* Mesa 3-D graphics library
* Version: 6.3
*
* Copyright (C) 2005 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
* AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#if !defined SLANG_EXECUTE_H
#define SLANG_EXECUTE_H
#if defined __cplusplus
extern "C" {
#endif
#define SLANG_MACHINE_STACK_SIZE 1024
typedef struct slang_machine_
{
GLuint ip; /* instruction pointer, for flow control */
GLuint sp; /* stack pointer, for stack access */
GLuint bp; /* base pointer, for local variable access */
GLuint kill; /* discard the fragment */
GLuint exit; /* terminate the shader */
union stack_
{
GLfloat _float[SLANG_MACHINE_STACK_SIZE];
GLfloat *_floatp[SLANG_MACHINE_STACK_SIZE];
GLuint _addr[SLANG_MACHINE_STACK_SIZE];
GLuint *_addrp[SLANG_MACHINE_STACK_SIZE];
} stack;
} slang_machine;
int _slang_execute (const slang_assembly_file *);
#ifdef __cplusplus
}
#endif
#endif
/*
* Mesa 3-D graphics library
* Version: 6.3
*
* Copyright (C) 2005 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
* AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#if !defined SLANG_EXECUTE_H
#define SLANG_EXECUTE_H
#if defined __cplusplus
extern "C" {
#endif
#define SLANG_MACHINE_STACK_SIZE 1024
typedef struct slang_machine_
{
GLuint ip; /* instruction pointer, for flow control */
GLuint sp; /* stack pointer, for stack access */
GLuint bp; /* base pointer, for local variable access */
GLuint kill; /* discard the fragment */
GLuint exit; /* terminate the shader */
union stack_
{
GLfloat _float[SLANG_MACHINE_STACK_SIZE];
GLfloat *_floatp[SLANG_MACHINE_STACK_SIZE];
GLuint _addr[SLANG_MACHINE_STACK_SIZE];
GLuint *_addrp[SLANG_MACHINE_STACK_SIZE];
} stack;
} slang_machine;
int _slang_execute (const slang_assembly_file *);
#ifdef __cplusplus
}
#endif
#endif
/*
* Mesa 3-D graphics library
* Version: 6.3
*
* Copyright (C) 2005 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
* AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
/**
* \file slang_preprocess.c
* slang preprocessor
* \author Michal Krol
*/
#include "imports.h"
#include "grammar_mesa.h"
#include "slang_compile.h"
#include "slang_preprocess.h"
static const char *slang_version_syn =
#include "library/slang_version_syn.h"
;
int _slang_preprocess_version (const char *text, unsigned int *version, unsigned int *eaten,
slang_info_log *log)
{
grammar id;
byte *prod, *I;
unsigned int size;
id = grammar_load_from_text ((const byte *) slang_version_syn);
if (id == 0)
{
char buf[1024];
unsigned int pos;
grammar_get_last_error ( (unsigned char*) buf, 1024, (int*) &pos);
slang_info_log_error (log, buf);
return 0;
}
if (!grammar_fast_check (id, (const byte *) text, &prod, &size, 8))
{
char buf[1024];
unsigned int pos;
grammar_get_last_error ( (unsigned char*) buf, 1024, (int*) &pos);
slang_info_log_error (log, buf);
grammar_destroy (id);
return 0;
}
grammar_destroy (id);
/* there can be multiple #version directives - grab the last one */
I = prod;
while (I < prod + size)
{
*version =
(unsigned int) I[0] +
(unsigned int) I[1] * 100;
*eaten =
((unsigned int) I[2]) +
((unsigned int) I[3] << 8) +
((unsigned int) I[4] << 16) +
((unsigned int) I[5] << 24);
I += 6;
}
grammar_alloc_free (prod);
return 1;
}
/*
* Mesa 3-D graphics library
* Version: 6.3
*
* Copyright (C) 2005 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
* AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
/**
* \file slang_preprocess.c
* slang preprocessor
* \author Michal Krol
*/
#include "imports.h"
#include "grammar_mesa.h"
#include "slang_compile.h"
#include "slang_preprocess.h"
static const char *slang_version_syn =
#include "library/slang_version_syn.h"
;
int _slang_preprocess_version (const char *text, unsigned int *version, unsigned int *eaten,
slang_info_log *log)
{
grammar id;
byte *prod, *I;
unsigned int size;
id = grammar_load_from_text ((const byte *) slang_version_syn);
if (id == 0)
{
char buf[1024];
unsigned int pos;
grammar_get_last_error ( (unsigned char*) buf, 1024, (int*) &pos);
slang_info_log_error (log, buf);
return 0;
}
if (!grammar_fast_check (id, (const byte *) text, &prod, &size, 8))
{
char buf[1024];
unsigned int pos;
grammar_get_last_error ( (unsigned char*) buf, 1024, (int*) &pos);
slang_info_log_error (log, buf);
grammar_destroy (id);
return 0;
}
grammar_destroy (id);
/* there can be multiple #version directives - grab the last one */
I = prod;
while (I < prod + size)
{
*version =
(unsigned int) I[0] +
(unsigned int) I[1] * 100;
*eaten =
((unsigned int) I[2]) +
((unsigned int) I[3] << 8) +
((unsigned int) I[4] << 16) +
((unsigned int) I[5] << 24);
I += 6;
}
grammar_alloc_free (prod);
return 1;
}
/*
* Mesa 3-D graphics library
* Version: 6.3
*
* Copyright (C) 2005 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
* AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#if !defined SLANG_PREPROCESS_H
#define SLANG_PREPROCESS_H
#if defined __cplusplus
extern "C" {
#endif
int _slang_preprocess_version (const char *, unsigned int *, unsigned int *, slang_info_log *);
#ifdef __cplusplus
}
#endif
#endif
/*
* Mesa 3-D graphics library
* Version: 6.3
*
* Copyright (C) 2005 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
* AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#if !defined SLANG_PREPROCESS_H
#define SLANG_PREPROCESS_H
#if defined __cplusplus
extern "C" {
#endif
int _slang_preprocess_version (const char *, unsigned int *, unsigned int *, slang_info_log *);
#ifdef __cplusplus
}
#endif
#endif
/*
* Mesa 3-D graphics library
* Version: 6.3
*
* Copyright (C) 2005 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
* AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
/**
* \file slang_utility.c
* slang utilities
* \author Michal Krol
*/
#include "imports.h"
#include "slang_utility.h"
void slang_alloc_free (void *ptr)
{
_mesa_free (ptr);
}
void *slang_alloc_malloc (unsigned int size)
{
return _mesa_malloc (size);
}
void *slang_alloc_realloc (void *ptr, unsigned int old_size, unsigned int size)
{
return _mesa_realloc (ptr, old_size, size);
}
int slang_string_compare (const char *str1, const char *str2)
{
return _mesa_strcmp (str1, str2);
}
char *slang_string_copy (char *dst, const char *src)
{
return _mesa_strcpy (dst, src);
}
char *slang_string_concat (char *dst, const char *src)
{
return _mesa_strcpy (dst + _mesa_strlen (dst), src);
}
char *slang_string_duplicate (const char *src)
{
return _mesa_strdup (src);
}
unsigned int slang_string_length (const char *str)
{
return _mesa_strlen (str);
}
/*
* Mesa 3-D graphics library
* Version: 6.3
*
* Copyright (C) 2005 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
* AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
/**
* \file slang_utility.c
* slang utilities
* \author Michal Krol
*/
#include "imports.h"
#include "slang_utility.h"
void slang_alloc_free (void *ptr)
{
_mesa_free (ptr);
}
void *slang_alloc_malloc (unsigned int size)
{
return _mesa_malloc (size);
}
void *slang_alloc_realloc (void *ptr, unsigned int old_size, unsigned int size)
{
return _mesa_realloc (ptr, old_size, size);
}
int slang_string_compare (const char *str1, const char *str2)
{
return _mesa_strcmp (str1, str2);
}
char *slang_string_copy (char *dst, const char *src)
{
return _mesa_strcpy (dst, src);
}
char *slang_string_concat (char *dst, const char *src)
{
return _mesa_strcpy (dst + _mesa_strlen (dst), src);
}
char *slang_string_duplicate (const char *src)
{
return _mesa_strdup (src);
}
unsigned int slang_string_length (const char *str)
{
return _mesa_strlen (str);
}
/*
* Mesa 3-D graphics library
* Version: 6.3
*
* Copyright (C) 2005 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
* AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#if !defined SLANG_UTILITY_H
#define SLANG_UTILITY_H
#if defined __cplusplus
extern "C" {
#endif
/*
* Mesa 3-D graphics library
* Version: 6.3
*
* Copyright (C) 2005 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
* AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#if !defined SLANG_UTILITY_H
#define SLANG_UTILITY_H
#if defined __cplusplus
extern "C" {
#endif
/* Compile-time assertions. If the expression is zero, try to declare an
* array of size [-1] to cause compilation error.
*/
#define _static_assert(expr) do { int _array[(expr) ? 1 : -1]; _array[0]; } while (0)
void slang_alloc_free (void *);
void *slang_alloc_malloc (unsigned int);
void *slang_alloc_realloc (void *, unsigned int, unsigned int);
int slang_string_compare (const char *, const char *);
char *slang_string_copy (char *, const char *);
char *slang_string_concat (char *, const char *);
char *slang_string_duplicate (const char *);
unsigned int slang_string_length (const char *);
#ifdef __cplusplus
}
#endif
#endif
void slang_alloc_free (void *);
void *slang_alloc_malloc (unsigned int);
void *slang_alloc_realloc (void *, unsigned int, unsigned int);
int slang_string_compare (const char *, const char *);
char *slang_string_copy (char *, const char *);
char *slang_string_concat (char *, const char *);
char *slang_string_duplicate (const char *);
unsigned int slang_string_length (const char *);
#ifdef __cplusplus
}
#endif
#endif
/*
* Mesa 3-D graphics library
* Version: 6.3
*
* Copyright (C) 2005 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
* AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
/**
* \file traverse_wrap.h
* Handy TIntermTraverser class wrapper
* \author Michal Krol
*/
#ifndef __TRAVERSE_WRAP_H__
#define __TRAVERSE_WRAP_H__
#include "Include/intermediate.h"
/*
The original TIntermTraverser class that is used to walk the intermediate tree,
is not very elegant in its design. One must define static functions with
appropriate prototypes, construct TIntermTraverser object, and set its member
function pointers to one's static functions. If traversal-specific data
is needed, a new class must be derived, and one must up-cast the object
passed as a parameter to the static function.
The class below eliminates this burden by providing virtual methods that are
to be overridden in the derived class.
*/
class traverse_wrap: private TIntermTraverser
{
private:
static void _visitSymbol (TIntermSymbol *S, TIntermTraverser *T) {
static_cast<traverse_wrap *> (T)->Symbol (*S);
}
static void _visitConstantUnion (TIntermConstantUnion *U, TIntermTraverser *T) {
static_cast<traverse_wrap *> (T)->ConstantUnion (*U);
}
static bool _visitBinary (bool preVisit, TIntermBinary *B, TIntermTraverser *T) {
return static_cast<traverse_wrap *> (T)->Binary (preVisit, *B);
}
static bool _visitUnary (bool preVisit, TIntermUnary *U, TIntermTraverser *T) {
return static_cast<traverse_wrap *> (T)->Unary (preVisit, *U);
}
static bool _visitSelection (bool preVisit, TIntermSelection *S, TIntermTraverser *T) {
return static_cast<traverse_wrap *> (T)->Selection (preVisit, *S);
}
static bool _visitAggregate (bool preVisit, TIntermAggregate *A, TIntermTraverser *T) {
return static_cast<traverse_wrap *> (T)->Aggregate (preVisit, *A);
}
static bool _visitLoop (bool preVisit, TIntermLoop *L, TIntermTraverser *T) {
return static_cast<traverse_wrap *> (T)->Loop (preVisit, *L);
}
static bool _visitBranch (bool preVisit, TIntermBranch *B, TIntermTraverser *T) {
return static_cast<traverse_wrap *> (T)->Branch (preVisit, *B);
}
public:
traverse_wrap () {
visitSymbol = _visitSymbol;
visitConstantUnion = _visitConstantUnion;
visitBinary = _visitBinary;
visitUnary = _visitUnary;
visitSelection = _visitSelection;
visitAggregate = _visitAggregate;
visitLoop = _visitLoop;
visitBranch = _visitBranch;
}
protected:
virtual void Symbol (const TIntermSymbol &) {
}
virtual void ConstantUnion (const TIntermConstantUnion &) {
}
virtual bool Binary (bool, const TIntermBinary &) {
return true;
}
virtual bool Unary (bool, const TIntermUnary &) {
return true;
}
virtual bool Selection (bool, const TIntermSelection &) {
return true;
}
virtual bool Aggregate (bool, const TIntermAggregate &) {
return true;
}
virtual bool Loop (bool, const TIntermLoop &) {
return true;
}
virtual bool Branch (bool, const TIntermBranch &) {
return true;
}
};
#endif
/*
* Mesa 3-D graphics library
* Version: 6.3
*
* Copyright (C) 2005 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
* AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
/**
* \file traverse_wrap.h
* Handy TIntermTraverser class wrapper
* \author Michal Krol
*/
#ifndef __TRAVERSE_WRAP_H__
#define __TRAVERSE_WRAP_H__
#include "Include/intermediate.h"
/*
The original TIntermTraverser class that is used to walk the intermediate tree,
is not very elegant in its design. One must define static functions with
appropriate prototypes, construct TIntermTraverser object, and set its member
function pointers to one's static functions. If traversal-specific data
is needed, a new class must be derived, and one must up-cast the object
passed as a parameter to the static function.
The class below eliminates this burden by providing virtual methods that are
to be overridden in the derived class.
*/
class traverse_wrap: private TIntermTraverser
{
private:
static void _visitSymbol (TIntermSymbol *S, TIntermTraverser *T) {
static_cast<traverse_wrap *> (T)->Symbol (*S);
}
static void _visitConstantUnion (TIntermConstantUnion *U, TIntermTraverser *T) {
static_cast<traverse_wrap *> (T)->ConstantUnion (*U);
}
static bool _visitBinary (bool preVisit, TIntermBinary *B, TIntermTraverser *T) {
return static_cast<traverse_wrap *> (T)->Binary (preVisit, *B);
}
static bool _visitUnary (bool preVisit, TIntermUnary *U, TIntermTraverser *T) {
return static_cast<traverse_wrap *> (T)->Unary (preVisit, *U);
}
static bool _visitSelection (bool preVisit, TIntermSelection *S, TIntermTraverser *T) {
return static_cast<traverse_wrap *> (T)->Selection (preVisit, *S);
}
static bool _visitAggregate (bool preVisit, TIntermAggregate *A, TIntermTraverser *T) {
return static_cast<traverse_wrap *> (T)->Aggregate (preVisit, *A);
}
static bool _visitLoop (bool preVisit, TIntermLoop *L, TIntermTraverser *T) {
return static_cast<traverse_wrap *> (T)->Loop (preVisit, *L);
}
static bool _visitBranch (bool preVisit, TIntermBranch *B, TIntermTraverser *T) {
return static_cast<traverse_wrap *> (T)->Branch (preVisit, *B);
}
public:
traverse_wrap () {
visitSymbol = _visitSymbol;
visitConstantUnion = _visitConstantUnion;
visitBinary = _visitBinary;
visitUnary = _visitUnary;
visitSelection = _visitSelection;
visitAggregate = _visitAggregate;
visitLoop = _visitLoop;
visitBranch = _visitBranch;
}
protected:
virtual void Symbol (const TIntermSymbol &) {
}
virtual void ConstantUnion (const TIntermConstantUnion &) {
}
virtual bool Binary (bool, const TIntermBinary &) {
return true;
}
virtual bool Unary (bool, const TIntermUnary &) {
return true;
}
virtual bool Selection (bool, const TIntermSelection &) {
return true;
}
virtual bool Aggregate (bool, const TIntermAggregate &) {
return true;
}
virtual bool Loop (bool, const TIntermLoop &) {
return true;
}
virtual bool Branch (bool, const TIntermBranch &) {
return true;
}
};
#endif
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment