remove final imports.h and imports.c bits

This moves the fi_types to a new mesa_private.h and removes the
imports.c file. The vast majority of this patch is just removing
pound includes of imports.h and fixing up the recursive includes.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3024>
This commit is contained in:
Dylan Baker 2018-09-14 12:57:32 -07:00
parent 289f02d1d5
commit 8e3696137f
218 changed files with 843 additions and 952 deletions

View file

@ -37,7 +37,6 @@
#include "compiler/nir/nir_builtin_builder.h"
#include "compiler/nir/nir_deref.h"
#include "main/errors.h"
#include "util/imports.h"
#include "main/mtypes.h"
#include "main/shaderobj.h"
#include "util/u_math.h"
@ -903,7 +902,7 @@ deref_get_qualifier(nir_deref_instr *deref)
if (field->memory_restrict)
qualifiers |= ACCESS_RESTRICT;
}
parent_type = cur->type;
}

View file

@ -86,7 +86,7 @@
#include "util/u_string.h"
#include "util/u_math.h"
#include "util/imports.h"
#include "main/shaderobj.h"
#include "main/enums.h"
#include "main/mtypes.h"

View file

@ -26,7 +26,6 @@
*/
#include "nir.h"
#include <util/imports.h>
/**
* SSA-based copy propagation

View file

@ -39,7 +39,6 @@
#include <GL/glxproto.h>
#include "xm_api.h"
#include "util/imports.h"
#include "main/errors.h"
#include "util/u_math.h"
#include "util/u_memory.h"
@ -50,7 +49,7 @@
#if !defined(X_GLXCreateContextAttribsARB) && \
defined(X_GLXCreateContextAtrribsARB)
#define X_GLXCreateContextAttribsARB X_GLXCreateContextAtrribsARB
#endif
#endif
/* This indicates the client-side GLX API and GLX encoder version. */
#define CLIENT_MAJOR_VERSION 1
@ -433,7 +432,7 @@ get_visual( Display *dpy, int scr, unsigned int depth, int xclass )
return NULL;
}
}
return vis;
}
@ -486,7 +485,7 @@ get_env_visual(Display *dpy, int scr, const char *varname)
/*
* Select an X visual which satisfies the RGBA flag and minimum depth.
* Input: dpy,
* Input: dpy,
* screen - X display and screen number
* min_depth - minimum visual depth
* preferred_class - preferred GLX visual class or DONT_CARE
@ -1069,13 +1068,13 @@ choose_visual( Display *dpy, int screen, const int *list, GLboolean fbConfig )
if (stencil_size > 0)
stencil_size = 8;
if (accumRedSize > 0 ||
accumGreenSize > 0 ||
if (accumRedSize > 0 ||
accumGreenSize > 0 ||
accumBlueSize > 0 ||
accumAlphaSize > 0) {
accumRedSize =
accumGreenSize =
accumRedSize =
accumGreenSize =
accumBlueSize = default_accum_bits();
accumAlphaSize = alpha_flag ? accumRedSize : 0;
@ -1225,7 +1224,7 @@ glXMakeContextCurrent( Display *dpy, GLXDrawable draw,
if (no_rast && current == ctx)
return True;
/* Now make current! */
if (XMesaMakeCurrent2(xmctx, drawBuffer, readBuffer)) {
ctx->currentDpy = dpy;
@ -1865,7 +1864,7 @@ glXGetVisualFromFBConfig( Display *dpy, GLXFBConfig config )
{
if (dpy && config) {
XMesaVisual xmvis = (XMesaVisual) config;
#if 0
#if 0
return xmvis->vishandle;
#else
/* create a new vishandle - the cached one may be stale */

View file

@ -71,7 +71,6 @@
#include "hud/hud_context.h"
#include "main/errors.h"
#include "util/imports.h"
#include "xm_public.h"
#include <GL/glx.h>
@ -405,7 +404,7 @@ xmesa_get_window_size(Display *dpy, XMesaBuffer b,
static GLuint
choose_pixel_format(XMesaVisual v)
{
boolean native_byte_order = (host_byte_order() ==
boolean native_byte_order = (host_byte_order() ==
ImageByteOrder(v->display));
if ( GET_REDMASK(v) == 0x0000ff
@ -690,12 +689,12 @@ initialize_visual_and_buffer(XMesaVisual v, XMesaBuffer b,
/**
* Convert an X visual type to a GLX visual type.
*
*
* \param visualType X visual type (i.e., \c TrueColor, \c StaticGray, etc.)
* to be converted.
* \return If \c visualType is a valid X visual type, a GLX visual type will
* be returned. Otherwise \c GLX_NONE will be returned.
*
*
* \note
* This code was lifted directly from lib/GL/glx/glcontextmodes.c in the
* DRI CVS tree.
@ -1051,9 +1050,9 @@ void XMesaDestroyContext( XMesaContext c )
c->st->destroy(c->st);
/* FIXME: We should destroy the screen here, but if we do so, surfaces may
/* FIXME: We should destroy the screen here, but if we do so, surfaces may
* outlive it, causing segfaults
struct pipe_screen *screen = c->st->pipe->screen;
struct pipe_screen *screen = c->st->pipe->screen;
screen->destroy(screen);
*/

View file

@ -33,6 +33,7 @@
#define BRW_EU_DEFINES_H
#include <stdint.h>
#include <stdlib.h>
#include "util/macros.h"
/* The following hunk, up-to "Execution Unit" is used by both the

View file

@ -38,6 +38,7 @@
* test_eu_validate.cpp) will be rejected.
*/
#include <stdlib.h>
#include "brw_eu.h"
/* We're going to do lots of string concatenation, so this should help. */

View file

@ -2,7 +2,7 @@
# (C) Copyright Zack Rusin 2005. All Rights Reserved.
# Copyright (C) 2015 Intel Corporation
# Copyright (C) 2015 Broadcom Corporation
#
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
@ -53,7 +53,6 @@ class PrintGlEnums(gl_XML.gl_print_base):
print('#include <stdio.h>')
print('#include "main/glheader.h"')
print('#include "main/enums.h"')
print('#include "util/imports.h"')
print('#include "main/mtypes.h"')
print('')
print('typedef struct PACKED {')

View file

@ -89,7 +89,6 @@ header = """/**
#include "main/genmipmap.h"
#include "main/hint.h"
#include "main/histogram.h"
#include "util/imports.h"
#include "main/light.h"
#include "main/lines.h"
#include "main/matrix.h"

View file

@ -103,6 +103,7 @@ class PrintRemapTable(gl_XML.gl_print_base):
#include "main/glheader.h"
""")
print('#include "main/glheader.h"')
return

View file

@ -67,7 +67,6 @@ LOCAL_C_INCLUDES := \
LOCAL_SRC_FILES := \
main/extensions_table.c \
main/imports.c \
program/symbol_table.c \
program/dummy_errors.c

View file

@ -137,6 +137,7 @@ MAIN_FILES = \
main/histogram.h \
main/image.c \
main/image.h \
main/mesa_private.h \
main/light.c \
main/light.h \
main/lines.c \

View file

@ -24,7 +24,6 @@
#include "main/glheader.h"
#include "util/imports.h"
#include "main/accum.h"
#include "main/arrayobj.h"
#include "main/context.h"

View file

@ -33,7 +33,6 @@
#include "main/glheader.h"
#include "main/mtypes.h"
#include "util/imports.h"
#include "main/arbprogram.h"
#include "main/arrayobj.h"
#include "main/blend.h"
@ -2311,7 +2310,7 @@ _mesa_meta_DrawPixels(struct gl_context *ctx,
_mesa_StencilOp(GL_REPLACE, GL_REPLACE, GL_REPLACE);
_mesa_StencilFunc(GL_ALWAYS, 0, 255);
_mesa_DrawArrays(GL_TRIANGLE_FAN, 0, 4);
/* set stencil bits to 1 where needed */
_mesa_StencilOp(GL_KEEP, GL_KEEP, GL_REPLACE);
@ -3233,7 +3232,7 @@ decompress_texture_image(struct gl_context *ctx,
/* render quad w/ texture into renderbuffer */
_mesa_DrawArrays(GL_TRIANGLE_FAN, 0, 4);
/* Restore texture object state, the texture binding will
* be restored by _mesa_meta_end().
*/

View file

@ -24,7 +24,6 @@
#include "main/glheader.h"
#include "main/mtypes.h"
#include "util/imports.h"
#include "main/arbprogram.h"
#include "main/arrayobj.h"
#include "main/blend.h"

View file

@ -1,8 +1,8 @@
/**************************************************************************
*
*
* Copyright 2003 VMware, Inc.
* All Rights Reserved.
*
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
@ -10,11 +10,11 @@
* distribute, sub license, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
*
* The above copyright notice and this permission notice (including the
* next paragraph) shall be included in all copies or substantial portions
* of the Software.
*
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
@ -22,13 +22,12 @@
* ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
*
**************************************************************************/
#include "i830_context.h"
#include "main/api_exec.h"
#include "main/extensions.h"
#include "util/imports.h"
#include "main/version.h"
#include "main/vtxfmt.h"
#include "tnl/tnl.h"

View file

@ -1,8 +1,8 @@
/**************************************************************************
*
*
* Copyright 2003 VMware, Inc.
* All Rights Reserved.
*
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
@ -10,11 +10,11 @@
* distribute, sub license, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
*
* The above copyright notice and this permission notice (including the
* next paragraph) shall be included in all copies or substantial portions
* of the Software.
*
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
@ -22,14 +22,13 @@
* ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
*
**************************************************************************/
#include "i915_context.h"
#include "main/api_exec.h"
#include "main/framebuffer.h"
#include "main/extensions.h"
#include "util/imports.h"
#include "main/macros.h"
#include "main/version.h"
#include "main/vtxfmt.h"

View file

@ -1,8 +1,8 @@
/**************************************************************************
*
*
* Copyright 2003 VMware, Inc.
* All Rights Reserved.
*
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
@ -10,11 +10,11 @@
* distribute, sub license, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
*
* The above copyright notice and this permission notice (including the
* next paragraph) shall be included in all copies or substantial portions
* of the Software.
*
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
@ -22,14 +22,16 @@
* ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
*
**************************************************************************/
#include <stdio.h>
#include <assert.h>
#include "main/glheader.h"
#include "i915_reg.h"
#include "i915_debug.h"
#include "util/imports.h"
#include "main/glheader.h"
static const char *opcodes[0x20] = {

View file

@ -1,8 +1,8 @@
/**************************************************************************
*
*
* Copyright 2003 VMware, Inc.
* All Rights Reserved.
*
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
@ -10,11 +10,11 @@
* distribute, sub license, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
*
* The above copyright notice and this permission notice (including the
* next paragraph) shall be included in all copies or substantial portions
* of the Software.
*
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
@ -22,14 +22,13 @@
* ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
*
**************************************************************************/
#include "main/glheader.h"
#include "main/mtypes.h"
#include "util/imports.h"
#include "main/macros.h"
#include "main/renderbuffer.h"
#include "main/framebuffer.h"
@ -96,7 +95,7 @@ i915_reduced_primitive_state(struct intel_context *intel, GLenum rprim)
/* Pull apart the vertex format registers and figure out how large a
* vertex is supposed to be.
* vertex is supposed to be.
*/
static bool
i915_check_vertex_size(struct intel_context *intel, GLuint expected)
@ -341,7 +340,7 @@ i915_emit_state(struct intel_context *intel)
}
/* work out list of buffers to emit */
/* Do this here as we may have flushed the batchbuffer above,
* causing more state to be dirty!
*/
@ -432,7 +431,7 @@ i915_emit_state(struct intel_context *intel)
}
/* Combine all the dirty texture state into a single command to
* avoid lockups on I915 hardware.
* avoid lockups on I915 hardware.
*/
if (dirty & I915_UPLOAD_TEX_ALL) {
int nr = 0;
@ -820,7 +819,7 @@ i915_new_batch(struct intel_context *intel)
i915->current_vertex_size = 0;
}
static void
static void
i915_assert_not_dirty( struct intel_context *intel )
{
struct i915_context *i915 = i915_context(&intel->ctx);

View file

@ -1,8 +1,8 @@
/**************************************************************************
*
*
* Copyright 2003 VMware, Inc.
* All Rights Reserved.
*
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
@ -10,11 +10,11 @@
* distribute, sub license, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
*
* The above copyright notice and this permission notice (including the
* next paragraph) shall be included in all copies or substantial portions
* of the Software.
*
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
@ -22,7 +22,7 @@
* ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
*
**************************************************************************/
@ -31,7 +31,6 @@
#include "main/extensions.h"
#include "main/fbobject.h"
#include "main/framebuffer.h"
#include "util/imports.h"
#include "main/points.h"
#include "main/renderbuffer.h"
@ -111,7 +110,7 @@ intel_flush_front(struct gl_context *ctx)
__DRIscreen *const screen = intel->intelScreen->driScrnPriv;
if (intel->front_buffer_dirty && _mesa_is_winsys_fbo(ctx->DrawBuffer)) {
if (flushFront(screen) &&
if (flushFront(screen) &&
driDrawable &&
driDrawable->loaderPrivate) {
flushFront(screen)(driDrawable, driDrawable->loaderPrivate);
@ -632,7 +631,7 @@ intelMakeCurrent(__DRIcontext * driContextPriv,
if (driContextPriv) {
struct gl_context *ctx = &intel->ctx;
struct gl_framebuffer *fb, *readFb;
if (driDrawPriv == NULL && driReadPriv == NULL) {
fb = _mesa_get_incomplete_framebuffer();
readFb = _mesa_get_incomplete_framebuffer();

View file

@ -1,8 +1,8 @@
/**************************************************************************
*
*
* Copyright 2006 VMware, Inc.
* All Rights Reserved.
*
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
@ -10,11 +10,11 @@
* distribute, sub license, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
*
* The above copyright notice and this permission notice (including the
* next paragraph) shall be included in all copies or substantial portions
* of the Software.
*
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
@ -22,12 +22,11 @@
* ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
*
**************************************************************************/
#include "main/enums.h"
#include "util/imports.h"
#include "main/macros.h"
#include "main/mtypes.h"
#include "main/fbobject.h"

View file

@ -1,8 +1,8 @@
/**************************************************************************
*
*
* Copyright 2003 VMware, Inc.
* All Rights Reserved.
*
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
@ -10,11 +10,11 @@
* distribute, sub license, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
*
* The above copyright notice and this permission notice (including the
* next paragraph) shall be included in all copies or substantial portions
* of the Software.
*
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
@ -22,7 +22,7 @@
* ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
*
**************************************************************************/
/*
@ -33,7 +33,6 @@
#include "main/glheader.h"
#include "main/context.h"
#include "main/macros.h"
#include "util/imports.h"
#include "main/mtypes.h"
#include "main/enums.h"
@ -167,7 +166,7 @@ do { \
/* Render pipeline stage */
/**********************************************************************/
/* Heuristic to choose between the two render paths:
/* Heuristic to choose between the two render paths:
*/
static bool
choose_render(struct intel_context *intel, struct vertex_buffer *VB)

View file

@ -38,8 +38,6 @@
* performance bottleneck, though.
*/
#include "util/imports.h"
#include "intel_context.h"
#include "intel_batchbuffer.h"
#include "intel_reg.h"

View file

@ -30,7 +30,6 @@
* (GL_NV_conditional_render, GL_ARB_conditional_render_inverted) on Gen7+.
*/
#include "util/imports.h"
#include "main/condrender.h"
#include "brw_context.h"

View file

@ -37,7 +37,6 @@
#include "main/fbobject.h"
#include "main/extensions.h"
#include "main/glthread.h"
#include "util/imports.h"
#include "main/macros.h"
#include "main/points.h"
#include "main/version.h"

View file

@ -27,7 +27,6 @@
* The driver implementation of the GL_APPLE_object_purgeable extension.
*/
#include "util/imports.h"
#include "main/mtypes.h"
#include "main/macros.h"
#include "main/bufferobj.h"

View file

@ -25,7 +25,6 @@
*
*/
#include "util/imports.h"
#include "main/bufferobj.h"
#include "main/varray.h"
#include "vbo/vbo.h"

View file

@ -30,7 +30,6 @@
*/
#include <pthread.h>
#include "util/imports.h"
#include "main/glspirv.h"
#include "program/prog_parameter.h"
#include "program/prog_print.h"

View file

@ -44,7 +44,6 @@
* big we throw out all of the cache data and let it get regenerated.
*/
#include "util/imports.h"
#include "main/streaming-load-memcpy.h"
#include "x86/common_x86_asm.h"
#include "intel_batchbuffer.h"

View file

@ -35,7 +35,6 @@
* appropriately synced with the stage of the pipeline for our extensions'
* needs.
*/
#include "util/imports.h"
#include "main/queryobj.h"
#include "brw_context.h"

View file

@ -40,8 +40,6 @@
#include <libsync.h> /* Requires Android or libdrm-2.4.72 */
#include "util/imports.h"
#include "brw_context.h"
#include "intel_batchbuffer.h"

View file

@ -31,8 +31,6 @@
* GL_EXT_transform_feedback, and friends) on platforms that support
* hardware contexts (Gen6+).
*/
#include "util/imports.h"
#include "brw_context.h"
#include "brw_defines.h"
#include "brw_state.h"

View file

@ -26,8 +26,6 @@
*
* Support for query buffer objects (GL_ARB_query_buffer_object) on Haswell+.
*/
#include "util/imports.h"
#include "brw_context.h"
#include "brw_defines.h"
#include "intel_batchbuffer.h"

View file

@ -29,7 +29,6 @@
* This provides core GL buffer object functionality.
*/
#include "util/imports.h"
#include "main/mtypes.h"
#include "main/macros.h"
#include "main/streaming-load-memcpy.h"

View file

@ -24,7 +24,6 @@
*/
#include "main/enums.h"
#include "util/imports.h"
#include "main/macros.h"
#include "main/mtypes.h"
#include "main/fbobject.h"

View file

@ -28,7 +28,6 @@
* Batched upload via BOs.
*/
#include "util/imports.h"
#include "main/macros.h"
#include "brw_bufmgr.h"
#include "brw_context.h"

View file

@ -27,7 +27,7 @@
#ifndef __NOUVEAU_DRIVER_H__
#define __NOUVEAU_DRIVER_H__
#include "util/imports.h"
#include "main/mtypes.h"
#include "main/macros.h"
#include "main/formats.h"

View file

@ -32,7 +32,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#include "main/glheader.h"
#include "util/imports.h"
#include "main/macros.h"
#include "main/context.h"
#include "util/simple_list.h"
@ -111,7 +111,7 @@ void r200SetUpAtomList( r200ContextPtr rmesa )
}
/* Fire a section of the retained (indexed_verts) buffer as a regular
* primtive.
* primtive.
*/
void r200EmitVbufPrim( r200ContextPtr rmesa,
GLuint primitive,
@ -120,13 +120,13 @@ void r200EmitVbufPrim( r200ContextPtr rmesa,
BATCH_LOCALS(&rmesa->radeon);
assert(!(primitive & R200_VF_PRIM_WALK_IND));
radeonEmitState(&rmesa->radeon);
radeon_print(RADEON_RENDER|RADEON_SWRENDER,RADEON_VERBOSE,
"%s cmd_used/4: %d prim %x nr %d\n", __func__,
rmesa->store.cmd_used/4, primitive, vertex_nr);
BEGIN_BATCH(3);
OUT_BATCH_PACKET3_CLIP(R200_CP_CMD_3D_DRAW_VBUF_2, 0);
OUT_BATCH(primitive | R200_VF_PRIM_WALK_LIST | R200_VF_COLOR_ORDER_RGBA |
@ -142,7 +142,7 @@ static void r200FireEB(r200ContextPtr rmesa, int vertex_count, int type)
BEGIN_BATCH(8+2);
OUT_BATCH_PACKET3_CLIP(R200_CP_CMD_3D_DRAW_INDX_2, 0);
OUT_BATCH(R200_VF_PRIM_WALK_IND |
R200_VF_COLOR_ORDER_RGBA |
R200_VF_COLOR_ORDER_RGBA |
((vertex_count + 0) << 16) |
type);
@ -190,7 +190,7 @@ GLushort *r200AllocEltsOpenEnded( r200ContextPtr rmesa,
radeon_print(RADEON_RENDER, RADEON_VERBOSE, "%s %d prim %x\n", __func__, min_nr, primitive);
assert((primitive & R200_VF_PRIM_WALK_IND));
radeonEmitState(&rmesa->radeon);
radeonAllocDmaRegion(&rmesa->radeon, &rmesa->radeon.tcl.elt_dma_bo,
@ -199,7 +199,7 @@ GLushort *r200AllocEltsOpenEnded( r200ContextPtr rmesa,
radeon_bo_map(rmesa->radeon.tcl.elt_dma_bo, 1);
retval = rmesa->radeon.tcl.elt_dma_bo->ptr + rmesa->radeon.tcl.elt_dma_offset;
assert(!rmesa->radeon.dma.flush);
rmesa->radeon.glCtx.Driver.NeedFlush |= FLUSH_STORED_VERTICES;
rmesa->radeon.dma.flush = r200FlushElts;
@ -242,7 +242,7 @@ void r200EmitAOS(r200ContextPtr rmesa, GLuint nr, GLuint offset)
uint32_t voffset;
int sz = 1 + (nr >> 1) * 3 + (nr & 1) * 2;
int i;
radeon_print(RADEON_RENDER, RADEON_VERBOSE,
"%s: nr=%d, ofs=0x%08x\n",
__func__, nr, offset);
@ -257,7 +257,7 @@ void r200EmitAOS(r200ContextPtr rmesa, GLuint nr, GLuint offset)
(rmesa->radeon.tcl.aos[i].stride << 8) |
(rmesa->radeon.tcl.aos[i + 1].components << 16) |
(rmesa->radeon.tcl.aos[i + 1].stride << 24));
voffset = rmesa->radeon.tcl.aos[i + 0].offset +
offset * 4 * rmesa->radeon.tcl.aos[i + 0].stride;
OUT_BATCH(voffset);
@ -265,7 +265,7 @@ void r200EmitAOS(r200ContextPtr rmesa, GLuint nr, GLuint offset)
offset * 4 * rmesa->radeon.tcl.aos[i + 1].stride;
OUT_BATCH(voffset);
}
if (nr & 1) {
OUT_BATCH((rmesa->radeon.tcl.aos[nr - 1].components << 0) |
(rmesa->radeon.tcl.aos[nr - 1].stride << 8));

View file

@ -37,7 +37,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include "main/api_arrayelt.h"
#include "main/api_exec.h"
#include "main/context.h"
#include "util/imports.h"
#include "main/extensions.h"
#include "main/version.h"
#include "main/vtxfmt.h"
@ -103,7 +103,7 @@ static const struct tnl_pipeline_stage *r200_pipeline[] = {
/* Try and go straight to t&l
*/
&_r200_tcl_stage,
&_r200_tcl_stage,
/* Catch any t&l fallbacks
*/
@ -115,7 +115,7 @@ static const struct tnl_pipeline_stage *r200_pipeline[] = {
&_tnl_texture_transform_stage,
&_tnl_point_attenuation_stage,
&_tnl_vertex_program_stage,
/* Try again to go to tcl?
/* Try again to go to tcl?
* - no good for asymmetric-twoside (do with multipass)
* - no good for asymmetric-unfilled (do with multipass)
* - good for material
@ -124,7 +124,7 @@ static const struct tnl_pipeline_stage *r200_pipeline[] = {
*
* - worth it/not worth it?
*/
/* Else do them here.
*/
/* &_r200_render_stage, */ /* FIXME: bugs with ut2003 */
@ -266,7 +266,7 @@ GLboolean r200CreateContext( gl_api api,
ctx->Const.StripTextureBorder = GL_TRUE;
/* FIXME: When no memory manager is available we should set this
/* FIXME: When no memory manager is available we should set this
* to some reasonable value based on texture memory pool size */
ctx->Const.MaxTextureSize = 2048;
ctx->Const.Max3DTextureLevels = 9;
@ -378,7 +378,7 @@ GLboolean r200CreateContext( gl_api api,
r200InitState( rmesa );
r200InitSwtcl( ctx );
rmesa->prefer_gart_client_texturing =
rmesa->prefer_gart_client_texturing =
(getenv("R200_GART_CLIENT_TEXTURES") != 0);
tcl_mode = driQueryOptioni(&rmesa->radeon.optionCache, "tcl_mode");

View file

@ -36,7 +36,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include <errno.h>
#include "main/glheader.h"
#include "util/imports.h"
#include "main/macros.h"
#include "main/context.h"
#include "swrast/swrast.h"

View file

@ -34,7 +34,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include "main/glheader.h"
#include "main/mtypes.h"
#include "util/imports.h"
#include "main/macros.h"
#include "main/state.h"
@ -71,7 +71,7 @@ do { \
#endif
/* Emit any changed arrays to new GART memory, re-emit a packet to
* update the arrays.
* update the arrays.
*/
void r200EmitArrays( struct gl_context *ctx, GLubyte *vimap_rev )
{

View file

@ -31,11 +31,11 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
* Keith Whitwell <keithw@vmware.com>
*
*/
#include <errno.h>
#include <errno.h>
#include "main/glheader.h"
#include "util/imports.h"
#include "r200_context.h"
#include "r200_sanity.h"
@ -57,11 +57,11 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
/* New (1.3) state mechanism. 3 commands (packet, scalar, vector) in
* 1.3 cmdbuffers allow all previous state to be updated as well as
* the tcl scalar and vector areas.
* the tcl scalar and vector areas.
*/
static struct {
int start;
int len;
static struct {
int start;
int len;
const char *name;
} packet[RADEON_MAX_STATE_PACKETS] = {
{ RADEON_PP_MISC,7,"RADEON_PP_MISC" },
@ -115,15 +115,15 @@ static struct {
{ R200_SE_VTE_CNTL, 1, "R200_SE_VTE_CNTL" },
{ R200_SE_TCL_OUTPUT_VTX_COMP_SEL, 1, "R200_SE_TCL_OUTPUT_VTX_COMP_SEL" },
{ R200_PP_TAM_DEBUG3, 1, "R200_PP_TAM_DEBUG3" },
{ R200_PP_CNTL_X, 1, "R200_PP_CNTL_X" },
{ R200_RB3D_DEPTHXY_OFFSET, 1, "R200_RB3D_DEPTHXY_OFFSET" },
{ R200_RE_AUX_SCISSOR_CNTL, 1, "R200_RE_AUX_SCISSOR_CNTL" },
{ R200_RE_SCISSOR_TL_0, 2, "R200_RE_SCISSOR_TL_0" },
{ R200_RE_SCISSOR_TL_1, 2, "R200_RE_SCISSOR_TL_1" },
{ R200_RE_SCISSOR_TL_2, 2, "R200_RE_SCISSOR_TL_2" },
{ R200_SE_VAP_CNTL_STATUS, 1, "R200_SE_VAP_CNTL_STATUS" },
{ R200_SE_VTX_STATE_CNTL, 1, "R200_SE_VTX_STATE_CNTL" },
{ R200_RE_POINTSIZE, 1, "R200_RE_POINTSIZE" },
{ R200_PP_CNTL_X, 1, "R200_PP_CNTL_X" },
{ R200_RB3D_DEPTHXY_OFFSET, 1, "R200_RB3D_DEPTHXY_OFFSET" },
{ R200_RE_AUX_SCISSOR_CNTL, 1, "R200_RE_AUX_SCISSOR_CNTL" },
{ R200_RE_SCISSOR_TL_0, 2, "R200_RE_SCISSOR_TL_0" },
{ R200_RE_SCISSOR_TL_1, 2, "R200_RE_SCISSOR_TL_1" },
{ R200_RE_SCISSOR_TL_2, 2, "R200_RE_SCISSOR_TL_2" },
{ R200_SE_VAP_CNTL_STATUS, 1, "R200_SE_VAP_CNTL_STATUS" },
{ R200_SE_VTX_STATE_CNTL, 1, "R200_SE_VTX_STATE_CNTL" },
{ R200_RE_POINTSIZE, 1, "R200_RE_POINTSIZE" },
{ R200_SE_TCL_INPUT_VTX_VECTOR_ADDR_0, 4, "R200_SE_TCL_INPUT_VTX_VECTOR_ADDR_0" },
{ R200_PP_CUBIC_FACES_0, 1, "R200_PP_CUBIC_FACES_0" }, /* 61 */
{ R200_PP_CUBIC_OFFSET_F1_0, 5, "R200_PP_CUBIC_OFFSET_F1_0" }, /* 62 */
@ -598,7 +598,7 @@ static struct reg_names vector_names[] = {
#define TOUCHED 4
struct reg {
int idx;
int idx;
struct reg_names *closest;
int flags;
union fi current;
@ -681,14 +681,14 @@ static const char *get_reg_name( struct reg *reg )
{
static char tmp[80];
if (reg->idx == reg->closest->idx)
if (reg->idx == reg->closest->idx)
return reg->closest->name;
if (reg->flags & ISVEC) {
if (reg->idx/4 != reg->closest->idx)
sprintf(tmp, "%s+%d[%d]",
reg->closest->name,
sprintf(tmp, "%s+%d[%d]",
reg->closest->name,
(reg->idx/4) - reg->closest->idx,
reg->idx%4);
else
@ -708,17 +708,17 @@ static int print_int_reg_assignment( struct reg *reg, int data )
{
int changed = (reg->current.i != data);
int ever_seen = find_or_add_value( reg, data );
if (VERBOSE || (NORMAL && (changed || !ever_seen)))
fprintf(stderr, " %s <-- 0x%x", get_reg_name(reg), data);
if (NORMAL) {
if (!ever_seen)
if (!ever_seen)
fprintf(stderr, " *** BRAND NEW VALUE");
else if (changed)
fprintf(stderr, " *** CHANGED");
else if (changed)
fprintf(stderr, " *** CHANGED");
}
reg->current.i = data;
if (VERBOSE || (NORMAL && (changed || !ever_seen)))
@ -786,19 +786,19 @@ static void dump_state( void )
{
int i;
for (i = 0 ; i < ARRAY_SIZE(regs) ; i++)
for (i = 0 ; i < ARRAY_SIZE(regs) ; i++)
print_reg( &regs[i] );
for (i = 0 ; i < ARRAY_SIZE(scalars) ; i++)
for (i = 0 ; i < ARRAY_SIZE(scalars) ; i++)
print_reg( &scalars[i] );
for (i = 0 ; i < ARRAY_SIZE(vectors) ; i++)
for (i = 0 ; i < ARRAY_SIZE(vectors) ; i++)
print_reg( &vectors[i] );
}
static int radeon_emit_packets(
static int radeon_emit_packets(
drm_radeon_cmd_header_t header,
drm_radeon_cmd_buffer_t *cmdbuf )
{
@ -806,9 +806,9 @@ static int radeon_emit_packets(
int sz = packet[id].len;
int *data = (int *)cmdbuf->buf;
int i;
if (sz * sizeof(int) > cmdbuf->bufsz) {
fprintf(stderr, "Packet overflows cmdbuf\n");
fprintf(stderr, "Packet overflows cmdbuf\n");
return -EINVAL;
}
@ -817,8 +817,8 @@ static int radeon_emit_packets(
return -EINVAL;
}
if (VERBOSE)
if (VERBOSE)
fprintf(stderr, "Packet 0 reg %s nr %d\n", packet[id].name, sz );
for ( i = 0 ; i < sz ; i++) {
@ -834,7 +834,7 @@ static int radeon_emit_packets(
}
static int radeon_emit_scalars(
static int radeon_emit_scalars(
drm_radeon_cmd_header_t header,
drm_radeon_cmd_buffer_t *cmdbuf )
{
@ -855,14 +855,14 @@ static int radeon_emit_scalars(
total_changed++;
total++;
}
cmdbuf->buf += sz * sizeof(int);
cmdbuf->bufsz -= sz * sizeof(int);
return 0;
}
static int radeon_emit_scalars2(
static int radeon_emit_scalars2(
drm_radeon_cmd_header_t header,
drm_radeon_cmd_buffer_t *cmdbuf )
{
@ -887,7 +887,7 @@ static int radeon_emit_scalars2(
total_changed++;
total++;
}
cmdbuf->buf += sz * sizeof(int);
cmdbuf->bufsz -= sz * sizeof(int);
return 0;
@ -896,7 +896,7 @@ static int radeon_emit_scalars2(
/* Check: inf/nan/extreme-size?
* Check: table start, end, nr, etc.
*/
static int radeon_emit_vectors(
static int radeon_emit_vectors(
drm_radeon_cmd_header_t header,
drm_radeon_cmd_buffer_t *cmdbuf )
{
@ -926,14 +926,14 @@ static int radeon_emit_vectors(
total_changed += 4;
total += 4;
}
cmdbuf->buf += sz * sizeof(int);
cmdbuf->bufsz -= sz * sizeof(int);
return 0;
}
static int radeon_emit_veclinear(
static int radeon_emit_veclinear(
drm_radeon_cmd_header_t header,
drm_radeon_cmd_buffer_t *cmdbuf )
{
@ -1019,7 +1019,7 @@ static int print_vertex_format( int vfmt )
(vfmt & R200_VTX_W1) ? "w1," : "",
(vfmt & R200_VTX_N1) ? "n1," : "");
if (!find_or_add_value( &others[V_VTXFMT], vfmt ))
fprintf(stderr, " *** NEW VALUE");
@ -1052,7 +1052,7 @@ static char *primname[0x10] = {
static int print_prim_and_flags( int prim )
{
int numverts;
if (NORMAL)
fprintf(stderr, " %s(%x): %s%s%s%s%s%s\n",
"prim flags",
@ -1065,7 +1065,7 @@ static int print_prim_and_flags( int prim )
(prim & R200_VF_TCL_OUTPUT_VTX_ENABLE) ? "TCL_OUT_VTX," : "");
numverts = prim>>16;
if (NORMAL)
fprintf(stderr, " prim: %s numverts %d\n", primname[prim&0xf], numverts);
@ -1123,7 +1123,7 @@ static int print_prim_and_flags( int prim )
default:
fprintf(stderr, "Bad primitive\n");
return -1;
}
}
return 0;
}
@ -1247,7 +1247,7 @@ static int radeon_emit_packet3( drm_radeon_cmd_buffer_t *cmdbuf )
break;
case R200_CP_CMD_HOSTDATA_BLT:
if (NORMAL)
fprintf(stderr, "PACKET3_CNTL_HOSTDATA_BLT, %d dwords\n",
fprintf(stderr, "PACKET3_CNTL_HOSTDATA_BLT, %d dwords\n",
cmdsz);
break;
case R200_CP_CMD_POLYLINE:
@ -1256,41 +1256,41 @@ static int radeon_emit_packet3( drm_radeon_cmd_buffer_t *cmdbuf )
break;
case R200_CP_CMD_POLYSCANLINES:
if (NORMAL)
fprintf(stderr, "PACKET3_CNTL_POLYSCANLINES, %d dwords\n",
fprintf(stderr, "PACKET3_CNTL_POLYSCANLINES, %d dwords\n",
cmdsz);
break;
case R200_CP_CMD_PAINT_MULTI:
if (NORMAL)
fprintf(stderr, "PACKET3_CNTL_PAINT_MULTI, %d dwords\n",
fprintf(stderr, "PACKET3_CNTL_PAINT_MULTI, %d dwords\n",
cmdsz);
break;
case R200_CP_CMD_BITBLT_MULTI:
if (NORMAL)
fprintf(stderr, "PACKET3_CNTL_BITBLT_MULTI, %d dwords\n",
fprintf(stderr, "PACKET3_CNTL_BITBLT_MULTI, %d dwords\n",
cmdsz);
break;
case R200_CP_CMD_TRANS_BITBLT:
if (NORMAL)
fprintf(stderr, "PACKET3_CNTL_TRANS_BITBLT, %d dwords\n",
fprintf(stderr, "PACKET3_CNTL_TRANS_BITBLT, %d dwords\n",
cmdsz);
break;
case R200_CP_CMD_3D_DRAW_VBUF_2:
if (NORMAL)
fprintf(stderr, "R200_CP_CMD_3D_DRAW_VBUF_2, %d dwords\n",
fprintf(stderr, "R200_CP_CMD_3D_DRAW_VBUF_2, %d dwords\n",
cmdsz);
if (print_prim_and_flags(cmd[1]))
return -EINVAL;
break;
case R200_CP_CMD_3D_DRAW_IMMD_2:
if (NORMAL)
fprintf(stderr, "R200_CP_CMD_3D_DRAW_IMMD_2, %d dwords\n",
fprintf(stderr, "R200_CP_CMD_3D_DRAW_IMMD_2, %d dwords\n",
cmdsz);
if (print_prim_and_flags(cmd[1]))
return -EINVAL;
break;
case R200_CP_CMD_3D_DRAW_INDX_2:
if (NORMAL)
fprintf(stderr, "R200_CP_CMD_3D_DRAW_INDX_2, %d dwords\n",
fprintf(stderr, "R200_CP_CMD_3D_DRAW_INDX_2, %d dwords\n",
cmdsz);
if (print_prim_and_flags(cmd[1]))
return -EINVAL;
@ -1299,7 +1299,7 @@ static int radeon_emit_packet3( drm_radeon_cmd_buffer_t *cmdbuf )
fprintf(stderr, "UNKNOWN PACKET, %d dwords\n", cmdsz);
break;
}
cmdbuf->buf += cmdsz * 4;
cmdbuf->bufsz -= cmdsz * 4;
return 0;
@ -1309,7 +1309,7 @@ static int radeon_emit_packet3( drm_radeon_cmd_buffer_t *cmdbuf )
/* Check cliprects for bounds, then pass on to above:
*/
static int radeon_emit_packet3_cliprect( drm_radeon_cmd_buffer_t *cmdbuf )
{
{
drm_clip_rect_t *boxes = (drm_clip_rect_t *)cmdbuf->boxes;
int i = 0;
@ -1356,13 +1356,13 @@ int r200SanityCmdBuffer( r200ContextPtr rmesa,
cmdbuf.nbox = nbox;
while ( cmdbuf.bufsz >= sizeof(header) ) {
header.i = *(int *)cmdbuf.buf;
cmdbuf.buf += sizeof(header);
cmdbuf.bufsz -= sizeof(header);
switch (header.header.cmd_type) {
case RADEON_CMD_PACKET:
case RADEON_CMD_PACKET:
if (radeon_emit_packets( header, &cmdbuf )) {
fprintf(stderr,"radeon_emit_packets failed\n");
return -EINVAL;
@ -1422,7 +1422,7 @@ int r200SanityCmdBuffer( r200ContextPtr rmesa,
break;
default:
fprintf(stderr,"bad cmd_type %d at %p\n",
fprintf(stderr,"bad cmd_type %d at %p\n",
header.header.cmd_type,
cmdbuf.buf - sizeof(header));
return -EINVAL;
@ -1436,7 +1436,7 @@ int r200SanityCmdBuffer( r200ContextPtr rmesa,
if (n == 10) {
fprintf(stderr, "Bufs %d Total emitted %d real changes %d (%.2f%%)\n",
bufs,
total, total_changed,
total, total_changed,
((float)total_changed/(float)total*100.0));
fprintf(stderr, "Total emitted per buf: %.2f\n",
(float)total/(float)bufs);

View file

@ -34,7 +34,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#include "main/glheader.h"
#include "util/imports.h"
#include "main/enums.h"
#include "main/light.h"
#include "main/framebuffer.h"

View file

@ -33,7 +33,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include "main/errors.h"
#include "main/glheader.h"
#include "util/imports.h"
#include "main/enums.h"
#include "main/api_arrayelt.h"
#include "main/state.h"
@ -164,12 +164,12 @@ static struct {
/* =============================================================
* State initialization
*/
static int cmdpkt( r200ContextPtr rmesa, int id )
static int cmdpkt( r200ContextPtr rmesa, int id )
{
return CP_PACKET0(packet[id].start, packet[id].len - 1);
}
static int cmdvec( int offset, int stride, int count )
static int cmdvec( int offset, int stride, int count )
{
drm_radeon_cmd_header_t h;
h.i = 0;
@ -182,7 +182,7 @@ static int cmdvec( int offset, int stride, int count )
/* warning: the count here is divided by 4 compared to other cmds
(so it doesn't exceed the char size)! */
static int cmdveclinear( int offset, int count )
static int cmdveclinear( int offset, int count )
{
drm_radeon_cmd_header_t h;
h.i = 0;
@ -193,7 +193,7 @@ static int cmdveclinear( int offset, int count )
return h.i;
}
static int cmdscl( int offset, int stride, int count )
static int cmdscl( int offset, int stride, int count )
{
drm_radeon_cmd_header_t h;
h.i = 0;
@ -204,7 +204,7 @@ static int cmdscl( int offset, int stride, int count )
return h.i;
}
static int cmdscl2( int offset, int stride, int count )
static int cmdscl2( int offset, int stride, int count )
{
drm_radeon_cmd_header_t h;
h.i = 0;
@ -849,9 +849,9 @@ void r200InitState( r200ContextPtr rmesa )
rmesa->hw.ptp.emit = ptp_emit;
rmesa->hw.mtl[0].cmd[MTL_CMD_0] =
rmesa->hw.mtl[0].cmd[MTL_CMD_0] =
cmdvec( R200_VS_MAT_0_EMISS, 1, 16 );
rmesa->hw.mtl[0].cmd[MTL_CMD_1] =
rmesa->hw.mtl[0].cmd[MTL_CMD_1] =
cmdscl2( R200_SS_MAT_0_SHININESS, 1, 1 );
rmesa->hw.mtl[1].cmd[MTL_CMD_0] =
cmdvec( R200_VS_MAT_1_EMISS, 1, 16 );
@ -867,43 +867,43 @@ void r200InitState( r200ContextPtr rmesa )
rmesa->hw.vpp[1].cmd[VPP_CMD_0] =
cmdveclinear( R200_PVS_PARAM1, 96 );
rmesa->hw.grd.cmd[GRD_CMD_0] =
rmesa->hw.grd.cmd[GRD_CMD_0] =
cmdscl( R200_SS_VERT_GUARD_CLIP_ADJ_ADDR, 1, 4 );
rmesa->hw.fog.cmd[FOG_CMD_0] =
rmesa->hw.fog.cmd[FOG_CMD_0] =
cmdvec( R200_VS_FOG_PARAM_ADDR, 1, 4 );
rmesa->hw.glt.cmd[GLT_CMD_0] =
rmesa->hw.glt.cmd[GLT_CMD_0] =
cmdvec( R200_VS_GLOBAL_AMBIENT_ADDR, 1, 4 );
rmesa->hw.eye.cmd[EYE_CMD_0] =
rmesa->hw.eye.cmd[EYE_CMD_0] =
cmdvec( R200_VS_EYE_VECTOR_ADDR, 1, 4 );
rmesa->hw.mat[R200_MTX_MV].cmd[MAT_CMD_0] =
rmesa->hw.mat[R200_MTX_MV].cmd[MAT_CMD_0] =
cmdvec( R200_VS_MATRIX_0_MV, 1, 16);
rmesa->hw.mat[R200_MTX_IMV].cmd[MAT_CMD_0] =
rmesa->hw.mat[R200_MTX_IMV].cmd[MAT_CMD_0] =
cmdvec( R200_VS_MATRIX_1_INV_MV, 1, 16);
rmesa->hw.mat[R200_MTX_MVP].cmd[MAT_CMD_0] =
rmesa->hw.mat[R200_MTX_MVP].cmd[MAT_CMD_0] =
cmdvec( R200_VS_MATRIX_2_MVP, 1, 16);
rmesa->hw.mat[R200_MTX_TEX0].cmd[MAT_CMD_0] =
rmesa->hw.mat[R200_MTX_TEX0].cmd[MAT_CMD_0] =
cmdvec( R200_VS_MATRIX_3_TEX0, 1, 16);
rmesa->hw.mat[R200_MTX_TEX1].cmd[MAT_CMD_0] =
rmesa->hw.mat[R200_MTX_TEX1].cmd[MAT_CMD_0] =
cmdvec( R200_VS_MATRIX_4_TEX1, 1, 16);
rmesa->hw.mat[R200_MTX_TEX2].cmd[MAT_CMD_0] =
rmesa->hw.mat[R200_MTX_TEX2].cmd[MAT_CMD_0] =
cmdvec( R200_VS_MATRIX_5_TEX2, 1, 16);
rmesa->hw.mat[R200_MTX_TEX3].cmd[MAT_CMD_0] =
rmesa->hw.mat[R200_MTX_TEX3].cmd[MAT_CMD_0] =
cmdvec( R200_VS_MATRIX_6_TEX3, 1, 16);
rmesa->hw.mat[R200_MTX_TEX4].cmd[MAT_CMD_0] =
rmesa->hw.mat[R200_MTX_TEX4].cmd[MAT_CMD_0] =
cmdvec( R200_VS_MATRIX_7_TEX4, 1, 16);
rmesa->hw.mat[R200_MTX_TEX5].cmd[MAT_CMD_0] =
rmesa->hw.mat[R200_MTX_TEX5].cmd[MAT_CMD_0] =
cmdvec( R200_VS_MATRIX_8_TEX5, 1, 16);
for (i = 0 ; i < 8; i++) {
rmesa->hw.lit[i].cmd[LIT_CMD_0] =
rmesa->hw.lit[i].cmd[LIT_CMD_0] =
cmdvec( R200_VS_LIGHT_AMBIENT_ADDR + i, 8, 24 );
rmesa->hw.lit[i].cmd[LIT_CMD_1] =
rmesa->hw.lit[i].cmd[LIT_CMD_1] =
cmdscl( R200_SS_LIGHT_DCD_ADDR + i, 8, 7 );
}
for (i = 0 ; i < 6; i++) {
rmesa->hw.ucp[i].cmd[UCP_CMD_0] =
rmesa->hw.ucp[i].cmd[UCP_CMD_0] =
cmdvec( R200_VS_UCP_ADDR + i, 1, 4 );
}
@ -937,11 +937,11 @@ void r200InitState( r200ContextPtr rmesa )
rmesa->hw.ctx.cmd[CTX_RB3D_DEPTHOFFSET] =
rmesa->radeon.radeonScreen->depthOffset + rmesa->radeon.radeonScreen->fbLocation;
rmesa->hw.ctx.cmd[CTX_RB3D_DEPTHPITCH] =
rmesa->hw.ctx.cmd[CTX_RB3D_DEPTHPITCH] =
((rmesa->radeon.radeonScreen->depthPitch &
R200_DEPTHPITCH_MASK) |
R200_DEPTH_ENDIAN_NO_SWAP);
if (rmesa->using_hyperz)
rmesa->hw.ctx.cmd[CTX_RB3D_DEPTHPITCH] |= R200_DEPTH_HYPERZ;
@ -959,7 +959,7 @@ void r200InitState( r200ContextPtr rmesa )
rmesa->hw.ctx.cmd[CTX_RB3D_ZSTENCILCNTL] |= RADEON_Z_HIERARCHY_ENABLE;*/
}
rmesa->hw.ctx.cmd[CTX_PP_CNTL] = (R200_ANTI_ALIAS_NONE
rmesa->hw.ctx.cmd[CTX_PP_CNTL] = (R200_ANTI_ALIAS_NONE
| R200_TEX_BLEND_0_ENABLE);
switch ( driQueryOptioni( &rmesa->radeon.optionCache, "dither_mode" ) ) {
@ -981,7 +981,7 @@ void r200InitState( r200ContextPtr rmesa )
else
rmesa->hw.ctx.cmd[CTX_RB3D_CNTL] |= rmesa->radeon.state.color.roundEnable;
rmesa->hw.prf.cmd[PRF_PP_TRI_PERF] = R200_TRI_CUTOFF_MASK - R200_TRI_CUTOFF_MASK *
rmesa->hw.prf.cmd[PRF_PP_TRI_PERF] = R200_TRI_CUTOFF_MASK - R200_TRI_CUTOFF_MASK *
driQueryOptionf (&rmesa->radeon.optionCache,"texture_blend_quality");
rmesa->hw.prf.cmd[PRF_PP_PERF_CNTL] = 0;
@ -1003,13 +1003,13 @@ void r200InitState( r200ContextPtr rmesa )
rmesa->hw.lin.cmd[LIN_RE_LINE_PATTERN] = ((1 << 16) | 0xffff);
rmesa->hw.lin.cmd[LIN_RE_LINE_STATE] =
rmesa->hw.lin.cmd[LIN_RE_LINE_STATE] =
((0 << R200_LINE_CURRENT_PTR_SHIFT) |
(1 << R200_LINE_CURRENT_COUNT_SHIFT));
rmesa->hw.lin.cmd[LIN_SE_LINE_WIDTH] = (1 << 4);
rmesa->hw.msk.cmd[MSK_RB3D_STENCILREFMASK] =
rmesa->hw.msk.cmd[MSK_RB3D_STENCILREFMASK] =
((0x00 << R200_STENCIL_REF_SHIFT) |
(0xff << R200_STENCIL_MASK_SHIFT) |
(0xff << R200_STENCIL_WRITEMASK_SHIFT));
@ -1019,7 +1019,7 @@ void r200InitState( r200ContextPtr rmesa )
rmesa->hw.tam.cmd[TAM_DEBUG3] = 0;
rmesa->hw.msc.cmd[MSC_RE_MISC] =
rmesa->hw.msc.cmd[MSC_RE_MISC] =
((0 << R200_STIPPLE_X_OFFSET_SHIFT) |
(0 << R200_STIPPLE_Y_OFFSET_SHIFT) |
R200_STIPPLE_BIG_BIT_ORDER);
@ -1055,7 +1055,7 @@ void r200InitState( r200ContextPtr rmesa )
rmesa->hw.cst.cmd[CST_SE_TCL_INPUT_VTX_3] =
(0x0A << R200_VTX_TEX_4_ADDR__SHIFT) |
(0x0B << R200_VTX_TEX_5_ADDR__SHIFT);
rmesa->hw.vpt.cmd[VPT_SE_VPORT_XSCALE] = 0x00000000;
rmesa->hw.vpt.cmd[VPT_SE_VPORT_XOFFSET] = 0x00000000;
@ -1066,7 +1066,7 @@ void r200InitState( r200ContextPtr rmesa )
for ( i = 0 ; i < ctx->Const.MaxTextureUnits ; i++ ) {
rmesa->hw.tex[i].cmd[TEX_PP_TXFILTER] = R200_BORDER_MODE_OGL;
rmesa->hw.tex[i].cmd[TEX_PP_TXFORMAT] =
rmesa->hw.tex[i].cmd[TEX_PP_TXFORMAT] =
((i << R200_TXFORMAT_ST_ROUTE_SHIFT) | /* <-- note i */
(2 << R200_TXFORMAT_WIDTH_SHIFT) |
(2 << R200_TXFORMAT_HEIGHT_SHIFT));
@ -1123,11 +1123,11 @@ void r200InitState( r200ContextPtr rmesa )
rmesa->hw.tf.cmd[TF_TFACTOR_4] = 0;
rmesa->hw.tf.cmd[TF_TFACTOR_5] = 0;
rmesa->hw.vap.cmd[VAP_SE_VAP_CNTL] =
(R200_VAP_TCL_ENABLE |
rmesa->hw.vap.cmd[VAP_SE_VAP_CNTL] =
(R200_VAP_TCL_ENABLE |
(0x9 << R200_VAP_VF_MAX_VTX_NUM__SHIFT));
rmesa->hw.vte.cmd[VTE_SE_VTE_CNTL] =
rmesa->hw.vte.cmd[VTE_SE_VTE_CNTL] =
(R200_VPORT_X_SCALE_ENA |
R200_VPORT_Y_SCALE_ENA |
R200_VPORT_Z_SCALE_ENA |
@ -1135,50 +1135,50 @@ void r200InitState( r200ContextPtr rmesa )
R200_VPORT_Y_OFFSET_ENA |
R200_VPORT_Z_OFFSET_ENA |
/* FIXME: Turn on for tex rect only */
R200_VTX_ST_DENORMALIZED |
R200_VTX_W0_FMT);
R200_VTX_ST_DENORMALIZED |
R200_VTX_W0_FMT);
rmesa->hw.vtx.cmd[VTX_VTXFMT_0] = 0;
rmesa->hw.vtx.cmd[VTX_VTXFMT_1] = 0;
rmesa->hw.vtx.cmd[VTX_TCL_OUTPUT_VTXFMT_0] =
rmesa->hw.vtx.cmd[VTX_TCL_OUTPUT_VTXFMT_0] =
((R200_VTX_Z0 | R200_VTX_W0 |
(R200_VTX_FP_RGBA << R200_VTX_COLOR_0_SHIFT)));
(R200_VTX_FP_RGBA << R200_VTX_COLOR_0_SHIFT)));
rmesa->hw.vtx.cmd[VTX_TCL_OUTPUT_VTXFMT_1] = 0;
rmesa->hw.vtx.cmd[VTX_TCL_OUTPUT_COMPSEL] = (R200_OUTPUT_XYZW);
rmesa->hw.vtx.cmd[VTX_STATE_CNTL] = R200_VSC_UPDATE_USER_COLOR_0_ENABLE;
/* Matrix selection */
rmesa->hw.msl.cmd[MSL_MATRIX_SELECT_0] =
rmesa->hw.msl.cmd[MSL_MATRIX_SELECT_0] =
(R200_MTX_MV << R200_MODELVIEW_0_SHIFT);
rmesa->hw.msl.cmd[MSL_MATRIX_SELECT_1] =
rmesa->hw.msl.cmd[MSL_MATRIX_SELECT_1] =
(R200_MTX_IMV << R200_IT_MODELVIEW_0_SHIFT);
rmesa->hw.msl.cmd[MSL_MATRIX_SELECT_2] =
rmesa->hw.msl.cmd[MSL_MATRIX_SELECT_2] =
(R200_MTX_MVP << R200_MODELPROJECT_0_SHIFT);
rmesa->hw.msl.cmd[MSL_MATRIX_SELECT_3] =
rmesa->hw.msl.cmd[MSL_MATRIX_SELECT_3] =
((R200_MTX_TEX0 << R200_TEXMAT_0_SHIFT) |
(R200_MTX_TEX1 << R200_TEXMAT_1_SHIFT) |
(R200_MTX_TEX2 << R200_TEXMAT_2_SHIFT) |
(R200_MTX_TEX3 << R200_TEXMAT_3_SHIFT));
rmesa->hw.msl.cmd[MSL_MATRIX_SELECT_4] =
rmesa->hw.msl.cmd[MSL_MATRIX_SELECT_4] =
((R200_MTX_TEX4 << R200_TEXMAT_4_SHIFT) |
(R200_MTX_TEX5 << R200_TEXMAT_5_SHIFT));
/* General TCL state */
rmesa->hw.tcl.cmd[TCL_LIGHT_MODEL_CTL_0] =
rmesa->hw.tcl.cmd[TCL_LIGHT_MODEL_CTL_0] =
(R200_SPECULAR_LIGHTS |
R200_DIFFUSE_SPECULAR_COMBINE |
R200_LOCAL_LIGHT_VEC_GL |
R200_LM0_SOURCE_MATERIAL_0 << R200_FRONT_SHININESS_SOURCE_SHIFT |
R200_LM0_SOURCE_MATERIAL_1 << R200_BACK_SHININESS_SOURCE_SHIFT);
rmesa->hw.tcl.cmd[TCL_LIGHT_MODEL_CTL_1] =
rmesa->hw.tcl.cmd[TCL_LIGHT_MODEL_CTL_1] =
((R200_LM1_SOURCE_MATERIAL_0 << R200_FRONT_EMISSIVE_SOURCE_SHIFT) |
(R200_LM1_SOURCE_MATERIAL_0 << R200_FRONT_AMBIENT_SOURCE_SHIFT) |
(R200_LM1_SOURCE_MATERIAL_0 << R200_FRONT_DIFFUSE_SOURCE_SHIFT) |
@ -1186,34 +1186,34 @@ void r200InitState( r200ContextPtr rmesa )
(R200_LM1_SOURCE_MATERIAL_1 << R200_BACK_EMISSIVE_SOURCE_SHIFT) |
(R200_LM1_SOURCE_MATERIAL_1 << R200_BACK_AMBIENT_SOURCE_SHIFT) |
(R200_LM1_SOURCE_MATERIAL_1 << R200_BACK_DIFFUSE_SOURCE_SHIFT) |
(R200_LM1_SOURCE_MATERIAL_1 << R200_BACK_SPECULAR_SOURCE_SHIFT));
(R200_LM1_SOURCE_MATERIAL_1 << R200_BACK_SPECULAR_SOURCE_SHIFT));
rmesa->hw.tcl.cmd[TCL_PER_LIGHT_CTL_0] = 0; /* filled in via callbacks */
rmesa->hw.tcl.cmd[TCL_PER_LIGHT_CTL_1] = 0;
rmesa->hw.tcl.cmd[TCL_PER_LIGHT_CTL_2] = 0;
rmesa->hw.tcl.cmd[TCL_PER_LIGHT_CTL_3] = 0;
rmesa->hw.tcl.cmd[TCL_UCP_VERT_BLEND_CTL] =
rmesa->hw.tcl.cmd[TCL_UCP_VERT_BLEND_CTL] =
(R200_UCP_IN_CLIP_SPACE |
R200_CULL_FRONT_IS_CCW);
/* Texgen/Texmat state */
rmesa->hw.tcg.cmd[TCG_TEX_PROC_CTL_2] = 0x00ffffff;
rmesa->hw.tcg.cmd[TCG_TEX_PROC_CTL_3] =
rmesa->hw.tcg.cmd[TCG_TEX_PROC_CTL_3] =
((0 << R200_TEXGEN_0_INPUT_TEX_SHIFT) |
(1 << R200_TEXGEN_1_INPUT_TEX_SHIFT) |
(2 << R200_TEXGEN_2_INPUT_TEX_SHIFT) |
(3 << R200_TEXGEN_3_INPUT_TEX_SHIFT) |
(4 << R200_TEXGEN_4_INPUT_TEX_SHIFT) |
(5 << R200_TEXGEN_5_INPUT_TEX_SHIFT));
rmesa->hw.tcg.cmd[TCG_TEX_PROC_CTL_0] = 0;
rmesa->hw.tcg.cmd[TCG_TEX_PROC_CTL_1] =
(5 << R200_TEXGEN_5_INPUT_TEX_SHIFT));
rmesa->hw.tcg.cmd[TCG_TEX_PROC_CTL_0] = 0;
rmesa->hw.tcg.cmd[TCG_TEX_PROC_CTL_1] =
((0 << R200_TEXGEN_0_INPUT_SHIFT) |
(1 << R200_TEXGEN_1_INPUT_SHIFT) |
(2 << R200_TEXGEN_2_INPUT_SHIFT) |
(3 << R200_TEXGEN_3_INPUT_SHIFT) |
(4 << R200_TEXGEN_4_INPUT_SHIFT) |
(5 << R200_TEXGEN_5_INPUT_SHIFT));
(5 << R200_TEXGEN_5_INPUT_SHIFT));
rmesa->hw.tcg.cmd[TCG_TEX_CYL_WRAP_CTL] = 0;
@ -1231,14 +1231,14 @@ void r200InitState( r200ContextPtr rmesa )
ctx->Driver.Lightfv( ctx, p, GL_SPOT_CUTOFF, &l->SpotCutoff );
ctx->Driver.Lightfv( ctx, p, GL_CONSTANT_ATTENUATION,
&l->ConstantAttenuation );
ctx->Driver.Lightfv( ctx, p, GL_LINEAR_ATTENUATION,
ctx->Driver.Lightfv( ctx, p, GL_LINEAR_ATTENUATION,
&l->LinearAttenuation );
ctx->Driver.Lightfv( ctx, p, GL_QUADRATIC_ATTENUATION,
ctx->Driver.Lightfv( ctx, p, GL_QUADRATIC_ATTENUATION,
&l->QuadraticAttenuation );
*(float *)&(rmesa->hw.lit[i].cmd[LIT_ATTEN_XXX]) = 0.0;
}
ctx->Driver.LightModelfv( ctx, GL_LIGHT_MODEL_AMBIENT,
ctx->Driver.LightModelfv( ctx, GL_LIGHT_MODEL_AMBIENT,
ctx->Light.Model.Ambient );
TNL_CONTEXT(ctx)->Driver.NotifyMaterialChange( ctx );
@ -1253,7 +1253,7 @@ void r200InitState( r200ContextPtr rmesa )
ctx->Driver.Fogfv( ctx, GL_FOG_END, &ctx->Fog.End );
ctx->Driver.Fogfv( ctx, GL_FOG_COLOR, ctx->Fog.Color );
ctx->Driver.Fogfv( ctx, GL_FOG_COORDINATE_SOURCE_EXT, NULL );
rmesa->hw.grd.cmd[GRD_VERT_GUARD_CLIP_ADJ] = IEEE_ONE;
rmesa->hw.grd.cmd[GRD_VERT_GUARD_DISCARD_ADJ] = IEEE_ONE;
rmesa->hw.grd.cmd[GRD_HORZ_GUARD_CLIP_ADJ] = IEEE_ONE;

View file

@ -36,7 +36,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include "main/mtypes.h"
#include "main/enums.h"
#include "main/image.h"
#include "util/imports.h"
#include "main/macros.h"
#include "main/state.h"

View file

@ -33,7 +33,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#include "main/glheader.h"
#include "util/imports.h"
#include "main/mtypes.h"
#include "main/enums.h"
#include "main/light.h"
@ -99,7 +99,7 @@ static GLboolean discrete_prim[0x10] = {
0, /* e quad strip */
0, /* f polygon */
};
#define LOCAL_VARS r200ContextPtr rmesa = R200_CONTEXT(ctx)
#define ELT_TYPE GLushort
@ -138,7 +138,7 @@ static GLboolean discrete_prim[0x10] = {
#define ALLOC_ELTS(nr) r200AllocElts( rmesa, nr )
static GLushort *r200AllocElts( r200ContextPtr rmesa, GLuint nr )
static GLushort *r200AllocElts( r200ContextPtr rmesa, GLuint nr )
{
if (rmesa->radeon.dma.flush == r200FlushElts &&
rmesa->tcl.elt_used + nr*2 < R200_ELT_BUF_SZ) {
@ -174,21 +174,21 @@ while (0)
* discrete and there are no intervening state changes. (Somewhat
* duplicates changes to DrawArrays code)
*/
static void r200EmitPrim( struct gl_context *ctx,
GLenum prim,
GLuint hwprim,
GLuint start,
GLuint count)
static void r200EmitPrim( struct gl_context *ctx,
GLenum prim,
GLuint hwprim,
GLuint start,
GLuint count)
{
r200ContextPtr rmesa = R200_CONTEXT( ctx );
r200TclPrimitive( ctx, prim, hwprim );
// fprintf(stderr,"Emit prim %d\n", rmesa->radeon.tcl.aos_count);
r200EmitAOS( rmesa,
rmesa->radeon.tcl.aos_count,
start );
/* Why couldn't this packet have taken an offset param?
*/
r200EmitVbufPrim( rmesa,
@ -238,7 +238,7 @@ static void r200EmitPrim( struct gl_context *ctx,
/* External entrypoints */
/**********************************************************************/
void r200EmitPrimitive( struct gl_context *ctx,
void r200EmitPrimitive( struct gl_context *ctx,
GLuint first,
GLuint last,
GLuint flags )
@ -246,7 +246,7 @@ void r200EmitPrimitive( struct gl_context *ctx,
tcl_render_tab_verts[flags&PRIM_MODE_MASK]( ctx, first, last, flags );
}
void r200EmitEltPrimitive( struct gl_context *ctx,
void r200EmitEltPrimitive( struct gl_context *ctx,
GLuint first,
GLuint last,
GLuint flags )
@ -254,7 +254,7 @@ void r200EmitEltPrimitive( struct gl_context *ctx,
tcl_render_tab_elts[flags&PRIM_MODE_MASK]( ctx, first, last, flags );
}
void r200TclPrimitive( struct gl_context *ctx,
void r200TclPrimitive( struct gl_context *ctx,
GLenum prim,
int hw_prim )
{
@ -360,14 +360,14 @@ static GLboolean r200_run_tcl_render( struct gl_context *ctx,
struct vertex_buffer *VB = &tnl->vb;
GLuint i;
GLubyte *vimap_rev;
/* use hw fixed order for simplicity, pos 0, weight 1, normal 2, fog 3,
/* use hw fixed order for simplicity, pos 0, weight 1, normal 2, fog 3,
color0 - color3 4-7, texcoord0 - texcoord5 8-13, pos 1 14. Must not use
more than 12 of those at the same time. */
GLubyte map_rev_fixed[15] = {255, 255, 255, 255, 255, 255, 255, 255,
255, 255, 255, 255, 255, 255, 255};
/* TODO: separate this from the swtnl pipeline
/* TODO: separate this from the swtnl pipeline
*/
if (rmesa->radeon.TclFallback)
return GL_TRUE; /* fallback to software t&l */
@ -485,7 +485,7 @@ static GLboolean r200_run_tcl_render( struct gl_context *ctx,
/* Initial state for tcl stage.
/* Initial state for tcl stage.
*/
const struct tnl_pipeline_stage _r200_tcl_stage =
{
@ -519,9 +519,9 @@ static void transition_to_swtnl( struct gl_context *ctx )
r200ChooseVertexState( ctx );
r200ChooseRenderState( ctx );
_tnl_validate_shine_tables( ctx );
_tnl_validate_shine_tables( ctx );
tnl->Driver.NotifyMaterialChange =
tnl->Driver.NotifyMaterialChange =
_tnl_validate_shine_tables;
radeonReleaseArrays( ctx, ~0 );
@ -544,11 +544,11 @@ static void transition_to_hwtnl( struct gl_context *ctx )
tnl->Driver.NotifyMaterialChange = r200UpdateMaterial;
if ( rmesa->radeon.dma.flush )
rmesa->radeon.dma.flush( &rmesa->radeon.glCtx );
if ( rmesa->radeon.dma.flush )
rmesa->radeon.dma.flush( &rmesa->radeon.glCtx );
rmesa->radeon.dma.flush = NULL;
R200_STATECHANGE( rmesa, vap );
rmesa->hw.vap.cmd[VAP_SE_VAP_CNTL] |= R200_VAP_TCL_ENABLE;
rmesa->hw.vap.cmd[VAP_SE_VAP_CNTL] &= ~R200_VAP_FORCE_W_TO_ONE;

View file

@ -32,7 +32,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#include "main/glheader.h"
#include "util/imports.h"
#include "main/context.h"
#include "main/enums.h"
#include "main/image.h"
@ -52,7 +52,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
/**
* Set the texture wrap modes.
*
*
* \param t Texture object whose wrap modes are to be set
* \param swrap Wrap mode for the \a s texture coordinate
* \param twrap Wrap mode for the \a t texture coordinate
@ -205,7 +205,7 @@ static void r200SetTexMaxAnisotropy( radeonTexObjPtr t, GLfloat max )
/**
* Set the texture magnification and minification modes.
*
*
* \param t Texture whose filter modes are to be set
* \param minf Texture minification mode
* \param magf Texture magnification mode
@ -327,7 +327,7 @@ static void r200TexEnv( struct gl_context *ctx, GLenum target,
const int fixed_one = R200_LOD_BIAS_FIXED_ONE;
/* The R200's LOD bias is a signed 2's complement value with a
* range of -16.0 <= bias < 16.0.
* range of -16.0 <= bias < 16.0.
*
* NOTE: Add a small bias to the bias for conform mipsel.c test.
*/
@ -337,7 +337,7 @@ static void r200TexEnv( struct gl_context *ctx, GLenum target,
bias = CLAMP( bias, min, 16.0 );
b = ((int)(bias * fixed_one)
+ R200_LOD_BIAS_CORRECTION) & R200_LOD_BIAS_MASK;
if ( (rmesa->hw.tex[unit].cmd[TEX_PP_TXFORMAT_X] & R200_LOD_BIAS_MASK) != b ) {
R200_STATECHANGE( rmesa, tex[unit] );
rmesa->hw.tex[unit].cmd[TEX_PP_TXFORMAT_X] &= ~R200_LOD_BIAS_MASK;
@ -426,7 +426,7 @@ static void r200DeleteTexture(struct gl_context * ctx, struct gl_texture_object
rmesa->hw.tex[i].dirty = GL_FALSE;
rmesa->hw.cube[i].dirty = GL_FALSE;
}
}
}
}
radeon_miptree_unreference(&t->mt);
@ -434,13 +434,13 @@ static void r200DeleteTexture(struct gl_context * ctx, struct gl_texture_object
_mesa_delete_texture_object(ctx, texObj);
}
/* Need:
/* Need:
* - Same GEN_MODE for all active bits
* - Same EyePlane/ObjPlane for all active bits when using Eye/Obj
* - STRQ presumably all supported (matrix means incoming R values
* can end up in STQ, this has implications for vertex support,
* presumably ok if maos is used, though?)
*
*
* Basically impossible to do this on the fly - just collect some
* basic info & do the checks from ValidateState().
*/

View file

@ -33,7 +33,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#include "main/glheader.h"
#include "util/imports.h"
#include "main/context.h"
#include "main/macros.h"
#include "main/state.h"
@ -457,7 +457,7 @@ static GLboolean r200UpdateTextureEnv( struct gl_context *ctx, int unit, int slo
break;
case GL_ADD:
color_combine = (R200_TXC_ARG_B_ZERO |
R200_TXC_COMP_ARG_B |
R200_TXC_COMP_ARG_B |
R200_TXC_OP_MADD);
R200_COLOR_ARG( 0, A );
R200_COLOR_ARG( 1, C );
@ -472,7 +472,7 @@ static GLboolean r200UpdateTextureEnv( struct gl_context *ctx, int unit, int slo
break;
case GL_SUBTRACT:
color_combine = (R200_TXC_ARG_B_ZERO |
R200_TXC_COMP_ARG_B |
R200_TXC_COMP_ARG_B |
R200_TXC_NEG_ARG_C |
R200_TXC_OP_MADD);
R200_COLOR_ARG( 0, A );
@ -798,7 +798,7 @@ static GLboolean r200UpdateAllTexEnv( struct gl_context *ctx )
continue;
}
currentnext = j;
const GLuint numColorArgs = texUnit->_CurrentCombine->_NumArgsRGB;
const GLuint numAlphaArgs = texUnit->_CurrentCombine->_NumArgsA;
const GLboolean isdot3rgba = (texUnit->_CurrentCombine->ModeRGB == GL_DOT3_RGBA) ||
@ -940,10 +940,10 @@ static GLboolean r200UpdateAllTexEnv( struct gl_context *ctx )
R200_VOLUME_FILTER_MASK)
static void disable_tex_obj_state( r200ContextPtr rmesa,
static void disable_tex_obj_state( r200ContextPtr rmesa,
int unit )
{
R200_STATECHANGE( rmesa, vtx );
rmesa->hw.vtx.cmd[VTX_TCL_OUTPUT_VTXFMT_1] &= ~(7 << (unit * 3));
@ -1002,7 +1002,7 @@ static void import_tex_obj_state( r200ContextPtr rmesa,
}
static void set_texgen_matrix( r200ContextPtr rmesa,
static void set_texgen_matrix( r200ContextPtr rmesa,
GLuint unit,
const GLfloat *s_plane,
const GLfloat *t_plane,
@ -1079,10 +1079,10 @@ static GLuint r200_need_dis_texgen(const GLbitfield texGenEnabled,
/*
* Returns GL_FALSE if fallback required.
* Returns GL_FALSE if fallback required.
*/
static GLboolean r200_validate_texgen( struct gl_context *ctx, GLuint unit )
{
{
r200ContextPtr rmesa = R200_CONTEXT(ctx);
const struct gl_fixedfunc_texture_unit *texUnit =
&ctx->Texture.FixedFuncUnit[unit];
@ -1110,7 +1110,7 @@ static GLboolean r200_validate_texgen( struct gl_context *ctx, GLuint unit )
tgcm = rmesa->hw.tcg.cmd[TCG_TEX_PROC_CTL_2] & ~(R200_TEXGEN_COMP_MASK <<
(unit * 4));
if (0)
if (0)
fprintf(stderr, "%s unit %d\n", __func__, unit);
if (texUnit->TexGenEnabled & S_BIT) {
@ -1179,7 +1179,7 @@ static GLboolean r200_validate_texgen( struct gl_context *ctx, GLuint unit )
}
tgi |= R200_TEXGEN_INPUT_OBJ << inputshift;
set_texgen_matrix( rmesa, unit,
set_texgen_matrix( rmesa, unit,
(texUnit->TexGenEnabled & S_BIT) ? texUnit->GenS.ObjectPlane : I,
(texUnit->TexGenEnabled & T_BIT) ? texUnit->GenT.ObjectPlane : I + 4,
(texUnit->TexGenEnabled & R_BIT) ? texUnit->GenR.ObjectPlane : I + 8,
@ -1219,7 +1219,7 @@ static GLboolean r200_validate_texgen( struct gl_context *ctx, GLuint unit )
tgi |= R200_TEXGEN_INPUT_EYE_REFLECT << inputshift;
/* pretty weird, must only negate when lighting is enabled? */
if (ctx->Light.Enabled)
set_texgen_matrix( rmesa, unit,
set_texgen_matrix( rmesa, unit,
(texUnit->TexGenEnabled & S_BIT) ? reflect : I,
(texUnit->TexGenEnabled & T_BIT) ? reflect + 4 : I + 4,
(texUnit->TexGenEnabled & R_BIT) ? reflect + 8 : I + 8,
@ -1253,7 +1253,7 @@ static GLboolean r200_validate_texgen( struct gl_context *ctx, GLuint unit )
rmesa->TexGenEnabled |= R200_TEXGEN_TEXMAT_0_ENABLE << unit;
rmesa->TexGenCompSel |= R200_OUTPUT_TEX_0 << unit;
if (tgi != rmesa->hw.tcg.cmd[TCG_TEX_PROC_CTL_1] ||
if (tgi != rmesa->hw.tcg.cmd[TCG_TEX_PROC_CTL_1] ||
tgcm != rmesa->hw.tcg.cmd[TCG_TEX_PROC_CTL_2])
{
R200_STATECHANGE(rmesa, tcg);
@ -1313,11 +1313,11 @@ static void setup_hardware_state(r200ContextPtr rmesa, radeonTexObj *t)
#else
const struct tx_table *table = tx_table_be;
#endif
t->pp_txformat &= ~(R200_TXFORMAT_FORMAT_MASK |
R200_TXFORMAT_ALPHA_IN_MAP);
t->pp_txfilter &= ~R200_YUV_TO_RGB;
t->pp_txformat |= table[ firstImage->TexFormat ].format;
t->pp_txfilter |= table[ firstImage->TexFormat ].filter;
@ -1349,9 +1349,9 @@ static void setup_hardware_state(r200ContextPtr rmesa, radeonTexObj *t)
R200_TXFORMAT_F5_HEIGHT_MASK);
t->pp_txformat |= (((log2Width + extra_size) << R200_TXFORMAT_WIDTH_SHIFT) |
((log2Height + extra_size)<< R200_TXFORMAT_HEIGHT_SHIFT));
t->tile_bits = 0;
t->pp_txformat_x &= ~(R200_DEPTH_LOG2_MASK | R200_TEXCOORD_MASK
| R200_MIN_MIP_LEVEL_MASK);
@ -1424,7 +1424,7 @@ static GLboolean r200_validate_texture(struct gl_context *ctx, struct gl_texture
set_re_cntl_d3d( ctx, unit, GL_TRUE );
R200_STATECHANGE( rmesa, ctx );
rmesa->hw.ctx.cmd[CTX_PP_CNTL] |= R200_TEX_0_ENABLE << unit;
R200_STATECHANGE( rmesa, vtx );
rmesa->hw.vtx.cmd[VTX_TCL_OUTPUT_VTXFMT_1] &= ~(7 << (unit * 3));
rmesa->hw.vtx.cmd[VTX_TCL_OUTPUT_VTXFMT_1] |= 4 << (unit * 3);

View file

@ -25,7 +25,6 @@
*
*/
#include "util/imports.h"
#include "main/mtypes.h"
#include "main/bufferobj.h"
#include "util/u_memory.h"

View file

@ -43,7 +43,6 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include <errno.h>
#include "main/glheader.h"
#include "util/imports.h"
#include "main/context.h"
#include "main/enums.h"
#include "main/fbobject.h"

View file

@ -40,7 +40,6 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include "main/api_exec.h"
#include "main/context.h"
#include "util/simple_list.h"
#include "util/imports.h"
#include "main/extensions.h"
#include "main/version.h"
#include "main/vtxfmt.h"
@ -76,7 +75,7 @@ static const struct tnl_pipeline_stage *radeon_pipeline[] = {
/* Try and go straight to t&l
*/
&_radeon_tcl_stage,
&_radeon_tcl_stage,
/* Catch any t&l fallbacks
*/
@ -95,7 +94,7 @@ static const struct tnl_pipeline_stage *radeon_pipeline[] = {
static void r100_vtbl_pre_emit_state(radeonContextPtr radeon)
{
r100ContextPtr rmesa = (r100ContextPtr)radeon;
/* r100 always needs to emit ZBS to avoid TCL lockups */
rmesa->hw.zbs.dirty = 1;
radeon->hw.is_dirty = 1;
@ -228,7 +227,7 @@ r100CreateContext( gl_api api,
ctx->Const.StripTextureBorder = GL_TRUE;
/* FIXME: When no memory manager is available we should set this
/* FIXME: When no memory manager is available we should set this
* to some reasonable value based on texture memory pool size */
ctx->Const.MaxTextureSize = 2048;
ctx->Const.Max3DTextureLevels = 9;
@ -255,9 +254,9 @@ r100CreateContext( gl_api api,
* fit in a single dma buffer for indexed rendering of quad strips,
* etc.
*/
ctx->Const.MaxArrayLockSize =
MIN2( ctx->Const.MaxArrayLockSize,
RADEON_BUFFER_SIZE / RADEON_MAX_TCL_VERTSIZE );
ctx->Const.MaxArrayLockSize =
MIN2( ctx->Const.MaxArrayLockSize,
RADEON_BUFFER_SIZE / RADEON_MAX_TCL_VERTSIZE );
rmesa->boxes = 0;
@ -319,7 +318,7 @@ r100CreateContext( gl_api api,
radeonInitState( rmesa );
radeonInitSwtcl( ctx );
_mesa_vector4f_alloc( &rmesa->tcl.ObjClean, 0,
_mesa_vector4f_alloc( &rmesa->tcl.ObjClean, 0,
ctx->Const.MaxArrayLockSize, 32 );
fthrottle_mode = driQueryOptioni(&rmesa->radeon.optionCache, "fthrottle_mode");

View file

@ -1,8 +1,8 @@
/**************************************************************************
*
*
* Copyright 2008 Red Hat Inc.
* All Rights Reserved.
*
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
@ -10,11 +10,11 @@
* distribute, sub license, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
*
* The above copyright notice and this permission notice (including the
* next paragraph) shall be included in all copies or substantial portions
* of the Software.
*
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
@ -22,11 +22,10 @@
* ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
*
**************************************************************************/
#include "util/imports.h"
#include "main/macros.h"
#include "main/mtypes.h"
#include "main/enums.h"
@ -177,7 +176,7 @@ radeon_map_renderbuffer_s8z24(struct gl_renderbuffer *rb,
}
radeon_bo_unmap(rrb->bo);
*out_map = rrb->map_buffer;
*out_stride = rrb->map_pitch;
}
@ -275,7 +274,7 @@ radeon_map_renderbuffer(struct gl_context *ctx,
rrb->map_bo = radeon_bo_open(rmesa->radeonScreen->bom, 0,
rrb->map_pitch * h, 4,
RADEON_GEM_DOMAIN_GTT, 0);
ok = rmesa->vtbl.blit(ctx, rrb->bo, rrb->draw_offset,
rb->Format, rrb->pitch / rrb->cpp,
rb->Width, rb->Height,
@ -359,7 +358,7 @@ radeon_unmap_renderbuffer_s8z24(struct gl_context *ctx,
int y_bias = (rb->Name == 0) ? (rb->Height - 1) : 0;
radeon_bo_map(rrb->bo, 1);
tiled_s8z24_map = rrb->bo->ptr;
for (uint32_t pix_y = 0; pix_y < rrb->map_h; pix_y++) {
@ -392,7 +391,7 @@ radeon_unmap_renderbuffer_z16(struct gl_context *ctx,
int y_bias = (rb->Name == 0) ? (rb->Height - 1) : 0;
radeon_bo_map(rrb->bo, 1);
tiled_z16_map = rrb->bo->ptr;
for (uint32_t pix_y = 0; pix_y < rrb->map_h; pix_y++) {
@ -732,7 +731,7 @@ radeon_framebuffer_renderbuffer(struct gl_context * ctx,
}
static GLboolean
radeon_update_wrapper(struct gl_context *ctx, struct radeon_renderbuffer *rrb,
radeon_update_wrapper(struct gl_context *ctx, struct radeon_renderbuffer *rrb,
struct gl_texture_image *texImage)
{
struct gl_renderbuffer *rb = &rrb->base.Base;
@ -881,7 +880,7 @@ void radeon_fbo_init(struct radeon_context *radeon)
radeon_image_target_renderbuffer_storage;
}
void radeon_renderbuffer_set_bo(struct radeon_renderbuffer *rb,
struct radeon_bo *bo)
{

View file

@ -34,7 +34,6 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include "c99_math.h"
#include "main/glheader.h"
#include "util/imports.h"
#include "main/context.h"
#include "main/mtypes.h"
#include "main/enums.h"

View file

@ -42,7 +42,6 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include "swrast/swrast.h"
#include "main/glheader.h"
#include "util/imports.h"
#include "util/simple_list.h"
#include "radeon_context.h"

View file

@ -33,7 +33,6 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#include "main/glheader.h"
#include "util/imports.h"
#include "main/mtypes.h"
#include "main/macros.h"
@ -139,7 +138,7 @@ static void emit_tex_vector(struct gl_context *ctx, struct radeon_aos *aos,
/* Emit any changed arrays to new GART memory, re-emit a packet to
* update the arrays.
* update the arrays.
*/
void radeonEmitArrays( struct gl_context *ctx, GLuint inputs )
{
@ -149,15 +148,15 @@ void radeonEmitArrays( struct gl_context *ctx, GLuint inputs )
GLuint vfmt = 0;
GLuint count = VB->Count;
GLuint vtx, unit;
#if 0
if (RADEON_DEBUG & RADEON_VERTS)
_tnl_print_vert_flags( __func__, inputs );
#endif
if (1) {
if (!rmesa->tcl.obj.buf)
rcommon_emit_vector( ctx,
if (!rmesa->tcl.obj.buf)
rcommon_emit_vector( ctx,
&(rmesa->tcl.aos[nr]),
(char *)VB->AttribPtr[_TNL_ATTRIB_POS]->data,
VB->AttribPtr[_TNL_ATTRIB_POS]->size,
@ -173,11 +172,11 @@ void radeonEmitArrays( struct gl_context *ctx, GLuint inputs )
}
nr++;
}
if (inputs & VERT_BIT_NORMAL) {
if (!rmesa->tcl.norm.buf)
rcommon_emit_vector( ctx,
rcommon_emit_vector( ctx,
&(rmesa->tcl.aos[nr]),
(char *)VB->AttribPtr[_TNL_ATTRIB_NORMAL]->data,
3,
@ -247,7 +246,7 @@ void radeonEmitArrays( struct gl_context *ctx, GLuint inputs )
vtx = (rmesa->hw.tcl.cmd[TCL_OUTPUT_VTXFMT] &
~(RADEON_TCL_VTX_Q0|RADEON_TCL_VTX_Q1|RADEON_TCL_VTX_Q2));
for (unit = 0; unit < ctx->Const.MaxTextureUnits; unit++) {
if (inputs & VERT_BIT_TEX(unit)) {
if (!rmesa->tcl.tex[unit].buf)

View file

@ -33,7 +33,6 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#include "main/glheader.h"
#include "util/imports.h"
#include "main/mtypes.h"
#include "main/state.h"
@ -280,7 +279,7 @@ static struct {
/***********************************************************************
* Initialization
* Initialization
***********************************************************************/
@ -370,8 +369,8 @@ void radeonEmitArrays( struct gl_context *ctx, GLuint inputs )
rmesa->hw.tcl.cmd[TCL_OUTPUT_VTXFMT] = vtx;
}
for (i = 0 ; i < RADEON_TCL_MAX_SETUP ; i++)
if ((setup_tab[i].vertex_format & req) == req)
for (i = 0 ; i < RADEON_TCL_MAX_SETUP ; i++)
if ((setup_tab[i].vertex_format & req) == req)
break;
if (rmesa->tcl.vertex_format == setup_tab[i].vertex_format &&
@ -384,12 +383,12 @@ void radeonEmitArrays( struct gl_context *ctx, GLuint inputs )
radeonAllocDmaRegion( &rmesa->radeon,
&rmesa->radeon.tcl.aos[0].bo,
&rmesa->radeon.tcl.aos[0].offset,
VB->Count * setup_tab[i].vertex_size * 4,
VB->Count * setup_tab[i].vertex_size * 4,
4);
/* The vertex code expects Obj to be clean to element 3. To fix
* this, add more vertex code (for obj-2, obj-3) or preferably move
* to maos.
* to maos.
*/
if (VB->AttribPtr[_TNL_ATTRIB_POS]->size < 3 ||
(VB->AttribPtr[_TNL_ATTRIB_POS]->size == 3 &&
@ -422,7 +421,7 @@ void radeonEmitArrays( struct gl_context *ctx, GLuint inputs )
radeon_bo_map(rmesa->radeon.tcl.aos[0].bo, 1);
setup_tab[i].emit( ctx, 0, VB->Count,
setup_tab[i].emit( ctx, 0, VB->Count,
rmesa->radeon.tcl.aos[0].bo->ptr + rmesa->radeon.tcl.aos[0].offset);
radeon_bo_unmap(rmesa->radeon.tcl.aos[0].bo);
// rmesa->radeon.tcl.aos[0].size = setup_tab[i].vertex_size;

View file

@ -28,7 +28,7 @@
#include "radeon_queryobj.h"
#include "radeon_debug.h"
#include "util/imports.h"
#include "main/queryobj.h"
#include <inttypes.h>

View file

@ -25,7 +25,6 @@
*
*/
#include "util/imports.h"
#include "util/simple_list.h"
#include "radeon_common_context.h"

View file

@ -37,7 +37,6 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include <errno.h>
#include "main/glheader.h"
#include "util/imports.h"
#include "main/mtypes.h"
#include "main/framebuffer.h"
#include "main/renderbuffer.h"
@ -711,7 +710,7 @@ radeonCreateBuffer( __DRIscreen *driScrnPriv,
MESA_FORMAT_X8R8G8B8_UNORM;
#endif
else
rgbFormat =
rgbFormat =
#if UTIL_ARCH_LITTLE_ENDIAN
MESA_FORMAT_B8G8R8A8_UNORM;
#else

View file

@ -33,7 +33,6 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#include "main/glheader.h"
#include "util/imports.h"
#include "main/enums.h"
#include "main/light.h"
#include "main/context.h"

View file

@ -29,7 +29,6 @@
#include "main/errors.h"
#include "main/glheader.h"
#include "util/imports.h"
#include "main/api_arrayelt.h"
#include "swrast/swrast.h"
@ -159,12 +158,12 @@ static struct {
/* =============================================================
* State initialization
*/
static int cmdpkt( r100ContextPtr rmesa, int id )
static int cmdpkt( r100ContextPtr rmesa, int id )
{
return CP_PACKET0(packet[id].start, packet[id].len - 1);
}
static int cmdvec( int offset, int stride, int count )
static int cmdvec( int offset, int stride, int count )
{
drm_radeon_cmd_header_t h;
h.i = 0;
@ -175,7 +174,7 @@ static int cmdvec( int offset, int stride, int count )
return h.i;
}
static int cmdscl( int offset, int stride, int count )
static int cmdscl( int offset, int stride, int count )
{
drm_radeon_cmd_header_t h;
h.i = 0;
@ -263,7 +262,7 @@ static void scl_emit(struct gl_context *ctx, struct radeon_state_atom *atom)
r100ContextPtr r100 = R100_CONTEXT(ctx);
BATCH_LOCALS(&r100->radeon);
uint32_t dwords = atom->check(ctx, atom);
BEGIN_BATCH(dwords);
OUT_SCL(atom->cmd[0], atom->cmd+1);
END_BATCH();
@ -367,7 +366,7 @@ static void ctx_emit_cs(struct gl_context *ctx, struct radeon_state_atom *atom)
depth_fmt = RADEON_DEPTH_FORMAT_16BIT_INT_Z;
atom->cmd[CTX_RB3D_ZSTENCILCNTL] &= ~RADEON_DEPTH_FORMAT_MASK;
atom->cmd[CTX_RB3D_ZSTENCILCNTL] |= depth_fmt;
}
BEGIN_BATCH(dwords);
@ -617,34 +616,34 @@ void radeonInitState( r100ContextPtr rmesa )
rmesa->hw.cube[2].cmd[CUBE_CMD_1] = cmdpkt(rmesa, RADEON_EMIT_PP_CUBIC_OFFSETS_T2);
rmesa->hw.zbs.cmd[ZBS_CMD_0] = cmdpkt(rmesa, RADEON_EMIT_SE_ZBIAS_FACTOR);
rmesa->hw.tcl.cmd[TCL_CMD_0] = cmdpkt(rmesa, RADEON_EMIT_SE_TCL_OUTPUT_VTX_FMT);
rmesa->hw.mtl.cmd[MTL_CMD_0] =
rmesa->hw.mtl.cmd[MTL_CMD_0] =
cmdpkt(rmesa, RADEON_EMIT_SE_TCL_MATERIAL_EMMISSIVE_RED);
rmesa->hw.txr[0].cmd[TXR_CMD_0] = cmdpkt(rmesa, RADEON_EMIT_PP_TEX_SIZE_0);
rmesa->hw.txr[1].cmd[TXR_CMD_0] = cmdpkt(rmesa, RADEON_EMIT_PP_TEX_SIZE_1);
rmesa->hw.txr[2].cmd[TXR_CMD_0] = cmdpkt(rmesa, RADEON_EMIT_PP_TEX_SIZE_2);
rmesa->hw.grd.cmd[GRD_CMD_0] =
rmesa->hw.grd.cmd[GRD_CMD_0] =
cmdscl( RADEON_SS_VERT_GUARD_CLIP_ADJ_ADDR, 1, 4 );
rmesa->hw.fog.cmd[FOG_CMD_0] =
rmesa->hw.fog.cmd[FOG_CMD_0] =
cmdvec( RADEON_VS_FOG_PARAM_ADDR, 1, 4 );
rmesa->hw.glt.cmd[GLT_CMD_0] =
rmesa->hw.glt.cmd[GLT_CMD_0] =
cmdvec( RADEON_VS_GLOBAL_AMBIENT_ADDR, 1, 4 );
rmesa->hw.eye.cmd[EYE_CMD_0] =
rmesa->hw.eye.cmd[EYE_CMD_0] =
cmdvec( RADEON_VS_EYE_VECTOR_ADDR, 1, 4 );
for (i = 0 ; i < 6; i++) {
rmesa->hw.mat[i].cmd[MAT_CMD_0] =
rmesa->hw.mat[i].cmd[MAT_CMD_0] =
cmdvec( RADEON_VS_MATRIX_0_ADDR + i*4, 1, 16);
}
for (i = 0 ; i < 8; i++) {
rmesa->hw.lit[i].cmd[LIT_CMD_0] =
rmesa->hw.lit[i].cmd[LIT_CMD_0] =
cmdvec( RADEON_VS_LIGHT_AMBIENT_ADDR + i, 8, 24 );
rmesa->hw.lit[i].cmd[LIT_CMD_1] =
rmesa->hw.lit[i].cmd[LIT_CMD_1] =
cmdscl( RADEON_SS_LIGHT_DCD_ADDR + i, 8, 6 );
}
for (i = 0 ; i < 6; i++) {
rmesa->hw.ucp[i].cmd[UCP_CMD_0] =
rmesa->hw.ucp[i].cmd[UCP_CMD_0] =
cmdvec( RADEON_VS_UCP_ADDR + i, 1, 4 );
}
@ -699,7 +698,7 @@ void radeonInitState( r100ContextPtr rmesa )
/* rmesa->hw.ctx.cmd[CTX_RB3D_ZSTENCILCNTL] |= RADEON_Z_HIERARCHY_ENABLE;*/
/* need this otherwise get lots of lockups with q3 ??? */
rmesa->hw.ctx.cmd[CTX_RB3D_ZSTENCILCNTL] |= RADEON_FORCE_Z_DIRTY;
}
}
}
rmesa->hw.ctx.cmd[CTX_PP_CNTL] = (RADEON_SCISSOR_ENABLE |
@ -761,13 +760,13 @@ void radeonInitState( r100ContextPtr rmesa )
rmesa->hw.lin.cmd[LIN_RE_LINE_PATTERN] = ((1 << 16) | 0xffff);
rmesa->hw.lin.cmd[LIN_RE_LINE_STATE] =
rmesa->hw.lin.cmd[LIN_RE_LINE_STATE] =
((0 << RADEON_LINE_CURRENT_PTR_SHIFT) |
(1 << RADEON_LINE_CURRENT_COUNT_SHIFT));
rmesa->hw.lin.cmd[LIN_SE_LINE_WIDTH] = (1 << 4);
rmesa->hw.msk.cmd[MSK_RB3D_STENCILREFMASK] =
rmesa->hw.msk.cmd[MSK_RB3D_STENCILREFMASK] =
((0x00 << RADEON_STENCIL_REF_SHIFT) |
(0xff << RADEON_STENCIL_MASK_SHIFT) |
(0xff << RADEON_STENCIL_WRITEMASK_SHIFT));
@ -775,7 +774,7 @@ void radeonInitState( r100ContextPtr rmesa )
rmesa->hw.msk.cmd[MSK_RB3D_ROPCNTL] = RADEON_ROP_COPY;
rmesa->hw.msk.cmd[MSK_RB3D_PLANEMASK] = 0xffffffff;
rmesa->hw.msc.cmd[MSC_RE_MISC] =
rmesa->hw.msc.cmd[MSC_RE_MISC] =
((0 << RADEON_STIPPLE_X_OFFSET_SHIFT) |
(0 << RADEON_STIPPLE_Y_OFFSET_SHIFT) |
RADEON_STIPPLE_BIG_BIT_ORDER);
@ -789,7 +788,7 @@ void radeonInitState( r100ContextPtr rmesa )
for ( i = 0 ; i < ctx->Const.MaxTextureUnits ; i++ ) {
rmesa->hw.tex[i].cmd[TEX_PP_TXFILTER] = RADEON_BORDER_MODE_OGL;
rmesa->hw.tex[i].cmd[TEX_PP_TXFORMAT] =
rmesa->hw.tex[i].cmd[TEX_PP_TXFORMAT] =
(RADEON_TXFORMAT_ENDIAN_NO_SWAP |
RADEON_TXFORMAT_PERSPECTIVE_ENABLE |
(i << 24) | /* This is one of RADEON_TXFORMAT_ST_ROUTE_STQ[012] */
@ -801,14 +800,14 @@ void radeonInitState( r100ContextPtr rmesa )
// rmesa->radeon.radeonScreen->texOffset[RADEON_LOCAL_TEX_HEAP];
rmesa->hw.tex[i].cmd[TEX_PP_BORDER_COLOR] = 0;
rmesa->hw.tex[i].cmd[TEX_PP_TXCBLEND] =
rmesa->hw.tex[i].cmd[TEX_PP_TXCBLEND] =
(RADEON_COLOR_ARG_A_ZERO |
RADEON_COLOR_ARG_B_ZERO |
RADEON_COLOR_ARG_C_CURRENT_COLOR |
RADEON_BLEND_CTL_ADD |
RADEON_SCALE_1X |
RADEON_CLAMP_TX);
rmesa->hw.tex[i].cmd[TEX_PP_TXABLEND] =
rmesa->hw.tex[i].cmd[TEX_PP_TXABLEND] =
(RADEON_ALPHA_ARG_A_ZERO |
RADEON_ALPHA_ARG_B_ZERO |
RADEON_ALPHA_ARG_C_CURRENT_ALPHA |
@ -833,12 +832,12 @@ void radeonInitState( r100ContextPtr rmesa )
/* Can only add ST1 at the time of doing some multitex but can keep
* it after that. Errors if DIFFUSE is missing.
*/
rmesa->hw.tcl.cmd[TCL_OUTPUT_VTXFMT] =
rmesa->hw.tcl.cmd[TCL_OUTPUT_VTXFMT] =
(RADEON_TCL_VTX_Z0 |
RADEON_TCL_VTX_W0 |
RADEON_TCL_VTX_PK_DIFFUSE
); /* need to keep this uptodate */
rmesa->hw.tcl.cmd[TCL_OUTPUT_VTXSEL] =
( RADEON_TCL_COMPUTE_XYZW |
(RADEON_TCL_TEX_INPUT_TEX_0 << RADEON_TCL_TEX_0_OUTPUT_SHIFT) |
@ -847,23 +846,23 @@ void radeonInitState( r100ContextPtr rmesa )
/* XXX */
rmesa->hw.tcl.cmd[TCL_MATRIX_SELECT_0] =
rmesa->hw.tcl.cmd[TCL_MATRIX_SELECT_0] =
((MODEL << RADEON_MODELVIEW_0_SHIFT) |
(MODEL_IT << RADEON_IT_MODELVIEW_0_SHIFT));
rmesa->hw.tcl.cmd[TCL_MATRIX_SELECT_1] =
rmesa->hw.tcl.cmd[TCL_MATRIX_SELECT_1] =
((MODEL_PROJ << RADEON_MODELPROJECT_0_SHIFT) |
(TEXMAT_0 << RADEON_TEXMAT_0_SHIFT) |
(TEXMAT_1 << RADEON_TEXMAT_1_SHIFT) |
(TEXMAT_2 << RADEON_TEXMAT_2_SHIFT));
rmesa->hw.tcl.cmd[TCL_UCP_VERT_BLEND_CTL] =
rmesa->hw.tcl.cmd[TCL_UCP_VERT_BLEND_CTL] =
(RADEON_UCP_IN_CLIP_SPACE |
RADEON_CULL_FRONT_IS_CCW);
rmesa->hw.tcl.cmd[TCL_TEXTURE_PROC_CTL] = 0;
rmesa->hw.tcl.cmd[TCL_TEXTURE_PROC_CTL] = 0;
rmesa->hw.tcl.cmd[TCL_LIGHT_MODEL_CTL] =
rmesa->hw.tcl.cmd[TCL_LIGHT_MODEL_CTL] =
(RADEON_SPECULAR_LIGHTS |
RADEON_DIFFUSE_SPECULAR_COMBINE |
RADEON_LOCAL_LIGHT_VEC_GL |
@ -886,14 +885,14 @@ void radeonInitState( r100ContextPtr rmesa )
ctx->Driver.Lightfv( ctx, p, GL_SPOT_CUTOFF, &l->SpotCutoff );
ctx->Driver.Lightfv( ctx, p, GL_CONSTANT_ATTENUATION,
&l->ConstantAttenuation );
ctx->Driver.Lightfv( ctx, p, GL_LINEAR_ATTENUATION,
ctx->Driver.Lightfv( ctx, p, GL_LINEAR_ATTENUATION,
&l->LinearAttenuation );
ctx->Driver.Lightfv( ctx, p, GL_QUADRATIC_ATTENUATION,
ctx->Driver.Lightfv( ctx, p, GL_QUADRATIC_ATTENUATION,
&l->QuadraticAttenuation );
*(float *)&(rmesa->hw.lit[i].cmd[LIT_ATTEN_XXX]) = 0.0;
}
ctx->Driver.LightModelfv( ctx, GL_LIGHT_MODEL_AMBIENT,
ctx->Driver.LightModelfv( ctx, GL_LIGHT_MODEL_AMBIENT,
ctx->Light.Model.Ambient );
TNL_CONTEXT(ctx)->Driver.NotifyMaterialChange( ctx );
@ -908,7 +907,7 @@ void radeonInitState( r100ContextPtr rmesa )
ctx->Driver.Fogfv( ctx, GL_FOG_END, &ctx->Fog.End );
ctx->Driver.Fogfv( ctx, GL_FOG_COLOR, ctx->Fog.Color );
ctx->Driver.Fogfv( ctx, GL_FOG_COORDINATE_SOURCE_EXT, NULL );
rmesa->hw.grd.cmd[GRD_VERT_GUARD_CLIP_ADJ] = IEEE_ONE;
rmesa->hw.grd.cmd[GRD_VERT_GUARD_DISCARD_ADJ] = IEEE_ONE;
rmesa->hw.grd.cmd[GRD_HORZ_GUARD_CLIP_ADJ] = IEEE_ONE;
@ -922,7 +921,7 @@ void radeonInitState( r100ContextPtr rmesa )
radeon_init_query_stateobj(&rmesa->radeon, R100_QUERYOBJ_CMDSIZE);
rmesa->radeon.query.queryobj.cmd[R100_QUERYOBJ_CMD_0] = CP_PACKET0(RADEON_RB3D_ZPASS_DATA, 0);
rmesa->radeon.query.queryobj.cmd[R100_QUERYOBJ_DATA_0] = 0;
rmesa->radeon.hw.all_dirty = GL_TRUE;
rcommonInitCmdBuf(&rmesa->radeon);

View file

@ -35,7 +35,6 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include "main/glheader.h"
#include "main/mtypes.h"
#include "main/enums.h"
#include "util/imports.h"
#include "main/macros.h"
#include "main/state.h"
@ -60,7 +59,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#define RADEON_MAX_TNL_VERTEX_SIZE (15 * sizeof(GLfloat)) /* for mesa _tnl stage */
/***********************************************************************
* Initialization
* Initialization
***********************************************************************/
#define EMIT_ATTR( ATTR, STYLE, F0 ) \
@ -113,19 +112,19 @@ static void radeonSetVertexFormat( struct gl_context *ctx )
if ( !rmesa->swtcl.needproj ||
(index_bitset & BITFIELD64_RANGE(_TNL_ATTRIB_TEX0, _TNL_NUM_TEX))) {
/* for projtex */
EMIT_ATTR( _TNL_ATTRIB_POS, EMIT_4F,
EMIT_ATTR( _TNL_ATTRIB_POS, EMIT_4F,
RADEON_CP_VC_FRMT_XY | RADEON_CP_VC_FRMT_Z | RADEON_CP_VC_FRMT_W0 );
offset = 4;
}
else {
EMIT_ATTR( _TNL_ATTRIB_POS, EMIT_3F,
EMIT_ATTR( _TNL_ATTRIB_POS, EMIT_3F,
RADEON_CP_VC_FRMT_XY | RADEON_CP_VC_FRMT_Z );
offset = 3;
}
rmesa->swtcl.coloroffset = offset;
#if MESA_LITTLE_ENDIAN
EMIT_ATTR( _TNL_ATTRIB_COLOR0, EMIT_4UB_4F_RGBA,
#if MESA_LITTLE_ENDIAN
EMIT_ATTR( _TNL_ATTRIB_COLOR0, EMIT_4UB_4F_RGBA,
RADEON_CP_VC_FRMT_PKCOLOR );
#else
EMIT_ATTR( _TNL_ATTRIB_COLOR0, EMIT_4UB_4F_ABGR,
@ -137,7 +136,7 @@ static void radeonSetVertexFormat( struct gl_context *ctx )
if (index_bitset &
(BITFIELD64_BIT(_TNL_ATTRIB_COLOR1) | BITFIELD64_BIT(_TNL_ATTRIB_FOG))) {
#if MESA_LITTLE_ENDIAN
#if MESA_LITTLE_ENDIAN
if (index_bitset & BITFIELD64_BIT(_TNL_ATTRIB_COLOR1)) {
rmesa->swtcl.specoffset = offset;
EMIT_ATTR( _TNL_ATTRIB_COLOR1, EMIT_3UB_3F_RGB,
@ -220,7 +219,7 @@ static void radeonSetVertexFormat( struct gl_context *ctx )
rmesa->swtcl.vertex_format = fmt_0;
rmesa->radeon.swtcl.vertex_size =
_tnl_install_attrs( ctx,
rmesa->radeon.swtcl.vertex_attrs,
rmesa->radeon.swtcl.vertex_attrs,
rmesa->radeon.swtcl.vertex_attr_count,
NULL, 0 );
rmesa->radeon.swtcl.vertex_size /= 4;
@ -277,7 +276,7 @@ void radeonChooseVertexState( struct gl_context *ctx )
GLboolean unfilled = (ctx->Polygon.FrontMode != GL_FILL ||
ctx->Polygon.BackMode != GL_FILL);
GLboolean twosided = ctx->Light.Enabled && ctx->Light.Model.TwoSide;
se_coord_fmt &= ~(RADEON_VTX_XY_PRE_MULT_1_OVER_W0 |
RADEON_VTX_Z_PRE_MULT_1_OVER_W0 |
RADEON_VTX_W0_IS_NOT_1_OVER_W0);
@ -293,7 +292,7 @@ void radeonChooseVertexState( struct gl_context *ctx )
* bigger one.
*/
if ((0 == (tnl->render_inputs_bitset &
if ((0 == (tnl->render_inputs_bitset &
(BITFIELD64_RANGE(_TNL_ATTRIB_TEX0, _TNL_NUM_TEX)
| BITFIELD64_BIT(_TNL_ATTRIB_COLOR1))))
|| twosided
@ -327,7 +326,7 @@ void r100_swtcl_flush(struct gl_context *ctx, uint32_t current_offset)
rmesa->radeon.swtcl.bo,
current_offset);
radeonEmitVbufPrim( rmesa,
rmesa->swtcl.vertex_format,
rmesa->radeon.swtcl.hw_primitive,
@ -438,7 +437,7 @@ static GLboolean radeon_run_render( struct gl_context *ctx,
radeon_print(RADEON_SWRENDER, RADEON_NORMAL,
"radeon_render.c: prim %s %d..%d\n",
_mesa_enum_to_string(prim & PRIM_MODE_MASK),
_mesa_enum_to_string(prim & PRIM_MODE_MASK),
start, start+length);
if (length)
@ -498,7 +497,7 @@ static void radeonResetLineStipple( struct gl_context *ctx );
r100ContextPtr rmesa = R100_CONTEXT(ctx); \
const char *radeonverts = (char *)rmesa->radeon.swtcl.verts;
#define VERT(x) (radeonVertex *)(radeonverts + ((x) * (vertsize) * sizeof(int)))
#define VERTEX radeonVertex
#define VERTEX radeonVertex
#undef TAG
#define TAG(x) radeon_##x
#include "tnl_dd/t_dd_triemit.h"
@ -699,7 +698,7 @@ void radeonChooseRenderState( struct gl_context *ctx )
ctx->Polygon.BackMode != GL_FILL);
GLboolean twosided = ctx->Light.Enabled && ctx->Light.Model.TwoSide;
if (!rmesa->radeon.TclFallback || rmesa->radeon.Fallback)
if (!rmesa->radeon.TclFallback || rmesa->radeon.Fallback)
return;
if (twosided)
@ -751,7 +750,7 @@ static void radeonRenderPrimitive( struct gl_context *ctx, GLenum prim )
ctx->Polygon.BackMode != GL_FILL);
rmesa->radeon.swtcl.render_primitive = prim;
if (prim < GL_TRIANGLES || !unfilled)
if (prim < GL_TRIANGLES || !unfilled)
radeonRasterPrimitive( ctx, reduced_hw_prim[prim] );
}
@ -870,9 +869,9 @@ void radeonInitSwtcl( struct gl_context *ctx )
tnl->Driver.Render.CopyPV = _tnl_copy_pv;
tnl->Driver.Render.Interp = _tnl_interp;
_tnl_init_vertices( ctx, ctx->Const.MaxArrayLockSize + 12,
_tnl_init_vertices( ctx, ctx->Const.MaxArrayLockSize + 12,
RADEON_MAX_TNL_VERTEX_SIZE);
rmesa->radeon.swtcl.verts = (GLubyte *)tnl->clipspace.vertex_buf;
rmesa->radeon.swtcl.RenderIndex = ~0;
rmesa->radeon.swtcl.render_primitive = GL_TRIANGLES;

View file

@ -33,7 +33,6 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#include "main/glheader.h"
#include "util/imports.h"
#include "main/mtypes.h"
#include "main/light.h"
#include "main/enums.h"
@ -105,7 +104,7 @@ static GLboolean discrete_prim[0x10] = {
0,
0,
};
#define LOCAL_VARS r100ContextPtr rmesa = R100_CONTEXT(ctx)
#define ELT_TYPE GLushort
@ -146,7 +145,7 @@ static GLboolean discrete_prim[0x10] = {
#define ALLOC_ELTS(nr) radeonAllocElts( rmesa, nr )
static GLushort *radeonAllocElts( r100ContextPtr rmesa, GLuint nr )
static GLushort *radeonAllocElts( r100ContextPtr rmesa, GLuint nr )
{
if (rmesa->radeon.dma.flush)
rmesa->radeon.dma.flush( &rmesa->radeon.glCtx );
@ -166,19 +165,19 @@ static GLushort *radeonAllocElts( r100ContextPtr rmesa, GLuint nr )
* discrete and there are no intervening state changes. (Somewhat
* duplicates changes to DrawArrays code)
*/
static void radeonEmitPrim( struct gl_context *ctx,
GLenum prim,
GLuint hwprim,
GLuint start,
GLuint count)
static void radeonEmitPrim( struct gl_context *ctx,
GLenum prim,
GLuint hwprim,
GLuint start,
GLuint count)
{
r100ContextPtr rmesa = R100_CONTEXT( ctx );
radeonTclPrimitive( ctx, prim, hwprim );
radeonEmitAOS( rmesa,
rmesa->radeon.tcl.aos_count,
start );
/* Why couldn't this packet have taken an offset param?
*/
radeonEmitVbufPrim( rmesa,
@ -230,7 +229,7 @@ static void radeonEmitPrim( struct gl_context *ctx,
/* External entrypoints */
/**********************************************************************/
void radeonEmitPrimitive( struct gl_context *ctx,
void radeonEmitPrimitive( struct gl_context *ctx,
GLuint first,
GLuint last,
GLuint flags )
@ -238,7 +237,7 @@ void radeonEmitPrimitive( struct gl_context *ctx,
tcl_render_tab_verts[flags&PRIM_MODE_MASK]( ctx, first, last, flags );
}
void radeonEmitEltPrimitive( struct gl_context *ctx,
void radeonEmitEltPrimitive( struct gl_context *ctx,
GLuint first,
GLuint last,
GLuint flags )
@ -246,7 +245,7 @@ void radeonEmitEltPrimitive( struct gl_context *ctx,
tcl_render_tab_elts[flags&PRIM_MODE_MASK]( ctx, first, last, flags );
}
void radeonTclPrimitive( struct gl_context *ctx,
void radeonTclPrimitive( struct gl_context *ctx,
GLenum prim,
int hw_prim )
{
@ -267,7 +266,7 @@ void radeonTclPrimitive( struct gl_context *ctx,
se_cntl = rmesa->hw.set.cmd[SET_SE_CNTL];
se_cntl &= ~RADEON_FLAT_SHADE_VTX_LAST;
if (prim == GL_POLYGON && ctx->Light.ShadeModel == GL_FLAT)
if (prim == GL_POLYGON && ctx->Light.ShadeModel == GL_FLAT)
se_cntl |= RADEON_FLAT_SHADE_VTX_0;
else
se_cntl |= RADEON_FLAT_SHADE_VTX_LAST;
@ -363,7 +362,7 @@ static GLboolean radeon_run_tcl_render( struct gl_context *ctx,
GLuint i;
GLuint emit_end;
/* TODO: separate this from the swtnl pipeline
/* TODO: separate this from the swtnl pipeline
*/
if (rmesa->radeon.TclFallback)
return GL_TRUE; /* fallback to software t&l */
@ -427,7 +426,7 @@ static GLboolean radeon_run_tcl_render( struct gl_context *ctx,
/* Initial state for tcl stage.
/* Initial state for tcl stage.
*/
const struct tnl_pipeline_stage _radeon_tcl_stage =
{
@ -463,16 +462,16 @@ static void transition_to_swtnl( struct gl_context *ctx )
radeonChooseVertexState( ctx );
radeonChooseRenderState( ctx );
_tnl_validate_shine_tables( ctx );
_tnl_validate_shine_tables( ctx );
tnl->Driver.NotifyMaterialChange =
tnl->Driver.NotifyMaterialChange =
_tnl_validate_shine_tables;
radeonReleaseArrays( ctx, ~0 );
se_cntl = rmesa->hw.set.cmd[SET_SE_CNTL];
se_cntl |= RADEON_FLAT_SHADE_VTX_LAST;
if (se_cntl != rmesa->hw.set.cmd[SET_SE_CNTL]) {
RADEON_STATECHANGE( rmesa, set );
rmesa->hw.set.cmd[SET_SE_CNTL] = se_cntl;
@ -501,14 +500,14 @@ static void transition_to_hwtnl( struct gl_context *ctx )
tnl->Driver.NotifyMaterialChange = radeonUpdateMaterial;
if ( rmesa->radeon.dma.flush )
rmesa->radeon.dma.flush( &rmesa->radeon.glCtx );
if ( rmesa->radeon.dma.flush )
rmesa->radeon.dma.flush( &rmesa->radeon.glCtx );
rmesa->radeon.dma.flush = NULL;
rmesa->swtcl.vertex_format = 0;
// if (rmesa->swtcl.indexed_verts.buf)
// radeonReleaseDmaRegion( rmesa, &rmesa->swtcl.indexed_verts,
// if (rmesa->swtcl.indexed_verts.buf)
// radeonReleaseDmaRegion( rmesa, &rmesa->swtcl.indexed_verts,
// __func__ );
if (RADEON_DEBUG & RADEON_FALLBACKS)

View file

@ -32,7 +32,6 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#include "main/glheader.h"
#include "util/imports.h"
#include "main/context.h"
#include "main/enums.h"
#include "main/image.h"
@ -51,7 +50,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
/**
* Set the texture wrap modes.
*
*
* \param t Texture object whose wrap modes are to be set
* \param swrap Wrap mode for the \a s texture coordinate
* \param twrap Wrap mode for the \a t texture coordinate
@ -158,7 +157,7 @@ static void radeonSetTexMaxAnisotropy( radeonTexObjPtr t, GLfloat max )
/**
* Set the texture magnification and minification modes.
*
*
* \param t Texture whose filter modes are to be set
* \param minf Texture minification mode
* \param magf Texture magnification mode
@ -378,13 +377,13 @@ static void radeonDeleteTexture( struct gl_context *ctx,
_mesa_delete_texture_object(ctx, texObj);
}
/* Need:
/* Need:
* - Same GEN_MODE for all active bits
* - Same EyePlane/ObjPlane for all active bits when using Eye/Obj
* - STRQ presumably all supported (matrix means incoming R values
* can end up in STQ, this has implications for vertex support,
* presumably ok if maos is used, though?)
*
*
* Basically impossible to do this on the fly - just collect some
* basic info & do the checks from ValidateState().
*/
@ -418,7 +417,7 @@ radeonNewTextureObject( struct gl_context *ctx, GLuint name, GLenum target )
t->pp_txfilter = RADEON_BORDER_MODE_OGL;
t->pp_txformat = (RADEON_TXFORMAT_ENDIAN_NO_SWAP |
RADEON_TXFORMAT_PERSPECTIVE_ENABLE);
radeonSetTexWrap( t, t->base.Sampler.WrapS, t->base.Sampler.WrapT );
radeonSetTexMaxAnisotropy( t, t->base.Sampler.MaxAnisotropy );
radeonSetTexFilter( t, t->base.Sampler.MinFilter, t->base.Sampler.MagFilter );

View file

@ -34,7 +34,6 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#include "main/glheader.h"
#include "util/imports.h"
#include "main/context.h"
#include "main/macros.h"
#include "main/teximage.h"
@ -326,7 +325,7 @@ static GLboolean radeonUpdateTextureEnv( struct gl_context *ctx, int unit )
break;
case GL_TEXTURE0:
case GL_TEXTURE1:
case GL_TEXTURE2: {
case GL_TEXTURE2: {
GLuint txunit = srcAi - GL_TEXTURE0;
if (texture_base_format(ctx->Texture.Unit[txunit]._Current) == GL_LUMINANCE)
alpha_arg[i] = radeon_zero_alpha[op+1];
@ -670,7 +669,7 @@ void radeonSetTexBuffer(__DRIcontext *pDRICtx, GLint target, __DRIdrawable *dPri
RADEON_TXFORMAT_NON_POWER2)
static void disable_tex_obj_state( r100ContextPtr rmesa,
static void disable_tex_obj_state( r100ContextPtr rmesa,
int unit )
{
RADEON_STATECHANGE( rmesa, tex[unit] );
@ -678,7 +677,7 @@ static void disable_tex_obj_state( r100ContextPtr rmesa,
RADEON_STATECHANGE( rmesa, tcl );
rmesa->hw.tcl.cmd[TCL_OUTPUT_VTXFMT] &= ~(RADEON_ST_BIT(unit) |
RADEON_Q_BIT(unit));
if (rmesa->radeon.TclFallback & (RADEON_TCL_FALLBACK_TEXGEN_0<<unit)) {
TCL_FALLBACK( &rmesa->radeon.glCtx, (RADEON_TCL_FALLBACK_TEXGEN_0<<unit), GL_FALSE);
rmesa->recheck_texgen[unit] = GL_TRUE;
@ -701,7 +700,7 @@ static void disable_tex_obj_state( r100ContextPtr rmesa,
rmesa->TexGenEnabled &= ~(RADEON_TEXMAT_0_ENABLE<<unit);
rmesa->TexGenEnabled &= ~(RADEON_TEXGEN_INPUT_MASK<<inputshift);
rmesa->TexGenNeedNormals[unit] = 0;
rmesa->TexGenEnabled |=
rmesa->TexGenEnabled |=
(RADEON_TEXGEN_INPUT_TEXCOORD_0+unit) << inputshift;
if (tmp != rmesa->TexGenEnabled) {
@ -758,7 +757,7 @@ static void import_tex_obj_state( r100ContextPtr rmesa,
}
static void set_texgen_matrix( r100ContextPtr rmesa,
static void set_texgen_matrix( r100ContextPtr rmesa,
GLuint unit,
const GLfloat *s_plane,
const GLfloat *t_plane,
@ -928,8 +927,8 @@ static GLboolean setup_hardware_state(r100ContextPtr rmesa, radeonTexObj *t, int
t->pp_txformat &= ~(RADEON_TXFORMAT_FORMAT_MASK |
RADEON_TXFORMAT_ALPHA_IN_MAP);
t->pp_txfilter &= ~RADEON_YUV_TO_RGB;
t->pp_txfilter &= ~RADEON_YUV_TO_RGB;
t->pp_txformat |= table[ firstImage->TexFormat ].format;
t->pp_txfilter |= table[ firstImage->TexFormat ].filter;
} else {
@ -941,7 +940,7 @@ static GLboolean setup_hardware_state(r100ContextPtr rmesa, radeonTexObj *t, int
t->pp_txfilter &= ~RADEON_MAX_MIP_LEVEL_MASK;
t->pp_txfilter |= (t->maxLod - t->minLod) << RADEON_MAX_MIP_LEVEL_SHIFT;
t->pp_txformat &= ~(RADEON_TXFORMAT_WIDTH_MASK |
RADEON_TXFORMAT_HEIGHT_MASK |
RADEON_TXFORMAT_CUBIC_MAP_ENABLE |
@ -1004,7 +1003,7 @@ static GLboolean radeon_validate_texture(struct gl_context *ctx, struct gl_textu
return GL_FALSE;
RADEON_STATECHANGE( rmesa, ctx );
rmesa->hw.ctx.cmd[CTX_PP_CNTL] |=
rmesa->hw.ctx.cmd[CTX_PP_CNTL] |=
(RADEON_TEX_0_ENABLE | RADEON_TEX_BLEND_0_ENABLE) << unit;
RADEON_STATECHANGE( rmesa, tcl );
rmesa->hw.tcl.cmd[TCL_OUTPUT_VTXFMT] |= RADEON_ST_BIT(unit);

View file

@ -30,7 +30,6 @@
*/
#include "main/glheader.h"
#include "util/imports.h"
#include "main/context.h"
#include "main/enums.h"
#include "main/mipmap.h"
@ -113,7 +112,7 @@ radeonAllocTextureImageBuffer(struct gl_context *ctx,
return GL_FALSE;
teximage_assign_miptree(rmesa, texobj, timage);
return GL_TRUE;
}
@ -182,7 +181,7 @@ radeon_map_texture_image(struct gl_context *ctx,
} else if (likely(mt)) {
void *base;
radeon_mipmap_level *lvl = &image->mt->levels[texImage->Level];
radeon_bo_map(mt->bo, write);
base = mt->bo->ptr + lvl->faces[image->base.Base.Face].offset;
@ -687,6 +686,6 @@ static radeon_mipmap_tree *radeon_miptree_create_for_teximage(radeonContextPtr r
return radeon_miptree_create(rmesa, texObj->Target,
texImage->TexFormat, firstLevel, lastLevel - firstLevel + 1,
width, height, depth,
width, height, depth,
t->tile_bits);
}
}

View file

@ -39,7 +39,6 @@
#include "main/fbobject.h"
#include "main/formats.h"
#include "main/framebuffer.h"
#include "util/imports.h"
#include "main/renderbuffer.h"
#include "main/version.h"
#include "main/vtxfmt.h"

View file

@ -41,7 +41,6 @@
#include "main/extensions.h"
#include "main/formats.h"
#include "main/framebuffer.h"
#include "util/imports.h"
#include "main/macros.h"
#include "main/mipmap.h"
#include "main/mtypes.h"
@ -899,7 +898,7 @@ OSMesaCreateContextAttribs(const int *attribList, OSMesaContext sharelist)
free(osmesa);
return NULL;
}
_swsetup_Wakeup( ctx );
/* use default TCL pipeline */
@ -1041,7 +1040,7 @@ OSMesaMakeCurrent( OSMesaContext osmesa, void *buffer, GLenum type,
osmesa->DataType = type;
/* Set renderbuffer fields. Set width/height = 0 to force
/* Set renderbuffer fields. Set width/height = 0 to force
* osmesa_renderbuffer_storage() being called by _mesa_resize_framebuffer()
*/
osmesa->srb->Buffer = buffer;

View file

@ -47,7 +47,6 @@
#include "main/context.h"
#include "main/config.h"
#include "main/macros.h"
#include "util/imports.h"
#include "main/mtypes.h"
#include "main/version.h"
#include "xfonts.h"
@ -1207,8 +1206,8 @@ choose_visual( Display *dpy, int screen, const int *list, GLboolean fbConfig )
stencil_size = 8;
if (accumRedSize > 0 || accumGreenSize > 0 || accumBlueSize > 0 ||
accumAlphaSize > 0) {
accumRedSize =
accumGreenSize =
accumRedSize =
accumGreenSize =
accumBlueSize = default_accum_bits();
accumAlphaSize = alpha_flag ? accumRedSize : 0;
}

View file

@ -31,7 +31,6 @@
#include <stdio.h>
#include "glxheader.h"
#include "main/context.h"
#include "util/imports.h"
#include "xfonts.h"

View file

@ -69,7 +69,6 @@
#include "main/context.h"
#include "main/extensions.h"
#include "main/framebuffer.h"
#include "util/imports.h"
#include "main/macros.h"
#include "main/renderbuffer.h"
#include "main/teximage.h"

View file

@ -32,7 +32,6 @@
#include "glxheader.h"
#include "xmesaP.h"
#include "main/errors.h"
#include "util/imports.h"
#include "main/formats.h"
#include "main/framebuffer.h"
#include "main/renderbuffer.h"
@ -43,7 +42,7 @@
#define XMESA_RENDERBUFFER 0x1234
#if defined(USE_XSHM)
#if defined(USE_XSHM)
static volatile int mesaXErrorFlag = 0;
/**
@ -177,7 +176,7 @@ alloc_back_buffer(XMesaBuffer b, GLuint width, GLuint height)
if (b->db_mode == BACK_XIMAGE) {
/* Deallocate the old backxrb->ximage, if any */
if (b->backxrb->ximage) {
#if defined(USE_XSHM)
#if defined(USE_XSHM)
if (b->shm) {
XShmDetach(b->xm_visual->display, &b->shminfo);
XDestroyImage(b->backxrb->ximage);
@ -396,7 +395,7 @@ xmesa_delete_framebuffer(struct gl_framebuffer *fb)
if (fb->Visual.doubleBufferMode) {
/* free back ximage/pixmap/shmregion */
if (b->backxrb->ximage) {
#if defined(USE_XSHM)
#if defined(USE_XSHM)
if (b->shm) {
XShmDetach( b->display, &b->shminfo );
XDestroyImage( b->backxrb->ximage );

View file

@ -37,7 +37,6 @@
#include "main/macros.h"
#include "main/mipmap.h"
#include "main/image.h"
#include "util/imports.h"
#include "main/mtypes.h"
#include "main/pbo.h"
#include "main/texformat.h"
@ -316,7 +315,7 @@ can_do_DrawPixels_8R8G8B(struct gl_context *ctx, GLenum format, GLenum type)
if (swrast->NewState)
_swrast_validate_derived( ctx );
if ((swrast->_RasterMask & ~CLIP_BIT) == 0) /* no blend, z-test, etc */ {
struct gl_renderbuffer *rb = ctx->DrawBuffer->_ColorDrawBuffers[0];
if (rb) {
@ -447,7 +446,7 @@ can_do_DrawPixels_5R6G5B(struct gl_context *ctx, GLenum format, GLenum type)
if (swrast->NewState)
_swrast_validate_derived( ctx );
if ((swrast->_RasterMask & ~CLIP_BIT) == 0) /* no blend, z-test, etc */ {
struct gl_renderbuffer *rb = ctx->DrawBuffer->_ColorDrawBuffers[0];
if (rb) {
@ -487,7 +486,7 @@ xmesa_DrawPixels_5R6G5B( struct gl_context *ctx,
if (swrast->NewState)
_swrast_validate_derived( ctx );
if (unpack->BufferObj) {
/* unpack from PBO */
GLubyte *buf;

View file

@ -32,7 +32,6 @@
#include <stdio.h>
#include "c99_math.h"
#include "util/imports.h"
#include "main/mtypes.h"
#include "glxheader.h"
#include "xmesaP.h"
@ -1021,7 +1020,7 @@ get_triangle_func(struct gl_context *ctx)
return (swrast_tri_func) NULL;
if (swrast->_RasterMask & MULTI_DRAW_BIT)
return (swrast_tri_func) NULL;
if (ctx->Polygon.CullFlag &&
if (ctx->Polygon.CullFlag &&
ctx->Polygon.CullFaceMode == GL_FRONT_AND_BACK)
return (swrast_tri_func) NULL;

View file

@ -29,7 +29,7 @@
#include "format_unpack.h"
#include "format_pack.h"
#include "framebuffer.h"
#include "util/imports.h"
#include "macros.h"
#include "state.h"
#include "mtypes.h"
@ -99,7 +99,7 @@ _mesa_clear_accum_buffer(struct gl_context *ctx)
for (j = 0; j < height; j++) {
GLshort *row = (GLshort *) accMap;
for (i = 0; i < width; i++) {
row[i * 4 + 0] = clearR;
row[i * 4 + 1] = clearG;
@ -441,7 +441,7 @@ accum(struct gl_context *ctx, GLenum op, GLfloat value)
}
void
void
_mesa_init_accum( struct gl_context *ctx )
{
/* Accumulate buffer group */

View file

@ -39,7 +39,7 @@
#include "api_arrayelt.h"
#include "bufferobj.h"
#include "context.h"
#include "util/imports.h"
#include "macros.h"
#include "mtypes.h"
#include "main/dispatch.h"

View file

@ -32,7 +32,7 @@
#include "main/glheader.h"
#include "main/context.h"
#include "main/hash.h"
#include "util/imports.h"
#include "main/macros.h"
#include "main/mtypes.h"
#include "main/arbprogram.h"
@ -158,7 +158,7 @@ _mesa_BindProgramARB(GLenum target, GLuint id)
* \note Not compiled into display lists.
* \note Called by both glDeleteProgramsNV and glDeleteProgramsARB.
*/
void GLAPIENTRY
void GLAPIENTRY
_mesa_DeleteProgramsARB(GLsizei n, const GLuint *ids)
{
GLint i;
@ -256,7 +256,7 @@ _mesa_GenProgramsARB(GLsizei n, GLuint *ids)
GLboolean GLAPIENTRY
_mesa_IsProgramARB(GLuint id)
{
struct gl_program *prog = NULL;
struct gl_program *prog = NULL;
GET_CURRENT_CONTEXT(ctx);
ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx, GL_FALSE);
@ -487,7 +487,7 @@ void GLAPIENTRY
_mesa_ProgramEnvParameter4dARB(GLenum target, GLuint index,
GLdouble x, GLdouble y, GLdouble z, GLdouble w)
{
_mesa_ProgramEnvParameter4fARB(target, index, (GLfloat) x, (GLfloat) y,
_mesa_ProgramEnvParameter4fARB(target, index, (GLfloat) x, (GLfloat) y,
(GLfloat) z, (GLfloat) w);
}
@ -500,8 +500,8 @@ void GLAPIENTRY
_mesa_ProgramEnvParameter4dvARB(GLenum target, GLuint index,
const GLdouble *params)
{
_mesa_ProgramEnvParameter4fARB(target, index, (GLfloat) params[0],
(GLfloat) params[1], (GLfloat) params[2],
_mesa_ProgramEnvParameter4fARB(target, index, (GLfloat) params[0],
(GLfloat) params[1], (GLfloat) params[2],
(GLfloat) params[3]);
}
@ -602,7 +602,7 @@ _mesa_GetProgramEnvParameterdvARB(GLenum target, GLuint index,
void GLAPIENTRY
_mesa_GetProgramEnvParameterfvARB(GLenum target, GLuint index,
_mesa_GetProgramEnvParameterfvARB(GLenum target, GLuint index,
GLfloat *params)
{
GLfloat *param;
@ -746,7 +746,7 @@ _mesa_ProgramLocalParameter4dARB(GLenum target, GLuint index,
GLdouble x, GLdouble y,
GLdouble z, GLdouble w)
{
_mesa_ProgramLocalParameter4fARB(target, index, (GLfloat) x, (GLfloat) y,
_mesa_ProgramLocalParameter4fARB(target, index, (GLfloat) x, (GLfloat) y,
(GLfloat) z, (GLfloat) w);
}

View file

@ -43,7 +43,7 @@
#include "glheader.h"
#include "hash.h"
#include "image.h"
#include "util/imports.h"
#include "context.h"
#include "bufferobj.h"
#include "arrayobj.h"
@ -1053,7 +1053,7 @@ delete_vertex_arrays(struct gl_context *ctx, GLsizei n, const GLuint *ids)
if (ctx->Array._DrawVAO == obj)
_mesa_set_draw_vao(ctx, ctx->Array._EmptyVAO, 0);
/* Unreference the array object.
/* Unreference the array object.
* If refcount hits zero, the object will be deleted.
*/
_mesa_reference_vao(ctx, &obj, NULL);

View file

@ -24,7 +24,7 @@
#include "main/glheader.h"
#include "main/context.h"
#include "main/hash.h"
#include "util/imports.h"
#include "main/macros.h"
#include "main/enums.h"
#include "main/mtypes.h"
@ -110,7 +110,7 @@ create_dst_mod_str(GLuint mod)
return ret_str;
}
static char *atifs_ops[] = {"ColorFragmentOp1ATI", "ColorFragmentOp2ATI", "ColorFragmentOp3ATI",
static char *atifs_ops[] = {"ColorFragmentOp1ATI", "ColorFragmentOp2ATI", "ColorFragmentOp3ATI",
"AlphaFragmentOp1ATI", "AlphaFragmentOp2ATI", "AlphaFragmentOp3ATI" };
static void debug_op(GLint optype, GLuint arg_count, GLenum op, GLuint dst,
@ -122,14 +122,14 @@ static void debug_op(GLint optype, GLuint arg_count, GLenum op, GLuint dst,
char *op_name;
op_name = atifs_ops[(arg_count-1)+(optype?3:0)];
fprintf(stderr, "%s(%s, %s", op_name, _mesa_enum_to_string(op),
_mesa_enum_to_string(dst));
if (optype == ATI_FRAGMENT_SHADER_COLOR_OP)
fprintf(stderr, ", %d", dstMask);
fprintf(stderr, ", %s", create_dst_mod_str(dstMod));
fprintf(stderr, ", %s, %s, %d", _mesa_enum_to_string(arg1),
_mesa_enum_to_string(arg1Rep), arg1Mod);
if (arg_count>1)

View file

@ -24,7 +24,7 @@
*/
#include "glheader.h"
#include "util/imports.h"
#include "accum.h"
#include "arrayobj.h"
#include "attrib.h"

View file

@ -77,7 +77,7 @@
#include "glheader.h"
#include "util/imports.h"
#include "accum.h"
#include "api_exec.h"
#include "api_loopback.h"

View file

@ -50,7 +50,7 @@
#include "errors.h"
#include "util/imports.h"
#include "extensions.h"
#include "mtypes.h"
#include "vbo/vbo.h"
@ -66,7 +66,7 @@ struct _glapi_table;
/** \name Visual-related functions */
/*@{*/
extern struct gl_config *
_mesa_create_visual( GLboolean dbFlag,
GLboolean stereoFlag,
@ -257,7 +257,7 @@ do { \
/**
* Macro to assert that the API call was made outside the
* glBegin()/glEnd() pair, with return value.
*
*
* \param ctx GL context.
* \param retval value to return in case the assertion fails.
*/
@ -272,7 +272,7 @@ do { \
/**
* Macro to assert that the API call was made outside the
* glBegin()/glEnd() pair.
*
*
* \param ctx GL context.
*/
#define ASSERT_OUTSIDE_BEGIN_END(ctx) \

View file

@ -23,7 +23,10 @@
*/
#include "util/imports.h"
#include <stdlib.h>
#include <string.h>
#include <assert.h>
#include "main/cpuinfo.h"

View file

@ -30,7 +30,7 @@
#include "enums.h"
#include "formats.h"
#include "hash.h"
#include "util/imports.h"
#include "macros.h"
#include "debug.h"
#include "get.h"
@ -210,7 +210,7 @@ set_debug_flags(const char *str)
/**
* Initialize debugging variables from env vars.
*/
void
void
_mesa_init_debug( struct gl_context *ctx )
{
set_debug_flags(getenv("MESA_DEBUG"));
@ -307,7 +307,7 @@ _mesa_write_renderbuffer_image(const struct gl_renderbuffer *rb)
char s[100];
GLenum format, type;
if (rb->_BaseFormat == GL_RGB ||
if (rb->_BaseFormat == GL_RGB ||
rb->_BaseFormat == GL_RGBA) {
format = GL_RGBA;
type = GL_UNSIGNED_BYTE;

View file

@ -28,7 +28,7 @@
#include "context.h"
#include "debug_output.h"
#include "enums.h"
#include "util/imports.h"
#include "hash.h"
#include "mtypes.h"
#include "version.h"

View file

@ -24,7 +24,7 @@
#include "glheader.h"
#include "util/imports.h"
#include "context.h"
#include "depth.h"
#include "enums.h"

View file

@ -31,7 +31,7 @@
#include "c99_math.h"
#include "glheader.h"
#include "util/imports.h"
#include "api_arrayelt.h"
#include "api_exec.h"
#include "api_loopback.h"

View file

@ -28,7 +28,7 @@
#include "arrayobj.h"
#include "bufferobj.h"
#include "context.h"
#include "util/imports.h"
#include "mtypes.h"
#include "pipelineobj.h"
#include "enums.h"

View file

@ -24,7 +24,7 @@
#include "main/errors.h"
#include "main/drawtex.h"
#include "main/state.h"
#include "util/imports.h"
#include "main/mtypes.h"

View file

@ -32,7 +32,7 @@
#include <stdio.h>
#include "errors.h"
#include "enums.h"
#include "util/imports.h"
#include "context.h"
#include "debug_output.h"
@ -82,8 +82,8 @@ output_if_debug(const char *prefixString, const char *outputString,
fflush(LogFile);
#if defined(_WIN32)
/* stderr from windows applications without console is not usually
* visible, so communicate with the debugger instead */
/* stderr from windows applications without console is not usually
* visible, so communicate with the debugger instead */
{
char buf[4096];
snprintf(buf, sizeof(buf), "%s: %s%s", prefixString, outputString, newline ? "\n" : "");

View file

@ -9,7 +9,7 @@
#include "context.h"
#include "depth.h"
#include "fog.h"
#include "util/imports.h"
#include "light.h"
#include "lines.h"
#include "matrix.h"

View file

@ -32,7 +32,6 @@
#include <stdio.h>
#include "util/imports.h"
#include "main/glheader.h"
#include "execmem.h"
#include "c11/threads.h"
@ -80,7 +79,7 @@ init_heap(void)
if (!exec_heap)
exec_heap = u_mmInit( 0, EXEC_HEAP_SIZE );
if (!exec_mem)
exec_mem = mmap(NULL, EXEC_HEAP_SIZE, PROT_EXEC | PROT_READ | PROT_WRITE,
MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
@ -107,24 +106,24 @@ _mesa_exec_malloc(unsigned size)
if (block)
addr = exec_mem + block->ofs;
else
else
printf("_mesa_exec_malloc failed\n");
bail:
mtx_unlock(&exec_mutex);
return addr;
}
void
void
_mesa_exec_free(void *addr)
{
mtx_lock(&exec_mutex);
if (exec_heap) {
struct mem_block *block = u_mmFindBlock(exec_heap, (unsigned char *)addr - exec_mem);
if (block)
u_mmFreeMem(block);
}
@ -145,8 +144,8 @@ _mesa_exec_malloc(unsigned size)
return malloc( size );
}
void
void
_mesa_exec_free(void *addr)
{
free(addr);

View file

@ -26,6 +26,7 @@
#ifndef EXECMEM_H
#define EXECMEM_H
#include "glheader.h"
extern void *
_mesa_exec_malloc(unsigned size);

View file

@ -31,7 +31,7 @@
#include "glheader.h"
#include "util/imports.h"
#include "context.h"
#include "extensions.h"
#include "macros.h"

View file

@ -1,10 +1,10 @@
/**************************************************************************
*
*
* Copyright 2007 VMware, Inc.
* All Rights Reserved.
* Copyright 2009 VMware, Inc. All Rights Reserved.
* Copyright © 2010-2011 Intel Corporation
*
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
@ -12,11 +12,11 @@
* distribute, sub license, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
*
* The above copyright notice and this permission notice (including the
* next paragraph) shall be included in all copies or substantial portions
* of the Software.
*
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
@ -24,12 +24,12 @@
* ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
*
**************************************************************************/
#include "main/glheader.h"
#include "main/context.h"
#include "util/imports.h"
#include "main/macros.h"
#include "main/samplerobj.h"
#include "main/shaderobj.h"
@ -503,7 +503,7 @@ static GLboolean args_match( const struct state_key *key, GLuint unit )
return GL_FALSE;
}
break;
default:
default:
return GL_FALSE; /* impossible */
}
}
@ -587,7 +587,7 @@ emit_combine(texenv_fragment_program *p,
case TEXENV_MODE_ADD_PRODUCTS_SIGNED_NV:
return add(add(mul(src[0], src[1]), mul(src[2], src[3])),
new(p->mem_ctx) ir_constant(-0.5f));
default:
default:
assert(0);
return src[0];
}
@ -606,7 +606,7 @@ emit_texenv(texenv_fragment_program *p, GLuint unit)
if (!key->unit[unit].enabled) {
return get_source(p, TEXENV_SRC_PREVIOUS, 0);
}
switch (key->unit[unit].ModeRGB) {
case TEXENV_MODE_DOT3_RGB_EXT:
alpha_shift = key->unit[unit].ScaleShiftA;
@ -621,7 +621,7 @@ emit_texenv(texenv_fragment_program *p, GLuint unit)
alpha_shift = key->unit[unit].ScaleShiftA;
break;
}
/* If we'll do rgb/alpha shifting don't saturate in emit_combine().
* We don't want to clamp twice.
*/
@ -869,7 +869,7 @@ load_texenv_source(texenv_fragment_program *p,
case TEXENV_SRC_TEXTURE7:
load_texture(p, src - TEXENV_SRC_TEXTURE0);
break;
default:
/* not a texture src - do nothing */
break;

View file

@ -42,6 +42,7 @@ string = """/*
*/
#include <stdint.h>
#include <stdlib.h>
#include "format_unpack.h"
#include "format_utils.h"

View file

@ -22,6 +22,8 @@
* OTHER DEALINGS IN THE SOFTWARE.
*/
#include <stdlib.h>
#include "errors.h"
#include "format_utils.h"
#include "glformats.h"

View file

@ -32,7 +32,7 @@
#define FORMAT_UTILS_H
#include "formats.h"
#include "util/imports.h"
#include "macros.h"
#include "util/rounding.h"
#include "util/half_float.h"

View file

@ -25,7 +25,7 @@
#include "errors.h"
#include "util/imports.h"
#include "formats.h"
#include "macros.h"
#include "glformats.h"
@ -574,7 +574,7 @@ _mesa_is_format_unsigned(mesa_format format)
bool
_mesa_is_format_signed(mesa_format format)
{
if (format == MESA_FORMAT_R11G11B10_FLOAT ||
if (format == MESA_FORMAT_R11G11B10_FLOAT ||
format == MESA_FORMAT_R9G9B9E5_FLOAT) {
/* these packed float formats only store unsigned values */
return false;

View file

@ -31,7 +31,7 @@
#include <stdio.h>
#include "glheader.h"
#include "util/imports.h"
#include "blend.h"
#include "buffers.h"
#include "context.h"

Some files were not shown because too many files have changed in this diff Show more