From cdacca4868bbfe2e39f72d524556e7b2c7200ba5 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Sun, 31 Oct 2010 10:51:59 -0700 Subject: [PATCH] mesa: Move texenvprogram.c to ff_fragment_shader.cpp. This file is about to change to generating a shader program instead of a fragment program. --- src/mesa/main/{texenvprogram.c => ff_fragment_shader.cpp} | 13 +++++++++---- src/mesa/sources.mak | 10 +++++++--- 2 files changed, 16 insertions(+), 7 deletions(-) rename src/mesa/main/{texenvprogram.c => ff_fragment_shader.cpp} (99%) diff --git a/src/mesa/main/texenvprogram.c b/src/mesa/main/ff_fragment_shader.cpp similarity index 99% rename from src/mesa/main/texenvprogram.c rename to src/mesa/main/ff_fragment_shader.cpp index c1380f2a645..9be531735ed 100644 --- a/src/mesa/main/texenvprogram.c +++ b/src/mesa/main/ff_fragment_shader.cpp @@ -26,6 +26,7 @@ * **************************************************************************/ +extern "C" { #include "glheader.h" #include "imports.h" #include "mtypes.h" @@ -37,7 +38,7 @@ #include "program/prog_statevars.h" #include "program/programopt.h" #include "texenvprogram.h" - +} /* * Note on texture units: @@ -524,7 +525,7 @@ struct ureg { static const struct ureg undef = { PROGRAM_UNDEFINED, - ~0, + 255, 0, 0, 0 @@ -686,14 +687,15 @@ static struct ureg register_param5( struct texenv_fragment_program *p, GLint s3, GLint s4) { - gl_state_index tokens[STATE_LENGTH]; + int tokens[STATE_LENGTH]; GLuint idx; tokens[0] = s0; tokens[1] = s1; tokens[2] = s2; tokens[3] = s3; tokens[4] = s4; - idx = _mesa_add_state_reference( p->program->Base.Parameters, tokens ); + idx = _mesa_add_state_reference(p->program->Base.Parameters, + (gl_state_index *)tokens); return make_ureg(PROGRAM_STATE_VAR, idx); } @@ -1586,6 +1588,7 @@ create_new_program(struct gl_context *ctx, struct state_key *key, } } +extern "C" { /** * Return a fragment program which implements the current @@ -1616,3 +1619,5 @@ _mesa_get_fixed_func_fragment_program(struct gl_context *ctx) return prog; } + +} diff --git a/src/mesa/sources.mak b/src/mesa/sources.mak index 95330947a83..21e08ed5f36 100644 --- a/src/mesa/sources.mak +++ b/src/mesa/sources.mak @@ -83,7 +83,6 @@ MAIN_SOURCES = \ main/texcompress_s3tc.c \ main/texcompress_fxt1.c \ main/texenv.c \ - main/texenvprogram.c \ main/texfetch.c \ main/texformat.c \ main/texgen.c \ @@ -103,6 +102,9 @@ MAIN_SOURCES = \ main/vtxfmt.c \ $(MAIN_ES_SOURCES) +MAIN_CXX_SOURCES = \ + main/ff_fragment_shader.cpp + MATH_SOURCES = \ math/m_debug_clip.c \ math/m_debug_norm.c \ @@ -316,7 +318,8 @@ MESA_SOURCES = \ $(ASM_C_SOURCES) MESA_CXX_SOURCES = \ - $(SHADER_CXX_SOURCES) + $(MAIN_CXX_SOURCES) \ + $(SHADER_CXX_SOURCES) # Sources for building Gallium drivers MESA_GALLIUM_SOURCES = \ @@ -329,7 +332,8 @@ MESA_GALLIUM_SOURCES = \ x86/common_x86.c MESA_GALLIUM_CXX_SOURCES = \ - $(SHADER_CXX_SOURCES) + $(MAIN_CXX_SOURCES) \ + $(SHADER_CXX_SOURCES) # All the core C sources, for dependency checking ALL_SOURCES = \ -- 2.11.0