summaryrefslogtreecommitdiffstats
path: root/src/mesa/program
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/program')
-rw-r--r--src/mesa/program/arbprogparse.c4
-rw-r--r--src/mesa/program/prog_cache.c16
-rw-r--r--src/mesa/program/prog_instruction.c3
-rw-r--r--src/mesa/program/prog_noise.c2
-rw-r--r--src/mesa/program/prog_parameter.c1
-rw-r--r--src/mesa/program/prog_parameter.h2
-rw-r--r--src/mesa/program/prog_parameter_layout.c6
-rw-r--r--src/mesa/program/prog_print.c9
-rw-r--r--src/mesa/program/prog_statevars.c12
-rw-r--r--src/mesa/program/prog_to_nir.c2
-rw-r--r--src/mesa/program/program_lexer.l4
-rw-r--r--src/mesa/program/program_parse.y28
-rw-r--r--src/mesa/program/symbol_table.c6
13 files changed, 49 insertions, 46 deletions
diff --git a/src/mesa/program/arbprogparse.c b/src/mesa/program/arbprogparse.c
index 7216f9fdcce..42f84944a1e 100644
--- a/src/mesa/program/arbprogparse.c
+++ b/src/mesa/program/arbprogparse.c
@@ -52,7 +52,7 @@ having three separate program parameter arrays.
#include "main/glheader.h"
-#include "util/imports.h"
+
#include "main/context.h"
#include "main/mtypes.h"
#include "arbprogparse.h"
@@ -183,7 +183,7 @@ _mesa_parse_arb_vertex_program(struct gl_context *ctx, GLenum target,
ralloc_free(program->String);
- /* Copy the relevant contents of the arb_program struct into the
+ /* Copy the relevant contents of the arb_program struct into the
* vertex_program struct.
*/
program->String = prog.String;
diff --git a/src/mesa/program/prog_cache.c b/src/mesa/program/prog_cache.c
index d1cfc27837b..aee61f90f47 100644
--- a/src/mesa/program/prog_cache.c
+++ b/src/mesa/program/prog_cache.c
@@ -1,8 +1,8 @@
/**************************************************************************
- *
+ *
* Copyright 2003 VMware, Inc.
* 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
@@ -10,11 +10,11 @@
* distribute, sub license, 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 (including the
* next paragraph) 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 NON-INFRINGEMENT.
@@ -22,13 +22,13 @@
* 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.
- *
+ *
**************************************************************************/
#include "main/glheader.h"
#include "main/mtypes.h"
-#include "util/imports.h"
+
#include "main/shaderobj.h"
#include "program/prog_cache.h"
#include "program/program.h"
@@ -112,7 +112,7 @@ clear_cache(struct gl_context *ctx, struct gl_program_cache *cache,
{
struct cache_item *c, *next;
GLuint i;
-
+
cache->last = NULL;
for (i = 0; i < cache->size; i++) {
@@ -220,7 +220,7 @@ _mesa_program_cache_insert(struct gl_context *ctx,
if (cache->n_items > cache->size * 1.5) {
if (cache->size < 1000)
rehash(cache);
- else
+ else
clear_cache(ctx, cache, GL_FALSE);
}
diff --git a/src/mesa/program/prog_instruction.c b/src/mesa/program/prog_instruction.c
index 7a2407048aa..3bbb23a41fc 100644
--- a/src/mesa/program/prog_instruction.c
+++ b/src/mesa/program/prog_instruction.c
@@ -25,8 +25,9 @@
#include <stdio.h>
+#include <assert.h>
+
#include "main/glheader.h"
-#include "util/imports.h"
#include "prog_instruction.h"
#include "prog_parameter.h"
diff --git a/src/mesa/program/prog_noise.c b/src/mesa/program/prog_noise.c
index 75a22d8b991..e42b5ba739f 100644
--- a/src/mesa/program/prog_noise.c
+++ b/src/mesa/program/prog_noise.c
@@ -49,7 +49,7 @@
*/
-#include "util/imports.h"
+
#include "prog_noise.h"
#define FASTFLOOR(x) ( ((x)>0) ? ((int)x) : (((int)x)-1) )
diff --git a/src/mesa/program/prog_parameter.c b/src/mesa/program/prog_parameter.c
index b674472b4fd..ed3b6d34dc9 100644
--- a/src/mesa/program/prog_parameter.c
+++ b/src/mesa/program/prog_parameter.c
@@ -28,7 +28,6 @@
* \author Brian Paul
*/
-
#include "main/glheader.h"
#include "main/macros.h"
#include "util/u_memory.h"
diff --git a/src/mesa/program/prog_parameter.h b/src/mesa/program/prog_parameter.h
index c91156f623c..1fb0c5b7d1f 100644
--- a/src/mesa/program/prog_parameter.h
+++ b/src/mesa/program/prog_parameter.h
@@ -31,6 +31,8 @@
#ifndef PROG_PARAMETER_H
#define PROG_PARAMETER_H
+#include <stdbool.h>
+#include <stdint.h>
#include "prog_statevars.h"
#include <string.h>
diff --git a/src/mesa/program/prog_parameter_layout.c b/src/mesa/program/prog_parameter_layout.c
index a254dc072af..4fca765e419 100644
--- a/src/mesa/program/prog_parameter_layout.c
+++ b/src/mesa/program/prog_parameter_layout.c
@@ -28,7 +28,7 @@
* \author Ian Romanick <[email protected]>
*/
-#include "util/imports.h"
+
#include "main/mtypes.h"
#include "prog_parameter.h"
#include "prog_parameter_layout.h"
@@ -82,7 +82,7 @@ copy_indirect_accessed_array(struct gl_program_parameter_list *src,
j = dst->NumParameters;
} else {
for (j = 0; j < dst->NumParameters; j++) {
- if (memcmp(dst->Parameters[j].StateIndexes, curr->StateIndexes,
+ if (memcmp(dst->Parameters[j].StateIndexes, curr->StateIndexes,
sizeof(curr->StateIndexes)) == 0) {
return -1;
}
@@ -200,7 +200,7 @@ _mesa_layout_parameters(struct asm_parser_state *state)
inst->Base.SrcReg[i].Index =
_mesa_add_unnamed_constant(layout, v, p->Size, & swizzle);
- inst->Base.SrcReg[i].Swizzle =
+ inst->Base.SrcReg[i].Swizzle =
_mesa_combine_swizzles(swizzle, inst->Base.SrcReg[i].Swizzle);
break;
}
diff --git a/src/mesa/program/prog_print.c b/src/mesa/program/prog_print.c
index 0b280828341..7e043302da2 100644
--- a/src/mesa/program/prog_print.c
+++ b/src/mesa/program/prog_print.c
@@ -33,11 +33,12 @@
#include "main/glheader.h"
#include "main/context.h"
-#include "util/imports.h"
+
#include "prog_instruction.h"
#include "prog_parameter.h"
#include "prog_print.h"
#include "prog_statevars.h"
+#include "util/bitscan.h"
@@ -535,7 +536,7 @@ fprint_dst_reg(FILE * f,
reg_string((gl_register_file) dstReg->File,
dstReg->Index, mode, dstReg->RelAddr, prog),
_mesa_writemask_string(dstReg->WriteMask));
-
+
#if 0
fprintf(f, "%s[%d]%s",
_mesa_register_file_name((gl_register_file) dstReg->File),
@@ -547,7 +548,7 @@ fprint_dst_reg(FILE * f,
static void
fprint_src_reg(FILE *f,
- const struct prog_src_register *srcReg,
+ const struct prog_src_register *srcReg,
gl_prog_print_mode mode,
const struct gl_program *prog)
{
@@ -901,7 +902,7 @@ _mesa_fprint_program_parameters(FILE *f,
const GLfloat *p = prog->LocalParams[i];
fprintf(f, "%2d: %f, %f, %f, %f\n", i, p[0], p[1], p[2], p[3]);
}
-#endif
+#endif
_mesa_print_parameter_list(prog->Parameters);
}
diff --git a/src/mesa/program/prog_statevars.c b/src/mesa/program/prog_statevars.c
index 06da12074cb..225acd853a0 100644
--- a/src/mesa/program/prog_statevars.c
+++ b/src/mesa/program/prog_statevars.c
@@ -33,7 +33,7 @@
#include "main/glheader.h"
#include "main/context.h"
#include "main/blend.h"
-#include "util/imports.h"
+
#include "main/macros.h"
#include "main/mtypes.h"
#include "main/fbobject.h"
@@ -451,10 +451,10 @@ _mesa_fetch_state(struct gl_context *ctx, const gl_state_index16 state[],
return;
case STATE_NORMAL_SCALE:
- ASSIGN_4V(value,
- ctx->_ModelViewInvScale,
- ctx->_ModelViewInvScale,
- ctx->_ModelViewInvScale,
+ ASSIGN_4V(value,
+ ctx->_ModelViewInvScale,
+ ctx->_ModelViewInvScale,
+ ctx->_ModelViewInvScale,
1);
return;
@@ -613,7 +613,7 @@ _mesa_fetch_state(struct gl_context *ctx, const gl_state_index16 state[],
}
return;
- /* XXX: make sure new tokens added here are also handled in the
+ /* XXX: make sure new tokens added here are also handled in the
* _mesa_program_state_flags() switch, below.
*/
default:
diff --git a/src/mesa/program/prog_to_nir.c b/src/mesa/program/prog_to_nir.c
index c0c9ba66544..31ad0cb58c5 100644
--- a/src/mesa/program/prog_to_nir.c
+++ b/src/mesa/program/prog_to_nir.c
@@ -26,7 +26,7 @@
#include "compiler/nir/nir.h"
#include "compiler/nir/nir_builder.h"
#include "compiler/glsl/list.h"
-#include "util/imports.h"
+
#include "main/mtypes.h"
#include "util/ralloc.h"
diff --git a/src/mesa/program/program_lexer.l b/src/mesa/program/program_lexer.l
index 2c2a66812c7..6c3099f88d7 100644
--- a/src/mesa/program/program_lexer.l
+++ b/src/mesa/program/program_lexer.l
@@ -27,7 +27,7 @@
#endif
#include "main/glheader.h"
-#include "util/imports.h"
+
#include "program/prog_instruction.h"
#include "program/prog_statevars.h"
#include "program/symbol_table.h"
@@ -379,7 +379,7 @@ ARRAYSHADOW2D { return_token_or_IDENTIFIER(require_ARB_fp && require
const unsigned s = swiz_from_char(yytext[1]);
yylval->swiz_mask.swizzle = MAKE_SWIZZLE4(s, s, s, s);
yylval->swiz_mask.mask = mask_from_char(yytext[1]);
- return MASK1;
+ return MASK1;
}
"."[xyzw]{4} {
diff --git a/src/mesa/program/program_parse.y b/src/mesa/program/program_parse.y
index 53489410253..577537dd7ab 100644
--- a/src/mesa/program/program_parse.y
+++ b/src/mesa/program/program_parse.y
@@ -29,7 +29,7 @@
#include "main/errors.h"
#include "main/mtypes.h"
-#include "util/imports.h"
+
#include "program/program.h"
#include "program/prog_parameter.h"
#include "program/prog_parameter_layout.h"
@@ -188,7 +188,7 @@ static struct asm_instruction *asm_instruction_copy_ctor(
%token TEXCOORD TEXENV TEXGEN TEXGEN_Q TEXGEN_R TEXGEN_S TEXGEN_T TEXTURE TRANSPOSE
%token TEXTURE_UNIT TEX_1D TEX_2D TEX_3D TEX_CUBE TEX_RECT
%token TEX_SHADOW1D TEX_SHADOW2D TEX_SHADOWRECT
-%token TEX_ARRAY1D TEX_ARRAY2D TEX_ARRAYSHADOW1D TEX_ARRAYSHADOW2D
+%token TEX_ARRAY1D TEX_ARRAY2D TEX_ARRAYSHADOW1D TEX_ARRAYSHADOW2D
%token VERTEX VTXATTRIB
%token <string> IDENTIFIER USED_IDENTIFIER
@@ -250,7 +250,7 @@ static struct asm_instruction *asm_instruction_copy_ctor(
%type <integer> statePointProperty
%type <integer> stateOptMatModifier stateMatModifier stateMatrixRowNum
-%type <integer> stateOptModMatNum stateModMatNum statePaletteMatNum
+%type <integer> stateOptModMatNum stateModMatNum statePaletteMatNum
%type <integer> stateProgramMatNum
%type <integer> ambDiffSpecProperty
@@ -800,7 +800,7 @@ srcReg: USED_IDENTIFIER /* temporaryReg | progParamSingle */
}
| paramSingleItemUse
{
- gl_register_file file = ($1.name != NULL)
+ gl_register_file file = ($1.name != NULL)
? $1.param_binding_type
: PROGRAM_CONSTANT;
set_src_reg_swz(& $$, file, $1.param_binding_begin,
@@ -965,7 +965,7 @@ swizzleSuffix: MASK1
| { $$.swizzle = SWIZZLE_NOOP; $$.mask = WRITEMASK_XYZW; }
;
-optionalMask: MASK4 | MASK3 | MASK2 | MASK1
+optionalMask: MASK4 | MASK3 | MASK2 | MASK1
| { $$.swizzle = SWIZZLE_NOOP; $$.mask = WRITEMASK_XYZW; }
;
@@ -1092,7 +1092,7 @@ PARAM_multipleStmt: PARAM IDENTIFIER '[' optArraySize ']' paramMultipleInit
{
if (($4 != 0) && ((unsigned) $4 != $6.param_binding_length)) {
free($2);
- yyerror(& @4, state,
+ yyerror(& @4, state,
"parameter array size and number of bindings must match");
YYERROR;
} else {
@@ -1505,7 +1505,7 @@ stateMatrixItem: MATRIX stateMatrixName stateOptMatModifier
}
;
-stateOptMatModifier:
+stateOptMatModifier:
{
$$ = 0;
}
@@ -1515,11 +1515,11 @@ stateOptMatModifier:
}
;
-stateMatModifier: INVERSE
+stateMatModifier: INVERSE
{
$$ = STATE_MATRIX_INVERSE;
}
- | TRANSPOSE
+ | TRANSPOSE
{
$$ = STATE_MATRIX_TRANSPOSE;
}
@@ -1946,7 +1946,7 @@ optResultFaceType:
optResultColorType:
{
- $$ = 0;
+ $$ = 0;
}
| PRIMARY
{
@@ -2323,7 +2323,7 @@ int add_state_reference(struct gl_program_parameter_list *param_list,
int
initialize_symbol_from_state(struct gl_program *prog,
- struct asm_symbol *param_var,
+ struct asm_symbol *param_var,
const gl_state_index16 tokens[STATE_LENGTH])
{
int idx = -1;
@@ -2375,7 +2375,7 @@ initialize_symbol_from_state(struct gl_program *prog,
int
initialize_symbol_from_param(struct gl_program *prog,
- struct asm_symbol *param_var,
+ struct asm_symbol *param_var,
const gl_state_index16 tokens[STATE_LENGTH])
{
int idx = -1;
@@ -2440,7 +2440,7 @@ initialize_symbol_from_param(struct gl_program *prog,
*/
int
initialize_symbol_from_const(struct gl_program *prog,
- struct asm_symbol *param_var,
+ struct asm_symbol *param_var,
const struct asm_vector *vec,
GLboolean allowSwizzle)
{
@@ -2585,7 +2585,7 @@ _mesa_parse_arb_program(struct gl_context *ctx, GLenum target, const GLubyte *st
}
-
+
/* Add one instruction to store the "END" instruction.
*/
state->prog->arb.Instructions =
diff --git a/src/mesa/program/symbol_table.c b/src/mesa/program/symbol_table.c
index dcb32895828..f86588b76bd 100644
--- a/src/mesa/program/symbol_table.c
+++ b/src/mesa/program/symbol_table.c
@@ -21,10 +21,10 @@
* DEALINGS IN THE SOFTWARE.
*/
-#include "util/imports.h"
+
#include "main/errors.h"
#include "symbol_table.h"
-#include "../../util/hash_table.h"
+#include "util/hash_table.h"
#include "util/u_string.h"
struct symbol {
@@ -63,7 +63,7 @@ struct symbol {
struct scope_level {
/** Link to next (inner) scope level. */
struct scope_level *next;
-
+
/** Linked list of symbols with the same scope. */
struct symbol *symbols;
};