From 9ba4311e71f510797e1b446ab7dc6b6d4dc55dd5 Mon Sep 17 00:00:00 2001 From: Brian Date: Thu, 16 Aug 2007 17:30:38 -0600 Subject: check for null swrast (pipe work-around) --- src/mesa/swrast/s_context.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/mesa/swrast/s_context.c') diff --git a/src/mesa/swrast/s_context.c b/src/mesa/swrast/s_context.c index 3956925651..f43fa61f8a 100644 --- a/src/mesa/swrast/s_context.c +++ b/src/mesa/swrast/s_context.c @@ -524,6 +524,9 @@ _swrast_update_texture_samplers(GLcontext *ctx) SWcontext *swrast = SWRAST_CONTEXT(ctx); GLuint u; + if (!swrast) + return; /* pipe hack */ + for (u = 0; u < ctx->Const.MaxTextureImageUnits; u++) { const struct gl_texture_object *tObj = ctx->Texture.Unit[u]._Current; /* Note: If tObj is NULL, the sample function will be a simple -- cgit v1.2.3 From 101d1a658a614d1e2ec02b1e697f6161291af653 Mon Sep 17 00:00:00 2001 From: José Fonseca Date: Wed, 23 Jul 2008 21:06:01 +0900 Subject: mesa: Prefix main includes with dir to avoid conflicts. Some of the headers in src/mesa/main have pretty common names which easily conflict with third-party code, e.g. config.h --- src/mesa/SConscript | 1 - src/mesa/glapi/glapi.c | 2 +- src/mesa/glapi/glapi_getproc.c | 2 +- src/mesa/glapi/glthread.c | 2 +- src/mesa/math/m_debug_clip.c | 8 ++++---- src/mesa/math/m_debug_norm.c | 8 ++++---- src/mesa/math/m_debug_xform.c | 8 ++++---- src/mesa/math/m_matrix.c | 8 ++++---- src/mesa/math/m_translate.c | 6 +++--- src/mesa/math/m_vector.c | 8 ++++---- src/mesa/math/m_xform.h | 4 ++-- src/mesa/shader/arbprogparse.c | 6 +++--- src/mesa/shader/arbprogparse.h | 2 +- src/mesa/shader/arbprogram.c | 12 ++++++------ src/mesa/shader/atifragshader.c | 14 +++++++------- src/mesa/shader/grammar/grammar_mesa.h | 2 +- src/mesa/shader/nvfragparse.c | 8 ++++---- src/mesa/shader/nvprogram.c | 10 +++++----- src/mesa/shader/nvvertparse.c | 8 ++++---- src/mesa/shader/prog_debug.c | 6 +++--- src/mesa/shader/prog_execute.c | 6 +++--- src/mesa/shader/prog_instruction.c | 6 +++--- src/mesa/shader/prog_parameter.c | 6 +++--- src/mesa/shader/prog_parameter.h | 2 +- src/mesa/shader/prog_print.c | 6 +++--- src/mesa/shader/prog_statevars.c | 12 ++++++------ src/mesa/shader/prog_statevars.h | 2 +- src/mesa/shader/program.c | 6 +++--- src/mesa/shader/program.h | 2 +- src/mesa/shader/programopt.c | 4 ++-- src/mesa/shader/shader_api.c | 8 ++++---- src/mesa/shader/shader_api.h | 4 ++-- src/mesa/shader/slang/slang_codegen.h | 2 +- src/mesa/shader/slang/slang_compile.h | 4 ++-- src/mesa/shader/slang/slang_compile_function.c | 2 +- src/mesa/shader/slang/slang_compile_operation.c | 2 +- src/mesa/shader/slang/slang_compile_struct.c | 2 +- src/mesa/shader/slang/slang_compile_variable.c | 2 +- src/mesa/shader/slang/slang_emit.h | 4 ++-- src/mesa/shader/slang/slang_ir.c | 4 ++-- src/mesa/shader/slang/slang_ir.h | 4 ++-- src/mesa/shader/slang/slang_library_noise.c | 2 +- src/mesa/shader/slang/slang_log.c | 2 +- src/mesa/shader/slang/slang_mem.c | 4 ++-- src/mesa/shader/slang/slang_mem.h | 2 +- src/mesa/shader/slang/slang_preprocess.c | 2 +- src/mesa/shader/slang/slang_print.c | 2 +- src/mesa/shader/slang/slang_simplify.c | 6 +++--- src/mesa/shader/slang/slang_storage.c | 2 +- src/mesa/shader/slang/slang_typeinfo.h | 4 ++-- src/mesa/shader/slang/slang_utility.c | 2 +- src/mesa/sources | 1 - src/mesa/sparc/sparc.c | 2 +- src/mesa/state_tracker/st_atom.c | 4 ++-- src/mesa/state_tracker/st_atom_viewport.c | 4 ++-- src/mesa/state_tracker/st_mesa_to_tgsi.h | 2 +- src/mesa/state_tracker/st_texture.c | 2 +- src/mesa/swrast/s_aaline.c | 8 ++++---- src/mesa/swrast/s_aaline.h | 2 +- src/mesa/swrast/s_aatriangle.c | 12 ++++++------ src/mesa/swrast/s_aatriangle.h | 2 +- src/mesa/swrast/s_accum.c | 8 ++++---- src/mesa/swrast/s_accum.h | 2 +- src/mesa/swrast/s_alpha.c | 8 ++++---- src/mesa/swrast/s_alpha.h | 2 +- src/mesa/swrast/s_atifragshader.c | 8 ++++---- src/mesa/swrast/s_bitmap.c | 4 ++-- src/mesa/swrast/s_blend.c | 8 ++++---- src/mesa/swrast/s_blend.h | 2 +- src/mesa/swrast/s_blit.c | 4 ++-- src/mesa/swrast/s_buffers.c | 10 +++++----- src/mesa/swrast/s_context.c | 8 ++++---- src/mesa/swrast/s_copypix.c | 10 +++++----- src/mesa/swrast/s_depth.c | 8 ++++---- src/mesa/swrast/s_depth.h | 2 +- src/mesa/swrast/s_drawpix.c | 8 ++++---- src/mesa/swrast/s_drawpix.h | 2 +- src/mesa/swrast/s_feedback.c | 10 +++++----- src/mesa/swrast/s_feedback.h | 2 +- src/mesa/swrast/s_fog.c | 8 ++++---- src/mesa/swrast/s_fog.h | 2 +- src/mesa/swrast/s_lines.c | 8 ++++---- src/mesa/swrast/s_lines.h | 2 +- src/mesa/swrast/s_logic.c | 8 ++++---- src/mesa/swrast/s_logic.h | 2 +- src/mesa/swrast/s_masking.c | 4 ++-- src/mesa/swrast/s_masking.h | 2 +- src/mesa/swrast/s_points.c | 8 ++++---- src/mesa/swrast/s_points.h | 2 +- src/mesa/swrast/s_readpix.c | 10 +++++----- src/mesa/swrast/s_span.c | 10 +++++----- src/mesa/swrast/s_span.h | 2 +- src/mesa/swrast/s_spantemp.h | 2 +- src/mesa/swrast/s_stencil.c | 6 +++--- src/mesa/swrast/s_stencil.h | 2 +- src/mesa/swrast/s_texcombine.c | 10 +++++----- src/mesa/swrast/s_texcombine.h | 2 +- src/mesa/swrast/s_texfilter.c | 8 ++++---- src/mesa/swrast/s_texfilter.h | 2 +- src/mesa/swrast/s_texstore.c | 10 +++++----- src/mesa/swrast/s_triangle.c | 10 +++++----- src/mesa/swrast/s_triangle.h | 2 +- src/mesa/swrast/s_zoom.c | 8 ++++---- src/mesa/swrast/s_zoom.h | 2 +- src/mesa/swrast_setup/ss_context.c | 6 +++--- src/mesa/swrast_setup/ss_context.h | 2 +- src/mesa/swrast_setup/ss_triangle.c | 8 ++++---- src/mesa/swrast_setup/ss_triangle.h | 2 +- src/mesa/swrast_setup/ss_vb.h | 2 +- src/mesa/tnl/t_draw.c | 12 ++++++------ src/mesa/tnl/t_pipeline.h | 2 +- src/mesa/tnl/t_rasterpos.c | 10 +++++----- src/mesa/tnl/t_vb_cull.c | 12 ++++++------ src/mesa/tnl/t_vb_fog.c | 12 ++++++------ src/mesa/tnl/t_vb_light.c | 10 +++++----- src/mesa/tnl/t_vb_normals.c | 12 ++++++------ src/mesa/tnl/t_vb_points.c | 4 ++-- src/mesa/tnl/t_vb_program.c | 10 +++++----- src/mesa/tnl/t_vb_render.c | 12 ++++++------ src/mesa/tnl/t_vb_texgen.c | 12 ++++++------ src/mesa/tnl/t_vb_texmat.c | 12 ++++++------ src/mesa/tnl/t_vb_vertex.c | 12 ++++++------ src/mesa/tnl/t_vertex.c | 6 +++--- src/mesa/tnl/t_vertex.h | 2 +- src/mesa/tnl/t_vertex_generic.c | 6 +++--- src/mesa/tnl/t_vertex_sse.c | 8 ++++---- src/mesa/tnl/t_vp_build.c | 2 +- src/mesa/tnl/t_vp_build.h | 2 +- src/mesa/vf/vf.c | 6 +++--- src/mesa/vf/vf_generic.c | 8 ++++---- src/mesa/vf/vf_sse.c | 8 ++++---- src/mesa/x86-64/x86-64.c | 4 ++-- src/mesa/x86/3dnow.c | 4 ++-- src/mesa/x86/common_x86.c | 2 +- src/mesa/x86/rtasm/x86sse.c | 2 +- src/mesa/x86/sse.c | 4 ++-- src/mesa/x86/x86.c | 4 ++-- 137 files changed, 369 insertions(+), 371 deletions(-) (limited to 'src/mesa/swrast/s_context.c') diff --git a/src/mesa/SConscript b/src/mesa/SConscript index d2de189f69..2c74dc7dd0 100644 --- a/src/mesa/SConscript +++ b/src/mesa/SConscript @@ -10,7 +10,6 @@ if env['platform'] != 'winddk': env.Append(CPPPATH = [ '#/src/mesa', - '#/src/mesa/main', ]) if gcc: diff --git a/src/mesa/glapi/glapi.c b/src/mesa/glapi/glapi.c index c236656d9a..53efd7eef4 100644 --- a/src/mesa/glapi/glapi.c +++ b/src/mesa/glapi/glapi.c @@ -50,7 +50,7 @@ -#include "glheader.h" +#include "main/glheader.h" #include "glapi.h" #include "glapioffsets.h" #include "glapitable.h" diff --git a/src/mesa/glapi/glapi_getproc.c b/src/mesa/glapi/glapi_getproc.c index 3634444c85..6d40b495c7 100644 --- a/src/mesa/glapi/glapi_getproc.c +++ b/src/mesa/glapi/glapi_getproc.c @@ -32,7 +32,7 @@ #include #include -#include "glheader.h" +#include "main/glheader.h" #include "glapi.h" #include "glapioffsets.h" #include "glapitable.h" diff --git a/src/mesa/glapi/glthread.c b/src/mesa/glapi/glthread.c index 4513853f5a..09cc8cfcde 100644 --- a/src/mesa/glapi/glthread.c +++ b/src/mesa/glapi/glthread.c @@ -29,7 +29,7 @@ */ -#include "glheader.h" +#include "main/glheader.h" #include "glthread.h" diff --git a/src/mesa/math/m_debug_clip.c b/src/mesa/math/m_debug_clip.c index ab28818359..460fed4a75 100644 --- a/src/mesa/math/m_debug_clip.c +++ b/src/mesa/math/m_debug_clip.c @@ -25,10 +25,10 @@ * Gareth Hughes */ -#include "glheader.h" -#include "context.h" -#include "macros.h" -#include "imports.h" +#include "main/glheader.h" +#include "main/context.h" +#include "main/macros.h" +#include "main/imports.h" #include "m_matrix.h" #include "m_xform.h" diff --git a/src/mesa/math/m_debug_norm.c b/src/mesa/math/m_debug_norm.c index 11cae6bba7..89c632e7d5 100644 --- a/src/mesa/math/m_debug_norm.c +++ b/src/mesa/math/m_debug_norm.c @@ -26,10 +26,10 @@ * Gareth Hughes */ -#include "glheader.h" -#include "context.h" -#include "macros.h" -#include "imports.h" +#include "main/glheader.h" +#include "main/context.h" +#include "main/macros.h" +#include "main/imports.h" #include "m_matrix.h" #include "m_xform.h" diff --git a/src/mesa/math/m_debug_xform.c b/src/mesa/math/m_debug_xform.c index 0b07b4fd68..df8cc066b6 100644 --- a/src/mesa/math/m_debug_xform.c +++ b/src/mesa/math/m_debug_xform.c @@ -26,10 +26,10 @@ * Updated for P6 architecture by Gareth Hughes. */ -#include "glheader.h" -#include "context.h" -#include "macros.h" -#include "imports.h" +#include "main/glheader.h" +#include "main/context.h" +#include "main/macros.h" +#include "main/imports.h" #include "m_matrix.h" #include "m_xform.h" diff --git a/src/mesa/math/m_matrix.c b/src/mesa/math/m_matrix.c index b4ba1bc2a0..84b4cae4ad 100644 --- a/src/mesa/math/m_matrix.c +++ b/src/mesa/math/m_matrix.c @@ -34,10 +34,10 @@ */ -#include "glheader.h" -#include "imports.h" -#include "macros.h" -#include "imports.h" +#include "main/glheader.h" +#include "main/imports.h" +#include "main/macros.h" +#include "main/imports.h" #include "m_matrix.h" diff --git a/src/mesa/math/m_translate.c b/src/mesa/math/m_translate.c index c7423e9d9d..4a20f45ee4 100644 --- a/src/mesa/math/m_translate.c +++ b/src/mesa/math/m_translate.c @@ -28,9 +28,9 @@ */ -#include "glheader.h" -#include "mtypes.h" /* GLchan hack */ -#include "colormac.h" +#include "main/glheader.h" +#include "main/mtypes.h" /* GLchan hack */ +#include "main/colormac.h" #include "m_translate.h" diff --git a/src/mesa/math/m_vector.c b/src/mesa/math/m_vector.c index 3ad81d468b..c5e2fd1de1 100644 --- a/src/mesa/math/m_vector.c +++ b/src/mesa/math/m_vector.c @@ -28,10 +28,10 @@ */ -#include "glheader.h" -#include "imports.h" -#include "macros.h" -#include "imports.h" +#include "main/glheader.h" +#include "main/imports.h" +#include "main/macros.h" +#include "main/imports.h" #include "m_vector.h" diff --git a/src/mesa/math/m_xform.h b/src/mesa/math/m_xform.h index 99b071a46b..d1b974f043 100644 --- a/src/mesa/math/m_xform.h +++ b/src/mesa/math/m_xform.h @@ -27,8 +27,8 @@ #define _M_XFORM_H -#include "glheader.h" -#include "config.h" +#include "main/glheader.h" +#include "main/config.h" #include "math/m_vector.h" #include "math/m_matrix.h" diff --git a/src/mesa/shader/arbprogparse.c b/src/mesa/shader/arbprogparse.c index ff583352ce..78cc6aa9cc 100644 --- a/src/mesa/shader/arbprogparse.c +++ b/src/mesa/shader/arbprogparse.c @@ -38,9 +38,9 @@ #include "programopt.h" #include "prog_parameter.h" #include "prog_statevars.h" -#include "context.h" -#include "macros.h" -#include "mtypes.h" +#include "main/context.h" +#include "main/macros.h" +#include "main/mtypes.h" #include "prog_instruction.h" diff --git a/src/mesa/shader/arbprogparse.h b/src/mesa/shader/arbprogparse.h index 4574e5cd55..980d39fb9f 100644 --- a/src/mesa/shader/arbprogparse.h +++ b/src/mesa/shader/arbprogparse.h @@ -26,7 +26,7 @@ #ifndef ARBPROGPARSE_H #define ARBPROGPARSE_H -#include "mtypes.h" +#include "main/mtypes.h" extern void _mesa_parse_arb_vertex_program(GLcontext *ctx, GLenum target, diff --git a/src/mesa/shader/arbprogram.c b/src/mesa/shader/arbprogram.c index 81c20a0150..beb5deea50 100644 --- a/src/mesa/shader/arbprogram.c +++ b/src/mesa/shader/arbprogram.c @@ -29,14 +29,14 @@ */ -#include "glheader.h" +#include "main/glheader.h" #include "arbprogram.h" #include "arbprogparse.h" -#include "context.h" -#include "hash.h" -#include "imports.h" -#include "macros.h" -#include "mtypes.h" +#include "main/context.h" +#include "main/hash.h" +#include "main/imports.h" +#include "main/macros.h" +#include "main/mtypes.h" #include "program.h" diff --git a/src/mesa/shader/atifragshader.c b/src/mesa/shader/atifragshader.c index 854c911874..ac087d415c 100644 --- a/src/mesa/shader/atifragshader.c +++ b/src/mesa/shader/atifragshader.c @@ -21,13 +21,13 @@ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -#include "glheader.h" -#include "context.h" -#include "hash.h" -#include "imports.h" -#include "macros.h" -#include "enums.h" -#include "mtypes.h" +#include "main/glheader.h" +#include "main/context.h" +#include "main/hash.h" +#include "main/imports.h" +#include "main/macros.h" +#include "main/enums.h" +#include "main/mtypes.h" #include "atifragshader.h" #define MESA_DEBUG_ATI_FS 0 diff --git a/src/mesa/shader/grammar/grammar_mesa.h b/src/mesa/shader/grammar/grammar_mesa.h index c14033a9d4..6c92c5812d 100644 --- a/src/mesa/shader/grammar/grammar_mesa.h +++ b/src/mesa/shader/grammar/grammar_mesa.h @@ -26,7 +26,7 @@ #define GRAMMAR_MESA_H -#include "imports.h" +#include "main/imports.h" /* NOTE: include Mesa 3-D specific headers here */ diff --git a/src/mesa/shader/nvfragparse.c b/src/mesa/shader/nvfragparse.c index 0f1a1eade4..a2a7a5f3f4 100644 --- a/src/mesa/shader/nvfragparse.c +++ b/src/mesa/shader/nvfragparse.c @@ -37,10 +37,10 @@ * including any use thereof or modifications thereto. */ -#include "glheader.h" -#include "context.h" -#include "imports.h" -#include "macros.h" +#include "main/glheader.h" +#include "main/context.h" +#include "main/imports.h" +#include "main/macros.h" #include "prog_parameter.h" #include "prog_instruction.h" #include "nvfragparse.h" diff --git a/src/mesa/shader/nvprogram.c b/src/mesa/shader/nvprogram.c index 409c61cdc1..d656d4b28b 100644 --- a/src/mesa/shader/nvprogram.c +++ b/src/mesa/shader/nvprogram.c @@ -37,11 +37,11 @@ * including any use thereof or modifications thereto. */ -#include "glheader.h" -#include "context.h" -#include "hash.h" -#include "imports.h" -#include "macros.h" +#include "main/glheader.h" +#include "main/context.h" +#include "main/hash.h" +#include "main/imports.h" +#include "main/macros.h" #include "prog_parameter.h" #include "prog_instruction.h" #include "nvfragparse.h" diff --git a/src/mesa/shader/nvvertparse.c b/src/mesa/shader/nvvertparse.c index ac96d4a60e..08538c0ee4 100644 --- a/src/mesa/shader/nvvertparse.c +++ b/src/mesa/shader/nvvertparse.c @@ -37,10 +37,10 @@ * including any use thereof or modifications thereto. */ -#include "glheader.h" -#include "context.h" -#include "imports.h" -#include "macros.h" +#include "main/glheader.h" +#include "main/context.h" +#include "main/imports.h" +#include "main/macros.h" #include "nvprogram.h" #include "nvvertparse.h" #include "prog_instruction.h" diff --git a/src/mesa/shader/prog_debug.c b/src/mesa/shader/prog_debug.c index 57929fcbca..7bcb2ef734 100644 --- a/src/mesa/shader/prog_debug.c +++ b/src/mesa/shader/prog_debug.c @@ -23,9 +23,9 @@ */ -#include "glheader.h" -#include "context.h" -#include "macros.h" +#include "main/glheader.h" +#include "main/context.h" +#include "main/macros.h" #include "nvfragparse.h" #include "nvvertparse.h" #include "program.h" diff --git a/src/mesa/shader/prog_execute.c b/src/mesa/shader/prog_execute.c index 4745211c65..5afd9eb153 100644 --- a/src/mesa/shader/prog_execute.c +++ b/src/mesa/shader/prog_execute.c @@ -35,9 +35,9 @@ */ -#include "glheader.h" -#include "colormac.h" -#include "context.h" +#include "main/glheader.h" +#include "main/colormac.h" +#include "main/context.h" #include "program.h" #include "prog_execute.h" #include "prog_instruction.h" diff --git a/src/mesa/shader/prog_instruction.c b/src/mesa/shader/prog_instruction.c index bea5d0551e..1033496d97 100644 --- a/src/mesa/shader/prog_instruction.c +++ b/src/mesa/shader/prog_instruction.c @@ -23,9 +23,9 @@ */ -#include "glheader.h" -#include "imports.h" -#include "mtypes.h" +#include "main/glheader.h" +#include "main/imports.h" +#include "main/mtypes.h" #include "prog_instruction.h" diff --git a/src/mesa/shader/prog_parameter.c b/src/mesa/shader/prog_parameter.c index d87e8f6e15..e0d2096b30 100644 --- a/src/mesa/shader/prog_parameter.c +++ b/src/mesa/shader/prog_parameter.c @@ -29,9 +29,9 @@ */ -#include "glheader.h" -#include "imports.h" -#include "macros.h" +#include "main/glheader.h" +#include "main/imports.h" +#include "main/macros.h" #include "prog_instruction.h" #include "prog_parameter.h" #include "prog_statevars.h" diff --git a/src/mesa/shader/prog_parameter.h b/src/mesa/shader/prog_parameter.h index dfb8c39ca4..ac5c629fab 100644 --- a/src/mesa/shader/prog_parameter.h +++ b/src/mesa/shader/prog_parameter.h @@ -31,7 +31,7 @@ #ifndef PROG_PARAMETER_H #define PROG_PARAMETER_H -#include "mtypes.h" +#include "main/mtypes.h" #include "prog_statevars.h" diff --git a/src/mesa/shader/prog_print.c b/src/mesa/shader/prog_print.c index 5368ab2187..10c5afec18 100644 --- a/src/mesa/shader/prog_print.c +++ b/src/mesa/shader/prog_print.c @@ -28,9 +28,9 @@ * \author Brian Paul */ -#include "glheader.h" -#include "context.h" -#include "imports.h" +#include "main/glheader.h" +#include "main/context.h" +#include "main/imports.h" #include "prog_instruction.h" #include "prog_parameter.h" #include "prog_print.h" diff --git a/src/mesa/shader/prog_statevars.c b/src/mesa/shader/prog_statevars.c index 81bb4122f2..819db25a00 100644 --- a/src/mesa/shader/prog_statevars.c +++ b/src/mesa/shader/prog_statevars.c @@ -29,12 +29,12 @@ */ -#include "glheader.h" -#include "context.h" -#include "hash.h" -#include "imports.h" -#include "macros.h" -#include "mtypes.h" +#include "main/glheader.h" +#include "main/context.h" +#include "main/hash.h" +#include "main/imports.h" +#include "main/macros.h" +#include "main/mtypes.h" #include "prog_statevars.h" #include "prog_parameter.h" diff --git a/src/mesa/shader/prog_statevars.h b/src/mesa/shader/prog_statevars.h index a515fda3aa..0a1c235828 100644 --- a/src/mesa/shader/prog_statevars.h +++ b/src/mesa/shader/prog_statevars.h @@ -25,7 +25,7 @@ #ifndef PROG_STATEVARS_H #define PROG_STATEVARS_H -#include "mtypes.h" +#include "main/mtypes.h" /** diff --git a/src/mesa/shader/program.c b/src/mesa/shader/program.c index 13d6df1ce6..02e23aaa3a 100644 --- a/src/mesa/shader/program.c +++ b/src/mesa/shader/program.c @@ -29,9 +29,9 @@ */ -#include "glheader.h" -#include "context.h" -#include "hash.h" +#include "main/glheader.h" +#include "main/context.h" +#include "main/hash.h" #include "program.h" #include "prog_cache.h" #include "prog_parameter.h" diff --git a/src/mesa/shader/program.h b/src/mesa/shader/program.h index 7484961364..f8bd63233e 100644 --- a/src/mesa/shader/program.h +++ b/src/mesa/shader/program.h @@ -40,7 +40,7 @@ #ifndef PROGRAM_H #define PROGRAM_H -#include "mtypes.h" +#include "main/mtypes.h" extern struct gl_program _mesa_DummyProgram; diff --git a/src/mesa/shader/programopt.c b/src/mesa/shader/programopt.c index f3511ba00e..d6a3231055 100644 --- a/src/mesa/shader/programopt.c +++ b/src/mesa/shader/programopt.c @@ -31,8 +31,8 @@ */ -#include "glheader.h" -#include "context.h" +#include "main/glheader.h" +#include "main/context.h" #include "prog_parameter.h" #include "prog_statevars.h" #include "program.h" diff --git a/src/mesa/shader/shader_api.c b/src/mesa/shader/shader_api.c index bd3745cfe6..b33dfd6663 100644 --- a/src/mesa/shader/shader_api.c +++ b/src/mesa/shader/shader_api.c @@ -35,10 +35,10 @@ */ -#include "glheader.h" -#include "context.h" -#include "hash.h" -#include "macros.h" +#include "main/glheader.h" +#include "main/context.h" +#include "main/hash.h" +#include "main/macros.h" #include "program.h" #include "prog_parameter.h" #include "prog_print.h" diff --git a/src/mesa/shader/shader_api.h b/src/mesa/shader/shader_api.h index 5521c585b5..e7f1266915 100644 --- a/src/mesa/shader/shader_api.h +++ b/src/mesa/shader/shader_api.h @@ -27,8 +27,8 @@ #define SHADER_API_H -#include "glheader.h" -#include "mtypes.h" +#include "main/glheader.h" +#include "main/mtypes.h" /** diff --git a/src/mesa/shader/slang/slang_codegen.h b/src/mesa/shader/slang/slang_codegen.h index 821d396162..ba7ca4c142 100644 --- a/src/mesa/shader/slang/slang_codegen.h +++ b/src/mesa/shader/slang/slang_codegen.h @@ -27,7 +27,7 @@ #define SLANG_CODEGEN_H -#include "imports.h" +#include "main/imports.h" #include "slang_compile.h" diff --git a/src/mesa/shader/slang/slang_compile.h b/src/mesa/shader/slang/slang_compile.h index 0f1f820d2e..35e468b44e 100644 --- a/src/mesa/shader/slang/slang_compile.h +++ b/src/mesa/shader/slang/slang_compile.h @@ -25,8 +25,8 @@ #if !defined SLANG_COMPILE_H #define SLANG_COMPILE_H -#include "imports.h" -#include "mtypes.h" +#include "main/imports.h" +#include "main/mtypes.h" #include "slang_typeinfo.h" #include "slang_compile_variable.h" #include "slang_compile_struct.h" diff --git a/src/mesa/shader/slang/slang_compile_function.c b/src/mesa/shader/slang/slang_compile_function.c index 80769b33ae..8405d7f778 100644 --- a/src/mesa/shader/slang/slang_compile_function.c +++ b/src/mesa/shader/slang/slang_compile_function.c @@ -28,7 +28,7 @@ * \author Michal Krol */ -#include "imports.h" +#include "main/imports.h" #include "slang_compile.h" #include "slang_mem.h" diff --git a/src/mesa/shader/slang/slang_compile_operation.c b/src/mesa/shader/slang/slang_compile_operation.c index 4d2fd5b666..c0d469c829 100644 --- a/src/mesa/shader/slang/slang_compile_operation.c +++ b/src/mesa/shader/slang/slang_compile_operation.c @@ -28,7 +28,7 @@ * \author Michal Krol */ -#include "imports.h" +#include "main/imports.h" #include "slang_compile.h" #include "slang_mem.h" diff --git a/src/mesa/shader/slang/slang_compile_struct.c b/src/mesa/shader/slang/slang_compile_struct.c index 96bdb1f491..e6c38730d7 100644 --- a/src/mesa/shader/slang/slang_compile_struct.c +++ b/src/mesa/shader/slang/slang_compile_struct.c @@ -28,7 +28,7 @@ * \author Michal Krol */ -#include "imports.h" +#include "main/imports.h" #include "slang_mem.h" #include "slang_compile.h" diff --git a/src/mesa/shader/slang/slang_compile_variable.c b/src/mesa/shader/slang/slang_compile_variable.c index d53255075f..b26c18e38d 100644 --- a/src/mesa/shader/slang/slang_compile_variable.c +++ b/src/mesa/shader/slang/slang_compile_variable.c @@ -28,7 +28,7 @@ * \author Michal Krol */ -#include "imports.h" +#include "main/imports.h" #include "slang_compile.h" #include "slang_mem.h" diff --git a/src/mesa/shader/slang/slang_emit.h b/src/mesa/shader/slang/slang_emit.h index 153e872d74..4db4bbe562 100644 --- a/src/mesa/shader/slang/slang_emit.h +++ b/src/mesa/shader/slang/slang_emit.h @@ -26,10 +26,10 @@ #define SLANG_EMIT_H -#include "imports.h" +#include "main/imports.h" #include "slang_compile.h" #include "slang_ir.h" -#include "mtypes.h" +#include "main/mtypes.h" extern void diff --git a/src/mesa/shader/slang/slang_ir.c b/src/mesa/shader/slang/slang_ir.c index a414036a36..23d554234e 100644 --- a/src/mesa/shader/slang/slang_ir.c +++ b/src/mesa/shader/slang/slang_ir.c @@ -23,8 +23,8 @@ */ -#include "imports.h" -#include "context.h" +#include "main/imports.h" +#include "main/context.h" #include "slang_ir.h" #include "slang_mem.h" #include "shader/prog_print.h" diff --git a/src/mesa/shader/slang/slang_ir.h b/src/mesa/shader/slang/slang_ir.h index 61ff649e5c..e4697ba3b4 100644 --- a/src/mesa/shader/slang/slang_ir.h +++ b/src/mesa/shader/slang/slang_ir.h @@ -33,10 +33,10 @@ #define SLANG_IR_H -#include "imports.h" +#include "main/imports.h" #include "slang_compile.h" #include "slang_label.h" -#include "mtypes.h" +#include "main/mtypes.h" /** diff --git a/src/mesa/shader/slang/slang_library_noise.c b/src/mesa/shader/slang/slang_library_noise.c index 46075c492c..25a05657cc 100644 --- a/src/mesa/shader/slang/slang_library_noise.c +++ b/src/mesa/shader/slang/slang_library_noise.c @@ -49,7 +49,7 @@ */ -#include "imports.h" +#include "main/imports.h" #include "slang_library_noise.h" #define FASTFLOOR(x) ( ((x)>0) ? ((int)x) : (((int)x)-1) ) diff --git a/src/mesa/shader/slang/slang_log.c b/src/mesa/shader/slang/slang_log.c index c963914fe3..01591ceba5 100644 --- a/src/mesa/shader/slang/slang_log.c +++ b/src/mesa/shader/slang/slang_log.c @@ -22,7 +22,7 @@ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -#include "imports.h" +#include "main/imports.h" #include "slang_log.h" #include "slang_utility.h" diff --git a/src/mesa/shader/slang/slang_mem.c b/src/mesa/shader/slang/slang_mem.c index e1d1e6ba14..21d6bfce88 100644 --- a/src/mesa/shader/slang/slang_mem.c +++ b/src/mesa/shader/slang/slang_mem.c @@ -32,8 +32,8 @@ * \author Brian Paul */ -#include "context.h" -#include "macros.h" +#include "main/context.h" +#include "main/macros.h" #include "slang_mem.h" diff --git a/src/mesa/shader/slang/slang_mem.h b/src/mesa/shader/slang/slang_mem.h index 49885b6c98..b5bfae2479 100644 --- a/src/mesa/shader/slang/slang_mem.h +++ b/src/mesa/shader/slang/slang_mem.h @@ -27,7 +27,7 @@ #define SLANG_MEM_H -#include "imports.h" +#include "main/imports.h" typedef struct slang_mempool_ slang_mempool; diff --git a/src/mesa/shader/slang/slang_preprocess.c b/src/mesa/shader/slang/slang_preprocess.c index d3f412c211..bfe29b6bc9 100644 --- a/src/mesa/shader/slang/slang_preprocess.c +++ b/src/mesa/shader/slang/slang_preprocess.c @@ -28,7 +28,7 @@ * \author Michal Krol */ -#include "imports.h" +#include "main/imports.h" #include "shader/grammar/grammar_mesa.h" #include "slang_preprocess.h" diff --git a/src/mesa/shader/slang/slang_print.c b/src/mesa/shader/slang/slang_print.c index f48762fb11..4422f70159 100644 --- a/src/mesa/shader/slang/slang_print.c +++ b/src/mesa/shader/slang/slang_print.c @@ -4,7 +4,7 @@ */ -#include "imports.h" +#include "main/imports.h" #include "slang_compile.h" #include "slang_print.h" diff --git a/src/mesa/shader/slang/slang_simplify.c b/src/mesa/shader/slang/slang_simplify.c index 9a4b6a88d1..d5997283a8 100644 --- a/src/mesa/shader/slang/slang_simplify.c +++ b/src/mesa/shader/slang/slang_simplify.c @@ -28,9 +28,9 @@ * \author Michal Krol */ -#include "imports.h" -#include "macros.h" -#include "get.h" +#include "main/imports.h" +#include "main/macros.h" +#include "main/get.h" #include "slang_compile.h" #include "slang_codegen.h" #include "slang_simplify.h" diff --git a/src/mesa/shader/slang/slang_storage.c b/src/mesa/shader/slang/slang_storage.c index bc32aa4b02..e8b0fb7747 100644 --- a/src/mesa/shader/slang/slang_storage.c +++ b/src/mesa/shader/slang/slang_storage.c @@ -28,7 +28,7 @@ * \author Michal Krol */ -#include "imports.h" +#include "main/imports.h" #include "slang_storage.h" #include "slang_mem.h" diff --git a/src/mesa/shader/slang/slang_typeinfo.h b/src/mesa/shader/slang/slang_typeinfo.h index 587331e8b1..8a36fc3422 100644 --- a/src/mesa/shader/slang/slang_typeinfo.h +++ b/src/mesa/shader/slang/slang_typeinfo.h @@ -25,8 +25,8 @@ #ifndef SLANG_TYPEINFO_H #define SLANG_TYPEINFO_H 1 -#include "imports.h" -#include "mtypes.h" +#include "main/imports.h" +#include "main/mtypes.h" #include "slang_log.h" #include "slang_utility.h" #include "slang_vartable.h" diff --git a/src/mesa/shader/slang/slang_utility.c b/src/mesa/shader/slang/slang_utility.c index 2a2dc8e54f..3631e32b3c 100644 --- a/src/mesa/shader/slang/slang_utility.c +++ b/src/mesa/shader/slang/slang_utility.c @@ -28,7 +28,7 @@ * \author Michal Krol */ -#include "imports.h" +#include "main/imports.h" #include "slang_utility.h" #include "slang_mem.h" diff --git a/src/mesa/sources b/src/mesa/sources index e6b050c3f2..0e0e10979b 100644 --- a/src/mesa/sources +++ b/src/mesa/sources @@ -342,7 +342,6 @@ COMMON_DRIVER_OBJECTS = $(COMMON_DRIVER_SOURCES:.c=.o) INCLUDE_DIRS = \ -I$(TOP)/include \ -I$(TOP)/src/mesa \ - -I$(TOP)/src/mesa/main \ -I$(TOP)/src/gallium/include \ -I$(TOP)/src/gallium/drivers \ -I$(TOP)/src/gallium/auxiliary diff --git a/src/mesa/sparc/sparc.c b/src/mesa/sparc/sparc.c index 1b77b0bb7b..84e8ac6723 100644 --- a/src/mesa/sparc/sparc.c +++ b/src/mesa/sparc/sparc.c @@ -31,7 +31,7 @@ #ifdef USE_SPARC_ASM -#include "context.h" +#include "main/context.h" #include "math/m_xform.h" #include "tnl/t_context.h" diff --git a/src/mesa/state_tracker/st_atom.c b/src/mesa/state_tracker/st_atom.c index ecfd117918..fc8587f459 100644 --- a/src/mesa/state_tracker/st_atom.c +++ b/src/mesa/state_tracker/st_atom.c @@ -26,8 +26,8 @@ **************************************************************************/ -#include "glheader.h" -#include "context.h" +#include "main/glheader.h" +#include "main/context.h" #include "pipe/p_defines.h" #include "st_context.h" diff --git a/src/mesa/state_tracker/st_atom_viewport.c b/src/mesa/state_tracker/st_atom_viewport.c index 8b9f1abda4..27ec2eb033 100644 --- a/src/mesa/state_tracker/st_atom_viewport.c +++ b/src/mesa/state_tracker/st_atom_viewport.c @@ -26,8 +26,8 @@ **************************************************************************/ -#include "context.h" -#include "colormac.h" +#include "main/context.h" +#include "main/colormac.h" #include "st_context.h" #include "st_atom.h" #include "pipe/p_context.h" diff --git a/src/mesa/state_tracker/st_mesa_to_tgsi.h b/src/mesa/state_tracker/st_mesa_to_tgsi.h index 63fc855b53..f17f2eac96 100644 --- a/src/mesa/state_tracker/st_mesa_to_tgsi.h +++ b/src/mesa/state_tracker/st_mesa_to_tgsi.h @@ -29,7 +29,7 @@ #ifndef ST_MESA_TO_TGSI_H #define ST_MESA_TO_TGSI_H -#include "mtypes.h" +#include "main/mtypes.h" #if defined __cplusplus diff --git a/src/mesa/state_tracker/st_texture.c b/src/mesa/state_tracker/st_texture.c index 3e5054ecd2..289b78b38b 100644 --- a/src/mesa/state_tracker/st_texture.c +++ b/src/mesa/state_tracker/st_texture.c @@ -28,7 +28,7 @@ #include "st_context.h" #include "st_format.h" #include "st_texture.h" -#include "enums.h" +#include "main/enums.h" #undef Elements /* fix re-defined macro warning */ diff --git a/src/mesa/swrast/s_aaline.c b/src/mesa/swrast/s_aaline.c index d6a9afb421..ee65a71d7e 100644 --- a/src/mesa/swrast/s_aaline.c +++ b/src/mesa/swrast/s_aaline.c @@ -23,14 +23,14 @@ */ -#include "glheader.h" -#include "imports.h" -#include "macros.h" +#include "main/glheader.h" +#include "main/imports.h" +#include "main/macros.h" #include "swrast/s_aaline.h" #include "swrast/s_context.h" #include "swrast/s_span.h" #include "swrast/swrast.h" -#include "mtypes.h" +#include "main/mtypes.h" #define SUB_PIXEL 4 diff --git a/src/mesa/swrast/s_aaline.h b/src/mesa/swrast/s_aaline.h index 41e7e5fd4d..9fb4959f91 100644 --- a/src/mesa/swrast/s_aaline.h +++ b/src/mesa/swrast/s_aaline.h @@ -28,7 +28,7 @@ #define S_AALINE_H -#include "mtypes.h" +#include "main/mtypes.h" #include "swrast.h" diff --git a/src/mesa/swrast/s_aatriangle.c b/src/mesa/swrast/s_aatriangle.c index 66891f9fec..078f16aea0 100644 --- a/src/mesa/swrast/s_aatriangle.c +++ b/src/mesa/swrast/s_aatriangle.c @@ -28,12 +28,12 @@ */ -#include "glheader.h" -#include "context.h" -#include "colormac.h" -#include "context.h" -#include "macros.h" -#include "imports.h" +#include "main/glheader.h" +#include "main/context.h" +#include "main/colormac.h" +#include "main/context.h" +#include "main/macros.h" +#include "main/imports.h" #include "s_aatriangle.h" #include "s_context.h" #include "s_span.h" diff --git a/src/mesa/swrast/s_aatriangle.h b/src/mesa/swrast/s_aatriangle.h index ebb828eb19..734d420b62 100644 --- a/src/mesa/swrast/s_aatriangle.h +++ b/src/mesa/swrast/s_aatriangle.h @@ -28,7 +28,7 @@ #define S_AATRIANGLE_H -#include "mtypes.h" +#include "main/mtypes.h" #include "swrast.h" diff --git a/src/mesa/swrast/s_accum.c b/src/mesa/swrast/s_accum.c index 3c45dee399..13a42fdf53 100644 --- a/src/mesa/swrast/s_accum.c +++ b/src/mesa/swrast/s_accum.c @@ -23,10 +23,10 @@ */ -#include "glheader.h" -#include "context.h" -#include "macros.h" -#include "imports.h" +#include "main/glheader.h" +#include "main/context.h" +#include "main/macros.h" +#include "main/imports.h" #include "fbobject.h" #include "s_accum.h" diff --git a/src/mesa/swrast/s_accum.h b/src/mesa/swrast/s_accum.h index 97d2bef4c3..42e38cf02b 100644 --- a/src/mesa/swrast/s_accum.h +++ b/src/mesa/swrast/s_accum.h @@ -27,7 +27,7 @@ #define S_ACCUM_H -#include "mtypes.h" +#include "main/mtypes.h" extern void diff --git a/src/mesa/swrast/s_alpha.c b/src/mesa/swrast/s_alpha.c index 3c55d3e9e3..5761bb00b4 100644 --- a/src/mesa/swrast/s_alpha.c +++ b/src/mesa/swrast/s_alpha.c @@ -27,10 +27,10 @@ * \brief Functions to apply alpha test. */ -#include "glheader.h" -#include "context.h" -#include "colormac.h" -#include "macros.h" +#include "main/glheader.h" +#include "main/context.h" +#include "main/colormac.h" +#include "main/macros.h" #include "s_alpha.h" #include "s_context.h" diff --git a/src/mesa/swrast/s_alpha.h b/src/mesa/swrast/s_alpha.h index a85ef8a83a..92cb01b18a 100644 --- a/src/mesa/swrast/s_alpha.h +++ b/src/mesa/swrast/s_alpha.h @@ -28,7 +28,7 @@ #define S_ALPHA_H -#include "mtypes.h" +#include "main/mtypes.h" #include "s_context.h" diff --git a/src/mesa/swrast/s_atifragshader.c b/src/mesa/swrast/s_atifragshader.c index 55ec757ee0..9fa352c36b 100644 --- a/src/mesa/swrast/s_atifragshader.c +++ b/src/mesa/swrast/s_atifragshader.c @@ -20,10 +20,10 @@ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -#include "glheader.h" -#include "colormac.h" -#include "context.h" -#include "macros.h" +#include "main/glheader.h" +#include "main/colormac.h" +#include "main/context.h" +#include "main/macros.h" #include "shader/program.h" #include "shader/atifragshader.h" #include "swrast/s_atifragshader.h" diff --git a/src/mesa/swrast/s_bitmap.c b/src/mesa/swrast/s_bitmap.c index f3dda12e25..2308acae1c 100644 --- a/src/mesa/swrast/s_bitmap.c +++ b/src/mesa/swrast/s_bitmap.c @@ -28,10 +28,10 @@ * \author Brian Paul */ -#include "glheader.h" +#include "main/glheader.h" #include "bufferobj.h" #include "image.h" -#include "macros.h" +#include "main/macros.h" #include "pixel.h" #include "s_context.h" diff --git a/src/mesa/swrast/s_blend.c b/src/mesa/swrast/s_blend.c index 82c5e84294..7fd8945354 100644 --- a/src/mesa/swrast/s_blend.c +++ b/src/mesa/swrast/s_blend.c @@ -35,10 +35,10 @@ -#include "glheader.h" -#include "context.h" -#include "colormac.h" -#include "macros.h" +#include "main/glheader.h" +#include "main/context.h" +#include "main/colormac.h" +#include "main/macros.h" #include "s_blend.h" #include "s_context.h" diff --git a/src/mesa/swrast/s_blend.h b/src/mesa/swrast/s_blend.h index 0b8cbed1a0..c8abecc099 100644 --- a/src/mesa/swrast/s_blend.h +++ b/src/mesa/swrast/s_blend.h @@ -27,7 +27,7 @@ #define S_BLEND_H -#include "mtypes.h" +#include "main/mtypes.h" #include "s_context.h" diff --git a/src/mesa/swrast/s_blit.c b/src/mesa/swrast/s_blit.c index 5aec4aad03..0e12dfa1da 100644 --- a/src/mesa/swrast/s_blit.c +++ b/src/mesa/swrast/s_blit.c @@ -23,8 +23,8 @@ */ -#include "glheader.h" -#include "macros.h" +#include "main/glheader.h" +#include "main/macros.h" #include "s_context.h" diff --git a/src/mesa/swrast/s_buffers.c b/src/mesa/swrast/s_buffers.c index 90a56284c5..a70f474587 100644 --- a/src/mesa/swrast/s_buffers.c +++ b/src/mesa/swrast/s_buffers.c @@ -24,11 +24,11 @@ /** XXX This file should be named s_clear.c */ -#include "glheader.h" -#include "colormac.h" -#include "macros.h" -#include "imports.h" -#include "mtypes.h" +#include "main/glheader.h" +#include "main/colormac.h" +#include "main/macros.h" +#include "main/imports.h" +#include "main/mtypes.h" #include "s_accum.h" #include "s_context.h" diff --git a/src/mesa/swrast/s_context.c b/src/mesa/swrast/s_context.c index f43fa61f8a..4d9b956f85 100644 --- a/src/mesa/swrast/s_context.c +++ b/src/mesa/swrast/s_context.c @@ -26,11 +26,11 @@ * Brian Paul */ -#include "imports.h" +#include "main/imports.h" #include "bufferobj.h" -#include "context.h" -#include "colormac.h" -#include "mtypes.h" +#include "main/context.h" +#include "main/colormac.h" +#include "main/mtypes.h" #include "teximage.h" #include "swrast.h" #include "shader/prog_statevars.h" diff --git a/src/mesa/swrast/s_copypix.c b/src/mesa/swrast/s_copypix.c index bbe1081860..7385a9942c 100644 --- a/src/mesa/swrast/s_copypix.c +++ b/src/mesa/swrast/s_copypix.c @@ -23,14 +23,14 @@ */ -#include "glheader.h" -#include "context.h" -#include "colormac.h" +#include "main/glheader.h" +#include "main/context.h" +#include "main/colormac.h" #include "convolve.h" #include "histogram.h" #include "image.h" -#include "macros.h" -#include "imports.h" +#include "main/macros.h" +#include "main/imports.h" #include "pixel.h" #include "s_context.h" diff --git a/src/mesa/swrast/s_depth.c b/src/mesa/swrast/s_depth.c index 408174c990..a9d3e9d98e 100644 --- a/src/mesa/swrast/s_depth.c +++ b/src/mesa/swrast/s_depth.c @@ -23,10 +23,10 @@ */ -#include "glheader.h" -#include "context.h" -#include "macros.h" -#include "imports.h" +#include "main/glheader.h" +#include "main/context.h" +#include "main/macros.h" +#include "main/imports.h" #include "fbobject.h" #include "s_depth.h" diff --git a/src/mesa/swrast/s_depth.h b/src/mesa/swrast/s_depth.h index d1ed050efd..484cc73f49 100644 --- a/src/mesa/swrast/s_depth.h +++ b/src/mesa/swrast/s_depth.h @@ -27,7 +27,7 @@ #define S_DEPTH_H -#include "mtypes.h" +#include "main/mtypes.h" #include "s_context.h" diff --git a/src/mesa/swrast/s_drawpix.c b/src/mesa/swrast/s_drawpix.c index cbf6617058..d1120d2cee 100644 --- a/src/mesa/swrast/s_drawpix.c +++ b/src/mesa/swrast/s_drawpix.c @@ -23,13 +23,13 @@ */ -#include "glheader.h" +#include "main/glheader.h" #include "bufferobj.h" -#include "context.h" +#include "main/context.h" #include "convolve.h" #include "image.h" -#include "macros.h" -#include "imports.h" +#include "main/macros.h" +#include "main/imports.h" #include "pixel.h" #include "state.h" diff --git a/src/mesa/swrast/s_drawpix.h b/src/mesa/swrast/s_drawpix.h index 66067115dd..7882a79966 100644 --- a/src/mesa/swrast/s_drawpix.h +++ b/src/mesa/swrast/s_drawpix.h @@ -28,7 +28,7 @@ #define S_DRAWPIXELS_H -#include "mtypes.h" +#include "main/mtypes.h" #include "swrast.h" /* XXX kill this header? */ diff --git a/src/mesa/swrast/s_feedback.c b/src/mesa/swrast/s_feedback.c index 07b7409ab5..31cea8e41f 100644 --- a/src/mesa/swrast/s_feedback.c +++ b/src/mesa/swrast/s_feedback.c @@ -22,12 +22,12 @@ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -#include "glheader.h" -#include "colormac.h" -#include "context.h" -#include "enums.h" +#include "main/glheader.h" +#include "main/colormac.h" +#include "main/context.h" +#include "main/enums.h" #include "feedback.h" -#include "macros.h" +#include "main/macros.h" #include "s_context.h" #include "s_feedback.h" diff --git a/src/mesa/swrast/s_feedback.h b/src/mesa/swrast/s_feedback.h index 73f45c10be..6484f1dc75 100644 --- a/src/mesa/swrast/s_feedback.h +++ b/src/mesa/swrast/s_feedback.h @@ -28,7 +28,7 @@ #define S_FEEDBACK_H -#include "mtypes.h" +#include "main/mtypes.h" #include "swrast.h" diff --git a/src/mesa/swrast/s_fog.c b/src/mesa/swrast/s_fog.c index 7b143f6e5b..b9ba265db6 100644 --- a/src/mesa/swrast/s_fog.c +++ b/src/mesa/swrast/s_fog.c @@ -23,10 +23,10 @@ */ -#include "glheader.h" -#include "colormac.h" -#include "context.h" -#include "macros.h" +#include "main/glheader.h" +#include "main/colormac.h" +#include "main/context.h" +#include "main/macros.h" #include "s_context.h" #include "s_fog.h" diff --git a/src/mesa/swrast/s_fog.h b/src/mesa/swrast/s_fog.h index 9639bee2cc..2346dd1734 100644 --- a/src/mesa/swrast/s_fog.h +++ b/src/mesa/swrast/s_fog.h @@ -28,7 +28,7 @@ #define S_FOG_H -#include "mtypes.h" +#include "main/mtypes.h" #include "swrast.h" diff --git a/src/mesa/swrast/s_lines.c b/src/mesa/swrast/s_lines.c index 3de438760b..23cb9b57ef 100644 --- a/src/mesa/swrast/s_lines.c +++ b/src/mesa/swrast/s_lines.c @@ -23,10 +23,10 @@ */ -#include "glheader.h" -#include "context.h" -#include "colormac.h" -#include "macros.h" +#include "main/glheader.h" +#include "main/context.h" +#include "main/colormac.h" +#include "main/macros.h" #include "s_aaline.h" #include "s_context.h" #include "s_depth.h" diff --git a/src/mesa/swrast/s_lines.h b/src/mesa/swrast/s_lines.h index 5372b99b91..6c629ca2d4 100644 --- a/src/mesa/swrast/s_lines.h +++ b/src/mesa/swrast/s_lines.h @@ -27,7 +27,7 @@ #ifndef S_LINES_H #define S_LINES_H -#include "mtypes.h" +#include "main/mtypes.h" void _swrast_choose_line( GLcontext *ctx ); diff --git a/src/mesa/swrast/s_logic.c b/src/mesa/swrast/s_logic.c index 0af9063968..f0274b4c0b 100644 --- a/src/mesa/swrast/s_logic.c +++ b/src/mesa/swrast/s_logic.c @@ -23,10 +23,10 @@ */ -#include "glheader.h" -#include "context.h" -#include "imports.h" -#include "macros.h" +#include "main/glheader.h" +#include "main/context.h" +#include "main/imports.h" +#include "main/macros.h" #include "s_context.h" #include "s_logic.h" diff --git a/src/mesa/swrast/s_logic.h b/src/mesa/swrast/s_logic.h index 0bc2c3f8a8..04ef00bb99 100644 --- a/src/mesa/swrast/s_logic.h +++ b/src/mesa/swrast/s_logic.h @@ -27,7 +27,7 @@ #define S_LOGIC_H -#include "mtypes.h" +#include "main/mtypes.h" #include "swrast.h" diff --git a/src/mesa/swrast/s_masking.c b/src/mesa/swrast/s_masking.c index a69720e83a..df779b0739 100644 --- a/src/mesa/swrast/s_masking.c +++ b/src/mesa/swrast/s_masking.c @@ -28,8 +28,8 @@ */ -#include "glheader.h" -#include "macros.h" +#include "main/glheader.h" +#include "main/macros.h" #include "s_context.h" #include "s_masking.h" diff --git a/src/mesa/swrast/s_masking.h b/src/mesa/swrast/s_masking.h index 0596cb3f45..688c07c7ae 100644 --- a/src/mesa/swrast/s_masking.h +++ b/src/mesa/swrast/s_masking.h @@ -27,7 +27,7 @@ #define S_MASKING_H -#include "mtypes.h" +#include "main/mtypes.h" #include "swrast.h" diff --git a/src/mesa/swrast/s_points.c b/src/mesa/swrast/s_points.c index f4b3650210..9f52da980c 100644 --- a/src/mesa/swrast/s_points.c +++ b/src/mesa/swrast/s_points.c @@ -23,10 +23,10 @@ */ -#include "glheader.h" -#include "colormac.h" -#include "context.h" -#include "macros.h" +#include "main/glheader.h" +#include "main/colormac.h" +#include "main/context.h" +#include "main/macros.h" #include "texstate.h" #include "s_context.h" #include "s_feedback.h" diff --git a/src/mesa/swrast/s_points.h b/src/mesa/swrast/s_points.h index 40b442e951..3fda115c0d 100644 --- a/src/mesa/swrast/s_points.h +++ b/src/mesa/swrast/s_points.h @@ -27,7 +27,7 @@ #ifndef S_POINTS_H #define S_POINTS_H -#include "mtypes.h" +#include "main/mtypes.h" extern void _swrast_choose_point( GLcontext *ctx ); diff --git a/src/mesa/swrast/s_readpix.c b/src/mesa/swrast/s_readpix.c index 2f155d0b70..6186f92899 100644 --- a/src/mesa/swrast/s_readpix.c +++ b/src/mesa/swrast/s_readpix.c @@ -23,15 +23,15 @@ */ -#include "glheader.h" +#include "main/glheader.h" #include "bufferobj.h" -#include "colormac.h" +#include "main/colormac.h" #include "convolve.h" -#include "context.h" +#include "main/context.h" #include "feedback.h" #include "image.h" -#include "macros.h" -#include "imports.h" +#include "main/macros.h" +#include "main/imports.h" #include "pixel.h" #include "state.h" diff --git a/src/mesa/swrast/s_span.c b/src/mesa/swrast/s_span.c index d9c1d1bec7..457dc4a6ce 100644 --- a/src/mesa/swrast/s_span.c +++ b/src/mesa/swrast/s_span.c @@ -30,11 +30,11 @@ * \author Brian Paul */ -#include "glheader.h" -#include "colormac.h" -#include "context.h" -#include "macros.h" -#include "imports.h" +#include "main/glheader.h" +#include "main/colormac.h" +#include "main/context.h" +#include "main/macros.h" +#include "main/imports.h" #include "image.h" #include "s_atifragshader.h" diff --git a/src/mesa/swrast/s_span.h b/src/mesa/swrast/s_span.h index 512134db0f..6b814fc8fb 100644 --- a/src/mesa/swrast/s_span.h +++ b/src/mesa/swrast/s_span.h @@ -27,7 +27,7 @@ #define S_SPAN_H -#include "mtypes.h" +#include "main/mtypes.h" #include "swrast.h" diff --git a/src/mesa/swrast/s_spantemp.h b/src/mesa/swrast/s_spantemp.h index 1eef81eb91..bab2ca7378 100644 --- a/src/mesa/swrast/s_spantemp.h +++ b/src/mesa/swrast/s_spantemp.h @@ -43,7 +43,7 @@ * ignored otherwise. */ -#include "macros.h" +#include "main/macros.h" #ifdef CI_MODE diff --git a/src/mesa/swrast/s_stencil.c b/src/mesa/swrast/s_stencil.c index d0cbdd6917..cdb7e4669c 100644 --- a/src/mesa/swrast/s_stencil.c +++ b/src/mesa/swrast/s_stencil.c @@ -23,9 +23,9 @@ */ -#include "glheader.h" -#include "context.h" -#include "imports.h" +#include "main/glheader.h" +#include "main/context.h" +#include "main/imports.h" #include "s_context.h" #include "s_depth.h" diff --git a/src/mesa/swrast/s_stencil.h b/src/mesa/swrast/s_stencil.h index 1fcb538fec..742f8d4c94 100644 --- a/src/mesa/swrast/s_stencil.h +++ b/src/mesa/swrast/s_stencil.h @@ -27,7 +27,7 @@ #define S_STENCIL_H -#include "mtypes.h" +#include "main/mtypes.h" #include "swrast.h" diff --git a/src/mesa/swrast/s_texcombine.c b/src/mesa/swrast/s_texcombine.c index 4c5e22618e..b7724f7b20 100644 --- a/src/mesa/swrast/s_texcombine.c +++ b/src/mesa/swrast/s_texcombine.c @@ -23,11 +23,11 @@ */ -#include "glheader.h" -#include "context.h" -#include "colormac.h" -#include "imports.h" -#include "macros.h" +#include "main/glheader.h" +#include "main/context.h" +#include "main/colormac.h" +#include "main/imports.h" +#include "main/macros.h" #include "image.h" #include "s_context.h" diff --git a/src/mesa/swrast/s_texcombine.h b/src/mesa/swrast/s_texcombine.h index 3bf70e0b86..20cd2bd8ad 100644 --- a/src/mesa/swrast/s_texcombine.h +++ b/src/mesa/swrast/s_texcombine.h @@ -27,7 +27,7 @@ #define S_TEXCOMBINE_H -#include "mtypes.h" +#include "main/mtypes.h" #include "swrast.h" extern void diff --git a/src/mesa/swrast/s_texfilter.c b/src/mesa/swrast/s_texfilter.c index c2a7512388..bb0fc823e7 100644 --- a/src/mesa/swrast/s_texfilter.c +++ b/src/mesa/swrast/s_texfilter.c @@ -23,10 +23,10 @@ */ -#include "glheader.h" -#include "context.h" -#include "colormac.h" -#include "imports.h" +#include "main/glheader.h" +#include "main/context.h" +#include "main/colormac.h" +#include "main/imports.h" #include "texformat.h" #include "s_context.h" diff --git a/src/mesa/swrast/s_texfilter.h b/src/mesa/swrast/s_texfilter.h index e4445e79a0..6267ad17eb 100644 --- a/src/mesa/swrast/s_texfilter.h +++ b/src/mesa/swrast/s_texfilter.h @@ -27,7 +27,7 @@ #define S_TEXFILTER_H -#include "mtypes.h" +#include "main/mtypes.h" #include "swrast.h" diff --git a/src/mesa/swrast/s_texstore.c b/src/mesa/swrast/s_texstore.c index 3f49b40d9c..f5d081d7a3 100644 --- a/src/mesa/swrast/s_texstore.c +++ b/src/mesa/swrast/s_texstore.c @@ -36,13 +36,13 @@ -#include "glheader.h" -#include "imports.h" -#include "colormac.h" -#include "context.h" +#include "main/glheader.h" +#include "main/imports.h" +#include "main/colormac.h" +#include "main/context.h" #include "convolve.h" #include "image.h" -#include "macros.h" +#include "main/macros.h" #include "mipmap.h" #include "texformat.h" #include "teximage.h" diff --git a/src/mesa/swrast/s_triangle.c b/src/mesa/swrast/s_triangle.c index c255545217..00cff6635f 100644 --- a/src/mesa/swrast/s_triangle.c +++ b/src/mesa/swrast/s_triangle.c @@ -29,11 +29,11 @@ * functions to draw triangles. */ -#include "glheader.h" -#include "context.h" -#include "colormac.h" -#include "imports.h" -#include "macros.h" +#include "main/glheader.h" +#include "main/context.h" +#include "main/colormac.h" +#include "main/imports.h" +#include "main/macros.h" #include "texformat.h" #include "s_aatriangle.h" diff --git a/src/mesa/swrast/s_triangle.h b/src/mesa/swrast/s_triangle.h index 0de812500c..c3cadae2d4 100644 --- a/src/mesa/swrast/s_triangle.h +++ b/src/mesa/swrast/s_triangle.h @@ -28,7 +28,7 @@ #define S_TRIANGLES_H -#include "mtypes.h" +#include "main/mtypes.h" #include "swrast.h" diff --git a/src/mesa/swrast/s_zoom.c b/src/mesa/swrast/s_zoom.c index 9f1a4c6f0a..48b4d1e240 100644 --- a/src/mesa/swrast/s_zoom.c +++ b/src/mesa/swrast/s_zoom.c @@ -22,10 +22,10 @@ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -#include "glheader.h" -#include "macros.h" -#include "imports.h" -#include "colormac.h" +#include "main/glheader.h" +#include "main/macros.h" +#include "main/imports.h" +#include "main/colormac.h" #include "s_context.h" #include "s_span.h" diff --git a/src/mesa/swrast/s_zoom.h b/src/mesa/swrast/s_zoom.h index 6ca11ac211..7701515476 100644 --- a/src/mesa/swrast/s_zoom.h +++ b/src/mesa/swrast/s_zoom.h @@ -25,7 +25,7 @@ #ifndef S_ZOOM_H #define S_ZOOM_H -#include "mtypes.h" +#include "main/mtypes.h" #include "swrast.h" diff --git a/src/mesa/swrast_setup/ss_context.c b/src/mesa/swrast_setup/ss_context.c index a9c7d941e5..fd6935e7be 100644 --- a/src/mesa/swrast_setup/ss_context.c +++ b/src/mesa/swrast_setup/ss_context.c @@ -25,9 +25,9 @@ * Keith Whitwell */ -#include "glheader.h" -#include "imports.h" -#include "colormac.h" +#include "main/glheader.h" +#include "main/imports.h" +#include "main/colormac.h" #include "ss_context.h" #include "ss_triangle.h" #include "swrast_setup.h" diff --git a/src/mesa/swrast_setup/ss_context.h b/src/mesa/swrast_setup/ss_context.h index 11f9ded3ff..1ec293fade 100644 --- a/src/mesa/swrast_setup/ss_context.h +++ b/src/mesa/swrast_setup/ss_context.h @@ -28,7 +28,7 @@ #ifndef SS_CONTEXT_H #define SS_CONTEXT_H -#include "mtypes.h" +#include "main/mtypes.h" #include "swrast/swrast.h" #include "swrast_setup.h" #include "tnl/t_context.h" diff --git a/src/mesa/swrast_setup/ss_triangle.c b/src/mesa/swrast_setup/ss_triangle.c index b4207f2c64..9fef7a52ec 100644 --- a/src/mesa/swrast_setup/ss_triangle.c +++ b/src/mesa/swrast_setup/ss_triangle.c @@ -25,10 +25,10 @@ * Keith Whitwell */ -#include "glheader.h" -#include "colormac.h" -#include "macros.h" -#include "mtypes.h" +#include "main/glheader.h" +#include "main/colormac.h" +#include "main/macros.h" +#include "main/mtypes.h" #include "tnl/t_context.h" diff --git a/src/mesa/swrast_setup/ss_triangle.h b/src/mesa/swrast_setup/ss_triangle.h index 78833269e6..863e744607 100644 --- a/src/mesa/swrast_setup/ss_triangle.h +++ b/src/mesa/swrast_setup/ss_triangle.h @@ -29,7 +29,7 @@ #ifndef SS_TRIANGLE_H #define SS_TRIANGLE_H -#include "mtypes.h" +#include "main/mtypes.h" #include "ss_context.h" diff --git a/src/mesa/swrast_setup/ss_vb.h b/src/mesa/swrast_setup/ss_vb.h index 6ea0cb1a70..2ad1f56f39 100644 --- a/src/mesa/swrast_setup/ss_vb.h +++ b/src/mesa/swrast_setup/ss_vb.h @@ -29,7 +29,7 @@ #ifndef SS_VB_H #define SS_VB_H -#include "mtypes.h" +#include "main/mtypes.h" #include "swrast_setup.h" void _swsetup_vb_init( GLcontext *ctx ); diff --git a/src/mesa/tnl/t_draw.c b/src/mesa/tnl/t_draw.c index 5b2b2ae549..a1a46f6b82 100644 --- a/src/mesa/tnl/t_draw.c +++ b/src/mesa/tnl/t_draw.c @@ -26,13 +26,13 @@ * Keith Whitwell */ -#include "glheader.h" -#include "context.h" -#include "imports.h" +#include "main/glheader.h" +#include "main/context.h" +#include "main/imports.h" #include "state.h" -#include "mtypes.h" -#include "macros.h" -#include "enums.h" +#include "main/mtypes.h" +#include "main/macros.h" +#include "main/enums.h" #include "t_context.h" #include "t_pipeline.h" diff --git a/src/mesa/tnl/t_pipeline.h b/src/mesa/tnl/t_pipeline.h index 0952854b85..d110010f04 100644 --- a/src/mesa/tnl/t_pipeline.h +++ b/src/mesa/tnl/t_pipeline.h @@ -30,7 +30,7 @@ #ifndef _T_PIPELINE_H_ #define _T_PIPELINE_H_ -#include "mtypes.h" +#include "main/mtypes.h" #include "t_context.h" extern void _tnl_run_pipeline( GLcontext *ctx ); diff --git a/src/mesa/tnl/t_rasterpos.c b/src/mesa/tnl/t_rasterpos.c index be963867c0..dfbe0f1806 100644 --- a/src/mesa/tnl/t_rasterpos.c +++ b/src/mesa/tnl/t_rasterpos.c @@ -23,15 +23,15 @@ */ -#include "glheader.h" -#include "colormac.h" -#include "context.h" +#include "main/glheader.h" +#include "main/colormac.h" +#include "main/context.h" #include "feedback.h" #include "light.h" -#include "macros.h" +#include "main/macros.h" #include "rastpos.h" #include "simple_list.h" -#include "mtypes.h" +#include "main/mtypes.h" #include "math/m_matrix.h" #include "tnl/tnl.h" diff --git a/src/mesa/tnl/t_vb_cull.c b/src/mesa/tnl/t_vb_cull.c index 21a32e5b1d..712901acf3 100644 --- a/src/mesa/tnl/t_vb_cull.c +++ b/src/mesa/tnl/t_vb_cull.c @@ -26,12 +26,12 @@ */ -#include "glheader.h" -#include "colormac.h" -#include "context.h" -#include "macros.h" -#include "imports.h" -#include "mtypes.h" +#include "main/glheader.h" +#include "main/colormac.h" +#include "main/context.h" +#include "main/macros.h" +#include "main/imports.h" +#include "main/mtypes.h" #include "math/m_xform.h" diff --git a/src/mesa/tnl/t_vb_fog.c b/src/mesa/tnl/t_vb_fog.c index f6518500d8..00c0979f3f 100644 --- a/src/mesa/tnl/t_vb_fog.c +++ b/src/mesa/tnl/t_vb_fog.c @@ -26,12 +26,12 @@ */ -#include "glheader.h" -#include "colormac.h" -#include "context.h" -#include "macros.h" -#include "imports.h" -#include "mtypes.h" +#include "main/glheader.h" +#include "main/colormac.h" +#include "main/context.h" +#include "main/macros.h" +#include "main/imports.h" +#include "main/mtypes.h" #include "math/m_xform.h" diff --git a/src/mesa/tnl/t_vb_light.c b/src/mesa/tnl/t_vb_light.c index 12f2cc7735..ebd3412d20 100644 --- a/src/mesa/tnl/t_vb_light.c +++ b/src/mesa/tnl/t_vb_light.c @@ -24,13 +24,13 @@ -#include "glheader.h" -#include "colormac.h" +#include "main/glheader.h" +#include "main/colormac.h" #include "light.h" -#include "macros.h" -#include "imports.h" +#include "main/macros.h" +#include "main/imports.h" #include "simple_list.h" -#include "mtypes.h" +#include "main/mtypes.h" #include "math/m_translate.h" diff --git a/src/mesa/tnl/t_vb_normals.c b/src/mesa/tnl/t_vb_normals.c index 01fad0cee2..a4821cc1cc 100644 --- a/src/mesa/tnl/t_vb_normals.c +++ b/src/mesa/tnl/t_vb_normals.c @@ -26,12 +26,12 @@ */ -#include "glheader.h" -#include "colormac.h" -#include "context.h" -#include "macros.h" -#include "imports.h" -#include "mtypes.h" +#include "main/glheader.h" +#include "main/colormac.h" +#include "main/context.h" +#include "main/macros.h" +#include "main/imports.h" +#include "main/mtypes.h" #include "math/m_xform.h" diff --git a/src/mesa/tnl/t_vb_points.c b/src/mesa/tnl/t_vb_points.c index 1ac14fedf9..01d055c1dd 100644 --- a/src/mesa/tnl/t_vb_points.c +++ b/src/mesa/tnl/t_vb_points.c @@ -25,8 +25,8 @@ * Brian Paul */ -#include "mtypes.h" -#include "imports.h" +#include "main/mtypes.h" +#include "main/imports.h" #include "t_context.h" #include "t_pipeline.h" diff --git a/src/mesa/tnl/t_vb_program.c b/src/mesa/tnl/t_vb_program.c index f8e561ac57..c778f5d248 100644 --- a/src/mesa/tnl/t_vb_program.c +++ b/src/mesa/tnl/t_vb_program.c @@ -30,11 +30,11 @@ */ -#include "glheader.h" -#include "colormac.h" -#include "context.h" -#include "macros.h" -#include "imports.h" +#include "main/glheader.h" +#include "main/colormac.h" +#include "main/context.h" +#include "main/macros.h" +#include "main/imports.h" #include "shader/prog_instruction.h" #include "shader/prog_statevars.h" #include "shader/prog_execute.h" diff --git a/src/mesa/tnl/t_vb_render.c b/src/mesa/tnl/t_vb_render.c index c38f0745e1..c1bebc9942 100644 --- a/src/mesa/tnl/t_vb_render.c +++ b/src/mesa/tnl/t_vb_render.c @@ -38,12 +38,12 @@ */ -#include "glheader.h" -#include "context.h" -#include "enums.h" -#include "macros.h" -#include "imports.h" -#include "mtypes.h" +#include "main/glheader.h" +#include "main/context.h" +#include "main/enums.h" +#include "main/macros.h" +#include "main/imports.h" +#include "main/mtypes.h" #include "t_pipeline.h" diff --git a/src/mesa/tnl/t_vb_texgen.c b/src/mesa/tnl/t_vb_texgen.c index e98ab743c5..14d3876e54 100644 --- a/src/mesa/tnl/t_vb_texgen.c +++ b/src/mesa/tnl/t_vb_texgen.c @@ -35,12 +35,12 @@ * including any use thereof or modifications thereto. */ -#include "glheader.h" -#include "colormac.h" -#include "context.h" -#include "macros.h" -#include "imports.h" -#include "mtypes.h" +#include "main/glheader.h" +#include "main/colormac.h" +#include "main/context.h" +#include "main/macros.h" +#include "main/imports.h" +#include "main/mtypes.h" #include "math/m_xform.h" diff --git a/src/mesa/tnl/t_vb_texmat.c b/src/mesa/tnl/t_vb_texmat.c index 674d36f8cb..0abe8cc35d 100644 --- a/src/mesa/tnl/t_vb_texmat.c +++ b/src/mesa/tnl/t_vb_texmat.c @@ -26,12 +26,12 @@ */ -#include "glheader.h" -#include "colormac.h" -#include "context.h" -#include "macros.h" -#include "imports.h" -#include "mtypes.h" +#include "main/glheader.h" +#include "main/colormac.h" +#include "main/context.h" +#include "main/macros.h" +#include "main/imports.h" +#include "main/mtypes.h" #include "math/m_xform.h" diff --git a/src/mesa/tnl/t_vb_vertex.c b/src/mesa/tnl/t_vb_vertex.c index 276305b5e6..30aa7c4086 100644 --- a/src/mesa/tnl/t_vb_vertex.c +++ b/src/mesa/tnl/t_vb_vertex.c @@ -26,12 +26,12 @@ */ -#include "glheader.h" -#include "colormac.h" -#include "context.h" -#include "macros.h" -#include "imports.h" -#include "mtypes.h" +#include "main/glheader.h" +#include "main/colormac.h" +#include "main/context.h" +#include "main/macros.h" +#include "main/imports.h" +#include "main/mtypes.h" #include "math/m_xform.h" diff --git a/src/mesa/tnl/t_vertex.c b/src/mesa/tnl/t_vertex.c index a6728c318f..b661524c87 100644 --- a/src/mesa/tnl/t_vertex.c +++ b/src/mesa/tnl/t_vertex.c @@ -25,9 +25,9 @@ * Keith Whitwell */ -#include "glheader.h" -#include "context.h" -#include "colormac.h" +#include "main/glheader.h" +#include "main/context.h" +#include "main/colormac.h" #include "t_context.h" #include "t_vertex.h" diff --git a/src/mesa/tnl/t_vertex.h b/src/mesa/tnl/t_vertex.h index fda8f151d3..712311a146 100644 --- a/src/mesa/tnl/t_vertex.h +++ b/src/mesa/tnl/t_vertex.h @@ -28,7 +28,7 @@ #ifndef _TNL_VERTEX_H #define _TNL_VERTEX_H -#include "mtypes.h" +#include "main/mtypes.h" #include "t_context.h" /* New mechanism to specify hardware vertices so that tnl can build diff --git a/src/mesa/tnl/t_vertex_generic.c b/src/mesa/tnl/t_vertex_generic.c index 236a5bedc8..c399423b9e 100644 --- a/src/mesa/tnl/t_vertex_generic.c +++ b/src/mesa/tnl/t_vertex_generic.c @@ -26,9 +26,9 @@ * Keith Whitwell */ -#include "glheader.h" -#include "context.h" -#include "colormac.h" +#include "main/glheader.h" +#include "main/context.h" +#include "main/colormac.h" #include "t_context.h" #include "t_vertex.h" #include "simple_list.h" diff --git a/src/mesa/tnl/t_vertex_sse.c b/src/mesa/tnl/t_vertex_sse.c index a180441a5a..96def25206 100644 --- a/src/mesa/tnl/t_vertex_sse.c +++ b/src/mesa/tnl/t_vertex_sse.c @@ -25,13 +25,13 @@ * Keith Whitwell */ -#include "glheader.h" -#include "context.h" -#include "colormac.h" +#include "main/glheader.h" +#include "main/context.h" +#include "main/colormac.h" #include "t_context.h" #include "t_vertex.h" #include "simple_list.h" -#include "enums.h" +#include "main/enums.h" #if defined(USE_SSE_ASM) diff --git a/src/mesa/tnl/t_vp_build.c b/src/mesa/tnl/t_vp_build.c index 249bccb443..b3b63cd3e4 100644 --- a/src/mesa/tnl/t_vp_build.c +++ b/src/mesa/tnl/t_vp_build.c @@ -30,7 +30,7 @@ */ -#include "glheader.h" +#include "main/glheader.h" #include "main/ffvertex_prog.h" #include "t_vp_build.h" diff --git a/src/mesa/tnl/t_vp_build.h b/src/mesa/tnl/t_vp_build.h index efe12e41a4..d6ebc66c04 100644 --- a/src/mesa/tnl/t_vp_build.h +++ b/src/mesa/tnl/t_vp_build.h @@ -27,7 +27,7 @@ #ifndef T_VP_BUILD_H #define T_VP_BUILD_H -#include "mtypes.h" +#include "main/mtypes.h" #define TNL_FIXED_FUNCTION_STATE_FLAGS (_NEW_PROGRAM | \ _NEW_LIGHT | \ diff --git a/src/mesa/vf/vf.c b/src/mesa/vf/vf.c index cb25f2e113..82f3d2b641 100644 --- a/src/mesa/vf/vf.c +++ b/src/mesa/vf/vf.c @@ -25,9 +25,9 @@ * Keith Whitwell */ -#include "glheader.h" -#include "context.h" -#include "colormac.h" +#include "main/glheader.h" +#include "main/context.h" +#include "main/colormac.h" #include "vf.h" diff --git a/src/mesa/vf/vf_generic.c b/src/mesa/vf/vf_generic.c index 68d8d0897b..baa00af29a 100644 --- a/src/mesa/vf/vf_generic.c +++ b/src/mesa/vf/vf_generic.c @@ -26,10 +26,10 @@ * Keith Whitwell */ -#include "glheader.h" -#include "context.h" -#include "colormac.h" -#include "simple_list.h" +#include "main/glheader.h" +#include "main/context.h" +#include "main/colormac.h" +#include "main/simple_list.h" #include "vf/vf.h" diff --git a/src/mesa/vf/vf_sse.c b/src/mesa/vf/vf_sse.c index c3a2166578..4d70196ffe 100644 --- a/src/mesa/vf/vf_sse.c +++ b/src/mesa/vf/vf_sse.c @@ -25,10 +25,10 @@ * Keith Whitwell */ -#include "glheader.h" -#include "colormac.h" -#include "simple_list.h" -#include "enums.h" +#include "main/glheader.h" +#include "main/colormac.h" +#include "main/simple_list.h" +#include "main/enums.h" #include "vf/vf.h" diff --git a/src/mesa/x86-64/x86-64.c b/src/mesa/x86-64/x86-64.c index dee09fd648..9ec43c841d 100644 --- a/src/mesa/x86-64/x86-64.c +++ b/src/mesa/x86-64/x86-64.c @@ -30,8 +30,8 @@ #ifdef USE_X86_64_ASM -#include "glheader.h" -#include "context.h" +#include "main/glheader.h" +#include "main/context.h" #include "math/m_xform.h" #include "tnl/t_context.h" #include "x86-64.h" diff --git a/src/mesa/x86/3dnow.c b/src/mesa/x86/3dnow.c index 4122ee4b00..c037a61761 100644 --- a/src/mesa/x86/3dnow.c +++ b/src/mesa/x86/3dnow.c @@ -28,8 +28,8 @@ * Holger Waechtler */ -#include "glheader.h" -#include "context.h" +#include "main/glheader.h" +#include "main/context.h" #include "math/m_xform.h" #include "tnl/t_context.h" diff --git a/src/mesa/x86/common_x86.c b/src/mesa/x86/common_x86.c index 0caa36a5a0..dc80d26fa9 100644 --- a/src/mesa/x86/common_x86.c +++ b/src/mesa/x86/common_x86.c @@ -49,7 +49,7 @@ #endif #include "common_x86_asm.h" -#include "imports.h" +#include "main/imports.h" int _mesa_x86_cpu_features = 0; diff --git a/src/mesa/x86/rtasm/x86sse.c b/src/mesa/x86/rtasm/x86sse.c index 7a91364ed8..5c4bab7331 100644 --- a/src/mesa/x86/rtasm/x86sse.c +++ b/src/mesa/x86/rtasm/x86sse.c @@ -1,7 +1,7 @@ #ifdef USE_X86_ASM #if defined(__i386__) || defined(__386__) -#include "imports.h" +#include "main/imports.h" #include "x86sse.h" #define DISASSEM 0 diff --git a/src/mesa/x86/sse.c b/src/mesa/x86/sse.c index 4b016a1e85..1c185387c6 100644 --- a/src/mesa/x86/sse.c +++ b/src/mesa/x86/sse.c @@ -27,8 +27,8 @@ * Andre Werthmann */ -#include "glheader.h" -#include "context.h" +#include "main/glheader.h" +#include "main/context.h" #include "math/m_xform.h" #include "tnl/t_context.h" diff --git a/src/mesa/x86/x86.c b/src/mesa/x86/x86.c index 82caa42dbd..ce649f66b0 100644 --- a/src/mesa/x86/x86.c +++ b/src/mesa/x86/x86.c @@ -27,8 +27,8 @@ * Intel x86 assembly code by Josh Vanderhoof */ -#include "glheader.h" -#include "context.h" +#include "main/glheader.h" +#include "main/context.h" #include "math/m_xform.h" #include "tnl/t_context.h" -- cgit v1.2.3 From 8d475822e6e19fa79719c856a2db5b6a205db1b9 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Sat, 28 Feb 2009 11:49:46 -0700 Subject: mesa: rename, reorder FRAG_RESULT_x tokens s/FRAG_RESULT_DEPR/FRAG_RESULT_DEPTH/ s/FRAG_RESULT_COLR/FRAG_RESULT/COLOR/ Remove FRAG_RESULT_COLH (NV half-precision) output since we never used it. Next, we might merge the COLOR and DATA outputs (COLOR0, COLOR1, etc). --- src/mesa/drivers/dri/i915/i915_fragprog.c | 4 +-- src/mesa/drivers/dri/i965/brw_wm.c | 2 +- src/mesa/drivers/dri/i965/brw_wm_fp.c | 8 ++--- src/mesa/drivers/dri/i965/brw_wm_state.c | 2 +- src/mesa/drivers/dri/r300/r300_fragprog.c | 4 +-- src/mesa/drivers/dri/r300/r500_fragprog.c | 4 +-- src/mesa/drivers/dri/r300/radeon_nqssadce.c | 2 +- src/mesa/drivers/dri/r300/radeon_program_pair.c | 4 +-- src/mesa/main/mtypes.h | 7 ++--- src/mesa/main/texenvprogram.c | 6 ++-- src/mesa/shader/arbprogparse.c | 4 +-- src/mesa/shader/nvfragparse.c | 40 ++++++++----------------- src/mesa/shader/nvfragparse.h | 5 ---- src/mesa/shader/prog_debug.c | 12 +++----- src/mesa/shader/program.c | 6 ++-- src/mesa/shader/programopt.c | 6 ++-- src/mesa/shader/slang/slang_codegen.c | 4 +-- src/mesa/shader/slang/slang_link.c | 2 +- src/mesa/state_tracker/st_atom_pixeltransfer.c | 4 +-- src/mesa/state_tracker/st_cb_drawpixels.c | 10 +++---- src/mesa/state_tracker/st_program.c | 10 +++---- src/mesa/swrast/s_context.c | 2 +- src/mesa/swrast/s_fragprog.c | 12 ++++---- 23 files changed, 68 insertions(+), 92 deletions(-) (limited to 'src/mesa/swrast/s_context.c') diff --git a/src/mesa/drivers/dri/i915/i915_fragprog.c b/src/mesa/drivers/dri/i915/i915_fragprog.c index f091d600c3..52f09a4b1b 100644 --- a/src/mesa/drivers/dri/i915/i915_fragprog.c +++ b/src/mesa/drivers/dri/i915/i915_fragprog.c @@ -180,9 +180,9 @@ get_result_vector(struct i915_fragment_program *p, switch (inst->DstReg.File) { case PROGRAM_OUTPUT: switch (inst->DstReg.Index) { - case FRAG_RESULT_COLR: + case FRAG_RESULT_COLOR: return UREG(REG_TYPE_OC, 0); - case FRAG_RESULT_DEPR: + case FRAG_RESULT_DEPTH: p->depth_written = 1; return UREG(REG_TYPE_OD, 0); default: diff --git a/src/mesa/drivers/dri/i965/brw_wm.c b/src/mesa/drivers/dri/i965/brw_wm.c index 10f38e02a4..06a6f3f0f4 100644 --- a/src/mesa/drivers/dri/i965/brw_wm.c +++ b/src/mesa/drivers/dri/i965/brw_wm.c @@ -198,7 +198,7 @@ static void brw_wm_populate_key( struct brw_context *brw, ctx->Color.AlphaEnabled) lookup |= IZ_PS_KILL_ALPHATEST_BIT; - if (fp->program.Base.OutputsWritten & (1<program.Base.OutputsWritten & (1<Aux = (i<<1); if (c->fp_fragcolor_emitted) { - outcolor = src_reg(PROGRAM_OUTPUT, FRAG_RESULT_COLR); + outcolor = src_reg(PROGRAM_OUTPUT, FRAG_RESULT_COLOR); last_inst = inst = emit_op(c, WM_FB_WRITE, dst_mask(dst_undef(),0), 0, outcolor, payload_r0_depth, outdepth); inst->Aux = (i<<1); @@ -892,7 +892,7 @@ static void emit_fb_write( struct brw_wm_compile *c ) if (c->fp->program.Base.OutputsWritten & (1 << FRAG_RESULT_DATA0)) outcolor = src_reg(PROGRAM_OUTPUT, FRAG_RESULT_DATA0); else - outcolor = src_reg(PROGRAM_OUTPUT, FRAG_RESULT_COLR); + outcolor = src_reg(PROGRAM_OUTPUT, FRAG_RESULT_COLOR); inst = emit_op(c, WM_FB_WRITE, dst_mask(dst_undef(),0), 0, outcolor, payload_r0_depth, outdepth); @@ -928,7 +928,7 @@ static void validate_dst_regs( struct brw_wm_compile *c, { if (inst->DstReg.File == PROGRAM_OUTPUT) { GLuint idx = inst->DstReg.Index; - if (idx == FRAG_RESULT_COLR) + if (idx == FRAG_RESULT_COLOR) c->fp_fragcolor_emitted = 1; } } diff --git a/src/mesa/drivers/dri/i965/brw_wm_state.c b/src/mesa/drivers/dri/i965/brw_wm_state.c index 3c3b3473d6..f7ea756fb0 100644 --- a/src/mesa/drivers/dri/i965/brw_wm_state.c +++ b/src/mesa/drivers/dri/i965/brw_wm_state.c @@ -103,7 +103,7 @@ wm_unit_populate_key(struct brw_context *brw, struct brw_wm_unit_key *key) /* as far as we can tell */ key->computes_depth = - (fp->Base.OutputsWritten & (1 << FRAG_RESULT_DEPR)) != 0; + (fp->Base.OutputsWritten & (1 << FRAG_RESULT_DEPTH)) != 0; /* _NEW_COLOR */ key->uses_kill = fp->UsesKill || ctx->Color.AlphaEnabled; diff --git a/src/mesa/drivers/dri/r300/r300_fragprog.c b/src/mesa/drivers/dri/r300/r300_fragprog.c index 8d030c63fb..32182bb667 100644 --- a/src/mesa/drivers/dri/r300/r300_fragprog.c +++ b/src/mesa/drivers/dri/r300/r300_fragprog.c @@ -356,8 +356,8 @@ static void insert_WPOS_trailer(struct r300_fragment_program_compiler *compiler) static void nqssadce_init(struct nqssadce_state* s) { - s->Outputs[FRAG_RESULT_COLR].Sourced = WRITEMASK_XYZW; - s->Outputs[FRAG_RESULT_DEPR].Sourced = WRITEMASK_W; + s->Outputs[FRAG_RESULT_COLOR].Sourced = WRITEMASK_XYZW; + s->Outputs[FRAG_RESULT_DEPTH].Sourced = WRITEMASK_W; } diff --git a/src/mesa/drivers/dri/r300/r500_fragprog.c b/src/mesa/drivers/dri/r300/r500_fragprog.c index 926ddd5964..07a2a7b17c 100644 --- a/src/mesa/drivers/dri/r300/r500_fragprog.c +++ b/src/mesa/drivers/dri/r300/r500_fragprog.c @@ -298,8 +298,8 @@ static void insert_WPOS_trailer(struct r500_fragment_program_compiler *compiler) static void nqssadce_init(struct nqssadce_state* s) { - s->Outputs[FRAG_RESULT_COLR].Sourced = WRITEMASK_XYZW; - s->Outputs[FRAG_RESULT_DEPR].Sourced = WRITEMASK_W; + s->Outputs[FRAG_RESULT_COLOR].Sourced = WRITEMASK_XYZW; + s->Outputs[FRAG_RESULT_DEPTH].Sourced = WRITEMASK_W; } static GLboolean is_native_swizzle(GLuint opcode, struct prog_src_register reg) diff --git a/src/mesa/drivers/dri/r300/radeon_nqssadce.c b/src/mesa/drivers/dri/r300/radeon_nqssadce.c index 97ce016c99..a083c3d243 100644 --- a/src/mesa/drivers/dri/r300/radeon_nqssadce.c +++ b/src/mesa/drivers/dri/r300/radeon_nqssadce.c @@ -191,7 +191,7 @@ static void process_instruction(struct nqssadce_state* s) if (inst->Opcode != OPCODE_KIL) { if (s->Descr->RewriteDepthOut) { - if (inst->DstReg.File == PROGRAM_OUTPUT && inst->DstReg.Index == FRAG_RESULT_DEPR) + if (inst->DstReg.File == PROGRAM_OUTPUT && inst->DstReg.Index == FRAG_RESULT_DEPTH) rewrite_depth_out(inst); } diff --git a/src/mesa/drivers/dri/r300/radeon_program_pair.c b/src/mesa/drivers/dri/r300/radeon_program_pair.c index 58bc0d5843..365e7c1722 100644 --- a/src/mesa/drivers/dri/r300/radeon_program_pair.c +++ b/src/mesa/drivers/dri/r300/radeon_program_pair.c @@ -778,10 +778,10 @@ static void fill_dest_into_pair(struct pair_state *s, struct radeon_pair_instruc struct prog_instruction *inst = s->Program->Instructions + ip; if (inst->DstReg.File == PROGRAM_OUTPUT) { - if (inst->DstReg.Index == FRAG_RESULT_COLR) { + if (inst->DstReg.Index == FRAG_RESULT_COLOR) { pair->RGB.OutputWriteMask |= inst->DstReg.WriteMask & WRITEMASK_XYZ; pair->Alpha.OutputWriteMask |= GET_BIT(inst->DstReg.WriteMask, 3); - } else if (inst->DstReg.Index == FRAG_RESULT_DEPR) { + } else if (inst->DstReg.Index == FRAG_RESULT_DEPTH) { pair->Alpha.DepthWriteMask |= GET_BIT(inst->DstReg.WriteMask, 3); } } else { diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h index 22add9d975..f17b9e1e71 100644 --- a/src/mesa/main/mtypes.h +++ b/src/mesa/main/mtypes.h @@ -268,10 +268,9 @@ typedef enum */ typedef enum { - FRAG_RESULT_COLR = 0, - FRAG_RESULT_COLH = 1, - FRAG_RESULT_DEPR = 2, - FRAG_RESULT_DATA0 = 3, + FRAG_RESULT_DEPTH = 0, + FRAG_RESULT_COLOR = 1, + FRAG_RESULT_DATA0 = 2, FRAG_RESULT_MAX = (FRAG_RESULT_DATA0 + MAX_DRAW_BUFFERS) } gl_frag_result; diff --git a/src/mesa/main/texenvprogram.c b/src/mesa/main/texenvprogram.c index d2a9e35dd5..51c13a563d 100644 --- a/src/mesa/main/texenvprogram.c +++ b/src/mesa/main/texenvprogram.c @@ -1098,7 +1098,7 @@ emit_texenv(struct texenv_fragment_program *p, GLuint unit) rgb_shift) dest = get_temp( p ); else - dest = make_ureg(PROGRAM_OUTPUT, FRAG_RESULT_COLR); + dest = make_ureg(PROGRAM_OUTPUT, FRAG_RESULT_COLOR); /* Emit the RGB and A combine ops */ @@ -1278,7 +1278,7 @@ create_new_program(GLcontext *ctx, struct state_key *key, p.program->Base.Parameters = _mesa_new_parameter_list(); p.program->Base.InputsRead = 0; - p.program->Base.OutputsWritten = 1 << FRAG_RESULT_COLR; + p.program->Base.OutputsWritten = 1 << FRAG_RESULT_COLOR; for (unit = 0; unit < ctx->Const.MaxTextureUnits; unit++) p.src_texture[unit] = undef; @@ -1313,7 +1313,7 @@ create_new_program(GLcontext *ctx, struct state_key *key, } cf = get_source( &p, SRC_PREVIOUS, 0 ); - out = make_ureg( PROGRAM_OUTPUT, FRAG_RESULT_COLR ); + out = make_ureg( PROGRAM_OUTPUT, FRAG_RESULT_COLOR ); if (key->separate_specular) { /* Emit specular add. diff --git a/src/mesa/shader/arbprogparse.c b/src/mesa/shader/arbprogparse.c index 62edb7f595..ccc0318a53 100644 --- a/src/mesa/shader/arbprogparse.c +++ b/src/mesa/shader/arbprogparse.c @@ -1688,7 +1688,7 @@ parse_result_binding(GLcontext *ctx, const GLubyte **inst, */ parse_output_color_num(ctx, inst, Program, &out_color); ASSERT(out_color < MAX_DRAW_BUFFERS); - *outputReg = FRAG_RESULT_COLR; + *outputReg = FRAG_RESULT_COLOR; } else { /* for vtx programs, this is VERTEX_RESULT_POSITION */ @@ -1699,7 +1699,7 @@ parse_result_binding(GLcontext *ctx, const GLubyte **inst, case FRAGMENT_RESULT_DEPTH: if (Program->Base.Target == GL_FRAGMENT_PROGRAM_ARB) { /* for frag programs, this is FRAGMENT_RESULT_DEPTH */ - *outputReg = FRAG_RESULT_DEPR; + *outputReg = FRAG_RESULT_DEPTH; } else { /* for vtx programs, this is VERTEX_RESULT_COLOR */ diff --git a/src/mesa/shader/nvfragparse.c b/src/mesa/shader/nvfragparse.c index 20e4781372..37418ffb6e 100644 --- a/src/mesa/shader/nvfragparse.c +++ b/src/mesa/shader/nvfragparse.c @@ -384,18 +384,12 @@ static const char *InputRegisters[MAX_NV_FRAGMENT_PROGRAM_INPUTS + 1] = { "TEX0", "TEX1", "TEX2", "TEX3", "TEX4", "TEX5", "TEX6", "TEX7", NULL }; + static const char *OutputRegisters[MAX_NV_FRAGMENT_PROGRAM_OUTPUTS + 1] = { - "COLR", "COLH", - /* These are only allows for register combiners */ - /* - "TEX0", "TEX1", "TEX2", "TEX3", - */ - "DEPR", NULL + "DEPR", "COLR", "DATA0", NULL }; - - /**********************************************************************/ /** @@ -828,7 +822,6 @@ static GLboolean Parse_OutputReg(struct parse_state *parseState, GLint *outputRegNum) { GLubyte token[100]; - GLint j; /* Match "o[" */ if (!Parse_String(parseState, "o[")) @@ -839,19 +832,19 @@ Parse_OutputReg(struct parse_state *parseState, GLint *outputRegNum) RETURN_ERROR; /* try to match an output register name */ - for (j = 0; OutputRegisters[j]; j++) { - if (_mesa_strcmp((const char *) token, OutputRegisters[j]) == 0) { - static GLuint bothColors = (1 << FRAG_RESULT_COLR) | (1 << FRAG_RESULT_COLH); - *outputRegNum = j; - parseState->outputsWritten |= (1 << j); - if ((parseState->outputsWritten & bothColors) == bothColors) { - RETURN_ERROR1("Illegal to write to both o[COLR] and o[COLH]"); - } - break; - } + if (_mesa_strcmp((char *) token, "COLR") == 0 || + _mesa_strcmp((char *) token, "COLH") == 0) { + /* note that we don't distinguish between COLR and COLH */ + *outputRegNum = FRAG_RESULT_COLOR; + parseState->outputsWritten |= (1 << FRAG_RESULT_COLOR); } - if (!OutputRegisters[j]) + else if (_mesa_strcmp((char *) token, "DEPR") == 0) { + *outputRegNum = FRAG_RESULT_DEPTH; + parseState->outputsWritten |= (1 << FRAG_RESULT_DEPTH); + } + else { RETURN_ERROR1("Invalid output register name"); + } /* Match ']' */ if (!Parse_String(parseState, "]")) @@ -1826,10 +1819,3 @@ _mesa_nv_fragment_input_register_name(GLuint i) return InputRegisters[i]; } - -const char * -_mesa_nv_fragment_output_register_name(GLuint i) -{ - ASSERT(i < MAX_NV_FRAGMENT_PROGRAM_OUTPUTS); - return OutputRegisters[i]; -} diff --git a/src/mesa/shader/nvfragparse.h b/src/mesa/shader/nvfragparse.h index de45cf543d..ac97921080 100644 --- a/src/mesa/shader/nvfragparse.h +++ b/src/mesa/shader/nvfragparse.h @@ -44,9 +44,4 @@ _mesa_print_nv_fragment_program(const struct gl_fragment_program *program); extern const char * _mesa_nv_fragment_input_register_name(GLuint i); - -extern const char * -_mesa_nv_fragment_output_register_name(GLuint i); - - #endif diff --git a/src/mesa/shader/prog_debug.c b/src/mesa/shader/prog_debug.c index 7bcb2ef734..35ce37d5ce 100644 --- a/src/mesa/shader/prog_debug.c +++ b/src/mesa/shader/prog_debug.c @@ -222,20 +222,16 @@ _mesa_GetProgramRegisterfvMESA(GLenum target, "glGetProgramRegisterfvMESA(registerName)"); return; } - else if (_mesa_strcmp(reg, "o[COLR]") == 0) { + else if (_mesa_strcmp(reg, "o[COLR]") == 0 || + _mesa_strcmp(reg, "o[COLH]") == 0) { /* Fragment output color */ ctx->Driver.GetProgramRegister(ctx, PROGRAM_OUTPUT, - FRAG_RESULT_COLR, v); - } - else if (_mesa_strcmp(reg, "o[COLH]") == 0) { - /* Fragment output color */ - ctx->Driver.GetProgramRegister(ctx, PROGRAM_OUTPUT, - FRAG_RESULT_COLH, v); + FRAG_RESULT_COLOR, v); } else if (_mesa_strcmp(reg, "o[DEPR]") == 0) { /* Fragment output depth */ ctx->Driver.GetProgramRegister(ctx, PROGRAM_OUTPUT, - FRAG_RESULT_DEPR, v); + FRAG_RESULT_DEPTH, v); } else { /* try user-defined identifiers */ diff --git a/src/mesa/shader/program.c b/src/mesa/shader/program.c index 00655f0288..2e5632710e 100644 --- a/src/mesa/shader/program.c +++ b/src/mesa/shader/program.c @@ -738,7 +738,7 @@ _mesa_combine_programs(GLcontext *ctx, /* Connect color outputs of fprogA to color inputs of fprogB, via a * new temporary register. */ - if ((progA->OutputsWritten & (1 << FRAG_RESULT_COLR)) && + if ((progA->OutputsWritten & (1 << FRAG_RESULT_COLOR)) && (progB_inputsRead & FRAG_BIT_COL0)) { GLint tempReg = _mesa_find_free_register(newProg, PROGRAM_TEMPORARY); if (tempReg < 0) { @@ -748,7 +748,7 @@ _mesa_combine_programs(GLcontext *ctx, } /* replace writes to result.color[0] with tempReg */ replace_registers(newInst, lenA, - PROGRAM_OUTPUT, FRAG_RESULT_COLR, + PROGRAM_OUTPUT, FRAG_RESULT_COLOR, PROGRAM_TEMPORARY, tempReg); /* replace reads from the input color with tempReg */ replace_registers(newInst + lenA, lenB, @@ -758,7 +758,7 @@ _mesa_combine_programs(GLcontext *ctx, /* compute combined program's InputsRead */ inputsB = progB_inputsRead; - if (progA->OutputsWritten & (1 << FRAG_RESULT_COLR)) { + if (progA->OutputsWritten & (1 << FRAG_RESULT_COLOR)) { inputsB &= ~(1 << FRAG_ATTRIB_COL0); } newProg->InputsRead = progA->InputsRead | inputsB; diff --git a/src/mesa/shader/programopt.c b/src/mesa/shader/programopt.c index 56f1eb832e..05d9bdf7ec 100644 --- a/src/mesa/shader/programopt.c +++ b/src/mesa/shader/programopt.c @@ -171,7 +171,7 @@ _mesa_append_fog_code(GLcontext *ctx, struct gl_fragment_program *fprog) if (inst->Opcode == OPCODE_END) break; if (inst->DstReg.File == PROGRAM_OUTPUT && - inst->DstReg.Index == FRAG_RESULT_COLR) { + inst->DstReg.Index == FRAG_RESULT_COLOR) { /* change the instruction to write to colorTemp w/ clamping */ inst->DstReg.File = PROGRAM_TEMPORARY; inst->DstReg.Index = colorTemp; @@ -249,7 +249,7 @@ _mesa_append_fog_code(GLcontext *ctx, struct gl_fragment_program *fprog) /* LRP result.color.xyz, fogFactorTemp.xxxx, colorTemp, fogColorRef; */ inst->Opcode = OPCODE_LRP; inst->DstReg.File = PROGRAM_OUTPUT; - inst->DstReg.Index = FRAG_RESULT_COLR; + inst->DstReg.Index = FRAG_RESULT_COLOR; inst->DstReg.WriteMask = WRITEMASK_XYZ; inst->SrcReg[0].File = PROGRAM_TEMPORARY; inst->SrcReg[0].Index = fogFactorTemp; @@ -264,7 +264,7 @@ _mesa_append_fog_code(GLcontext *ctx, struct gl_fragment_program *fprog) /* MOV result.color.w, colorTemp.x; # copy alpha */ inst->Opcode = OPCODE_MOV; inst->DstReg.File = PROGRAM_OUTPUT; - inst->DstReg.Index = FRAG_RESULT_COLR; + inst->DstReg.Index = FRAG_RESULT_COLOR; inst->DstReg.WriteMask = WRITEMASK_W; inst->SrcReg[0].File = PROGRAM_TEMPORARY; inst->SrcReg[0].Index = colorTemp; diff --git a/src/mesa/shader/slang/slang_codegen.c b/src/mesa/shader/slang/slang_codegen.c index 5e2ce0ce3a..ee24e2e138 100644 --- a/src/mesa/shader/slang/slang_codegen.c +++ b/src/mesa/shader/slang/slang_codegen.c @@ -450,8 +450,8 @@ _slang_output_index(const char *name, GLenum target) { NULL, 0 } }; static const struct output_info fragOutputs[] = { - { "gl_FragColor", FRAG_RESULT_COLR }, - { "gl_FragDepth", FRAG_RESULT_DEPR }, + { "gl_FragColor", FRAG_RESULT_COLOR }, + { "gl_FragDepth", FRAG_RESULT_DEPTH }, { "gl_FragData", FRAG_RESULT_DATA0 }, { NULL, 0 } }; diff --git a/src/mesa/shader/slang/slang_link.c b/src/mesa/shader/slang/slang_link.c index bcabe71bfa..f98434892b 100644 --- a/src/mesa/shader/slang/slang_link.c +++ b/src/mesa/shader/slang/slang_link.c @@ -686,7 +686,7 @@ _slang_link(GLcontext *ctx, /* check that gl_FragColor and gl_FragData are not both written to */ if (shProg->FragmentProgram) { GLbitfield outputsWritten = shProg->FragmentProgram->Base.OutputsWritten; - if ((outputsWritten & ((1 << FRAG_RESULT_COLR))) && + if ((outputsWritten & ((1 << FRAG_RESULT_COLOR))) && (outputsWritten >= (1 << FRAG_RESULT_DATA0))) { link_error(shProg, "Fragment program cannot write both gl_FragColor" " and gl_FragData[].\n"); diff --git a/src/mesa/state_tracker/st_atom_pixeltransfer.c b/src/mesa/state_tracker/st_atom_pixeltransfer.c index ce872458e3..05b69c9d00 100644 --- a/src/mesa/state_tracker/st_atom_pixeltransfer.c +++ b/src/mesa/state_tracker/st_atom_pixeltransfer.c @@ -212,7 +212,7 @@ get_pixel_transfer_program(GLcontext *ctx, const struct state_key *key) inst[ic].TexSrcTarget = TEXTURE_2D_INDEX; ic++; fp->Base.InputsRead = (1 << FRAG_ATTRIB_TEX0); - fp->Base.OutputsWritten = (1 << FRAG_RESULT_COLR); + fp->Base.OutputsWritten = (1 << FRAG_RESULT_COLOR); fp->Base.SamplersUsed = 0x1; /* sampler 0 (bit 0) is used */ if (key->scaleAndBias) { @@ -400,7 +400,7 @@ get_pixel_transfer_program(GLcontext *ctx, const struct state_key *key) { struct prog_instruction *last = &inst[ic - 1]; last->DstReg.File = PROGRAM_OUTPUT; - last->DstReg.Index = FRAG_RESULT_COLR; + last->DstReg.Index = FRAG_RESULT_COLOR; } /* END; */ diff --git a/src/mesa/state_tracker/st_cb_drawpixels.c b/src/mesa/state_tracker/st_cb_drawpixels.c index c73d0080ca..cc7a9e7890 100644 --- a/src/mesa/state_tracker/st_cb_drawpixels.c +++ b/src/mesa/state_tracker/st_cb_drawpixels.c @@ -75,7 +75,7 @@ is_passthrough_program(const struct gl_fragment_program *prog) if (inst[0].Opcode == OPCODE_MOV && inst[1].Opcode == OPCODE_END && inst[0].DstReg.File == PROGRAM_OUTPUT && - inst[0].DstReg.Index == FRAG_RESULT_COLR && + inst[0].DstReg.Index == FRAG_RESULT_COLOR && inst[0].DstReg.WriteMask == WRITEMASK_XYZW && inst[0].SrcReg[0].File == PROGRAM_INPUT && inst[0].SrcReg[0].Index == FRAG_ATTRIB_COL0 && @@ -158,7 +158,7 @@ combined_drawpix_fragment_program(GLcontext *ctx) /** * Create fragment shader that does a TEX() instruction to get a Z - * value, then writes to FRAG_RESULT_DEPR. + * value, then writes to FRAG_RESULT_DEPTH. * Pass fragment color through as-is. */ static struct st_fragment_program * @@ -191,7 +191,7 @@ make_fragment_shader_z(struct st_context *st) /* TEX result.depth, fragment.texcoord[0], texture[0], 2D; */ p->Instructions[ic].Opcode = OPCODE_TEX; p->Instructions[ic].DstReg.File = PROGRAM_OUTPUT; - p->Instructions[ic].DstReg.Index = FRAG_RESULT_DEPR; + p->Instructions[ic].DstReg.Index = FRAG_RESULT_DEPTH; p->Instructions[ic].DstReg.WriteMask = WRITEMASK_Z; p->Instructions[ic].SrcReg[0].File = PROGRAM_INPUT; p->Instructions[ic].SrcReg[0].Index = FRAG_ATTRIB_TEX0; @@ -202,7 +202,7 @@ make_fragment_shader_z(struct st_context *st) /* MOV result.color, fragment.color */ p->Instructions[ic].Opcode = OPCODE_MOV; p->Instructions[ic].DstReg.File = PROGRAM_OUTPUT; - p->Instructions[ic].DstReg.Index = FRAG_RESULT_COLR; + p->Instructions[ic].DstReg.Index = FRAG_RESULT_COLOR; p->Instructions[ic].SrcReg[0].File = PROGRAM_INPUT; p->Instructions[ic].SrcReg[0].Index = FRAG_ATTRIB_COL0; ic++; @@ -213,7 +213,7 @@ make_fragment_shader_z(struct st_context *st) assert(ic == p->NumInstructions); p->InputsRead = FRAG_BIT_TEX0 | FRAG_BIT_COL0; - p->OutputsWritten = (1 << FRAG_RESULT_COLR) | (1 << FRAG_RESULT_DEPR); + p->OutputsWritten = (1 << FRAG_RESULT_COLOR) | (1 << FRAG_RESULT_DEPTH); p->SamplersUsed = 0x1; /* sampler 0 (bit 0) is used */ st->drawpix.z_shader = (struct st_fragment_program *) p; diff --git a/src/mesa/state_tracker/st_program.c b/src/mesa/state_tracker/st_program.c index d2535b6a2f..f825204915 100644 --- a/src/mesa/state_tracker/st_program.c +++ b/src/mesa/state_tracker/st_program.c @@ -466,23 +466,23 @@ st_translate_fragment_program(struct st_context *st, GLbitfield outputsWritten = stfp->Base.Base.OutputsWritten; /* if z is written, emit that first */ - if (outputsWritten & (1 << FRAG_RESULT_DEPR)) { + if (outputsWritten & (1 << FRAG_RESULT_DEPTH)) { fs_output_semantic_name[fs_num_outputs] = TGSI_SEMANTIC_POSITION; fs_output_semantic_index[fs_num_outputs] = 0; - outputMapping[FRAG_RESULT_DEPR] = fs_num_outputs; + outputMapping[FRAG_RESULT_DEPTH] = fs_num_outputs; fs_num_outputs++; - outputsWritten &= ~(1 << FRAG_RESULT_DEPR); + outputsWritten &= ~(1 << FRAG_RESULT_DEPTH); } /* handle remaning outputs (color) */ for (attr = 0; attr < FRAG_RESULT_MAX; attr++) { if (outputsWritten & (1 << attr)) { switch (attr) { - case FRAG_RESULT_DEPR: + case FRAG_RESULT_DEPTH: /* handled above */ assert(0); break; - case FRAG_RESULT_COLR: + case FRAG_RESULT_COLOR: fs_output_semantic_name[fs_num_outputs] = TGSI_SEMANTIC_COLOR; fs_output_semantic_index[fs_num_outputs] = numColors; outputMapping[attr] = fs_num_outputs; diff --git a/src/mesa/swrast/s_context.c b/src/mesa/swrast/s_context.c index 297940adbd..719e6b8296 100644 --- a/src/mesa/swrast/s_context.c +++ b/src/mesa/swrast/s_context.c @@ -206,7 +206,7 @@ _swrast_update_deferred_texture(GLcontext *ctx) else { const struct gl_fragment_program *fprog = ctx->FragmentProgram._Current; - if (fprog && (fprog->Base.OutputsWritten & (1 << FRAG_RESULT_DEPR))) { + if (fprog && (fprog->Base.OutputsWritten & (1 << FRAG_RESULT_DEPTH))) { /* Z comes from fragment program/shader */ swrast->_DeferredTexture = GL_FALSE; } diff --git a/src/mesa/swrast/s_fragprog.c b/src/mesa/swrast/s_fragprog.c index c6601f5593..3735f041d6 100644 --- a/src/mesa/swrast/s_fragprog.c +++ b/src/mesa/swrast/s_fragprog.c @@ -202,9 +202,9 @@ run_program(GLcontext *ctx, SWspan *span, GLuint start, GLuint end) if (_mesa_execute_program(ctx, &program->Base, machine)) { /* Store result color */ - if (outputsWritten & (1 << FRAG_RESULT_COLR)) { + if (outputsWritten & (1 << FRAG_RESULT_COLOR)) { COPY_4V(span->array->attribs[FRAG_ATTRIB_COL0][i], - machine->Outputs[FRAG_RESULT_COLR]); + machine->Outputs[FRAG_RESULT_COLOR]); } else { /* Multiple drawbuffers / render targets @@ -221,8 +221,8 @@ run_program(GLcontext *ctx, SWspan *span, GLuint start, GLuint end) } /* Store result depth/z */ - if (outputsWritten & (1 << FRAG_RESULT_DEPR)) { - const GLfloat depth = machine->Outputs[FRAG_RESULT_DEPR][2]; + if (outputsWritten & (1 << FRAG_RESULT_DEPTH)) { + const GLfloat depth = machine->Outputs[FRAG_RESULT_DEPTH][2]; if (depth <= 0.0) span->array->z[i] = 0; else if (depth >= 1.0) @@ -259,12 +259,12 @@ _swrast_exec_fragment_program( GLcontext *ctx, SWspan *span ) run_program(ctx, span, 0, span->end); - if (program->Base.OutputsWritten & (1 << FRAG_RESULT_COLR)) { + if (program->Base.OutputsWritten & (1 << FRAG_RESULT_COLOR)) { span->interpMask &= ~SPAN_RGBA; span->arrayMask |= SPAN_RGBA; } - if (program->Base.OutputsWritten & (1 << FRAG_RESULT_DEPR)) { + if (program->Base.OutputsWritten & (1 << FRAG_RESULT_DEPTH)) { span->interpMask &= ~SPAN_Z; span->arrayMask |= SPAN_Z; } -- cgit v1.2.3 From 91e61f435a71436c209934a0ece165b540aba3e0 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Mon, 2 Mar 2009 11:47:52 -0700 Subject: mesa: use Stencil._Enabled field instead of Stencil.Enabled --- src/mesa/drivers/common/driverfuncs.c | 2 +- src/mesa/drivers/dri/ffb/ffb_state.c | 4 ++-- src/mesa/drivers/dri/i965/brw_cc.c | 2 +- src/mesa/drivers/dri/i965/brw_fallback.c | 2 +- src/mesa/drivers/dri/i965/brw_wm.c | 2 +- src/mesa/drivers/dri/intel/intel_buffers.c | 4 ++-- src/mesa/drivers/dri/intel/intel_pixel.c | 2 +- src/mesa/drivers/dri/intel/intel_pixel_copy.c | 2 +- src/mesa/drivers/dri/intel/intel_pixel_draw.c | 2 +- src/mesa/drivers/dri/mga/mgapixel.c | 2 +- src/mesa/drivers/dri/r200/r200_pixel.c | 2 +- src/mesa/drivers/dri/r300/r300_state.c | 2 +- src/mesa/drivers/dri/savage/savagestate.c | 4 ++-- src/mesa/drivers/dri/tdfx/tdfx_pixels.c | 2 +- src/mesa/drivers/dri/tdfx/tdfx_render.c | 2 +- src/mesa/drivers/dri/tdfx/tdfx_state.c | 2 +- src/mesa/drivers/dri/unichrome/via_state.c | 2 +- src/mesa/drivers/ggi/default/stubs.c | 2 +- src/mesa/drivers/glide/fxdd.c | 2 +- src/mesa/swrast/s_context.c | 2 +- src/mesa/swrast/s_span.c | 8 ++++---- src/mesa/swrast/s_triangle.c | 2 +- 22 files changed, 28 insertions(+), 28 deletions(-) (limited to 'src/mesa/swrast/s_context.c') diff --git a/src/mesa/drivers/common/driverfuncs.c b/src/mesa/drivers/common/driverfuncs.c index 986f751bdc..9bee212c6a 100644 --- a/src/mesa/drivers/common/driverfuncs.c +++ b/src/mesa/drivers/common/driverfuncs.c @@ -308,7 +308,7 @@ _mesa_init_driver_state(GLcontext *ctx) ctx->Driver.Enable(ctx, GL_LINE_SMOOTH, ctx->Line.SmoothFlag); ctx->Driver.Enable(ctx, GL_POLYGON_STIPPLE, ctx->Polygon.StippleFlag); ctx->Driver.Enable(ctx, GL_SCISSOR_TEST, ctx->Scissor.Enabled); - ctx->Driver.Enable(ctx, GL_STENCIL_TEST, ctx->Stencil.Enabled); + ctx->Driver.Enable(ctx, GL_STENCIL_TEST, ctx->Stencil._Enabled); ctx->Driver.Enable(ctx, GL_TEXTURE_1D, GL_FALSE); ctx->Driver.Enable(ctx, GL_TEXTURE_2D, GL_FALSE); ctx->Driver.Enable(ctx, GL_TEXTURE_RECTANGLE_NV, GL_FALSE); diff --git a/src/mesa/drivers/dri/ffb/ffb_state.c b/src/mesa/drivers/dri/ffb/ffb_state.c index ee0fe4e0db..5eb8f417ff 100644 --- a/src/mesa/drivers/dri/ffb/ffb_state.c +++ b/src/mesa/drivers/dri/ffb/ffb_state.c @@ -275,7 +275,7 @@ ffbDDStencilFuncSeparate(GLcontext *ctx, GLenum face, GLenum func, /* We will properly update sw/hw state when stenciling is * enabled. */ - if (! ctx->Stencil.Enabled) + if (! ctx->Stencil._Enabled) return; stencilctl = fmesa->stencilctl; @@ -333,7 +333,7 @@ ffbDDStencilOpSeparate(GLcontext *ctx, GLenum face, GLenum fail, /* We will properly update sw/hw state when stenciling is * enabled. */ - if (! ctx->Stencil.Enabled) + if (! ctx->Stencil._Enabled) return; stencilctl = fmesa->stencilctl; diff --git a/src/mesa/drivers/dri/i965/brw_cc.c b/src/mesa/drivers/dri/i965/brw_cc.c index 82370162f5..c724218cf5 100644 --- a/src/mesa/drivers/dri/i965/brw_cc.c +++ b/src/mesa/drivers/dri/i965/brw_cc.c @@ -88,7 +88,7 @@ cc_unit_populate_key(struct brw_context *brw, struct brw_cc_unit_key *key) memset(key, 0, sizeof(*key)); - key->stencil = ctx->Stencil.Enabled; + key->stencil = ctx->Stencil._Enabled; key->stencil_two_side = ctx->Stencil._TestTwoSide; if (key->stencil) { diff --git a/src/mesa/drivers/dri/i965/brw_fallback.c b/src/mesa/drivers/dri/i965/brw_fallback.c index 5f4f2d515d..299357409c 100644 --- a/src/mesa/drivers/dri/i965/brw_fallback.c +++ b/src/mesa/drivers/dri/i965/brw_fallback.c @@ -75,7 +75,7 @@ static GLboolean do_check_fallback(struct brw_context *brw) /* _NEW_STENCIL */ - if (ctx->Stencil.Enabled && + if (ctx->Stencil._Enabled && (ctx->DrawBuffer->Name == 0 && !brw->intel.hw_stencil)) { DBG("FALLBACK: stencil\n"); return GL_TRUE; diff --git a/src/mesa/drivers/dri/i965/brw_wm.c b/src/mesa/drivers/dri/i965/brw_wm.c index 06a6f3f0f4..879000644b 100644 --- a/src/mesa/drivers/dri/i965/brw_wm.c +++ b/src/mesa/drivers/dri/i965/brw_wm.c @@ -210,7 +210,7 @@ static void brw_wm_populate_key( struct brw_context *brw, lookup |= IZ_DEPTH_WRITE_ENABLE_BIT; /* _NEW_STENCIL */ - if (ctx->Stencil.Enabled) { + if (ctx->Stencil._Enabled) { lookup |= IZ_STENCIL_TEST_ENABLE_BIT; if (ctx->Stencil.WriteMask[0] || diff --git a/src/mesa/drivers/dri/intel/intel_buffers.c b/src/mesa/drivers/dri/intel/intel_buffers.c index 7f2144abd4..732bae5b5a 100644 --- a/src/mesa/drivers/dri/intel/intel_buffers.c +++ b/src/mesa/drivers/dri/intel/intel_buffers.c @@ -263,7 +263,7 @@ intel_draw_buffer(GLcontext * ctx, struct gl_framebuffer *fb) } } else { - /* XXX FBO: instead of FALSE, pass ctx->Stencil.Enabled ??? */ + /* XXX FBO: instead of FALSE, pass ctx->Stencil._Enabled ??? */ FALLBACK(intel, INTEL_FALLBACK_STENCIL_BUFFER, GL_FALSE); } @@ -274,7 +274,7 @@ intel_draw_buffer(GLcontext * ctx, struct gl_framebuffer *fb) ctx->Driver.Enable(ctx, GL_DEPTH_TEST, (ctx->Depth.Test && fb->Visual.depthBits > 0)); ctx->Driver.Enable(ctx, GL_STENCIL_TEST, - (ctx->Stencil.Enabled && fb->Visual.stencilBits > 0)); + (ctx->Stencil._Enabled && fb->Visual.stencilBits > 0)); } else { ctx->NewState |= (_NEW_DEPTH | _NEW_STENCIL); diff --git a/src/mesa/drivers/dri/intel/intel_pixel.c b/src/mesa/drivers/dri/intel/intel_pixel.c index 5e32288844..9f4b4ff0ba 100644 --- a/src/mesa/drivers/dri/intel/intel_pixel.c +++ b/src/mesa/drivers/dri/intel/intel_pixel.c @@ -112,7 +112,7 @@ intel_check_blit_fragment_ops(GLcontext * ctx, GLboolean src_alpha_is_one) return GL_FALSE; } - if (ctx->Stencil.Enabled) { + if (ctx->Stencil._Enabled) { DBG("fallback due to image stencil\n"); return GL_FALSE; } diff --git a/src/mesa/drivers/dri/intel/intel_pixel_copy.c b/src/mesa/drivers/dri/intel/intel_pixel_copy.c index 7c7aa6097c..d50dd68092 100644 --- a/src/mesa/drivers/dri/intel/intel_pixel_copy.c +++ b/src/mesa/drivers/dri/intel/intel_pixel_copy.c @@ -87,7 +87,7 @@ intel_check_copypixel_blit_fragment_ops(GLcontext * ctx) ctx->Color.AlphaEnabled || ctx->Depth.Test || ctx->Fog.Enabled || - ctx->Stencil.Enabled || + ctx->Stencil._Enabled || !ctx->Color.ColorMask[0] || !ctx->Color.ColorMask[1] || !ctx->Color.ColorMask[2] || diff --git a/src/mesa/drivers/dri/intel/intel_pixel_draw.c b/src/mesa/drivers/dri/intel/intel_pixel_draw.c index 7be7ea82b3..e8d5ac8569 100644 --- a/src/mesa/drivers/dri/intel/intel_pixel_draw.c +++ b/src/mesa/drivers/dri/intel/intel_pixel_draw.c @@ -233,7 +233,7 @@ intel_stencil_drawpixels(GLcontext * ctx, } /* We don't support stencil testing/ops here */ - if (ctx->Stencil.Enabled) + if (ctx->Stencil._Enabled) return GL_FALSE; /* We use FBOs for our wrapping of the depthbuffer into a color diff --git a/src/mesa/drivers/dri/mga/mgapixel.c b/src/mesa/drivers/dri/mga/mgapixel.c index 9f90047ba5..977dfa0b76 100644 --- a/src/mesa/drivers/dri/mga/mgapixel.c +++ b/src/mesa/drivers/dri/mga/mgapixel.c @@ -133,7 +133,7 @@ check_color_per_fragment_ops( const GLcontext *ctx ) ctx->Depth.Test || ctx->Fog.Enabled || ctx->Scissor.Enabled || - ctx->Stencil.Enabled || + ctx->Stencil._Enabled || !ctx->Color.ColorMask[0] || !ctx->Color.ColorMask[1] || !ctx->Color.ColorMask[2] || diff --git a/src/mesa/drivers/dri/r200/r200_pixel.c b/src/mesa/drivers/dri/r200/r200_pixel.c index be68821dc1..2797cbb3dc 100644 --- a/src/mesa/drivers/dri/r200/r200_pixel.c +++ b/src/mesa/drivers/dri/r200/r200_pixel.c @@ -87,7 +87,7 @@ check_color_per_fragment_ops( const GLcontext *ctx ) ctx->Depth.Test || ctx->Fog.Enabled || ctx->Scissor.Enabled || - ctx->Stencil.Enabled || + ctx->Stencil._Enabled || !ctx->Color.ColorMask[0] || !ctx->Color.ColorMask[1] || !ctx->Color.ColorMask[2] || diff --git a/src/mesa/drivers/dri/r300/r300_state.c b/src/mesa/drivers/dri/r300/r300_state.c index ade45f581c..37dae6c886 100644 --- a/src/mesa/drivers/dri/r300/r300_state.c +++ b/src/mesa/drivers/dri/r300/r300_state.c @@ -2205,7 +2205,7 @@ static void r300ResetHwState(r300ContextPtr r300) r300DepthFunc(ctx, ctx->Depth.Func); /* stencil */ - r300Enable(ctx, GL_STENCIL_TEST, ctx->Stencil.Enabled); + r300Enable(ctx, GL_STENCIL_TEST, ctx->Stencil._Enabled); r300StencilMaskSeparate(ctx, 0, ctx->Stencil.WriteMask[0]); r300StencilFuncSeparate(ctx, 0, ctx->Stencil.Function[0], ctx->Stencil.Ref[0], ctx->Stencil.ValueMask[0]); diff --git a/src/mesa/drivers/dri/savage/savagestate.c b/src/mesa/drivers/dri/savage/savagestate.c index 73d85ed57b..84e1b52585 100644 --- a/src/mesa/drivers/dri/savage/savagestate.c +++ b/src/mesa/drivers/dri/savage/savagestate.c @@ -514,7 +514,7 @@ static void savageDDDepthFunc_s4(GLcontext *ctx, GLenum func) imesa->regs.s4.drawLocalCtrl.ni.flushPdZbufWrites = GL_TRUE; imesa->regs.s4.zBufCtrl.ni.zBufEn = GL_TRUE; } - else if (imesa->glCtx->Stencil.Enabled && imesa->hw_stencil) + else if (imesa->glCtx->Stencil._Enabled && imesa->hw_stencil) { /* Need to keep Z on for Stencil. */ imesa->regs.s4.zBufCtrl.ni.zCmpFunc = CF_Always; @@ -1092,7 +1092,7 @@ static void savageDDEnable_s4(GLcontext *ctx, GLenum cap, GLboolean state) FALLBACK (ctx, SAVAGE_FALLBACK_STENCIL, state); else { imesa->regs.s4.stencilCtrl.ni.stencilEn = state; - if (ctx->Stencil.Enabled && + if (ctx->Stencil._Enabled && imesa->regs.s4.zBufCtrl.ni.zBufEn != GL_TRUE) { /* Stencil buffer requires Z enabled. */ diff --git a/src/mesa/drivers/dri/tdfx/tdfx_pixels.c b/src/mesa/drivers/dri/tdfx/tdfx_pixels.c index 9ab9c05f2b..18729d5ae0 100644 --- a/src/mesa/drivers/dri/tdfx/tdfx_pixels.c +++ b/src/mesa/drivers/dri/tdfx/tdfx_pixels.c @@ -610,7 +610,7 @@ tdfx_drawpixels_R8G8B8A8(GLcontext * ctx, GLint x, GLint y, ctx->Depth.Test || ctx->Fog.Enabled || ctx->Scissor.Enabled || - ctx->Stencil.Enabled || + ctx->Stencil._Enabled || !ctx->Color.ColorMask[0] || !ctx->Color.ColorMask[1] || !ctx->Color.ColorMask[2] || diff --git a/src/mesa/drivers/dri/tdfx/tdfx_render.c b/src/mesa/drivers/dri/tdfx/tdfx_render.c index cf840c57a7..2cd8e12d95 100644 --- a/src/mesa/drivers/dri/tdfx/tdfx_render.c +++ b/src/mesa/drivers/dri/tdfx/tdfx_render.c @@ -740,7 +740,7 @@ void tdfxEmitHwStateLocked( tdfxContextPtr fxMesa ) } if ( fxMesa->dirty & TDFX_UPLOAD_STENCIL ) { - if (fxMesa->glCtx->Stencil.Enabled) { + if (fxMesa->glCtx->Stencil._Enabled) { fxMesa->Glide.grEnable(GR_STENCIL_MODE_EXT); fxMesa->Glide.grStencilOp(fxMesa->Stencil.FailFunc, fxMesa->Stencil.ZFailFunc, diff --git a/src/mesa/drivers/dri/tdfx/tdfx_state.c b/src/mesa/drivers/dri/tdfx/tdfx_state.c index a2d7bcd97d..591df8a905 100644 --- a/src/mesa/drivers/dri/tdfx/tdfx_state.c +++ b/src/mesa/drivers/dri/tdfx/tdfx_state.c @@ -459,7 +459,7 @@ static void tdfxUpdateStencil( GLcontext *ctx ) } if (fxMesa->haveHwStencil) { - if (ctx->Stencil.Enabled) { + if (ctx->Stencil._Enabled) { fxMesa->Stencil.Function = ctx->Stencil.Function[0] - GL_NEVER + GR_CMP_NEVER; fxMesa->Stencil.RefValue = ctx->Stencil.Ref[0] & 0xff; fxMesa->Stencil.ValueMask = ctx->Stencil.ValueMask[0] & 0xff; diff --git a/src/mesa/drivers/dri/unichrome/via_state.c b/src/mesa/drivers/dri/unichrome/via_state.c index 1cef01ab03..840e4e42da 100644 --- a/src/mesa/drivers/dri/unichrome/via_state.c +++ b/src/mesa/drivers/dri/unichrome/via_state.c @@ -1342,7 +1342,7 @@ static void viaChooseStencilState(GLcontext *ctx) { struct via_context *vmesa = VIA_CONTEXT(ctx); - if (ctx->Stencil.Enabled) { + if (ctx->Stencil._Enabled) { GLuint temp; vmesa->regEnable |= HC_HenST_MASK; diff --git a/src/mesa/drivers/ggi/default/stubs.c b/src/mesa/drivers/ggi/default/stubs.c index 7b442b6d20..62722972b2 100644 --- a/src/mesa/drivers/ggi/default/stubs.c +++ b/src/mesa/drivers/ggi/default/stubs.c @@ -472,7 +472,7 @@ static void GGItriangle_flat_depth(GLcontext *ctx, const SWvertex *v0, const SWv static swrast_tri_func ggimesa_stubs_get_triangle_func(GLcontext *ctx) { - if (ctx->Stencil.Enabled) return NULL; + if (ctx->Stencil._Enabled) return NULL; if (ctx->Polygon.SmoothFlag) return NULL; if (ctx->Polygon.StippleFlag) return NULL; if (ctx->Texture._ReallyEnabled) return NULL; diff --git a/src/mesa/drivers/glide/fxdd.c b/src/mesa/drivers/glide/fxdd.c index 338cd37382..1bcf2512a6 100644 --- a/src/mesa/drivers/glide/fxdd.c +++ b/src/mesa/drivers/glide/fxdd.c @@ -1948,7 +1948,7 @@ fx_check_IsInHardware(GLcontext * ctx) return FX_FALLBACK_RENDER_MODE; } - if (ctx->Stencil.Enabled && !fxMesa->haveHwStencil) { + if (ctx->Stencil._Enabled && !fxMesa->haveHwStencil) { return FX_FALLBACK_STENCIL; } diff --git a/src/mesa/swrast/s_context.c b/src/mesa/swrast/s_context.c index 719e6b8296..4dbccbb2d5 100644 --- a/src/mesa/swrast/s_context.c +++ b/src/mesa/swrast/s_context.c @@ -61,7 +61,7 @@ _swrast_update_rasterflags( GLcontext *ctx ) if (ctx->Depth.Test) rasterMask |= DEPTH_BIT; if (swrast->_FogEnabled) rasterMask |= FOG_BIT; if (ctx->Scissor.Enabled) rasterMask |= CLIP_BIT; - if (ctx->Stencil.Enabled) rasterMask |= STENCIL_BIT; + if (ctx->Stencil._Enabled) rasterMask |= STENCIL_BIT; if (ctx->Visual.rgbMode) { const GLuint colorMask = *((GLuint *) &ctx->Color.ColorMask); if (colorMask != 0xffffffff) rasterMask |= MASKING_BIT; diff --git a/src/mesa/swrast/s_span.c b/src/mesa/swrast/s_span.c index 43e0721ec9..5e1f412d6b 100644 --- a/src/mesa/swrast/s_span.c +++ b/src/mesa/swrast/s_span.c @@ -846,11 +846,11 @@ _swrast_write_index_span( GLcontext *ctx, SWspan *span) } /* Stencil and Z testing */ - if (ctx->Depth.Test || ctx->Stencil.Enabled) { + if (ctx->Stencil._Enabled || ctx->Depth.Test) { if (!(span->arrayMask & SPAN_Z)) _swrast_span_interpolate_z(ctx, span); - if (ctx->Stencil.Enabled) { + if (ctx->Stencil._Enabled) { if (!_swrast_stencil_and_ztest_span(ctx, span)) { span->arrayMask = origArrayMask; return; @@ -1317,11 +1317,11 @@ _swrast_write_rgba_span( GLcontext *ctx, SWspan *span) } /* Stencil and Z testing */ - if (ctx->Stencil.Enabled || ctx->Depth.Test) { + if (ctx->Stencil._Enabled || ctx->Depth.Test) { if (!(span->arrayMask & SPAN_Z)) _swrast_span_interpolate_z(ctx, span); - if (ctx->Stencil.Enabled && fb->Visual.stencilBits > 0) { + if (ctx->Stencil._Enabled) { /* Combined Z/stencil tests */ if (!_swrast_stencil_and_ztest_span(ctx, span)) { /* all fragments failed test */ diff --git a/src/mesa/swrast/s_triangle.c b/src/mesa/swrast/s_triangle.c index c97cd4dfe7..9260e35066 100644 --- a/src/mesa/swrast/s_triangle.c +++ b/src/mesa/swrast/s_triangle.c @@ -1022,7 +1022,7 @@ _swrast_choose_triangle( GLcontext *ctx ) ctx->Depth.Test && ctx->Depth.Mask == GL_FALSE && ctx->Depth.Func == GL_LESS && - !ctx->Stencil.Enabled) { + !ctx->Stencil._Enabled) { if ((rgbmode && ctx->Color.ColorMask[0] == 0 && ctx->Color.ColorMask[1] == 0 && -- cgit v1.2.3 From de2afd8688ceb45013d15be7c6e0995199b80e5a Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Sun, 8 Mar 2009 13:49:57 -0600 Subject: swrast: do texture sampling/combining in floating point The code's cleaner and a step toward supporting float-valued texture sampling. Some optimizations for common cases can be added and re-enabled... --- src/mesa/main/colormac.h | 9 - src/mesa/swrast/s_atifragshader.c | 7 +- src/mesa/swrast/s_context.c | 4 +- src/mesa/swrast/s_context.h | 4 +- src/mesa/swrast/s_fragprog.c | 19 +- src/mesa/swrast/s_texcombine.c | 827 +++++++++++++++----------------------- src/mesa/swrast/s_texfilter.c | 414 +++++++++---------- src/mesa/tnl/t_vb_program.c | 7 +- 8 files changed, 512 insertions(+), 779 deletions(-) (limited to 'src/mesa/swrast/s_context.c') diff --git a/src/mesa/main/colormac.h b/src/mesa/main/colormac.h index 74692e9a98..815624ee50 100644 --- a/src/mesa/main/colormac.h +++ b/src/mesa/main/colormac.h @@ -71,9 +71,6 @@ /** \def COPY_CHAN4 * Copy a GLchan[4] array */ -/** \def CHAN_PRODUCT - * Scaled product (usually approximated) between two GLchan arguments */ - #if CHAN_BITS == 8 #define BYTE_TO_CHAN(b) ((b) < 0 ? 0 : (GLchan) (b)) @@ -91,8 +88,6 @@ #define COPY_CHAN4(DST, SRC) COPY_4UBV(DST, SRC) -#define CHAN_PRODUCT(a, b) ((GLubyte) (((GLint)(a) * ((GLint)(b) + 1)) >> 8)) - #elif CHAN_BITS == 16 #define BYTE_TO_CHAN(b) ((b) < 0 ? 0 : (((GLchan) (b)) * 516)) @@ -110,8 +105,6 @@ #define COPY_CHAN4(DST, SRC) COPY_4V(DST, SRC) -#define CHAN_PRODUCT(a, b) ((GLchan) ((((GLuint) (a)) * ((GLuint) (b))) / 65535)) - #elif CHAN_BITS == 32 /* XXX floating-point color channels not fully thought-out */ @@ -130,8 +123,6 @@ #define COPY_CHAN4(DST, SRC) COPY_4V(DST, SRC) -#define CHAN_PRODUCT(a, b) ((a) * (b)) - #else #error unexpected CHAN_BITS size diff --git a/src/mesa/swrast/s_atifragshader.c b/src/mesa/swrast/s_atifragshader.c index 458fe18163..5fefae6c42 100644 --- a/src/mesa/swrast/s_atifragshader.c +++ b/src/mesa/swrast/s_atifragshader.c @@ -47,17 +47,12 @@ static void fetch_texel(GLcontext * ctx, const GLfloat texcoord[4], GLfloat lambda, GLuint unit, GLfloat color[4]) { - GLchan rgba[4]; SWcontext *swrast = SWRAST_CONTEXT(ctx); /* XXX use a float-valued TextureSample routine here!!! */ swrast->TextureSample[unit](ctx, ctx->Texture.Unit[unit]._Current, 1, (const GLfloat(*)[4]) texcoord, - &lambda, &rgba); - color[0] = CHAN_TO_FLOAT(rgba[0]); - color[1] = CHAN_TO_FLOAT(rgba[1]); - color[2] = CHAN_TO_FLOAT(rgba[2]); - color[3] = CHAN_TO_FLOAT(rgba[3]); + &lambda, (GLfloat (*)[4]) color); } static void diff --git a/src/mesa/swrast/s_context.c b/src/mesa/swrast/s_context.c index 4dbccbb2d5..0257abc34a 100644 --- a/src/mesa/swrast/s_context.c +++ b/src/mesa/swrast/s_context.c @@ -820,8 +820,8 @@ _swrast_CreateContext( GLcontext *ctx ) swrast->PointSpan.facing = 0; swrast->PointSpan.array = swrast->SpanArrays; - swrast->TexelBuffer = (GLchan *) MALLOC(ctx->Const.MaxTextureImageUnits * - MAX_WIDTH * 4 * sizeof(GLchan)); + swrast->TexelBuffer = (GLfloat *) MALLOC(ctx->Const.MaxTextureImageUnits * + MAX_WIDTH * 4 * sizeof(GLfloat)); if (!swrast->TexelBuffer) { FREE(swrast->SpanArrays); FREE(swrast); diff --git a/src/mesa/swrast/s_context.h b/src/mesa/swrast/s_context.h index 6e8d080704..4cf57c6fc6 100644 --- a/src/mesa/swrast/s_context.h +++ b/src/mesa/swrast/s_context.h @@ -52,7 +52,7 @@ typedef void (*texture_sample_func)(GLcontext *ctx, const struct gl_texture_object *tObj, GLuint n, const GLfloat texcoords[][4], - const GLfloat lambda[], GLchan rgba[][4]); + const GLfloat lambda[], GLfloat rgba[][4]); typedef void (_ASMAPIP blend_func)( GLcontext *ctx, GLuint n, const GLubyte mask[], @@ -221,7 +221,7 @@ typedef struct /** Buffer for saving the sampled texture colors. * Needed for GL_ARB_texture_env_crossbar implementation. */ - GLchan *TexelBuffer; + GLfloat *TexelBuffer; validate_texture_image_func ValidateTextureImage; diff --git a/src/mesa/swrast/s_fragprog.c b/src/mesa/swrast/s_fragprog.c index ae1dea16a0..5f032bbd69 100644 --- a/src/mesa/swrast/s_fragprog.c +++ b/src/mesa/swrast/s_fragprog.c @@ -37,20 +37,17 @@ * and return results in 'colorOut'. */ static INLINE void -swizzle_texel(const GLchan texel[4], GLfloat colorOut[4], GLuint swizzle) +swizzle_texel(const GLfloat texel[4], GLfloat colorOut[4], GLuint swizzle) { if (swizzle == SWIZZLE_NOOP) { - colorOut[0] = CHAN_TO_FLOAT(texel[0]); - colorOut[1] = CHAN_TO_FLOAT(texel[1]); - colorOut[2] = CHAN_TO_FLOAT(texel[2]); - colorOut[3] = CHAN_TO_FLOAT(texel[3]); + COPY_4V(colorOut, texel); } else { GLfloat vector[6]; - vector[SWIZZLE_X] = CHAN_TO_FLOAT(texel[0]); - vector[SWIZZLE_Y] = CHAN_TO_FLOAT(texel[1]); - vector[SWIZZLE_Z] = CHAN_TO_FLOAT(texel[2]); - vector[SWIZZLE_W] = CHAN_TO_FLOAT(texel[3]); + vector[SWIZZLE_X] = texel[0]; + vector[SWIZZLE_Y] = texel[1]; + vector[SWIZZLE_Z] = texel[2]; + vector[SWIZZLE_W] = texel[3]; vector[SWIZZLE_ZERO] = 0.0F; vector[SWIZZLE_ONE] = 1.0F; colorOut[0] = vector[GET_SWZ(swizzle, 0)]; @@ -73,7 +70,7 @@ fetch_texel_lod( GLcontext *ctx, const GLfloat texcoord[4], GLfloat lambda, if (texObj) { SWcontext *swrast = SWRAST_CONTEXT(ctx); - GLchan rgba[4]; + GLfloat rgba[4]; lambda = CLAMP(lambda, texObj->MinLod, texObj->MaxLod); @@ -108,7 +105,7 @@ fetch_texel_deriv( GLcontext *ctx, const GLfloat texcoord[4], const GLfloat texW = (GLfloat) texImg->WidthScale; const GLfloat texH = (GLfloat) texImg->HeightScale; GLfloat lambda; - GLchan rgba[4]; + GLfloat rgba[4]; lambda = _swrast_compute_lambda(texdx[0], texdy[0], /* ds/dx, ds/dy */ texdx[1], texdy[1], /* dt/dx, dt/dy */ diff --git a/src/mesa/swrast/s_texcombine.c b/src/mesa/swrast/s_texcombine.c index aa28311672..c48a6fb114 100644 --- a/src/mesa/swrast/s_texcombine.c +++ b/src/mesa/swrast/s_texcombine.c @@ -37,13 +37,7 @@ #include "s_texcombine.h" -#define PROD(A,B) ( (GLuint)(A) * ((GLuint)(B)+1) ) -#define S_PROD(A,B) ( (GLint)(A) * ((GLint)(B)+1) ) -#if CHAN_BITS == 32 -typedef GLfloat ChanTemp; -#else -typedef GLuint ChanTemp; -#endif +#define MAX_COMBINER_TERMS 4 /** @@ -63,32 +57,36 @@ typedef GLuint ChanTemp; */ static void texture_combine( const GLcontext *ctx, GLuint unit, GLuint n, - CONST GLchan (*primary_rgba)[4], - CONST GLchan *texelBuffer, - GLchan (*rgba)[4] ) + CONST GLfloat (*primary_rgba)[4], + CONST GLfloat *texelBuffer, + GLchan (*rgbaChan)[4] ) { const struct gl_texture_unit *textureUnit = &(ctx->Texture.Unit[unit]); - const GLchan (*argRGB [4])[4]; - const GLchan (*argA [4])[4]; + const GLfloat (*argRGB [MAX_COMBINER_TERMS])[4]; + const GLfloat (*argA [MAX_COMBINER_TERMS])[4]; const GLint RGBshift = textureUnit->_CurrentCombine->ScaleShiftRGB; const GLuint Ashift = textureUnit->_CurrentCombine->ScaleShiftA; -#if CHAN_TYPE == GL_FLOAT - const GLchan RGBmult = (GLfloat) (1 << RGBshift); - const GLchan Amult = (GLfloat) (1 << Ashift); -#else - const GLint half = (CHAN_MAX + 1) / 2; -#endif - static const GLchan one[4] = { CHAN_MAX, CHAN_MAX, CHAN_MAX, CHAN_MAX }; - static const GLchan zero[4] = { 0, 0, 0, 0 }; + const GLfloat RGBmult = (GLfloat) (1 << RGBshift); + const GLfloat Amult = (GLfloat) (1 << Ashift); + static const GLfloat one[4] = { 1, 1, 1, 1 }; + static const GLfloat zero[4] = { 0, 0, 0, 0 }; const GLuint numColorArgs = textureUnit->_CurrentCombine->_NumArgsRGB; const GLuint numAlphaArgs = textureUnit->_CurrentCombine->_NumArgsA; - GLchan ccolor[4][MAX_WIDTH][4]; + GLfloat ccolor[MAX_COMBINER_TERMS][MAX_WIDTH][4]; /* temp color buffers */ + GLfloat rgba[MAX_WIDTH][4]; GLuint i, j; ASSERT(ctx->Extensions.EXT_texture_env_combine || ctx->Extensions.ARB_texture_env_combine); ASSERT(CONST_SWRAST_CONTEXT(ctx)->_AnyTextureCombine); + for (i = 0; i < n; i++) { + rgba[i][RCOMP] = CHAN_TO_FLOAT(rgbaChan[i][RCOMP]); + rgba[i][GCOMP] = CHAN_TO_FLOAT(rgbaChan[i][GCOMP]); + rgba[i][BCOMP] = CHAN_TO_FLOAT(rgbaChan[i][BCOMP]); + rgba[i][ACOMP] = CHAN_TO_FLOAT(rgbaChan[i][ACOMP]); + } + /* printf("modeRGB 0x%x modeA 0x%x srcRGB1 0x%x srcA1 0x%x srcRGB2 0x%x srcA2 0x%x\n", textureUnit->_CurrentCombine->ModeRGB, @@ -107,39 +105,47 @@ texture_combine( const GLcontext *ctx, GLuint unit, GLuint n, switch (srcRGB) { case GL_TEXTURE: - argRGB[j] = (const GLchan (*)[4]) - (texelBuffer + unit * (n * 4 * sizeof(GLchan))); + argRGB[j] = (const GLfloat (*)[4]) + (texelBuffer + unit * (n * 4 * sizeof(GLfloat))); break; case GL_PRIMARY_COLOR: argRGB[j] = primary_rgba; break; case GL_PREVIOUS: - argRGB[j] = (const GLchan (*)[4]) rgba; + argRGB[j] = (const GLfloat (*)[4]) rgba; break; case GL_CONSTANT: { - GLchan (*c)[4] = ccolor[j]; - GLchan red, green, blue, alpha; - UNCLAMPED_FLOAT_TO_CHAN(red, textureUnit->EnvColor[0]); - UNCLAMPED_FLOAT_TO_CHAN(green, textureUnit->EnvColor[1]); - UNCLAMPED_FLOAT_TO_CHAN(blue, textureUnit->EnvColor[2]); - UNCLAMPED_FLOAT_TO_CHAN(alpha, textureUnit->EnvColor[3]); + GLfloat (*c)[4] = ccolor[j]; + GLfloat red = textureUnit->EnvColor[0]; + GLfloat green = textureUnit->EnvColor[1]; + GLfloat blue = textureUnit->EnvColor[2]; + GLfloat alpha = textureUnit->EnvColor[3]; for (i = 0; i < n; i++) { - c[i][RCOMP] = red; - c[i][GCOMP] = green; - c[i][BCOMP] = blue; - c[i][ACOMP] = alpha; + ASSIGN_4V(c[i], red, green, blue, alpha); } - argRGB[j] = (const GLchan (*)[4]) ccolor[j]; + argRGB[j] = (const GLfloat (*)[4]) ccolor[j]; } break; /* GL_ATI_texture_env_combine3 allows GL_ZERO & GL_ONE as sources. */ case GL_ZERO: - argRGB[j] = & zero; + { + GLfloat (*c)[4] = ccolor[j]; + for (i = 0; i < n; i++) { + ASSIGN_4V(c[i], 0.0F, 0.0F, 0.0F, 0.0F); + } + argRGB[j] = (const GLfloat (*)[4]) ccolor[j]; + } break; case GL_ONE: - argRGB[j] = & one; + { + GLfloat (*c)[4] = ccolor[j]; + for (i = 0; i < n; i++) { + ASSIGN_4V(c[i], 1.0F, 1.0F, 1.0F, 1.0F); + } + argRGB[j] = (const GLfloat (*)[4]) ccolor[j]; + } break; default: /* ARB_texture_env_crossbar source */ @@ -148,23 +154,23 @@ texture_combine( const GLcontext *ctx, GLuint unit, GLuint n, ASSERT(srcUnit < ctx->Const.MaxTextureUnits); if (!ctx->Texture.Unit[srcUnit]._ReallyEnabled) return; - argRGB[j] = (const GLchan (*)[4]) - (texelBuffer + srcUnit * (n * 4 * sizeof(GLchan))); + argRGB[j] = (const GLfloat (*)[4]) + (texelBuffer + srcUnit * (n * 4 * sizeof(GLfloat))); } } if (textureUnit->_CurrentCombine->OperandRGB[j] != GL_SRC_COLOR) { - const GLchan (*src)[4] = argRGB[j]; - GLchan (*dst)[4] = ccolor[j]; + const GLfloat (*src)[4] = argRGB[j]; + GLfloat (*dst)[4] = ccolor[j]; /* point to new arg[j] storage */ - argRGB[j] = (const GLchan (*)[4]) ccolor[j]; + argRGB[j] = (const GLfloat (*)[4]) ccolor[j]; if (textureUnit->_CurrentCombine->OperandRGB[j] == GL_ONE_MINUS_SRC_COLOR) { for (i = 0; i < n; i++) { - dst[i][RCOMP] = CHAN_MAX - src[i][RCOMP]; - dst[i][GCOMP] = CHAN_MAX - src[i][GCOMP]; - dst[i][BCOMP] = CHAN_MAX - src[i][BCOMP]; + dst[i][RCOMP] = 1.0F - src[i][RCOMP]; + dst[i][GCOMP] = 1.0F - src[i][GCOMP]; + dst[i][BCOMP] = 1.0F - src[i][BCOMP]; } } else if (textureUnit->_CurrentCombine->OperandRGB[j] == GL_SRC_ALPHA) { @@ -177,9 +183,9 @@ texture_combine( const GLcontext *ctx, GLuint unit, GLuint n, else { ASSERT(textureUnit->_CurrentCombine->OperandRGB[j] ==GL_ONE_MINUS_SRC_ALPHA); for (i = 0; i < n; i++) { - dst[i][RCOMP] = CHAN_MAX - src[i][ACOMP]; - dst[i][GCOMP] = CHAN_MAX - src[i][ACOMP]; - dst[i][BCOMP] = CHAN_MAX - src[i][ACOMP]; + dst[i][RCOMP] = 1.0F - src[i][ACOMP]; + dst[i][GCOMP] = 1.0F - src[i][ACOMP]; + dst[i][BCOMP] = 1.0F - src[i][ACOMP]; } } } @@ -193,22 +199,22 @@ texture_combine( const GLcontext *ctx, GLuint unit, GLuint n, switch (srcA) { case GL_TEXTURE: - argA[j] = (const GLchan (*)[4]) - (texelBuffer + unit * (n * 4 * sizeof(GLchan))); + argA[j] = (const GLfloat (*)[4]) + (texelBuffer + unit * (n * 4 * sizeof(GLfloat))); break; case GL_PRIMARY_COLOR: argA[j] = primary_rgba; break; case GL_PREVIOUS: - argA[j] = (const GLchan (*)[4]) rgba; + argA[j] = (const GLfloat (*)[4]) rgba; break; case GL_CONSTANT: { - GLchan alpha, (*c)[4] = ccolor[j]; - UNCLAMPED_FLOAT_TO_CHAN(alpha, textureUnit->EnvColor[3]); + GLfloat alpha, (*c)[4] = ccolor[j]; + alpha = textureUnit->EnvColor[3]; for (i = 0; i < n; i++) c[i][ACOMP] = alpha; - argA[j] = (const GLchan (*)[4]) ccolor[j]; + argA[j] = (const GLfloat (*)[4]) ccolor[j]; } break; /* GL_ATI_texture_env_combine3 allows GL_ZERO & GL_ONE as sources. @@ -226,17 +232,17 @@ texture_combine( const GLcontext *ctx, GLuint unit, GLuint n, ASSERT(srcUnit < ctx->Const.MaxTextureUnits); if (!ctx->Texture.Unit[srcUnit]._ReallyEnabled) return; - argA[j] = (const GLchan (*)[4]) - (texelBuffer + srcUnit * (n * 4 * sizeof(GLchan))); + argA[j] = (const GLfloat (*)[4]) + (texelBuffer + srcUnit * (n * 4 * sizeof(GLfloat))); } } if (textureUnit->_CurrentCombine->OperandA[j] == GL_ONE_MINUS_SRC_ALPHA) { - const GLchan (*src)[4] = argA[j]; - GLchan (*dst)[4] = ccolor[j]; - argA[j] = (const GLchan (*)[4]) ccolor[j]; + const GLfloat (*src)[4] = argA[j]; + GLfloat (*dst)[4] = ccolor[j]; + argA[j] = (const GLfloat (*)[4]) ccolor[j]; for (i = 0; i < n; i++) { - dst[i][ACOMP] = CHAN_MAX - src[i][ACOMP]; + dst[i][ACOMP] = 1.0F - src[i][ACOMP]; } } } @@ -247,21 +253,12 @@ texture_combine( const GLcontext *ctx, GLuint unit, GLuint n, switch (textureUnit->_CurrentCombine->ModeRGB) { case GL_REPLACE: { - const GLchan (*arg0)[4] = (const GLchan (*)[4]) argRGB[0]; + const GLfloat (*arg0)[4] = (const GLfloat (*)[4]) argRGB[0]; if (RGBshift) { for (i = 0; i < n; i++) { -#if CHAN_TYPE == GL_FLOAT rgba[i][RCOMP] = arg0[i][RCOMP] * RGBmult; rgba[i][GCOMP] = arg0[i][GCOMP] * RGBmult; rgba[i][BCOMP] = arg0[i][BCOMP] * RGBmult; -#else - GLuint r = (GLuint) arg0[i][RCOMP] << RGBshift; - GLuint g = (GLuint) arg0[i][GCOMP] << RGBshift; - GLuint b = (GLuint) arg0[i][BCOMP] << RGBshift; - rgba[i][RCOMP] = MIN2(r, CHAN_MAX); - rgba[i][GCOMP] = MIN2(g, CHAN_MAX); - rgba[i][BCOMP] = MIN2(b, CHAN_MAX); -#endif } } else { @@ -275,179 +272,91 @@ texture_combine( const GLcontext *ctx, GLuint unit, GLuint n, break; case GL_MODULATE: { - const GLchan (*arg0)[4] = (const GLchan (*)[4]) argRGB[0]; - const GLchan (*arg1)[4] = (const GLchan (*)[4]) argRGB[1]; -#if CHAN_TYPE != GL_FLOAT - const GLint shift = CHAN_BITS - RGBshift; -#endif + const GLfloat (*arg0)[4] = (const GLfloat (*)[4]) argRGB[0]; + const GLfloat (*arg1)[4] = (const GLfloat (*)[4]) argRGB[1]; for (i = 0; i < n; i++) { -#if CHAN_TYPE == GL_FLOAT rgba[i][RCOMP] = arg0[i][RCOMP] * arg1[i][RCOMP] * RGBmult; rgba[i][GCOMP] = arg0[i][GCOMP] * arg1[i][GCOMP] * RGBmult; rgba[i][BCOMP] = arg0[i][BCOMP] * arg1[i][BCOMP] * RGBmult; -#else - GLuint r = PROD(arg0[i][RCOMP], arg1[i][RCOMP]) >> shift; - GLuint g = PROD(arg0[i][GCOMP], arg1[i][GCOMP]) >> shift; - GLuint b = PROD(arg0[i][BCOMP], arg1[i][BCOMP]) >> shift; - rgba[i][RCOMP] = (GLchan) MIN2(r, CHAN_MAX); - rgba[i][GCOMP] = (GLchan) MIN2(g, CHAN_MAX); - rgba[i][BCOMP] = (GLchan) MIN2(b, CHAN_MAX); -#endif } } break; case GL_ADD: if (textureUnit->EnvMode == GL_COMBINE4_NV) { /* (a * b) + (c * d) */ - const GLchan (*arg0)[4] = (const GLchan (*)[4]) argRGB[0]; - const GLchan (*arg1)[4] = (const GLchan (*)[4]) argRGB[1]; - const GLchan (*arg2)[4] = (const GLchan (*)[4]) argRGB[2]; - const GLchan (*arg3)[4] = (const GLchan (*)[4]) argRGB[3]; + const GLfloat (*arg0)[4] = (const GLfloat (*)[4]) argRGB[0]; + const GLfloat (*arg1)[4] = (const GLfloat (*)[4]) argRGB[1]; + const GLfloat (*arg2)[4] = (const GLfloat (*)[4]) argRGB[2]; + const GLfloat (*arg3)[4] = (const GLfloat (*)[4]) argRGB[3]; for (i = 0; i < n; i++) { -#if CHAN_TYPE == GL_FLOAT rgba[i][RCOMP] = (arg0[i][RCOMP] * arg1[i][RCOMP] + arg2[i][RCOMP] * arg3[i][RCOMP]) * RGBmult; rgba[i][GCOMP] = (arg0[i][GCOMP] * arg1[i][GCOMP] + arg2[i][GCOMP] * arg3[i][GCOMP]) * RGBmult; rgba[i][BCOMP] = (arg0[i][BCOMP] * arg1[i][BCOMP] + arg2[i][BCOMP] * arg3[i][BCOMP]) * RGBmult; -#else - const GLint shift = CHAN_BITS - RGBshift; - GLint r = (PROD(arg0[i][RCOMP], arg1[i][RCOMP]) >> shift) + - (PROD(arg2[i][RCOMP], arg3[i][RCOMP]) >> shift); - GLint g = (PROD(arg0[i][GCOMP], arg1[i][GCOMP]) >> shift) + - (PROD(arg2[i][GCOMP], arg3[i][GCOMP]) >> shift); - GLint b = (PROD(arg0[i][BCOMP], arg1[i][BCOMP]) >> shift) + - (PROD(arg2[i][BCOMP], arg3[i][BCOMP]) >> shift); - rgba[i][RCOMP] = (GLchan) MIN2(r, CHAN_MAX); - rgba[i][GCOMP] = (GLchan) MIN2(g, CHAN_MAX); - rgba[i][BCOMP] = (GLchan) MIN2(b, CHAN_MAX); -#endif } } else { /* 2-term addition */ - const GLchan (*arg0)[4] = (const GLchan (*)[4]) argRGB[0]; - const GLchan (*arg1)[4] = (const GLchan (*)[4]) argRGB[1]; + const GLfloat (*arg0)[4] = (const GLfloat (*)[4]) argRGB[0]; + const GLfloat (*arg1)[4] = (const GLfloat (*)[4]) argRGB[1]; for (i = 0; i < n; i++) { -#if CHAN_TYPE == GL_FLOAT rgba[i][RCOMP] = (arg0[i][RCOMP] + arg1[i][RCOMP]) * RGBmult; rgba[i][GCOMP] = (arg0[i][GCOMP] + arg1[i][GCOMP]) * RGBmult; rgba[i][BCOMP] = (arg0[i][BCOMP] + arg1[i][BCOMP]) * RGBmult; -#else - GLint r = ((GLint) arg0[i][RCOMP] + (GLint) arg1[i][RCOMP]) << RGBshift; - GLint g = ((GLint) arg0[i][GCOMP] + (GLint) arg1[i][GCOMP]) << RGBshift; - GLint b = ((GLint) arg0[i][BCOMP] + (GLint) arg1[i][BCOMP]) << RGBshift; - rgba[i][RCOMP] = (GLchan) MIN2(r, CHAN_MAX); - rgba[i][GCOMP] = (GLchan) MIN2(g, CHAN_MAX); - rgba[i][BCOMP] = (GLchan) MIN2(b, CHAN_MAX); -#endif } } break; case GL_ADD_SIGNED: if (textureUnit->EnvMode == GL_COMBINE4_NV) { /* (a * b) + (c * d) - 0.5 */ - const GLchan (*arg0)[4] = (const GLchan (*)[4]) argRGB[0]; - const GLchan (*arg1)[4] = (const GLchan (*)[4]) argRGB[1]; - const GLchan (*arg2)[4] = (const GLchan (*)[4]) argRGB[2]; - const GLchan (*arg3)[4] = (const GLchan (*)[4]) argRGB[3]; + const GLfloat (*arg0)[4] = (const GLfloat (*)[4]) argRGB[0]; + const GLfloat (*arg1)[4] = (const GLfloat (*)[4]) argRGB[1]; + const GLfloat (*arg2)[4] = (const GLfloat (*)[4]) argRGB[2]; + const GLfloat (*arg3)[4] = (const GLfloat (*)[4]) argRGB[3]; for (i = 0; i < n; i++) { -#if CHAN_TYPE == GL_FLOAT rgba[i][RCOMP] = (arg0[i][RCOMP] + arg1[i][RCOMP] * arg2[i][RCOMP] + arg3[i][RCOMP] - 0.5) * RGBmult; rgba[i][GCOMP] = (arg0[i][GCOMP] + arg1[i][GCOMP] * arg2[i][GCOMP] + arg3[i][GCOMP] - 0.5) * RGBmult; rgba[i][BCOMP] = (arg0[i][BCOMP] + arg1[i][BCOMP] * arg2[i][BCOMP] + arg3[i][BCOMP] - 0.5) * RGBmult; -#else - GLint r = (((PROD(arg0[i][RCOMP], arg1[i][RCOMP]) + - PROD(arg2[i][RCOMP], arg3[i][RCOMP])) >> CHAN_BITS) - half) - << RGBshift; - GLint g = (((PROD(arg0[i][GCOMP], arg1[i][GCOMP]) + - PROD(arg2[i][GCOMP], arg3[i][GCOMP])) >> CHAN_BITS) - half) - << RGBshift; - GLint b = (((PROD(arg0[i][BCOMP], arg1[i][BCOMP]) + - PROD(arg2[i][BCOMP], arg3[i][BCOMP])) >> CHAN_BITS) - half) - << RGBshift; - rgba[i][RCOMP] = (GLchan) CLAMP(r, 0, CHAN_MAX); - rgba[i][GCOMP] = (GLchan) CLAMP(g, 0, CHAN_MAX); - rgba[i][BCOMP] = (GLchan) CLAMP(b, 0, CHAN_MAX); -#endif } } else { - const GLchan (*arg0)[4] = (const GLchan (*)[4]) argRGB[0]; - const GLchan (*arg1)[4] = (const GLchan (*)[4]) argRGB[1]; + const GLfloat (*arg0)[4] = (const GLfloat (*)[4]) argRGB[0]; + const GLfloat (*arg1)[4] = (const GLfloat (*)[4]) argRGB[1]; for (i = 0; i < n; i++) { -#if CHAN_TYPE == GL_FLOAT rgba[i][RCOMP] = (arg0[i][RCOMP] + arg1[i][RCOMP] - 0.5) * RGBmult; rgba[i][GCOMP] = (arg0[i][GCOMP] + arg1[i][GCOMP] - 0.5) * RGBmult; rgba[i][BCOMP] = (arg0[i][BCOMP] + arg1[i][BCOMP] - 0.5) * RGBmult; -#else - GLint r = (GLint) arg0[i][RCOMP] + (GLint) arg1[i][RCOMP] - half; - GLint g = (GLint) arg0[i][GCOMP] + (GLint) arg1[i][GCOMP] - half; - GLint b = (GLint) arg0[i][BCOMP] + (GLint) arg1[i][BCOMP] - half; - r = (r < 0) ? 0 : r << RGBshift; - g = (g < 0) ? 0 : g << RGBshift; - b = (b < 0) ? 0 : b << RGBshift; - rgba[i][RCOMP] = (GLchan) MIN2(r, CHAN_MAX); - rgba[i][GCOMP] = (GLchan) MIN2(g, CHAN_MAX); - rgba[i][BCOMP] = (GLchan) MIN2(b, CHAN_MAX); -#endif } } break; case GL_INTERPOLATE: { - const GLchan (*arg0)[4] = (const GLchan (*)[4]) argRGB[0]; - const GLchan (*arg1)[4] = (const GLchan (*)[4]) argRGB[1]; - const GLchan (*arg2)[4] = (const GLchan (*)[4]) argRGB[2]; -#if CHAN_TYPE != GL_FLOAT - const GLint shift = CHAN_BITS - RGBshift; -#endif + const GLfloat (*arg0)[4] = (const GLfloat (*)[4]) argRGB[0]; + const GLfloat (*arg1)[4] = (const GLfloat (*)[4]) argRGB[1]; + const GLfloat (*arg2)[4] = (const GLfloat (*)[4]) argRGB[2]; for (i = 0; i < n; i++) { -#if CHAN_TYPE == GL_FLOAT rgba[i][RCOMP] = (arg0[i][RCOMP] * arg2[i][RCOMP] + - arg1[i][RCOMP] * (CHAN_MAXF - arg2[i][RCOMP])) * RGBmult; + arg1[i][RCOMP] * (1.0F - arg2[i][RCOMP])) * RGBmult; rgba[i][GCOMP] = (arg0[i][GCOMP] * arg2[i][GCOMP] + - arg1[i][GCOMP] * (CHAN_MAXF - arg2[i][GCOMP])) * RGBmult; + arg1[i][GCOMP] * (1.0F - arg2[i][GCOMP])) * RGBmult; rgba[i][BCOMP] = (arg0[i][BCOMP] * arg2[i][BCOMP] + - arg1[i][BCOMP] * (CHAN_MAXF - arg2[i][BCOMP])) * RGBmult; -#else - GLuint r = (PROD(arg0[i][RCOMP], arg2[i][RCOMP]) - + PROD(arg1[i][RCOMP], CHAN_MAX - arg2[i][RCOMP])) - >> shift; - GLuint g = (PROD(arg0[i][GCOMP], arg2[i][GCOMP]) - + PROD(arg1[i][GCOMP], CHAN_MAX - arg2[i][GCOMP])) - >> shift; - GLuint b = (PROD(arg0[i][BCOMP], arg2[i][BCOMP]) - + PROD(arg1[i][BCOMP], CHAN_MAX - arg2[i][BCOMP])) - >> shift; - rgba[i][RCOMP] = (GLchan) MIN2(r, CHAN_MAX); - rgba[i][GCOMP] = (GLchan) MIN2(g, CHAN_MAX); - rgba[i][BCOMP] = (GLchan) MIN2(b, CHAN_MAX); -#endif + arg1[i][BCOMP] * (1.0F - arg2[i][BCOMP])) * RGBmult; } } break; case GL_SUBTRACT: { - const GLchan (*arg0)[4] = (const GLchan (*)[4]) argRGB[0]; - const GLchan (*arg1)[4] = (const GLchan (*)[4]) argRGB[1]; + const GLfloat (*arg0)[4] = (const GLfloat (*)[4]) argRGB[0]; + const GLfloat (*arg1)[4] = (const GLfloat (*)[4]) argRGB[1]; for (i = 0; i < n; i++) { -#if CHAN_TYPE == GL_FLOAT rgba[i][RCOMP] = (arg0[i][RCOMP] - arg1[i][RCOMP]) * RGBmult; rgba[i][GCOMP] = (arg0[i][GCOMP] - arg1[i][GCOMP]) * RGBmult; rgba[i][BCOMP] = (arg0[i][BCOMP] - arg1[i][BCOMP]) * RGBmult; -#else - GLint r = ((GLint) arg0[i][RCOMP] - (GLint) arg1[i][RCOMP]) << RGBshift; - GLint g = ((GLint) arg0[i][GCOMP] - (GLint) arg1[i][GCOMP]) << RGBshift; - GLint b = ((GLint) arg0[i][BCOMP] - (GLint) arg1[i][BCOMP]) << RGBshift; - rgba[i][RCOMP] = (GLchan) CLAMP(r, 0, CHAN_MAX); - rgba[i][GCOMP] = (GLchan) CLAMP(g, 0, CHAN_MAX); - rgba[i][BCOMP] = (GLchan) CLAMP(b, 0, CHAN_MAX); -#endif } } break; @@ -455,25 +364,15 @@ texture_combine( const GLcontext *ctx, GLuint unit, GLuint n, case GL_DOT3_RGBA_EXT: { /* Do not scale the result by 1 2 or 4 */ - const GLchan (*arg0)[4] = (const GLchan (*)[4]) argRGB[0]; - const GLchan (*arg1)[4] = (const GLchan (*)[4]) argRGB[1]; + const GLfloat (*arg0)[4] = (const GLfloat (*)[4]) argRGB[0]; + const GLfloat (*arg1)[4] = (const GLfloat (*)[4]) argRGB[1]; for (i = 0; i < n; i++) { -#if CHAN_TYPE == GL_FLOAT - GLchan dot = ((arg0[i][RCOMP]-0.5F) * (arg1[i][RCOMP]-0.5F) + + GLfloat dot = ((arg0[i][RCOMP]-0.5F) * (arg1[i][RCOMP]-0.5F) + (arg0[i][GCOMP]-0.5F) * (arg1[i][GCOMP]-0.5F) + (arg0[i][BCOMP]-0.5F) * (arg1[i][BCOMP]-0.5F)) * 4.0F; - dot = CLAMP(dot, 0.0F, CHAN_MAXF); -#else - GLint dot = (S_PROD((GLint)arg0[i][RCOMP] - half, - (GLint)arg1[i][RCOMP] - half) + - S_PROD((GLint)arg0[i][GCOMP] - half, - (GLint)arg1[i][GCOMP] - half) + - S_PROD((GLint)arg0[i][BCOMP] - half, - (GLint)arg1[i][BCOMP] - half)) >> 6; - dot = CLAMP(dot, 0, CHAN_MAX); -#endif - rgba[i][RCOMP] = rgba[i][GCOMP] = rgba[i][BCOMP] = (GLchan) dot; + dot = CLAMP(dot, 0.0F, 1.0F); + rgba[i][RCOMP] = rgba[i][GCOMP] = rgba[i][BCOMP] = (GLfloat) dot; } } break; @@ -481,113 +380,60 @@ texture_combine( const GLcontext *ctx, GLuint unit, GLuint n, case GL_DOT3_RGBA: { /* DO scale the result by 1 2 or 4 */ - const GLchan (*arg0)[4] = (const GLchan (*)[4]) argRGB[0]; - const GLchan (*arg1)[4] = (const GLchan (*)[4]) argRGB[1]; + const GLfloat (*arg0)[4] = (const GLfloat (*)[4]) argRGB[0]; + const GLfloat (*arg1)[4] = (const GLfloat (*)[4]) argRGB[1]; for (i = 0; i < n; i++) { -#if CHAN_TYPE == GL_FLOAT - GLchan dot = ((arg0[i][RCOMP]-0.5F) * (arg1[i][RCOMP]-0.5F) + + GLfloat dot = ((arg0[i][RCOMP]-0.5F) * (arg1[i][RCOMP]-0.5F) + (arg0[i][GCOMP]-0.5F) * (arg1[i][GCOMP]-0.5F) + (arg0[i][BCOMP]-0.5F) * (arg1[i][BCOMP]-0.5F)) * 4.0F * RGBmult; - dot = CLAMP(dot, 0.0, CHAN_MAXF); -#else - GLint dot = (S_PROD((GLint)arg0[i][RCOMP] - half, - (GLint)arg1[i][RCOMP] - half) + - S_PROD((GLint)arg0[i][GCOMP] - half, - (GLint)arg1[i][GCOMP] - half) + - S_PROD((GLint)arg0[i][BCOMP] - half, - (GLint)arg1[i][BCOMP] - half)) >> 6; - dot <<= RGBshift; - dot = CLAMP(dot, 0, CHAN_MAX); -#endif - rgba[i][RCOMP] = rgba[i][GCOMP] = rgba[i][BCOMP] = (GLchan) dot; + dot = CLAMP(dot, 0.0, 1.0F); + rgba[i][RCOMP] = rgba[i][GCOMP] = rgba[i][BCOMP] = (GLfloat) dot; } } break; case GL_MODULATE_ADD_ATI: { - const GLchan (*arg0)[4] = (const GLchan (*)[4]) argRGB[0]; - const GLchan (*arg1)[4] = (const GLchan (*)[4]) argRGB[1]; - const GLchan (*arg2)[4] = (const GLchan (*)[4]) argRGB[2]; -#if CHAN_TYPE != GL_FLOAT - const GLint shift = CHAN_BITS - RGBshift; -#endif + const GLfloat (*arg0)[4] = (const GLfloat (*)[4]) argRGB[0]; + const GLfloat (*arg1)[4] = (const GLfloat (*)[4]) argRGB[1]; + const GLfloat (*arg2)[4] = (const GLfloat (*)[4]) argRGB[2]; for (i = 0; i < n; i++) { -#if CHAN_TYPE == GL_FLOAT - rgba[i][RCOMP] = ((arg0[i][RCOMP] * arg2[i][RCOMP]) + arg1[i][RCOMP]) * RGBmult; - rgba[i][GCOMP] = ((arg0[i][GCOMP] * arg2[i][GCOMP]) + arg1[i][GCOMP]) * RGBmult; - rgba[i][BCOMP] = ((arg0[i][BCOMP] * arg2[i][BCOMP]) + arg1[i][BCOMP]) * RGBmult; -#else - GLuint r = (PROD(arg0[i][RCOMP], arg2[i][RCOMP]) - + ((GLuint) arg1[i][RCOMP] << CHAN_BITS)) >> shift; - GLuint g = (PROD(arg0[i][GCOMP], arg2[i][GCOMP]) - + ((GLuint) arg1[i][GCOMP] << CHAN_BITS)) >> shift; - GLuint b = (PROD(arg0[i][BCOMP], arg2[i][BCOMP]) - + ((GLuint) arg1[i][BCOMP] << CHAN_BITS)) >> shift; - rgba[i][RCOMP] = (GLchan) MIN2(r, CHAN_MAX); - rgba[i][GCOMP] = (GLchan) MIN2(g, CHAN_MAX); - rgba[i][BCOMP] = (GLchan) MIN2(b, CHAN_MAX); -#endif + rgba[i][RCOMP] = ((arg0[i][RCOMP] * arg2[i][RCOMP]) + + arg1[i][RCOMP]) * RGBmult; + rgba[i][GCOMP] = ((arg0[i][GCOMP] * arg2[i][GCOMP]) + + arg1[i][GCOMP]) * RGBmult; + rgba[i][BCOMP] = ((arg0[i][BCOMP] * arg2[i][BCOMP]) + + arg1[i][BCOMP]) * RGBmult; } } break; case GL_MODULATE_SIGNED_ADD_ATI: { - const GLchan (*arg0)[4] = (const GLchan (*)[4]) argRGB[0]; - const GLchan (*arg1)[4] = (const GLchan (*)[4]) argRGB[1]; - const GLchan (*arg2)[4] = (const GLchan (*)[4]) argRGB[2]; -#if CHAN_TYPE != GL_FLOAT - const GLint shift = CHAN_BITS - RGBshift; -#endif + const GLfloat (*arg0)[4] = (const GLfloat (*)[4]) argRGB[0]; + const GLfloat (*arg1)[4] = (const GLfloat (*)[4]) argRGB[1]; + const GLfloat (*arg2)[4] = (const GLfloat (*)[4]) argRGB[2]; for (i = 0; i < n; i++) { -#if CHAN_TYPE == GL_FLOAT - rgba[i][RCOMP] = ((arg0[i][RCOMP] * arg2[i][RCOMP]) + arg1[i][RCOMP] - 0.5) * RGBmult; - rgba[i][GCOMP] = ((arg0[i][GCOMP] * arg2[i][GCOMP]) + arg1[i][GCOMP] - 0.5) * RGBmult; - rgba[i][BCOMP] = ((arg0[i][BCOMP] * arg2[i][BCOMP]) + arg1[i][BCOMP] - 0.5) * RGBmult; -#else - GLint r = (S_PROD(arg0[i][RCOMP], arg2[i][RCOMP]) - + (((GLint) arg1[i][RCOMP] - half) << CHAN_BITS)) - >> shift; - GLint g = (S_PROD(arg0[i][GCOMP], arg2[i][GCOMP]) - + (((GLint) arg1[i][GCOMP] - half) << CHAN_BITS)) - >> shift; - GLint b = (S_PROD(arg0[i][BCOMP], arg2[i][BCOMP]) - + (((GLint) arg1[i][BCOMP] - half) << CHAN_BITS)) - >> shift; - rgba[i][RCOMP] = (GLchan) CLAMP(r, 0, CHAN_MAX); - rgba[i][GCOMP] = (GLchan) CLAMP(g, 0, CHAN_MAX); - rgba[i][BCOMP] = (GLchan) CLAMP(b, 0, CHAN_MAX); -#endif + rgba[i][RCOMP] = ((arg0[i][RCOMP] * arg2[i][RCOMP]) + + arg1[i][RCOMP] - 0.5) * RGBmult; + rgba[i][GCOMP] = ((arg0[i][GCOMP] * arg2[i][GCOMP]) + + arg1[i][GCOMP] - 0.5) * RGBmult; + rgba[i][BCOMP] = ((arg0[i][BCOMP] * arg2[i][BCOMP]) + + arg1[i][BCOMP] - 0.5) * RGBmult; } } break; case GL_MODULATE_SUBTRACT_ATI: { - const GLchan (*arg0)[4] = (const GLchan (*)[4]) argRGB[0]; - const GLchan (*arg1)[4] = (const GLchan (*)[4]) argRGB[1]; - const GLchan (*arg2)[4] = (const GLchan (*)[4]) argRGB[2]; -#if CHAN_TYPE != GL_FLOAT - const GLint shift = CHAN_BITS - RGBshift; -#endif + const GLfloat (*arg0)[4] = (const GLfloat (*)[4]) argRGB[0]; + const GLfloat (*arg1)[4] = (const GLfloat (*)[4]) argRGB[1]; + const GLfloat (*arg2)[4] = (const GLfloat (*)[4]) argRGB[2]; for (i = 0; i < n; i++) { -#if CHAN_TYPE == GL_FLOAT - rgba[i][RCOMP] = ((arg0[i][RCOMP] * arg2[i][RCOMP]) - arg1[i][RCOMP]) * RGBmult; - rgba[i][GCOMP] = ((arg0[i][GCOMP] * arg2[i][GCOMP]) - arg1[i][GCOMP]) * RGBmult; - rgba[i][BCOMP] = ((arg0[i][BCOMP] * arg2[i][BCOMP]) - arg1[i][BCOMP]) * RGBmult; -#else - GLint r = (S_PROD(arg0[i][RCOMP], arg2[i][RCOMP]) - - ((GLint) arg1[i][RCOMP] << CHAN_BITS)) - >> shift; - GLint g = (S_PROD(arg0[i][GCOMP], arg2[i][GCOMP]) - - ((GLint) arg1[i][GCOMP] << CHAN_BITS)) - >> shift; - GLint b = (S_PROD(arg0[i][BCOMP], arg2[i][BCOMP]) - - ((GLint) arg1[i][BCOMP] << CHAN_BITS)) - >> shift; - rgba[i][RCOMP] = (GLchan) CLAMP(r, 0, CHAN_MAX); - rgba[i][GCOMP] = (GLchan) CLAMP(g, 0, CHAN_MAX); - rgba[i][BCOMP] = (GLchan) CLAMP(b, 0, CHAN_MAX); -#endif + rgba[i][RCOMP] = ((arg0[i][RCOMP] * arg2[i][RCOMP]) - + arg1[i][RCOMP]) * RGBmult; + rgba[i][GCOMP] = ((arg0[i][GCOMP] * arg2[i][GCOMP]) - + arg1[i][GCOMP]) * RGBmult; + rgba[i][BCOMP] = ((arg0[i][BCOMP] * arg2[i][BCOMP]) - + arg1[i][BCOMP]) * RGBmult; } } break; @@ -617,15 +463,11 @@ texture_combine( const GLcontext *ctx, GLuint unit, GLuint n, switch (textureUnit->_CurrentCombine->ModeA) { case GL_REPLACE: { - const GLchan (*arg0)[4] = (const GLchan (*)[4]) argA[0]; + const GLfloat (*arg0)[4] = (const GLfloat (*)[4]) argA[0]; if (Ashift) { for (i = 0; i < n; i++) { -#if CHAN_TYPE == GL_FLOAT - GLchan a = arg0[i][ACOMP] * Amult; -#else - GLuint a = (GLuint) arg0[i][ACOMP] << Ashift; -#endif - rgba[i][ACOMP] = (GLchan) MIN2(a, CHAN_MAX); + GLfloat a = arg0[i][ACOMP] * Amult; + rgba[i][ACOMP] = (GLfloat) MIN2(a, 1.0F); } } else { @@ -637,182 +479,107 @@ texture_combine( const GLcontext *ctx, GLuint unit, GLuint n, break; case GL_MODULATE: { - const GLchan (*arg0)[4] = (const GLchan (*)[4]) argA[0]; - const GLchan (*arg1)[4] = (const GLchan (*)[4]) argA[1]; -#if CHAN_TYPE != GL_FLOAT - const GLint shift = CHAN_BITS - Ashift; -#endif + const GLfloat (*arg0)[4] = (const GLfloat (*)[4]) argA[0]; + const GLfloat (*arg1)[4] = (const GLfloat (*)[4]) argA[1]; for (i = 0; i < n; i++) { -#if CHAN_TYPE == GL_FLOAT rgba[i][ACOMP] = arg0[i][ACOMP] * arg1[i][ACOMP] * Amult; -#else - GLuint a = (PROD(arg0[i][ACOMP], arg1[i][ACOMP]) >> shift); - rgba[i][ACOMP] = (GLchan) MIN2(a, CHAN_MAX); -#endif } } break; case GL_ADD: if (textureUnit->EnvMode == GL_COMBINE4_NV) { /* (a * b) + (c * d) */ - const GLchan (*arg0)[4] = (const GLchan (*)[4]) argA[0]; - const GLchan (*arg1)[4] = (const GLchan (*)[4]) argA[1]; - const GLchan (*arg2)[4] = (const GLchan (*)[4]) argA[2]; - const GLchan (*arg3)[4] = (const GLchan (*)[4]) argA[3]; + const GLfloat (*arg0)[4] = (const GLfloat (*)[4]) argA[0]; + const GLfloat (*arg1)[4] = (const GLfloat (*)[4]) argA[1]; + const GLfloat (*arg2)[4] = (const GLfloat (*)[4]) argA[2]; + const GLfloat (*arg3)[4] = (const GLfloat (*)[4]) argA[3]; for (i = 0; i < n; i++) { -#if CHAN_TYPE == GL_FLOAT rgba[i][ACOMP] = (arg0[i][ACOMP] * arg1[i][ACOMP] + arg2[i][ACOMP] * arg3[i][ACOMP]) * Amult; -#else - const GLint shift = CHAN_BITS - Ashift; - GLint a = (PROD(arg0[i][ACOMP], arg1[i][ACOMP]) >> shift) + - (PROD(arg2[i][ACOMP], arg3[i][ACOMP]) >> shift); - rgba[i][ACOMP] = (GLchan) MIN2(a, CHAN_MAX); -#endif } } else { /* two-term add */ - const GLchan (*arg0)[4] = (const GLchan (*)[4]) argA[0]; - const GLchan (*arg1)[4] = (const GLchan (*)[4]) argA[1]; + const GLfloat (*arg0)[4] = (const GLfloat (*)[4]) argA[0]; + const GLfloat (*arg1)[4] = (const GLfloat (*)[4]) argA[1]; for (i = 0; i < n; i++) { -#if CHAN_TYPE == GL_FLOAT rgba[i][ACOMP] = (arg0[i][ACOMP] + arg1[i][ACOMP]) * Amult; -#else - GLint a = ((GLint) arg0[i][ACOMP] + arg1[i][ACOMP]) << Ashift; - rgba[i][ACOMP] = (GLchan) MIN2(a, CHAN_MAX); -#endif } } break; case GL_ADD_SIGNED: if (textureUnit->EnvMode == GL_COMBINE4_NV) { /* (a * b) + (c * d) - 0.5 */ - const GLchan (*arg0)[4] = (const GLchan (*)[4]) argA[0]; - const GLchan (*arg1)[4] = (const GLchan (*)[4]) argA[1]; - const GLchan (*arg2)[4] = (const GLchan (*)[4]) argA[2]; - const GLchan (*arg3)[4] = (const GLchan (*)[4]) argA[3]; + const GLfloat (*arg0)[4] = (const GLfloat (*)[4]) argA[0]; + const GLfloat (*arg1)[4] = (const GLfloat (*)[4]) argA[1]; + const GLfloat (*arg2)[4] = (const GLfloat (*)[4]) argA[2]; + const GLfloat (*arg3)[4] = (const GLfloat (*)[4]) argA[3]; for (i = 0; i < n; i++) { -#if CHAN_TYPE == GL_FLOAT rgba[i][ACOMP] = (arg0[i][ACOMP] * arg1[i][ACOMP] + arg2[i][ACOMP] * arg3[i][ACOMP] - 0.5) * Amult; -#else - GLint a = (((PROD(arg0[i][ACOMP], arg1[i][ACOMP]) + - PROD(arg2[i][ACOMP], arg3[i][ACOMP])) >> CHAN_BITS) - half) - << Ashift; - rgba[i][ACOMP] = (GLchan) CLAMP(a, 0, CHAN_MAX); -#endif } } else { /* a + b - 0.5 */ - const GLchan (*arg0)[4] = (const GLchan (*)[4]) argA[0]; - const GLchan (*arg1)[4] = (const GLchan (*)[4]) argA[1]; + const GLfloat (*arg0)[4] = (const GLfloat (*)[4]) argA[0]; + const GLfloat (*arg1)[4] = (const GLfloat (*)[4]) argA[1]; for (i = 0; i < n; i++) { -#if CHAN_TYPE == GL_FLOAT rgba[i][ACOMP] = (arg0[i][ACOMP] + arg1[i][ACOMP] - 0.5F) * Amult; -#else - GLint a = (GLint) arg0[i][ACOMP] + (GLint) arg1[i][ACOMP] -half; - a = (a < 0) ? 0 : a << Ashift; - rgba[i][ACOMP] = (GLchan) CLAMP(a, 0, CHAN_MAX); -#endif } } break; case GL_INTERPOLATE: { - const GLchan (*arg0)[4] = (const GLchan (*)[4]) argA[0]; - const GLchan (*arg1)[4] = (const GLchan (*)[4]) argA[1]; - const GLchan (*arg2)[4] = (const GLchan (*)[4]) argA[2]; -#if CHAN_TYPE != GL_FLOAT - const GLint shift = CHAN_BITS - Ashift; -#endif + const GLfloat (*arg0)[4] = (const GLfloat (*)[4]) argA[0]; + const GLfloat (*arg1)[4] = (const GLfloat (*)[4]) argA[1]; + const GLfloat (*arg2)[4] = (const GLfloat (*)[4]) argA[2]; for (i=0; i> shift; - rgba[i][ACOMP] = (GLchan) MIN2(a, CHAN_MAX); -#endif } } break; case GL_SUBTRACT: { - const GLchan (*arg0)[4] = (const GLchan (*)[4]) argA[0]; - const GLchan (*arg1)[4] = (const GLchan (*)[4]) argA[1]; + const GLfloat (*arg0)[4] = (const GLfloat (*)[4]) argA[0]; + const GLfloat (*arg1)[4] = (const GLfloat (*)[4]) argA[1]; for (i = 0; i < n; i++) { -#if CHAN_TYPE == GL_FLOAT rgba[i][ACOMP] = (arg0[i][ACOMP] - arg1[i][ACOMP]) * Amult; -#else - GLint a = ((GLint) arg0[i][ACOMP] - (GLint) arg1[i][ACOMP]) << Ashift; - rgba[i][ACOMP] = (GLchan) CLAMP(a, 0, CHAN_MAX); -#endif } } break; case GL_MODULATE_ADD_ATI: { - const GLchan (*arg0)[4] = (const GLchan (*)[4]) argA[0]; - const GLchan (*arg1)[4] = (const GLchan (*)[4]) argA[1]; - const GLchan (*arg2)[4] = (const GLchan (*)[4]) argA[2]; -#if CHAN_TYPE != GL_FLOAT - const GLint shift = CHAN_BITS - Ashift; -#endif + const GLfloat (*arg0)[4] = (const GLfloat (*)[4]) argA[0]; + const GLfloat (*arg1)[4] = (const GLfloat (*)[4]) argA[1]; + const GLfloat (*arg2)[4] = (const GLfloat (*)[4]) argA[2]; for (i = 0; i < n; i++) { -#if CHAN_TYPE == GL_FLOAT - rgba[i][ACOMP] = ((arg0[i][ACOMP] * arg2[i][ACOMP]) + arg1[i][ACOMP]) * Amult; -#else - GLint a = (PROD(arg0[i][ACOMP], arg2[i][ACOMP]) - + ((GLuint) arg1[i][ACOMP] << CHAN_BITS)) - >> shift; - rgba[i][ACOMP] = (GLchan) CLAMP(a, 0, CHAN_MAX); -#endif + rgba[i][ACOMP] = ((arg0[i][ACOMP] * arg2[i][ACOMP]) + + arg1[i][ACOMP]) * Amult; } } break; case GL_MODULATE_SIGNED_ADD_ATI: { - const GLchan (*arg0)[4] = (const GLchan (*)[4]) argA[0]; - const GLchan (*arg1)[4] = (const GLchan (*)[4]) argA[1]; - const GLchan (*arg2)[4] = (const GLchan (*)[4]) argA[2]; -#if CHAN_TYPE != GL_FLOAT - const GLint shift = CHAN_BITS - Ashift; -#endif + const GLfloat (*arg0)[4] = (const GLfloat (*)[4]) argA[0]; + const GLfloat (*arg1)[4] = (const GLfloat (*)[4]) argA[1]; + const GLfloat (*arg2)[4] = (const GLfloat (*)[4]) argA[2]; for (i = 0; i < n; i++) { -#if CHAN_TYPE == GL_FLOAT - rgba[i][ACOMP] = ((arg0[i][ACOMP] * arg2[i][ACOMP]) + arg1[i][ACOMP] - 0.5F) * Amult; -#else - GLint a = (S_PROD(arg0[i][ACOMP], arg2[i][ACOMP]) - + (((GLint) arg1[i][ACOMP] - half) << CHAN_BITS)) - >> shift; - rgba[i][ACOMP] = (GLchan) CLAMP(a, 0, CHAN_MAX); -#endif + rgba[i][ACOMP] = ((arg0[i][ACOMP] * arg2[i][ACOMP]) + + arg1[i][ACOMP] - 0.5F) * Amult; } } break; case GL_MODULATE_SUBTRACT_ATI: { - const GLchan (*arg0)[4] = (const GLchan (*)[4]) argA[0]; - const GLchan (*arg1)[4] = (const GLchan (*)[4]) argA[1]; - const GLchan (*arg2)[4] = (const GLchan (*)[4]) argA[2]; -#if CHAN_TYPE != GL_FLOAT - const GLint shift = CHAN_BITS - Ashift; -#endif + const GLfloat (*arg0)[4] = (const GLfloat (*)[4]) argA[0]; + const GLfloat (*arg1)[4] = (const GLfloat (*)[4]) argA[1]; + const GLfloat (*arg2)[4] = (const GLfloat (*)[4]) argA[2]; for (i = 0; i < n; i++) { -#if CHAN_TYPE == GL_FLOAT - rgba[i][ACOMP] = ((arg0[i][ACOMP] * arg2[i][ACOMP]) - arg1[i][ACOMP]) * Amult; -#else - GLint a = (S_PROD(arg0[i][ACOMP], arg2[i][ACOMP]) - - ((GLint) arg1[i][ACOMP] << CHAN_BITS)) - >> shift; - rgba[i][ACOMP] = (GLchan) CLAMP(a, 0, CHAN_MAX); -#endif + rgba[i][ACOMP] = ((arg0[i][ACOMP] * arg2[i][ACOMP]) + - arg1[i][ACOMP]) * Amult; } } break; @@ -831,8 +598,15 @@ texture_combine( const GLcontext *ctx, GLuint unit, GLuint n, rgba[i][ACOMP] = rgba[i][RCOMP]; } } + + for (i = 0; i < n; i++) { + UNCLAMPED_FLOAT_TO_CHAN(rgbaChan[i][RCOMP], rgba[i][RCOMP]); + UNCLAMPED_FLOAT_TO_CHAN(rgbaChan[i][GCOMP], rgba[i][GCOMP]); + UNCLAMPED_FLOAT_TO_CHAN(rgbaChan[i][BCOMP], rgba[i][BCOMP]); + UNCLAMPED_FLOAT_TO_CHAN(rgbaChan[i][ACOMP], rgba[i][ACOMP]); + } } -#undef PROD + /** @@ -840,17 +614,17 @@ texture_combine( const GLcontext *ctx, GLuint unit, GLuint n, * See GL_EXT_texture_swizzle. */ static void -swizzle_texels(GLuint swizzle, GLuint count, GLchan (*texels)[4]) +swizzle_texels(GLuint swizzle, GLuint count, GLfloat (*texels)[4]) { const GLuint swzR = GET_SWZ(swizzle, 0); const GLuint swzG = GET_SWZ(swizzle, 1); const GLuint swzB = GET_SWZ(swizzle, 2); const GLuint swzA = GET_SWZ(swizzle, 3); - GLchan vector[6]; + GLfloat vector[6]; GLuint i; vector[SWIZZLE_ZERO] = 0; - vector[SWIZZLE_ONE] = CHAN_MAX; + vector[SWIZZLE_ONE] = 1.0F; for (i = 0; i < count; i++) { vector[SWIZZLE_X] = texels[i][0]; @@ -880,13 +654,15 @@ static void texture_apply( const GLcontext *ctx, const struct gl_texture_unit *texUnit, GLuint n, - CONST GLchan primary_rgba[][4], CONST GLchan texel[][4], - GLchan rgba[][4] ) + CONST GLfloat primary_rgba[][4], CONST GLfloat texel[][4], + GLchan rgbaChan[][4] ) { GLint baseLevel; GLuint i; - GLchan Rc, Gc, Bc, Ac; + GLfloat Rc, Gc, Bc, Ac; GLenum format; + GLfloat rgba[MAX_WIDTH][4]; + (void) primary_rgba; ASSERT(texUnit); @@ -904,6 +680,16 @@ texture_apply( const GLcontext *ctx, format = texUnit->_Current->DepthMode; } + if (texUnit->EnvMode != GL_REPLACE) { + /* convert GLchan colors to GLfloat */ + for (i = 0; i < n; i++) { + rgba[i][RCOMP] = CHAN_TO_FLOAT(rgbaChan[i][RCOMP]); + rgba[i][GCOMP] = CHAN_TO_FLOAT(rgbaChan[i][GCOMP]); + rgba[i][BCOMP] = CHAN_TO_FLOAT(rgbaChan[i][BCOMP]); + rgba[i][ACOMP] = CHAN_TO_FLOAT(rgbaChan[i][ACOMP]); + } + } + switch (texUnit->EnvMode) { case GL_REPLACE: switch (format) { @@ -917,14 +703,14 @@ texture_apply( const GLcontext *ctx, case GL_LUMINANCE: for (i=0;iEnvColor[0]); - UNCLAMPED_FLOAT_TO_CHAN(Gc, texUnit->EnvColor[1]); - UNCLAMPED_FLOAT_TO_CHAN(Bc, texUnit->EnvColor[2]); - UNCLAMPED_FLOAT_TO_CHAN(Ac, texUnit->EnvColor[3]); + Rc = texUnit->EnvColor[0]; + Gc = texUnit->EnvColor[1]; + Bc = texUnit->EnvColor[2]; + Ac = texUnit->EnvColor[3]; switch (format) { case GL_ALPHA: for (i=0;iend < MAX_WIDTH); @@ -1234,8 +1034,15 @@ _swrast_texture_span( GLcontext *ctx, SWspan *span ) /* * Save copy of the incoming fragment colors (the GL_PRIMARY_COLOR) */ - if (swrast->_AnyTextureCombine) - MEMCPY(primary_rgba, span->array->rgba, 4 * span->end * sizeof(GLchan)); + if (swrast->_AnyTextureCombine) { + GLuint i; + for (i = 0; i < span->end; i++) { + primary_rgba[i][RCOMP] = CHAN_TO_FLOAT(span->array->rgba[i][RCOMP]); + primary_rgba[i][GCOMP] = CHAN_TO_FLOAT(span->array->rgba[i][GCOMP]); + primary_rgba[i][BCOMP] = CHAN_TO_FLOAT(span->array->rgba[i][BCOMP]); + primary_rgba[i][ACOMP] = CHAN_TO_FLOAT(span->array->rgba[i][ACOMP]); + } + } /* First must sample all bump maps */ for (unit = 0; unit < ctx->Const.MaxTextureUnits; unit++) { @@ -1323,8 +1130,8 @@ _swrast_texture_span( GLcontext *ctx, SWspan *span ) const struct gl_texture_unit *texUnit = &ctx->Texture.Unit[unit]; const struct gl_texture_object *curObj = texUnit->_Current; GLfloat *lambda = span->array->lambda[unit]; - GLchan (*texels)[4] = (GLchan (*)[4]) - (swrast->TexelBuffer + unit * (span->end * 4 * sizeof(GLchan))); + GLfloat (*texels)[4] = (GLfloat (*)[4]) + (swrast->TexelBuffer + unit * (span->end * 4 * sizeof(GLfloat))); /* adjust texture lod (lambda) */ if (span->arrayMask & SPAN_LAMBDA) { @@ -1357,13 +1164,7 @@ _swrast_texture_span( GLcontext *ctx, SWspan *span ) /* GL_SGI_texture_color_table */ if (texUnit->ColorTableEnabled) { -#if CHAN_TYPE == GL_UNSIGNED_BYTE - _mesa_lookup_rgba_ubyte(&texUnit->ColorTable, span->end, texels); -#elif CHAN_TYPE == GL_UNSIGNED_SHORT - _mesa_lookup_rgba_ubyte(&texUnit->ColorTable, span->end, texels); -#else _mesa_lookup_rgba_float(&texUnit->ColorTable, span->end, texels); -#endif } /* GL_EXT_texture_swizzle */ @@ -1383,19 +1184,19 @@ _swrast_texture_span( GLcontext *ctx, SWspan *span ) const struct gl_texture_unit *texUnit = &ctx->Texture.Unit[unit]; if (texUnit->_CurrentCombine != &texUnit->_EnvMode ) { texture_combine( ctx, unit, span->end, - (CONST GLchan (*)[4]) primary_rgba, + (CONST GLfloat (*)[4]) primary_rgba, swrast->TexelBuffer, span->array->rgba ); } else { /* conventional texture blend */ - const GLchan (*texels)[4] = (const GLchan (*)[4]) + const GLfloat (*texels)[4] = (const GLfloat (*)[4]) (swrast->TexelBuffer + unit * - (span->end * 4 * sizeof(GLchan))); + (span->end * 4 * sizeof(GLfloat))); texture_apply( ctx, texUnit, span->end, - (CONST GLchan (*)[4]) primary_rgba, texels, + (CONST GLfloat (*)[4]) primary_rgba, texels, span->array->rgba ); } } diff --git a/src/mesa/swrast/s_texfilter.c b/src/mesa/swrast/s_texfilter.c index 19317c393a..b76de045f8 100644 --- a/src/mesa/swrast/s_texfilter.c +++ b/src/mesa/swrast/s_texfilter.c @@ -133,27 +133,12 @@ ilerp_3d(GLint ia, GLint ib, GLint ic, * Do linear interpolation of colors. */ static INLINE void -lerp_rgba(GLchan result[4], GLfloat t, const GLchan a[4], const GLchan b[4]) +lerp_rgba(GLfloat result[4], GLfloat t, const GLfloat a[4], const GLfloat b[4]) { -#if CHAN_TYPE == GL_FLOAT result[0] = LERP(t, a[0], b[0]); result[1] = LERP(t, a[1], b[1]); result[2] = LERP(t, a[2], b[2]); result[3] = LERP(t, a[3], b[3]); -#elif CHAN_TYPE == GL_UNSIGNED_SHORT - result[0] = (GLchan) (LERP(t, a[0], b[0]) + 0.5); - result[1] = (GLchan) (LERP(t, a[1], b[1]) + 0.5); - result[2] = (GLchan) (LERP(t, a[2], b[2]) + 0.5); - result[3] = (GLchan) (LERP(t, a[3], b[3]) + 0.5); -#else - /* fixed point interpolants in [0, ILERP_SCALE] */ - const GLint it = IROUND_POS(t * ILERP_SCALE); - ASSERT(CHAN_TYPE == GL_UNSIGNED_BYTE); - result[0] = ILERP(it, a[0], b[0]); - result[1] = ILERP(it, a[1], b[1]); - result[2] = ILERP(it, a[2], b[2]); - result[3] = ILERP(it, a[3], b[3]); -#endif } @@ -161,29 +146,14 @@ lerp_rgba(GLchan result[4], GLfloat t, const GLchan a[4], const GLchan b[4]) * Do bilinear interpolation of colors. */ static INLINE void -lerp_rgba_2d(GLchan result[4], GLfloat a, GLfloat b, - const GLchan t00[4], const GLchan t10[4], - const GLchan t01[4], const GLchan t11[4]) +lerp_rgba_2d(GLfloat result[4], GLfloat a, GLfloat b, + const GLfloat t00[4], const GLfloat t10[4], + const GLfloat t01[4], const GLfloat t11[4]) { -#if CHAN_TYPE == GL_FLOAT result[0] = lerp_2d(a, b, t00[0], t10[0], t01[0], t11[0]); result[1] = lerp_2d(a, b, t00[1], t10[1], t01[1], t11[1]); result[2] = lerp_2d(a, b, t00[2], t10[2], t01[2], t11[2]); result[3] = lerp_2d(a, b, t00[3], t10[3], t01[3], t11[3]); -#elif CHAN_TYPE == GL_UNSIGNED_SHORT - result[0] = (GLchan) (lerp_2d(a, b, t00[0], t10[0], t01[0], t11[0]) + 0.5); - result[1] = (GLchan) (lerp_2d(a, b, t00[1], t10[1], t01[1], t11[1]) + 0.5); - result[2] = (GLchan) (lerp_2d(a, b, t00[2], t10[2], t01[2], t11[2]) + 0.5); - result[3] = (GLchan) (lerp_2d(a, b, t00[3], t10[3], t01[3], t11[3]) + 0.5); -#else - const GLint ia = IROUND_POS(a * ILERP_SCALE); - const GLint ib = IROUND_POS(b * ILERP_SCALE); - ASSERT(CHAN_TYPE == GL_UNSIGNED_BYTE); - result[0] = ilerp_2d(ia, ib, t00[0], t10[0], t01[0], t11[0]); - result[1] = ilerp_2d(ia, ib, t00[1], t10[1], t01[1], t11[1]); - result[2] = ilerp_2d(ia, ib, t00[2], t10[2], t01[2], t11[2]); - result[3] = ilerp_2d(ia, ib, t00[3], t10[3], t01[3], t11[3]); -#endif } @@ -191,34 +161,18 @@ lerp_rgba_2d(GLchan result[4], GLfloat a, GLfloat b, * Do trilinear interpolation of colors. */ static INLINE void -lerp_rgba_3d(GLchan result[4], GLfloat a, GLfloat b, GLfloat c, - const GLchan t000[4], const GLchan t100[4], - const GLchan t010[4], const GLchan t110[4], - const GLchan t001[4], const GLchan t101[4], - const GLchan t011[4], const GLchan t111[4]) +lerp_rgba_3d(GLfloat result[4], GLfloat a, GLfloat b, GLfloat c, + const GLfloat t000[4], const GLfloat t100[4], + const GLfloat t010[4], const GLfloat t110[4], + const GLfloat t001[4], const GLfloat t101[4], + const GLfloat t011[4], const GLfloat t111[4]) { GLuint k; /* compiler should unroll these short loops */ -#if CHAN_TYPE == GL_FLOAT for (k = 0; k < 4; k++) { result[k] = lerp_3d(a, b, c, t000[k], t100[k], t010[k], t110[k], t001[k], t101[k], t011[k], t111[k]); } -#elif CHAN_TYPE == GL_UNSIGNED_SHORT - for (k = 0; k < 4; k++) { - result[k] = (GLchan)(lerp_3d(a, b, c, - t000[k], t100[k], t010[k], t110[k], - t001[k], t101[k], t011[k], t111[k]) + 0.5F); - } -#else - GLint ia = IROUND_POS(a * ILERP_SCALE); - GLint ib = IROUND_POS(b * ILERP_SCALE); - GLint ic = IROUND_POS(c * ILERP_SCALE); - for (k = 0; k < 4; k++) { - result[k] = ilerp_3d(ia, ib, ic, t000[k], t100[k], t010[k], t110[k], - t001[k], t101[k], t011[k], t111[k]); - } -#endif } @@ -671,7 +625,7 @@ static INLINE void sample_1d_nearest(GLcontext *ctx, const struct gl_texture_object *tObj, const struct gl_texture_image *img, - const GLfloat texcoord[4], GLchan rgba[4]) + const GLfloat texcoord[4], GLfloat rgba[4]) { const GLint width = img->Width2; /* without border, power of two */ GLint i; @@ -680,10 +634,10 @@ sample_1d_nearest(GLcontext *ctx, i += img->Border; if (i < 0 || i >= (GLint) img->Width) { /* Need this test for GL_CLAMP_TO_BORDER mode */ - COPY_CHAN4(rgba, tObj->_BorderChan); + COPY_4V(rgba, tObj->BorderColor); } else { - img->FetchTexelc(img, i, 0, 0, rgba); + img->FetchTexelf(img, i, 0, 0, rgba); } } @@ -695,13 +649,13 @@ static INLINE void sample_1d_linear(GLcontext *ctx, const struct gl_texture_object *tObj, const struct gl_texture_image *img, - const GLfloat texcoord[4], GLchan rgba[4]) + const GLfloat texcoord[4], GLfloat rgba[4]) { const GLint width = img->Width2; GLint i0, i1; GLbitfield useBorderColor = 0x0; GLfloat a; - GLchan t0[4], t1[4]; /* texels */ + GLfloat t0[4], t1[4]; /* texels */ linear_texel_locations(tObj->WrapS, img, width, texcoord[0], &i0, &i1, &a); @@ -716,16 +670,16 @@ sample_1d_linear(GLcontext *ctx, /* fetch texel colors */ if (useBorderColor & I0BIT) { - COPY_CHAN4(t0, tObj->_BorderChan); + COPY_4V(t0, tObj->BorderColor); } else { - img->FetchTexelc(img, i0, 0, 0, t0); + img->FetchTexelf(img, i0, 0, 0, t0); } if (useBorderColor & I1BIT) { - COPY_CHAN4(t1, tObj->_BorderChan); + COPY_4V(t1, tObj->BorderColor); } else { - img->FetchTexelc(img, i1, 0, 0, t1); + img->FetchTexelf(img, i1, 0, 0, t1); } lerp_rgba(rgba, a, t0, t1); @@ -736,7 +690,7 @@ static void sample_1d_nearest_mipmap_nearest(GLcontext *ctx, const struct gl_texture_object *tObj, GLuint n, const GLfloat texcoord[][4], - const GLfloat lambda[], GLchan rgba[][4]) + const GLfloat lambda[], GLfloat rgba[][4]) { GLuint i; ASSERT(lambda != NULL); @@ -751,7 +705,7 @@ static void sample_1d_linear_mipmap_nearest(GLcontext *ctx, const struct gl_texture_object *tObj, GLuint n, const GLfloat texcoord[][4], - const GLfloat lambda[], GLchan rgba[][4]) + const GLfloat lambda[], GLfloat rgba[][4]) { GLuint i; ASSERT(lambda != NULL); @@ -766,7 +720,7 @@ static void sample_1d_nearest_mipmap_linear(GLcontext *ctx, const struct gl_texture_object *tObj, GLuint n, const GLfloat texcoord[][4], - const GLfloat lambda[], GLchan rgba[][4]) + const GLfloat lambda[], GLfloat rgba[][4]) { GLuint i; ASSERT(lambda != NULL); @@ -777,7 +731,7 @@ sample_1d_nearest_mipmap_linear(GLcontext *ctx, texcoord[i], rgba[i]); } else { - GLchan t0[4], t1[4]; + GLfloat t0[4], t1[4]; const GLfloat f = FRAC(lambda[i]); sample_1d_nearest(ctx, tObj, tObj->Image[0][level ], texcoord[i], t0); sample_1d_nearest(ctx, tObj, tObj->Image[0][level+1], texcoord[i], t1); @@ -791,7 +745,7 @@ static void sample_1d_linear_mipmap_linear(GLcontext *ctx, const struct gl_texture_object *tObj, GLuint n, const GLfloat texcoord[][4], - const GLfloat lambda[], GLchan rgba[][4]) + const GLfloat lambda[], GLfloat rgba[][4]) { GLuint i; ASSERT(lambda != NULL); @@ -802,7 +756,7 @@ sample_1d_linear_mipmap_linear(GLcontext *ctx, texcoord[i], rgba[i]); } else { - GLchan t0[4], t1[4]; + GLfloat t0[4], t1[4]; const GLfloat f = FRAC(lambda[i]); sample_1d_linear(ctx, tObj, tObj->Image[0][level ], texcoord[i], t0); sample_1d_linear(ctx, tObj, tObj->Image[0][level+1], texcoord[i], t1); @@ -817,7 +771,7 @@ static void sample_nearest_1d( GLcontext *ctx, const struct gl_texture_object *tObj, GLuint n, const GLfloat texcoords[][4], const GLfloat lambda[], - GLchan rgba[][4] ) + GLfloat rgba[][4] ) { GLuint i; struct gl_texture_image *image = tObj->Image[0][tObj->BaseLevel]; @@ -833,7 +787,7 @@ static void sample_linear_1d( GLcontext *ctx, const struct gl_texture_object *tObj, GLuint n, const GLfloat texcoords[][4], const GLfloat lambda[], - GLchan rgba[][4] ) + GLfloat rgba[][4] ) { GLuint i; struct gl_texture_image *image = tObj->Image[0][tObj->BaseLevel]; @@ -849,7 +803,7 @@ static void sample_lambda_1d( GLcontext *ctx, const struct gl_texture_object *tObj, GLuint n, const GLfloat texcoords[][4], - const GLfloat lambda[], GLchan rgba[][4] ) + const GLfloat lambda[], GLfloat rgba[][4] ) { GLuint minStart, minEnd; /* texels with minification */ GLuint magStart, magEnd; /* texels with magnification */ @@ -929,7 +883,7 @@ sample_2d_nearest(GLcontext *ctx, const struct gl_texture_object *tObj, const struct gl_texture_image *img, const GLfloat texcoord[4], - GLchan rgba[]) + GLfloat rgba[]) { const GLint width = img->Width2; /* without border, power of two */ const GLint height = img->Height2; /* without border, power of two */ @@ -945,10 +899,10 @@ sample_2d_nearest(GLcontext *ctx, if (i < 0 || i >= (GLint) img->Width || j < 0 || j >= (GLint) img->Height) { /* Need this test for GL_CLAMP_TO_BORDER mode */ - COPY_CHAN4(rgba, tObj->_BorderChan); + COPY_4V(rgba, tObj->BorderColor); } else { - img->FetchTexelc(img, i, j, 0, rgba); + img->FetchTexelf(img, i, j, 0, rgba); } } @@ -962,14 +916,14 @@ sample_2d_linear(GLcontext *ctx, const struct gl_texture_object *tObj, const struct gl_texture_image *img, const GLfloat texcoord[4], - GLchan rgba[]) + GLfloat rgba[]) { const GLint width = img->Width2; const GLint height = img->Height2; GLint i0, j0, i1, j1; GLbitfield useBorderColor = 0x0; GLfloat a, b; - GLchan t00[4], t10[4], t01[4], t11[4]; /* sampled texel colors */ + GLfloat t00[4], t10[4], t01[4], t11[4]; /* sampled texel colors */ linear_texel_locations(tObj->WrapS, img, width, texcoord[0], &i0, &i1, &a); linear_texel_locations(tObj->WrapT, img, height, texcoord[1], &j0, &j1, &b); @@ -989,28 +943,28 @@ sample_2d_linear(GLcontext *ctx, /* fetch four texel colors */ if (useBorderColor & (I0BIT | J0BIT)) { - COPY_CHAN4(t00, tObj->_BorderChan); + COPY_4V(t00, tObj->BorderColor); } else { - img->FetchTexelc(img, i0, j0, 0, t00); + img->FetchTexelf(img, i0, j0, 0, t00); } if (useBorderColor & (I1BIT | J0BIT)) { - COPY_CHAN4(t10, tObj->_BorderChan); + COPY_4V(t10, tObj->BorderColor); } else { - img->FetchTexelc(img, i1, j0, 0, t10); + img->FetchTexelf(img, i1, j0, 0, t10); } if (useBorderColor & (I0BIT | J1BIT)) { - COPY_CHAN4(t01, tObj->_BorderChan); + COPY_4V(t01, tObj->BorderColor); } else { - img->FetchTexelc(img, i0, j1, 0, t01); + img->FetchTexelf(img, i0, j1, 0, t01); } if (useBorderColor & (I1BIT | J1BIT)) { - COPY_CHAN4(t11, tObj->_BorderChan); + COPY_4V(t11, tObj->BorderColor); } else { - img->FetchTexelc(img, i1, j1, 0, t11); + img->FetchTexelf(img, i1, j1, 0, t11); } lerp_rgba_2d(rgba, a, b, t00, t10, t01, t11); @@ -1026,13 +980,13 @@ sample_2d_linear_repeat(GLcontext *ctx, const struct gl_texture_object *tObj, const struct gl_texture_image *img, const GLfloat texcoord[4], - GLchan rgba[]) + GLfloat rgba[]) { const GLint width = img->Width2; const GLint height = img->Height2; GLint i0, j0, i1, j1; GLfloat wi, wj; - GLchan t00[4], t10[4], t01[4], t11[4]; /* sampled texel colors */ + GLfloat t00[4], t10[4], t01[4], t11[4]; /* sampled texel colors */ (void) ctx; @@ -1045,10 +999,10 @@ sample_2d_linear_repeat(GLcontext *ctx, linear_repeat_texel_location(width, texcoord[0], &i0, &i1, &wi); linear_repeat_texel_location(height, texcoord[1], &j0, &j1, &wj); - img->FetchTexelc(img, i0, j0, 0, t00); - img->FetchTexelc(img, i1, j0, 0, t10); - img->FetchTexelc(img, i0, j1, 0, t01); - img->FetchTexelc(img, i1, j1, 0, t11); + img->FetchTexelf(img, i0, j0, 0, t00); + img->FetchTexelf(img, i1, j0, 0, t10); + img->FetchTexelf(img, i0, j1, 0, t01); + img->FetchTexelf(img, i1, j1, 0, t11); lerp_rgba_2d(rgba, wi, wj, t00, t10, t01, t11); } @@ -1058,7 +1012,7 @@ static void sample_2d_nearest_mipmap_nearest(GLcontext *ctx, const struct gl_texture_object *tObj, GLuint n, const GLfloat texcoord[][4], - const GLfloat lambda[], GLchan rgba[][4]) + const GLfloat lambda[], GLfloat rgba[][4]) { GLuint i; for (i = 0; i < n; i++) { @@ -1072,7 +1026,7 @@ static void sample_2d_linear_mipmap_nearest(GLcontext *ctx, const struct gl_texture_object *tObj, GLuint n, const GLfloat texcoord[][4], - const GLfloat lambda[], GLchan rgba[][4]) + const GLfloat lambda[], GLfloat rgba[][4]) { GLuint i; ASSERT(lambda != NULL); @@ -1087,7 +1041,7 @@ static void sample_2d_nearest_mipmap_linear(GLcontext *ctx, const struct gl_texture_object *tObj, GLuint n, const GLfloat texcoord[][4], - const GLfloat lambda[], GLchan rgba[][4]) + const GLfloat lambda[], GLfloat rgba[][4]) { GLuint i; ASSERT(lambda != NULL); @@ -1098,7 +1052,7 @@ sample_2d_nearest_mipmap_linear(GLcontext *ctx, texcoord[i], rgba[i]); } else { - GLchan t0[4], t1[4]; /* texels */ + GLfloat t0[4], t1[4]; /* texels */ const GLfloat f = FRAC(lambda[i]); sample_2d_nearest(ctx, tObj, tObj->Image[0][level ], texcoord[i], t0); sample_2d_nearest(ctx, tObj, tObj->Image[0][level+1], texcoord[i], t1); @@ -1112,7 +1066,7 @@ static void sample_2d_linear_mipmap_linear( GLcontext *ctx, const struct gl_texture_object *tObj, GLuint n, const GLfloat texcoord[][4], - const GLfloat lambda[], GLchan rgba[][4] ) + const GLfloat lambda[], GLfloat rgba[][4] ) { GLuint i; ASSERT(lambda != NULL); @@ -1123,7 +1077,7 @@ sample_2d_linear_mipmap_linear( GLcontext *ctx, texcoord[i], rgba[i]); } else { - GLchan t0[4], t1[4]; /* texels */ + GLfloat t0[4], t1[4]; /* texels */ const GLfloat f = FRAC(lambda[i]); sample_2d_linear(ctx, tObj, tObj->Image[0][level ], texcoord[i], t0); sample_2d_linear(ctx, tObj, tObj->Image[0][level+1], texcoord[i], t1); @@ -1137,7 +1091,7 @@ static void sample_2d_linear_mipmap_linear_repeat(GLcontext *ctx, const struct gl_texture_object *tObj, GLuint n, const GLfloat texcoord[][4], - const GLfloat lambda[], GLchan rgba[][4]) + const GLfloat lambda[], GLfloat rgba[][4]) { GLuint i; ASSERT(lambda != NULL); @@ -1150,7 +1104,7 @@ sample_2d_linear_mipmap_linear_repeat(GLcontext *ctx, texcoord[i], rgba[i]); } else { - GLchan t0[4], t1[4]; /* texels */ + GLfloat t0[4], t1[4]; /* texels */ const GLfloat f = FRAC(lambda[i]); sample_2d_linear_repeat(ctx, tObj, tObj->Image[0][level ], texcoord[i], t0); @@ -1167,7 +1121,7 @@ static void sample_nearest_2d(GLcontext *ctx, const struct gl_texture_object *tObj, GLuint n, const GLfloat texcoords[][4], - const GLfloat lambda[], GLchan rgba[][4]) + const GLfloat lambda[], GLfloat rgba[][4]) { GLuint i; struct gl_texture_image *image = tObj->Image[0][tObj->BaseLevel]; @@ -1183,7 +1137,7 @@ static void sample_linear_2d(GLcontext *ctx, const struct gl_texture_object *tObj, GLuint n, const GLfloat texcoords[][4], - const GLfloat lambda[], GLchan rgba[][4]) + const GLfloat lambda[], GLfloat rgba[][4]) { GLuint i; struct gl_texture_image *image = tObj->Image[0][tObj->BaseLevel]; @@ -1279,7 +1233,7 @@ opt_sample_rgba_2d(GLcontext *ctx, const GLint row = IFLOOR(texcoords[i][1] * height) & rowMask; const GLint pos = (row << shift) | col; const GLchan *texel = ((GLchan *) img->Data) + (pos << 2); /* pos*4 */ - COPY_CHAN4(rgba[i], texel); + COPY_4V(rgba[i], texel); } } @@ -1289,7 +1243,7 @@ static void sample_lambda_2d(GLcontext *ctx, const struct gl_texture_object *tObj, GLuint n, const GLfloat texcoords[][4], - const GLfloat lambda[], GLchan rgba[][4]) + const GLfloat lambda[], GLfloat rgba[][4]) { const struct gl_texture_image *tImg = tObj->Image[0][tObj->BaseLevel]; GLuint minStart, minEnd; /* texels with minification */ @@ -1312,6 +1266,7 @@ sample_lambda_2d(GLcontext *ctx, case GL_NEAREST: if (repeatNoBorderPOT) { switch (tImg->TexFormat->MesaFormat) { +#if 0 case MESA_FORMAT_RGB: opt_sample_rgb_2d(ctx, tObj, m, texcoords + minStart, NULL, rgba + minStart); @@ -1320,6 +1275,7 @@ sample_lambda_2d(GLcontext *ctx, opt_sample_rgba_2d(ctx, tObj, m, texcoords + minStart, NULL, rgba + minStart); break; +#endif default: sample_nearest_2d(ctx, tObj, m, texcoords + minStart, NULL, rgba + minStart ); @@ -1369,6 +1325,7 @@ sample_lambda_2d(GLcontext *ctx, case GL_NEAREST: if (repeatNoBorderPOT) { switch (tImg->TexFormat->MesaFormat) { +#if 0 case MESA_FORMAT_RGB: opt_sample_rgb_2d(ctx, tObj, m, texcoords + magStart, NULL, rgba + magStart); @@ -1377,6 +1334,7 @@ sample_lambda_2d(GLcontext *ctx, opt_sample_rgba_2d(ctx, tObj, m, texcoords + magStart, NULL, rgba + magStart); break; +#endif default: sample_nearest_2d(ctx, tObj, m, texcoords + magStart, NULL, rgba + magStart ); @@ -1411,7 +1369,7 @@ sample_3d_nearest(GLcontext *ctx, const struct gl_texture_object *tObj, const struct gl_texture_image *img, const GLfloat texcoord[4], - GLchan rgba[4]) + GLfloat rgba[4]) { const GLint width = img->Width2; /* without border, power of two */ const GLint height = img->Height2; /* without border, power of two */ @@ -1427,10 +1385,10 @@ sample_3d_nearest(GLcontext *ctx, j < 0 || j >= (GLint) img->Height || k < 0 || k >= (GLint) img->Depth) { /* Need this test for GL_CLAMP_TO_BORDER mode */ - COPY_CHAN4(rgba, tObj->_BorderChan); + COPY_4V(rgba, tObj->BorderColor); } else { - img->FetchTexelc(img, i, j, k, rgba); + img->FetchTexelf(img, i, j, k, rgba); } } @@ -1443,7 +1401,7 @@ sample_3d_linear(GLcontext *ctx, const struct gl_texture_object *tObj, const struct gl_texture_image *img, const GLfloat texcoord[4], - GLchan rgba[4]) + GLfloat rgba[4]) { const GLint width = img->Width2; const GLint height = img->Height2; @@ -1451,8 +1409,8 @@ sample_3d_linear(GLcontext *ctx, GLint i0, j0, k0, i1, j1, k1; GLbitfield useBorderColor = 0x0; GLfloat a, b, c; - GLchan t000[4], t010[4], t001[4], t011[4]; - GLchan t100[4], t110[4], t101[4], t111[4]; + GLfloat t000[4], t010[4], t001[4], t011[4]; + GLfloat t100[4], t110[4], t101[4], t111[4]; linear_texel_locations(tObj->WrapS, img, width, texcoord[0], &i0, &i1, &a); linear_texel_locations(tObj->WrapT, img, height, texcoord[1], &j0, &j1, &b); @@ -1478,53 +1436,53 @@ sample_3d_linear(GLcontext *ctx, /* Fetch texels */ if (useBorderColor & (I0BIT | J0BIT | K0BIT)) { - COPY_CHAN4(t000, tObj->_BorderChan); + COPY_4V(t000, tObj->BorderColor); } else { - img->FetchTexelc(img, i0, j0, k0, t000); + img->FetchTexelf(img, i0, j0, k0, t000); } if (useBorderColor & (I1BIT | J0BIT | K0BIT)) { - COPY_CHAN4(t100, tObj->_BorderChan); + COPY_4V(t100, tObj->BorderColor); } else { - img->FetchTexelc(img, i1, j0, k0, t100); + img->FetchTexelf(img, i1, j0, k0, t100); } if (useBorderColor & (I0BIT | J1BIT | K0BIT)) { - COPY_CHAN4(t010, tObj->_BorderChan); + COPY_4V(t010, tObj->BorderColor); } else { - img->FetchTexelc(img, i0, j1, k0, t010); + img->FetchTexelf(img, i0, j1, k0, t010); } if (useBorderColor & (I1BIT | J1BIT | K0BIT)) { - COPY_CHAN4(t110, tObj->_BorderChan); + COPY_4V(t110, tObj->BorderColor); } else { - img->FetchTexelc(img, i1, j1, k0, t110); + img->FetchTexelf(img, i1, j1, k0, t110); } if (useBorderColor & (I0BIT | J0BIT | K1BIT)) { - COPY_CHAN4(t001, tObj->_BorderChan); + COPY_4V(t001, tObj->BorderColor); } else { - img->FetchTexelc(img, i0, j0, k1, t001); + img->FetchTexelf(img, i0, j0, k1, t001); } if (useBorderColor & (I1BIT | J0BIT | K1BIT)) { - COPY_CHAN4(t101, tObj->_BorderChan); + COPY_4V(t101, tObj->BorderColor); } else { - img->FetchTexelc(img, i1, j0, k1, t101); + img->FetchTexelf(img, i1, j0, k1, t101); } if (useBorderColor & (I0BIT | J1BIT | K1BIT)) { - COPY_CHAN4(t011, tObj->_BorderChan); + COPY_4V(t011, tObj->BorderColor); } else { - img->FetchTexelc(img, i0, j1, k1, t011); + img->FetchTexelf(img, i0, j1, k1, t011); } if (useBorderColor & (I1BIT | J1BIT | K1BIT)) { - COPY_CHAN4(t111, tObj->_BorderChan); + COPY_4V(t111, tObj->BorderColor); } else { - img->FetchTexelc(img, i1, j1, k1, t111); + img->FetchTexelf(img, i1, j1, k1, t111); } /* trilinear interpolation of samples */ @@ -1536,7 +1494,7 @@ static void sample_3d_nearest_mipmap_nearest(GLcontext *ctx, const struct gl_texture_object *tObj, GLuint n, const GLfloat texcoord[][4], - const GLfloat lambda[], GLchan rgba[][4] ) + const GLfloat lambda[], GLfloat rgba[][4] ) { GLuint i; for (i = 0; i < n; i++) { @@ -1550,7 +1508,7 @@ static void sample_3d_linear_mipmap_nearest(GLcontext *ctx, const struct gl_texture_object *tObj, GLuint n, const GLfloat texcoord[][4], - const GLfloat lambda[], GLchan rgba[][4]) + const GLfloat lambda[], GLfloat rgba[][4]) { GLuint i; ASSERT(lambda != NULL); @@ -1565,7 +1523,7 @@ static void sample_3d_nearest_mipmap_linear(GLcontext *ctx, const struct gl_texture_object *tObj, GLuint n, const GLfloat texcoord[][4], - const GLfloat lambda[], GLchan rgba[][4]) + const GLfloat lambda[], GLfloat rgba[][4]) { GLuint i; ASSERT(lambda != NULL); @@ -1576,7 +1534,7 @@ sample_3d_nearest_mipmap_linear(GLcontext *ctx, texcoord[i], rgba[i]); } else { - GLchan t0[4], t1[4]; /* texels */ + GLfloat t0[4], t1[4]; /* texels */ const GLfloat f = FRAC(lambda[i]); sample_3d_nearest(ctx, tObj, tObj->Image[0][level ], texcoord[i], t0); sample_3d_nearest(ctx, tObj, tObj->Image[0][level+1], texcoord[i], t1); @@ -1590,7 +1548,7 @@ static void sample_3d_linear_mipmap_linear(GLcontext *ctx, const struct gl_texture_object *tObj, GLuint n, const GLfloat texcoord[][4], - const GLfloat lambda[], GLchan rgba[][4]) + const GLfloat lambda[], GLfloat rgba[][4]) { GLuint i; ASSERT(lambda != NULL); @@ -1601,7 +1559,7 @@ sample_3d_linear_mipmap_linear(GLcontext *ctx, texcoord[i], rgba[i]); } else { - GLchan t0[4], t1[4]; /* texels */ + GLfloat t0[4], t1[4]; /* texels */ const GLfloat f = FRAC(lambda[i]); sample_3d_linear(ctx, tObj, tObj->Image[0][level ], texcoord[i], t0); sample_3d_linear(ctx, tObj, tObj->Image[0][level+1], texcoord[i], t1); @@ -1616,7 +1574,7 @@ static void sample_nearest_3d(GLcontext *ctx, const struct gl_texture_object *tObj, GLuint n, const GLfloat texcoords[][4], const GLfloat lambda[], - GLchan rgba[][4]) + GLfloat rgba[][4]) { GLuint i; struct gl_texture_image *image = tObj->Image[0][tObj->BaseLevel]; @@ -1632,7 +1590,7 @@ static void sample_linear_3d(GLcontext *ctx, const struct gl_texture_object *tObj, GLuint n, const GLfloat texcoords[][4], - const GLfloat lambda[], GLchan rgba[][4]) + const GLfloat lambda[], GLfloat rgba[][4]) { GLuint i; struct gl_texture_image *image = tObj->Image[0][tObj->BaseLevel]; @@ -1648,7 +1606,7 @@ static void sample_lambda_3d(GLcontext *ctx, const struct gl_texture_object *tObj, GLuint n, const GLfloat texcoords[][4], const GLfloat lambda[], - GLchan rgba[][4]) + GLfloat rgba[][4]) { GLuint minStart, minEnd; /* texels with minification */ GLuint magStart, magEnd; /* texels with magnification */ @@ -1799,7 +1757,7 @@ static void sample_nearest_cube(GLcontext *ctx, const struct gl_texture_object *tObj, GLuint n, const GLfloat texcoords[][4], const GLfloat lambda[], - GLchan rgba[][4]) + GLfloat rgba[][4]) { GLuint i; (void) lambda; @@ -1817,7 +1775,7 @@ static void sample_linear_cube(GLcontext *ctx, const struct gl_texture_object *tObj, GLuint n, const GLfloat texcoords[][4], - const GLfloat lambda[], GLchan rgba[][4]) + const GLfloat lambda[], GLfloat rgba[][4]) { GLuint i; (void) lambda; @@ -1835,7 +1793,7 @@ static void sample_cube_nearest_mipmap_nearest(GLcontext *ctx, const struct gl_texture_object *tObj, GLuint n, const GLfloat texcoord[][4], - const GLfloat lambda[], GLchan rgba[][4]) + const GLfloat lambda[], GLfloat rgba[][4]) { GLuint i; ASSERT(lambda != NULL); @@ -1864,7 +1822,7 @@ static void sample_cube_linear_mipmap_nearest(GLcontext *ctx, const struct gl_texture_object *tObj, GLuint n, const GLfloat texcoord[][4], - const GLfloat lambda[], GLchan rgba[][4]) + const GLfloat lambda[], GLfloat rgba[][4]) { GLuint i; ASSERT(lambda != NULL); @@ -1883,7 +1841,7 @@ static void sample_cube_nearest_mipmap_linear(GLcontext *ctx, const struct gl_texture_object *tObj, GLuint n, const GLfloat texcoord[][4], - const GLfloat lambda[], GLchan rgba[][4]) + const GLfloat lambda[], GLfloat rgba[][4]) { GLuint i; ASSERT(lambda != NULL); @@ -1898,7 +1856,7 @@ sample_cube_nearest_mipmap_linear(GLcontext *ctx, newCoord, rgba[i]); } else { - GLchan t0[4], t1[4]; /* texels */ + GLfloat t0[4], t1[4]; /* texels */ const GLfloat f = FRAC(lambda[i]); sample_2d_nearest(ctx, tObj, images[level ], newCoord, t0); sample_2d_nearest(ctx, tObj, images[level+1], newCoord, t1); @@ -1912,7 +1870,7 @@ static void sample_cube_linear_mipmap_linear(GLcontext *ctx, const struct gl_texture_object *tObj, GLuint n, const GLfloat texcoord[][4], - const GLfloat lambda[], GLchan rgba[][4]) + const GLfloat lambda[], GLfloat rgba[][4]) { GLuint i; ASSERT(lambda != NULL); @@ -1927,7 +1885,7 @@ sample_cube_linear_mipmap_linear(GLcontext *ctx, newCoord, rgba[i]); } else { - GLchan t0[4], t1[4]; + GLfloat t0[4], t1[4]; const GLfloat f = FRAC(lambda[i]); sample_2d_linear(ctx, tObj, images[level ], newCoord, t0); sample_2d_linear(ctx, tObj, images[level+1], newCoord, t1); @@ -1942,7 +1900,7 @@ static void sample_lambda_cube(GLcontext *ctx, const struct gl_texture_object *tObj, GLuint n, const GLfloat texcoords[][4], const GLfloat lambda[], - GLchan rgba[][4]) + GLfloat rgba[][4]) { GLuint minStart, minEnd; /* texels with minification */ GLuint magStart, magEnd; /* texels with magnification */ @@ -2076,7 +2034,7 @@ static void sample_nearest_rect(GLcontext *ctx, const struct gl_texture_object *tObj, GLuint n, const GLfloat texcoords[][4], const GLfloat lambda[], - GLchan rgba[][4]) + GLfloat rgba[][4]) { const struct gl_texture_image *img = tObj->Image[0][0]; const GLint width = img->Width; @@ -2099,9 +2057,9 @@ sample_nearest_rect(GLcontext *ctx, col = clamp_rect_coord_nearest(tObj->WrapS, texcoords[i][0], width); row = clamp_rect_coord_nearest(tObj->WrapT, texcoords[i][1], height); if (col < 0 || col >= width || row < 0 || row >= height) - COPY_CHAN4(rgba[i], tObj->_BorderChan); + COPY_4V(rgba[i], tObj->BorderColor); else - img->FetchTexelc(img, col, row, 0, rgba[i]); + img->FetchTexelf(img, col, row, 0, rgba[i]); } } @@ -2110,7 +2068,7 @@ static void sample_linear_rect(GLcontext *ctx, const struct gl_texture_object *tObj, GLuint n, const GLfloat texcoords[][4], - const GLfloat lambda[], GLchan rgba[][4]) + const GLfloat lambda[], GLfloat rgba[][4]) { const struct gl_texture_image *img = tObj->Image[0][0]; const GLint width = img->Width; @@ -2130,7 +2088,7 @@ sample_linear_rect(GLcontext *ctx, for (i = 0; i < n; i++) { GLint i0, j0, i1, j1; - GLchan t00[4], t01[4], t10[4], t11[4]; + GLfloat t00[4], t01[4], t10[4], t11[4]; GLfloat a, b; GLbitfield useBorderColor = 0x0; @@ -2147,24 +2105,24 @@ sample_linear_rect(GLcontext *ctx, /* get four texel samples */ if (useBorderColor & (I0BIT | J0BIT)) - COPY_CHAN4(t00, tObj->_BorderChan); + COPY_4V(t00, tObj->BorderColor); else - img->FetchTexelc(img, i0, j0, 0, t00); + img->FetchTexelf(img, i0, j0, 0, t00); if (useBorderColor & (I1BIT | J0BIT)) - COPY_CHAN4(t10, tObj->_BorderChan); + COPY_4V(t10, tObj->BorderColor); else - img->FetchTexelc(img, i1, j0, 0, t10); + img->FetchTexelf(img, i1, j0, 0, t10); if (useBorderColor & (I0BIT | J1BIT)) - COPY_CHAN4(t01, tObj->_BorderChan); + COPY_4V(t01, tObj->BorderColor); else - img->FetchTexelc(img, i0, j1, 0, t01); + img->FetchTexelf(img, i0, j1, 0, t01); if (useBorderColor & (I1BIT | J1BIT)) - COPY_CHAN4(t11, tObj->_BorderChan); + COPY_4V(t11, tObj->BorderColor); else - img->FetchTexelc(img, i1, j1, 0, t11); + img->FetchTexelf(img, i1, j1, 0, t11); lerp_rgba_2d(rgba[i], a, b, t00, t10, t01, t11); } @@ -2176,7 +2134,7 @@ static void sample_lambda_rect(GLcontext *ctx, const struct gl_texture_object *tObj, GLuint n, const GLfloat texcoords[][4], const GLfloat lambda[], - GLchan rgba[][4]) + GLfloat rgba[][4]) { GLuint minStart, minEnd, magStart, magEnd; @@ -2222,7 +2180,7 @@ sample_2d_array_nearest(GLcontext *ctx, const struct gl_texture_object *tObj, const struct gl_texture_image *img, const GLfloat texcoord[4], - GLchan rgba[4]) + GLfloat rgba[4]) { const GLint width = img->Width2; /* without border, power of two */ const GLint height = img->Height2; /* without border, power of two */ @@ -2239,10 +2197,10 @@ sample_2d_array_nearest(GLcontext *ctx, j < 0 || j >= (GLint) img->Height || array < 0 || array >= (GLint) img->Depth) { /* Need this test for GL_CLAMP_TO_BORDER mode */ - COPY_CHAN4(rgba, tObj->_BorderChan); + COPY_4V(rgba, tObj->BorderColor); } else { - img->FetchTexelc(img, i, j, array, rgba); + img->FetchTexelf(img, i, j, array, rgba); } } @@ -2255,7 +2213,7 @@ sample_2d_array_linear(GLcontext *ctx, const struct gl_texture_object *tObj, const struct gl_texture_image *img, const GLfloat texcoord[4], - GLchan rgba[4]) + GLfloat rgba[4]) { const GLint width = img->Width2; const GLint height = img->Height2; @@ -2264,14 +2222,14 @@ sample_2d_array_linear(GLcontext *ctx, GLint array; GLbitfield useBorderColor = 0x0; GLfloat a, b; - GLchan t00[4], t01[4], t10[4], t11[4]; + GLfloat t00[4], t01[4], t10[4], t11[4]; linear_texel_locations(tObj->WrapS, img, width, texcoord[0], &i0, &i1, &a); linear_texel_locations(tObj->WrapT, img, height, texcoord[1], &j0, &j1, &b); array = clamp_rect_coord_nearest(tObj->WrapR, texcoord[2], depth); if (array < 0 || array >= depth) { - COPY_CHAN4(rgba, tObj->_BorderChan); + COPY_4V(rgba, tObj->BorderColor); } else { if (img->Border) { @@ -2290,28 +2248,28 @@ sample_2d_array_linear(GLcontext *ctx, /* Fetch texels */ if (useBorderColor & (I0BIT | J0BIT)) { - COPY_CHAN4(t00, tObj->_BorderChan); + COPY_4V(t00, tObj->BorderColor); } else { - img->FetchTexelc(img, i0, j0, array, t00); + img->FetchTexelf(img, i0, j0, array, t00); } if (useBorderColor & (I1BIT | J0BIT)) { - COPY_CHAN4(t10, tObj->_BorderChan); + COPY_4V(t10, tObj->BorderColor); } else { - img->FetchTexelc(img, i1, j0, array, t10); + img->FetchTexelf(img, i1, j0, array, t10); } if (useBorderColor & (I0BIT | J1BIT)) { - COPY_CHAN4(t01, tObj->_BorderChan); + COPY_4V(t01, tObj->BorderColor); } else { - img->FetchTexelc(img, i0, j1, array, t01); + img->FetchTexelf(img, i0, j1, array, t01); } if (useBorderColor & (I1BIT | J1BIT)) { - COPY_CHAN4(t11, tObj->_BorderChan); + COPY_4V(t11, tObj->BorderColor); } else { - img->FetchTexelc(img, i1, j1, array, t11); + img->FetchTexelf(img, i1, j1, array, t11); } /* trilinear interpolation of samples */ @@ -2324,7 +2282,7 @@ static void sample_2d_array_nearest_mipmap_nearest(GLcontext *ctx, const struct gl_texture_object *tObj, GLuint n, const GLfloat texcoord[][4], - const GLfloat lambda[], GLchan rgba[][4]) + const GLfloat lambda[], GLfloat rgba[][4]) { GLuint i; for (i = 0; i < n; i++) { @@ -2339,7 +2297,7 @@ static void sample_2d_array_linear_mipmap_nearest(GLcontext *ctx, const struct gl_texture_object *tObj, GLuint n, const GLfloat texcoord[][4], - const GLfloat lambda[], GLchan rgba[][4]) + const GLfloat lambda[], GLfloat rgba[][4]) { GLuint i; ASSERT(lambda != NULL); @@ -2355,7 +2313,7 @@ static void sample_2d_array_nearest_mipmap_linear(GLcontext *ctx, const struct gl_texture_object *tObj, GLuint n, const GLfloat texcoord[][4], - const GLfloat lambda[], GLchan rgba[][4]) + const GLfloat lambda[], GLfloat rgba[][4]) { GLuint i; ASSERT(lambda != NULL); @@ -2366,7 +2324,7 @@ sample_2d_array_nearest_mipmap_linear(GLcontext *ctx, texcoord[i], rgba[i]); } else { - GLchan t0[4], t1[4]; /* texels */ + GLfloat t0[4], t1[4]; /* texels */ const GLfloat f = FRAC(lambda[i]); sample_2d_array_nearest(ctx, tObj, tObj->Image[0][level ], texcoord[i], t0); @@ -2382,7 +2340,7 @@ static void sample_2d_array_linear_mipmap_linear(GLcontext *ctx, const struct gl_texture_object *tObj, GLuint n, const GLfloat texcoord[][4], - const GLfloat lambda[], GLchan rgba[][4]) + const GLfloat lambda[], GLfloat rgba[][4]) { GLuint i; ASSERT(lambda != NULL); @@ -2393,7 +2351,7 @@ sample_2d_array_linear_mipmap_linear(GLcontext *ctx, texcoord[i], rgba[i]); } else { - GLchan t0[4], t1[4]; /* texels */ + GLfloat t0[4], t1[4]; /* texels */ const GLfloat f = FRAC(lambda[i]); sample_2d_array_linear(ctx, tObj, tObj->Image[0][level ], texcoord[i], t0); @@ -2410,7 +2368,7 @@ static void sample_nearest_2d_array(GLcontext *ctx, const struct gl_texture_object *tObj, GLuint n, const GLfloat texcoords[][4], const GLfloat lambda[], - GLchan rgba[][4]) + GLfloat rgba[][4]) { GLuint i; struct gl_texture_image *image = tObj->Image[0][tObj->BaseLevel]; @@ -2427,7 +2385,7 @@ static void sample_linear_2d_array(GLcontext *ctx, const struct gl_texture_object *tObj, GLuint n, const GLfloat texcoords[][4], - const GLfloat lambda[], GLchan rgba[][4]) + const GLfloat lambda[], GLfloat rgba[][4]) { GLuint i; struct gl_texture_image *image = tObj->Image[0][tObj->BaseLevel]; @@ -2443,7 +2401,7 @@ static void sample_lambda_2d_array(GLcontext *ctx, const struct gl_texture_object *tObj, GLuint n, const GLfloat texcoords[][4], const GLfloat lambda[], - GLchan rgba[][4]) + GLfloat rgba[][4]) { GLuint minStart, minEnd; /* texels with minification */ GLuint magStart, magEnd; /* texels with magnification */ @@ -2532,7 +2490,7 @@ sample_1d_array_nearest(GLcontext *ctx, const struct gl_texture_object *tObj, const struct gl_texture_image *img, const GLfloat texcoord[4], - GLchan rgba[4]) + GLfloat rgba[4]) { const GLint width = img->Width2; /* without border, power of two */ const GLint height = img->Height; @@ -2546,10 +2504,10 @@ sample_1d_array_nearest(GLcontext *ctx, if (i < 0 || i >= (GLint) img->Width || array < 0 || array >= (GLint) img->Height) { /* Need this test for GL_CLAMP_TO_BORDER mode */ - COPY_CHAN4(rgba, tObj->_BorderChan); + COPY_4V(rgba, tObj->BorderColor); } else { - img->FetchTexelc(img, i, array, 0, rgba); + img->FetchTexelf(img, i, array, 0, rgba); } } @@ -2562,7 +2520,7 @@ sample_1d_array_linear(GLcontext *ctx, const struct gl_texture_object *tObj, const struct gl_texture_image *img, const GLfloat texcoord[4], - GLchan rgba[4]) + GLfloat rgba[4]) { const GLint width = img->Width2; const GLint height = img->Height; @@ -2570,7 +2528,7 @@ sample_1d_array_linear(GLcontext *ctx, GLint array; GLbitfield useBorderColor = 0x0; GLfloat a; - GLchan t0[4], t1[4]; + GLfloat t0[4], t1[4]; linear_texel_locations(tObj->WrapS, img, width, texcoord[0], &i0, &i1, &a); array = clamp_rect_coord_nearest(tObj->WrapT, texcoord[1], height); @@ -2589,16 +2547,16 @@ sample_1d_array_linear(GLcontext *ctx, /* Fetch texels */ if (useBorderColor & (I0BIT | K0BIT)) { - COPY_CHAN4(t0, tObj->_BorderChan); + COPY_4V(t0, tObj->BorderColor); } else { - img->FetchTexelc(img, i0, array, 0, t0); + img->FetchTexelf(img, i0, array, 0, t0); } if (useBorderColor & (I1BIT | K0BIT)) { - COPY_CHAN4(t1, tObj->_BorderChan); + COPY_4V(t1, tObj->BorderColor); } else { - img->FetchTexelc(img, i1, array, 0, t1); + img->FetchTexelf(img, i1, array, 0, t1); } /* bilinear interpolation of samples */ @@ -2610,7 +2568,7 @@ static void sample_1d_array_nearest_mipmap_nearest(GLcontext *ctx, const struct gl_texture_object *tObj, GLuint n, const GLfloat texcoord[][4], - const GLfloat lambda[], GLchan rgba[][4]) + const GLfloat lambda[], GLfloat rgba[][4]) { GLuint i; for (i = 0; i < n; i++) { @@ -2625,7 +2583,7 @@ static void sample_1d_array_linear_mipmap_nearest(GLcontext *ctx, const struct gl_texture_object *tObj, GLuint n, const GLfloat texcoord[][4], - const GLfloat lambda[], GLchan rgba[][4]) + const GLfloat lambda[], GLfloat rgba[][4]) { GLuint i; ASSERT(lambda != NULL); @@ -2641,7 +2599,7 @@ static void sample_1d_array_nearest_mipmap_linear(GLcontext *ctx, const struct gl_texture_object *tObj, GLuint n, const GLfloat texcoord[][4], - const GLfloat lambda[], GLchan rgba[][4]) + const GLfloat lambda[], GLfloat rgba[][4]) { GLuint i; ASSERT(lambda != NULL); @@ -2652,7 +2610,7 @@ sample_1d_array_nearest_mipmap_linear(GLcontext *ctx, texcoord[i], rgba[i]); } else { - GLchan t0[4], t1[4]; /* texels */ + GLfloat t0[4], t1[4]; /* texels */ const GLfloat f = FRAC(lambda[i]); sample_1d_array_nearest(ctx, tObj, tObj->Image[0][level ], texcoord[i], t0); sample_1d_array_nearest(ctx, tObj, tObj->Image[0][level+1], texcoord[i], t1); @@ -2666,7 +2624,7 @@ static void sample_1d_array_linear_mipmap_linear(GLcontext *ctx, const struct gl_texture_object *tObj, GLuint n, const GLfloat texcoord[][4], - const GLfloat lambda[], GLchan rgba[][4]) + const GLfloat lambda[], GLfloat rgba[][4]) { GLuint i; ASSERT(lambda != NULL); @@ -2677,7 +2635,7 @@ sample_1d_array_linear_mipmap_linear(GLcontext *ctx, texcoord[i], rgba[i]); } else { - GLchan t0[4], t1[4]; /* texels */ + GLfloat t0[4], t1[4]; /* texels */ const GLfloat f = FRAC(lambda[i]); sample_1d_array_linear(ctx, tObj, tObj->Image[0][level ], texcoord[i], t0); sample_1d_array_linear(ctx, tObj, tObj->Image[0][level+1], texcoord[i], t1); @@ -2692,7 +2650,7 @@ static void sample_nearest_1d_array(GLcontext *ctx, const struct gl_texture_object *tObj, GLuint n, const GLfloat texcoords[][4], const GLfloat lambda[], - GLchan rgba[][4]) + GLfloat rgba[][4]) { GLuint i; struct gl_texture_image *image = tObj->Image[0][tObj->BaseLevel]; @@ -2708,7 +2666,7 @@ static void sample_linear_1d_array(GLcontext *ctx, const struct gl_texture_object *tObj, GLuint n, const GLfloat texcoords[][4], - const GLfloat lambda[], GLchan rgba[][4]) + const GLfloat lambda[], GLfloat rgba[][4]) { GLuint i; struct gl_texture_image *image = tObj->Image[0][tObj->BaseLevel]; @@ -2724,7 +2682,7 @@ static void sample_lambda_1d_array(GLcontext *ctx, const struct gl_texture_object *tObj, GLuint n, const GLfloat texcoords[][4], const GLfloat lambda[], - GLchan rgba[][4]) + GLfloat rgba[][4]) { GLuint minStart, minEnd; /* texels with minification */ GLuint magStart, magEnd; /* texels with magnification */ @@ -2802,7 +2760,7 @@ static void sample_depth_texture( GLcontext *ctx, const struct gl_texture_object *tObj, GLuint n, const GLfloat texcoords[][4], const GLfloat lambda[], - GLchan texel[][4] ) + GLfloat texel[][4] ) { const GLint baseLevel = tObj->BaseLevel; const struct gl_texture_image *img = tObj->Image[0][baseLevel]; @@ -2811,9 +2769,9 @@ sample_depth_texture( GLcontext *ctx, const GLint depth = img->Depth; const GLuint compare_coord = (tObj->Target == GL_TEXTURE_2D_ARRAY_EXT) ? 3 : 2; - GLchan ambient; + GLfloat ambient; GLenum function; - GLchan result; + GLfloat result; (void) lambda; @@ -2826,7 +2784,7 @@ sample_depth_texture( GLcontext *ctx, tObj->Target == GL_TEXTURE_1D_ARRAY_EXT || tObj->Target == GL_TEXTURE_2D_ARRAY_EXT); - UNCLAMPED_FLOAT_TO_CHAN(ambient, tObj->CompareFailValue); + ambient = tObj->CompareFailValue; /* XXXX if tObj->MinFilter != tObj->MagFilter, we're ignoring lambda */ @@ -2889,31 +2847,31 @@ sample_depth_texture( GLcontext *ctx, switch (function) { case GL_LEQUAL: - result = (texcoords[i][compare_coord] <= depthSample) ? CHAN_MAX : ambient; + result = (texcoords[i][compare_coord] <= depthSample) ? 1.0F : ambient; break; case GL_GEQUAL: - result = (texcoords[i][compare_coord] >= depthSample) ? CHAN_MAX : ambient; + result = (texcoords[i][compare_coord] >= depthSample) ? 1.0F : ambient; break; case GL_LESS: - result = (texcoords[i][compare_coord] < depthSample) ? CHAN_MAX : ambient; + result = (texcoords[i][compare_coord] < depthSample) ? 1.0F : ambient; break; case GL_GREATER: - result = (texcoords[i][compare_coord] > depthSample) ? CHAN_MAX : ambient; + result = (texcoords[i][compare_coord] > depthSample) ? 1.0F : ambient; break; case GL_EQUAL: - result = (texcoords[i][compare_coord] == depthSample) ? CHAN_MAX : ambient; + result = (texcoords[i][compare_coord] == depthSample) ? 1.0F : ambient; break; case GL_NOTEQUAL: - result = (texcoords[i][compare_coord] != depthSample) ? CHAN_MAX : ambient; + result = (texcoords[i][compare_coord] != depthSample) ? 1.0F : ambient; break; case GL_ALWAYS: - result = CHAN_MAX; + result = 1.0F; break; case GL_NEVER: result = ambient; break; case GL_NONE: - CLAMPED_FLOAT_TO_CHAN(result, depthSample); + result = depthSample; break; default: _mesa_problem(ctx, "Bad compare func in sample_depth_texture"); @@ -2922,22 +2880,13 @@ sample_depth_texture( GLcontext *ctx, switch (tObj->DepthMode) { case GL_LUMINANCE: - texel[i][RCOMP] = result; - texel[i][GCOMP] = result; - texel[i][BCOMP] = result; - texel[i][ACOMP] = CHAN_MAX; + ASSIGN_4V(texel[i], result, result, result, 1.0F); break; case GL_INTENSITY: - texel[i][RCOMP] = result; - texel[i][GCOMP] = result; - texel[i][BCOMP] = result; - texel[i][ACOMP] = result; + ASSIGN_4V(texel[i], result, result, result, result); break; case GL_ALPHA: - texel[i][RCOMP] = 0; - texel[i][GCOMP] = 0; - texel[i][BCOMP] = 0; - texel[i][ACOMP] = result; + ASSIGN_4V(texel[i], 0.0F, 0.0F, 0.0F, result); break; default: _mesa_problem(ctx, "Bad depth texture mode"); @@ -3074,42 +3023,42 @@ sample_depth_texture( GLcontext *ctx, if (depth01 <= texcoords[i][compare_coord]) luminance -= d; if (depth10 <= texcoords[i][compare_coord]) luminance -= d; if (depth11 <= texcoords[i][compare_coord]) luminance -= d; - result = (GLchan) luminance; + result = (GLfloat) luminance; break; case GL_GEQUAL: if (depth00 >= texcoords[i][compare_coord]) luminance -= d; if (depth01 >= texcoords[i][compare_coord]) luminance -= d; if (depth10 >= texcoords[i][compare_coord]) luminance -= d; if (depth11 >= texcoords[i][compare_coord]) luminance -= d; - result = (GLchan) luminance; + result = (GLfloat) luminance; break; case GL_LESS: if (depth00 < texcoords[i][compare_coord]) luminance -= d; if (depth01 < texcoords[i][compare_coord]) luminance -= d; if (depth10 < texcoords[i][compare_coord]) luminance -= d; if (depth11 < texcoords[i][compare_coord]) luminance -= d; - result = (GLchan) luminance; + result = (GLfloat) luminance; break; case GL_GREATER: if (depth00 > texcoords[i][compare_coord]) luminance -= d; if (depth01 > texcoords[i][compare_coord]) luminance -= d; if (depth10 > texcoords[i][compare_coord]) luminance -= d; if (depth11 > texcoords[i][compare_coord]) luminance -= d; - result = (GLchan) luminance; + result = (GLfloat) luminance; break; case GL_EQUAL: if (depth00 == texcoords[i][compare_coord]) luminance -= d; if (depth01 == texcoords[i][compare_coord]) luminance -= d; if (depth10 == texcoords[i][compare_coord]) luminance -= d; if (depth11 == texcoords[i][compare_coord]) luminance -= d; - result = (GLchan) luminance; + result = (GLfloat) luminance; break; case GL_NOTEQUAL: if (depth00 != texcoords[i][compare_coord]) luminance -= d; if (depth01 != texcoords[i][compare_coord]) luminance -= d; if (depth10 != texcoords[i][compare_coord]) luminance -= d; if (depth11 != texcoords[i][compare_coord]) luminance -= d; - result = (GLchan) luminance; + result = (GLfloat) luminance; break; case GL_ALWAYS: result = 0; @@ -3168,7 +3117,7 @@ static void null_sample_func( GLcontext *ctx, const struct gl_texture_object *tObj, GLuint n, const GLfloat texcoords[][4], const GLfloat lambda[], - GLchan rgba[][4]) + GLfloat rgba[][4]) { GLuint i; (void) ctx; @@ -3225,6 +3174,7 @@ _swrast_choose_texture_sample_func( GLcontext *ctx, } else { /* check for a few optimized cases */ +#if 0 const struct gl_texture_image *img = t->Image[0][t->BaseLevel]; ASSERT(t->MinFilter == GL_NEAREST); if (t->WrapS == GL_REPEAT && @@ -3241,6 +3191,10 @@ _swrast_choose_texture_sample_func( GLcontext *ctx, img->TexFormat->MesaFormat == MESA_FORMAT_RGBA) { return &opt_sample_rgba_2d; } +#else + if (0) + ; +#endif else { return &sample_nearest_2d; } diff --git a/src/mesa/tnl/t_vb_program.c b/src/mesa/tnl/t_vb_program.c index f99401ca6d..1795f62c32 100644 --- a/src/mesa/tnl/t_vb_program.c +++ b/src/mesa/tnl/t_vb_program.c @@ -176,17 +176,12 @@ static void vp_fetch_texel(GLcontext *ctx, const GLfloat texcoord[4], GLfloat lambda, GLuint unit, GLfloat color[4]) { - GLchan rgba[4]; SWcontext *swrast = SWRAST_CONTEXT(ctx); /* XXX use a float-valued TextureSample routine here!!! */ swrast->TextureSample[unit](ctx, ctx->Texture.Unit[unit]._Current, 1, (const GLfloat (*)[4]) texcoord, - &lambda, &rgba); - color[0] = CHAN_TO_FLOAT(rgba[0]); - color[1] = CHAN_TO_FLOAT(rgba[1]); - color[2] = CHAN_TO_FLOAT(rgba[2]); - color[3] = CHAN_TO_FLOAT(rgba[3]); + &lambda, (GLfloat (*)[4]) color); } -- cgit v1.2.3 From 7aed2b0c30c6d29d70efd2402a68a8e3de98418c Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Tue, 10 Mar 2009 20:14:32 -0600 Subject: swrast: remove old texture_apply() code; always use texture combine code --- src/mesa/swrast/s_context.c | 22 ++- src/mesa/swrast/s_context.h | 2 +- src/mesa/swrast/s_texcombine.c | 401 +---------------------------------------- 3 files changed, 22 insertions(+), 403 deletions(-) (limited to 'src/mesa/swrast/s_context.c') diff --git a/src/mesa/swrast/s_context.c b/src/mesa/swrast/s_context.c index 0257abc34a..56bf2033ca 100644 --- a/src/mesa/swrast/s_context.c +++ b/src/mesa/swrast/s_context.c @@ -172,19 +172,29 @@ _swrast_update_fog_hint( GLcontext *ctx ) /** - * Update the swrast->_AnyTextureCombine flag. + * Update the swrast->_TextureCombinePrimary flag. */ static void _swrast_update_texture_env( GLcontext *ctx ) { SWcontext *swrast = SWRAST_CONTEXT(ctx); GLuint i; - swrast->_AnyTextureCombine = GL_FALSE; + + swrast->_TextureCombinePrimary = GL_FALSE; + for (i = 0; i < ctx->Const.MaxTextureUnits; i++) { - if (ctx->Texture.Unit[i].EnvMode == GL_COMBINE_EXT || - ctx->Texture.Unit[i].EnvMode == GL_COMBINE4_NV) { - swrast->_AnyTextureCombine = GL_TRUE; - return; + const struct gl_tex_env_combine_state *combine = + ctx->Texture.Unit[i]._CurrentCombine; + GLuint term; + for (term = 0; term < combine->_NumArgsRGB; term++) { + if (combine->SourceRGB[term] == GL_PRIMARY_COLOR) { + swrast->_TextureCombinePrimary = GL_TRUE; + return; + } + if (combine->SourceA[term] == GL_PRIMARY_COLOR) { + swrast->_TextureCombinePrimary = GL_TRUE; + return; + } } } } diff --git a/src/mesa/swrast/s_context.h b/src/mesa/swrast/s_context.h index 4cf57c6fc6..b7a17cb28c 100644 --- a/src/mesa/swrast/s_context.h +++ b/src/mesa/swrast/s_context.h @@ -131,7 +131,7 @@ typedef struct GLfloat _BackfaceSign; /** +1 or -1 */ GLfloat _BackfaceCullSign; /** +1, 0, or -1 */ GLboolean _PreferPixelFog; /* Compute fog blend factor per fragment? */ - GLboolean _AnyTextureCombine; + GLboolean _TextureCombinePrimary; GLboolean _FogEnabled; GLboolean _DeferredTexture; GLenum _FogMode; /* either GL_FOG_MODE or fragment program's fog mode */ diff --git a/src/mesa/swrast/s_texcombine.c b/src/mesa/swrast/s_texcombine.c index ef2db0dc7e..2c694c25cb 100644 --- a/src/mesa/swrast/s_texcombine.c +++ b/src/mesa/swrast/s_texcombine.c @@ -29,7 +29,6 @@ #include "main/colormac.h" #include "main/image.h" #include "main/imports.h" -#include "main/macros.h" #include "main/pixel.h" #include "shader/prog_instruction.h" @@ -92,8 +91,6 @@ texture_combine( const GLcontext *ctx, GLuint unit, GLuint n, GLfloat rgba[MAX_WIDTH][4]; GLuint i, term; - ASSERT(CONST_SWRAST_CONTEXT(ctx)->_AnyTextureCombine); - for (i = 0; i < n; i++) { rgba[i][RCOMP] = CHAN_TO_FLOAT(rgbaChan[i][RCOMP]); rgba[i][GCOMP] = CHAN_TO_FLOAT(rgbaChan[i][GCOMP]); @@ -535,7 +532,6 @@ texture_combine( const GLcontext *ctx, GLuint unit, GLuint n, } - /** * Apply X/Y/Z/W/0/1 swizzle to an array of colors/texels. * See GL_EXT_texture_swizzle. @@ -566,382 +562,6 @@ swizzle_texels(GLuint swizzle, GLuint count, float4_array texels) } -/** - * Apply a conventional OpenGL texture env mode (REPLACE, ADD, BLEND, - * MODULATE, or DECAL) to an array of fragments. - * Input: textureUnit - pointer to texture unit to apply - * format - base internal texture format - * n - number of fragments - * texels - array of texel colors - * InOut: rgba - incoming fragment colors modified by texel colors - * according to the texture environment mode. - */ -static void -texture_apply( const GLcontext *ctx, - const struct gl_texture_unit *texUnit, - GLuint n, - float4_array texel, - GLchan rgbaChan[][4] ) -{ - GLint baseLevel; - GLuint i; - GLfloat Rc, Gc, Bc, Ac; - GLenum format; - GLfloat rgba[MAX_WIDTH][4]; - - ASSERT(texUnit); - ASSERT(texUnit->_Current); - - baseLevel = texUnit->_Current->BaseLevel; - ASSERT(texUnit->_Current->Image[0][baseLevel]); - - format = texUnit->_Current->Image[0][baseLevel]->_BaseFormat; - - if (format == GL_COLOR_INDEX || format == GL_YCBCR_MESA) { - format = GL_RGBA; /* a bit of a hack */ - } - else if (format == GL_DEPTH_COMPONENT || format == GL_DEPTH_STENCIL_EXT) { - format = texUnit->_Current->DepthMode; - } - - /* skip chan->float conversion when not needed */ - if (texUnit->EnvMode != GL_REPLACE || format != GL_RGBA) { - /* convert GLchan colors to GLfloat */ - for (i = 0; i < n; i++) { - rgba[i][RCOMP] = CHAN_TO_FLOAT(rgbaChan[i][RCOMP]); - rgba[i][GCOMP] = CHAN_TO_FLOAT(rgbaChan[i][GCOMP]); - rgba[i][BCOMP] = CHAN_TO_FLOAT(rgbaChan[i][BCOMP]); - rgba[i][ACOMP] = CHAN_TO_FLOAT(rgbaChan[i][ACOMP]); - } - } - - switch (texUnit->EnvMode) { - case GL_REPLACE: - switch (format) { - case GL_ALPHA: - for (i=0;iEnvColor[0]; - Gc = texUnit->EnvColor[1]; - Bc = texUnit->EnvColor[2]; - Ac = texUnit->EnvColor[3]; - switch (format) { - case GL_ALPHA: - for (i=0;i_AnyTextureCombine) { + if (swrast->_TextureCombinePrimary) { GLuint i; for (i = 0; i < span->end; i++) { primary_rgba[i][RCOMP] = CHAN_TO_FLOAT(span->array->rgba[i][RCOMP]); @@ -1101,27 +721,16 @@ _swrast_texture_span( GLcontext *ctx, SWspan *span ) } } - /* * OK, now apply the texture (aka texture combine/blend). * We modify the span->color.rgba values. */ for (unit = 0; unit < ctx->Const.MaxTextureUnits; unit++) { if (ctx->Texture.Unit[unit]._ReallyEnabled) { - const struct gl_texture_unit *texUnit = &ctx->Texture.Unit[unit]; - if (texUnit->_CurrentCombine != &texUnit->_EnvMode ) { - texture_combine( ctx, unit, span->end, - primary_rgba, - swrast->TexelBuffer, - span->array->rgba ); - } - else { - /* conventional texture blend */ - float4_array texels = - get_texel_array(swrast->TexelBuffer, unit, span->end); - texture_apply( ctx, texUnit, span->end, - texels, span->array->rgba ); - } + texture_combine( ctx, unit, span->end, + primary_rgba, + swrast->TexelBuffer, + span->array->rgba ); } } } -- cgit v1.2.3 From 76ac75af8e5481b498981c133836efa2101be2dc Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Mon, 6 Apr 2009 17:17:52 -0600 Subject: swrast: fix secondary color add for glBitmap Also, clean up the logic involved in choosing per-vertex vs. per-fragment primary+secondary color addition. --- src/mesa/swrast/s_context.c | 36 +++++++++++++++++++++++++++--------- src/mesa/swrast/s_context.h | 1 + src/mesa/swrast/s_span.c | 4 ++-- 3 files changed, 30 insertions(+), 11 deletions(-) (limited to 'src/mesa/swrast/s_context.c') diff --git a/src/mesa/swrast/s_context.c b/src/mesa/swrast/s_context.c index 56bf2033ca..a7eaf76a0a 100644 --- a/src/mesa/swrast/s_context.c +++ b/src/mesa/swrast/s_context.c @@ -275,6 +275,24 @@ _swrast_update_fragment_program(GLcontext *ctx, GLbitfield newState) } +/** + * See if we can do early diffuse+specular (primary+secondary) color + * add per vertex instead of per-fragment. + */ +static void +_swrast_update_specular_vertex_add(GLcontext *ctx) +{ + SWcontext *swrast = SWRAST_CONTEXT(ctx); + GLboolean separateSpecular = ctx->Fog.ColorSumEnabled || + (ctx->Light.Enabled && + ctx->Light.Model.ColorControl == GL_SEPARATE_SPECULAR_COLOR); + + swrast->SpecularVertexAdd = (separateSpecular + && ctx->Texture._EnabledUnits == 0x0 + && !ctx->FragmentProgram._Current + && !ctx->ATIFragmentShader._Enabled); +} + #define _SWRAST_NEW_DERIVED (_SWRAST_NEW_RASTERMASK | \ _NEW_TEXTURE | \ @@ -336,9 +354,7 @@ _swrast_validate_triangle( GLcontext *ctx, swrast->choose_triangle( ctx ); ASSERT(swrast->Triangle); - if (ctx->Texture._EnabledUnits == 0 - && NEED_SECONDARY_COLOR(ctx) - && !ctx->FragmentProgram._Current) { + if (swrast->SpecularVertexAdd) { /* separate specular color, but no texture */ swrast->SpecTriangle = swrast->Triangle; swrast->Triangle = _swrast_add_spec_terms_triangle; @@ -360,9 +376,7 @@ _swrast_validate_line( GLcontext *ctx, const SWvertex *v0, const SWvertex *v1 ) swrast->choose_line( ctx ); ASSERT(swrast->Line); - if (ctx->Texture._EnabledUnits == 0 - && NEED_SECONDARY_COLOR(ctx) - && !ctx->FragmentProgram._Current) { + if (swrast->SpecularVertexAdd) { swrast->SpecLine = swrast->Line; swrast->Line = _swrast_add_spec_terms_line; } @@ -382,9 +396,7 @@ _swrast_validate_point( GLcontext *ctx, const SWvertex *v0 ) _swrast_validate_derived( ctx ); swrast->choose_point( ctx ); - if (ctx->Texture._EnabledUnits == 0 - && NEED_SECONDARY_COLOR(ctx) - && !ctx->FragmentProgram._Current) { + if (swrast->SpecularVertexAdd) { swrast->SpecPoint = swrast->Point; swrast->Point = _swrast_add_spec_terms_point; } @@ -666,6 +678,12 @@ _swrast_validate_derived( GLcontext *ctx ) _NEW_TEXTURE)) _swrast_update_active_attribs(ctx); + if (swrast->NewState & (_NEW_FOG | + _NEW_PROGRAM | + _NEW_LIGHT | + _NEW_TEXTURE)) + _swrast_update_specular_vertex_add(ctx); + swrast->NewState = 0; swrast->StateChanges = 0; swrast->InvalidateState = _swrast_invalidate_state; diff --git a/src/mesa/swrast/s_context.h b/src/mesa/swrast/s_context.h index b7a17cb28c..9059f9b5ec 100644 --- a/src/mesa/swrast/s_context.h +++ b/src/mesa/swrast/s_context.h @@ -157,6 +157,7 @@ typedef struct GLbitfield NewState; GLuint StateChanges; GLenum Primitive; /* current primitive being drawn (ala glBegin) */ + GLboolean SpecularVertexAdd; /**< Add specular/secondary color per vertex */ void (*InvalidateState)( GLcontext *ctx, GLbitfield new_state ); diff --git a/src/mesa/swrast/s_span.c b/src/mesa/swrast/s_span.c index 08d725c5eb..07b3966603 100644 --- a/src/mesa/swrast/s_span.c +++ b/src/mesa/swrast/s_span.c @@ -1377,8 +1377,8 @@ _swrast_write_rgba_span( GLcontext *ctx, SWspan *span) ASSERT(span->arrayMask & SPAN_RGBA); - if (!shader) { - /* Add base and specular colors */ + if (span->primitive == GL_BITMAP || !swrast->SpecularVertexAdd) { + /* Add primary and specular (diffuse + specular) colors */ if (ctx->Fog.ColorSumEnabled || (ctx->Light.Enabled && ctx->Light.Model.ColorControl == GL_SEPARATE_SPECULAR_COLOR)) { -- cgit v1.2.3 From 7872b8e37e13719fbea71b3a92507eb00e7fc9db Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Tue, 21 Apr 2009 17:00:01 -0600 Subject: swrast: simplify state update logic for fragment shader const buffers --- src/mesa/swrast/s_context.c | 27 ++------------------------- 1 file changed, 2 insertions(+), 25 deletions(-) (limited to 'src/mesa/swrast/s_context.c') diff --git a/src/mesa/swrast/s_context.c b/src/mesa/swrast/s_context.c index a7eaf76a0a..f24f4fc59b 100644 --- a/src/mesa/swrast/s_context.c +++ b/src/mesa/swrast/s_context.c @@ -264,13 +264,7 @@ _swrast_update_fragment_program(GLcontext *ctx, GLbitfield newState) { const struct gl_fragment_program *fp = ctx->FragmentProgram._Current; if (fp) { -#if 0 - /* XXX Need a way to trigger the initial loading of parameters - * even when there's no recent state changes. - */ - if (fp->Base.Parameters->StateFlags & newState) -#endif - _mesa_load_state_parameters(ctx, fp->Base.Parameters); + _mesa_load_state_parameters(ctx, fp->Base.Parameters); } } @@ -524,13 +518,6 @@ _swrast_invalidate_state( GLcontext *ctx, GLbitfield new_state ) new_state = ~0; } - { - const struct gl_fragment_program *fp = ctx->FragmentProgram._Current; - if (fp && (fp->Base.Parameters->StateFlags & new_state)) { - _mesa_load_state_parameters(ctx, fp->Base.Parameters); - } - } - if (new_state & swrast->InvalidateTriangleMask) swrast->Triangle = _swrast_validate_triangle; @@ -647,17 +634,7 @@ _swrast_validate_derived( GLcontext *ctx ) if (swrast->NewState & (_NEW_FOG | _NEW_PROGRAM)) _swrast_update_fog_state( ctx ); - if (swrast->NewState & (_NEW_MODELVIEW | - _NEW_PROJECTION | - _NEW_TEXTURE_MATRIX | - _NEW_FOG | - _NEW_LIGHT | - _NEW_LINE | - _NEW_TEXTURE | - _NEW_TRANSFORM | - _NEW_POINT | - _NEW_VIEWPORT | - _NEW_PROGRAM)) + if (swrast->NewState & (_NEW_PROGRAM_CONSTANTS | _NEW_PROGRAM)) _swrast_update_fragment_program( ctx, swrast->NewState ); if (swrast->NewState & (_NEW_TEXTURE | _NEW_PROGRAM)) { -- cgit v1.2.3 From 88527220e44fd36c317f73e667bc6abebb0af112 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Wed, 10 Jun 2009 09:18:22 -0600 Subject: swrast: fix state validation bug for changing program constants Add _NEW_PROGRAM_CONSTANTS to _SWRAST_NEW_DERIVED. This makes sure that we update the fragment shader's constants when state vars (such as point size) changes. Fixes the progs/glsl/points.c demo. --- src/mesa/swrast/s_context.c | 1 + 1 file changed, 1 insertion(+) (limited to 'src/mesa/swrast/s_context.c') diff --git a/src/mesa/swrast/s_context.c b/src/mesa/swrast/s_context.c index f24f4fc59b..e7c2ace32c 100644 --- a/src/mesa/swrast/s_context.c +++ b/src/mesa/swrast/s_context.c @@ -289,6 +289,7 @@ _swrast_update_specular_vertex_add(GLcontext *ctx) #define _SWRAST_NEW_DERIVED (_SWRAST_NEW_RASTERMASK | \ + _NEW_PROGRAM_CONSTANTS | \ _NEW_TEXTURE | \ _NEW_HINT | \ _NEW_POLYGON ) -- cgit v1.2.3 From 18656201ef62da1892d66e0899001ae82e2555c2 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Mon, 31 Aug 2009 13:28:31 -0600 Subject: swrast: can't use deferred texture/shading if using KIL instruction If the fragment program uses KIL, we have to execute it before z/stencil testing. Otherwise, deferred texture/shading lets us skip shading for pixels that fail z/stencil testing. --- src/mesa/swrast/s_context.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/mesa/swrast/s_context.c') diff --git a/src/mesa/swrast/s_context.c b/src/mesa/swrast/s_context.c index e7c2ace32c..abf0008565 100644 --- a/src/mesa/swrast/s_context.c +++ b/src/mesa/swrast/s_context.c @@ -220,6 +220,9 @@ _swrast_update_deferred_texture(GLcontext *ctx) /* Z comes from fragment program/shader */ swrast->_DeferredTexture = GL_FALSE; } + else if (fprog && fprog->UsesKill) { + swrast->_DeferredTexture = GL_FALSE; + } else if (ctx->Query.CurrentOcclusionObject) { /* occlusion query depends on shader discard/kill results */ swrast->_DeferredTexture = GL_FALSE; -- cgit v1.2.3