From 897e791ee03ce31b33efe1b7839204cf461b8df5 Mon Sep 17 00:00:00 2001 From: "Gun.io Whitespace Robot" Date: Tue, 31 Jan 2012 00:08:33 -0500 Subject: [PATCH] Remove whitespace [WhitespaceBot] --- aclocal.m4 | 4 +- configs/autoconf.in | 2 +- configs/beos | 12 +- configs/catamount-osmesa-pgi | 4 +- configs/config.mgw | 12 +- configs/default | 8 +- configs/freebsd-dri | 6 +- configs/freebsd-dri-x86 | 2 +- configs/hpux10-static | 10 +- configs/linux-dri | 4 +- configs/linux-dri-debug | 2 +- configs/linux-dri-xcb | 4 +- configs/linux-egl | 4 +- configs/linux-ia64-icc | 2 +- configs/linux-indirect | 4 +- configs/linux-static | 10 +- configs/linux-x86-64-static | 10 +- configs/linux-x86-debug | 2 +- configs/linux-x86-static | 10 +- configs/psl1ght-rsx | 4 +- configs/sunos4-static | 10 +- configure.ac | 2 +- docs/COPYING | 2 +- docs/MESA_copy_sub_buffer.spec | 2 +- docs/MESA_swap_control.spec | 4 +- docs/MESA_swap_frame_usage.spec | 4 +- docs/MESA_texture_array.spec | 38 +- docs/MESA_ycbcr_texture.spec | 6 +- docs/README.3DFX | 12 +- docs/README.AMIWIN | 42 +- docs/README.BEOS | 12 +- docs/README.CYGWIN | 20 +- docs/README.GGI | 4 +- docs/README.LYNXOS | 10 +- docs/README.MINGW32 | 24 +- docs/README.MITS | 2 +- docs/README.OS2 | 8 +- docs/README.OpenStep | 2 +- docs/README.QUAKE | 8 +- docs/README.THREADS | 2 +- docs/README.VMS | 2 +- docs/README.WIN32 | 2 +- docs/README.WINDML | 6 +- docs/RELNOTES-3.2.1 | 2 +- docs/RELNOTES-5.1 | 2 +- docs/RELNOTES-6.4 | 2 +- docs/cell.html | 2 +- docs/devinfo.html | 2 +- docs/dispatch.html | 2 +- docs/fbdev-dri.html | 4 +- docs/install.html | 4 +- docs/intro.html | 8 +- docs/lists.html | 2 +- docs/relnotes-6.4.1.html | 2 +- docs/relnotes-6.4.2.html | 2 +- docs/relnotes-6.4.html | 2 +- docs/relnotes-6.5.2.html | 2 +- docs/relnotes-7.8.3.html | 4 +- docs/repository.html | 6 +- docs/shading.html | 2 +- docs/sourcetree.html | 2 +- docs/versions.html | 2 +- docs/xlibdriver.html | 4 +- include/GL/gl.h | 4 +- include/GL/glext.h | 6 +- include/GL/glx.h | 22 +- include/GL/glx_mangle.h | 44 +- include/GL/glxext.h | 6 +- include/GL/internal/dri_interface.h | 18 +- include/GL/internal/sarea.h | 10 +- include/GL/osmesa.h | 8 +- include/GL/vms_x_fix.h | 10 +- include/GL/wglext.h | 6 +- include/GL/wmesa.h | 4 +- include/VG/openvg.h | 16 +- include/VG/vgext.h | 24 +- include/VG/vgplatform.h | 14 +- include/VG/vgu.h | 18 +- src/egl/drivers/dri2/egl_dri2.c | 36 +- src/egl/drivers/glx/egl_glx.c | 10 +- src/egl/main/egldefines.h | 10 +- src/egl/main/egldisplay.c | 4 +- src/egl/main/eglmisc.c | 10 +- src/egl/main/eglmisc.h | 10 +- src/gallium/SConscript | 20 +- src/gallium/auxiliary/SConscript | 14 +- src/gallium/auxiliary/cso_cache/cso_cache.c | 2 +- src/gallium/auxiliary/cso_cache/cso_context.c | 14 +- src/gallium/auxiliary/cso_cache/cso_hash.c | 2 +- src/gallium/auxiliary/cso_cache/cso_hash.h | 4 +- .../auxiliary/draw/draw_cliptest_tmp.h | 12 +- src/gallium/auxiliary/draw/draw_context.c | 20 +- src/gallium/auxiliary/draw/draw_context.h | 18 +- src/gallium/auxiliary/draw/draw_gs.c | 4 +- src/gallium/auxiliary/draw/draw_gs.h | 12 +- src/gallium/auxiliary/draw/draw_llvm.c | 122 +- src/gallium/auxiliary/draw/draw_pipe.c | 18 +- src/gallium/auxiliary/draw/draw_pipe.h | 12 +- src/gallium/auxiliary/draw/draw_pipe_aaline.c | 24 +- .../auxiliary/draw/draw_pipe_aapoint.c | 16 +- src/gallium/auxiliary/draw/draw_pipe_clip.c | 46 +- src/gallium/auxiliary/draw/draw_pipe_cull.c | 14 +- .../auxiliary/draw/draw_pipe_flatshade.c | 18 +- src/gallium/auxiliary/draw/draw_pipe_offset.c | 12 +- .../auxiliary/draw/draw_pipe_pstipple.c | 24 +- .../auxiliary/draw/draw_pipe_stipple.c | 18 +- .../auxiliary/draw/draw_pipe_twoside.c | 16 +- .../auxiliary/draw/draw_pipe_unfilled.c | 20 +- src/gallium/auxiliary/draw/draw_pipe_util.c | 14 +- .../auxiliary/draw/draw_pipe_validate.c | 38 +- src/gallium/auxiliary/draw/draw_pipe_vbuf.c | 90 +- .../auxiliary/draw/draw_pipe_wide_line.c | 10 +- .../auxiliary/draw/draw_pipe_wide_point.c | 16 +- src/gallium/auxiliary/draw/draw_private.h | 30 +- src/gallium/auxiliary/draw/draw_pt.c | 18 +- src/gallium/auxiliary/draw/draw_pt.h | 14 +- src/gallium/auxiliary/draw/draw_pt_emit.c | 30 +- src/gallium/auxiliary/draw/draw_pt_fetch.c | 8 +- .../auxiliary/draw/draw_pt_fetch_emit.c | 82 +- .../auxiliary/draw/draw_pt_fetch_shade_emit.c | 84 +- .../draw/draw_pt_fetch_shade_pipeline.c | 10 +- .../draw/draw_pt_fetch_shade_pipeline_llvm.c | 6 +- src/gallium/auxiliary/draw/draw_pt_post_vs.c | 4 +- src/gallium/auxiliary/draw/draw_pt_util.c | 10 +- src/gallium/auxiliary/draw/draw_vbuf.h | 12 +- src/gallium/auxiliary/draw/draw_vertex.c | 10 +- src/gallium/auxiliary/draw/draw_vertex.h | 16 +- src/gallium/auxiliary/draw/draw_vs.c | 44 +- src/gallium/auxiliary/draw/draw_vs.h | 16 +- src/gallium/auxiliary/draw/draw_vs_aos.c | 318 +-- src/gallium/auxiliary/draw/draw_vs_aos.h | 14 +- src/gallium/auxiliary/draw/draw_vs_aos_io.c | 68 +- .../auxiliary/draw/draw_vs_aos_machine.c | 40 +- src/gallium/auxiliary/draw/draw_vs_exec.c | 20 +- src/gallium/auxiliary/draw/draw_vs_llvm.c | 2 +- src/gallium/auxiliary/draw/draw_vs_ppc.c | 28 +- src/gallium/auxiliary/draw/draw_vs_sse.c | 32 +- src/gallium/auxiliary/draw/draw_vs_varient.c | 60 +- src/gallium/auxiliary/gallivm/f.cpp | 14 +- src/gallium/auxiliary/gallivm/lp_bld.h | 2 +- src/gallium/auxiliary/gallivm/lp_bld_arit.c | 64 +- src/gallium/auxiliary/gallivm/lp_bld_const.c | 10 +- src/gallium/auxiliary/gallivm/lp_bld_const.h | 4 +- src/gallium/auxiliary/gallivm/lp_bld_conv.c | 6 +- src/gallium/auxiliary/gallivm/lp_bld_flow.c | 2 +- .../auxiliary/gallivm/lp_bld_format_aos.c | 2 +- src/gallium/auxiliary/gallivm/lp_bld_init.c | 4 +- src/gallium/auxiliary/gallivm/lp_bld_logic.c | 2 +- src/gallium/auxiliary/gallivm/lp_bld_printf.c | 4 +- src/gallium/auxiliary/gallivm/lp_bld_sample.c | 2 +- .../auxiliary/gallivm/lp_bld_sample_aos.c | 2 +- .../auxiliary/gallivm/lp_bld_sample_soa.c | 6 +- .../auxiliary/gallivm/lp_bld_tgsi_aos.c | 4 +- .../auxiliary/gallivm/lp_bld_tgsi_soa.c | 14 +- src/gallium/auxiliary/gallivm/lp_bld_type.c | 8 +- src/gallium/auxiliary/indices/u_indices.c | 12 +- .../auxiliary/indices/u_unfilled_indices.c | 10 +- src/gallium/auxiliary/os/os_memory_aligned.h | 10 +- src/gallium/auxiliary/os/os_memory_debug.h | 10 +- src/gallium/auxiliary/os/os_memory_stdc.h | 10 +- src/gallium/auxiliary/os/os_memory_win32k.h | 12 +- src/gallium/auxiliary/os/os_misc.c | 30 +- src/gallium/auxiliary/os/os_thread.h | 8 +- src/gallium/auxiliary/os/os_time.c | 12 +- src/gallium/auxiliary/os/os_time.h | 2 +- src/gallium/auxiliary/pipebuffer/pb_buffer.h | 58 +- .../auxiliary/pipebuffer/pb_buffer_fenced.c | 2 +- .../auxiliary/pipebuffer/pb_buffer_fenced.h | 20 +- .../auxiliary/pipebuffer/pb_buffer_malloc.c | 34 +- src/gallium/auxiliary/pipebuffer/pb_bufmgr.h | 80 +- .../auxiliary/pipebuffer/pb_bufmgr_alt.c | 18 +- .../auxiliary/pipebuffer/pb_bufmgr_cache.c | 78 +- .../auxiliary/pipebuffer/pb_bufmgr_debug.c | 120 +- .../auxiliary/pipebuffer/pb_bufmgr_mm.c | 74 +- .../auxiliary/pipebuffer/pb_bufmgr_ondemand.c | 80 +- .../auxiliary/pipebuffer/pb_bufmgr_pool.c | 72 +- .../auxiliary/pipebuffer/pb_bufmgr_slab.c | 128 +- .../auxiliary/pipebuffer/pb_validate.c | 26 +- .../auxiliary/pipebuffer/pb_validate.h | 8 +- src/gallium/auxiliary/rtasm/rtasm_cpu.c | 4 +- src/gallium/auxiliary/rtasm/rtasm_execmem.c | 22 +- src/gallium/auxiliary/rtasm/rtasm_execmem.h | 2 +- src/gallium/auxiliary/rtasm/rtasm_ppc_spe.c | 22 +- src/gallium/auxiliary/rtasm/rtasm_ppc_spe.h | 4 +- src/gallium/auxiliary/rtasm/rtasm_x86sse.c | 78 +- src/gallium/auxiliary/tgsi/tgsi_build.c | 10 +- src/gallium/auxiliary/tgsi/tgsi_build.h | 10 +- src/gallium/auxiliary/tgsi/tgsi_dump.c | 16 +- src/gallium/auxiliary/tgsi/tgsi_dump.h | 10 +- src/gallium/auxiliary/tgsi/tgsi_exec.c | 14 +- src/gallium/auxiliary/tgsi/tgsi_exec.h | 12 +- src/gallium/auxiliary/tgsi/tgsi_info.c | 12 +- src/gallium/auxiliary/tgsi/tgsi_info.h | 10 +- src/gallium/auxiliary/tgsi/tgsi_iterate.c | 8 +- src/gallium/auxiliary/tgsi/tgsi_iterate.h | 8 +- src/gallium/auxiliary/tgsi/tgsi_opcode_tmp.h | 10 +- src/gallium/auxiliary/tgsi/tgsi_parse.c | 12 +- src/gallium/auxiliary/tgsi/tgsi_parse.h | 10 +- src/gallium/auxiliary/tgsi/tgsi_ppc.c | 20 +- src/gallium/auxiliary/tgsi/tgsi_ppc.h | 10 +- src/gallium/auxiliary/tgsi/tgsi_sanity.c | 10 +- src/gallium/auxiliary/tgsi/tgsi_sanity.h | 10 +- src/gallium/auxiliary/tgsi/tgsi_scan.c | 10 +- src/gallium/auxiliary/tgsi/tgsi_scan.h | 8 +- src/gallium/auxiliary/tgsi/tgsi_sse2.c | 106 +- src/gallium/auxiliary/tgsi/tgsi_sse2.h | 10 +- src/gallium/auxiliary/tgsi/tgsi_text.c | 10 +- src/gallium/auxiliary/tgsi/tgsi_text.h | 10 +- src/gallium/auxiliary/tgsi/tgsi_transform.c | 12 +- src/gallium/auxiliary/tgsi/tgsi_transform.h | 8 +- src/gallium/auxiliary/tgsi/tgsi_ureg.c | 58 +- src/gallium/auxiliary/tgsi/tgsi_ureg.h | 34 +- src/gallium/auxiliary/tgsi/tgsi_util.c | 10 +- src/gallium/auxiliary/tgsi/tgsi_util.h | 10 +- src/gallium/auxiliary/translate/translate.c | 10 +- src/gallium/auxiliary/translate/translate.h | 2 +- .../auxiliary/translate/translate_generic.c | 18 +- .../auxiliary/translate/translate_sse.c | 40 +- src/gallium/auxiliary/util/u_atomic.h | 4 +- src/gallium/auxiliary/util/u_bitmask.c | 74 +- src/gallium/auxiliary/util/u_bitmask.h | 40 +- src/gallium/auxiliary/util/u_blit.c | 12 +- src/gallium/auxiliary/util/u_blit.h | 2 +- src/gallium/auxiliary/util/u_cache.c | 44 +- src/gallium/auxiliary/util/u_cache.h | 6 +- src/gallium/auxiliary/util/u_clear.h | 10 +- src/gallium/auxiliary/util/u_cpu_detect.c | 4 +- src/gallium/auxiliary/util/u_cpu_detect.h | 2 +- src/gallium/auxiliary/util/u_debug.c | 82 +- src/gallium/auxiliary/util/u_debug.h | 72 +- src/gallium/auxiliary/util/u_debug_memory.c | 60 +- src/gallium/auxiliary/util/u_debug_stack.c | 34 +- src/gallium/auxiliary/util/u_debug_stack.h | 20 +- src/gallium/auxiliary/util/u_debug_symbol.c | 16 +- src/gallium/auxiliary/util/u_debug_symbol.h | 12 +- src/gallium/auxiliary/util/u_double_list.h | 16 +- src/gallium/auxiliary/util/u_draw_quad.c | 12 +- src/gallium/auxiliary/util/u_draw_quad.h | 4 +- src/gallium/auxiliary/util/u_dump.h | 12 +- src/gallium/auxiliary/util/u_dump_defines.c | 14 +- src/gallium/auxiliary/util/u_format.csv | 24 +- src/gallium/auxiliary/util/u_format.h | 28 +- src/gallium/auxiliary/util/u_format_yuv.h | 6 +- src/gallium/auxiliary/util/u_framebuffer.c | 2 +- src/gallium/auxiliary/util/u_gen_mipmap.c | 16 +- src/gallium/auxiliary/util/u_gen_mipmap.h | 4 +- src/gallium/auxiliary/util/u_handle_table.c | 78 +- src/gallium/auxiliary/util/u_handle_table.h | 22 +- src/gallium/auxiliary/util/u_hash.c | 134 +- src/gallium/auxiliary/util/u_hash.h | 4 +- src/gallium/auxiliary/util/u_hash_table.c | 52 +- src/gallium/auxiliary/util/u_hash_table.h | 6 +- src/gallium/auxiliary/util/u_inlines.h | 24 +- src/gallium/auxiliary/util/u_keymap.c | 20 +- src/gallium/auxiliary/util/u_keymap.h | 10 +- src/gallium/auxiliary/util/u_linear.c | 10 +- src/gallium/auxiliary/util/u_linear.h | 14 +- src/gallium/auxiliary/util/u_math.c | 12 +- src/gallium/auxiliary/util/u_math.h | 32 +- src/gallium/auxiliary/util/u_memory.h | 10 +- src/gallium/auxiliary/util/u_mm.c | 30 +- src/gallium/auxiliary/util/u_mm.h | 10 +- src/gallium/auxiliary/util/u_pack_color.h | 6 +- src/gallium/auxiliary/util/u_pointer.h | 10 +- src/gallium/auxiliary/util/u_rect.c | 14 +- src/gallium/auxiliary/util/u_rect.h | 10 +- src/gallium/auxiliary/util/u_ringbuffer.c | 6 +- src/gallium/auxiliary/util/u_simple_list.h | 12 +- src/gallium/auxiliary/util/u_simple_shaders.c | 16 +- src/gallium/auxiliary/util/u_simple_shaders.h | 2 +- src/gallium/auxiliary/util/u_snprintf.c | 14 +- src/gallium/auxiliary/util/u_sse.h | 6 +- src/gallium/auxiliary/util/u_string.h | 2 +- src/gallium/auxiliary/util/u_surface.c | 2 +- src/gallium/auxiliary/util/u_tile.c | 10 +- src/gallium/auxiliary/util/u_tile.h | 10 +- src/gallium/auxiliary/util/u_time.h | 12 +- src/gallium/auxiliary/util/u_transfer.c | 2 +- src/gallium/auxiliary/util/u_upload_mgr.c | 32 +- src/gallium/auxiliary/util/u_upload_mgr.h | 12 +- src/gallium/drivers/cell/common.h | 14 +- src/gallium/drivers/cell/ppu/cell_batch.c | 12 +- src/gallium/drivers/cell/ppu/cell_batch.h | 10 +- src/gallium/drivers/cell/ppu/cell_clear.c | 10 +- src/gallium/drivers/cell/ppu/cell_clear.h | 10 +- src/gallium/drivers/cell/ppu/cell_context.c | 14 +- src/gallium/drivers/cell/ppu/cell_context.h | 10 +- .../drivers/cell/ppu/cell_draw_arrays.c | 10 +- .../drivers/cell/ppu/cell_draw_arrays.h | 10 +- src/gallium/drivers/cell/ppu/cell_fence.c | 10 +- src/gallium/drivers/cell/ppu/cell_fence.h | 10 +- src/gallium/drivers/cell/ppu/cell_flush.c | 12 +- src/gallium/drivers/cell/ppu/cell_flush.h | 10 +- src/gallium/drivers/cell/ppu/cell_gen_fp.c | 26 +- src/gallium/drivers/cell/ppu/cell_gen_fp.h | 10 +- .../drivers/cell/ppu/cell_gen_fragment.c | 94 +- .../drivers/cell/ppu/cell_gen_fragment.h | 10 +- .../drivers/cell/ppu/cell_pipe_state.h | 8 +- src/gallium/drivers/cell/ppu/cell_render.c | 8 +- src/gallium/drivers/cell/ppu/cell_render.h | 8 +- src/gallium/drivers/cell/ppu/cell_screen.c | 10 +- src/gallium/drivers/cell/ppu/cell_screen.h | 12 +- src/gallium/drivers/cell/ppu/cell_spu.c | 14 +- src/gallium/drivers/cell/ppu/cell_spu.h | 10 +- src/gallium/drivers/cell/ppu/cell_state.h | 10 +- .../drivers/cell/ppu/cell_state_derived.c | 12 +- .../drivers/cell/ppu/cell_state_emit.c | 12 +- .../drivers/cell/ppu/cell_state_emit.h | 10 +- .../drivers/cell/ppu/cell_state_shader.c | 10 +- .../drivers/cell/ppu/cell_state_vertex.c | 8 +- src/gallium/drivers/cell/ppu/cell_surface.c | 10 +- src/gallium/drivers/cell/ppu/cell_surface.h | 8 +- src/gallium/drivers/cell/ppu/cell_texture.c | 30 +- src/gallium/drivers/cell/ppu/cell_texture.h | 10 +- src/gallium/drivers/cell/ppu/cell_vbuf.c | 14 +- src/gallium/drivers/cell/ppu/cell_vbuf.h | 10 +- .../drivers/cell/ppu/cell_vertex_fetch.c | 12 +- .../drivers/cell/ppu/cell_vertex_shader.c | 4 +- src/gallium/drivers/cell/spu/spu_colorpack.h | 14 +- src/gallium/drivers/cell/spu/spu_command.c | 10 +- src/gallium/drivers/cell/spu/spu_command.h | 10 +- src/gallium/drivers/cell/spu/spu_dcache.c | 4 +- src/gallium/drivers/cell/spu/spu_exec.c | 12 +- src/gallium/drivers/cell/spu/spu_exec.h | 12 +- src/gallium/drivers/cell/spu/spu_funcs.c | 10 +- src/gallium/drivers/cell/spu/spu_funcs.h | 10 +- src/gallium/drivers/cell/spu/spu_main.c | 10 +- src/gallium/drivers/cell/spu/spu_main.h | 10 +- .../drivers/cell/spu/spu_per_fragment_op.c | 8 +- .../drivers/cell/spu/spu_per_fragment_op.h | 8 +- src/gallium/drivers/cell/spu/spu_render.c | 12 +- src/gallium/drivers/cell/spu/spu_render.h | 10 +- src/gallium/drivers/cell/spu/spu_shuffle.h | 8 +- src/gallium/drivers/cell/spu/spu_texture.c | 16 +- src/gallium/drivers/cell/spu/spu_texture.h | 8 +- src/gallium/drivers/cell/spu/spu_tgsi_exec.h | 10 +- src/gallium/drivers/cell/spu/spu_tile.c | 10 +- src/gallium/drivers/cell/spu/spu_tile.h | 10 +- src/gallium/drivers/cell/spu/spu_tri.c | 26 +- src/gallium/drivers/cell/spu/spu_tri.h | 10 +- .../drivers/cell/spu/spu_vertex_fetch.c | 18 +- .../drivers/cell/spu/spu_vertex_shader.c | 18 +- .../drivers/cell/spu/spu_vertex_shader.h | 4 +- src/gallium/drivers/failover/Makefile | 2 +- src/gallium/drivers/failover/fo_context.c | 10 +- src/gallium/drivers/failover/fo_context.h | 8 +- src/gallium/drivers/failover/fo_state.c | 22 +- src/gallium/drivers/failover/fo_state_emit.c | 14 +- src/gallium/drivers/failover/fo_winsys.h | 10 +- src/gallium/drivers/galahad/glhd_context.c | 2 +- src/gallium/drivers/i915/Makefile | 2 +- src/gallium/drivers/i915/i915_batch.h | 10 +- src/gallium/drivers/i915/i915_blit.c | 16 +- src/gallium/drivers/i915/i915_blit.h | 10 +- src/gallium/drivers/i915/i915_clear.c | 10 +- src/gallium/drivers/i915/i915_context.c | 14 +- src/gallium/drivers/i915/i915_context.h | 42 +- src/gallium/drivers/i915/i915_debug.c | 80 +- src/gallium/drivers/i915/i915_debug.h | 8 +- src/gallium/drivers/i915/i915_debug_fp.c | 26 +- src/gallium/drivers/i915/i915_debug_private.h | 12 +- src/gallium/drivers/i915/i915_flush.c | 12 +- src/gallium/drivers/i915/i915_fpc.h | 12 +- src/gallium/drivers/i915/i915_fpc_emit.c | 14 +- src/gallium/drivers/i915/i915_fpc_translate.c | 60 +- src/gallium/drivers/i915/i915_prim_emit.c | 20 +- src/gallium/drivers/i915/i915_prim_vbuf.c | 24 +- src/gallium/drivers/i915/i915_reg.h | 22 +- src/gallium/drivers/i915/i915_resource.h | 10 +- .../drivers/i915/i915_resource_buffer.c | 12 +- .../drivers/i915/i915_resource_texture.c | 20 +- src/gallium/drivers/i915/i915_screen.c | 12 +- src/gallium/drivers/i915/i915_screen.h | 10 +- src/gallium/drivers/i915/i915_state.c | 18 +- src/gallium/drivers/i915/i915_state.h | 8 +- src/gallium/drivers/i915/i915_state_derived.c | 12 +- src/gallium/drivers/i915/i915_state_emit.c | 56 +- src/gallium/drivers/i915/i915_state_inlines.h | 10 +- src/gallium/drivers/i915/i915_state_sampler.c | 18 +- src/gallium/drivers/i915/i915_surface.c | 10 +- src/gallium/drivers/i915/i915_surface.h | 10 +- src/gallium/drivers/i965/brw_batchbuffer.c | 22 +- src/gallium/drivers/i965/brw_cc.c | 10 +- src/gallium/drivers/i965/brw_clip.c | 24 +- src/gallium/drivers/i965/brw_clip.h | 22 +- src/gallium/drivers/i965/brw_clip_line.c | 30 +- src/gallium/drivers/i965/brw_clip_point.c | 8 +- src/gallium/drivers/i965/brw_clip_state.c | 20 +- src/gallium/drivers/i965/brw_clip_tri.c | 90 +- src/gallium/drivers/i965/brw_clip_unfilled.c | 82 +- src/gallium/drivers/i965/brw_clip_util.c | 66 +- src/gallium/drivers/i965/brw_context.c | 8 +- src/gallium/drivers/i965/brw_context.h | 36 +- src/gallium/drivers/i965/brw_curbe.c | 26 +- src/gallium/drivers/i965/brw_defines.h | 298 +-- src/gallium/drivers/i965/brw_disasm.c | 2 +- src/gallium/drivers/i965/brw_disasm.h | 2 +- src/gallium/drivers/i965/brw_draw.c | 24 +- src/gallium/drivers/i965/brw_draw.h | 10 +- src/gallium/drivers/i965/brw_draw_upload.c | 22 +- src/gallium/drivers/i965/brw_eu.c | 16 +- src/gallium/drivers/i965/brw_eu.h | 58 +- src/gallium/drivers/i965/brw_eu_debug.c | 20 +- src/gallium/drivers/i965/brw_eu_emit.c | 142 +- src/gallium/drivers/i965/brw_eu_util.c | 18 +- src/gallium/drivers/i965/brw_gs.c | 20 +- src/gallium/drivers/i965/brw_gs.h | 14 +- src/gallium/drivers/i965/brw_gs_emit.c | 38 +- src/gallium/drivers/i965/brw_gs_state.c | 12 +- src/gallium/drivers/i965/brw_misc_state.c | 52 +- src/gallium/drivers/i965/brw_pipe_blend.c | 72 +- src/gallium/drivers/i965/brw_pipe_clear.c | 16 +- src/gallium/drivers/i965/brw_pipe_fb.c | 6 +- src/gallium/drivers/i965/brw_pipe_flush.c | 4 +- src/gallium/drivers/i965/brw_pipe_query.c | 14 +- src/gallium/drivers/i965/brw_pipe_rast.c | 12 +- src/gallium/drivers/i965/brw_pipe_sampler.c | 50 +- src/gallium/drivers/i965/brw_pipe_shader.c | 16 +- src/gallium/drivers/i965/brw_pipe_surface.c | 16 +- src/gallium/drivers/i965/brw_pipe_vertex.c | 8 +- src/gallium/drivers/i965/brw_reg.h | 10 +- src/gallium/drivers/i965/brw_resource.h | 12 +- .../drivers/i965/brw_resource_buffer.c | 34 +- .../drivers/i965/brw_resource_texture.c | 48 +- .../i965/brw_resource_texture_layout.c | 38 +- src/gallium/drivers/i965/brw_screen.c | 16 +- src/gallium/drivers/i965/brw_screen.h | 10 +- src/gallium/drivers/i965/brw_sf.c | 22 +- src/gallium/drivers/i965/brw_sf.h | 18 +- src/gallium/drivers/i965/brw_sf_emit.c | 152 +- src/gallium/drivers/i965/brw_sf_state.c | 22 +- src/gallium/drivers/i965/brw_state.h | 12 +- src/gallium/drivers/i965/brw_state_batch.c | 10 +- src/gallium/drivers/i965/brw_state_cache.c | 22 +- src/gallium/drivers/i965/brw_state_debug.c | 10 +- src/gallium/drivers/i965/brw_state_upload.c | 24 +- src/gallium/drivers/i965/brw_structs.h | 770 +++---- src/gallium/drivers/i965/brw_swtnl.c | 12 +- src/gallium/drivers/i965/brw_urb.c | 50 +- src/gallium/drivers/i965/brw_util.h | 10 +- src/gallium/drivers/i965/brw_vs.c | 14 +- src/gallium/drivers/i965/brw_vs.h | 12 +- src/gallium/drivers/i965/brw_vs_emit.c | 198 +- src/gallium/drivers/i965/brw_vs_state.c | 12 +- .../drivers/i965/brw_vs_surface_state.c | 8 +- src/gallium/drivers/i965/brw_winsys.h | 6 +- src/gallium/drivers/i965/brw_wm.c | 24 +- src/gallium/drivers/i965/brw_wm.h | 16 +- .../drivers/i965/brw_wm_constant_buffer.c | 4 +- src/gallium/drivers/i965/brw_wm_debug.c | 26 +- src/gallium/drivers/i965/brw_wm_emit.c | 178 +- src/gallium/drivers/i965/brw_wm_fp.c | 112 +- src/gallium/drivers/i965/brw_wm_glsl.c | 70 +- src/gallium/drivers/i965/brw_wm_iz.c | 140 +- src/gallium/drivers/i965/brw_wm_pass0.c | 32 +- src/gallium/drivers/i965/brw_wm_pass1.c | 38 +- src/gallium/drivers/i965/brw_wm_pass2.c | 28 +- .../drivers/i965/brw_wm_sampler_state.c | 24 +- src/gallium/drivers/i965/brw_wm_state.c | 20 +- .../drivers/i965/brw_wm_surface_state.c | 34 +- src/gallium/drivers/i965/intel_structs.h | 12 +- src/gallium/drivers/identity/id_context.c | 2 +- src/gallium/drivers/llvmpipe/SConscript | 4 +- src/gallium/drivers/llvmpipe/lp_bld_blend.h | 2 +- .../drivers/llvmpipe/lp_bld_blend_aos.c | 8 +- src/gallium/drivers/llvmpipe/lp_bld_depth.c | 4 +- src/gallium/drivers/llvmpipe/lp_bld_depth.h | 2 +- src/gallium/drivers/llvmpipe/lp_bld_interp.c | 10 +- src/gallium/drivers/llvmpipe/lp_clear.c | 12 +- src/gallium/drivers/llvmpipe/lp_clear.h | 10 +- src/gallium/drivers/llvmpipe/lp_context.c | 12 +- src/gallium/drivers/llvmpipe/lp_context.h | 16 +- src/gallium/drivers/llvmpipe/lp_debug.h | 10 +- src/gallium/drivers/llvmpipe/lp_draw_arrays.c | 10 +- src/gallium/drivers/llvmpipe/lp_fence.h | 2 +- src/gallium/drivers/llvmpipe/lp_flush.c | 10 +- src/gallium/drivers/llvmpipe/lp_flush.h | 10 +- src/gallium/drivers/llvmpipe/lp_jit.c | 2 +- src/gallium/drivers/llvmpipe/lp_limits.h | 10 +- src/gallium/drivers/llvmpipe/lp_memory.c | 10 +- src/gallium/drivers/llvmpipe/lp_memory.h | 8 +- src/gallium/drivers/llvmpipe/lp_perf.c | 4 +- src/gallium/drivers/llvmpipe/lp_query.c | 16 +- src/gallium/drivers/llvmpipe/lp_query.h | 10 +- src/gallium/drivers/llvmpipe/lp_rast.c | 8 +- src/gallium/drivers/llvmpipe/lp_rast.h | 4 +- src/gallium/drivers/llvmpipe/lp_rast_debug.c | 12 +- src/gallium/drivers/llvmpipe/lp_rast_priv.h | 22 +- src/gallium/drivers/llvmpipe/lp_rast_tri.c | 18 +- .../drivers/llvmpipe/lp_rast_tri_tmp.h | 22 +- src/gallium/drivers/llvmpipe/lp_scene.c | 4 +- src/gallium/drivers/llvmpipe/lp_scene.h | 10 +- src/gallium/drivers/llvmpipe/lp_scene_queue.c | 2 +- src/gallium/drivers/llvmpipe/lp_screen.c | 10 +- src/gallium/drivers/llvmpipe/lp_screen.h | 8 +- src/gallium/drivers/llvmpipe/lp_setup.c | 50 +- src/gallium/drivers/llvmpipe/lp_setup.h | 12 +- .../drivers/llvmpipe/lp_setup_context.h | 2 +- src/gallium/drivers/llvmpipe/lp_setup_line.c | 92 +- src/gallium/drivers/llvmpipe/lp_setup_point.c | 20 +- src/gallium/drivers/llvmpipe/lp_setup_tri.c | 60 +- src/gallium/drivers/llvmpipe/lp_setup_vbuf.c | 20 +- src/gallium/drivers/llvmpipe/lp_state.h | 10 +- src/gallium/drivers/llvmpipe/lp_state_blend.c | 8 +- src/gallium/drivers/llvmpipe/lp_state_clip.c | 8 +- .../drivers/llvmpipe/lp_state_derived.c | 16 +- src/gallium/drivers/llvmpipe/lp_state_fs.c | 38 +- src/gallium/drivers/llvmpipe/lp_state_gs.c | 10 +- .../drivers/llvmpipe/lp_state_rasterizer.c | 14 +- .../drivers/llvmpipe/lp_state_sampler.c | 8 +- src/gallium/drivers/llvmpipe/lp_state_setup.c | 58 +- src/gallium/drivers/llvmpipe/lp_state_setup.h | 6 +- .../drivers/llvmpipe/lp_state_surface.c | 8 +- .../drivers/llvmpipe/lp_state_vertex.c | 8 +- src/gallium/drivers/llvmpipe/lp_state_vs.c | 16 +- src/gallium/drivers/llvmpipe/lp_surface.c | 12 +- src/gallium/drivers/llvmpipe/lp_surface.h | 8 +- src/gallium/drivers/llvmpipe/lp_test_blend.c | 2 +- src/gallium/drivers/llvmpipe/lp_test_conv.c | 2 +- src/gallium/drivers/llvmpipe/lp_test_main.c | 2 +- src/gallium/drivers/llvmpipe/lp_tex_sample.c | 10 +- src/gallium/drivers/llvmpipe/lp_tex_sample.h | 8 +- src/gallium/drivers/llvmpipe/lp_texture.c | 18 +- src/gallium/drivers/llvmpipe/lp_texture.h | 10 +- src/gallium/drivers/llvmpipe/lp_tile_image.c | 10 +- src/gallium/drivers/llvmpipe/lp_tile_image.h | 10 +- src/gallium/drivers/llvmpipe/lp_tile_soa.h | 10 +- src/gallium/drivers/llvmpipe/sse_mathfun.h | 66 +- src/gallium/drivers/noop/noop_pipe.c | 2 +- src/gallium/drivers/nouveau/Makefile | 2 +- src/gallium/drivers/nouveau/nouveau_screen.c | 4 +- src/gallium/drivers/nv50/nv50_buffer.c | 4 +- src/gallium/drivers/nv50/nv50_pc.h | 2 +- src/gallium/drivers/nv50/nv50_pc_emit.c | 2 +- src/gallium/drivers/nv50/nv50_pc_regalloc.c | 4 +- src/gallium/drivers/nv50/nv50_program.c | 2 +- src/gallium/drivers/nv50/nv50_resource.h | 2 +- src/gallium/drivers/nv50/nv50_surface.c | 4 +- src/gallium/drivers/nv50/nv50_tgsi_to_nc.c | 8 +- src/gallium/drivers/nv50/nv50_vbo.c | 2 +- src/gallium/drivers/r300/SConscript | 4 +- src/gallium/drivers/r300/r300_emit.c | 4 +- src/gallium/drivers/r300/r300_hyperz.c | 4 +- src/gallium/drivers/r300/r300_screen_buffer.c | 2 +- src/gallium/drivers/r300/r300_state.c | 6 +- src/gallium/drivers/r300/r300_vs_draw.c | 8 +- src/gallium/drivers/r600/SConscript | 2 +- src/gallium/drivers/r600/eg_states_inc.h | 58 +- src/gallium/drivers/r600/r600_asm.c | 18 +- src/gallium/drivers/r600/r600_pipe.h | 2 +- src/gallium/drivers/r600/r600_state_inlines.h | 2 +- src/gallium/drivers/r600/r600_states_inc.h | 76 +- src/gallium/drivers/r600/r600_texture.c | 12 +- src/gallium/drivers/softpipe/sp_clear.c | 10 +- src/gallium/drivers/softpipe/sp_clear.h | 10 +- src/gallium/drivers/softpipe/sp_context.c | 18 +- src/gallium/drivers/softpipe/sp_context.h | 8 +- src/gallium/drivers/softpipe/sp_draw_arrays.c | 10 +- src/gallium/drivers/softpipe/sp_flush.c | 14 +- src/gallium/drivers/softpipe/sp_flush.h | 10 +- src/gallium/drivers/softpipe/sp_fs.h | 8 +- src/gallium/drivers/softpipe/sp_fs_exec.c | 18 +- src/gallium/drivers/softpipe/sp_fs_sse.c | 20 +- src/gallium/drivers/softpipe/sp_limits.h | 10 +- src/gallium/drivers/softpipe/sp_prim_vbuf.c | 20 +- src/gallium/drivers/softpipe/sp_prim_vbuf.h | 10 +- src/gallium/drivers/softpipe/sp_quad.h | 10 +- src/gallium/drivers/softpipe/sp_quad_blend.c | 52 +- .../drivers/softpipe/sp_quad_depth_test.c | 66 +- .../drivers/softpipe/sp_quad_depth_test_tmp.h | 14 +- src/gallium/drivers/softpipe/sp_quad_fs.c | 18 +- src/gallium/drivers/softpipe/sp_quad_pipe.c | 10 +- src/gallium/drivers/softpipe/sp_quad_pipe.h | 8 +- src/gallium/drivers/softpipe/sp_query.c | 14 +- src/gallium/drivers/softpipe/sp_query.h | 10 +- src/gallium/drivers/softpipe/sp_screen.c | 10 +- src/gallium/drivers/softpipe/sp_screen.h | 10 +- src/gallium/drivers/softpipe/sp_setup.c | 6 +- src/gallium/drivers/softpipe/sp_setup.h | 2 +- src/gallium/drivers/softpipe/sp_state.h | 8 +- src/gallium/drivers/softpipe/sp_state_blend.c | 8 +- src/gallium/drivers/softpipe/sp_state_clip.c | 8 +- .../drivers/softpipe/sp_state_derived.c | 14 +- .../drivers/softpipe/sp_state_rasterizer.c | 10 +- .../drivers/softpipe/sp_state_sampler.c | 18 +- .../drivers/softpipe/sp_state_shader.c | 16 +- .../drivers/softpipe/sp_state_surface.c | 8 +- .../drivers/softpipe/sp_state_vertex.c | 8 +- src/gallium/drivers/softpipe/sp_surface.c | 10 +- src/gallium/drivers/softpipe/sp_surface.h | 8 +- src/gallium/drivers/softpipe/sp_tex_sample.c | 76 +- src/gallium/drivers/softpipe/sp_tex_sample.h | 16 +- .../drivers/softpipe/sp_tex_tile_cache.c | 28 +- .../drivers/softpipe/sp_tex_tile_cache.h | 14 +- src/gallium/drivers/softpipe/sp_texture.c | 24 +- src/gallium/drivers/softpipe/sp_texture.h | 10 +- src/gallium/drivers/softpipe/sp_tile_cache.c | 18 +- src/gallium/drivers/softpipe/sp_tile_cache.h | 16 +- src/gallium/drivers/svga/Makefile | 2 +- src/gallium/drivers/svga/SConscript | 6 +- src/gallium/drivers/svga/svga_cmd.c | 82 +- src/gallium/drivers/svga/svga_context.c | 12 +- src/gallium/drivers/svga/svga_context.h | 22 +- src/gallium/drivers/svga/svga_debug.h | 2 +- src/gallium/drivers/svga/svga_draw.c | 30 +- src/gallium/drivers/svga/svga_draw.h | 10 +- src/gallium/drivers/svga/svga_draw_arrays.c | 42 +- src/gallium/drivers/svga/svga_draw_elements.c | 20 +- src/gallium/drivers/svga/svga_draw_private.h | 22 +- src/gallium/drivers/svga/svga_pipe_blend.c | 2 +- src/gallium/drivers/svga/svga_pipe_clear.c | 4 +- .../drivers/svga/svga_pipe_constants.c | 4 +- .../drivers/svga/svga_pipe_depthstencil.c | 2 +- src/gallium/drivers/svga/svga_pipe_draw.c | 12 +- src/gallium/drivers/svga/svga_pipe_fs.c | 8 +- src/gallium/drivers/svga/svga_pipe_misc.c | 6 +- src/gallium/drivers/svga/svga_pipe_query.c | 48 +- .../drivers/svga/svga_pipe_rasterizer.c | 12 +- src/gallium/drivers/svga/svga_pipe_sampler.c | 22 +- src/gallium/drivers/svga/svga_pipe_vertex.c | 2 +- src/gallium/drivers/svga/svga_pipe_vs.c | 12 +- src/gallium/drivers/svga/svga_resource.h | 10 +- .../drivers/svga/svga_resource_buffer.c | 48 +- .../drivers/svga/svga_resource_buffer.h | 24 +- .../svga/svga_resource_buffer_upload.c | 64 +- .../drivers/svga/svga_resource_texture.c | 38 +- .../drivers/svga/svga_resource_texture.h | 8 +- src/gallium/drivers/svga/svga_sampler_view.c | 2 +- src/gallium/drivers/svga/svga_screen.c | 16 +- src/gallium/drivers/svga/svga_screen.h | 4 +- src/gallium/drivers/svga/svga_screen_cache.c | 70 +- src/gallium/drivers/svga/svga_screen_cache.h | 30 +- src/gallium/drivers/svga/svga_state.c | 24 +- .../drivers/svga/svga_state_constants.c | 16 +- .../drivers/svga/svga_state_framebuffer.c | 40 +- src/gallium/drivers/svga/svga_state_fs.c | 16 +- .../drivers/svga/svga_state_need_swtnl.c | 18 +- src/gallium/drivers/svga/svga_state_rss.c | 16 +- src/gallium/drivers/svga/svga_state_tss.c | 20 +- src/gallium/drivers/svga/svga_state_vdecl.c | 8 +- src/gallium/drivers/svga/svga_state_vs.c | 14 +- src/gallium/drivers/svga/svga_surface.c | 14 +- src/gallium/drivers/svga/svga_swtnl_backend.c | 4 +- src/gallium/drivers/svga/svga_swtnl_draw.c | 6 +- src/gallium/drivers/svga/svga_swtnl_state.c | 18 +- src/gallium/drivers/svga/svga_tgsi.c | 20 +- src/gallium/drivers/svga/svga_tgsi.h | 2 +- .../drivers/svga/svga_tgsi_decl_sm20.c | 16 +- .../drivers/svga/svga_tgsi_decl_sm30.c | 22 +- src/gallium/drivers/svga/svga_tgsi_emit.h | 18 +- src/gallium/drivers/svga/svga_tgsi_insn.c | 166 +- src/gallium/drivers/svga/svga_winsys.h | 62 +- src/gallium/drivers/svga/svgadump/svga_dump.c | 12 +- src/gallium/drivers/svga/svgadump/svga_dump.h | 2 +- .../drivers/svga/svgadump/svga_shader.h | 2 +- .../drivers/svga/svgadump/svga_shader_dump.c | 2 +- .../drivers/svga/svgadump/svga_shader_dump.h | 2 +- .../drivers/svga/svgadump/svga_shader_op.c | 2 +- .../drivers/svga/svgadump/svga_shader_op.h | 2 +- src/gallium/drivers/trace/tr_context.h | 2 +- src/gallium/drivers/trace/tr_screen.c | 2 +- src/gallium/include/pipe/p_compiler.h | 10 +- src/gallium/include/pipe/p_config.h | 40 +- src/gallium/include/pipe/p_context.h | 10 +- src/gallium/include/pipe/p_defines.h | 20 +- src/gallium/include/pipe/p_format.h | 10 +- src/gallium/include/pipe/p_screen.h | 12 +- src/gallium/include/pipe/p_shader_tokens.h | 20 +- src/gallium/include/pipe/p_state.h | 24 +- src/gallium/include/state_tracker/sw_winsys.h | 32 +- .../state_trackers/d3d1x/gd3d10/Makefile | 2 +- .../d3d1x/gd3d11/d3d11_context.h | 4 +- .../state_trackers/dri/common/dri_drawable.c | 2 +- src/gallium/state_trackers/egl/Makefile | 2 +- .../state_trackers/egl/common/egl_g3d.c | 2 +- .../state_trackers/egl/common/egl_g3d_st.c | 2 +- .../egl/psl1ght/native_psl1ght.c | 4 +- src/gallium/state_trackers/egl/x11/glcore.h | 6 +- src/gallium/state_trackers/glx/xlib/glx_api.c | 20 +- .../state_trackers/glx/xlib/glx_getproc.c | 8 +- src/gallium/state_trackers/glx/xlib/xm_api.c | 12 +- src/gallium/state_trackers/glx/xlib/xm_api.h | 8 +- .../state_trackers/glx/xlib/xm_public.h | 12 +- src/gallium/state_trackers/glx/xlib/xm_st.c | 2 +- src/gallium/state_trackers/python/st_device.c | 58 +- src/gallium/state_trackers/python/st_device.h | 26 +- .../python/st_hardpipe_winsys.c | 22 +- src/gallium/state_trackers/python/st_sample.c | 46 +- src/gallium/state_trackers/python/st_sample.h | 12 +- .../python/st_softpipe_winsys.c | 14 +- src/gallium/state_trackers/python/st_winsys.h | 10 +- src/gallium/state_trackers/vega/api_params.c | 2 +- src/gallium/state_trackers/wgl/SConscript | 2 +- src/gallium/state_trackers/wgl/stw_context.c | 36 +- src/gallium/state_trackers/wgl/stw_device.c | 10 +- src/gallium/state_trackers/wgl/stw_device.h | 8 +- .../wgl/stw_ext_extensionsstring.c | 12 +- .../state_trackers/wgl/stw_ext_pbuffer.c | 10 +- .../state_trackers/wgl/stw_ext_pixelformat.c | 4 +- .../state_trackers/wgl/stw_ext_swapinterval.c | 10 +- .../state_trackers/wgl/stw_framebuffer.c | 58 +- .../state_trackers/wgl/stw_framebuffer.h | 48 +- .../state_trackers/wgl/stw_pixelformat.c | 50 +- .../state_trackers/wgl/stw_pixelformat.h | 12 +- src/gallium/state_trackers/wgl/stw_st.c | 2 +- src/gallium/state_trackers/wgl/stw_tls.c | 10 +- .../state_trackers/xorg/xorg_composite.c | 2 +- src/gallium/state_trackers/xorg/xorg_driver.c | 4 +- src/gallium/state_trackers/xorg/xorg_exa.c | 12 +- .../state_trackers/xorg/xorg_renderer.c | 4 +- src/gallium/state_trackers/xorg/xorg_xv.c | 2 +- src/gallium/targets/Makefile.dri | 2 +- src/gallium/targets/graw-gdi/graw_gdi.c | 2 +- src/gallium/targets/graw-null/graw_null.c | 2 +- src/gallium/targets/graw-xlib/graw_xlib.c | 4 +- src/gallium/targets/libgl-gdi/SConscript | 2 +- src/gallium/targets/libgl-gdi/libgl_gdi.c | 2 +- src/gallium/targets/libgl-xlib/Makefile | 2 +- src/gallium/targets/libgl-xlib/SConscript | 2 +- src/gallium/targets/libgl-xlib/xlib.c | 16 +- src/gallium/targets/xorg-vmwgfx/vmw_ioctl.c | 20 +- src/gallium/tests/graw/SConscript | 2 +- src/gallium/tests/graw/clear.c | 8 +- src/gallium/tests/graw/fs-test.c | 26 +- src/gallium/tests/graw/gs-test.c | 22 +- src/gallium/tests/graw/quad-tex.c | 22 +- src/gallium/tests/graw/shader-leak.c | 10 +- src/gallium/tests/graw/tri-gs.c | 12 +- src/gallium/tests/graw/tri-instanced.c | 10 +- src/gallium/tests/graw/tri.c | 10 +- src/gallium/tests/graw/vs-test.c | 24 +- src/gallium/tests/unit/SConscript | 2 +- src/gallium/winsys/i915/drm/i915_drm_buffer.c | 2 +- src/gallium/winsys/i915/sw/i915_sw_buffer.c | 2 +- src/gallium/winsys/i965/drm/i965_drm_buffer.c | 36 +- src/gallium/winsys/i965/drm/i965_drm_winsys.h | 2 +- src/gallium/winsys/i965/xlib/Makefile | 2 +- src/gallium/winsys/i965/xlib/xlib_i965.c | 54 +- src/gallium/winsys/psl1ght/Makefile | 2 +- .../winsys/psl1ght/nouveau/nouveau_bo.c | 10 +- .../winsys/psl1ght/nouveau/nouveau_grobj.c | 2 +- .../winsys/psl1ght/nouveau/nouveau_notifier.c | 2 +- .../winsys/psl1ght/nouveau/nouveau_pushbuf.h | 2 +- .../winsys/psl1ght/nouveau/nouveau_resource.c | 4 +- src/gallium/winsys/r600/drm/bof.c | 2 +- src/gallium/winsys/r600/drm/radeon_bo.c | 4 +- src/gallium/winsys/r600/drm/radeon_pciid.c | 76 +- .../winsys/radeon/drm/radeon_drm_buffer.c | 2 +- src/gallium/winsys/svga/drm/SConscript | 4 +- src/gallium/winsys/svga/drm/vmw_buffer.c | 58 +- src/gallium/winsys/svga/drm/vmw_buffer.h | 2 +- src/gallium/winsys/svga/drm/vmw_context.c | 10 +- src/gallium/winsys/svga/drm/vmw_fence.c | 4 +- src/gallium/winsys/svga/drm/vmw_fence.h | 2 +- .../winsys/svga/drm/vmw_screen_ioctl.c | 12 +- src/gallium/winsys/svga/drm/vmw_surface.h | 2 +- src/gallium/winsys/sw/gdi/gdi_sw_winsys.c | 12 +- src/gallium/winsys/sw/null/Makefile | 2 +- src/gallium/winsys/sw/null/null_sw_winsys.c | 14 +- src/gallium/winsys/sw/xlib/Makefile | 2 +- src/gallium/winsys/sw/xlib/xlib_sw_winsys.c | 16 +- src/glsl/README | 6 +- src/glsl/ast.h | 6 +- src/glsl/ast_function.cpp | 2 +- src/glsl/ast_to_hir.cpp | 2 +- src/glsl/glcpp/glcpp-lex.c | 70 +- src/glsl/glcpp/glcpp-parse.c | 26 +- src/glsl/glcpp/glcpp-parse.h | 10 +- src/glsl/glcpp/glcpp-parse.y | 16 +- src/glsl/glsl_lexer.cpp | 66 +- src/glsl/glsl_lexer.lpp | 4 +- src/glsl/glsl_parser.cpp | 12 +- src/glsl/glsl_parser.h | 10 +- src/glsl/glsl_parser.ypp | 10 +- src/glsl/glsl_parser_extras.cpp | 4 +- src/glsl/glsl_parser_extras.h | 2 +- src/glsl/glsl_symbol_table.h | 2 +- src/glsl/ir_reader.cpp | 8 +- src/glsl/list.h | 2 +- src/glu/sgi/Makefile.mgw | 12 +- src/glu/sgi/Makefile.win | 8 +- src/glu/sgi/glu.def | 2 +- src/glu/sgi/libnurbs/interface/bezierPatch.cc | 32 +- src/glu/sgi/libnurbs/interface/bezierPatch.h | 10 +- .../sgi/libnurbs/interface/bezierPatchMesh.cc | 58 +- .../sgi/libnurbs/interface/bezierPatchMesh.h | 8 +- src/glu/sgi/libnurbs/interface/glcurveval.cc | 26 +- src/glu/sgi/libnurbs/interface/glcurveval.h | 6 +- src/glu/sgi/libnurbs/interface/glinterface.cc | 70 +- src/glu/sgi/libnurbs/interface/glrenderer.h | 22 +- src/glu/sgi/libnurbs/interface/glsurfeval.cc | 24 +- src/glu/sgi/libnurbs/interface/glsurfeval.h | 46 +- src/glu/sgi/libnurbs/interface/incurveeval.cc | 28 +- src/glu/sgi/libnurbs/interface/insurfeval.cc | 214 +- src/glu/sgi/libnurbs/internals/arc.cc | 4 +- src/glu/sgi/libnurbs/internals/arc.h | 4 +- src/glu/sgi/libnurbs/internals/arcsorter.cc | 20 +- src/glu/sgi/libnurbs/internals/arcsorter.h | 4 +- src/glu/sgi/libnurbs/internals/arctess.cc | 22 +- src/glu/sgi/libnurbs/internals/backend.cc | 56 +- src/glu/sgi/libnurbs/internals/backend.h | 12 +- .../sgi/libnurbs/internals/basicsurfeval.h | 6 +- src/glu/sgi/libnurbs/internals/bin.cc | 10 +- src/glu/sgi/libnurbs/internals/bin.h | 2 +- src/glu/sgi/libnurbs/internals/bufpool.cc | 4 +- src/glu/sgi/libnurbs/internals/bufpool.h | 8 +- src/glu/sgi/libnurbs/internals/cachingeval.cc | 2 +- src/glu/sgi/libnurbs/internals/cachingeval.h | 2 +- src/glu/sgi/libnurbs/internals/ccw.cc | 28 +- .../sgi/libnurbs/internals/coveandtiler.cc | 2 +- src/glu/sgi/libnurbs/internals/curve.cc | 12 +- src/glu/sgi/libnurbs/internals/curvelist.cc | 2 +- src/glu/sgi/libnurbs/internals/curvelist.h | 2 +- src/glu/sgi/libnurbs/internals/curvesub.cc | 2 +- .../sgi/libnurbs/internals/dataTransform.cc | 14 +- src/glu/sgi/libnurbs/internals/defines.h | 2 +- src/glu/sgi/libnurbs/internals/displaylist.cc | 10 +- src/glu/sgi/libnurbs/internals/displaylist.h | 2 +- src/glu/sgi/libnurbs/internals/flist.cc | 4 +- src/glu/sgi/libnurbs/internals/flistsorter.h | 6 +- .../sgi/libnurbs/internals/gridtrimvertex.h | 2 +- src/glu/sgi/libnurbs/internals/hull.cc | 18 +- src/glu/sgi/libnurbs/internals/hull.h | 2 +- src/glu/sgi/libnurbs/internals/intersect.cc | 48 +- src/glu/sgi/libnurbs/internals/jarcloc.h | 2 +- src/glu/sgi/libnurbs/internals/knotvector.cc | 2 +- src/glu/sgi/libnurbs/internals/knotvector.h | 2 +- src/glu/sgi/libnurbs/internals/mapdesc.cc | 152 +- src/glu/sgi/libnurbs/internals/mapdesc.h | 58 +- src/glu/sgi/libnurbs/internals/mapdescv.cc | 24 +- src/glu/sgi/libnurbs/internals/maplist.cc | 14 +- src/glu/sgi/libnurbs/internals/maplist.h | 2 +- src/glu/sgi/libnurbs/internals/mesher.cc | 32 +- .../internals/monoTriangulationBackend.cc | 60 +- src/glu/sgi/libnurbs/internals/monotonizer.cc | 36 +- src/glu/sgi/libnurbs/internals/monotonizer.h | 2 +- src/glu/sgi/libnurbs/internals/mycode.cc | 8 +- src/glu/sgi/libnurbs/internals/mymath.h | 2 +- src/glu/sgi/libnurbs/internals/mysetjmp.h | 2 +- src/glu/sgi/libnurbs/internals/nurbsconsts.h | 10 +- .../sgi/libnurbs/internals/nurbsinterfac.cc | 50 +- src/glu/sgi/libnurbs/internals/nurbstess.cc | 72 +- src/glu/sgi/libnurbs/internals/nurbstess.h | 2 +- src/glu/sgi/libnurbs/internals/patch.cc | 76 +- src/glu/sgi/libnurbs/internals/patch.h | 6 +- src/glu/sgi/libnurbs/internals/patchlist.cc | 4 +- src/glu/sgi/libnurbs/internals/patchlist.h | 6 +- src/glu/sgi/libnurbs/internals/quilt.cc | 56 +- src/glu/sgi/libnurbs/internals/quilt.h | 6 +- src/glu/sgi/libnurbs/internals/reader.cc | 14 +- src/glu/sgi/libnurbs/internals/reader.h | 10 +- src/glu/sgi/libnurbs/internals/renderhints.cc | 4 +- src/glu/sgi/libnurbs/internals/simplemath.h | 6 +- src/glu/sgi/libnurbs/internals/slicer.cc | 190 +- src/glu/sgi/libnurbs/internals/sorter.h | 6 +- src/glu/sgi/libnurbs/internals/splitarcs.cc | 16 +- src/glu/sgi/libnurbs/internals/subdivider.cc | 108 +- src/glu/sgi/libnurbs/internals/subdivider.h | 4 +- src/glu/sgi/libnurbs/internals/tobezier.cc | 66 +- src/glu/sgi/libnurbs/internals/trimline.cc | 28 +- src/glu/sgi/libnurbs/internals/trimline.h | 26 +- src/glu/sgi/libnurbs/internals/trimregion.cc | 8 +- src/glu/sgi/libnurbs/internals/trimregion.h | 2 +- src/glu/sgi/libnurbs/internals/trimvertex.h | 10 +- .../sgi/libnurbs/internals/trimvertpool.cc | 8 +- src/glu/sgi/libnurbs/internals/uarray.cc | 4 +- src/glu/sgi/libnurbs/internals/uarray.h | 2 +- src/glu/sgi/libnurbs/internals/varray.cc | 14 +- src/glu/sgi/libnurbs/internals/varray.h | 4 +- src/glu/sgi/libnurbs/nurbtess/directedLine.cc | 8 +- src/glu/sgi/libnurbs/nurbtess/directedLine.h | 24 +- src/glu/sgi/libnurbs/nurbtess/gridWrap.cc | 52 +- src/glu/sgi/libnurbs/nurbtess/gridWrap.h | 14 +- src/glu/sgi/libnurbs/nurbtess/monoChain.cc | 102 +- src/glu/sgi/libnurbs/nurbtess/monoChain.h | 16 +- src/glu/sgi/libnurbs/nurbtess/monoPolyPart.cc | 24 +- src/glu/sgi/libnurbs/nurbtess/monoPolyPart.h | 2 +- .../libnurbs/nurbtess/monoTriangulation.cc | 224 +- .../sgi/libnurbs/nurbtess/monoTriangulation.h | 44 +- src/glu/sgi/libnurbs/nurbtess/partitionX.cc | 40 +- src/glu/sgi/libnurbs/nurbtess/partitionY.cc | 116 +- src/glu/sgi/libnurbs/nurbtess/partitionY.h | 16 +- src/glu/sgi/libnurbs/nurbtess/polyDBG.h | 2 +- src/glu/sgi/libnurbs/nurbtess/polyUtil.cc | 20 +- .../sgi/libnurbs/nurbtess/primitiveStream.cc | 40 +- .../sgi/libnurbs/nurbtess/primitiveStream.h | 16 +- src/glu/sgi/libnurbs/nurbtess/quicksort.cc | 12 +- src/glu/sgi/libnurbs/nurbtess/rectBlock.cc | 16 +- src/glu/sgi/libnurbs/nurbtess/rectBlock.h | 4 +- src/glu/sgi/libnurbs/nurbtess/sampleComp.cc | 38 +- src/glu/sgi/libnurbs/nurbtess/sampleComp.h | 4 +- .../sgi/libnurbs/nurbtess/sampleCompBot.cc | 108 +- src/glu/sgi/libnurbs/nurbtess/sampleCompBot.h | 8 +- .../sgi/libnurbs/nurbtess/sampleCompRight.cc | 98 +- .../sgi/libnurbs/nurbtess/sampleCompRight.h | 6 +- .../sgi/libnurbs/nurbtess/sampleCompTop.cc | 118 +- .../sgi/libnurbs/nurbtess/sampleMonoPoly.cc | 326 +-- .../sgi/libnurbs/nurbtess/sampleMonoPoly.h | 34 +- src/glu/sgi/libnurbs/nurbtess/sampledLine.cc | 20 +- src/glu/sgi/libnurbs/nurbtess/sampledLine.h | 2 +- src/glu/sgi/libnurbs/nurbtess/searchTree.cc | 42 +- src/glu/sgi/libnurbs/nurbtess/searchTree.h | 4 +- src/glu/sgi/libtess/README | 44 +- src/glu/sgi/libtess/alg-outline | 12 +- src/glu/sgi/libtess/dict-list.h | 2 +- src/glu/sgi/libtess/dict.h | 2 +- src/glu/sgi/libtess/geom.c | 8 +- src/glu/sgi/libtess/mesh.c | 18 +- src/glu/sgi/libtess/mesh.h | 2 +- src/glu/sgi/libtess/priorityq-heap.c | 6 +- src/glu/sgi/libtess/priorityq-heap.h | 2 +- src/glu/sgi/libtess/priorityq-sort.h | 2 +- src/glu/sgi/libtess/priorityq.c | 10 +- src/glu/sgi/libtess/priorityq.h | 2 +- src/glu/sgi/libtess/render.c | 24 +- src/glu/sgi/libtess/tess.c | 2 +- src/glu/sgi/libtess/tess.h | 4 +- src/glu/sgi/libtess/tessmono.c | 2 +- src/glu/sgi/libtess/tessmono.h | 2 +- src/glu/sgi/libutil/mipmap.c | 90 +- src/glu/sgi/libutil/project.c | 16 +- src/glu/sgi/libutil/registry.c | 6 +- src/glu/sgi/mesaglu.opt | 134 +- src/glw/GLwDrawA.c | 88 +- src/glw/GLwDrawA.h | 24 +- src/glw/GLwDrawAP.h | 22 +- src/glw/GLwMDrawA.c | 14 +- src/glw/GLwMDrawA.h | 14 +- src/glw/GLwMDrawAP.h | 14 +- src/glw/Makefile | 2 +- src/glw/README | 14 +- src/glx/applegl_glx.c | 2 +- src/glx/dri2.c | 2 +- src/glx/dri2_glx.c | 4 +- src/glx/dri_glx.c | 4 +- src/glx/glx_pbuffer.c | 10 +- src/glx/glxclient.h | 2 +- src/glx/glxcmds.c | 8 +- src/glx/glxconfig.c | 4 +- src/glx/glxconfig.h | 2 +- src/glx/glxext.c | 12 +- src/glx/glxextensions.h | 2 +- src/glx/indirect.c | 6 +- src/glx/indirect.h | 6 +- src/glx/indirect_glx.c | 4 +- src/glx/indirect_init.c | 6 +- src/glx/indirect_size.c | 6 +- src/glx/indirect_size.h | 6 +- src/glx/indirect_vertex_array.h | 6 +- src/glx/indirect_vertex_array_priv.h | 24 +- src/glx/indirect_vertex_program.c | 8 +- src/glx/indirect_window_pos.c | 6 +- src/glx/pixel.c | 2 +- src/glx/pixelstore.c | 2 +- src/glx/renderpix.c | 8 +- src/mapi/glapi/SConscript | 16 +- src/mapi/glapi/gen/gl_API.dtd | 4 +- src/mapi/glapi/glapi_entrypoint.c | 2 +- src/mapi/glapi/glapi_getproc.c | 12 +- src/mapi/glapi/glapi_sparc.S | 6 +- src/mapi/glapi/glapi_x86-64.S | 6 +- src/mapi/glapi/glapi_x86.S | 6 +- src/mapi/glapi/glapitable.h | 6 +- src/mapi/glapi/glapitemp.h | 6 +- src/mapi/glapi/glprocs.h | 6 +- src/mapi/mapi/entry.c | 2 +- src/mapi/mapi/stub.c | 2 +- src/mapi/mapi/table.c | 2 +- src/mapi/mapi/u_current.c | 2 +- src/mapi/mapi/u_thread.h | 2 +- src/mapi/vgapi/vgapi.csv | 2 +- src/mesa/Makefile.mgw | 16 +- src/mesa/drivers/beos/GLView.cpp | 98 +- src/mesa/drivers/beos/Makefile | 4 +- src/mesa/drivers/common/driverfuncs.c | 2 +- src/mesa/drivers/common/meta.c | 6 +- src/mesa/drivers/dri/Makefile.template | 4 +- src/mesa/drivers/dri/common/dri_metaops.h | 4 +- src/mesa/drivers/dri/common/dri_util.c | 60 +- src/mesa/drivers/dri/common/dri_util.h | 42 +- src/mesa/drivers/dri/common/drirenderbuffer.h | 2 +- src/mesa/drivers/dri/common/spantmp.h | 6 +- src/mesa/drivers/dri/common/spantmp2.h | 10 +- src/mesa/drivers/dri/common/stenciltmp.h | 8 +- src/mesa/drivers/dri/common/texmem.c | 74 +- src/mesa/drivers/dri/common/texmem.h | 28 +- src/mesa/drivers/dri/common/utils.c | 48 +- src/mesa/drivers/dri/common/utils.h | 4 +- src/mesa/drivers/dri/common/vblank.c | 24 +- src/mesa/drivers/dri/common/xmlconfig.c | 10 +- src/mesa/drivers/dri/common/xmlconfig.h | 14 +- src/mesa/drivers/dri/common/xmlpool.h | 8 +- src/mesa/drivers/dri/common/xmlpool/Makefile | 2 +- src/mesa/drivers/dri/common/xmlpool/options.h | 8 +- .../drivers/dri/common/xmlpool/t_options.h | 8 +- src/mesa/drivers/dri/i810/Makefile | 2 +- src/mesa/drivers/dri/i810/i810context.c | 10 +- src/mesa/drivers/dri/i810/i810context.h | 38 +- src/mesa/drivers/dri/i810/i810ioctl.c | 90 +- src/mesa/drivers/dri/i810/i810ioctl.h | 4 +- src/mesa/drivers/dri/i810/i810render.c | 2 +- src/mesa/drivers/dri/i810/i810screen.c | 2 +- src/mesa/drivers/dri/i810/i810span.c | 2 +- src/mesa/drivers/dri/i810/i810state.c | 8 +- src/mesa/drivers/dri/i810/i810tex.c | 58 +- src/mesa/drivers/dri/i810/i810tex.h | 16 +- src/mesa/drivers/dri/i810/i810texmem.c | 22 +- src/mesa/drivers/dri/i810/i810texstate.c | 56 +- src/mesa/drivers/dri/i810/i810tris.c | 16 +- src/mesa/drivers/dri/i810/i810vb.c | 2 +- src/mesa/drivers/dri/i810/server/i810_dri.h | 2 +- src/mesa/drivers/dri/i810/server/i810_reg.h | 30 +- src/mesa/drivers/dri/i915/Makefile | 2 +- src/mesa/drivers/dri/i915/i830_context.c | 10 +- src/mesa/drivers/dri/i915/i830_context.h | 10 +- src/mesa/drivers/dri/i915/i830_reg.h | 10 +- src/mesa/drivers/dri/i915/i830_state.c | 36 +- src/mesa/drivers/dri/i915/i830_texblend.c | 14 +- src/mesa/drivers/dri/i915/i830_texstate.c | 16 +- src/mesa/drivers/dri/i915/i830_vtbl.c | 16 +- src/mesa/drivers/dri/i915/i915_context.c | 10 +- src/mesa/drivers/dri/i915/i915_context.h | 12 +- src/mesa/drivers/dri/i915/i915_debug.c | 78 +- src/mesa/drivers/dri/i915/i915_debug.h | 10 +- src/mesa/drivers/dri/i915/i915_debug_fp.c | 10 +- src/mesa/drivers/dri/i915/i915_fragprog.c | 34 +- src/mesa/drivers/dri/i915/i915_program.c | 22 +- src/mesa/drivers/dri/i915/i915_program.h | 14 +- src/mesa/drivers/dri/i915/i915_reg.h | 24 +- src/mesa/drivers/dri/i915/i915_state.c | 30 +- src/mesa/drivers/dri/i915/i915_tex_layout.c | 10 +- src/mesa/drivers/dri/i915/i915_texstate.c | 20 +- src/mesa/drivers/dri/i915/i915_vtbl.c | 18 +- src/mesa/drivers/dri/i915/intel_render.c | 12 +- src/mesa/drivers/dri/i915/intel_tris.c | 14 +- src/mesa/drivers/dri/i915/intel_tris.h | 10 +- src/mesa/drivers/dri/i965/Makefile | 2 +- src/mesa/drivers/dri/i965/brw_cc.c | 8 +- src/mesa/drivers/dri/i965/brw_clip.c | 32 +- src/mesa/drivers/dri/i965/brw_clip.h | 20 +- src/mesa/drivers/dri/i965/brw_clip_line.c | 30 +- src/mesa/drivers/dri/i965/brw_clip_point.c | 8 +- src/mesa/drivers/dri/i965/brw_clip_state.c | 12 +- src/mesa/drivers/dri/i965/brw_clip_tri.c | 88 +- src/mesa/drivers/dri/i965/brw_clip_unfilled.c | 82 +- src/mesa/drivers/dri/i965/brw_clip_util.c | 58 +- src/mesa/drivers/dri/i965/brw_context.c | 10 +- src/mesa/drivers/dri/i965/brw_context.h | 28 +- src/mesa/drivers/dri/i965/brw_curbe.c | 18 +- src/mesa/drivers/dri/i965/brw_defines.h | 298 +-- src/mesa/drivers/dri/i965/brw_draw.c | 36 +- src/mesa/drivers/dri/i965/brw_draw.h | 10 +- src/mesa/drivers/dri/i965/brw_draw_upload.c | 22 +- src/mesa/drivers/dri/i965/brw_eu.c | 16 +- src/mesa/drivers/dri/i965/brw_eu.h | 56 +- src/mesa/drivers/dri/i965/brw_eu_debug.c | 20 +- src/mesa/drivers/dri/i965/brw_eu_emit.c | 78 +- src/mesa/drivers/dri/i965/brw_eu_util.c | 18 +- src/mesa/drivers/dri/i965/brw_fallback.c | 14 +- src/mesa/drivers/dri/i965/brw_fallback.h | 10 +- src/mesa/drivers/dri/i965/brw_gs.c | 22 +- src/mesa/drivers/dri/i965/brw_gs.h | 14 +- src/mesa/drivers/dri/i965/brw_gs_emit.c | 28 +- src/mesa/drivers/dri/i965/brw_gs_state.c | 10 +- src/mesa/drivers/dri/i965/brw_misc_state.c | 28 +- src/mesa/drivers/dri/i965/brw_optimize.c | 4 +- src/mesa/drivers/dri/i965/brw_program.c | 24 +- src/mesa/drivers/dri/i965/brw_queryobj.c | 8 +- src/mesa/drivers/dri/i965/brw_sf.c | 24 +- src/mesa/drivers/dri/i965/brw_sf.h | 20 +- src/mesa/drivers/dri/i965/brw_sf_emit.c | 114 +- src/mesa/drivers/dri/i965/brw_sf_state.c | 20 +- src/mesa/drivers/dri/i965/brw_state.h | 10 +- src/mesa/drivers/dri/i965/brw_state_batch.c | 10 +- src/mesa/drivers/dri/i965/brw_state_cache.c | 8 +- src/mesa/drivers/dri/i965/brw_state_dump.c | 4 +- src/mesa/drivers/dri/i965/brw_state_upload.c | 18 +- src/mesa/drivers/dri/i965/brw_structs.h | 774 +++---- src/mesa/drivers/dri/i965/brw_tex.c | 10 +- src/mesa/drivers/dri/i965/brw_tex_layout.c | 8 +- src/mesa/drivers/dri/i965/brw_urb.c | 42 +- src/mesa/drivers/dri/i965/brw_util.c | 76 +- src/mesa/drivers/dri/i965/brw_util.h | 10 +- src/mesa/drivers/dri/i965/brw_vs.c | 14 +- src/mesa/drivers/dri/i965/brw_vs.h | 12 +- src/mesa/drivers/dri/i965/brw_vs_constval.c | 24 +- src/mesa/drivers/dri/i965/brw_vs_emit.c | 174 +- src/mesa/drivers/dri/i965/brw_vs_state.c | 10 +- src/mesa/drivers/dri/i965/brw_vtbl.c | 14 +- src/mesa/drivers/dri/i965/brw_wm.c | 20 +- src/mesa/drivers/dri/i965/brw_wm.h | 14 +- src/mesa/drivers/dri/i965/brw_wm_debug.c | 20 +- src/mesa/drivers/dri/i965/brw_wm_emit.c | 96 +- src/mesa/drivers/dri/i965/brw_wm_fp.c | 98 +- src/mesa/drivers/dri/i965/brw_wm_iz.c | 138 +- src/mesa/drivers/dri/i965/brw_wm_pass0.c | 46 +- src/mesa/drivers/dri/i965/brw_wm_pass1.c | 36 +- src/mesa/drivers/dri/i965/brw_wm_pass2.c | 26 +- .../drivers/dri/i965/brw_wm_sampler_state.c | 40 +- src/mesa/drivers/dri/i965/brw_wm_state.c | 18 +- .../drivers/dri/i965/brw_wm_surface_state.c | 38 +- src/mesa/drivers/dri/i965/gen6_sf_state.c | 2 +- .../drivers/dri/intel/intel_batchbuffer.c | 10 +- src/mesa/drivers/dri/intel/intel_blit.c | 10 +- src/mesa/drivers/dri/intel/intel_blit.h | 10 +- .../drivers/dri/intel/intel_buffer_objects.c | 10 +- .../drivers/dri/intel/intel_buffer_objects.h | 12 +- src/mesa/drivers/dri/intel/intel_buffers.c | 12 +- src/mesa/drivers/dri/intel/intel_buffers.h | 10 +- src/mesa/drivers/dri/intel/intel_clear.c | 10 +- src/mesa/drivers/dri/intel/intel_clear.h | 10 +- src/mesa/drivers/dri/intel/intel_context.c | 20 +- src/mesa/drivers/dri/intel/intel_context.h | 14 +- src/mesa/drivers/dri/intel/intel_extensions.c | 10 +- src/mesa/drivers/dri/intel/intel_extensions.h | 10 +- .../drivers/dri/intel/intel_extensions_es2.c | 10 +- src/mesa/drivers/dri/intel/intel_fbo.c | 14 +- src/mesa/drivers/dri/intel/intel_fbo.h | 10 +- .../drivers/dri/intel/intel_mipmap_tree.c | 14 +- .../drivers/dri/intel/intel_mipmap_tree.h | 16 +- src/mesa/drivers/dri/intel/intel_pixel.c | 10 +- src/mesa/drivers/dri/intel/intel_pixel.h | 10 +- .../drivers/dri/intel/intel_pixel_bitmap.c | 24 +- src/mesa/drivers/dri/intel/intel_pixel_copy.c | 12 +- src/mesa/drivers/dri/intel/intel_pixel_draw.c | 10 +- src/mesa/drivers/dri/intel/intel_reg.h | 10 +- src/mesa/drivers/dri/intel/intel_regions.c | 14 +- src/mesa/drivers/dri/intel/intel_regions.h | 12 +- src/mesa/drivers/dri/intel/intel_screen.c | 16 +- src/mesa/drivers/dri/intel/intel_screen.h | 10 +- src/mesa/drivers/dri/intel/intel_span.c | 10 +- src/mesa/drivers/dri/intel/intel_span.h | 10 +- src/mesa/drivers/dri/intel/intel_state.c | 26 +- src/mesa/drivers/dri/intel/intel_tex.c | 2 +- src/mesa/drivers/dri/intel/intel_tex.h | 10 +- src/mesa/drivers/dri/intel/intel_tex_copy.c | 16 +- src/mesa/drivers/dri/intel/intel_tex_image.c | 16 +- src/mesa/drivers/dri/intel/intel_tex_layout.c | 10 +- src/mesa/drivers/dri/intel/intel_tex_layout.h | 10 +- src/mesa/drivers/dri/intel/intel_tex_obj.h | 12 +- .../drivers/dri/intel/intel_tex_subimage.c | 12 +- .../drivers/dri/intel/intel_tex_validate.c | 8 +- src/mesa/drivers/dri/mach64/Makefile | 2 +- src/mesa/drivers/dri/mach64/mach64_context.c | 12 +- src/mesa/drivers/dri/mach64/mach64_context.h | 2 +- src/mesa/drivers/dri/mach64/mach64_dd.c | 2 +- src/mesa/drivers/dri/mach64/mach64_ioctl.c | 24 +- src/mesa/drivers/dri/mach64/mach64_lock.c | 2 +- .../drivers/dri/mach64/mach64_native_vb.c | 40 +- .../drivers/dri/mach64/mach64_native_vbtmp.h | 46 +- src/mesa/drivers/dri/mach64/mach64_screen.c | 10 +- src/mesa/drivers/dri/mach64/mach64_state.c | 16 +- src/mesa/drivers/dri/mach64/mach64_tex.c | 4 +- src/mesa/drivers/dri/mach64/mach64_texmem.c | 4 +- src/mesa/drivers/dri/mach64/mach64_texstate.c | 40 +- src/mesa/drivers/dri/mach64/mach64_tris.c | 136 +- src/mesa/drivers/dri/mach64/mach64_vb.c | 4 +- src/mesa/drivers/dri/mach64/mach64_vbtmp.h | 56 +- src/mesa/drivers/dri/mga/Doxyfile | 78 +- src/mesa/drivers/dri/mga/Makefile | 4 +- src/mesa/drivers/dri/mga/mga_texcombine.c | 6 +- src/mesa/drivers/dri/mga/mga_texstate.c | 36 +- src/mesa/drivers/dri/mga/mga_xmesa.c | 46 +- src/mesa/drivers/dri/mga/mga_xmesa.h | 2 +- src/mesa/drivers/dri/mga/mgacontext.h | 24 +- src/mesa/drivers/dri/mga/mgadd.c | 2 +- src/mesa/drivers/dri/mga/mgaioctl.c | 18 +- src/mesa/drivers/dri/mga/mgaioctl.h | 4 +- src/mesa/drivers/dri/mga/mgaregs.h | 888 +++---- src/mesa/drivers/dri/mga/mgarender.c | 22 +- src/mesa/drivers/dri/mga/mgaspan.c | 2 +- src/mesa/drivers/dri/mga/mgastate.c | 42 +- src/mesa/drivers/dri/mga/mgatex.c | 18 +- src/mesa/drivers/dri/mga/mgatexmem.c | 18 +- src/mesa/drivers/dri/mga/mgatris.c | 78 +- src/mesa/drivers/dri/mga/mgavb.c | 30 +- src/mesa/drivers/dri/mga/mgavb.h | 8 +- src/mesa/drivers/dri/mga/server/mga_macros.h | 2 +- src/mesa/drivers/dri/r128/Makefile | 4 +- src/mesa/drivers/dri/r128/r128_context.c | 2 +- src/mesa/drivers/dri/r128/r128_context.h | 8 +- src/mesa/drivers/dri/r128/r128_ioctl.c | 2 +- src/mesa/drivers/dri/r128/r128_ioctl.h | 2 +- src/mesa/drivers/dri/r128/r128_screen.c | 6 +- src/mesa/drivers/dri/r128/r128_state.c | 18 +- src/mesa/drivers/dri/r128/r128_tex.c | 4 +- src/mesa/drivers/dri/r128/r128_texmem.c | 6 +- src/mesa/drivers/dri/r128/r128_texstate.c | 10 +- src/mesa/drivers/dri/r128/r128_tris.c | 28 +- src/mesa/drivers/dri/r128/server/r128.h | 8 +- src/mesa/drivers/dri/r200/Doxyfile | 78 +- src/mesa/drivers/dri/r200/Makefile | 2 +- src/mesa/drivers/dri/r200/r200_cmdbuf.c | 28 +- src/mesa/drivers/dri/r200/r200_context.c | 12 +- src/mesa/drivers/dri/r200/r200_context.h | 26 +- src/mesa/drivers/dri/r200/r200_ioctl.h | 6 +- src/mesa/drivers/dri/r200/r200_maos.c | 2 +- src/mesa/drivers/dri/r200/r200_maos_arrays.c | 2 +- src/mesa/drivers/dri/r200/r200_reg.h | 102 +- src/mesa/drivers/dri/r200/r200_sanity.c | 120 +- src/mesa/drivers/dri/r200/r200_state_init.c | 150 +- src/mesa/drivers/dri/r200/r200_swtcl.h | 4 +- src/mesa/drivers/dri/r200/r200_tcl.c | 40 +- src/mesa/drivers/dri/r200/r200_tcl.h | 2 +- src/mesa/drivers/dri/r200/r200_tex.c | 14 +- src/mesa/drivers/dri/r200/r200_texstate.c | 34 +- src/mesa/drivers/dri/r200/r200_vertprog.c | 14 +- src/mesa/drivers/dri/r200/r200_vertprog.h | 2 +- .../drivers/dri/r300/compiler/r500_fragprog.c | 10 +- .../dri/r300/compiler/r500_fragprog_emit.c | 2 +- .../dri/r300/compiler/radeon_opcodes.h | 2 +- .../dri/r300/compiler/radeon_optimize.c | 2 +- src/mesa/drivers/dri/r300/r300_blit.c | 2 +- src/mesa/drivers/dri/r300/r300_render.c | 2 +- src/mesa/drivers/dri/r300/r300_state.c | 2 +- src/mesa/drivers/dri/r300/r300_texstate.c | 4 +- src/mesa/drivers/dri/r600/evergreen_chip.c | 646 +++--- src/mesa/drivers/dri/r600/evergreen_chip.h | 766 +++--- src/mesa/drivers/dri/r600/evergreen_diff.h | 72 +- .../drivers/dri/r600/evergreen_fragprog.c | 64 +- .../drivers/dri/r600/evergreen_fragprog.h | 4 +- src/mesa/drivers/dri/r600/evergreen_ioctl.c | 2 +- src/mesa/drivers/dri/r600/evergreen_off.h | 1576 ++++++------- src/mesa/drivers/dri/r600/evergreen_oglprog.c | 26 +- src/mesa/drivers/dri/r600/evergreen_oglprog.h | 2 +- src/mesa/drivers/dri/r600/evergreen_render.c | 90 +- src/mesa/drivers/dri/r600/evergreen_sq.h | 20 +- src/mesa/drivers/dri/r600/evergreen_state.c | 230 +- src/mesa/drivers/dri/r600/evergreen_tex.c | 284 +-- .../drivers/dri/r600/evergreen_vertprog.c | 72 +- .../drivers/dri/r600/evergreen_vertprog.h | 8 +- src/mesa/drivers/dri/r600/r600_cmdbuf.c | 8 +- src/mesa/drivers/dri/r600/r600_cmdbuf.h | 2 +- src/mesa/drivers/dri/r600/r600_context.c | 6 +- src/mesa/drivers/dri/r600/r600_context.h | 4 +- src/mesa/drivers/dri/r600/r600_emit.c | 6 +- src/mesa/drivers/dri/r600/r600_emit.h | 10 +- src/mesa/drivers/dri/r600/r600_reg.h | 6 +- src/mesa/drivers/dri/r600/r600_texstate.c | 8 +- src/mesa/drivers/dri/r600/r700_assembler.c | 2044 ++++++++--------- src/mesa/drivers/dri/r600/r700_assembler.h | 108 +- src/mesa/drivers/dri/r600/r700_chip.c | 22 +- src/mesa/drivers/dri/r600/r700_chip.h | 14 +- src/mesa/drivers/dri/r600/r700_clear.c | 2 +- src/mesa/drivers/dri/r600/r700_fragprog.c | 40 +- src/mesa/drivers/dri/r600/r700_fragprog.h | 4 +- src/mesa/drivers/dri/r600/r700_oglprog.c | 24 +- src/mesa/drivers/dri/r600/r700_render.c | 88 +- src/mesa/drivers/dri/r600/r700_shader.c | 80 +- src/mesa/drivers/dri/r600/r700_shader.h | 34 +- src/mesa/drivers/dri/r600/r700_shaderinst.c | 16 +- src/mesa/drivers/dri/r600/r700_shaderinst.h | 50 +- src/mesa/drivers/dri/r600/r700_state.c | 4 +- src/mesa/drivers/dri/r600/r700_vertprog.c | 54 +- src/mesa/drivers/dri/r600/r700_vertprog.h | 8 +- src/mesa/drivers/dri/radeon/Makefile | 2 +- src/mesa/drivers/dri/radeon/radeon_bo_drm.h | 8 +- .../drivers/dri/radeon/radeon_bo_legacy.c | 42 +- .../drivers/dri/radeon/radeon_bo_legacy.h | 10 +- src/mesa/drivers/dri/radeon/radeon_chipset.h | 6 +- .../dri/radeon/radeon_common_context.c | 2 +- src/mesa/drivers/dri/radeon/radeon_context.c | 20 +- src/mesa/drivers/dri/radeon/radeon_context.h | 8 +- src/mesa/drivers/dri/radeon/radeon_cs_drm.h | 10 +- .../drivers/dri/radeon/radeon_cs_int_drm.h | 2 +- .../drivers/dri/radeon/radeon_cs_legacy.c | 20 +- .../drivers/dri/radeon/radeon_cs_legacy.h | 10 +- .../drivers/dri/radeon/radeon_cs_space_drm.c | 22 +- src/mesa/drivers/dri/radeon/radeon_fbo.c | 26 +- src/mesa/drivers/dri/radeon/radeon_ioctl.h | 4 +- .../drivers/dri/radeon/radeon_maos_arrays.c | 14 +- .../drivers/dri/radeon/radeon_maos_vbtmp.h | 28 +- .../drivers/dri/radeon/radeon_maos_verts.c | 12 +- .../drivers/dri/radeon/radeon_mipmap_tree.c | 2 +- src/mesa/drivers/dri/radeon/radeon_sanity.c | 110 +- src/mesa/drivers/dri/radeon/radeon_screen.c | 2 +- src/mesa/drivers/dri/radeon/radeon_span.c | 4 +- src/mesa/drivers/dri/radeon/radeon_state.c | 2 +- .../drivers/dri/radeon/radeon_state_init.c | 72 +- src/mesa/drivers/dri/radeon/radeon_swtcl.c | 34 +- src/mesa/drivers/dri/radeon/radeon_swtcl.h | 4 +- src/mesa/drivers/dri/radeon/radeon_tcl.c | 46 +- src/mesa/drivers/dri/radeon/radeon_tex.c | 10 +- src/mesa/drivers/dri/radeon/radeon_texstate.c | 20 +- src/mesa/drivers/dri/radeon/radeon_texture.c | 2 +- src/mesa/drivers/dri/radeon/server/radeon.h | 4 +- .../drivers/dri/radeon/server/radeon_dri.h | 2 +- .../drivers/dri/radeon/server/radeon_reg.h | 4 +- src/mesa/drivers/dri/savage/Makefile | 4 +- src/mesa/drivers/dri/savage/savage_3d_reg.h | 10 +- src/mesa/drivers/dri/savage/savage_bci.h | 8 +- src/mesa/drivers/dri/savage/savage_init.h | 12 +- src/mesa/drivers/dri/savage/savage_xmesa.c | 82 +- src/mesa/drivers/dri/savage/savagecontext.h | 26 +- src/mesa/drivers/dri/savage/savageioctl.c | 52 +- src/mesa/drivers/dri/savage/savageioctl.h | 2 +- src/mesa/drivers/dri/savage/savagerender.c | 12 +- src/mesa/drivers/dri/savage/savagestate.c | 152 +- src/mesa/drivers/dri/savage/savagetex.c | 68 +- src/mesa/drivers/dri/savage/savagetris.c | 26 +- .../drivers/dri/savage/server/savage_dri.h | 2 +- src/mesa/drivers/dri/sis/Makefile | 2 +- src/mesa/drivers/dri/sis/sis6326_clear.c | 6 +- src/mesa/drivers/dri/sis/sis6326_reg.h | 10 +- src/mesa/drivers/dri/sis/sis6326_state.c | 6 +- src/mesa/drivers/dri/sis/sis_alloc.c | 26 +- src/mesa/drivers/dri/sis/sis_clear.c | 10 +- src/mesa/drivers/dri/sis/sis_context.c | 8 +- src/mesa/drivers/dri/sis/sis_context.h | 12 +- src/mesa/drivers/dri/sis/sis_dd.c | 4 +- src/mesa/drivers/dri/sis/sis_reg.h | 12 +- src/mesa/drivers/dri/sis/sis_screen.c | 6 +- src/mesa/drivers/dri/sis/sis_span.c | 6 +- src/mesa/drivers/dri/sis/sis_span.h | 2 +- src/mesa/drivers/dri/sis/sis_state.c | 8 +- src/mesa/drivers/dri/sis/sis_stencil.c | 4 +- src/mesa/drivers/dri/sis/sis_tex.c | 14 +- src/mesa/drivers/dri/sis/sis_texstate.c | 18 +- src/mesa/drivers/dri/sis/sis_tris.c | 16 +- src/mesa/drivers/dri/sis/sis_tritmp.h | 14 +- src/mesa/drivers/dri/tdfx/Makefile | 2 +- src/mesa/drivers/dri/tdfx/tdfx_context.c | 22 +- src/mesa/drivers/dri/tdfx/tdfx_context.h | 20 +- src/mesa/drivers/dri/tdfx/tdfx_dd.c | 4 +- src/mesa/drivers/dri/tdfx/tdfx_pixels.c | 10 +- src/mesa/drivers/dri/tdfx/tdfx_screen.c | 4 +- src/mesa/drivers/dri/tdfx/tdfx_span.c | 2 +- src/mesa/drivers/dri/tdfx/tdfx_state.c | 6 +- src/mesa/drivers/dri/tdfx/tdfx_tex.c | 10 +- src/mesa/drivers/dri/tdfx/tdfx_texstate.c | 6 +- src/mesa/drivers/dri/tdfx/tdfx_tris.c | 70 +- src/mesa/drivers/dri/tdfx/tdfx_vb.c | 18 +- src/mesa/drivers/dri/tdfx/tdfx_vb.h | 8 +- src/mesa/drivers/dri/tdfx/tdfx_vbtmp.h | 30 +- src/mesa/drivers/dri/unichrome/Makefile | 4 +- .../drivers/dri/unichrome/server/via_priv.h | 2 +- src/mesa/drivers/dri/unichrome/via_3d_reg.h | 62 +- src/mesa/drivers/dri/unichrome/via_context.c | 68 +- src/mesa/drivers/dri/unichrome/via_context.h | 34 +- src/mesa/drivers/dri/unichrome/via_fb.c | 44 +- src/mesa/drivers/dri/unichrome/via_ioctl.c | 172 +- src/mesa/drivers/dri/unichrome/via_ioctl.h | 4 +- src/mesa/drivers/dri/unichrome/via_render.c | 14 +- src/mesa/drivers/dri/unichrome/via_screen.c | 12 +- src/mesa/drivers/dri/unichrome/via_screen.h | 6 +- src/mesa/drivers/dri/unichrome/via_span.c | 8 +- src/mesa/drivers/dri/unichrome/via_state.c | 188 +- src/mesa/drivers/dri/unichrome/via_tex.c | 168 +- .../drivers/dri/unichrome/via_texcombine.c | 48 +- src/mesa/drivers/dri/unichrome/via_tris.c | 102 +- src/mesa/drivers/osmesa/osmesa.c | 6 +- src/mesa/drivers/windows/gdi/mesa.def | 2 +- src/mesa/drivers/windows/gdi/wgl.c | 180 +- src/mesa/drivers/windows/gdi/wmesa.c | 352 +-- .../drivers/windows/gldirect/dglcontext.c | 6 +- .../drivers/windows/gldirect/dglglobals.h | 2 +- src/mesa/drivers/windows/gldirect/dglpf.c | 30 +- src/mesa/drivers/windows/gldirect/dglwgl.c | 130 +- src/mesa/drivers/windows/gldirect/dglwgl.h | 2 +- src/mesa/drivers/windows/gldirect/dll_main.c | 2 +- .../drivers/windows/gldirect/gld_dispatch.c | 2 +- .../drivers/windows/gldirect/gld_driver.c | 2 +- src/mesa/drivers/windows/icd/icd.c | 2 +- src/mesa/drivers/x11/fakeglx.c | 12 +- src/mesa/drivers/x11/glxapi.c | 10 +- src/mesa/drivers/x11/glxapi.h | 8 +- src/mesa/drivers/x11/glxheader.h | 8 +- src/mesa/drivers/x11/realglx.c | 8 +- src/mesa/drivers/x11/realglx.h | 8 +- src/mesa/drivers/x11/xm_api.c | 14 +- src/mesa/drivers/x11/xm_buffer.c | 6 +- src/mesa/drivers/x11/xm_dd.c | 6 +- src/mesa/drivers/x11/xm_glide.c | 2 +- src/mesa/drivers/x11/xm_span.c | 14 +- src/mesa/drivers/x11/xm_tri.c | 2 +- src/mesa/drivers/x11/xmesa.h | 8 +- src/mesa/drivers/x11/xmesaP.h | 2 +- src/mesa/main/accum.c | 2 +- src/mesa/main/accum.h | 2 +- src/mesa/main/api_arrayelt.c | 12 +- src/mesa/main/api_loopback.c | 10 +- src/mesa/main/api_noop.c | 10 +- src/mesa/main/arbprogram.c | 14 +- src/mesa/main/arbprogram.h | 4 +- src/mesa/main/arrayobj.c | 16 +- src/mesa/main/atifragshader.c | 8 +- src/mesa/main/attrib.c | 10 +- src/mesa/main/attrib.h | 4 +- src/mesa/main/bitset.h | 2 +- src/mesa/main/blend.c | 2 +- src/mesa/main/blend.h | 2 +- src/mesa/main/bufferobj.c | 26 +- src/mesa/main/buffers.c | 2 +- src/mesa/main/clear.c | 4 +- src/mesa/main/clip.h | 4 +- src/mesa/main/colortab.c | 4 +- src/mesa/main/compiler.h | 4 +- src/mesa/main/config.h | 8 +- src/mesa/main/context.c | 36 +- src/mesa/main/context.h | 10 +- src/mesa/main/dd.h | 76 +- src/mesa/main/debug.c | 4 +- src/mesa/main/debug.h | 2 +- src/mesa/main/depth.h | 2 +- src/mesa/main/dispatch.h | 6 +- src/mesa/main/dlist.c | 18 +- src/mesa/main/drawpix.c | 2 +- src/mesa/main/enable.c | 6 +- src/mesa/main/enums.c | 8 +- src/mesa/main/enums.h | 2 +- src/mesa/main/eval.c | 6 +- src/mesa/main/eval.h | 2 +- src/mesa/main/execmem.c | 16 +- src/mesa/main/extensions.h | 2 +- src/mesa/main/fbobject.c | 14 +- src/mesa/main/feedback.c | 14 +- src/mesa/main/ffvertex_prog.h | 10 +- src/mesa/main/fog.h | 2 +- src/mesa/main/formats.c | 14 +- src/mesa/main/formats.h | 2 +- src/mesa/main/framebuffer.c | 6 +- src/mesa/main/framebuffer.h | 2 +- src/mesa/main/get.c | 38 +- src/mesa/main/glapidispatch.h | 6 +- src/mesa/main/hash.c | 28 +- src/mesa/main/hash.h | 2 +- src/mesa/main/hint.h | 4 +- src/mesa/main/histogram.h | 2 +- src/mesa/main/image.c | 6 +- src/mesa/main/image.h | 2 +- src/mesa/main/imports.c | 34 +- src/mesa/main/light.c | 24 +- src/mesa/main/lines.c | 2 +- src/mesa/main/lines.h | 2 +- src/mesa/main/matrix.c | 32 +- src/mesa/main/matrix.h | 6 +- src/mesa/main/mipmap.c | 10 +- src/mesa/main/mm.c | 30 +- src/mesa/main/mm.h | 10 +- src/mesa/main/mtypes.h | 80 +- src/mesa/main/nvprogram.c | 4 +- src/mesa/main/nvprogram.h | 2 +- src/mesa/main/pack.c | 4 +- src/mesa/main/pixel.h | 4 +- src/mesa/main/points.h | 2 +- src/mesa/main/polygon.c | 6 +- src/mesa/main/polygon.h | 2 +- src/mesa/main/rastpos.c | 8 +- src/mesa/main/rastpos.h | 2 +- src/mesa/main/readpix.c | 2 +- src/mesa/main/remap_helper.h | 6 +- src/mesa/main/renderbuffer.c | 4 +- src/mesa/main/scissor.c | 2 +- src/mesa/main/scissor.h | 4 +- src/mesa/main/shaderapi.c | 10 +- src/mesa/main/shared.c | 2 +- src/mesa/main/simple_list.h | 12 +- src/mesa/main/state.c | 12 +- src/mesa/main/state.h | 2 +- src/mesa/main/stencil.c | 4 +- src/mesa/main/stencil.h | 2 +- src/mesa/main/texcompress_fxt1.c | 6 +- src/mesa/main/texenv.c | 2 +- src/mesa/main/texenvprogram.c | 142 +- src/mesa/main/texfetch_tmp.h | 20 +- src/mesa/main/texformat.c | 2 +- src/mesa/main/texgen.c | 2 +- src/mesa/main/texgetimage.c | 2 +- src/mesa/main/teximage.c | 50 +- src/mesa/main/teximage.h | 2 +- src/mesa/main/texobj.c | 30 +- src/mesa/main/texparam.c | 20 +- src/mesa/main/texstate.c | 20 +- src/mesa/main/texstate.h | 4 +- src/mesa/main/texstore.c | 82 +- src/mesa/main/transformfeedback.c | 6 +- src/mesa/main/varray.c | 6 +- src/mesa/main/varray.h | 2 +- src/mesa/main/viewport.c | 6 +- src/mesa/main/viewport.h | 6 +- src/mesa/main/vtxfmt.h | 2 +- src/mesa/math/descrip.mms | 2 +- src/mesa/math/m_debug_util.h | 6 +- src/mesa/math/m_matrix.c | 60 +- src/mesa/ppc/common_ppc.c | 4 +- src/mesa/program/arbprogparse.c | 4 +- src/mesa/program/descrip.mms | 2 +- src/mesa/program/hash_table.c | 2 +- src/mesa/program/ir_to_mesa.cpp | 2 +- src/mesa/program/lex.yy.c | 66 +- src/mesa/program/nvfragparse.c | 12 +- src/mesa/program/nvvertparse.c | 4 +- src/mesa/program/prog_cache.c | 16 +- src/mesa/program/prog_cache.h | 10 +- src/mesa/program/prog_execute.c | 4 +- src/mesa/program/prog_optimize.c | 2 +- src/mesa/program/prog_parameter.c | 6 +- src/mesa/program/prog_parameter_layout.c | 4 +- src/mesa/program/prog_print.c | 8 +- src/mesa/program/prog_statevars.c | 12 +- src/mesa/program/program_lexer.l | 2 +- src/mesa/program/program_parse.tab.c | 24 +- src/mesa/program/program_parse.tab.h | 10 +- src/mesa/program/program_parse.y | 26 +- src/mesa/program/program_parser.h | 2 +- src/mesa/program/programopt.c | 14 +- src/mesa/program/symbol_table.c | 6 +- src/mesa/sources.mak | 6 +- src/mesa/sparc/clip.S | 2 +- src/mesa/sparc/norm.S | 2 +- src/mesa/sparc/sparc.c | 8 +- src/mesa/sparc/sparc.h | 8 +- src/mesa/state_tracker/st_atom.c | 18 +- src/mesa/state_tracker/st_atom.h | 12 +- src/mesa/state_tracker/st_atom_blend.c | 14 +- src/mesa/state_tracker/st_atom_clip.c | 18 +- src/mesa/state_tracker/st_atom_constbuf.c | 12 +- src/mesa/state_tracker/st_atom_constbuf.h | 10 +- src/mesa/state_tracker/st_atom_depth.c | 12 +- src/mesa/state_tracker/st_atom_framebuffer.c | 12 +- src/mesa/state_tracker/st_atom_msaa.c | 10 +- .../state_tracker/st_atom_pixeltransfer.c | 10 +- src/mesa/state_tracker/st_atom_rasterizer.c | 18 +- src/mesa/state_tracker/st_atom_sampler.c | 14 +- src/mesa/state_tracker/st_atom_scissor.c | 12 +- src/mesa/state_tracker/st_atom_shader.c | 16 +- src/mesa/state_tracker/st_atom_shader.h | 10 +- src/mesa/state_tracker/st_atom_stipple.c | 14 +- src/mesa/state_tracker/st_atom_texture.c | 18 +- src/mesa/state_tracker/st_atom_viewport.c | 14 +- src/mesa/state_tracker/st_cb_accum.c | 14 +- src/mesa/state_tracker/st_cb_accum.h | 10 +- src/mesa/state_tracker/st_cb_bitmap.c | 20 +- src/mesa/state_tracker/st_cb_bitmap.h | 10 +- src/mesa/state_tracker/st_cb_blit.c | 12 +- src/mesa/state_tracker/st_cb_blit.h | 10 +- src/mesa/state_tracker/st_cb_bufferobjects.c | 32 +- src/mesa/state_tracker/st_cb_bufferobjects.h | 10 +- src/mesa/state_tracker/st_cb_clear.c | 20 +- src/mesa/state_tracker/st_cb_clear.h | 10 +- src/mesa/state_tracker/st_cb_condrender.c | 10 +- src/mesa/state_tracker/st_cb_condrender.h | 10 +- src/mesa/state_tracker/st_cb_drawpixels.c | 32 +- src/mesa/state_tracker/st_cb_drawpixels.h | 10 +- src/mesa/state_tracker/st_cb_drawtex.c | 4 +- src/mesa/state_tracker/st_cb_drawtex.h | 2 +- src/mesa/state_tracker/st_cb_fbo.c | 32 +- src/mesa/state_tracker/st_cb_fbo.h | 12 +- src/mesa/state_tracker/st_cb_feedback.c | 10 +- src/mesa/state_tracker/st_cb_feedback.h | 10 +- src/mesa/state_tracker/st_cb_flush.c | 10 +- src/mesa/state_tracker/st_cb_flush.h | 10 +- src/mesa/state_tracker/st_cb_program.c | 26 +- src/mesa/state_tracker/st_cb_queryobj.c | 14 +- src/mesa/state_tracker/st_cb_queryobj.h | 10 +- src/mesa/state_tracker/st_cb_rasterpos.c | 10 +- src/mesa/state_tracker/st_cb_rasterpos.h | 10 +- src/mesa/state_tracker/st_cb_readpixels.c | 10 +- src/mesa/state_tracker/st_cb_readpixels.h | 10 +- src/mesa/state_tracker/st_cb_strings.c | 12 +- src/mesa/state_tracker/st_cb_strings.h | 10 +- src/mesa/state_tracker/st_cb_texture.c | 44 +- src/mesa/state_tracker/st_cb_texture.h | 12 +- src/mesa/state_tracker/st_cb_xformfb.c | 10 +- src/mesa/state_tracker/st_cb_xformfb.h | 10 +- src/mesa/state_tracker/st_context.c | 16 +- src/mesa/state_tracker/st_context.h | 10 +- src/mesa/state_tracker/st_debug.c | 10 +- src/mesa/state_tracker/st_debug.h | 10 +- src/mesa/state_tracker/st_draw.c | 26 +- src/mesa/state_tracker/st_draw.h | 12 +- src/mesa/state_tracker/st_draw_feedback.c | 14 +- src/mesa/state_tracker/st_extensions.c | 14 +- src/mesa/state_tracker/st_extensions.h | 10 +- src/mesa/state_tracker/st_format.c | 20 +- src/mesa/state_tracker/st_format.h | 10 +- src/mesa/state_tracker/st_gen_mipmap.c | 14 +- src/mesa/state_tracker/st_gen_mipmap.h | 10 +- src/mesa/state_tracker/st_manager.c | 4 +- src/mesa/state_tracker/st_mesa_to_tgsi.c | 74 +- src/mesa/state_tracker/st_mesa_to_tgsi.h | 10 +- src/mesa/state_tracker/st_program.c | 32 +- src/mesa/state_tracker/st_program.h | 14 +- src/mesa/state_tracker/st_texture.c | 20 +- src/mesa/state_tracker/st_texture.h | 12 +- src/mesa/swrast/descrip.mms | 4 +- src/mesa/swrast/s_aaline.c | 2 +- src/mesa/swrast/s_aatritemp.h | 16 +- src/mesa/swrast/s_blend.c | 2 +- src/mesa/swrast/s_blit.c | 2 +- src/mesa/swrast/s_clear.c | 2 +- src/mesa/swrast/s_context.c | 4 +- src/mesa/swrast/s_copypix.c | 2 +- src/mesa/swrast/s_depth.c | 4 +- src/mesa/swrast/s_drawpix.c | 6 +- src/mesa/swrast/s_fog.c | 2 +- src/mesa/swrast/s_linetemp.h | 4 +- src/mesa/swrast/s_span.c | 6 +- src/mesa/swrast/s_span.h | 2 +- src/mesa/swrast/s_stencil.c | 8 +- src/mesa/swrast/s_texcombine.c | 2 +- src/mesa/swrast/s_texfilter.c | 20 +- src/mesa/swrast/s_triangle.c | 2 +- src/mesa/swrast/swrast.h | 2 +- src/mesa/swrast_setup/ss_context.c | 4 +- src/mesa/swrast_setup/swrast_setup.h | 4 +- src/mesa/tnl/t_context.c | 4 +- src/mesa/tnl/t_context.h | 34 +- src/mesa/tnl/t_draw.c | 68 +- src/mesa/tnl/t_pipeline.c | 16 +- src/mesa/tnl/t_pipeline.h | 2 +- src/mesa/tnl/t_rasterpos.c | 10 +- src/mesa/tnl/t_vb_light.c | 12 +- src/mesa/tnl/t_vb_program.c | 8 +- src/mesa/tnl/t_vb_render.c | 10 +- src/mesa/tnl/t_vb_texgen.c | 8 +- src/mesa/tnl/t_vb_texmat.c | 2 +- src/mesa/tnl/t_vb_vertex.c | 4 +- src/mesa/tnl/t_vertex.c | 52 +- src/mesa/tnl/t_vertex.h | 12 +- src/mesa/tnl/t_vertex_generic.c | 140 +- src/mesa/tnl/t_vertex_sse.c | 100 +- src/mesa/tnl_dd/imm/NOTES.imm | 14 +- src/mesa/tnl_dd/imm/t_dd_imm_primtmp.h | 32 +- src/mesa/tnl_dd/imm/t_dd_imm_vapi.h | 2 +- src/mesa/tnl_dd/imm/t_dd_imm_vb.c | 2 +- src/mesa/tnl_dd/imm/t_dd_imm_vbtmp.h | 20 +- src/mesa/tnl_dd/t_dd_dmatmp.h | 22 +- src/mesa/tnl_dd/t_dd_dmatmp2.h | 52 +- src/mesa/tnl_dd/t_dd_triemit.h | 8 +- src/mesa/tnl_dd/t_dd_vb.c | 10 +- src/mesa/tnl_dd/t_dd_vbtmp.h | 46 +- src/mesa/vbo/vbo_attrib.h | 16 +- src/mesa/vbo/vbo_context.c | 10 +- src/mesa/vbo/vbo_context.h | 8 +- src/mesa/vbo/vbo_exec.c | 4 +- src/mesa/vbo/vbo_exec.h | 10 +- src/mesa/vbo/vbo_exec_api.c | 78 +- src/mesa/vbo/vbo_exec_array.c | 16 +- src/mesa/vbo/vbo_exec_draw.c | 48 +- src/mesa/vbo/vbo_exec_eval.c | 84 +- src/mesa/vbo/vbo_rebase.c | 40 +- src/mesa/vbo/vbo_save.c | 2 +- src/mesa/vbo/vbo_save.h | 4 +- src/mesa/vbo/vbo_save_api.c | 130 +- src/mesa/vbo/vbo_save_draw.c | 30 +- src/mesa/vbo/vbo_save_loopback.c | 14 +- src/mesa/vbo/vbo_split.c | 2 +- src/mesa/vbo/vbo_split_copy.c | 46 +- src/mesa/vbo/vbo_split_inplace.c | 24 +- src/mesa/x86-64/x86-64.c | 2 +- src/mesa/x86-64/xform4.S | 46 +- src/mesa/x86/3dnow_normal.S | 6 +- src/mesa/x86/3dnow_xform1.S | 2 +- src/mesa/x86/3dnow_xform2.S | 2 +- src/mesa/x86/3dnow_xform3.S | 4 +- src/mesa/x86/3dnow_xform4.S | 8 +- src/mesa/x86/common_x86.c | 4 +- src/mesa/x86/common_x86_asm.S | 2 +- src/mesa/x86/mmx_blend.S | 10 +- src/mesa/x86/mmx_blendtmp.h | 14 +- src/mesa/x86/read_rgba_span_x86.S | 18 +- src/mesa/x86/read_rgba_span_x86.h | 2 +- src/mesa/x86/rtasm/x86sse.c | 66 +- src/mesa/x86/sse_normal.S | 2 +- src/mesa/x86/sse_xform1.S | 2 +- src/mesa/x86/sse_xform2.S | 2 +- src/mesa/x86/sse_xform3.S | 2 +- src/mesa/x86/sse_xform4.S | 2 +- src/mesa/x86/x86_cliptest.S | 2 +- src/mesa/x86/x86_xform2.S | 2 +- src/mesa/x86/x86_xform3.S | 2 +- src/mesa/x86/x86_xform4.S | 2 +- 1673 files changed, 20475 insertions(+), 20475 deletions(-) diff --git a/aclocal.m4 b/aclocal.m4 index 165d9bc..26dbd20 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -13,7 +13,7 @@ # pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*- # serial 1 (pkg-config-0.24) -# +# # Copyright © 2004 Scott James Remnant . # # This program is free software; you can redistribute it and/or modify @@ -134,7 +134,7 @@ if test $pkg_failed = yes; then _PKG_SHORT_ERRORS_SUPPORTED if test $_pkg_short_errors_supported = yes; then $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "$2" 2>&1` - else + else $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors "$2" 2>&1` fi # Put the nasty error message in config.log where it belongs diff --git a/configs/autoconf.in b/configs/autoconf.in index 1538d9a..f7ad661 100644 --- a/configs/autoconf.in +++ b/configs/autoconf.in @@ -100,7 +100,7 @@ GALLIUM_AUXILIARIES = $(TOP)/src/gallium/auxiliary/libgallium.a GALLIUM_DRIVERS = $(foreach DIR,$(GALLIUM_DRIVERS_DIRS),$(TOP)/src/gallium/drivers/$(DIR)/lib$(DIR).a) # Driver specific build vars -DRI_DIRS = @DRI_DIRS@ +DRI_DIRS = @DRI_DIRS@ EGL_PLATFORMS = @EGL_PLATFORMS@ EGL_CLIENT_APIS = @EGL_CLIENT_APIS@ diff --git a/configs/beos b/configs/beos index ac8d6fc..3ffbbd0 100644 --- a/configs/beos +++ b/configs/beos @@ -7,7 +7,7 @@ CONFIG_NAME = beos DEFINES = \ - -DBEOS_THREADS + -DBEOS_THREADS MACHINE=$(shell uname -m) ifeq ($(MACHINE), BePC) @@ -25,14 +25,14 @@ ifeq ($(CPU), x86) -DUSE_MMX_ASM \ -DUSE_3DNOW_ASM \ -DUSE_SSE_ASM - + MESA_ASM_SOURCES = $(X86_SOURCES) GLAPI_ASM_SOURCES = $(X86_API) CC = gcc CXX = g++ LD = gcc - + CFLAGS = \ -Wall -Wno-multichar -Wno-ctor-dtor-privacy \ $(DEFINES) @@ -75,7 +75,7 @@ else -lroot \ /boot/develop/lib/ppc/glue-noinit.a \ /boot/develop/lib/ppc/init_term_dyn.o \ - /boot/develop/lib/ppc/start_dyn.o + /boot/develop/lib/ppc/start_dyn.o ifdef DEBUG CFLAGS += -g -O0 @@ -95,9 +95,9 @@ GLU_DIRS = sgi DRIVER_DIRS = beos # Library/program dependencies -GL_LIB_DEPS = +GL_LIB_DEPS = OSMESA_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GL_LIB) -GLU_LIB_DEPS = +GLU_LIB_DEPS = GLUT_LIB_DEPS = -lgame -L$(TOP)/$(LIB_DIR) -l$(GL_LIB) APP_LIB_DEPS = -lbe -L$(TOP)/$(LIB_DIR) -l$(GL_LIB) -l$(GLUT_LIB) diff --git a/configs/catamount-osmesa-pgi b/configs/catamount-osmesa-pgi index 74fd53a..097904b 100644 --- a/configs/catamount-osmesa-pgi +++ b/configs/catamount-osmesa-pgi @@ -1,6 +1,6 @@ # Configuration for building only libOSMesa on Cray Xt3 -# for the compute nodes running Catamount using the -# Portland Group compiler. The Portland Group toolchain has to be +# for the compute nodes running Catamount using the +# Portland Group compiler. The Portland Group toolchain has to be # enabled before using "module switch PrgEnv-gnu PrgEnv-pgi" . # This doesn't really have a lot of dependencies, so it should be usable # on other similar systems too. diff --git a/configs/config.mgw b/configs/config.mgw index af74fda..2777290 100644 --- a/configs/config.mgw +++ b/configs/config.mgw @@ -2,26 +2,26 @@ # # Updated : by Heromyth, on 2007-7-21 # Email : zxpmyth@yahoo.com.cn -# Bugs : 1) All the default settings work fine. But the setting X86=1 can't work. +# Bugs : 1) All the default settings work fine. But the setting X86=1 can't work. # The others havn't been tested yet. # 2) The generated DLLs are *not* compatible with the ones built -# with the other compilers like VC8, especially for GLUT. +# with the other compilers like VC8, especially for GLUT. # 3) Although more tests are needed, it can be used individually! -# The generated DLLs by MingW with STDCALL are not totally compatible +# The generated DLLs by MingW with STDCALL are not totally compatible # with the ones linked by Microsoft's compilers. # # xxx_USING_STDCALL = 1 Compiling MESA with __stdcall. This is default! -# +# # xxx_USING_STDCALL = 0 Compiling MESA without __stdcall. I like this:) -# +# # In fact, GL_USING_STDCALL and GLUT_USING_STDCALL can be # different. For example: # # GL_USING_STDCALL = 0 # GLUT_USING_STDCALL = 1 -# +# # Suggested setting: # # ALL_USING_STDCALL = 1 diff --git a/configs/default b/configs/default index 2301a68..d180c3c 100644 --- a/configs/default +++ b/configs/default @@ -24,7 +24,7 @@ CFLAGS = -O CXXFLAGS = -O LDFLAGS = HOST_CFLAGS = $(CFLAGS) -GLU_CFLAGS = +GLU_CFLAGS = # Compiler for building demos/tests/etc APP_CC = $(CC) @@ -33,7 +33,7 @@ APP_CXX = $(CXX) # Misc tools and flags SHELL = /bin/sh MKLIB = $(SHELL) $(TOP)/bin/mklib -MKLIB_OPTIONS = +MKLIB_OPTIONS = MKDEP = makedepend MKDEP_OPTIONS = -fdepend MAKE = make @@ -83,7 +83,7 @@ GLESv2_LIB_GLOB = $(GLESv2_LIB_NAME)* VG_LIB_GLOB = $(VG_LIB_NAME)* # Optional assembly language optimization files for libGL -MESA_ASM_SOURCES = +MESA_ASM_SOURCES = # GLw widget sources (Append "GLwMDrawA.c" here and add -lXm to GLW_LIB_DEPS in # order to build the Motif widget too) @@ -101,7 +101,7 @@ DRIVER_DIRS = x11 osmesa # EGL drivers to build EGL_DRIVERS_DIRS = glx -# Gallium directories and +# Gallium directories and GALLIUM_DIRS = auxiliary drivers state_trackers GALLIUM_AUXILIARIES = $(TOP)/src/gallium/auxiliary/libgallium.a GALLIUM_DRIVERS_DIRS = softpipe trace rbug identity galahad i915 i965 svga r300 nvfx nv50 failover diff --git a/configs/freebsd-dri b/configs/freebsd-dri index a4aa82e..ad7e87f 100644 --- a/configs/freebsd-dri +++ b/configs/freebsd-dri @@ -20,14 +20,14 @@ DEFINES = -DPTHREADS -DUSE_EXTERNAL_DXTN_LIB=1 -DIN_DRI_DRIVER \ CFLAGS = $(WARN_FLAGS) $(OPT_FLAGS) $(PIC_FLAGS) -Wmissing-prototypes -std=c99 -Wundef -ffast-math \ $(ASM_FLAGS) $(X11_INCLUDES) $(DEFINES) -CXXFLAGS = $(WARN_FLAGS) $(OPT_FLAGS) $(PIC_FLAGS) $(DEFINES) -Wall -ansi -pedantic $(ASM_FLAGS) $(X11_INCLUDES) +CXXFLAGS = $(WARN_FLAGS) $(OPT_FLAGS) $(PIC_FLAGS) $(DEFINES) -Wall -ansi -pedantic $(ASM_FLAGS) $(X11_INCLUDES) # Work around aliasing bugs - developers should comment this out CFLAGS += -fno-strict-aliasing CXXFLAGS += -fno-strict-aliasing -ASM_SOURCES = -MESA_ASM_SOURCES = +ASM_SOURCES = +MESA_ASM_SOURCES = # Library/program dependencies LIBDRM_CFLAGS = `pkg-config --cflags libdrm` diff --git a/configs/freebsd-dri-x86 b/configs/freebsd-dri-x86 index 9475437..dd4b0c7 100644 --- a/configs/freebsd-dri-x86 +++ b/configs/freebsd-dri-x86 @@ -6,7 +6,7 @@ include $(TOP)/configs/freebsd-dri CONFIG_NAME = freebsd-dri-x86 # Unnecessary on x86, generally. -PIC_FLAGS = +PIC_FLAGS = ASM_FLAGS = -DUSE_X86_ASM -DUSE_MMX_ASM -DUSE_3DNOW_ASM -DUSE_SSE_ASM MESA_ASM_SOURCES = $(X86_SOURCES) diff --git a/configs/hpux10-static b/configs/hpux10-static index 6101a4e..9f8c9aa 100644 --- a/configs/hpux10-static +++ b/configs/hpux10-static @@ -21,10 +21,10 @@ GLW_LIB_NAME = libGLw.a OSMESA_LIB_NAME = libOSMesa.a # Library/program dependencies (static libs don't have dependencies) -GL_LIB_DEPS = -OSMESA_LIB_DEPS = -GLU_LIB_DEPS = -GLUT_LIB_DEPS = -GLW_LIB_DEPS = +GL_LIB_DEPS = +OSMESA_LIB_DEPS = +GLU_LIB_DEPS = +GLUT_LIB_DEPS = +GLW_LIB_DEPS = APP_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) -L/usr/X11R6/lib -lX11 -lXext -lXmu -lXt -lXi -lpthread -lm -lstdc++ APP_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) -L/usr/lib/X11R6 -L/usr/contrib/X11R6/lib -lXext -lXmu -lXi -lX11 -lm -lstdc++ diff --git a/configs/linux-dri b/configs/linux-dri index 1c94ed0..55e9455 100644 --- a/configs/linux-dri +++ b/configs/linux-dri @@ -38,7 +38,7 @@ GLUT_CFLAGS = -fexceptions CFLAGS += -fno-strict-aliasing CXXFLAGS += -fno-strict-aliasing -MESA_ASM_SOURCES = +MESA_ASM_SOURCES = # Library/program dependencies EXTRA_LIB_PATH=-L/usr/X11R6/lib @@ -58,7 +58,7 @@ EGL_DRIVERS_DIRS = glx DRIVER_DIRS = dri GALLIUM_WINSYS_DIRS = sw sw/xlib drm/vmware drm/intel drm/i965 -GALLIUM_TARGET_DIRS = +GALLIUM_TARGET_DIRS = GALLIUM_STATE_TRACKERS_DIRS = egl DRI_DIRS = i810 i915 i965 mach64 mga r128 r200 r300 radeon \ diff --git a/configs/linux-dri-debug b/configs/linux-dri-debug index 0dbf428..1ce2ff2 100644 --- a/configs/linux-dri-debug +++ b/configs/linux-dri-debug @@ -8,7 +8,7 @@ OPT_FLAGS = -O0 -g ARCH_FLAGS = -DDEBUG # Helpful to reduce the amount of stuff that gets built sometimes: -#DRI_DIRS = i915tex i915 +#DRI_DIRS = i915tex i915 #DRI_DIRS = i965 #DRI_DIRS = radeon r200 r300 #DRI_DIRS = unichrome sis diff --git a/configs/linux-dri-xcb b/configs/linux-dri-xcb index 8092a04..33b680b 100644 --- a/configs/linux-dri-xcb +++ b/configs/linux-dri-xcb @@ -28,7 +28,7 @@ DEFINES = -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE \ X11_INCLUDES = $(shell pkg-config --cflags-only-I x11) $(shell pkg-config --cflags-only-I xcb) $(shell pkg-config --cflags-only-I x11-xcb) $(shell pkg-config --cflags-only-I xcb-glx) CFLAGS = -Wall -Wmissing-prototypes $(OPT_FLAGS) $(PIC_FLAGS) $(ARCH_FLAGS) \ - $(DEFINES) $(ASM_FLAGS) -std=c99 -ffast-math + $(DEFINES) $(ASM_FLAGS) -std=c99 -ffast-math CXXFLAGS = -Wall $(OPT_FLAGS) $(PIC_FLAGS) $(ARCH_FLAGS) $(DEFINES) @@ -36,7 +36,7 @@ CXXFLAGS = -Wall $(OPT_FLAGS) $(PIC_FLAGS) $(ARCH_FLAGS) $(DEFINES) CFLAGS += -fno-strict-aliasing CXXFLAGS += -fno-strict-aliasing -MESA_ASM_SOURCES = +MESA_ASM_SOURCES = # Library/program dependencies EXTRA_LIB_PATH=$(shell pkg-config --libs-only-L x11) diff --git a/configs/linux-egl b/configs/linux-egl index 6393e94..984bf3b 100644 --- a/configs/linux-egl +++ b/configs/linux-egl @@ -33,7 +33,7 @@ CFLAGS = -Wall -Wmissing-prototypes -std=c99 -ffast-math \ CXXFLAGS = -Wall $(OPT_FLAGS) $(PIC_FLAGS) $(ARCH_FLAGS) $(DEFINES) -MESA_ASM_SOURCES = +MESA_ASM_SOURCES = # Library/program dependencies EXTRA_LIB_PATH=-L/usr/X11R6/lib @@ -53,4 +53,4 @@ DRIVER_DIRS = dri GALLIUM_WINSYS_DIRS = egl_drm GALLIUM_TARGET_DIRS = -DRI_DIRS = intel +DRI_DIRS = intel diff --git a/configs/linux-ia64-icc b/configs/linux-ia64-icc index bd11897..ccb58ea 100644 --- a/configs/linux-ia64-icc +++ b/configs/linux-ia64-icc @@ -13,7 +13,7 @@ GLUT_CFLAGS = -fexceptions MKLIB_OPTIONS = -arch icc-istatic GL_LIB_DEPS = -L/usr/X11R6/lib -lX11 -lXext -lpthread -GLU_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GL_LIB) +GLU_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GL_LIB) GLUT_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GLU_LIB) -l$(GL_LIB) -L/usr/X11R6/lib -lX11 -lXmu -lXt -lXi GLW_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GL_LIB) $(GL_LIB_DEPS) APP_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) diff --git a/configs/linux-indirect b/configs/linux-indirect index 272d34e..fd47b43 100644 --- a/configs/linux-indirect +++ b/configs/linux-indirect @@ -29,7 +29,7 @@ DEFINES = -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE \ X11_INCLUDES = -I/usr/X11R6/include CFLAGS = $(WARN_FLAGS) $(OPT_FLAGS) $(PIC_FLAGS) $(ARCH_FLAGS) $(DEFINES) \ - $(ASM_FLAGS) -std=c99 -ffast-math + $(ASM_FLAGS) -std=c99 -ffast-math CXXFLAGS = $(WARN_FLAGS) $(OPT_FLAGS) $(PIC_FLAGS) $(ARCH_FLAGS) $(DEFINES) @@ -37,7 +37,7 @@ CXXFLAGS = $(WARN_FLAGS) $(OPT_FLAGS) $(PIC_FLAGS) $(ARCH_FLAGS) $(DEFINES) CFLAGS += -fno-strict-aliasing CXXFLAGS += -fno-strict-aliasing -MESA_ASM_SOURCES = +MESA_ASM_SOURCES = # Library/program dependencies EXTRA_LIB_PATH=-L/usr/X11R6/lib diff --git a/configs/linux-static b/configs/linux-static index 907904b..a99363d 100644 --- a/configs/linux-static +++ b/configs/linux-static @@ -15,11 +15,11 @@ GLW_LIB_NAME = libGLw.a OSMESA_LIB_NAME = libOSMesa.a # Library/program dependencies (static libs don't have dependencies) -GL_LIB_DEPS = -OSMESA_LIB_DEPS = -GLU_LIB_DEPS = -GLUT_LIB_DEPS = -GLW_LIB_DEPS = +GL_LIB_DEPS = +OSMESA_LIB_DEPS = +GLU_LIB_DEPS = +GLUT_LIB_DEPS = +GLW_LIB_DEPS = # Need to specify all libraries we may need APP_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GLUT_LIB) -l$(GLU_LIB) \ diff --git a/configs/linux-x86-64-static b/configs/linux-x86-64-static index 626d579..51a231c 100644 --- a/configs/linux-x86-64-static +++ b/configs/linux-x86-64-static @@ -15,11 +15,11 @@ GLW_LIB_NAME = libGLw.a OSMESA_LIB_NAME = libOSMesa.a # Library/program dependencies (static libs don't have dependencies) -GL_LIB_DEPS = -OSMESA_LIB_DEPS = -GLU_LIB_DEPS = -GLUT_LIB_DEPS = -GLW_LIB_DEPS = +GL_LIB_DEPS = +OSMESA_LIB_DEPS = +GLU_LIB_DEPS = +GLUT_LIB_DEPS = +GLW_LIB_DEPS = # Need to specify all libraries we may need APP_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GLUT_LIB) -l$(GLU_LIB) -Wl,--start-group \ diff --git a/configs/linux-x86-debug b/configs/linux-x86-debug index d35012f..1e66c09 100644 --- a/configs/linux-x86-debug +++ b/configs/linux-x86-debug @@ -1,4 +1,4 @@ -# Configuration for Linux with x86 code, but no gcc optimizations and +# Configuration for Linux with x86 code, but no gcc optimizations and # debugging enabled. include $(TOP)/configs/linux-x86 diff --git a/configs/linux-x86-static b/configs/linux-x86-static index 16c8731..2f60b54 100644 --- a/configs/linux-x86-static +++ b/configs/linux-x86-static @@ -15,11 +15,11 @@ GLW_LIB_NAME = libGLw.a OSMESA_LIB_NAME = libOSMesa.a # Library/program dependencies (static libs don't have dependencies) -GL_LIB_DEPS = -OSMESA_LIB_DEPS = -GLU_LIB_DEPS = -GLUT_LIB_DEPS = -GLW_LIB_DEPS = +GL_LIB_DEPS = +OSMESA_LIB_DEPS = +GLU_LIB_DEPS = +GLUT_LIB_DEPS = +GLW_LIB_DEPS = # Need to specify all libraries we may need APP_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GLUT_LIB) -l$(GLU_LIB) \ diff --git a/configs/psl1ght-rsx b/configs/psl1ght-rsx index dd236f6..d24ecc3 100644 --- a/configs/psl1ght-rsx +++ b/configs/psl1ght-rsx @@ -27,7 +27,7 @@ SRC_DIRS = glsl mapi/glapi mesa \ gallium gallium/winsys gallium/targets glu egl # Build no traditional Mesa drivers: -DRIVER_DIRS = +DRIVER_DIRS = GLU_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GL_LIB) @@ -45,7 +45,7 @@ GALLIUM_TARGET_DIRS = egl-psl1ght GALLIUM_STATE_TRACKERS_DIRS = egl EGL_PLATFORMS = psl1ght -EGL_DRIVERS_DIRS = +EGL_DRIVERS_DIRS = EGL_LIB_DEPS = $(TOP)/src/gallium/targets/egl-psl1ght/libeglpsl1ght.a \ $(TOP)/src/gallium/state_trackers/egl/libegl.a diff --git a/configs/sunos4-static b/configs/sunos4-static index 9135fa7..573ec55 100644 --- a/configs/sunos4-static +++ b/configs/sunos4-static @@ -17,9 +17,9 @@ GLW_LIB_NAME = libGLw.a OSMESA_LIB_NAME = libOSMesa.a # Library/program dependencies (static libs don't have dependencies) -GL_LIB_DEPS = -OSMESA_LIB_DEPS = -GLU_LIB_DEPS = -GLUT_LIB_DEPS = -GLW_LIB_DEPS = +GL_LIB_DEPS = +OSMESA_LIB_DEPS = +GLU_LIB_DEPS = +GLUT_LIB_DEPS = +GLW_LIB_DEPS = APP_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) -L/usr/X11R6/lib -lX11 -lXext -lXmu -lXt -lXi -lpthread -lm diff --git a/configure.ac b/configure.ac index 6662b8a..c44bfb1 100644 --- a/configure.ac +++ b/configure.ac @@ -1081,7 +1081,7 @@ if test "x$enable_egl" = xyes; then [have_xcb_dri2=yes],[have_xcb_dri2=no]) PKG_CHECK_MODULES([LIBUDEV], [libudev > 150], [have_libudev=yes],[have_libudev=no]) - + if test "$have_xcb_dri2" = yes; then EGL_DRIVER_DRI2=dri2 DEFINES="$DEFINES -DHAVE_XCB_DRI2" diff --git a/docs/COPYING b/docs/COPYING index b88946c..4da3a14 100644 --- a/docs/COPYING +++ b/docs/COPYING @@ -141,7 +141,7 @@ such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does. - + 1. You may copy and distribute verbatim copies of the Library's complete source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an diff --git a/docs/MESA_copy_sub_buffer.spec b/docs/MESA_copy_sub_buffer.spec index 752a014..138879d 100644 --- a/docs/MESA_copy_sub_buffer.spec +++ b/docs/MESA_copy_sub_buffer.spec @@ -73,7 +73,7 @@ Additions to Chapter 3 of the GLX 1.3 Specification (Functions and Errors) thread's current context, glXCopySubBufferMESA performs an implicit glFlush before it returns. Subsequent OpenGL commands may be issued immediately after calling glXCopySubBufferMESA, but - are not executed until the copy is completed. + are not executed until the copy is completed. GLX Protocol diff --git a/docs/MESA_swap_control.spec b/docs/MESA_swap_control.spec index 856978b..fbbe074 100644 --- a/docs/MESA_swap_control.spec +++ b/docs/MESA_swap_control.spec @@ -83,9 +83,9 @@ Additions to the GLX 1.3 Specification takes effect when glXSwapBuffers is first called subsequent to the glXSwapIntervalMESA call. - A video frame period is the time required by the monitor to display a + A video frame period is the time required by the monitor to display a full frame of video data. In the case of an interlaced monitor, - this is typically the time required to display both the even and odd + this is typically the time required to display both the even and odd fields of a frame of video data. If is set to a value of 0, buffer swaps are not synchron- diff --git a/docs/MESA_swap_frame_usage.spec b/docs/MESA_swap_frame_usage.spec index 5023ead..610187f 100644 --- a/docs/MESA_swap_frame_usage.spec +++ b/docs/MESA_swap_frame_usage.spec @@ -45,7 +45,7 @@ Overview call to enable the statistic) to when the next buffer swap completes, tf is the entire time for a frame which may be multiple screen refreshes depending on the swap interval as set by the GLX_SGI_swap_control or - GLX_OML_sync_control extensions. + GLX_OML_sync_control extensions. The value, percent, indicates the amount of time spent between the completion of the two swaps. If the value is in the range [0,1], the @@ -115,7 +115,7 @@ Additions to the GLX 1.3 Specification MESA_swap_control are supported, the swap period is the vertical refresh time multiplied by the swap interval (or one if the swap interval is set to zero). - + If OML_sync_control is supported, the swap period is the vertical refresh time multiplied by the divisor parameter to glXSwapBuffersMscOML. The frame usage in this case is less than 1.0 if diff --git a/docs/MESA_texture_array.spec b/docs/MESA_texture_array.spec index 9dee65b..3e65513 100644 --- a/docs/MESA_texture_array.spec +++ b/docs/MESA_texture_array.spec @@ -103,7 +103,7 @@ New Tokens Accepted by the parameter of TexImage2D, TexSubImage2D, CopyTexImage2D, CopyTexSubImage2D, CompressedTexImage2D, - CompressedTexSubImage2D, GetTexLevelParameteriv, and + CompressedTexSubImage2D, GetTexLevelParameteriv, and GetTexLevelParameterfv: TEXTURE_1D_ARRAY_EXT @@ -189,7 +189,7 @@ Additions to Chapter 3 of the OpenGL 2.0 Specification (Rasterization) Change the fourth paragraph on page 156 to say (spec changes identical to EXT_texture_array): - + "The command void TexImage2D(enum target, int level, @@ -213,7 +213,7 @@ Additions to Chapter 3 of the OpenGL 2.0 Specification (Rasterization) of 1, except that * The border depth, d_b, is zero, and the depth of the image is - always 1 regardless of the value of border. + always 1 regardless of the value of border. * The border height, h_b, is zero if is TEXTURE_1D_ARRAY_EXT, and otherwise. @@ -264,7 +264,7 @@ Additions to Chapter 3 of the OpenGL 2.0 Specification (Rasterization) specified or changed, and when applied to a fragment. Each parameter is set by calling - void TexParameter{if}(enum target, enum pname, T param); + void TexParameter{if}(enum target, enum pname, T param); void TexParameter{if}v(enum target, enum pname, T params); target is the target, either TEXTURE_1D, TEXTURE_2D, TEXTURE_3D, @@ -289,7 +289,7 @@ Additions to Chapter 3 of the OpenGL 2.0 Specification (Rasterization) -- Section 3.8.8 "Texture Minification" in the section "Mipmapping" Change the third paragraph (page 174) to say: - + "For a two-dimensional texture, two-dimensional array texture, or cube map texture," @@ -369,7 +369,7 @@ Additions to Chapter 3 of the OpenGL 2.0 Specification (Rasterization) -- Section 3.8.12 "Texture Objects" - Change section (page 180) to say (spec changes identical to + Change section (page 180) to say (spec changes identical to EXT_texture_array): "In addition to the default textures TEXTURE_1D, TEXTURE_2D, @@ -421,18 +421,18 @@ Additions to Chapter 3 of the OpenGL 2.0 Specification (Rasterization) TEXTURE_2D_ARRAY_EXT respectively while 0 is bound to the corresponding targets. - Change second paragraph on page 181 to say (spec changes identical to + Change second paragraph on page 181 to say (spec changes identical to EXT_texture_array): - + "... If a texture that is currently bound to one of the targets TEXTURE_1D, TEXTURE_2D, TEXTURE_3D, TEXTURE_CUBE_MAP, TEXTURE_1D_ARRAY_EXT, or TEXTURE_2D_ARRAY_EXT is deleted, it is as though BindTexture had been executed with the same target and texture zero. ..." - Change second paragraph on page 182 to say (spec changes identical to + Change second paragraph on page 182 to say (spec changes identical to EXT_texture_array): - + "The texture object name space, including the initial one-, two-, and three dimensional, cube map, and one- and two-dimensional array texture objects, is shared among all texture units. ..." @@ -473,7 +473,7 @@ Additions to Chapter 3 of the OpenGL 2.0 Specification (Rasterization) three-dimensional texture is used. If the cube map texture and any of the three-, two-, or one-dimensional textures is enabled, then cube map texturing is used. If one-dimensional array texture is enabled and any - of cube map, three-, two-, or one-dimensional textures is enabled, + of cube map, three-, two-, or one-dimensional textures is enabled, one-dimensional array texturing is used. If two-dimensional array texture is enabled and any of cube map, three-, two-, one-dimensional textures or one-dimensional array texture is enabled, two-dimensional @@ -524,7 +524,7 @@ Additions to Chapter 3 of the OpenGL 2.0 Specification (Rasterization) rectangle, ARRAY1D, ARRAY2D). These texture instructions specify how the 4-tuple is mapped into the coordinates used for sampling. The following function is used to describe the texture sampling in the - descriptions below: + descriptions below: vec4 TextureSample(vec4 coord, float lodBias, int texImageUnit, enum texTarget); @@ -556,9 +556,9 @@ Additions to Chapter 3 of the OpenGL 2.0 Specification (Rasterization) texture comparisons." -- Section 3.11.6.2 "TXP: Project coordinate and map to color" - + Add to the end of the section: - + "A program will fail to load if the TXP instruction is used in conjunction with the SHADOWARRAY2D target." @@ -595,7 +595,7 @@ Additions to Chapter 4 of the OpenGL 2.0 Specification (Per-Fragment Operations) identical to EXT_texture_array): "* If FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE_EXT is TEXTURE and - FRAMEBUFFER_ATTACHMENT_OBJECT_NAME_EXT names a one- or + FRAMEBUFFER_ATTACHMENT_OBJECT_NAME_EXT names a one- or two-dimensional array texture, then FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER_EXT must be smaller than the number of layers in the texture." @@ -630,7 +630,7 @@ Additions to Chapter 6 of the OpenGL 2.0 Specification (State and State Requests attachment point. Otherwise, will contain the value zero." -- Section 6.1.4 "Texture Queries" - + Change the first three paragraphs (page 248) to say (spec changes identical to EXT_texture_array): @@ -766,9 +766,9 @@ Issues RESOLVED. A new query is added. (5) How are array textures exposed in GLSL? - + RESOLVED. Use GL_EXT_texture_array. - + (6) Should a 1D array texture also be exposed? RESOLVED. For orthogonality, yes. @@ -781,7 +781,7 @@ Issues two-dimensional texture. (8) How is this extension related to GL_EXT_texture_array? - + This extension adapats GL_MESAX_texture_stack to the notation, indexing, and FBO access of GL_EXT_texture_array. This extension replaces the GLSL support of GL_EXT_texture_array with diff --git a/docs/MESA_ycbcr_texture.spec b/docs/MESA_ycbcr_texture.spec index 0fa1f7b..f7b4d38 100644 --- a/docs/MESA_ycbcr_texture.spec +++ b/docs/MESA_ycbcr_texture.spec @@ -77,7 +77,7 @@ Additions to Chapter 3 of the OpenGL 1.4 Specification (Rasterization) In section 3.6.4, Rasterization of Pixel Rectangles, on page 101, add the following to Table 3.8 (Packed pixel formats): - + type Parameter GL Data Number of Matching Token Name Type Components Pixel Formats -------------- ------- ---------- ------------- @@ -94,7 +94,7 @@ Additions to Chapter 3 of the OpenGL 1.4 Specification (Rasterization) +-------------------------------+-------------------------------+ | 1st | 2nd | +-------------------------------+-------------------------------+ - + UNSIGNED_SHORT_8_8_REV_MESA: 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 @@ -187,7 +187,7 @@ Errors INVALID_OPERATION is generated by CopyTexSubImage2D if the internal image is YCBCR_MESA. - + New State Edit table 6.16 on page 231: change the type of TEXTURE_INTERNAL_FORMAT diff --git a/docs/README.3DFX b/docs/README.3DFX index 7feda6f..4c43a81 100644 --- a/docs/README.3DFX +++ b/docs/README.3DFX @@ -120,7 +120,7 @@ SSTH3_SLI_AA_CONFIGURATION "5" - 4-way SLI enabled, AA disabled "6" - 4-way SLI enabled, 2 sample AA enabled "7" - 2-way SLI enabled, 4 sample AA enabled - "8" - SLI disabled, 8 sample AA enabled + "8" - SLI disabled, 8 sample AA enabled SST_DUALHEAD OS: win32 HW: ? @@ -338,7 +338,7 @@ Linux: MacOS: ------ Check the WEB page at http://valerie.inf.elte.hu/~boga/Mesa.html - + MS Windows: ----------- @@ -394,7 +394,7 @@ Doing more with Mesa & Linux Glide: setenv MESA_GLX_FX fullscreen 2. As root, run a GLX-based program (any GLUT demo on Linux). - + 3. Be careful: once the 3Dfx screen appears you won't be able to see the GLUT windows on your X display. This can make using the mouse tricky! One solution is to hook up your 3Dfx card to @@ -403,7 +403,7 @@ Doing more with Mesa & Linux Glide: setenv SST_VGA_PASS 1 setenv SST_NOSHUTDOWN - + or for the Voodoo2: setenv SSTV2_VGA_PASS 1 @@ -606,7 +606,7 @@ Know BUGS and Problems: - Using polygon offset or stipple polygons; NOTE: this is list is not yet complete. - + Hints and Special Features: --------------------------- @@ -822,7 +822,7 @@ the Mesa mailing list and my driver WEB page David Bucciarelli (davibu@tin.it) -Humanware s.r.l. +Humanware s.r.l. Via XXIV Maggio 62 Pisa, Italy Tel./Fax +39-50-554108 diff --git a/docs/README.AMIWIN b/docs/README.AMIWIN index 47cf696..df83f6f 100644 --- a/docs/README.AMIWIN +++ b/docs/README.AMIWIN @@ -1,6 +1,6 @@ AMIGA AMIWIN PORT of MESA: THE OPENGL SOFTWARE EMULATION ======================================================== -Port by Victor Ng-Thow-Hing (victorng@dgp.toronto.edu) +Port by Victor Ng-Thow-Hing (victorng@dgp.toronto.edu) Original Author (Brian Paul (brianp@ssec.wisc.edu) Dec.1 , 1995: Port of release Mesa 1.2.5 @@ -11,22 +11,22 @@ Nov.25, 1995: Port of release Mesa 1.2.4 HISTORY ======= -As a 3D graphics progammer, I was increasingly frustrated to see OpenGL +As a 3D graphics progammer, I was increasingly frustrated to see OpenGL appearing on so many platforms EXCEPT the Amiga. Up to now, the task of porting OpenGL directly from native Amiga drawing routines seemed like a daunting task. However, two important events made this port possible. -First of all, Brian Paul wrote Mesa, the OpenGL software emulator that -can be found on many platforms - except the Amiga and Atari (who cares -about the latter!). This was pretty ironic considering that Mesa was -originally prototyped on an Amiga! The second great event was when -Holger Kruse developed AmiWin, the X11R6 server for the Amiga (definitely +First of all, Brian Paul wrote Mesa, the OpenGL software emulator that +can be found on many platforms - except the Amiga and Atari (who cares +about the latter!). This was pretty ironic considering that Mesa was +originally prototyped on an Amiga! The second great event was when +Holger Kruse developed AmiWin, the X11R6 server for the Amiga (definitely register for this great piece of software) and released a development kit so one could compile X programs with SAS/C. Since Mesa had X routines as its primitive drawing operations, this made a marriage of Mesa and Amiwin feasible. I copied over the sources from -an ftp site, played with the code, wrote some Smakefiles, and voila, +an ftp site, played with the code, wrote some Smakefiles, and voila, I had OpenGL programs displaying on my Amiga. Although the speed is nothing to be impressed about, this port can be @@ -34,7 +34,7 @@ potentially useful to those who want to quickly test their code in wireframe or perhaps learn more about programming with the OpenGL API. I hope Amiga developers will continue to write excellent software for -their machine, especially more X clients for Amiwin. If you have any +their machine, especially more X clients for Amiwin. If you have any solutions so some of my problems in the porting notes, please send me some email! @@ -62,7 +62,7 @@ Study the Smakefiles in the demos, samples and book directories for the proper SAS/C options and linkable libraries to use. Basically aux calls require Mesaaux.LIB, gl calls require MesaGL.LIB, glu calls MesaGLU.LIB, tk calls Mesatk.LIB. There is a preliminary port of MesaGLUT.LIB toolkit -available in the lib directory with the other Mesa libraries. However, +available in the lib directory with the other Mesa libraries. However, it seems to cause crashes on some of the sample code. Someone else may want to attempt a more stable port. @@ -70,7 +70,7 @@ PORTING NOTES TO AMIWIN ======================= My strategy of porting was to leave as much of the code untouched as -possible. I surrounded any amiga specific changes with +possible. I surrounded any amiga specific changes with #ifdef AMIWIN ... #endif or #ifndef AMIWIN ... #endif preprocessor symbols. The code was ported on an Amiga 2000, with Fusion 40 accelerator and a Picasso II graphics card. The SAS/C 6.56 compiler was used, with @@ -79,7 +79,7 @@ the AmiWin 2.16 X development kit. All compilations were done for a 68040 CPU with 68882 math coprocessor for maximum speed. Please edit the smakefile for other compilers. I wrote smakefiles for the directories I ported. I omitted the Windows -and Widgets directories. The former is for MS Windows and the latter +and Widgets directories. The former is for MS Windows and the latter requires Motif, which is not easily available for the Amiga. Here are the changes I did per directory: @@ -92,25 +92,25 @@ Nov. 25, 1995 v 1.2.4 * mesa/include Dec. 1, 1995 v 1.2.5 - - added the following to GL/xmesa.h + - added the following to GL/xmesa.h #ifdef AMIWIN #include extern struct Library *XLibBase; #endif NET CHANGE: xmesa.h -* mesa/src +* mesa/src Nov. 25, 1995 v 1.2.4 - added the necessary pragma calls for X functions to the following: - xmesa1.c, xmesa2.c, xmesa3.c, xfonts.c, glx.c - This prevents undefined symbols errors during the linking phase for + xmesa1.c, xmesa2.c, xmesa3.c, xfonts.c, glx.c + This prevents undefined symbols errors during the linking phase for X library calls - created smakefile Dec. 1, 1995 v 1.2.5 - - removed AMIWIN includes from xmesa1.c, xmesa2.c, xmesa3.c, xfonts.c, + - removed AMIWIN includes from xmesa1.c, xmesa2.c, xmesa3.c, xfonts.c, glx.c since they are now defined in include/GL/xmesa.h NET CHANGE: smakefile - + * mesa/src-tk Nov. 25, 1995 v 1.2.4 - added the necessary pragma calls for X functions to the following: @@ -138,7 +138,7 @@ Nov. 25, 1995 v 1.2.4 - added the necessary pragma calls for X functions to the following: xdemo.c, glxdemo.c, offset.c - created smakefile - - put #ifndef AMIWIN ... #endif around sleep() calls in xdemo.c since + - put #ifndef AMIWIN ... #endif around sleep() calls in xdemo.c since they are not part of AmigaDOS. Dec. 1, 1995 v 1.2.5 - removed AMIWIN defines from xdemo.c, glxdemo.c, offset.c since @@ -157,7 +157,7 @@ Nov. 25, 1995 v 1.2.4 - put #ifndef AMIWIN ... #endif around sleep() in blendxor.c - removed olympic from smakefile targets since not defined Dec. 1, 1995 v 1.2.5 - - removed AMIWIN defines from oglinfo.c, since already defined in + - removed AMIWIN defines from oglinfo.c, since already defined in include/GL/xmesa.h - modified Smakefile to include header and includes from the AmiTCP4.0 net.lib linkable library to provide unix-compatible sys/time.h and @@ -177,5 +177,5 @@ NET CHANGE: smakefile * mesa/windows Dec. 1, 1995 v 1.2.5 -- Removed directory to save space since this is only needed for Windows based +- Removed directory to save space since this is only needed for Windows based machines. diff --git a/docs/README.BEOS b/docs/README.BEOS index efd84e8..857e4c6 100644 --- a/docs/README.BEOS +++ b/docs/README.BEOS @@ -29,7 +29,7 @@ working. No optimizations have been made at this time. * Compiling Since Mesa 6.x, it can be build under BeOS with both the R5 builtin gcc version -or more recent gcc versions available for BeOS, like this gcc version 2.95.3 for BeOS +or more recent gcc versions available for BeOS, like this gcc version 2.95.3 for BeOS you can find at http://www.bebits.com/app/2157. Anyway, keep in mind that to take full advantage of Mesa x86 optimizations, you better want to use gcc 2.95.3 or sooner versions... @@ -51,9 +51,9 @@ and force make to move on next target by adding the -k make option: $ cd progs $ make -k -To install it as Be's default libGL.so replacement, put it in your -/boot/home/config/lib/ directory. All your GL/GLUT apps will use -the Mesa based then. +To install it as Be's default libGL.so replacement, put it in your +/boot/home/config/lib/ directory. All your GL/GLUT apps will use +the Mesa based then. By default, it build a non-debug version library. The x86 (MMX, SSE and 3DNOW) optimizations are also supported for x86 target. @@ -74,11 +74,11 @@ They all should have been compiled along with the Mesa library. * GLUT -A beta version of GLUT 3.7 port for BeOS, made by Jake Hamby, can be found at +A beta version of GLUT 3.7 port for BeOS, made by Jake Hamby, can be found at http://anobject.com/jehamby/Code/Glut-3.7-x86.zip. This is the version currently included in Mesa source code, and build in lib/libglut.so. - + A previous 3.5 version of this GLUT BeOS port used to be available at http://home.beoscentral.com/jehamby/Glut-3.5-x86.zip. diff --git a/docs/README.CYGWIN b/docs/README.CYGWIN index 58d5af3..31b72ae 100644 --- a/docs/README.CYGWIN +++ b/docs/README.CYGWIN @@ -5,9 +5,9 @@ WARNING ======= -If you installed X11 (packages xorg-x11-devel and xorg-x11-bin-dlls ) with the -latest setup.exe from Cygwin the GL (Mesa) libraries and include are already -installed in /usr/X11R6. +If you installed X11 (packages xorg-x11-devel and xorg-x11-bin-dlls ) with the +latest setup.exe from Cygwin the GL (Mesa) libraries and include are already +installed in /usr/X11R6. The following will explain how to "replace" them. @@ -19,7 +19,7 @@ How to compile Mesa on Cygwin/X11 systems: 1. Shared libs: type 'make cygwin-sl'. - When finished, the Mesa DLL will be in the Mesa-x.y/lib/ and + When finished, the Mesa DLL will be in the Mesa-x.y/lib/ and Mesa-x.y/bin directories. @@ -59,10 +59,10 @@ Configuration options: Shared libraries: - If you compile shared libraries (Win32 DLLS) you may have to set an - environment variable to specify where the Mesa libraries are located. - Set the PATH variable to include /your-dir/Mesa-2.6/bin. - Otherwise, when you try to run a demo it may fail with a message saying + If you compile shared libraries (Win32 DLLS) you may have to set an + environment variable to specify where the Mesa libraries are located. + Set the PATH variable to include /your-dir/Mesa-2.6/bin. + Otherwise, when you try to run a demo it may fail with a message saying that one or more DLL couldn't be found. @@ -119,7 +119,7 @@ Double buffering: XImage is faster when Mesa has to do pixel-by-pixel rendering. If you need depth buffering the XImage will almost surely be faster. Exper- iment with the MESA_BACK_BUFFER variable to see which is faster for - your application. + your application. Colormaps: @@ -196,7 +196,7 @@ Extensions ========== There are three Mesa-specific GLX extensions at this time. - GLX_MESA_pixmap_colormap + GLX_MESA_pixmap_colormap This extension adds the GLX function: diff --git a/docs/README.GGI b/docs/README.GGI index ddb6772..c9425f0 100644 --- a/docs/README.GGI +++ b/docs/README.GGI @@ -6,7 +6,7 @@ LibGGI 2.0 or greater Installation: ------------- -To install GGIMesa, follow the instructions in INSTALL.GNU. If you +To install GGIMesa, follow the instructions in INSTALL.GNU. If you wish to install GGIGLUT as well, first install GGIMesa and then run make @@ -17,7 +17,7 @@ in ggi/ggiglut. Notes: ------ -* Set the environment variables GGIMESA_DEBUG and/or GGIGLUT_DEBUG +* Set the environment variables GGIMESA_DEBUG and/or GGIGLUT_DEBUG to 255 to see lots of debugging output. * GGIGLUT contains support for all of the GLUT 3.6 API except for the diff --git a/docs/README.LYNXOS b/docs/README.LYNXOS index e3ab980..cf26b2a 100644 --- a/docs/README.LYNXOS +++ b/docs/README.LYNXOS @@ -3,17 +3,17 @@ Mesa 3.0 for LynxOS builds in the following way: make lynxos -This will build all the libraries and demo applications. You should have -around 400 megabytes free for everything since everything is done with +This will build all the libraries and demo applications. You should have +around 400 megabytes free for everything since everything is done with static libraries. -Before using this make file however, you should perform the following +Before using this make file however, you should perform the following actions: 0) cd to the Mesa-3.0 directory 1) Copy the GL directory under the include directory to /usr/include. 2) Copy the files in the lib directory to /lib. -3) Make links so that the Mesa libraries look like ordinary OpenGL +3) Make links so that the Mesa libraries look like ordinary OpenGL libraries in /lib. This is important for compatibility with other OpenGL apps. This is done as follows: @@ -53,7 +53,7 @@ all: $(STANDARD_OFILES) ----cut here for Makefile----- -I have tested Mesa under LynxOS 3.0 and 3.01. It should build fine under +I have tested Mesa under LynxOS 3.0 and 3.01. It should build fine under other versions as well. Note, however, that LynxOS versions prior to 3.0 are not binary compatible, so you will have to rebuild from source. diff --git a/docs/README.MINGW32 b/docs/README.MINGW32 index 9477b2b..e1f4f09 100644 --- a/docs/README.MINGW32 +++ b/docs/README.MINGW32 @@ -73,7 +73,7 @@ Targets and Environment variables used for Mingw build: X86=1 optimize for x86 (if possible, use MMX, SSE, 3DNow). default = no - + Running the Build: Launch Mingw. @@ -99,22 +99,22 @@ Updated on 2007-7-21 Notice: 1) The generated DLLs are *not* compatible with the ones built -with the other compilers like VC8, especially for GLUT. +with the other compilers like VC8, especially for GLUT. 2) Although more tests are needed, it can be used individually! - 3) You can set the options about whether using STDCALL to build MESA. The + 3) You can set the options about whether using STDCALL to build MESA. The config file is \configs\config.mgw. The default setting is that: ALL_USING_STDCALL = 1 -, which means using STDCALL to build MESA. +, which means using STDCALL to build MESA. - 4) Of course, you can MESA without using STDCALL,I like this:) + 4) Of course, you can MESA without using STDCALL,I like this:) The setting is : ALL_USING_STDCALL = 0 -To do this, however, you must modify wingdi.h which is in MingW's include dir. +To do this, however, you must modify wingdi.h which is in MingW's include dir. For example, run: notepad C:\MingW\include\wingdi.h -, and delete all the lines where all the wgl*() functions are. Because they would +, and delete all the lines where all the wgl*() functions are. Because they would be conflicted with the ones in \include\GL\mesa_wgl.h. >>>>>>>>>> Conflicted Functions List >>>>>>>>>> @@ -141,13 +141,13 @@ WINGDIAPI BOOL WINAPI wglUseFontOutlinesW(HDC,DWORD,DWORD,DWORD,FLOAT,FLOAT,int, ==================== Updated on 2007-7-22 ==================== - I havn't thought that I would find a better way to solve my problems so soon. + I havn't thought that I would find a better way to solve my problems so soon. I changed the method in which the import-libs and DLLs are made. After this update, -the DLLs of MESA are more optimized and more compatible. - It seems that there is no need to keep the building way of 'NO-STDCALL'.The -way of USING_STDCALL is so nice! The file \configs\config.mgw is +the DLLs of MESA are more optimized and more compatible. + It seems that there is no need to keep the building way of 'NO-STDCALL'.The +way of USING_STDCALL is so nice! The file \configs\config.mgw is also not needed, and can be deleted safely! - + ********************************************************************************* \ No newline at end of file diff --git a/docs/README.MITS b/docs/README.MITS index a89176a..4b0327d 100644 --- a/docs/README.MITS +++ b/docs/README.MITS @@ -14,7 +14,7 @@ http://10-dencies.zkm.de/~mesa/ Version 0.1 (Yes it's very alpha code so be warned!) -Contributors: +Contributors: Emil Briggs (briggs@bucky.physics.ncsu.edu) David Bucciarelli (tech.hmw@plus.it) Andreas Schiffler (schiffler@zkm.de) diff --git a/docs/README.OS2 b/docs/README.OS2 index b3374ea..306e17b 100644 --- a/docs/README.OS2 +++ b/docs/README.OS2 @@ -60,17 +60,17 @@ 3) History Initially Darren Abbott (abbott@hiwaay.net) ported Mesa versions 2.x - to XFree86 OS/2. This port might still be available from + to XFree86 OS/2. This port might still be available from http://fly.HiWAAY.net/~abbott/xfree86-os2/xfree86.html - The current port picked up things during the beta test for 3.0. + The current port picked up things during the beta test for 3.0. No major changes in the source were done. The build mechanism under OS/2 has been made very similar to other platforms (if you treat mklib-emx.cmd as a "black box"). Advantage is that X/2 is now a valid target and all files are integrated in the official source distribution. Disadvantage is that this port (i.e. the DLLs' interface itself) is - definitly NOT COMPATIBLE to those of version 2.x. + definitly NOT COMPATIBLE to those of version 2.x. It's uncertain whether this would be at all possible but since there a _very_ few those apps it's not worth to find out anyway. Also some libs (MesaTK, MesaAUX) are withdrawn from the Mesa distribution, @@ -89,7 +89,7 @@ http://www.mesa3d.org/ The OS/2 ports should be available from - http://r350.ee.ntu.edu.tw/~hcchu/os2/ports + http://r350.ee.ntu.edu.tw/~hcchu/os2/ports -- Alexander Mai diff --git a/docs/README.OpenStep b/docs/README.OpenStep index a566eca..cfad0a0 100644 --- a/docs/README.OpenStep +++ b/docs/README.OpenStep @@ -11,7 +11,7 @@ system, the Rhapsody/Mac OS X system and also the windows implementations of the latter two systems. This version of the code has been compiled and tested under the following architectures: - NextStep 3.3 + NextStep 3.3 OpenStep 4.2 Rhapsody DR2 WebObjects for NT 3.5 diff --git a/docs/README.QUAKE b/docs/README.QUAKE index e90c76a..ff01f38 100644 --- a/docs/README.QUAKE +++ b/docs/README.QUAKE @@ -58,10 +58,10 @@ info: > uses the libc5 libraries in /usr/i486-linux-libc5/lib for programs > linked against libc5 while it uses the glibc libraries in /lib and > /usr/lib for programs linked against glibc. -> +> > Anyway I changed line 41 of mklib.glide to > GLIDELIBS="-L/usr/local/glide/lib -lglide2x -L/usr/i486-linux-libc5/lib" -> +> > And I started quake2 up with a script like this > #!/bin/csh > setenv LD_LIBRARY_PATH /usr/i486-linux-libc5/lib @@ -90,7 +90,7 @@ libc5 libraries. What can you do about it? Well there's a package called gcc5 that does MOST of the right stuff to compile with libc5. (It brings back older header files, makes appropriate symbolic links for libraries, and sets -up the compiler to use the correct directories) You can find gcc5 here: +up the compiler to use the correct directories) You can find gcc5 here: ftp://ecg.mit.edu/pub/linux/gcc5-1.0-1.i386.rpm No, this isn't quite enough. There are still a few tricks to getting @@ -102,7 +102,7 @@ to use the glibc version of things) If you get all the stuff correctly compiled with gcc5 it should work. I've run Mesa 3.0B6 and its demos in a window with my Rush on a Red Hat 5.1 system. It is a big hassle, but it can be done. I've only made Quake -segfault, but I think that's from my libRush using the wrong libc. +segfault, but I think that's from my libRush using the wrong libc. Yes, mixing libc5 and glibc is a major pain. I've been working to get all my libraries compiling correctly with this setup. Someone should diff --git a/docs/README.THREADS b/docs/README.THREADS index fb6e0ff..336dd73 100644 --- a/docs/README.THREADS +++ b/docs/README.THREADS @@ -28,7 +28,7 @@ necessary for both Mesa and application code to use the same threads API. So, if your application uses Sun's thread API, then you should build Mesa using one of the targets for Sun threads. -The mtdemos directory contains some example programs which use +The mtdemos directory contains some example programs which use multiple threads to render to osmesa rendering context(s). Linux users should be aware that there exist many different POSIX diff --git a/docs/README.VMS b/docs/README.VMS index 6b02909..1ba73f3 100644 --- a/docs/README.VMS +++ b/docs/README.VMS @@ -27,7 +27,7 @@ To get a static library make it by typing MMS/MACRO=(NOSHARE=1). On VAX platforms only static libraries can be build. 23-sep-2005 -changed default compilation to use /float=ieee/ieee=denorm. The reason for +changed default compilation to use /float=ieee/ieee=denorm. The reason for this is that it makes Mesa on OpenVMS better compatible with other platforms and other packages for VMS that I maintain. For more information see diff --git a/docs/README.WIN32 b/docs/README.WIN32 index 204b8e6..4948160 100644 --- a/docs/README.WIN32 +++ b/docs/README.WIN32 @@ -71,7 +71,7 @@ below. GLUT and Demos ---- --- ----- -A Visual Studio workspace can be found at +A Visual Studio workspace can be found at windows/VC8/progs/progs.sln diff --git a/docs/README.WINDML b/docs/README.WINDML index 448db71..16da9db 100644 --- a/docs/README.WINDML +++ b/docs/README.WINDML @@ -5,8 +5,8 @@ Requirements ------------ -Tornado 2 + WindML, Cumulative Patchs are recommended. - +Tornado 2 + WindML, Cumulative Patchs are recommended. + I suppose you have a valid WindML installation. Double buffer hardware gives better performance than double buffer software so if you can compile your WindML driver with this option, just do it. I/O @@ -32,7 +32,7 @@ Installation set MESA_BASE=C:\Mesa OR copy the new torVars.bat in your bin path: -c:/Mesa/src/ugl/tornado/torVars.sample -> +c:/Mesa/src/ugl/tornado/torVars.sample -> /mnt/nt/Tornado/host/x86-win32/bin/torVars (for example) 3. In a command prompt: diff --git a/docs/RELNOTES-3.2.1 b/docs/RELNOTES-3.2.1 index d34efcc..40723f3 100644 --- a/docs/RELNOTES-3.2.1 +++ b/docs/RELNOTES-3.2.1 @@ -21,7 +21,7 @@ bugs. Mesa implements GLU 1.1. Ideally, people should use the GLU 1.3 library included in SGI's -OpenGL Sample Implementation (SI) available from +OpenGL Sample Implementation (SI) available from http://oss.sgi.com/projects/ogl-sample/ People are working to make easy-to-install Linux RPMs of the GLU library. diff --git a/docs/RELNOTES-5.1 b/docs/RELNOTES-5.1 index aed6e10..5c9ae91 100644 --- a/docs/RELNOTES-5.1 +++ b/docs/RELNOTES-5.1 @@ -98,7 +98,7 @@ With the addition of GL_ARB_occlusion_query, GL_ARB_vertex_buffer_object, GL_ARB_texture_non_power_of_two and GL_EXT_shadow_funcs, Mesa 5.1 supports all the new features of OpenGL 1.5. Mesa 6.0 (the next stable release) will advertise GL_VERSION = "1.5". - + Vertex/Fragment program debugger diff --git a/docs/RELNOTES-6.4 b/docs/RELNOTES-6.4 index 1a945a1..1e2f16b 100644 --- a/docs/RELNOTES-6.4 +++ b/docs/RELNOTES-6.4 @@ -33,7 +33,7 @@ DRI drivers varies with the driver XMesa (Xlib) implements OpenGL 1.5 OSMesa (off-screen) implements OpenGL 1.5 Windows/Win32 implements OpenGL 1.5 -Glide (3dfx Voodoo1/2) requires updates +Glide (3dfx Voodoo1/2) requires updates SVGA requires updates DJGPP requires updates GGI requires updates diff --git a/docs/cell.html b/docs/cell.html index 30626b6..ceea562 100644 --- a/docs/cell.html +++ b/docs/cell.html @@ -11,7 +11,7 @@

Mesa/Gallium Cell Driver

The Mesa Cell -driver is part of the +driver is part of the Gallium3D architecture. Tungsten Graphics did the original implementation of the Cell driver. diff --git a/docs/devinfo.html b/docs/devinfo.html index 2d1c125..bde923b 100644 --- a/docs/devinfo.html +++ b/docs/devinfo.html @@ -198,7 +198,7 @@

Update the website and announce the release

-Update the web site by copying the docs/ directory's files to +Update the web site by copying the docs/ directory's files to /home/users/b/br/brianp/mesa-www/htdocs/ with:
diff --git a/docs/dispatch.html b/docs/dispatch.html index e5587c1..1d1a432 100644 --- a/docs/dispatch.html +++ b/docs/dispatch.html @@ -75,7 +75,7 @@

2. Overview of Mesa's Implementation

void glVertex3f(GLfloat x, GLfloat y, GLfloat z) { const struct _glapi_table * const dispatch = GET_DISPATCH(); - + (*dispatch->Vertex3f)(x, y, z); } Sample dispatch function diff --git a/docs/fbdev-dri.html b/docs/fbdev-dri.html index 0eea5e8..c81dee6 100644 --- a/docs/fbdev-dri.html +++ b/docs/fbdev-dri.html @@ -67,7 +67,7 @@

2.2 libpciaccess

sudo apt-get install autoconf
 
-The next step is to install the libpciaccess library. +The next step is to install the libpciaccess library.
make
 make install
 
@@ -136,7 +136,7 @@

2.4 Mesa

Copy the miniglx folder from 7.1-prerelease to 7.0.3. -You may also extract GLUT to 7.0.3 version at this step. +You may also extract GLUT to 7.0.3 version at this step.

Edit linux-solo.conf at /conf directory, just only compile the diff --git a/docs/install.html b/docs/install.html index bfa3bb8..e8c594b 100644 --- a/docs/install.html +++ b/docs/install.html @@ -119,7 +119,7 @@

1.4 Building with traditional Makefiles

make linux-dri

-There are also linux-dri-x86, linux-dri-x86-64, +There are also linux-dri-x86, linux-dri-x86-64, and linux-ppc configurations which are optimized for those architectures.

@@ -305,7 +305,7 @@

3. Building with SCons

This will create:

    -
  • build/windows-x86-debug/gallium/targets/libgl-gdi/opengl32.dll — Mesa + Gallium + softpipe, binary compatible with Windows's opengl32.dll +
  • build/windows-x86-debug/gallium/targets/libgl-gdi/opengl32.dll — Mesa + Gallium + softpipe, binary compatible with Windows's opengl32.dll
  • build/windows-x86-debug/glut/glx/glut32.dll
  • progs/build/windows-x86-debug/wgl/wglinfo.exe
  • progs/build/windows-x86-debug/trivial/tri.exe diff --git a/docs/intro.html b/docs/intro.html index 0806caf..ab03922 100644 --- a/docs/intro.html +++ b/docs/intro.html @@ -21,10 +21,10 @@

    Introduction

    -Mesa ties into several other open-source projects: the -Direct Rendering -Infrastructure and X.org to -provide OpenGL support to users of X on Linux, FreeBSD and other operating +Mesa ties into several other open-source projects: the +Direct Rendering +Infrastructure and X.org to +provide OpenGL support to users of X on Linux, FreeBSD and other operating systems.

    diff --git a/docs/lists.html b/docs/lists.html index 1487891..430aaf4 100644 --- a/docs/lists.html +++ b/docs/lists.html @@ -49,7 +49,7 @@

    Mailing Lists

    -

    For mailing lists about Direct Rendering Modules (drm) in Linux/BSD +

    For mailing lists about Direct Rendering Modules (drm) in Linux/BSD kernels, see the DRI wiki. diff --git a/docs/relnotes-6.4.1.html b/docs/relnotes-6.4.1.html index 3d6ff1c..2325d8f 100644 --- a/docs/relnotes-6.4.1.html +++ b/docs/relnotes-6.4.1.html @@ -55,7 +55,7 @@

    Driver Status

    XMesa (Xlib) implements OpenGL 1.5 OSMesa (off-screen) implements OpenGL 1.5 Windows/Win32 implements OpenGL 1.5 -Glide (3dfx Voodoo1/2) requires updates +Glide (3dfx Voodoo1/2) requires updates SVGA requires updates DJGPP requires updates GGI requires updates diff --git a/docs/relnotes-6.4.2.html b/docs/relnotes-6.4.2.html index f5a658f..9eee48f 100644 --- a/docs/relnotes-6.4.2.html +++ b/docs/relnotes-6.4.2.html @@ -62,7 +62,7 @@

    Driver Status

    XMesa (Xlib) implements OpenGL 1.5 OSMesa (off-screen) implements OpenGL 1.5 Windows/Win32 implements OpenGL 1.5 -Glide (3dfx Voodoo1/2) requires updates +Glide (3dfx Voodoo1/2) requires updates SVGA requires updates DJGPP requires updates GGI requires updates diff --git a/docs/relnotes-6.4.html b/docs/relnotes-6.4.html index 1fffa27..4e1bff7 100644 --- a/docs/relnotes-6.4.html +++ b/docs/relnotes-6.4.html @@ -77,7 +77,7 @@

    Driver Status

    XMesa (Xlib) implements OpenGL 1.5 OSMesa (off-screen) implements OpenGL 1.5 Windows/Win32 implements OpenGL 1.5 -Glide (3dfx Voodoo1/2) requires updates +Glide (3dfx Voodoo1/2) requires updates SVGA requires updates DJGPP requires updates GGI requires updates diff --git a/docs/relnotes-6.5.2.html b/docs/relnotes-6.5.2.html index db2038a..8d114bc 100644 --- a/docs/relnotes-6.5.2.html +++ b/docs/relnotes-6.5.2.html @@ -45,7 +45,7 @@

    New features

  • ARB_pixel_buffer_objects
  • Accelerated CopyTexSubimage, DrawPixels, ReadPixels, CopyPixels
  • Accelerated texture uploads from pixel buffer objects -
  • Potentially texturing directly from the pixel buffer object (zero +
  • Potentially texturing directly from the pixel buffer object (zero copy texturing).
  • New Intel i965 DRI driver diff --git a/docs/relnotes-7.8.3.html b/docs/relnotes-7.8.3.html index 1e9f433..e733d75 100644 --- a/docs/relnotes-7.8.3.html +++ b/docs/relnotes-7.8.3.html @@ -51,7 +51,7 @@

    Changes

    Bug fixes

  • glut - Mark Kilgard's OpenGL OpenGL Utility Toolkit library
  • glx - The GLX library code for building libGL. This is used for - direct rendering drivers. It will dynamically load one of the + direct rendering drivers. It will dynamically load one of the xxx_dri.so drivers.
  • glw - Widgets for Xt/Motif.
  • glew - OpenGL Extension Wrangler library (used by demo programs) diff --git a/docs/versions.html b/docs/versions.html index 84b40fd..5f68a6f 100644 --- a/docs/versions.html +++ b/docs/versions.html @@ -594,7 +594,7 @@

    2.6 February 12, 1998

  • v0.22 of 3Dfx Glide driver
  • more X86 assembly language optimizations
  • faster blending for some modes -
  • XMesaSetFXmode() to switch between 3Dfx window and full-screen mode +
  • XMesaSetFXmode() to switch between 3Dfx window and full-screen mode
  • added preliminary thread support
  • added GLX_MESA_copy_sub_buffer extension
  • some clipping optimizations diff --git a/docs/xlibdriver.html b/docs/xlibdriver.html index d95f4d5..7e2f4f7 100644 --- a/docs/xlibdriver.html +++ b/docs/xlibdriver.html @@ -110,7 +110,7 @@

    Colormaps

    When sharing the root colormap, Mesa may be unable to allocate the colors it needs, resulting in poor color quality. This can happen when a large number of colorcells in the root colormap are already allocated. -To prevent colormap sharing in GLUT, set the +To prevent colormap sharing in GLUT, set the MESA_PRIVATE_CMAP environment variable. The value isn't significant.

    @@ -123,7 +123,7 @@

    Gamma Correction

    Mesa. Some systems, such as Silicon Graphics, support gamma correction in hardware (man gamma) so you won't need to use Mesa's gamma facility. Other systems, however, may need gamma adjustment -to produce images which look correct. If you believe that +to produce images which look correct. If you believe that Mesa's images are too dim, read on.

    diff --git a/include/GL/gl.h b/include/GL/gl.h index 8e5f138..0fa7f65 100644 --- a/include/GL/gl.h +++ b/include/GL/gl.h @@ -35,7 +35,7 @@ /********************************************************************** * Begin system-specific stuff. Do not do any of this when building * for SciTech SNAP, as this is all done before this header file is - * included. + * included. */ #if !defined(__SCITECH_SNAP__) @@ -60,7 +60,7 @@ # define GLAPI extern # endif /* _STATIC_MESA support */ # if defined(__MINGW32__) && defined(GL_NO_STDCALL) || defined(UNDER_CE) /* The generated DLLs by MingW with STDCALL are not compatible with the ones done by Microsoft's compilers */ -# define GLAPIENTRY +# define GLAPIENTRY # else # define GLAPIENTRY __stdcall # endif diff --git a/include/GL/glext.h b/include/GL/glext.h index 9818cbc..ef9387b 100644 --- a/include/GL/glext.h +++ b/include/GL/glext.h @@ -7,7 +7,7 @@ extern "C" { /* ** Copyright (c) 2007-2010 The Khronos Group Inc. -** +** ** Permission is hereby granted, free of charge, to any person obtaining a ** copy of this software and/or associated documentation files (the ** "Materials"), to deal in the Materials without restriction, including @@ -15,10 +15,10 @@ extern "C" { ** distribute, sublicense, and/or sell copies of the Materials, and to ** permit persons to whom the Materials are furnished to do so, subject to ** the following conditions: -** +** ** The above copyright notice and this permission notice shall be included ** in all copies or substantial portions of the Materials. -** +** ** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, ** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF ** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. diff --git a/include/GL/glx.h b/include/GL/glx.h index a3a7d97..cf9ff89 100644 --- a/include/GL/glx.h +++ b/include/GL/glx.h @@ -1,19 +1,19 @@ /* * Mesa 3-D graphics library * Version: 6.5 - * + * * Copyright (C) 1999-2006 Brian Paul All Rights Reserved. - * + * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: - * + * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. - * + * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL @@ -465,14 +465,14 @@ typedef int (*PFNGLXGETSWAPINTERVALMESAPROC)(void); #define GLX_FRONT_EXT GLX_FRONT_LEFT_EXT #define GLX_BACK_EXT GLX_BACK_LEFT_EXT #define GLX_AUX0_EXT 0x20E2 -#define GLX_AUX1_EXT 0x20E3 -#define GLX_AUX2_EXT 0x20E4 -#define GLX_AUX3_EXT 0x20E5 -#define GLX_AUX4_EXT 0x20E6 -#define GLX_AUX5_EXT 0x20E7 +#define GLX_AUX1_EXT 0x20E3 +#define GLX_AUX2_EXT 0x20E4 +#define GLX_AUX3_EXT 0x20E5 +#define GLX_AUX4_EXT 0x20E6 +#define GLX_AUX5_EXT 0x20E7 #define GLX_AUX6_EXT 0x20E8 -#define GLX_AUX7_EXT 0x20E9 -#define GLX_AUX8_EXT 0x20EA +#define GLX_AUX7_EXT 0x20E9 +#define GLX_AUX8_EXT 0x20EA #define GLX_AUX9_EXT 0x20EB extern void glXBindTexImageEXT(Display *dpy, GLXDrawable drawable, int buffer, const int *attrib_list); diff --git a/include/GL/glx_mangle.h b/include/GL/glx_mangle.h index fa664a7..65e5488 100644 --- a/include/GL/glx_mangle.h +++ b/include/GL/glx_mangle.h @@ -1,19 +1,19 @@ /* * Mesa 3-D graphics library * Version: 6.5 - * + * * Copyright (C) 1999-2006 Brian Paul All Rights Reserved. - * + * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: - * + * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. - * + * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL @@ -53,26 +53,26 @@ #define glXWaitVideoSyncSGI mglXWaitVideoSyncSGI /* GLX 1.2 */ -#define glXGetCurrentDisplay mglXGetCurrentDisplay +#define glXGetCurrentDisplay mglXGetCurrentDisplay /* GLX 1.3 */ -#define glXChooseFBConfig mglXChooseFBConfig -#define glXGetFBConfigAttrib mglXGetFBConfigAttrib -#define glXGetFBConfigs mglXGetFBConfigs -#define glXGetVisualFromFBConfig mglXGetVisualFromFBConfig -#define glXCreateWindow mglXCreateWindow -#define glXDestroyWindow mglXDestroyWindow -#define glXCreatePixmap mglXCreatePixmap -#define glXDestroyPixmap mglXDestroyPixmap -#define glXCreatePbuffer mglXCreatePbuffer -#define glXDestroyPbuffer mglXDestroyPbuffer -#define glXQueryDrawable mglXQueryDrawable -#define glXCreateNewContext mglXCreateNewContext -#define glXMakeContextCurrent mglXMakeContextCurrent -#define glXGetCurrentReadDrawable mglXGetCurrentReadDrawable -#define glXQueryContext mglXQueryContext -#define glXSelectEvent mglXSelectEvent -#define glXGetSelectedEvent mglXGetSelectedEvent +#define glXChooseFBConfig mglXChooseFBConfig +#define glXGetFBConfigAttrib mglXGetFBConfigAttrib +#define glXGetFBConfigs mglXGetFBConfigs +#define glXGetVisualFromFBConfig mglXGetVisualFromFBConfig +#define glXCreateWindow mglXCreateWindow +#define glXDestroyWindow mglXDestroyWindow +#define glXCreatePixmap mglXCreatePixmap +#define glXDestroyPixmap mglXDestroyPixmap +#define glXCreatePbuffer mglXCreatePbuffer +#define glXDestroyPbuffer mglXDestroyPbuffer +#define glXQueryDrawable mglXQueryDrawable +#define glXCreateNewContext mglXCreateNewContext +#define glXMakeContextCurrent mglXMakeContextCurrent +#define glXGetCurrentReadDrawable mglXGetCurrentReadDrawable +#define glXQueryContext mglXQueryContext +#define glXSelectEvent mglXSelectEvent +#define glXGetSelectedEvent mglXGetSelectedEvent /* GLX 1.4 */ #define glXGetProcAddress mglXGetProcAddress diff --git a/include/GL/glxext.h b/include/GL/glxext.h index 3c47dc3..e2851e4 100644 --- a/include/GL/glxext.h +++ b/include/GL/glxext.h @@ -7,7 +7,7 @@ extern "C" { /* ** Copyright (c) 2007-2010 The Khronos Group Inc. -** +** ** Permission is hereby granted, free of charge, to any person obtaining a ** copy of this software and/or associated documentation files (the ** "Materials"), to deal in the Materials without restriction, including @@ -15,10 +15,10 @@ extern "C" { ** distribute, sublicense, and/or sell copies of the Materials, and to ** permit persons to whom the Materials are furnished to do so, subject to ** the following conditions: -** +** ** The above copyright notice and this permission notice shall be included ** in all copies or substantial portions of the Materials. -** +** ** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, ** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF ** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. diff --git a/include/GL/internal/dri_interface.h b/include/GL/internal/dri_interface.h index 9ee039b..65ce9a3 100644 --- a/include/GL/internal/dri_interface.h +++ b/include/GL/internal/dri_interface.h @@ -31,7 +31,7 @@ * between a DRI driver and driver loader. Currently, the most common driver * loader is the XFree86 libGL.so. However, other loaders do exist, and in * the future the server-side libglx.a will also be a loader. - * + * * \author Kevin E. Martin * \author Ian Romanick * \author Kristian Høgsberg @@ -158,14 +158,14 @@ struct __DRIframeTrackingExtensionRec { /** * Enable or disable frame usage tracking. - * + * * \since Internal API version 20030317. */ int (*frameTracking)(__DRIdrawable *drawable, GLboolean enable); /** * Retrieve frame usage information. - * + * * \since Internal API version 20030317. */ int (*queryFrameTracking)(__DRIdrawable *drawable, @@ -232,7 +232,7 @@ struct __DRItexBufferExtensionRec { /** * Method to override base texture image with the contents of a - * __DRIdrawable. + * __DRIdrawable. * * For GLX_EXT_texture_from_pixmap with AIGLX. Deprecated in favor of * setTexBuffer2 in version 2 of this interface @@ -335,7 +335,7 @@ struct __DRIsystemTimeExtensionRec { /** * Get the media stream counter (MSC) rate. - * + * * Matching the definition in GLX_OML_sync_control, this function returns * the rate of the "media stream counter". In practical terms, this is * the frame refresh rate of the display. @@ -492,7 +492,7 @@ struct __DRIuseInvalidateExtensionRec { #define __DRI_ATTRIB_YINVERTED 47 /* __DRI_ATTRIB_RENDER_TYPE */ -#define __DRI_ATTRIB_RGBA_BIT 0x01 +#define __DRI_ATTRIB_RGBA_BIT 0x01 #define __DRI_ATTRIB_COLOR_INDEX_BIT 0x02 #define __DRI_ATTRIB_LUMINANCE_BIT 0x04 @@ -566,7 +566,7 @@ struct __DRIcoreExtensionRec { /** * Stored version of some component (i.e., server-side DRI module, kernel-side * DRM, etc.). - * + * * \todo * There are several data structures that explicitly store a major version, * minor version, and patch level. These structures should be modified to @@ -581,7 +581,7 @@ struct __DRIversionRec { /** * Framebuffer information record. Used by libGL to communicate information * about the framebuffer to the driver's \c __driCreateNewScreen function. - * + * * In XFree86, most of this information is derrived from data returned by * calling \c XF86DRIGetDeviceInfo. * @@ -622,7 +622,7 @@ struct __DRIlegacyExtensionRec { const __DRIversion *dri_version, const __DRIversion *drm_version, const __DRIframebuffer *frame_buffer, - void *pSAREA, int fd, + void *pSAREA, int fd, const __DRIextension **extensions, const __DRIconfig ***driver_configs, void *loaderPrivate); diff --git a/include/GL/internal/sarea.h b/include/GL/internal/sarea.h index a0d6084..74602e3 100644 --- a/include/GL/internal/sarea.h +++ b/include/GL/internal/sarea.h @@ -1,7 +1,7 @@ /** - * \file sarea.h + * \file sarea.h * SAREA definitions. - * + * * \author Kevin E. Martin * \author Jens Owen * \author Rickard E. (Rik) Faith @@ -11,7 +11,7 @@ * Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas. * Copyright 2000 VA Linux Systems, 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 @@ -19,11 +19,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. diff --git a/include/GL/osmesa.h b/include/GL/osmesa.h index 56fa23c..ecb43fd 100644 --- a/include/GL/osmesa.h +++ b/include/GL/osmesa.h @@ -1,19 +1,19 @@ /* * Mesa 3-D graphics library * Version: 6.5 - * + * * Copyright (C) 1999-2005 Brian Paul All Rights Reserved. - * + * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: - * + * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. - * + * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL diff --git a/include/GL/vms_x_fix.h b/include/GL/vms_x_fix.h index 24cba47..443291c 100644 --- a/include/GL/vms_x_fix.h +++ b/include/GL/vms_x_fix.h @@ -698,7 +698,7 @@ #define XtCallCallbackList XTCALLCALLBACKLIST #define XtCallCallbacks XTCALLCALLBACKS #define XtCallConverter XTCALLCONVERTER -#define XtCalloc XTCALLOC +#define XtCalloc XTCALLOC #ifndef NOXTDISPLAY #define XtClass XTCLASS #endif @@ -808,7 +808,7 @@ #define XtSetTypeConverter XTSETTYPECONVERTER #define XtSetValues XTSETVALUES #define XtShellStrings XTSHELLSTRINGS -#define XtStringConversionWarning XTSTRINGCONVERSIONWARNING +#define XtStringConversionWarning XTSTRINGCONVERSIONWARNING #define XtStrings XTSTRINGS #define XtToolkitInitialize XTTOOLKITINITIALIZE #define XtTranslateCoords XTTRANSLATECOORDS @@ -848,11 +848,11 @@ #define _XEatData _XEATDATA #define _XFlush _XFLUSH #define _XFreeTemp _XFREETEMP -#define _XGetAsyncReply _XGETASYNCREPLY +#define _XGetAsyncReply _XGETASYNCREPLY #define _XInitImageFuncPtrs _XINITIMAGEFUNCPTRS #define _XRead _XREAD #define _XReadPad _XREADPAD -#define _XRegisterFilterByType _XREGISTERFILTERBYTYPE +#define _XRegisterFilterByType _XREGISTERFILTERBYTYPE #define _XReply _XREPLY #define _XSend _XSEND #define _XUnregisterFilter _XUNREGISTERFILTER @@ -1204,7 +1204,7 @@ #define xmToggleButtonGadgetClass XMTOGGLEBUTTONGADGETCLASS #define xmToggleButtonWidgetClass XMTOGGLEBUTTONWIDGETCLASS -#if (__VMS_VER < 80200000) +#if (__VMS_VER < 80200000) # define SetReqLen(req,n,badlen) \ if ((req->length + n) > (unsigned)65535) { \ n = badlen; \ diff --git a/include/GL/wglext.h b/include/GL/wglext.h index e60c652..8e06d93 100644 --- a/include/GL/wglext.h +++ b/include/GL/wglext.h @@ -7,7 +7,7 @@ extern "C" { /* ** Copyright (c) 2007-2010 The Khronos Group Inc. -** +** ** Permission is hereby granted, free of charge, to any person obtaining a ** copy of this software and/or associated documentation files (the ** "Materials"), to deal in the Materials without restriction, including @@ -15,10 +15,10 @@ extern "C" { ** distribute, sublicense, and/or sell copies of the Materials, and to ** permit persons to whom the Materials are furnished to do so, subject to ** the following conditions: -** +** ** The above copyright notice and this permission notice shall be included ** in all copies or substantial portions of the Materials. -** +** ** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, ** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF ** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. diff --git a/include/GL/wmesa.h b/include/GL/wmesa.h index f5f4f27..cbc538f 100644 --- a/include/GL/wmesa.h +++ b/include/GL/wmesa.h @@ -27,13 +27,13 @@ * *************************************************************** * WMesa * - * version 2.3 * + * version 2.3 * * * * By * * Li Wei * * Institute of Artificial Intelligence & Robotics * * Xi'an Jiaotong University * - * Email: liwei@aiar.xjtu.edu.cn * + * Email: liwei@aiar.xjtu.edu.cn * * Web page: http://sun.aiar.xjtu.edu.cn * * * * July 7th, 1997 * diff --git a/include/VG/openvg.h b/include/VG/openvg.h index 86d54d6..0e37fe2 100644 --- a/include/VG/openvg.h +++ b/include/VG/openvg.h @@ -13,10 +13,10 @@ * including without limitation the rights to use, copy, modify, merge, * publish, distribute, sublicense, and/or sell copies of the Materials, * and to permit persons to whom the Materials are furnished to do so, - * subject to the following conditions: + * subject to the following conditions: * - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Materials. + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Materials. * * THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF @@ -497,11 +497,11 @@ typedef enum { #endif #ifndef VG_API_ENTRY -# error VG_API_ENTRY must be defined +# error VG_API_ENTRY must be defined #endif #ifndef VG_API_EXIT -# error VG_API_EXIT must be defined +# error VG_API_EXIT must be defined #endif VG_API_CALL VGErrorCode VG_API_ENTRY vgGetError(void) VG_API_EXIT; @@ -645,7 +645,7 @@ VG_API_CALL void VG_API_ENTRY vgGetImageSubData(VGImage image, VGint width, VGint height) VG_API_EXIT; VG_API_CALL VGImage VG_API_ENTRY vgChildImage(VGImage parent, VGint x, VGint y, VGint width, VGint height) VG_API_EXIT; -VG_API_CALL VGImage VG_API_ENTRY vgGetParent(VGImage image) VG_API_EXIT; +VG_API_CALL VGImage VG_API_ENTRY vgGetParent(VGImage image) VG_API_EXIT; VG_API_CALL void VG_API_ENTRY vgCopyImage(VGImage dst, VGint dx, VGint dy, VGImage src, VGint sx, VGint sy, VGint width, VGint height, @@ -684,7 +684,7 @@ VG_API_CALL void VG_API_ENTRY vgSetGlyphToImage(VGFont font, const VGfloat glyphOrigin [2], const VGfloat escapement[2]) VG_API_EXIT; VG_API_CALL void VG_API_ENTRY vgClearGlyph(VGFont font,VGuint glyphIndex) VG_API_EXIT; -VG_API_CALL void VG_API_ENTRY vgDrawGlyph(VGFont font, +VG_API_CALL void VG_API_ENTRY vgDrawGlyph(VGFont font, VGuint glyphIndex, VGbitfield paintModes, VGboolean allowAutoHinting) VG_API_EXIT; @@ -739,7 +739,7 @@ VG_API_CALL VGHardwareQueryResult VG_API_ENTRY vgHardwareQuery(VGHardwareQueryTy /* Renderer and Extension Information */ VG_API_CALL const VGubyte * VG_API_ENTRY vgGetString(VGStringID name) VG_API_EXIT; -#ifdef __cplusplus +#ifdef __cplusplus } /* extern "C" */ #endif diff --git a/include/VG/vgext.h b/include/VG/vgext.h index 9ff3234..49b3bf3 100644 --- a/include/VG/vgext.h +++ b/include/VG/vgext.h @@ -1,7 +1,7 @@ /* $Revision: 6810 $ on $Date:: 2008-10-29 07:31:37 -0700 #$ */ /*------------------------------------------------------------------------ - * + * * VG extensions Reference Implementation * ------------------------------------- * @@ -13,10 +13,10 @@ * including without limitation the rights to use, copy, modify, merge, * publish, distribute, sublicense, and/or sell copies of the Materials, * and to permit persons to whom the Materials are furnished to do so, - * subject to the following conditions: + * subject to the following conditions: * - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Materials. + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Materials. * * THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF @@ -69,7 +69,7 @@ typedef enum { #ifndef VG_KHR_EGL_image #define VG_KHR_EGL_image 1 /* VGEGLImageKHR is an opaque handle to an EGLImage */ -typedef void* VGeglImageKHR; +typedef void* VGeglImageKHR; #ifdef VG_VGEXT_PROTOTYPES VG_API_CALL VGImage VG_API_ENTRY vgCreateEGLImageTargetKHR(VGeglImageKHR image); @@ -84,7 +84,7 @@ typedef VGImage (VG_API_ENTRYP PFNVGCREATEEGLIMAGETARGETKHRPROC) (VGeglImageKHR #ifdef VG_VGEXT_PROTOTYPES VG_API_CALL void vgIterativeAverageBlurKHR(VGImage dst,VGImage src,VGfloat dimX,VGfloat dimY,VGuint iterative,VGTilingMode tilingMode); -#endif +#endif typedef void (VG_API_ENTRYP PFNVGITERATIVEAVERAGEBLURKHRPROC) (VGImage dst,VGImage src,VGfloat dimX,VGfloat dimY,VGuint iterative,VGTilingMode tilingMode); #endif @@ -123,7 +123,7 @@ typedef enum { #endif #ifndef VG_KHR_parametric_filter -#define VG_KHR_parametric_filter 1 +#define VG_KHR_parametric_filter 1 typedef enum { VG_PF_OBJECT_VISIBLE_FLAG_KHR = (1 << 0), @@ -165,7 +165,7 @@ typedef VGUErrorCode (VGU_API_ENTRYP PFNVGUGRADIENTBEVELKHRPROC) (VGImage dst,VG #ifndef VG_NDS_paint_generation #define VG_NDS_paint_generation 1 -typedef enum { +typedef enum { VG_PAINT_COLOR_RAMP_LINEAR_NDS = 0x1A10, VG_COLOR_MATRIX_NDS = 0x1A11, VG_PAINT_COLOR_TRANSFORM_LINEAR_NDS = 0x1A12, @@ -178,7 +178,7 @@ typedef enum { VG_IMAGE_MODE_NDS_FORCE_SIZE = VG_MAX_ENUM } VGImageModeNds; -#endif +#endif #ifndef VG_NDS_projective_geometry @@ -204,7 +204,7 @@ typedef enum { typedef enum { VG_RQUAD_TO_NDS = ( 13 << 1 ), VG_RCUBIC_TO_NDS = ( 14 << 1 ), - + VG_PATH_SEGMENT_NDS_FORCE_SIZE = VG_MAX_ENUM } VGPathSegmentNds; @@ -220,13 +220,13 @@ typedef enum { #ifdef VG_VGEXT_PROTOTYPES VG_API_CALL void VG_API_ENTRY vgProjectiveMatrixNDS(VGboolean enable) ; VGU_API_CALL VGUErrorCode VGU_API_ENTRY vguTransformClipLineNDS(const VGfloat Ain,const VGfloat Bin,const VGfloat Cin,const VGfloat* matrix,const VGboolean inverse,VGfloat* Aout,VGfloat* Bout,VGfloat* Cout); -#endif +#endif typedef void (VG_API_ENTRYP PFNVGPROJECTIVEMATRIXNDSPROC) (VGboolean enable) ; typedef VGUErrorCode (VGU_API_ENTRYP PFNVGUTRANSFORMCLIPLINENDSPROC) (const VGfloat Ain,const VGfloat Bin,const VGfloat Cin,const VGfloat* matrix,const VGboolean inverse,VGfloat* Aout,VGfloat* Bout,VGfloat* Cout); #endif -#ifdef __cplusplus +#ifdef __cplusplus } /* extern "C" */ #endif diff --git a/include/VG/vgplatform.h b/include/VG/vgplatform.h index aa1829f..464b751 100644 --- a/include/VG/vgplatform.h +++ b/include/VG/vgplatform.h @@ -13,10 +13,10 @@ * including without limitation the rights to use, copy, modify, merge, * publish, distribute, sublicense, and/or sell copies of the Materials, * and to permit persons to whom the Materials are furnished to do so, - * subject to the following conditions: + * subject to the following conditions: * - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Materials. + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Materials. * * THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF @@ -40,7 +40,7 @@ extern "C" { #endif -#ifndef VG_API_CALL +#ifndef VG_API_CALL #if defined(OPENVG_STATIC_LIBRARY) # define VG_API_CALL #else @@ -48,7 +48,7 @@ extern "C" { #endif /* defined OPENVG_STATIC_LIBRARY */ #endif /* ifndef VG_API_CALL */ -#ifndef VGU_API_CALL +#ifndef VGU_API_CALL #if defined(OPENVG_STATIC_LIBRARY) # define VGU_API_CALL #else @@ -83,9 +83,9 @@ typedef unsigned int VGbitfield; #ifndef VG_VGEXT_PROTOTYPES #define VG_VGEXT_PROTOTYPES -#endif +#endif -#ifdef __cplusplus +#ifdef __cplusplus } /* extern "C" */ #endif diff --git a/include/VG/vgu.h b/include/VG/vgu.h index da81da9..275fb6f 100644 --- a/include/VG/vgu.h +++ b/include/VG/vgu.h @@ -1,7 +1,7 @@ /* $Revision: 6810 $ on $Date:: 2008-10-29 07:31:37 -0700 #$ */ /*------------------------------------------------------------------------ - * + * * VGU 1.1 Reference Implementation * ------------------------------------- * @@ -13,10 +13,10 @@ * including without limitation the rights to use, copy, modify, merge, * publish, distribute, sublicense, and/or sell copies of the Materials, * and to permit persons to whom the Materials are furnished to do so, - * subject to the following conditions: + * subject to the following conditions: * - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Materials. + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Materials. * * THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF @@ -34,8 +34,8 @@ #ifndef _VGU_H #define _VGU_H -#ifdef __cplusplus -extern "C" { +#ifdef __cplusplus +extern "C" { #endif #include @@ -48,11 +48,11 @@ extern "C" { #endif #ifndef VGU_API_ENTRY -# error VGU_API_ENTRY must be defined +# error VGU_API_ENTRY must be defined #endif #ifndef VGU_API_EXIT -# error VGU_API_EXIT must be defined +# error VGU_API_EXIT must be defined #endif @@ -124,7 +124,7 @@ VGU_API_CALL VGUErrorCode VGU_API_ENTRY vguComputeWarpQuadToQuad(VGfloat dx0, VG VGfloat sx3, VGfloat sy3, VGfloat * matrix) VGU_API_EXIT; -#ifdef __cplusplus +#ifdef __cplusplus } /* extern "C" */ #endif diff --git a/src/egl/drivers/dri2/egl_dri2.c b/src/egl/drivers/dri2/egl_dri2.c index 6f40ab9..b64d567 100644 --- a/src/egl/drivers/dri2/egl_dri2.c +++ b/src/egl/drivers/dri2/egl_dri2.c @@ -190,7 +190,7 @@ dri2_add_config(_EGLDisplay *disp, const __DRIconfig *dri_config, int id, dri2_dpy = disp->DriverData; _eglInitConfig(&base, disp, id); - + i = 0; double_buffer = 0; bind_to_texture_rgb = 0; @@ -206,7 +206,7 @@ dri2_add_config(_EGLDisplay *disp, const __DRIconfig *dri_config, int id, else /* not valid */; _eglSetConfigKey(&base, EGL_COLOR_BUFFER_TYPE, value); - break; + break; case __DRI_ATTRIB_CONFIG_CAVEAT: if (value & __DRI_ATTRIB_NON_CONFORMANT_CONFIG) @@ -351,7 +351,7 @@ dri2_get_buffers(__DRIdrawable * driDrawable, *out_count = reply->count; dri2_surf->base.Width = *width = reply->width; dri2_surf->base.Height = *height = reply->height; - dri2_process_buffers(dri2_surf, buffers, *out_count); + dri2_process_buffers(dri2_surf, buffers, *out_count); free(reply); @@ -430,7 +430,7 @@ dri2_get_buffers_with_format(__DRIdrawable * driDrawable, dri2_surf->base.Width = *width = reply->width; dri2_surf->base.Height = *height = reply->height; *out_count = reply->count; - dri2_process_buffers(dri2_surf, buffers, *out_count); + dri2_process_buffers(dri2_surf, buffers, *out_count); free(reply); @@ -478,7 +478,7 @@ dri2_bind_extensions(struct dri2_egl_display *dri2_dpy, } } } - + for (j = 0; matches[j].name; j++) { field = ((char *) dri2_dpy + matches[j].offset); if (*(const __DRIextension **) field == NULL) { @@ -524,7 +524,7 @@ dri2_connect(struct dri2_egl_display *dri2_dpy) xfixes_query_cookie = xcb_xfixes_query_version(dri2_dpy->conn, XCB_XFIXES_MAJOR_VERSION, XCB_XFIXES_MINOR_VERSION); - + dri2_query_cookie = xcb_dri2_query_version (dri2_dpy->conn, XCB_DRI2_MAJOR_VERSION, XCB_DRI2_MINOR_VERSION); @@ -533,7 +533,7 @@ dri2_connect(struct dri2_egl_display *dri2_dpy) connect_cookie = xcb_dri2_connect_unchecked (dri2_dpy->conn, s.data->root, XCB_DRI2_DRIVER_TYPE_DRI); - + xfixes_query = xcb_xfixes_query_version_reply (dri2_dpy->conn, xfixes_query_cookie, &error); @@ -566,7 +566,7 @@ dri2_connect(struct dri2_egl_display *dri2_dpy) dri2_dpy->device_name = dri2_strndup(xcb_dri2_connect_device_name (connect), xcb_dri2_connect_device_name_length (connect)); - + dri2_dpy->driver_name = dri2_strndup(xcb_dri2_connect_driver_name (connect), xcb_dri2_connect_driver_name_length (connect)); @@ -653,7 +653,7 @@ dri2_add_configs_for_visuals(struct dri2_egl_display *dri2_dpy, } } - xcb_depth_next(&d); + xcb_depth_next(&d); } if (!_eglGetArraySize(disp->Configs)) { @@ -833,7 +833,7 @@ dri2_initialize_x11(_EGLDriver *drv, _EGLDisplay *disp, dri2_dpy->loader_extension.flushFrontBuffer = dri2_flush_front_buffer; dri2_dpy->loader_extension.getBuffersWithFormat = NULL; } - + dri2_dpy->extensions[0] = &dri2_dpy->loader_extension.base; dri2_dpy->extensions[1] = &image_lookup_extension.base; dri2_dpy->extensions[2] = NULL; @@ -1567,14 +1567,14 @@ dri2_create_context(_EGLDriver *drv, _EGLDisplay *disp, _EGLConfig *conf, dri2_dpy->dri2->createNewContextForAPI(dri2_dpy->dri_screen, api, dri_config, - dri2_ctx_shared ? + dri2_ctx_shared ? dri2_ctx_shared->dri_context : NULL, dri2_ctx); } else if (api == __DRI_API_OPENGL) { dri2_ctx->dri_context = dri2_dpy->dri2->createNewContext(dri2_dpy->dri_screen, dri2_config->dri_config, - dri2_ctx_shared ? + dri2_ctx_shared ? dri2_ctx_shared->dri_context : NULL, dri2_ctx); } else { @@ -1603,7 +1603,7 @@ dri2_destroy_surface(_EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *surf) return EGL_TRUE; (*dri2_dpy->core->destroyDrawable)(dri2_surf->dri_drawable); - + xcb_dri2_destroy_drawable (dri2_dpy->conn, dri2_surf->drawable); if (surf->Type == EGL_PBUFFER_BIT) @@ -1700,7 +1700,7 @@ dri2_create_surface(_EGLDriver *drv, _EGLDisplay *disp, EGLint type, _eglError(EGL_BAD_ALLOC, "dri2_create_surface"); return NULL; } - + if (!_eglInitSurface(&dri2_surf->base, disp, type, conf, attrib_list)) goto cleanup_surf; @@ -1715,7 +1715,7 @@ dri2_create_surface(_EGLDriver *drv, _EGLDisplay *disp, EGLint type, dri2_surf->drawable = window; } - dri2_surf->dri_drawable = + dri2_surf->dri_drawable = (*dri2_dpy->dri2->createNewDrawable) (dri2_dpy->dri_screen, dri2_conf->dri_config, dri2_surf); if (dri2_surf->dri_drawable == NULL) { @@ -2103,7 +2103,7 @@ dri2_create_image_khr_renderbuffer(_EGLDisplay *disp, _EGLContext *ctx, if (!_eglInitImage(&dri2_img->base, disp)) return EGL_NO_IMAGE_KHR; - dri2_img->dri_image = + dri2_img->dri_image = dri2_dpy->image->createImageFromRenderbuffer(dri2_ctx->dri_context, renderbuffer, dri2_img); @@ -2259,7 +2259,7 @@ dri2_create_drm_image_mesa(_EGLDriver *drv, _EGLDisplay *disp, valid_mask = EGL_DRM_BUFFER_USE_SCANOUT_MESA | - EGL_DRM_BUFFER_USE_SHARE_MESA; + EGL_DRM_BUFFER_USE_SHARE_MESA; if (attrs.DRMBufferUseMESA & ~valid_mask) { _eglLog(_EGL_WARNING, "bad image use bit 0x%04x", attrs.DRMBufferUseMESA & ~valid_mask); @@ -2272,7 +2272,7 @@ dri2_create_drm_image_mesa(_EGLDriver *drv, _EGLDisplay *disp, if (attrs.DRMBufferUseMESA & EGL_DRM_BUFFER_USE_SCANOUT_MESA) dri_use |= __DRI_IMAGE_USE_SCANOUT; - dri2_img->dri_image = + dri2_img->dri_image = dri2_dpy->image->createImage(dri2_dpy->dri_screen, attrs.Width, attrs.Height, format, dri_use, dri2_img); diff --git a/src/egl/drivers/glx/egl_glx.c b/src/egl/drivers/glx/egl_glx.c index 8ec7c48..de0128f 100644 --- a/src/egl/drivers/glx/egl_glx.c +++ b/src/egl/drivers/glx/egl_glx.c @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ diff --git a/src/egl/main/egldefines.h b/src/egl/main/egldefines.h index 4ecd4c1..03ea047 100644 --- a/src/egl/main/egldefines.h +++ b/src/egl/main/egldefines.h @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ diff --git a/src/egl/main/egldisplay.c b/src/egl/main/egldisplay.c index 565e44d..9a7df62 100644 --- a/src/egl/main/egldisplay.c +++ b/src/egl/main/egldisplay.c @@ -130,7 +130,7 @@ _eglFindDisplay(_EGLPlatformType plat, void *plat_dpy) dpy->Platform = plat; dpy->PlatformDisplay = plat_dpy; - /* add to the display list */ + /* add to the display list */ dpy->Next = _eglGlobal.DisplayList; _eglGlobal.DisplayList = dpy; } @@ -216,7 +216,7 @@ EGLBoolean _eglCheckResource(void *res, _EGLResourceType type, _EGLDisplay *dpy) { _EGLResource *list = dpy->ResourceLists[type]; - + if (!res) return EGL_FALSE; diff --git a/src/egl/main/eglmisc.c b/src/egl/main/eglmisc.c index bbb96a9..5e60d1d 100644 --- a/src/egl/main/eglmisc.c +++ b/src/egl/main/eglmisc.c @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ diff --git a/src/egl/main/eglmisc.h b/src/egl/main/eglmisc.h index a753307..a9688b3 100644 --- a/src/egl/main/eglmisc.h +++ b/src/egl/main/eglmisc.h @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ diff --git a/src/gallium/SConscript b/src/gallium/SConscript index 0efab83..c526251 100644 --- a/src/gallium/SConscript +++ b/src/gallium/SConscript @@ -1,6 +1,6 @@ Import('env') -# +# # Auxiliary modules # @@ -11,20 +11,20 @@ SConscript('auxiliary/SConscript') # SConscript([ - 'drivers/failover/SConscript', + 'drivers/failover/SConscript', 'drivers/galahad/SConscript', - 'drivers/identity/SConscript', - 'drivers/llvmpipe/SConscript', + 'drivers/identity/SConscript', + 'drivers/llvmpipe/SConscript', 'drivers/rbug/SConscript', 'drivers/softpipe/SConscript', - 'drivers/svga/SConscript', - 'drivers/trace/SConscript', + 'drivers/svga/SConscript', + 'drivers/trace/SConscript', ]) if not env['msvc']: # These drivers do not build on MSVC compilers SConscript([ - 'drivers/i915/SConscript', + 'drivers/i915/SConscript', 'drivers/i965/SConscript', 'drivers/r300/SConscript', ]) @@ -40,8 +40,8 @@ if env['drm']: # no nouveau target in scons # if env['drm_nouveau']: # SConscript([ - # 'drivers/nouveau/SConscript', - # 'drivers/nv50/SConscript', + # 'drivers/nouveau/SConscript', + # 'drivers/nv50/SConscript', # 'drivers/nvfx/SConscript', # ]) @@ -73,7 +73,7 @@ if env['platform'] == 'windows': # # Winsys -# +# SConscript('winsys/SConscript') diff --git a/src/gallium/auxiliary/SConscript b/src/gallium/auxiliary/SConscript index fca7e5f..602ac2b 100644 --- a/src/gallium/auxiliary/SConscript +++ b/src/gallium/auxiliary/SConscript @@ -8,22 +8,22 @@ env.Append(CPPPATH = [ ]) env.CodeGenerate( - target = 'indices/u_indices_gen.c', - script = 'indices/u_indices_gen.py', + target = 'indices/u_indices_gen.c', + script = 'indices/u_indices_gen.py', source = [], command = python_cmd + ' $SCRIPT > $TARGET' ) env.CodeGenerate( - target = 'indices/u_unfilled_gen.c', - script = 'indices/u_unfilled_gen.py', + target = 'indices/u_unfilled_gen.c', + script = 'indices/u_unfilled_gen.py', source = [], command = python_cmd + ' $SCRIPT > $TARGET' ) env.CodeGenerate( - target = 'util/u_format_srgb.c', - script = 'util/u_format_srgb.py', + target = 'util/u_format_srgb.c', + script = 'util/u_format_srgb.py', source = [], command = python_cmd + ' $SCRIPT > $TARGET' ) @@ -44,7 +44,7 @@ env.CodeGenerate( env.Depends('util/u_format_table.c', [ '#src/gallium/auxiliary/util/u_format_parse.py', - 'util/u_format_pack.py', + 'util/u_format_pack.py', ]) source = [ diff --git a/src/gallium/auxiliary/cso_cache/cso_cache.c b/src/gallium/auxiliary/cso_cache/cso_cache.c index 900c64d..05f2306 100644 --- a/src/gallium/auxiliary/cso_cache/cso_cache.c +++ b/src/gallium/auxiliary/cso_cache/cso_cache.c @@ -256,7 +256,7 @@ cso_find_state(struct cso_cache *sc, void *cso_hash_find_data_from_template( struct cso_hash *hash, - unsigned hash_key, + unsigned hash_key, void *templ, int size ) { diff --git a/src/gallium/auxiliary/cso_cache/cso_context.c b/src/gallium/auxiliary/cso_cache/cso_context.c index b983fa6..4372a7b 100644 --- a/src/gallium/auxiliary/cso_cache/cso_context.c +++ b/src/gallium/auxiliary/cso_cache/cso_context.c @@ -27,7 +27,7 @@ /** * @file - * + * * Wrap the cso cache & hash mechanisms in a simplified * pipe-driver-specific interface. * @@ -267,7 +267,7 @@ struct cso_context *cso_create_context( struct pipe_context *pipe ) return ctx; out: - cso_destroy_context( ctx ); + cso_destroy_context( ctx ); return NULL; } @@ -278,7 +278,7 @@ struct cso_context *cso_create_context( struct pipe_context *pipe ) void cso_release_all( struct cso_context *ctx ) { unsigned i; - + if (ctx->pipe) { ctx->pipe->bind_blend_state( ctx->pipe, NULL ); ctx->pipe->bind_rasterizer_state( ctx->pipe, NULL ); @@ -491,7 +491,7 @@ void cso_single_sampler_done( struct cso_context *ctx ) if (ctx->hw.nr_samplers != ctx->nr_samplers || memcmp(ctx->hw.samplers, ctx->samplers, - ctx->nr_samplers * sizeof(void *)) != 0) + ctx->nr_samplers * sizeof(void *)) != 0) { memcpy(ctx->hw.samplers, ctx->samplers, ctx->nr_samplers * sizeof(void *)); ctx->hw.nr_samplers = ctx->nr_samplers; @@ -516,7 +516,7 @@ cso_single_vertex_sampler_done(struct cso_context *ctx) if (ctx->hw.nr_vertex_samplers != ctx->nr_vertex_samplers || memcmp(ctx->hw.vertex_samplers, ctx->vertex_samplers, - ctx->nr_vertex_samplers * sizeof(void *)) != 0) + ctx->nr_vertex_samplers * sizeof(void *)) != 0) { memcpy(ctx->hw.vertex_samplers, ctx->vertex_samplers, @@ -628,7 +628,7 @@ enum pipe_error cso_set_depth_stencil_alpha(struct cso_context *ctx, unsigned key_size = sizeof(struct pipe_depth_stencil_alpha_state); unsigned hash_key = cso_construct_key((void*)templ, key_size); struct cso_hash_iter iter = cso_find_state_template(ctx->cache, - hash_key, + hash_key, CSO_DEPTH_STENCIL_ALPHA, (void*)templ, key_size); void *handle; @@ -766,7 +766,7 @@ enum pipe_error cso_set_fragment_shader(struct cso_context *ctx, size_t tokens_size = num_tokens*sizeof(struct tgsi_token); unsigned hash_key = cso_construct_key((void*)tokens, tokens_size); struct cso_hash_iter iter = cso_find_state_template(ctx->cache, - hash_key, + hash_key, CSO_FRAGMENT_SHADER, (void*)tokens, sizeof(*templ)); /* XXX correct? tokens_size? */ diff --git a/src/gallium/auxiliary/cso_cache/cso_hash.c b/src/gallium/auxiliary/cso_cache/cso_hash.c index 288cef7..3e0b14a 100644 --- a/src/gallium/auxiliary/cso_cache/cso_hash.c +++ b/src/gallium/auxiliary/cso_cache/cso_hash.c @@ -155,7 +155,7 @@ static void cso_data_rehash(struct cso_hash_data *hash, int hint) struct cso_node *lastNode = firstNode; struct cso_node *afterLastNode; struct cso_node **beforeFirstNode; - + while (lastNode->next != e && lastNode->next->key == h) lastNode = lastNode->next; diff --git a/src/gallium/auxiliary/cso_cache/cso_hash.h b/src/gallium/auxiliary/cso_cache/cso_hash.h index 5891c32..a6b99fd 100644 --- a/src/gallium/auxiliary/cso_cache/cso_hash.h +++ b/src/gallium/auxiliary/cso_cache/cso_hash.h @@ -28,7 +28,7 @@ /** * @file * Hash table implementation. - * + * * This file provides a hash implementation that is capable of dealing * with collisions. It stores colliding entries in linked list. All * functions operating on the hash return an iterator. The iterator @@ -37,7 +37,7 @@ * iterate over the entries to find the exact entry among ones that * had the same key (e.g. memcmp could be used on the data to check * that) - * + * * @author Zack Rusin */ diff --git a/src/gallium/auxiliary/draw/draw_cliptest_tmp.h b/src/gallium/auxiliary/draw/draw_cliptest_tmp.h index 958ed20..1c23fe9 100644 --- a/src/gallium/auxiliary/draw/draw_cliptest_tmp.h +++ b/src/gallium/auxiliary/draw/draw_cliptest_tmp.h @@ -1,5 +1,5 @@ /************************************************************************** - * + * * Copyright 2010, VMware, inc. * All Rights Reserved. * @@ -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. - * + * **************************************************************************/ @@ -44,7 +44,7 @@ static boolean TAG(do_cliptest)( struct pt_post_vs *pvs, for (j = 0; j < info->count; j++) { float *position = out->data[pos]; unsigned mask = 0x0; - + initialize_vertex_header(out); if (flags & (DO_CLIP_XY | DO_CLIP_FULL_Z | DO_CLIP_HALF_Z | DO_CLIP_USER)) { @@ -76,7 +76,7 @@ static boolean TAG(do_cliptest)( struct pt_post_vs *pvs, if (flags & DO_CLIP_USER) { unsigned i; for (i = 6; i < nr; i++) { - if (dot4(position, plane[i]) < 0) + if (dot4(position, plane[i]) < 0) mask |= (1<render) draw->render->destroy( draw->render ); */ @@ -229,7 +229,7 @@ void draw_set_rasterizer_state( struct draw_context *draw, } /* With a little more work, llvmpipe will be able to turn this off and - * do its own x/y clipping. + * do its own x/y clipping. * * Some hardware can turn off clipping altogether - in particular any * hardware with a TNL unit can do its own clipping, even if it is @@ -247,7 +247,7 @@ void draw_set_driver_clipping( struct draw_context *draw, } -/** +/** * Plug in the primitive rendering/rasterization stage (which is the last * stage in the drawing pipeline). * This is provided by the device driver. @@ -562,7 +562,7 @@ draw_texture_samplers(struct draw_context *draw, -void draw_set_render( struct draw_context *draw, +void draw_set_render( struct draw_context *draw, struct vbuf_render *render ) { draw->render = render; @@ -604,7 +604,7 @@ void draw_do_flush( struct draw_context *draw, unsigned flags ) draw_pipeline_flush( draw, flags ); draw->reduced_prim = ~0; /* is reduced_prim needed any more? */ - + draw->flushing = FALSE; } } diff --git a/src/gallium/auxiliary/draw/draw_context.h b/src/gallium/auxiliary/draw/draw_context.h index a0b217e..e105251 100644 --- a/src/gallium/auxiliary/draw/draw_context.h +++ b/src/gallium/auxiliary/draw/draw_context.h @@ -1,6 +1,6 @@ /************************************************************************** - * + * * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas. * All Rights Reserved. * @@ -11,11 +11,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. @@ -23,7 +23,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. - * + * **************************************************************************/ /** @@ -203,7 +203,7 @@ draw_set_so_state(struct draw_context *draw, /*********************************************************************** - * draw_pt.c + * draw_pt.c */ void draw_vbo(struct draw_context *draw, @@ -222,21 +222,21 @@ draw_arrays_instanced(struct draw_context *draw, /******************************************************************************* - * Driver backend interface + * Driver backend interface */ struct vbuf_render; -void draw_set_render( struct draw_context *draw, +void draw_set_render( struct draw_context *draw, struct vbuf_render *render ); void draw_set_driver_clipping( struct draw_context *draw, boolean bypass_clip_xy, boolean bypass_clip_z ); -void draw_set_force_passthrough( struct draw_context *draw, +void draw_set_force_passthrough( struct draw_context *draw, boolean enable ); /******************************************************************************* - * Draw pipeline + * Draw pipeline */ boolean draw_need_pipeline(const struct draw_context *draw, const struct pipe_rasterizer_state *rasterizer, diff --git a/src/gallium/auxiliary/draw/draw_gs.c b/src/gallium/auxiliary/draw/draw_gs.c index 50a03ac..b8f954c 100644 --- a/src/gallium/auxiliary/draw/draw_gs.c +++ b/src/gallium/auxiliary/draw/draw_gs.c @@ -388,8 +388,8 @@ static void gs_tri_adj(struct draw_geometry_shader *shader, * Execute geometry shader using TGSI interpreter. */ int draw_geometry_shader_run(struct draw_geometry_shader *shader, - const void *constants[PIPE_MAX_CONSTANT_BUFFERS], - const unsigned constants_size[PIPE_MAX_CONSTANT_BUFFERS], + const void *constants[PIPE_MAX_CONSTANT_BUFFERS], + const unsigned constants_size[PIPE_MAX_CONSTANT_BUFFERS], const struct draw_vertex_info *input_verts, const struct draw_prim_info *input_prim, struct draw_vertex_info *output_verts, diff --git a/src/gallium/auxiliary/draw/draw_gs.h b/src/gallium/auxiliary/draw/draw_gs.h index 67bc1aa..11e2297 100644 --- a/src/gallium/auxiliary/draw/draw_gs.h +++ b/src/gallium/auxiliary/draw/draw_gs.h @@ -1,5 +1,5 @@ /************************************************************************** - * + * * Copyright 2009 VMware, Inc. * All Rights Reserved. * @@ -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. - * + * **************************************************************************/ #ifndef DRAW_GS_H @@ -72,8 +72,8 @@ struct draw_geometry_shader { * smaller than the GS_MAX_OUTPUT_VERTICES shader property. */ int draw_geometry_shader_run(struct draw_geometry_shader *shader, - const void *constants[PIPE_MAX_CONSTANT_BUFFERS], - const unsigned constants_size[PIPE_MAX_CONSTANT_BUFFERS], + const void *constants[PIPE_MAX_CONSTANT_BUFFERS], + const unsigned constants_size[PIPE_MAX_CONSTANT_BUFFERS], const struct draw_vertex_info *input_verts, const struct draw_prim_info *input_prim, struct draw_vertex_info *output_verts, diff --git a/src/gallium/auxiliary/draw/draw_llvm.c b/src/gallium/auxiliary/draw/draw_llvm.c index 3b8286f..3019711 100644 --- a/src/gallium/auxiliary/draw/draw_llvm.c +++ b/src/gallium/auxiliary/draw/draw_llvm.c @@ -116,7 +116,7 @@ create_jit_texture_type(struct gallivm_state *gallivm) elem_types[DRAW_JIT_TEXTURE_MIN_LOD] = elem_types[DRAW_JIT_TEXTURE_MAX_LOD] = elem_types[DRAW_JIT_TEXTURE_LOD_BIAS] = LLVMFloatTypeInContext(gallivm->context); - elem_types[DRAW_JIT_TEXTURE_BORDER_COLOR] = + elem_types[DRAW_JIT_TEXTURE_BORDER_COLOR] = LLVMArrayType(LLVMFloatTypeInContext(gallivm->context), 4); texture_type = LLVMStructTypeInContext(gallivm->context, elem_types, @@ -669,8 +669,8 @@ store_aos(struct gallivm_state *gallivm, val = lp_build_const_int32(gallivm, 0xffff1); shift = lp_build_const_int32(gallivm, 12); val = LLVMBuildShl(builder, val, shift, ""); - /* add clipmask:12 */ - val = LLVMBuildOr(builder, val, clipmask, ""); + /* add clipmask:12 */ + val = LLVMBuildOr(builder, val, clipmask, ""); /* store vertex header */ LLVMBuildStore(builder, val, id_ptr); @@ -740,7 +740,7 @@ store_aos_array(struct gallivm_state *gallivm, LLVMValueRef ind3 = lp_build_const_int32(gallivm, 3); LLVMValueRef io0_ptr, io1_ptr, io2_ptr, io3_ptr; LLVMValueRef clipmask0, clipmask1, clipmask2, clipmask3; - + debug_assert(NUM_CHANNELS == 4); io0_ptr = LLVMBuildGEP(builder, io_ptr, @@ -821,15 +821,15 @@ convert_to_aos(struct gallivm_state *gallivm, */ static void store_clip(struct gallivm_state *gallivm, - LLVMValueRef io_ptr, + LLVMValueRef io_ptr, LLVMValueRef (*outputs)[NUM_CHANNELS]) { LLVMBuilderRef builder = gallivm->builder; LLVMValueRef out[4]; - LLVMValueRef indices[2]; + LLVMValueRef indices[2]; LLVMValueRef io0_ptr, io1_ptr, io2_ptr, io3_ptr; LLVMValueRef clip_ptr0, clip_ptr1, clip_ptr2, clip_ptr3; - LLVMValueRef clip0_ptr, clip1_ptr, clip2_ptr, clip3_ptr; + LLVMValueRef clip0_ptr, clip1_ptr, clip2_ptr, clip3_ptr; LLVMValueRef out0elem, out1elem, out2elem, out3elem; int i; @@ -837,14 +837,14 @@ store_clip(struct gallivm_state *gallivm, LLVMValueRef ind1 = lp_build_const_int32(gallivm, 1); LLVMValueRef ind2 = lp_build_const_int32(gallivm, 2); LLVMValueRef ind3 = lp_build_const_int32(gallivm, 3); - + indices[0] = indices[1] = lp_build_const_int32(gallivm, 0); - + out[0] = LLVMBuildLoad(builder, outputs[0][0], ""); /*x0 x1 x2 x3*/ out[1] = LLVMBuildLoad(builder, outputs[0][1], ""); /*y0 y1 y2 y3*/ out[2] = LLVMBuildLoad(builder, outputs[0][2], ""); /*z0 z1 z2 z3*/ - out[3] = LLVMBuildLoad(builder, outputs[0][3], ""); /*w0 w1 w2 w3*/ + out[3] = LLVMBuildLoad(builder, outputs[0][3], ""); /*w0 w1 w2 w3*/ io0_ptr = LLVMBuildGEP(builder, io_ptr, &ind0, 1, ""); io1_ptr = LLVMBuildGEP(builder, io_ptr, &ind1, 1, ""); @@ -866,7 +866,7 @@ store_clip(struct gallivm_state *gallivm, out1elem = LLVMBuildExtractElement(builder, out[i], ind1, ""); /* x1 */ out2elem = LLVMBuildExtractElement(builder, out[i], ind2, ""); /* x2 */ out3elem = LLVMBuildExtractElement(builder, out[i], ind3, ""); /* x3 */ - + LLVMBuildStore(builder, out0elem, clip0_ptr); LLVMBuildStore(builder, out1elem, clip1_ptr); LLVMBuildStore(builder, out2elem, clip2_ptr); @@ -909,14 +909,14 @@ generate_viewport(struct draw_llvm *llvm, int i; struct gallivm_state *gallivm = llvm->gallivm; struct lp_type f32_type = lp_type_float_vec(32); - LLVMValueRef out3 = LLVMBuildLoad(builder, outputs[0][3], ""); /*w0 w1 w2 w3*/ - LLVMValueRef const1 = lp_build_const_vec(gallivm, f32_type, 1.0); /*1.0 1.0 1.0 1.0*/ + LLVMValueRef out3 = LLVMBuildLoad(builder, outputs[0][3], ""); /*w0 w1 w2 w3*/ + LLVMValueRef const1 = lp_build_const_vec(gallivm, f32_type, 1.0); /*1.0 1.0 1.0 1.0*/ LLVMValueRef vp_ptr = draw_jit_context_viewport(gallivm, context_ptr); /* for 1/w convention*/ out3 = LLVMBuildFDiv(builder, const1, out3, ""); LLVMBuildStore(builder, out3, outputs[0][3]); - + /* Viewport Mapping */ for (i=0; i<3; i++){ LLVMValueRef out = LLVMBuildLoad(builder, outputs[0][i], ""); /*x0 x1 x2 x3*/ @@ -925,7 +925,7 @@ generate_viewport(struct draw_llvm *llvm, LLVMValueRef scale_i; LLVMValueRef trans_i; LLVMValueRef index; - + index = lp_build_const_int32(gallivm, i); scale_i = LLVMBuildGEP(builder, vp_ptr, &index, 1, ""); @@ -945,14 +945,14 @@ generate_viewport(struct draw_llvm *llvm, /* store transformed outputs */ LLVMBuildStore(builder, out, outputs[0][i]); } - + } /* * Returns clipmask as 4xi32 bitmask for the 4 vertices */ -static LLVMValueRef +static LLVMValueRef generate_clipmask(struct gallivm_state *gallivm, LLVMValueRef (*outputs)[NUM_CHANNELS], boolean clip_xy, @@ -963,15 +963,15 @@ generate_clipmask(struct gallivm_state *gallivm, LLVMValueRef context_ptr) { LLVMBuilderRef builder = gallivm->builder; - LLVMValueRef mask; /* stores the <4xi32> clipmasks */ - LLVMValueRef test, temp; + LLVMValueRef mask; /* stores the <4xi32> clipmasks */ + LLVMValueRef test, temp; LLVMValueRef zero, shift; LLVMValueRef pos_x, pos_y, pos_z, pos_w; LLVMValueRef plane1, planes, plane_ptr, sum; unsigned i; - struct lp_type f32_type = lp_type_float_vec(32); + struct lp_type f32_type = lp_type_float_vec(32); mask = lp_build_const_int_vec(gallivm, lp_type_int_vec(32), 0); temp = lp_build_const_int_vec(gallivm, lp_type_int_vec(32), 0); @@ -982,34 +982,34 @@ generate_clipmask(struct gallivm_state *gallivm, pos_x = LLVMBuildLoad(builder, outputs[0][0], ""); /*x0 x1 x2 x3*/ pos_y = LLVMBuildLoad(builder, outputs[0][1], ""); /*y0 y1 y2 y3*/ pos_z = LLVMBuildLoad(builder, outputs[0][2], ""); /*z0 z1 z2 z3*/ - pos_w = LLVMBuildLoad(builder, outputs[0][3], ""); /*w0 w1 w2 w3*/ + pos_w = LLVMBuildLoad(builder, outputs[0][3], ""); /*w0 w1 w2 w3*/ /* Cliptest, for hardwired planes */ if (clip_xy){ /* plane 1 */ test = lp_build_compare(gallivm, f32_type, PIPE_FUNC_GREATER, pos_x , pos_w); temp = shift; - test = LLVMBuildAnd(builder, test, temp, ""); + test = LLVMBuildAnd(builder, test, temp, ""); mask = test; - + /* plane 2 */ test = LLVMBuildFAdd(builder, pos_x, pos_w, ""); test = lp_build_compare(gallivm, f32_type, PIPE_FUNC_GREATER, zero, test); temp = LLVMBuildShl(builder, temp, shift, ""); - test = LLVMBuildAnd(builder, test, temp, ""); + test = LLVMBuildAnd(builder, test, temp, ""); mask = LLVMBuildOr(builder, mask, test, ""); - + /* plane 3 */ test = lp_build_compare(gallivm, f32_type, PIPE_FUNC_GREATER, pos_y, pos_w); temp = LLVMBuildShl(builder, temp, shift, ""); - test = LLVMBuildAnd(builder, test, temp, ""); + test = LLVMBuildAnd(builder, test, temp, ""); mask = LLVMBuildOr(builder, mask, test, ""); /* plane 4 */ test = LLVMBuildFAdd(builder, pos_y, pos_w, ""); test = lp_build_compare(gallivm, f32_type, PIPE_FUNC_GREATER, zero, test); temp = LLVMBuildShl(builder, temp, shift, ""); - test = LLVMBuildAnd(builder, test, temp, ""); + test = LLVMBuildAnd(builder, test, temp, ""); mask = LLVMBuildOr(builder, mask, test, ""); } @@ -1018,22 +1018,22 @@ generate_clipmask(struct gallivm_state *gallivm, if (clip_halfz){ /* plane 5 */ test = lp_build_compare(gallivm, f32_type, PIPE_FUNC_GREATER, zero, pos_z); - test = LLVMBuildAnd(builder, test, temp, ""); + test = LLVMBuildAnd(builder, test, temp, ""); mask = LLVMBuildOr(builder, mask, test, ""); - } + } else{ /* plane 5 */ test = LLVMBuildFAdd(builder, pos_z, pos_w, ""); test = lp_build_compare(gallivm, f32_type, PIPE_FUNC_GREATER, zero, test); - test = LLVMBuildAnd(builder, test, temp, ""); + test = LLVMBuildAnd(builder, test, temp, ""); mask = LLVMBuildOr(builder, mask, test, ""); } /* plane 6 */ test = lp_build_compare(gallivm, f32_type, PIPE_FUNC_GREATER, pos_z, pos_w); temp = LLVMBuildShl(builder, temp, shift, ""); - test = LLVMBuildAnd(builder, test, temp, ""); + test = LLVMBuildAnd(builder, test, temp, ""); mask = LLVMBuildOr(builder, mask, test, ""); - } + } if (clip_user){ LLVMValueRef planes_ptr = draw_jit_context_planes(gallivm, context_ptr); @@ -1053,28 +1053,28 @@ generate_clipmask(struct gallivm_state *gallivm, indices[2] = lp_build_const_int32(gallivm, 1); plane_ptr = LLVMBuildGEP(builder, planes_ptr, indices, 3, ""); - plane1 = LLVMBuildLoad(builder, plane_ptr, "plane_y"); + plane1 = LLVMBuildLoad(builder, plane_ptr, "plane_y"); planes = vec4f_from_scalar(gallivm, plane1, "plane4_y"); test = LLVMBuildFMul(builder, planes, pos_y, ""); sum = LLVMBuildFAdd(builder, sum, test, ""); - + indices[2] = lp_build_const_int32(gallivm, 2); plane_ptr = LLVMBuildGEP(builder, planes_ptr, indices, 3, ""); - plane1 = LLVMBuildLoad(builder, plane_ptr, "plane_z"); + plane1 = LLVMBuildLoad(builder, plane_ptr, "plane_z"); planes = vec4f_from_scalar(gallivm, plane1, "plane4_z"); test = LLVMBuildFMul(builder, planes, pos_z, ""); sum = LLVMBuildFAdd(builder, sum, test, ""); indices[2] = lp_build_const_int32(gallivm, 3); plane_ptr = LLVMBuildGEP(builder, planes_ptr, indices, 3, ""); - plane1 = LLVMBuildLoad(builder, plane_ptr, "plane_w"); + plane1 = LLVMBuildLoad(builder, plane_ptr, "plane_w"); planes = vec4f_from_scalar(gallivm, plane1, "plane4_w"); test = LLVMBuildFMul(builder, planes, pos_w, ""); sum = LLVMBuildFAdd(builder, sum, test, ""); test = lp_build_compare(gallivm, f32_type, PIPE_FUNC_GREATER, zero, sum); temp = LLVMBuildShl(builder, temp, shift, ""); - test = LLVMBuildAnd(builder, test, temp, ""); + test = LLVMBuildAnd(builder, test, temp, ""); mask = LLVMBuildOr(builder, mask, test, ""); } } @@ -1083,7 +1083,7 @@ generate_clipmask(struct gallivm_state *gallivm, /* * Returns boolean if any clipping has occurred - * Used zero/non-zero i32 value to represent boolean + * Used zero/non-zero i32 value to represent boolean */ static void clipmask_bool(struct gallivm_state *gallivm, @@ -1091,16 +1091,16 @@ clipmask_bool(struct gallivm_state *gallivm, LLVMValueRef ret_ptr) { LLVMBuilderRef builder = gallivm->builder; - LLVMValueRef ret = LLVMBuildLoad(builder, ret_ptr, ""); + LLVMValueRef ret = LLVMBuildLoad(builder, ret_ptr, ""); LLVMValueRef temp; int i; - for (i=0; i<4; i++){ + for (i=0; i<4; i++){ temp = LLVMBuildExtractElement(builder, clipmask, lp_build_const_int32(gallivm, i) , ""); ret = LLVMBuildOr(builder, ret, temp, ""); } - + LLVMBuildStore(builder, ret, ret_ptr); } @@ -1128,10 +1128,10 @@ draw_llvm_generate(struct draw_llvm *llvm, struct draw_llvm_variant *variant) struct lp_build_sampler_soa *sampler = 0; LLVMValueRef ret, ret_ptr; boolean bypass_viewport = variant->key.bypass_viewport; - boolean enable_cliptest = variant->key.clip_xy || + boolean enable_cliptest = variant->key.clip_xy || variant->key.clip_z || variant->key.clip_user; - + arg_types[0] = get_context_ptr_type(llvm); /* context */ arg_types[1] = get_vertex_header_ptr_type(llvm); /* vertex_header */ arg_types[2] = get_buffer_ptr_type(llvm); /* vbuffers */ @@ -1183,8 +1183,8 @@ draw_llvm_generate(struct draw_llvm *llvm, struct draw_llvm_variant *variant) step = lp_build_const_int32(gallivm, max_vertices); - /* function will return non-zero i32 value if any clipped vertices */ - ret_ptr = lp_build_alloca(gallivm, int32_type, ""); + /* function will return non-zero i32 value if any clipped vertices */ + ret_ptr = lp_build_alloca(gallivm, int32_type, ""); LLVMBuildStore(builder, lp_build_const_int32(gallivm, 0), ret_ptr); /* code generated texture sampling */ @@ -1244,7 +1244,7 @@ draw_llvm_generate(struct draw_llvm *llvm, struct draw_llvm_variant *variant) /* allocate clipmask, assign it integer type */ clipmask = generate_clipmask(gallivm, outputs, variant->key.clip_xy, - variant->key.clip_z, + variant->key.clip_z, variant->key.clip_user, variant->key.clip_halfz, variant->key.nr_planes, @@ -1253,9 +1253,9 @@ draw_llvm_generate(struct draw_llvm *llvm, struct draw_llvm_variant *variant) clipmask_bool(gallivm, clipmask, ret_ptr); } else{ - clipmask = lp_build_const_int_vec(gallivm, lp_type_int_vec(32), 0); + clipmask = lp_build_const_int_vec(gallivm, lp_type_int_vec(32), 0); } - + /* do viewport mapping */ if (!bypass_viewport){ generate_viewport(llvm, builder, outputs, context_ptr); @@ -1273,7 +1273,7 @@ draw_llvm_generate(struct draw_llvm *llvm, struct draw_llvm_variant *variant) ret = LLVMBuildLoad(builder, ret_ptr,""); LLVMBuildRet(builder, ret); - + /* * Translate the LLVM IR into machine code. */ @@ -1326,10 +1326,10 @@ draw_llvm_generate_elts(struct draw_llvm *llvm, struct draw_llvm_variant *varian struct lp_build_sampler_soa *sampler = 0; LLVMValueRef ret, ret_ptr; boolean bypass_viewport = variant->key.bypass_viewport; - boolean enable_cliptest = variant->key.clip_xy || + boolean enable_cliptest = variant->key.clip_xy || variant->key.clip_z || variant->key.clip_user; - + arg_types[0] = get_context_ptr_type(llvm); /* context */ arg_types[1] = get_vertex_header_ptr_type(llvm); /* vertex_header */ arg_types[2] = get_buffer_ptr_type(llvm); /* vbuffers */ @@ -1388,7 +1388,7 @@ draw_llvm_generate_elts(struct draw_llvm *llvm, struct draw_llvm_variant *varian "fetch_max"); /* function returns non-zero i32 value if any clipped vertices */ - ret_ptr = lp_build_alloca(gallivm, int32_type, ""); + ret_ptr = lp_build_alloca(gallivm, int32_type, ""); LLVMBuildStore(builder, lp_build_const_int32(gallivm, 0), ret_ptr); lp_build_loop_begin(&lp_loop, gallivm, lp_build_const_int32(gallivm, 0)); @@ -1449,7 +1449,7 @@ draw_llvm_generate_elts(struct draw_llvm *llvm, struct draw_llvm_variant *varian /* allocate clipmask, assign it integer type */ clipmask = generate_clipmask(gallivm, outputs, variant->key.clip_xy, - variant->key.clip_z, + variant->key.clip_z, variant->key.clip_user, variant->key.clip_halfz, variant->key.nr_planes, @@ -1460,16 +1460,16 @@ draw_llvm_generate_elts(struct draw_llvm *llvm, struct draw_llvm_variant *varian else{ clipmask = lp_build_const_int_vec(gallivm, lp_type_int_vec(32), 0); } - + /* do viewport mapping */ if (!bypass_viewport){ generate_viewport(llvm, builder, outputs, context_ptr); } - /* store clipmask in vertex header, - * original positions in clip - * and transformed positions in data - */ + /* store clipmask in vertex header, + * original positions in clip + * and transformed positions in data + */ convert_to_aos(gallivm, io, outputs, clipmask, draw->vs.vertex_shader->info.num_outputs, max_vertices); @@ -1479,9 +1479,9 @@ draw_llvm_generate_elts(struct draw_llvm *llvm, struct draw_llvm_variant *varian sampler->destroy(sampler); - ret = LLVMBuildLoad(builder, ret_ptr,""); + ret = LLVMBuildLoad(builder, ret_ptr,""); LLVMBuildRet(builder, ret); - + /* * Translate the LLVM IR into machine code. */ @@ -1544,7 +1544,7 @@ draw_llvm_make_variant_key(struct draw_llvm *llvm, char *store) memcpy(key->vertex_element, llvm->draw->pt.vertex_element, sizeof(struct pipe_vertex_element) * key->nr_vertex_elements); - + memset(sampler, 0, key->nr_samplers * sizeof *sampler); for (i = 0 ; i < key->nr_samplers; i++) { diff --git a/src/gallium/auxiliary/draw/draw_pipe.c b/src/gallium/auxiliary/draw/draw_pipe.c index 6206197..61b322d 100644 --- a/src/gallium/auxiliary/draw/draw_pipe.c +++ b/src/gallium/auxiliary/draw/draw_pipe.c @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ /* @@ -115,7 +115,7 @@ static void do_point( struct draw_context *draw, const char *v0 ) { struct prim_header prim; - + prim.flags = 0; prim.pad = 0; prim.v[0] = (struct vertex_header *)v0; @@ -134,7 +134,7 @@ static void do_line( struct draw_context *draw, const char *v1 ) { struct prim_header prim; - + prim.flags = flags; prim.pad = 0; prim.v[0] = (struct vertex_header *)v0; @@ -155,7 +155,7 @@ static void do_triangle( struct draw_context *draw, char *v2 ) { struct prim_header prim; - + prim.v[0] = (struct vertex_header *)v0; prim.v[1] = (struct vertex_header *)v1; prim.v[2] = (struct vertex_header *)v2; @@ -340,7 +340,7 @@ void draw_pipeline_run_linear( struct draw_context *draw, } -void draw_pipeline_flush( struct draw_context *draw, +void draw_pipeline_flush( struct draw_context *draw, unsigned flags ) { draw->pipeline.first->flush( draw->pipeline.first, flags ); diff --git a/src/gallium/auxiliary/draw/draw_pipe.h b/src/gallium/auxiliary/draw/draw_pipe.h index 4792507..f18f16d 100644 --- a/src/gallium/auxiliary/draw/draw_pipe.h +++ b/src/gallium/auxiliary/draw/draw_pipe.h @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ /* @@ -114,7 +114,7 @@ static INLINE struct vertex_header * dup_vert( struct draw_stage *stage, const struct vertex_header *vert, unsigned idx ) -{ +{ struct vertex_header *tmp = stage->tmp[idx]; const uint vsize = sizeof(struct vertex_header) + stage->draw->vs.num_vs_outputs * 4 * sizeof(float); diff --git a/src/gallium/auxiliary/draw/draw_pipe_aaline.c b/src/gallium/auxiliary/draw/draw_pipe_aaline.c index 0851b9a..c650c3d 100644 --- a/src/gallium/auxiliary/draw/draw_pipe_aaline.c +++ b/src/gallium/auxiliary/draw/draw_pipe_aaline.c @@ -1,5 +1,5 @@ /************************************************************************** - * + * * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas. * All Rights Reserved. * @@ -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. - * + * **************************************************************************/ /** @@ -234,27 +234,27 @@ aa_transform_inst(struct tgsi_transform_context *ctx, decl.Declaration.Semantic = 1; decl.Semantic.Name = TGSI_SEMANTIC_GENERIC; decl.Semantic.Index = aactx->maxGeneric + 1; - decl.Range.First = + decl.Range.First = decl.Range.Last = aactx->maxInput + 1; ctx->emit_declaration(ctx, &decl); /* declare new sampler */ decl = tgsi_default_full_declaration(); decl.Declaration.File = TGSI_FILE_SAMPLER; - decl.Range.First = + decl.Range.First = decl.Range.Last = aactx->freeSampler; ctx->emit_declaration(ctx, &decl); /* declare new temp regs */ decl = tgsi_default_full_declaration(); decl.Declaration.File = TGSI_FILE_TEMPORARY; - decl.Range.First = + decl.Range.First = decl.Range.Last = aactx->texTemp; ctx->emit_declaration(ctx, &decl); decl = tgsi_default_full_declaration(); decl.Declaration.File = TGSI_FILE_TEMPORARY; - decl.Range.First = + decl.Range.First = decl.Range.Last = aactx->colorTemp; ctx->emit_declaration(ctx, &decl); @@ -439,7 +439,7 @@ aaline_create_texture(struct aaline_stage *aaline) u_box_origin_2d( size, size, &box ); - /* This texture is new, no need to flush. + /* This texture is new, no need to flush. */ transfer = pipe->get_transfer(pipe, aaline->texture, @@ -519,7 +519,7 @@ bind_aaline_fragment_shader(struct aaline_stage *aaline) struct draw_context *draw = aaline->stage.draw; struct pipe_context *pipe = draw->pipe; - if (!aaline->fs->aaline_fs && + if (!aaline->fs->aaline_fs && !generate_aaline_fs(aaline)) return FALSE; @@ -950,7 +950,7 @@ draw_install_aaline_stage(struct draw_context *draw, struct pipe_context *pipe) pipe->bind_fragment_sampler_states = aaline_bind_sampler_states; pipe->set_fragment_sampler_views = aaline_set_sampler_views; - + /* Install once everything is known to be OK: */ draw->pipeline.aaline = &aaline->stage; @@ -960,6 +960,6 @@ draw_install_aaline_stage(struct draw_context *draw, struct pipe_context *pipe) fail: if (aaline) aaline->stage.destroy( &aaline->stage ); - + return FALSE; } diff --git a/src/gallium/auxiliary/draw/draw_pipe_aapoint.c b/src/gallium/auxiliary/draw/draw_pipe_aapoint.c index 5ea552f..dcb8c4a 100644 --- a/src/gallium/auxiliary/draw/draw_pipe_aapoint.c +++ b/src/gallium/auxiliary/draw/draw_pipe_aapoint.c @@ -1,5 +1,5 @@ /************************************************************************** - * + * * Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas. * All Rights Reserved. * @@ -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. - * + * **************************************************************************/ /** @@ -205,20 +205,20 @@ aa_transform_inst(struct tgsi_transform_context *ctx, decl.Declaration.Semantic = 1; decl.Semantic.Name = TGSI_SEMANTIC_GENERIC; decl.Semantic.Index = aactx->maxGeneric + 1; - decl.Range.First = + decl.Range.First = decl.Range.Last = texInput; ctx->emit_declaration(ctx, &decl); /* declare new temp regs */ decl = tgsi_default_full_declaration(); decl.Declaration.File = TGSI_FILE_TEMPORARY; - decl.Range.First = + decl.Range.First = decl.Range.Last = tmp0; ctx->emit_declaration(ctx, &decl); decl = tgsi_default_full_declaration(); decl.Declaration.File = TGSI_FILE_TEMPORARY; - decl.Range.First = + decl.Range.First = decl.Range.Last = aactx->colorTemp; ctx->emit_declaration(ctx, &decl); @@ -822,7 +822,7 @@ aapoint_create_fs_state(struct pipe_context *pipe, { struct aapoint_stage *aapoint = aapoint_stage_from_pipe(pipe); struct aapoint_fragment_shader *aafs = CALLOC_STRUCT(aapoint_fragment_shader); - if (aafs == NULL) + if (aafs == NULL) return NULL; aafs->state = *fs; diff --git a/src/gallium/auxiliary/draw/draw_pipe_clip.c b/src/gallium/auxiliary/draw/draw_pipe_clip.c index a10d8e9..c7f1aac 100644 --- a/src/gallium/auxiliary/draw/draw_pipe_clip.c +++ b/src/gallium/auxiliary/draw/draw_pipe_clip.c @@ -1,5 +1,5 @@ /************************************************************************** - * + * * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas. * All Rights Reserved. * @@ -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. - * + * **************************************************************************/ /** @@ -84,7 +84,7 @@ static void interp_attr( float dst[4], float t, const float in[4], const float out[4] ) -{ +{ dst[0] = LINTERP( t, out[0], in[0] ); dst[1] = LINTERP( t, out[1], in[1] ); dst[2] = LINTERP( t, out[2], in[2] ); @@ -110,12 +110,12 @@ static void copy_colors( struct draw_stage *stage, -/* Interpolate between two vertices to produce a third. +/* Interpolate between two vertices to produce a third. */ static void interp( const struct clip_stage *clip, struct vertex_header *dst, float t, - const struct vertex_header *out, + const struct vertex_header *out, const struct vertex_header *in ) { const unsigned nr_attrs = draw_current_shader_outputs(clip->stage.draw); @@ -236,7 +236,7 @@ dot4(const float *a, const float *b) /* Clip a triangle against the viewport and user clip planes. */ static void -do_clip_tri( struct draw_stage *stage, +do_clip_tri( struct draw_stage *stage, struct prim_header *header, unsigned clipmask ) { @@ -298,7 +298,7 @@ do_clip_tri( struct draw_stage *stage, */ float t = dp / (dp - dp_prev); interp( clipper, new_vert, t, vert, vert_prev ); - + /* Force edgeflag true in this case: */ new_vert->edgeflag = 1; @@ -350,7 +350,7 @@ do_clip_tri( struct draw_stage *stage, } } } - + /* Emit the polygon as triangles to the setup stage: */ emit_poly( stage, inlist, n, header ); @@ -383,7 +383,7 @@ do_clip_line( struct draw_stage *stage, if (dp1 < 0.0F) { float t = dp1 / (dp1 - dp0); t1 = MAX2(t1, t); - } + } if (dp0 < 0.0F) { float t = dp0 / (dp0 - dp1); @@ -421,10 +421,10 @@ do_clip_line( struct draw_stage *stage, static void -clip_point( struct draw_stage *stage, +clip_point( struct draw_stage *stage, struct prim_header *header ) { - if (header->v[0]->clipmask == 0) + if (header->v[0]->clipmask == 0) stage->next->point( stage->next, header ); } @@ -433,9 +433,9 @@ static void clip_line( struct draw_stage *stage, struct prim_header *header ) { - unsigned clipmask = (header->v[0]->clipmask | + unsigned clipmask = (header->v[0]->clipmask | header->v[1]->clipmask); - + if (clipmask == 0) { /* no clipping needed */ stage->next->line( stage->next, header ); @@ -452,16 +452,16 @@ static void clip_tri( struct draw_stage *stage, struct prim_header *header ) { - unsigned clipmask = (header->v[0]->clipmask | - header->v[1]->clipmask | + unsigned clipmask = (header->v[0]->clipmask | + header->v[1]->clipmask | header->v[2]->clipmask); - + if (clipmask == 0) { /* no clipping needed */ stage->next->tri( stage->next, header ); } - else if ((header->v[0]->clipmask & - header->v[1]->clipmask & + else if ((header->v[0]->clipmask & + header->v[1]->clipmask & header->v[2]->clipmask) == 0) { do_clip_tri(stage, header, clipmask); } @@ -471,7 +471,7 @@ clip_tri( struct draw_stage *stage, /* Update state. Could further delay this until we hit the first * primitive that really requires clipping. */ -static void +static void clip_init_state( struct draw_stage *stage ) { struct clip_stage *clipper = clip_stage( stage ); @@ -490,7 +490,7 @@ clip_init_state( struct draw_stage *stage ) } } } - + stage->tri = clip_tri; stage->line = clip_line; } @@ -512,7 +512,7 @@ static void clip_first_line( struct draw_stage *stage, } -static void clip_flush( struct draw_stage *stage, +static void clip_flush( struct draw_stage *stage, unsigned flags ) { stage->tri = clip_first_tri; diff --git a/src/gallium/auxiliary/draw/draw_pipe_cull.c b/src/gallium/auxiliary/draw/draw_pipe_cull.c index 2f4d01d..b55c805 100644 --- a/src/gallium/auxiliary/draw/draw_pipe_cull.c +++ b/src/gallium/auxiliary/draw/draw_pipe_cull.c @@ -1,5 +1,5 @@ /************************************************************************** - * + * * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas. * All Rights Reserved. * @@ -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. - * + * **************************************************************************/ /** @@ -66,12 +66,12 @@ static void cull_tri( struct draw_stage *stage, const float ey = v0[1] - v2[1]; const float fx = v1[0] - v2[0]; const float fy = v1[1] - v2[1]; - + /* det = cross(e,f).z */ header->det = ex * fy - ey * fx; if (header->det != 0) { - /* if det < 0 then Z points toward the camera and the triangle is + /* if det < 0 then Z points toward the camera and the triangle is * counter-clockwise winding. */ unsigned ccw = (header->det < 0); @@ -87,7 +87,7 @@ static void cull_tri( struct draw_stage *stage, } -static void cull_first_tri( struct draw_stage *stage, +static void cull_first_tri( struct draw_stage *stage, struct prim_header *header ) { struct cull_stage *cull = cull_stage(stage); diff --git a/src/gallium/auxiliary/draw/draw_pipe_flatshade.c b/src/gallium/auxiliary/draw/draw_pipe_flatshade.c index 693f289..cd68036 100644 --- a/src/gallium/auxiliary/draw/draw_pipe_flatshade.c +++ b/src/gallium/auxiliary/draw/draw_pipe_flatshade.c @@ -1,5 +1,5 @@ /************************************************************************** - * + * * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas. * All Rights Reserved. * @@ -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. - * + * **************************************************************************/ /* Authors: Keith Whitwell @@ -122,7 +122,7 @@ static void flatshade_tri_0( struct draw_stage *stage, tmp.v[2] = dup_vert(stage, header->v[2], 1); copy_colors2(stage, tmp.v[1], tmp.v[2], tmp.v[0]); - + stage->next->tri( stage->next, &tmp ); } @@ -140,7 +140,7 @@ static void flatshade_tri_2( struct draw_stage *stage, tmp.v[2] = header->v[2]; copy_colors2(stage, tmp.v[0], tmp.v[1], tmp.v[2]); - + stage->next->tri( stage->next, &tmp ); } @@ -160,7 +160,7 @@ static void flatshade_line_0( struct draw_stage *stage, tmp.v[1] = dup_vert(stage, header->v[1], 0); copy_colors(stage, tmp.v[1], tmp.v[0]); - + stage->next->line( stage->next, &tmp ); } @@ -173,7 +173,7 @@ static void flatshade_line_1( struct draw_stage *stage, tmp.v[1] = header->v[1]; copy_colors(stage, tmp.v[0], tmp.v[1]); - + stage->next->line( stage->next, &tmp ); } @@ -226,7 +226,7 @@ static void flatshade_first_line( struct draw_stage *stage, } -static void flatshade_flush( struct draw_stage *stage, +static void flatshade_flush( struct draw_stage *stage, unsigned flags ) { stage->tri = flatshade_first_tri; diff --git a/src/gallium/auxiliary/draw/draw_pipe_offset.c b/src/gallium/auxiliary/draw/draw_pipe_offset.c index 8afbbfa..d79f99f 100644 --- a/src/gallium/auxiliary/draw/draw_pipe_offset.c +++ b/src/gallium/auxiliary/draw/draw_pipe_offset.c @@ -1,5 +1,5 @@ /************************************************************************** - * + * * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas. * All Rights Reserved. * @@ -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. - * + * **************************************************************************/ /** @@ -64,7 +64,7 @@ static void do_offset_tri( struct draw_stage *stage, struct prim_header *header ) { const unsigned pos = draw_current_shader_position_output(stage->draw); - struct offset_stage *offset = offset_stage(stage); + struct offset_stage *offset = offset_stage(stage); float inv_det = 1.0f / header->det; /* Window coords: @@ -118,7 +118,7 @@ static void offset_tri( struct draw_stage *stage, } -static void offset_first_tri( struct draw_stage *stage, +static void offset_first_tri( struct draw_stage *stage, struct prim_header *header ) { struct offset_stage *offset = offset_stage(stage); diff --git a/src/gallium/auxiliary/draw/draw_pipe_pstipple.c b/src/gallium/auxiliary/draw/draw_pipe_pstipple.c index f5515c1..6ee05fb 100644 --- a/src/gallium/auxiliary/draw/draw_pipe_pstipple.c +++ b/src/gallium/auxiliary/draw/draw_pipe_pstipple.c @@ -1,5 +1,5 @@ /************************************************************************** - * + * * Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas. * All Rights Reserved. * @@ -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. - * + * **************************************************************************/ /** @@ -231,7 +231,7 @@ pstip_transform_inst(struct tgsi_transform_context *ctx, decl.Declaration.Semantic = 1; decl.Semantic.Name = TGSI_SEMANTIC_POSITION; decl.Semantic.Index = 0; - decl.Range.First = + decl.Range.First = decl.Range.Last = wincoordInput; ctx->emit_declaration(ctx, &decl); } @@ -239,14 +239,14 @@ pstip_transform_inst(struct tgsi_transform_context *ctx, /* declare new sampler */ decl = tgsi_default_full_declaration(); decl.Declaration.File = TGSI_FILE_SAMPLER; - decl.Range.First = + decl.Range.First = decl.Range.Last = pctx->freeSampler; ctx->emit_declaration(ctx, &decl); /* declare new temp regs */ decl = tgsi_default_full_declaration(); decl.Declaration.File = TGSI_FILE_TEMPORARY; - decl.Range.First = + decl.Range.First = decl.Range.Last = pctx->texTemp; ctx->emit_declaration(ctx, &decl); @@ -269,7 +269,7 @@ pstip_transform_inst(struct tgsi_transform_context *ctx, pctx->firstInstruction = FALSE; - /* + /* * Insert new MUL/TEX/KILP instructions at start of program * Take gl_FragCoord, divide by 32 (stipple size), sample the * texture and kill fragment if needed. @@ -363,7 +363,7 @@ generate_pstip_fs(struct pstip_stage *pstip) assert(pstip->fs->sampler_unit < PIPE_MAX_SAMPLERS); pstip->fs->pstip_fs = pstip->driver_create_fs_state(pstip->pipe, &pstip_fs); - + FREE((void *)pstip_fs.tokens); if (!pstip->fs->pstip_fs) @@ -386,7 +386,7 @@ pstip_update_texture(struct pstip_stage *pstip) uint i, j; ubyte *data; - /* XXX: want to avoid flushing just because we use stipple: + /* XXX: want to avoid flushing just because we use stipple: * * Flush should no longer be necessary if driver is properly * interleaving drawing and transfers on a given context: @@ -484,7 +484,7 @@ pstip_create_sampler(struct pstip_stage *pstip) pstip->sampler_cso = pipe->create_sampler_state(pipe, &sampler); if (pstip->sampler_cso == NULL) return FALSE; - + return TRUE; } @@ -531,7 +531,7 @@ pstip_first_tri(struct draw_stage *stage, struct prim_header *header) stage->tri(stage, header); return; } - + /* how many samplers? */ /* we'll use sampler/texture[pstip->sampler_unit] for the stipple */ diff --git a/src/gallium/auxiliary/draw/draw_pipe_stipple.c b/src/gallium/auxiliary/draw/draw_pipe_stipple.c index 4b3f4e7..831a0e7 100644 --- a/src/gallium/auxiliary/draw/draw_pipe_stipple.c +++ b/src/gallium/auxiliary/draw/draw_pipe_stipple.c @@ -1,5 +1,5 @@ /************************************************************************** - * + * * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas. * All Rights Reserved. * @@ -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. - * + * **************************************************************************/ /* Authors: Keith Whitwell @@ -61,7 +61,7 @@ stipple_stage(struct draw_stage *stage) /** - * Compute interpolated vertex attributes for 'dst' at position 't' + * Compute interpolated vertex attributes for 'dst' at position 't' * between 'v0' and 'v1'. * XXX using linear interpolation for all attribs at this time. */ @@ -69,7 +69,7 @@ static void screen_interp( struct draw_context *draw, struct vertex_header *dst, float t, - const struct vertex_header *v0, + const struct vertex_header *v0, const struct vertex_header *v1 ) { uint attr; @@ -160,7 +160,7 @@ stipple_line(struct draw_stage *stage, struct prim_header *header) /* starting an "on" segment */ start = (float) i; } - state = result; + state = result; } } @@ -197,7 +197,7 @@ stipple_reset_tri(struct draw_stage *stage, struct prim_header *header) static void -stipple_first_line(struct draw_stage *stage, +stipple_first_line(struct draw_stage *stage, struct prim_header *header) { struct stipple_stage *stipple = stipple_stage(stage); @@ -221,7 +221,7 @@ stipple_flush(struct draw_stage *stage, unsigned flags) -static void +static void stipple_destroy( struct draw_stage *stage ) { draw_free_temp_verts( stage ); diff --git a/src/gallium/auxiliary/draw/draw_pipe_twoside.c b/src/gallium/auxiliary/draw/draw_pipe_twoside.c index 9a3f3fe..15f867d 100644 --- a/src/gallium/auxiliary/draw/draw_pipe_twoside.c +++ b/src/gallium/auxiliary/draw/draw_pipe_twoside.c @@ -1,5 +1,5 @@ /************************************************************************** - * + * * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas. * All Rights Reserved. * @@ -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. - * + * **************************************************************************/ /* Authors: Keith Whitwell @@ -55,12 +55,12 @@ static INLINE struct twoside_stage *twoside_stage( struct draw_stage *stage ) * Copy back color(s) to front color(s). */ static INLINE struct vertex_header * -copy_bfc( struct twoside_stage *twoside, +copy_bfc( struct twoside_stage *twoside, const struct vertex_header *v, unsigned idx ) -{ +{ struct vertex_header *tmp = dup_vert( &twoside->stage, v, idx ); - + if (twoside->attrib_back0) { COPY_4FV(tmp->data[twoside->attrib_front0], tmp->data[twoside->attrib_back0]); @@ -102,7 +102,7 @@ static void twoside_tri( struct draw_stage *stage, -static void twoside_first_tri( struct draw_stage *stage, +static void twoside_first_tri( struct draw_stage *stage, struct prim_header *header ) { struct twoside_stage *twoside = twoside_stage(stage); diff --git a/src/gallium/auxiliary/draw/draw_pipe_unfilled.c b/src/gallium/auxiliary/draw/draw_pipe_unfilled.c index d87741b..13a35d3 100644 --- a/src/gallium/auxiliary/draw/draw_pipe_unfilled.c +++ b/src/gallium/auxiliary/draw/draw_pipe_unfilled.c @@ -1,5 +1,5 @@ /************************************************************************** - * + * * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas. * All Rights Reserved. * @@ -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. - * + * **************************************************************************/ /** @@ -122,11 +122,11 @@ print_header_flags(unsigned flags) } -/* Unfilled tri: +/* Unfilled tri: * * Note edgeflags in the vertex struct is not sufficient as we will - * need to manipulate them when decomposing primitives. - * + * need to manipulate them when decomposing primitives. + * * We currently keep the vertex edgeflag and primitive edgeflag mask * separate until the last possible moment. */ @@ -136,7 +136,7 @@ static void unfilled_tri( struct draw_stage *stage, struct unfilled_stage *unfilled = unfilled_stage(stage); unsigned cw = header->det >= 0.0; unsigned mode = unfilled->mode[cw]; - + if (0) print_header_flags(header->flags); @@ -152,11 +152,11 @@ static void unfilled_tri( struct draw_stage *stage, break; default: assert(0); - } + } } -static void unfilled_first_tri( struct draw_stage *stage, +static void unfilled_first_tri( struct draw_stage *stage, struct prim_header *header ) { struct unfilled_stage *unfilled = unfilled_stage(stage); diff --git a/src/gallium/auxiliary/draw/draw_pipe_util.c b/src/gallium/auxiliary/draw/draw_pipe_util.c index e22e5fe..ede5f10 100644 --- a/src/gallium/auxiliary/draw/draw_pipe_util.c +++ b/src/gallium/auxiliary/draw/draw_pipe_util.c @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ /* @@ -86,7 +86,7 @@ boolean draw_alloc_temp_verts( struct draw_stage *stage, unsigned nr ) FREE(store); return FALSE; } - + for (i = 0; i < nr; i++) stage->tmp[i] = (struct vertex_header *)(store + i * MAX_VERTEX_SIZE); } @@ -112,7 +112,7 @@ void draw_free_temp_verts( struct draw_stage *stage ) void draw_reset_vertex_ids(struct draw_context *draw) { struct draw_stage *stage = draw->pipeline.first; - + while (stage) { unsigned i; diff --git a/src/gallium/auxiliary/draw/draw_pipe_validate.c b/src/gallium/auxiliary/draw/draw_pipe_validate.c index c575a8a..dd14dbc 100644 --- a/src/gallium/auxiliary/draw/draw_pipe_validate.c +++ b/src/gallium/auxiliary/draw/draw_pipe_validate.c @@ -1,5 +1,5 @@ /************************************************************************** - * + * * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas. * All Rights Reserved. * @@ -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. - * + * **************************************************************************/ /* Authors: Keith Whitwell @@ -65,10 +65,10 @@ draw_need_pipeline(const struct draw_context *draw, const struct pipe_rasterizer_state *rasterizer, unsigned int prim ) { - /* If the driver has overridden this, use that version: + /* If the driver has overridden this, use that version: */ if (draw->render && - draw->render->need_pipeline) + draw->render->need_pipeline) { return draw->render->need_pipeline( draw->render, rasterizer, @@ -79,7 +79,7 @@ draw_need_pipeline(const struct draw_context *draw, * and triggering the pipeline, because we have to trigger the * pipeline *anyway* if unfilled mode is active. */ - if (lines(prim)) + if (lines(prim)) { /* line stipple */ if (rasterizer->line_stipple_enable && draw->pipeline.line_stipple) @@ -115,7 +115,7 @@ draw_need_pipeline(const struct draw_context *draw, } - if (triangles(prim)) + if (triangles(prim)) { /* polygon stipple */ if (rasterizer->poly_stipple_enable && draw->pipeline.pstipple) @@ -125,7 +125,7 @@ draw_need_pipeline(const struct draw_context *draw, if (rasterizer->fill_front != PIPE_POLYGON_MODE_FILL || rasterizer->fill_back != PIPE_POLYGON_MODE_FILL) return TRUE; - + /* polygon offset */ if (rasterizer->offset_point || rasterizer->offset_line || @@ -139,7 +139,7 @@ draw_need_pipeline(const struct draw_context *draw, /* polygon cull - this is difficult - hardware can cull just fine * most of the time (though sometimes CULL_NEITHER is unsupported. - * + * * Generally this isn't a reason to require the pipeline, though. * if (rasterizer->cull_mode) @@ -236,7 +236,7 @@ static struct draw_stage *validate_pipeline( struct draw_stage *stage ) draw->pipeline.flatshade->next = next; next = draw->pipeline.flatshade; } - + if (rast->offset_point || rast->offset_line || rast->offset_tri) { @@ -252,7 +252,7 @@ static struct draw_stage *validate_pipeline( struct draw_stage *stage ) } /* Always run the cull stage as we calculate determinant there - * also. + * also. * * This can actually be a win as culling out the triangles can lead * to less work emitting vertices, smaller vertex buffers, etc. @@ -271,34 +271,34 @@ static struct draw_stage *validate_pipeline( struct draw_stage *stage ) next = draw->pipeline.clip; } - + draw->pipeline.first = next; if (0) { debug_printf("draw pipeline:\n"); - for (next = draw->pipeline.first; next ; next = next->next ) + for (next = draw->pipeline.first; next ; next = next->next ) debug_printf(" %s\n", next->name); debug_printf("\n"); } - + return draw->pipeline.first; } -static void validate_tri( struct draw_stage *stage, +static void validate_tri( struct draw_stage *stage, struct prim_header *header ) { struct draw_stage *pipeline = validate_pipeline( stage ); pipeline->tri( pipeline, header ); } -static void validate_line( struct draw_stage *stage, +static void validate_line( struct draw_stage *stage, struct prim_header *header ) { struct draw_stage *pipeline = validate_pipeline( stage ); pipeline->line( pipeline, header ); } -static void validate_point( struct draw_stage *stage, +static void validate_point( struct draw_stage *stage, struct prim_header *header ) { struct draw_stage *pipeline = validate_pipeline( stage ); @@ -311,7 +311,7 @@ static void validate_reset_stipple_counter( struct draw_stage *stage ) pipeline->reset_stipple_counter( pipeline ); } -static void validate_flush( struct draw_stage *stage, +static void validate_flush( struct draw_stage *stage, unsigned flags ) { /* May need to pass a backend flush on to the rasterize stage. diff --git a/src/gallium/auxiliary/draw/draw_pipe_vbuf.c b/src/gallium/auxiliary/draw/draw_pipe_vbuf.c index 58c5858..f389af1 100644 --- a/src/gallium/auxiliary/draw/draw_pipe_vbuf.c +++ b/src/gallium/auxiliary/draw/draw_pipe_vbuf.c @@ -28,7 +28,7 @@ /** * \file * Vertex buffer drawing stage. - * + * * \author Jose Fonseca * \author Keith Whitwell */ @@ -53,14 +53,14 @@ struct vbuf_stage { struct draw_stage stage; /**< This must be first (base class) */ struct vbuf_render *render; - + const struct vertex_info *vinfo; - + /** Vertex size in bytes */ unsigned vertex_size; struct translate *translate; - + /* FIXME: we have no guarantee that 'unsigned' is 32bit */ /** Vertices in hardware format */ @@ -68,7 +68,7 @@ struct vbuf_stage { unsigned *vertex_ptr; unsigned max_vertices; unsigned nr_vertices; - + /** Indices */ ushort *indices; unsigned max_indices; @@ -97,7 +97,7 @@ static void vbuf_flush_vertices( struct vbuf_stage *vbuf ); static void vbuf_alloc_vertices( struct vbuf_stage *vbuf ); -static INLINE boolean +static INLINE boolean overflow( void *map, void *ptr, unsigned bytes, unsigned bufsz ) { unsigned long used = (unsigned long) ((char *)ptr - (char *)map); @@ -105,7 +105,7 @@ overflow( void *map, void *ptr, unsigned bytes, unsigned bufsz ) } -static INLINE void +static INLINE void check_space( struct vbuf_stage *vbuf, unsigned nr ) { if (vbuf->nr_vertices + nr > vbuf->max_vertices || @@ -126,22 +126,22 @@ check_space( struct vbuf_stage *vbuf, unsigned nr ) * have a couple of slots at the beginning (1-dword header, 4-dword * clip pos) that we ignore here. We only use the vertex->data[] fields. */ -static INLINE ushort +static INLINE ushort emit_vertex( struct vbuf_stage *vbuf, struct vertex_header *vertex ) { - if(vertex->vertex_id == UNDEFINED_VERTEX_ID) { + if(vertex->vertex_id == UNDEFINED_VERTEX_ID) { /* Hmm - vertices are emitted one at a time - better make sure * set_buffer is efficient. Consider a special one-shot mode for * translate. */ - /* Note: we really do want data[0] here, not data[pos]: + /* Note: we really do want data[0] here, not data[pos]: */ vbuf->translate->set_buffer(vbuf->translate, 0, vertex->data[0], 0, ~0); vbuf->translate->run(vbuf->translate, 0, 1, 0, vbuf->vertex_ptr); if (0) draw_dump_emitted_vertex(vbuf->vinfo, (uint8_t *)vbuf->vertex_ptr); - + vbuf->vertex_ptr += vbuf->vertex_size/4; vertex->vertex_id = vbuf->nr_vertices++; } @@ -150,7 +150,7 @@ emit_vertex( struct vbuf_stage *vbuf, } -static void +static void vbuf_tri( struct draw_stage *stage, struct prim_header *prim ) { @@ -165,8 +165,8 @@ vbuf_tri( struct draw_stage *stage, } -static void -vbuf_line( struct draw_stage *stage, +static void +vbuf_line( struct draw_stage *stage, struct prim_header *prim ) { struct vbuf_stage *vbuf = vbuf_stage( stage ); @@ -176,12 +176,12 @@ vbuf_line( struct draw_stage *stage, for (i = 0; i < 2; i++) { vbuf->indices[vbuf->nr_indices++] = emit_vertex( vbuf, prim->v[i] ); - } + } } -static void -vbuf_point( struct draw_stage *stage, +static void +vbuf_point( struct draw_stage *stage, struct prim_header *prim ) { struct vbuf_stage *vbuf = vbuf_stage( stage ); @@ -209,7 +209,7 @@ vbuf_start_prim( struct vbuf_stage *vbuf, uint prim ) vbuf->render->set_primitive(vbuf->render, prim); /* Must do this after set_primitive() above: - * + * * XXX: need some state managment to track when this needs to be * recalculated. The driver should tell us whether there was a * state change. @@ -255,7 +255,7 @@ vbuf_start_prim( struct vbuf_stage *vbuf, uint prim ) /* Don't bother with caching at this stage: */ if (!vbuf->translate || - translate_key_compare(&vbuf->translate->key, &hw_key) != 0) + translate_key_compare(&vbuf->translate->key, &hw_key) != 0) { translate_key_sanitize(&hw_key); vbuf->translate = translate_cache_find(vbuf->cache, &hw_key); @@ -272,7 +272,7 @@ vbuf_start_prim( struct vbuf_stage *vbuf, uint prim ) } -static void +static void vbuf_first_tri( struct draw_stage *stage, struct prim_header *prim ) { @@ -285,7 +285,7 @@ vbuf_first_tri( struct draw_stage *stage, } -static void +static void vbuf_first_line( struct draw_stage *stage, struct prim_header *prim ) { @@ -298,7 +298,7 @@ vbuf_first_line( struct draw_stage *stage, } -static void +static void vbuf_first_point( struct draw_stage *stage, struct prim_header *prim ) { @@ -315,26 +315,26 @@ vbuf_first_point( struct draw_stage *stage, /** * Flush existing vertex buffer and allocate a new one. */ -static void +static void vbuf_flush_vertices( struct vbuf_stage *vbuf ) { if(vbuf->vertices) { vbuf->render->unmap_vertices( vbuf->render, 0, vbuf->nr_vertices - 1 ); - if (vbuf->nr_indices) + if (vbuf->nr_indices) { - vbuf->render->draw_elements(vbuf->render, - vbuf->indices, + vbuf->render->draw_elements(vbuf->render, + vbuf->indices, vbuf->nr_indices ); - + vbuf->nr_indices = 0; } - + /* Reset temporary vertices ids */ if(vbuf->nr_vertices) draw_reset_vertex_ids( vbuf->stage.draw ); - + /* Free the vertex buffer */ vbuf->render->release_vertices( vbuf->render ); @@ -342,14 +342,14 @@ vbuf_flush_vertices( struct vbuf_stage *vbuf ) vbuf->vertex_ptr = vbuf->vertices = NULL; } } - -static void + +static void vbuf_alloc_vertices( struct vbuf_stage *vbuf ) { assert(!vbuf->nr_indices); assert(!vbuf->vertices); - + /* Allocate a new vertex buffer */ vbuf->max_vertices = vbuf->render->max_vertex_buffer_bytes / vbuf->vertex_size; @@ -366,13 +366,13 @@ vbuf_alloc_vertices( struct vbuf_stage *vbuf ) (ushort) vbuf->max_vertices); vbuf->vertices = (uint *) vbuf->render->map_vertices( vbuf->render ); - + vbuf->vertex_ptr = vbuf->vertices; } -static void +static void vbuf_flush( struct draw_stage *stage, unsigned flags ) { struct vbuf_stage *vbuf = vbuf_stage( stage ); @@ -385,7 +385,7 @@ vbuf_flush( struct draw_stage *stage, unsigned flags ) } -static void +static void vbuf_reset_stipple_counter( struct draw_stage *stage ) { /* XXX: Need to do something here for hardware with linestipple. @@ -400,7 +400,7 @@ static void vbuf_destroy( struct draw_stage *stage ) if(vbuf->indices) align_free( vbuf->indices ); - + if (vbuf->render) vbuf->render->destroy( vbuf->render ); @@ -420,7 +420,7 @@ struct draw_stage *draw_vbuf_stage( struct draw_context *draw, struct vbuf_stage *vbuf = CALLOC_STRUCT(vbuf_stage); if (vbuf == NULL) goto fail; - + vbuf->stage.draw = draw; vbuf->stage.name = "vbuf"; vbuf->stage.point = vbuf_first_point; @@ -429,29 +429,29 @@ struct draw_stage *draw_vbuf_stage( struct draw_context *draw, vbuf->stage.flush = vbuf_flush; vbuf->stage.reset_stipple_counter = vbuf_reset_stipple_counter; vbuf->stage.destroy = vbuf_destroy; - + vbuf->render = render; vbuf->max_indices = MAX2(render->max_indices, UNDEFINED_VERTEX_ID-1); - vbuf->indices = (ushort *) align_malloc( vbuf->max_indices * - sizeof(vbuf->indices[0]), + vbuf->indices = (ushort *) align_malloc( vbuf->max_indices * + sizeof(vbuf->indices[0]), 16 ); if (!vbuf->indices) goto fail; vbuf->cache = translate_cache_create(); - if (!vbuf->cache) + if (!vbuf->cache) goto fail; - - + + vbuf->vertices = NULL; vbuf->vertex_ptr = vbuf->vertices; - + return &vbuf->stage; fail: if (vbuf) vbuf_destroy(&vbuf->stage); - + return NULL; } diff --git a/src/gallium/auxiliary/draw/draw_pipe_wide_line.c b/src/gallium/auxiliary/draw/draw_pipe_wide_line.c index 98da9cf..b753ab1 100644 --- a/src/gallium/auxiliary/draw/draw_pipe_wide_line.c +++ b/src/gallium/auxiliary/draw/draw_pipe_wide_line.c @@ -1,5 +1,5 @@ /************************************************************************** - * + * * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas. * All Rights Reserved. * @@ -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. - * + * **************************************************************************/ /* Authors: Keith Whitwell @@ -149,7 +149,7 @@ static void wideline_line( struct draw_stage *stage, } -static void wideline_first_line( struct draw_stage *stage, +static void wideline_first_line( struct draw_stage *stage, struct prim_header *header ) { struct draw_context *draw = stage->draw; diff --git a/src/gallium/auxiliary/draw/draw_pipe_wide_point.c b/src/gallium/auxiliary/draw/draw_pipe_wide_point.c index 3646c6a..82acc9d 100644 --- a/src/gallium/auxiliary/draw/draw_pipe_wide_point.c +++ b/src/gallium/auxiliary/draw/draw_pipe_wide_point.c @@ -1,5 +1,5 @@ /************************************************************************** - * + * * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas. * All Rights Reserved. * @@ -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. - * + * **************************************************************************/ /* Authors: Keith Whitwell @@ -142,7 +142,7 @@ static void widepoint_point( struct draw_stage *stage, /* point size is either per-vertex or fixed size */ if (wide->psize_slot >= 0) { half_size = header->v[0]->data[wide->psize_slot][0]; - half_size *= 0.5f; + half_size *= 0.5f; } else { half_size = wide->half_point_size; @@ -190,7 +190,7 @@ static void widepoint_point( struct draw_stage *stage, static void -widepoint_first_point(struct draw_stage *stage, +widepoint_first_point(struct draw_stage *stage, struct prim_header *header) { struct widepoint_stage *wide = widepoint_stage(stage); @@ -280,7 +280,7 @@ widepoint_first_point(struct draw_stage *stage, } } } - + stage->point( stage, header ); } @@ -341,6 +341,6 @@ struct draw_stage *draw_wide_point_stage( struct draw_context *draw ) fail: if (wide) wide->stage.destroy( &wide->stage ); - + return NULL; } diff --git a/src/gallium/auxiliary/draw/draw_private.h b/src/gallium/auxiliary/draw/draw_private.h index 06ed4d6..56bb2aa 100644 --- a/src/gallium/auxiliary/draw/draw_private.h +++ b/src/gallium/auxiliary/draw/draw_private.h @@ -1,5 +1,5 @@ /************************************************************************** - * + * * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas. * All Rights Reserved. * @@ -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. - * + * **************************************************************************/ /** @@ -63,7 +63,7 @@ struct tgsi_sampler; /** * Basic vertex info. - * Carry some useful information around with the vertices in the prim pipe. + * Carry some useful information around with the vertices in the prim pipe. */ struct vertex_header { unsigned clipmask:12; @@ -96,7 +96,7 @@ struct draw_context struct { struct draw_stage *first; /**< one of the following */ - struct draw_stage *validate; + struct draw_stage *validate; /* stages (in logical order) */ struct draw_stage *flatshade; @@ -160,18 +160,18 @@ struct draw_context int eltBias; unsigned min_index; unsigned max_index; - + /** vertex arrays */ const void *vbuffer[PIPE_MAX_ATTRIBS]; - + /** constant buffers (for vertex/geometry shader) */ const void *vs_constants[PIPE_MAX_CONSTANT_BUFFERS]; unsigned vs_constants_size[PIPE_MAX_CONSTANT_BUFFERS]; const void *gs_constants[PIPE_MAX_CONSTANT_BUFFERS]; unsigned gs_constants_size[PIPE_MAX_CONSTANT_BUFFERS]; - + /* pointer to planes */ - float (*planes)[12][4]; + float (*planes)[12][4]; } user; boolean test_fse; /* enable FSE even though its not correct (eg for softpipe) */ @@ -225,7 +225,7 @@ struct draw_context /* Here's another one: */ - struct aos_machine *aos_machine; + struct aos_machine *aos_machine; const void *aligned_constants[PIPE_MAX_CONSTANT_BUFFERS]; @@ -340,7 +340,7 @@ boolean draw_init(struct draw_context *draw); boolean draw_vs_init( struct draw_context *draw ); void draw_vs_destroy( struct draw_context *draw ); -void draw_vs_set_viewport( struct draw_context *, +void draw_vs_set_viewport( struct draw_context *, const struct pipe_viewport_state * ); void @@ -384,7 +384,7 @@ void draw_pt_reset_vertex_ids( struct draw_context *draw ); /******************************************************************************* - * Primitive processing (pipeline) code: + * Primitive processing (pipeline) code: */ boolean draw_pipeline_init( struct draw_context *draw ); @@ -415,13 +415,13 @@ void draw_pipeline_run_linear( struct draw_context *draw, -void draw_pipeline_flush( struct draw_context *draw, +void draw_pipeline_flush( struct draw_context *draw, unsigned flags ); /******************************************************************************* - * Flushing + * Flushing */ #define DRAW_FLUSH_STATE_CHANGE 0x8 diff --git a/src/gallium/auxiliary/draw/draw_pt.c b/src/gallium/auxiliary/draw/draw_pt.c index 4078b2a..2cf0bbc 100644 --- a/src/gallium/auxiliary/draw/draw_pt.c +++ b/src/gallium/auxiliary/draw/draw_pt.c @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ /* @@ -48,13 +48,13 @@ DEBUG_GET_ONCE_BOOL_OPTION(draw_no_fse, "DRAW_NO_FSE", FALSE) /* Overall we split things into: * - frontend -- prepare fetch_elts, draw_elts - eg vsplit * - middle -- fetch, shade, cliptest, viewport - * - pipeline -- the prim pipeline: clipping, wide lines, etc + * - pipeline -- the prim pipeline: clipping, wide lines, etc * - backend -- the vbuf_render provided by the driver. */ static boolean -draw_pt_arrays(struct draw_context *draw, +draw_pt_arrays(struct draw_context *draw, unsigned prim, - unsigned start, + unsigned start, unsigned count) { struct draw_pt_front_end *frontend = NULL; @@ -72,7 +72,7 @@ draw_pt_arrays(struct draw_context *draw, } if (!draw->force_passthrough) { - unsigned gs_out_prim = (draw->gs.geometry_shader ? + unsigned gs_out_prim = (draw->gs.geometry_shader ? draw->gs.geometry_shader->output_primitive : prim); diff --git a/src/gallium/auxiliary/draw/draw_pt.h b/src/gallium/auxiliary/draw/draw_pt.h index 5fbb424..9ee7ce9 100644 --- a/src/gallium/auxiliary/draw/draw_pt.h +++ b/src/gallium/auxiliary/draw/draw_pt.h @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ /* @@ -128,7 +128,7 @@ struct vbuf_render; struct vertex_header; -/* Frontends: +/* Frontends: * * Currently only the general-purpose vsplit implementation. */ @@ -234,7 +234,7 @@ void draw_pt_post_vs_destroy( struct pt_post_vs *pvs ); /******************************************************************************* - * Utils: + * Utils: */ void draw_pt_split_prim(unsigned prim, unsigned *first, unsigned *incr); unsigned draw_pt_trim_count(unsigned count, unsigned first, unsigned incr); diff --git a/src/gallium/auxiliary/draw/draw_pt_emit.c b/src/gallium/auxiliary/draw/draw_pt_emit.c index c8dfc16..d91e0c3 100644 --- a/src/gallium/auxiliary/draw/draw_pt_emit.c +++ b/src/gallium/auxiliary/draw/draw_pt_emit.c @@ -55,8 +55,8 @@ void draw_pt_emit_prepare( struct pt_emit *emit, struct translate_key hw_key; unsigned i; boolean ok; - - /* XXX: need to flush to get prim_vbuf.c to release its allocation?? + + /* XXX: need to flush to get prim_vbuf.c to release its allocation?? */ draw_do_flush( draw, DRAW_FLUSH_BACKEND ); @@ -118,7 +118,7 @@ void draw_pt_emit_prepare( struct pt_emit *emit, emit->translate = translate_cache_find(emit->cache, &hw_key); } - *max_vertices = (draw->render->max_vertex_buffer_bytes / + *max_vertices = (draw->render->max_vertex_buffer_bytes / (vinfo->size * 4)); } @@ -137,7 +137,7 @@ void draw_pt_emit( struct pt_emit *emit, unsigned start, i; void *hw_verts; - /* XXX: need to flush to get prim_vbuf.c to release its allocation?? + /* XXX: need to flush to get prim_vbuf.c to release its allocation?? */ draw_do_flush( draw, DRAW_FLUSH_BACKEND ); @@ -162,27 +162,27 @@ void draw_pt_emit( struct pt_emit *emit, return; } - translate->set_buffer(translate, - 0, + translate->set_buffer(translate, + 0, vertex_data, stride, ~0); - translate->set_buffer(translate, - 1, + translate->set_buffer(translate, + 1, &draw->rasterizer->point_size, 0, ~0); /* fetch/translate vertex attribs to fill hw_verts[] */ translate->run( translate, - 0, + 0, vertex_count, draw->instance_id, hw_verts ); - render->unmap_vertices( render, - 0, + render->unmap_vertices( render, + 0, vertex_count - 1 ); for (start = i = 0; @@ -214,14 +214,14 @@ void draw_pt_emit_linear(struct pt_emit *emit, #if 0 debug_printf("Linear emit\n"); #endif - /* XXX: need to flush to get prim_vbuf.c to release its allocation?? + /* XXX: need to flush to get prim_vbuf.c to release its allocation?? */ draw_do_flush( draw, DRAW_FLUSH_BACKEND ); /* XXX: and work out some way to coordinate the render primitive * between vbuf.c and here... */ - if (!draw->render->set_primitive(draw->render, emit->prim)) + if (!draw->render->set_primitive(draw->render, emit->prim)) goto fail; if (!render->allocate_vertices(render, @@ -250,8 +250,8 @@ void draw_pt_emit_linear(struct pt_emit *emit, unsigned i; for (i = 0; i < count; i++) { debug_printf("\n\n%s vertex %d:\n", __FUNCTION__, i); - draw_dump_emitted_vertex( emit->vinfo, - (const uint8_t *)hw_verts + + draw_dump_emitted_vertex( emit->vinfo, + (const uint8_t *)hw_verts + translate->key.output_stride * i ); } } diff --git a/src/gallium/auxiliary/draw/draw_pt_fetch.c b/src/gallium/auxiliary/draw/draw_pt_fetch.c index ae12ee2..86578bd 100644 --- a/src/gallium/auxiliary/draw/draw_pt_fetch.c +++ b/src/gallium/auxiliary/draw/draw_pt_fetch.c @@ -134,16 +134,16 @@ void draw_pt_fetch_run( struct pt_fetch *fetch, unsigned i; for (i = 0; i < draw->pt.nr_vertex_buffers; i++) { - translate->set_buffer(translate, - i, - ((char *)draw->pt.user.vbuffer[i] + + translate->set_buffer(translate, + i, + ((char *)draw->pt.user.vbuffer[i] + draw->pt.vertex_buffer[i].buffer_offset), draw->pt.vertex_buffer[i].stride, draw->pt.vertex_buffer[i].max_index); } translate->run_elts( translate, - elts, + elts, count, draw->instance_id, verts ); diff --git a/src/gallium/auxiliary/draw/draw_pt_fetch_emit.c b/src/gallium/auxiliary/draw/draw_pt_fetch_emit.c index e706b77..d8b9498 100644 --- a/src/gallium/auxiliary/draw/draw_pt_fetch_emit.c +++ b/src/gallium/auxiliary/draw/draw_pt_fetch_emit.c @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ /* @@ -40,15 +40,15 @@ #include "translate/translate.h" #include "translate/translate_cache.h" -/* The simplest 'middle end' in the new vertex code. - * +/* The simplest 'middle end' in the new vertex code. + * * The responsibilities of a middle end are to: * - perform vertex fetch using * - draw vertex element/buffer state * - a list of fetch indices we received as an input * - run the vertex shader - * - cliptest, - * - clip coord calculation + * - cliptest, + * - clip coord calculation * - viewport transformation * - if necessary, run the primitive pipeline, passing it: * - a linear array of vertex_header vertices constructed here @@ -75,7 +75,7 @@ struct fetch_emit_middle_end { struct draw_pt_middle_end base; struct draw_context *draw; - + struct translate *translate; const struct vertex_info *vinfo; @@ -101,24 +101,24 @@ static void fetch_emit_prepare( struct draw_pt_middle_end *middle, boolean ok; struct translate_key key; - unsigned gs_out_prim = (draw->gs.geometry_shader ? + unsigned gs_out_prim = (draw->gs.geometry_shader ? draw->gs.geometry_shader->output_primitive : prim); - ok = draw->render->set_primitive( draw->render, + ok = draw->render->set_primitive( draw->render, gs_out_prim ); if (!ok) { assert(0); return; } - + /* Must do this after set_primitive() above: */ vinfo = feme->vinfo = draw->render->get_vertex_info(draw->render); - - + + /* Transform from API vertices to HW vertices, skipping the * pipeline_vertex intermediate step. @@ -154,7 +154,7 @@ static void fetch_emit_prepare( struct draw_pt_middle_end *middle, key.element[i].instance_divisor = src->instance_divisor; key.element[i].output_format = output_format; key.element[i].output_offset = dst_offset; - + dst_offset += emit_sz; } @@ -164,32 +164,32 @@ static void fetch_emit_prepare( struct draw_pt_middle_end *middle, /* Don't bother with caching at this stage: */ if (!feme->translate || - translate_key_compare(&feme->translate->key, &key) != 0) + translate_key_compare(&feme->translate->key, &key) != 0) { translate_key_sanitize(&key); feme->translate = translate_cache_find(feme->cache, &key); - feme->translate->set_buffer(feme->translate, - draw->pt.nr_vertex_buffers, + feme->translate->set_buffer(feme->translate, + draw->pt.nr_vertex_buffers, &feme->point_size, 0, ~0); } - + feme->point_size = draw->rasterizer->point_size; for (i = 0; i < draw->pt.nr_vertex_buffers; i++) { - feme->translate->set_buffer(feme->translate, - i, - ((char *)draw->pt.user.vbuffer[i] + + feme->translate->set_buffer(feme->translate, + i, + ((char *)draw->pt.user.vbuffer[i] + draw->pt.vertex_buffer[i].buffer_offset), draw->pt.vertex_buffer[i].stride, draw->pt.vertex_buffer[i].max_index); } - *max_vertices = (draw->render->max_vertex_buffer_bytes / + *max_vertices = (draw->render->max_vertex_buffer_bytes / (vinfo->size * 4)); } @@ -207,8 +207,8 @@ static void fetch_emit_run( struct draw_pt_middle_end *middle, struct fetch_emit_middle_end *feme = (struct fetch_emit_middle_end *)middle; struct draw_context *draw = feme->draw; void *hw_verts; - - /* XXX: need to flush to get prim_vbuf.c to release its allocation?? + + /* XXX: need to flush to get prim_vbuf.c to release its allocation?? */ draw_do_flush( draw, DRAW_FLUSH_BACKEND ); @@ -221,11 +221,11 @@ static void fetch_emit_run( struct draw_pt_middle_end *middle, assert(0); return; } - - + + /* Single routine to fetch vertices and emit HW verts. */ - feme->translate->run_elts( feme->translate, + feme->translate->run_elts( feme->translate, fetch_elts, fetch_count, draw->instance_id, @@ -235,23 +235,23 @@ static void fetch_emit_run( struct draw_pt_middle_end *middle, unsigned i; for (i = 0; i < fetch_count; i++) { debug_printf("\n\nvertex %d:\n", i); - draw_dump_emitted_vertex( feme->vinfo, + draw_dump_emitted_vertex( feme->vinfo, (const uint8_t *)hw_verts + feme->vinfo->size * 4 * i ); } } - draw->render->unmap_vertices( draw->render, - 0, + draw->render->unmap_vertices( draw->render, + 0, (ushort)(fetch_count - 1) ); /* XXX: Draw arrays path to avoid re-emitting index list again and * again. */ - draw->render->draw_elements( draw->render, - draw_elts, + draw->render->draw_elements( draw->render, + draw_elts, draw_count ); - /* Done -- that was easy, wasn't it: + /* Done -- that was easy, wasn't it: */ draw->render->release_vertices( draw->render ); @@ -273,11 +273,11 @@ static void fetch_emit_run_linear( struct draw_pt_middle_end *middle, if (!draw->render->allocate_vertices( draw->render, (ushort)feme->translate->key.output_stride, - (ushort)count )) + (ushort)count )) goto fail; hw_verts = draw->render->map_vertices( draw->render ); - if (!hw_verts) + if (!hw_verts) goto fail; /* Single routine to fetch vertices and emit HW verts. @@ -336,7 +336,7 @@ static boolean fetch_emit_run_linear_elts( struct draw_pt_middle_end *middle, return FALSE; hw_verts = draw->render->map_vertices( draw->render ); - if (!hw_verts) + if (!hw_verts) return FALSE; /* Single routine to fetch vertices and emit HW verts. @@ -352,8 +352,8 @@ static boolean fetch_emit_run_linear_elts( struct draw_pt_middle_end *middle, /* XXX: Draw arrays path to avoid re-emitting index list again and * again. */ - draw->render->draw_elements( draw->render, - draw_elts, + draw->render->draw_elements( draw->render, + draw_elts, draw_count ); /* Done -- that was easy, wasn't it: @@ -402,7 +402,7 @@ struct draw_pt_middle_end *draw_pt_fetch_emit( struct draw_context *draw ) fetch_emit->base.destroy = fetch_emit_destroy; fetch_emit->draw = draw; - + return &fetch_emit->base; } diff --git a/src/gallium/auxiliary/draw/draw_pt_fetch_shade_emit.c b/src/gallium/auxiliary/draw/draw_pt_fetch_shade_emit.c index 7c198c6..73a8517 100644 --- a/src/gallium/auxiliary/draw/draw_pt_fetch_shade_emit.c +++ b/src/gallium/auxiliary/draw/draw_pt_fetch_shade_emit.c @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ /* @@ -105,7 +105,7 @@ static void fse_prepare( struct draw_pt_middle_end *middle, fse->key.clip = draw->clip_xy || draw->clip_z || draw->clip_user; fse->key.const_vbuffers = 0; - memset(fse->key.element, 0, + memset(fse->key.element, 0, fse->key.nr_elements * sizeof(fse->key.element[0])); for (i = 0; i < num_vs_inputs; i++) { @@ -119,14 +119,14 @@ static void fse_prepare( struct draw_pt_middle_end *middle, fse->key.element[i].in.offset = src->src_offset; nr_vbs = MAX2(nr_vbs, src->vertex_buffer_index + 1); } - + for (i = 0; i < 5 && i < nr_vbs; i++) { if (draw->pt.vertex_buffer[i].stride == 0) fse->key.const_vbuffers |= (1<key.const_vbuffers); - + { unsigned dst_offset = 0; @@ -143,14 +143,14 @@ static void fse_prepare( struct draw_pt_middle_end *middle, fse->key.element[i].out.format = vinfo->attrib[i].emit; fse->key.element[i].out.vs_output = vinfo->attrib[i].src_index; fse->key.element[i].out.offset = dst_offset; - + dst_offset += emit_sz; assert(fse->key.output_stride >= dst_offset); } } - - fse->active = draw_vs_lookup_varient( draw->vs.vertex_shader, + + fse->active = draw_vs_lookup_varient( draw->vs.vertex_shader, &fse->key ); if (!fse->active) { @@ -158,21 +158,21 @@ static void fse_prepare( struct draw_pt_middle_end *middle, return ; } - if (0) debug_printf("%s: found const_vbuffers: %x\n", __FUNCTION__, + if (0) debug_printf("%s: found const_vbuffers: %x\n", __FUNCTION__, fse->active->key.const_vbuffers); /* Now set buffer pointers: */ for (i = 0; i < draw->pt.nr_vertex_buffers; i++) { - fse->active->set_buffer( fse->active, - i, - ((const ubyte *) draw->pt.user.vbuffer[i] + + fse->active->set_buffer( fse->active, + i, + ((const ubyte *) draw->pt.user.vbuffer[i] + draw->pt.vertex_buffer[i].buffer_offset), draw->pt.vertex_buffer[i].stride, draw->pt.vertex_buffer[i].max_index ); } - *max_vertices = (draw->render->max_vertex_buffer_bytes / + *max_vertices = (draw->render->max_vertex_buffer_bytes / (vinfo->size * 4)); /* Probably need to do this somewhere (or fix exec shader not to @@ -186,8 +186,8 @@ static void fse_prepare( struct draw_pt_middle_end *middle, -static void fse_run_linear( struct draw_pt_middle_end *middle, - unsigned start, +static void fse_run_linear( struct draw_pt_middle_end *middle, + unsigned start, unsigned count, unsigned prim_flags ) { @@ -212,7 +212,7 @@ static void fse_run_linear( struct draw_pt_middle_end *middle, * Clipping is done elsewhere -- either by the API or on hardware, * or for some other reason not required... */ - fse->active->run_linear( fse->active, + fse->active->run_linear( fse->active, start, count, hw_verts ); @@ -224,11 +224,11 @@ static void fse_run_linear( struct draw_pt_middle_end *middle, fse->key.output_stride, fse->key.output_stride * i); - draw_dump_emitted_vertex( fse->vinfo, + draw_dump_emitted_vertex( fse->vinfo, (const uint8_t *)hw_verts + fse->key.output_stride * i ); } } - + draw->render->unmap_vertices( draw->render, 0, (ushort)(count - 1) ); /* Draw arrays path to avoid re-emitting index list again and @@ -237,7 +237,7 @@ static void fse_run_linear( struct draw_pt_middle_end *middle, draw->render->draw_arrays( draw->render, 0, count ); - + draw->render->release_vertices( draw->render ); @@ -260,8 +260,8 @@ fse_run(struct draw_pt_middle_end *middle, struct fetch_shade_emit *fse = (struct fetch_shade_emit *)middle; struct draw_context *draw = fse->draw; void *hw_verts; - - /* XXX: need to flush to get prim_vbuf.c to release its allocation?? + + /* XXX: need to flush to get prim_vbuf.c to release its allocation?? */ draw_do_flush( draw, DRAW_FLUSH_BACKEND ); @@ -270,14 +270,14 @@ fse_run(struct draw_pt_middle_end *middle, (ushort)fetch_count )) goto fail; - hw_verts = draw->render->map_vertices( draw->render ); - if (!hw_verts) + hw_verts = draw->render->map_vertices( draw->render ); + if (!hw_verts) goto fail; - - + + /* Single routine to fetch vertices, run shader and emit HW verts. */ - fse->active->run_elts( fse->active, + fse->active->run_elts( fse->active, fetch_elts, fetch_count, hw_verts ); @@ -287,16 +287,16 @@ fse_run(struct draw_pt_middle_end *middle, unsigned i; for (i = 0; i < fetch_count; i++) { debug_printf("\n\n%s vertex %d:\n", __FUNCTION__, i); - draw_dump_emitted_vertex( fse->vinfo, - (const uint8_t *)hw_verts + + draw_dump_emitted_vertex( fse->vinfo, + (const uint8_t *)hw_verts + fse->key.output_stride * i ); } } draw->render->unmap_vertices( draw->render, 0, (ushort)(fetch_count - 1) ); - - draw->render->draw_elements( draw->render, - draw_elts, + + draw->render->draw_elements( draw->render, + draw_elts, draw_count ); @@ -310,8 +310,8 @@ fse_run(struct draw_pt_middle_end *middle, -static boolean fse_run_linear_elts( struct draw_pt_middle_end *middle, - unsigned start, +static boolean fse_run_linear_elts( struct draw_pt_middle_end *middle, + unsigned start, unsigned count, const ushort *draw_elts, unsigned draw_count, @@ -331,22 +331,22 @@ static boolean fse_run_linear_elts( struct draw_pt_middle_end *middle, return FALSE; hw_verts = draw->render->map_vertices( draw->render ); - if (!hw_verts) + if (!hw_verts) return FALSE; /* Single routine to fetch vertices, run shader and emit HW verts. * Clipping is done elsewhere -- either by the API or on hardware, * or for some other reason not required... */ - fse->active->run_linear( fse->active, + fse->active->run_linear( fse->active, start, count, hw_verts ); - draw->render->draw_elements( draw->render, - draw_elts, + draw->render->draw_elements( draw->render, + draw_elts, draw_count ); - + draw->render->unmap_vertices( draw->render, 0, (ushort)(count - 1) ); @@ -363,7 +363,7 @@ static void fse_finish( struct draw_pt_middle_end *middle ) static void -fse_destroy( struct draw_pt_middle_end *middle ) +fse_destroy( struct draw_pt_middle_end *middle ) { FREE(middle); } diff --git a/src/gallium/auxiliary/draw/draw_pt_fetch_shade_pipeline.c b/src/gallium/auxiliary/draw/draw_pt_fetch_shade_pipeline.c index b72fd61..cab2f3c 100644 --- a/src/gallium/auxiliary/draw/draw_pt_fetch_shade_pipeline.c +++ b/src/gallium/auxiliary/draw/draw_pt_fetch_shade_pipeline.c @@ -62,7 +62,7 @@ static void fetch_pipeline_prepare( struct draw_pt_middle_end *middle, unsigned i; unsigned instance_id_index = ~0; - unsigned gs_out_prim = (draw->gs.geometry_shader ? + unsigned gs_out_prim = (draw->gs.geometry_shader ? draw->gs.geometry_shader->output_primitive : prim); @@ -86,13 +86,13 @@ static void fetch_pipeline_prepare( struct draw_pt_middle_end *middle, /* Always leave room for the vertex header whether we need it or * not. It's hard to get rid of it in particular because of the - * viewport code in draw_pt_post_vs.c. + * viewport code in draw_pt_post_vs.c. */ fpme->vertex_size = sizeof(struct vertex_header) + nr * 4 * sizeof(float); - - draw_pt_fetch_prepare( fpme->fetch, + + draw_pt_fetch_prepare( fpme->fetch, vs->info.num_inputs, fpme->vertex_size, instance_id_index ); @@ -174,7 +174,7 @@ static void emit(struct pt_emit *emit, static void draw_vertex_shader_run(struct draw_vertex_shader *vshader, - const void *constants[PIPE_MAX_CONSTANT_BUFFERS], + const void *constants[PIPE_MAX_CONSTANT_BUFFERS], unsigned const_size[PIPE_MAX_CONSTANT_BUFFERS], const struct draw_vertex_info *input_verts, struct draw_vertex_info *output_verts ) diff --git a/src/gallium/auxiliary/draw/draw_pt_fetch_shade_pipeline_llvm.c b/src/gallium/auxiliary/draw/draw_pt_fetch_shade_pipeline_llvm.c index 2e3afb2..5b96911 100644 --- a/src/gallium/auxiliary/draw/draw_pt_fetch_shade_pipeline_llvm.c +++ b/src/gallium/auxiliary/draw/draw_pt_fetch_shade_pipeline_llvm.c @@ -73,7 +73,7 @@ llvm_middle_end_prepare( struct draw_pt_middle_end *middle, struct draw_llvm_variant_list_item *li; unsigned i; unsigned instance_id_index = ~0; - const unsigned out_prim = (draw->gs.geometry_shader ? + const unsigned out_prim = (draw->gs.geometry_shader ? draw->gs.geometry_shader->output_primitive : in_prim); @@ -130,7 +130,7 @@ llvm_middle_end_prepare( struct draw_pt_middle_end *middle, /* return even number */ *max_vertices = *max_vertices & ~1; - + key = draw_llvm_make_variant_key(fpme->llvm, store); /* Search shader's list of variants for the key */ @@ -186,7 +186,7 @@ llvm_middle_end_prepare( struct draw_pt_middle_end *middle, (float (*) [12][4]) draw->pt.user.planes[0]; fpme->llvm->jit_context.viewport = (float *)draw->viewport.scale; - + } diff --git a/src/gallium/auxiliary/draw/draw_pt_post_vs.c b/src/gallium/auxiliary/draw/draw_pt_post_vs.c index 769409c..0f85008 100644 --- a/src/gallium/auxiliary/draw/draw_pt_post_vs.c +++ b/src/gallium/auxiliary/draw/draw_pt_post_vs.c @@ -128,7 +128,7 @@ void draw_pt_post_vs_prepare( struct pt_post_vs *pvs, if (clip_xy) pvs->flags |= DO_CLIP_XY; - + if (clip_z && opengl) { pvs->flags |= DO_CLIP_FULL_Z; ASSIGN_4V( pvs->draw->plane[4], 0, 0, 1, 1 ); @@ -179,7 +179,7 @@ void draw_pt_post_vs_prepare( struct pt_post_vs *pvs, DO_VIEWPORT | DO_EDGEFLAG): pvs->run = do_cliptest_xy_fullz_user_viewport_edgeflag; break; - + default: pvs->run = do_cliptest_generic; break; diff --git a/src/gallium/auxiliary/draw/draw_pt_util.c b/src/gallium/auxiliary/draw/draw_pt_util.c index 513bbbe..413ed87 100644 --- a/src/gallium/auxiliary/draw/draw_pt_util.c +++ b/src/gallium/auxiliary/draw/draw_pt_util.c @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ /* diff --git a/src/gallium/auxiliary/draw/draw_vbuf.h b/src/gallium/auxiliary/draw/draw_vbuf.h index e32803c..b84d3ca 100644 --- a/src/gallium/auxiliary/draw/draw_vbuf.h +++ b/src/gallium/auxiliary/draw/draw_vbuf.h @@ -28,7 +28,7 @@ /** * \file * Vertex buffer drawing stage. - * + * * \author Keith Whitwell * \author Jose Fonseca */ @@ -70,11 +70,11 @@ struct vbuf_render { /** * Get the hardware vertex format. - * + * * XXX: have this in draw_context instead? - */ + */ const struct vertex_info *(*get_vertex_info)( struct vbuf_render * ); - + /** * Request a destination for vertices. * Hardware renderers will use ttm memory, others will just malloc @@ -83,9 +83,9 @@ struct vbuf_render { boolean (*allocate_vertices)( struct vbuf_render *, ushort vertex_size, ushort nr_vertices ); - + void *(*map_vertices)( struct vbuf_render * ); - void (*unmap_vertices)( struct vbuf_render *, + void (*unmap_vertices)( struct vbuf_render *, ushort min_index, ushort max_index ); diff --git a/src/gallium/auxiliary/draw/draw_vertex.c b/src/gallium/auxiliary/draw/draw_vertex.c index a4f5e88..605acf0 100644 --- a/src/gallium/auxiliary/draw/draw_vertex.c +++ b/src/gallium/auxiliary/draw/draw_vertex.c @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ /* diff --git a/src/gallium/auxiliary/draw/draw_vertex.h b/src/gallium/auxiliary/draw/draw_vertex.h index e63cf5f..0d211ba 100644 --- a/src/gallium/auxiliary/draw/draw_vertex.h +++ b/src/gallium/auxiliary/draw/draw_vertex.h @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ /** @@ -79,7 +79,7 @@ struct vertex_info uint num_attribs; uint hwfmt[4]; /**< hardware format info for this format */ uint size; /**< total vertex size in dwords */ - + /* Keep this small and at the end of the struct to allow quick * memcmp() comparisons. */ @@ -122,7 +122,7 @@ draw_vinfo_copy( struct vertex_info *dst, */ static INLINE uint draw_emit_vertex_attr(struct vertex_info *vinfo, - enum attrib_emit emit, + enum attrib_emit emit, enum interp_mode interp, /* only used by softpipe??? */ uint src_index) { @@ -138,7 +138,7 @@ draw_emit_vertex_attr(struct vertex_info *vinfo, extern void draw_compute_vertex_size(struct vertex_info *vinfo); -void draw_dump_emitted_vertex(const struct vertex_info *vinfo, +void draw_dump_emitted_vertex(const struct vertex_info *vinfo, const uint8_t *data); diff --git a/src/gallium/auxiliary/draw/draw_vs.c b/src/gallium/auxiliary/draw/draw_vs.c index 032c06b..e9060e7 100644 --- a/src/gallium/auxiliary/draw/draw_vs.c +++ b/src/gallium/auxiliary/draw/draw_vs.c @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ /* @@ -143,8 +143,8 @@ draw_bind_vertex_shader(struct draw_context *draw, struct draw_vertex_shader *dvs) { draw_do_flush( draw, DRAW_FLUSH_STATE_CHANGE ); - - if (dvs) + + if (dvs) { draw->vs.vertex_shader = dvs; draw->vs.num_vs_outputs = dvs->info.num_outputs; @@ -165,7 +165,7 @@ draw_delete_vertex_shader(struct draw_context *draw, { unsigned i; - for (i = 0; i < dvs->nr_varients; i++) + for (i = 0; i < dvs->nr_varients; i++) dvs->varient[i]->destroy( dvs->varient[i] ); dvs->nr_varients = 0; @@ -175,7 +175,7 @@ draw_delete_vertex_shader(struct draw_context *draw, -boolean +boolean draw_vs_init( struct draw_context *draw ) { draw->dump_vs = debug_get_option_gallium_dump_vs(); @@ -185,11 +185,11 @@ draw_vs_init( struct draw_context *draw ) return FALSE; draw->vs.emit_cache = translate_cache_create(); - if (!draw->vs.emit_cache) + if (!draw->vs.emit_cache) return FALSE; - + draw->vs.fetch_cache = translate_cache_create(); - if (!draw->vs.fetch_cache) + if (!draw->vs.fetch_cache) return FALSE; draw->vs.aos_machine = draw_vs_aos_machine(); @@ -197,7 +197,7 @@ draw_vs_init( struct draw_context *draw ) if (!draw->vs.aos_machine) return FALSE; #endif - + return TRUE; } @@ -232,19 +232,19 @@ draw_vs_lookup_varient( struct draw_vertex_shader *vs, struct draw_vs_varient *varient; unsigned i; - /* Lookup existing varient: + /* Lookup existing varient: */ for (i = 0; i < vs->nr_varients; i++) if (draw_vs_varient_key_compare(key, &vs->varient[i]->key) == 0) return vs->varient[i]; - - /* Else have to create a new one: + + /* Else have to create a new one: */ varient = vs->create_varient( vs, key ); if (varient == NULL) return NULL; - /* Add it to our list, could be smarter: + /* Add it to our list, could be smarter: */ if (vs->nr_varients < Elements(vs->varient)) { vs->varient[vs->nr_varients++] = varient; @@ -256,7 +256,7 @@ draw_vs_lookup_varient( struct draw_vertex_shader *vs, vs->varient[vs->last_varient] = varient; } - /* Done + /* Done */ return varient; } @@ -267,12 +267,12 @@ draw_vs_get_fetch( struct draw_context *draw, struct translate_key *key ) { if (!draw->vs.fetch || - translate_key_compare(&draw->vs.fetch->key, key) != 0) + translate_key_compare(&draw->vs.fetch->key, key) != 0) { translate_key_sanitize(key); draw->vs.fetch = translate_cache_find(draw->vs.fetch_cache, key); } - + return draw->vs.fetch; } @@ -281,11 +281,11 @@ draw_vs_get_emit( struct draw_context *draw, struct translate_key *key ) { if (!draw->vs.emit || - translate_key_compare(&draw->vs.emit->key, key) != 0) + translate_key_compare(&draw->vs.emit->key, key) != 0) { translate_key_sanitize(key); draw->vs.emit = translate_cache_find(draw->vs.emit_cache, key); } - + return draw->vs.emit; } diff --git a/src/gallium/auxiliary/draw/draw_vs.h b/src/gallium/auxiliary/draw/draw_vs.h index f9a0387..452266a 100644 --- a/src/gallium/auxiliary/draw/draw_vs.h +++ b/src/gallium/auxiliary/draw/draw_vs.h @@ -1,5 +1,5 @@ /************************************************************************** - * + * * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas. * All Rights Reserved. * @@ -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. - * + * **************************************************************************/ /* Authors: Keith Whitwell @@ -38,11 +38,11 @@ struct draw_context; struct pipe_shader_state; -struct draw_varient_input +struct draw_varient_input { enum pipe_format format; unsigned buffer; - unsigned offset; + unsigned offset; unsigned instance_divisor; }; @@ -115,7 +115,7 @@ struct draw_vertex_shader { */ const float (*immediates)[4]; - /* + /* */ struct draw_vs_varient *varient[16]; unsigned nr_varients; @@ -226,7 +226,7 @@ void draw_vs_aos_machine_viewport( struct aos_machine *machine, #define MAX_TGSI_VERTICES 4 - + #endif diff --git a/src/gallium/auxiliary/draw/draw_vs_aos.c b/src/gallium/auxiliary/draw/draw_vs_aos.c index 19f49e3..0a68263 100644 --- a/src/gallium/auxiliary/draw/draw_vs_aos.c +++ b/src/gallium/auxiliary/draw/draw_vs_aos.c @@ -68,7 +68,7 @@ static INLINE boolean eq( struct x86_reg a, a.mod == b.mod && a.disp == b.disp); } - + struct x86_reg aos_get_x86( struct aos_compilation *cp, unsigned which_reg, /* quick hack */ unsigned value ) @@ -102,7 +102,7 @@ struct x86_reg aos_get_x86( struct aos_compilation *cp, } - x86_mov(cp->func, reg, + x86_mov(cp->func, reg, x86_make_disp(cp->machine_EDX, offset)); cp->x86_reg[which_reg] = value; @@ -134,11 +134,11 @@ static struct x86_reg get_reg_ptr(struct aos_compilation *cp, assert(idx < MAX_INTERNALS); return x86_make_disp(ptr, Offset(struct aos_machine, internal[idx])); - case TGSI_FILE_IMMEDIATE: + case TGSI_FILE_IMMEDIATE: assert(idx < MAX_IMMEDIATES); /* just a sanity check */ return x86_make_disp(aos_get_x86(cp, 0, X86_IMMEDIATES), idx * 4 * sizeof(float)); - case TGSI_FILE_CONSTANT: + case TGSI_FILE_CONSTANT: assert(idx < MAX_CONSTANTS); /* just a sanity check */ return x86_make_disp(aos_get_x86(cp, 1, X86_CONSTANTS), idx * 4 * sizeof(float)); @@ -147,7 +147,7 @@ static struct x86_reg get_reg_ptr(struct aos_compilation *cp, return x86_make_reg(0,0); } } - + #define X87_CW_EXCEPTION_INV_OP (1<<0) @@ -184,11 +184,11 @@ static void spill( struct aos_compilation *cp, unsigned idx ) struct x86_reg oldval = get_reg_ptr(cp, cp->xmm[idx].file, cp->xmm[idx].idx); - - if (0) debug_printf("\nspill %s[%d]", + + if (0) debug_printf("\nspill %s[%d]", files[cp->xmm[idx].file], cp->xmm[idx].idx); - + assert(cp->xmm[idx].dirty); sse_movaps(cp->func, oldval, x86_make_reg(file_XMM, idx)); cp->xmm[idx].dirty = 0; @@ -201,7 +201,7 @@ void aos_spill_all( struct aos_compilation *cp ) unsigned i; for (i = 0; i < 8; i++) { - if (cp->xmm[i].dirty) + if (cp->xmm[i].dirty) spill(cp, i); aos_release_xmm_reg(cp, i); } @@ -226,7 +226,7 @@ static struct x86_reg get_xmm_writable( struct aos_compilation *cp, static struct x86_reg get_xmm( struct aos_compilation *cp, struct x86_reg reg ) { - if (reg.file != file_XMM) + if (reg.file != file_XMM) { struct x86_reg tmp = aos_get_xmm_reg(cp); sse_movaps(cp->func, tmp, reg); @@ -247,7 +247,7 @@ struct x86_reg aos_get_xmm_reg( struct aos_compilation *cp ) unsigned oldest = 0; boolean found = FALSE; - for (i = 0; i < 8; i++) + for (i = 0; i < 8; i++) if (cp->xmm[i].last_used != cp->insn_counter && cp->xmm[i].file == TGSI_FILE_NULL) { oldest = i; @@ -255,14 +255,14 @@ struct x86_reg aos_get_xmm_reg( struct aos_compilation *cp ) } if (!found) { - for (i = 0; i < 8; i++) + for (i = 0; i < 8; i++) if (cp->xmm[i].last_used < cp->xmm[oldest].last_used) oldest = i; } /* Need to write out the old value? */ - if (cp->xmm[oldest].dirty) + if (cp->xmm[oldest].dirty) spill(cp, oldest); assert(cp->xmm[oldest].last_used != cp->insn_counter); @@ -294,7 +294,7 @@ static void aos_soft_release_xmm( struct aos_compilation *cp, } - + /* Mark an xmm reg as holding the current copy of a shader reg. */ void aos_adopt_xmm_reg( struct aos_compilation *cp, @@ -315,8 +315,8 @@ void aos_adopt_xmm_reg( struct aos_compilation *cp, * illusion. */ for (i = 0; i < 8; i++) { - if (cp->xmm[i].file == file && - cp->xmm[i].idx == idx) + if (cp->xmm[i].file == file && + cp->xmm[i].idx == idx) { /* If an xmm reg is already holding this shader reg, take into account its * dirty flag... @@ -335,7 +335,7 @@ void aos_adopt_xmm_reg( struct aos_compilation *cp, /* Return a pointer to the in-memory copy of the reg, making sure it is uptodate. */ -static struct x86_reg aos_get_shader_reg_ptr( struct aos_compilation *cp, +static struct x86_reg aos_get_shader_reg_ptr( struct aos_compilation *cp, unsigned file, unsigned idx ) { @@ -344,7 +344,7 @@ static struct x86_reg aos_get_shader_reg_ptr( struct aos_compilation *cp, /* Ensure the in-memory copy of this reg is up-to-date */ for (i = 0; i < 8; i++) { - if (cp->xmm[i].file == file && + if (cp->xmm[i].file == file && cp->xmm[i].idx == idx && cp->xmm[i].dirty) { spill(cp, i); @@ -358,13 +358,13 @@ static struct x86_reg aos_get_shader_reg_ptr( struct aos_compilation *cp, /* As above, but return a pointer. Note - this pointer may alias * those returned by get_arg_ptr(). */ -static struct x86_reg get_dst_ptr( struct aos_compilation *cp, +static struct x86_reg get_dst_ptr( struct aos_compilation *cp, const struct tgsi_full_dst_register *dst ) { unsigned file = dst->Register.File; unsigned idx = dst->Register.Index; unsigned i; - + /* Ensure in-memory copy of this reg is up-to-date and invalidate * any xmm copies. @@ -373,9 +373,9 @@ static struct x86_reg get_dst_ptr( struct aos_compilation *cp, if (cp->xmm[i].file == file && cp->xmm[i].idx == idx) { - if (cp->xmm[i].dirty) + if (cp->xmm[i].dirty) spill(cp, i); - + aos_release_xmm_reg(cp, i); } } @@ -390,7 +390,7 @@ static struct x86_reg get_dst_ptr( struct aos_compilation *cp, /* Return an XMM reg if the argument is resident, otherwise return a * base+offset pointer to the saved value. */ -struct x86_reg aos_get_shader_reg( struct aos_compilation *cp, +struct x86_reg aos_get_shader_reg( struct aos_compilation *cp, unsigned file, unsigned idx ) { @@ -398,7 +398,7 @@ struct x86_reg aos_get_shader_reg( struct aos_compilation *cp, for (i = 0; i < 8; i++) { if (cp->xmm[i].file == file && - cp->xmm[i].idx == idx) + cp->xmm[i].idx == idx) { cp->xmm[i].last_used = cp->insn_counter; return x86_make_reg(file_XMM, i); @@ -413,7 +413,7 @@ struct x86_reg aos_get_shader_reg( struct aos_compilation *cp, -static struct x86_reg aos_get_shader_reg_xmm( struct aos_compilation *cp, +static struct x86_reg aos_get_shader_reg_xmm( struct aos_compilation *cp, unsigned file, unsigned idx ) { @@ -425,7 +425,7 @@ static struct x86_reg aos_get_shader_reg_xmm( struct aos_compilation *cp, file, idx, FALSE ); - + return reg; } @@ -459,7 +459,7 @@ static void emit_pshufd( struct aos_compilation *cp, sse2_pshufd(cp->func, dst, arg0, shuf); } else { - if (!eq(dst, arg0)) + if (!eq(dst, arg0)) sse_movaps(cp->func, dst, arg0); sse_shufps(cp->func, dst, dst, shuf); @@ -479,8 +479,8 @@ static boolean mask_write( struct aos_compilation *cp, { struct x86_reg imm_swz = aos_get_internal_xmm(cp, IMM_SWZ); struct x86_reg tmp = aos_get_xmm_reg(cp); - - emit_pshufd(cp, tmp, imm_swz, + + emit_pshufd(cp, tmp, imm_swz, SHUF((mask & 1) ? 2 : 3, (mask & 2) ? 2 : 3, (mask & 4) ? 2 : 3, @@ -521,15 +521,15 @@ static boolean emit_shuf_copy2( struct aos_compilation *cp, #define SSE_SWIZZLE_NOOP ((0<<0) | (1<<2) | (2<<4) | (3<<6)) -/* Locate a source register and perform any required (simple) swizzle. - * +/* Locate a source register and perform any required (simple) swizzle. + * * Just fail on complex swizzles at this point. */ -static struct x86_reg fetch_src( struct aos_compilation *cp, - const struct tgsi_full_src_register *src ) +static struct x86_reg fetch_src( struct aos_compilation *cp, + const struct tgsi_full_src_register *src ) { - struct x86_reg arg0 = aos_get_shader_reg(cp, - src->Register.File, + struct x86_reg arg0 = aos_get_shader_reg(cp, + src->Register.File, src->Register.Index); unsigned i; ubyte swz = 0; @@ -546,7 +546,7 @@ static struct x86_reg fetch_src( struct aos_compilation *cp, case TGSI_UTIL_SIGN_TOGGLE: negs |= (1<Register.File, + struct x86_reg arg0 = aos_get_shader_reg_ptr(cp, + src->Register.File, src->Register.Index); unsigned swizzle = tgsi_util_get_full_src_register_swizzle( src, channel ); @@ -634,7 +634,7 @@ static void x87_fld_src( struct aos_compilation *cp, */ x87_fchs( cp->func ); break; - + case TGSI_UTIL_SIGN_KEEP: break; @@ -663,7 +663,7 @@ static void x87_fld_src( struct aos_compilation *cp, * to a 2 argument format (dst/arg0, arg1) at the shader level before * attempting to translate to x86/sse code. */ -static void store_dest( struct aos_compilation *cp, +static void store_dest( struct aos_compilation *cp, const struct tgsi_full_dst_register *reg, struct x86_reg result ) { @@ -672,19 +672,19 @@ static void store_dest( struct aos_compilation *cp, switch (reg->Register.WriteMask) { case 0: return; - + case TGSI_WRITEMASK_XYZW: - aos_adopt_xmm_reg(cp, - get_xmm_writable(cp, result), + aos_adopt_xmm_reg(cp, + get_xmm_writable(cp, result), reg->Register.File, reg->Register.Index, TRUE); return; - default: + default: break; } - dst = aos_get_shader_reg_xmm(cp, + dst = aos_get_shader_reg_xmm(cp, reg->Register.File, reg->Register.Index); @@ -692,18 +692,18 @@ static void store_dest( struct aos_compilation *cp, case TGSI_WRITEMASK_X: sse_movss(cp->func, dst, get_xmm(cp, result)); break; - + case TGSI_WRITEMASK_ZW: sse_shufps(cp->func, dst, get_xmm(cp, result), SHUF(X, Y, Z, W)); break; - case TGSI_WRITEMASK_XY: + case TGSI_WRITEMASK_XY: result = get_xmm_writable(cp, result); sse_shufps(cp->func, result, dst, SHUF(X, Y, Z, W)); dst = result; break; - case TGSI_WRITEMASK_YZW: + case TGSI_WRITEMASK_YZW: result = get_xmm_writable(cp, result); sse_movss(cp->func, result, dst); dst = result; @@ -714,8 +714,8 @@ static void store_dest( struct aos_compilation *cp, break; } - aos_adopt_xmm_reg(cp, - dst, + aos_adopt_xmm_reg(cp, + dst, reg->Register.File, reg->Register.Index, TRUE); @@ -733,7 +733,7 @@ static void inject_scalar( struct aos_compilation *cp, } -static void store_scalar_dest( struct aos_compilation *cp, +static void store_scalar_dest( struct aos_compilation *cp, const struct tgsi_full_dst_register *reg, struct x86_reg result ) { @@ -744,7 +744,7 @@ static void store_scalar_dest( struct aos_compilation *cp, writemask != TGSI_WRITEMASK_Y && writemask != TGSI_WRITEMASK_Z && writemask != TGSI_WRITEMASK_W && - writemask != 0) + writemask != 0) { result = get_xmm_writable(cp, result); /* already true, right? */ sse_shufps(cp->func, result, result, SHUF(X,X,X,X)); @@ -753,7 +753,7 @@ static void store_scalar_dest( struct aos_compilation *cp, } result = get_xmm(cp, result); - dst = aos_get_shader_reg_xmm(cp, + dst = aos_get_shader_reg_xmm(cp, reg->Register.File, reg->Register.Index); @@ -780,13 +780,13 @@ static void store_scalar_dest( struct aos_compilation *cp, break; } - aos_adopt_xmm_reg(cp, - dst, + aos_adopt_xmm_reg(cp, + dst, reg->Register.File, reg->Register.Index, TRUE); } - + static void x87_fst_or_nop( struct x86_function *func, @@ -795,7 +795,7 @@ static void x87_fst_or_nop( struct x86_function *func, struct x86_reg ptr ) { assert(ptr.file == file_REG32); - if (writemask & (1<Register.WriteMask; x87_fst_or_nop(cp->func, writemask, 0, ptr); @@ -831,14 +831,14 @@ static void x87_fstp_dest4( struct aos_compilation *cp, */ static void save_fpu_state( struct aos_compilation *cp ) { - x87_fnstcw( cp->func, x86_make_disp(cp->machine_EDX, + x87_fnstcw( cp->func, x86_make_disp(cp->machine_EDX, Offset(struct aos_machine, fpu_restore))); } static void restore_fpu_state( struct aos_compilation *cp ) { x87_fnclex(cp->func); - x87_fldcw( cp->func, x86_make_disp(cp->machine_EDX, + x87_fldcw( cp->func, x86_make_disp(cp->machine_EDX, Offset(struct aos_machine, fpu_restore))); } @@ -847,7 +847,7 @@ static void set_fpu_round_neg_inf( struct aos_compilation *cp ) if (cp->fpucntl != FPU_RND_NEG) { cp->fpucntl = FPU_RND_NEG; x87_fnclex(cp->func); - x87_fldcw( cp->func, x86_make_disp(cp->machine_EDX, + x87_fldcw( cp->func, x86_make_disp(cp->machine_EDX, Offset(struct aos_machine, fpu_rnd_neg_inf))); } } @@ -857,7 +857,7 @@ static void set_fpu_round_nearest( struct aos_compilation *cp ) if (cp->fpucntl != FPU_RND_NEAREST) { cp->fpucntl = FPU_RND_NEAREST; x87_fnclex(cp->func); - x87_fldcw( cp->func, x86_make_disp(cp->machine_EDX, + x87_fldcw( cp->func, x86_make_disp(cp->machine_EDX, Offset(struct aos_machine, fpu_rnd_nearest))); } } @@ -883,7 +883,7 @@ static void x87_emit_ex2( struct aos_compilation *cp ) x87_fstp(cp->func, st1); /* 2^a */ assert( stack == cp->func->x87_stack); - + } #endif @@ -915,13 +915,13 @@ static void emit_print( struct aos_compilation *cp, * debug path, so here goes: */ for (i = 0; i < 8; i++) { - if (cp->xmm[i].dirty) + if (cp->xmm[i].dirty) spill(cp, i); aos_release_xmm_reg(cp, i); } - /* Push caller-save (ie scratch) regs. + /* Push caller-save (ie scratch) regs. */ x86_cdecl_caller_push_regs( cp->func ); @@ -940,11 +940,11 @@ static void emit_print( struct aos_compilation *cp, x86_pop( cp->func, ecx ); x86_pop( cp->func, ecx ); - /* Pop caller-save regs + /* Pop caller-save regs */ x86_cdecl_caller_pop_regs( cp->func ); - /* Done... + /* Done... */ } #endif @@ -954,7 +954,7 @@ static void emit_print( struct aos_compilation *cp, * and ignore write masks and swizzling issues. */ -static boolean emit_ABS( struct aos_compilation *cp, const struct tgsi_full_instruction *op ) +static boolean emit_ABS( struct aos_compilation *cp, const struct tgsi_full_instruction *op ) { struct x86_reg arg0 = fetch_src(cp, &op->Src[0]); struct x86_reg neg = aos_get_internal(cp, IMM_NEGS); @@ -963,7 +963,7 @@ static boolean emit_ABS( struct aos_compilation *cp, const struct tgsi_full_inst sse_movaps(cp->func, tmp, arg0); sse_mulps(cp->func, tmp, neg); sse_maxps(cp->func, tmp, arg0); - + store_dest(cp, &op->Dst[0], tmp); return TRUE; } @@ -980,7 +980,7 @@ static boolean emit_ADD( struct aos_compilation *cp, const struct tgsi_full_inst return TRUE; } -static boolean emit_COS( struct aos_compilation *cp, const struct tgsi_full_instruction *op ) +static boolean emit_COS( struct aos_compilation *cp, const struct tgsi_full_instruction *op ) { x87_fld_src(cp, &op->Src[0], 0); x87_fcos(cp->func); @@ -995,17 +995,17 @@ static boolean emit_DP3( struct aos_compilation *cp, const struct tgsi_full_inst { struct x86_reg arg0 = fetch_src(cp, &op->Src[0]); struct x86_reg arg1 = fetch_src(cp, &op->Src[1]); - struct x86_reg tmp = aos_get_xmm_reg(cp); + struct x86_reg tmp = aos_get_xmm_reg(cp); struct x86_reg dst = get_xmm_writable(cp, arg0); sse_mulps(cp->func, dst, arg1); /* Now the hard bit: sum the first 3 values: - */ + */ sse_movhlps(cp->func, tmp, dst); sse_addss(cp->func, dst, tmp); /* a*x+c*z, b*y, ?, ? */ emit_pshufd(cp, tmp, dst, SHUF(Y,X,W,Z)); sse_addss(cp->func, dst, tmp); - + aos_release_xmm_reg(cp, tmp.idx); store_scalar_dest(cp, &op->Dst[0], dst); return TRUE; @@ -1015,13 +1015,13 @@ static boolean emit_DP4( struct aos_compilation *cp, const struct tgsi_full_inst { struct x86_reg arg0 = fetch_src(cp, &op->Src[0]); struct x86_reg arg1 = fetch_src(cp, &op->Src[1]); - struct x86_reg tmp = aos_get_xmm_reg(cp); + struct x86_reg tmp = aos_get_xmm_reg(cp); struct x86_reg dst = get_xmm_writable(cp, arg0); sse_mulps(cp->func, dst, arg1); - + /* Now the hard bit: sum the values: - */ + */ sse_movhlps(cp->func, tmp, dst); sse_addps(cp->func, dst, tmp); /* a*x+c*z, b*y+d*w, a*x+c*z, b*y+d*w */ emit_pshufd(cp, tmp, dst, SHUF(Y,X,W,Z)); @@ -1042,7 +1042,7 @@ static boolean emit_DPH( struct aos_compilation *cp, const struct tgsi_full_inst sse_mulps(cp->func, dst, arg1); /* Now the hard bit: sum the values (from DP3): - */ + */ sse_movhlps(cp->func, tmp, dst); sse_addss(cp->func, dst, tmp); /* a*x+c*z, b*y, ?, ? */ emit_pshufd(cp, tmp, dst, SHUF(Y,X,W,Z)); @@ -1077,7 +1077,7 @@ static boolean emit_DST( struct aos_compilation *cp, const struct tgsi_full_inst return TRUE; } -static boolean emit_LG2( struct aos_compilation *cp, const struct tgsi_full_instruction *op ) +static boolean emit_LG2( struct aos_compilation *cp, const struct tgsi_full_instruction *op ) { x87_fld1(cp->func); /* 1 */ x87_fld_src(cp, &op->Src[0], 0); /* a0 1 */ @@ -1087,7 +1087,7 @@ static boolean emit_LG2( struct aos_compilation *cp, const struct tgsi_full_inst } #if 0 -static boolean emit_EX2( struct aos_compilation *cp, const struct tgsi_full_instruction *op ) +static boolean emit_EX2( struct aos_compilation *cp, const struct tgsi_full_instruction *op ) { x87_fld_src(cp, &op->Src[0], 0); x87_emit_ex2(cp); @@ -1097,9 +1097,9 @@ static boolean emit_EX2( struct aos_compilation *cp, const struct tgsi_full_inst #endif -static boolean emit_FLR( struct aos_compilation *cp, const struct tgsi_full_instruction *op ) +static boolean emit_FLR( struct aos_compilation *cp, const struct tgsi_full_instruction *op ) { - struct x86_reg dst = get_dst_ptr(cp, &op->Dst[0]); + struct x86_reg dst = get_dst_ptr(cp, &op->Dst[0]); unsigned writemask = op->Dst[0].Register.WriteMask; int i; @@ -1109,13 +1109,13 @@ static boolean emit_FLR( struct aos_compilation *cp, const struct tgsi_full_inst */ for (i = 3; i >= 0; i--) { if (writemask & (1<Src[0], i); + x87_fld_src(cp, &op->Src[0], i); } } for (i = 0; i < 4; i++) { if (writemask & (1<func ); + x87_fprndint( cp->func ); x87_fstp(cp->func, x86_make_disp(dst, i*4)); } } @@ -1124,9 +1124,9 @@ static boolean emit_FLR( struct aos_compilation *cp, const struct tgsi_full_inst } -static boolean emit_RND( struct aos_compilation *cp, const struct tgsi_full_instruction *op ) +static boolean emit_RND( struct aos_compilation *cp, const struct tgsi_full_instruction *op ) { - struct x86_reg dst = get_dst_ptr(cp, &op->Dst[0]); + struct x86_reg dst = get_dst_ptr(cp, &op->Dst[0]); unsigned writemask = op->Dst[0].Register.WriteMask; int i; @@ -1136,13 +1136,13 @@ static boolean emit_RND( struct aos_compilation *cp, const struct tgsi_full_inst */ for (i = 3; i >= 0; i--) { if (writemask & (1<Src[0], i); + x87_fld_src(cp, &op->Src[0], i); } } for (i = 0; i < 4; i++) { if (writemask & (1<func ); + x87_fprndint( cp->func ); x87_fstp(cp->func, x86_make_disp(dst, i*4)); } } @@ -1151,9 +1151,9 @@ static boolean emit_RND( struct aos_compilation *cp, const struct tgsi_full_inst } -static boolean emit_FRC( struct aos_compilation *cp, const struct tgsi_full_instruction *op ) +static boolean emit_FRC( struct aos_compilation *cp, const struct tgsi_full_instruction *op ) { - struct x86_reg dst = get_dst_ptr(cp, &op->Dst[0]); + struct x86_reg dst = get_dst_ptr(cp, &op->Dst[0]); struct x86_reg st0 = x86_make_reg(file_x87, 0); struct x86_reg st1 = x86_make_reg(file_x87, 1); unsigned writemask = op->Dst[0].Register.WriteMask; @@ -1166,7 +1166,7 @@ static boolean emit_FRC( struct aos_compilation *cp, const struct tgsi_full_inst */ for (i = 3; i >= 0; i--) { if (writemask & (1<Src[0], i); + x87_fld_src(cp, &op->Src[0], i); } } @@ -1197,32 +1197,32 @@ static boolean emit_LIT( struct aos_compilation *cp, const struct tgsi_full_inst #if 1 /* For absolute correctness, need to spill/invalidate all XMM regs - * too. + * too. */ for (i = 0; i < 8; i++) { - if (cp->xmm[i].dirty) + if (cp->xmm[i].dirty) spill(cp, i); aos_release_xmm_reg(cp, i); } #endif - if (writemask != TGSI_WRITEMASK_XYZW) + if (writemask != TGSI_WRITEMASK_XYZW) result = x86_make_disp(cp->machine_EDX, Offset(struct aos_machine, tmp[0])); - else - result = get_dst_ptr(cp, &op->Dst[0]); + else + result = get_dst_ptr(cp, &op->Dst[0]); + - arg0 = fetch_src( cp, &op->Src[0] ); if (arg0.file == file_XMM) { - struct x86_reg tmp = x86_make_disp(cp->machine_EDX, + struct x86_reg tmp = x86_make_disp(cp->machine_EDX, Offset(struct aos_machine, tmp[1])); sse_movaps( cp->func, tmp, arg0 ); arg0 = tmp; } - - - /* Push caller-save (ie scratch) regs. + + + /* Push caller-save (ie scratch) regs. */ x86_cdecl_caller_push_regs( cp->func ); @@ -1239,9 +1239,9 @@ static boolean emit_LIT( struct aos_compilation *cp, const struct tgsi_full_inst x86_push( cp->func, cp->machine_EDX ); if (lit_count < MAX_LIT_INFO) { - x86_mov( cp->func, ecx, x86_make_disp( cp->machine_EDX, - Offset(struct aos_machine, lit_info) + - lit_count * sizeof(struct lit_info) + + x86_mov( cp->func, ecx, x86_make_disp( cp->machine_EDX, + Offset(struct aos_machine, lit_info) + + lit_count * sizeof(struct lit_info) + Offset(struct lit_info, func))); } else { @@ -1249,7 +1249,7 @@ static boolean emit_LIT( struct aos_compilation *cp, const struct tgsi_full_inst } x86_call( cp->func, ecx ); - + x86_pop( cp->func, ecx ); /* fixme... */ x86_pop( cp->func, ecx ); x86_pop( cp->func, ecx ); @@ -1258,7 +1258,7 @@ static boolean emit_LIT( struct aos_compilation *cp, const struct tgsi_full_inst x86_cdecl_caller_pop_regs( cp->func ); if (writemask != TGSI_WRITEMASK_XYZW) { - store_dest( cp, + store_dest( cp, &op->Dst[0], get_xmm_writable( cp, result ) ); } @@ -1266,17 +1266,17 @@ static boolean emit_LIT( struct aos_compilation *cp, const struct tgsi_full_inst return TRUE; } -#if 0 +#if 0 static boolean emit_inline_LIT( struct aos_compilation *cp, const struct tgsi_full_instruction *op ) { - struct x86_reg dst = get_dst_ptr(cp, &op->Dst[0]); + struct x86_reg dst = get_dst_ptr(cp, &op->Dst[0]); unsigned writemask = op->Dst[0].Register.WriteMask; if (writemask & TGSI_WRITEMASK_YZ) { struct x86_reg st1 = x86_make_reg(file_x87, 1); struct x86_reg st2 = x86_make_reg(file_x87, 2); - /* a1' = a1 <= 0 ? 1 : a1; + /* a1' = a1 <= 0 ? 1 : a1; */ x87_fldz(cp->func); /* 1 0 */ #if 1 @@ -1294,7 +1294,7 @@ static boolean emit_inline_LIT( struct aos_compilation *cp, const struct tgsi_fu x87_fld_src(cp, &op->Src[0], 3); /* a3 a1' */ x87_fxch(cp->func, st1); /* a1' a3 */ - + /* Compute pow(a1, a3) */ @@ -1306,7 +1306,7 @@ static boolean emit_inline_LIT( struct aos_compilation *cp, const struct tgsi_fu */ x87_fldz(cp->func); /* 0 r2 */ x87_fld_src(cp, &op->Src[0], 0); /* a0 0 r2 */ - x87_fcomi(cp->func, st1); + x87_fcomi(cp->func, st1); x87_fcmovb(cp->func, st1); /* a0' 0 r2 */ x87_fst_or_nop(cp->func, writemask, 1, dst); /* result[1] = a0' */ @@ -1422,7 +1422,7 @@ static float PIPE_CDECL _exp2(float x) /* Really not sufficient -- need to check for conditions that could * generate inf/nan values, which will slow things down hugely. */ -static boolean emit_POW( struct aos_compilation *cp, const struct tgsi_full_instruction *op ) +static boolean emit_POW( struct aos_compilation *cp, const struct tgsi_full_instruction *op ) { #if 0 x87_fld_src(cp, &op->Src[1], 0); /* a1.x */ @@ -1436,15 +1436,15 @@ static boolean emit_POW( struct aos_compilation *cp, const struct tgsi_full_inst uint i; /* For absolute correctness, need to spill/invalidate all XMM regs - * too. + * too. */ for (i = 0; i < 8; i++) { - if (cp->xmm[i].dirty) + if (cp->xmm[i].dirty) spill(cp, i); aos_release_xmm_reg(cp, i); } - /* Push caller-save (ie scratch) regs. + /* Push caller-save (ie scratch) regs. */ x86_cdecl_caller_push_regs( cp->func ); @@ -1474,20 +1474,20 @@ static boolean emit_POW( struct aos_compilation *cp, const struct tgsi_full_inst #if FAST_MATH -static boolean emit_EXPBASE2( struct aos_compilation *cp, const struct tgsi_full_instruction *op ) +static boolean emit_EXPBASE2( struct aos_compilation *cp, const struct tgsi_full_instruction *op ) { uint i; /* For absolute correctness, need to spill/invalidate all XMM regs - * too. + * too. */ for (i = 0; i < 8; i++) { - if (cp->xmm[i].dirty) + if (cp->xmm[i].dirty) spill(cp, i); aos_release_xmm_reg(cp, i); } - /* Push caller-save (ie scratch) regs. + /* Push caller-save (ie scratch) regs. */ x86_cdecl_caller_push_regs( cp->func ); @@ -1539,12 +1539,12 @@ static boolean emit_RCP( struct aos_compilation *cp, const struct tgsi_full_inst /* Although rsqrtps() and rcpps() are low precision on some/all SSE * implementations, it is possible to improve its precision at * fairly low cost, using a newton/raphson step, as below: - * + * * x1 = 2 * rcpps(a) - a * rcpps(a) * rcpps(a) * x1 = 0.5 * rsqrtps(a) * [3.0 - (a * rsqrtps(a))* rsqrtps(a)] * or: * x1 = rsqrtps(a) * [1.5 - .5 * a * rsqrtps(a) * rsqrtps(a)] - * + * * * See: http://softwarecommunity.intel.com/articles/eng/1818.htm */ @@ -1570,7 +1570,7 @@ static boolean emit_RSQ( struct aos_compilation *cp, const struct tgsi_full_inst sse_movaps(cp->func, tmp, src); sse_mulps(cp->func, tmp, neg); sse_maxps(cp->func, tmp, src); - + sse_rsqrtss( cp->func, r, tmp ); /* rsqrtss(a) */ sse_mulss( cp->func, tmp, neg_half ); /* -.5 * a */ sse_mulss( cp->func, tmp, r ); /* -.5 * a * r */ @@ -1601,7 +1601,7 @@ static boolean emit_SGE( struct aos_compilation *cp, const struct tgsi_full_inst return TRUE; } -static boolean emit_SIN( struct aos_compilation *cp, const struct tgsi_full_instruction *op ) +static boolean emit_SIN( struct aos_compilation *cp, const struct tgsi_full_instruction *op ) { x87_fld_src(cp, &op->Src[0], 0); x87_fsin(cp->func); @@ -1617,7 +1617,7 @@ static boolean emit_SLT( struct aos_compilation *cp, const struct tgsi_full_inst struct x86_reg arg1 = fetch_src(cp, &op->Src[1]); struct x86_reg ones = aos_get_internal(cp, IMM_ONES); struct x86_reg dst = get_xmm_writable(cp, arg0); - + sse_cmpps(cp->func, dst, arg1, cc_LessThan); sse_andps(cp->func, dst, ones); @@ -1625,7 +1625,7 @@ static boolean emit_SLT( struct aos_compilation *cp, const struct tgsi_full_inst return TRUE; } -static boolean emit_SUB( struct aos_compilation *cp, const struct tgsi_full_instruction *op ) +static boolean emit_SUB( struct aos_compilation *cp, const struct tgsi_full_instruction *op ) { struct x86_reg arg0 = fetch_src(cp, &op->Src[0]); struct x86_reg arg1 = fetch_src(cp, &op->Src[1]); @@ -1649,7 +1649,7 @@ static boolean emit_TRUNC( struct aos_compilation *cp, const struct tgsi_full_in return TRUE; } -static boolean emit_XPD( struct aos_compilation *cp, const struct tgsi_full_instruction *op ) +static boolean emit_XPD( struct aos_compilation *cp, const struct tgsi_full_instruction *op ) { struct x86_reg arg0 = fetch_src(cp, &op->Src[0]); struct x86_reg arg1 = fetch_src(cp, &op->Src[1]); @@ -1735,7 +1735,7 @@ emit_instruction( struct aos_compilation *cp, case TGSI_OPCODE_SUB: return emit_SUB(cp, inst); - + case TGSI_OPCODE_LRP: /*return emit_LERP(cp, inst);*/ return FALSE; @@ -1800,14 +1800,14 @@ emit_instruction( struct aos_compilation *cp, static boolean emit_viewport( struct aos_compilation *cp ) { - struct x86_reg pos = aos_get_shader_reg_xmm(cp, - TGSI_FILE_OUTPUT, + struct x86_reg pos = aos_get_shader_reg_xmm(cp, + TGSI_FILE_OUTPUT, cp->vaos->draw->vs.position_output ); - struct x86_reg scale = x86_make_disp(cp->machine_EDX, + struct x86_reg scale = x86_make_disp(cp->machine_EDX, Offset(struct aos_machine, scale)); - struct x86_reg translate = x86_make_disp(cp->machine_EDX, + struct x86_reg translate = x86_make_disp(cp->machine_EDX, Offset(struct aos_machine, translate)); sse_mulps(cp->func, pos, scale); @@ -1829,14 +1829,14 @@ static boolean emit_viewport( struct aos_compilation *cp ) static boolean emit_rhw_viewport( struct aos_compilation *cp ) { struct x86_reg tmp = aos_get_xmm_reg(cp); - struct x86_reg pos = aos_get_shader_reg_xmm(cp, - TGSI_FILE_OUTPUT, + struct x86_reg pos = aos_get_shader_reg_xmm(cp, + TGSI_FILE_OUTPUT, cp->vaos->draw->vs.position_output); - struct x86_reg scale = x86_make_disp(cp->machine_EDX, + struct x86_reg scale = x86_make_disp(cp->machine_EDX, Offset(struct aos_machine, scale)); - struct x86_reg translate = x86_make_disp(cp->machine_EDX, + struct x86_reg translate = x86_make_disp(cp->machine_EDX, Offset(struct aos_machine, translate)); @@ -1844,12 +1844,12 @@ static boolean emit_rhw_viewport( struct aos_compilation *cp ) emit_pshufd(cp, tmp, pos, SHUF(W, W, W, W)); sse2_rcpss(cp->func, tmp, tmp); sse_shufps(cp->func, tmp, tmp, SHUF(X, X, X, X)); - + sse_mulps(cp->func, pos, scale); sse_mulps(cp->func, pos, tmp); sse_addps(cp->func, pos, translate); - /* Set pos[3] = w + /* Set pos[3] = w */ mask_write(cp, pos, tmp, TGSI_WRITEMASK_W); @@ -1890,15 +1890,15 @@ static void find_last_write_outputs( struct aos_compilation *cp ) tgsi_parse_init( &parse, cp->vaos->base.vs->state.tokens ); while (!tgsi_parse_end_of_tokens( &parse )) { - + tgsi_parse_token( &parse ); - if (parse.FullToken.Token.Type != TGSI_TOKEN_TYPE_INSTRUCTION) + if (parse.FullToken.Token.Type != TGSI_TOKEN_TYPE_INSTRUCTION) continue; for (i = 0; i < TGSI_FULL_MAX_DST_REGISTERS; i++) { if (parse.FullToken.FullInstruction.Dst[i].Register.File == - TGSI_FILE_OUTPUT) + TGSI_FILE_OUTPUT) { unsigned idx = parse.FullToken.FullInstruction.Dst[i].Register.Index; cp->output_last_write[idx] = this_instruction; @@ -1920,7 +1920,7 @@ static void find_last_write_outputs( struct aos_compilation *cp ) static boolean build_vertex_program( struct draw_vs_varient_aos_sse *varient, boolean linear ) -{ +{ struct tgsi_parse_context parse; struct aos_compilation cp; unsigned fixup, label; @@ -1975,8 +1975,8 @@ static boolean build_vertex_program( struct draw_vs_varient_aos_sse *varient, cp.x86_reg[0] = 0; cp.x86_reg[1] = 0; - - /* Note address for loop jump + + /* Note address for loop jump */ label = x86_get_label(cp.func); { @@ -1987,7 +1987,7 @@ static boolean build_vertex_program( struct draw_vs_varient_aos_sse *varient, /* Emit the shader: */ - while( !tgsi_parse_end_of_tokens( &parse ) && !cp.error ) + while( !tgsi_parse_end_of_tokens( &parse ) && !cp.error ) { tgsi_parse_token( &parse ); @@ -2015,7 +2015,7 @@ static boolean build_vertex_program( struct draw_vs_varient_aos_sse *varient, debug_printf("\n"); } - + { unsigned i; for (i = 0; i < 8; i++) { @@ -2033,7 +2033,7 @@ static boolean build_vertex_program( struct draw_vs_varient_aos_sse *varient, /* not really handling clipping, just do the rhw so we can * see the results... */ - emit_rhw_viewport(&cp); + emit_rhw_viewport(&cp); } else if (cp.vaos->base.key.viewport) { emit_viewport(&cp); @@ -2048,13 +2048,13 @@ static boolean build_vertex_program( struct draw_vs_varient_aos_sse *varient, /* Next vertex: */ - x86_lea(cp.func, - cp.outbuf_ECX, - x86_make_disp(cp.outbuf_ECX, + x86_lea(cp.func, + cp.outbuf_ECX, + x86_make_disp(cp.outbuf_ECX, cp.vaos->base.key.output_stride)); /* Incr index - */ + */ aos_incr_inputs( &cp, linear ); } /* decr count, loop if not zero @@ -2148,7 +2148,7 @@ static void PIPE_CDECL vaos_run_linear( struct draw_vs_varient *varient, struct aos_machine *machine = vaos->draw->vs.aos_machine; unsigned i; - if (0) debug_printf("%s %d %d const: %x\n", __FUNCTION__, start, count, + if (0) debug_printf("%s %d %d const: %x\n", __FUNCTION__, start, count, vaos->base.key.const_vbuffers); machine->internal[IMM_PSIZE][0] = vaos->draw->rasterizer->point_size; @@ -2193,7 +2193,7 @@ static struct draw_vs_varient *varient_aos_sse( struct draw_vertex_shader *vs, if (!vaos) goto fail; - + vaos->base.key = *key; vaos->base.vs = vs; vaos->base.set_buffer = vaos_set_buffer; @@ -2203,7 +2203,7 @@ static struct draw_vs_varient *varient_aos_sse( struct draw_vertex_shader *vs, vaos->draw = vs->draw; - for (i = 0; i < key->nr_inputs; i++) + for (i = 0; i < key->nr_inputs; i++) vaos->nr_vb = MAX2( vaos->nr_vb, key->element[i].in.buffer + 1 ); vaos->buffer = MALLOC( vaos->nr_vb * sizeof(vaos->buffer[0]) ); @@ -2244,7 +2244,7 @@ static struct draw_vs_varient *varient_aos_sse( struct draw_vertex_shader *vs, x86_release_func( &vaos->func[1] ); FREE(vaos); - + return NULL; } diff --git a/src/gallium/auxiliary/draw/draw_vs_aos.h b/src/gallium/auxiliary/draw/draw_vs_aos.h index 68e8295..90214a2 100644 --- a/src/gallium/auxiliary/draw/draw_vs_aos.h +++ b/src/gallium/auxiliary/draw/draw_vs_aos.h @@ -1,5 +1,5 @@ /************************************************************************** - * + * * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas. * All Rights Reserved. * @@ -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. - * + * **************************************************************************/ /* Authors: Keith Whitwell @@ -116,7 +116,7 @@ struct aos_machine { struct shine_tab shine_tab[MAX_SHINE_TAB]; struct lit_info lit_info[MAX_LIT_INFO]; unsigned now; - + ushort fpu_rnd_nearest; ushort fpu_rnd_neg_inf; @@ -180,7 +180,7 @@ void aos_adopt_xmm_reg( struct aos_compilation *cp, void aos_spill_all( struct aos_compilation *cp ); -struct x86_reg aos_get_shader_reg( struct aos_compilation *cp, +struct x86_reg aos_get_shader_reg( struct aos_compilation *cp, unsigned file, unsigned idx ); @@ -251,5 +251,5 @@ struct draw_vs_varient_aos_sse { #endif -#endif +#endif diff --git a/src/gallium/auxiliary/draw/draw_vs_aos_io.c b/src/gallium/auxiliary/draw/draw_vs_aos_io.c index 8f8bbe7..b78ac04 100644 --- a/src/gallium/auxiliary/draw/draw_vs_aos_io.c +++ b/src/gallium/auxiliary/draw/draw_vs_aos_io.c @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ @@ -43,14 +43,14 @@ * draw_vs_aos.c as there is no intermingling of generated code... * That may have to change, we'll see. */ -static void emit_load_R32G32B32A32( struct aos_compilation *cp, +static void emit_load_R32G32B32A32( struct aos_compilation *cp, struct x86_reg data, struct x86_reg src_ptr ) { sse_movups(cp->func, data, src_ptr); } -static void emit_load_R32G32B32( struct aos_compilation *cp, +static void emit_load_R32G32B32( struct aos_compilation *cp, struct x86_reg data, struct x86_reg src_ptr ) { @@ -75,7 +75,7 @@ static void emit_load_R32G32B32( struct aos_compilation *cp, #endif } -static void emit_load_R32G32( struct aos_compilation *cp, +static void emit_load_R32G32( struct aos_compilation *cp, struct x86_reg data, struct x86_reg src_ptr ) { @@ -84,7 +84,7 @@ static void emit_load_R32G32( struct aos_compilation *cp, } -static void emit_load_R32( struct aos_compilation *cp, +static void emit_load_R32( struct aos_compilation *cp, struct x86_reg data, struct x86_reg src_ptr ) { @@ -107,7 +107,7 @@ static void emit_load_R8G8B8A8_UNORM( struct aos_compilation *cp, /* Extended swizzles? Maybe later. - */ + */ static void emit_swizzle( struct aos_compilation *cp, struct x86_reg dest, struct x86_reg src, @@ -124,13 +124,13 @@ static boolean get_buffer_ptr( struct aos_compilation *cp, struct x86_reg elt, struct x86_reg ptr) { - struct x86_reg buf = x86_make_disp(aos_get_x86( cp, 0, X86_BUFFERS ), + struct x86_reg buf = x86_make_disp(aos_get_x86( cp, 0, X86_BUFFERS ), buf_idx * sizeof(struct aos_buffer)); - struct x86_reg buf_stride = x86_make_disp(buf, + struct x86_reg buf_stride = x86_make_disp(buf, Offset(struct aos_buffer, stride)); if (linear) { - struct x86_reg buf_ptr = x86_make_disp(buf, + struct x86_reg buf_ptr = x86_make_disp(buf, Offset(struct aos_buffer, ptr)); @@ -143,7 +143,7 @@ static boolean get_buffer_ptr( struct aos_compilation *cp, x86_mov(cp->func, buf_ptr, elt); } else { - struct x86_reg buf_base_ptr = x86_make_disp(buf, + struct x86_reg buf_base_ptr = x86_make_disp(buf, Offset(struct aos_buffer, base_ptr)); @@ -221,7 +221,7 @@ static boolean load_inputs( struct aos_compilation *cp, cp->insn_counter++; } } - + return TRUE; } @@ -229,10 +229,10 @@ boolean aos_init_inputs( struct aos_compilation *cp, boolean linear ) { unsigned i; for (i = 0; i < cp->vaos->nr_vb; i++) { - struct x86_reg buf = x86_make_disp(aos_get_x86( cp, 0, X86_BUFFERS ), + struct x86_reg buf = x86_make_disp(aos_get_x86( cp, 0, X86_BUFFERS ), i * sizeof(struct aos_buffer)); - struct x86_reg buf_base_ptr = x86_make_disp(buf, + struct x86_reg buf_base_ptr = x86_make_disp(buf, Offset(struct aos_buffer, base_ptr)); if (cp->vaos->base.key.const_vbuffers & (1<idx_EBX; struct x86_reg ptr = cp->tmp_EAX; - struct x86_reg buf_stride = x86_make_disp(buf, + struct x86_reg buf_stride = x86_make_disp(buf, Offset(struct aos_buffer, stride)); - struct x86_reg buf_ptr = x86_make_disp(buf, + struct x86_reg buf_ptr = x86_make_disp(buf, Offset(struct aos_buffer, ptr)); @@ -271,7 +271,7 @@ boolean aos_init_inputs( struct aos_compilation *cp, boolean linear ) /* In the linear case, keep the buffer pointer instead of the * index number. */ - if (cp->vaos->nr_vb == 1) + if (cp->vaos->nr_vb == 1) x86_mov( cp->func, elt, ptr ); else x86_mov( cp->func, buf_ptr, ptr ); @@ -312,8 +312,8 @@ boolean aos_fetch_inputs( struct aos_compilation *cp, boolean linear ) boolean aos_incr_inputs( struct aos_compilation *cp, boolean linear ) { if (linear && cp->vaos->nr_vb == 1) { - struct x86_reg stride = x86_make_disp(aos_get_x86( cp, 0, X86_BUFFERS ), - (0 * sizeof(struct aos_buffer) + + struct x86_reg stride = x86_make_disp(aos_get_x86( cp, 0, X86_BUFFERS ), + (0 * sizeof(struct aos_buffer) + Offset(struct aos_buffer, stride))); x86_add(cp->func, cp->idx_EBX, stride); @@ -321,7 +321,7 @@ boolean aos_incr_inputs( struct aos_compilation *cp, boolean linear ) } else if (linear) { /* Nothing to do */ - } + } else { x86_lea(cp->func, cp->idx_EBX, x86_make_disp(cp->idx_EBX, 4)); } @@ -334,14 +334,14 @@ boolean aos_incr_inputs( struct aos_compilation *cp, boolean linear ) -static void emit_store_R32G32B32A32( struct aos_compilation *cp, +static void emit_store_R32G32B32A32( struct aos_compilation *cp, struct x86_reg dst_ptr, struct x86_reg dataXMM ) { sse_movups(cp->func, dst_ptr, dataXMM); } -static void emit_store_R32G32B32( struct aos_compilation *cp, +static void emit_store_R32G32B32( struct aos_compilation *cp, struct x86_reg dst_ptr, struct x86_reg dataXMM ) { @@ -350,14 +350,14 @@ static void emit_store_R32G32B32( struct aos_compilation *cp, sse_movss(cp->func, x86_make_disp(dst_ptr,8), dataXMM); } -static void emit_store_R32G32( struct aos_compilation *cp, +static void emit_store_R32G32( struct aos_compilation *cp, struct x86_reg dst_ptr, struct x86_reg dataXMM ) { sse_movlps(cp->func, dst_ptr, dataXMM); } -static void emit_store_R32( struct aos_compilation *cp, +static void emit_store_R32( struct aos_compilation *cp, struct x86_reg dst_ptr, struct x86_reg dataXMM ) { @@ -383,7 +383,7 @@ static void emit_store_R8G8B8A8_UNORM( struct aos_compilation *cp, static boolean emit_output( struct aos_compilation *cp, struct x86_reg ptr, - struct x86_reg dataXMM, + struct x86_reg dataXMM, unsigned format ) { switch (format) { @@ -420,7 +420,7 @@ static boolean emit_output( struct aos_compilation *cp, boolean aos_emit_outputs( struct aos_compilation *cp ) { unsigned i; - + for (i = 0; i < cp->vaos->base.key.nr_outputs; i++) { unsigned format = cp->vaos->base.key.element[i].out.format; unsigned offset = cp->vaos->base.key.element[i].out.offset; @@ -432,7 +432,7 @@ boolean aos_emit_outputs( struct aos_compilation *cp ) data = aos_get_internal_xmm( cp, IMM_PSIZE ); } else { - data = aos_get_shader_reg( cp, + data = aos_get_shader_reg( cp, TGSI_FILE_OUTPUT, vs_output ); } @@ -442,10 +442,10 @@ boolean aos_emit_outputs( struct aos_compilation *cp ) sse_movaps(cp->func, tmp, data); data = tmp; } - - if (!emit_output( cp, + + if (!emit_output( cp, x86_make_disp( cp->outbuf_ECX, offset ), - data, + data, format )) return FALSE; diff --git a/src/gallium/auxiliary/draw/draw_vs_aos_machine.c b/src/gallium/auxiliary/draw/draw_vs_aos_machine.c index 0eda414..0429838 100644 --- a/src/gallium/auxiliary/draw/draw_vs_aos_machine.c +++ b/src/gallium/auxiliary/draw/draw_vs_aos_machine.c @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ @@ -68,9 +68,9 @@ void PIPE_CDECL aos_do_lit( struct aos_machine *machine, const float *in, unsigned count ) { - if (in[0] > 0) + if (in[0] > 0) { - if (in[1] <= 0.0) + if (in[1] <= 0.0) { result[0] = 1.0F; result[1] = in[0]; @@ -79,7 +79,7 @@ void PIPE_CDECL aos_do_lit( struct aos_machine *machine, } else { - const float epsilon = 1.0F / 256.0F; + const float epsilon = 1.0F / 256.0F; float exponent = CLAMP(in[3], -(128.0F - epsilon), (128.0F - epsilon)); result[0] = 1.0F; result[1] = in[0]; @@ -87,7 +87,7 @@ void PIPE_CDECL aos_do_lit( struct aos_machine *machine, result[3] = 1.0; } } - else + else { result[0] = 1.0F; result[1] = 0.0; @@ -102,9 +102,9 @@ static void PIPE_CDECL do_lit_lut( struct aos_machine *machine, const float *in, unsigned count ) { - if (in[0] > 0) + if (in[0] > 0) { - if (in[1] <= 0.0) + if (in[1] <= 0.0) { result[0] = 1.0F; result[1] = in[0]; @@ -112,7 +112,7 @@ static void PIPE_CDECL do_lit_lut( struct aos_machine *machine, result[3] = 1.0F; return; } - + if (machine->lit_info[count].shine_tab->exponent != in[3]) { machine->lit_info[count].func = aos_do_lit; goto no_luck; @@ -124,17 +124,17 @@ static void PIPE_CDECL do_lit_lut( struct aos_machine *machine, float f = in[1] * 256; int k = (int)f; float frac = f - (float)k; - + result[0] = 1.0F; result[1] = in[0]; result[2] = tab[k] + frac*(tab[k+1]-tab[k]); result[3] = 1.0; return; } - + no_luck: { - const float epsilon = 1.0F / 256.0F; + const float epsilon = 1.0F / 256.0F; float exponent = CLAMP(in[3], -(128.0F - epsilon), (128.0F - epsilon)); result[0] = 1.0F; result[1] = in[0]; @@ -142,7 +142,7 @@ static void PIPE_CDECL do_lit_lut( struct aos_machine *machine, result[3] = 1.0; } } - else + else { result[0] = 1.0F; result[1] = 0.0; @@ -155,17 +155,17 @@ static void PIPE_CDECL do_lit_lut( struct aos_machine *machine, static void do_populate_lut( struct shine_tab *tab, float unclamped_exponent ) { - const float epsilon = 1.0F / 256.0F; + const float epsilon = 1.0F / 256.0F; float exponent = CLAMP(unclamped_exponent, -(128.0F - epsilon), (128.0F - epsilon)); unsigned i; tab->exponent = unclamped_exponent; /* for later comparison */ - + tab->values[0] = 0; if (exponent == 0) { for (i = 1; i < 258; i++) { tab->values[i] = 1.0; - } + } } else { for (i = 1; i < 258; i++) { @@ -285,7 +285,7 @@ struct aos_machine *draw_vs_aos_machine( void ) X87_CW_PRECISION_DOUBLE_EXT); assert(machine->fpu_rnd_nearest == 0x37f); - + machine->fpu_rnd_neg_inf = (X87_CW_EXCEPTION_INV_OP | X87_CW_EXCEPTION_DENORM_OP | X87_CW_EXCEPTION_ZERO_DIVIDE | diff --git a/src/gallium/auxiliary/draw/draw_vs_exec.c b/src/gallium/auxiliary/draw/draw_vs_exec.c index dab3eb1..d8e7dc4 100644 --- a/src/gallium/auxiliary/draw/draw_vs_exec.c +++ b/src/gallium/auxiliary/draw/draw_vs_exec.c @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ /* @@ -102,7 +102,7 @@ vs_exec_run_linear( struct draw_vertex_shader *shader, for (i = 0; i < count; i += MAX_TGSI_VERTICES) { unsigned int max_vertices = MIN2(MAX_TGSI_VERTICES, count - i); - /* Swizzle inputs. + /* Swizzle inputs. */ for (j = 0; j < max_vertices; j++) { #if 0 @@ -130,7 +130,7 @@ vs_exec_run_linear( struct draw_vertex_shader *shader, } input = (const float (*)[4])((const char *)input + input_stride); - } + } tgsi_set_exec_mask(machine, 1, @@ -141,7 +141,7 @@ vs_exec_run_linear( struct draw_vertex_shader *shader, /* run interpreter */ tgsi_exec_machine_run( machine ); - /* Unswizzle all output results. + /* Unswizzle all output results. */ for (j = 0; j < max_vertices; j++) { for (slot = 0; slot < shader->info.num_outputs; slot++) { @@ -165,7 +165,7 @@ vs_exec_run_linear( struct draw_vertex_shader *shader, #endif output = (float (*)[4])((char *)output + output_stride); - } + } } } @@ -187,7 +187,7 @@ draw_create_vs_exec(struct draw_context *draw, { struct exec_vertex_shader *vs = CALLOC_STRUCT( exec_vertex_shader ); - if (vs == NULL) + if (vs == NULL) return NULL; /* we make a private copy of the tokens */ diff --git a/src/gallium/auxiliary/draw/draw_vs_llvm.c b/src/gallium/auxiliary/draw/draw_vs_llvm.c index de074be..a08c304 100644 --- a/src/gallium/auxiliary/draw/draw_vs_llvm.c +++ b/src/gallium/auxiliary/draw/draw_vs_llvm.c @@ -98,7 +98,7 @@ draw_create_vs_llvm(struct draw_context *draw, tgsi_scan_shader(state->tokens, &vs->base.info); - vs->variant_key_size = + vs->variant_key_size = draw_llvm_variant_key_size( vs->base.info.file_max[TGSI_FILE_INPUT]+1, vs->base.info.file_max[TGSI_FILE_SAMPLER]+1); diff --git a/src/gallium/auxiliary/draw/draw_vs_ppc.c b/src/gallium/auxiliary/draw/draw_vs_ppc.c index 5df8491..85fabcb 100644 --- a/src/gallium/auxiliary/draw/draw_vs_ppc.c +++ b/src/gallium/auxiliary/draw/draw_vs_ppc.c @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ /* @@ -157,7 +157,7 @@ static void vs_ppc_delete( struct draw_vertex_shader *base ) { struct draw_ppc_vertex_shader *shader = (struct draw_ppc_vertex_shader *)base; - + ppc_release_func( &shader->ppc_program ); align_free( (void *) shader->base.immediates ); @@ -174,7 +174,7 @@ draw_create_vs_ppc(struct draw_context *draw, struct draw_ppc_vertex_shader *vs; vs = CALLOC_STRUCT( draw_ppc_vertex_shader ); - if (vs == NULL) + if (vs == NULL) return NULL; /* we make a private copy of the tokens */ @@ -194,7 +194,7 @@ draw_create_vs_ppc(struct draw_context *draw, vs->base.prepare = vs_ppc_prepare; vs->base.run_linear = vs_ppc_run_linear; vs->base.delete = vs_ppc_delete; - + vs->base.immediates = align_malloc(TGSI_EXEC_NUM_IMMEDIATES * 4 * sizeof(float), 16); @@ -206,16 +206,16 @@ draw_create_vs_ppc(struct draw_context *draw, #endif if (!tgsi_emit_ppc( (struct tgsi_token *) vs->base.state.tokens, - &vs->ppc_program, - (float (*)[4]) vs->base.immediates, - TRUE )) + &vs->ppc_program, + (float (*)[4]) vs->base.immediates, + TRUE )) goto fail; - + vs->func = (codegen_function) ppc_get_func( &vs->ppc_program ); if (!vs->func) { goto fail; } - + return &vs->base; fail: @@ -224,7 +224,7 @@ draw_create_vs_ppc(struct draw_context *draw, */ ppc_release_func( &vs->ppc_program ); - + FREE(vs); return NULL; } diff --git a/src/gallium/auxiliary/draw/draw_vs_sse.c b/src/gallium/auxiliary/draw/draw_vs_sse.c index 0b0c607..fd93d47 100644 --- a/src/gallium/auxiliary/draw/draw_vs_sse.c +++ b/src/gallium/auxiliary/draw/draw_vs_sse.c @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ /* @@ -58,7 +58,7 @@ struct draw_sse_vertex_shader { struct x86_function sse2_program; tgsi_sse2_vs_func func; - + struct tgsi_exec_machine *machine; }; @@ -134,7 +134,7 @@ static void vs_sse_delete( struct draw_vertex_shader *base ) { struct draw_sse_vertex_shader *shader = (struct draw_sse_vertex_shader *)base; - + x86_release_func( &shader->sse2_program ); align_free( (void *) shader->base.immediates ); @@ -154,7 +154,7 @@ draw_create_vs_sse(struct draw_context *draw, return NULL; vs = CALLOC_STRUCT( draw_sse_vertex_shader ); - if (vs == NULL) + if (vs == NULL) return NULL; /* we make a private copy of the tokens */ @@ -172,32 +172,32 @@ draw_create_vs_sse(struct draw_context *draw, vs->base.prepare = vs_sse_prepare; vs->base.run_linear = vs_sse_run_linear; vs->base.delete = vs_sse_delete; - + vs->base.immediates = align_malloc(TGSI_EXEC_NUM_IMMEDIATES * 4 * sizeof(float), 16); vs->machine = draw->vs.machine; - + x86_init_func( &vs->sse2_program ); if (!tgsi_emit_sse2( (struct tgsi_token *) vs->base.state.tokens, - &vs->sse2_program, - (float (*)[4])vs->base.immediates, - TRUE )) + &vs->sse2_program, + (float (*)[4])vs->base.immediates, + TRUE )) goto fail; - + vs->func = (tgsi_sse2_vs_func) x86_get_func( &vs->sse2_program ); if (!vs->func) { goto fail; } - + return &vs->base; fail: debug_error("tgsi_emit_sse2() failed, falling back to interpreter\n"); x86_release_func( &vs->sse2_program ); - + FREE(vs); return NULL; } diff --git a/src/gallium/auxiliary/draw/draw_vs_varient.c b/src/gallium/auxiliary/draw/draw_vs_varient.c index eacd160..00deec5 100644 --- a/src/gallium/auxiliary/draw/draw_vs_varient.c +++ b/src/gallium/auxiliary/draw/draw_vs_varient.c @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ /* @@ -39,18 +39,18 @@ #include "draw/draw_vs.h" #include "translate/translate.h" -/* A first pass at incorporating vertex fetch/emit functionality into +/* A first pass at incorporating vertex fetch/emit functionality into */ struct draw_vs_varient_generic { struct draw_vs_varient base; struct draw_vertex_shader *shader; struct draw_context *draw; - + /* Basic plan is to run these two translate functions before/after * the vertex shader's existing run_linear() routine to simulate - * the inclusion of this functionality into the shader... - * + * the inclusion of this functionality into the shader... + * * Next will look at actually including it. */ struct translate *fetch; @@ -71,9 +71,9 @@ static void vsvg_set_buffer( struct draw_vs_varient *varient, { struct draw_vs_varient_generic *vsvg = (struct draw_vs_varient_generic *)varient; - vsvg->fetch->set_buffer(vsvg->fetch, - buffer, - ptr, + vsvg->fetch->set_buffer(vsvg->fetch, + buffer, + ptr, stride, max_index ); } @@ -124,7 +124,7 @@ static void do_viewport( struct draw_vs_varient_generic *vsvg, data[2] = data[2] * scale[2] + trans[2]; } } - + static void PIPE_CDECL vsvg_run_elts( struct draw_vs_varient *varient, const unsigned *elts, @@ -134,25 +134,25 @@ static void PIPE_CDECL vsvg_run_elts( struct draw_vs_varient *varient, struct draw_vs_varient_generic *vsvg = (struct draw_vs_varient_generic *)varient; unsigned temp_vertex_stride = vsvg->temp_vertex_stride; void *temp_buffer = MALLOC( align(count,4) * temp_vertex_stride ); - + if (0) debug_printf("%s %d \n", __FUNCTION__, count); - + /* Want to do this in small batches for cache locality? */ - - vsvg->fetch->run_elts( vsvg->fetch, + + vsvg->fetch->run_elts( vsvg->fetch, elts, count, vsvg->draw->instance_id, temp_buffer ); - vsvg->base.vs->run_linear( vsvg->base.vs, + vsvg->base.vs->run_linear( vsvg->base.vs, temp_buffer, temp_buffer, vsvg->base.vs->draw->pt.user.vs_constants, vsvg->base.vs->draw->pt.user.vs_constants_size, count, - temp_vertex_stride, + temp_vertex_stride, temp_vertex_stride); /* FIXME: geometry shading? */ @@ -173,12 +173,12 @@ static void PIPE_CDECL vsvg_run_elts( struct draw_vs_varient *varient, vsvg->emit->set_buffer( vsvg->emit, - 0, + 0, temp_buffer, temp_vertex_stride, ~0 ); - vsvg->emit->set_buffer( vsvg->emit, + vsvg->emit->set_buffer( vsvg->emit, 1, &vsvg->draw->rasterizer->point_size, 0, @@ -201,24 +201,24 @@ static void PIPE_CDECL vsvg_run_linear( struct draw_vs_varient *varient, struct draw_vs_varient_generic *vsvg = (struct draw_vs_varient_generic *)varient; unsigned temp_vertex_stride = vsvg->temp_vertex_stride; void *temp_buffer = MALLOC( align(count,4) * temp_vertex_stride ); - + if (0) debug_printf("%s %d %d (sz %d, %d)\n", __FUNCTION__, start, count, vsvg->base.key.output_stride, temp_vertex_stride); - vsvg->fetch->run( vsvg->fetch, + vsvg->fetch->run( vsvg->fetch, start, count, vsvg->draw->instance_id, temp_buffer ); - vsvg->base.vs->run_linear( vsvg->base.vs, + vsvg->base.vs->run_linear( vsvg->base.vs, temp_buffer, temp_buffer, vsvg->base.vs->draw->pt.user.vs_constants, vsvg->base.vs->draw->pt.user.vs_constants_size, count, - temp_vertex_stride, + temp_vertex_stride, temp_vertex_stride); if (vsvg->base.key.clip) { @@ -236,17 +236,17 @@ static void PIPE_CDECL vsvg_run_linear( struct draw_vs_varient *varient, } vsvg->emit->set_buffer( vsvg->emit, - 0, + 0, temp_buffer, temp_vertex_stride, ~0 ); - - vsvg->emit->set_buffer( vsvg->emit, + + vsvg->emit->set_buffer( vsvg->emit, 1, &vsvg->draw->rasterizer->point_size, 0, ~0 ); - + vsvg->emit->run( vsvg->emit, 0, count, vsvg->draw->instance_id, @@ -308,7 +308,7 @@ draw_vs_create_varient_generic( struct draw_vertex_shader *vs, emit.output_stride = key->output_stride; for (i = 0; i < key->nr_outputs; i++) { if (key->element[i].out.format != EMIT_1F_PSIZE) - { + { emit.element[i].type = TRANSLATE_ELEMENT_NORMAL; emit.element[i].input_format = PIPE_FORMAT_R32G32B32A32_FLOAT; emit.element[i].input_buffer = 0; diff --git a/src/gallium/auxiliary/gallivm/f.cpp b/src/gallium/auxiliary/gallivm/f.cpp index 5eb09c0..84d9ff5 100644 --- a/src/gallium/auxiliary/gallivm/f.cpp +++ b/src/gallium/auxiliary/gallivm/f.cpp @@ -18,7 +18,7 @@ * - Download and abuild the NTL library from * http://shoup.net/ntl/download.html * - * - Download boost source code matching to your distro. + * - Download boost source code matching to your distro. * * - Goto libs/math/minimax and replace f.cpp with this file. * @@ -26,7 +26,7 @@ * * g++ -o minimax -I /path/to/ntl/include main.cpp f.cpp /path/to/ntl/src/ntl.a -lboost_math_tr1 * - * - Run as + * - Run as * * ./minimax * @@ -52,7 +52,7 @@ boost::math::ntl::RR f(const boost::math::ntl::RR& x, int variant) { static const boost::math::ntl::RR tiny = boost::math::tools::min_value() * 64; - + switch(variant) { case 0: @@ -69,10 +69,10 @@ boost::math::ntl::RR f(const boost::math::ntl::RR& x, int variant) void show_extra( - const boost::math::tools::polynomial& n, - const boost::math::tools::polynomial& d, - const boost::math::ntl::RR& x_offset, - const boost::math::ntl::RR& y_offset, + const boost::math::tools::polynomial& n, + const boost::math::tools::polynomial& d, + const boost::math::ntl::RR& x_offset, + const boost::math::ntl::RR& y_offset, int variant) { switch(variant) diff --git a/src/gallium/auxiliary/gallivm/lp_bld.h b/src/gallium/auxiliary/gallivm/lp_bld.h index ee05c6b..355da7e 100644 --- a/src/gallium/auxiliary/gallivm/lp_bld.h +++ b/src/gallium/auxiliary/gallivm/lp_bld.h @@ -46,7 +46,7 @@ * for a standalone example. */ -#include +#include /** Ensure HAVE_LLVM is set to avoid #ifdef HAVE_LLVM everywhere */ diff --git a/src/gallium/auxiliary/gallivm/lp_bld_arit.c b/src/gallium/auxiliary/gallivm/lp_bld_arit.c index 02b3bde..0be5b25 100644 --- a/src/gallium/auxiliary/gallivm/lp_bld_arit.c +++ b/src/gallium/auxiliary/gallivm/lp_bld_arit.c @@ -239,7 +239,7 @@ lp_build_add(struct lp_build_context *bld, if(type.width == 16) intrinsic = type.sign ? "llvm.x86.sse2.padds.w" : "llvm.x86.sse2.paddus.w"; } - + if(intrinsic) return lp_build_intrinsic_binary(builder, intrinsic, lp_build_vec_type(bld->gallivm, bld->type), a, b); } @@ -340,7 +340,7 @@ lp_build_sub(struct lp_build_context *bld, if(type.width == 16) intrinsic = type.sign ? "llvm.x86.sse2.psubs.w" : "llvm.x86.sse2.psubus.w"; } - + if(intrinsic) return lp_build_intrinsic_binary(builder, intrinsic, lp_build_vec_type(bld->gallivm, bld->type), a, b); } @@ -369,11 +369,11 @@ lp_build_sub(struct lp_build_context *bld, * - alpha plus one * * makes the following approximation to the division (Sree) - * + * * a*b/255 ~= (a*(b + 1)) >> 256 - * + * * which is the fastest method that satisfies the following OpenGL criteria - * + * * 0*0 = 0 and 255*255 = 255 * * - geometric series @@ -399,9 +399,9 @@ lp_build_sub(struct lp_build_context *bld, * * achieving the exact results * - * @sa Alvy Ray Smith, Image Compositing Fundamentals, Tech Memo 4, Aug 15, 1995, + * @sa Alvy Ray Smith, Image Compositing Fundamentals, Tech Memo 4, Aug 15, 1995, * ftp://ftp.alvyray.com/Acrobat/4_Comp.pdf - * @sa Michael Herf, The "double blend trick", May 2000, + * @sa Michael Herf, The "double blend trick", May 2000, * http://www.stereopsis.com/doubleblend.html */ static LLVMValueRef @@ -418,22 +418,22 @@ lp_build_mul_u8n(struct gallivm_state *gallivm, assert(lp_check_value(i16_type, b)); c8 = lp_build_const_int_vec(gallivm, i16_type, 8); - + #if 0 - + /* a*b/255 ~= (a*(b + 1)) >> 256 */ b = LLVMBuildAdd(builder, b, lp_build_const_int_vec(gallium, i16_type, 1), ""); ab = LLVMBuildMul(builder, a, b, ""); #else - + /* ab/255 ~= (ab + (ab >> 8) + 0x80) >> 8 */ ab = LLVMBuildMul(builder, a, b, ""); ab = LLVMBuildAdd(builder, ab, LLVMBuildLShr(builder, ab, c8, ""), ""); ab = LLVMBuildAdd(builder, ab, lp_build_const_int_vec(gallivm, i16_type, 0x80), ""); #endif - + ab = LLVMBuildLShr(builder, ab, c8, ""); return ab; @@ -480,7 +480,7 @@ lp_build_mul(struct lp_build_context *bld, abh = lp_build_mul_u8n(bld->gallivm, i16_type, ah, bh); ab = lp_build_pack2(bld->gallivm, i16_type, type, abl, abh); - + return ab; } @@ -1715,7 +1715,7 @@ lp_build_sin(struct lp_build_context *bld, * scale by 4/Pi * y = _mm_mul_ps(x, *(v4sf*)_ps_cephes_FOPI); */ - + LLVMValueRef FOPi = lp_build_const_v4sf(gallivm, 1.27323954473516); LLVMValueRef scale_y = LLVMBuildFMul(b, x_abs, FOPi, "scale_y"); @@ -1723,7 +1723,7 @@ lp_build_sin(struct lp_build_context *bld, * store the integer part of y in mm0 * emm2 = _mm_cvttps_epi32(y); */ - + LLVMValueRef emm2_i = LLVMBuildFPToSI(b, scale_y, v4si, "emm2_i"); /* @@ -1749,19 +1749,19 @@ lp_build_sin(struct lp_build_context *bld, */ LLVMValueRef pi32_4 = lp_build_const_v4si(bld->gallivm, 4); LLVMValueRef emm0_and = LLVMBuildAnd(b, emm2_add, pi32_4, "emm0_and"); - + /* * emm2 = _mm_slli_epi32(emm0, 29); - */ + */ LLVMValueRef const_29 = lp_build_const_v4si(bld->gallivm, 29); LLVMValueRef swap_sign_bit = LLVMBuildShl(b, emm0_and, const_29, "swap_sign_bit"); /* - * get the polynom selection mask + * get the polynom selection mask * there is one polynom for 0 <= x <= Pi/4 * and another one for Pi/4gallivm, 4); LLVMValueRef emm0_and = LLVMBuildAnd(b, emm0_not, pi32_4, "emm0_and"); - + /* * emm2 = _mm_slli_epi32(emm0, 29); - */ + */ LLVMValueRef const_29 = lp_build_const_v4si(bld->gallivm, 29); LLVMValueRef sign_bit = LLVMBuildShl(b, emm0_and, const_29, "sign_bit"); /* - * get the polynom selection mask + * get the polynom selection mask * there is one polynom for 0 <= x <= Pi/4 * and another one for Pi/4 1x16ub + /* Special case 4x4f --> 1x16ub */ if (src_type.floating == 1 && src_type.fixed == 0 && @@ -386,7 +386,7 @@ lp_build_conv(struct gallivm_state *gallivm, hi = lp_build_pack2(gallivm, int32_type, int16_type, src_int2, src_int3); dst[i] = lp_build_pack2(gallivm, int16_type, dst_type, lo, hi); } - return; + return; } /* diff --git a/src/gallium/auxiliary/gallivm/lp_bld_flow.c b/src/gallium/auxiliary/gallivm/lp_bld_flow.c index a9c9c7a..c41a1c7 100644 --- a/src/gallium/auxiliary/gallivm/lp_bld_flow.c +++ b/src/gallium/auxiliary/gallivm/lp_bld_flow.c @@ -208,7 +208,7 @@ void lp_build_loop_begin(struct lp_build_loop_state *state, struct gallivm_state *gallivm, LLVMValueRef start) - + { LLVMBuilderRef builder = gallivm->builder; diff --git a/src/gallium/auxiliary/gallivm/lp_bld_format_aos.c b/src/gallium/auxiliary/gallivm/lp_bld_format_aos.c index 8a4261f..178413c 100644 --- a/src/gallium/auxiliary/gallivm/lp_bld_format_aos.c +++ b/src/gallium/auxiliary/gallivm/lp_bld_format_aos.c @@ -333,7 +333,7 @@ lp_build_pack_rgba_aos(struct gallivm_state *gallivm, casted = LLVMBuildFPToSI(builder, scaled, LLVMVectorType(LLVMInt32TypeInContext(gallivm->context), 4), ""); shifted = LLVMBuildShl(builder, casted, LLVMConstVector(shifts, 4), ""); - + /* Bitwise or all components */ for (i = 0; i < 4; ++i) { if (desc->channel[i].type == UTIL_FORMAT_TYPE_UNSIGNED) { diff --git a/src/gallium/auxiliary/gallivm/lp_bld_init.c b/src/gallium/auxiliary/gallivm/lp_bld_init.c index efe8d38..56c3531 100644 --- a/src/gallium/auxiliary/gallivm/lp_bld_init.c +++ b/src/gallium/auxiliary/gallivm/lp_bld_init.c @@ -396,7 +396,7 @@ lp_build_init(void) LLVMLinkInJIT(); util_cpu_detect(); - + gallivm_initialized = TRUE; #if 0 @@ -441,7 +441,7 @@ gallivm_destroy(struct gallivm_state *gallivm) -/* +/* * Hack to allow the linking of release LLVM static libraries on a debug build. * * See also: diff --git a/src/gallium/auxiliary/gallivm/lp_bld_logic.c b/src/gallium/auxiliary/gallivm/lp_bld_logic.c index f7e6fba..8af30b5 100644 --- a/src/gallium/auxiliary/gallivm/lp_bld_logic.c +++ b/src/gallium/auxiliary/gallivm/lp_bld_logic.c @@ -60,7 +60,7 @@ * sext <4 x i1> %C to <4 x i32> * * is valid and supported (e.g., llvm/test/CodeGen/X86/vec_compare.ll), but - * it causes assertion failures in LLVM 2.6. It appears to work correctly on + * it causes assertion failures in LLVM 2.6. It appears to work correctly on * LLVM 2.7. */ diff --git a/src/gallium/auxiliary/gallivm/lp_bld_printf.c b/src/gallium/auxiliary/gallivm/lp_bld_printf.c index 60cc609..57c62fe 100644 --- a/src/gallium/auxiliary/gallivm/lp_bld_printf.c +++ b/src/gallium/auxiliary/gallivm/lp_bld_printf.c @@ -66,7 +66,7 @@ lp_get_printf_arg_count(const char *fmt) return count; } -LLVMValueRef +LLVMValueRef lp_build_const_string_variable(LLVMModuleRef module, LLVMContextRef context, const char *str, int len) @@ -77,7 +77,7 @@ lp_build_const_string_variable(LLVMModuleRef module, LLVMSetInitializer(string, LLVMConstStringInContext(context, str, len + 1, TRUE)); return string; } - + /** * lp_build_printf. diff --git a/src/gallium/auxiliary/gallivm/lp_bld_sample.c b/src/gallium/auxiliary/gallivm/lp_bld_sample.c index 8ad3459..681cf36 100644 --- a/src/gallium/auxiliary/gallivm/lp_bld_sample.c +++ b/src/gallium/auxiliary/gallivm/lp_bld_sample.c @@ -533,7 +533,7 @@ lp_build_lod_selector(struct lp_build_sample_context *bld, * mipmap level index. * Note: this is all scalar code. * \param lod scalar float texture level of detail - * \param level_out returns integer + * \param level_out returns integer */ void lp_build_nearest_mip_level(struct lp_build_sample_context *bld, diff --git a/src/gallium/auxiliary/gallivm/lp_bld_sample_aos.c b/src/gallium/auxiliary/gallivm/lp_bld_sample_aos.c index 991f6fa..e120652 100644 --- a/src/gallium/auxiliary/gallivm/lp_bld_sample_aos.c +++ b/src/gallium/auxiliary/gallivm/lp_bld_sample_aos.c @@ -1062,7 +1062,7 @@ lp_build_sample_aos(struct lp_build_sample_context *bld, lp_build_else(&if_ctx); { /* Use the magnification filter */ - lp_build_sample_mipmap(bld, + lp_build_sample_mipmap(bld, mag_filter, PIPE_TEX_MIPFILTER_NONE, s, t, r, i32t_zero, NULL, NULL, diff --git a/src/gallium/auxiliary/gallivm/lp_bld_sample_soa.c b/src/gallium/auxiliary/gallivm/lp_bld_sample_soa.c index cf46e2b..359ef6a 100644 --- a/src/gallium/auxiliary/gallivm/lp_bld_sample_soa.c +++ b/src/gallium/auxiliary/gallivm/lp_bld_sample_soa.c @@ -173,7 +173,7 @@ lp_build_sample_texel_soa(struct lp_build_sample_context *bld, if (use_border) { /* select texel color or border color depending on use_border */ - LLVMValueRef border_color_ptr = + LLVMValueRef border_color_ptr = bld->dynamic_state->border_color(bld->dynamic_state, bld->gallivm, unit); int chan; @@ -442,7 +442,7 @@ lp_build_sample_wrap_nearest(struct lp_build_sample_context *bld, LLVMBuilderRef builder = bld->gallivm->builder; LLVMValueRef length_minus_one = lp_build_sub(int_coord_bld, length, int_coord_bld->one); LLVMValueRef icoord; - + switch(wrap_mode) { case PIPE_TEX_WRAP_REPEAT: coord = lp_build_mul(coord_bld, coord, length_f); @@ -1136,7 +1136,7 @@ lp_build_sample_nop(struct gallivm_state *gallivm, struct lp_type type, for (chan = 0; chan < 4; chan++) { texel_out[chan] = one; - } + } } diff --git a/src/gallium/auxiliary/gallivm/lp_bld_tgsi_aos.c b/src/gallium/auxiliary/gallivm/lp_bld_tgsi_aos.c index a021efd..9914e6f 100644 --- a/src/gallium/auxiliary/gallivm/lp_bld_tgsi_aos.c +++ b/src/gallium/auxiliary/gallivm/lp_bld_tgsi_aos.c @@ -105,7 +105,7 @@ struct lp_build_tgsi_aos_context /** - * Wrapper around lp_build_swizzle_aos which translates swizzles to another + * Wrapper around lp_build_swizzle_aos which translates swizzles to another * ordering. */ static LLVMValueRef @@ -1026,7 +1026,7 @@ emit_instruction( default: return FALSE; } - + if (info->num_dst) { emit_store(bld, inst, 0, dst0); } diff --git a/src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c b/src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c index 1b5a8a5..d46e4ee 100644 --- a/src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c +++ b/src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c @@ -1,9 +1,9 @@ /************************************************************************** - * + * * Copyright 2009 VMware, Inc. * Copyright 2007-2008 Tungsten Graphics, Inc., Cedar Park, Texas. * 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 @@ -11,11 +11,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. @@ -23,7 +23,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. - * + * **************************************************************************/ /** @@ -984,7 +984,7 @@ emit_store( int i; /* build pixel offset vector: {0, 1, 2, 3, ...} */ - pixel_offsets = uint_bld->undef; + pixel_offsets = uint_bld->undef; for (i = 0; i < bld->base.type.length; i++) { LLVMValueRef ii = lp_build_const_int32(gallivm, i); pixel_offsets = LLVMBuildInsertElement(builder, pixel_offsets, @@ -2301,7 +2301,7 @@ emit_instruction( default: return FALSE; } - + if(info->num_dst) { LLVMValueRef pred[NUM_CHANNELS]; diff --git a/src/gallium/auxiliary/gallivm/lp_bld_type.c b/src/gallium/auxiliary/gallivm/lp_bld_type.c index c5cf6d4..237fb5f 100644 --- a/src/gallium/auxiliary/gallivm/lp_bld_type.c +++ b/src/gallium/auxiliary/gallivm/lp_bld_type.c @@ -73,7 +73,7 @@ lp_build_vec_type(struct gallivm_state *gallivm,struct lp_type type) * type and check for identity. */ boolean -lp_check_elem_type(struct lp_type type, LLVMTypeRef elem_type) +lp_check_elem_type(struct lp_type type, LLVMTypeRef elem_type) { LLVMTypeKind elem_kind; @@ -106,12 +106,12 @@ lp_check_elem_type(struct lp_type type, LLVMTypeRef elem_type) return FALSE; } - return TRUE; + return TRUE; } boolean -lp_check_vec_type(struct lp_type type, LLVMTypeRef vec_type) +lp_check_vec_type(struct lp_type type, LLVMTypeRef vec_type) { LLVMTypeRef elem_type; @@ -135,7 +135,7 @@ lp_check_vec_type(struct lp_type type, LLVMTypeRef vec_type) boolean -lp_check_value(struct lp_type type, LLVMValueRef val) +lp_check_value(struct lp_type type, LLVMValueRef val) { LLVMTypeRef vec_type; diff --git a/src/gallium/auxiliary/indices/u_indices.c b/src/gallium/auxiliary/indices/u_indices.c index 03d7453..f1bb594 100644 --- a/src/gallium/auxiliary/indices/u_indices.c +++ b/src/gallium/auxiliary/indices/u_indices.c @@ -31,14 +31,14 @@ static void translate_memcpy_ushort( const void *in, { memcpy(out, in, nr*sizeof(short)); } - + static void translate_memcpy_uint( const void *in, unsigned nr, void *out ) { memcpy(out, in, nr*sizeof(int)); } - + int u_index_translator( unsigned hw_mask, unsigned prim, @@ -61,9 +61,9 @@ int u_index_translator( unsigned hw_mask, *out_index_size = (in_index_size == 4) ? 4 : 2; out_idx = out_size_idx(*out_index_size); - if ((hw_mask & (1< 0xfffe) ? 4 : 2; out_idx = out_size_idx(*out_index_size); - if ((hw_mask & (1< -#include -#include -#include +#include +#include +#include +#include #elif defined(PIPE_SUBSYSTEM_WINDOWS_USER) @@ -60,7 +60,7 @@ #ifdef PIPE_SUBSYSTEM_WINDOWS_DISPLAY -static INLINE void +static INLINE void _EngDebugPrint(const char *format, ...) { va_list ap; @@ -85,16 +85,16 @@ os_log_message(const char *message) } #elif defined(PIPE_SUBSYSTEM_WINDOWS_CE) wchar_t *wide_format; - long wide_str_len; - /* Format is ascii - needs to be converted to wchar_t for printing */ + long wide_str_len; + /* Format is ascii - needs to be converted to wchar_t for printing */ wide_str_len = MultiByteToWideChar(CP_ACP, 0, message, -1, NULL, 0); - wide_format = (wchar_t *) malloc((wide_str_len+1) * sizeof(wchar_t)); - if (wide_format) { + wide_format = (wchar_t *) malloc((wide_str_len+1) * sizeof(wchar_t)); + if (wide_format) { MultiByteToWideChar(CP_ACP, 0, message, -1, - wide_format, wide_str_len); - NKDbgPrintfW(wide_format, wide_format); - free(wide_format); - } + wide_format, wide_str_len); + NKDbgPrintfW(wide_format, wide_format); + free(wide_format); + } #elif defined(PIPE_SUBSYSTEM_WINDOWS_MINIPORT) /* TODO */ #else /* !PIPE_SUBSYSTEM_WINDOWS */ @@ -153,7 +153,7 @@ os_get_option(const char *name) const void *pMap = NULL; const char *sol, *eol, *sep; static char output[1024]; - + pMap = EngMapFile(L"\\??\\c:\\gallium.cfg", 0, &iFile); if(pMap) { sol = (const char *)pMap; @@ -178,7 +178,7 @@ os_get_option(const char *name) #else return NULL; #endif -#elif defined(PIPE_SUBSYSTEM_WINDOWS_CE) || defined(PIPE_SUBSYSTEM_WINDOWS_MINIPORT) +#elif defined(PIPE_SUBSYSTEM_WINDOWS_CE) || defined(PIPE_SUBSYSTEM_WINDOWS_MINIPORT) /* TODO: implement */ return NULL; #else diff --git a/src/gallium/auxiliary/os/os_thread.h b/src/gallium/auxiliary/os/os_thread.h index a084310..0c1b6df 100644 --- a/src/gallium/auxiliary/os/os_thread.h +++ b/src/gallium/auxiliary/os/os_thread.h @@ -1,9 +1,9 @@ /************************************************************************** - * + * * Copyright 1999-2006 Brian Paul * Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas. * All Rights Reserved. - * + * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation @@ -20,13 +20,13 @@ * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * + * **************************************************************************/ /** * @file - * + * * Thread, mutex, condition variable, barrier, semaphore and * thread-specific data functions. */ diff --git a/src/gallium/auxiliary/os/os_time.c b/src/gallium/auxiliary/os/os_time.c index 2e1527b..dc607b8 100644 --- a/src/gallium/auxiliary/os/os_time.c +++ b/src/gallium/auxiliary/os/os_time.c @@ -28,7 +28,7 @@ /** * @file * OS independent time-manipulation functions. - * + * * @author Jose Fonseca */ @@ -100,17 +100,17 @@ os_time_sleep(int64_t usecs) { static LONGLONG frequency; LONGLONG start, curr, end; - + EngQueryPerformanceCounter(&start); - + if(!frequency) EngQueryPerformanceFrequency(&frequency); - + end = start + (usecs * frequency + 999999LL)/1000000LL; - + do { EngQueryPerformanceCounter(&curr); - } while(start <= curr && curr < end || + } while(start <= curr && curr < end || end < start && (curr < end || start <= curr)); } diff --git a/src/gallium/auxiliary/os/os_time.h b/src/gallium/auxiliary/os/os_time.h index 4836ccb..54f5078 100644 --- a/src/gallium/auxiliary/os/os_time.h +++ b/src/gallium/auxiliary/os/os_time.h @@ -28,7 +28,7 @@ /** * @file * OS independent time-manipulation functions. - * + * * @author Jose Fonseca */ diff --git a/src/gallium/auxiliary/pipebuffer/pb_buffer.h b/src/gallium/auxiliary/pipebuffer/pb_buffer.h index 5a13f39..8946fe8 100644 --- a/src/gallium/auxiliary/pipebuffer/pb_buffer.h +++ b/src/gallium/auxiliary/pipebuffer/pb_buffer.h @@ -28,15 +28,15 @@ /** * \file * Generic code for buffers. - * - * Behind a pipe buffle handle there can be DMA buffers, client (or user) - * buffers, regular malloced buffers, etc. This file provides an abstract base - * buffer handle that allows the driver to cope with all those kinds of buffers + * + * Behind a pipe buffle handle there can be DMA buffers, client (or user) + * buffers, regular malloced buffers, etc. This file provides an abstract base + * buffer handle that allows the driver to cope with all those kinds of buffers * in a more flexible way. - * + * * There is no obligation of a winsys driver to use this library. And a pipe * driver should be completly agnostic about it. - * + * * \author Jose Fonseca */ @@ -76,7 +76,7 @@ struct pipe_fence_handle; /** * Buffer description. - * + * * Used when allocating the buffer. */ struct pb_desc @@ -95,7 +95,7 @@ typedef unsigned pb_size; /** * Base class for all pb_* buffers. */ -struct pb_buffer +struct pb_buffer { /* This used to be a pipe_buffer struct: */ @@ -109,8 +109,8 @@ struct pb_buffer /** * Pointer to the virtual function table. * - * Avoid accessing this table directly. Use the inline functions below - * instead to avoid mistakes. + * Avoid accessing this table directly. Use the inline functions below + * instead to avoid mistakes. */ const struct pb_vtbl *vtbl; }; @@ -118,44 +118,44 @@ struct pb_buffer /** * Virtual function table for the buffer storage operations. - * + * * Note that creation is not done through this table. */ struct pb_vtbl { void (*destroy)( struct pb_buffer *buf ); - /** + /** * Map the entire data store of a buffer object into the client's address. - * flags is bitmask of PB_USAGE_CPU_READ/WRITE. + * flags is bitmask of PB_USAGE_CPU_READ/WRITE. */ - void *(*map)( struct pb_buffer *buf, + void *(*map)( struct pb_buffer *buf, unsigned flags, void *flush_ctx ); - + void (*unmap)( struct pb_buffer *buf ); - enum pipe_error (*validate)( struct pb_buffer *buf, + enum pipe_error (*validate)( struct pb_buffer *buf, struct pb_validate *vl, unsigned flags ); - void (*fence)( struct pb_buffer *buf, + void (*fence)( struct pb_buffer *buf, struct pipe_fence_handle *fence ); /** * Get the base buffer and the offset. - * + * * A buffer can be subdivided in smaller buffers. This method should return * the underlaying buffer, and the relative offset. - * - * Buffers without an underlaying base buffer should return themselves, with + * + * Buffers without an underlaying base buffer should return themselves, with * a zero offset. - * + * * Note that this will increase the reference count of the base buffer. */ void (*get_base_buffer)( struct pb_buffer *buf, struct pb_buffer **base_buf, pb_size *offset ); - + }; @@ -163,7 +163,7 @@ struct pb_vtbl /* Accessor functions for pb->vtbl: */ static INLINE void * -pb_map(struct pb_buffer *buf, +pb_map(struct pb_buffer *buf, unsigned flags, void *flush_ctx) { assert(buf); @@ -174,7 +174,7 @@ pb_map(struct pb_buffer *buf, } -static INLINE void +static INLINE void pb_unmap(struct pb_buffer *buf) { assert(buf); @@ -204,7 +204,7 @@ pb_get_base_buffer( struct pb_buffer *buf, } -static INLINE enum pipe_error +static INLINE enum pipe_error pb_validate(struct pb_buffer *buf, struct pb_validate *vl, unsigned flags) { assert(buf); @@ -215,7 +215,7 @@ pb_validate(struct pb_buffer *buf, struct pb_validate *vl, unsigned flags) } -static INLINE void +static INLINE void pb_fence(struct pb_buffer *buf, struct pipe_fence_handle *fence) { assert(buf); @@ -226,7 +226,7 @@ pb_fence(struct pb_buffer *buf, struct pipe_fence_handle *fence) } -static INLINE void +static INLINE void pb_destroy(struct pb_buffer *buf) { assert(buf); @@ -277,11 +277,11 @@ pb_check_usage(unsigned requested, unsigned provided) /** - * Malloc-based buffer to store data that can't be used by the graphics + * Malloc-based buffer to store data that can't be used by the graphics * hardware. */ struct pb_buffer * -pb_malloc_buffer_create(pb_size size, +pb_malloc_buffer_create(pb_size size, const struct pb_desc *desc); diff --git a/src/gallium/auxiliary/pipebuffer/pb_buffer_fenced.c b/src/gallium/auxiliary/pipebuffer/pb_buffer_fenced.c index c310f28..e58fcd1 100644 --- a/src/gallium/auxiliary/pipebuffer/pb_buffer_fenced.c +++ b/src/gallium/auxiliary/pipebuffer/pb_buffer_fenced.c @@ -692,7 +692,7 @@ fenced_buffer_map(struct pb_buffer *buf, ((fenced_buf->flags & PB_USAGE_GPU_READ) && (flags & PB_USAGE_CPU_WRITE))) { - /* + /* * Don't wait for the GPU to finish accessing it, if blocking is forbidden. */ if((flags & PB_USAGE_DONTBLOCK) && diff --git a/src/gallium/auxiliary/pipebuffer/pb_buffer_fenced.h b/src/gallium/auxiliary/pipebuffer/pb_buffer_fenced.h index 004c2b9..de335e1 100644 --- a/src/gallium/auxiliary/pipebuffer/pb_buffer_fenced.h +++ b/src/gallium/auxiliary/pipebuffer/pb_buffer_fenced.h @@ -28,22 +28,22 @@ /** * \file * Buffer fencing. - * - * "Fenced buffers" is actually a misnomer. They should be referred as + * + * "Fenced buffers" is actually a misnomer. They should be referred as * "fenceable buffers", i.e, buffers that can be fenced, but I couldn't find * the word "fenceable" in the dictionary. - * - * A "fenced buffer" is a decorator around a normal buffer, which adds two + * + * A "fenced buffer" is a decorator around a normal buffer, which adds two * special properties: * - the ability for the destruction to be delayed by a fence; * - reference counting. - * - * Usually DMA buffers have a life-time that will extend the life-time of its - * handle. The end-of-life is dictated by the fence signalling. - * - * Between the handle's destruction, and the fence signalling, the buffer is + * + * Usually DMA buffers have a life-time that will extend the life-time of its + * handle. The end-of-life is dictated by the fence signalling. + * + * Between the handle's destruction, and the fence signalling, the buffer is * stored in a fenced buffer list. - * + * * \author Jose Fonseca */ diff --git a/src/gallium/auxiliary/pipebuffer/pb_buffer_malloc.c b/src/gallium/auxiliary/pipebuffer/pb_buffer_malloc.c index c2322ee..5dcd1d2 100644 --- a/src/gallium/auxiliary/pipebuffer/pb_buffer_malloc.c +++ b/src/gallium/auxiliary/pipebuffer/pb_buffer_malloc.c @@ -28,8 +28,8 @@ /** * \file * Implementation of malloc-based buffers to store data that can't be processed - * by the hardware. - * + * by the hardware. + * * \author Jose Fonseca */ @@ -40,7 +40,7 @@ #include "pb_bufmgr.h" -struct malloc_buffer +struct malloc_buffer { struct pb_buffer base; void *data; @@ -69,7 +69,7 @@ malloc_buffer_destroy(struct pb_buffer *buf) static void * -malloc_buffer_map(struct pb_buffer *buf, +malloc_buffer_map(struct pb_buffer *buf, unsigned flags, void *flush_ctx) { @@ -84,8 +84,8 @@ malloc_buffer_unmap(struct pb_buffer *buf) } -static enum pipe_error -malloc_buffer_validate(struct pb_buffer *buf, +static enum pipe_error +malloc_buffer_validate(struct pb_buffer *buf, struct pb_validate *vl, unsigned flags) { @@ -95,7 +95,7 @@ malloc_buffer_validate(struct pb_buffer *buf, static void -malloc_buffer_fence(struct pb_buffer *buf, +malloc_buffer_fence(struct pb_buffer *buf, struct pipe_fence_handle *fence) { assert(0); @@ -112,7 +112,7 @@ malloc_buffer_get_base_buffer(struct pb_buffer *buf, } -const struct pb_vtbl +const struct pb_vtbl malloc_buffer_vtbl = { malloc_buffer_destroy, malloc_buffer_map, @@ -125,12 +125,12 @@ malloc_buffer_vtbl = { struct pb_buffer * pb_malloc_buffer_create(pb_size size, - const struct pb_desc *desc) + const struct pb_desc *desc) { struct malloc_buffer *buf; - + /* TODO: do a single allocation */ - + buf = CALLOC_STRUCT(malloc_buffer); if(!buf) return NULL; @@ -152,29 +152,29 @@ pb_malloc_buffer_create(pb_size size, static struct pb_buffer * -pb_malloc_bufmgr_create_buffer(struct pb_manager *mgr, +pb_malloc_bufmgr_create_buffer(struct pb_manager *mgr, pb_size size, - const struct pb_desc *desc) + const struct pb_desc *desc) { return pb_malloc_buffer_create(size, desc); } static void -pb_malloc_bufmgr_flush(struct pb_manager *mgr) +pb_malloc_bufmgr_flush(struct pb_manager *mgr) { /* No-op */ } static void -pb_malloc_bufmgr_destroy(struct pb_manager *mgr) +pb_malloc_bufmgr_destroy(struct pb_manager *mgr) { /* No-op */ } -static struct pb_manager +static struct pb_manager pb_malloc_bufmgr = { pb_malloc_bufmgr_destroy, pb_malloc_bufmgr_create_buffer, @@ -183,7 +183,7 @@ pb_malloc_bufmgr = { struct pb_manager * -pb_malloc_bufmgr_create(void) +pb_malloc_bufmgr_create(void) { return &pb_malloc_bufmgr; } diff --git a/src/gallium/auxiliary/pipebuffer/pb_bufmgr.h b/src/gallium/auxiliary/pipebuffer/pb_bufmgr.h index 2ef0216..86c97fa 100644 --- a/src/gallium/auxiliary/pipebuffer/pb_bufmgr.h +++ b/src/gallium/auxiliary/pipebuffer/pb_bufmgr.h @@ -28,21 +28,21 @@ /** * \file * Buffer management. - * + * * A buffer manager does only one basic thing: it creates buffers. Actually, * "buffer factory" would probably a more accurate description. - * + * * You can chain buffer managers so that you can have a finer grained memory * management and pooling. - * + * * For example, for a simple batch buffer manager you would chain: * - the native buffer manager, which provides DMA memory from the graphics * memory space; * - the pool buffer manager, which keep around a pool of equally sized buffers - * to avoid latency associated with the native buffer manager; - * - the fenced buffer manager, which will delay buffer destruction until the - * the moment the card finishing processing it. - * + * to avoid latency associated with the native buffer manager; + * - the fenced buffer manager, which will delay buffer destruction until the + * the moment the card finishing processing it. + * * \author Jose Fonseca */ @@ -61,7 +61,7 @@ extern "C" { struct pb_desc; -/** +/** * Abstract base class for all buffer managers. */ struct pb_manager @@ -70,14 +70,14 @@ struct pb_manager (*destroy)( struct pb_manager *mgr ); struct pb_buffer * - (*create_buffer)( struct pb_manager *mgr, + (*create_buffer)( struct pb_manager *mgr, pb_size size, const struct pb_desc *desc); /** * Flush all temporary-held buffers. - * - * Used mostly to aid debugging memory issues or to clean up resources when + * + * Used mostly to aid debugging memory issues or to clean up resources when * the drivers are long lived. */ void @@ -87,45 +87,45 @@ struct pb_manager /** * Malloc buffer provider. - * + * * Simple wrapper around pb_malloc_buffer_create for convenience. */ struct pb_manager * pb_malloc_bufmgr_create(void); -/** +/** * Static buffer pool sub-allocator. - * + * * Manages the allocation of equally sized buffers. It does so by allocating - * a single big buffer and divide it equally sized buffers. - * + * a single big buffer and divide it equally sized buffers. + * * It is meant to manage the allocation of batch buffer pools. */ struct pb_manager * -pool_bufmgr_create(struct pb_manager *provider, +pool_bufmgr_create(struct pb_manager *provider, pb_size n, pb_size size, const struct pb_desc *desc); -/** +/** * Static sub-allocator based the old memory manager. - * + * * It managers buffers of different sizes. It does so by allocating a buffer * with the size of the heap, and then using the old mm memory manager to manage - * that heap. + * that heap. */ struct pb_manager * -mm_bufmgr_create(struct pb_manager *provider, +mm_bufmgr_create(struct pb_manager *provider, pb_size size, pb_size align2); /** * Same as mm_bufmgr_create. - * + * * Buffer will be release when the manager is destroyed. */ struct pb_manager * -mm_bufmgr_create_from_buffer(struct pb_buffer *buffer, +mm_bufmgr_create_from_buffer(struct pb_buffer *buffer, pb_size size, pb_size align2); @@ -139,7 +139,7 @@ pb_slab_manager_create(struct pb_manager *provider, const struct pb_desc *desc); /** - * Allow a range of buffer size, by aggregating multiple slabs sub-allocators + * Allow a range of buffer size, by aggregating multiple slabs sub-allocators * with different bucket sizes. */ struct pb_manager * @@ -150,24 +150,24 @@ pb_slab_range_manager_create(struct pb_manager *provider, const struct pb_desc *desc); -/** +/** * Time-based buffer cache. * - * This manager keeps a cache of destroyed buffers during a time interval. + * This manager keeps a cache of destroyed buffers during a time interval. */ struct pb_manager * -pb_cache_manager_create(struct pb_manager *provider, - unsigned usecs); +pb_cache_manager_create(struct pb_manager *provider, + unsigned usecs); struct pb_fence_ops; -/** +/** * Fenced buffer manager. * * This manager is just meant for convenience. It wraps the buffers returned - * by another manager in fenced buffers, so that - * + * by another manager in fenced buffers, so that + * * NOTE: the buffer manager that provides the buffers will be destroyed * at the same time. */ @@ -179,32 +179,32 @@ fenced_bufmgr_create(struct pb_manager *provider, struct pb_manager * -pb_alt_manager_create(struct pb_manager *provider1, +pb_alt_manager_create(struct pb_manager *provider1, struct pb_manager *provider2); -/** +/** * Ondemand buffer manager. - * + * * Buffers are created in malloc'ed memory (fast and cached), and the constents - * is transfered to a buffer from the provider (typically in slow uncached + * is transfered to a buffer from the provider (typically in slow uncached * memory) when there is an attempt to validate the buffer. - * + * * Ideal for situations where one does not know before hand whether a given - * buffer will effectively be used by the hardware or not. + * buffer will effectively be used by the hardware or not. */ struct pb_manager * -pb_ondemand_manager_create(struct pb_manager *provider); +pb_ondemand_manager_create(struct pb_manager *provider); -/** +/** * Debug buffer manager to detect buffer under- and overflows. * * Under/overflow sizes should be a multiple of the largest alignment */ struct pb_manager * pb_debug_manager_create(struct pb_manager *provider, - pb_size underflow_size, pb_size overflow_size); + pb_size underflow_size, pb_size overflow_size); #ifdef __cplusplus diff --git a/src/gallium/auxiliary/pipebuffer/pb_bufmgr_alt.c b/src/gallium/auxiliary/pipebuffer/pb_bufmgr_alt.c index f60c836..94bed12 100644 --- a/src/gallium/auxiliary/pipebuffer/pb_bufmgr_alt.c +++ b/src/gallium/auxiliary/pipebuffer/pb_bufmgr_alt.c @@ -28,7 +28,7 @@ /** * \file * Allocate buffers from two alternative buffer providers. - * + * * \author Jose Fonseca */ @@ -59,17 +59,17 @@ pb_alt_manager(struct pb_manager *mgr) static struct pb_buffer * -pb_alt_manager_create_buffer(struct pb_manager *_mgr, +pb_alt_manager_create_buffer(struct pb_manager *_mgr, pb_size size, const struct pb_desc *desc) { struct pb_alt_manager *mgr = pb_alt_manager(_mgr); struct pb_buffer *buf; - + buf = mgr->provider1->create_buffer(mgr->provider1, size, desc); if(buf) return buf; - + buf = mgr->provider2->create_buffer(mgr->provider2, size, desc); return buf; } @@ -79,11 +79,11 @@ static void pb_alt_manager_flush(struct pb_manager *_mgr) { struct pb_alt_manager *mgr = pb_alt_manager(_mgr); - + assert(mgr->provider1->flush); if(mgr->provider1->flush) mgr->provider1->flush(mgr->provider1); - + assert(mgr->provider2->flush); if(mgr->provider2->flush) mgr->provider2->flush(mgr->provider2); @@ -98,14 +98,14 @@ pb_alt_manager_destroy(struct pb_manager *mgr) struct pb_manager * -pb_alt_manager_create(struct pb_manager *provider1, +pb_alt_manager_create(struct pb_manager *provider1, struct pb_manager *provider2) { struct pb_alt_manager *mgr; if(!provider1 || !provider2) return NULL; - + mgr = CALLOC_STRUCT(pb_alt_manager); if (!mgr) return NULL; @@ -115,6 +115,6 @@ pb_alt_manager_create(struct pb_manager *provider1, mgr->base.flush = pb_alt_manager_flush; mgr->provider1 = provider1; mgr->provider2 = provider2; - + return &mgr->base; } diff --git a/src/gallium/auxiliary/pipebuffer/pb_bufmgr_cache.c b/src/gallium/auxiliary/pipebuffer/pb_bufmgr_cache.c index a6eb403..9cb0182 100644 --- a/src/gallium/auxiliary/pipebuffer/pb_bufmgr_cache.c +++ b/src/gallium/auxiliary/pipebuffer/pb_bufmgr_cache.c @@ -28,7 +28,7 @@ /** * \file * Buffer cache. - * + * * \author Jose Fonseca * \author Thomas Hellström */ @@ -60,7 +60,7 @@ struct pb_cache_manager; struct pb_cache_buffer { struct pb_buffer base; - + struct pb_buffer *buffer; struct pb_cache_manager *mgr; @@ -77,9 +77,9 @@ struct pb_cache_manager struct pb_manager *provider; unsigned usecs; - + pipe_mutex mutex; - + struct list_head delayed; pb_size numDelayed; }; @@ -119,7 +119,7 @@ _pb_cache_buffer_destroy(struct pb_cache_buffer *buf) /** - * Free as many cache buffers from the list head as possible. + * Free as many cache buffers from the list head as possible. */ static void _pb_cache_buffer_list_check_free(struct pb_cache_manager *mgr) @@ -127,9 +127,9 @@ _pb_cache_buffer_list_check_free(struct pb_cache_manager *mgr) struct list_head *curr, *next; struct pb_cache_buffer *buf; int64_t now; - + now = os_time_get(); - + curr = mgr->delayed.next; next = curr->next; while(curr != &mgr->delayed) { @@ -137,10 +137,10 @@ _pb_cache_buffer_list_check_free(struct pb_cache_manager *mgr) if(!os_time_timeout(buf->start, buf->end, now)) break; - + _pb_cache_buffer_destroy(buf); - curr = next; + curr = next; next = curr->next; } } @@ -149,14 +149,14 @@ _pb_cache_buffer_list_check_free(struct pb_cache_manager *mgr) static void pb_cache_buffer_destroy(struct pb_buffer *_buf) { - struct pb_cache_buffer *buf = pb_cache_buffer(_buf); + struct pb_cache_buffer *buf = pb_cache_buffer(_buf); struct pb_cache_manager *mgr = buf->mgr; pipe_mutex_lock(mgr->mutex); assert(!pipe_is_referenced(&buf->base.base.reference)); - + _pb_cache_buffer_list_check_free(mgr); - + buf->start = os_time_get(); buf->end = buf->start + mgr->usecs; LIST_ADDTAIL(&buf->head, &mgr->delayed); @@ -166,10 +166,10 @@ pb_cache_buffer_destroy(struct pb_buffer *_buf) static void * -pb_cache_buffer_map(struct pb_buffer *_buf, +pb_cache_buffer_map(struct pb_buffer *_buf, unsigned flags, void *flush_ctx) { - struct pb_cache_buffer *buf = pb_cache_buffer(_buf); + struct pb_cache_buffer *buf = pb_cache_buffer(_buf); return pb_map(buf->buffer, flags, flush_ctx); } @@ -177,13 +177,13 @@ pb_cache_buffer_map(struct pb_buffer *_buf, static void pb_cache_buffer_unmap(struct pb_buffer *_buf) { - struct pb_cache_buffer *buf = pb_cache_buffer(_buf); + struct pb_cache_buffer *buf = pb_cache_buffer(_buf); pb_unmap(buf->buffer); } -static enum pipe_error -pb_cache_buffer_validate(struct pb_buffer *_buf, +static enum pipe_error +pb_cache_buffer_validate(struct pb_buffer *_buf, struct pb_validate *vl, unsigned flags) { @@ -193,7 +193,7 @@ pb_cache_buffer_validate(struct pb_buffer *_buf, static void -pb_cache_buffer_fence(struct pb_buffer *_buf, +pb_cache_buffer_fence(struct pb_buffer *_buf, struct pipe_fence_handle *fence) { struct pb_cache_buffer *buf = pb_cache_buffer(_buf); @@ -211,7 +211,7 @@ pb_cache_buffer_get_base_buffer(struct pb_buffer *_buf, } -const struct pb_vtbl +const struct pb_vtbl pb_cache_buffer_vtbl = { pb_cache_buffer_destroy, pb_cache_buffer_map, @@ -223,7 +223,7 @@ pb_cache_buffer_vtbl = { static INLINE int -pb_cache_is_buffer_compat(struct pb_cache_buffer *buf, +pb_cache_is_buffer_compat(struct pb_cache_buffer *buf, pb_size size, const struct pb_desc *desc) { @@ -235,10 +235,10 @@ pb_cache_is_buffer_compat(struct pb_cache_buffer *buf, /* be lenient with size */ if(buf->base.base.size >= 2*size) return 0; - + if(!pb_check_alignment(desc->alignment, buf->base.base.alignment)) return 0; - + if(!pb_check_usage(desc->usage, buf->base.base.usage)) return 0; @@ -248,13 +248,13 @@ pb_cache_is_buffer_compat(struct pb_cache_buffer *buf, } pb_unmap(buf->buffer); - + return 1; } static struct pb_buffer * -pb_cache_manager_create_buffer(struct pb_manager *_mgr, +pb_cache_manager_create_buffer(struct pb_manager *_mgr, pb_size size, const struct pb_desc *desc) { @@ -270,7 +270,7 @@ pb_cache_manager_create_buffer(struct pb_manager *_mgr, buf = NULL; curr = mgr->delayed.next; next = curr->next; - + /* search in the expired buffers, freeing them in the process */ now = os_time_get(); while(curr != &mgr->delayed) { @@ -284,7 +284,7 @@ pb_cache_manager_create_buffer(struct pb_manager *_mgr, break; if (ret == -1) break; - curr = next; + curr = next; next = curr->next; } @@ -304,7 +304,7 @@ pb_cache_manager_create_buffer(struct pb_manager *_mgr, next = curr->next; } } - + if(buf) { LIST_DEL(&buf->head); --mgr->numDelayed; @@ -313,32 +313,32 @@ pb_cache_manager_create_buffer(struct pb_manager *_mgr, pipe_reference_init(&buf->base.base.reference, 1); return &buf->base; } - + pipe_mutex_unlock(mgr->mutex); buf = CALLOC_STRUCT(pb_cache_buffer); if(!buf) return NULL; - + buf->buffer = mgr->provider->create_buffer(mgr->provider, size, desc); if(!buf->buffer) { FREE(buf); return NULL; } - + assert(pipe_is_referenced(&buf->buffer->base.reference)); assert(pb_check_alignment(desc->alignment, buf->buffer->base.alignment)); assert(pb_check_usage(desc->usage, buf->buffer->base.usage)); assert(buf->buffer->base.size >= size); - + pipe_reference_init(&buf->base.base.reference, 1); buf->base.base.alignment = buf->buffer->base.alignment; buf->base.base.usage = buf->buffer->base.usage; buf->base.base.size = buf->buffer->base.size; - + buf->base.vtbl = &pb_cache_buffer_vtbl; buf->mgr = mgr; - + return &buf->base; } @@ -356,11 +356,11 @@ pb_cache_manager_flush(struct pb_manager *_mgr) while(curr != &mgr->delayed) { buf = LIST_ENTRY(struct pb_cache_buffer, curr, head); _pb_cache_buffer_destroy(buf); - curr = next; + curr = next; next = curr->next; } pipe_mutex_unlock(mgr->mutex); - + assert(mgr->provider->flush); if(mgr->provider->flush) mgr->provider->flush(mgr->provider); @@ -376,14 +376,14 @@ pb_cache_manager_destroy(struct pb_manager *mgr) struct pb_manager * -pb_cache_manager_create(struct pb_manager *provider, - unsigned usecs) +pb_cache_manager_create(struct pb_manager *provider, + unsigned usecs) { struct pb_cache_manager *mgr; if(!provider) return NULL; - + mgr = CALLOC_STRUCT(pb_cache_manager); if (!mgr) return NULL; @@ -396,6 +396,6 @@ pb_cache_manager_create(struct pb_manager *provider, LIST_INITHEAD(&mgr->delayed); mgr->numDelayed = 0; pipe_mutex_init(mgr->mutex); - + return &mgr->base; } diff --git a/src/gallium/auxiliary/pipebuffer/pb_bufmgr_debug.c b/src/gallium/auxiliary/pipebuffer/pb_bufmgr_debug.c index 7604e75..78d1cdc 100644 --- a/src/gallium/auxiliary/pipebuffer/pb_bufmgr_debug.c +++ b/src/gallium/auxiliary/pipebuffer/pb_bufmgr_debug.c @@ -28,7 +28,7 @@ /** * \file * Debug buffer manager to detect buffer under- and overflows. - * + * * \author Jose Fonseca */ @@ -68,10 +68,10 @@ struct pb_debug_manager; struct pb_debug_buffer { struct pb_buffer base; - + struct pb_buffer *buffer; struct pb_debug_manager *mgr; - + pb_size underflow_size; pb_size overflow_size; @@ -80,7 +80,7 @@ struct pb_debug_buffer pipe_mutex mutex; unsigned map_count; struct debug_stack_frame map_backtrace[PB_DEBUG_MAP_BACKTRACE]; - + struct list_head head; }; @@ -93,7 +93,7 @@ struct pb_debug_manager pb_size underflow_size; pb_size overflow_size; - + pipe_mutex mutex; struct list_head list; }; @@ -116,14 +116,14 @@ pb_debug_manager(struct pb_manager *mgr) static const uint8_t random_pattern[32] = { - 0xaf, 0xcf, 0xa5, 0xa2, 0xc2, 0x63, 0x15, 0x1a, + 0xaf, 0xcf, 0xa5, 0xa2, 0xc2, 0x63, 0x15, 0x1a, 0x7e, 0xe2, 0x7e, 0x84, 0x15, 0x49, 0xa2, 0x1e, - 0x49, 0x63, 0xf5, 0x52, 0x74, 0x66, 0x9e, 0xc4, + 0x49, 0x63, 0xf5, 0x52, 0x74, 0x66, 0x9e, 0xc4, 0x6d, 0xcf, 0x2c, 0x4a, 0x74, 0xe6, 0xfd, 0x94 }; -static INLINE void +static INLINE void fill_random_pattern(uint8_t *dst, pb_size size) { pb_size i = 0; @@ -134,9 +134,9 @@ fill_random_pattern(uint8_t *dst, pb_size size) } -static INLINE boolean -check_random_pattern(const uint8_t *dst, pb_size size, - pb_size *min_ofs, pb_size *max_ofs) +static INLINE boolean +check_random_pattern(const uint8_t *dst, pb_size size, + pb_size *min_ofs, pb_size *max_ofs) { boolean result = TRUE; pb_size i; @@ -157,12 +157,12 @@ static void pb_debug_buffer_fill(struct pb_debug_buffer *buf) { uint8_t *map; - + map = pb_map(buf->buffer, PB_USAGE_CPU_WRITE, NULL); assert(map); if(map) { fill_random_pattern(map, buf->underflow_size); - fill_random_pattern(map + buf->underflow_size + buf->base.base.size, + fill_random_pattern(map + buf->underflow_size + buf->base.base.size, buf->overflow_size); pb_unmap(buf->buffer); } @@ -171,14 +171,14 @@ pb_debug_buffer_fill(struct pb_debug_buffer *buf) /** * Check for under/over flows. - * + * * Should be called with the buffer unmaped. */ static void pb_debug_buffer_check(struct pb_debug_buffer *buf) { uint8_t *map; - + map = pb_map(buf->buffer, PB_USAGE_CPU_READ | PB_USAGE_UNSYNCHRONIZED, NULL); @@ -186,8 +186,8 @@ pb_debug_buffer_check(struct pb_debug_buffer *buf) if(map) { boolean underflow, overflow; pb_size min_ofs, max_ofs; - - underflow = !check_random_pattern(map, buf->underflow_size, + + underflow = !check_random_pattern(map, buf->underflow_size, &min_ofs, &max_ofs); if(underflow) { debug_printf("buffer underflow (offset -%u%s to -%u bytes) detected\n", @@ -195,9 +195,9 @@ pb_debug_buffer_check(struct pb_debug_buffer *buf) min_ofs == 0 ? "+" : "", buf->underflow_size - max_ofs); } - - overflow = !check_random_pattern(map + buf->underflow_size + buf->base.base.size, - buf->overflow_size, + + overflow = !check_random_pattern(map + buf->underflow_size + buf->base.base.size, + buf->overflow_size, &min_ofs, &max_ofs); if(overflow) { debug_printf("buffer overflow (size %u plus offset %u to %u%s bytes) detected\n", @@ -206,7 +206,7 @@ pb_debug_buffer_check(struct pb_debug_buffer *buf) max_ofs, max_ofs == buf->overflow_size - 1 ? "+" : ""); } - + if(underflow || overflow) debug_backtrace_dump(buf->create_backtrace, PB_DEBUG_CREATE_BACKTRACE); @@ -216,7 +216,7 @@ pb_debug_buffer_check(struct pb_debug_buffer *buf) if(underflow) fill_random_pattern(map, buf->underflow_size); if(overflow) - fill_random_pattern(map + buf->underflow_size + buf->base.base.size, + fill_random_pattern(map + buf->underflow_size + buf->base.base.size, buf->overflow_size); pb_unmap(buf->buffer); @@ -229,9 +229,9 @@ pb_debug_buffer_destroy(struct pb_buffer *_buf) { struct pb_debug_buffer *buf = pb_debug_buffer(_buf); struct pb_debug_manager *mgr = buf->mgr; - + assert(!pipe_is_referenced(&buf->base.base.reference)); - + pb_debug_buffer_check(buf); pipe_mutex_lock(mgr->mutex); @@ -239,32 +239,32 @@ pb_debug_buffer_destroy(struct pb_buffer *_buf) pipe_mutex_unlock(mgr->mutex); pipe_mutex_destroy(buf->mutex); - + pb_reference(&buf->buffer, NULL); FREE(buf); } static void * -pb_debug_buffer_map(struct pb_buffer *_buf, +pb_debug_buffer_map(struct pb_buffer *_buf, unsigned flags, void *flush_ctx) { struct pb_debug_buffer *buf = pb_debug_buffer(_buf); void *map; - + pb_debug_buffer_check(buf); map = pb_map(buf->buffer, flags, flush_ctx); if(!map) return NULL; - + if(map) { pipe_mutex_lock(buf->mutex); ++buf->map_count; debug_backtrace_capture(buf->map_backtrace, 1, PB_DEBUG_MAP_BACKTRACE); pipe_mutex_unlock(buf->mutex); } - + return (uint8_t *)map + buf->underflow_size; } @@ -272,16 +272,16 @@ pb_debug_buffer_map(struct pb_buffer *_buf, static void pb_debug_buffer_unmap(struct pb_buffer *_buf) { - struct pb_debug_buffer *buf = pb_debug_buffer(_buf); - + struct pb_debug_buffer *buf = pb_debug_buffer(_buf); + pipe_mutex_lock(buf->mutex); assert(buf->map_count); if(buf->map_count) --buf->map_count; pipe_mutex_unlock(buf->mutex); - + pb_unmap(buf->buffer); - + pb_debug_buffer_check(buf); } @@ -297,13 +297,13 @@ pb_debug_buffer_get_base_buffer(struct pb_buffer *_buf, } -static enum pipe_error -pb_debug_buffer_validate(struct pb_buffer *_buf, +static enum pipe_error +pb_debug_buffer_validate(struct pb_buffer *_buf, struct pb_validate *vl, unsigned flags) { struct pb_debug_buffer *buf = pb_debug_buffer(_buf); - + pipe_mutex_lock(buf->mutex); if(buf->map_count) { debug_printf("%s: attempting to validate a mapped buffer\n", __FUNCTION__); @@ -319,7 +319,7 @@ pb_debug_buffer_validate(struct pb_buffer *_buf, static void -pb_debug_buffer_fence(struct pb_buffer *_buf, +pb_debug_buffer_fence(struct pb_buffer *_buf, struct pipe_fence_handle *fence) { struct pb_debug_buffer *buf = pb_debug_buffer(_buf); @@ -327,7 +327,7 @@ pb_debug_buffer_fence(struct pb_buffer *_buf, } -const struct pb_vtbl +const struct pb_vtbl pb_debug_buffer_vtbl = { pb_debug_buffer_destroy, pb_debug_buffer_map, @@ -345,7 +345,7 @@ pb_debug_manager_dump(struct pb_debug_manager *mgr) struct pb_debug_buffer *buf; pipe_mutex_lock(mgr->mutex); - + curr = mgr->list.next; next = curr->next; while(curr != &mgr->list) { @@ -354,8 +354,8 @@ pb_debug_manager_dump(struct pb_debug_manager *mgr) debug_printf("buffer = %p\n", (void *) buf); debug_printf(" .size = 0x%x\n", buf->base.base.size); debug_backtrace_dump(buf->create_backtrace, PB_DEBUG_CREATE_BACKTRACE); - - curr = next; + + curr = next; next = curr->next; } @@ -364,7 +364,7 @@ pb_debug_manager_dump(struct pb_debug_manager *mgr) static struct pb_buffer * -pb_debug_manager_create_buffer(struct pb_manager *_mgr, +pb_debug_manager_create_buffer(struct pb_manager *_mgr, pb_size size, const struct pb_desc *desc) { @@ -372,21 +372,21 @@ pb_debug_manager_create_buffer(struct pb_manager *_mgr, struct pb_debug_buffer *buf; struct pb_desc real_desc; pb_size real_size; - + assert(size); assert(desc->alignment); buf = CALLOC_STRUCT(pb_debug_buffer); if(!buf) return NULL; - + real_size = mgr->underflow_size + size + mgr->overflow_size; real_desc = *desc; real_desc.usage |= PB_USAGE_CPU_WRITE; real_desc.usage |= PB_USAGE_CPU_READ; - buf->buffer = mgr->provider->create_buffer(mgr->provider, - real_size, + buf->buffer = mgr->provider->create_buffer(mgr->provider, + real_size, &real_desc); if(!buf->buffer) { FREE(buf); @@ -399,29 +399,29 @@ pb_debug_manager_create_buffer(struct pb_manager *_mgr, #endif return NULL; } - + assert(pipe_is_referenced(&buf->buffer->base.reference)); assert(pb_check_alignment(real_desc.alignment, buf->buffer->base.alignment)); assert(pb_check_usage(real_desc.usage, buf->buffer->base.usage)); assert(buf->buffer->base.size >= real_size); - + pipe_reference_init(&buf->base.base.reference, 1); buf->base.base.alignment = desc->alignment; buf->base.base.usage = desc->usage; buf->base.base.size = size; - + buf->base.vtbl = &pb_debug_buffer_vtbl; buf->mgr = mgr; buf->underflow_size = mgr->underflow_size; buf->overflow_size = buf->buffer->base.size - buf->underflow_size - size; - + debug_backtrace_capture(buf->create_backtrace, 1, PB_DEBUG_CREATE_BACKTRACE); pb_debug_buffer_fill(buf); - + pipe_mutex_init(buf->mutex); - + pipe_mutex_lock(mgr->mutex); LIST_ADDTAIL(&buf->head, &mgr->list); pipe_mutex_unlock(mgr->mutex); @@ -444,14 +444,14 @@ static void pb_debug_manager_destroy(struct pb_manager *_mgr) { struct pb_debug_manager *mgr = pb_debug_manager(_mgr); - + pipe_mutex_lock(mgr->mutex); if(!LIST_IS_EMPTY(&mgr->list)) { debug_printf("%s: unfreed buffers\n", __FUNCTION__); pb_debug_manager_dump(mgr); } pipe_mutex_unlock(mgr->mutex); - + pipe_mutex_destroy(mgr->mutex); mgr->provider->destroy(mgr->provider); FREE(mgr); @@ -459,14 +459,14 @@ pb_debug_manager_destroy(struct pb_manager *_mgr) struct pb_manager * -pb_debug_manager_create(struct pb_manager *provider, - pb_size underflow_size, pb_size overflow_size) +pb_debug_manager_create(struct pb_manager *provider, + pb_size underflow_size, pb_size overflow_size) { struct pb_debug_manager *mgr; if(!provider) return NULL; - + mgr = CALLOC_STRUCT(pb_debug_manager); if (!mgr) return NULL; @@ -477,7 +477,7 @@ pb_debug_manager_create(struct pb_manager *provider, mgr->provider = provider; mgr->underflow_size = underflow_size; mgr->overflow_size = overflow_size; - + pipe_mutex_init(mgr->mutex); LIST_INITHEAD(&mgr->list); @@ -489,8 +489,8 @@ pb_debug_manager_create(struct pb_manager *provider, struct pb_manager * -pb_debug_manager_create(struct pb_manager *provider, - pb_size underflow_size, pb_size overflow_size) +pb_debug_manager_create(struct pb_manager *provider, + pb_size underflow_size, pb_size overflow_size) { return provider; } diff --git a/src/gallium/auxiliary/pipebuffer/pb_bufmgr_mm.c b/src/gallium/auxiliary/pipebuffer/pb_bufmgr_mm.c index 88da786..e2249f2 100644 --- a/src/gallium/auxiliary/pipebuffer/pb_bufmgr_mm.c +++ b/src/gallium/auxiliary/pipebuffer/pb_bufmgr_mm.c @@ -28,7 +28,7 @@ /** * \file * Buffer manager using the old texture memory manager. - * + * * \author Jose Fonseca */ @@ -52,14 +52,14 @@ struct mm_pb_manager { struct pb_manager base; - + pipe_mutex mutex; - + pb_size size; struct mem_block *heap; - + pb_size align2; - + struct pb_buffer *buffer; void *map; }; @@ -76,9 +76,9 @@ mm_pb_manager(struct pb_manager *mgr) struct mm_buffer { struct pb_buffer base; - + struct mm_pb_manager *mgr; - + struct mem_block *block; }; @@ -96,9 +96,9 @@ mm_buffer_destroy(struct pb_buffer *buf) { struct mm_buffer *mm_buf = mm_buffer(buf); struct mm_pb_manager *mm = mm_buf->mgr; - + assert(!pipe_is_referenced(&mm_buf->base.base.reference)); - + pipe_mutex_lock(mm->mutex); u_mmFreeMem(mm_buf->block); FREE(mm_buf); @@ -127,8 +127,8 @@ mm_buffer_unmap(struct pb_buffer *buf) } -static enum pipe_error -mm_buffer_validate(struct pb_buffer *buf, +static enum pipe_error +mm_buffer_validate(struct pb_buffer *buf, struct pb_validate *vl, unsigned flags) { @@ -139,7 +139,7 @@ mm_buffer_validate(struct pb_buffer *buf, static void -mm_buffer_fence(struct pb_buffer *buf, +mm_buffer_fence(struct pb_buffer *buf, struct pipe_fence_handle *fence) { struct mm_buffer *mm_buf = mm_buffer(buf); @@ -160,7 +160,7 @@ mm_buffer_get_base_buffer(struct pb_buffer *buf, } -static const struct pb_vtbl +static const struct pb_vtbl mm_buffer_vtbl = { mm_buffer_destroy, mm_buffer_map, @@ -172,7 +172,7 @@ mm_buffer_vtbl = { static struct pb_buffer * -mm_bufmgr_create_buffer(struct pb_manager *mgr, +mm_bufmgr_create_buffer(struct pb_manager *mgr, pb_size size, const struct pb_desc *desc) { @@ -183,7 +183,7 @@ mm_bufmgr_create_buffer(struct pb_manager *mgr, assert(pb_check_alignment(desc->alignment, (pb_size)1 << mm->align2)); if(!pb_check_alignment(desc->alignment, (pb_size)1 << mm->align2)) return NULL; - + pipe_mutex_lock(mm->mutex); mm_buf = CALLOC_STRUCT(mm_buffer); @@ -196,11 +196,11 @@ mm_bufmgr_create_buffer(struct pb_manager *mgr, mm_buf->base.base.alignment = desc->alignment; mm_buf->base.base.usage = desc->usage; mm_buf->base.base.size = size; - + mm_buf->base.vtbl = &mm_buffer_vtbl; - + mm_buf->mgr = mm; - + mm_buf->block = u_mmAllocMem(mm->heap, (int)size, (int)mm->align2, 0); if(!mm_buf->block) { #if 0 @@ -211,11 +211,11 @@ mm_bufmgr_create_buffer(struct pb_manager *mgr, pipe_mutex_unlock(mm->mutex); return NULL; } - + /* Some sanity checks */ assert(0 <= (pb_size)mm_buf->block->ofs && (pb_size)mm_buf->block->ofs < mm->size); assert(size <= (pb_size)mm_buf->block->size && (pb_size)mm_buf->block->ofs + (pb_size)mm_buf->block->size <= mm->size); - + pipe_mutex_unlock(mm->mutex); return SUPER(mm_buf); } @@ -232,29 +232,29 @@ static void mm_bufmgr_destroy(struct pb_manager *mgr) { struct mm_pb_manager *mm = mm_pb_manager(mgr); - + pipe_mutex_lock(mm->mutex); u_mmDestroy(mm->heap); - + pb_unmap(mm->buffer); pb_reference(&mm->buffer, NULL); - + pipe_mutex_unlock(mm->mutex); - + FREE(mgr); } struct pb_manager * -mm_bufmgr_create_from_buffer(struct pb_buffer *buffer, - pb_size size, pb_size align2) +mm_bufmgr_create_from_buffer(struct pb_buffer *buffer, + pb_size size, pb_size align2) { struct mm_pb_manager *mm; if(!buffer) return NULL; - + mm = CALLOC_STRUCT(mm_pb_manager); if (!mm) return NULL; @@ -268,20 +268,20 @@ mm_bufmgr_create_from_buffer(struct pb_buffer *buffer, pipe_mutex_init(mm->mutex); - mm->buffer = buffer; + mm->buffer = buffer; - mm->map = pb_map(mm->buffer, + mm->map = pb_map(mm->buffer, PB_USAGE_CPU_READ | PB_USAGE_CPU_WRITE, NULL); if(!mm->map) goto failure; - mm->heap = u_mmInit(0, (int)size); + mm->heap = u_mmInit(0, (int)size); if (!mm->heap) goto failure; return SUPER(mm); - + failure: if(mm->heap) u_mmDestroy(mm->heap); @@ -294,8 +294,8 @@ if(mm->heap) struct pb_manager * -mm_bufmgr_create(struct pb_manager *provider, - pb_size size, pb_size align2) +mm_bufmgr_create(struct pb_manager *provider, + pb_size size, pb_size align2) { struct pb_buffer *buffer; struct pb_manager *mgr; @@ -303,14 +303,14 @@ mm_bufmgr_create(struct pb_manager *provider, if(!provider) return NULL; - + memset(&desc, 0, sizeof(desc)); desc.alignment = 1 << align2; - - buffer = provider->create_buffer(provider, size, &desc); + + buffer = provider->create_buffer(provider, size, &desc); if (!buffer) return NULL; - + mgr = mm_bufmgr_create_from_buffer(buffer, size, align2); if (!mgr) { pb_reference(&buffer, NULL); diff --git a/src/gallium/auxiliary/pipebuffer/pb_bufmgr_ondemand.c b/src/gallium/auxiliary/pipebuffer/pb_bufmgr_ondemand.c index 694a092..292d92d 100644 --- a/src/gallium/auxiliary/pipebuffer/pb_bufmgr_ondemand.c +++ b/src/gallium/auxiliary/pipebuffer/pb_bufmgr_ondemand.c @@ -28,8 +28,8 @@ /** * @file * A variation of malloc buffers which get transferred to real graphics memory - * when there is an attempt to validate them. - * + * when there is an attempt to validate them. + * * @author Jose Fonseca */ @@ -43,16 +43,16 @@ struct pb_ondemand_manager; -struct pb_ondemand_buffer +struct pb_ondemand_buffer { struct pb_buffer base; - + struct pb_ondemand_manager *mgr; - + /** Regular malloc'ed memory */ void *data; unsigned mapcount; - + /** Real buffer */ struct pb_buffer *buffer; pb_size size; @@ -63,7 +63,7 @@ struct pb_ondemand_buffer struct pb_ondemand_manager { struct pb_manager base; - + struct pb_manager *provider; }; @@ -92,17 +92,17 @@ static void pb_ondemand_buffer_destroy(struct pb_buffer *_buf) { struct pb_ondemand_buffer *buf = pb_ondemand_buffer(_buf); - + pb_reference(&buf->buffer, NULL); - + align_free(buf->data); - + FREE(buf); } static void * -pb_ondemand_buffer_map(struct pb_buffer *_buf, +pb_ondemand_buffer_map(struct pb_buffer *_buf, unsigned flags, void *flush_ctx) { struct pb_ondemand_buffer *buf = pb_ondemand_buffer(_buf); @@ -137,45 +137,45 @@ pb_ondemand_buffer_unmap(struct pb_buffer *_buf) } -static enum pipe_error +static enum pipe_error pb_ondemand_buffer_instantiate(struct pb_ondemand_buffer *buf) { if(!buf->buffer) { struct pb_manager *provider = buf->mgr->provider; uint8_t *map; - + assert(!buf->mapcount); - + buf->buffer = provider->create_buffer(provider, buf->size, &buf->desc); if(!buf->buffer) return PIPE_ERROR_OUT_OF_MEMORY; - + map = pb_map(buf->buffer, PB_USAGE_CPU_READ, NULL); if(!map) { pb_reference(&buf->buffer, NULL); return PIPE_ERROR; } - + memcpy(map, buf->data, buf->size); - + pb_unmap(buf->buffer); - + if(!buf->mapcount) { FREE(buf->data); buf->data = NULL; } } - + return PIPE_OK; } -static enum pipe_error -pb_ondemand_buffer_validate(struct pb_buffer *_buf, +static enum pipe_error +pb_ondemand_buffer_validate(struct pb_buffer *_buf, struct pb_validate *vl, unsigned flags) { struct pb_ondemand_buffer *buf = pb_ondemand_buffer(_buf); - enum pipe_error ret; + enum pipe_error ret; assert(!buf->mapcount); if(buf->mapcount) @@ -184,21 +184,21 @@ pb_ondemand_buffer_validate(struct pb_buffer *_buf, ret = pb_ondemand_buffer_instantiate(buf); if(ret != PIPE_OK) return ret; - + return pb_validate(buf->buffer, vl, flags); } static void -pb_ondemand_buffer_fence(struct pb_buffer *_buf, +pb_ondemand_buffer_fence(struct pb_buffer *_buf, struct pipe_fence_handle *fence) { struct pb_ondemand_buffer *buf = pb_ondemand_buffer(_buf); - + assert(buf->buffer); if(!buf->buffer) return; - + pb_fence(buf->buffer, fence); } @@ -221,7 +221,7 @@ pb_ondemand_buffer_get_base_buffer(struct pb_buffer *_buf, } -const struct pb_vtbl +const struct pb_vtbl pb_ondemand_buffer_vtbl = { pb_ondemand_buffer_destroy, pb_ondemand_buffer_map, @@ -233,13 +233,13 @@ pb_ondemand_buffer_vtbl = { static struct pb_buffer * -pb_ondemand_manager_create_buffer(struct pb_manager *_mgr, +pb_ondemand_manager_create_buffer(struct pb_manager *_mgr, pb_size size, - const struct pb_desc *desc) + const struct pb_desc *desc) { struct pb_ondemand_manager *mgr = pb_ondemand_manager(_mgr); struct pb_ondemand_buffer *buf; - + buf = CALLOC_STRUCT(pb_ondemand_buffer); if(!buf) return NULL; @@ -249,15 +249,15 @@ pb_ondemand_manager_create_buffer(struct pb_manager *_mgr, buf->base.base.usage = desc->usage; buf->base.base.size = size; buf->base.vtbl = &pb_ondemand_buffer_vtbl; - + buf->mgr = mgr; - + buf->data = align_malloc(size, desc->alignment < sizeof(void*) ? sizeof(void*) : desc->alignment); if(!buf->data) { FREE(buf); return NULL; } - + buf->size = size; buf->desc = *desc; @@ -266,16 +266,16 @@ pb_ondemand_manager_create_buffer(struct pb_manager *_mgr, static void -pb_ondemand_manager_flush(struct pb_manager *_mgr) +pb_ondemand_manager_flush(struct pb_manager *_mgr) { struct pb_ondemand_manager *mgr = pb_ondemand_manager(_mgr); - + mgr->provider->flush(mgr->provider); } static void -pb_ondemand_manager_destroy(struct pb_manager *_mgr) +pb_ondemand_manager_destroy(struct pb_manager *_mgr) { struct pb_ondemand_manager *mgr = pb_ondemand_manager(_mgr); @@ -284,21 +284,21 @@ pb_ondemand_manager_destroy(struct pb_manager *_mgr) struct pb_manager * -pb_ondemand_manager_create(struct pb_manager *provider) +pb_ondemand_manager_create(struct pb_manager *provider) { struct pb_ondemand_manager *mgr; if(!provider) return NULL; - + mgr = CALLOC_STRUCT(pb_ondemand_manager); if(!mgr) return NULL; - + mgr->base.destroy = pb_ondemand_manager_destroy; mgr->base.create_buffer = pb_ondemand_manager_create_buffer; mgr->base.flush = pb_ondemand_manager_flush; - + mgr->provider = provider; return &mgr->base; diff --git a/src/gallium/auxiliary/pipebuffer/pb_bufmgr_pool.c b/src/gallium/auxiliary/pipebuffer/pb_bufmgr_pool.c index 2f7c738..bfd332c 100644 --- a/src/gallium/auxiliary/pipebuffer/pb_bufmgr_pool.c +++ b/src/gallium/auxiliary/pipebuffer/pb_bufmgr_pool.c @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2006 Tungsten Graphics, Inc., Bismarck, ND., USA * 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,26 +10,26 @@ * 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 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. IN NO EVENT SHALL * THE COPYRIGHT HOLDERS, AUTHORS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, - * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR - * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE + * 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. * * The above copyright notice and this permission notice (including the * next paragraph) shall be included in all copies or substantial portions * of the Software. - * - * + * + * **************************************************************************/ /** * \file * Batch buffer pool management. - * + * * \author Jose Fonseca * \author Thomas Hellström */ @@ -55,20 +55,20 @@ struct pool_pb_manager { struct pb_manager base; - + pipe_mutex mutex; - + pb_size bufSize; pb_size bufAlign; - + pb_size numFree; pb_size numTot; - + struct list_head free; - + struct pb_buffer *buffer; void *map; - + struct pool_buffer *bufs; }; @@ -84,11 +84,11 @@ pool_pb_manager(struct pb_manager *mgr) struct pool_buffer { struct pb_buffer base; - + struct pool_pb_manager *mgr; - + struct list_head head; - + pb_size start; }; @@ -107,7 +107,7 @@ pool_buffer_destroy(struct pb_buffer *buf) { struct pool_buffer *pool_buf = pool_buffer(buf); struct pool_pb_manager *pool = pool_buf->mgr; - + assert(!pipe_is_referenced(&pool_buf->base.base.reference)); pipe_mutex_lock(pool->mutex); @@ -140,8 +140,8 @@ pool_buffer_unmap(struct pb_buffer *buf) } -static enum pipe_error -pool_buffer_validate(struct pb_buffer *buf, +static enum pipe_error +pool_buffer_validate(struct pb_buffer *buf, struct pb_validate *vl, unsigned flags) { @@ -152,7 +152,7 @@ pool_buffer_validate(struct pb_buffer *buf, static void -pool_buffer_fence(struct pb_buffer *buf, +pool_buffer_fence(struct pb_buffer *buf, struct pipe_fence_handle *fence) { struct pool_buffer *pool_buf = pool_buffer(buf); @@ -173,7 +173,7 @@ pool_buffer_get_base_buffer(struct pb_buffer *buf, } -static const struct pb_vtbl +static const struct pb_vtbl pool_buffer_vtbl = { pool_buffer_destroy, pool_buffer_map, @@ -195,7 +195,7 @@ pool_bufmgr_create_buffer(struct pb_manager *mgr, assert(size == pool->bufSize); assert(pool->bufAlign % desc->alignment == 0); - + pipe_mutex_lock(pool->mutex); if (pool->numFree == 0) { @@ -216,13 +216,13 @@ pool_bufmgr_create_buffer(struct pb_manager *mgr, --pool->numFree; pipe_mutex_unlock(pool->mutex); - + pool_buf = LIST_ENTRY(struct pool_buffer, item, head); assert(!pipe_is_referenced(&pool_buf->base.base.reference)); pipe_reference_init(&pool_buf->base.base.reference, 1); pool_buf->base.base.alignment = desc->alignment; pool_buf->base.base.usage = desc->usage; - + return SUPER(pool_buf); } @@ -241,21 +241,21 @@ pool_bufmgr_destroy(struct pb_manager *mgr) pipe_mutex_lock(pool->mutex); FREE(pool->bufs); - + pb_unmap(pool->buffer); pb_reference(&pool->buffer, NULL); - + pipe_mutex_unlock(pool->mutex); - + FREE(mgr); } struct pb_manager * -pool_bufmgr_create(struct pb_manager *provider, - pb_size numBufs, +pool_bufmgr_create(struct pb_manager *provider, + pb_size numBufs, pb_size bufSize, - const struct pb_desc *desc) + const struct pb_desc *desc) { struct pool_pb_manager *pool; struct pool_buffer *pool_buf; @@ -263,7 +263,7 @@ pool_bufmgr_create(struct pb_manager *provider, if(!provider) return NULL; - + pool = CALLOC_STRUCT(pool_pb_manager); if (!pool) return NULL; @@ -277,11 +277,11 @@ pool_bufmgr_create(struct pb_manager *provider, pool->numTot = numBufs; pool->numFree = numBufs; pool->bufSize = bufSize; - pool->bufAlign = desc->alignment; - + pool->bufAlign = desc->alignment; + pipe_mutex_init(pool->mutex); - pool->buffer = provider->create_buffer(provider, numBufs*bufSize, desc); + pool->buffer = provider->create_buffer(provider, numBufs*bufSize, desc); if (!pool->buffer) goto failure; @@ -309,7 +309,7 @@ pool_bufmgr_create(struct pb_manager *provider, } return SUPER(pool); - + failure: if(pool->bufs) FREE(pool->bufs); diff --git a/src/gallium/auxiliary/pipebuffer/pb_bufmgr_slab.c b/src/gallium/auxiliary/pipebuffer/pb_bufmgr_slab.c index 176f9aa..e312e1b 100644 --- a/src/gallium/auxiliary/pipebuffer/pb_bufmgr_slab.c +++ b/src/gallium/auxiliary/pipebuffer/pb_bufmgr_slab.c @@ -29,9 +29,9 @@ /** * @file * S-lab pool implementation. - * + * * @sa http://en.wikipedia.org/wiki/Slab_allocation - * + * * @author Thomas Hellstrom * @author Jose Fonseca */ @@ -53,22 +53,22 @@ struct pb_slab; /** * Buffer in a slab. - * + * * Sub-allocation of a contiguous buffer. */ struct pb_slab_buffer { struct pb_buffer base; - + struct pb_slab *slab; - + struct list_head head; - + unsigned mapCount; - + /** Offset relative to the start of the slab buffer. */ pb_size start; - + /** Use when validating, to signal that all mappings are finished */ /* TODO: Actually validation does not reach this stage yet */ pipe_condvar event; @@ -76,7 +76,7 @@ struct pb_slab_buffer /** - * Slab -- a contiguous piece of memory. + * Slab -- a contiguous piece of memory. */ struct pb_slab { @@ -84,80 +84,80 @@ struct pb_slab struct list_head freeBuffers; pb_size numBuffers; pb_size numFree; - + struct pb_slab_buffer *buffers; struct pb_slab_manager *mgr; - + /** Buffer from the provider */ struct pb_buffer *bo; - - void *virtual; + + void *virtual; }; /** - * It adds/removes slabs as needed in order to meet the allocation/destruction + * It adds/removes slabs as needed in order to meet the allocation/destruction * of individual buffers. */ -struct pb_slab_manager +struct pb_slab_manager { struct pb_manager base; - + /** From where we get our buffers */ struct pb_manager *provider; - + /** Size of the buffers we hand on downstream */ pb_size bufSize; - + /** Size of the buffers we request upstream */ pb_size slabSize; - - /** + + /** * Alignment, usage to be used to allocate the slab buffers. - * - * We can only provide buffers which are consistent (in alignment, usage) - * with this description. + * + * We can only provide buffers which are consistent (in alignment, usage) + * with this description. */ struct pb_desc desc; - /** + /** * Partial slabs - * - * Full slabs are not stored in any list. Empty slabs are destroyed + * + * Full slabs are not stored in any list. Empty slabs are destroyed * immediatly. */ struct list_head slabs; - + pipe_mutex mutex; }; /** - * Wrapper around several slabs, therefore capable of handling buffers of - * multiple sizes. - * + * Wrapper around several slabs, therefore capable of handling buffers of + * multiple sizes. + * * This buffer manager just dispatches buffer allocations to the appropriate slab - * manager, according to the requested buffer size, or by passes the slab + * manager, according to the requested buffer size, or by passes the slab * managers altogether for even greater sizes. - * + * * The data of this structure remains constant after * initialization and thus needs no mutex protection. */ -struct pb_slab_range_manager +struct pb_slab_range_manager { struct pb_manager base; struct pb_manager *provider; - + pb_size minBufSize; pb_size maxBufSize; - - /** @sa pb_slab_manager::desc */ + + /** @sa pb_slab_manager::desc */ struct pb_desc desc; - + unsigned numBuckets; pb_size *bucketSizes; - + /** Array of pb_slab_manager, one for each bucket size */ struct pb_manager **buckets; }; @@ -200,9 +200,9 @@ pb_slab_buffer_destroy(struct pb_buffer *_buf) struct list_head *list = &buf->head; pipe_mutex_lock(mgr->mutex); - + assert(!pipe_is_referenced(&buf->base.base.reference)); - + buf->mapCount = 0; LIST_DEL(list); @@ -226,7 +226,7 @@ pb_slab_buffer_destroy(struct pb_buffer *_buf) static void * -pb_slab_buffer_map(struct pb_buffer *_buf, +pb_slab_buffer_map(struct pb_buffer *_buf, unsigned flags, void *flush_ctx) { @@ -245,13 +245,13 @@ pb_slab_buffer_unmap(struct pb_buffer *_buf) struct pb_slab_buffer *buf = pb_slab_buffer(_buf); --buf->mapCount; - if (buf->mapCount == 0) + if (buf->mapCount == 0) pipe_condvar_broadcast(buf->event); } -static enum pipe_error -pb_slab_buffer_validate(struct pb_buffer *_buf, +static enum pipe_error +pb_slab_buffer_validate(struct pb_buffer *_buf, struct pb_validate *vl, unsigned flags) { @@ -261,7 +261,7 @@ pb_slab_buffer_validate(struct pb_buffer *_buf, static void -pb_slab_buffer_fence(struct pb_buffer *_buf, +pb_slab_buffer_fence(struct pb_buffer *_buf, struct pipe_fence_handle *fence) { struct pb_slab_buffer *buf = pb_slab_buffer(_buf); @@ -280,7 +280,7 @@ pb_slab_buffer_get_base_buffer(struct pb_buffer *_buf, } -static const struct pb_vtbl +static const struct pb_vtbl pb_slab_buffer_vtbl = { pb_slab_buffer_destroy, pb_slab_buffer_map, @@ -293,7 +293,7 @@ pb_slab_buffer_vtbl = { /** * Create a new slab. - * + * * Called when we ran out of free slabs. */ static enum pipe_error @@ -315,9 +315,9 @@ pb_slab_create(struct pb_slab_manager *mgr) goto out_err0; } - /* Note down the slab virtual address. All mappings are accessed directly + /* Note down the slab virtual address. All mappings are accessed directly * through this address so it is required that the buffer is pinned. */ - slab->virtual = pb_map(slab->bo, + slab->virtual = pb_map(slab->bo, PB_USAGE_CPU_READ | PB_USAGE_CPU_WRITE, NULL); if(!slab->virtual) { @@ -361,9 +361,9 @@ pb_slab_create(struct pb_slab_manager *mgr) return PIPE_OK; -out_err1: +out_err1: pb_reference(&slab->bo, NULL); -out_err0: +out_err0: FREE(slab); return ret; } @@ -383,7 +383,7 @@ pb_slab_manager_create_buffer(struct pb_manager *_mgr, assert(size <= mgr->bufSize); if(size > mgr->bufSize) return NULL; - + /* check if we can provide the requested alignment */ assert(pb_check_alignment(desc->alignment, mgr->desc.alignment)); if(!pb_check_alignment(desc->alignment, mgr->desc.alignment)) @@ -397,7 +397,7 @@ pb_slab_manager_create_buffer(struct pb_manager *_mgr, return NULL; pipe_mutex_lock(mgr->mutex); - + /* Create a new slab, if we run out of partial slabs */ if (mgr->slabs.next == &mgr->slabs) { (void) pb_slab_create(mgr); @@ -406,11 +406,11 @@ pb_slab_manager_create_buffer(struct pb_manager *_mgr, return NULL; } } - + /* Allocate the buffer from a partial (or just created) slab */ list = mgr->slabs.next; slab = LIST_ENTRY(struct pb_slab, list, head); - + /* If totally full remove from the partial slab list */ if (--slab->numFree == 0) LIST_DELINIT(list); @@ -420,11 +420,11 @@ pb_slab_manager_create_buffer(struct pb_manager *_mgr, pipe_mutex_unlock(mgr->mutex); buf = LIST_ENTRY(struct pb_slab_buffer, list, head); - + pipe_reference_init(&buf->base.base.reference, 1); buf->base.base.alignment = desc->alignment; buf->base.base.usage = desc->usage; - + return &buf->base; } @@ -472,7 +472,7 @@ pb_slab_manager_create(struct pb_manager *provider, mgr->desc = *desc; LIST_INITHEAD(&mgr->slabs); - + pipe_mutex_init(mgr->mutex); return &mgr->base; @@ -510,7 +510,7 @@ pb_slab_range_manager_flush(struct pb_manager *_mgr) struct pb_slab_range_manager *mgr = pb_slab_range_manager(_mgr); /* Individual slabs don't hold any temporary buffers so no need to call them */ - + assert(mgr->provider->flush); if(mgr->provider->flush) mgr->provider->flush(mgr->provider); @@ -522,7 +522,7 @@ pb_slab_range_manager_destroy(struct pb_manager *_mgr) { struct pb_slab_range_manager *mgr = pb_slab_range_manager(_mgr); unsigned i; - + for (i = 0; i < mgr->numBuckets; ++i) mgr->buckets[i]->destroy(mgr->buckets[i]); FREE(mgr->buckets); @@ -544,7 +544,7 @@ pb_slab_range_manager_create(struct pb_manager *provider, if(!provider) return NULL; - + mgr = CALLOC_STRUCT(pb_slab_range_manager); if (!mgr) goto out_err0; @@ -563,7 +563,7 @@ pb_slab_range_manager_create(struct pb_manager *provider, bufSize *= 2; ++mgr->numBuckets; } - + mgr->buckets = CALLOC(mgr->numBuckets, sizeof(*mgr->buckets)); if (!mgr->buckets) goto out_err1; @@ -578,12 +578,12 @@ pb_slab_range_manager_create(struct pb_manager *provider, return &mgr->base; -out_err2: +out_err2: for (i = 0; i < mgr->numBuckets; ++i) if(mgr->buckets[i]) mgr->buckets[i]->destroy(mgr->buckets[i]); FREE(mgr->buckets); -out_err1: +out_err1: FREE(mgr); out_err0: return NULL; diff --git a/src/gallium/auxiliary/pipebuffer/pb_validate.c b/src/gallium/auxiliary/pipebuffer/pb_validate.c index b585422..adb5bfb 100644 --- a/src/gallium/auxiliary/pipebuffer/pb_validate.c +++ b/src/gallium/auxiliary/pipebuffer/pb_validate.c @@ -28,7 +28,7 @@ /** * @file * Buffer validation. - * + * * @author Jose Fonseca */ @@ -42,7 +42,7 @@ #include "pb_validate.h" -#define PB_VALIDATE_INITIAL_SIZE 1 /* 512 */ +#define PB_VALIDATE_INITIAL_SIZE 1 /* 512 */ struct pb_validate_entry @@ -74,19 +74,19 @@ pb_validate_add_buffer(struct pb_validate *vl, flags &= PB_USAGE_GPU_READ_WRITE; /* We only need to store one reference for each buffer, so avoid storing - * consecutive references for the same buffer. It might not be the most + * consecutive references for the same buffer. It might not be the most * common pattern, but it is easy to implement. */ if(vl->used && vl->entries[vl->used - 1].buf == buf) { vl->entries[vl->used - 1].flags |= flags; return PIPE_OK; } - + /* Grow the table */ if(vl->used == vl->size) { unsigned new_size; struct pb_validate_entry *new_entries; - + new_size = vl->size * 2; if(!new_size) return PIPE_ERROR_OUT_OF_MEMORY; @@ -96,18 +96,18 @@ pb_validate_add_buffer(struct pb_validate *vl, new_size*sizeof(struct pb_validate_entry)); if(!new_entries) return PIPE_ERROR_OUT_OF_MEMORY; - + memset(new_entries + vl->size, 0, (new_size - vl->size)*sizeof(struct pb_validate_entry)); - + vl->size = new_size; vl->entries = new_entries; } - + assert(!vl->entries[vl->used].buf); pb_reference(&vl->entries[vl->used].buf, buf); vl->entries[vl->used].flags = flags; ++vl->used; - + return PIPE_OK; } @@ -129,10 +129,10 @@ pb_validate_foreach(struct pb_validate *vl, enum pipe_error -pb_validate_validate(struct pb_validate *vl) +pb_validate_validate(struct pb_validate *vl) { unsigned i; - + for(i = 0; i < vl->used; ++i) { enum pipe_error ret; ret = pb_validate(vl->entries[i].buf, vl, vl->entries[i].flags); @@ -175,11 +175,11 @@ struct pb_validate * pb_validate_create() { struct pb_validate *vl; - + vl = CALLOC_STRUCT(pb_validate); if(!vl) return NULL; - + vl->size = PB_VALIDATE_INITIAL_SIZE; vl->entries = (struct pb_validate_entry *)CALLOC(vl->size, sizeof(struct pb_validate_entry)); if(!vl->entries) { diff --git a/src/gallium/auxiliary/pipebuffer/pb_validate.h b/src/gallium/auxiliary/pipebuffer/pb_validate.h index 3c93f30..728d977 100644 --- a/src/gallium/auxiliary/pipebuffer/pb_validate.h +++ b/src/gallium/auxiliary/pipebuffer/pb_validate.h @@ -28,7 +28,7 @@ /** * @file * Buffer validation. - * + * * @author Jose Fonseca */ @@ -50,7 +50,7 @@ struct pipe_fence_handle; /** * Buffer validation list. - * + * * It holds a list of buffers to be validated and fenced when flushing. */ struct pb_validate; @@ -68,7 +68,7 @@ pb_validate_foreach(struct pb_validate *vl, /** * Validate all buffers for hardware access. - * + * * Should be called right before issuing commands to the hardware. */ enum pipe_error @@ -76,7 +76,7 @@ pb_validate_validate(struct pb_validate *vl); /** * Fence all buffers and clear the list. - * + * * Should be called right after issuing commands to the hardware. */ void diff --git a/src/gallium/auxiliary/rtasm/rtasm_cpu.c b/src/gallium/auxiliary/rtasm/rtasm_cpu.c index 0461c81..575778f 100644 --- a/src/gallium/auxiliary/rtasm/rtasm_cpu.c +++ b/src/gallium/auxiliary/rtasm/rtasm_cpu.c @@ -35,7 +35,7 @@ static boolean rtasm_sse_enabled(void) { static boolean firsttime = 1; static boolean enabled; - + /* This gets called quite often at the moment: */ if (firsttime) { @@ -56,7 +56,7 @@ int rtasm_cpu_has_sse(void) #endif } -int rtasm_cpu_has_sse2(void) +int rtasm_cpu_has_sse2(void) { /* FIXME: actually detect this at run-time */ #if defined(PIPE_ARCH_X86) || defined(PIPE_ARCH_X86_64) diff --git a/src/gallium/auxiliary/rtasm/rtasm_execmem.c b/src/gallium/auxiliary/rtasm/rtasm_execmem.c index fbde1d1..7de4c45 100644 --- a/src/gallium/auxiliary/rtasm/rtasm_execmem.c +++ b/src/gallium/auxiliary/rtasm/rtasm_execmem.c @@ -73,10 +73,10 @@ init_heap(void) { if (!exec_heap) exec_heap = u_mmInit( 0, EXEC_HEAP_SIZE ); - + if (!exec_mem) - exec_mem = (unsigned char *) mmap(0, EXEC_HEAP_SIZE, - PROT_EXEC | PROT_READ | PROT_WRITE, + exec_mem = (unsigned char *) mmap(0, EXEC_HEAP_SIZE, + PROT_EXEC | PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0); } @@ -98,23 +98,23 @@ rtasm_exec_malloc(size_t size) if (block) addr = exec_mem + block->ofs; - else + else debug_printf("rtasm_exec_malloc failed\n"); - + pipe_mutex_unlock(exec_mutex); - + return addr; } - -void + +void rtasm_exec_free(void *addr) { pipe_mutex_lock(exec_mutex); if (exec_heap) { struct mem_block *block = u_mmFindBlock(exec_heap, (unsigned char *)addr - exec_mem); - + if (block) u_mmFreeMem(block); } @@ -157,8 +157,8 @@ rtasm_exec_malloc(size_t size) return MALLOC( size ); } - -void + +void rtasm_exec_free(void *addr) { FREE(addr); diff --git a/src/gallium/auxiliary/rtasm/rtasm_execmem.h b/src/gallium/auxiliary/rtasm/rtasm_execmem.h index 155c6d3..c51ddfe 100644 --- a/src/gallium/auxiliary/rtasm/rtasm_execmem.h +++ b/src/gallium/auxiliary/rtasm/rtasm_execmem.h @@ -38,7 +38,7 @@ extern void * rtasm_exec_malloc( size_t size ); -extern void +extern void rtasm_exec_free( void *addr ); diff --git a/src/gallium/auxiliary/rtasm/rtasm_ppc_spe.c b/src/gallium/auxiliary/rtasm/rtasm_ppc_spe.c index 53a0e72..81357c9 100644 --- a/src/gallium/auxiliary/rtasm/rtasm_ppc_spe.c +++ b/src/gallium/auxiliary/rtasm/rtasm_ppc_spe.c @@ -520,7 +520,7 @@ void spe_allocate_register_set(struct spe_function *p) { uint i; - /* Keep track of the set count. If it ever wraps around to 0, + /* Keep track of the set count. If it ever wraps around to 0, * we're in trouble. */ p->set_count++; @@ -843,7 +843,7 @@ spe_and_uint(struct spe_function *p, int rT, int rA, uint ui) spe_andi(p, rT, rA, ui & 0x000003ff); return; } - + /* If the ui field is symmetric along halfword boundaries and * the upper 7 bits of each halfword are all 0s or 1s, we * can use And Halfword Immediate @@ -878,10 +878,10 @@ spe_and_uint(struct spe_function *p, int rT, int rA, uint ui) void spe_xor_uint(struct spe_function *p, int rT, int rA, uint ui) { - /* If we can, emit a single instruction, either Exclusive Or Byte - * Immediate (which uses the same constant across each byte), Exclusive - * Or Halfword Immediate (which sign-extends a 10-bit immediate to - * 16 bits and uses that across each halfword), or Exclusive Or Word + /* If we can, emit a single instruction, either Exclusive Or Byte + * Immediate (which uses the same constant across each byte), Exclusive + * Or Halfword Immediate (which sign-extends a 10-bit immediate to + * 16 bits and uses that across each halfword), or Exclusive Or Word * Immediate (which sign-extends a 10-bit immediate to 32 bits). * * Otherwise, we'll need to use a temporary register. @@ -896,7 +896,7 @@ spe_xor_uint(struct spe_function *p, int rT, int rA, uint ui) spe_xori(p, rT, rA, ui & 0x000003ff); return; } - + /* If the ui field is symmetric along halfword boundaries and * the upper 7 bits of each halfword are all 0s or 1s, we * can use Exclusive Or Halfword Immediate @@ -1025,7 +1025,7 @@ spe_splat_word(struct spe_function *p, int rT, int rA, int word) /** * For each 32-bit float element of rA and rB, choose the smaller of the * two, compositing them into the rT register. - * + * * The Float Compare Greater Than (fcgt) instruction will put 1s into * compare_reg where rA > rB, and 0s where rA <= rB. * @@ -1038,7 +1038,7 @@ spe_splat_word(struct spe_function *p, int rT, int rA, int word) * rT == rA || rt == rB. But since this is common in constructions * like "x = min(x, a)", we always allocate a new register to be safe. */ -void +void spe_float_min(struct spe_function *p, int rT, int rA, int rB) { int compare_reg = spe_allocate_available_register(p); @@ -1050,12 +1050,12 @@ spe_float_min(struct spe_function *p, int rT, int rA, int rB) /** * For each 32-bit float element of rA and rB, choose the greater of the * two, compositing them into the rT register. - * + * * The logic is similar to that of spe_float_min() above; the only * difference is that the registers on spe_selb() have been reversed, * so that the larger of the two is selected instead of the smaller. */ -void +void spe_float_max(struct spe_function *p, int rT, int rA, int rB) { int compare_reg = spe_allocate_available_register(p); diff --git a/src/gallium/auxiliary/rtasm/rtasm_ppc_spe.h b/src/gallium/auxiliary/rtasm/rtasm_ppc_spe.h index 65d9c77..fe07bff 100644 --- a/src/gallium/auxiliary/rtasm/rtasm_ppc_spe.h +++ b/src/gallium/auxiliary/rtasm/rtasm_ppc_spe.h @@ -61,7 +61,7 @@ struct spe_function */ unsigned char set_count; - /** + /** * Flags for used and unused registers. Each byte corresponds to a * register; a 0 in that byte means that the register is available. * A value of 1 means that the register was allocated in the current @@ -70,7 +70,7 @@ struct spe_function * * \sa * spe_allocate_register, spe_allocate_available_register, - * spe_allocate_register_set, spe_release_register_set, spe_release_register, + * spe_allocate_register_set, spe_release_register_set, spe_release_register, */ unsigned char regs[SPE_NUM_REGS]; diff --git a/src/gallium/auxiliary/rtasm/rtasm_x86sse.c b/src/gallium/auxiliary/rtasm/rtasm_x86sse.c index 75b0f6a..6a128c4 100644 --- a/src/gallium/auxiliary/rtasm/rtasm_x86sse.c +++ b/src/gallium/auxiliary/rtasm/rtasm_x86sse.c @@ -42,9 +42,9 @@ void x86_print_reg( struct x86_reg reg ) { - if (reg.mod != mod_REG) + if (reg.mod != mod_REG) debug_printf( "[" ); - + switch( reg.file ) { case file_REG32: switch( reg.idx ) { @@ -73,7 +73,7 @@ void x86_print_reg( struct x86_reg reg ) reg.mod == mod_DISP32) debug_printf("+%d", reg.disp); - if (reg.mod != mod_REG) + if (reg.mod != mod_REG) debug_printf( "]" ); } @@ -224,14 +224,14 @@ static void emit_3ub( struct x86_function *p, unsigned char b0, unsigned char b1 * * This is the "/r" field in the x86 manuals... */ -static void emit_modrm( struct x86_function *p, - struct x86_reg reg, +static void emit_modrm( struct x86_function *p, + struct x86_reg reg, struct x86_reg regmem ) { unsigned char val = 0; - + assert(reg.mod == mod_REG); - + /* TODO: support extended x86-64 registers */ assert(reg.idx < 8); assert(regmem.idx < 8); @@ -239,7 +239,7 @@ static void emit_modrm( struct x86_function *p, val |= regmem.mod << 6; /* mod field */ val |= reg.idx << 3; /* reg field */ val |= regmem.idx; /* r/m field */ - + emit_1ub(p, val); /* Oh-oh we've stumbled into the SIB thing. @@ -282,11 +282,11 @@ static void emit_modrm_noreg( struct x86_function *p, * the arguments presented. */ static void emit_op_modrm( struct x86_function *p, - unsigned char op_dst_is_reg, + unsigned char op_dst_is_reg, unsigned char op_dst_is_mem, struct x86_reg dst, struct x86_reg src ) -{ +{ switch (dst.mod) { case mod_REG: emit_1ub(p, op_dst_is_reg); @@ -380,7 +380,7 @@ void x86_jcc( struct x86_function *p, { int offset = label - (x86_get_label(p) + 2); DUMP_I(cc); - + if (offset < 0) { /*assert(p->csr - p->store > -offset);*/ if (p->csr - p->store <= -offset) { @@ -509,8 +509,8 @@ void x86_mov8_imm( struct x86_function *p, struct x86_reg dst, uint8_t imm ) /** * Immediate group 1 instructions. */ -static INLINE void -x86_group1_imm( struct x86_function *p, +static INLINE void +x86_group1_imm( struct x86_function *p, unsigned op, struct x86_reg dst, int imm ) { assert(dst.file == file_REG32); @@ -570,7 +570,7 @@ void x86_push( struct x86_function *p, DUMP_R( reg ); if (reg.mod == mod_REG) emit_1ub(p, 0x50 + reg.idx); - else + else { emit_1ub(p, 0xff); emit_modrm_noreg(p, 6, reg); @@ -905,7 +905,7 @@ void sse_prefetch1( struct x86_function *p, struct x86_reg ptr) emit_modrm_noreg(p, 2, ptr); } -void sse_movntps( struct x86_function *p, +void sse_movntps( struct x86_function *p, struct x86_reg dst, struct x86_reg src) { @@ -1128,7 +1128,7 @@ void sse_cvtps2pi( struct x86_function *p, struct x86_reg src ) { DUMP_RR( dst, src ); - assert(dst.file == file_MMX && + assert(dst.file == file_MMX && (src.file == file_XMM || src.mod != mod_REG)); p->need_emms = 1; @@ -1153,12 +1153,12 @@ void sse2_cvtdq2ps( struct x86_function *p, void sse_shufps( struct x86_function *p, struct x86_reg dst, struct x86_reg src, - unsigned char shuf) + unsigned char shuf) { DUMP_RRI( dst, src, shuf ); emit_2ub(p, X86_TWOB, 0xC6); emit_modrm(p, dst, src); - emit_1ub(p, shuf); + emit_1ub(p, shuf); } void sse_unpckhps( struct x86_function *p, struct x86_reg dst, struct x86_reg src ) @@ -1178,12 +1178,12 @@ void sse_unpcklps( struct x86_function *p, struct x86_reg dst, struct x86_reg sr void sse_cmpps( struct x86_function *p, struct x86_reg dst, struct x86_reg src, - enum sse_cc cc) + enum sse_cc cc) { DUMP_RRI( dst, src, cc ); emit_2ub(p, X86_TWOB, 0xC2); emit_modrm(p, dst, src); - emit_1ub(p, cc); + emit_1ub(p, cc); } void sse_pmovmskb( struct x86_function *p, @@ -1285,12 +1285,12 @@ void sse2_movapd( struct x86_function *p, struct x86_reg dst, struct x86_reg src void sse2_pshufd( struct x86_function *p, struct x86_reg dst, struct x86_reg src, - unsigned char shuf) + unsigned char shuf) { DUMP_RRI( dst, src, shuf ); emit_3ub(p, 0x66, X86_TWOB, 0x70); emit_modrm(p, dst, src); - emit_1ub(p, shuf); + emit_1ub(p, shuf); } void sse2_pshuflw( struct x86_function *p, @@ -1651,9 +1651,9 @@ static void x87_arith_op( struct x86_function *p, struct x86_reg dst, struct x86 assert(dst.file == file_x87); if (arg.file == file_x87) { - if (dst.idx == 0) + if (dst.idx == 0) emit_2ub(p, dst0ub0, dst0ub1+arg.idx); - else if (arg.idx == 0) + else if (arg.idx == 0) emit_2ub(p, arg0ub0, arg0ub1+arg.idx); else assert(0); @@ -1670,7 +1670,7 @@ static void x87_arith_op( struct x86_function *p, struct x86_reg dst, struct x86 void x87_fmul( struct x86_function *p, struct x86_reg dst, struct x86_reg src ) { DUMP_RR( dst, src ); - x87_arith_op(p, dst, src, + x87_arith_op(p, dst, src, 0xd8, 0xc8, 0xdc, 0xc8, 4); @@ -1679,7 +1679,7 @@ void x87_fmul( struct x86_function *p, struct x86_reg dst, struct x86_reg src ) void x87_fsub( struct x86_function *p, struct x86_reg dst, struct x86_reg src ) { DUMP_RR( dst, src ); - x87_arith_op(p, dst, src, + x87_arith_op(p, dst, src, 0xd8, 0xe0, 0xdc, 0xe8, 4); @@ -1688,7 +1688,7 @@ void x87_fsub( struct x86_function *p, struct x86_reg dst, struct x86_reg src ) void x87_fsubr( struct x86_function *p, struct x86_reg dst, struct x86_reg src ) { DUMP_RR( dst, src ); - x87_arith_op(p, dst, src, + x87_arith_op(p, dst, src, 0xd8, 0xe8, 0xdc, 0xe0, 5); @@ -1697,7 +1697,7 @@ void x87_fsubr( struct x86_function *p, struct x86_reg dst, struct x86_reg src ) void x87_fadd( struct x86_function *p, struct x86_reg dst, struct x86_reg src ) { DUMP_RR( dst, src ); - x87_arith_op(p, dst, src, + x87_arith_op(p, dst, src, 0xd8, 0xc0, 0xdc, 0xc0, 0); @@ -1706,7 +1706,7 @@ void x87_fadd( struct x86_function *p, struct x86_reg dst, struct x86_reg src ) void x87_fdiv( struct x86_function *p, struct x86_reg dst, struct x86_reg src ) { DUMP_RR( dst, src ); - x87_arith_op(p, dst, src, + x87_arith_op(p, dst, src, 0xd8, 0xf0, 0xdc, 0xf8, 6); @@ -1715,7 +1715,7 @@ void x87_fdiv( struct x86_function *p, struct x86_reg dst, struct x86_reg src ) void x87_fdivr( struct x86_function *p, struct x86_reg dst, struct x86_reg src ) { DUMP_RR( dst, src ); - x87_arith_op(p, dst, src, + x87_arith_op(p, dst, src, 0xd8, 0xf8, 0xdc, 0xf0, 7); @@ -1889,7 +1889,7 @@ void x87_fyl2x( struct x86_function *p ) /* st1 = st1 * log2(st0 + 1.0); * pop_stack; * - * A fast operation, with restrictions: -.29 < st0 < .29 + * A fast operation, with restrictions: -.29 < st0 < .29 */ void x87_fyl2xp1( struct x86_function *p ) { @@ -1902,7 +1902,7 @@ void x87_fyl2xp1( struct x86_function *p ) void x87_fld( struct x86_function *p, struct x86_reg arg ) { DUMP_R( arg ); - if (arg.file == file_x87) + if (arg.file == file_x87) emit_2ub(p, 0xd9, 0xc0 + arg.idx); else { emit_1ub(p, 0xd9); @@ -1914,7 +1914,7 @@ void x87_fld( struct x86_function *p, struct x86_reg arg ) void x87_fst( struct x86_function *p, struct x86_reg dst ) { DUMP_R( dst ); - if (dst.file == file_x87) + if (dst.file == file_x87) emit_2ub(p, 0xdd, 0xd0 + dst.idx); else { emit_1ub(p, 0xd9); @@ -1925,7 +1925,7 @@ void x87_fst( struct x86_function *p, struct x86_reg dst ) void x87_fstp( struct x86_function *p, struct x86_reg dst ) { DUMP_R( dst ); - if (dst.file == file_x87) + if (dst.file == file_x87) emit_2ub(p, 0xdd, 0xd8 + dst.idx); else { emit_1ub(p, 0xd9); @@ -1943,7 +1943,7 @@ void x87_fpop( struct x86_function *p ) void x87_fcom( struct x86_function *p, struct x86_reg dst ) { DUMP_R( dst ); - if (dst.file == file_x87) + if (dst.file == file_x87) emit_2ub(p, 0xd8, 0xd0 + dst.idx); else { emit_1ub(p, 0xd8); @@ -1955,7 +1955,7 @@ void x87_fcom( struct x86_function *p, struct x86_reg dst ) void x87_fcomp( struct x86_function *p, struct x86_reg dst ) { DUMP_R( dst ); - if (dst.file == file_x87) + if (dst.file == file_x87) emit_2ub(p, 0xd8, 0xd8 + dst.idx); else { emit_1ub(p, 0xd8); @@ -1984,7 +1984,7 @@ void x87_fnstsw( struct x86_function *p, struct x86_reg dst ) assert(dst.file == file_REG32); if (dst.idx == reg_AX && - dst.mod == mod_REG) + dst.mod == mod_REG) emit_2ub(p, 0xdf, 0xe0); else { emit_1ub(p, 0xdd); @@ -2023,7 +2023,7 @@ void mmx_packssdw( struct x86_function *p, struct x86_reg src ) { DUMP_RR( dst, src ); - assert(dst.file == file_MMX && + assert(dst.file == file_MMX && (src.file == file_MMX || src.mod != mod_REG)); p->need_emms = 1; @@ -2037,7 +2037,7 @@ void mmx_packuswb( struct x86_function *p, struct x86_reg src ) { DUMP_RR( dst, src ); - assert(dst.file == file_MMX && + assert(dst.file == file_MMX && (src.file == file_MMX || src.mod != mod_REG)); p->need_emms = 1; diff --git a/src/gallium/auxiliary/tgsi/tgsi_build.c b/src/gallium/auxiliary/tgsi/tgsi_build.c index 16a205f..3d748e1 100644 --- a/src/gallium/auxiliary/tgsi/tgsi_build.c +++ b/src/gallium/auxiliary/tgsi/tgsi_build.c @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ #include "util/u_debug.h" diff --git a/src/gallium/auxiliary/tgsi/tgsi_build.h b/src/gallium/auxiliary/tgsi/tgsi_build.h index 3f236a9..f03d921 100644 --- a/src/gallium/auxiliary/tgsi/tgsi_build.h +++ b/src/gallium/auxiliary/tgsi/tgsi_build.h @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ #ifndef TGSI_BUILD_H diff --git a/src/gallium/auxiliary/tgsi/tgsi_dump.c b/src/gallium/auxiliary/tgsi/tgsi_dump.c index 77bde86..4d3e7bd 100644 --- a/src/gallium/auxiliary/tgsi/tgsi_dump.c +++ b/src/gallium/auxiliary/tgsi/tgsi_dump.c @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2007-2008 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ #include "util/u_debug.h" @@ -44,13 +44,13 @@ struct dump_ctx uint instno; int indent; - + uint indentation; void (*printf)(struct dump_ctx *ctx, const char *format, ...); }; -static void +static void dump_ctx_printf(struct dump_ctx *ctx, const char *format, ...) { va_list ap; @@ -744,7 +744,7 @@ static void str_dump_ctx_printf(struct dump_ctx *ctx, const char *format, ...) { struct str_dump_ctx *sctx = (struct str_dump_ctx *)ctx; - + if(sctx->left > 1) { int written; va_list ap; diff --git a/src/gallium/auxiliary/tgsi/tgsi_dump.h b/src/gallium/auxiliary/tgsi/tgsi_dump.h index fc0429a..dd1b6fb 100644 --- a/src/gallium/auxiliary/tgsi/tgsi_dump.h +++ b/src/gallium/auxiliary/tgsi/tgsi_dump.h @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2007-2008 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ #ifndef TGSI_DUMP_H diff --git a/src/gallium/auxiliary/tgsi/tgsi_exec.c b/src/gallium/auxiliary/tgsi/tgsi_exec.c index 7892a67..dfd0406 100644 --- a/src/gallium/auxiliary/tgsi/tgsi_exec.c +++ b/src/gallium/auxiliary/tgsi/tgsi_exec.c @@ -1,9 +1,9 @@ /************************************************************************** - * + * * Copyright 2007-2008 Tungsten Graphics, Inc., Cedar Park, Texas. * All Rights Reserved. * Copyright 2009-2010 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 @@ -11,11 +11,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. @@ -23,7 +23,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. - * + * **************************************************************************/ /** @@ -619,7 +619,7 @@ tgsi_check_soa_dependencies(const struct tgsi_full_instruction *inst) * allocating temporary storage, setting up constants, etc. * After this, we can call tgsi_exec_machine_run() many times. */ -void +void tgsi_exec_machine_bind_shader( struct tgsi_exec_machine *mach, const struct tgsi_token *tokens, @@ -736,7 +736,7 @@ tgsi_exec_machine_bind_shader( assert( mach->ImmLimit + 1 <= TGSI_EXEC_NUM_IMMEDIATES ); for( i = 0; i < size; i++ ) { - mach->Imms[mach->ImmLimit][i] = + mach->Imms[mach->ImmLimit][i] = parse.FullToken.FullImmediate.u[i].Float; } mach->ImmLimit += 1; diff --git a/src/gallium/auxiliary/tgsi/tgsi_exec.h b/src/gallium/auxiliary/tgsi/tgsi_exec.h index b5ebbfb..3749d3b 100644 --- a/src/gallium/auxiliary/tgsi/tgsi_exec.h +++ b/src/gallium/auxiliary/tgsi/tgsi_exec.h @@ -1,9 +1,9 @@ /************************************************************************** - * + * * Copyright 2007-2008 Tungsten Graphics, Inc., Cedar Park, Texas. * All Rights Reserved. * Copyright 2009-2010 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 @@ -11,11 +11,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. @@ -23,7 +23,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. - * + * **************************************************************************/ #ifndef TGSI_EXEC_H @@ -310,7 +310,7 @@ void tgsi_exec_machine_destroy(struct tgsi_exec_machine *mach); -void +void tgsi_exec_machine_bind_shader( struct tgsi_exec_machine *mach, const struct tgsi_token *tokens, diff --git a/src/gallium/auxiliary/tgsi/tgsi_info.c b/src/gallium/auxiliary/tgsi/tgsi_info.c index e59e964..4de934d 100644 --- a/src/gallium/auxiliary/tgsi/tgsi_info.c +++ b/src/gallium/auxiliary/tgsi/tgsi_info.c @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ #include "util/u_debug.h" @@ -189,7 +189,7 @@ tgsi_get_opcode_info( uint opcode ) for (i = 0; i < Elements(opcode_info); i++) assert(opcode_info[i].opcode == i); } - + if (opcode < TGSI_OPCODE_LAST) return &opcode_info[opcode]; diff --git a/src/gallium/auxiliary/tgsi/tgsi_info.h b/src/gallium/auxiliary/tgsi/tgsi_info.h index 1992d11..35add66 100644 --- a/src/gallium/auxiliary/tgsi/tgsi_info.h +++ b/src/gallium/auxiliary/tgsi/tgsi_info.h @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ #ifndef TGSI_INFO_H diff --git a/src/gallium/auxiliary/tgsi/tgsi_iterate.c b/src/gallium/auxiliary/tgsi/tgsi_iterate.c index 0ba5fe4..82a11ba 100644 --- a/src/gallium/auxiliary/tgsi/tgsi_iterate.c +++ b/src/gallium/auxiliary/tgsi/tgsi_iterate.c @@ -1,5 +1,5 @@ /************************************************************************** - * + * * Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas. * All Rights Reserved. * @@ -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. - * + * **************************************************************************/ #include "util/u_debug.h" diff --git a/src/gallium/auxiliary/tgsi/tgsi_iterate.h b/src/gallium/auxiliary/tgsi/tgsi_iterate.h index 8d67f22..aaf5ead 100644 --- a/src/gallium/auxiliary/tgsi/tgsi_iterate.h +++ b/src/gallium/auxiliary/tgsi/tgsi_iterate.h @@ -1,5 +1,5 @@ /************************************************************************** - * + * * Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas. * All Rights Reserved. * @@ -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. - * + * **************************************************************************/ #ifndef TGSI_ITERATE_H diff --git a/src/gallium/auxiliary/tgsi/tgsi_opcode_tmp.h b/src/gallium/auxiliary/tgsi/tgsi_opcode_tmp.h index b3123ed..067d746 100644 --- a/src/gallium/auxiliary/tgsi/tgsi_opcode_tmp.h +++ b/src/gallium/auxiliary/tgsi/tgsi_opcode_tmp.h @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ #ifndef OP12_TEX #define OP12_TEX(a) OP12(a) diff --git a/src/gallium/auxiliary/tgsi/tgsi_parse.c b/src/gallium/auxiliary/tgsi/tgsi_parse.c index 1891203..705e499 100644 --- a/src/gallium/auxiliary/tgsi/tgsi_parse.c +++ b/src/gallium/auxiliary/tgsi/tgsi_parse.c @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ #include "util/u_debug.h" @@ -316,7 +316,7 @@ tgsi_dump_tokens(const struct tgsi_token *tokens) const unsigned *dwords = (const unsigned *)tokens; int nr = tgsi_num_tokens(tokens); int i; - + assert(sizeof(*tokens) == sizeof(unsigned)); debug_printf("const unsigned tokens[%d] = {\n", nr); diff --git a/src/gallium/auxiliary/tgsi/tgsi_parse.h b/src/gallium/auxiliary/tgsi/tgsi_parse.h index d4df585..c9e1895 100644 --- a/src/gallium/auxiliary/tgsi/tgsi_parse.h +++ b/src/gallium/auxiliary/tgsi/tgsi_parse.h @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ #ifndef TGSI_PARSE_H diff --git a/src/gallium/auxiliary/tgsi/tgsi_ppc.c b/src/gallium/auxiliary/tgsi/tgsi_ppc.c index 3521847..34c908f 100644 --- a/src/gallium/auxiliary/tgsi/tgsi_ppc.c +++ b/src/gallium/auxiliary/tgsi/tgsi_ppc.c @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ /** @@ -51,7 +51,7 @@ * Since it's pretty much impossible to form PPC vector immediates, load * them from memory here: */ -PIPE_ALIGN_VAR(16) const float +PIPE_ALIGN_VAR(16) const float ppc_builtin_constants[] = { 1.0f, -128.0f, 128.0, 0.0 }; @@ -432,7 +432,7 @@ static int get_src_vec(struct gen_context *gen, struct tgsi_full_instruction *inst, int src_reg, uint chan) { - const const struct tgsi_full_src_register *src = + const const struct tgsi_full_src_register *src = &inst->Src[src_reg]; int vec; uint i; @@ -480,7 +480,7 @@ release_src_vecs(struct gen_context *gen) static int -get_dst_vec(struct gen_context *gen, +get_dst_vec(struct gen_context *gen, const struct tgsi_full_instruction *inst, unsigned chan_index) { @@ -984,7 +984,7 @@ emit_log(struct gen_context *gen, struct tgsi_full_instruction *inst) if (IS_DST0_CHANNEL_ENABLED(*inst, CHAN_X)) { emit_store(gen, tmp_vec, inst, CHAN_X, FALSE); } - + /* Compute Y = abs / 2^tmp */ if (IS_DST0_CHANNEL_ENABLED(*inst, CHAN_Y)) { const int zero_vec = ppc_allocate_vec_register(gen->f); @@ -1319,7 +1319,7 @@ tgsi_emit_ppc(const struct tgsi_token *tokens, if (!ok) { uint opcode = parse.FullToken.FullInstruction.Instruction.Opcode; - debug_printf("failed to translate tgsi opcode %d (%s) to PPC (%s)\n", + debug_printf("failed to translate tgsi opcode %d (%s) to PPC (%s)\n", opcode, tgsi_get_opcode_name(opcode), parse.FullHeader.Processor.Processor == TGSI_PROCESSOR_VERTEX ? diff --git a/src/gallium/auxiliary/tgsi/tgsi_ppc.h b/src/gallium/auxiliary/tgsi/tgsi_ppc.h index 829ec07..e00b3ed 100644 --- a/src/gallium/auxiliary/tgsi/tgsi_ppc.h +++ b/src/gallium/auxiliary/tgsi/tgsi_ppc.h @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ #ifndef TGSI_PPC_H diff --git a/src/gallium/auxiliary/tgsi/tgsi_sanity.c b/src/gallium/auxiliary/tgsi/tgsi_sanity.c index acbff10..8574f6c 100644 --- a/src/gallium/auxiliary/tgsi/tgsi_sanity.c +++ b/src/gallium/auxiliary/tgsi/tgsi_sanity.c @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ #include "util/u_debug.h" diff --git a/src/gallium/auxiliary/tgsi/tgsi_sanity.h b/src/gallium/auxiliary/tgsi/tgsi_sanity.h index 73f0f41..f389a59 100644 --- a/src/gallium/auxiliary/tgsi/tgsi_sanity.h +++ b/src/gallium/auxiliary/tgsi/tgsi_sanity.h @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ #ifndef TGSI_SANITY_H diff --git a/src/gallium/auxiliary/tgsi/tgsi_scan.c b/src/gallium/auxiliary/tgsi/tgsi_scan.c index 6585da3..820e219 100644 --- a/src/gallium/auxiliary/tgsi/tgsi_scan.c +++ b/src/gallium/auxiliary/tgsi/tgsi_scan.c @@ -1,5 +1,5 @@ /************************************************************************** - * + * * Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas. * All Rights Reserved. * Copyright 2008 VMware, Inc. All rights Reserved. @@ -11,11 +11,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. @@ -23,7 +23,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. - * + * **************************************************************************/ /** @@ -213,7 +213,7 @@ tgsi_scan_shader(const struct tgsi_token *tokens, /** * Check if the given shader is a "passthrough" shader consisting of only * MOV instructions of the form: MOV OUT[n], IN[n] - * + * */ boolean tgsi_is_passthrough_shader(const struct tgsi_token *tokens) diff --git a/src/gallium/auxiliary/tgsi/tgsi_scan.h b/src/gallium/auxiliary/tgsi/tgsi_scan.h index 104097f..b177d3d 100644 --- a/src/gallium/auxiliary/tgsi/tgsi_scan.h +++ b/src/gallium/auxiliary/tgsi/tgsi_scan.h @@ -1,5 +1,5 @@ /************************************************************************** - * + * * Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas. * All Rights Reserved. * @@ -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. - * + * **************************************************************************/ #ifndef TGSI_SCAN_H diff --git a/src/gallium/auxiliary/tgsi/tgsi_sse2.c b/src/gallium/auxiliary/tgsi/tgsi_sse2.c index 086d983..71b33da 100644 --- a/src/gallium/auxiliary/tgsi/tgsi_sse2.c +++ b/src/gallium/auxiliary/tgsi/tgsi_sse2.c @@ -1,9 +1,9 @@ /************************************************************************** - * + * * Copyright 2007-2008 Tungsten Graphics, Inc., Cedar Park, Texas. * All Rights Reserved. * Copyright 2009-2010 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 @@ -11,11 +11,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. @@ -23,7 +23,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. - * + * **************************************************************************/ #include "pipe/p_config.h" @@ -548,7 +548,7 @@ emit_coef_dady( */ /** - * NOTE: In gcc, if the destination uses the SSE intrinsics, then it must be + * NOTE: In gcc, if the destination uses the SSE intrinsics, then it must be * defined with __attribute__((force_align_arg_pointer)), as we do not guarantee * that the stack pointer is 16 byte aligned, as expected. */ @@ -572,15 +572,15 @@ emit_func_call( x86_push( func, x86_make_reg( file_REG32, reg_DX) ); - + /* Store XMM regs to the stack */ for(i = 0, n = 0; i < 8; ++i) if(xmm_save_mask & (1 << i)) ++n; - + x86_sub_imm( - func, + func, x86_make_reg( file_REG32, reg_SP ), n*16); @@ -601,7 +601,7 @@ emit_func_call( func, ecx, arg[i] ); - + /* Push actual function arguments (currently just the pointer to * the buffer above), and call the function: */ @@ -627,9 +627,9 @@ emit_func_call( x86_make_disp( x86_make_reg( file_REG32, reg_SP ), n*16 ) ); ++n; } - + x86_add_imm( - func, + func, x86_make_reg( file_REG32, reg_SP ), n*16); @@ -649,14 +649,14 @@ emit_func_call( static void emit_func_call_dst_src1( struct x86_function *func, - unsigned xmm_save, + unsigned xmm_save, unsigned xmm_dst, unsigned xmm_src0, void (PIPE_CDECL *code)() ) { struct x86_reg store = get_temp( TEMP_R0, 0 ); unsigned xmm_mask = ((1 << xmm_save) - 1) & ~(1 << xmm_dst); - + /* Store our input parameters (in xmm regs) to the buffer we use * for passing arguments. We will pass a pointer to this buffer as * the actual function argument. @@ -682,7 +682,7 @@ emit_func_call_dst_src1( static void emit_func_call_dst_src2( struct x86_function *func, - unsigned xmm_save, + unsigned xmm_save, unsigned xmm_dst, unsigned xmm_src0, unsigned xmm_src1, @@ -743,7 +743,7 @@ emit_func_call_dst_src2( /** * See http://www.devmaster.net/forums/showthread.php?p=43580 */ -static INLINE __m128 +static INLINE __m128 exp2f4(__m128 x) { __m128i ipart; @@ -781,7 +781,7 @@ exp2f4(__m128 x) /** * See http://www.devmaster.net/forums/showthread.php?p=43580 */ -static INLINE __m128 +static INLINE __m128 log2f4(__m128 x) { __m128i expmask = _mm_set1_epi32(0x7f800000); @@ -798,8 +798,8 @@ log2f4(__m128 x) __m128 logmant; - /* Minimax polynomial fit of log2(x)/(x - 1), for x in range [1, 2[ - * These coefficients can be generate with + /* Minimax polynomial fit of log2(x)/(x - 1), for x in range [1, 2[ + * These coefficients can be generate with * http://www.boost.org/doc/libs/1_36_0/libs/math/doc/sf_and_dist/html/math_toolkit/toolkit/internals2/minimax.html */ #if LOG_POLY_DEGREE == 6 @@ -873,12 +873,12 @@ cos4f( static void emit_cos( struct x86_function *func, - unsigned xmm_save, + unsigned xmm_save, unsigned xmm_dst ) { emit_func_call_dst_src1( func, - xmm_save, + xmm_save, xmm_dst, xmm_dst, cos4f ); @@ -904,7 +904,7 @@ ex24f( static void emit_ex2( struct x86_function *func, - unsigned xmm_save, + unsigned xmm_save, unsigned xmm_dst ) { emit_func_call_dst_src1( @@ -950,7 +950,7 @@ flr4f( static void emit_flr( struct x86_function *func, - unsigned xmm_save, + unsigned xmm_save, unsigned xmm_dst ) { emit_func_call_dst_src1( @@ -974,7 +974,7 @@ frc4f( static void emit_frc( struct x86_function *func, - unsigned xmm_save, + unsigned xmm_save, unsigned xmm_dst ) { emit_func_call_dst_src1( @@ -1005,7 +1005,7 @@ lg24f( static void emit_lg2( struct x86_function *func, - unsigned xmm_save, + unsigned xmm_save, unsigned xmm_dst ) { emit_func_call_dst_src1( @@ -1072,7 +1072,7 @@ pow4f( static void emit_pow( struct x86_function *func, - unsigned xmm_save, + unsigned xmm_save, unsigned xmm_dst, unsigned xmm_src0, unsigned xmm_src1 ) @@ -1115,7 +1115,7 @@ rnd4f( static void emit_rnd( struct x86_function *func, - unsigned xmm_save, + unsigned xmm_save, unsigned xmm_dst ) { emit_func_call_dst_src1( @@ -1136,7 +1136,7 @@ emit_rsqrt( /* Although rsqrtps() and rcpps() are low precision on some/all SSE * implementations, it is possible to improve its precision at * fairly low cost, using a newton/raphson step, as below: - * + * * x1 = 2 * rcpps(a) - a * rcpps(a) * rcpps(a) * x1 = 0.5 * rsqrtps(a) * [3.0 - (a * rsqrtps(a))* rsqrtps(a)] * @@ -1198,7 +1198,7 @@ sgn4f( static void emit_sgn( struct x86_function *func, - unsigned xmm_save, + unsigned xmm_save, unsigned xmm_dst ) { emit_func_call_dst_src1( @@ -1221,7 +1221,7 @@ sin4f( static void emit_sin (struct x86_function *func, - unsigned xmm_save, + unsigned xmm_save, unsigned xmm_dst) { emit_func_call_dst_src1( @@ -1406,14 +1406,14 @@ fetch_texel( struct tgsi_sampler **sampler, #if 0 uint j; - debug_printf("%s sampler: %p (%p) store: %p\n", + debug_printf("%s sampler: %p (%p) store: %p\n", __FUNCTION__, sampler, *sampler, store ); for (j = 0; j < 4; j++) debug_printf("sample %d texcoord %f %f %f lodbias %f\n", - j, + j, store[0+j], store[4+j], store[8 + j], @@ -1422,7 +1422,7 @@ fetch_texel( struct tgsi_sampler **sampler, { float rgba[NUM_CHANNELS][QUAD_SIZE]; - (*sampler)->get_samples(*sampler, + (*sampler)->get_samples(*sampler, &store[0], /* s */ &store[4], /* t */ &store[8], /* r */ @@ -1435,8 +1435,8 @@ fetch_texel( struct tgsi_sampler **sampler, #if 0 for (j = 0; j < 4; j++) - debug_printf("sample %d result %f %f %f %f\n", - j, + debug_printf("sample %d result %f %f %f %f\n", + j, store[0+j], store[4+j], store[8+j], @@ -1513,7 +1513,7 @@ emit_tex( struct x86_function *func, make_xmm( i ), make_xmm( 3 ) ); } - + /* Store in the argument buffer: */ sse_movaps( @@ -1600,7 +1600,7 @@ emit_kil( TGSI_EXEC_TEMP_00000000_I, TGSI_EXEC_TEMP_00000000_C ), cc_LessThan ); - + if( i == 0 ) { sse_movmskps( func, @@ -2530,7 +2530,7 @@ emit_instruction( case TGSI_OPCODE_TXP: emit_tex( func, inst, FALSE, TRUE ); break; - + case TGSI_OPCODE_BRK: return 0; break; @@ -2627,7 +2627,7 @@ emit_instruction( default: return 0; } - + return 1; } @@ -2693,10 +2693,10 @@ emit_declaration( } } -static void aos_to_soa( struct x86_function *func, +static void aos_to_soa( struct x86_function *func, uint arg_aos, - uint arg_machine, - uint arg_num, + uint arg_machine, + uint arg_num, uint arg_stride ) { struct x86_reg soa_input = x86_make_reg( file_REG32, reg_AX ); @@ -2710,8 +2710,8 @@ static void aos_to_soa( struct x86_function *func, x86_mov( func, aos_input, x86_fn_arg( func, arg_aos ) ); x86_mov( func, soa_input, x86_fn_arg( func, arg_machine ) ); - x86_lea( func, soa_input, - x86_make_disp( soa_input, + x86_lea( func, soa_input, + x86_make_disp( soa_input, Offset(struct tgsi_exec_machine, Inputs) ) ); x86_mov( func, num_inputs, x86_fn_arg( func, arg_num ) ); x86_mov( func, stride, x86_fn_arg( func, arg_stride ) ); @@ -2761,10 +2761,10 @@ static void aos_to_soa( struct x86_function *func, x86_pop( func, x86_make_reg( file_REG32, reg_BX ) ); } -static void soa_to_aos( struct x86_function *func, - uint arg_aos, - uint arg_machine, - uint arg_num, +static void soa_to_aos( struct x86_function *func, + uint arg_aos, + uint arg_machine, + uint arg_num, uint arg_stride ) { struct x86_reg soa_output = x86_make_reg( file_REG32, reg_AX ); @@ -2778,8 +2778,8 @@ static void soa_to_aos( struct x86_function *func, x86_mov( func, aos_output, x86_fn_arg( func, arg_aos ) ); x86_mov( func, soa_output, x86_fn_arg( func, arg_machine ) ); - x86_lea( func, soa_output, - x86_make_disp( soa_output, + x86_lea( func, soa_output, + x86_make_disp( soa_output, Offset(struct tgsi_exec_machine, Outputs) ) ); x86_mov( func, num_outputs, x86_fn_arg( func, arg_num ) ); @@ -2916,7 +2916,7 @@ tgsi_emit_sse2( */ if (parse.FullHeader.Processor.Processor == TGSI_PROCESSOR_VERTEX) { if (do_swizzles) - aos_to_soa( func, + aos_to_soa( func, 4, /* aos_input */ 1, /* machine */ 5, /* num_inputs */ @@ -2969,7 +2969,7 @@ tgsi_emit_sse2( if (!ok) { uint opcode = parse.FullToken.FullInstruction.Instruction.Opcode; uint proc = parse.FullHeader.Processor.Processor; - debug_printf("failed to translate tgsi opcode %d (%s) to SSE (%s)\n", + debug_printf("failed to translate tgsi opcode %d (%s) to SSE (%s)\n", opcode, tgsi_get_opcode_name(opcode), tgsi_get_processor_name(proc)); @@ -3013,7 +3013,7 @@ tgsi_emit_sse2( if (parse.FullHeader.Processor.Processor == TGSI_PROCESSOR_VERTEX) { if (do_swizzles) - soa_to_aos( func, + soa_to_aos( func, 7, /* aos_output */ 1, /* machine */ 8, /* num_outputs */ diff --git a/src/gallium/auxiliary/tgsi/tgsi_sse2.h b/src/gallium/auxiliary/tgsi/tgsi_sse2.h index 00aa8b8..219324d 100644 --- a/src/gallium/auxiliary/tgsi/tgsi_sse2.h +++ b/src/gallium/auxiliary/tgsi/tgsi_sse2.h @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ #ifndef TGSI_SSE2_H diff --git a/src/gallium/auxiliary/tgsi/tgsi_text.c b/src/gallium/auxiliary/tgsi/tgsi_text.c index 9a38c37..0fd5c5d 100644 --- a/src/gallium/auxiliary/tgsi/tgsi_text.c +++ b/src/gallium/auxiliary/tgsi/tgsi_text.c @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ #include "util/u_debug.h" diff --git a/src/gallium/auxiliary/tgsi/tgsi_text.h b/src/gallium/auxiliary/tgsi/tgsi_text.h index 8eeeeef..eefdac5 100644 --- a/src/gallium/auxiliary/tgsi/tgsi_text.h +++ b/src/gallium/auxiliary/tgsi/tgsi_text.h @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ #ifndef TGSI_TEXT_H diff --git a/src/gallium/auxiliary/tgsi/tgsi_transform.c b/src/gallium/auxiliary/tgsi/tgsi_transform.c index ae875f2..c5d891e 100644 --- a/src/gallium/auxiliary/tgsi/tgsi_transform.c +++ b/src/gallium/auxiliary/tgsi/tgsi_transform.c @@ -1,5 +1,5 @@ /************************************************************************** - * + * * Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas. * All Rights Reserved. * @@ -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. - * + * **************************************************************************/ /** @@ -237,13 +237,13 @@ int tgsi_transform_foo( struct tgsi_token *tokens_out, uint max_tokens_out ) { - const char *text = + const char *text = "FRAG\n" "DCL IN[0], COLOR, CONSTANT\n" "DCL OUT[0], COLOR\n" " 0: MOV OUT[0], IN[0]\n" " 1: END"; - + return tgsi_text_translate( text, tokens_out, max_tokens_out ); diff --git a/src/gallium/auxiliary/tgsi/tgsi_transform.h b/src/gallium/auxiliary/tgsi/tgsi_transform.h index 818478e..ff57ded 100644 --- a/src/gallium/auxiliary/tgsi/tgsi_transform.h +++ b/src/gallium/auxiliary/tgsi/tgsi_transform.h @@ -1,5 +1,5 @@ /************************************************************************** - * + * * Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas. * All Rights Reserved. * @@ -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. - * + * **************************************************************************/ #ifndef TGSI_TRANSFORM_H diff --git a/src/gallium/auxiliary/tgsi/tgsi_ureg.c b/src/gallium/auxiliary/tgsi/tgsi_ureg.c index 7d13a17..e1a3d94 100644 --- a/src/gallium/auxiliary/tgsi/tgsi_ureg.c +++ b/src/gallium/auxiliary/tgsi/tgsi_ureg.c @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2009 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. - * + * **************************************************************************/ @@ -182,7 +182,7 @@ static void tokens_expand( struct ureg_tokens *tokens, tokens->size = (1 << ++tokens->order); } - tokens->tokens = REALLOC(tokens->tokens, + tokens->tokens = REALLOC(tokens->tokens, old_size, tokens->size * sizeof(unsigned)); if (tokens->tokens == NULL) { @@ -204,7 +204,7 @@ static union tgsi_any_token *get_tokens( struct ureg_program *ureg, struct ureg_tokens *tokens = &ureg->domain[domain]; union tgsi_any_token *result; - if (tokens->count + count > tokens->size) + if (tokens->count + count > tokens->size) tokens_expand(tokens, count); result = &tokens->tokens[tokens->count]; @@ -319,12 +319,12 @@ ureg_DECL_fs_input_cyl_centroid(struct ureg_program *ureg, } -struct ureg_src +struct ureg_src ureg_DECL_vs_input( struct ureg_program *ureg, unsigned index ) { assert(ureg->processor == TGSI_PROCESSOR_VERTEX); - + ureg->vs_inputs[index/32] |= 1 << (index % 32); return ureg_src_register( TGSI_FILE_INPUT, index ); } @@ -369,7 +369,7 @@ ureg_DECL_system_value(struct ureg_program *ureg, } -struct ureg_dst +struct ureg_dst ureg_DECL_output( struct ureg_program *ureg, unsigned name, unsigned index ) @@ -378,7 +378,7 @@ ureg_DECL_output( struct ureg_program *ureg, for (i = 0; i < ureg->nr_outputs; i++) { if (ureg->output[i].semantic_name == name && - ureg->output[i].semantic_index == index) + ureg->output[i].semantic_index == index) goto out; } @@ -561,7 +561,7 @@ struct ureg_src ureg_DECL_sampler( struct ureg_program *ureg, for (i = 0; i < ureg->nr_samplers; i++) if (ureg->sampler[i].Index == nr) return ureg->sampler[i]; - + if (i < PIPE_MAX_SAMPLERS) { ureg->sampler[i] = ureg_src_register( TGSI_FILE_SAMPLER, nr ); ureg->nr_samplers++; @@ -748,7 +748,7 @@ ureg_emit_src( struct ureg_program *ureg, assert(src.File != TGSI_FILE_NULL); assert(src.File != TGSI_FILE_OUTPUT); assert(src.File < TGSI_FILE_COUNT); - + out[n].value = 0; out[n].src.File = src.File; out[n].src.SwizzleX = src.SwizzleX; @@ -801,11 +801,11 @@ ureg_emit_src( struct ureg_program *ureg, } -void +void ureg_emit_dst( struct ureg_program *ureg, struct ureg_dst dst ) { - unsigned size = (1 + + unsigned size = (1 + (dst.Indirect ? 1 : 0)); union tgsi_any_token *out = get_tokens( ureg, DOMAIN_INSN, size ); @@ -817,14 +817,14 @@ ureg_emit_dst( struct ureg_program *ureg, assert(dst.File != TGSI_FILE_SAMPLER); assert(dst.File != TGSI_FILE_IMMEDIATE); assert(dst.File < TGSI_FILE_COUNT); - + out[n].value = 0; out[n].dst.File = dst.File; out[n].dst.WriteMask = dst.WriteMask; out[n].dst.Indirect = dst.Indirect; out[n].dst.Index = dst.Index; n++; - + if (dst.Indirect) { out[n].value = 0; out[n].src.File = TGSI_FILE_ADDRESS; @@ -872,7 +872,7 @@ ureg_emit_insn(struct ureg_program *ureg, struct ureg_emit_insn_result result; validate( opcode, num_dst, num_src ); - + out = get_tokens( ureg, DOMAIN_INSN, count ); out[0].insn = tgsi_default_instruction(); out[0].insn.Opcode = opcode; @@ -1322,7 +1322,7 @@ static void emit_decls( struct ureg_program *ureg ) } for (i = 0; i < ureg->nr_samplers; i++) { - emit_decl_range( ureg, + emit_decl_range( ureg, TGSI_FILE_SAMPLER, ureg->sampler[i].Index, 1 ); } @@ -1384,12 +1384,12 @@ static void emit_decls( struct ureg_program *ureg ) static void copy_instructions( struct ureg_program *ureg ) { unsigned nr_tokens = ureg->domain[DOMAIN_INSN].count; - union tgsi_any_token *out = get_tokens( ureg, - DOMAIN_DECL, + union tgsi_any_token *out = get_tokens( ureg, + DOMAIN_DECL, nr_tokens ); - memcpy(out, - ureg->domain[DOMAIN_INSN].tokens, + memcpy(out, + ureg->domain[DOMAIN_INSN].tokens, nr_tokens * sizeof out[0] ); } @@ -1424,7 +1424,7 @@ const struct tgsi_token *ureg_finalize( struct ureg_program *ureg ) emit_decls( ureg ); copy_instructions( ureg ); fixup_header_size( ureg ); - + if (ureg->domain[0].tokens == error_tokens || ureg->domain[1].tokens == error_tokens) { debug_printf("%s: error in generated shader\n", __FUNCTION__); @@ -1435,7 +1435,7 @@ const struct tgsi_token *ureg_finalize( struct ureg_program *ureg ) tokens = &ureg->domain[DOMAIN_DECL].tokens[0].token; if (0) { - debug_printf("%s: emitted shader %d tokens:\n", __FUNCTION__, + debug_printf("%s: emitted shader %d tokens:\n", __FUNCTION__, ureg->domain[DOMAIN_DECL].count); tgsi_dump( tokens, 0 ); } @@ -1448,7 +1448,7 @@ const struct tgsi_token *ureg_finalize( struct ureg_program *ureg ) } #endif - + return tokens; } @@ -1478,7 +1478,7 @@ const struct tgsi_token *ureg_get_tokens( struct ureg_program *ureg, tokens = &ureg->domain[DOMAIN_DECL].tokens[0].token; - if (nr_tokens) + if (nr_tokens) *nr_tokens = ureg->domain[DOMAIN_DECL].size; ureg->domain[DOMAIN_DECL].tokens = 0; @@ -1515,10 +1515,10 @@ void ureg_destroy( struct ureg_program *ureg ) unsigned i; for (i = 0; i < Elements(ureg->domain); i++) { - if (ureg->domain[i].tokens && + if (ureg->domain[i].tokens && ureg->domain[i].tokens != error_tokens) FREE(ureg->domain[i].tokens); } - + FREE(ureg); } diff --git a/src/gallium/auxiliary/tgsi/tgsi_ureg.h b/src/gallium/auxiliary/tgsi/tgsi_ureg.h index acc4632..126262c 100644 --- a/src/gallium/auxiliary/tgsi/tgsi_ureg.h +++ b/src/gallium/auxiliary/tgsi/tgsi_ureg.h @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2009 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. - * + * **************************************************************************/ #ifndef TGSI_UREG_H @@ -35,7 +35,7 @@ #ifdef __cplusplus extern "C" { #endif - + struct ureg_program; /* Almost a tgsi_src_register, but we need to pull in the Absolute @@ -112,7 +112,7 @@ ureg_get_tokens( struct ureg_program *ureg, void ureg_free_tokens( const struct tgsi_token *tokens ); -void +void ureg_destroy( struct ureg_program * ); @@ -247,7 +247,7 @@ ureg_DECL_constant( struct ureg_program *, struct ureg_dst ureg_DECL_temporary( struct ureg_program * ); -void +void ureg_release_temporary( struct ureg_program *ureg, struct ureg_dst tmp ); @@ -482,11 +482,11 @@ ureg_emit_texture(struct ureg_program *ureg, unsigned insn_token, unsigned target ); -void +void ureg_emit_dst( struct ureg_program *ureg, struct ureg_dst dst ); -void +void ureg_emit_src( struct ureg_program *ureg, struct ureg_src src ); @@ -738,7 +738,7 @@ static INLINE void ureg_##op( struct ureg_program *ureg, \ /*********************************************************************** * Inline helpers for manipulating register structs: */ -static INLINE struct ureg_src +static INLINE struct ureg_src ureg_negate( struct ureg_src reg ) { assert(reg.File != TGSI_FILE_NULL); @@ -755,8 +755,8 @@ ureg_abs( struct ureg_src reg ) return reg; } -static INLINE struct ureg_src -ureg_swizzle( struct ureg_src reg, +static INLINE struct ureg_src +ureg_swizzle( struct ureg_src reg, int x, int y, int z, int w ) { unsigned swz = ( (reg.SwizzleX << 0) | @@ -783,7 +783,7 @@ ureg_scalar( struct ureg_src reg, int x ) return ureg_swizzle(reg, x, x, x, x); } -static INLINE struct ureg_dst +static INLINE struct ureg_dst ureg_writemask( struct ureg_dst reg, unsigned writemask ) { @@ -792,7 +792,7 @@ ureg_writemask( struct ureg_dst reg, return reg; } -static INLINE struct ureg_dst +static INLINE struct ureg_dst ureg_saturate( struct ureg_dst reg ) { assert(reg.File != TGSI_FILE_NULL); @@ -818,7 +818,7 @@ ureg_predicate(struct ureg_dst reg, return reg; } -static INLINE struct ureg_dst +static INLINE struct ureg_dst ureg_dst_indirect( struct ureg_dst reg, struct ureg_src addr ) { assert(reg.File != TGSI_FILE_NULL); @@ -829,7 +829,7 @@ ureg_dst_indirect( struct ureg_dst reg, struct ureg_src addr ) return reg; } -static INLINE struct ureg_src +static INLINE struct ureg_src ureg_src_indirect( struct ureg_src reg, struct ureg_src addr ) { assert(reg.File != TGSI_FILE_NULL); diff --git a/src/gallium/auxiliary/tgsi/tgsi_util.c b/src/gallium/auxiliary/tgsi/tgsi_util.c index 08e7e89..d156e3e 100644 --- a/src/gallium/auxiliary/tgsi/tgsi_util.c +++ b/src/gallium/auxiliary/tgsi/tgsi_util.c @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ #include "util/u_debug.h" diff --git a/src/gallium/auxiliary/tgsi/tgsi_util.h b/src/gallium/auxiliary/tgsi/tgsi_util.h index 04702ba..aad4758 100644 --- a/src/gallium/auxiliary/tgsi/tgsi_util.h +++ b/src/gallium/auxiliary/tgsi/tgsi_util.h @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ #ifndef TGSI_UTIL_H diff --git a/src/gallium/auxiliary/translate/translate.c b/src/gallium/auxiliary/translate/translate.c index 73287b6..463b2de 100644 --- a/src/gallium/auxiliary/translate/translate.c +++ b/src/gallium/auxiliary/translate/translate.c @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ /* diff --git a/src/gallium/auxiliary/translate/translate.h b/src/gallium/auxiliary/translate/translate.h index 850ef39..fd68b12 100644 --- a/src/gallium/auxiliary/translate/translate.h +++ b/src/gallium/auxiliary/translate/translate.h @@ -49,7 +49,7 @@ enum translate_element_type { TRANSLATE_ELEMENT_INSTANCE_ID }; -struct translate_element +struct translate_element { enum translate_element_type type; enum pipe_format input_format; diff --git a/src/gallium/auxiliary/translate/translate_generic.c b/src/gallium/auxiliary/translate/translate_generic.c index ad809db..4c84fab 100644 --- a/src/gallium/auxiliary/translate/translate_generic.c +++ b/src/gallium/auxiliary/translate/translate_generic.c @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ /* @@ -59,7 +59,7 @@ struct translate_generic { emit_func emit; unsigned output_offset; - + const uint8_t *input_ptr; unsigned input_stride; unsigned max_index; @@ -215,7 +215,7 @@ emit_B8G8R8A8_UNORM( const float *attrib, void *ptr) out[3] = TO_8_UNORM(attrib[3]); } -static void +static void emit_NULL( const float *attrib, void *ptr ) { /* do nothing is the only sensible option */ @@ -357,7 +357,7 @@ static emit_func get_emit_func( enum pipe_format format ) return &emit_A8R8G8B8_UNORM; default: - assert(0); + assert(0); return &emit_NULL; } } @@ -490,7 +490,7 @@ static void PIPE_CDECL generic_run( struct translate *translate, } - + static void generic_set_buffer( struct translate *translate, unsigned buf, const void *ptr, diff --git a/src/gallium/auxiliary/translate/translate_sse.c b/src/gallium/auxiliary/translate/translate_sse.c index ef7f4be..7f77a32 100644 --- a/src/gallium/auxiliary/translate/translate_sse.c +++ b/src/gallium/auxiliary/translate/translate_sse.c @@ -1143,10 +1143,10 @@ static struct x86_reg get_buffer_ptr( struct translate_sse *p, } else if (!index_size || p->buffer_varient[var_idx].instance_divisor) { struct x86_reg ptr = p->src_ECX; - struct x86_reg buf_ptr = + struct x86_reg buf_ptr = x86_make_disp(p->machine_EDI, get_offset(p, &p->buffer_varient[var_idx].ptr)); - + x64_rexw(p->func); x86_mov(p->func, ptr, buf_ptr); return ptr; @@ -1155,11 +1155,11 @@ static struct x86_reg get_buffer_ptr( struct translate_sse *p, struct x86_reg ptr = p->src_ECX; const struct translate_buffer_varient *varient = &p->buffer_varient[var_idx]; - struct x86_reg buf_stride = + struct x86_reg buf_stride = x86_make_disp(p->machine_EDI, get_offset(p, &p->buffer[varient->buffer_index].stride)); - struct x86_reg buf_base_ptr = + struct x86_reg buf_base_ptr = x86_make_disp(p->machine_EDI, get_offset(p, &p->buffer[varient->buffer_index].base_ptr)); @@ -1188,7 +1188,7 @@ static struct x86_reg get_buffer_ptr( struct translate_sse *p, -static boolean incr_inputs( struct translate_sse *p, +static boolean incr_inputs( struct translate_sse *p, unsigned index_size ) { if (!index_size && p->nr_buffer_varients == 1) { @@ -1222,12 +1222,12 @@ static boolean incr_inputs( struct translate_sse *p, x86_mov(p->func, buf_ptr, p->tmp_EAX); } } - } + } else { x64_rexw(p->func); x86_lea(p->func, p->idx_ESI, x86_make_disp(p->idx_ESI, index_size)); } - + return TRUE; } @@ -1245,8 +1245,8 @@ static boolean incr_inputs( struct translate_sse *p, * Lots of hardcoding * * EAX -- pointer to current output vertex - * ECX -- pointer to current attribute - * + * ECX -- pointer to current attribute + * */ static boolean build_vertex_emit( struct translate_sse *p, struct x86_function *func, @@ -1336,9 +1336,9 @@ static boolean build_vertex_emit( struct translate_sse *p, last_varient = varient; vb = get_buffer_ptr(p, index_size, varient, elt); } - - if (!translate_attr( p, a, - x86_make_disp(vb, a->input_offset), + + if (!translate_attr( p, a, + x86_make_disp(vb, a->input_offset), x86_make_disp(p->outbuf_EBX, a->output_offset))) return FALSE; } @@ -1346,13 +1346,13 @@ static boolean build_vertex_emit( struct translate_sse *p, /* Next output vertex: */ x64_rexw(p->func); - x86_lea(p->func, + x86_lea(p->func, p->outbuf_EBX, x86_make_disp(p->outbuf_EBX, p->translate.key.output_stride)); /* Incr index - */ + */ incr_inputs( p, index_size ); } @@ -1372,7 +1372,7 @@ static boolean build_vertex_emit( struct translate_sse *p, /* Pop regs and return */ - + if(x86_target(p->func) != X86_64_STD_ABI) { x86_pop(p->func, p->idx_ESI); @@ -1397,7 +1397,7 @@ static boolean build_vertex_emit( struct translate_sse *p, - + static void translate_sse_set_buffer( struct translate *translate, unsigned buf, const void *ptr, @@ -1412,9 +1412,9 @@ static void translate_sse_set_buffer( struct translate *translate, p->buffer[buf].max_index = max_index; } - if (0) debug_printf("%s %d/%d: %p %d\n", - __FUNCTION__, buf, - p->nr_buffers, + if (0) debug_printf("%s %d/%d: %p %d\n", + __FUNCTION__, buf, + p->nr_buffers, ptr, stride); } @@ -1440,7 +1440,7 @@ struct translate *translate_sse2_create( const struct translate_key *key ) goto fail; p = os_malloc_aligned(sizeof(struct translate_sse), 16); - if (p == NULL) + if (p == NULL) goto fail; memset(p, 0, sizeof(*p)); memcpy(p->consts, consts, sizeof(consts)); diff --git a/src/gallium/auxiliary/util/u_atomic.h b/src/gallium/auxiliary/util/u_atomic.h index 8434491..d791ff9 100644 --- a/src/gallium/auxiliary/util/u_atomic.h +++ b/src/gallium/auxiliary/util/u_atomic.h @@ -26,7 +26,7 @@ #elif defined(PIPE_CC_MSVC) #define PIPE_ATOMIC_MSVC_INTRINSIC #elif (defined(PIPE_CC_MSVC) && defined(PIPE_ARCH_X86)) -#define PIPE_ATOMIC_ASM_MSVC_X86 +#define PIPE_ATOMIC_ASM_MSVC_X86 #elif (defined(PIPE_CC_GCC) && defined(PIPE_ARCH_X86)) #define PIPE_ATOMIC_ASM_GCC_X86 #elif (defined(PIPE_CC_GCC) && defined(PIPE_ARCH_X86_64)) @@ -180,7 +180,7 @@ p_atomic_cmpxchg(int32_t *v, int32_t old, int32_t _new) /* Unlocked version for single threaded environments, such as some * windows kernel modules. */ -#if defined(PIPE_ATOMIC_OS_UNLOCKED) +#if defined(PIPE_ATOMIC_OS_UNLOCKED) #define PIPE_ATOMIC "Unlocked" diff --git a/src/gallium/auxiliary/util/u_bitmask.c b/src/gallium/auxiliary/util/u_bitmask.c index 23c93a3..b5c88f7 100644 --- a/src/gallium/auxiliary/util/u_bitmask.c +++ b/src/gallium/auxiliary/util/u_bitmask.c @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2009 VMware, Inc. * All Rights Reserved. - * + * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including @@ -10,11 +10,11 @@ * distribute, sub license, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: - * + * * The above copyright notice and this permission notice (including the * next paragraph) shall be included in all copies or substantial portions * of the Software. - * + * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. @@ -22,13 +22,13 @@ * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * + * **************************************************************************/ /** * @file * Generic bitmask implementation. - * + * * @author Jose Fonseca */ @@ -40,7 +40,7 @@ #include "util/u_bitmask.h" -typedef uint32_t util_bitmask_word; +typedef uint32_t util_bitmask_word; #define UTIL_BITMASK_INITIAL_WORDS 16 @@ -51,10 +51,10 @@ typedef uint32_t util_bitmask_word; struct util_bitmask { util_bitmask_word *words; - + /** Number of bits we can currently hold */ unsigned size; - + /** Number of consecutive bits set at the start of the bitmask */ unsigned filled; }; @@ -64,26 +64,26 @@ struct util_bitmask * util_bitmask_create(void) { struct util_bitmask *bm; - + bm = MALLOC_STRUCT(util_bitmask); if(!bm) return NULL; - + bm->words = (util_bitmask_word *)CALLOC(UTIL_BITMASK_INITIAL_WORDS, sizeof(util_bitmask_word)); if(!bm->words) { FREE(bm); return NULL; } - + bm->size = UTIL_BITMASK_INITIAL_WORDS * UTIL_BITMASK_BITS_PER_WORD; bm->filled = 0; - + return bm; } /** - * Resize the bitmask if necessary + * Resize the bitmask if necessary */ static INLINE boolean util_bitmask_resize(struct util_bitmask *bm, @@ -96,7 +96,7 @@ util_bitmask_resize(struct util_bitmask *bm, /* Check integer overflow */ if(!minimum_size) return FALSE; - + if(bm->size >= minimum_size) return TRUE; @@ -110,20 +110,20 @@ util_bitmask_resize(struct util_bitmask *bm, } assert(new_size); assert(new_size % UTIL_BITMASK_BITS_PER_WORD == 0); - + new_words = (util_bitmask_word *)REALLOC((void *)bm->words, bm->size / UTIL_BITMASK_BITS_PER_BYTE, new_size / UTIL_BITMASK_BITS_PER_BYTE); if(!new_words) return FALSE; - - memset(new_words + bm->size/UTIL_BITMASK_BITS_PER_WORD, - 0, + + memset(new_words + bm->size/UTIL_BITMASK_BITS_PER_WORD, + 0, (new_size - bm->size)/UTIL_BITMASK_BITS_PER_BYTE); - + bm->size = new_size; bm->words = new_words; - + return TRUE; } @@ -137,7 +137,7 @@ util_bitmask_filled_set(struct util_bitmask *bm, { assert(bm->filled <= bm->size); assert(index < bm->size); - + if(index == bm->filled) { ++bm->filled; assert(bm->filled <= bm->size); @@ -150,7 +150,7 @@ util_bitmask_filled_unset(struct util_bitmask *bm, { assert(bm->filled <= bm->size); assert(index < bm->size); - + if(index < bm->filled) bm->filled = index; } @@ -162,7 +162,7 @@ util_bitmask_add(struct util_bitmask *bm) unsigned word; unsigned bit; util_bitmask_word mask; - + assert(bm); /* linear search for an empty index */ @@ -195,15 +195,15 @@ util_bitmask_add(struct util_bitmask *bm) unsigned -util_bitmask_set(struct util_bitmask *bm, +util_bitmask_set(struct util_bitmask *bm, unsigned index) { unsigned word; unsigned bit; util_bitmask_word mask; - + assert(bm); - + /* grow the bitmask if necessary */ if(!util_bitmask_resize(bm, index)) return UTIL_BITMASK_INVALID_INDEX; @@ -215,21 +215,21 @@ util_bitmask_set(struct util_bitmask *bm, bm->words[word] |= mask; util_bitmask_filled_set(bm, index); - + return index; } void -util_bitmask_clear(struct util_bitmask *bm, +util_bitmask_clear(struct util_bitmask *bm, unsigned index) { unsigned word; unsigned bit; util_bitmask_word mask; - + assert(bm); - + if(index >= bm->size) return; @@ -238,21 +238,21 @@ util_bitmask_clear(struct util_bitmask *bm, mask = 1 << bit; bm->words[word] &= ~mask; - + util_bitmask_filled_unset(bm, index); } boolean -util_bitmask_get(struct util_bitmask *bm, +util_bitmask_get(struct util_bitmask *bm, unsigned index) { unsigned word = index / UTIL_BITMASK_BITS_PER_WORD; unsigned bit = index % UTIL_BITMASK_BITS_PER_WORD; util_bitmask_word mask = 1 << bit; - + assert(bm); - + if(index < bm->filled) { assert(bm->words[word] & mask); return TRUE; @@ -271,7 +271,7 @@ util_bitmask_get(struct util_bitmask *bm, unsigned -util_bitmask_get_next_index(struct util_bitmask *bm, +util_bitmask_get_next_index(struct util_bitmask *bm, unsigned index) { unsigned word = index / UTIL_BITMASK_BITS_PER_WORD; @@ -305,7 +305,7 @@ util_bitmask_get_next_index(struct util_bitmask *bm, bit = 0; mask = 1; } - + return UTIL_BITMASK_INVALID_INDEX; } diff --git a/src/gallium/auxiliary/util/u_bitmask.h b/src/gallium/auxiliary/util/u_bitmask.h index 98b85dd..f076968 100644 --- a/src/gallium/auxiliary/util/u_bitmask.h +++ b/src/gallium/auxiliary/util/u_bitmask.h @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2009 VMware, Inc. * All Rights Reserved. - * + * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including @@ -10,11 +10,11 @@ * distribute, sub license, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: - * + * * The above copyright notice and this permission notice (including the * next paragraph) shall be included in all copies or substantial portions * of the Software. - * + * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. @@ -22,13 +22,13 @@ * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * + * **************************************************************************/ /** * @file * Generic bitmask. - * + * * @author Jose Fonseca */ @@ -45,8 +45,8 @@ extern "C" { #define UTIL_BITMASK_INVALID_INDEX (~0U) - - + + /** * Abstract data type to represent arbitrary set of bits. */ @@ -59,10 +59,10 @@ util_bitmask_create(void); /** * Search a cleared bit and set it. - * + * * It searches for the first cleared bit. - * - * Returns the bit index on success, or UTIL_BITMASK_INVALID_INDEX on out of + * + * Returns the bit index on success, or UTIL_BITMASK_INVALID_INDEX on out of * memory growing the bitmask. */ unsigned @@ -70,20 +70,20 @@ util_bitmask_add(struct util_bitmask *bm); /** * Set a bit. - * - * Returns the input index on success, or UTIL_BITMASK_INVALID_INDEX on out of + * + * Returns the input index on success, or UTIL_BITMASK_INVALID_INDEX on out of * memory growing the bitmask. */ unsigned -util_bitmask_set(struct util_bitmask *bm, +util_bitmask_set(struct util_bitmask *bm, unsigned index); void -util_bitmask_clear(struct util_bitmask *bm, +util_bitmask_clear(struct util_bitmask *bm, unsigned index); boolean -util_bitmask_get(struct util_bitmask *bm, +util_bitmask_get(struct util_bitmask *bm, unsigned index); @@ -93,8 +93,8 @@ util_bitmask_destroy(struct util_bitmask *bm); /** * Search for the first set bit. - * - * Returns UTIL_BITMASK_INVALID_INDEX if a set bit cannot be found. + * + * Returns UTIL_BITMASK_INVALID_INDEX if a set bit cannot be found. */ unsigned util_bitmask_get_first_index(struct util_bitmask *bm); @@ -102,8 +102,8 @@ util_bitmask_get_first_index(struct util_bitmask *bm); /** * Search for the first set bit, starting from the giving index. - * - * Returns UTIL_BITMASK_INVALID_INDEX if a set bit cannot be found. + * + * Returns UTIL_BITMASK_INVALID_INDEX if a set bit cannot be found. */ unsigned util_bitmask_get_next_index(struct util_bitmask *bm, diff --git a/src/gallium/auxiliary/util/u_blit.c b/src/gallium/auxiliary/util/u_blit.c index c11f7d3..f3a1fc3 100644 --- a/src/gallium/auxiliary/util/u_blit.c +++ b/src/gallium/auxiliary/util/u_blit.c @@ -28,7 +28,7 @@ /** * @file * Copy/blit pixel rect between surfaces - * + * * @author Brian Paul */ @@ -193,7 +193,7 @@ get_next_slot( struct blit_state *ctx ) { const unsigned max_slots = 4096 / sizeof ctx->vertices; - if (ctx->vbuf_slot >= max_slots) + if (ctx->vbuf_slot >= max_slots) util_blit_flush( ctx ); if (!ctx->vbuf) { @@ -201,7 +201,7 @@ get_next_slot( struct blit_state *ctx ) PIPE_BIND_VERTEX_BUFFER, max_slots * sizeof ctx->vertices); } - + return ctx->vbuf_slot++ * sizeof ctx->vertices; } @@ -357,7 +357,7 @@ util_blit_pixels_writemask(struct blit_state *ctx, * is anything other than a 2d texture. * XXX should just use appropriate shader to access 1d / 3d slice / cube face, * much like the u_blitter code does (should be pretty trivial). - * + * * This can still be improved upon. */ if ((src_tex == dst->texture && @@ -608,7 +608,7 @@ void util_blit_flush( struct blit_state *ctx ) { pipe_resource_reference(&ctx->vbuf, NULL); ctx->vbuf_slot = 0; -} +} @@ -722,7 +722,7 @@ util_blit_pixels_tex(struct blit_state *ctx, s0, t0, s1, t1, z); - util_draw_vertex_buffer(ctx->pipe, + util_draw_vertex_buffer(ctx->pipe, ctx->vbuf, offset, PIPE_PRIM_TRIANGLE_FAN, 4, /* verts */ diff --git a/src/gallium/auxiliary/util/u_blit.h b/src/gallium/auxiliary/util/u_blit.h index 3009e25..c01831e 100644 --- a/src/gallium/auxiliary/util/u_blit.h +++ b/src/gallium/auxiliary/util/u_blit.h @@ -37,7 +37,7 @@ extern "C" { #endif - + struct cso_context; struct pipe_context; struct pipe_resource; diff --git a/src/gallium/auxiliary/util/u_cache.c b/src/gallium/auxiliary/util/u_cache.c index 15f4a88..b1a2632 100644 --- a/src/gallium/auxiliary/util/u_cache.c +++ b/src/gallium/auxiliary/util/u_cache.c @@ -29,8 +29,8 @@ * @file * Simple cache implementation. * - * We simply have fixed size array, and destroy previous values on collision. - * + * We simply have fixed size array, and destroy previous values on collision. + * * @author Jose Fonseca */ @@ -47,7 +47,7 @@ struct util_cache_entry { void *key; void *value; - + #ifdef DEBUG unsigned count; #endif @@ -58,7 +58,7 @@ struct util_cache { /** Hash function */ uint32_t (*hash)(const void *key); - + /** Compare two keys */ int (*compare)(const void *key1, const void *key2); @@ -66,9 +66,9 @@ struct util_cache void (*destroy)(void *key, void *value); uint32_t size; - + struct util_cache_entry *entries; - + #ifdef DEBUG unsigned count; #endif @@ -82,22 +82,22 @@ util_cache_create(uint32_t (*hash)(const void *key), uint32_t size) { struct util_cache *cache; - + cache = CALLOC_STRUCT(util_cache); if(!cache) return NULL; - + cache->hash = hash; cache->compare = compare; cache->destroy = destroy; cache->size = size; - + cache->entries = CALLOC(size, sizeof(struct util_cache_entry)); if(!cache->entries) { FREE(cache); return NULL; } - + return cache; } @@ -107,7 +107,7 @@ util_cache_entry_get(struct util_cache *cache, const void *key) { uint32_t hash; - + hash = cache->hash(key); return &cache->entries[hash % cache->size]; @@ -119,10 +119,10 @@ util_cache_entry_destroy(struct util_cache *cache, { void *key = entry->key; void *value = entry->value; - + entry->key = NULL; entry->value = NULL; - + if(key || value) if(cache->destroy) cache->destroy(key, value); @@ -142,19 +142,19 @@ util_cache_set(struct util_cache *cache, entry = util_cache_entry_get(cache, key); util_cache_entry_destroy(cache, entry); - + #ifdef DEBUG ++entry->count; ++cache->count; #endif - + entry->key = key; entry->value = value; } void * -util_cache_get(struct util_cache *cache, +util_cache_get(struct util_cache *cache, const void *key) { struct util_cache_entry *entry; @@ -166,15 +166,15 @@ util_cache_get(struct util_cache *cache, entry = util_cache_entry_get(cache, key); if(!entry->key && !entry->value) return NULL; - + if(cache->compare(key, entry->key) != 0) return NULL; - + return entry->value; } -void +void util_cache_clear(struct util_cache *cache) { uint32_t i; @@ -203,15 +203,15 @@ util_cache_destroy(struct util_cache *cache) unsigned i; for(i = 0; i < cache->size; ++i) { double z = fabs(cache->entries[i].count - mean)/stddev; - /* This assert should not fail 99.9999998027% of the times, unless + /* This assert should not fail 99.9999998027% of the times, unless * the hash function is a poor one */ assert(z <= 6.0); } } #endif - + util_cache_clear(cache); - + FREE(cache->entries); FREE(cache); } diff --git a/src/gallium/auxiliary/util/u_cache.h b/src/gallium/auxiliary/util/u_cache.h index 8a612c6..be5522c 100644 --- a/src/gallium/auxiliary/util/u_cache.h +++ b/src/gallium/auxiliary/util/u_cache.h @@ -43,7 +43,7 @@ extern "C" { #endif - + /** * Least Recently Used (LRU) cache. */ @@ -52,7 +52,7 @@ struct util_cache; /** * Create a cache. - * + * * @param hash hash function * @param compare should return 0 for two equal keys * @param destroy destruction callback (optional) @@ -70,7 +70,7 @@ util_cache_set(struct util_cache *cache, void *value); void * -util_cache_get(struct util_cache *cache, +util_cache_get(struct util_cache *cache, const void *key); void diff --git a/src/gallium/auxiliary/util/u_clear.h b/src/gallium/auxiliary/util/u_clear.h index ad69df3..03c5f68 100644 --- a/src/gallium/auxiliary/util/u_clear.h +++ b/src/gallium/auxiliary/util/u_clear.h @@ -1,7 +1,7 @@ /************************************************************************** - * + * * Copyright 2009 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 @@ -9,11 +9,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. @@ -21,7 +21,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. - * + * **************************************************************************/ /* Authors: diff --git a/src/gallium/auxiliary/util/u_cpu_detect.c b/src/gallium/auxiliary/util/u_cpu_detect.c index 32519b1..858fba9 100644 --- a/src/gallium/auxiliary/util/u_cpu_detect.c +++ b/src/gallium/auxiliary/util/u_cpu_detect.c @@ -1,5 +1,5 @@ /************************************************************************** - * + * * Copyright 2008 Dennis Smit * All Rights Reserved. * @@ -21,7 +21,7 @@ * 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. - * + * **************************************************************************/ /** diff --git a/src/gallium/auxiliary/util/u_cpu_detect.h b/src/gallium/auxiliary/util/u_cpu_detect.h index f3bef09..0613542 100644 --- a/src/gallium/auxiliary/util/u_cpu_detect.h +++ b/src/gallium/auxiliary/util/u_cpu_detect.h @@ -1,5 +1,5 @@ /************************************************************************** - * + * * Copyright 2008 Dennis Smit * All Rights Reserved. * diff --git a/src/gallium/auxiliary/util/u_debug.c b/src/gallium/auxiliary/util/u_debug.c index 2ad2f95..fc86269 100644 --- a/src/gallium/auxiliary/util/u_debug.c +++ b/src/gallium/auxiliary/util/u_debug.c @@ -1,9 +1,9 @@ /************************************************************************** - * + * * Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas. * Copyright (c) 2008 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 @@ -11,11 +11,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. @@ -23,23 +23,23 @@ * 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 "pipe/p_config.h" +#include "pipe/p_config.h" #include "pipe/p_compiler.h" #include "os/os_stream.h" -#include "util/u_debug.h" -#include "pipe/p_format.h" -#include "pipe/p_state.h" -#include "util/u_inlines.h" +#include "util/u_debug.h" +#include "pipe/p_format.h" +#include "pipe/p_state.h" +#include "util/u_inlines.h" #include "util/u_format.h" -#include "util/u_memory.h" -#include "util/u_string.h" -#include "util/u_math.h" -#include "util/u_tile.h" +#include "util/u_memory.h" +#include "util/u_string.h" +#include "util/u_math.h" +#include "util/u_tile.h" #include "util/u_prim.h" #include "util/u_surface.h" @@ -105,7 +105,7 @@ debug_get_option(const char *name, const char *dfault) if (debug_get_option_should_print()) debug_printf("%s: %s = %s\n", __FUNCTION__, name, result ? result : "(null)"); - + return result; } @@ -114,7 +114,7 @@ debug_get_bool_option(const char *name, boolean dfault) { const char *str = os_get_option(name); boolean result; - + if(str == NULL) result = dfault; else if(!util_strcmp(str, "n")) @@ -136,7 +136,7 @@ debug_get_bool_option(const char *name, boolean dfault) if (debug_get_option_should_print()) debug_printf("%s: %s = %s\n", __FUNCTION__, name, result ? "TRUE" : "FALSE"); - + return result; } @@ -146,7 +146,7 @@ debug_get_num_option(const char *name, long dfault) { long result; const char *str; - + str = os_get_option(name); if(!str) result = dfault; @@ -157,7 +157,7 @@ debug_get_num_option(const char *name, long dfault) if(c == '-') { sign = -1; c = *str++; - } + } else { sign = 1; } @@ -177,7 +177,7 @@ debug_get_num_option(const char *name, long dfault) unsigned long -debug_get_flags_option(const char *name, +debug_get_flags_option(const char *name, const struct debug_named_value *flags, unsigned long dfault) { @@ -185,7 +185,7 @@ debug_get_flags_option(const char *name, const char *str; const struct debug_named_value *orig = flags; int namealign = 0; - + str = os_get_option(name); if(!str) result = dfault; @@ -220,10 +220,10 @@ debug_get_flags_option(const char *name, } -void _debug_assert_fail(const char *expr, - const char *file, - unsigned line, - const char *function) +void _debug_assert_fail(const char *expr, + const char *file, + unsigned line, + const char *function) { _debug_printf("%s:%u:%s: Assertion `%s' failed.\n", file, line, function, expr); #if defined(PIPE_OS_WINDOWS) && !defined(PIPE_SUBSYSTEM_WINDOWS_USER) @@ -238,11 +238,11 @@ void _debug_assert_fail(const char *expr, const char * -debug_dump_enum(const struct debug_named_value *names, +debug_dump_enum(const struct debug_named_value *names, unsigned long value) { static char rest[64]; - + while(names->name) { if(names->value == value) return names->name; @@ -255,12 +255,12 @@ debug_dump_enum(const struct debug_named_value *names, const char * -debug_dump_enum_noprefix(const struct debug_named_value *names, +debug_dump_enum_noprefix(const struct debug_named_value *names, const char *prefix, unsigned long value) { static char rest[64]; - + while(names->name) { if(names->value == value) { const char *name = names->name; @@ -273,7 +273,7 @@ debug_dump_enum_noprefix(const struct debug_named_value *names, ++names; } - + util_snprintf(rest, sizeof(rest), "0x%08lx", value); return rest; @@ -281,7 +281,7 @@ debug_dump_enum_noprefix(const struct debug_named_value *names, const char * -debug_dump_flags(const struct debug_named_value *names, +debug_dump_flags(const struct debug_named_value *names, unsigned long value) { static char output[4096]; @@ -302,21 +302,21 @@ debug_dump_flags(const struct debug_named_value *names, } ++names; } - + if (value) { if (!first) util_strncat(output, "|", sizeof(output)); else first = 0; - + util_snprintf(rest, sizeof(rest), "0x%08lx", value); util_strncat(output, rest, sizeof(output) - 1); output[sizeof(output) - 1] = '\0'; } - + if(first) return "0"; - + return output; } @@ -368,10 +368,10 @@ void debug_dump_image(const char *prefix, unsigned format, unsigned cpp, unsigned width, unsigned height, unsigned stride, - const void *data) + const void *data) { #ifdef PIPE_SUBSYSTEM_WINDOWS_DISPLAY - static unsigned no = 0; + static unsigned no = 0; char filename[256]; WCHAR wfilename[sizeof(filename)]; ULONG_PTR iFile = 0; @@ -387,23 +387,23 @@ void debug_dump_image(const char *prefix, util_snprintf(filename, sizeof(filename), "\\??\\c:\\%03u%s.raw", ++no, prefix); for(i = 0; i < sizeof(filename); ++i) wfilename[i] = (WCHAR)filename[i]; - + pMap = (unsigned char *)EngMapFile(wfilename, sizeof(header) + height*width*cpp, &iFile); if(!pMap) return; - + header.format = format; header.cpp = cpp; header.width = width; header.height = height; memcpy(pMap, &header, sizeof(header)); pMap += sizeof(header); - + for(i = 0; i < height; ++i) { memcpy(pMap, (unsigned char *)data + stride*i, cpp*width); pMap += cpp*width; } - + EngUnmapFile(iFile); #elif defined(PIPE_OS_UNIX) /* write a ppm file */ diff --git a/src/gallium/auxiliary/util/u_debug.h b/src/gallium/auxiliary/util/u_debug.h index 1c9624e..a939944 100644 --- a/src/gallium/auxiliary/util/u_debug.h +++ b/src/gallium/auxiliary/util/u_debug.h @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas. * 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,16 +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. - * + * **************************************************************************/ /** * @file * Cross-platform debugging helpers. - * - * For now it just has assert and printf replacements, but it might be extended - * with stack trace reports and more advanced logging in the near future. - * + * + * For now it just has assert and printf replacements, but it might be extended + * with stack trace reports and more advanced logging in the near future. + * * @author Jose Fonseca */ @@ -54,7 +54,7 @@ extern "C" { #endif void _debug_vprintf(const char *format, va_list ap); - + static INLINE void _debug_printf(const char *format, ...) @@ -146,16 +146,16 @@ void debug_print_format(const char *msg, unsigned fmt ); long debug_get_num_option(const char *name, long dfault); -void _debug_assert_fail(const char *expr, - const char *file, - unsigned line, +void _debug_assert_fail(const char *expr, + const char *file, + unsigned line, const char *function); -/** +/** * Assert macro - * - * Do not expect that the assert call terminates -- errors must be handled + * + * Do not expect that the assert call terminates -- errors must be handled * regardless of assert behavior. * * For non debug builds the assert macro will expand to a no-op, so do not @@ -183,7 +183,7 @@ void _debug_assert_fail(const char *expr, _debug_printf("%s\n", __FUNCTION__) #else #define debug_checkpoint() \ - ((void)0) + ((void)0) #endif @@ -192,10 +192,10 @@ void _debug_assert_fail(const char *expr, */ #ifdef DEBUG #define debug_checkpoint_full() \ - _debug_printf("%s:%u:%s", __FILE__, __LINE__, __FUNCTION__) + _debug_printf("%s:%u:%s", __FILE__, __LINE__, __FUNCTION__) #else #define debug_checkpoint_full() \ - ((void)0) + ((void)0) #endif @@ -207,7 +207,7 @@ void _debug_assert_fail(const char *expr, _debug_printf("%s:%u:%s: warning: %s\n", __FILE__, __LINE__, __FUNCTION__, __msg) #else #define debug_warning(__msg) \ - ((void)0) + ((void)0) #endif @@ -216,7 +216,7 @@ void _debug_assert_fail(const char *expr, */ #ifdef DEBUG #define debug_error(__msg) \ - _debug_printf("%s:%u:%s: error: %s\n", __FILE__, __LINE__, __FUNCTION__, __msg) + _debug_printf("%s:%u:%s: error: %s\n", __FILE__, __LINE__, __FUNCTION__, __msg) #else #define debug_error(__msg) \ _debug_printf("error: %s\n", __msg) @@ -236,7 +236,7 @@ struct debug_named_value /** * Some C pre-processor magic to simplify creating named values. - * + * * Example: * @code * static const debug_named_value my_names[] = { @@ -245,9 +245,9 @@ struct debug_named_value * DEBUG_NAMED_VALUE(MY_ENUM_VALUE_Z), * DEBUG_NAMED_VALUE_END * }; - * + * * ... - * debug_printf("%s = %s\n", + * debug_printf("%s = %s\n", * name, * debug_dump_enum(my_names, my_value)); * ... @@ -262,11 +262,11 @@ struct debug_named_value * Convert a enum value to a string. */ const char * -debug_dump_enum(const struct debug_named_value *names, +debug_dump_enum(const struct debug_named_value *names, unsigned long value); const char * -debug_dump_enum_noprefix(const struct debug_named_value *names, +debug_dump_enum_noprefix(const struct debug_named_value *names, const char *prefix, unsigned long value); @@ -275,20 +275,20 @@ debug_dump_enum_noprefix(const struct debug_named_value *names, * Convert binary flags value to a string. */ const char * -debug_dump_flags(const struct debug_named_value *names, +debug_dump_flags(const struct debug_named_value *names, unsigned long value); /** * Get option. - * - * It is an alias for getenv on Linux. - * - * On Windows it reads C:\gallium.cfg, which is a text file with CR+LF line + * + * It is an alias for getenv on Linux. + * + * On Windows it reads C:\gallium.cfg, which is a text file with CR+LF line * endings with one option per line as - * + * * NAME=value - * + * * This file must be terminated with an extra empty line. */ const char * @@ -301,7 +301,7 @@ long debug_get_num_option(const char *name, long dfault); unsigned long -debug_get_flags_option(const char *name, +debug_get_flags_option(const char *name, const struct debug_named_value *flags, unsigned long dfault); @@ -348,7 +348,7 @@ debug_get_option_ ## sufix (void) \ unsigned long debug_memory_begin(void); -void +void debug_memory_end(unsigned long beginning); @@ -365,7 +365,7 @@ void debug_dump_image(const char *prefix, const void *data); void debug_dump_surface(struct pipe_context *pipe, const char *prefix, - struct pipe_surface *surface); + struct pipe_surface *surface); void debug_dump_texture(struct pipe_context *pipe, const char *prefix, struct pipe_resource *texture); diff --git a/src/gallium/auxiliary/util/u_debug_memory.c b/src/gallium/auxiliary/util/u_debug_memory.c index f1baa62..62e1376 100644 --- a/src/gallium/auxiliary/util/u_debug_memory.c +++ b/src/gallium/auxiliary/util/u_debug_memory.c @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas. * 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,36 +22,36 @@ * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * + * **************************************************************************/ /** * @file * Memory debugging. - * + * * @author José Fonseca */ -#include "pipe/p_config.h" +#include "pipe/p_config.h" #define DEBUG_MEMORY_IMPLEMENTATION #include "os/os_memory.h" #include "os/os_memory_debug.h" -#include "util/u_debug.h" -#include "util/u_debug_stack.h" -#include "util/u_double_list.h" +#include "util/u_debug.h" +#include "util/u_debug_stack.h" +#include "util/u_double_list.h" -#define DEBUG_MEMORY_MAGIC 0x6e34090aU +#define DEBUG_MEMORY_MAGIC 0x6e34090aU #define DEBUG_MEMORY_STACK 0 /* XXX: disabled until we have symbol lookup */ -struct debug_memory_header +struct debug_memory_header { struct list_head head; - + unsigned long no; const char *file; unsigned line; @@ -60,7 +60,7 @@ struct debug_memory_header struct debug_stack_frame backtrace[DEBUG_MEMORY_STACK]; #endif size_t size; - + unsigned magic; }; @@ -105,11 +105,11 @@ footer_from_header(struct debug_memory_header *hdr) void * debug_malloc(const char *file, unsigned line, const char *function, - size_t size) + size_t size) { struct debug_memory_header *hdr; struct debug_memory_footer *ftr; - + hdr = os_malloc(sizeof(*hdr) + size + sizeof(*ftr)); if(!hdr) { debug_printf("%s:%u:%s: out of memory when trying to allocate %lu bytes\n", @@ -117,7 +117,7 @@ debug_malloc(const char *file, unsigned line, const char *function, (long unsigned)size); return NULL; } - + hdr->no = last_no++; hdr->file = file; hdr->line = line; @@ -131,22 +131,22 @@ debug_malloc(const char *file, unsigned line, const char *function, ftr = footer_from_header(hdr); ftr->magic = DEBUG_MEMORY_MAGIC; - + LIST_ADDTAIL(&hdr->head, &list); - + return data_from_header(hdr); } void debug_free(const char *file, unsigned line, const char *function, - void *ptr) + void *ptr) { struct debug_memory_header *hdr; struct debug_memory_footer *ftr; - + if(!ptr) return; - + hdr = header_from_data(ptr); if(hdr->magic != DEBUG_MEMORY_MAGIC) { debug_printf("%s:%u:%s: freeing bad or corrupted memory %p\n", @@ -167,7 +167,7 @@ debug_free(const char *file, unsigned line, const char *function, LIST_DEL(&hdr->head); hdr->magic = 0; ftr->magic = 0; - + os_free(hdr); } @@ -188,15 +188,15 @@ debug_realloc(const char *file, unsigned line, const char *function, struct debug_memory_header *old_hdr, *new_hdr; struct debug_memory_footer *old_ftr, *new_ftr; void *new_ptr; - + if(!old_ptr) return debug_malloc( file, line, function, new_size ); - + if(!new_size) { debug_free( file, line, function, old_ptr ); return NULL; } - + old_hdr = header_from_data(old_ptr); if(old_hdr->magic != DEBUG_MEMORY_MAGIC) { debug_printf("%s:%u:%s: reallocating bad or corrupted memory %p\n", @@ -205,7 +205,7 @@ debug_realloc(const char *file, unsigned line, const char *function, debug_assert(0); return NULL; } - + old_ftr = footer_from_header(old_hdr); if(old_ftr->magic != DEBUG_MEMORY_MAGIC) { debug_printf("%s:%u:%s: buffer overflow %p\n", @@ -228,10 +228,10 @@ debug_realloc(const char *file, unsigned line, const char *function, new_hdr->function = old_hdr->function; new_hdr->size = new_size; new_hdr->magic = DEBUG_MEMORY_MAGIC; - + new_ftr = footer_from_header(new_hdr); new_ftr->magic = DEBUG_MEMORY_MAGIC; - + LIST_REPLACE(&old_hdr->head, &new_hdr->head); /* copy data */ @@ -252,7 +252,7 @@ debug_memory_begin(void) return last_no; } -void +void debug_memory_end(unsigned long start_no) { size_t total_size = 0; diff --git a/src/gallium/auxiliary/util/u_debug_stack.c b/src/gallium/auxiliary/util/u_debug_stack.c index 24e039f..d2709b7 100644 --- a/src/gallium/auxiliary/util/u_debug_stack.c +++ b/src/gallium/auxiliary/util/u_debug_stack.c @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2009 VMware, Inc. * All Rights Reserved. - * + * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including @@ -10,11 +10,11 @@ * distribute, sub license, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: - * + * * The above copyright notice and this permission notice (including the * next paragraph) shall be included in all copies or substantial portions * of the Software. - * + * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. @@ -22,13 +22,13 @@ * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * + * **************************************************************************/ /** * @file * Stack backtracing. - * + * * @author Jose Fonseca */ @@ -39,7 +39,7 @@ void debug_backtrace_capture(struct debug_stack_frame *backtrace, - unsigned start_frame, + unsigned start_frame, unsigned nr_frames) { const void **frame_pointer = NULL; @@ -61,46 +61,46 @@ debug_backtrace_capture(struct debug_stack_frame *backtrace, #else frame_pointer = NULL; #endif - - + + #ifdef PIPE_ARCH_X86 while(nr_frames) { const void **next_frame_pointer; if(!frame_pointer) break; - + if(start_frame) --start_frame; else { backtrace[i++].function = frame_pointer[1]; --nr_frames; } - + next_frame_pointer = (const void **)frame_pointer[0]; - + /* Limit the stack walk to avoid referencing undefined memory */ if((uintptr_t)next_frame_pointer <= (uintptr_t)frame_pointer || (uintptr_t)next_frame_pointer > (uintptr_t)frame_pointer + 64*1024) break; - + frame_pointer = next_frame_pointer; } #endif - + while(nr_frames) { backtrace[i++].function = NULL; --nr_frames; } } - + void -debug_backtrace_dump(const struct debug_stack_frame *backtrace, +debug_backtrace_dump(const struct debug_stack_frame *backtrace, unsigned nr_frames) { unsigned i; - + for(i = 0; i < nr_frames; ++i) { if(!backtrace[i].function) break; diff --git a/src/gallium/auxiliary/util/u_debug_stack.h b/src/gallium/auxiliary/util/u_debug_stack.h index f50f04e..35e66e5 100644 --- a/src/gallium/auxiliary/util/u_debug_stack.h +++ b/src/gallium/auxiliary/util/u_debug_stack.h @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2009 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. - * + * **************************************************************************/ #ifndef U_DEBUG_STACK_H_ @@ -32,7 +32,7 @@ /** * @file * Stack backtracing. - * + * * @author Jose Fonseca */ @@ -42,19 +42,19 @@ extern "C" { #endif -struct debug_stack_frame +struct debug_stack_frame { const void *function; }; - + void debug_backtrace_capture(struct debug_stack_frame *backtrace, - unsigned start_frame, + unsigned start_frame, unsigned nr_frames); void -debug_backtrace_dump(const struct debug_stack_frame *backtrace, +debug_backtrace_dump(const struct debug_stack_frame *backtrace, unsigned nr_frames); diff --git a/src/gallium/auxiliary/util/u_debug_symbol.c b/src/gallium/auxiliary/util/u_debug_symbol.c index 44d4377..ff141f0 100644 --- a/src/gallium/auxiliary/util/u_debug_symbol.c +++ b/src/gallium/auxiliary/util/u_debug_symbol.c @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2009 VMware, Inc. * All Rights Reserved. - * + * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including @@ -10,11 +10,11 @@ * distribute, sub license, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: - * + * * The above copyright notice and this permission notice (including the * next paragraph) shall be included in all copies or substantial portions * of the Software. - * + * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. @@ -22,13 +22,13 @@ * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * + * **************************************************************************/ /** * @file * Symbol lookup. - * + * * @author Jose Fonseca */ @@ -41,14 +41,14 @@ #include "u_hash_table.h" #if defined(PIPE_CC_MSVC) && defined(PIPE_ARCH_X86) - + #include #include #include /* * TODO: Cleanup code. - * TODO: Support x86_64 + * TODO: Support x86_64 */ static BOOL bSymInitialized = FALSE; diff --git a/src/gallium/auxiliary/util/u_debug_symbol.h b/src/gallium/auxiliary/util/u_debug_symbol.h index b247706..11621c3 100644 --- a/src/gallium/auxiliary/util/u_debug_symbol.h +++ b/src/gallium/auxiliary/util/u_debug_symbol.h @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2009 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. - * + * **************************************************************************/ #ifndef U_DEBUG_SYMBOL_H_ @@ -32,7 +32,7 @@ /** * @file * Symbol lookup. - * + * * @author Jose Fonseca */ diff --git a/src/gallium/auxiliary/util/u_double_list.h b/src/gallium/auxiliary/util/u_double_list.h index 42adb1f..f43cf94 100644 --- a/src/gallium/auxiliary/util/u_double_list.h +++ b/src/gallium/auxiliary/util/u_double_list.h @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2006 Tungsten Graphics, Inc., Bismarck, ND. USA. * 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,26 +10,26 @@ * 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 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. IN NO EVENT SHALL - * THE COPYRIGHT HOLDERS, AUTHORS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, - * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR - * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE + * THE COPYRIGHT HOLDERS, AUTHORS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, + * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE * USE OR OTHER DEALINGS IN THE SOFTWARE. * * The above copyright notice and this permission notice (including the * next paragraph) shall be included in all copies or substantial portions * of the Software. - * + * **************************************************************************/ /** * \file * List macros heavily inspired by the Linux kernel * list handling. No list looping yet. - * + * * Is not threadsafe, so common operations need to * be protected using an external mutex. */ diff --git a/src/gallium/auxiliary/util/u_draw_quad.c b/src/gallium/auxiliary/util/u_draw_quad.c index 0b6dc58..38b050e 100644 --- a/src/gallium/auxiliary/util/u_draw_quad.c +++ b/src/gallium/auxiliary/util/u_draw_quad.c @@ -37,7 +37,7 @@ * Draw a simple vertex buffer / primitive. * Limited to float[4] vertex attribs, tightly packed. */ -void +void util_draw_vertex_buffer(struct pipe_context *pipe, struct pipe_resource *vbuf, uint offset, @@ -69,13 +69,13 @@ util_draw_vertex_buffer(struct pipe_context *pipe, * Draw screen-aligned textured quad. * Note: this isn't especially efficient. */ -void +void util_draw_texquad(struct pipe_context *pipe, float x0, float y0, float x1, float y1, float z) { uint numAttribs = 2, i, j; uint vertexBytes = 4 * (4 * numAttribs * sizeof(float)); - struct pipe_resource *vbuf = NULL; + struct pipe_resource *vbuf = NULL; uint *v = NULL; v = MALLOC(vertexBytes); @@ -112,10 +112,10 @@ util_draw_texquad(struct pipe_context *pipe, v[25] = y1; v[28] = 0.0; v[29] = 1.0; - + vbuf = pipe_user_buffer_create(pipe->screen, v, vertexBytes, PIPE_BIND_VERTEX_BUFFER); - if (!vbuf) + if (!vbuf) goto out; util_draw_vertex_buffer(pipe, vbuf, 0, PIPE_PRIM_TRIANGLE_FAN, 4, 2); @@ -123,7 +123,7 @@ util_draw_texquad(struct pipe_context *pipe, out: if (vbuf) pipe_resource_reference(&vbuf, NULL); - + if (v) FREE(v); } diff --git a/src/gallium/auxiliary/util/u_draw_quad.h b/src/gallium/auxiliary/util/u_draw_quad.h index 52994fe..4eaec2d 100644 --- a/src/gallium/auxiliary/util/u_draw_quad.h +++ b/src/gallium/auxiliary/util/u_draw_quad.h @@ -41,13 +41,13 @@ struct pipe_resource; #include "util/u_draw.h" -extern void +extern void util_draw_vertex_buffer(struct pipe_context *pipe, struct pipe_resource *vbuf, uint offset, uint num_attribs, uint num_verts, uint prim_type); -extern void +extern void util_draw_texquad(struct pipe_context *pipe, float x0, float y0, float x1, float y1, float z); diff --git a/src/gallium/auxiliary/util/u_dump.h b/src/gallium/auxiliary/util/u_dump.h index 49536c0..6a7bb8e 100644 --- a/src/gallium/auxiliary/util/u_dump.h +++ b/src/gallium/auxiliary/util/u_dump.h @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2009 VMware, Inc. * All Rights Reserved. - * + * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including @@ -10,11 +10,11 @@ * distribute, sub license, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: - * + * * The above copyright notice and this permission notice (including the * next paragraph) shall be included in all copies or substantial portions * of the Software. - * + * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. @@ -22,13 +22,13 @@ * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * + * **************************************************************************/ /** * @file * Dump data in human/machine readable format. - * + * * @author Jose Fonseca */ diff --git a/src/gallium/auxiliary/util/u_dump_defines.c b/src/gallium/auxiliary/util/u_dump_defines.c index 692d444..ad60500 100644 --- a/src/gallium/auxiliary/util/u_dump_defines.c +++ b/src/gallium/auxiliary/util/u_dump_defines.c @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2009 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,19 +22,19 @@ * 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/u_memory.h" -#include "util/u_debug.h" +#include "util/u_debug.h" #include "util/u_dump.h" #if 0 static const char * util_dump_strip_prefix(const char *name, - const char *prefix) + const char *prefix) { const char *stripped; assert(name); diff --git a/src/gallium/auxiliary/util/u_format.csv b/src/gallium/auxiliary/util/u_format.csv index 1fbd838..3d71d81 100644 --- a/src/gallium/auxiliary/util/u_format.csv +++ b/src/gallium/auxiliary/util/u_format.csv @@ -1,8 +1,8 @@ ########################################################################### -# +# # Copyright 2009-2010 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. -# +# ########################################################################### # This CSV file has the input data for u_format.h's struct @@ -43,7 +43,7 @@ # - 'f': FLOAT # - optionally followed by 'n' if it is normalized # - number of bits -# - channel swizzle +# - channel swizzle # - color space: rgb, yub, sz # # See also: @@ -86,10 +86,10 @@ PIPE_FORMAT_L8A8_UNORM , plain, 1, 1, un8 , un8 , , , xxxy, r PIPE_FORMAT_L16_UNORM , plain, 1, 1, un16, , , , xxx1, rgb # SRGB formats -PIPE_FORMAT_L8_SRGB , plain, 1, 1, un8 , , , , xxx1, srgb -PIPE_FORMAT_L8A8_SRGB , plain, 1, 1, un8 , un8 , , , xxxy, srgb -PIPE_FORMAT_R8G8B8_SRGB , plain, 1, 1, un8 , un8 , un8 , , xyz1, srgb -PIPE_FORMAT_R8G8B8A8_SRGB , plain, 1, 1, un8 , un8 , un8 , un8 , xyzw, srgb +PIPE_FORMAT_L8_SRGB , plain, 1, 1, un8 , , , , xxx1, srgb +PIPE_FORMAT_L8A8_SRGB , plain, 1, 1, un8 , un8 , , , xxxy, srgb +PIPE_FORMAT_R8G8B8_SRGB , plain, 1, 1, un8 , un8 , un8 , , xyz1, srgb +PIPE_FORMAT_R8G8B8A8_SRGB , plain, 1, 1, un8 , un8 , un8 , un8 , xyzw, srgb PIPE_FORMAT_A8B8G8R8_SRGB , plain, 1, 1, un8 , un8 , un8 , un8 , wzyx, srgb PIPE_FORMAT_X8B8G8R8_SRGB , plain, 1, 1, x8 , un8 , un8 , un8 , wzy1, srgb PIPE_FORMAT_B8G8R8A8_SRGB , plain, 1, 1, un8 , un8 , un8 , un8 , zyxw, srgb @@ -152,9 +152,9 @@ PIPE_FORMAT_RGTC1_SNORM , rgtc, 4, 4, x64, , , , x001, rg PIPE_FORMAT_RGTC2_UNORM , rgtc, 4, 4, x128, , , , xy01, rgb PIPE_FORMAT_RGTC2_SNORM , rgtc, 4, 4, x128, , , , xy01, rgb -# Straightforward D3D10-like formats (also used for +# Straightforward D3D10-like formats (also used for # vertex buffer element description) -# +# # See also: # - src/gallium/auxiliary/translate/translate_generic.c # - src/mesa/state_tracker/st_draw.c diff --git a/src/gallium/auxiliary/util/u_format.h b/src/gallium/auxiliary/util/u_format.h index 03b73c0..9beb034 100644 --- a/src/gallium/auxiliary/util/u_format.h +++ b/src/gallium/auxiliary/util/u_format.h @@ -80,7 +80,7 @@ struct util_format_block { /** Block width in pixels */ unsigned width; - + /** Block height in pixels */ unsigned height; @@ -323,7 +323,7 @@ struct util_format_description }; -extern const struct util_format_description +extern const struct util_format_description util_format_description_table[]; @@ -376,7 +376,7 @@ util_format_is_plain(enum pipe_format format) return desc->layout == UTIL_FORMAT_LAYOUT_PLAIN ? TRUE : FALSE; } -static INLINE boolean +static INLINE boolean util_format_is_compressed(enum pipe_format format) { const struct util_format_description *desc = util_format_description(format); @@ -396,7 +396,7 @@ util_format_is_compressed(enum pipe_format format) } } -static INLINE boolean +static INLINE boolean util_format_is_s3tc(enum pipe_format format) { const struct util_format_description *desc = util_format_description(format); @@ -409,7 +409,7 @@ util_format_is_s3tc(enum pipe_format format) return desc->layout == UTIL_FORMAT_LAYOUT_S3TC ? TRUE : FALSE; } -static INLINE boolean +static INLINE boolean util_format_is_depth_or_stencil(enum pipe_format format) { const struct util_format_description *desc = util_format_description(format); @@ -422,7 +422,7 @@ util_format_is_depth_or_stencil(enum pipe_format format) return desc->colorspace == UTIL_FORMAT_COLORSPACE_ZS ? TRUE : FALSE; } -static INLINE boolean +static INLINE boolean util_format_is_depth_and_stencil(enum pipe_format format) { const struct util_format_description *desc = util_format_description(format); @@ -727,26 +727,26 @@ util_format_get_nr_components(enum pipe_format format) void util_format_read_4f(enum pipe_format format, - float *dst, unsigned dst_stride, - const void *src, unsigned src_stride, + float *dst, unsigned dst_stride, + const void *src, unsigned src_stride, unsigned x, unsigned y, unsigned w, unsigned h); void util_format_write_4f(enum pipe_format format, - const float *src, unsigned src_stride, - void *dst, unsigned dst_stride, + const float *src, unsigned src_stride, + void *dst, unsigned dst_stride, unsigned x, unsigned y, unsigned w, unsigned h); void util_format_read_4ub(enum pipe_format format, - uint8_t *dst, unsigned dst_stride, - const void *src, unsigned src_stride, + uint8_t *dst, unsigned dst_stride, + const void *src, unsigned src_stride, unsigned x, unsigned y, unsigned w, unsigned h); void util_format_write_4ub(enum pipe_format format, - const uint8_t *src, unsigned src_stride, - void *dst, unsigned dst_stride, + const uint8_t *src, unsigned src_stride, + void *dst, unsigned dst_stride, unsigned x, unsigned y, unsigned w, unsigned h); /* diff --git a/src/gallium/auxiliary/util/u_format_yuv.h b/src/gallium/auxiliary/util/u_format_yuv.h index dc96323..d5d7226 100644 --- a/src/gallium/auxiliary/util/u_format_yuv.h +++ b/src/gallium/auxiliary/util/u_format_yuv.h @@ -68,9 +68,9 @@ util_format_rgb_float_to_yuv(float r, float g, float b, const int _u = scale * (-(0.148f * _r) - (0.291f * _g) + (0.439f * _b)); const int _v = scale * ( (0.439f * _r) - (0.368f * _g) - (0.071f * _b)); - *y = _y + 16; - *u = _u + 128; - *v = _v + 128; + *y = _y + 16; + *u = _u + 128; + *v = _v + 128; } diff --git a/src/gallium/auxiliary/util/u_framebuffer.c b/src/gallium/auxiliary/util/u_framebuffer.c index 7803ec6..6905e22 100644 --- a/src/gallium/auxiliary/util/u_framebuffer.c +++ b/src/gallium/auxiliary/util/u_framebuffer.c @@ -27,7 +27,7 @@ /** * @file * Framebuffer utility functions. - * + * * @author Brian Paul */ diff --git a/src/gallium/auxiliary/util/u_gen_mipmap.c b/src/gallium/auxiliary/util/u_gen_mipmap.c index d22ae8b..8c71f03 100644 --- a/src/gallium/auxiliary/util/u_gen_mipmap.c +++ b/src/gallium/auxiliary/util/u_gen_mipmap.c @@ -29,7 +29,7 @@ /** * @file * Mipmap generation utility - * + * * @author Brian Paul */ @@ -999,7 +999,7 @@ reduce_2d(enum pipe_format pformat, /* Compute src and dst pointers */ srcA = srcPtr; - if (srcHeight > 1) + if (srcHeight > 1) srcB = srcA + srcRowStride; else srcB = srcA; @@ -1078,7 +1078,7 @@ reduce_3d(enum pipe_format pformat, ubyte *dstImgRow = imgDst; for (row = 0; row < dstHeight; row++) { - do_row_3D(datatype, comps, srcWidth, + do_row_3D(datatype, comps, srcWidth, srcImgARowA, srcImgARowB, srcImgBRowA, srcImgBRowB, dstWidth, dstImgRow); @@ -1302,7 +1302,7 @@ util_create_gen_mipmap(struct pipe_context *pipe, } /* vertex shader - still needed to specify mapping from fragment - * shader input semantics to vertex elements + * shader input semantics to vertex elements */ { const uint semantic_names[] = { TGSI_SEMANTIC_POSITION, @@ -1344,7 +1344,7 @@ get_next_slot(struct gen_mipmap_state *ctx) { const unsigned max_slots = 4096 / sizeof ctx->vertices; - if (ctx->vbuf_slot >= max_slots) + if (ctx->vbuf_slot >= max_slots) util_gen_mipmap_flush( ctx ); if (!ctx->vbuf) { @@ -1352,7 +1352,7 @@ get_next_slot(struct gen_mipmap_state *ctx) PIPE_BIND_VERTEX_BUFFER, max_slots * sizeof ctx->vertices); } - + return ctx->vbuf_slot++ * sizeof ctx->vertices; } @@ -1446,7 +1446,7 @@ void util_gen_mipmap_flush( struct gen_mipmap_state *ctx ) { pipe_resource_reference(&ctx->vbuf, NULL); ctx->vbuf_slot = 0; -} +} /** @@ -1616,7 +1616,7 @@ util_gen_mipmap(struct gen_mipmap_state *ctx, face, rcoord); - util_draw_vertex_buffer(ctx->pipe, + util_draw_vertex_buffer(ctx->pipe, ctx->vbuf, offset, PIPE_PRIM_TRIANGLE_FAN, diff --git a/src/gallium/auxiliary/util/u_gen_mipmap.h b/src/gallium/auxiliary/util/u_gen_mipmap.h index a10b6a4..3ea0774 100644 --- a/src/gallium/auxiliary/util/u_gen_mipmap.h +++ b/src/gallium/auxiliary/util/u_gen_mipmap.h @@ -35,7 +35,7 @@ extern "C" { #endif - + struct pipe_context; struct pipe_resource; struct cso_context; @@ -53,7 +53,7 @@ util_destroy_gen_mipmap(struct gen_mipmap_state *ctx); /* Release vertex buffer at end of frame to avoid synchronous * rendering. */ -extern void +extern void util_gen_mipmap_flush( struct gen_mipmap_state *ctx ); diff --git a/src/gallium/auxiliary/util/u_handle_table.c b/src/gallium/auxiliary/util/u_handle_table.c index 3703718..df25a25 100644 --- a/src/gallium/auxiliary/util/u_handle_table.c +++ b/src/gallium/auxiliary/util/u_handle_table.c @@ -28,7 +28,7 @@ /** * @file * Generic handle table implementation. - * + * * @author José Fonseca */ @@ -40,19 +40,19 @@ #include "util/u_handle_table.h" -#define HANDLE_TABLE_INITIAL_SIZE 16 +#define HANDLE_TABLE_INITIAL_SIZE 16 struct handle_table { /** Object array. Empty handles have a null object */ void **objects; - + /** Number of objects the handle can currently hold */ unsigned size; /** Number of consecutive objects allocated at the start of the table */ unsigned filled; - + /** Optional object destructor */ void (*destroy)(void *object); }; @@ -62,22 +62,22 @@ struct handle_table * handle_table_create(void) { struct handle_table *ht; - + ht = MALLOC_STRUCT(handle_table); if(!ht) return NULL; - + ht->objects = (void **)CALLOC(HANDLE_TABLE_INITIAL_SIZE, sizeof(void *)); if(!ht->objects) { FREE(ht); return NULL; } - + ht->size = HANDLE_TABLE_INITIAL_SIZE; ht->filled = 0; - + ht->destroy = NULL; - + return ht; } @@ -94,7 +94,7 @@ handle_table_set_destroy(struct handle_table *ht, /** - * Resize the table if necessary + * Resize the table if necessary */ static INLINE int handle_table_resize(struct handle_table *ht, @@ -110,51 +110,51 @@ handle_table_resize(struct handle_table *ht, while(!(new_size > minimum_size)) new_size *= 2; assert(new_size); - + new_objects = (void **)REALLOC((void *)ht->objects, ht->size*sizeof(void *), new_size*sizeof(void *)); if(!new_objects) return 0; - + memset(new_objects + ht->size, 0, (new_size - ht->size)*sizeof(void *)); - + ht->size = new_size; ht->objects = new_objects; - + return ht->size; } static INLINE void -handle_table_clear(struct handle_table *ht, +handle_table_clear(struct handle_table *ht, unsigned index) { void *object; - + /* The order here is important so that the object being destroyed is not - * present in the table when seen by the destroy callback, because the - * destroy callback may directly or indirectly call the other functions in + * present in the table when seen by the destroy callback, because the + * destroy callback may directly or indirectly call the other functions in * this module. */ object = ht->objects[index]; if(object) { ht->objects[index] = NULL; - + if(ht->destroy) ht->destroy(object); - } + } } unsigned -handle_table_add(struct handle_table *ht, +handle_table_add(struct handle_table *ht, void *object) { unsigned index; unsigned handle; - + assert(ht); assert(object); if(!object || !ht) @@ -166,14 +166,14 @@ handle_table_add(struct handle_table *ht, break; ++ht->filled; } - + index = ht->filled; handle = index + 1; - + /* check integer overflow */ if(!handle) return 0; - + /* grow the table if necessary */ if(!handle_table_resize(ht, index)) return 0; @@ -181,18 +181,18 @@ handle_table_add(struct handle_table *ht, assert(!ht->objects[index]); ht->objects[index] = object; ++ht->filled; - + return handle; } unsigned -handle_table_set(struct handle_table *ht, +handle_table_set(struct handle_table *ht, unsigned handle, void *object) { unsigned index; - + assert(ht); assert(handle); if(!handle || !ht) @@ -201,7 +201,7 @@ handle_table_set(struct handle_table *ht, assert(object); if(!object) return 0; - + index = handle - 1; /* grow the table if necessary */ @@ -211,35 +211,35 @@ handle_table_set(struct handle_table *ht, handle_table_clear(ht, index); ht->objects[index] = object; - + return handle; } void * -handle_table_get(struct handle_table *ht, +handle_table_get(struct handle_table *ht, unsigned handle) { void *object; - + assert(ht); assert(handle); if(!handle || !ht || handle > ht->size) return NULL; object = ht->objects[handle - 1]; - + return object; } void -handle_table_remove(struct handle_table *ht, +handle_table_remove(struct handle_table *ht, unsigned handle) { void *object; unsigned index; - + assert(ht); assert(handle); if(!handle || !ht || handle > ht->size) @@ -249,7 +249,7 @@ handle_table_remove(struct handle_table *ht, object = ht->objects[index]; if(!object) return; - + handle_table_clear(ht, index); if(index < ht->filled) @@ -258,11 +258,11 @@ handle_table_remove(struct handle_table *ht, unsigned -handle_table_get_next_handle(struct handle_table *ht, +handle_table_get_next_handle(struct handle_table *ht, unsigned handle) { unsigned index; - + for(index = handle; index < ht->size; ++index) { if(ht->objects[index]) return index + 1; @@ -291,7 +291,7 @@ handle_table_destroy(struct handle_table *ht) if(ht->destroy) for(index = 0; index < ht->size; ++index) handle_table_clear(ht, index); - + FREE(ht->objects); FREE(ht); } diff --git a/src/gallium/auxiliary/util/u_handle_table.h b/src/gallium/auxiliary/util/u_handle_table.h index d080135..d47b249 100644 --- a/src/gallium/auxiliary/util/u_handle_table.h +++ b/src/gallium/auxiliary/util/u_handle_table.h @@ -28,7 +28,7 @@ /** * @file * Generic handle table. - * + * * @author José Fonseca */ @@ -40,10 +40,10 @@ extern "C" { #endif - + /** * Abstract data type to map integer handles to objects. - * + * * Also referred as "pointer array". */ struct handle_table; @@ -55,8 +55,8 @@ handle_table_create(void); /** * Set an optional destructor callback. - * - * If set, it will be called during handle_table_remove and + * + * If set, it will be called during handle_table_remove and * handle_table_destroy calls. */ void @@ -66,33 +66,33 @@ handle_table_set_destroy(struct handle_table *ht, /** * Add a new object. - * + * * Returns a zero handle on failure (out of memory). */ unsigned -handle_table_add(struct handle_table *ht, +handle_table_add(struct handle_table *ht, void *object); /** * Returns zero on failure (out of memory). */ unsigned -handle_table_set(struct handle_table *ht, +handle_table_set(struct handle_table *ht, unsigned handle, void *object); /** * Fetch an existing object. - * + * * Returns NULL for an invalid handle. */ void * -handle_table_get(struct handle_table *ht, +handle_table_get(struct handle_table *ht, unsigned handle); void -handle_table_remove(struct handle_table *ht, +handle_table_remove(struct handle_table *ht, unsigned handle); diff --git a/src/gallium/auxiliary/util/u_hash.c b/src/gallium/auxiliary/util/u_hash.c index b67653e..adab2b6 100644 --- a/src/gallium/auxiliary/util/u_hash.c +++ b/src/gallium/auxiliary/util/u_hash.c @@ -28,7 +28,7 @@ /** * @file * Hash functions implementation. - * + * * @author Jose Fonseca */ @@ -36,71 +36,71 @@ #include "u_hash.h" -static const uint32_t +static const uint32_t util_crc32_table[256] = { - 0x00000000, 0x77073096, 0xee0e612c, 0x990951ba, - 0x076dc419, 0x706af48f, 0xe963a535, 0x9e6495a3, - 0x0edb8832, 0x79dcb8a4, 0xe0d5e91e, 0x97d2d988, - 0x09b64c2b, 0x7eb17cbd, 0xe7b82d07, 0x90bf1d91, - 0x1db71064, 0x6ab020f2, 0xf3b97148, 0x84be41de, - 0x1adad47d, 0x6ddde4eb, 0xf4d4b551, 0x83d385c7, - 0x136c9856, 0x646ba8c0, 0xfd62f97a, 0x8a65c9ec, - 0x14015c4f, 0x63066cd9, 0xfa0f3d63, 0x8d080df5, - 0x3b6e20c8, 0x4c69105e, 0xd56041e4, 0xa2677172, - 0x3c03e4d1, 0x4b04d447, 0xd20d85fd, 0xa50ab56b, - 0x35b5a8fa, 0x42b2986c, 0xdbbbc9d6, 0xacbcf940, - 0x32d86ce3, 0x45df5c75, 0xdcd60dcf, 0xabd13d59, - 0x26d930ac, 0x51de003a, 0xc8d75180, 0xbfd06116, - 0x21b4f4b5, 0x56b3c423, 0xcfba9599, 0xb8bda50f, - 0x2802b89e, 0x5f058808, 0xc60cd9b2, 0xb10be924, - 0x2f6f7c87, 0x58684c11, 0xc1611dab, 0xb6662d3d, - 0x76dc4190, 0x01db7106, 0x98d220bc, 0xefd5102a, - 0x71b18589, 0x06b6b51f, 0x9fbfe4a5, 0xe8b8d433, - 0x7807c9a2, 0x0f00f934, 0x9609a88e, 0xe10e9818, - 0x7f6a0dbb, 0x086d3d2d, 0x91646c97, 0xe6635c01, - 0x6b6b51f4, 0x1c6c6162, 0x856530d8, 0xf262004e, - 0x6c0695ed, 0x1b01a57b, 0x8208f4c1, 0xf50fc457, - 0x65b0d9c6, 0x12b7e950, 0x8bbeb8ea, 0xfcb9887c, - 0x62dd1ddf, 0x15da2d49, 0x8cd37cf3, 0xfbd44c65, - 0x4db26158, 0x3ab551ce, 0xa3bc0074, 0xd4bb30e2, - 0x4adfa541, 0x3dd895d7, 0xa4d1c46d, 0xd3d6f4fb, - 0x4369e96a, 0x346ed9fc, 0xad678846, 0xda60b8d0, - 0x44042d73, 0x33031de5, 0xaa0a4c5f, 0xdd0d7cc9, - 0x5005713c, 0x270241aa, 0xbe0b1010, 0xc90c2086, - 0x5768b525, 0x206f85b3, 0xb966d409, 0xce61e49f, - 0x5edef90e, 0x29d9c998, 0xb0d09822, 0xc7d7a8b4, - 0x59b33d17, 0x2eb40d81, 0xb7bd5c3b, 0xc0ba6cad, - 0xedb88320, 0x9abfb3b6, 0x03b6e20c, 0x74b1d29a, - 0xead54739, 0x9dd277af, 0x04db2615, 0x73dc1683, - 0xe3630b12, 0x94643b84, 0x0d6d6a3e, 0x7a6a5aa8, - 0xe40ecf0b, 0x9309ff9d, 0x0a00ae27, 0x7d079eb1, - 0xf00f9344, 0x8708a3d2, 0x1e01f268, 0x6906c2fe, - 0xf762575d, 0x806567cb, 0x196c3671, 0x6e6b06e7, - 0xfed41b76, 0x89d32be0, 0x10da7a5a, 0x67dd4acc, - 0xf9b9df6f, 0x8ebeeff9, 0x17b7be43, 0x60b08ed5, - 0xd6d6a3e8, 0xa1d1937e, 0x38d8c2c4, 0x4fdff252, - 0xd1bb67f1, 0xa6bc5767, 0x3fb506dd, 0x48b2364b, - 0xd80d2bda, 0xaf0a1b4c, 0x36034af6, 0x41047a60, - 0xdf60efc3, 0xa867df55, 0x316e8eef, 0x4669be79, - 0xcb61b38c, 0xbc66831a, 0x256fd2a0, 0x5268e236, - 0xcc0c7795, 0xbb0b4703, 0x220216b9, 0x5505262f, - 0xc5ba3bbe, 0xb2bd0b28, 0x2bb45a92, 0x5cb36a04, - 0xc2d7ffa7, 0xb5d0cf31, 0x2cd99e8b, 0x5bdeae1d, - 0x9b64c2b0, 0xec63f226, 0x756aa39c, 0x026d930a, - 0x9c0906a9, 0xeb0e363f, 0x72076785, 0x05005713, - 0x95bf4a82, 0xe2b87a14, 0x7bb12bae, 0x0cb61b38, - 0x92d28e9b, 0xe5d5be0d, 0x7cdcefb7, 0x0bdbdf21, - 0x86d3d2d4, 0xf1d4e242, 0x68ddb3f8, 0x1fda836e, - 0x81be16cd, 0xf6b9265b, 0x6fb077e1, 0x18b74777, - 0x88085ae6, 0xff0f6a70, 0x66063bca, 0x11010b5c, - 0x8f659eff, 0xf862ae69, 0x616bffd3, 0x166ccf45, - 0xa00ae278, 0xd70dd2ee, 0x4e048354, 0x3903b3c2, - 0xa7672661, 0xd06016f7, 0x4969474d, 0x3e6e77db, - 0xaed16a4a, 0xd9d65adc, 0x40df0b66, 0x37d83bf0, - 0xa9bcae53, 0xdebb9ec5, 0x47b2cf7f, 0x30b5ffe9, - 0xbdbdf21c, 0xcabac28a, 0x53b39330, 0x24b4a3a6, - 0xbad03605, 0xcdd70693, 0x54de5729, 0x23d967bf, - 0xb3667a2e, 0xc4614ab8, 0x5d681b02, 0x2a6f2b94, + 0x00000000, 0x77073096, 0xee0e612c, 0x990951ba, + 0x076dc419, 0x706af48f, 0xe963a535, 0x9e6495a3, + 0x0edb8832, 0x79dcb8a4, 0xe0d5e91e, 0x97d2d988, + 0x09b64c2b, 0x7eb17cbd, 0xe7b82d07, 0x90bf1d91, + 0x1db71064, 0x6ab020f2, 0xf3b97148, 0x84be41de, + 0x1adad47d, 0x6ddde4eb, 0xf4d4b551, 0x83d385c7, + 0x136c9856, 0x646ba8c0, 0xfd62f97a, 0x8a65c9ec, + 0x14015c4f, 0x63066cd9, 0xfa0f3d63, 0x8d080df5, + 0x3b6e20c8, 0x4c69105e, 0xd56041e4, 0xa2677172, + 0x3c03e4d1, 0x4b04d447, 0xd20d85fd, 0xa50ab56b, + 0x35b5a8fa, 0x42b2986c, 0xdbbbc9d6, 0xacbcf940, + 0x32d86ce3, 0x45df5c75, 0xdcd60dcf, 0xabd13d59, + 0x26d930ac, 0x51de003a, 0xc8d75180, 0xbfd06116, + 0x21b4f4b5, 0x56b3c423, 0xcfba9599, 0xb8bda50f, + 0x2802b89e, 0x5f058808, 0xc60cd9b2, 0xb10be924, + 0x2f6f7c87, 0x58684c11, 0xc1611dab, 0xb6662d3d, + 0x76dc4190, 0x01db7106, 0x98d220bc, 0xefd5102a, + 0x71b18589, 0x06b6b51f, 0x9fbfe4a5, 0xe8b8d433, + 0x7807c9a2, 0x0f00f934, 0x9609a88e, 0xe10e9818, + 0x7f6a0dbb, 0x086d3d2d, 0x91646c97, 0xe6635c01, + 0x6b6b51f4, 0x1c6c6162, 0x856530d8, 0xf262004e, + 0x6c0695ed, 0x1b01a57b, 0x8208f4c1, 0xf50fc457, + 0x65b0d9c6, 0x12b7e950, 0x8bbeb8ea, 0xfcb9887c, + 0x62dd1ddf, 0x15da2d49, 0x8cd37cf3, 0xfbd44c65, + 0x4db26158, 0x3ab551ce, 0xa3bc0074, 0xd4bb30e2, + 0x4adfa541, 0x3dd895d7, 0xa4d1c46d, 0xd3d6f4fb, + 0x4369e96a, 0x346ed9fc, 0xad678846, 0xda60b8d0, + 0x44042d73, 0x33031de5, 0xaa0a4c5f, 0xdd0d7cc9, + 0x5005713c, 0x270241aa, 0xbe0b1010, 0xc90c2086, + 0x5768b525, 0x206f85b3, 0xb966d409, 0xce61e49f, + 0x5edef90e, 0x29d9c998, 0xb0d09822, 0xc7d7a8b4, + 0x59b33d17, 0x2eb40d81, 0xb7bd5c3b, 0xc0ba6cad, + 0xedb88320, 0x9abfb3b6, 0x03b6e20c, 0x74b1d29a, + 0xead54739, 0x9dd277af, 0x04db2615, 0x73dc1683, + 0xe3630b12, 0x94643b84, 0x0d6d6a3e, 0x7a6a5aa8, + 0xe40ecf0b, 0x9309ff9d, 0x0a00ae27, 0x7d079eb1, + 0xf00f9344, 0x8708a3d2, 0x1e01f268, 0x6906c2fe, + 0xf762575d, 0x806567cb, 0x196c3671, 0x6e6b06e7, + 0xfed41b76, 0x89d32be0, 0x10da7a5a, 0x67dd4acc, + 0xf9b9df6f, 0x8ebeeff9, 0x17b7be43, 0x60b08ed5, + 0xd6d6a3e8, 0xa1d1937e, 0x38d8c2c4, 0x4fdff252, + 0xd1bb67f1, 0xa6bc5767, 0x3fb506dd, 0x48b2364b, + 0xd80d2bda, 0xaf0a1b4c, 0x36034af6, 0x41047a60, + 0xdf60efc3, 0xa867df55, 0x316e8eef, 0x4669be79, + 0xcb61b38c, 0xbc66831a, 0x256fd2a0, 0x5268e236, + 0xcc0c7795, 0xbb0b4703, 0x220216b9, 0x5505262f, + 0xc5ba3bbe, 0xb2bd0b28, 0x2bb45a92, 0x5cb36a04, + 0xc2d7ffa7, 0xb5d0cf31, 0x2cd99e8b, 0x5bdeae1d, + 0x9b64c2b0, 0xec63f226, 0x756aa39c, 0x026d930a, + 0x9c0906a9, 0xeb0e363f, 0x72076785, 0x05005713, + 0x95bf4a82, 0xe2b87a14, 0x7bb12bae, 0x0cb61b38, + 0x92d28e9b, 0xe5d5be0d, 0x7cdcefb7, 0x0bdbdf21, + 0x86d3d2d4, 0xf1d4e242, 0x68ddb3f8, 0x1fda836e, + 0x81be16cd, 0xf6b9265b, 0x6fb077e1, 0x18b74777, + 0x88085ae6, 0xff0f6a70, 0x66063bca, 0x11010b5c, + 0x8f659eff, 0xf862ae69, 0x616bffd3, 0x166ccf45, + 0xa00ae278, 0xd70dd2ee, 0x4e048354, 0x3903b3c2, + 0xa7672661, 0xd06016f7, 0x4969474d, 0x3e6e77db, + 0xaed16a4a, 0xd9d65adc, 0x40df0b66, 0x37d83bf0, + 0xa9bcae53, 0xdebb9ec5, 0x47b2cf7f, 0x30b5ffe9, + 0xbdbdf21c, 0xcabac28a, 0x53b39330, 0x24b4a3a6, + 0xbad03605, 0xcdd70693, 0x54de5729, 0x23d967bf, + 0xb3667a2e, 0xc4614ab8, 0x5d681b02, 0x2a6f2b94, 0xb40bbe37, 0xc30c8ea1, 0x5a05df1b, 0x2d02ef8d }; @@ -113,9 +113,9 @@ util_hash_crc32(const void *data, size_t size) { uint8_t *p = (uint8_t *)data; uint32_t crc = 0xffffffff; - + while (size--) crc = util_crc32_table[(crc ^ *p++) & 0xff] ^ (crc >> 8); - + return crc; } diff --git a/src/gallium/auxiliary/util/u_hash.h b/src/gallium/auxiliary/util/u_hash.h index 8d92b07..aee65c0 100644 --- a/src/gallium/auxiliary/util/u_hash.h +++ b/src/gallium/auxiliary/util/u_hash.h @@ -28,7 +28,7 @@ /** * @file * Hash functions. - * + * * @author Jose Fonseca */ @@ -43,7 +43,7 @@ extern "C" { #endif - + uint32_t util_hash_crc32(const void *data, size_t size); diff --git a/src/gallium/auxiliary/util/u_hash_table.c b/src/gallium/auxiliary/util/u_hash_table.c index 5604e3a..dcf2606 100644 --- a/src/gallium/auxiliary/util/u_hash_table.c +++ b/src/gallium/auxiliary/util/u_hash_table.c @@ -28,12 +28,12 @@ /** * @file * General purpose hash table implementation. - * - * Just uses the cso_hash for now, but it might be better switch to a linear - * probing hash table implementation at some point -- as it is said they have - * better lookup and cache performance and it appears to be possible to write - * a lock-free implementation of such hash tables . - * + * + * Just uses the cso_hash for now, but it might be better switch to a linear + * probing hash table implementation at some point -- as it is said they have + * better lookup and cache performance and it appears to be possible to write + * a lock-free implementation of such hash tables . + * * @author José Fonseca */ @@ -49,14 +49,14 @@ struct util_hash_table { - struct cso_hash *cso; - + struct cso_hash *cso; + /** Hash function */ unsigned (*hash)(void *key); - + /** Compare two keys */ int (*compare)(void *key1, void *key2); - + /* TODO: key, value destructors? */ }; @@ -80,20 +80,20 @@ util_hash_table_create(unsigned (*hash)(void *key), int (*compare)(void *key1, void *key2)) { struct util_hash_table *ht; - + ht = MALLOC_STRUCT(util_hash_table); if(!ht) return NULL; - + ht->cso = cso_hash_create(); if(!ht->cso) { FREE(ht); return NULL; } - + ht->hash = hash; ht->compare = compare; - + return ht; } @@ -105,7 +105,7 @@ util_hash_table_find_iter(struct util_hash_table *ht, { struct cso_hash_iter iter; struct util_hash_table_item *item; - + iter = cso_hash_find(ht->cso, key_hash); while (!cso_hash_iter_is_null(iter)) { item = (struct util_hash_table_item *)cso_hash_iter_data(iter); @@ -113,7 +113,7 @@ util_hash_table_find_iter(struct util_hash_table *ht, break; iter = cso_hash_iter_next(iter); } - + return iter; } @@ -125,7 +125,7 @@ util_hash_table_find_item(struct util_hash_table *ht, { struct cso_hash_iter iter; struct util_hash_table_item *item; - + iter = cso_hash_find(ht->cso, key_hash); while (!cso_hash_iter_is_null(iter)) { item = (struct util_hash_table_item *)cso_hash_iter_data(iter); @@ -133,7 +133,7 @@ util_hash_table_find_item(struct util_hash_table *ht, return item; iter = cso_hash_iter_next(iter); } - + return NULL; } @@ -159,14 +159,14 @@ util_hash_table_set(struct util_hash_table *ht, item->value = value; return PIPE_OK; } - + item = MALLOC_STRUCT(util_hash_table_item); if(!item) return PIPE_ERROR_OUT_OF_MEMORY; - + item->key = key; item->value = value; - + iter = cso_hash_insert(ht->cso, key_hash, item); if(cso_hash_iter_is_null(iter)) { FREE(item); @@ -193,7 +193,7 @@ util_hash_table_get(struct util_hash_table *ht, item = util_hash_table_find_item(ht, key, key_hash); if(!item) return NULL; - + return item->value; } @@ -215,16 +215,16 @@ util_hash_table_remove(struct util_hash_table *ht, iter = util_hash_table_find_iter(ht, key, key_hash); if(cso_hash_iter_is_null(iter)) return; - + item = util_hash_table_item(iter); assert(item); FREE(item); - + cso_hash_erase(ht->cso, iter); } -void +void util_hash_table_clear(struct util_hash_table *ht) { struct cso_hash_iter iter; @@ -288,6 +288,6 @@ util_hash_table_destroy(struct util_hash_table *ht) } cso_hash_delete(ht->cso); - + FREE(ht); } diff --git a/src/gallium/auxiliary/util/u_hash_table.h b/src/gallium/auxiliary/util/u_hash_table.h index 51ec10a..361ec8f 100644 --- a/src/gallium/auxiliary/util/u_hash_table.h +++ b/src/gallium/auxiliary/util/u_hash_table.h @@ -27,7 +27,7 @@ /** * General purpose hash table. - * + * * @author José Fonseca */ @@ -42,7 +42,7 @@ extern "C" { #endif - + /** * Generic purpose hash table. */ @@ -51,7 +51,7 @@ struct util_hash_table; /** * Create an hash table. - * + * * @param hash hash function * @param compare should return 0 for two equal keys. */ diff --git a/src/gallium/auxiliary/util/u_inlines.h b/src/gallium/auxiliary/util/u_inlines.h index e55aafe..f72ef02 100644 --- a/src/gallium/auxiliary/util/u_inlines.h +++ b/src/gallium/auxiliary/util/u_inlines.h @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ #ifndef U_INLINES_H @@ -69,8 +69,8 @@ pipe_is_referenced(struct pipe_reference *reference) * \return TRUE if the object's refcount hits zero and should be destroyed. */ static INLINE boolean -pipe_reference_described(struct pipe_reference *ptr, - struct pipe_reference *reference, +pipe_reference_described(struct pipe_reference *ptr, + struct pipe_reference *reference, debug_reference_descriptor get_desc) { boolean destroy = FALSE; @@ -98,7 +98,7 @@ pipe_reference_described(struct pipe_reference *ptr, static INLINE boolean pipe_reference(struct pipe_reference *ptr, struct pipe_reference *reference) { - return pipe_reference_described(ptr, reference, + return pipe_reference_described(ptr, reference, (debug_reference_descriptor)debug_describe_reference); } @@ -107,7 +107,7 @@ pipe_surface_reference(struct pipe_surface **ptr, struct pipe_surface *surf) { struct pipe_surface *old_surf = *ptr; - if (pipe_reference_described(&(*ptr)->reference, &surf->reference, + if (pipe_reference_described(&(*ptr)->reference, &surf->reference, (debug_reference_descriptor)debug_describe_surface)) old_surf->context->surface_destroy(old_surf->context, old_surf); *ptr = surf; @@ -118,7 +118,7 @@ pipe_resource_reference(struct pipe_resource **ptr, struct pipe_resource *tex) { struct pipe_resource *old_tex = *ptr; - if (pipe_reference_described(&(*ptr)->reference, &tex->reference, + if (pipe_reference_described(&(*ptr)->reference, &tex->reference, (debug_reference_descriptor)debug_describe_resource)) old_tex->screen->resource_destroy(old_tex->screen, old_tex); *ptr = tex; @@ -377,14 +377,14 @@ pipe_transfer_unmap( struct pipe_context *context, static INLINE void -pipe_transfer_destroy( struct pipe_context *context, +pipe_transfer_destroy( struct pipe_context *context, struct pipe_transfer *transfer ) { context->transfer_destroy(context, transfer); } -static INLINE boolean util_get_offset( +static INLINE boolean util_get_offset( const struct pipe_rasterizer_state *templ, unsigned fill_mode) { diff --git a/src/gallium/auxiliary/util/u_keymap.c b/src/gallium/auxiliary/util/u_keymap.c index e161ccd..1fbdf4d 100644 --- a/src/gallium/auxiliary/util/u_keymap.c +++ b/src/gallium/auxiliary/util/u_keymap.c @@ -45,7 +45,7 @@ struct keymap { - struct cso_hash *cso; + struct cso_hash *cso; unsigned key_size; unsigned max_entries; /* XXX not obeyed net */ unsigned num_entries; @@ -113,13 +113,13 @@ util_new_keymap(unsigned keySize, unsigned maxEntries, struct keymap *map = MALLOC_STRUCT(keymap); if (!map) return NULL; - + map->cso = cso_hash_create(); if (!map->cso) { FREE(map); return NULL; } - + map->max_entries = maxEntries; map->num_entries = 0; map->key_size = keySize; @@ -149,7 +149,7 @@ hash_table_find_iter(const struct keymap *map, const void *key, { struct cso_hash_iter iter; struct keymap_item *item; - + iter = cso_hash_find(map->cso, key_hash); while (!cso_hash_iter_is_null(iter)) { item = (struct keymap_item *) cso_hash_iter_data(iter); @@ -157,7 +157,7 @@ hash_table_find_iter(const struct keymap *map, const void *key, break; iter = cso_hash_iter_next(iter); } - + return iter; } @@ -205,14 +205,14 @@ util_keymap_insert(struct keymap *map, const void *key, item->value = (void *) data; return TRUE; } - + item = MALLOC_STRUCT(keymap_item); if (!item) return FALSE; item->key = mem_dup(key, map->key_size); item->value = (void *) data; - + iter = cso_hash_insert(map->cso, key_hash, item); if (cso_hash_iter_is_null(iter)) { FREE(item); @@ -243,7 +243,7 @@ util_keymap_lookup(const struct keymap *map, const void *key) item = hash_table_find_item(map, key, key_hash); if (!item) return NULL; - + return item->value; } @@ -269,7 +269,7 @@ util_keymap_remove(struct keymap *map, const void *key, void *user) iter = hash_table_find_iter(map, key, key_hash); if (cso_hash_iter_is_null(iter)) return; - + item = hash_table_item(iter); assert(item); if (!item) @@ -277,7 +277,7 @@ util_keymap_remove(struct keymap *map, const void *key, void *user) map->delete_func(map, item->key, item->value, user); FREE(item->key); FREE(item); - + map->num_entries--; cso_hash_erase(map->cso, iter); diff --git a/src/gallium/auxiliary/util/u_keymap.h b/src/gallium/auxiliary/util/u_keymap.h index 8d60a76..67587ec 100644 --- a/src/gallium/auxiliary/util/u_keymap.h +++ b/src/gallium/auxiliary/util/u_keymap.h @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ #ifndef U_KEYMAP_H diff --git a/src/gallium/auxiliary/util/u_linear.c b/src/gallium/auxiliary/util/u_linear.c index f1aef21..c178ac9 100644 --- a/src/gallium/auxiliary/util/u_linear.c +++ b/src/gallium/auxiliary/util/u_linear.c @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2009 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. - * + * **************************************************************************/ /** diff --git a/src/gallium/auxiliary/util/u_linear.h b/src/gallium/auxiliary/util/u_linear.h index 81ffc9f..d0e1c5f 100644 --- a/src/gallium/auxiliary/util/u_linear.h +++ b/src/gallium/auxiliary/util/u_linear.h @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2009 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. - * + * **************************************************************************/ /** @@ -40,10 +40,10 @@ struct u_linear_format_block { /** Block size in bytes */ unsigned size; - + /** Block width in pixels */ unsigned width; - + /** Block height in pixels */ unsigned height; }; diff --git a/src/gallium/auxiliary/util/u_math.c b/src/gallium/auxiliary/util/u_math.c index 2811475..75a6905 100644 --- a/src/gallium/auxiliary/util/u_math.c +++ b/src/gallium/auxiliary/util/u_math.c @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ @@ -47,7 +47,7 @@ init_pow2_table(void) float log2_table[LOG2_TABLE_SIZE]; -static void +static void init_log2_table(void) { unsigned i; diff --git a/src/gallium/auxiliary/util/u_math.h b/src/gallium/auxiliary/util/u_math.h index 37294b7..9f82379 100644 --- a/src/gallium/auxiliary/util/u_math.h +++ b/src/gallium/auxiliary/util/u_math.h @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ @@ -123,46 +123,46 @@ __inline double __cdecl atan2(double val) #endif -#if defined(_MSC_VER) +#if defined(_MSC_VER) #if _MSC_VER < 1400 && !defined(__cplusplus) || defined(PIPE_SUBSYSTEM_WINDOWS_CE) - -static INLINE float cosf( float f ) + +static INLINE float cosf( float f ) { return (float) cos( (double) f ); } -static INLINE float sinf( float f ) +static INLINE float sinf( float f ) { return (float) sin( (double) f ); } -static INLINE float ceilf( float f ) +static INLINE float ceilf( float f ) { return (float) ceil( (double) f ); } -static INLINE float floorf( float f ) +static INLINE float floorf( float f ) { return (float) floor( (double) f ); } -static INLINE float powf( float f, float g ) +static INLINE float powf( float f, float g ) { return (float) pow( (double) f, (double) g ); } -static INLINE float sqrtf( float f ) +static INLINE float sqrtf( float f ) { return (float) sqrt( (double) f ); } -static INLINE float fabsf( float f ) +static INLINE float fabsf( float f ) { return (float) fabs( (double) f ); } -static INLINE float logf( float f ) +static INLINE float logf( float f ) { return (float) log( (double) f ); } @@ -323,7 +323,7 @@ util_ifloor(float f) static INLINE int util_iround(float f) { -#if defined(PIPE_CC_GCC) && defined(PIPE_ARCH_X86) +#if defined(PIPE_CC_GCC) && defined(PIPE_ARCH_X86) int r; __asm__ ("fistpl %0" : "=m" (r) : "t" (f) : "st"); return r; diff --git a/src/gallium/auxiliary/util/u_memory.h b/src/gallium/auxiliary/util/u_memory.h index 53d5659..3c6c6fc 100644 --- a/src/gallium/auxiliary/util/u_memory.h +++ b/src/gallium/auxiliary/util/u_memory.h @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ diff --git a/src/gallium/auxiliary/util/u_mm.c b/src/gallium/auxiliary/util/u_mm.c index 82f8370..d66a29e 100644 --- a/src/gallium/auxiliary/util/u_mm.c +++ b/src/gallium/auxiliary/util/u_mm.c @@ -15,9 +15,9 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * WITTAWAT YAMWONG, OR ANY OTHER CONTRIBUTORS BE LIABLE FOR ANY CLAIM, - * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR - * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE + * WITTAWAT YAMWONG, OR ANY OTHER CONTRIBUTORS BE LIABLE FOR ANY CLAIM, + * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * **************************************************************************/ @@ -70,14 +70,14 @@ struct mem_block * u_mmInit(int ofs, int size) { struct mem_block *heap, *block; - - if (size <= 0) + + if (size <= 0) return NULL; heap = CALLOC_STRUCT(mem_block); - if (!heap) + if (!heap) return NULL; - + block = CALLOC_STRUCT(mem_block); if (!block) { FREE(heap); @@ -104,8 +104,8 @@ u_mmInit(int ofs, int size) static struct mem_block * -SliceBlock(struct mem_block *p, - int startofs, int size, +SliceBlock(struct mem_block *p, + int startofs, int size, int reserved, int alignment) { struct mem_block *newblock; @@ -153,14 +153,14 @@ SliceBlock(struct mem_block *p, newblock->prev_free = p; p->next_free->prev_free = newblock; p->next_free = newblock; - + p->size = size; } /* p = middle block */ p->free = 0; - /* Remove p from the free list: + /* Remove p from the free list: */ p->next_free->prev_free = p->prev_free; p->prev_free->next_free = p->next_free; @@ -200,7 +200,7 @@ u_mmAllocMem(struct mem_block *heap, int size, int align2, int startSearch) break; } - if (p == heap) + if (p == heap) return NULL; assert(p->free); @@ -216,7 +216,7 @@ u_mmFindBlock(struct mem_block *heap, int start) struct mem_block *p; for (p = heap->next; p != heap; p = p->next) { - if (p->ofs == start) + if (p->ofs == start) return p; } @@ -240,9 +240,9 @@ Join2Blocks(struct mem_block *p) p->next = q->next; q->next->prev = p; - q->next_free->prev_free = q->prev_free; + q->next_free->prev_free = q->prev_free; q->prev_free->next_free = q->next_free; - + FREE(q); return 1; } diff --git a/src/gallium/auxiliary/util/u_mm.h b/src/gallium/auxiliary/util/u_mm.h index 6b158aa..66886fe 100644 --- a/src/gallium/auxiliary/util/u_mm.h +++ b/src/gallium/auxiliary/util/u_mm.h @@ -15,9 +15,9 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * KEITH WHITWELL, OR ANY OTHER CONTRIBUTORS BE LIABLE FOR ANY CLAIM, - * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR - * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE + * KEITH WHITWELL, OR ANY OTHER CONTRIBUTORS BE LIABLE FOR ANY CLAIM, + * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * **************************************************************************/ @@ -45,7 +45,7 @@ struct mem_block { -/** +/** * input: total size in bytes * return: a heap pointer if OK, NULL if error */ @@ -61,7 +61,7 @@ extern struct mem_block *u_mmInit(int ofs, int size); * startSearch = linear offset from start of heap to begin search * return: pointer to the allocated block, 0 if error */ -extern struct mem_block *u_mmAllocMem(struct mem_block *heap, int size, int align2, +extern struct mem_block *u_mmAllocMem(struct mem_block *heap, int size, int align2, int startSearch); /** diff --git a/src/gallium/auxiliary/util/u_pack_color.h b/src/gallium/auxiliary/util/u_pack_color.h index 5378f2d..80e1f28 100644 --- a/src/gallium/auxiliary/util/u_pack_color.h +++ b/src/gallium/auxiliary/util/u_pack_color.h @@ -155,7 +155,7 @@ util_pack_color_ub(ubyte r, ubyte g, ubyte b, ubyte a, } } } - + /** * Unpack RGBA from a packed pixel, returning values as ubytes in [0,255]. @@ -430,7 +430,7 @@ util_pack_color(const float rgba[4], enum pipe_format format, union util_color * util_format_write_4f(format, rgba, 0, uc, 0, 0, 0, 1, 1); } } - + /* Integer versions of util_pack_z and util_pack_z_stencil - useful for * constructing clear masks. */ @@ -525,7 +525,7 @@ util_pack_z(enum pipe_format format, double z) return 0; } } - + /** * Pack Z and/or stencil values into a 32-bit value described by format. diff --git a/src/gallium/auxiliary/util/u_pointer.h b/src/gallium/auxiliary/util/u_pointer.h index cce0c74..6c0f849 100644 --- a/src/gallium/auxiliary/util/u_pointer.h +++ b/src/gallium/auxiliary/util/u_pointer.h @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2007-2008 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ #ifndef U_POINTER_H diff --git a/src/gallium/auxiliary/util/u_rect.c b/src/gallium/auxiliary/util/u_rect.c index 56fcfac..9c8d565 100644 --- a/src/gallium/auxiliary/util/u_rect.c +++ b/src/gallium/auxiliary/util/u_rect.c @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ /** @@ -50,7 +50,7 @@ util_copy_rect(ubyte * dst, unsigned height, const ubyte * src, int src_stride, - unsigned src_x, + unsigned src_x, unsigned src_y) { unsigned i; @@ -69,7 +69,7 @@ util_copy_rect(ubyte * dst, height = (height + blockheight - 1)/blockheight; src_x /= blockwidth; src_y /= blockheight; - + dst += dst_x * blocksize; src += src_x * blocksize; dst += dst_y * dst_stride; diff --git a/src/gallium/auxiliary/util/u_rect.h b/src/gallium/auxiliary/util/u_rect.h index 4cb90d3..5c9edec 100644 --- a/src/gallium/auxiliary/util/u_rect.h +++ b/src/gallium/auxiliary/util/u_rect.h @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ diff --git a/src/gallium/auxiliary/util/u_ringbuffer.c b/src/gallium/auxiliary/util/u_ringbuffer.c index 648b105..e6300fa 100644 --- a/src/gallium/auxiliary/util/u_ringbuffer.c +++ b/src/gallium/auxiliary/util/u_ringbuffer.c @@ -5,9 +5,9 @@ #include "util/u_math.h" #include "util/u_memory.h" -/* Generic ringbuffer: +/* Generic ringbuffer: */ -struct util_ringbuffer +struct util_ringbuffer { struct util_packet *buf; unsigned mask; @@ -28,7 +28,7 @@ struct util_ringbuffer *util_ringbuffer_create( unsigned dwords ) return NULL; assert(util_is_power_of_two(dwords)); - + ring->buf = MALLOC( dwords * sizeof(unsigned) ); if (ring->buf == NULL) goto fail; diff --git a/src/gallium/auxiliary/util/u_simple_list.h b/src/gallium/auxiliary/util/u_simple_list.h index fe59771..e25d29b 100644 --- a/src/gallium/auxiliary/util/u_simple_list.h +++ b/src/gallium/auxiliary/util/u_simple_list.h @@ -4,7 +4,7 @@ * * Intended to work with a list sentinal which is created as an empty * list. Insert & delete are O(1). - * + * * \author * (C) 1997, Keith Whitwell */ @@ -151,19 +151,19 @@ do { \ /** * Test whether element is at end of the list. - * + * * \param list list. * \param elem element. - * + * * \return non-zero if element is at end of list, or zero otherwise. */ #define at_end(list, elem) ((elem) == (list)) /** * Test if a list is empty. - * + * * \param list list. - * + * * \return non-zero if list empty, or zero otherwise. */ #define is_empty_list(list) ((list)->next == (list)) @@ -185,7 +185,7 @@ do { \ * * Same as #foreach but lets you unlink the current value during a list * traversal. Useful for freeing a list, element by element. - * + * * \param ptr pointer to the current element. * \param t temporary pointer. * \param list list. diff --git a/src/gallium/auxiliary/util/u_simple_shaders.c b/src/gallium/auxiliary/util/u_simple_shaders.c index b0f2dd8..11fd3c0 100644 --- a/src/gallium/auxiliary/util/u_simple_shaders.c +++ b/src/gallium/auxiliary/util/u_simple_shaders.c @@ -29,7 +29,7 @@ /** * @file * Simple vertex/fragment shader generators. - * + * * @author Brian Paul Marek Olšák */ @@ -68,11 +68,11 @@ util_make_vertex_passthrough_shader(struct pipe_context *pipe, struct ureg_dst dst; src = ureg_DECL_vs_input( ureg, i ); - + dst = ureg_DECL_output( ureg, semantic_names[i], semantic_indexes[i]); - + ureg_MOV( ureg, dst, src ); } @@ -110,14 +110,14 @@ util_make_fragment_tex_shader_writemask(struct pipe_context *pipe, ureg = ureg_create( TGSI_PROCESSOR_FRAGMENT ); if (ureg == NULL) return NULL; - + sampler = ureg_DECL_sampler( ureg, 0 ); - tex = ureg_DECL_fs_input( ureg, - TGSI_SEMANTIC_GENERIC, 0, + tex = ureg_DECL_fs_input( ureg, + TGSI_SEMANTIC_GENERIC, 0, interp_mode ); - out = ureg_DECL_output( ureg, + out = ureg_DECL_output( ureg, TGSI_SEMANTIC_COLOR, 0 ); @@ -127,7 +127,7 @@ util_make_fragment_tex_shader_writemask(struct pipe_context *pipe, ureg_MOV( ureg, out, imm ); } - ureg_TEX( ureg, + ureg_TEX( ureg, ureg_writemask(out, writemask), tex_target, tex, sampler ); ureg_END( ureg ); diff --git a/src/gallium/auxiliary/util/u_simple_shaders.h b/src/gallium/auxiliary/util/u_simple_shaders.h index 1bfec18..09e7ab8 100644 --- a/src/gallium/auxiliary/util/u_simple_shaders.h +++ b/src/gallium/auxiliary/util/u_simple_shaders.h @@ -50,7 +50,7 @@ util_make_vertex_passthrough_shader(struct pipe_context *pipe, extern void * -util_make_fragment_tex_shader_writemask(struct pipe_context *pipe, +util_make_fragment_tex_shader_writemask(struct pipe_context *pipe, unsigned tex_target, unsigned interp_mode, unsigned writemask); diff --git a/src/gallium/auxiliary/util/u_snprintf.c b/src/gallium/auxiliary/util/u_snprintf.c index 65bdd0d..3c3db2c 100644 --- a/src/gallium/auxiliary/util/u_snprintf.c +++ b/src/gallium/auxiliary/util/u_snprintf.c @@ -334,13 +334,13 @@ static void *mymemcpy(void *, void *, size_t); #endif /* HAVE_UINTPTR_T || defined(uintptr_t) */ #endif /* !defined(UINTPTR_T) */ -/* WinCE5.0 does not have uintptr_t defined */ -#if (_WIN32_WCE < 600) -#ifdef UINTPTR_T -#undef UINTPTR_T -#endif -#define UINTPTR_T unsigned long int -#endif +/* WinCE5.0 does not have uintptr_t defined */ +#if (_WIN32_WCE < 600) +#ifdef UINTPTR_T +#undef UINTPTR_T +#endif +#define UINTPTR_T unsigned long int +#endif /* Support for ptrdiff_t. */ diff --git a/src/gallium/auxiliary/util/u_sse.h b/src/gallium/auxiliary/util/u_sse.h index 1df6c87..980edbb 100644 --- a/src/gallium/auxiliary/util/u_sse.h +++ b/src/gallium/auxiliary/util/u_sse.h @@ -28,9 +28,9 @@ /** * @file * SSE intrinsics portability header. - * - * Although the SSE intrinsics are support by all modern x86 and x86-64 - * compilers, there are some intrisincs missing in some implementations + * + * Although the SSE intrinsics are support by all modern x86 and x86-64 + * compilers, there are some intrisincs missing in some implementations * (especially older MSVC versions). This header abstracts that away. */ diff --git a/src/gallium/auxiliary/util/u_string.h b/src/gallium/auxiliary/util/u_string.h index cc7992d..d7914da 100644 --- a/src/gallium/auxiliary/util/u_string.h +++ b/src/gallium/auxiliary/util/u_string.h @@ -188,7 +188,7 @@ struct util_strbuf static INLINE void -util_strbuf_init(struct util_strbuf *sbuf, char *str, size_t size) +util_strbuf_init(struct util_strbuf *sbuf, char *str, size_t size) { sbuf->str = str; sbuf->str[0] = 0; diff --git a/src/gallium/auxiliary/util/u_surface.c b/src/gallium/auxiliary/util/u_surface.c index 4eddd3f..f56776e 100644 --- a/src/gallium/auxiliary/util/u_surface.c +++ b/src/gallium/auxiliary/util/u_surface.c @@ -27,7 +27,7 @@ /** * @file * Surface utility functions. - * + * * @author Brian Paul */ diff --git a/src/gallium/auxiliary/util/u_tile.c b/src/gallium/auxiliary/util/u_tile.c index 44cadbf..fbab23c 100644 --- a/src/gallium/auxiliary/util/u_tile.c +++ b/src/gallium/auxiliary/util/u_tile.c @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ /** diff --git a/src/gallium/auxiliary/util/u_tile.h b/src/gallium/auxiliary/util/u_tile.h index 558351d..275792e 100644 --- a/src/gallium/auxiliary/util/u_tile.h +++ b/src/gallium/auxiliary/util/u_tile.h @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ #ifndef P_TILE_H diff --git a/src/gallium/auxiliary/util/u_time.h b/src/gallium/auxiliary/util/u_time.h index 15899c2..66160ba 100644 --- a/src/gallium/auxiliary/util/u_time.h +++ b/src/gallium/auxiliary/util/u_time.h @@ -28,7 +28,7 @@ /** * @file * OS independent time-manipulation functions. - * + * * @author Jose Fonseca */ @@ -50,14 +50,14 @@ extern "C" { /** * Time abstraction. - * + * * Do not access this structure directly. Use the provided function instead. */ -struct util_time +struct util_time { int64_t counter; }; - + PIPE_DEPRECATED static INLINE void @@ -85,7 +85,7 @@ util_time_add(const struct util_time *t1, */ PIPE_DEPRECATED static INLINE int64_t -util_time_diff(const struct util_time *t1, +util_time_diff(const struct util_time *t1, const struct util_time *t2) { return t2->counter - t1->counter; @@ -116,7 +116,7 @@ _util_time_compare(const struct util_time *t1, */ PIPE_DEPRECATED static INLINE boolean -util_time_timeout(const struct util_time *start, +util_time_timeout(const struct util_time *start, const struct util_time *end, const struct util_time *curr) { diff --git a/src/gallium/auxiliary/util/u_transfer.c b/src/gallium/auxiliary/util/u_transfer.c index e2828cf..465096e 100644 --- a/src/gallium/auxiliary/util/u_transfer.c +++ b/src/gallium/auxiliary/util/u_transfer.c @@ -96,7 +96,7 @@ struct pipe_transfer * u_default_get_transfer(struct pipe_context *context, transfer->box = *box; /* Note strides are zero, this is ok for buffers, but not for - * textures 2d & higher at least. + * textures 2d & higher at least. */ return transfer; } diff --git a/src/gallium/auxiliary/util/u_upload_mgr.c b/src/gallium/auxiliary/util/u_upload_mgr.c index af229e6..b1c4a84 100644 --- a/src/gallium/auxiliary/util/u_upload_mgr.c +++ b/src/gallium/auxiliary/util/u_upload_mgr.c @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2009 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. - * + * **************************************************************************/ /* Helper utility for uploading user buffers & other data, and @@ -78,7 +78,7 @@ struct u_upload_mgr *u_upload_create( struct pipe_context *pipe, * dirty_size may be slightly greater than size to cope with * alignment. We don't want to leave holes between succesively mapped * regions as that may prevent the driver from consolidating uploads. - * + * * Note that the 'data' pointer has probably come from the application * and we cannot read even a byte past its end without risking * segfaults, or at least complaints from valgrind.. @@ -91,7 +91,7 @@ my_buffer_write(struct pipe_context *pipe, { struct pipe_transfer *transfer = NULL; uint8_t *map; - + assert(offset < buf->width0); assert(offset + size <= buf->width0); assert(dirty_size >= size); @@ -103,7 +103,7 @@ my_buffer_write(struct pipe_context *pipe, PIPE_TRANSFER_DISCARD | PIPE_TRANSFER_UNSYNCHRONIZED, &transfer); - if (map == NULL) + if (map == NULL) return PIPE_ERROR_OUT_OF_MEMORY; memcpy(map + offset, data, size); @@ -114,7 +114,7 @@ my_buffer_write(struct pipe_context *pipe, } /* Release old buffer. - * + * * This must usually be called prior to firing the command stream * which references the upload buffer, as many memory managers will * cause subsequent maps of a fired buffer to wait. @@ -136,7 +136,7 @@ void u_upload_destroy( struct u_upload_mgr *upload ) } -static enum pipe_error +static enum pipe_error u_upload_alloc_buffer( struct u_upload_mgr *upload, unsigned min_size ) { @@ -146,16 +146,16 @@ u_upload_alloc_buffer( struct u_upload_mgr *upload, */ u_upload_flush( upload ); - /* Allocate a new one: + /* Allocate a new one: */ size = align(MAX2(upload->default_size, min_size), 4096); upload->buffer = pipe_buffer_create( upload->pipe->screen, upload->usage, size ); - if (upload->buffer == NULL) + if (upload->buffer == NULL) goto fail; - + upload->size = size; upload->offset = 0; @@ -186,10 +186,10 @@ enum pipe_error u_upload_data( struct u_upload_mgr *upload, /* Copy the data, using map_range if available: */ - ret = my_buffer_write( upload->pipe, + ret = my_buffer_write( upload->pipe, upload->buffer, upload->offset, - size, + size, alloc_size, data ); if (ret) @@ -233,7 +233,7 @@ enum pipe_error u_upload_buffer( struct u_upload_mgr *upload, if (0) debug_printf("upload ptr %p ofs %d sz %d\n", map, offset, size); - ret = u_upload_data( upload, + ret = u_upload_data( upload, size, map + offset, out_offset, diff --git a/src/gallium/auxiliary/util/u_upload_mgr.h b/src/gallium/auxiliary/util/u_upload_mgr.h index de016df..a9de564 100644 --- a/src/gallium/auxiliary/util/u_upload_mgr.h +++ b/src/gallium/auxiliary/util/u_upload_mgr.h @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2009 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. - * + * **************************************************************************/ /* Helper utility for uploading user buffers & other data, and @@ -44,7 +44,7 @@ struct u_upload_mgr *u_upload_create( struct pipe_context *pipe, void u_upload_destroy( struct u_upload_mgr *upload ); /* Unmap and release old buffer. - * + * * This must usually be called prior to firing the command stream * which references the upload buffer, as many memory managers either * don't like firing a mapped buffer or cause subsequent maps of a diff --git a/src/gallium/drivers/cell/common.h b/src/gallium/drivers/cell/common.h index a8cdde3..bb8f702 100644 --- a/src/gallium/drivers/cell/common.h +++ b/src/gallium/drivers/cell/common.h @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ /** @@ -162,7 +162,7 @@ struct cell_command_fence /** * Command to specify per-fragment operations state and generated code. - * Note that this is a variant-length structure, allocated with as + * Note that this is a variant-length structure, allocated with as * much memory as needed to hold the generated code; the "code" * field *must* be the last field in the structure. Also, the entire * length of the structure (including the variant code field) must be @@ -188,7 +188,7 @@ struct cell_command_fragment_ops unsigned total_code_size; unsigned front_code_index; unsigned back_code_index; - /* this field has variant length, and must be the last field in + /* this field has variant length, and must be the last field in * the structure */ unsigned code[0]; diff --git a/src/gallium/drivers/cell/ppu/cell_batch.c b/src/gallium/drivers/cell/ppu/cell_batch.c index fe144f8..2c1e931 100644 --- a/src/gallium/drivers/cell/ppu/cell_batch.c +++ b/src/gallium/drivers/cell/ppu/cell_batch.c @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ @@ -155,7 +155,7 @@ cell_batch_flush(struct cell_context *cell) printf("cell_batch_dispatch: buf %u at %p, size %u\n", batch, &cell->buffer[batch][0], size); */ - + /* * Build "BATCH" command and send to all SPUs. */ diff --git a/src/gallium/drivers/cell/ppu/cell_batch.h b/src/gallium/drivers/cell/ppu/cell_batch.h index 2901360..08f2a15 100644 --- a/src/gallium/drivers/cell/ppu/cell_batch.h +++ b/src/gallium/drivers/cell/ppu/cell_batch.h @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ diff --git a/src/gallium/drivers/cell/ppu/cell_clear.c b/src/gallium/drivers/cell/ppu/cell_clear.c index 246fe21..2150e76 100644 --- a/src/gallium/drivers/cell/ppu/cell_clear.c +++ b/src/gallium/drivers/cell/ppu/cell_clear.c @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ /** diff --git a/src/gallium/drivers/cell/ppu/cell_clear.h b/src/gallium/drivers/cell/ppu/cell_clear.h index 08e091a..0a0135d 100644 --- a/src/gallium/drivers/cell/ppu/cell_clear.h +++ b/src/gallium/drivers/cell/ppu/cell_clear.h @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ diff --git a/src/gallium/drivers/cell/ppu/cell_context.c b/src/gallium/drivers/cell/ppu/cell_context.c index b6b3a70..3bb7f73 100644 --- a/src/gallium/drivers/cell/ppu/cell_context.c +++ b/src/gallium/drivers/cell/ppu/cell_context.c @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ /** @@ -164,8 +164,8 @@ cell_create_context(struct pipe_screen *screen, draw_wide_line_threshold(cell->draw, 0.0); /* get env vars or read config file to get debug flags */ - cell->debug_flags = debug_get_flags_option("CELL_DEBUG", - cell_debug_flags, + cell->debug_flags = debug_get_flags_option("CELL_DEBUG", + cell_debug_flags, 0 ); for (i = 0; i < CELL_NUM_BUFFERS; i++) diff --git a/src/gallium/drivers/cell/ppu/cell_context.h b/src/gallium/drivers/cell/ppu/cell_context.h index d1aee62..b2101a0 100644 --- a/src/gallium/drivers/cell/ppu/cell_context.h +++ b/src/gallium/drivers/cell/ppu/cell_context.h @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ diff --git a/src/gallium/drivers/cell/ppu/cell_draw_arrays.c b/src/gallium/drivers/cell/ppu/cell_draw_arrays.c index a367fa3..454de6e 100644 --- a/src/gallium/drivers/cell/ppu/cell_draw_arrays.c +++ b/src/gallium/drivers/cell/ppu/cell_draw_arrays.c @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ /* Author: diff --git a/src/gallium/drivers/cell/ppu/cell_draw_arrays.h b/src/gallium/drivers/cell/ppu/cell_draw_arrays.h index 148873a..54ec0e0 100644 --- a/src/gallium/drivers/cell/ppu/cell_draw_arrays.h +++ b/src/gallium/drivers/cell/ppu/cell_draw_arrays.h @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ #ifndef CELL_DRAW_ARRAYS_H diff --git a/src/gallium/drivers/cell/ppu/cell_fence.c b/src/gallium/drivers/cell/ppu/cell_fence.c index e7c9fc4..3f13564 100644 --- a/src/gallium/drivers/cell/ppu/cell_fence.c +++ b/src/gallium/drivers/cell/ppu/cell_fence.c @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ #include diff --git a/src/gallium/drivers/cell/ppu/cell_fence.h b/src/gallium/drivers/cell/ppu/cell_fence.h index 536b4ba..ac4740a 100644 --- a/src/gallium/drivers/cell/ppu/cell_fence.h +++ b/src/gallium/drivers/cell/ppu/cell_fence.h @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ diff --git a/src/gallium/drivers/cell/ppu/cell_flush.c b/src/gallium/drivers/cell/ppu/cell_flush.c index 8275c9d..6a45c6f 100644 --- a/src/gallium/drivers/cell/ppu/cell_flush.c +++ b/src/gallium/drivers/cell/ppu/cell_flush.c @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ @@ -103,7 +103,7 @@ cell_flush_buffer_range(struct cell_context *cell, void *ptr, unsigned size) { STATIC_ASSERT((sizeof(opcode_t) + sizeof(struct cell_buffer_range)) % 16 == 0); - uint32_t *batch = (uint32_t*)cell_batch_alloc16(cell, + uint32_t *batch = (uint32_t*)cell_batch_alloc16(cell, sizeof(opcode_t) + sizeof(struct cell_buffer_range)); struct cell_buffer_range *br = (struct cell_buffer_range *) &batch[4]; batch[0] = CELL_CMD_FLUSH_BUFFER_RANGE; diff --git a/src/gallium/drivers/cell/ppu/cell_flush.h b/src/gallium/drivers/cell/ppu/cell_flush.h index 509ae62..9cc1fe1 100644 --- a/src/gallium/drivers/cell/ppu/cell_flush.h +++ b/src/gallium/drivers/cell/ppu/cell_flush.h @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ diff --git a/src/gallium/drivers/cell/ppu/cell_gen_fp.c b/src/gallium/drivers/cell/ppu/cell_gen_fp.c index 1d8a11a..c7b65b6 100644 --- a/src/gallium/drivers/cell/ppu/cell_gen_fp.c +++ b/src/gallium/drivers/cell/ppu/cell_gen_fp.c @@ -1,9 +1,9 @@ /************************************************************************** - * + * * Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas. * All Rights Reserved. * Copyright 2009 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 @@ -11,11 +11,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. @@ -23,7 +23,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. - * + * **************************************************************************/ @@ -244,7 +244,7 @@ is_register_src(struct codegen *gen, int channel, return FALSE; } - + static boolean is_memory_dst(struct codegen *gen, int channel, const struct tgsi_full_dst_register *dst) @@ -257,7 +257,7 @@ is_memory_dst(struct codegen *gen, int channel, } } - + /** * Return the index of the SPU temporary containing the named TGSI * source register. If the TGSI register is a TGSI_FILE_TEMPORARY we @@ -743,7 +743,7 @@ emit_ABS(struct codegen *gen, const struct tgsi_full_instruction *inst) int ch, s1_reg[4], d_reg[4]; const int bit31mask_reg = get_itemp(gen); - /* mask with bit 31 set, the rest cleared */ + /* mask with bit 31 set, the rest cleared */ spe_load_uint(gen->f, bit31mask_reg, (1 << 31)); FOR_EACH_ENABLED_CHANNEL(inst, ch) { @@ -1065,7 +1065,7 @@ emit_CMP(struct codegen *gen, const struct tgsi_full_instruction *inst) int s3_reg = get_src_reg(gen, ch, &inst->Src[2]); int d_reg = get_dst_reg(gen, ch, &inst->Dst[0]); int zero_reg = get_itemp(gen); - + spe_zero(gen->f, zero_reg); /* d = (s1 < 0) ? s2 : s3 */ @@ -1080,7 +1080,7 @@ emit_CMP(struct codegen *gen, const struct tgsi_full_instruction *inst) } /** - * Emit trunc. + * Emit trunc. * Convert float to signed int * Convert signed int to float */ @@ -1114,7 +1114,7 @@ emit_TRUNC(struct codegen *gen, const struct tgsi_full_instruction *inst) /** - * Emit floor. + * Emit floor. * If negative int subtract one * Convert float to signed int * Convert signed int to float @@ -1127,7 +1127,7 @@ emit_FLR(struct codegen *gen, const struct tgsi_full_instruction *inst) zero_reg = get_itemp(gen); spe_zero(gen->f, zero_reg); one_reg = get_const_one_reg(gen); - + FOR_EACH_ENABLED_CHANNEL(inst, ch) { s1_reg[ch] = get_src_reg(gen, ch, &inst->Src[0]); d_reg[ch] = get_dst_reg(gen, ch, &inst->Dst[0]); @@ -1503,7 +1503,7 @@ emit_MIN_MAX(struct codegen *gen, const struct tgsi_full_instruction *inst) s0_reg[ch] = get_src_reg(gen, ch, &inst->Src[0]); s1_reg[ch] = get_src_reg(gen, ch, &inst->Src[1]); d_reg[ch] = get_dst_reg(gen, ch, &inst->Dst[0]); - tmp_reg[ch] = get_itemp(gen); + tmp_reg[ch] = get_itemp(gen); } /* d = (s0 > s1) ? s0 : s1 */ diff --git a/src/gallium/drivers/cell/ppu/cell_gen_fp.h b/src/gallium/drivers/cell/ppu/cell_gen_fp.h index 99faea7..c8447d2 100644 --- a/src/gallium/drivers/cell/ppu/cell_gen_fp.h +++ b/src/gallium/drivers/cell/ppu/cell_gen_fp.h @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ diff --git a/src/gallium/drivers/cell/ppu/cell_gen_fragment.c b/src/gallium/drivers/cell/ppu/cell_gen_fragment.c index 628bc1c..426576d 100644 --- a/src/gallium/drivers/cell/ppu/cell_gen_fragment.c +++ b/src/gallium/drivers/cell/ppu/cell_gen_fragment.c @@ -1,9 +1,9 @@ /************************************************************************** - * + * * Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas. * All Rights Reserved. * Copyright 2009 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 @@ -11,11 +11,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. @@ -23,7 +23,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. - * + * **************************************************************************/ /** @@ -240,7 +240,7 @@ gen_alpha_test(const struct pipe_depth_stencil_alpha_state *dsa, /** * This pair of functions is used inline to allocate and deallocate - * optional constant registers. Once a constant is discovered to be + * optional constant registers. Once a constant is discovered to be * needed, we will likely need it again, so we don't want to deallocate * it and have to allocate and load it again unnecessarily. */ @@ -417,7 +417,7 @@ gen_blend(const struct pipe_blend_state *blend, /* * Compute Src RGB terms. We're actually looking for the value * of (the appropriate RGB factors) * (the incoming source RGB color), - * because in some cases (like PIPE_BLENDFACTOR_ONE and + * because in some cases (like PIPE_BLENDFACTOR_ONE and * PIPE_BLENDFACTOR_ZERO) we can avoid doing unnecessary math. */ switch (blend->rt[0].rgb_src_factor) { @@ -446,7 +446,7 @@ gen_blend(const struct pipe_blend_state *blend, spe_fm(f, term1B_reg, fragB_reg, fragA_reg); break; case PIPE_BLENDFACTOR_INV_SRC_COLOR: - /* factors = (1-R,1-G,1-B), so term = (R*(1-R), G*(1-G), B*(1-B)) + /* factors = (1-R,1-G,1-B), so term = (R*(1-R), G*(1-G), B*(1-B)) * or in other words term = (R-R*R, G-G*G, B-B*B) * fnms(a,b,c,d) computes a = d - b*c */ @@ -485,7 +485,7 @@ gen_blend(const struct pipe_blend_state *blend, spe_fm(f, term1B_reg, fragB_reg, fbA_reg); break; case PIPE_BLENDFACTOR_INV_DST_ALPHA: - /* factors = (1-Afb, 1-Afb, 1-Afb), so term = (R*(1-Afb),G*(1-Afb),B*(1-Afb)) + /* factors = (1-Afb, 1-Afb, 1-Afb), so term = (R*(1-Afb),G*(1-Afb),B*(1-Afb)) * or term = (R-R*Afb,G-G*Afb,b-B*Afb) * fnms(a,b,c,d) computes a = d - b*c */ @@ -516,7 +516,7 @@ gen_blend(const struct pipe_blend_state *blend, setup_const_register(f, &constR_reg, blend_color->color[0]); setup_const_register(f, &constG_reg, blend_color->color[1]); setup_const_register(f, &constB_reg, blend_color->color[2]); - /* factor = (1-Rc,1-Gc,1-Bc), so term = (R*(1-Rc),G*(1-Gc),B*(1-Bc)) + /* factor = (1-Rc,1-Gc,1-Bc), so term = (R*(1-Rc),G*(1-Gc),B*(1-Bc)) * or term = (R-R*Rc, G-G*Gc, B-B*Bc) * fnms(a,b,c,d) computes a = d - b*c */ @@ -540,7 +540,7 @@ gen_blend(const struct pipe_blend_state *blend, case PIPE_BLENDFACTOR_SRC_ALPHA_SATURATE: /* We'll need the optional {1,1,1,1} register */ setup_const_register(f, &one_reg, 1.0f); - /* factor = (min(A,1-Afb),min(A,1-Afb),min(A,1-Afb)), so + /* factor = (min(A,1-Afb),min(A,1-Afb),min(A,1-Afb)), so * term = (R*min(A,1-Afb), G*min(A,1-Afb), B*min(A,1-Afb)) * We could expand the term (as a*min(b,c) == min(a*b,a*c) * as long as a is positive), but then we'd have to do three @@ -668,7 +668,7 @@ gen_blend(const struct pipe_blend_state *blend, spe_fm(f, term2B_reg, fbB_reg, fragB_reg); break; case PIPE_BLENDFACTOR_INV_SRC_COLOR: - /* factors = (1-R,1-G,1-B), so term = (Rfb*(1-R), Gfb*(1-G), Bfb*(1-B)) + /* factors = (1-R,1-G,1-B), so term = (Rfb*(1-R), Gfb*(1-G), Bfb*(1-B)) * or in other words term = (Rfb-Rfb*R, Gfb-Gfb*G, Bfb-Bfb*B) * fnms(a,b,c,d) computes a = d - b*c */ @@ -712,7 +712,7 @@ gen_blend(const struct pipe_blend_state *blend, spe_fm(f, term2B_reg, fbB_reg, fbA_reg); break; case PIPE_BLENDFACTOR_INV_DST_ALPHA: - /* factors = (1-Afb, 1-Afb, 1-Afb), so term = (Rfb*(1-Afb),Gfb*(1-Afb),Bfb*(1-Afb)) + /* factors = (1-Afb, 1-Afb, 1-Afb), so term = (Rfb*(1-Afb),Gfb*(1-Afb),Bfb*(1-Afb)) * or term = (Rfb-Rfb*Afb,Gfb-Gfb*Afb,Bfb-Bfb*Afb) * fnms(a,b,c,d) computes a = d - b*c */ @@ -743,7 +743,7 @@ gen_blend(const struct pipe_blend_state *blend, setup_const_register(f, &constR_reg, blend_color->color[0]); setup_const_register(f, &constG_reg, blend_color->color[1]); setup_const_register(f, &constB_reg, blend_color->color[2]); - /* factor = (1-Rc,1-Gc,1-Bc), so term = (Rfb*(1-Rc),Gfb*(1-Gc),Bfb*(1-Bc)) + /* factor = (1-Rc,1-Gc,1-Bc), so term = (Rfb*(1-Rc),Gfb*(1-Gc),Bfb*(1-Bc)) * or term = (Rfb-Rfb*Rc, Gfb-Gfb*Gc, Bfb-Bfb*Bc) * fnms(a,b,c,d) computes a = d - b*c */ @@ -1114,8 +1114,8 @@ gen_colormask(struct spe_function *f, ASSERT(0); } - /* For each R, G, B, and A component we're supposed to mask out, - * clear its bits. Then our mask operation later will work + /* For each R, G, B, and A component we're supposed to mask out, + * clear its bits. Then our mask operation later will work * as expected. */ if (!(colormask & PIPE_MASK_R)) { @@ -1144,7 +1144,7 @@ gen_colormask(struct spe_function *f, /* Use the mask register to select between the fragment color * values and the frame buffer color values. Wherever the * mask has a 0 bit, the current frame buffer color should override - * the fragment color. Wherever the mask has a 1 bit, the + * the fragment color. Wherever the mask has a 1 bit, the * fragment color should persevere. The Select Bits (selb rt, rA, rB, rM) * instruction will select bits from its first operand rA wherever the * the mask bits rM are 0, and from its second operand rB wherever the @@ -1162,7 +1162,7 @@ gen_colormask(struct spe_function *f, * This function is annoyingly similar to gen_depth_test(), above, except * that instead of comparing two varying values (i.e. fragment and buffer), * we're comparing a varying value with a static value. As such, we have - * access to the Compare Immediate instructions where we don't in + * access to the Compare Immediate instructions where we don't in * gen_depth_test(), which is what makes us very different. * * There's some added complexity if there's a non-trivial state->mask @@ -1179,7 +1179,7 @@ gen_stencil_test(struct spe_function *f, const unsigned ref_value, uint stencil_max_value, int fragment_mask_reg, - int fbS_reg, + int fbS_reg, int stencil_pass_reg) { /* Generate code that puts the set of passing fragments into the @@ -1242,8 +1242,8 @@ gen_stencil_test(struct spe_function *f, if (state->valuemask == stencil_max_value) { /* stencil_pass = fragment_mask & (reference > s) */ /* There's no convenient Compare Less Than Immediate instruction, so - * we'll have to do this one the harder way, by loading a register and - * comparing directly. Compare Logical Greater Than Word (clgt) + * we'll have to do this one the harder way, by loading a register and + * comparing directly. Compare Logical Greater Than Word (clgt) * treats its operands as unsigned - no sign extension. */ int tmp_reg = spe_allocate_available_register(f); @@ -1267,7 +1267,7 @@ gen_stencil_test(struct spe_function *f, case PIPE_FUNC_GEQUAL: if (state->valuemask == stencil_max_value) { - /* stencil_pass = fragment_mask & (reference >= s) + /* stencil_pass = fragment_mask & (reference >= s) * = fragment_mask & ~(s > reference) */ spe_compare_greater_uint(f, stencil_pass_reg, fbS_reg, ref_value); @@ -1353,9 +1353,9 @@ gen_stencil_values(struct spe_function *f, ASSERT(fbS_reg != newS_reg); /* The code also assumes that the stencil_max_value is of the form - * 2^n-1 and can therefore be used as a mask for the valid bits in + * 2^n-1 and can therefore be used as a mask for the valid bits in * addition to a maximum. Make sure this is the case as well. - * The clever math below exploits the fact that incrementing a + * The clever math below exploits the fact that incrementing a * binary number serves to flip all the bits of a number starting at * the LSB and continuing to (and including) the first zero bit * found. That means that a number and its increment will always @@ -1411,7 +1411,7 @@ gen_stencil_values(struct spe_function *f, } case PIPE_STENCIL_OP_INCR_WRAP: /* newS = (s == max ? 0 : s + 1), but since max is 2^n-1, we can - * do a normal add and mask off the correct bits + * do a normal add and mask off the correct bits */ spe_ai(f, newS_reg, fbS_reg, 1); spe_and_uint(f, newS_reg, newS_reg, stencil_max_value); @@ -1443,7 +1443,7 @@ gen_stencil_values(struct spe_function *f, * and calculates a new set of values based on the stencil operation, * or it reuses a register allocation and calculation done for an * earlier (matching) operation, or it reuses the fbS_reg register - * (if the stencil operation is KEEP, which doesn't change the + * (if the stencil operation is KEEP, which doesn't change the * stencil buffer). * * Since this function allocates a variable number of registers, @@ -1456,9 +1456,9 @@ gen_get_stencil_values(struct spe_function *f, const struct pipe_stencil_state *stencil, const unsigned ref_value, const uint depth_enabled, - int fbS_reg, + int fbS_reg, int *fail_reg, - int *zfail_reg, + int *zfail_reg, int *zpass_reg) { uint zfail_op; @@ -1490,7 +1490,7 @@ gen_get_stencil_values(struct spe_function *f, } else { *fail_reg = spe_allocate_available_register(f); - gen_stencil_values(f, stencil->fail_op, ref_value, + gen_stencil_values(f, stencil->fail_op, ref_value, 0xff, fbS_reg, *fail_reg); } @@ -1503,7 +1503,7 @@ gen_get_stencil_values(struct spe_function *f, } else { *zfail_reg = spe_allocate_available_register(f); - gen_stencil_values(f, stencil->zfail_op, ref_value, + gen_stencil_values(f, stencil->zfail_op, ref_value, 0xff, fbS_reg, *zfail_reg); } @@ -1518,7 +1518,7 @@ gen_get_stencil_values(struct spe_function *f, } else { *zpass_reg = spe_allocate_available_register(f); - gen_stencil_values(f, stencil->zpass_op, ref_value, + gen_stencil_values(f, stencil->zpass_op, ref_value, 0xff, fbS_reg, *zpass_reg); } } @@ -1529,11 +1529,11 @@ gen_get_stencil_values(struct spe_function *f, * the register if depth is not enabled. */ static boolean -gen_stencil_depth_test(struct spe_function *f, +gen_stencil_depth_test(struct spe_function *f, const struct pipe_depth_stencil_alpha_state *dsa, const struct pipe_stencil_ref *stencil_ref, const uint facing, - const int mask_reg, const int fragZ_reg, + const int mask_reg, const int fragZ_reg, const int fbZ_reg, const int fbS_reg) { /* True if we've generated code that could require writeback to the @@ -1556,17 +1556,17 @@ gen_stencil_depth_test(struct spe_function *f, int newS_reg; unsigned ref_value; - /* Stenciling is quite complex: up to six different configurable stencil + /* Stenciling is quite complex: up to six different configurable stencil * operations/calculations can be required (three each for front-facing - * and back-facing fragments). Many of those operations will likely - * be identical, so there's good reason to try to avoid calculating - * the same values more than once (which unfortunately makes the code less + * and back-facing fragments). Many of those operations will likely + * be identical, so there's good reason to try to avoid calculating + * the same values more than once (which unfortunately makes the code less * straightforward). * - * To make register management easier, we start a new + * To make register management easier, we start a new * register set; we can release all the registers in the set at * once, and avoid having to keep track of exactly which registers - * we allocate. We can still allocate and free registers as + * we allocate. We can still allocate and free registers as * desired (if we know we no longer need a register), but we don't * have to spend the complexity to track the more difficult variant * register usage scenarios. @@ -1654,7 +1654,7 @@ gen_stencil_depth_test(struct spe_function *f, * the mask of valid fragments that failed the stencil test. We * have to do this before we run a depth test (because the * depth test should not be performed on fragments that failed the - * stencil test, and because the depth test will update the + * stencil test, and because the depth test will update the * mask of valid fragments based on the results of the depth test). */ spe_comment(f, 0, "Computing stencil fail mask and updating fragment mask"); @@ -1684,12 +1684,12 @@ gen_stencil_depth_test(struct spe_function *f, spe_comment(f, 0, facing == CELL_FACING_FRONT ? "Computing front-facing stencil values" : "Computing back-facing stencil values"); - gen_get_stencil_values(f, stencil, ref_value, dsa->depth.enabled, fbS_reg, - &stencil_fail_values, &stencil_pass_depth_fail_values, + gen_get_stencil_values(f, stencil, ref_value, dsa->depth.enabled, fbS_reg, + &stencil_fail_values, &stencil_pass_depth_fail_values, &stencil_pass_depth_pass_values); - } + } - /* We now have all the stencil values we need. We also need + /* We now have all the stencil values we need. We also need * the results of the depth test to figure out which * stencil values will become the new stencil values. (Even if * we aren't actually calculating stencil values, we need to apply @@ -1943,7 +1943,7 @@ gen_depth_stencil(struct cell_context *cell, spe_comment(f, 0, "Perform stencil test"); /* Note that fbZ_reg may not be set on entry, if stenciling - * is enabled but there's no Z-buffer. The + * is enabled but there's no Z-buffer. The * gen_stencil_depth_test() function must ignore the * fbZ_reg register if depth is not enabled. */ @@ -2023,7 +2023,7 @@ gen_depth_stencil(struct cell_context *cell, * should be much faster. * * \param cell the rendering context (in) - * \param facing whether the generated code is for front-facing or + * \param facing whether the generated code is for front-facing or * back-facing fragments * \param f the generated function (in/out); on input, the function * must already have been initialized. On exit, whatever @@ -2182,7 +2182,7 @@ cell_gen_fragment_function(struct cell_context *cell, if (cell->debug_flags & CELL_DEBUG_ASM) { char buffer[1024]; - sprintf(buffer, "End %s-facing per-fragment ops: %d instructions", + sprintf(buffer, "End %s-facing per-fragment ops: %d instructions", facing == CELL_FACING_FRONT ? "front" : "back", f->num_inst); spe_comment(f, -4, buffer); } diff --git a/src/gallium/drivers/cell/ppu/cell_gen_fragment.h b/src/gallium/drivers/cell/ppu/cell_gen_fragment.h index 21b35d1..0519463 100644 --- a/src/gallium/drivers/cell/ppu/cell_gen_fragment.h +++ b/src/gallium/drivers/cell/ppu/cell_gen_fragment.h @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ diff --git a/src/gallium/drivers/cell/ppu/cell_pipe_state.h b/src/gallium/drivers/cell/ppu/cell_pipe_state.h index 1889bd5..ab40183 100644 --- a/src/gallium/drivers/cell/ppu/cell_pipe_state.h +++ b/src/gallium/drivers/cell/ppu/cell_pipe_state.h @@ -1,5 +1,5 @@ /************************************************************************** - * + * * Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas. * All Rights Reserved. * @@ -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. - * + * **************************************************************************/ diff --git a/src/gallium/drivers/cell/ppu/cell_render.c b/src/gallium/drivers/cell/ppu/cell_render.c index f648482..e9e7c76 100644 --- a/src/gallium/drivers/cell/ppu/cell_render.c +++ b/src/gallium/drivers/cell/ppu/cell_render.c @@ -1,5 +1,5 @@ /************************************************************************** - * + * * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas. * All Rights Reserved. * @@ -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. - * + * **************************************************************************/ /** diff --git a/src/gallium/drivers/cell/ppu/cell_render.h b/src/gallium/drivers/cell/ppu/cell_render.h index 826dcba..fa2d834 100644 --- a/src/gallium/drivers/cell/ppu/cell_render.h +++ b/src/gallium/drivers/cell/ppu/cell_render.h @@ -1,5 +1,5 @@ /************************************************************************** - * + * * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas. * All Rights Reserved. * @@ -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. - * + * **************************************************************************/ #ifndef CELL_RENDER_H diff --git a/src/gallium/drivers/cell/ppu/cell_screen.c b/src/gallium/drivers/cell/ppu/cell_screen.c index 8d2b4b9..7b06019 100644 --- a/src/gallium/drivers/cell/ppu/cell_screen.c +++ b/src/gallium/drivers/cell/ppu/cell_screen.c @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ diff --git a/src/gallium/drivers/cell/ppu/cell_screen.h b/src/gallium/drivers/cell/ppu/cell_screen.h index baff9d3..dc60213 100644 --- a/src/gallium/drivers/cell/ppu/cell_screen.h +++ b/src/gallium/drivers/cell/ppu/cell_screen.h @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ @@ -42,7 +42,7 @@ struct cell_screen { /* Increments whenever textures are modified. Contexts can track * this. */ - unsigned timestamp; + unsigned timestamp; }; static INLINE struct cell_screen * diff --git a/src/gallium/drivers/cell/ppu/cell_spu.c b/src/gallium/drivers/cell/ppu/cell_spu.c index 39284f3..ed0e39d 100644 --- a/src/gallium/drivers/cell/ppu/cell_spu.c +++ b/src/gallium/drivers/cell/ppu/cell_spu.c @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ @@ -104,7 +104,7 @@ wait_mbox_message(spe_context_ptr_t ctx) if (count == 1) { return data; } - + if (count < 0) { /* error */ ; } @@ -187,7 +187,7 @@ cell_start_spus(struct cell_context *cell) fprintf(stderr, "spe_program_load() failed\n"); exit(1); } - + pthread_create(&cell_global.spe_threads[i], /* returned thread handle */ NULL, /* pthread attribs */ &cell_thread_function, /* start routine */ diff --git a/src/gallium/drivers/cell/ppu/cell_spu.h b/src/gallium/drivers/cell/ppu/cell_spu.h index c93958a..e58dbad 100644 --- a/src/gallium/drivers/cell/ppu/cell_spu.h +++ b/src/gallium/drivers/cell/ppu/cell_spu.h @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ #ifndef CELL_SPU diff --git a/src/gallium/drivers/cell/ppu/cell_state.h b/src/gallium/drivers/cell/ppu/cell_state.h index 7adedcd..6906b51 100644 --- a/src/gallium/drivers/cell/ppu/cell_state.h +++ b/src/gallium/drivers/cell/ppu/cell_state.h @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ diff --git a/src/gallium/drivers/cell/ppu/cell_state_derived.c b/src/gallium/drivers/cell/ppu/cell_state_derived.c index b723e79..44e158c 100644 --- a/src/gallium/drivers/cell/ppu/cell_state_derived.c +++ b/src/gallium/drivers/cell/ppu/cell_state_derived.c @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ #include "util/u_memory.h" @@ -82,7 +82,7 @@ calculate_vertex_layout( struct cell_context *cell ) break; case TGSI_SEMANTIC_COLOR: - src = draw_find_shader_output(cell->draw, TGSI_SEMANTIC_COLOR, + src = draw_find_shader_output(cell->draw, TGSI_SEMANTIC_COLOR, fs->info.input_semantic_index[i]); assert(src >= 0); draw_emit_vertex_attr(vinfo, EMIT_4F, colorInterp, src); diff --git a/src/gallium/drivers/cell/ppu/cell_state_emit.c b/src/gallium/drivers/cell/ppu/cell_state_emit.c index bb11c68..7a7474e 100644 --- a/src/gallium/drivers/cell/ppu/cell_state_emit.c +++ b/src/gallium/drivers/cell/ppu/cell_state_emit.c @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ #include "util/u_inlines.h" @@ -180,7 +180,7 @@ static void emit_state_cmd(struct cell_context *cell, uint cmd, const void *state, uint state_size) { - uint32_t *dst = (uint32_t *) + uint32_t *dst = (uint32_t *) cell_batch_alloc16(cell, ROUNDUP16(sizeof(opcode_t) + state_size)); *dst = cmd; memcpy(dst + 4, state, state_size); diff --git a/src/gallium/drivers/cell/ppu/cell_state_emit.h b/src/gallium/drivers/cell/ppu/cell_state_emit.h index 59f8aff..9422685 100644 --- a/src/gallium/drivers/cell/ppu/cell_state_emit.h +++ b/src/gallium/drivers/cell/ppu/cell_state_emit.h @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ #ifndef CELL_STATE_EMIT_H diff --git a/src/gallium/drivers/cell/ppu/cell_state_shader.c b/src/gallium/drivers/cell/ppu/cell_state_shader.c index ddf1477..dfbd9e2 100644 --- a/src/gallium/drivers/cell/ppu/cell_state_shader.c +++ b/src/gallium/drivers/cell/ppu/cell_state_shader.c @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ #include "pipe/p_defines.h" diff --git a/src/gallium/drivers/cell/ppu/cell_state_vertex.c b/src/gallium/drivers/cell/ppu/cell_state_vertex.c index a065d68..48a55dc 100644 --- a/src/gallium/drivers/cell/ppu/cell_state_vertex.c +++ b/src/gallium/drivers/cell/ppu/cell_state_vertex.c @@ -1,5 +1,5 @@ /************************************************************************** - * + * * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas. * All Rights Reserved. * @@ -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. - * + * **************************************************************************/ /* Authors: Keith Whitwell diff --git a/src/gallium/drivers/cell/ppu/cell_surface.c b/src/gallium/drivers/cell/ppu/cell_surface.c index 7774544..1d03d71 100644 --- a/src/gallium/drivers/cell/ppu/cell_surface.c +++ b/src/gallium/drivers/cell/ppu/cell_surface.c @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ #include "util/u_surface.h" diff --git a/src/gallium/drivers/cell/ppu/cell_surface.h b/src/gallium/drivers/cell/ppu/cell_surface.h index 9e58f32..17b1330 100644 --- a/src/gallium/drivers/cell/ppu/cell_surface.h +++ b/src/gallium/drivers/cell/ppu/cell_surface.h @@ -1,5 +1,5 @@ /************************************************************************** - * + * * Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas. * All Rights Reserved. * @@ -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. - * + * **************************************************************************/ /* Authors: Keith Whitwell diff --git a/src/gallium/drivers/cell/ppu/cell_texture.c b/src/gallium/drivers/cell/ppu/cell_texture.c index 946a705..1782360 100644 --- a/src/gallium/drivers/cell/ppu/cell_texture.c +++ b/src/gallium/drivers/cell/ppu/cell_texture.c @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2006 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ /* * Authors: @@ -49,7 +49,7 @@ static boolean -cell_resource_layout(struct pipe_screen *screen, +cell_resource_layout(struct pipe_screen *screen, struct cell_resource *ct) { struct pipe_resource *pt = &ct->base; @@ -88,7 +88,7 @@ cell_resource_layout(struct pipe_screen *screen, } ct->data = align_malloc(ct->buffer_size, 16); - + return ct->data != NULL; } @@ -107,7 +107,7 @@ cell_displaytarget_layout(struct pipe_screen *screen, ct->dt = winsys->displaytarget_create(winsys, ct->base.bind, ct->base.format, - ct->base.width0, + ct->base.width0, ct->base.height0, 16, &ct->dt_stride ); @@ -267,13 +267,13 @@ untwiddle_image_uint(uint w, uint h, uint tile_size, uint *dst, dst_stride /= 4; /* convert from bytes to pixels */ tile_buf = align_malloc(tile_size * tile_size * 4, 16); - + /* loop over src tiles */ for (it = 0; it < h_t; it++) { for (jt = 0; jt < w_t; jt++) { /* start of src tile: */ const uint *tsrc = src + (it * w_t + jt) * tile_size2; - + twiddle_tile(tsrc, tile_buf); tsrc = tile_buf; @@ -330,7 +330,7 @@ cell_create_surface(struct pipe_context *ctx, } -static void +static void cell_surface_destroy(struct pipe_context *ctx, struct pipe_surface *surf) { pipe_resource_reference(&surf->texture, NULL); @@ -387,7 +387,7 @@ cell_get_transfer(struct pipe_context *ctx, } -static void +static void cell_transfer_destroy(struct pipe_context *ctx, struct pipe_transfer *t) { struct cell_transfer *transfer = cell_transfer(t); @@ -459,7 +459,7 @@ cell_transfer_map(struct pipe_context *ctx, struct pipe_transfer *transfer) enum pipe_format format = pt->format; unsigned blocksize = util_format_get_blocksize(format); - ctrans->map = (ct->mapped + + ctrans->map = (ct->mapped + ctrans->offset + ctrans->base.box.y / util_format_get_blockheight(format) * stride + ctrans->base.box.x / util_format_get_blockwidth(format) * blocksize); @@ -507,7 +507,7 @@ cell_transfer_unmap(struct pipe_context *ctx, // xxx fix } } - + align_free(ctrans->map); } else { @@ -606,7 +606,7 @@ cell_resource_from_handle(struct pipe_screen *screen, } -static boolean +static boolean cell_resource_get_handle(struct pipe_screen *scree, struct pipe_resource *tex, struct winsys_handle *handle) diff --git a/src/gallium/drivers/cell/ppu/cell_texture.h b/src/gallium/drivers/cell/ppu/cell_texture.h index bd8224b..a483980 100644 --- a/src/gallium/drivers/cell/ppu/cell_texture.h +++ b/src/gallium/drivers/cell/ppu/cell_texture.h @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ #ifndef CELL_TEXTURE_H diff --git a/src/gallium/drivers/cell/ppu/cell_vbuf.c b/src/gallium/drivers/cell/ppu/cell_vbuf.c index 37b7195..0bc670b 100644 --- a/src/gallium/drivers/cell/ppu/cell_vbuf.c +++ b/src/gallium/drivers/cell/ppu/cell_vbuf.c @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ /** @@ -142,8 +142,8 @@ cell_vbuf_map_vertices(struct vbuf_render *vbr) } -static void -cell_vbuf_unmap_vertices(struct vbuf_render *vbr, +static void +cell_vbuf_unmap_vertices(struct vbuf_render *vbr, ushort min_index, ushort max_index ) { diff --git a/src/gallium/drivers/cell/ppu/cell_vbuf.h b/src/gallium/drivers/cell/ppu/cell_vbuf.h index d265cbf..b4dc64e 100644 --- a/src/gallium/drivers/cell/ppu/cell_vbuf.h +++ b/src/gallium/drivers/cell/ppu/cell_vbuf.h @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ #ifndef CELL_VBUF_H diff --git a/src/gallium/drivers/cell/ppu/cell_vertex_fetch.c b/src/gallium/drivers/cell/ppu/cell_vertex_fetch.c index 9cba537..e27e103 100644 --- a/src/gallium/drivers/cell/ppu/cell_vertex_fetch.c +++ b/src/gallium/drivers/cell/ppu/cell_vertex_fetch.c @@ -51,7 +51,7 @@ * \c row2, and \c row3 are scratch and can be modified by the generated code. * Furthermore, these registers will be released, via calls to * \c release_register, by this function. - * + * * \note * This function requires that four temporary are available on entry. */ @@ -173,7 +173,7 @@ emit_fetch(struct spe_function *p, spe_lqd(p, v2, in_ptr, (2 + offset[0]) * 16); spe_lqd(p, v3, in_ptr, (3 + offset[0]) * 16); offset[0] += 4; - + switch (bytes) { case 1: scale_signed = 1.0f / 127.0f; @@ -230,7 +230,7 @@ emit_fetch(struct spe_function *p, float_one = spe_allocate_available_register(p); spe_il(p, float_one, 1); spe_cuflt(p, float_one, float_one, 0); - + if (count < 3) { float_zero = spe_allocate_available_register(p); spe_il(p, float_zero, 0); @@ -290,7 +290,7 @@ void cell_update_vertex_fetch(struct draw_context *draw) break; } } - + if (j == i) { unique_attr_formats++; } @@ -318,7 +318,7 @@ void cell_update_vertex_fetch(struct draw_context *draw) unsigned offset; if (function_index[i] == i) { - cell->attrib_fetch_offsets[i] = (unsigned) ((void *) p->csr + cell->attrib_fetch_offsets[i] = (unsigned) ((void *) p->csr - (void *) p->store); offset = 0; @@ -336,7 +336,7 @@ void cell_update_vertex_fetch(struct draw_context *draw) /* Use the same function entry-point as a previously seen attribute * with the same format. */ - cell->attrib_fetch_offsets[i] = + cell->attrib_fetch_offsets[i] = cell->attrib_fetch_offsets[function_index[i]]; } } diff --git a/src/gallium/drivers/cell/ppu/cell_vertex_shader.c b/src/gallium/drivers/cell/ppu/cell_vertex_shader.c index 3d389d6..16cadca 100644 --- a/src/gallium/drivers/cell/ppu/cell_vertex_shader.c +++ b/src/gallium/drivers/cell/ppu/cell_vertex_shader.c @@ -61,7 +61,7 @@ cell_vertex_shader_queue_flush(struct draw_context *draw) assert(draw->vs.queue_nr != 0); - /* XXX: do this on statechange: + /* XXX: do this on statechange: */ draw_update_vertex_fetch(draw); cell_update_vertex_fetch(draw); @@ -71,7 +71,7 @@ cell_vertex_shader_queue_flush(struct draw_context *draw) batch[0] = CELL_CMD_STATE_ATTRIB_FETCH; cf = (struct cell_attribute_fetch_code *) (&batch[1]); cf->base = (uint64_t) cell->attrib_fetch.store; - cf->size = ROUNDUP16((unsigned)((void *) cell->attrib_fetch.csr + cf->size = ROUNDUP16((unsigned)((void *) cell->attrib_fetch.csr - (void *) cell->attrib_fetch.store)); diff --git a/src/gallium/drivers/cell/spu/spu_colorpack.h b/src/gallium/drivers/cell/spu/spu_colorpack.h index d7ce005..b2e6b69 100644 --- a/src/gallium/drivers/cell/spu/spu_colorpack.h +++ b/src/gallium/drivers/cell/spu/spu_colorpack.h @@ -1,5 +1,5 @@ /************************************************************************** - * + * * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas. * All Rights Reserved. * @@ -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. - * + * **************************************************************************/ @@ -41,7 +41,7 @@ spu_pack_R8G8B8A8(vector float rgba) vector unsigned int out = spu_convtu(rgba, 32); out = spu_shuffle(out, out, ((vector unsigned char) { - 0, 4, 8, 12, 0, 0, 0, 0, + 0, 4, 8, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }) ); return spu_extract(out, 0); @@ -53,7 +53,7 @@ spu_pack_A8R8G8B8(vector float rgba) { vector unsigned int out = spu_convtu(rgba, 32); out = spu_shuffle(out, out, ((vector unsigned char) { - 12, 0, 4, 8, 0, 0, 0, 0, + 12, 0, 4, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}) ); return spu_extract(out, 0); } @@ -64,7 +64,7 @@ spu_pack_B8G8R8A8(vector float rgba) { vector unsigned int out = spu_convtu(rgba, 32); out = spu_shuffle(out, out, ((vector unsigned char) { - 8, 4, 0, 12, 0, 0, 0, 0, + 8, 4, 0, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}) ); return spu_extract(out, 0); } diff --git a/src/gallium/drivers/cell/spu/spu_command.c b/src/gallium/drivers/cell/spu/spu_command.c index f16cabc..56a56dc 100644 --- a/src/gallium/drivers/cell/spu/spu_command.c +++ b/src/gallium/drivers/cell/spu/spu_command.c @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ diff --git a/src/gallium/drivers/cell/spu/spu_command.h b/src/gallium/drivers/cell/spu/spu_command.h index 83dcdad..a935344 100644 --- a/src/gallium/drivers/cell/spu/spu_command.h +++ b/src/gallium/drivers/cell/spu/spu_command.h @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ extern void diff --git a/src/gallium/drivers/cell/spu/spu_dcache.c b/src/gallium/drivers/cell/spu/spu_dcache.c index a6d6763..3c65d0b 100644 --- a/src/gallium/drivers/cell/spu/spu_dcache.c +++ b/src/gallium/drivers/cell/spu/spu_dcache.c @@ -100,7 +100,7 @@ spu_dcache_fetch_unaligned(qword *dst, unsigned ea, unsigned size) *(dst++) = si_or((qword) spu_slqwbyte(hi, shift), si_il(0)); } } - + ASSERT((ea + i) == last_read); ASSERT(dst == last_write); } @@ -114,7 +114,7 @@ spu_dcache_mark_dirty(unsigned ea, unsigned size) { unsigned i; const unsigned aligned_start = (ea & ALIGN_MASK); - const unsigned aligned_end = (ea + size + (LINE_SIZE - 1)) + const unsigned aligned_end = (ea + size + (LINE_SIZE - 1)) & ALIGN_MASK; diff --git a/src/gallium/drivers/cell/spu/spu_exec.c b/src/gallium/drivers/cell/spu/spu_exec.c index e4ebeb5..306e8c5 100644 --- a/src/gallium/drivers/cell/spu/spu_exec.c +++ b/src/gallium/drivers/cell/spu/spu_exec.c @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ /** @@ -661,7 +661,7 @@ fetch_texel( struct spu_sampler *sampler, qword rgba[4]; qword out[4]; - sampler->get_samples(sampler, s->f, t->f, p->f, lodbias, + sampler->get_samples(sampler, s->f, t->f, p->f, lodbias, (float (*)[4]) rgba); _transpose_matrix4x4((vec_float4 *) out, (vec_float4 *) rgba); diff --git a/src/gallium/drivers/cell/spu/spu_exec.h b/src/gallium/drivers/cell/spu/spu_exec.h index 68f4479..0ee0b4d 100644 --- a/src/gallium/drivers/cell/spu/spu_exec.h +++ b/src/gallium/drivers/cell/spu/spu_exec.h @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ #if !defined SPU_EXEC_H @@ -100,7 +100,7 @@ struct spu_exec_machine * 1 address */ PIPE_ALIGN_VAR(16) - struct spu_exec_vector Temps[TGSI_EXEC_NUM_TEMPS + struct spu_exec_vector Temps[TGSI_EXEC_NUM_TEMPS + TGSI_EXEC_NUM_TEMP_EXTRAS + 1]; struct spu_exec_vector *Addrs; diff --git a/src/gallium/drivers/cell/spu/spu_funcs.c b/src/gallium/drivers/cell/spu/spu_funcs.c index 98919c4..c7be85e 100644 --- a/src/gallium/drivers/cell/spu/spu_funcs.c +++ b/src/gallium/drivers/cell/spu/spu_funcs.c @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ diff --git a/src/gallium/drivers/cell/spu/spu_funcs.h b/src/gallium/drivers/cell/spu/spu_funcs.h index 3adb6ae..d7afd15 100644 --- a/src/gallium/drivers/cell/spu/spu_funcs.h +++ b/src/gallium/drivers/cell/spu/spu_funcs.h @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ #ifndef SPU_FUNCS_H diff --git a/src/gallium/drivers/cell/spu/spu_main.c b/src/gallium/drivers/cell/spu/spu_main.c index 97c86d1..f0a3d30 100644 --- a/src/gallium/drivers/cell/spu/spu_main.c +++ b/src/gallium/drivers/cell/spu/spu_main.c @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ diff --git a/src/gallium/drivers/cell/spu/spu_main.h b/src/gallium/drivers/cell/spu/spu_main.h index a9d72f8..0cb7ec9 100644 --- a/src/gallium/drivers/cell/spu/spu_main.h +++ b/src/gallium/drivers/cell/spu/spu_main.h @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ #ifndef SPU_MAIN_H diff --git a/src/gallium/drivers/cell/spu/spu_per_fragment_op.c b/src/gallium/drivers/cell/spu/spu_per_fragment_op.c index 3b95660..28e5059 100644 --- a/src/gallium/drivers/cell/spu/spu_per_fragment_op.c +++ b/src/gallium/drivers/cell/spu/spu_per_fragment_op.c @@ -1,5 +1,5 @@ /************************************************************************** - * + * * Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas. * All Rights Reserved. * @@ -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. - * + * **************************************************************************/ /** diff --git a/src/gallium/drivers/cell/spu/spu_per_fragment_op.h b/src/gallium/drivers/cell/spu/spu_per_fragment_op.h index f817abf..46fe717 100644 --- a/src/gallium/drivers/cell/spu/spu_per_fragment_op.h +++ b/src/gallium/drivers/cell/spu/spu_per_fragment_op.h @@ -1,5 +1,5 @@ /************************************************************************** - * + * * Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas. * All Rights Reserved. * @@ -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. - * + * **************************************************************************/ #ifndef SPU_PER_FRAGMENT_OP diff --git a/src/gallium/drivers/cell/spu/spu_render.c b/src/gallium/drivers/cell/spu/spu_render.c index 14987e3..2c6436b 100644 --- a/src/gallium/drivers/cell/spu/spu_render.c +++ b/src/gallium/drivers/cell/spu/spu_render.c @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ @@ -325,7 +325,7 @@ cmd_render(const struct cell_command_render *render, uint *pos_incr) vs6 = si_mpya(vs6, vertex_sizes, verticess); vs7 = si_mpya(vs7, vertex_sizes, verticess); - /* Select the appropriate call based on the number of vertices + /* Select the appropriate call based on the number of vertices * remaining */ switch(num_indexes - j) { default: drawn += tri_draw(vs7, tx, ty); diff --git a/src/gallium/drivers/cell/spu/spu_render.h b/src/gallium/drivers/cell/spu/spu_render.h index 493434f..7e4fa8f 100644 --- a/src/gallium/drivers/cell/spu/spu_render.h +++ b/src/gallium/drivers/cell/spu/spu_render.h @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ diff --git a/src/gallium/drivers/cell/spu/spu_shuffle.h b/src/gallium/drivers/cell/spu/spu_shuffle.h index 74f2a0b..b4d9efc 100644 --- a/src/gallium/drivers/cell/spu/spu_shuffle.h +++ b/src/gallium/drivers/cell/spu/spu_shuffle.h @@ -4,7 +4,7 @@ /* * Generate shuffle patterns with minimal fuss. * - * Based on ideas from + * Based on ideas from * http://www.insomniacgames.com/tech/articles/0408/files/shuffles.pdf * * A-P indicates 0-15th position in first vector @@ -24,10 +24,10 @@ * 8 indicates 0x80 * 0 indicates 0x00 * - * The macros SHUFFLE4() SHUFFLE8() and SHUFFLE16() provide a const vector + * The macros SHUFFLE4() SHUFFLE8() and SHUFFLE16() provide a const vector * unsigned char literal suitable for use with spu_shuffle(). * - * The macros SHUFB4() SHUFB8() and SHUFB16() provide a const qword vector + * The macros SHUFB4() SHUFB8() and SHUFB16() provide a const qword vector * literal suitable for use with si_shufb(). * * @@ -35,7 +35,7 @@ * SHUFB4(A,A,A,A) * expands to : * ((const qword){0,1,2,3,0,1,2,3,0,1,2,3,0,1,2,3}) - * + * * SHUFFLE8(A,B,a,b,C,c,8,8) * expands to : * ((const vector unsigned char){0x00,0x01,0x02,0x03,0x10,0x11,0x12,0x13, diff --git a/src/gallium/drivers/cell/spu/spu_texture.c b/src/gallium/drivers/cell/spu/spu_texture.c index 69784c8..aa5754a 100644 --- a/src/gallium/drivers/cell/spu/spu_texture.c +++ b/src/gallium/drivers/cell/spu/spu_texture.c @@ -1,5 +1,5 @@ /************************************************************************** - * + * * Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas. * All Rights Reserved. * @@ -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. - * + * **************************************************************************/ @@ -90,9 +90,9 @@ get_four_texels(const struct spu_texture_level *tlevel, uint face, qword texel_offset = si_a(si_mpyui(offset_y, 32), offset_x); texel_offset = si_mpyui(texel_offset, 4); - + vec_uint4 offset = (vec_uint4) si_a(tile_offset, texel_offset); - + texture_ea = texture_ea + face * tlevel->bytes_per_image; spu_dcache_fetch_unaligned((qword *) & texels[0], @@ -604,7 +604,7 @@ sample_texture_cube(vector float s, vector float t, vector float r, /* Compute cube faces referenced by the four sets of texcoords. * XXX we should SIMD-ize this. */ - for (p = 0; p < 4; p++) { + for (p = 0; p < 4; p++) { float rx = spu_extract(s, p); float ry = spu_extract(t, p); float rz = spu_extract(r, p); @@ -621,7 +621,7 @@ sample_texture_cube(vector float s, vector float t, vector float r, } else { /* BAD! The four texcoords refer to different faces */ - for (p = 0; p < 4; p++) { + for (p = 0; p < 4; p++) { vector float c[4]; spu.sample_texture_2d[unit](spu_splats(newS[p]), spu_splats(newT[p]), diff --git a/src/gallium/drivers/cell/spu/spu_texture.h b/src/gallium/drivers/cell/spu/spu_texture.h index 7b75b00..d0a06dd 100644 --- a/src/gallium/drivers/cell/spu/spu_texture.h +++ b/src/gallium/drivers/cell/spu/spu_texture.h @@ -1,5 +1,5 @@ /************************************************************************** - * + * * Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas. * All Rights Reserved. * @@ -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. - * + * **************************************************************************/ #ifndef SPU_TEXTURE_H diff --git a/src/gallium/drivers/cell/spu/spu_tgsi_exec.h b/src/gallium/drivers/cell/spu/spu_tgsi_exec.h index 6f2a3d3..36fff68 100644 --- a/src/gallium/drivers/cell/spu/spu_tgsi_exec.h +++ b/src/gallium/drivers/cell/spu/spu_tgsi_exec.h @@ -1,9 +1,9 @@ /************************************************************************** - * + * * Copyright 2007-2008 Tungsten Graphics, Inc., Cedar Park, Texas. * All Rights Reserved. * Copyright 2009-2010 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 @@ -11,11 +11,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. @@ -23,7 +23,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. - * + * **************************************************************************/ #ifndef SPU_TGSI_EXEC_H diff --git a/src/gallium/drivers/cell/spu/spu_tile.c b/src/gallium/drivers/cell/spu/spu_tile.c index 6905015..df141ed 100644 --- a/src/gallium/drivers/cell/spu/spu_tile.c +++ b/src/gallium/drivers/cell/spu/spu_tile.c @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ diff --git a/src/gallium/drivers/cell/spu/spu_tile.h b/src/gallium/drivers/cell/spu/spu_tile.h index 7bfb52b..5395b12 100644 --- a/src/gallium/drivers/cell/spu/spu_tile.h +++ b/src/gallium/drivers/cell/spu/spu_tile.h @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ #ifndef SPU_TILE_H diff --git a/src/gallium/drivers/cell/spu/spu_tri.c b/src/gallium/drivers/cell/spu/spu_tri.c index efeebca..8bd5563 100644 --- a/src/gallium/drivers/cell/spu/spu_tri.c +++ b/src/gallium/drivers/cell/spu/spu_tri.c @@ -1,5 +1,5 @@ /************************************************************************** - * + * * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas. * All Rights Reserved. * @@ -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. - * + * **************************************************************************/ /** @@ -386,7 +386,7 @@ flush_spans(void) } /* XXX this loop could be moved into the above switch cases... */ - + /* Setup for mask calculation */ const vec_int4 quad_LlRr = setup.span.quad; const vec_int4 quad_RrLl = spu_rlqwbyte(quad_LlRr, 8); @@ -403,11 +403,11 @@ flush_spans(void) * Computes mask to indicate which pixels in the 2x2 quad are actually * inside the triangle's bounds. */ - + /* Calculate ({x,x+1,x,x+1} >= {l[0],l[0],l[1],l[1]}) */ const mask_t gt_LLll_xs = spu_cmpgt(quad_LLll, xs); - const mask_t gte_xs_LLll = spu_nand(gt_LLll_xs, gt_LLll_xs); - + const mask_t gte_xs_LLll = spu_nand(gt_LLll_xs, gt_LLll_xs); + /* Calculate ({r[0],r[0],r[1],r[1]} > {x,x+1,x,x+1}) */ const mask_t gt_RRrr_xs = spu_cmpgt(quad_RRrr, xs); @@ -431,7 +431,7 @@ print_vertex(const struct vertex_header *v) uint i; fprintf(stderr, " Vertex: (%p)\n", v); for (i = 0; i < spu.vertex_info.num_attribs; i++) { - fprintf(stderr, " %d: %f %f %f %f\n", i, + fprintf(stderr, " %d: %f %f %f %f\n", i, spu_extract(v->data[i], 0), spu_extract(v->data[i], 1), spu_extract(v->data[i], 2), @@ -578,7 +578,7 @@ setup_sort_vertices(const qword vs) * Compute a0 for a constant-valued coefficient (GL_FLAT shading). * The value value comes from vertex->data[slot]. * The result will be put into setup.coef[slot].a0. - * \param slot which attribute slot + * \param slot which attribute slot */ static INLINE void const_coeff4(uint slot) @@ -614,7 +614,7 @@ tri_linear_coeff4(uint slot) vector float tempx = spu_mul(setup.coef[slot].dadx, xxxx); vector float tempy = spu_mul(setup.coef[slot].dady, yyyy); - + setup.coef[slot].a0 = spu_sub(vmin_d, spu_add(tempx, tempy)); } @@ -658,7 +658,7 @@ tri_persp_coeff4(uint slot) vector float tempx = spu_mul(setup.coef[slot].dadx, xxxx); vector float tempy = spu_mul(setup.coef[slot].dady, yyyy); - + setup.coef[slot].a0 = spu_sub(vmin_d, spu_add(tempx, tempy)); } @@ -752,7 +752,7 @@ subtriangle(struct edge *eleft, struct edge *eright, unsigned lines) finish_y -= sy; /* - printf("%s %d %d\n", __FUNCTION__, start_y, finish_y); + printf("%s %d %d\n", __FUNCTION__, start_y, finish_y); */ for (y = start_y; y < finish_y; y++) { diff --git a/src/gallium/drivers/cell/spu/spu_tri.h b/src/gallium/drivers/cell/spu/spu_tri.h index 82e3b19..22c8fbd 100644 --- a/src/gallium/drivers/cell/spu/spu_tri.h +++ b/src/gallium/drivers/cell/spu/spu_tri.h @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ diff --git a/src/gallium/drivers/cell/spu/spu_vertex_fetch.c b/src/gallium/drivers/cell/spu/spu_vertex_fetch.c index 0879639..9a984dc 100644 --- a/src/gallium/drivers/cell/spu/spu_vertex_fetch.c +++ b/src/gallium/drivers/cell/spu/spu_vertex_fetch.c @@ -1,9 +1,9 @@ /************************************************************************** - * + * * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas. * (C) Copyright IBM Corporation 2008 * 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 @@ -11,11 +11,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. @@ -23,7 +23,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. - * + * **************************************************************************/ /* @@ -58,14 +58,14 @@ fetch_shuffle_data[5] = { 0x00, 0x80, 0x80, 0x80, 0x01, 0x80, 0x80, 0x80, 0x02, 0x80, 0x80, 0x80, 0x03, 0x80, 0x80, 0x80, }, - + /* Shuffle used by CVT_16_USCALED and CVT_16_SSCALED */ { 0x00, 0x01, 0x80, 0x80, 0x02, 0x03, 0x80, 0x80, 0x04, 0x05, 0x80, 0x80, 0x06, 0x07, 0x80, 0x80, }, - + /* High value shuffle used by trans4x4. */ { @@ -96,7 +96,7 @@ static void generic_vertex_fetch(struct spu_vs_context *draw, ASSERT(count <= 4); #if DRAW_DBG - printf("SPU: %s count = %u, nr_attrs = %u\n", + printf("SPU: %s count = %u, nr_attrs = %u\n", __FUNCTION__, count, nr_attrs); #endif @@ -114,7 +114,7 @@ static void generic_vertex_fetch(struct spu_vs_context *draw, PIPE_ALIGN_VAR(16) qword in[2 * 4]; - /* Fetch four attributes for four vertices. + /* Fetch four attributes for four vertices. */ idx = 0; for (i = 0; i < count; i++) { diff --git a/src/gallium/drivers/cell/spu/spu_vertex_shader.c b/src/gallium/drivers/cell/spu/spu_vertex_shader.c index 3e9804b..7964731 100644 --- a/src/gallium/drivers/cell/spu/spu_vertex_shader.c +++ b/src/gallium/drivers/cell/spu/spu_vertex_shader.c @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ /* @@ -83,7 +83,7 @@ compute_clipmask(const float *clip, /*const*/ float plane[][4], unsigned nr) /* Followed by any remaining ones: */ for (i = 6; i < nr; i++) { - if (dot4(clip, plane[i]) < 0) + if (dot4(clip, plane[i]) < 0) mask |= (1<num_vs_outputs)); mfc_get(tmpOut, vOut[j], vert_size, TAG_VERTEX_BUFFER, 0, 0); @@ -196,10 +196,10 @@ spu_bind_vertex_shader(struct spu_vs_context *draw, struct cell_shader_info *vs) { const unsigned immediate_addr = vs->immediates; - const unsigned immediate_size = + const unsigned immediate_size = ROUNDUP16((sizeof(float) * 4 * vs->num_immediates) + (immediate_addr & 0x0f)); - + mfc_get(immediates, immediate_addr & ~0x0f, immediate_size, TAG_VERTEX_BUFFER, 0, 0); diff --git a/src/gallium/drivers/cell/spu/spu_vertex_shader.h b/src/gallium/drivers/cell/spu/spu_vertex_shader.h index 4c74f5e..20977f6 100644 --- a/src/gallium/drivers/cell/spu/spu_vertex_shader.h +++ b/src/gallium/drivers/cell/spu/spu_vertex_shader.h @@ -26,7 +26,7 @@ struct spu_vs_context { spu_full_fetch_func fetch_func; void *code; } vertex_fetch; - + /* Clip derived state: */ float plane[12][4]; @@ -49,7 +49,7 @@ static INLINE void spu_vertex_fetch(struct spu_vs_context *draw, spu_update_vertex_fetch(draw); draw->vertex_fetch.dirty = 0; } - + (*draw->vertex_fetch.fetch_func)(draw, machine, elts, count); } diff --git a/src/gallium/drivers/failover/Makefile b/src/gallium/drivers/failover/Makefile index dfb7f5d..c5dbd1f 100644 --- a/src/gallium/drivers/failover/Makefile +++ b/src/gallium/drivers/failover/Makefile @@ -6,6 +6,6 @@ LIBNAME = failover C_SOURCES = \ fo_state.c \ fo_state_emit.c \ - fo_context.c + fo_context.c include ../../Makefile.template diff --git a/src/gallium/drivers/failover/fo_context.c b/src/gallium/drivers/failover/fo_context.c index e4d289c..ced52d6 100644 --- a/src/gallium/drivers/failover/fo_context.c +++ b/src/gallium/drivers/failover/fo_context.c @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2003 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ diff --git a/src/gallium/drivers/failover/fo_context.h b/src/gallium/drivers/failover/fo_context.h index 1afa6c9..2694b2d 100644 --- a/src/gallium/drivers/failover/fo_context.h +++ b/src/gallium/drivers/failover/fo_context.h @@ -1,5 +1,5 @@ /************************************************************************** - * + * * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas. * All Rights Reserved. * @@ -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. - * + * **************************************************************************/ /* Authors: Keith Whitwell diff --git a/src/gallium/drivers/failover/fo_state.c b/src/gallium/drivers/failover/fo_state.c index c265f38..c04f321 100644 --- a/src/gallium/drivers/failover/fo_state.c +++ b/src/gallium/drivers/failover/fo_state.c @@ -1,5 +1,5 @@ /************************************************************************** - * + * * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas. * All Rights Reserved. * @@ -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. - * + * **************************************************************************/ /* Authors: Keith Whitwell @@ -35,13 +35,13 @@ /* This looks like a lot of work at the moment - we're keeping a - * duplicate copy of the state up-to-date. + * duplicate copy of the state up-to-date. * * This can change in two ways: * - With constant state objects we would only need to save a pointer, * not the whole object. * - By adding a callback in the state tracker to re-emit state. The - * state tracker knows the current state already and can re-emit it + * state tracker knows the current state already and can re-emit it * without additional complexity. * * This works as a proof-of-concept, but a final version will have @@ -113,7 +113,7 @@ failover_set_stencil_ref( struct pipe_context *pipe, failover->hw->set_stencil_ref( failover->hw, stencil_ref ); } -static void +static void failover_set_clip_state( struct pipe_context *pipe, const struct pipe_clip_state *clip ) { @@ -312,7 +312,7 @@ failover_delete_vertex_elements_state( struct pipe_context *pipe, FREE(state); } -static void +static void failover_set_polygon_stipple( struct pipe_context *pipe, const struct pipe_poly_stipple *stipple ) { @@ -366,7 +366,7 @@ failover_delete_rasterizer_state(struct pipe_context *pipe, } -static void +static void failover_set_scissor_state( struct pipe_context *pipe, const struct pipe_scissor_state *scissor ) { @@ -554,13 +554,13 @@ failover_set_vertex_sampler_views(struct pipe_context *pipe, } -static void +static void failover_set_viewport_state( struct pipe_context *pipe, const struct pipe_viewport_state *viewport ) { struct failover_context *failover = failover_context(pipe); - failover->viewport = *viewport; + failover->viewport = *viewport; failover->dirty |= FO_NEW_VIEWPORT; failover->sw->set_viewport_state( failover->sw, viewport ); failover->hw->set_viewport_state( failover->hw, viewport ); diff --git a/src/gallium/drivers/failover/fo_state_emit.c b/src/gallium/drivers/failover/fo_state_emit.c index 7f434ff..de13fad 100644 --- a/src/gallium/drivers/failover/fo_state_emit.c +++ b/src/gallium/drivers/failover/fo_state_emit.c @@ -1,5 +1,5 @@ /************************************************************************** - * + * * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas. * All Rights Reserved. * @@ -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. - * + * **************************************************************************/ /* Authors: Keith Whitwell @@ -31,13 +31,13 @@ #include "fo_context.h" /* This looks like a lot of work at the moment - we're keeping a - * duplicate copy of the state up-to-date. + * duplicate copy of the state up-to-date. * * This can change in two ways: * - With constant state objects we would only need to save a pointer, * not the whole object. * - By adding a callback in the state tracker to re-emit state. The - * state tracker knows the current state already and can re-emit it + * state tracker knows the current state already and can re-emit it * without additional complexity. * * This works as a proof-of-concept, but a final version will have @@ -46,7 +46,7 @@ /* Bring the software pipe uptodate with current state. - * + * * With constant state objects we would probably just send all state * to both rasterizers all the time??? */ diff --git a/src/gallium/drivers/failover/fo_winsys.h b/src/gallium/drivers/failover/fo_winsys.h index 533122b..dc29259 100644 --- a/src/gallium/drivers/failover/fo_winsys.h +++ b/src/gallium/drivers/failover/fo_winsys.h @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ #ifndef FO_WINSYS_H diff --git a/src/gallium/drivers/galahad/glhd_context.c b/src/gallium/drivers/galahad/glhd_context.c index a572ad2..12d01b9 100644 --- a/src/gallium/drivers/galahad/glhd_context.c +++ b/src/gallium/drivers/galahad/glhd_context.c @@ -924,7 +924,7 @@ galahad_context_transfer_unmap(struct pipe_context *_context, if (glhd_resource->map_count < 1) { glhd_warn("context::transfer_unmap() called too many times" - " (count = %d)\n", glhd_resource->map_count); + " (count = %d)\n", glhd_resource->map_count); } glhd_resource->map_count--; diff --git a/src/gallium/drivers/i915/Makefile b/src/gallium/drivers/i915/Makefile index b3f387f..ebd061b 100644 --- a/src/gallium/drivers/i915/Makefile +++ b/src/gallium/drivers/i915/Makefile @@ -26,6 +26,6 @@ C_SOURCES = \ i915_resource_buffer.c \ i915_fpc_emit.c \ i915_fpc_translate.c \ - i915_surface.c + i915_surface.c include ../../Makefile.template diff --git a/src/gallium/drivers/i915/i915_batch.h b/src/gallium/drivers/i915/i915_batch.h index 6e93da7..7a99dde 100644 --- a/src/gallium/drivers/i915/i915_batch.h +++ b/src/gallium/drivers/i915/i915_batch.h @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ #ifndef I915_BATCH_H diff --git a/src/gallium/drivers/i915/i915_blit.c b/src/gallium/drivers/i915/i915_blit.c index 97c2566..fe65135 100644 --- a/src/gallium/drivers/i915/i915_blit.c +++ b/src/gallium/drivers/i915/i915_blit.c @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2003 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ @@ -39,8 +39,8 @@ i915_fill_blit(struct i915_context *i915, unsigned short dst_pitch, struct i915_winsys_buffer *dst_buffer, unsigned dst_offset, - short x, short y, - short w, short h, + short x, short y, + short w, short h, unsigned color) { unsigned BR13, CMD; @@ -88,7 +88,7 @@ i915_copy_blit(struct i915_context *i915, struct i915_winsys_buffer *dst_buffer, unsigned dst_offset, short src_x, short src_y, - short dst_x, short dst_y, + short dst_x, short dst_y, short w, short h) { unsigned CMD, BR13; diff --git a/src/gallium/drivers/i915/i915_blit.h b/src/gallium/drivers/i915/i915_blit.h index d82d2f2..9743d20 100644 --- a/src/gallium/drivers/i915/i915_blit.h +++ b/src/gallium/drivers/i915/i915_blit.h @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2003 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ #ifndef I915_BLIT_H diff --git a/src/gallium/drivers/i915/i915_clear.c b/src/gallium/drivers/i915/i915_clear.c index 6d824a5..03693a9 100644 --- a/src/gallium/drivers/i915/i915_clear.c +++ b/src/gallium/drivers/i915/i915_clear.c @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ /* Authors: diff --git a/src/gallium/drivers/i915/i915_context.c b/src/gallium/drivers/i915/i915_context.c index 847dd6d..0d1baea 100644 --- a/src/gallium/drivers/i915/i915_context.c +++ b/src/gallium/drivers/i915/i915_context.c @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2003 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ #include "i915_context.h" @@ -72,7 +72,7 @@ i915_draw_vbo(struct pipe_context *pipe, const struct pipe_draw_info *info) draw_set_mapped_constant_buffer(draw, PIPE_SHADER_VERTEX, 0, i915->current.constants[PIPE_SHADER_VERTEX], - (i915->current.num_user_constants[PIPE_SHADER_VERTEX] * + (i915->current.num_user_constants[PIPE_SHADER_VERTEX] * 4 * sizeof(float))); /* @@ -103,7 +103,7 @@ static void i915_destroy(struct pipe_context *pipe) int i; draw_destroy(i915->draw); - + if(i915->batch) i915->iws->batchbuffer_destroy(i915->batch); diff --git a/src/gallium/drivers/i915/i915_context.h b/src/gallium/drivers/i915/i915_context.h index 7103a1b..eeca6a3 100644 --- a/src/gallium/drivers/i915/i915_context.h +++ b/src/gallium/drivers/i915/i915_context.h @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2003 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ #ifndef I915_CONTEXT_H @@ -47,18 +47,18 @@ struct i915_winsys_batchbuffer; #define I915_DYNAMIC_MODES4 0 #define I915_DYNAMIC_DEPTHSCALE_0 1 /* just the header */ -#define I915_DYNAMIC_DEPTHSCALE_1 2 +#define I915_DYNAMIC_DEPTHSCALE_1 2 #define I915_DYNAMIC_IAB 3 #define I915_DYNAMIC_BC_0 4 /* just the header */ #define I915_DYNAMIC_BC_1 5 -#define I915_DYNAMIC_BFO_0 6 +#define I915_DYNAMIC_BFO_0 6 #define I915_DYNAMIC_BFO_1 7 -#define I915_DYNAMIC_STP_0 8 -#define I915_DYNAMIC_STP_1 9 -#define I915_DYNAMIC_SC_ENA_0 10 -#define I915_DYNAMIC_SC_RECT_0 11 -#define I915_DYNAMIC_SC_RECT_1 12 -#define I915_DYNAMIC_SC_RECT_2 13 +#define I915_DYNAMIC_STP_0 8 +#define I915_DYNAMIC_STP_1 9 +#define I915_DYNAMIC_SC_ENA_0 10 +#define I915_DYNAMIC_SC_RECT_0 11 +#define I915_DYNAMIC_SC_RECT_1 12 +#define I915_DYNAMIC_SC_RECT_2 13 #define I915_MAX_DYNAMIC 14 @@ -75,7 +75,7 @@ struct i915_winsys_batchbuffer; /* These must mach the order of LI0_STATE_* bits, as they will be used * to generate hardware packets: */ -#define I915_CACHE_STATIC 0 +#define I915_CACHE_STATIC 0 #define I915_CACHE_DYNAMIC 1 /* handled specially */ #define I915_CACHE_SAMPLER 2 #define I915_CACHE_MAP 3 @@ -127,9 +127,9 @@ struct i915_fragment_shader struct i915_cache_context; /* Use to calculate differences between state emitted to hardware and - * current driver-calculated state. + * current driver-calculated state. */ -struct i915_state +struct i915_state { unsigned immediate[I915_MAX_IMMEDIATE]; unsigned dynamic[I915_MAX_DYNAMIC]; @@ -276,33 +276,33 @@ struct i915_context { /*********************************************************************** - * i915_prim_emit.c: + * i915_prim_emit.c: */ struct draw_stage *i915_draw_render_stage( struct i915_context *i915 ); /*********************************************************************** - * i915_prim_vbuf.c: + * i915_prim_vbuf.c: */ struct draw_stage *i915_draw_vbuf_stage( struct i915_context *i915 ); /*********************************************************************** - * i915_state_emit.c: + * i915_state_emit.c: */ void i915_emit_hardware_state(struct i915_context *i915 ); /*********************************************************************** - * i915_clear.c: + * i915_clear.c: */ void i915_clear( struct pipe_context *pipe, unsigned buffers, const float *rgba, double depth, unsigned stencil); /*********************************************************************** - * + * */ void i915_init_state_functions( struct i915_context *i915 ); void i915_init_flush_functions( struct i915_context *i915 ); diff --git a/src/gallium/drivers/i915/i915_debug.c b/src/gallium/drivers/i915/i915_debug.c index d7150c9..6d02901 100644 --- a/src/gallium/drivers/i915/i915_debug.c +++ b/src/gallium/drivers/i915/i915_debug.c @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2003 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ #include "i915_reg.h" @@ -78,7 +78,7 @@ static boolean debug( struct debug_stream *stream, const char *name, unsigned le { unsigned i; unsigned *ptr = (unsigned *)(stream->ptr + stream->offset); - + if (len == 0) { PRINTF(stream, "Error - zero length packet (0x%08x)\n", stream->ptr[0]); assert(0); @@ -91,11 +91,11 @@ static boolean debug( struct debug_stream *stream, const char *name, unsigned le PRINTF(stream, "%s (%d dwords):\n", name, len); for (i = 0; i < len; i++) - PRINTF(stream, "\t0x%08x\n", ptr[i]); + PRINTF(stream, "\t0x%08x\n", ptr[i]); PRINTF(stream, "\n"); stream->offset += len * sizeof(unsigned); - + return TRUE; } @@ -119,33 +119,33 @@ static const char *get_prim_name( unsigned val ) } } -static boolean debug_prim( struct debug_stream *stream, const char *name, +static boolean debug_prim( struct debug_stream *stream, const char *name, boolean dump_floats, unsigned len ) { unsigned *ptr = (unsigned *)(stream->ptr + stream->offset); const char *prim = get_prim_name( ptr[0] ); unsigned i; - + PRINTF(stream, "%s %s (%d dwords):\n", name, prim, len); - PRINTF(stream, "\t0x%08x\n", ptr[0]); + PRINTF(stream, "\t0x%08x\n", ptr[0]); for (i = 1; i < len; i++) { if (dump_floats) - PRINTF(stream, "\t0x%08x // %f\n", ptr[i], *(float *)&ptr[i]); + PRINTF(stream, "\t0x%08x // %f\n", ptr[i], *(float *)&ptr[i]); else - PRINTF(stream, "\t0x%08x\n", ptr[i]); + PRINTF(stream, "\t0x%08x\n", ptr[i]); } - + PRINTF(stream, "\n"); stream->offset += len * sizeof(unsigned); - + return TRUE; } - + @@ -181,12 +181,12 @@ static boolean debug_chain( struct debug_stream *stream, const char *name, unsig PRINTF(stream, "\t0x%08x\n", ptr[i]); stream->offset = ptr[1] & ~0x3; - + if (stream->offset < old_offset) - PRINTF(stream, "\n... skipping backwards from 0x%x --> 0x%x ...\n\n", + PRINTF(stream, "\n... skipping backwards from 0x%x --> 0x%x ...\n\n", old_offset, stream->offset ); else - PRINTF(stream, "\n... skipping from 0x%x --> 0x%x ...\n\n", + PRINTF(stream, "\n... skipping from 0x%x --> 0x%x ...\n\n", old_offset, stream->offset ); @@ -278,7 +278,7 @@ static boolean debug_load_immediate( struct debug_stream *stream, unsigned *ptr = (unsigned *)(stream->ptr + stream->offset); unsigned bits = (ptr[0] >> 4) & 0xff; unsigned j = 0; - + PRINTF(stream, "%s (%d dwords, flags: %x):\n", name, len, bits); PRINTF(stream, "\t0x%08x\n", ptr[j++]); @@ -362,7 +362,7 @@ static boolean debug_load_immediate( struct debug_stream *stream, BITS(stream, ptr[j], 7, 4, "blend dst factor"); FLAG(stream, ptr[j], 3, "depth write enable"); FLAG(stream, ptr[j], 2, "color write enable"); - BITS(stream, ptr[j], 1, 0, "provoking vertex"); + BITS(stream, ptr[j], 1, 0, "provoking vertex"); j++; } @@ -372,10 +372,10 @@ static boolean debug_load_immediate( struct debug_stream *stream, assert(j == len); stream->offset += len * sizeof(unsigned); - + return TRUE; } - + static boolean debug_load_indirect( struct debug_stream *stream, @@ -385,7 +385,7 @@ static boolean debug_load_indirect( struct debug_stream *stream, unsigned *ptr = (unsigned *)(stream->ptr + stream->offset); unsigned bits = (ptr[0] >> 8) & 0x3f; unsigned i, j = 0; - + PRINTF(stream, "%s (%d dwords):\n", name, len); PRINTF(stream, "\t0x%08x\n", ptr[j++]); @@ -432,10 +432,10 @@ static boolean debug_load_indirect( struct debug_stream *stream, assert(j == len); stream->offset += len * sizeof(unsigned); - + return TRUE; } - + static void BR13( struct debug_stream *stream, unsigned val ) { @@ -495,7 +495,7 @@ static void BR16( struct debug_stream *stream, { PRINTF(stream, "\t0x%08x -- color\n", val); } - + static boolean debug_copy_blit( struct debug_stream *stream, const char *name, unsigned len ) @@ -505,7 +505,7 @@ static boolean debug_copy_blit( struct debug_stream *stream, PRINTF(stream, "%s (%d dwords):\n", name, len); PRINTF(stream, "\t0x%08x\n", ptr[j++]); - + BR13(stream, ptr[j++]); BR22(stream, ptr[j++]); BR23(stream, ptr[j++]); @@ -570,7 +570,7 @@ static boolean debug_map_state( struct debug_stream *stream, PRINTF(stream, "%s (%d dwords):\n", name, len); PRINTF(stream, "\t0x%08x\n", ptr[j++]); - + { PRINTF(stream, "\t0x%08x\n", ptr[j]); BITS(stream, ptr[j], 15, 0, "map mask"); @@ -622,7 +622,7 @@ static boolean debug_sampler_state( struct debug_stream *stream, PRINTF(stream, "%s (%d dwords):\n", name, len); PRINTF(stream, "\t0x%08x\n", ptr[j++]); - + { PRINTF(stream, "\t0x%08x\n", ptr[j]); BITS(stream, ptr[j], 15, 0, "sampler mask"); @@ -702,7 +702,7 @@ static boolean debug_dest_vars( struct debug_stream *stream, FLAG(stream, ptr[j], 1, "vert line stride offset"); j++; } - + stream->offset += len * sizeof(unsigned); assert(j == len); return TRUE; @@ -730,7 +730,7 @@ static boolean debug_buf_info( struct debug_stream *stream, MBZ (ptr[j], 2, 0); j++; } - + PRINTF(stream, "\t0x%08x -- buffer base address\n", ptr[j++]); stream->offset += len * sizeof(unsigned); @@ -742,7 +742,7 @@ static boolean i915_debug_packet( struct debug_stream *stream ) { unsigned *ptr = (unsigned *)(stream->ptr + stream->offset); unsigned cmd = *ptr; - + switch (((cmd >> 29) & 0x7)) { case 0x0: switch ((cmd >> 23) & 0x3f) { @@ -770,7 +770,7 @@ static boolean i915_debug_packet( struct debug_stream *stream ) assert(0); break; case 0x2: - switch ((cmd >> 22) & 0xff) { + switch ((cmd >> 22) & 0xff) { case 0x50: return debug_color_blit(stream, "XY_COLOR_BLT", (cmd & 0xff) + 2); case 0x53: @@ -780,7 +780,7 @@ static boolean i915_debug_packet( struct debug_stream *stream ) } break; case 0x3: - switch ((cmd >> 24) & 0x1f) { + switch ((cmd >> 24) & 0x1f) { case 0x6: return debug(stream, "3DSTATE_ANTI_ALIASING", 1); case 0x7: @@ -792,7 +792,7 @@ static boolean i915_debug_packet( struct debug_stream *stream ) case 0xb: return debug(stream, "3DSTATE_INDEPENDENT_ALPHA_BLEND", 1); case 0xc: - return debug(stream, "3DSTATE_MODES5", 1); + return debug(stream, "3DSTATE_MODES5", 1); case 0xd: return debug_modes4(stream, "3DSTATE_MODES4", 1); case 0x15: @@ -863,9 +863,9 @@ static boolean i915_debug_packet( struct debug_stream *stream ) return debug(stream, "", 1); break; case 0x1f: - if ((cmd & (1 << 23)) == 0) + if ((cmd & (1 << 23)) == 0) return debug_prim(stream, "3DPRIM (inline)", 1, (cmd & 0x1ffff) + 2); - else if (cmd & (1 << 17)) + else if (cmd & (1 << 17)) { if ((cmd & 0xffff) == 0) return debug_variable_length_prim(stream); @@ -873,7 +873,7 @@ static boolean i915_debug_packet( struct debug_stream *stream ) return debug_prim(stream, "3DPRIM (indexed)", 0, (((cmd & 0xffff) + 1) / 2) + 1); } else - return debug_prim(stream, "3DPRIM (indirect sequential)", 0, 2); + return debug_prim(stream, "3DPRIM (indirect sequential)", 0, 2); break; default: return debug(stream, "", 0); @@ -907,7 +907,7 @@ i915_dump_batchbuffer( struct i915_winsys_batchbuffer *batch ) debug_printf( "\n\nBATCH: ???\n"); return; } - + debug_printf( "\n\nBATCH: (%d)\n", (int)bytes / 4); while (!done && diff --git a/src/gallium/drivers/i915/i915_debug.h b/src/gallium/drivers/i915/i915_debug.h index 11af766..5f4a059 100644 --- a/src/gallium/drivers/i915/i915_debug.h +++ b/src/gallium/drivers/i915/i915_debug.h @@ -1,5 +1,5 @@ /************************************************************************** - * + * * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas. * All Rights Reserved. * @@ -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. - * + * **************************************************************************/ /* Authors: Keith Whitwell diff --git a/src/gallium/drivers/i915/i915_debug_fp.c b/src/gallium/drivers/i915/i915_debug_fp.c index 50f49c5..66fdce8 100644 --- a/src/gallium/drivers/i915/i915_debug_fp.c +++ b/src/gallium/drivers/i915/i915_debug_fp.c @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2003 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ @@ -254,7 +254,7 @@ print_dest_reg(struct debug_stream *stream, unsigned dword) static void -print_arith_op(struct debug_stream *stream, +print_arith_op(struct debug_stream *stream, unsigned opcode, const unsigned * program) { if (opcode != A0_NOP) { @@ -288,7 +288,7 @@ print_arith_op(struct debug_stream *stream, static void -print_tex_op(struct debug_stream *stream, +print_tex_op(struct debug_stream *stream, unsigned opcode, const unsigned * program) { print_dest_reg(stream, program[0] | A0_DEST_CHANNEL_ALL); @@ -298,7 +298,7 @@ print_tex_op(struct debug_stream *stream, PRINTF(stream, "S[%d],", program[0] & T0_SAMPLER_NR_MASK); - print_reg_type_nr(stream, + print_reg_type_nr(stream, (program[1] >> T1_ADDRESS_REG_TYPE_SHIFT) & REG_TYPE_MASK, (program[1] >> T1_ADDRESS_REG_NR_SHIFT) & REG_NR_MASK); @@ -306,12 +306,12 @@ print_tex_op(struct debug_stream *stream, } static void -print_texkil_op(struct debug_stream *stream, +print_texkil_op(struct debug_stream *stream, unsigned opcode, const unsigned * program) { PRINTF(stream, "TEXKIL "); - print_reg_type_nr(stream, + print_reg_type_nr(stream, (program[1] >> T1_ADDRESS_REG_TYPE_SHIFT) & REG_TYPE_MASK, (program[1] >> T1_ADDRESS_REG_NR_SHIFT) & REG_NR_MASK); @@ -319,18 +319,18 @@ print_texkil_op(struct debug_stream *stream, } static void -print_dcl_op(struct debug_stream *stream, +print_dcl_op(struct debug_stream *stream, unsigned opcode, const unsigned * program) { PRINTF(stream, "%s ", opcodes[opcode]); - print_dest_reg(stream, + print_dest_reg(stream, program[0] | A0_DEST_CHANNEL_ALL); PRINTF(stream, "\n"); } void -i915_disassemble_program(struct debug_stream *stream, +i915_disassemble_program(struct debug_stream *stream, const unsigned * program, unsigned sz) { unsigned i; diff --git a/src/gallium/drivers/i915/i915_debug_private.h b/src/gallium/drivers/i915/i915_debug_private.h index b3668d0..2260b03 100644 --- a/src/gallium/drivers/i915/i915_debug_private.h +++ b/src/gallium/drivers/i915/i915_debug_private.h @@ -1,5 +1,5 @@ /************************************************************************** - * + * * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas. * All Rights Reserved. * @@ -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. - * + * **************************************************************************/ /* Authors: Keith Whitwell @@ -31,7 +31,7 @@ #ifndef I915_DEBUG_PRIVATE_H #define I915_DEBUG_PRIVATE_H -struct debug_stream +struct debug_stream { unsigned offset; /* current gtt offset */ char *ptr; /* pointer to gtt offset zero */ @@ -39,7 +39,7 @@ struct debug_stream unsigned print_addresses; }; -void i915_disassemble_program(struct debug_stream *stream, +void i915_disassemble_program(struct debug_stream *stream, const unsigned *program, unsigned sz); #endif diff --git a/src/gallium/drivers/i915/i915_flush.c b/src/gallium/drivers/i915/i915_flush.c index a2c70b1..6b32645 100644 --- a/src/gallium/drivers/i915/i915_flush.c +++ b/src/gallium/drivers/i915/i915_flush.c @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ /* Author: @@ -52,7 +52,7 @@ static void i915_flush_pipe( struct pipe_context *pipe, */ if (flags & (PIPE_FLUSH_RENDER_CACHE | PIPE_FLUSH_TEXTURE_CACHE)) { unsigned flush = MI_FLUSH; - + if (!(flags & PIPE_FLUSH_RENDER_CACHE)) flush |= INHIBIT_FLUSH_RENDER_CACHE; diff --git a/src/gallium/drivers/i915/i915_fpc.h b/src/gallium/drivers/i915/i915_fpc.h index 2f0f99d..d6b0b39 100644 --- a/src/gallium/drivers/i915/i915_fpc.h +++ b/src/gallium/drivers/i915/i915_fpc.h @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2003 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ @@ -129,7 +129,7 @@ struct i915_fp_compile { #define UREG_XYZW_CHANNEL_MASK 0x00ffff00 -/* One neat thing about the UREG representation: +/* One neat thing about the UREG representation: */ static INLINE int swizzle(int reg, uint x, uint y, uint z, uint w) diff --git a/src/gallium/drivers/i915/i915_fpc_emit.c b/src/gallium/drivers/i915/i915_fpc_emit.c index 76c24d2..af4f2e8 100644 --- a/src/gallium/drivers/i915/i915_fpc_emit.c +++ b/src/gallium/drivers/i915/i915_fpc_emit.c @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2003 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ #include "i915_reg.h" @@ -232,7 +232,7 @@ uint i915_emit_texld( struct i915_fp_compile *p, coord = tempReg; } - /* Don't worry about saturate as we only support + /* Don't worry about saturate as we only support */ if (destmask != A0_DEST_CHANNEL_ALL) { /* if not writing to XYZW... */ @@ -250,7 +250,7 @@ uint i915_emit_texld( struct i915_fp_compile *p, p->nr_tex_indirect++; } - *(p->csr++) = (opcode | + *(p->csr++) = (opcode | T0_DEST( dest ) | T0_SAMPLER( sampler )); diff --git a/src/gallium/drivers/i915/i915_fpc_translate.c b/src/gallium/drivers/i915/i915_fpc_translate.c index 25c5321..d04a434 100644 --- a/src/gallium/drivers/i915/i915_fpc_translate.c +++ b/src/gallium/drivers/i915/i915_fpc_translate.c @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ @@ -46,24 +46,24 @@ * Simple pass-through fragment shader to use when we don't have * a real shader (or it fails to compile for some reason). */ -static unsigned passthrough[] = +static unsigned passthrough[] = { _3DSTATE_PIXEL_SHADER_PROGRAM | ((2*3)-1), /* declare input color: */ - (D0_DCL | - (REG_TYPE_T << D0_TYPE_SHIFT) | - (T_DIFFUSE << D0_NR_SHIFT) | + (D0_DCL | + (REG_TYPE_T << D0_TYPE_SHIFT) | + (T_DIFFUSE << D0_NR_SHIFT) | D0_CHANNEL_ALL), 0, 0, /* move to output color: */ - (A0_MOV | - (REG_TYPE_OC << A0_DEST_TYPE_SHIFT) | - A0_DEST_CHANNEL_ALL | + (A0_MOV | + (REG_TYPE_OC << A0_DEST_TYPE_SHIFT) | + A0_DEST_CHANNEL_ALL | (REG_TYPE_T << A0_SRC0_TYPE_SHIFT) | (T_DIFFUSE << A0_SRC0_NR_SHIFT)), 0x01230000, /* .xyzw */ @@ -124,7 +124,7 @@ i915_program_error(struct i915_fp_compile *p, const char *msg, ...) char buffer[1024]; debug_printf("i915_program_error: "); - va_start( args, msg ); + va_start( args, msg ); util_vsnprintf( buffer, sizeof(buffer), msg, args ); va_end( args ); debug_printf("%s", buffer); @@ -161,7 +161,7 @@ src_vector(struct i915_fp_compile *p, * components wide. Could use a texcoord to pass these * attributes if necessary, but that won't work in the general * case. - * + * * We also use a texture coordinate to pass wpos when possible. */ @@ -412,7 +412,7 @@ emit_simple_arith_swap2(struct i915_fp_compile *p, * SIN, COS -- could use another taylor step? * LIT -- results seem a little different to sw mesa * LOG -- different to mesa on negative numbers, but this is conformant. - */ + */ static void i915_translate_instruction(struct i915_fp_compile *p, const struct tgsi_full_instruction *inst) @@ -439,9 +439,9 @@ i915_translate_instruction(struct i915_fp_compile *p, src0 = src_vector(p, &inst->Src[0]); src1 = src_vector(p, &inst->Src[1]); src2 = src_vector(p, &inst->Src[2]); - i915_emit_arith(p, A0_CMP, + i915_emit_arith(p, A0_CMP, get_result_vector(p, &inst->Dst[0]), - get_result_flags(inst), + get_result_flags(inst), 0, src0, src2, src1); /* NOTE: order of src2, src1 */ break; @@ -463,7 +463,7 @@ i915_translate_instruction(struct i915_fp_compile *p, tmp, A0_DEST_CHANNEL_X, 0, tmp, i915_emit_const1f(p, (float) (M_PI * 2.0)), 0); - /* + /* * t0.xy = MUL x.xx11, x.x1111 ; x^2, x, 1, 1 * t0 = MUL t0.xyxy t0.xx11 ; x^4, x^3, x^2, 1 * t0 = MUL t0.xxz1 t0.z111 ; x^6 x^4 x^2 1 @@ -622,10 +622,10 @@ i915_translate_instruction(struct i915_fp_compile *p, /* b*a + c*(1-a) * - * b*a + c - ca + * b*a + c - ca * - * tmp = b*a + c, - * result = (-c)*a + tmp + * tmp = b*a + c, + * result = (-c)*a + tmp */ i915_emit_arith(p, A0_MAD, tmp, flags & A0_DEST_CHANNEL_ALL, 0, src1, src0, src2); @@ -689,11 +689,11 @@ i915_translate_instruction(struct i915_fp_compile *p, get_result_vector(p, &inst->Dst[0]), flags, 0, swizzle(tmp, X, X, X, X), 0, 0); break; - + case TGSI_OPCODE_RET: /* XXX: no-op? */ break; - + case TGSI_OPCODE_RCP: src0 = src_vector(p, &inst->Src[0]); @@ -718,7 +718,7 @@ i915_translate_instruction(struct i915_fp_compile *p, src0 = src_vector(p, &inst->Src[0]); tmp = i915_get_utemp(p); - /* + /* * t0.xy = MUL x.xx11, x.x1111 ; x^2, x, 1, 1 * t0 = MUL t0.xyxy t0.xx11 ; x^4, x^3, x^2, x * t1 = MUL t0.xyyw t0.yz11 ; x^7 x^5 x^3 x @@ -805,7 +805,7 @@ i915_translate_instruction(struct i915_fp_compile *p, tmp, A0_DEST_CHANNEL_X, 0, tmp, i915_emit_const1f(p, (float) (M_PI * 2.0)), 0); - /* + /* * t0.xy = MUL x.xx11, x.x1111 ; x^2, x, 1, 1 * t0 = MUL t0.xyxy t0.xx11 ; x^4, x^3, x^2, x * t1 = MUL t0.xyyw t0.yz11 ; x^7 x^5 x^3 x @@ -1078,7 +1078,7 @@ i915_fini_compile(struct i915_context *i915, struct i915_fp_compile *p) /* patch in the program length */ p->declarations[0] |= program_size + decl_size - 2; - /* Copy compilation results to fragment program struct: + /* Copy compilation results to fragment program struct: */ assert(!ifs->program); ifs->program @@ -1087,16 +1087,16 @@ i915_fini_compile(struct i915_context *i915, struct i915_fp_compile *p) ifs->program_len = program_size + decl_size; memcpy(ifs->program, - p->declarations, + p->declarations, decl_size * sizeof(uint)); - memcpy(ifs->program + decl_size, - p->program, + memcpy(ifs->program + decl_size, + p->program, program_size * sizeof(uint)); } } - /* Release the compilation struct: + /* Release the compilation struct: */ FREE(p); } diff --git a/src/gallium/drivers/i915/i915_prim_emit.c b/src/gallium/drivers/i915/i915_prim_emit.c index dd997e2..7b67c51 100644 --- a/src/gallium/drivers/i915/i915_prim_emit.c +++ b/src/gallium/drivers/i915/i915_prim_emit.c @@ -1,5 +1,5 @@ /************************************************************************** - * + * * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas. * All Rights Reserved. * @@ -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. - * + * **************************************************************************/ @@ -45,7 +45,7 @@ struct setup_stage { struct draw_stage stage; /**< This must be first (base class) */ - struct i915_context *i915; + struct i915_context *i915; }; @@ -124,8 +124,8 @@ emit_hw_vertex( struct i915_context *i915, -static INLINE void -emit_prim( struct draw_stage *stage, +static INLINE void +emit_prim( struct draw_stage *stage, struct prim_header *prim, unsigned hwprim, unsigned nr ) @@ -147,7 +147,7 @@ emit_prim( struct draw_stage *stage, if (!BEGIN_BATCH( 1 + nr * vertex_size / 4, 0 )) { FLUSH_BATCH(NULL); - /* Make sure state is re-emitted after a flush: + /* Make sure state is re-emitted after a flush: */ i915_update_derived( i915 ); i915_emit_hardware_state( i915 ); @@ -161,7 +161,7 @@ emit_prim( struct draw_stage *stage, /* Emit each triangle as a single primitive. I told you this was * simple. */ - OUT_BATCH(_3DPRIMITIVE | + OUT_BATCH(_3DPRIMITIVE | hwprim | ((4 + vertex_size * nr)/4 - 2)); @@ -170,7 +170,7 @@ emit_prim( struct draw_stage *stage, } -static void +static void setup_tri( struct draw_stage *stage, struct prim_header *prim ) { emit_prim( stage, prim, PRIM3D_TRILIST, 3 ); diff --git a/src/gallium/drivers/i915/i915_prim_vbuf.c b/src/gallium/drivers/i915/i915_prim_vbuf.c index baebbc7..6c8e55c 100644 --- a/src/gallium/drivers/i915/i915_prim_vbuf.c +++ b/src/gallium/drivers/i915/i915_prim_vbuf.c @@ -1,5 +1,5 @@ /************************************************************************** - * + * * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas. * All Rights Reserved. * @@ -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,8 +31,8 @@ * lists by hooking into the end of the primitive pipeline and * manipulating the vertex_id field in the vertex headers. * - * XXX: work in progress - * + * XXX: work in progress + * * \author José Fonseca * \author Keith Whitwell */ @@ -324,7 +324,7 @@ i915_vbuf_ensure_index_bounds(struct vbuf_render *render, } static boolean -i915_vbuf_render_set_primitive(struct vbuf_render *render, +i915_vbuf_render_set_primitive(struct vbuf_render *render, unsigned prim) { struct i915_vbuf_render *i915_render = i915_vbuf_render(render); @@ -613,7 +613,7 @@ draw_calc_nr_indices(uint nr_indices, unsigned type) } } -static void +static void i915_vbuf_render_draw_elements(struct vbuf_render *render, const ushort *indices, uint nr_indices) @@ -639,7 +639,7 @@ i915_vbuf_render_draw_elements(struct vbuf_render *render, if (!BEGIN_BATCH(1 + (nr_indices + 1)/2, 1)) { FLUSH_BATCH(NULL); - /* Make sure state is re-emitted after a flush: + /* Make sure state is re-emitted after a flush: */ i915_update_derived(i915); i915_emit_hardware_state(i915); @@ -701,7 +701,7 @@ i915_vbuf_render_create(struct i915_context *i915) i915_render->base.max_vertex_buffer_bytes = 16*4096; - /* NOTE: it must be such that state and vertices indices fit in a single + /* NOTE: it must be such that state and vertices indices fit in a single * batch buffer. */ i915_render->base.max_indices = 16*1024; @@ -752,11 +752,11 @@ struct draw_stage *i915_draw_vbuf_stage(struct i915_context *i915) { struct vbuf_render *render; struct draw_stage *stage; - + render = i915_vbuf_render_create(i915); if(!render) return NULL; - + stage = draw_vbuf_stage(i915->draw, render); if(!stage) { render->destroy(render); diff --git a/src/gallium/drivers/i915/i915_reg.h b/src/gallium/drivers/i915/i915_reg.h index 5e4e80d..a8c2c6f 100644 --- a/src/gallium/drivers/i915/i915_reg.h +++ b/src/gallium/drivers/i915/i915_reg.h @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2003 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ @@ -490,7 +490,7 @@ #define REG_TYPE_R 0 /* temporary regs, no need to * dcl, must be written before * read -- Preserved between - * phases. + * phases. */ #define REG_TYPE_T 1 /* Interpolated values, must be * dcl'ed before use. @@ -535,7 +535,7 @@ /* Arithmetic instructions */ /* .replicate_swizzle == selection and replication of a particular - * scalar channel, ie., .xxxx, .yyyy, .zzzz or .wwww + * scalar channel, ie., .xxxx, .yyyy, .zzzz or .wwww */ #define A0_NOP (0x0<<24) /* no operation */ #define A0_ADD (0x1<<24) /* dst = src0 + src1 */ @@ -636,11 +636,11 @@ #define T0_DEST_TYPE_SHIFT 19 /* Allow: R, OC, OD, U */ /* Note: U (unpreserved) regs do not retain their values between - * phases (cannot be used for feedback) + * phases (cannot be used for feedback) * * Note: oC and OD registers can only be used as the destination of a * texture instruction once per phase (this is an implementation - * restriction). + * restriction). */ #define T0_DEST_NR_SHIFT 14 /* Allow R: 0..15, OC,OD: 0..0, U: 0..2 */ @@ -677,9 +677,9 @@ #define D0_CHANNEL_XYZ (D0_CHANNEL_XY|D0_CHANNEL_Z) /* I915 Errata: Do not allow (xz), (xw), (xzw) combinations for diffuse - * or specular declarations. + * or specular declarations. * - * For T dcls, only allow: (x), (xy), (xyz), (w), (xyzw) + * For T dcls, only allow: (x), (xy), (xyz), (w), (xyzw) * * Must be zero for S (sampler) dcls */ diff --git a/src/gallium/drivers/i915/i915_resource.h b/src/gallium/drivers/i915/i915_resource.h index 86620e6..81f0879 100644 --- a/src/gallium/drivers/i915/i915_resource.h +++ b/src/gallium/drivers/i915/i915_resource.h @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ #ifndef I915_RESOURCE_H diff --git a/src/gallium/drivers/i915/i915_resource_buffer.c b/src/gallium/drivers/i915/i915_resource_buffer.c index 450203d..8e0c51a 100644 --- a/src/gallium/drivers/i915/i915_resource_buffer.c +++ b/src/gallium/drivers/i915/i915_resource_buffer.c @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2006 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ /* * Authors: @@ -87,7 +87,7 @@ i915_buffer_transfer_inline_write( struct pipe_context *rm_ctx, } -struct u_resource_vtbl i915_buffer_vtbl = +struct u_resource_vtbl i915_buffer_vtbl = { i915_buffer_get_handle, /* get_handle */ i915_buffer_destroy, /* resource_destroy */ diff --git a/src/gallium/drivers/i915/i915_resource_texture.c b/src/gallium/drivers/i915/i915_resource_texture.c index f19106f..0c2a720 100644 --- a/src/gallium/drivers/i915/i915_resource_texture.c +++ b/src/gallium/drivers/i915/i915_resource_texture.c @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2006 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ /* * Authors: @@ -365,7 +365,7 @@ i915_texture_layout_3d(struct i915_texture *tex) unsigned nblocksy = util_format_get_nblocksy(pt->format, pt->height0); unsigned stack_nblocksy = 0; - /* Calculate the size of a single slice. + /* Calculate the size of a single slice. */ tex->stride = align(util_format_get_stride(pt->format, pt->width0), 4); @@ -381,11 +381,11 @@ i915_texture_layout_3d(struct i915_texture *tex) nblocksy = util_format_get_nblocksy(pt->format, height); } - /* Fixup depth image_offsets: + /* Fixup depth image_offsets: */ for (level = 0; level <= pt->last_level; level++) { unsigned i; - for (i = 0; i < depth; i++) + for (i = 0; i < depth; i++) i915_texture_set_image_offset(tex, level, i, 0, i * stack_nblocksy); depth = u_minify(depth, 1); @@ -715,7 +715,7 @@ i915_texture_destroy(struct pipe_screen *screen, FREE(tex); } -static struct pipe_transfer * +static struct pipe_transfer * i915_texture_get_transfer(struct pipe_context *context, struct pipe_resource *resource, unsigned level, @@ -775,7 +775,7 @@ i915_texture_transfer_unmap(struct pipe_context *pipe, -struct u_resource_vtbl i915_texture_vtbl = +struct u_resource_vtbl i915_texture_vtbl = { i915_texture_get_handle, /* get_handle */ i915_texture_destroy, /* resource_destroy */ diff --git a/src/gallium/drivers/i915/i915_screen.c b/src/gallium/drivers/i915/i915_screen.c index f66478e..9eb959b 100644 --- a/src/gallium/drivers/i915/i915_screen.c +++ b/src/gallium/drivers/i915/i915_screen.c @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ @@ -361,7 +361,7 @@ i915_screen_create(struct i915_winsys *iws) break; default: - debug_printf("%s: unknown pci id 0x%x, cannot create screen\n", + debug_printf("%s: unknown pci id 0x%x, cannot create screen\n", __FUNCTION__, iws->pci_id); FREE(is); return NULL; diff --git a/src/gallium/drivers/i915/i915_screen.h b/src/gallium/drivers/i915/i915_screen.h index 0c4186c..d0cdc29 100644 --- a/src/gallium/drivers/i915/i915_screen.h +++ b/src/gallium/drivers/i915/i915_screen.h @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ #ifndef I915_SCREEN_H diff --git a/src/gallium/drivers/i915/i915_state.c b/src/gallium/drivers/i915/i915_state.c index bbfcff6..233b53a 100644 --- a/src/gallium/drivers/i915/i915_state.c +++ b/src/gallium/drivers/i915/i915_state.c @@ -1,5 +1,5 @@ /************************************************************************** - * + * * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas. * All Rights Reserved. * @@ -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. - * + * **************************************************************************/ /* Authors: Keith Whitwell @@ -57,7 +57,7 @@ translate_wrap_mode(unsigned wrap) return TEXCOORDMODE_CLAMP_EDGE; case PIPE_TEX_WRAP_CLAMP_TO_BORDER: return TEXCOORDMODE_CLAMP_BORDER; - /* + /* case PIPE_TEX_WRAP_MIRRORED_REPEAT: return TEXCOORDMODE_MIRROR; */ @@ -228,7 +228,7 @@ i915_create_sampler_state(struct pipe_context *pipe, mipFilt = translate_mip_filter(sampler->min_mip_filter); minFilt = translate_img_filter( sampler->min_img_filter ); magFilt = translate_img_filter( sampler->mag_img_filter ); - + if (sampler->max_anisotropy > 1) minFilt = magFilt = FILTER_ANISOTROPIC; @@ -244,7 +244,7 @@ i915_create_sampler_state(struct pipe_context *pipe, /* Shadow: */ - if (sampler->compare_mode == PIPE_TEX_COMPARE_R_TO_TEXTURE) + if (sampler->compare_mode == PIPE_TEX_COMPARE_R_TO_TEXTURE) { cso->state[0] |= (SS2_SHADOW_ENABLE | i915_translate_compare_func(sampler->compare_func)); @@ -688,13 +688,13 @@ i915_create_rasterizer_state(struct pipe_context *pipe, case PIPE_FACE_FRONT: if (rasterizer->front_ccw) cso->LIS4 |= S4_CULLMODE_CCW; - else + else cso->LIS4 |= S4_CULLMODE_CW; break; case PIPE_FACE_BACK: if (rasterizer->front_ccw) cso->LIS4 |= S4_CULLMODE_CW; - else + else cso->LIS4 |= S4_CULLMODE_CCW; break; case PIPE_FACE_FRONT_AND_BACK: diff --git a/src/gallium/drivers/i915/i915_state.h b/src/gallium/drivers/i915/i915_state.h index b4074dc..a5f5880 100644 --- a/src/gallium/drivers/i915/i915_state.h +++ b/src/gallium/drivers/i915/i915_state.h @@ -1,5 +1,5 @@ /************************************************************************** - * + * * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas. * All Rights Reserved. * @@ -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. - * + * **************************************************************************/ /* Authors: Keith Whitwell diff --git a/src/gallium/drivers/i915/i915_state_derived.c b/src/gallium/drivers/i915/i915_state_derived.c index 1d4026a..e261a02 100644 --- a/src/gallium/drivers/i915/i915_state_derived.c +++ b/src/gallium/drivers/i915/i915_state_derived.c @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2003 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ @@ -82,7 +82,7 @@ static void calculate_vertex_layout(struct i915_context *i915) } } - + /* pos */ src = draw_find_shader_output(i915->draw, TGSI_SEMANTIC_POSITION, 0); if (needW) { diff --git a/src/gallium/drivers/i915/i915_state_emit.c b/src/gallium/drivers/i915/i915_state_emit.c index c48d53f..afe4241 100644 --- a/src/gallium/drivers/i915/i915_state_emit.c +++ b/src/gallium/drivers/i915/i915_state_emit.c @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2003 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ @@ -109,19 +109,19 @@ void i915_emit_hardware_state(struct i915_context *i915 ) { /* XXX: there must be an easier way */ - const unsigned dwords = ( 14 + - 7 + - I915_MAX_DYNAMIC + - 8 + - 2 + I915_TEX_UNITS*3 + + const unsigned dwords = ( 14 + + 7 + + I915_MAX_DYNAMIC + + 8 + 2 + I915_TEX_UNITS*3 + - 2 + I915_MAX_CONSTANT*4 + + 2 + I915_TEX_UNITS*3 + + 2 + I915_MAX_CONSTANT*4 + #if 0 - i915->current.program_len + + i915->current.program_len + #else - i915->fs->program_len + + i915->fs->program_len + #endif - 6 + 6 ) * 3/2; /* plus 50% margin */ const unsigned relocs = ( I915_TEX_UNITS + 3 @@ -154,7 +154,7 @@ i915_emit_hardware_state(struct i915_context *i915 ) OUT_BATCH(_3DSTATE_DFLT_SPEC_CMD); OUT_BATCH(0); - + OUT_BATCH(_3DSTATE_DFLT_Z_CMD); OUT_BATCH(0); @@ -163,9 +163,9 @@ i915_emit_hardware_state(struct i915_context *i915 ) CSB_TCB(1, 1) | CSB_TCB(2, 2) | CSB_TCB(3, 3) | - CSB_TCB(4, 4) | - CSB_TCB(5, 5) | - CSB_TCB(6, 6) | + CSB_TCB(4, 4) | + CSB_TCB(5, 5) | + CSB_TCB(6, 6) | CSB_TCB(7, 7)); OUT_BATCH(_3DSTATE_RASTER_RULES_CMD | @@ -174,8 +174,8 @@ i915_emit_hardware_state(struct i915_context *i915 ) ENABLE_LINE_STRIP_PROVOKE_VRTX | ENABLE_TRI_FAN_PROVOKE_VRTX | LINE_STRIP_PROVOKE_VRTX(1) | - TRI_FAN_PROVOKE_VRTX(2) | - ENABLE_TEXKILL_3D_4D | + TRI_FAN_PROVOKE_VRTX(2) | + ENABLE_TEXKILL_3D_4D | TEXKILL_4D); /* Need to initialize this to zero. @@ -194,15 +194,15 @@ i915_emit_hardware_state(struct i915_context *i915 ) /* 7 dwords, 1 relocs */ if (i915->hardware_dirty & I915_HW_IMMEDIATE) { - OUT_BATCH(_3DSTATE_LOAD_STATE_IMMEDIATE_1 | + OUT_BATCH(_3DSTATE_LOAD_STATE_IMMEDIATE_1 | I1_LOAD_S(0) | I1_LOAD_S(1) | I1_LOAD_S(2) | I1_LOAD_S(4) | I1_LOAD_S(5) | - I1_LOAD_S(6) | + I1_LOAD_S(6) | (5)); - + if(i915->vbo) OUT_RELOC(i915->vbo, I915_USAGE_VERTEX, @@ -215,11 +215,11 @@ i915_emit_hardware_state(struct i915_context *i915 ) OUT_BATCH(i915->current.immediate[I915_IMMEDIATE_S4]); OUT_BATCH(i915->current.immediate[I915_IMMEDIATE_S5]); OUT_BATCH(i915->current.immediate[I915_IMMEDIATE_S6]); - } + } #if 01 /* I915_MAX_DYNAMIC dwords, 0 relocs */ - if (i915->hardware_dirty & I915_HW_DYNAMIC) + if (i915->hardware_dirty & I915_HW_DYNAMIC) { int i; for (i = 0; i < I915_MAX_DYNAMIC; i++) { @@ -280,7 +280,7 @@ i915_emit_hardware_state(struct i915_context *i915 ) cformat = PIPE_FORMAT_B8G8R8A8_UNORM; /* arbitrary */ cformat = translate_format(cformat); - if (depth_surface) + if (depth_surface) zformat = translate_depth_format( i915->framebuffer.zsbuf->format ); OUT_BATCH(_3DSTATE_DST_BUF_VARS_CMD); @@ -327,12 +327,12 @@ i915_emit_hardware_state(struct i915_context *i915 ) #if 01 /* samplers */ /* 2 + I915_TEX_UNITS*3 dwords, 0 relocs */ - if (i915->hardware_dirty & I915_HW_SAMPLER) + if (i915->hardware_dirty & I915_HW_SAMPLER) { if (i915->current.sampler_enable_nr) { int i; - OUT_BATCH( _3DSTATE_SAMPLER_STATE | + OUT_BATCH( _3DSTATE_SAMPLER_STATE | (3 * i915->current.sampler_enable_nr) ); OUT_BATCH( i915->current.sampler_enable_flags ); diff --git a/src/gallium/drivers/i915/i915_state_inlines.h b/src/gallium/drivers/i915/i915_state_inlines.h index b589117..9d512f8 100644 --- a/src/gallium/drivers/i915/i915_state_inlines.h +++ b/src/gallium/drivers/i915/i915_state_inlines.h @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2003 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ #ifndef I915_STATE_INLINES_H diff --git a/src/gallium/drivers/i915/i915_state_sampler.c b/src/gallium/drivers/i915/i915_state_sampler.c index 916cb76..ae206b9 100644 --- a/src/gallium/drivers/i915/i915_state_sampler.c +++ b/src/gallium/drivers/i915/i915_state_sampler.c @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2003 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ #include "pipe/p_context.h" @@ -97,12 +97,12 @@ static void update_sampler(struct i915_context *i915, /* 3D textures don't seem to respect the border color. * Fallback if there's ever a danger that they might refer to - * it. - * + * it. + * * Effectively this means fallback on 3D clamp or * clamp_to_border. * - * XXX: Check if this is true on i945. + * XXX: Check if this is true on i945. * XXX: Check if this bug got fixed in release silicon. */ #if 0 @@ -117,7 +117,7 @@ static void update_sampler(struct i915_context *i915, wt == PIPE_TEX_WRAP_CLAMP || wr == PIPE_TEX_WRAP_CLAMP || ws == PIPE_TEX_WRAP_CLAMP_TO_BORDER || - wt == PIPE_TEX_WRAP_CLAMP_TO_BORDER || + wt == PIPE_TEX_WRAP_CLAMP_TO_BORDER || wr == PIPE_TEX_WRAP_CLAMP_TO_BORDER)) { if (i915->conformance_mode > 0) { assert(0); diff --git a/src/gallium/drivers/i915/i915_surface.c b/src/gallium/drivers/i915/i915_surface.c index becc6e9..92b8832 100644 --- a/src/gallium/drivers/i915/i915_surface.c +++ b/src/gallium/drivers/i915/i915_surface.c @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2003 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ #include "i915_surface.h" diff --git a/src/gallium/drivers/i915/i915_surface.h b/src/gallium/drivers/i915/i915_surface.h index 70b61de..43fef6a 100644 --- a/src/gallium/drivers/i915/i915_surface.h +++ b/src/gallium/drivers/i915/i915_surface.h @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ #ifndef I915_SURFACE_H diff --git a/src/gallium/drivers/i965/brw_batchbuffer.c b/src/gallium/drivers/i965/brw_batchbuffer.c index e80067f..5b03089 100644 --- a/src/gallium/drivers/i965/brw_batchbuffer.c +++ b/src/gallium/drivers/i965/brw_batchbuffer.c @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2006 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ #include "util/u_memory.h" @@ -90,7 +90,7 @@ brw_batchbuffer_free(struct brw_batchbuffer *batch) void -_brw_batchbuffer_flush(struct brw_batchbuffer *batch, +_brw_batchbuffer_flush(struct brw_batchbuffer *batch, const char *file, int line) { @@ -103,7 +103,7 @@ _brw_batchbuffer_flush(struct brw_batchbuffer *batch, */ if (BRW_DEBUG & DEBUG_BATCH) - debug_printf("%s:%d: Batchbuffer flush with %db used\n", + debug_printf("%s:%d: Batchbuffer flush with %db used\n", file, line, used); if (ALWAYS_EMIT_MI_FLUSH) { @@ -112,7 +112,7 @@ _brw_batchbuffer_flush(struct brw_batchbuffer *batch, used = batch->ptr - batch->map; } - /* Round batchbuffer usage to 2 DWORDs. + /* Round batchbuffer usage to 2 DWORDs. */ if ((used & 4) == 0) { *(GLuint *) (batch->ptr) = 0; /* noop */ @@ -120,7 +120,7 @@ _brw_batchbuffer_flush(struct brw_batchbuffer *batch, used = batch->ptr - batch->map; } - /* Mark the end of the buffer. + /* Mark the end of the buffer. */ *(GLuint *) (batch->ptr) = MI_BATCH_BUFFER_END; batch->ptr += 4; @@ -130,7 +130,7 @@ _brw_batchbuffer_flush(struct brw_batchbuffer *batch, batch->sws->bo_unmap(batch->buf); batch->map = NULL; batch->ptr = NULL; - + batch->sws->bo_exec(batch->buf, used ); if (BRW_DEBUG & DEBUG_SYNC) { @@ -169,7 +169,7 @@ brw_batchbuffer_emit_reloc(struct brw_batchbuffer *batch, ret = batch->sws->bo_emit_reloc(batch->buf, usage, - delta, + delta, batch->ptr - batch->map, buffer); if (ret != 0) diff --git a/src/gallium/drivers/i965/brw_cc.c b/src/gallium/drivers/i965/brw_cc.c index cc8e380..99de542 100644 --- a/src/gallium/drivers/i965/brw_cc.c +++ b/src/gallium/drivers/i965/brw_cc.c @@ -2,7 +2,7 @@ Copyright (C) Intel Corp. 2006. All Rights Reserved. Intel funded Tungsten Graphics (http://www.tungstengraphics.com) to develop this 3D driver. - + 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, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - + The above copyright notice and this permission notice (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 NONINFRINGEMENT. @@ -22,7 +22,7 @@ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - + **********************************************************************/ /* * Authors: @@ -36,7 +36,7 @@ static enum pipe_error prepare_cc_vp( struct brw_context *brw ) { - return brw_cache_data( &brw->cache, + return brw_cache_data( &brw->cache, BRW_CC_VP, &brw->curr.ccv, NULL, 0, diff --git a/src/gallium/drivers/i965/brw_clip.c b/src/gallium/drivers/i965/brw_clip.c index ccba205..4eb7223 100644 --- a/src/gallium/drivers/i965/brw_clip.c +++ b/src/gallium/drivers/i965/brw_clip.c @@ -2,7 +2,7 @@ Copyright (C) Intel Corp. 2006. All Rights Reserved. Intel funded Tungsten Graphics (http://www.tungstengraphics.com) to develop this 3D driver. - + 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, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - + The above copyright notice and this permission notice (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 NONINFRINGEMENT. @@ -22,7 +22,7 @@ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - + **********************************************************************/ /* * Authors: @@ -59,7 +59,7 @@ compile_clip_prog( struct brw_context *brw, GLuint delta; memset(&c, 0, sizeof(c)); - + /* Begin the compilation: */ brw_init_compile(brw, &c.func); @@ -96,7 +96,7 @@ compile_clip_prog( struct brw_context *brw, if (c.key.output_edgeflag != BRW_OUTPUT_NOT_PRESENT) c.offset_edgeflag = delta + c.key.output_edgeflag * ATTR_SIZE; - + if (BRW_IS_IGDNG(brw)) c.nr_regs = (c.key.nr_attrs + 1) / 2 + 3; /* are vertices packed, or reg-aligned? */ else @@ -107,7 +107,7 @@ compile_clip_prog( struct brw_context *brw, c.prog_data.clip_mode = c.key.clip_mode; /* XXX */ /* For some reason the thread is spawned with only 4 channels - * unmasked. + * unmasked. */ brw_set_mask_control(&c.func, BRW_MASK_DISABLE); @@ -116,7 +116,7 @@ compile_clip_prog( struct brw_context *brw, * do all three: */ switch (key->primitive) { - case PIPE_PRIM_TRIANGLES: + case PIPE_PRIM_TRIANGLES: if (key->do_unfilled) brw_emit_unfilled_clip( &c ); else @@ -133,7 +133,7 @@ compile_clip_prog( struct brw_context *brw, return PIPE_ERROR_BAD_INPUT; } - + /* get the program */ @@ -167,12 +167,12 @@ upload_clip_prog(struct brw_context *brw) enum pipe_error ret; /* Populate the key, starting from the almost-complete version from - * the rast state. + * the rast state. */ /* PIPE_NEW_RAST */ key = brw->curr.rast->clip_key; - + /* BRW_NEW_REDUCED_PRIMITIVE */ key.primitive = brw->reduced_primitive; @@ -214,7 +214,7 @@ upload_clip_prog(struct brw_context *brw) const struct brw_tracked_state brw_clip_prog = { .dirty = { - .mesa = (PIPE_NEW_RAST | + .mesa = (PIPE_NEW_RAST | PIPE_NEW_CLIP), .brw = (BRW_NEW_REDUCED_PRIMITIVE), .cache = CACHE_NEW_VS_PROG diff --git a/src/gallium/drivers/i965/brw_clip.h b/src/gallium/drivers/i965/brw_clip.h index 80e3a11..58ff1ab 100644 --- a/src/gallium/drivers/i965/brw_clip.h +++ b/src/gallium/drivers/i965/brw_clip.h @@ -2,7 +2,7 @@ Copyright (C) Intel Corp. 2006. All Rights Reserved. Intel funded Tungsten Graphics (http://www.tungstengraphics.com) to develop this 3D driver. - + 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, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - + The above copyright notice and this permission notice (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 NONINFRINGEMENT. @@ -22,7 +22,7 @@ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - + **********************************************************************/ /* * Authors: @@ -36,7 +36,7 @@ #include "brw_reg.h" #include "brw_eu.h" -#define MAX_VERTS (3+6+6) +#define MAX_VERTS (3+6+6) /* Note that if unfilled primitives are being emitted, we have to fix * up polygon offset and flatshading at this point: @@ -62,7 +62,7 @@ struct brw_clip_prog_key { GLuint output_bfc1:6; GLuint output_edgeflag:6; GLuint pad1:2; - + GLfloat offset_factor; GLfloat offset_units; }; @@ -86,7 +86,7 @@ struct brw_clip_compile { struct brw_compile func; struct brw_clip_prog_key key; struct brw_clip_prog_data prog_data; - + struct { struct brw_reg R0; struct brw_reg vertex[MAX_VERTS]; @@ -108,10 +108,10 @@ struct brw_clip_compile { struct brw_reg dir; struct brw_reg tmp0, tmp1; struct brw_reg offset; - + struct brw_reg fixed_planes; struct brw_reg plane_equation; - + struct brw_reg ff_sync; } reg; @@ -158,7 +158,7 @@ void brw_clip_tri_init_vertices( struct brw_clip_compile *c ); void brw_clip_tri_flat_shade( struct brw_clip_compile *c ); void brw_clip_tri( struct brw_clip_compile *c ); void brw_clip_tri_emit_polygon( struct brw_clip_compile *c ); -void brw_clip_tri_alloc_regs( struct brw_clip_compile *c, +void brw_clip_tri_alloc_regs( struct brw_clip_compile *c, GLuint nr_verts ); @@ -174,7 +174,7 @@ void brw_clip_interp_vertex( struct brw_clip_compile *c, void brw_clip_init_planes( struct brw_clip_compile *c ); -void brw_clip_emit_vue(struct brw_clip_compile *c, +void brw_clip_emit_vue(struct brw_clip_compile *c, struct brw_indirect vert, GLboolean allocate, GLboolean eot, diff --git a/src/gallium/drivers/i965/brw_clip_line.c b/src/gallium/drivers/i965/brw_clip_line.c index 66caadc..ecfb19e 100644 --- a/src/gallium/drivers/i965/brw_clip_line.c +++ b/src/gallium/drivers/i965/brw_clip_line.c @@ -2,7 +2,7 @@ Copyright (C) Intel Corp. 2006. All Rights Reserved. Intel funded Tungsten Graphics (http://www.tungstengraphics.com) to develop this 3D driver. - + 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, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - + The above copyright notice and this permission notice (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 NONINFRINGEMENT. @@ -22,7 +22,7 @@ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - + **********************************************************************/ /* * Authors: @@ -75,7 +75,7 @@ static void brw_clip_line_alloc_regs( struct brw_clip_compile *c ) i++; if (!c->key.nr_userclip) { - c->reg.fixed_planes = brw_vec8_grf(i, 0); + c->reg.fixed_planes = brw_vec8_grf(i, 0); i++; } @@ -107,7 +107,7 @@ static void brw_clip_line_alloc_regs( struct brw_clip_compile *c ) * GLfloat t = dp0 / (dp0 - dp1); * if (t > t0) t0 = t; * } - * + * * if (t0 + t1 >= 1.0) * return; * } @@ -138,7 +138,7 @@ static void clip_and_emit_line( struct brw_clip_compile *c ) brw_MOV(p, get_addr_reg(newvtx1), brw_address(c->reg.vertex[3])); brw_MOV(p, get_addr_reg(plane_ptr), brw_clip_plane0_address(c)); - /* Note: init t0, t1 together: + /* Note: init t0, t1 together: */ brw_MOV(p, vec2(c->reg.t0), brw_imm_f(0)); @@ -161,7 +161,7 @@ static void clip_and_emit_line( struct brw_clip_compile *c ) */ brw_set_conditionalmod(p, BRW_CONDITIONAL_NZ); brw_AND(p, v1_null_ud, c->reg.planemask, brw_imm_ud(1)); - + plane_active = brw_IF(p, BRW_EXECUTE_1); { if (c->key.nr_userclip) @@ -169,11 +169,11 @@ static void clip_and_emit_line( struct brw_clip_compile *c ) else brw_MOV(p, c->reg.plane_equation, deref_4b(plane_ptr, 0)); - /* dp = DP4(vtx->position, plane) + /* dp = DP4(vtx->position, plane) */ brw_DP4(p, vec4(c->reg.dp0), deref_4f(vtx0, c->offset_hpos), c->reg.plane_equation); - /* if (IS_NEGATIVE(dp1)) + /* if (IS_NEGATIVE(dp1)) */ brw_set_conditionalmod(p, BRW_CONDITIONAL_L); brw_DP4(p, vec4(c->reg.dp1), deref_4f(vtx1, c->offset_hpos), c->reg.plane_equation); @@ -199,7 +199,7 @@ static void clip_and_emit_line( struct brw_clip_compile *c ) brw_CMP(p, vec1(brw_null_reg()), BRW_CONDITIONAL_G, c->reg.t, c->reg.t1 ); brw_MOV(p, c->reg.t1, c->reg.t); brw_set_predicate_control(p, BRW_PREDICATE_NONE); - } + } is_negative = brw_ELSE(p, is_negative); { /* Coming back in. We know that both cannot be negative @@ -227,10 +227,10 @@ static void clip_and_emit_line( struct brw_clip_compile *c ) brw_ENDIF(p, is_neg2); } } - brw_ENDIF(p, is_negative); + brw_ENDIF(p, is_negative); } brw_ENDIF(p, plane_active); - + /* plane_ptr++; */ brw_ADD(p, get_addr_reg(plane_ptr), get_addr_reg(plane_ptr), brw_clip_plane_stride(c)); @@ -250,7 +250,7 @@ static void clip_and_emit_line( struct brw_clip_compile *c ) brw_clip_interp_vertex(c, newvtx1, vtx1, vtx0, c->reg.t1, FALSE); brw_clip_emit_vue(c, newvtx0, 1, 0, (_3DPRIM_LINESTRIP << 2) | R02_PRIM_START); - brw_clip_emit_vue(c, newvtx1, 0, 1, (_3DPRIM_LINESTRIP << 2) | R02_PRIM_END); + brw_clip_emit_vue(c, newvtx1, 0, 1, (_3DPRIM_LINESTRIP << 2) | R02_PRIM_END); } brw_ENDIF(p, not_culled); brw_clip_kill_thread(c); @@ -265,6 +265,6 @@ void brw_emit_line_clip( struct brw_clip_compile *c ) if (c->key.do_flat_shading) brw_clip_copy_colors(c, 0, 1); - + clip_and_emit_line(c); } diff --git a/src/gallium/drivers/i965/brw_clip_point.c b/src/gallium/drivers/i965/brw_clip_point.c index 124156c..777ba8a 100644 --- a/src/gallium/drivers/i965/brw_clip_point.c +++ b/src/gallium/drivers/i965/brw_clip_point.c @@ -2,7 +2,7 @@ Copyright (C) Intel Corp. 2006. All Rights Reserved. Intel funded Tungsten Graphics (http://www.tungstengraphics.com) to develop this 3D driver. - + 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, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - + The above copyright notice and this permission notice (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 NONINFRINGEMENT. @@ -22,7 +22,7 @@ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - + **********************************************************************/ /* * Authors: diff --git a/src/gallium/drivers/i965/brw_clip_state.c b/src/gallium/drivers/i965/brw_clip_state.c index 5c3ccfd..53991a5 100644 --- a/src/gallium/drivers/i965/brw_clip_state.c +++ b/src/gallium/drivers/i965/brw_clip_state.c @@ -2,7 +2,7 @@ Copyright (C) Intel Corp. 2006. All Rights Reserved. Intel funded Tungsten Graphics (http://www.tungstengraphics.com) to develop this 3D driver. - + 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, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - + The above copyright notice and this permission notice (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 NONINFRINGEMENT. @@ -22,7 +22,7 @@ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - + **********************************************************************/ /* * Authors: @@ -105,12 +105,12 @@ clip_unit_create_from_key(struct brw_context *brw, * even number. */ assert(key->nr_urb_entries % 2 == 0); - - /* Although up to 16 concurrent Clip threads are allowed on IGDNG, + + /* Although up to 16 concurrent Clip threads are allowed on IGDNG, * only 2 threads can output VUEs at a time. */ if (BRW_IS_IGDNG(brw)) - clip.thread4.max_threads = 16 - 1; + clip.thread4.max_threads = 16 - 1; else clip.thread4.max_threads = 2 - 1; } else { @@ -186,15 +186,15 @@ static int upload_clip_unit( struct brw_context *brw ) NULL, &brw->clip.state_bo)) return PIPE_OK; - + /* Create new: */ - ret = clip_unit_create_from_key(brw, &key, + ret = clip_unit_create_from_key(brw, &key, reloc, &brw->clip.state_bo); if (ret) return ret; - + return PIPE_OK; } diff --git a/src/gallium/drivers/i965/brw_clip_tri.c b/src/gallium/drivers/i965/brw_clip_tri.c index 069524b..5ce2823 100644 --- a/src/gallium/drivers/i965/brw_clip_tri.c +++ b/src/gallium/drivers/i965/brw_clip_tri.c @@ -2,7 +2,7 @@ Copyright (C) Intel Corp. 2006. All Rights Reserved. Intel funded Tungsten Graphics (http://www.tungstengraphics.com) to develop this 3D driver. - + 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, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - + The above copyright notice and this permission notice (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 NONINFRINGEMENT. @@ -22,7 +22,7 @@ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - + **********************************************************************/ /* * Authors: @@ -39,7 +39,7 @@ static void release_tmps( struct brw_clip_compile *c ) } -void brw_clip_tri_alloc_regs( struct brw_clip_compile *c, +void brw_clip_tri_alloc_regs( struct brw_clip_compile *c, GLuint nr_verts ) { GLuint i = 0,j; @@ -97,7 +97,7 @@ void brw_clip_tri_alloc_regs( struct brw_clip_compile *c, i++; if (!c->key.nr_userclip) { - c->reg.fixed_planes = brw_vec8_grf(i, 0); + c->reg.fixed_planes = brw_vec8_grf(i, 0); i++; } @@ -132,10 +132,10 @@ void brw_clip_tri_init_vertices( struct brw_clip_compile *c ) /* Initial list of indices for incoming vertexes: */ - brw_AND(p, tmp0, get_element_ud(c->reg.R0, 2), brw_imm_ud(PRIM_MASK)); - brw_CMP(p, - vec1(brw_null_reg()), - BRW_CONDITIONAL_EQ, + brw_AND(p, tmp0, get_element_ud(c->reg.R0, 2), brw_imm_ud(PRIM_MASK)); + brw_CMP(p, + vec1(brw_null_reg()), + BRW_CONDITIONAL_EQ, tmp0, brw_imm_ud(_3DPRIM_TRISTRIP_REVERSE)); @@ -143,7 +143,7 @@ void brw_clip_tri_init_vertices( struct brw_clip_compile *c ) * second tristrip element: Can ignore sometimes? */ is_rev = brw_IF(p, BRW_EXECUTE_1); - { + { brw_MOV(p, get_element(c->reg.inlist, 0), brw_address(c->reg.vertex[1]) ); brw_MOV(p, get_element(c->reg.inlist, 1), brw_address(c->reg.vertex[0]) ); if (c->need_direction) @@ -171,15 +171,15 @@ void brw_clip_tri_flat_shade( struct brw_clip_compile *c ) struct brw_instruction *is_poly; struct brw_reg tmp0 = c->reg.loopcount; /* handy temporary */ - brw_AND(p, tmp0, get_element_ud(c->reg.R0, 2), brw_imm_ud(PRIM_MASK)); - brw_CMP(p, - vec1(brw_null_reg()), - BRW_CONDITIONAL_EQ, + brw_AND(p, tmp0, get_element_ud(c->reg.R0, 2), brw_imm_ud(PRIM_MASK)); + brw_CMP(p, + vec1(brw_null_reg()), + BRW_CONDITIONAL_EQ, tmp0, brw_imm_ud(_3DPRIM_POLYGON)); is_poly = brw_IF(p, BRW_EXECUTE_1); - { + { brw_clip_copy_colors(c, 1, 0); brw_clip_copy_colors(c, 2, 0); } @@ -210,7 +210,7 @@ void brw_clip_tri( struct brw_clip_compile *c ) struct brw_instruction *vertex_loop; struct brw_instruction *next_test; struct brw_instruction *prev_test; - + brw_MOV(p, get_addr_reg(vtxPrev), brw_address(c->reg.vertex[2]) ); brw_MOV(p, get_addr_reg(plane_ptr), brw_clip_plane0_address(c)); brw_MOV(p, get_addr_reg(inlist_ptr), brw_address(c->reg.inlist)); @@ -224,10 +224,10 @@ void brw_clip_tri( struct brw_clip_compile *c ) */ brw_set_conditionalmod(p, BRW_CONDITIONAL_NZ); brw_AND(p, vec1(brw_null_reg()), c->reg.planemask, brw_imm_ud(1)); - + plane_active = brw_IF(p, BRW_EXECUTE_1); { - /* vtxOut = freelist_ptr++ + /* vtxOut = freelist_ptr++ */ brw_MOV(p, get_addr_reg(vtxOut), get_addr_reg(freelist_ptr) ); brw_ADD(p, get_addr_reg(freelist_ptr), get_addr_reg(freelist_ptr), brw_imm_uw(c->nr_regs * REG_SIZE)); @@ -236,7 +236,7 @@ void brw_clip_tri( struct brw_clip_compile *c ) brw_MOV(p, c->reg.plane_equation, deref_4f(plane_ptr, 0)); else brw_MOV(p, c->reg.plane_equation, deref_4b(plane_ptr, 0)); - + brw_MOV(p, c->reg.loopcount, c->reg.nr_verts); brw_MOV(p, c->reg.nr_verts, brw_imm_ud(0)); @@ -273,7 +273,7 @@ void brw_clip_tri( struct brw_clip_compile *c ) brw_clip_interp_vertex(c, vtxOut, vtxPrev, vtx, c->reg.t, GL_FALSE); /* *outlist_ptr++ = vtxOut; - * nr_verts++; + * nr_verts++; * vtxOut = 0; */ brw_MOV(p, deref_1uw(outlist_ptr, 0), get_addr_reg(vtxOut)); @@ -282,7 +282,7 @@ void brw_clip_tri( struct brw_clip_compile *c ) brw_MOV(p, get_addr_reg(vtxOut), brw_imm_uw(0) ); } brw_ENDIF(p, next_test); - + } prev_test = brw_ELSE(p, prev_test); { @@ -312,21 +312,21 @@ void brw_clip_tri( struct brw_clip_compile *c ) brw_MOV(p, get_addr_reg(vtxOut), get_addr_reg(vtx) ); brw_set_predicate_control(p, BRW_PREDICATE_NONE); - brw_clip_interp_vertex(c, vtxOut, vtx, vtxPrev, c->reg.t, GL_TRUE); + brw_clip_interp_vertex(c, vtxOut, vtx, vtxPrev, c->reg.t, GL_TRUE); /* *outlist_ptr++ = vtxOut; - * nr_verts++; + * nr_verts++; * vtxOut = 0; */ brw_MOV(p, deref_1uw(outlist_ptr, 0), get_addr_reg(vtxOut)); brw_ADD(p, get_addr_reg(outlist_ptr), get_addr_reg(outlist_ptr), brw_imm_uw(sizeof(short))); brw_ADD(p, c->reg.nr_verts, c->reg.nr_verts, brw_imm_ud(1)); brw_MOV(p, get_addr_reg(vtxOut), brw_imm_uw(0) ); - } + } brw_ENDIF(p, next_test); } brw_ENDIF(p, prev_test); - + /* vtxPrev = vtx; * inlist_ptr++; */ @@ -337,7 +337,7 @@ void brw_clip_tri( struct brw_clip_compile *c ) */ brw_set_conditionalmod(p, BRW_CONDITIONAL_NZ); brw_ADD(p, c->reg.loopcount, c->reg.loopcount, brw_imm_d(-1)); - } + } brw_WHILE(p, vertex_loop); /* vtxPrev = *(outlist_ptr-1) OR: outlist[nr_verts-1] @@ -352,19 +352,19 @@ void brw_clip_tri( struct brw_clip_compile *c ) brw_MOV(p, get_addr_reg(outlist_ptr), brw_address(c->reg.outlist)); } brw_ENDIF(p, plane_active); - + /* plane_ptr++; */ brw_ADD(p, get_addr_reg(plane_ptr), get_addr_reg(plane_ptr), brw_clip_plane_stride(c)); - /* nr_verts >= 3 + /* nr_verts >= 3 */ brw_CMP(p, vec1(brw_null_reg()), BRW_CONDITIONAL_GE, c->reg.nr_verts, brw_imm_ud(3)); - + /* && (planemask>>=1) != 0 */ brw_set_conditionalmod(p, BRW_CONDITIONAL_NZ); @@ -397,14 +397,14 @@ void brw_clip_tri_emit_polygon(struct brw_clip_compile *c) brw_MOV(p, get_addr_reg(v0), deref_1uw(vptr, 0)); brw_clip_emit_vue(c, v0, 1, 0, ((_3DPRIM_TRIFAN << 2) | R02_PRIM_START)); - + brw_ADD(p, get_addr_reg(vptr), get_addr_reg(vptr), brw_imm_uw(2)); brw_MOV(p, get_addr_reg(v0), deref_1uw(vptr, 0)); loop = brw_DO(p, BRW_EXECUTE_1); { brw_clip_emit_vue(c, v0, 1, 0, (_3DPRIM_TRIFAN << 2)); - + brw_ADD(p, get_addr_reg(vptr), get_addr_reg(vptr), brw_imm_uw(2)); brw_MOV(p, get_addr_reg(v0), deref_1uw(vptr, 0)); @@ -468,11 +468,11 @@ static void brw_clip_test( struct brw_clip_compile *c ) /* test nearz, xmin, ymin plane */ /* clip.xyz < -clip.w */ - brw_CMP(p, t1, BRW_CONDITIONAL_L, v0, negate(get_element(v0, 3))); + brw_CMP(p, t1, BRW_CONDITIONAL_L, v0, negate(get_element(v0, 3))); brw_set_predicate_control(p, BRW_PREDICATE_NONE); - brw_CMP(p, t2, BRW_CONDITIONAL_L, v1, negate(get_element(v1, 3))); + brw_CMP(p, t2, BRW_CONDITIONAL_L, v1, negate(get_element(v1, 3))); brw_set_predicate_control(p, BRW_PREDICATE_NONE); - brw_CMP(p, t3, BRW_CONDITIONAL_L, v2, negate(get_element(v2, 3))); + brw_CMP(p, t3, BRW_CONDITIONAL_L, v2, negate(get_element(v2, 3))); brw_set_predicate_control(p, BRW_PREDICATE_NONE); /* All vertices are outside of a plane, rejected */ @@ -509,11 +509,11 @@ static void brw_clip_test( struct brw_clip_compile *c ) /* test farz, xmax, ymax plane */ /* clip.xyz > clip.w */ - brw_CMP(p, t1, BRW_CONDITIONAL_G, v0, get_element(v0, 3)); + brw_CMP(p, t1, BRW_CONDITIONAL_G, v0, get_element(v0, 3)); brw_set_predicate_control(p, BRW_PREDICATE_NONE); - brw_CMP(p, t2, BRW_CONDITIONAL_G, v1, get_element(v1, 3)); + brw_CMP(p, t2, BRW_CONDITIONAL_G, v1, get_element(v1, 3)); brw_set_predicate_control(p, BRW_PREDICATE_NONE); - brw_CMP(p, t3, BRW_CONDITIONAL_G, v2, get_element(v2, 3)); + brw_CMP(p, t3, BRW_CONDITIONAL_G, v2, get_element(v2, 3)); brw_set_predicate_control(p, BRW_PREDICATE_NONE); /* All vertices are outside of a plane, rejected */ @@ -561,13 +561,13 @@ void brw_emit_tri_clip( struct brw_clip_compile *c ) brw_clip_init_clipmask(c); brw_clip_init_ff_sync(c); - /* if -ve rhw workaround bit is set, + /* if -ve rhw workaround bit is set, do cliptest */ if (c->chipset.is_965) { brw_set_conditionalmod(p, BRW_CONDITIONAL_NZ); - brw_AND(p, brw_null_reg(), get_element_ud(c->reg.R0, 2), + brw_AND(p, brw_null_reg(), get_element_ud(c->reg.R0, 2), brw_imm_ud(1<<20)); - neg_rhw = brw_IF(p, BRW_EXECUTE_1); + neg_rhw = brw_IF(p, BRW_EXECUTE_1); { brw_clip_test(c); } @@ -577,13 +577,13 @@ void brw_emit_tri_clip( struct brw_clip_compile *c ) * flatshading, need to apply the flatshade here because we don't * respect the PV when converting to trifan for emit: */ - if (c->key.do_flat_shading) - brw_clip_tri_flat_shade(c); - + if (c->key.do_flat_shading) + brw_clip_tri_flat_shade(c); + if ((c->key.clip_mode == BRW_CLIPMODE_NORMAL) || (c->key.clip_mode == BRW_CLIPMODE_KERNEL_CLIP)) do_clip_tri(c); - else + else maybe_do_clip_tri(c); brw_clip_tri_emit_polygon(c); diff --git a/src/gallium/drivers/i965/brw_clip_unfilled.c b/src/gallium/drivers/i965/brw_clip_unfilled.c index aec835b..407e6b5 100644 --- a/src/gallium/drivers/i965/brw_clip_unfilled.c +++ b/src/gallium/drivers/i965/brw_clip_unfilled.c @@ -2,7 +2,7 @@ Copyright (C) Intel Corp. 2006. All Rights Reserved. Intel funded Tungsten Graphics (http://www.tungstengraphics.com) to develop this 3D driver. - + 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, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - + The above copyright notice and this permission notice (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 NONINFRINGEMENT. @@ -22,7 +22,7 @@ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - + **********************************************************************/ /* * Authors: @@ -45,9 +45,9 @@ static void compute_tri_direction( struct brw_clip_compile *c ) struct brw_compile *p = &c->func; struct brw_reg e = c->reg.tmp0; struct brw_reg f = c->reg.tmp1; - struct brw_reg v0 = byte_offset(c->reg.vertex[0], c->offset_hpos); - struct brw_reg v1 = byte_offset(c->reg.vertex[1], c->offset_hpos); - struct brw_reg v2 = byte_offset(c->reg.vertex[2], c->offset_hpos); + struct brw_reg v0 = byte_offset(c->reg.vertex[0], c->offset_hpos); + struct brw_reg v1 = byte_offset(c->reg.vertex[1], c->offset_hpos); + struct brw_reg v2 = byte_offset(c->reg.vertex[2], c->offset_hpos); struct brw_reg v0n = get_tmp(c); @@ -72,8 +72,8 @@ static void compute_tri_direction( struct brw_clip_compile *c ) /* Calculate the vectors of two edges of the triangle: */ - brw_ADD(p, e, v0n, negate(v2n)); - brw_ADD(p, f, v1n, negate(v2n)); + brw_ADD(p, e, v0n, negate(v2n)); + brw_ADD(p, f, v1n, negate(v2n)); /* Take their crossproduct: */ @@ -105,7 +105,7 @@ static void cull_direction( struct brw_clip_compile *c ) conditional, get_element(c->reg.dir, 2), brw_imm_f(0)); - + ccw = brw_IF(p, BRW_EXECUTE_1); { brw_clip_kill_thread(c); @@ -121,7 +121,7 @@ static void copy_bfc( struct brw_clip_compile *c ) struct brw_instruction *ccw; GLuint conditional; - /* Do we have any colors to copy? + /* Do we have any colors to copy? */ if ((c->offset_color0 == 0 || c->offset_bfc0 == 0) && (c->offset_color1 == 0 || c->offset_bfc1 == 0)) @@ -141,19 +141,19 @@ static void copy_bfc( struct brw_clip_compile *c ) conditional, get_element(c->reg.dir, 2), brw_imm_f(0)); - + ccw = brw_IF(p, BRW_EXECUTE_1); { GLuint i; for (i = 0; i < 3; i++) { if (c->offset_color0 && c->offset_bfc0) - brw_MOV(p, + brw_MOV(p, byte_offset(c->reg.vertex[i], c->offset_color0), byte_offset(c->reg.vertex[i], c->offset_bfc0)); if (c->offset_color1 && c->offset_bfc1) - brw_MOV(p, + brw_MOV(p, byte_offset(c->reg.vertex[i], c->offset_color0), byte_offset(c->reg.vertex[i], c->offset_bfc0)); } @@ -177,14 +177,14 @@ static void compute_offset( struct brw_clip_compile *c ) struct brw_compile *p = &c->func; struct brw_reg off = c->reg.offset; struct brw_reg dir = c->reg.dir; - + brw_math_invert(p, get_element(off, 2), get_element(dir, 2)); brw_MUL(p, vec2(off), dir, get_element(off, 2)); - brw_CMP(p, - vec1(brw_null_reg()), + brw_CMP(p, + vec1(brw_null_reg()), BRW_CONDITIONAL_GE, - brw_abs(get_element(off, 0)), + brw_abs(get_element(off, 0)), brw_abs(get_element(off, 1))); brw_SEL(p, vec1(off), brw_abs(get_element(off, 0)), brw_abs(get_element(off, 1))); @@ -201,10 +201,10 @@ static void merge_edgeflags( struct brw_clip_compile *c ) struct brw_instruction *is_poly; struct brw_reg tmp0 = get_element_ud(c->reg.tmp0, 0); - brw_AND(p, tmp0, get_element_ud(c->reg.R0, 2), brw_imm_ud(PRIM_MASK)); - brw_CMP(p, - vec1(brw_null_reg()), - BRW_CONDITIONAL_EQ, + brw_AND(p, tmp0, get_element_ud(c->reg.R0, 2), brw_imm_ud(PRIM_MASK)); + brw_CMP(p, + vec1(brw_null_reg()), + BRW_CONDITIONAL_EQ, tmp0, brw_imm_ud(_3DPRIM_POLYGON)); @@ -212,7 +212,7 @@ static void merge_edgeflags( struct brw_clip_compile *c ) * a _3DPRIM_TRISTRIP_REVERSE: */ is_poly = brw_IF(p, BRW_EXECUTE_1); - { + { brw_set_conditionalmod(p, BRW_CONDITIONAL_EQ); brw_AND(p, vec1(brw_null_reg()), get_element_ud(c->reg.R0, 2), brw_imm_ud(1<<8)); brw_MOV(p, byte_offset(c->reg.vertex[0], c->offset_edgeflag), brw_imm_f(0)); @@ -264,9 +264,9 @@ static void emit_lines(struct brw_clip_compile *c, { brw_MOV(p, get_addr_reg(v0), deref_1uw(v0ptr, 0)); brw_ADD(p, get_addr_reg(v0ptr), get_addr_reg(v0ptr), brw_imm_uw(2)); - + apply_one_offset(c, v0); - + brw_set_conditionalmod(p, BRW_CONDITIONAL_G); brw_ADD(p, c->reg.loopcount, c->reg.loopcount, brw_imm_d(-1)); } @@ -289,8 +289,8 @@ static void emit_lines(struct brw_clip_compile *c, brw_ADD(p, get_addr_reg(v0ptr), get_addr_reg(v0ptr), brw_imm_uw(2)); /* draw edge if edgeflag != 0 */ - brw_CMP(p, - vec1(brw_null_reg()), BRW_CONDITIONAL_NZ, + brw_CMP(p, + vec1(brw_null_reg()), BRW_CONDITIONAL_NZ, deref_1f(v0, c->offset_edgeflag), brw_imm_f(0)); draw_edge = brw_IF(p, BRW_EXECUTE_1); @@ -326,10 +326,10 @@ static void emit_points(struct brw_clip_compile *c, brw_MOV(p, get_addr_reg(v0), deref_1uw(v0ptr, 0)); brw_ADD(p, get_addr_reg(v0ptr), get_addr_reg(v0ptr), brw_imm_uw(2)); - /* draw if edgeflag != 0 + /* draw if edgeflag != 0 */ - brw_CMP(p, - vec1(brw_null_reg()), BRW_CONDITIONAL_NZ, + brw_CMP(p, + vec1(brw_null_reg()), BRW_CONDITIONAL_NZ, deref_1f(v0, c->offset_edgeflag), brw_imm_f(0)); draw_point = brw_IF(p, BRW_EXECUTE_1); @@ -354,7 +354,7 @@ static void emit_points(struct brw_clip_compile *c, static void emit_primitives( struct brw_clip_compile *c, - GLuint mode, + GLuint mode, GLboolean do_offset ) { switch (mode) { @@ -374,7 +374,7 @@ static void emit_primitives( struct brw_clip_compile *c, assert(0); break; } -} +} @@ -394,7 +394,7 @@ static void emit_unfilled_primitives( struct brw_clip_compile *c ) BRW_CONDITIONAL_GE, get_element(c->reg.dir, 2), brw_imm_f(0)); - + ccw = brw_IF(p, BRW_EXECUTE_1); { emit_primitives(c, c->key.fill_ccw, c->key.offset_ccw); @@ -408,7 +408,7 @@ static void emit_unfilled_primitives( struct brw_clip_compile *c ) else if (c->key.fill_cw != CLIP_CULL) { emit_primitives(c, c->key.fill_cw, c->key.offset_cw); } - else if (c->key.fill_ccw != CLIP_CULL) { + else if (c->key.fill_ccw != CLIP_CULL) { emit_primitives(c, c->key.fill_ccw, c->key.offset_ccw); } } @@ -421,7 +421,7 @@ static void check_nr_verts( struct brw_clip_compile *c ) struct brw_compile *p = &c->func; struct brw_instruction *if_insn; - brw_CMP(p, vec1(brw_null_reg()), BRW_CONDITIONAL_L, c->reg.nr_verts, brw_imm_d(3)); + brw_CMP(p, vec1(brw_null_reg()), BRW_CONDITIONAL_L, c->reg.nr_verts, brw_imm_d(3)); if_insn = brw_IF(p, BRW_EXECUTE_1); { brw_clip_kill_thread(c); @@ -434,7 +434,7 @@ void brw_emit_unfilled_clip( struct brw_clip_compile *c ) { struct brw_compile *p = &c->func; struct brw_instruction *do_clip; - + c->need_direction = ((c->key.offset_ccw || c->key.offset_cw) || (c->key.fill_ccw != c->key.fill_cw) || @@ -457,11 +457,11 @@ void brw_emit_unfilled_clip( struct brw_clip_compile *c ) merge_edgeflags(c); - /* Need to use the inlist indirection here: + /* Need to use the inlist indirection here: */ - if (c->need_direction) + if (c->need_direction) compute_tri_direction(c); - + if (c->key.fill_ccw == CLIP_CULL || c->key.fill_cw == CLIP_CULL) cull_direction(c); @@ -478,7 +478,7 @@ void brw_emit_unfilled_clip( struct brw_clip_compile *c ) */ if (c->key.do_flat_shading) brw_clip_tri_flat_shade(c); - + brw_clip_init_clipmask(c); brw_CMP(p, vec1(brw_null_reg()), BRW_CONDITIONAL_NZ, c->reg.planemask, brw_imm_ud(0)); do_clip = brw_IF(p, BRW_EXECUTE_1); @@ -488,7 +488,7 @@ void brw_emit_unfilled_clip( struct brw_clip_compile *c ) check_nr_verts(c); } brw_ENDIF(p, do_clip); - + emit_unfilled_primitives(c); brw_clip_kill_thread(c); } diff --git a/src/gallium/drivers/i965/brw_clip_util.c b/src/gallium/drivers/i965/brw_clip_util.c index 23e51ee..2e7608b 100644 --- a/src/gallium/drivers/i965/brw_clip_util.c +++ b/src/gallium/drivers/i965/brw_clip_util.c @@ -2,7 +2,7 @@ Copyright (C) Intel Corp. 2006. All Rights Reserved. Intel funded Tungsten Graphics (http://www.tungstengraphics.com) to develop this 3D driver. - + 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, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - + The above copyright notice and this permission notice (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 NONINFRINGEMENT. @@ -22,7 +22,7 @@ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - + **********************************************************************/ /* * Authors: @@ -84,7 +84,7 @@ void brw_clip_project_position(struct brw_clip_compile *c, struct brw_reg pos ) { struct brw_compile *p = &c->func; - /* calc rhw + /* calc rhw */ brw_math_invert(p, get_element(pos, W), get_element(pos, W)); @@ -96,7 +96,7 @@ void brw_clip_project_position(struct brw_clip_compile *c, struct brw_reg pos ) } -static void brw_clip_project_vertex( struct brw_clip_compile *c, +static void brw_clip_project_vertex( struct brw_clip_compile *c, struct brw_indirect vert_addr ) { struct brw_compile *p = &c->func; @@ -108,14 +108,14 @@ static void brw_clip_project_vertex( struct brw_clip_compile *c, brw_MOV(p, tmp, deref_4f(vert_addr, c->offset_hpos)); brw_clip_project_position(c, tmp); brw_MOV(p, deref_4f(vert_addr, c->header_position_offset), tmp); - + release_tmp(c, tmp); } -/* Interpolate between two vertices and put the result into a0.0. +/* Interpolate between two vertices and put the result into a0.0. * Increment a0.0 accordingly. */ void brw_clip_interp_vertex( struct brw_clip_compile *c, @@ -136,7 +136,7 @@ void brw_clip_interp_vertex( struct brw_clip_compile *c, * back on IGDNG, so needn't change it */ brw_copy_indirect_to_indirect(p, dest_ptr, v0_ptr, 1); - + /* Iterate over each attribute (could be done in pairs?) */ for (i = 0; i < c->key.nr_attrs; i++) { @@ -146,28 +146,28 @@ void brw_clip_interp_vertex( struct brw_clip_compile *c, delta = i * 16 + 32 * 3; if (delta == c->offset_edgeflag) { - if (force_edgeflag) + if (force_edgeflag) brw_MOV(p, deref_4f(dest_ptr, delta), brw_imm_f(1)); else brw_MOV(p, deref_4f(dest_ptr, delta), deref_4f(v0_ptr, delta)); } else { - /* Interpolate: + /* Interpolate: * * New = attr0 + t*attr1 - t*attr0 */ - brw_MUL(p, + brw_MUL(p, vec4(brw_null_reg()), deref_4f(v1_ptr, delta), t0); - brw_MAC(p, - tmp, + brw_MAC(p, + tmp, negate(deref_4f(v0_ptr, delta)), - t0); - + t0); + brw_ADD(p, - deref_4f(dest_ptr, delta), + deref_4f(dest_ptr, delta), deref_4f(v0_ptr, delta), tmp); } @@ -195,7 +195,7 @@ void brw_clip_interp_vertex( struct brw_clip_compile *c, #define MAX_MRF 16 -void brw_clip_emit_vue(struct brw_clip_compile *c, +void brw_clip_emit_vue(struct brw_clip_compile *c, struct brw_indirect vert, GLboolean allocate, GLboolean eot, @@ -207,7 +207,7 @@ void brw_clip_emit_vue(struct brw_clip_compile *c, brw_clip_ff_sync(c); assert(!(allocate && eot)); - + /* Cycle through mrf regs - probably futile as we have to wait for * the allocation response anyway. Also, the order this function * is invoked doesn't correspond to the order the instructions will @@ -219,7 +219,7 @@ void brw_clip_emit_vue(struct brw_clip_compile *c, c->last_mrf = start + c->nr_regs + 1; #endif - + /* Copy the vertex from vertn into m1..mN+1: */ brw_copy_from_indirect(p, brw_message_reg(start+1), vert, c->nr_regs); @@ -236,14 +236,14 @@ void brw_clip_emit_vue(struct brw_clip_compile *c, * entry. Each of these writes instantiates a seperate * urb entry - (I think... what about 'allocate'?) */ - brw_urb_WRITE(p, + brw_urb_WRITE(p, allocate ? c->reg.R0 : retype(brw_null_reg(), BRW_REGISTER_TYPE_UD), start, c->reg.R0, allocate, 1, /* used */ c->nr_regs + 1, /* msg length */ - allocate ? 1 : 0, /* response_length */ + allocate ? 1 : 0, /* response_length */ eot, /* eot */ 1, /* writes_complete */ 0, /* urb offset */ @@ -260,7 +260,7 @@ void brw_clip_kill_thread(struct brw_clip_compile *c) /* Send an empty message to kill the thread and release any * allocated urb entry: */ - brw_urb_WRITE(p, + brw_urb_WRITE(p, retype(brw_null_reg(), BRW_REGISTER_TYPE_UD), 0, c->reg.R0, @@ -303,22 +303,22 @@ void brw_clip_copy_colors( struct brw_clip_compile *c, struct brw_compile *p = &c->func; if (c->offset_color0) - brw_MOV(p, + brw_MOV(p, byte_offset(c->reg.vertex[to], c->offset_color0), byte_offset(c->reg.vertex[from], c->offset_color0)); if (c->offset_color1) - brw_MOV(p, + brw_MOV(p, byte_offset(c->reg.vertex[to], c->offset_color1), byte_offset(c->reg.vertex[from], c->offset_color1)); if (c->offset_bfc0) - brw_MOV(p, + brw_MOV(p, byte_offset(c->reg.vertex[to], c->offset_bfc0), byte_offset(c->reg.vertex[from], c->offset_bfc0)); if (c->offset_bfc1) - brw_MOV(p, + brw_MOV(p, byte_offset(c->reg.vertex[to], c->offset_bfc1), byte_offset(c->reg.vertex[from], c->offset_bfc1)); } @@ -329,8 +329,8 @@ void brw_clip_init_clipmask( struct brw_clip_compile *c ) { struct brw_compile *p = &c->func; struct brw_reg incoming = get_element_ud(c->reg.R0, 2); - - /* Shift so that lowest outcode bit is rightmost: + + /* Shift so that lowest outcode bit is rightmost: */ brw_SHR(p, c->reg.planemask, incoming, brw_imm_ud(26)); @@ -343,7 +343,7 @@ void brw_clip_init_clipmask( struct brw_clip_compile *c ) brw_AND(p, tmp, incoming, brw_imm_ud(0x3f<<14)); brw_SHR(p, tmp, tmp, brw_imm_ud(8)); brw_OR(p, c->reg.planemask, c->reg.planemask, tmp); - + release_tmp(c, tmp); } } @@ -359,11 +359,11 @@ void brw_clip_ff_sync(struct brw_clip_compile *c) need_ff_sync = brw_IF(p, BRW_EXECUTE_1); { brw_OR(p, c->reg.ff_sync, c->reg.ff_sync, brw_imm_ud(0x1)); - brw_ff_sync(p, + brw_ff_sync(p, c->reg.R0, 0, c->reg.R0, - 1, + 1, 1, /* used */ 1, /* msg length */ 1, /* response length */ @@ -381,7 +381,7 @@ void brw_clip_init_ff_sync(struct brw_clip_compile *c) { if (c->need_ff_sync) { struct brw_compile *p = &c->func; - + brw_MOV(p, c->reg.ff_sync, brw_imm_ud(0)); } } diff --git a/src/gallium/drivers/i965/brw_context.c b/src/gallium/drivers/i965/brw_context.c index a2736f7..9c5ceaf 100644 --- a/src/gallium/drivers/i965/brw_context.c +++ b/src/gallium/drivers/i965/brw_context.c @@ -2,7 +2,7 @@ Copyright (C) Intel Corp. 2006. All Rights Reserved. Intel funded Tungsten Graphics (http://www.tungstengraphics.com) to develop this 3D driver. - + 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, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - + The above copyright notice and this permission notice (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 NONINFRINGEMENT. @@ -22,7 +22,7 @@ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - + **********************************************************************/ /* * Authors: diff --git a/src/gallium/drivers/i965/brw_context.h b/src/gallium/drivers/i965/brw_context.h index d927f38..004b8c7 100644 --- a/src/gallium/drivers/i965/brw_context.h +++ b/src/gallium/drivers/i965/brw_context.h @@ -2,7 +2,7 @@ Copyright (C) Intel Corp. 2006. All Rights Reserved. Intel funded Tungsten Graphics (http://www.tungstengraphics.com) to develop this 3D driver. - + 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, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - + The above copyright notice and this permission notice (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 NONINFRINGEMENT. @@ -22,7 +22,7 @@ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - + **********************************************************************/ /* * Authors: @@ -53,7 +53,7 @@ * * VUE - vertex URB entry. An urb entry holding a vertex and usually * a vertex header. The header contains control information and - * things like primitive type, Begin/end flags and clip codes. + * things like primitive type, Begin/end flags and clip codes. * * PUE - primitive URB entry. An urb entry produced by the setup (SF) * unit holding rasterization and interpolation parameters. @@ -192,7 +192,7 @@ struct brw_fs_signature { }; #define brw_fs_signature_size(s) (offsetof(struct brw_fs_signature, input) + \ - ((s)->nr_inputs * sizeof (s)->input[0])) + ((s)->nr_inputs * sizeof (s)->input[0])) struct brw_fragment_shader { @@ -204,7 +204,7 @@ struct brw_fragment_shader { unsigned iz_lookup; /*unsigned wm_lookup;*/ - + unsigned uses_depth:1; unsigned has_flow_control:1; @@ -374,7 +374,7 @@ struct brw_vs_output_sizes { * to surface binding table indexes, for WM. */ #define BTI_COLOR_BUF(d) (d) -#define BTI_FRAGMENT_CONSTANTS (BRW_MAX_DRAW_BUFFERS) +#define BTI_FRAGMENT_CONSTANTS (BRW_MAX_DRAW_BUFFERS) #define BTI_TEXTURE(t) (BRW_MAX_DRAW_BUFFERS + 1 + (t)) /** @@ -432,7 +432,7 @@ struct brw_cache_item { GLuint data_size; struct brw_cache_item *next; -}; +}; @@ -448,7 +448,7 @@ struct brw_cache { GLuint key_size[BRW_MAX_CACHE]; /* for fixed-size keys */ GLuint aux_size[BRW_MAX_CACHE]; char *name[BRW_MAX_CACHE]; - + /* Record of the last BOs chosen for each cache_id. Used to set * brw->state.dirty.cache when a new cache item is chosen. @@ -489,7 +489,7 @@ struct brw_cached_batch_item { GLuint sz; struct brw_cached_batch_item *next; }; - + /* Protect against a future where VERT_ATTRIB_MAX > 32. Wouldn't life @@ -526,7 +526,7 @@ struct brw_query_object { /** * brw_context is derived from pipe_context */ -struct brw_context +struct brw_context { struct pipe_context base; struct brw_chipset chipset; @@ -538,7 +538,7 @@ struct brw_context GLuint primitive; GLuint reduced_primitive; - /* Active state from the state tracker: + /* Active state from the state tracker: */ struct { struct brw_vertex_shader *vertex_shader; @@ -609,7 +609,7 @@ struct brw_context struct { struct u_upload_mgr *upload_vertex; struct u_upload_mgr *upload_index; - + /* Information on uploaded vertex buffers: */ struct { @@ -657,8 +657,8 @@ struct brw_context GLuint cs_start; } urb; - - /* BRW_NEW_CURBE_OFFSETS: + + /* BRW_NEW_CURBE_OFFSETS: */ struct { GLuint wm_start; /**< pos of first wm const in CURBE buffer */ @@ -693,7 +693,7 @@ struct brw_context /** Binding table of pointers to surf_bo entries */ struct brw_winsys_buffer *bind_bo; struct brw_winsys_buffer *surf_bo[BRW_VS_MAX_SURF]; - GLuint nr_surfaces; + GLuint nr_surfaces; } vs; struct { @@ -734,7 +734,7 @@ struct brw_context struct brw_winsys_buffer *sdc_bo[BRW_MAX_TEX_UNIT]; GLuint render_surf; - GLuint nr_surfaces; + GLuint nr_surfaces; GLuint max_threads; struct brw_winsys_buffer *scratch_bo; diff --git a/src/gallium/drivers/i965/brw_curbe.c b/src/gallium/drivers/i965/brw_curbe.c index a701de3..0d38109 100644 --- a/src/gallium/drivers/i965/brw_curbe.c +++ b/src/gallium/drivers/i965/brw_curbe.c @@ -2,7 +2,7 @@ Copyright (C) Intel Corp. 2006. All Rights Reserved. Intel funded Tungsten Graphics (http://www.tungstengraphics.com) to develop this 3D driver. - + 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, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - + The above copyright notice and this permission notice (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 NONINFRINGEMENT. @@ -22,7 +22,7 @@ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - + **********************************************************************/ /* * Authors: @@ -50,7 +50,7 @@ static int calculate_curbe_offsets( struct brw_context *brw ) { /* CACHE_NEW_WM_PROG */ const GLuint nr_fp_regs = brw->wm.prog_data->curb_read_length; - + /* BRW_NEW_VERTEX_PROGRAM */ const GLuint nr_vp_regs = brw->vs.prog_data->curb_read_length; GLuint nr_clip_regs = 0; @@ -80,7 +80,7 @@ static int calculate_curbe_offsets( struct brw_context *brw ) GLuint reg = 0; - /* Calculate a new layout: + /* Calculate a new layout: */ reg = 0; brw->curbe.wm_start = reg; @@ -185,7 +185,7 @@ static enum pipe_error prepare_curbe_buffer(struct brw_context *brw) nr_immediate = fs->immediates.nr; if (nr_immediate) { - memcpy(&buf[offset], + memcpy(&buf[offset], fs->immediates.data, nr_immediate * 4 * sizeof(float)); @@ -240,7 +240,7 @@ static enum pipe_error prepare_curbe_buffer(struct brw_context *brw) nr_immediate = vs->immediates.nr; if (nr_immediate) { - memcpy(&buf[offset], + memcpy(&buf[offset], vs->immediates.data, nr_immediate * 4 * sizeof(float)); @@ -253,7 +253,7 @@ static enum pipe_error prepare_curbe_buffer(struct brw_context *brw) * buffer objects. If we want to keep on putting them into the * curbe, makes sense to treat constbuf's specially with malloc. */ - + /* XXX: what if user's constant buffer is too small? */ pipe_buffer_read(&brw->base, @@ -265,7 +265,7 @@ static enum pipe_error prepare_curbe_buffer(struct brw_context *brw) } if (BRW_DEBUG & DEBUG_CURBE) { - for (i = 0; i < sz*16; i+=4) + for (i = 0; i < sz*16; i+=4) debug_printf("curbe %d.%d: %f %f %f %f\n", i/8, i&4, buf[i+0], buf[i+1], buf[i+2], buf[i+3]); @@ -281,7 +281,7 @@ static enum pipe_error prepare_curbe_buffer(struct brw_context *brw) memcmp(buf, brw->curbe.last_buf, bufsz) == 0) { /* constants have not changed */ FREE(buf); - } + } else { /* constants have changed */ FREE(brw->curbe.last_buf); @@ -302,7 +302,7 @@ static enum pipe_error prepare_curbe_buffer(struct brw_context *brw) * discard the curbe buffer after the batch is flushed to * avoid synchronous updates. */ - ret = brw->sws->bo_alloc(brw->sws, + ret = brw->sws->bo_alloc(brw->sws, BRW_BUFFER_TYPE_CURBE, 4096, 1 << 6, &brw->curbe.curbe_bo); @@ -374,7 +374,7 @@ const struct brw_tracked_state brw_curbe_buffer = { BRW_NEW_PSP | /* Implicit - hardware requires this, not used above */ BRW_NEW_CURBE_OFFSETS | BRW_NEW_BATCH), - .cache = (CACHE_NEW_WM_PROG) + .cache = (CACHE_NEW_WM_PROG) }, .prepare = prepare_curbe_buffer, .emit = emit_curbe_buffer, diff --git a/src/gallium/drivers/i965/brw_defines.h b/src/gallium/drivers/i965/brw_defines.h index e201ce4..914a729 100644 --- a/src/gallium/drivers/i965/brw_defines.h +++ b/src/gallium/drivers/i965/brw_defines.h @@ -2,7 +2,7 @@ Copyright (C) Intel Corp. 2006. All Rights Reserved. Intel funded Tungsten Graphics (http://www.tungstengraphics.com) to develop this 3D driver. - + 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, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - + The above copyright notice and this permission notice (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 NONINFRINGEMENT. @@ -22,13 +22,13 @@ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - + **********************************************************************/ /* * Authors: * Keith Whitwell */ - + #ifndef BRW_DEFINES_H #define BRW_DEFINES_H @@ -90,13 +90,13 @@ #define _3DPRIM_VERTEXBUFFER_ACCESS_SEQUENTIAL 0 #define _3DPRIM_VERTEXBUFFER_ACCESS_RANDOM 1 -#define BRW_ANISORATIO_2 0 -#define BRW_ANISORATIO_4 1 -#define BRW_ANISORATIO_6 2 -#define BRW_ANISORATIO_8 3 -#define BRW_ANISORATIO_10 4 -#define BRW_ANISORATIO_12 5 -#define BRW_ANISORATIO_14 6 +#define BRW_ANISORATIO_2 0 +#define BRW_ANISORATIO_4 1 +#define BRW_ANISORATIO_6 2 +#define BRW_ANISORATIO_8 3 +#define BRW_ANISORATIO_10 4 +#define BRW_ANISORATIO_12 5 +#define BRW_ANISORATIO_14 6 #define BRW_ANISORATIO_16 7 #define BRW_BLENDFACTOR_ONE 0x1 @@ -198,20 +198,20 @@ #define BRW_LOGICOPFUNCTION_COPY 12 #define BRW_LOGICOPFUNCTION_OR_REVERSE 13 #define BRW_LOGICOPFUNCTION_OR 14 -#define BRW_LOGICOPFUNCTION_SET 15 +#define BRW_LOGICOPFUNCTION_SET 15 -#define BRW_MAPFILTER_NEAREST 0x0 -#define BRW_MAPFILTER_LINEAR 0x1 +#define BRW_MAPFILTER_NEAREST 0x0 +#define BRW_MAPFILTER_LINEAR 0x1 #define BRW_MAPFILTER_ANISOTROPIC 0x2 -#define BRW_MIPFILTER_NONE 0 -#define BRW_MIPFILTER_NEAREST 1 +#define BRW_MIPFILTER_NONE 0 +#define BRW_MIPFILTER_NEAREST 1 #define BRW_MIPFILTER_LINEAR 3 #define BRW_POLYGON_FRONT_FACING 0 #define BRW_POLYGON_BACK_FACING 1 -#define BRW_PREFILTER_ALWAYS 0x0 +#define BRW_PREFILTER_ALWAYS 0x0 #define BRW_PREFILTER_NEVER 0x1 #define BRW_PREFILTER_LESS 0x2 #define BRW_PREFILTER_EQUAL 0x3 @@ -221,10 +221,10 @@ #define BRW_PREFILTER_GEQUAL 0x7 #define BRW_PROVOKING_VERTEX_0 0 -#define BRW_PROVOKING_VERTEX_1 1 +#define BRW_PROVOKING_VERTEX_1 1 #define BRW_PROVOKING_VERTEX_2 2 -#define BRW_RASTRULE_UPPER_LEFT 0 +#define BRW_RASTRULE_UPPER_LEFT 0 #define BRW_RASTRULE_UPPER_RIGHT 1 /* These are listed as "Reserved, but not seen as useful" * in Intel documentation (page 212, "Point Rasterization Rule", @@ -232,7 +232,7 @@ * "Intel® 965 Express Chipset Family and Intel® G35 Express * Chipset Graphics Controller Programmer's Reference Manual, * Volume 2: 3D/Media", Revision 1.0b as of January 2008, - * available at + * available at * http://intellinuxgraphics.org/documentation.html * at the time of this writing). * @@ -261,85 +261,85 @@ #define BRW_SURFACE_MIPMAPLAYOUT_BELOW 0 #define BRW_SURFACE_MIPMAPLAYOUT_RIGHT 1 -#define BRW_SURFACEFORMAT_R32G32B32A32_FLOAT 0x000 -#define BRW_SURFACEFORMAT_R32G32B32A32_SINT 0x001 -#define BRW_SURFACEFORMAT_R32G32B32A32_UINT 0x002 -#define BRW_SURFACEFORMAT_R32G32B32A32_UNORM 0x003 -#define BRW_SURFACEFORMAT_R32G32B32A32_SNORM 0x004 -#define BRW_SURFACEFORMAT_R64G64_FLOAT 0x005 -#define BRW_SURFACEFORMAT_R32G32B32X32_FLOAT 0x006 +#define BRW_SURFACEFORMAT_R32G32B32A32_FLOAT 0x000 +#define BRW_SURFACEFORMAT_R32G32B32A32_SINT 0x001 +#define BRW_SURFACEFORMAT_R32G32B32A32_UINT 0x002 +#define BRW_SURFACEFORMAT_R32G32B32A32_UNORM 0x003 +#define BRW_SURFACEFORMAT_R32G32B32A32_SNORM 0x004 +#define BRW_SURFACEFORMAT_R64G64_FLOAT 0x005 +#define BRW_SURFACEFORMAT_R32G32B32X32_FLOAT 0x006 #define BRW_SURFACEFORMAT_R32G32B32A32_SSCALED 0x007 #define BRW_SURFACEFORMAT_R32G32B32A32_USCALED 0x008 -#define BRW_SURFACEFORMAT_R32G32B32_FLOAT 0x040 -#define BRW_SURFACEFORMAT_R32G32B32_SINT 0x041 -#define BRW_SURFACEFORMAT_R32G32B32_UINT 0x042 -#define BRW_SURFACEFORMAT_R32G32B32_UNORM 0x043 -#define BRW_SURFACEFORMAT_R32G32B32_SNORM 0x044 -#define BRW_SURFACEFORMAT_R32G32B32_SSCALED 0x045 -#define BRW_SURFACEFORMAT_R32G32B32_USCALED 0x046 -#define BRW_SURFACEFORMAT_R16G16B16A16_UNORM 0x080 -#define BRW_SURFACEFORMAT_R16G16B16A16_SNORM 0x081 -#define BRW_SURFACEFORMAT_R16G16B16A16_SINT 0x082 -#define BRW_SURFACEFORMAT_R16G16B16A16_UINT 0x083 -#define BRW_SURFACEFORMAT_R16G16B16A16_FLOAT 0x084 -#define BRW_SURFACEFORMAT_R32G32_FLOAT 0x085 -#define BRW_SURFACEFORMAT_R32G32_SINT 0x086 -#define BRW_SURFACEFORMAT_R32G32_UINT 0x087 -#define BRW_SURFACEFORMAT_R32_FLOAT_X8X24_TYPELESS 0x088 -#define BRW_SURFACEFORMAT_X32_TYPELESS_G8X24_UINT 0x089 -#define BRW_SURFACEFORMAT_L32A32_FLOAT 0x08A -#define BRW_SURFACEFORMAT_R32G32_UNORM 0x08B -#define BRW_SURFACEFORMAT_R32G32_SNORM 0x08C -#define BRW_SURFACEFORMAT_R64_FLOAT 0x08D -#define BRW_SURFACEFORMAT_R16G16B16X16_UNORM 0x08E -#define BRW_SURFACEFORMAT_R16G16B16X16_FLOAT 0x08F -#define BRW_SURFACEFORMAT_A32X32_FLOAT 0x090 -#define BRW_SURFACEFORMAT_L32X32_FLOAT 0x091 -#define BRW_SURFACEFORMAT_I32X32_FLOAT 0x092 +#define BRW_SURFACEFORMAT_R32G32B32_FLOAT 0x040 +#define BRW_SURFACEFORMAT_R32G32B32_SINT 0x041 +#define BRW_SURFACEFORMAT_R32G32B32_UINT 0x042 +#define BRW_SURFACEFORMAT_R32G32B32_UNORM 0x043 +#define BRW_SURFACEFORMAT_R32G32B32_SNORM 0x044 +#define BRW_SURFACEFORMAT_R32G32B32_SSCALED 0x045 +#define BRW_SURFACEFORMAT_R32G32B32_USCALED 0x046 +#define BRW_SURFACEFORMAT_R16G16B16A16_UNORM 0x080 +#define BRW_SURFACEFORMAT_R16G16B16A16_SNORM 0x081 +#define BRW_SURFACEFORMAT_R16G16B16A16_SINT 0x082 +#define BRW_SURFACEFORMAT_R16G16B16A16_UINT 0x083 +#define BRW_SURFACEFORMAT_R16G16B16A16_FLOAT 0x084 +#define BRW_SURFACEFORMAT_R32G32_FLOAT 0x085 +#define BRW_SURFACEFORMAT_R32G32_SINT 0x086 +#define BRW_SURFACEFORMAT_R32G32_UINT 0x087 +#define BRW_SURFACEFORMAT_R32_FLOAT_X8X24_TYPELESS 0x088 +#define BRW_SURFACEFORMAT_X32_TYPELESS_G8X24_UINT 0x089 +#define BRW_SURFACEFORMAT_L32A32_FLOAT 0x08A +#define BRW_SURFACEFORMAT_R32G32_UNORM 0x08B +#define BRW_SURFACEFORMAT_R32G32_SNORM 0x08C +#define BRW_SURFACEFORMAT_R64_FLOAT 0x08D +#define BRW_SURFACEFORMAT_R16G16B16X16_UNORM 0x08E +#define BRW_SURFACEFORMAT_R16G16B16X16_FLOAT 0x08F +#define BRW_SURFACEFORMAT_A32X32_FLOAT 0x090 +#define BRW_SURFACEFORMAT_L32X32_FLOAT 0x091 +#define BRW_SURFACEFORMAT_I32X32_FLOAT 0x092 #define BRW_SURFACEFORMAT_R16G16B16A16_SSCALED 0x093 #define BRW_SURFACEFORMAT_R16G16B16A16_USCALED 0x094 #define BRW_SURFACEFORMAT_R32G32_SSCALED 0x095 #define BRW_SURFACEFORMAT_R32G32_USCALED 0x096 -#define BRW_SURFACEFORMAT_B8G8R8A8_UNORM 0x0C0 -#define BRW_SURFACEFORMAT_B8G8R8A8_UNORM_SRGB 0x0C1 -#define BRW_SURFACEFORMAT_R10G10B10A2_UNORM 0x0C2 -#define BRW_SURFACEFORMAT_R10G10B10A2_UNORM_SRGB 0x0C3 -#define BRW_SURFACEFORMAT_R10G10B10A2_UINT 0x0C4 -#define BRW_SURFACEFORMAT_R10G10B10_SNORM_A2_UNORM 0x0C5 -#define BRW_SURFACEFORMAT_R8G8B8A8_UNORM 0x0C7 -#define BRW_SURFACEFORMAT_R8G8B8A8_UNORM_SRGB 0x0C8 -#define BRW_SURFACEFORMAT_R8G8B8A8_SNORM 0x0C9 -#define BRW_SURFACEFORMAT_R8G8B8A8_SINT 0x0CA -#define BRW_SURFACEFORMAT_R8G8B8A8_UINT 0x0CB -#define BRW_SURFACEFORMAT_R16G16_UNORM 0x0CC -#define BRW_SURFACEFORMAT_R16G16_SNORM 0x0CD -#define BRW_SURFACEFORMAT_R16G16_SINT 0x0CE -#define BRW_SURFACEFORMAT_R16G16_UINT 0x0CF -#define BRW_SURFACEFORMAT_R16G16_FLOAT 0x0D0 -#define BRW_SURFACEFORMAT_B10G10R10A2_UNORM 0x0D1 -#define BRW_SURFACEFORMAT_B10G10R10A2_UNORM_SRGB 0x0D2 -#define BRW_SURFACEFORMAT_R11G11B10_FLOAT 0x0D3 -#define BRW_SURFACEFORMAT_R32_SINT 0x0D6 -#define BRW_SURFACEFORMAT_R32_UINT 0x0D7 -#define BRW_SURFACEFORMAT_R32_FLOAT 0x0D8 -#define BRW_SURFACEFORMAT_R24_UNORM_X8_TYPELESS 0x0D9 -#define BRW_SURFACEFORMAT_X24_TYPELESS_G8_UINT 0x0DA -#define BRW_SURFACEFORMAT_L16A16_UNORM 0x0DF -#define BRW_SURFACEFORMAT_I24X8_UNORM 0x0E0 -#define BRW_SURFACEFORMAT_L24X8_UNORM 0x0E1 -#define BRW_SURFACEFORMAT_A24X8_UNORM 0x0E2 -#define BRW_SURFACEFORMAT_I32_FLOAT 0x0E3 -#define BRW_SURFACEFORMAT_L32_FLOAT 0x0E4 -#define BRW_SURFACEFORMAT_A32_FLOAT 0x0E5 -#define BRW_SURFACEFORMAT_B8G8R8X8_UNORM 0x0E9 -#define BRW_SURFACEFORMAT_B8G8R8X8_UNORM_SRGB 0x0EA -#define BRW_SURFACEFORMAT_R8G8B8X8_UNORM 0x0EB -#define BRW_SURFACEFORMAT_R8G8B8X8_UNORM_SRGB 0x0EC -#define BRW_SURFACEFORMAT_R9G9B9E5_SHAREDEXP 0x0ED -#define BRW_SURFACEFORMAT_B10G10R10X2_UNORM 0x0EE -#define BRW_SURFACEFORMAT_L16A16_FLOAT 0x0F0 -#define BRW_SURFACEFORMAT_R32_UNORM 0x0F1 -#define BRW_SURFACEFORMAT_R32_SNORM 0x0F2 +#define BRW_SURFACEFORMAT_B8G8R8A8_UNORM 0x0C0 +#define BRW_SURFACEFORMAT_B8G8R8A8_UNORM_SRGB 0x0C1 +#define BRW_SURFACEFORMAT_R10G10B10A2_UNORM 0x0C2 +#define BRW_SURFACEFORMAT_R10G10B10A2_UNORM_SRGB 0x0C3 +#define BRW_SURFACEFORMAT_R10G10B10A2_UINT 0x0C4 +#define BRW_SURFACEFORMAT_R10G10B10_SNORM_A2_UNORM 0x0C5 +#define BRW_SURFACEFORMAT_R8G8B8A8_UNORM 0x0C7 +#define BRW_SURFACEFORMAT_R8G8B8A8_UNORM_SRGB 0x0C8 +#define BRW_SURFACEFORMAT_R8G8B8A8_SNORM 0x0C9 +#define BRW_SURFACEFORMAT_R8G8B8A8_SINT 0x0CA +#define BRW_SURFACEFORMAT_R8G8B8A8_UINT 0x0CB +#define BRW_SURFACEFORMAT_R16G16_UNORM 0x0CC +#define BRW_SURFACEFORMAT_R16G16_SNORM 0x0CD +#define BRW_SURFACEFORMAT_R16G16_SINT 0x0CE +#define BRW_SURFACEFORMAT_R16G16_UINT 0x0CF +#define BRW_SURFACEFORMAT_R16G16_FLOAT 0x0D0 +#define BRW_SURFACEFORMAT_B10G10R10A2_UNORM 0x0D1 +#define BRW_SURFACEFORMAT_B10G10R10A2_UNORM_SRGB 0x0D2 +#define BRW_SURFACEFORMAT_R11G11B10_FLOAT 0x0D3 +#define BRW_SURFACEFORMAT_R32_SINT 0x0D6 +#define BRW_SURFACEFORMAT_R32_UINT 0x0D7 +#define BRW_SURFACEFORMAT_R32_FLOAT 0x0D8 +#define BRW_SURFACEFORMAT_R24_UNORM_X8_TYPELESS 0x0D9 +#define BRW_SURFACEFORMAT_X24_TYPELESS_G8_UINT 0x0DA +#define BRW_SURFACEFORMAT_L16A16_UNORM 0x0DF +#define BRW_SURFACEFORMAT_I24X8_UNORM 0x0E0 +#define BRW_SURFACEFORMAT_L24X8_UNORM 0x0E1 +#define BRW_SURFACEFORMAT_A24X8_UNORM 0x0E2 +#define BRW_SURFACEFORMAT_I32_FLOAT 0x0E3 +#define BRW_SURFACEFORMAT_L32_FLOAT 0x0E4 +#define BRW_SURFACEFORMAT_A32_FLOAT 0x0E5 +#define BRW_SURFACEFORMAT_B8G8R8X8_UNORM 0x0E9 +#define BRW_SURFACEFORMAT_B8G8R8X8_UNORM_SRGB 0x0EA +#define BRW_SURFACEFORMAT_R8G8B8X8_UNORM 0x0EB +#define BRW_SURFACEFORMAT_R8G8B8X8_UNORM_SRGB 0x0EC +#define BRW_SURFACEFORMAT_R9G9B9E5_SHAREDEXP 0x0ED +#define BRW_SURFACEFORMAT_B10G10R10X2_UNORM 0x0EE +#define BRW_SURFACEFORMAT_L16A16_FLOAT 0x0F0 +#define BRW_SURFACEFORMAT_R32_UNORM 0x0F1 +#define BRW_SURFACEFORMAT_R32_SNORM 0x0F2 #define BRW_SURFACEFORMAT_R10G10B10X2_USCALED 0x0F3 #define BRW_SURFACEFORMAT_R8G8B8A8_SSCALED 0x0F4 #define BRW_SURFACEFORMAT_R8G8B8A8_USCALED 0x0F5 @@ -347,25 +347,25 @@ #define BRW_SURFACEFORMAT_R16G16_USCALED 0x0F7 #define BRW_SURFACEFORMAT_R32_SSCALED 0x0F8 #define BRW_SURFACEFORMAT_R32_USCALED 0x0F9 -#define BRW_SURFACEFORMAT_B5G6R5_UNORM 0x100 -#define BRW_SURFACEFORMAT_B5G6R5_UNORM_SRGB 0x101 -#define BRW_SURFACEFORMAT_B5G5R5A1_UNORM 0x102 -#define BRW_SURFACEFORMAT_B5G5R5A1_UNORM_SRGB 0x103 -#define BRW_SURFACEFORMAT_B4G4R4A4_UNORM 0x104 -#define BRW_SURFACEFORMAT_B4G4R4A4_UNORM_SRGB 0x105 -#define BRW_SURFACEFORMAT_R8G8_UNORM 0x106 -#define BRW_SURFACEFORMAT_R8G8_SNORM 0x107 -#define BRW_SURFACEFORMAT_R8G8_SINT 0x108 -#define BRW_SURFACEFORMAT_R8G8_UINT 0x109 -#define BRW_SURFACEFORMAT_R16_UNORM 0x10A -#define BRW_SURFACEFORMAT_R16_SNORM 0x10B -#define BRW_SURFACEFORMAT_R16_SINT 0x10C -#define BRW_SURFACEFORMAT_R16_UINT 0x10D -#define BRW_SURFACEFORMAT_R16_FLOAT 0x10E -#define BRW_SURFACEFORMAT_I16_UNORM 0x111 -#define BRW_SURFACEFORMAT_L16_UNORM 0x112 -#define BRW_SURFACEFORMAT_A16_UNORM 0x113 -#define BRW_SURFACEFORMAT_L8A8_UNORM 0x114 +#define BRW_SURFACEFORMAT_B5G6R5_UNORM 0x100 +#define BRW_SURFACEFORMAT_B5G6R5_UNORM_SRGB 0x101 +#define BRW_SURFACEFORMAT_B5G5R5A1_UNORM 0x102 +#define BRW_SURFACEFORMAT_B5G5R5A1_UNORM_SRGB 0x103 +#define BRW_SURFACEFORMAT_B4G4R4A4_UNORM 0x104 +#define BRW_SURFACEFORMAT_B4G4R4A4_UNORM_SRGB 0x105 +#define BRW_SURFACEFORMAT_R8G8_UNORM 0x106 +#define BRW_SURFACEFORMAT_R8G8_SNORM 0x107 +#define BRW_SURFACEFORMAT_R8G8_SINT 0x108 +#define BRW_SURFACEFORMAT_R8G8_UINT 0x109 +#define BRW_SURFACEFORMAT_R16_UNORM 0x10A +#define BRW_SURFACEFORMAT_R16_SNORM 0x10B +#define BRW_SURFACEFORMAT_R16_SINT 0x10C +#define BRW_SURFACEFORMAT_R16_UINT 0x10D +#define BRW_SURFACEFORMAT_R16_FLOAT 0x10E +#define BRW_SURFACEFORMAT_I16_UNORM 0x111 +#define BRW_SURFACEFORMAT_L16_UNORM 0x112 +#define BRW_SURFACEFORMAT_A16_UNORM 0x113 +#define BRW_SURFACEFORMAT_L8A8_UNORM 0x114 #define BRW_SURFACEFORMAT_I16_FLOAT 0x115 #define BRW_SURFACEFORMAT_L16_FLOAT 0x116 #define BRW_SURFACEFORMAT_A16_FLOAT 0x117 @@ -377,45 +377,45 @@ #define BRW_SURFACEFORMAT_R8G8_USCALED 0x11D #define BRW_SURFACEFORMAT_R16_SSCALED 0x11E #define BRW_SURFACEFORMAT_R16_USCALED 0x11F -#define BRW_SURFACEFORMAT_R8_UNORM 0x140 -#define BRW_SURFACEFORMAT_R8_SNORM 0x141 -#define BRW_SURFACEFORMAT_R8_SINT 0x142 -#define BRW_SURFACEFORMAT_R8_UINT 0x143 -#define BRW_SURFACEFORMAT_A8_UNORM 0x144 -#define BRW_SURFACEFORMAT_I8_UNORM 0x145 -#define BRW_SURFACEFORMAT_L8_UNORM 0x146 -#define BRW_SURFACEFORMAT_P4A4_UNORM 0x147 +#define BRW_SURFACEFORMAT_R8_UNORM 0x140 +#define BRW_SURFACEFORMAT_R8_SNORM 0x141 +#define BRW_SURFACEFORMAT_R8_SINT 0x142 +#define BRW_SURFACEFORMAT_R8_UINT 0x143 +#define BRW_SURFACEFORMAT_A8_UNORM 0x144 +#define BRW_SURFACEFORMAT_I8_UNORM 0x145 +#define BRW_SURFACEFORMAT_L8_UNORM 0x146 +#define BRW_SURFACEFORMAT_P4A4_UNORM 0x147 #define BRW_SURFACEFORMAT_A4P4_UNORM 0x148 #define BRW_SURFACEFORMAT_R8_SSCALED 0x149 #define BRW_SURFACEFORMAT_R8_USCALED 0x14A #define BRW_SURFACEFORMAT_L8_UNORM_SRGB 0x14C -#define BRW_SURFACEFORMAT_R1_UINT 0x181 -#define BRW_SURFACEFORMAT_YCRCB_NORMAL 0x182 -#define BRW_SURFACEFORMAT_YCRCB_SWAPUVY 0x183 -#define BRW_SURFACEFORMAT_BC1_UNORM 0x186 -#define BRW_SURFACEFORMAT_BC2_UNORM 0x187 -#define BRW_SURFACEFORMAT_BC3_UNORM 0x188 -#define BRW_SURFACEFORMAT_BC4_UNORM 0x189 -#define BRW_SURFACEFORMAT_BC5_UNORM 0x18A -#define BRW_SURFACEFORMAT_BC1_UNORM_SRGB 0x18B -#define BRW_SURFACEFORMAT_BC2_UNORM_SRGB 0x18C -#define BRW_SURFACEFORMAT_BC3_UNORM_SRGB 0x18D -#define BRW_SURFACEFORMAT_MONO8 0x18E -#define BRW_SURFACEFORMAT_YCRCB_SWAPUV 0x18F -#define BRW_SURFACEFORMAT_YCRCB_SWAPY 0x190 -#define BRW_SURFACEFORMAT_DXT1_RGB 0x191 -#define BRW_SURFACEFORMAT_FXT1 0x192 -#define BRW_SURFACEFORMAT_R8G8B8_UNORM 0x193 -#define BRW_SURFACEFORMAT_R8G8B8_SNORM 0x194 -#define BRW_SURFACEFORMAT_R8G8B8_SSCALED 0x195 -#define BRW_SURFACEFORMAT_R8G8B8_USCALED 0x196 -#define BRW_SURFACEFORMAT_R64G64B64A64_FLOAT 0x197 -#define BRW_SURFACEFORMAT_R64G64B64_FLOAT 0x198 -#define BRW_SURFACEFORMAT_BC4_SNORM 0x199 -#define BRW_SURFACEFORMAT_BC5_SNORM 0x19A -#define BRW_SURFACEFORMAT_R16G16B16_UNORM 0x19C -#define BRW_SURFACEFORMAT_R16G16B16_SNORM 0x19D -#define BRW_SURFACEFORMAT_R16G16B16_SSCALED 0x19E +#define BRW_SURFACEFORMAT_R1_UINT 0x181 +#define BRW_SURFACEFORMAT_YCRCB_NORMAL 0x182 +#define BRW_SURFACEFORMAT_YCRCB_SWAPUVY 0x183 +#define BRW_SURFACEFORMAT_BC1_UNORM 0x186 +#define BRW_SURFACEFORMAT_BC2_UNORM 0x187 +#define BRW_SURFACEFORMAT_BC3_UNORM 0x188 +#define BRW_SURFACEFORMAT_BC4_UNORM 0x189 +#define BRW_SURFACEFORMAT_BC5_UNORM 0x18A +#define BRW_SURFACEFORMAT_BC1_UNORM_SRGB 0x18B +#define BRW_SURFACEFORMAT_BC2_UNORM_SRGB 0x18C +#define BRW_SURFACEFORMAT_BC3_UNORM_SRGB 0x18D +#define BRW_SURFACEFORMAT_MONO8 0x18E +#define BRW_SURFACEFORMAT_YCRCB_SWAPUV 0x18F +#define BRW_SURFACEFORMAT_YCRCB_SWAPY 0x190 +#define BRW_SURFACEFORMAT_DXT1_RGB 0x191 +#define BRW_SURFACEFORMAT_FXT1 0x192 +#define BRW_SURFACEFORMAT_R8G8B8_UNORM 0x193 +#define BRW_SURFACEFORMAT_R8G8B8_SNORM 0x194 +#define BRW_SURFACEFORMAT_R8G8B8_SSCALED 0x195 +#define BRW_SURFACEFORMAT_R8G8B8_USCALED 0x196 +#define BRW_SURFACEFORMAT_R64G64B64A64_FLOAT 0x197 +#define BRW_SURFACEFORMAT_R64G64B64_FLOAT 0x198 +#define BRW_SURFACEFORMAT_BC4_SNORM 0x199 +#define BRW_SURFACEFORMAT_BC5_SNORM 0x19A +#define BRW_SURFACEFORMAT_R16G16B16_UNORM 0x19C +#define BRW_SURFACEFORMAT_R16G16B16_SNORM 0x19D +#define BRW_SURFACEFORMAT_R16G16B16_SSCALED 0x19E #define BRW_SURFACEFORMAT_R16G16B16_USCALED 0x19F #define BRW_SURFACEFORMAT_INVALID 0xFFF @@ -589,7 +589,7 @@ #define BRW_ARF_NULL 0x00 #define BRW_ARF_ADDRESS 0x10 -#define BRW_ARF_ACCUMULATOR 0x20 +#define BRW_ARF_ACCUMULATOR 0x20 #define BRW_ARF_FLAG 0x30 #define BRW_ARF_MASK 0x40 #define BRW_ARF_MASK_STACK 0x50 diff --git a/src/gallium/drivers/i965/brw_disasm.c b/src/gallium/drivers/i965/brw_disasm.c index 28c8351..ed05c1d 100644 --- a/src/gallium/drivers/i965/brw_disasm.c +++ b/src/gallium/drivers/i965/brw_disasm.c @@ -904,7 +904,7 @@ int brw_disasm_insn (FILE *file, const struct brw_instruction *inst) } -int brw_disasm (FILE *file, +int brw_disasm (FILE *file, const struct brw_instruction *inst, unsigned count) { diff --git a/src/gallium/drivers/i965/brw_disasm.h b/src/gallium/drivers/i965/brw_disasm.h index ba5b109..21aa19b 100644 --- a/src/gallium/drivers/i965/brw_disasm.h +++ b/src/gallium/drivers/i965/brw_disasm.h @@ -28,7 +28,7 @@ struct brw_instruction; int brw_disasm_insn (FILE *file, const struct brw_instruction *inst); -int brw_disasm (FILE *file, +int brw_disasm (FILE *file, const struct brw_instruction *inst, unsigned count); diff --git a/src/gallium/drivers/i965/brw_draw.c b/src/gallium/drivers/i965/brw_draw.c index 3ab9024..31312d0 100644 --- a/src/gallium/drivers/i965/brw_draw.c +++ b/src/gallium/drivers/i965/brw_draw.c @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2003 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ @@ -64,7 +64,7 @@ static int brw_set_prim(struct brw_context *brw, unsigned prim ) if (BRW_DEBUG & DEBUG_PRIMS) debug_printf("PRIM: %s\n", u_prim_name(prim)); - + if (prim != brw->primitive) { unsigned reduced_prim; @@ -94,7 +94,7 @@ static int brw_emit_prim(struct brw_context *brw, if (BRW_DEBUG & DEBUG_PRIMS) debug_printf("%s start %d count %d indexed %d hw_prim %d\n", - __FUNCTION__, start, count, indexed, hw_prim); + __FUNCTION__, start, count, indexed, hw_prim); prim_packet.header.opcode = CMD_3D_PRIM; prim_packet.header.length = sizeof(prim_packet)/4 - 2; @@ -143,7 +143,7 @@ static int brw_emit_prim(struct brw_context *brw, static int try_draw_range_elements(struct brw_context *brw, boolean indexed, - unsigned hw_prim, + unsigned hw_prim, unsigned start, unsigned count) { int ret; @@ -164,7 +164,7 @@ try_draw_range_elements(struct brw_context *brw, ret = brw_upload_state(brw); if (ret) return ret; - + ret = brw_emit_prim(brw, start, count, indexed, hw_prim); if (ret) return ret; @@ -196,8 +196,8 @@ brw_draw_vbo(struct pipe_context *pipe, const struct pipe_draw_info *info) * XXX: do we really care? */ if (brw->curr.min_index != info->min_index || - brw->curr.max_index != info->max_index) - { + brw->curr.max_index != info->max_index) + { brw->curr.min_index = info->min_index; brw->curr.max_index = info->max_index; brw->state.dirty.mesa |= PIPE_NEW_INDEX_RANGE; @@ -222,7 +222,7 @@ brw_draw_vbo(struct pipe_context *pipe, const struct pipe_draw_info *info) boolean brw_draw_init( struct brw_context *brw ) { - /* Register our drawing function: + /* Register our drawing function: */ brw->base.draw_vbo = brw_draw_vbo; diff --git a/src/gallium/drivers/i965/brw_draw.h b/src/gallium/drivers/i965/brw_draw.h index 8dc5dbc..ef49c7e 100644 --- a/src/gallium/drivers/i965/brw_draw.h +++ b/src/gallium/drivers/i965/brw_draw.h @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2005 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ #ifndef BRW_DRAW_H diff --git a/src/gallium/drivers/i965/brw_draw_upload.c b/src/gallium/drivers/i965/brw_draw_upload.c index ebeb1e1..2978ca1 100644 --- a/src/gallium/drivers/i965/brw_draw_upload.c +++ b/src/gallium/drivers/i965/brw_draw_upload.c @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2003 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ #include "pipe/p_context.h" @@ -70,7 +70,7 @@ static int brw_prepare_vertices(struct brw_context *brw) struct brw_winsys_buffer *bo; struct pipe_resource *upload_buf = NULL; unsigned offset; - + if (BRW_DEBUG & DEBUG_VERTS) debug_printf("%s vb[%d] user:%d offset:0x%x sz:0x%x stride:0x%x\n", __FUNCTION__, i, @@ -85,12 +85,12 @@ static int brw_prepare_vertices(struct brw_context *brw) * zero-stride buffers & have them use additional constants (or * add support for >1 constant buffer) instead. */ - unsigned size = (vb->stride == 0 ? + unsigned size = (vb->stride == 0 ? vb->buffer->width0 - vb->buffer_offset : MAX2(vb->buffer->width0 - vb->buffer_offset, vb->stride * (max_index + 1 - min_index))); - ret = u_upload_buffer( brw->vb.upload_vertex, + ret = u_upload_buffer( brw->vb.upload_vertex, vb->buffer_offset + min_index * vb->stride, size, vb->buffer, @@ -100,7 +100,7 @@ static int brw_prepare_vertices(struct brw_context *brw) return ret; bo = brw_buffer(upload_buf)->bo; - + assert(offset + size <= bo->size); } else @@ -110,7 +110,7 @@ static int brw_prepare_vertices(struct brw_context *brw) } assert(offset < bo->size); - + /* Set up post-upload info about this vertex buffer: */ brw->vb.vb[i].offset = offset; @@ -280,7 +280,7 @@ static int brw_prepare_indices(struct brw_context *brw) * In gallium this will happen in the case where successive draw * calls are made with (distinct?) userbuffers, but the upload_mgr * places the data into a single winsys buffer. - * + * * This statechange doesn't raise any state flags and is always * just merged into the final draw packet: */ diff --git a/src/gallium/drivers/i965/brw_eu.c b/src/gallium/drivers/i965/brw_eu.c index a8fcb5f..f540c36 100644 --- a/src/gallium/drivers/i965/brw_eu.c +++ b/src/gallium/drivers/i965/brw_eu.c @@ -2,7 +2,7 @@ Copyright (C) Intel Corp. 2006. All Rights Reserved. Intel funded Tungsten Graphics (http://www.tungstengraphics.com) to develop this 3D driver. - + 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, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - + The above copyright notice and this permission notice (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 NONINFRINGEMENT. @@ -22,13 +22,13 @@ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - + **********************************************************************/ /* * Authors: * Keith Whitwell */ - + #include "util/u_memory.h" #include "brw_context.h" @@ -53,7 +53,7 @@ void brw_set_predicate_control_flag_value( struct brw_compile *p, GLuint value ) } p->current->header.predicate_control = BRW_PREDICATE_NORMAL; - } + } } void brw_set_predicate_control( struct brw_compile *p, GLuint pc ) @@ -90,7 +90,7 @@ void brw_push_insn_state( struct brw_compile *p ) { assert(p->current != &p->stack[BRW_EU_MAX_INSN_STACK-1]); memcpy(p->current+1, p->current, sizeof(struct brw_instruction)); - p->current++; + p->current++; } void brw_pop_insn_state( struct brw_compile *p ) @@ -114,7 +114,7 @@ void brw_init_compile( struct brw_context *brw, struct brw_compile *p ) brw_set_mask_control(p, BRW_MASK_ENABLE); /* what does this do? */ brw_set_saturate(p, 0); brw_set_compression_control(p, BRW_COMPRESSION_NONE); - brw_set_predicate_control_flag_value(p, 0xff); + brw_set_predicate_control_flag_value(p, 0xff); } diff --git a/src/gallium/drivers/i965/brw_eu.h b/src/gallium/drivers/i965/brw_eu.h index af509b2..261857f 100644 --- a/src/gallium/drivers/i965/brw_eu.h +++ b/src/gallium/drivers/i965/brw_eu.h @@ -2,7 +2,7 @@ Copyright (C) Intel Corp. 2006. All Rights Reserved. Intel funded Tungsten Graphics (http://www.tungstengraphics.com) to develop this 3D driver. - + 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, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - + The above copyright notice and this permission notice (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 NONINFRINGEMENT. @@ -22,13 +22,13 @@ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - + **********************************************************************/ /* * Authors: * Keith Whitwell */ - + #ifndef BRW_EU_H #define BRW_EU_H @@ -88,7 +88,7 @@ struct brw_reg GLuint address_mode:1; /* relative addressing, hopefully! */ GLuint pad0:1; - union { + union { struct { GLuint swizzle:8; /* src only, align16 only */ GLuint writemask:4; /* dest only, align16 only */ @@ -99,7 +99,7 @@ struct brw_reg GLfloat f; GLint d; GLuint ud; - } dw1; + } dw1; }; @@ -313,7 +313,7 @@ static INLINE struct brw_reg retype( struct brw_reg reg, static INLINE struct brw_reg suboffset( struct brw_reg reg, GLuint delta ) -{ +{ reg.subnr += delta * type_sz(reg.type); return reg; } @@ -335,7 +335,7 @@ static INLINE struct brw_reg byte_offset( struct brw_reg reg, reg.subnr = newoffset % REG_SIZE; return reg; } - + /** Construct unsigned word[16] register */ static INLINE struct brw_reg brw_uw16_reg( GLuint file, @@ -371,7 +371,7 @@ static INLINE struct brw_reg brw_imm_reg( GLuint type ) BRW_WIDTH_1, BRW_HORIZONTAL_STRIDE_0, 0, - 0); + 0); } /** Construct float immediate register */ @@ -444,8 +444,8 @@ static INLINE struct brw_reg brw_imm_vf( GLuint v ) #define VF_ONE 0x30 #define VF_NEG (1<<7) -static INLINE struct brw_reg brw_imm_vf4( GLuint v0, - GLuint v1, +static INLINE struct brw_reg brw_imm_vf4( GLuint v0, + GLuint v1, GLuint v2, GLuint v3) { @@ -505,15 +505,15 @@ static INLINE struct brw_reg brw_uw16_grf( GLuint nr, GLuint subnr ) /** Construct null register (usually used for setting condition codes) */ static INLINE struct brw_reg brw_null_reg( void ) { - return brw_vec8_reg(BRW_ARCHITECTURE_REGISTER_FILE, - BRW_ARF_NULL, + return brw_vec8_reg(BRW_ARCHITECTURE_REGISTER_FILE, + BRW_ARF_NULL, 0); } static INLINE struct brw_reg brw_address_reg( GLuint subnr ) { - return brw_uw1_reg(BRW_ARCHITECTURE_REGISTER_FILE, - BRW_ARF_ADDRESS, + return brw_uw1_reg(BRW_ARCHITECTURE_REGISTER_FILE, + BRW_ARF_ADDRESS, subnr); } @@ -523,8 +523,8 @@ static INLINE struct brw_reg brw_address_reg( GLuint subnr ) */ static INLINE struct brw_reg brw_ip_reg( void ) { - return brw_reg(BRW_ARCHITECTURE_REGISTER_FILE, - BRW_ARF_IP, + return brw_reg(BRW_ARCHITECTURE_REGISTER_FILE, + BRW_ARF_IP, 0, BRW_REGISTER_TYPE_UD, BRW_VERTICAL_STRIDE_4, /* ? */ @@ -536,8 +536,8 @@ static INLINE struct brw_reg brw_ip_reg( void ) static INLINE struct brw_reg brw_acc_reg( void ) { - return brw_vec8_reg(BRW_ARCHITECTURE_REGISTER_FILE, - BRW_ARF_ACCUMULATOR, + return brw_vec8_reg(BRW_ARCHITECTURE_REGISTER_FILE, + BRW_ARF_ACCUMULATOR, 0); } @@ -636,7 +636,7 @@ static INLINE struct brw_reg get_element_ud( struct brw_reg reg, GLuint elt ) static INLINE struct brw_reg brw_swizzle( struct brw_reg reg, GLuint x, - GLuint y, + GLuint y, GLuint z, GLuint w) { @@ -776,7 +776,7 @@ void brw_set_conditionalmod( struct brw_compile *p, GLuint conditional ); void brw_init_compile( struct brw_context *, struct brw_compile *p ); -enum pipe_error brw_get_program( struct brw_compile *p, +enum pipe_error brw_get_program( struct brw_compile *p, const GLuint **program, GLuint *sz ); @@ -918,13 +918,13 @@ void brw_dp_WRITE_16( struct brw_compile *p, /* If/else/endif. Works by manipulating the execution flags on each * channel. */ -struct brw_instruction *brw_IF(struct brw_compile *p, +struct brw_instruction *brw_IF(struct brw_compile *p, GLuint execute_size); -struct brw_instruction *brw_ELSE(struct brw_compile *p, +struct brw_instruction *brw_ELSE(struct brw_compile *p, struct brw_instruction *if_insn); -void brw_ENDIF(struct brw_compile *p, +void brw_ENDIF(struct brw_compile *p, struct brw_instruction *if_or_else_insn); @@ -933,14 +933,14 @@ void brw_ENDIF(struct brw_compile *p, struct brw_instruction *brw_DO(struct brw_compile *p, GLuint execute_size); -struct brw_instruction *brw_WHILE(struct brw_compile *p, +struct brw_instruction *brw_WHILE(struct brw_compile *p, struct brw_instruction *patch_insn); struct brw_instruction *brw_BREAK(struct brw_compile *p); struct brw_instruction *brw_CONT(struct brw_compile *p); /* Forward jumps: */ -void brw_land_fwd_jump(struct brw_compile *p, +void brw_land_fwd_jump(struct brw_compile *p, struct brw_instruction *jmp_insn); @@ -959,7 +959,7 @@ void brw_CMP(struct brw_compile *p, void brw_print_reg( struct brw_reg reg ); -/*********************************************************************** +/*********************************************************************** * brw_eu_util.c: */ @@ -983,7 +983,7 @@ void brw_copy8(struct brw_compile *p, struct brw_reg src, GLuint count); -void brw_math_invert( struct brw_compile *p, +void brw_math_invert( struct brw_compile *p, struct brw_reg dst, struct brw_reg src); diff --git a/src/gallium/drivers/i965/brw_eu_debug.c b/src/gallium/drivers/i965/brw_eu_debug.c index 5989f5a..cd87061 100644 --- a/src/gallium/drivers/i965/brw_eu_debug.c +++ b/src/gallium/drivers/i965/brw_eu_debug.c @@ -2,7 +2,7 @@ Copyright (C) Intel Corp. 2006. All Rights Reserved. Intel funded Tungsten Graphics (http://www.tungstengraphics.com) to develop this 3D driver. - + 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, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - + The above copyright notice and this permission notice (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 NONINFRINGEMENT. @@ -22,13 +22,13 @@ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - + **********************************************************************/ /* * Authors: * Keith Whitwell */ - + #include "util/u_debug.h" #include "brw_eu.h" @@ -53,10 +53,10 @@ void brw_print_reg( struct brw_reg hwreg ) "f" }; - debug_printf("%s%s", + debug_printf("%s%s", hwreg.abs ? "abs/" : "", hwreg.negate ? "-" : ""); - + if (hwreg.file == BRW_GENERAL_REGISTER_FILE && hwreg.nr % 2 == 0 && hwreg.subnr == 0 && @@ -71,7 +71,7 @@ void brw_print_reg( struct brw_reg hwreg ) hwreg.vstride == BRW_VERTICAL_STRIDE_0 && hwreg.width == BRW_WIDTH_1 && hwreg.hstride == BRW_HORIZONTAL_STRIDE_0 && - hwreg.type == BRW_REGISTER_TYPE_F) { + hwreg.type == BRW_REGISTER_TYPE_F) { /* "scalar" register */ debug_printf("scl%d.%d", hwreg.nr, hwreg.subnr / 4); } @@ -79,13 +79,13 @@ void brw_print_reg( struct brw_reg hwreg ) debug_printf("imm %f", hwreg.dw1.f); } else { - debug_printf("%s%d.%d<%d;%d,%d>:%s", + debug_printf("%s%d.%d<%d;%d,%d>:%s", file[hwreg.file], hwreg.nr, hwreg.subnr / type_sz(hwreg.type), hwreg.vstride ? (1<<(hwreg.vstride-1)) : 0, 1< */ - + #include "brw_context.h" #include "brw_defines.h" @@ -46,8 +46,8 @@ static void guess_execution_size( struct brw_instruction *insn, struct brw_reg reg ) { - if (reg.width == BRW_WIDTH_8 && - insn->header.compression_control == BRW_COMPRESSION_COMPRESSED) + if (reg.width == BRW_WIDTH_8 && + insn->header.compression_control == BRW_COMPRESSION_COMPRESSED) insn->header.execution_size = BRW_EXECUTE_16; else insn->header.execution_size = reg.width; /* note - definitions are compatible */ @@ -64,7 +64,7 @@ static void brw_set_dest( struct brw_instruction *insn, insn->bits1.da1.dest_reg_type = dest.type; insn->bits1.da1.dest_address_mode = dest.address_mode; - if (dest.address_mode == BRW_ADDRESS_DIRECT) { + if (dest.address_mode == BRW_ADDRESS_DIRECT) { insn->bits1.da1.dest_reg_nr = dest.nr; if (insn->header.access_mode == BRW_ALIGN_1) { @@ -116,13 +116,13 @@ static void brw_set_src0( struct brw_instruction *insn, if (reg.file == BRW_IMMEDIATE_VALUE) { insn->bits3.ud = reg.dw1.ud; - + /* Required to set some fields in src1 as well: */ insn->bits1.da1.src1_reg_file = 0; /* arf */ insn->bits1.da1.src1_reg_type = reg.type; } - else + else { if (reg.address_mode == BRW_ADDRESS_DIRECT) { if (insn->header.access_mode == BRW_ALIGN_1) { @@ -138,7 +138,7 @@ static void brw_set_src0( struct brw_instruction *insn, insn->bits2.ia1.src0_subreg_nr = reg.subnr; if (insn->header.access_mode == BRW_ALIGN_1) { - insn->bits2.ia1.src0_indirect_offset = reg.dw1.bits.indirect_offset; + insn->bits2.ia1.src0_indirect_offset = reg.dw1.bits.indirect_offset; } else { insn->bits2.ia16.src0_subreg_nr = reg.dw1.bits.indirect_offset; @@ -146,7 +146,7 @@ static void brw_set_src0( struct brw_instruction *insn, } if (insn->header.access_mode == BRW_ALIGN_1) { - if (reg.width == BRW_WIDTH_1 && + if (reg.width == BRW_WIDTH_1 && insn->header.execution_size == BRW_EXECUTE_1) { insn->bits2.da1.src0_horiz_stride = BRW_HORIZONTAL_STRIDE_0; insn->bits2.da1.src0_width = BRW_WIDTH_1; @@ -212,7 +212,7 @@ void brw_set_src1( struct brw_instruction *insn, } if (insn->header.access_mode == BRW_ALIGN_1) { - if (reg.width == BRW_WIDTH_1 && + if (reg.width == BRW_WIDTH_1 && insn->header.execution_size == BRW_EXECUTE_1) { insn->bits3.da1.src1_horiz_stride = BRW_HORIZONTAL_STRIDE_0; insn->bits3.da1.src1_width = BRW_WIDTH_1; @@ -470,14 +470,14 @@ static void brw_set_sampler_message(struct brw_context *brw, -static struct brw_instruction *next_insn( struct brw_compile *p, +static struct brw_instruction *next_insn( struct brw_compile *p, GLuint opcode ) { struct brw_instruction *insn; if (0 && (BRW_DEBUG & DEBUG_DISASSEM)) { - if (p->nr_insn) + if (p->nr_insn) brw_disasm_insn(stderr, &p->store[p->nr_insn-1]); } @@ -486,7 +486,7 @@ static struct brw_instruction *next_insn( struct brw_compile *p, insn = &p->store[p->nr_insn++]; memcpy(insn, p->current, sizeof(*insn)); - /* Reset this one-shot flag: + /* Reset this one-shot flag: */ if (p->current->header.destreg__conditionalmod) { @@ -506,7 +506,7 @@ static struct brw_instruction *brw_alu1( struct brw_compile *p, { struct brw_instruction *insn = next_insn(p, opcode); brw_set_dest(insn, dest); - brw_set_src0(insn, src); + brw_set_src0(insn, src); return insn; } @@ -516,7 +516,7 @@ static struct brw_instruction *brw_alu2(struct brw_compile *p, struct brw_reg src0, struct brw_reg src1 ) { - struct brw_instruction *insn = next_insn(p, opcode); + struct brw_instruction *insn = next_insn(p, opcode); brw_set_dest(insn, dest); brw_set_src0(insn, src0); brw_set_src1(insn, src1); @@ -575,7 +575,7 @@ ALU2(LINE) void brw_NOP(struct brw_compile *p) { - struct brw_instruction *insn = next_insn(p, BRW_OPCODE_NOP); + struct brw_instruction *insn = next_insn(p, BRW_OPCODE_NOP); brw_set_dest(insn, retype(brw_vec4_grf(0,0), BRW_REGISTER_TYPE_UD)); brw_set_src0(insn, retype(brw_vec4_grf(0,0), BRW_REGISTER_TYPE_UD)); brw_set_src1(insn, brw_imm_ud(0x0)); @@ -589,7 +589,7 @@ void brw_NOP(struct brw_compile *p) * Comparisons, if/else/endif */ -struct brw_instruction *brw_JMPI(struct brw_compile *p, +struct brw_instruction *brw_JMPI(struct brw_compile *p, struct brw_reg dest, struct brw_reg src0, struct brw_reg src1) @@ -652,7 +652,7 @@ struct brw_instruction *brw_IF(struct brw_compile *p, GLuint execute_size) } -struct brw_instruction *brw_ELSE(struct brw_compile *p, +struct brw_instruction *brw_ELSE(struct brw_compile *p, struct brw_instruction *if_insn) { struct brw_instruction *insn; @@ -694,14 +694,14 @@ struct brw_instruction *brw_ELSE(struct brw_compile *p, return insn; } -void brw_ENDIF(struct brw_compile *p, +void brw_ENDIF(struct brw_compile *p, struct brw_instruction *patch_insn) { GLuint br = 1; if (BRW_IS_IGDNG(p->brw)) - br = 2; - + br = 2; + if (p->single_program_flow) { /* In single program flow mode, there's no need to execute an ENDIF, * since we don't need to do any stack operations, and if we're executing @@ -807,7 +807,7 @@ struct brw_instruction *brw_DO(struct brw_compile *p, GLuint execute_size) -struct brw_instruction *brw_WHILE(struct brw_compile *p, +struct brw_instruction *brw_WHILE(struct brw_compile *p, struct brw_instruction *do_insn) { struct brw_instruction *insn; @@ -843,14 +843,14 @@ struct brw_instruction *brw_WHILE(struct brw_compile *p, /* insn->header.mask_control = BRW_MASK_ENABLE; */ /* insn->header.mask_control = BRW_MASK_DISABLE; */ - p->current->header.predicate_control = BRW_PREDICATE_NONE; + p->current->header.predicate_control = BRW_PREDICATE_NONE; return insn; } /* FORWARD JUMPS: */ -void brw_land_fwd_jump(struct brw_compile *p, +void brw_land_fwd_jump(struct brw_compile *p, struct brw_instruction *jmp_insn) { struct brw_instruction *landing = &p->store[p->nr_insn]; @@ -889,7 +889,7 @@ void brw_CMP(struct brw_compile *p, /* Make it so that future instructions will use the computed flag * value until brw_set_predicate_control_flag_value() is called - * again. + * again. */ if (dest.file == BRW_ARCHITECTURE_REGISTER_FILE && dest.nr == 0) { @@ -916,20 +916,20 @@ void brw_math( struct brw_compile *p, GLuint precision ) { struct brw_instruction *insn = next_insn(p, BRW_OPCODE_SEND); - GLuint msg_length = (function == BRW_MATH_FUNCTION_POW) ? 2 : 1; - GLuint response_length = (function == BRW_MATH_FUNCTION_SINCOS) ? 2 : 1; + GLuint msg_length = (function == BRW_MATH_FUNCTION_POW) ? 2 : 1; + GLuint response_length = (function == BRW_MATH_FUNCTION_SINCOS) ? 2 : 1; /* Example code doesn't set predicate_control for send * instructions. */ - insn->header.predicate_control = 0; + insn->header.predicate_control = 0; insn->header.destreg__conditionalmod = msg_reg_nr; brw_set_dest(insn, dest); brw_set_src0(insn, src); brw_set_math_message(p->brw, - insn, - msg_length, response_length, + insn, + msg_length, response_length, function, BRW_MATH_INTEGER_UNSIGNED, precision, @@ -950,8 +950,8 @@ void brw_math_16( struct brw_compile *p, GLuint precision ) { struct brw_instruction *insn; - GLuint msg_length = (function == BRW_MATH_FUNCTION_POW) ? 2 : 1; - GLuint response_length = (function == BRW_MATH_FUNCTION_SINCOS) ? 2 : 1; + GLuint msg_length = (function == BRW_MATH_FUNCTION_POW) ? 2 : 1; + GLuint response_length = (function == BRW_MATH_FUNCTION_SINCOS) ? 2 : 1; /* First instruction: */ @@ -965,8 +965,8 @@ void brw_math_16( struct brw_compile *p, brw_set_dest(insn, dest); brw_set_src0(insn, src); brw_set_math_message(p->brw, - insn, - msg_length, response_length, + insn, + msg_length, response_length, function, BRW_MATH_INTEGER_UNSIGNED, precision, @@ -981,9 +981,9 @@ void brw_math_16( struct brw_compile *p, brw_set_dest(insn, offset(dest,1)); brw_set_src0(insn, src); - brw_set_math_message(p->brw, - insn, - msg_length, response_length, + brw_set_math_message(p->brw, + insn, + msg_length, response_length, function, BRW_MATH_INTEGER_UNSIGNED, precision, @@ -1021,11 +1021,11 @@ void brw_dp_WRITE_16( struct brw_compile *p, GLuint msg_length = 3; struct brw_reg dest = retype(brw_null_reg(), BRW_REGISTER_TYPE_UW); struct brw_instruction *insn = next_insn(p, BRW_OPCODE_SEND); - + insn->header.predicate_control = 0; /* XXX */ - insn->header.compression_control = BRW_COMPRESSION_NONE; + insn->header.compression_control = BRW_COMPRESSION_NONE; insn->header.destreg__conditionalmod = msg_reg_nr; - + brw_set_dest(insn, dest); brw_set_src0(insn, src); @@ -1067,11 +1067,11 @@ void brw_dp_READ_16( struct brw_compile *p, { struct brw_instruction *insn = next_insn(p, BRW_OPCODE_SEND); - + insn->header.predicate_control = 0; /* XXX */ - insn->header.compression_control = BRW_COMPRESSION_NONE; + insn->header.compression_control = BRW_COMPRESSION_NONE; insn->header.destreg__conditionalmod = msg_reg_nr; - + brw_set_dest(insn, dest); /* UW? */ brw_set_src0(insn, retype(brw_vec8_grf(0, 0), BRW_REGISTER_TYPE_UW)); @@ -1121,12 +1121,12 @@ void brw_dp_READ_4( struct brw_compile *p, { struct brw_instruction *insn = next_insn(p, BRW_OPCODE_SEND); - + insn->header.predicate_control = BRW_PREDICATE_NONE; - insn->header.compression_control = BRW_COMPRESSION_NONE; + insn->header.compression_control = BRW_COMPRESSION_NONE; insn->header.destreg__conditionalmod = msg_reg_nr; insn->header.mask_control = BRW_MASK_DISABLE; - + /* cast dest to a uword[8] vector */ dest = retype(vec8(dest), BRW_REGISTER_TYPE_UW); @@ -1195,13 +1195,13 @@ void brw_dp_READ_4_vs(struct brw_compile *p, { struct brw_instruction *insn = next_insn(p, BRW_OPCODE_SEND); - + insn->header.predicate_control = BRW_PREDICATE_NONE; - insn->header.compression_control = BRW_COMPRESSION_NONE; + insn->header.compression_control = BRW_COMPRESSION_NONE; insn->header.destreg__conditionalmod = msg_reg_nr; insn->header.mask_control = BRW_MASK_DISABLE; /*insn->header.access_mode = BRW_ALIGN_16;*/ - + brw_set_dest(insn, dest); brw_set_src0(insn, brw_null_reg()); @@ -1229,11 +1229,11 @@ void brw_fb_WRITE(struct brw_compile *p, GLboolean eot) { struct brw_instruction *insn = next_insn(p, BRW_OPCODE_SEND); - + insn->header.predicate_control = 0; /* XXX */ - insn->header.compression_control = BRW_COMPRESSION_NONE; + insn->header.compression_control = BRW_COMPRESSION_NONE; insn->header.destreg__conditionalmod = msg_reg_nr; - + brw_set_dest(insn, dest); brw_set_src0(insn, src0); brw_set_dp_write_message(p->brw, @@ -1243,7 +1243,7 @@ void brw_fb_WRITE(struct brw_compile *p, BRW_DATAPORT_WRITE_MESSAGE_RENDER_TARGET_WRITE, /* msg_type */ msg_length, 1, /* pixel scoreboard */ - response_length, + response_length, eot); } @@ -1268,12 +1268,12 @@ void brw_SAMPLE(struct brw_compile *p, GLuint simd_mode) { GLboolean need_stall = 0; - + if (writemask == 0) { /*debug_printf("%s: zero writemask??\n", __FUNCTION__); */ return; } - + /* Hardware doesn't do destination dependency checking on send * instructions properly. Add a workaround which generates the * dependency by other means. In practice it seems like this bug @@ -1306,7 +1306,7 @@ void brw_SAMPLE(struct brw_compile *p, } else { struct brw_reg m1 = brw_message_reg(msg_reg_nr); - + newmask = ~newmask & BRW_WRITEMASK_XYZW; brw_push_insn_state(p); @@ -1314,12 +1314,12 @@ void brw_SAMPLE(struct brw_compile *p, brw_set_compression_control(p, BRW_COMPRESSION_NONE); brw_set_mask_control(p, BRW_MASK_DISABLE); - brw_MOV(p, m1, brw_vec8_grf(0,0)); - brw_MOV(p, get_element_ud(m1, 2), brw_imm_ud(newmask << 12)); + brw_MOV(p, m1, brw_vec8_grf(0,0)); + brw_MOV(p, get_element_ud(m1, 2), brw_imm_ud(newmask << 12)); brw_pop_insn_state(p); - src0 = retype(brw_null_reg(), BRW_REGISTER_TYPE_UW); + src0 = retype(brw_null_reg(), BRW_REGISTER_TYPE_UW); dest = offset(dest, dst_offset); response_length = len * 2; } @@ -1327,7 +1327,7 @@ void brw_SAMPLE(struct brw_compile *p, { struct brw_instruction *insn = next_insn(p, BRW_OPCODE_SEND); - + insn->header.predicate_control = 0; /* XXX */ insn->header.compression_control = BRW_COMPRESSION_NONE; insn->header.destreg__conditionalmod = msg_reg_nr; @@ -1338,7 +1338,7 @@ void brw_SAMPLE(struct brw_compile *p, binding_table_index, sampler, msg_type, - response_length, + response_length, msg_length, eot, header_present, @@ -1352,7 +1352,7 @@ void brw_SAMPLE(struct brw_compile *p, */ brw_push_insn_state(p); brw_set_compression_control(p, BRW_COMPRESSION_NONE); - brw_MOV(p, reg, reg); + brw_MOV(p, reg, reg); brw_pop_insn_state(p); } @@ -1390,9 +1390,9 @@ void brw_urb_WRITE(struct brw_compile *p, allocate, used, msg_length, - response_length, - eot, - writes_complete, + response_length, + eot, + writes_complete, offset, swizzle); } @@ -1425,9 +1425,9 @@ void brw_ff_sync(struct brw_compile *p, allocate, used, msg_length, - response_length, - eot, - writes_complete, + response_length, + eot, + writes_complete, offset, swizzle); } diff --git a/src/gallium/drivers/i965/brw_eu_util.c b/src/gallium/drivers/i965/brw_eu_util.c index 5405cf1..0067ac9 100644 --- a/src/gallium/drivers/i965/brw_eu_util.c +++ b/src/gallium/drivers/i965/brw_eu_util.c @@ -2,7 +2,7 @@ Copyright (C) Intel Corp. 2006. All Rights Reserved. Intel funded Tungsten Graphics (http://www.tungstengraphics.com) to develop this 3D driver. - + 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, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - + The above copyright notice and this permission notice (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 NONINFRINGEMENT. @@ -22,30 +22,30 @@ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - + **********************************************************************/ /* * Authors: * Keith Whitwell */ - + #include "brw_context.h" #include "brw_defines.h" #include "brw_eu.h" -void brw_math_invert( struct brw_compile *p, +void brw_math_invert( struct brw_compile *p, struct brw_reg dst, struct brw_reg src) { - brw_math( p, + brw_math( p, dst, - BRW_MATH_FUNCTION_INV, + BRW_MATH_FUNCTION_INV, BRW_MATH_SATURATE_NONE, 0, src, - BRW_MATH_PRECISION_FULL, + BRW_MATH_PRECISION_FULL, BRW_MATH_DATA_VECTOR ); } diff --git a/src/gallium/drivers/i965/brw_gs.c b/src/gallium/drivers/i965/brw_gs.c index 0682663..ff6523c 100644 --- a/src/gallium/drivers/i965/brw_gs.c +++ b/src/gallium/drivers/i965/brw_gs.c @@ -2,7 +2,7 @@ Copyright (C) Intel Corp. 2006. All Rights Reserved. Intel funded Tungsten Graphics (http://www.tungstengraphics.com) to develop this 3D driver. - + 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, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - + The above copyright notice and this permission notice (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 NONINFRINGEMENT. @@ -22,13 +22,13 @@ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - + **********************************************************************/ /* * Authors: * Keith Whitwell */ - + #include "brw_batchbuffer.h" #include "brw_defines.h" @@ -49,7 +49,7 @@ static enum pipe_error compile_gs_prog( struct brw_context *brw, GLuint program_size; memset(&c, 0, sizeof(c)); - + c.key = *key; c.need_ff_sync = BRW_IS_IGDNG(brw); /* Need to locate the two positions present in vertex + header. @@ -64,7 +64,7 @@ static enum pipe_error compile_gs_prog( struct brw_context *brw, c.nr_bytes = c.nr_regs * REG_SIZE; - + /* Begin the compilation: */ brw_init_compile(brw, &c.func); @@ -72,7 +72,7 @@ static enum pipe_error compile_gs_prog( struct brw_context *brw, c.func.single_program_flow = 1; /* For some reason the thread is spawned with only 4 channels - * unmasked. + * unmasked. */ brw_set_mask_control(&c.func, BRW_MASK_DISABLE); @@ -82,7 +82,7 @@ static enum pipe_error compile_gs_prog( struct brw_context *brw, */ switch (key->primitive) { case PIPE_PRIM_QUADS: - brw_gs_quads( &c ); + brw_gs_quads( &c ); break; case PIPE_PRIM_QUAD_STRIP: brw_gs_quad_strip( &c ); @@ -137,7 +137,7 @@ static enum pipe_error compile_gs_prog( struct brw_context *brw, return PIPE_OK; } -static const unsigned gs_prim[PIPE_PRIM_MAX] = { +static const unsigned gs_prim[PIPE_PRIM_MAX] = { PIPE_PRIM_POINTS, PIPE_PRIM_LINES, PIPE_PRIM_LINE_LOOP, diff --git a/src/gallium/drivers/i965/brw_gs.h b/src/gallium/drivers/i965/brw_gs.h index 6e616dc..0f88e2b 100644 --- a/src/gallium/drivers/i965/brw_gs.h +++ b/src/gallium/drivers/i965/brw_gs.h @@ -2,7 +2,7 @@ Copyright (C) Intel Corp. 2006. All Rights Reserved. Intel funded Tungsten Graphics (http://www.tungstengraphics.com) to develop this 3D driver. - + 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, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - + The above copyright notice and this permission notice (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 NONINFRINGEMENT. @@ -22,13 +22,13 @@ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - + **********************************************************************/ /* * Authors: * Keith Whitwell */ - + #ifndef BRW_GS_H #define BRW_GS_H @@ -37,7 +37,7 @@ #include "brw_context.h" #include "brw_eu.h" -#define MAX_GS_VERTS (4) +#define MAX_GS_VERTS (4) struct brw_gs_prog_key { GLuint nr_attrs:8; @@ -51,7 +51,7 @@ struct brw_gs_compile { struct brw_compile func; struct brw_gs_prog_key key; struct brw_gs_prog_data prog_data; - + struct { struct brw_reg R0; struct brw_reg vertex[MAX_GS_VERTS]; diff --git a/src/gallium/drivers/i965/brw_gs_emit.c b/src/gallium/drivers/i965/brw_gs_emit.c index 9b58773..405698d 100644 --- a/src/gallium/drivers/i965/brw_gs_emit.c +++ b/src/gallium/drivers/i965/brw_gs_emit.c @@ -2,7 +2,7 @@ Copyright (C) Intel Corp. 2006. All Rights Reserved. Intel funded Tungsten Graphics (http://www.tungstengraphics.com) to develop this 3D driver. - + 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, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - + The above copyright notice and this permission notice (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 NONINFRINGEMENT. @@ -22,13 +22,13 @@ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - + **********************************************************************/ /* * Authors: * Keith Whitwell */ - + #include "brw_batchbuffer.h" @@ -53,12 +53,12 @@ static void brw_gs_alloc_regs( struct brw_gs_compile *c, i += c->nr_regs; } - c->prog_data.urb_read_length = c->nr_regs; + c->prog_data.urb_read_length = c->nr_regs; c->prog_data.total_grf = i; } -static void brw_gs_emit_vue(struct brw_gs_compile *c, +static void brw_gs_emit_vue(struct brw_gs_compile *c, struct brw_reg vert, GLboolean last, GLuint header) @@ -81,7 +81,7 @@ static void brw_gs_emit_vue(struct brw_gs_compile *c, * writes instantiates a seperate urb entry, and a new one must be * allocated each time. */ - brw_urb_WRITE(p, + brw_urb_WRITE(p, allocate ? c->reg.R0 : retype(brw_null_reg(), BRW_REGISTER_TYPE_UD), 0, c->reg.R0, @@ -99,11 +99,11 @@ static void brw_gs_ff_sync(struct brw_gs_compile *c, int num_prim) { struct brw_compile *p = &c->func; brw_MOV(p, get_element_ud(c->reg.R0, 1), brw_imm_ud(num_prim)); - brw_ff_sync(p, + brw_ff_sync(p, c->reg.R0, 0, c->reg.R0, - 1, + 1, 1, /* used */ 1, /* msg length */ 1, /* response length */ @@ -117,27 +117,27 @@ static void brw_gs_ff_sync(struct brw_gs_compile *c, int num_prim) void brw_gs_quads( struct brw_gs_compile *c ) { brw_gs_alloc_regs(c, 4); - + /* Use polygons for correct edgeflag behaviour. Note that vertex 3 * is the PV for quads, but vertex 0 for polygons: */ if (c->need_ff_sync) - brw_gs_ff_sync(c, 1); + brw_gs_ff_sync(c, 1); brw_gs_emit_vue(c, c->reg.vertex[3], 0, ((_3DPRIM_POLYGON << 2) | R02_PRIM_START)); brw_gs_emit_vue(c, c->reg.vertex[0], 0, (_3DPRIM_POLYGON << 2)); - brw_gs_emit_vue(c, c->reg.vertex[1], 0, (_3DPRIM_POLYGON << 2)); + brw_gs_emit_vue(c, c->reg.vertex[1], 0, (_3DPRIM_POLYGON << 2)); brw_gs_emit_vue(c, c->reg.vertex[2], 1, ((_3DPRIM_POLYGON << 2) | R02_PRIM_END)); } void brw_gs_quad_strip( struct brw_gs_compile *c ) { brw_gs_alloc_regs(c, 4); - + if (c->need_ff_sync) - brw_gs_ff_sync(c, 1); + brw_gs_ff_sync(c, 1); brw_gs_emit_vue(c, c->reg.vertex[2], 0, ((_3DPRIM_POLYGON << 2) | R02_PRIM_START)); brw_gs_emit_vue(c, c->reg.vertex[3], 0, (_3DPRIM_POLYGON << 2)); - brw_gs_emit_vue(c, c->reg.vertex[0], 0, (_3DPRIM_POLYGON << 2)); + brw_gs_emit_vue(c, c->reg.vertex[0], 0, (_3DPRIM_POLYGON << 2)); brw_gs_emit_vue(c, c->reg.vertex[1], 1, ((_3DPRIM_POLYGON << 2) | R02_PRIM_END)); } @@ -146,7 +146,7 @@ void brw_gs_tris( struct brw_gs_compile *c ) brw_gs_alloc_regs(c, 3); if (c->need_ff_sync) - brw_gs_ff_sync(c, 1); + brw_gs_ff_sync(c, 1); brw_gs_emit_vue(c, c->reg.vertex[0], 0, ((_3DPRIM_TRILIST << 2) | R02_PRIM_START)); brw_gs_emit_vue(c, c->reg.vertex[1], 0, (_3DPRIM_TRILIST << 2)); brw_gs_emit_vue(c, c->reg.vertex[2], 1, ((_3DPRIM_TRILIST << 2) | R02_PRIM_END)); @@ -157,7 +157,7 @@ void brw_gs_lines( struct brw_gs_compile *c ) brw_gs_alloc_regs(c, 2); if (c->need_ff_sync) - brw_gs_ff_sync(c, 1); + brw_gs_ff_sync(c, 1); brw_gs_emit_vue(c, c->reg.vertex[0], 0, ((_3DPRIM_LINESTRIP << 2) | R02_PRIM_START)); brw_gs_emit_vue(c, c->reg.vertex[1], 1, ((_3DPRIM_LINESTRIP << 2) | R02_PRIM_END)); } @@ -167,7 +167,7 @@ void brw_gs_points( struct brw_gs_compile *c ) brw_gs_alloc_regs(c, 1); if (c->need_ff_sync) - brw_gs_ff_sync(c, 1); + brw_gs_ff_sync(c, 1); brw_gs_emit_vue(c, c->reg.vertex[0], 1, ((_3DPRIM_POINTLIST << 2) | R02_PRIM_START | R02_PRIM_END)); } diff --git a/src/gallium/drivers/i965/brw_gs_state.c b/src/gallium/drivers/i965/brw_gs_state.c index b64ec28..e30907f 100644 --- a/src/gallium/drivers/i965/brw_gs_state.c +++ b/src/gallium/drivers/i965/brw_gs_state.c @@ -2,7 +2,7 @@ Copyright (C) Intel Corp. 2006. All Rights Reserved. Intel funded Tungsten Graphics (http://www.tungstengraphics.com) to develop this 3D driver. - + 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, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - + The above copyright notice and this permission notice (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 NONINFRINGEMENT. @@ -22,13 +22,13 @@ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - + **********************************************************************/ /* * Authors: * Keith Whitwell */ - + #include "util/u_math.h" #include "brw_context.h" @@ -70,7 +70,7 @@ gs_unit_populate_key(struct brw_context *brw, struct brw_gs_unit_key *key) } static enum pipe_error -gs_unit_create_from_key(struct brw_context *brw, +gs_unit_create_from_key(struct brw_context *brw, struct brw_gs_unit_key *key, struct brw_winsys_reloc *reloc, unsigned nr_reloc, diff --git a/src/gallium/drivers/i965/brw_misc_state.c b/src/gallium/drivers/i965/brw_misc_state.c index 6d89b5d..6e4c30b 100644 --- a/src/gallium/drivers/i965/brw_misc_state.c +++ b/src/gallium/drivers/i965/brw_misc_state.c @@ -2,7 +2,7 @@ Copyright (C) Intel Corp. 2006. All Rights Reserved. Intel funded Tungsten Graphics (http://www.tungstengraphics.com) to develop this 3D driver. - + 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, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - + The above copyright notice and this permission notice (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 NONINFRINGEMENT. @@ -22,13 +22,13 @@ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - + **********************************************************************/ /* * Authors: * Keith Whitwell */ - + #include "brw_debug.h" @@ -111,7 +111,7 @@ static int upload_binding_table_pointers(struct brw_context *brw) BEGIN_BATCH(6, IGNORE_CLIPRECTS); OUT_BATCH(CMD_BINDING_TABLE_PTRS << 16 | (6 - 2)); if (brw->vs.bind_bo != NULL) - OUT_RELOC(brw->vs.bind_bo, + OUT_RELOC(brw->vs.bind_bo, BRW_USAGE_SAMPLER, 0); /* vs */ else @@ -147,16 +147,16 @@ static int upload_pipelined_state_pointers(struct brw_context *brw ) { BEGIN_BATCH(7, IGNORE_CLIPRECTS); OUT_BATCH(CMD_PIPELINED_STATE_POINTERS << 16 | (7 - 2)); - OUT_RELOC(brw->vs.state_bo, + OUT_RELOC(brw->vs.state_bo, BRW_USAGE_STATE, 0); if (brw->gs.prog_active) - OUT_RELOC(brw->gs.state_bo, + OUT_RELOC(brw->gs.state_bo, BRW_USAGE_STATE, 1); else OUT_BATCH(0); - OUT_RELOC(brw->clip.state_bo, + OUT_RELOC(brw->clip.state_bo, BRW_USAGE_STATE, 1); OUT_RELOC(brw->sf.state_bo, @@ -189,7 +189,7 @@ static int prepare_psp_urb_cbs(struct brw_context *brw) static int upload_psp_urb_cbs(struct brw_context *brw ) { int ret; - + ret = upload_pipelined_state_pointers(brw); if (ret) return ret; @@ -209,12 +209,12 @@ const struct brw_tracked_state brw_psp_urb_cbs = { .dirty = { .mesa = 0, .brw = BRW_NEW_URB_FENCE | BRW_NEW_BATCH, - .cache = (CACHE_NEW_VS_UNIT | - CACHE_NEW_GS_UNIT | - CACHE_NEW_GS_PROG | - CACHE_NEW_CLIP_UNIT | - CACHE_NEW_SF_UNIT | - CACHE_NEW_WM_UNIT | + .cache = (CACHE_NEW_VS_UNIT | + CACHE_NEW_GS_UNIT | + CACHE_NEW_GS_PROG | + CACHE_NEW_CLIP_UNIT | + CACHE_NEW_SF_UNIT | + CACHE_NEW_WM_UNIT | CACHE_NEW_CC_UNIT) }, .prepare = prepare_psp_urb_cbs, @@ -223,7 +223,7 @@ const struct brw_tracked_state brw_psp_urb_cbs = { /*********************************************************************** - * Depth buffer + * Depth buffer */ static int prepare_depthbuffer(struct brw_context *brw) @@ -386,7 +386,7 @@ static int upload_invarient_state( struct brw_context *brw ) struct brw_global_depth_offset_clamp gdo; memset(&gdo, 0, sizeof(gdo)); - /* Disable depth offset clamping. + /* Disable depth offset clamping. */ gdo.header.opcode = CMD_GLOBAL_DEPTH_OFFSET_CLAMP; gdo.header.length = sizeof(gdo)/4 - 2; @@ -413,17 +413,17 @@ static int upload_invarient_state( struct brw_context *brw ) struct brw_vf_statistics vfs; memset(&vfs, 0, sizeof(vfs)); - if (BRW_IS_G4X(brw) || BRW_IS_IGDNG(brw)) + if (BRW_IS_G4X(brw) || BRW_IS_IGDNG(brw)) vfs.opcode = CMD_VF_STATISTICS_GM45; - else + else vfs.opcode = CMD_VF_STATISTICS_965; if (BRW_DEBUG & DEBUG_STATS) - vfs.statistics_enable = 1; + vfs.statistics_enable = 1; BRW_BATCH_STRUCT(brw, &vfs); } - + if (!BRW_IS_965(brw)) { struct brw_aa_line_parameters balp; @@ -432,13 +432,13 @@ static int upload_invarient_state( struct brw_context *brw ) memset(&balp, 0, sizeof(balp)); balp.header.opcode = CMD_AA_LINE_PARAMETERS; balp.header.length = sizeof(balp) / 4 - 2; - + BRW_BATCH_STRUCT(brw, &balp); } { struct brw_polygon_stipple_offset bpso; - + /* This is invarient state in gallium: */ memset(&bpso, 0, sizeof(bpso)); @@ -449,7 +449,7 @@ static int upload_invarient_state( struct brw_context *brw ) BRW_BATCH_STRUCT(brw, &bpso); } - + return 0; } @@ -464,7 +464,7 @@ const struct brw_tracked_state brw_invarient_state = { /*********************************************************************** - * State base address + * State base address */ /** diff --git a/src/gallium/drivers/i965/brw_pipe_blend.c b/src/gallium/drivers/i965/brw_pipe_blend.c index 21f786f..7bc5faf 100644 --- a/src/gallium/drivers/i965/brw_pipe_blend.c +++ b/src/gallium/drivers/i965/brw_pipe_blend.c @@ -52,17 +52,17 @@ static int translate_logicop(unsigned logicop) static unsigned translate_blend_equation( unsigned mode ) { switch (mode) { - case PIPE_BLEND_ADD: - return BRW_BLENDFUNCTION_ADD; - case PIPE_BLEND_MIN: - return BRW_BLENDFUNCTION_MIN; - case PIPE_BLEND_MAX: - return BRW_BLENDFUNCTION_MAX; - case PIPE_BLEND_SUBTRACT: - return BRW_BLENDFUNCTION_SUBTRACT; - case PIPE_BLEND_REVERSE_SUBTRACT: - return BRW_BLENDFUNCTION_REVERSE_SUBTRACT; - default: + case PIPE_BLEND_ADD: + return BRW_BLENDFUNCTION_ADD; + case PIPE_BLEND_MIN: + return BRW_BLENDFUNCTION_MIN; + case PIPE_BLEND_MAX: + return BRW_BLENDFUNCTION_MAX; + case PIPE_BLEND_SUBTRACT: + return BRW_BLENDFUNCTION_SUBTRACT; + case PIPE_BLEND_REVERSE_SUBTRACT: + return BRW_BLENDFUNCTION_REVERSE_SUBTRACT; + default: assert(0); return BRW_BLENDFUNCTION_ADD; } @@ -71,40 +71,40 @@ static unsigned translate_blend_equation( unsigned mode ) static unsigned translate_blend_factor( unsigned factor ) { switch(factor) { - case PIPE_BLENDFACTOR_ZERO: - return BRW_BLENDFACTOR_ZERO; - case PIPE_BLENDFACTOR_SRC_ALPHA: - return BRW_BLENDFACTOR_SRC_ALPHA; - case PIPE_BLENDFACTOR_ONE: - return BRW_BLENDFACTOR_ONE; - case PIPE_BLENDFACTOR_SRC_COLOR: - return BRW_BLENDFACTOR_SRC_COLOR; - case PIPE_BLENDFACTOR_INV_SRC_COLOR: - return BRW_BLENDFACTOR_INV_SRC_COLOR; - case PIPE_BLENDFACTOR_DST_COLOR: - return BRW_BLENDFACTOR_DST_COLOR; - case PIPE_BLENDFACTOR_INV_DST_COLOR: - return BRW_BLENDFACTOR_INV_DST_COLOR; + case PIPE_BLENDFACTOR_ZERO: + return BRW_BLENDFACTOR_ZERO; + case PIPE_BLENDFACTOR_SRC_ALPHA: + return BRW_BLENDFACTOR_SRC_ALPHA; + case PIPE_BLENDFACTOR_ONE: + return BRW_BLENDFACTOR_ONE; + case PIPE_BLENDFACTOR_SRC_COLOR: + return BRW_BLENDFACTOR_SRC_COLOR; + case PIPE_BLENDFACTOR_INV_SRC_COLOR: + return BRW_BLENDFACTOR_INV_SRC_COLOR; + case PIPE_BLENDFACTOR_DST_COLOR: + return BRW_BLENDFACTOR_DST_COLOR; + case PIPE_BLENDFACTOR_INV_DST_COLOR: + return BRW_BLENDFACTOR_INV_DST_COLOR; case PIPE_BLENDFACTOR_INV_SRC_ALPHA: - return BRW_BLENDFACTOR_INV_SRC_ALPHA; - case PIPE_BLENDFACTOR_DST_ALPHA: - return BRW_BLENDFACTOR_DST_ALPHA; + return BRW_BLENDFACTOR_INV_SRC_ALPHA; + case PIPE_BLENDFACTOR_DST_ALPHA: + return BRW_BLENDFACTOR_DST_ALPHA; case PIPE_BLENDFACTOR_INV_DST_ALPHA: - return BRW_BLENDFACTOR_INV_DST_ALPHA; - case PIPE_BLENDFACTOR_SRC_ALPHA_SATURATE: + return BRW_BLENDFACTOR_INV_DST_ALPHA; + case PIPE_BLENDFACTOR_SRC_ALPHA_SATURATE: return BRW_BLENDFACTOR_SRC_ALPHA_SATURATE; case PIPE_BLENDFACTOR_CONST_COLOR: - return BRW_BLENDFACTOR_CONST_COLOR; + return BRW_BLENDFACTOR_CONST_COLOR; case PIPE_BLENDFACTOR_INV_CONST_COLOR: return BRW_BLENDFACTOR_INV_CONST_COLOR; case PIPE_BLENDFACTOR_CONST_ALPHA: - return BRW_BLENDFACTOR_CONST_ALPHA; + return BRW_BLENDFACTOR_CONST_ALPHA; case PIPE_BLENDFACTOR_INV_CONST_ALPHA: return BRW_BLENDFACTOR_INV_CONST_ALPHA; default: assert(0); return BRW_BLENDFACTOR_ZERO; - } + } } static void *brw_create_blend_state( struct pipe_context *pipe, @@ -117,7 +117,7 @@ static void *brw_create_blend_state( struct pipe_context *pipe, if (templ->logicop_enable) { blend->cc2.logicop_enable = 1; blend->cc5.logicop_func = translate_logicop(templ->logicop_func); - } + } else if (templ->rt[0].blend_enable) { blend->cc6.dest_blend_factor = translate_blend_factor(templ->rt[0].rgb_dst_factor); blend->cc6.src_blend_factor = translate_blend_factor(templ->rt[0].rgb_src_factor); @@ -128,7 +128,7 @@ static void *brw_create_blend_state( struct pipe_context *pipe, blend->cc5.ia_blend_function = translate_blend_equation(templ->rt[0].alpha_func); blend->cc3.blend_enable = 1; - blend->cc3.ia_blend_enable = + blend->cc3.ia_blend_enable = (blend->cc6.dest_blend_factor != blend->cc5.ia_dest_blend_factor || blend->cc6.src_blend_factor != blend->cc5.ia_src_blend_factor || blend->cc6.blend_function != blend->cc5.ia_blend_function); @@ -196,7 +196,7 @@ void brw_pipe_blend_init( struct brw_context *brw ) { struct brw_blend_constant_color *bcc = &brw->curr.bcc; - memset(bcc, 0, sizeof(*bcc)); + memset(bcc, 0, sizeof(*bcc)); bcc->header.opcode = CMD_BLEND_CONSTANT_COLOR; bcc->header.length = sizeof(*bcc)/4-2; } diff --git a/src/gallium/drivers/i965/brw_pipe_clear.c b/src/gallium/drivers/i965/brw_pipe_clear.c index 7bf3ea6..923a5c9 100644 --- a/src/gallium/drivers/i965/brw_pipe_clear.c +++ b/src/gallium/drivers/i965/brw_pipe_clear.c @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2003 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ #include "util/u_pack_color.h" @@ -109,7 +109,7 @@ try_clear( struct brw_context *brw, -static void color_clear(struct brw_context *brw, +static void color_clear(struct brw_context *brw, struct brw_surface *bsurface, const float *rgba ) { @@ -199,7 +199,7 @@ static void zstencil_clear(struct brw_context *brw, * Clear the given surface to the specified value. * No masking, no scissor (clear entire buffer). */ -static void brw_clear(struct pipe_context *pipe, +static void brw_clear(struct pipe_context *pipe, unsigned buffers, const float *rgba, double depth, @@ -210,7 +210,7 @@ static void brw_clear(struct pipe_context *pipe, if (buffers & PIPE_CLEAR_COLOR) { for (i = 0; i < brw->curr.fb.nr_cbufs; i++) { - color_clear( brw, + color_clear( brw, brw_surface(brw->curr.fb.cbufs[i]), rgba ); } diff --git a/src/gallium/drivers/i965/brw_pipe_fb.c b/src/gallium/drivers/i965/brw_pipe_fb.c index a90b7c7..f71ed2d 100644 --- a/src/gallium/drivers/i965/brw_pipe_fb.c +++ b/src/gallium/drivers/i965/brw_pipe_fb.c @@ -8,7 +8,7 @@ /** * called from intelDrawBuffer() */ -static void brw_set_framebuffer_state( struct pipe_context *pipe, +static void brw_set_framebuffer_state( struct pipe_context *pipe, const struct pipe_framebuffer_state *fb ) { struct brw_context *brw = brw_context(pipe); @@ -22,7 +22,7 @@ static void brw_set_framebuffer_state( struct pipe_context *pipe, brw->curr.fb.height = fb->height; brw->state.dirty.mesa |= PIPE_NEW_FRAMEBUFFER_DIMENSIONS; } - + /* Z/Stencil */ if (brw->curr.fb.zsbuf != fb->zsbuf) { @@ -38,7 +38,7 @@ static void brw_set_framebuffer_state( struct pipe_context *pipe, pipe_surface_reference(&brw->curr.fb.cbufs[i], fb->cbufs[i]); } } - + if (brw->curr.fb.nr_cbufs != fb->nr_cbufs) { brw->curr.fb.nr_cbufs = MIN2(BRW_MAX_DRAW_BUFFERS, fb->nr_cbufs); brw->state.dirty.mesa |= PIPE_NEW_NR_CBUFS; diff --git a/src/gallium/drivers/i965/brw_pipe_flush.c b/src/gallium/drivers/i965/brw_pipe_flush.c index 0ae1a6b..9d432a6 100644 --- a/src/gallium/drivers/i965/brw_pipe_flush.c +++ b/src/gallium/drivers/i965/brw_pipe_flush.c @@ -12,7 +12,7 @@ void brw_context_flush( struct brw_context *brw ) { /* - * + * */ brw_emit_query_end(brw); @@ -38,7 +38,7 @@ void brw_context_flush( struct brw_context *brw ) static void brw_flush( struct pipe_context *pipe, - unsigned flags, + unsigned flags, struct pipe_fence_handle **fence ) { brw_context_flush( brw_context( pipe ) ); diff --git a/src/gallium/drivers/i965/brw_pipe_query.c b/src/gallium/drivers/i965/brw_pipe_query.c index 0745254..86a6c0f 100644 --- a/src/gallium/drivers/i965/brw_pipe_query.c +++ b/src/gallium/drivers/i965/brw_pipe_query.c @@ -60,14 +60,14 @@ brw_query_get_result(struct pipe_context *pipe, if (query->bo) { int i; uint64_t *map; - + if (brw->sws->bo_is_busy(query->bo) && !wait) return FALSE; - + map = bo_map_read(brw->sws, query->bo); if (map == NULL) return FALSE; - + for (i = query->first_index; i <= query->last_index; i++) { query->result += map[i * 2 + 1] - map[i * 2]; } @@ -91,7 +91,7 @@ brw_query_create(struct pipe_context *pipe, unsigned type ) if (query == NULL) return NULL; return (struct pipe_query *)query; - + default: return NULL; } @@ -146,7 +146,7 @@ brw_query_end(struct pipe_context *pipe, struct pipe_query *q) } /*********************************************************************** - * Internal functions and callbacks to implement queries + * Internal functions and callbacks to implement queries */ /** Called to set up the query BO and account for its aperture space */ @@ -206,12 +206,12 @@ brw_emit_query_begin(struct brw_context *brw) foreach(query, &brw->query.active_head) { if (query->bo != brw->query.bo) { uint64_t tmp; - + /* Propogate the results from this buffer to all of the * active queries, as the bo is going away. */ if (query->bo != NULL) - brw_query_get_result( &brw->base, + brw_query_get_result( &brw->base, (struct pipe_query *)query, FALSE, &tmp ); diff --git a/src/gallium/drivers/i965/brw_pipe_rast.c b/src/gallium/drivers/i965/brw_pipe_rast.c index 4c1a6d7..79bdcd2 100644 --- a/src/gallium/drivers/i965/brw_pipe_rast.c +++ b/src/gallium/drivers/i965/brw_pipe_rast.c @@ -53,14 +53,14 @@ calculate_clip_key_rast( const struct brw_context *brw, if (!(templ->cull_face & PIPE_FACE_FRONT)) { if (templ->front_ccw) key->fill_ccw = translate_fill(templ->fill_front); - else + else key->fill_cw = translate_fill(templ->fill_front); } if (!(templ->cull_face & PIPE_FACE_BACK)) { if (templ->front_ccw) key->fill_cw = translate_fill(templ->fill_back); - else + else key->fill_ccw = translate_fill(templ->fill_back); } @@ -96,10 +96,10 @@ calculate_clip_key_rast( const struct brw_context *brw, break; } - if (templ->light_twoside && key->fill_cw != CLIP_CULL) + if (templ->light_twoside && key->fill_cw != CLIP_CULL) key->copy_bfc_cw = 1; - - if (templ->light_twoside && key->fill_ccw != CLIP_CULL) + + if (templ->light_twoside && key->fill_ccw != CLIP_CULL) key->copy_bfc_ccw = 1; } @@ -131,7 +131,7 @@ static void *brw_create_rasterizer_state( struct pipe_context *pipe, rast->templ = *templ; calculate_clip_key_rast( brw, templ, rast, &rast->clip_key ); - + if (templ->line_stipple_enable) calculate_line_stipple_rast( templ, &rast->bls ); diff --git a/src/gallium/drivers/i965/brw_pipe_sampler.c b/src/gallium/drivers/i965/brw_pipe_sampler.c index 3fe753e..63f00c1 100644 --- a/src/gallium/drivers/i965/brw_pipe_sampler.c +++ b/src/gallium/drivers/i965/brw_pipe_sampler.c @@ -18,25 +18,25 @@ static GLuint translate_wrap_mode( unsigned wrap ) { switch( wrap ) { - case PIPE_TEX_WRAP_REPEAT: + case PIPE_TEX_WRAP_REPEAT: return BRW_TEXCOORDMODE_WRAP; case PIPE_TEX_WRAP_CLAMP: case PIPE_TEX_WRAP_CLAMP_TO_EDGE: return BRW_TEXCOORDMODE_CLAMP; - + case PIPE_TEX_WRAP_CLAMP_TO_BORDER: return BRW_TEXCOORDMODE_CLAMP_BORDER; - case PIPE_TEX_WRAP_MIRROR_REPEAT: + case PIPE_TEX_WRAP_MIRROR_REPEAT: return BRW_TEXCOORDMODE_MIRROR; - case PIPE_TEX_WRAP_MIRROR_CLAMP: - case PIPE_TEX_WRAP_MIRROR_CLAMP_TO_EDGE: - case PIPE_TEX_WRAP_MIRROR_CLAMP_TO_BORDER: + case PIPE_TEX_WRAP_MIRROR_CLAMP: + case PIPE_TEX_WRAP_MIRROR_CLAMP_TO_EDGE: + case PIPE_TEX_WRAP_MIRROR_CLAMP_TO_BORDER: return BRW_TEXCOORDMODE_MIRROR_ONCE; - default: + default: return BRW_TEXCOORDMODE_WRAP; } } @@ -57,7 +57,7 @@ static GLuint translate_img_filter( unsigned filter ) static GLuint translate_mip_filter( unsigned filter ) { switch (filter) { - case PIPE_TEX_MIPFILTER_NONE: + case PIPE_TEX_MIPFILTER_NONE: return BRW_MIPFILTER_NONE; case PIPE_TEX_MIPFILTER_NEAREST: return BRW_MIPFILTER_NEAREST; @@ -76,21 +76,21 @@ static GLuint translate_mip_filter( unsigned filter ) static GLuint translate_shadow_compare_func( unsigned func ) { switch (func) { - case PIPE_FUNC_NEVER: + case PIPE_FUNC_NEVER: return BRW_COMPAREFUNCTION_ALWAYS; - case PIPE_FUNC_LESS: + case PIPE_FUNC_LESS: return BRW_COMPAREFUNCTION_LEQUAL; - case PIPE_FUNC_LEQUAL: + case PIPE_FUNC_LEQUAL: return BRW_COMPAREFUNCTION_LESS; - case PIPE_FUNC_GREATER: + case PIPE_FUNC_GREATER: return BRW_COMPAREFUNCTION_GEQUAL; - case PIPE_FUNC_GEQUAL: + case PIPE_FUNC_GEQUAL: return BRW_COMPAREFUNCTION_GREATER; - case PIPE_FUNC_NOTEQUAL: + case PIPE_FUNC_NOTEQUAL: return BRW_COMPAREFUNCTION_EQUAL; - case PIPE_FUNC_EQUAL: + case PIPE_FUNC_EQUAL: return BRW_COMPAREFUNCTION_NOTEQUAL; - case PIPE_FUNC_ALWAYS: + case PIPE_FUNC_ALWAYS: return BRW_COMPAREFUNCTION_NEVER; default: assert(0); @@ -112,10 +112,10 @@ brw_create_sampler_state( struct pipe_context *pipe, sampler->ss0.mip_filter = translate_mip_filter( template->min_mip_filter ); - /* XXX: anisotropy logic slightly changed: + /* XXX: anisotropy logic slightly changed: */ if (template->max_anisotropy > 1) { - sampler->ss0.min_filter = BRW_MAPFILTER_ANISOTROPIC; + sampler->ss0.min_filter = BRW_MAPFILTER_ANISOTROPIC; sampler->ss0.mag_filter = BRW_MAPFILTER_ANISOTROPIC; sampler->ss3.max_aniso = MIN2((template->max_anisotropy - 2) / 2, @@ -126,16 +126,16 @@ brw_create_sampler_state( struct pipe_context *pipe, sampler->ss1.s_wrap_mode = translate_wrap_mode(template->wrap_s); sampler->ss1.t_wrap_mode = translate_wrap_mode(template->wrap_t); - /* Set LOD bias: + /* Set LOD bias: */ - sampler->ss0.lod_bias = + sampler->ss0.lod_bias = util_signed_fixed(CLAMP(template->lod_bias, -16, 15), 6); sampler->ss0.lod_preclamp = 1; /* OpenGL mode */ sampler->ss0.default_color_mode = 0; /* OpenGL/DX10 mode */ - /* Set shadow function: + /* Set shadow function: */ if (template->compare_mode == PIPE_TEX_COMPARE_R_TO_TEXTURE) { @@ -147,15 +147,15 @@ brw_create_sampler_state( struct pipe_context *pipe, translate_shadow_compare_func(template->compare_func); } - /* Set BaseMipLevel, MaxLOD, MinLOD: + /* Set BaseMipLevel, MaxLOD, MinLOD: */ - sampler->ss0.base_level = + sampler->ss0.base_level = util_unsigned_fixed(0, 1); - sampler->ss1.max_lod = + sampler->ss1.max_lod = util_unsigned_fixed(CLAMP(template->max_lod, 0, 13), 6); - sampler->ss1.min_lod = + sampler->ss1.min_lod = util_unsigned_fixed(CLAMP(template->min_lod, 0, 13), 6); return (void *)sampler; diff --git a/src/gallium/drivers/i965/brw_pipe_shader.c b/src/gallium/drivers/i965/brw_pipe_shader.c index d9bee96..7072722 100644 --- a/src/gallium/drivers/i965/brw_pipe_shader.c +++ b/src/gallium/drivers/i965/brw_pipe_shader.c @@ -2,7 +2,7 @@ Copyright (C) Intel Corp. 2006. All Rights Reserved. Intel funded Tungsten Graphics (http://www.tungstengraphics.com) to develop this 3D driver. - + 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, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - + The above copyright notice and this permission notice (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 NONINFRINGEMENT. @@ -22,7 +22,7 @@ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - + **********************************************************************/ /* * Authors: @@ -31,7 +31,7 @@ #include "util/u_inlines.h" #include "util/u_memory.h" - + #include "tgsi/tgsi_parse.h" #include "tgsi/tgsi_scan.h" @@ -84,7 +84,7 @@ static void scan_immediates(const struct tgsi_token *tokens, for (; i < 4; i++) imm->data[imm->nr][i] = id[i]; - + imm->nr++; break; } @@ -101,7 +101,7 @@ static void brw_bind_fs_state( struct pipe_context *pipe, void *prog ) { struct brw_fragment_shader *fs = (struct brw_fragment_shader *)prog; struct brw_context *brw = brw_context(pipe); - + if (brw->curr.fragment_shader == fs) return; @@ -228,7 +228,7 @@ static void *brw_create_vs_state( struct pipe_context *pipe, } } - + /* Done: */ return (void *)vs; diff --git a/src/gallium/drivers/i965/brw_pipe_surface.c b/src/gallium/drivers/i965/brw_pipe_surface.c index 4deead9..6ba5eb4 100644 --- a/src/gallium/drivers/i965/brw_pipe_surface.c +++ b/src/gallium/drivers/i965/brw_pipe_surface.c @@ -2,7 +2,7 @@ Copyright (C) Intel Corp. 2006. All Rights Reserved. Intel funded Tungsten Graphics (http://www.tungstengraphics.com) to develop this 3D driver. - + 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, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - + The above copyright notice and this permission notice (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 NONINFRINGEMENT. @@ -22,7 +22,7 @@ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - + **********************************************************************/ /* * Authors: @@ -89,7 +89,7 @@ static boolean need_linear_view( struct brw_screen *brw_screen, /* Tiled 3d textures don't have subsets that look like 2d surfaces: */ - + /* Everything else should be fine to render to in-place: */ return GL_FALSE; @@ -108,7 +108,7 @@ void brw_update_texture( struct brw_screen *brw_screen, /* Create a new surface with linear layout to serve as a render-target * where it would be illegal (perhaps due to tiling constraints) to do * this in-place. - * + * * Currently not implemented, not sure if it's needed. */ static struct brw_surface *create_linear_view( struct brw_screen *brw_screen, @@ -200,7 +200,7 @@ static struct brw_surface *create_in_place_view( struct brw_screen *brw_screen, return surface; } -/* Get a surface which is view into a texture +/* Get a surface which is view into a texture */ static struct pipe_surface *brw_create_surface(struct pipe_context *pipe, struct pipe_resource *pt, @@ -221,7 +221,7 @@ static struct pipe_surface *brw_create_surface(struct pipe_context *pipe, else type = BRW_VIEW_IN_PLACE; - + foreach (surface, &tex->views[type]) { if (id.value == surface->id.value) return &surface->base; diff --git a/src/gallium/drivers/i965/brw_pipe_vertex.c b/src/gallium/drivers/i965/brw_pipe_vertex.c index 007239e..cb56860 100644 --- a/src/gallium/drivers/i965/brw_pipe_vertex.c +++ b/src/gallium/drivers/i965/brw_pipe_vertex.c @@ -258,8 +258,8 @@ static void brw_set_vertex_buffers(struct pipe_context *pipe, return; /* Adjust refcounts */ - for (i = 0; i < count; i++) - pipe_resource_reference(&brw->curr.vertex_buffer[i].buffer, + for (i = 0; i < count; i++) + pipe_resource_reference(&brw->curr.vertex_buffer[i].buffer, buffers[i].buffer); for ( ; i < brw->curr.num_vertex_buffers; i++) @@ -304,7 +304,7 @@ static void brw_set_index_buffer(struct pipe_context *pipe, } -void +void brw_pipe_vertex_init( struct brw_context *brw ) { brw->base.set_vertex_buffers = brw_set_vertex_buffers; @@ -315,7 +315,7 @@ brw_pipe_vertex_init( struct brw_context *brw ) } -void +void brw_pipe_vertex_cleanup( struct brw_context *brw ) { diff --git a/src/gallium/drivers/i965/brw_reg.h b/src/gallium/drivers/i965/brw_reg.h index ba10f9d..1a5d3cc 100644 --- a/src/gallium/drivers/i965/brw_reg.h +++ b/src/gallium/drivers/i965/brw_reg.h @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2003 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ #ifndef BRW_REG_H diff --git a/src/gallium/drivers/i965/brw_resource.h b/src/gallium/drivers/i965/brw_resource.h index 78defb3..e9b57d5 100644 --- a/src/gallium/drivers/i965/brw_resource.h +++ b/src/gallium/drivers/i965/brw_resource.h @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ #ifndef BRW_RESOURCE_H @@ -139,7 +139,7 @@ brw_buffer_is_user_buffer( const struct pipe_resource *buf ) /*********************************************************************** - * Internal functions + * Internal functions */ GLboolean brw_texture_layout(struct brw_screen *brw_screen, struct brw_texture *tex ); diff --git a/src/gallium/drivers/i965/brw_resource_buffer.c b/src/gallium/drivers/i965/brw_resource_buffer.c index afb96ee..93844de 100644 --- a/src/gallium/drivers/i965/brw_resource_buffer.c +++ b/src/gallium/drivers/i965/brw_resource_buffer.c @@ -35,7 +35,7 @@ static void * brw_buffer_transfer_map( struct pipe_context *pipe, struct pipe_transfer *transfer) { - struct brw_screen *bscreen = brw_screen(pipe->screen); + struct brw_screen *bscreen = brw_screen(pipe->screen); struct brw_winsys_screen *sws = bscreen->sws; struct brw_buffer *buf = brw_buffer(transfer->resource); unsigned offset = transfer->box.x; @@ -46,7 +46,7 @@ brw_buffer_transfer_map( struct pipe_context *pipe, if (buf->user_buffer) map = buf->user_buffer; else - map = sws->bo_map( buf->bo, + map = sws->bo_map( buf->bo, BRW_DATA_OTHER, offset, length, @@ -63,7 +63,7 @@ brw_buffer_transfer_flush_region( struct pipe_context *pipe, struct pipe_transfer *transfer, const struct pipe_box *box) { - struct brw_screen *bscreen = brw_screen(pipe->screen); + struct brw_screen *bscreen = brw_screen(pipe->screen); struct brw_winsys_screen *sws = bscreen->sws; struct brw_buffer *buf = brw_buffer(transfer->resource); unsigned offset = box->x; @@ -72,7 +72,7 @@ brw_buffer_transfer_flush_region( struct pipe_context *pipe, if (buf->user_buffer) return; - sws->bo_flush_range( buf->bo, + sws->bo_flush_range( buf->bo, offset, length ); } @@ -82,10 +82,10 @@ static void brw_buffer_transfer_unmap( struct pipe_context *pipe, struct pipe_transfer *transfer) { - struct brw_screen *bscreen = brw_screen(pipe->screen); + struct brw_screen *bscreen = brw_screen(pipe->screen); struct brw_winsys_screen *sws = bscreen->sws; struct brw_buffer *buf = brw_buffer( transfer->resource ); - + if (buf->bo) sws->bo_unmap(buf->bo); } @@ -110,7 +110,7 @@ static unsigned brw_buffer_is_referenced( struct pipe_context *pipe, } -struct u_resource_vtbl brw_buffer_vtbl = +struct u_resource_vtbl brw_buffer_vtbl = { brw_buffer_get_handle, /* get_handle */ brw_buffer_destroy, /* resource_destroy */ @@ -133,11 +133,11 @@ brw_buffer_create(struct pipe_screen *screen, struct brw_buffer *buf; unsigned buffer_type; enum pipe_error ret; - + buf = CALLOC_STRUCT(brw_buffer); if (!buf) return NULL; - + buf->b.b = *template; buf->b.vtbl = &brw_buffer_vtbl; pipe_reference_init(&buf->b.b.reference, 1); @@ -152,7 +152,7 @@ brw_buffer_create(struct pipe_screen *screen, case (PIPE_BIND_VERTEX_BUFFER|PIPE_BIND_INDEX_BUFFER): buffer_type = BRW_BUFFER_TYPE_VERTEX; break; - + case PIPE_BIND_CONSTANT_BUFFER: buffer_type = BRW_BUFFER_TYPE_SHADER_CONSTANTS; break; @@ -161,15 +161,15 @@ brw_buffer_create(struct pipe_screen *screen, buffer_type = BRW_BUFFER_TYPE_GENERIC; break; } - + ret = sws->bo_alloc( sws, buffer_type, template->width0, 64, /* alignment */ &buf->bo ); if (ret != PIPE_OK) return NULL; - - return &buf->b.b; + + return &buf->b.b; } @@ -180,11 +180,11 @@ brw_user_buffer_create(struct pipe_screen *screen, unsigned bind) { struct brw_buffer *buf; - + buf = CALLOC_STRUCT(brw_buffer); if (!buf) return NULL; - + pipe_reference_init(&buf->b.b.reference, 1); buf->b.vtbl = &brw_buffer_vtbl; buf->b.b.screen = screen; @@ -197,6 +197,6 @@ brw_user_buffer_create(struct pipe_screen *screen, buf->b.b.array_size = 1; buf->user_buffer = ptr; - - return &buf->b.b; + + return &buf->b.b; } diff --git a/src/gallium/drivers/i965/brw_resource_texture.c b/src/gallium/drivers/i965/brw_resource_texture.c index fded2da..bfb9ee0 100644 --- a/src/gallium/drivers/i965/brw_resource_texture.c +++ b/src/gallium/drivers/i965/brw_resource_texture.c @@ -2,7 +2,7 @@ Copyright (C) Intel Corp. 2006. All Rights Reserved. Intel funded Tungsten Graphics (http://www.tungstengraphics.com) to develop this 3D driver. - + 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, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - + The above copyright notice and this permission notice (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 NONINFRINGEMENT. @@ -22,7 +22,7 @@ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - + **********************************************************************/ /* * Authors: @@ -62,21 +62,21 @@ brw_transfer(struct pipe_transfer *transfer) static GLuint translate_tex_target( unsigned target ) { switch (target) { - case PIPE_TEXTURE_1D: + case PIPE_TEXTURE_1D: return BRW_SURFACE_1D; - case PIPE_TEXTURE_2D: + case PIPE_TEXTURE_2D: case PIPE_TEXTURE_RECT: return BRW_SURFACE_2D; - case PIPE_TEXTURE_3D: + case PIPE_TEXTURE_3D: return BRW_SURFACE_3D; case PIPE_TEXTURE_CUBE: return BRW_SURFACE_CUBE; - default: - assert(0); + default: + assert(0); return BRW_SURFACE_1D; } } @@ -92,7 +92,7 @@ static GLuint translate_tex_format( enum pipe_format pf ) return BRW_SURFACEFORMAT_I8_UNORM; case PIPE_FORMAT_A8_UNORM: - return BRW_SURFACEFORMAT_A8_UNORM; + return BRW_SURFACEFORMAT_A8_UNORM; case PIPE_FORMAT_L16_UNORM: return BRW_SURFACEFORMAT_L16_UNORM; @@ -102,7 +102,7 @@ static GLuint translate_tex_format( enum pipe_format pf ) return BRW_SURFACEFORMAT_I16_UNORM; case PIPE_FORMAT_A16_UNORM: - return BRW_SURFACEFORMAT_A16_UNORM; + return BRW_SURFACEFORMAT_A16_UNORM; */ case PIPE_FORMAT_L8A8_UNORM: @@ -146,10 +146,10 @@ static GLuint translate_tex_format( enum pipe_format pf ) case PIPE_FORMAT_DXT1_RGBA: return BRW_SURFACEFORMAT_BC1_UNORM; - + case PIPE_FORMAT_DXT3_RGBA: return BRW_SURFACEFORMAT_BC2_UNORM; - + case PIPE_FORMAT_DXT5_RGBA: return BRW_SURFACEFORMAT_BC3_UNORM; @@ -257,7 +257,7 @@ static unsigned brw_texture_is_referenced( struct pipe_context *pipe, if (!(layer == -1 || surf->id.bits.layer == layer) || surf->id.bits.level != level) continue; - + if (bscreen->sws->bo_references( batch_bo, surf->bo)) return PIPE_REFERENCED_FOR_READ | PIPE_REFERENCED_FOR_WRITE; } @@ -272,7 +272,7 @@ static unsigned brw_texture_is_referenced( struct pipe_context *pipe, */ -static struct pipe_transfer * +static struct pipe_transfer * brw_texture_get_transfer(struct pipe_context *context, struct pipe_resource *resource, unsigned level, @@ -313,7 +313,7 @@ brw_texture_transfer_map(struct pipe_context *pipe, assert(box->z == 0); offset = tex->image_offset[transfer->level][box->z]; - map = sws->bo_map(tex->bo, + map = sws->bo_map(tex->bo, BRW_DATA_OTHER, 0, tex->bo->size, @@ -343,7 +343,7 @@ brw_texture_transfer_unmap(struct pipe_context *pipe, -struct u_resource_vtbl brw_texture_vtbl = +struct u_resource_vtbl brw_texture_vtbl = { brw_texture_get_handle, /* get_handle */ brw_texture_destroy, /* resource_destroy */ @@ -363,13 +363,13 @@ struct u_resource_vtbl brw_texture_vtbl = struct pipe_resource * brw_texture_create( struct pipe_screen *screen, const struct pipe_resource *template ) -{ +{ struct brw_screen *bscreen = brw_screen(screen); struct brw_texture *tex; enum brw_buffer_type buffer_type; enum pipe_error ret; GLuint format; - + tex = CALLOC_STRUCT(brw_texture); if (tex == NULL) return NULL; @@ -390,14 +390,14 @@ brw_texture_create( struct pipe_screen *screen, /* XXX: No tiling with compressed textures?? */ if (tex->compressed == 0 && - !bscreen->no_tiling) + !bscreen->no_tiling) { if (bscreen->chipset.is_965 && util_format_is_depth_or_stencil(template->format)) tex->tiling = BRW_TILING_Y; else tex->tiling = BRW_TILING_X; - } + } else { tex->tiling = BRW_TILING_NONE; } @@ -406,7 +406,7 @@ brw_texture_create( struct pipe_screen *screen, if (!brw_texture_layout( bscreen, tex )) goto fail; - + if (template->bind & (PIPE_BIND_SCANOUT | PIPE_BIND_SHARED)) { buffer_type = BRW_BUFFER_TYPE_SCANOUT; @@ -461,7 +461,7 @@ brw_texture_create( struct pipe_screen *screen, tex->ss.ss3.depth = tex->b.b.depth0 - 1; tex->ss.ss4.min_lod = 0; - + if (tex->b.b.target == PIPE_TEXTURE_CUBE) { tex->ss.ss0.cube_pos_x = 1; tex->ss.ss0.cube_pos_y = 1; @@ -480,7 +480,7 @@ brw_texture_create( struct pipe_screen *screen, } -struct pipe_resource * +struct pipe_resource * brw_texture_from_handle(struct pipe_screen *screen, const struct pipe_resource *template, struct winsys_handle *whandle) diff --git a/src/gallium/drivers/i965/brw_resource_texture_layout.c b/src/gallium/drivers/i965/brw_resource_texture_layout.c index 2187bdd..8d551ca 100644 --- a/src/gallium/drivers/i965/brw_resource_texture_layout.c +++ b/src/gallium/drivers/i965/brw_resource_texture_layout.c @@ -2,7 +2,7 @@ Copyright (C) Intel Corp. 2006. All Rights Reserved. Intel funded Tungsten Graphics (http://www.tungstengraphics.com) to develop this 3D driver. - + 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, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - + The above copyright notice and this permission notice (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 NONINFRINGEMENT. @@ -22,7 +22,7 @@ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - + **********************************************************************/ #include "pipe/p_format.h" @@ -37,7 +37,7 @@ /* Code to layout images in a mipmap tree for i965. */ -static int +static int brw_tex_pitch_align (struct brw_texture *tex, int pitch) { @@ -70,8 +70,8 @@ brw_tex_pitch_align (struct brw_texture *tex, } -static void -brw_tex_alignment_unit(enum pipe_format pf, +static void +brw_tex_alignment_unit(enum pipe_format pf, GLuint *w, GLuint *h) { switch (pf) { @@ -95,7 +95,7 @@ brw_tex_alignment_unit(enum pipe_format pf, } -static void +static void brw_tex_set_level_info(struct brw_texture *tex, GLuint level, GLuint nr_images, @@ -121,7 +121,7 @@ brw_tex_set_level_info(struct brw_texture *tex, static void brw_tex_set_image_offset(struct brw_texture *tex, GLuint level, GLuint img, - GLuint x, GLuint y, + GLuint x, GLuint y, GLuint offset) { assert((x == 0 && y == 0) || img != 0 || level != 0); @@ -129,7 +129,7 @@ brw_tex_set_image_offset(struct brw_texture *tex, if (BRW_DEBUG & DEBUG_TEXTURE) debug_printf("%s level %d img %d pos %d,%d image_offset %x\n", - __FUNCTION__, level, img, x, y, + __FUNCTION__, level, img, x, y, tex->image_offset[level][img]); tex->image_offset[level][img] = (x + y * tex->pitch) * tex->cpp + offset; @@ -162,10 +162,10 @@ static void brw_layout_2d( struct brw_texture *tex ) GLuint mip1_width; if (tex->compressed) { - mip1_width = (align(u_minify(tex->b.b.width0, 1), align_w) + + mip1_width = (align(u_minify(tex->b.b.width0, 1), align_w) + align(u_minify(tex->b.b.width0, 2), align_w)); } else { - mip1_width = (align(u_minify(tex->b.b.width0, 1), align_w) + + mip1_width = (align(u_minify(tex->b.b.width0, 1), align_w) + u_minify(tex->b.b.width0, 2)); } @@ -211,7 +211,7 @@ static void brw_layout_2d( struct brw_texture *tex ) } -static boolean +static boolean brw_layout_cubemap_idgng( struct brw_texture *tex ) { GLuint align_h = 2, align_w = 4; @@ -250,16 +250,16 @@ brw_layout_cubemap_idgng( struct brw_texture *tex ) tex->pitch = brw_tex_pitch_align(tex, tex->pitch); if (tex->compressed) { - qpitch = ((y_pitch + + qpitch = ((y_pitch + align(u_minify(y_pitch, 1), align_h) + 11 * align_h) / 4) * tex->pitch * tex->cpp; - tex->total_height = ((y_pitch + - align(u_minify(y_pitch, 1), align_h) + + tex->total_height = ((y_pitch + + align(u_minify(y_pitch, 1), align_h) + 11 * align_h) / 4) * 6; } else { - qpitch = (y_pitch + - align(u_minify(y_pitch, 1), align_h) + + qpitch = (y_pitch + + align(u_minify(y_pitch, 1), align_h) + 11 * align_h) * tex->pitch * tex->cpp; tex->total_height = (y_pitch + @@ -393,7 +393,7 @@ GLboolean brw_texture_layout(struct brw_screen *brw_screen, else brw_layout_3d_cube( tex ); break; - + case PIPE_TEXTURE_3D: brw_layout_3d_cube( tex ); break; diff --git a/src/gallium/drivers/i965/brw_screen.c b/src/gallium/drivers/i965/brw_screen.c index f5b75b1..f51cfed 100644 --- a/src/gallium/drivers/i965/brw_screen.c +++ b/src/gallium/drivers/i965/brw_screen.c @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ @@ -444,7 +444,7 @@ brw_screen_create(struct brw_winsys_screen *sws) break; default: - debug_printf("%s: unknown pci id 0x%x, cannot create screen\n", + debug_printf("%s: unknown pci id 0x%x, cannot create screen\n", __FUNCTION__, chipset.pci_id); return NULL; } @@ -472,7 +472,7 @@ brw_screen_create(struct brw_winsys_screen *sws) brw_init_screen_resource_functions(bscreen); bscreen->no_tiling = debug_get_option("BRW_NO_TILING", FALSE) != NULL; - - + + return &bscreen->base; } diff --git a/src/gallium/drivers/i965/brw_screen.h b/src/gallium/drivers/i965/brw_screen.h index 58e293b..0bff364 100644 --- a/src/gallium/drivers/i965/brw_screen.h +++ b/src/gallium/drivers/i965/brw_screen.h @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ #ifndef BRW_SCREEN_H diff --git a/src/gallium/drivers/i965/brw_sf.c b/src/gallium/drivers/i965/brw_sf.c index 5abf384..72c49cb 100644 --- a/src/gallium/drivers/i965/brw_sf.c +++ b/src/gallium/drivers/i965/brw_sf.c @@ -2,7 +2,7 @@ Copyright (C) Intel Corp. 2006. All Rights Reserved. Intel funded Tungsten Graphics (http://www.tungstengraphics.com) to develop this 3D driver. - + 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, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - + The above copyright notice and this permission notice (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 NONINFRINGEMENT. @@ -22,13 +22,13 @@ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - + **********************************************************************/ /* * Authors: * Keith Whitwell */ - + #include "pipe/p_state.h" #include "brw_batchbuffer.h" @@ -73,7 +73,7 @@ static enum pipe_error compile_sf_prog( struct brw_context *brw, brw_emit_null_setup( &c ); } else { - /* Which primitive? Or all three? + /* Which primitive? Or all three? */ switch (key->primitive) { case SF_TRIANGLES: @@ -163,7 +163,7 @@ static enum pipe_error upload_sf_prog(struct brw_context *brw) /* BRW_NEW_REDUCED_PRIMITIVE */ switch (brw->reduced_primitive) { - case PIPE_PRIM_TRIANGLES: + case PIPE_PRIM_TRIANGLES: /* PIPE_NEW_RAST */ if (rast->fill_front != PIPE_POLYGON_MODE_FILL || @@ -172,11 +172,11 @@ static enum pipe_error upload_sf_prog(struct brw_context *brw) else key.primitive = SF_TRIANGLES; break; - case PIPE_PRIM_LINES: - key.primitive = SF_LINES; + case PIPE_PRIM_LINES: + key.primitive = SF_LINES; break; - case PIPE_PRIM_POINTS: - key.primitive = SF_POINTS; + case PIPE_PRIM_POINTS: + key.primitive = SF_POINTS; break; } diff --git a/src/gallium/drivers/i965/brw_sf.h b/src/gallium/drivers/i965/brw_sf.h index a895c7d..6493777 100644 --- a/src/gallium/drivers/i965/brw_sf.h +++ b/src/gallium/drivers/i965/brw_sf.h @@ -2,7 +2,7 @@ Copyright (C) Intel Corp. 2006. All Rights Reserved. Intel funded Tungsten Graphics (http://www.tungstengraphics.com) to develop this 3D driver. - + 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, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - + The above copyright notice and this permission notice (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 NONINFRINGEMENT. @@ -22,13 +22,13 @@ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - + **********************************************************************/ /* * Authors: * Keith Whitwell */ - + #ifndef BRW_SF_H #define BRW_SF_H @@ -67,14 +67,14 @@ struct brw_sf_prog_key { }; struct brw_sf_point_tex { - GLboolean CoordReplace; + GLboolean CoordReplace; }; struct brw_sf_compile { struct brw_compile func; struct brw_sf_prog_key key; struct brw_sf_prog_data prog_data; - + struct brw_reg pv; struct brw_reg det; struct brw_reg dx0; @@ -86,7 +86,7 @@ struct brw_sf_compile { */ struct brw_reg z[3]; struct brw_reg inv_w[3]; - + /* The vertices: */ struct brw_reg vert[3]; @@ -111,7 +111,7 @@ struct brw_sf_compile { GLuint point_coord_replace_mask; }; - + void brw_emit_null_setup( struct brw_sf_compile *c ); void brw_emit_tri_setup( struct brw_sf_compile *c, GLboolean allocate ); void brw_emit_line_setup( struct brw_sf_compile *c, GLboolean allocate ); diff --git a/src/gallium/drivers/i965/brw_sf_emit.c b/src/gallium/drivers/i965/brw_sf_emit.c index 497634e..f161372 100644 --- a/src/gallium/drivers/i965/brw_sf_emit.c +++ b/src/gallium/drivers/i965/brw_sf_emit.c @@ -2,7 +2,7 @@ Copyright (C) Intel Corp. 2006. All Rights Reserved. Intel funded Tungsten Graphics (http://www.tungstengraphics.com) to develop this 3D driver. - + 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, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - + The above copyright notice and this permission notice (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 NONINFRINGEMENT. @@ -22,13 +22,13 @@ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - + **********************************************************************/ /* * Authors: * Keith Whitwell */ - + #include "brw_batchbuffer.h" @@ -49,7 +49,7 @@ static struct brw_reg get_vert_attr(struct brw_sf_compile *c, } -/*********************************************************************** +/*********************************************************************** * Twoside lighting */ static void copy_bfc( struct brw_sf_compile *c, @@ -58,13 +58,13 @@ static void copy_bfc( struct brw_sf_compile *c, struct brw_compile *p = &c->func; if (c->key.attr_col0 && c->key.attr_bfc0) - brw_MOV(p, - get_vert_attr(c, vert, c->key.attr_col0), + brw_MOV(p, + get_vert_attr(c, vert, c->key.attr_col0), get_vert_attr(c, vert, c->key.attr_bfc0)); if (c->key.attr_col1 && c->key.attr_bfc1) - brw_MOV(p, - get_vert_attr(c, vert, c->key.attr_col1), + brw_MOV(p, + get_vert_attr(c, vert, c->key.attr_col1), get_vert_attr(c, vert, c->key.attr_bfc1)); } @@ -87,7 +87,7 @@ static void do_twoside_color( struct brw_sf_compile *c ) if (!(c->key.attr_col0 && c->key.attr_bfc0) && !(c->key.attr_col1 && c->key.attr_bfc1)) return; - + /* Need to use BRW_EXECUTE_4 and also do an 4-wide compare in order * to get all channels active inside the IF. In the clipping code * we run with NoMask, so it's not an option and we can use @@ -95,7 +95,7 @@ static void do_twoside_color( struct brw_sf_compile *c ) */ brw_push_insn_state(p); brw_CMP(p, vec4(brw_null_reg()), backface_conditional, c->det, brw_imm_f(0)); - if_insn = brw_IF(p, BRW_EXECUTE_4); + if_insn = brw_IF(p, BRW_EXECUTE_4); { switch (c->nr_verts) { case 3: copy_bfc(c, c->vert[2]); @@ -123,13 +123,13 @@ static void copy_colors( struct brw_sf_compile *c, struct brw_compile *p = &c->func; if (c->key.attr_col0) - brw_MOV(p, - get_vert_attr(c, dst, c->key.attr_col0), + brw_MOV(p, + get_vert_attr(c, dst, c->key.attr_col0), get_vert_attr(c, src, c->key.attr_col0)); if (c->key.attr_col1) - brw_MOV(p, - get_vert_attr(c, dst, c->key.attr_col1), + brw_MOV(p, + get_vert_attr(c, dst, c->key.attr_col1), get_vert_attr(c, src, c->key.attr_col1)); } @@ -165,7 +165,7 @@ static void do_flatshade_triangle( struct brw_sf_compile *c ) jmpi = 2; brw_push_insn_state(p); - + brw_MUL(p, c->pv, c->pv, brw_imm_d(jmpi*(nr*2+1))); brw_JMPI(p, ip, ip, c->pv); @@ -182,7 +182,7 @@ static void do_flatshade_triangle( struct brw_sf_compile *c ) brw_pop_insn_state(p); } - + static void do_flatshade_line( struct brw_sf_compile *c ) { @@ -200,7 +200,7 @@ static void do_flatshade_line( struct brw_sf_compile *c ) if (nr == 0) return; - /* Already done in clip program: + /* Already done in clip program: */ if (c->key.primitive == SF_UNFILLED_TRIS) return; @@ -209,7 +209,7 @@ static void do_flatshade_line( struct brw_sf_compile *c ) jmpi = 2; brw_push_insn_state(p); - + brw_MUL(p, c->pv, c->pv, brw_imm_d(jmpi*(nr+1))); brw_JMPI(p, ip, ip, c->pv); copy_colors(c, c->vert[1], c->vert[0]); @@ -220,7 +220,7 @@ static void do_flatshade_line( struct brw_sf_compile *c ) brw_pop_insn_state(p); } - + /*********************************************************************** * Triangle setup. @@ -248,7 +248,7 @@ static void alloc_regs( struct brw_sf_compile *c ) c->inv_w[1] = brw_vec1_grf(2, 3); c->z[2] = brw_vec1_grf(2, 4); c->inv_w[2] = brw_vec1_grf(2, 5); - + /* The vertices: */ reg = 3; @@ -267,7 +267,7 @@ static void alloc_regs( struct brw_sf_compile *c ) /* Note grf allocation: */ c->prog_data.total_grf = reg; - + /* Outputs of this program - interpolation coefficients for * rasterization: @@ -284,12 +284,12 @@ static void copy_z_inv_w( struct brw_sf_compile *c ) GLuint i; brw_push_insn_state(p); - + /* Copy both scalars with a single MOV: */ for (i = 0; i < c->nr_verts; i++) brw_MOV(p, vec2(suboffset(c->vert[i], 2)), vec2(c->z[i])); - + brw_pop_insn_state(p); } @@ -299,11 +299,11 @@ static void invert_det( struct brw_sf_compile *c) /* Looks like we invert all 8 elements just to get 1/det in * position 2 !?! */ - brw_math(&c->func, - c->inv_det, + brw_math(&c->func, + c->inv_det, BRW_MATH_FUNCTION_INV, BRW_MATH_SATURATE_NONE, - 0, + 0, c->det, BRW_MATH_DATA_SCALAR, BRW_MATH_PRECISION_FULL); @@ -328,11 +328,11 @@ static GLboolean calculate_masks( struct brw_sf_compile *c, *pc_persp = 0; *pc_linear = 0; *pc = 0xf; - - if (persp_mask & (1 << (reg*2))) + + if (persp_mask & (1 << (reg*2))) *pc_persp = 0xf; - if (linear_mask & (1 << (reg*2))) + if (linear_mask & (1 << (reg*2))) *pc_linear = 0xf; /* Maybe only processs one attribute on the final round: @@ -340,10 +340,10 @@ static GLboolean calculate_masks( struct brw_sf_compile *c, if (reg*2+1 < c->nr_setup_attrs) { *pc |= 0xf0; - if (persp_mask & (1 << (reg*2+1))) + if (persp_mask & (1 << (reg*2+1))) *pc_persp |= 0xf0; - if (linear_mask & (1 << (reg*2+1))) + if (linear_mask & (1 << (reg*2+1))) *pc_linear |= 0xf0; } @@ -356,8 +356,8 @@ void brw_emit_null_setup( struct brw_sf_compile *c ) struct brw_compile *p = &c->func; /* m0 is implicitly copied from r0 in the send instruction: - */ - brw_urb_WRITE(p, + */ + brw_urb_WRITE(p, brw_null_reg(), 0, brw_vec8_grf(0, 0), /* r0, will be copied to m0 */ @@ -368,7 +368,7 @@ void brw_emit_null_setup( struct brw_sf_compile *c ) 1, /* eot */ 1, /* writes complete */ 0, /* offset */ - BRW_URB_SWIZZLE_TRANSPOSE); + BRW_URB_SWIZZLE_TRANSPOSE); } void brw_emit_tri_setup( struct brw_sf_compile *c, GLboolean allocate) @@ -384,13 +384,13 @@ void brw_emit_tri_setup( struct brw_sf_compile *c, GLboolean allocate) invert_det(c); copy_z_inv_w(c); - if (c->key.do_twoside_color) + if (c->key.do_twoside_color) do_twoside_color(c); if (c->key.do_flat_shading) do_flatshade_triangle(c); - - + + for (i = 0; i < c->nr_setup_regs; i++) { /* Pair of incoming attributes: @@ -408,10 +408,10 @@ void brw_emit_tri_setup( struct brw_sf_compile *c, GLboolean allocate) brw_MUL(p, a1, a1, c->inv_w[1]); brw_MUL(p, a2, a2, c->inv_w[2]); } - - + + /* Calculate coefficients for interpolated values: - */ + */ if (pc_linear) { brw_set_predicate_control_flag_value(p, pc_linear); @@ -424,7 +424,7 @@ void brw_emit_tri_setup( struct brw_sf_compile *c, GLboolean allocate) brw_MUL(p, brw_null_reg(), c->a1_sub_a0, c->dy2); brw_MAC(p, c->tmp, c->a2_sub_a0, negate(c->dy0)); brw_MUL(p, c->m1Cx, c->tmp, c->inv_det); - + /* calculate dA/dy */ brw_MUL(p, brw_null_reg(), c->a2_sub_a0, c->dx0); @@ -433,15 +433,15 @@ void brw_emit_tri_setup( struct brw_sf_compile *c, GLboolean allocate) } { - brw_set_predicate_control_flag_value(p, pc); + brw_set_predicate_control_flag_value(p, pc); /* start point for interpolation */ brw_MOV(p, c->m3C0, a0); - + /* Copy m0..m3 to URB. m0 is implicitly copied from r0 in * the send instruction: - */ - brw_urb_WRITE(p, + */ + brw_urb_WRITE(p, brw_null_reg(), 0, brw_vec8_grf(0, 0), /* r0, will be copied to m0 */ @@ -495,27 +495,27 @@ void brw_emit_line_setup( struct brw_sf_compile *c, GLboolean allocate) /* Calculate coefficients for position, color: */ if (pc_linear) { - brw_set_predicate_control_flag_value(p, pc_linear); + brw_set_predicate_control_flag_value(p, pc_linear); brw_ADD(p, c->a1_sub_a0, a1, negate(a0)); - brw_MUL(p, c->tmp, c->a1_sub_a0, c->dx0); + brw_MUL(p, c->tmp, c->a1_sub_a0, c->dx0); brw_MUL(p, c->m1Cx, c->tmp, c->inv_det); - + brw_MUL(p, c->tmp, c->a1_sub_a0, c->dy0); brw_MUL(p, c->m2Cy, c->tmp, c->inv_det); } { - brw_set_predicate_control_flag_value(p, pc); + brw_set_predicate_control_flag_value(p, pc); /* start point for interpolation */ brw_MOV(p, c->m3C0, a0); - /* Copy m0..m3 to URB. + /* Copy m0..m3 to URB. */ - brw_urb_WRITE(p, + brw_urb_WRITE(p, brw_null_reg(), 0, brw_vec8_grf(0, 0), @@ -526,9 +526,9 @@ void brw_emit_line_setup( struct brw_sf_compile *c, GLboolean allocate) last, /* eot */ last, /* writes complete */ i*4, /* urb destination offset */ - BRW_URB_SWIZZLE_TRANSPOSE); + BRW_URB_SWIZZLE_TRANSPOSE); } - } + } } void brw_emit_point_sprite_setup( struct brw_sf_compile *c, GLboolean allocate) @@ -552,9 +552,9 @@ void brw_emit_point_sprite_setup( struct brw_sf_compile *c, GLboolean allocate) struct brw_reg a0 = offset(c->vert[0], i); GLushort pc, pc_persp, pc_linear; GLboolean last = calculate_masks(c, i, &pc, &pc_persp, &pc_linear); - + if (pc_persp) - { + { if (coord_replace) { brw_set_predicate_control_flag_value(p, pc_persp); brw_MUL(p, a0, a0, c->inv_w[0]); @@ -577,21 +577,21 @@ void brw_emit_point_sprite_setup( struct brw_sf_compile *c, GLboolean allocate) brw_MOV(p, vec1(suboffset(c->m1Cx, 1)), brw_imm_f(0.0)); brw_MUL(p, c->m2Cy, c->tmp, negate(c->inv_w[0])); brw_MOV(p, vec1(suboffset(c->m2Cy, 0)), brw_imm_f(0.0)); - } + } else { brw_MUL(p, c->m1Cx, c->tmp, c->inv_w[0]); brw_MOV(p, vec1(suboffset(c->m1Cx, 1)), brw_imm_f(0.0)); brw_MUL(p, c->m2Cy, c->tmp, c->inv_w[0]); brw_MOV(p, vec1(suboffset(c->m2Cy, 0)), brw_imm_f(0.0)); } - } + } else { brw_MOV(p, c->m1Cx, brw_imm_ud(0)); brw_MOV(p, c->m2Cy, brw_imm_ud(0)); } { - brw_set_predicate_control_flag_value(p, pc); + brw_set_predicate_control_flag_value(p, pc); if (coord_replace) { if (c->key.sprite_origin_lower_left) { brw_MUL(p, c->m3C0, c->inv_w[0], brw_imm_f(1.0)); @@ -600,14 +600,14 @@ void brw_emit_point_sprite_setup( struct brw_sf_compile *c, GLboolean allocate) else { brw_MOV(p, c->m3C0, brw_imm_f(0.0)); } - } + } else { brw_MOV(p, c->m3C0, a0); /* constant value */ } - /* Copy m0..m3 to URB. + /* Copy m0..m3 to URB. */ - brw_urb_WRITE(p, + brw_urb_WRITE(p, brw_null_reg(), 0, brw_vec8_grf(0, 0), @@ -632,7 +632,7 @@ void brw_emit_point_setup( struct brw_sf_compile *c, GLboolean allocate) GLuint i; c->nr_verts = 1; - + if (allocate) alloc_regs(c); @@ -646,9 +646,9 @@ void brw_emit_point_setup( struct brw_sf_compile *c, GLboolean allocate) struct brw_reg a0 = offset(c->vert[0], i); GLushort pc, pc_persp, pc_linear; GLboolean last = calculate_masks(c, i, &pc, &pc_persp, &pc_linear); - + if (pc_persp) - { + { /* This seems odd as the values are all constant, but the * fragment shader will be expecting it: */ @@ -662,13 +662,13 @@ void brw_emit_point_setup( struct brw_sf_compile *c, GLboolean allocate) * code in the fragment shader. */ { - brw_set_predicate_control_flag_value(p, pc); + brw_set_predicate_control_flag_value(p, pc); brw_MOV(p, c->m3C0, a0); /* constant value */ - /* Copy m0..m3 to URB. + /* Copy m0..m3 to URB. */ - brw_urb_WRITE(p, + brw_urb_WRITE(p, brw_null_reg(), 0, brw_vec8_grf(0, 0), @@ -689,11 +689,11 @@ void brw_emit_anyprim_setup( struct brw_sf_compile *c ) struct brw_compile *p = &c->func; struct brw_reg ip = brw_ip_reg(); struct brw_reg payload_prim = brw_uw1_reg(BRW_GENERAL_REGISTER_FILE, 1, 0); - struct brw_reg payload_attr = get_element_ud(brw_vec1_reg(BRW_GENERAL_REGISTER_FILE, 1, 0), 0); + struct brw_reg payload_attr = get_element_ud(brw_vec1_reg(BRW_GENERAL_REGISTER_FILE, 1, 0), 0); struct brw_reg primmask; struct brw_instruction *jmp; struct brw_reg v1_null_ud = vec1(retype(brw_null_reg(), BRW_REGISTER_TYPE_UD)); - + GLuint saveflag; c->nr_verts = 3; @@ -715,7 +715,7 @@ void brw_emit_anyprim_setup( struct brw_sf_compile *c ) jmp = brw_JMPI(p, ip, ip, brw_imm_d(0)); { saveflag = p->flag_value; - brw_push_insn_state(p); + brw_push_insn_state(p); brw_emit_tri_setup( c, GL_FALSE ); brw_pop_insn_state(p); p->flag_value = saveflag; @@ -736,25 +736,25 @@ void brw_emit_anyprim_setup( struct brw_sf_compile *c ) jmp = brw_JMPI(p, ip, ip, brw_imm_d(0)); { saveflag = p->flag_value; - brw_push_insn_state(p); + brw_push_insn_state(p); brw_emit_line_setup( c, GL_FALSE ); brw_pop_insn_state(p); p->flag_value = saveflag; /* note - thread killed in subroutine */ } - brw_land_fwd_jump(p, jmp); + brw_land_fwd_jump(p, jmp); brw_set_conditionalmod(p, BRW_CONDITIONAL_Z); brw_AND(p, v1_null_ud, payload_attr, brw_imm_ud(1<flag_value; - brw_push_insn_state(p); + brw_push_insn_state(p); brw_emit_point_sprite_setup( c, GL_FALSE ); brw_pop_insn_state(p); p->flag_value = saveflag; } - brw_land_fwd_jump(p, jmp); + brw_land_fwd_jump(p, jmp); brw_emit_point_setup( c, GL_FALSE ); } diff --git a/src/gallium/drivers/i965/brw_sf_state.c b/src/gallium/drivers/i965/brw_sf_state.c index 6c299a8..cd81390 100644 --- a/src/gallium/drivers/i965/brw_sf_state.c +++ b/src/gallium/drivers/i965/brw_sf_state.c @@ -2,7 +2,7 @@ Copyright (C) Intel Corp. 2006. All Rights Reserved. Intel funded Tungsten Graphics (http://www.tungstengraphics.com) to develop this 3D driver. - + 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, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - + The above copyright notice and this permission notice (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 NONINFRINGEMENT. @@ -22,13 +22,13 @@ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - + **********************************************************************/ /* * Authors: * Keith Whitwell */ - + #include "util/u_math.h" #include "pipe/p_state.h" @@ -72,7 +72,7 @@ static enum pipe_error upload_sf_vp(struct brw_context *brw) const struct brw_tracked_state brw_sf_vp = { .dirty = { - .mesa = (PIPE_NEW_VIEWPORT | + .mesa = (PIPE_NEW_VIEWPORT | PIPE_NEW_SCISSOR), .brw = 0, .cache = 0 @@ -84,7 +84,7 @@ struct brw_sf_unit_key { unsigned int total_grf; unsigned int urb_entry_read_length; unsigned int nr_urb_entries, urb_size, sfsize; - + unsigned scissor:1; unsigned line_smooth:1; unsigned point_sprite:1; @@ -158,8 +158,8 @@ sf_unit_create_from_key(struct brw_context *brw, sf.thread4.nr_urb_entries = key->nr_urb_entries; sf.thread4.urb_entry_allocation_size = key->sfsize - 1; - /* Each SF thread produces 1 PUE, and there can be up to 24(Pre-IGDNG) or - * 48(IGDNG) threads + /* Each SF thread produces 1 PUE, and there can be up to 24(Pre-IGDNG) or + * 48(IGDNG) threads */ if (BRW_IS_IGDNG(brw)) chipset_max_threads = 48; @@ -265,7 +265,7 @@ sf_unit_create_from_key(struct brw_context *brw, if (ret) return ret; - + return PIPE_OK; } @@ -279,7 +279,7 @@ static enum pipe_error upload_sf_unit( struct brw_context *brw ) enum pipe_error ret; sf_unit_populate_key(brw, &key); - + /* XXX: cut this crap and pre calculate the key: */ total_grf = (align(key.total_grf, 16) / 16 - 1); diff --git a/src/gallium/drivers/i965/brw_state.h b/src/gallium/drivers/i965/brw_state.h index d2bbd01..a94f966 100644 --- a/src/gallium/drivers/i965/brw_state.h +++ b/src/gallium/drivers/i965/brw_state.h @@ -2,7 +2,7 @@ Copyright (C) Intel Corp. 2006. All Rights Reserved. Intel funded Tungsten Graphics (http://www.tungstengraphics.com) to develop this 3D driver. - + 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, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - + The above copyright notice and this permission notice (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 NONINFRINGEMENT. @@ -22,13 +22,13 @@ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - + **********************************************************************/ /* * Authors: * Keith Whitwell */ - + #ifndef BRW_STATE_H #define BRW_STATE_H @@ -159,7 +159,7 @@ void brw_destroy_batch_cache( struct brw_context *brw ); void brw_clear_batch_cache( struct brw_context *brw ); /*********************************************************************** - * brw_wm_surface_state.c + * brw_wm_surface_state.c */ /*********************************************************************** diff --git a/src/gallium/drivers/i965/brw_state_batch.c b/src/gallium/drivers/i965/brw_state_batch.c index ce5ed0a..a5e265a 100644 --- a/src/gallium/drivers/i965/brw_state_batch.c +++ b/src/gallium/drivers/i965/brw_state_batch.c @@ -2,7 +2,7 @@ Copyright (C) Intel Corp. 2006. All Rights Reserved. Intel funded Tungsten Graphics (http://www.tungstengraphics.com) to develop this 3D driver. - + 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, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - + The above copyright notice and this permission notice (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 NONINFRINGEMENT. @@ -22,13 +22,13 @@ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - + **********************************************************************/ /* * Authors: * Keith Whitwell */ - + #include "brw_state.h" diff --git a/src/gallium/drivers/i965/brw_state_cache.c b/src/gallium/drivers/i965/brw_state_cache.c index c911f39..220b37d 100644 --- a/src/gallium/drivers/i965/brw_state_cache.c +++ b/src/gallium/drivers/i965/brw_state_cache.c @@ -2,7 +2,7 @@ Copyright (C) Intel Corp. 2006. All Rights Reserved. Intel funded Tungsten Graphics (http://www.tungstengraphics.com) to develop this 3D driver. - + 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, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - + The above copyright notice and this permission notice (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 NONINFRINGEMENT. @@ -22,7 +22,7 @@ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - + **********************************************************************/ /* * Authors: @@ -176,7 +176,7 @@ brw_search_cache(struct brw_cache *cache, enum brw_cache_id cache_id, const void *key, GLuint key_size, - struct brw_winsys_reloc *relocs, + struct brw_winsys_reloc *relocs, GLuint nr_relocs, void *aux_return, struct brw_winsys_buffer **bo_out) @@ -190,13 +190,13 @@ brw_search_cache(struct brw_cache *cache, if (item) { if (aux_return) *(void **)aux_return = (void *)((char *)item->key + item->key_size); - + update_cache_last(cache, cache_id, item->bo); bo_reference(bo_out, item->bo); return TRUE; } - - return FALSE; + + return FALSE; } @@ -228,7 +228,7 @@ brw_upload_cache( struct brw_cache *cache, */ ret = cache->sws->bo_alloc(cache->sws, cache->buffer_type, - data_size, 1 << 6, + data_size, 1 << 6, bo_out); if (ret) return ret; @@ -273,7 +273,7 @@ brw_upload_cache( struct brw_cache *cache, data_size, cache_id); /* Copy data to the buffer */ - ret = cache->sws->bo_subdata(item->bo, + ret = cache->sws->bo_subdata(item->bo, cache_id, 0, data_size, data, relocs, nr_relocs); @@ -325,7 +325,7 @@ brw_cache_data_sz(struct brw_cache *cache, * If nr_relocs is nonzero, brw_search_cache()/brw_upload_cache() would be * better to use, as the potentially changing offsets in the data-used-as-key * will result in excessive cache misses. - * + * * XXX: above is no longer true -- can we remove some code? */ enum pipe_error diff --git a/src/gallium/drivers/i965/brw_state_debug.c b/src/gallium/drivers/i965/brw_state_debug.c index 049c278..19db921 100644 --- a/src/gallium/drivers/i965/brw_state_debug.c +++ b/src/gallium/drivers/i965/brw_state_debug.c @@ -2,7 +2,7 @@ Copyright (C) Intel Corp. 2006. All Rights Reserved. Intel funded Tungsten Graphics (http://www.tungstengraphics.com) to develop this 3D driver. - + 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, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - + The above copyright notice and this permission notice (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 NONINFRINGEMENT. @@ -22,9 +22,9 @@ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - + **********************************************************************/ - + #include "brw_context.h" diff --git a/src/gallium/drivers/i965/brw_state_upload.c b/src/gallium/drivers/i965/brw_state_upload.c index f8b91ef..5b2ba93 100644 --- a/src/gallium/drivers/i965/brw_state_upload.c +++ b/src/gallium/drivers/i965/brw_state_upload.c @@ -2,7 +2,7 @@ Copyright (C) Intel Corp. 2006. All Rights Reserved. Intel funded Tungsten Graphics (http://www.tungstengraphics.com) to develop this 3D driver. - + 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, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - + The above copyright notice and this permission notice (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 NONINFRINGEMENT. @@ -22,13 +22,13 @@ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - + **********************************************************************/ /* * Authors: * Keith Whitwell */ - + #include "brw_context.h" @@ -40,8 +40,8 @@ const struct brw_tracked_state *atoms[] = { /* &brw_wm_input_sizes, */ &brw_vs_prog, - &brw_gs_prog, - &brw_clip_prog, + &brw_gs_prog, + &brw_clip_prog, &brw_sf_prog, &brw_wm_prog, @@ -65,7 +65,7 @@ const struct brw_tracked_state *atoms[] = &brw_sf_unit, &brw_vs_unit, /* always required, enabled or not */ &brw_clip_unit, - &brw_gs_unit, + &brw_gs_unit, /* Command packets: */ @@ -212,7 +212,7 @@ enum pipe_error brw_upload_state(struct brw_context *brw) * state flags which are generated and checked to help ensure * state atoms are ordered correctly in the list. */ - struct brw_state_flags examined, prev; + struct brw_state_flags examined, prev; memset(&examined, 0, sizeof(examined)); prev = *state; @@ -244,7 +244,7 @@ enum pipe_error brw_upload_state(struct brw_context *brw) } } else { - for (i = 0; i < Elements(atoms); i++) { + for (i = 0; i < Elements(atoms); i++) { const struct brw_tracked_state *atom = atoms[i]; if (check_state(state, &atom->dirty)) { @@ -258,11 +258,11 @@ enum pipe_error brw_upload_state(struct brw_context *brw) } if (BRW_DEBUG & DEBUG_STATE) { - brw_update_dirty_counts( state->mesa, + brw_update_dirty_counts( state->mesa, state->brw, state->cache ); } - + /* Clear dirty flags: */ memset(state, 0, sizeof(*state)); diff --git a/src/gallium/drivers/i965/brw_structs.h b/src/gallium/drivers/i965/brw_structs.h index e97ddeb..5d459af 100644 --- a/src/gallium/drivers/i965/brw_structs.h +++ b/src/gallium/drivers/i965/brw_structs.h @@ -2,7 +2,7 @@ Copyright (C) Intel Corp. 2006. All Rights Reserved. Intel funded Tungsten Graphics (http://www.tungstengraphics.com) to develop this 3D driver. - + 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, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - + The above copyright notice and this permission notice (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 NONINFRINGEMENT. @@ -22,7 +22,7 @@ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - + **********************************************************************/ /* * Authors: @@ -44,10 +44,10 @@ /* Command packets: */ -struct header +struct header { - GLuint length:16; - GLuint opcode:16; + GLuint length:16; + GLuint opcode:16; }; @@ -58,27 +58,27 @@ union header_union }; struct brw_3d_control -{ - struct +{ + struct { GLuint length:8; GLuint notify_enable:1; GLuint pad:3; - GLuint wc_flush_enable:1; - GLuint depth_stall_enable:1; - GLuint operation:2; - GLuint opcode:16; + GLuint wc_flush_enable:1; + GLuint depth_stall_enable:1; + GLuint operation:2; + GLuint opcode:16; } header; - + struct { GLuint pad:2; - GLuint dest_addr_type:1; - GLuint dest_addr:29; + GLuint dest_addr_type:1; + GLuint dest_addr:29; } dest; - - GLuint dword2; - GLuint dword3; + + GLuint dword2; + GLuint dword3; }; @@ -86,18 +86,18 @@ struct brw_3d_primitive { struct { - GLuint length:8; + GLuint length:8; GLuint pad:2; - GLuint topology:5; - GLuint indexed:1; - GLuint opcode:16; + GLuint topology:5; + GLuint indexed:1; + GLuint opcode:16; } header; - GLuint verts_per_instance; - GLuint start_vert_location; - GLuint instance_count; - GLuint start_instance_location; - GLuint base_vert_location; + GLuint verts_per_instance; + GLuint start_vert_location; + GLuint instance_count; + GLuint start_instance_location; + GLuint base_vert_location; }; /* These seem to be passed around as function args, so it works out @@ -127,49 +127,49 @@ struct brw_vf_statistics struct brw_binding_table_pointers { struct header header; - GLuint vs; - GLuint gs; - GLuint clp; - GLuint sf; - GLuint wm; + GLuint vs; + GLuint gs; + GLuint clp; + GLuint sf; + GLuint wm; }; struct brw_blend_constant_color { struct header header; - GLfloat blend_constant_color[4]; + GLfloat blend_constant_color[4]; }; struct brw_depthbuffer { union header_union header; - + union { struct { - GLuint pitch:18; - GLuint format:3; + GLuint pitch:18; + GLuint format:3; GLuint pad:2; GLuint software_tiled_rendering_mode:2; - GLuint depth_offset_disable:1; - GLuint tile_walk:1; - GLuint tiled_surface:1; + GLuint depth_offset_disable:1; + GLuint tile_walk:1; + GLuint tiled_surface:1; GLuint pad2:1; - GLuint surface_type:3; + GLuint surface_type:3; } bits; GLuint dword; } dword1; - - GLuint dword2_base_addr; - + + GLuint dword2_base_addr; + union { struct { GLuint pad:1; - GLuint mipmap_layout:1; - GLuint lod:4; - GLuint width:13; - GLuint height:13; + GLuint mipmap_layout:1; + GLuint lod:4; + GLuint width:13; + GLuint height:13; } bits; GLuint dword; } dword3; @@ -177,8 +177,8 @@ struct brw_depthbuffer union { struct { GLuint pad:10; - GLuint min_array_element:11; - GLuint depth:11; + GLuint min_array_element:11; + GLuint depth:11; } bits; GLuint dword; } dword4; @@ -187,31 +187,31 @@ struct brw_depthbuffer struct brw_depthbuffer_g4x { union header_union header; - + union { struct { - GLuint pitch:18; - GLuint format:3; + GLuint pitch:18; + GLuint format:3; GLuint pad:2; GLuint software_tiled_rendering_mode:2; - GLuint depth_offset_disable:1; - GLuint tile_walk:1; - GLuint tiled_surface:1; + GLuint depth_offset_disable:1; + GLuint tile_walk:1; + GLuint tiled_surface:1; GLuint pad2:1; - GLuint surface_type:3; + GLuint surface_type:3; } bits; GLuint dword; } dword1; - - GLuint dword2_base_addr; - + + GLuint dword2_base_addr; + union { struct { GLuint pad:1; - GLuint mipmap_layout:1; - GLuint lod:4; - GLuint width:13; - GLuint height:13; + GLuint mipmap_layout:1; + GLuint lod:4; + GLuint width:13; + GLuint height:13; } bits; GLuint dword; } dword3; @@ -219,8 +219,8 @@ struct brw_depthbuffer_g4x union { struct { GLuint pad:10; - GLuint min_array_element:11; - GLuint depth:11; + GLuint min_array_element:11; + GLuint depth:11; } bits; GLuint dword; } dword4; @@ -237,12 +237,12 @@ struct brw_depthbuffer_g4x struct brw_drawrect { struct header header; - GLuint xmin:16; - GLuint ymin:16; - GLuint xmax:16; - GLuint ymax:16; - GLuint xorg:16; - GLuint yorg:16; + GLuint xmin:16; + GLuint ymin:16; + GLuint xmax:16; + GLuint ymax:16; + GLuint xorg:16; + GLuint yorg:16; }; @@ -251,26 +251,26 @@ struct brw_drawrect struct brw_global_depth_offset_clamp { struct header header; - GLfloat depth_offset_clamp; + GLfloat depth_offset_clamp; }; struct brw_indexbuffer -{ +{ union { struct { - GLuint length:8; - GLuint index_format:2; - GLuint cut_index_enable:1; - GLuint pad:5; - GLuint opcode:16; + GLuint length:8; + GLuint index_format:2; + GLuint cut_index_enable:1; + GLuint pad:5; + GLuint opcode:16; } bits; GLuint dword; } header; - GLuint buffer_start; - GLuint buffer_end; + GLuint buffer_start; + GLuint buffer_end; }; /* NEW in Integrated Graphics Device */ @@ -294,20 +294,20 @@ struct brw_aa_line_parameters }; struct brw_line_stipple -{ +{ struct header header; - + struct { - GLuint pattern:16; + GLuint pattern:16; GLuint pad:16; } bits0; - + struct { - GLuint repeat_count:9; + GLuint repeat_count:9; GLuint pad:7; - GLuint inverse_repeat_count:16; + GLuint inverse_repeat_count:16; } bits1; }; @@ -315,26 +315,26 @@ struct brw_line_stipple struct brw_pipelined_state_pointers { struct header header; - + struct { GLuint pad:5; GLuint offset:27; /* Offset from GENERAL_STATE_BASE */ } vs; - + struct { GLuint enable:1; GLuint pad:4; GLuint offset:27; /* Offset from GENERAL_STATE_BASE */ } gs; - + struct { GLuint enable:1; GLuint pad:4; GLuint offset:27; /* Offset from GENERAL_STATE_BASE */ } clp; - + struct { GLuint pad:5; @@ -346,7 +346,7 @@ struct brw_pipelined_state_pointers GLuint pad:5; GLuint offset:27; /* Offset from GENERAL_STATE_BASE */ } wm; - + struct { GLuint pad:5; @@ -360,9 +360,9 @@ struct brw_polygon_stipple_offset struct header header; struct { - GLuint y_offset:5; + GLuint y_offset:5; GLuint pad:3; - GLuint x_offset:5; + GLuint x_offset:5; GLuint pad0:19; } bits0; }; @@ -381,9 +381,9 @@ struct brw_pipeline_select { struct { - GLuint pipeline_select:1; + GLuint pipeline_select:1; GLuint pad:15; - GLuint opcode:16; + GLuint opcode:16; } header; }; @@ -420,30 +420,30 @@ struct brw_urb_fence { struct { - GLuint length:8; - GLuint vs_realloc:1; - GLuint gs_realloc:1; - GLuint clp_realloc:1; - GLuint sf_realloc:1; - GLuint vfe_realloc:1; - GLuint cs_realloc:1; + GLuint length:8; + GLuint vs_realloc:1; + GLuint gs_realloc:1; + GLuint clp_realloc:1; + GLuint sf_realloc:1; + GLuint vfe_realloc:1; + GLuint cs_realloc:1; GLuint pad:2; - GLuint opcode:16; + GLuint opcode:16; } header; struct { - GLuint vs_fence:10; - GLuint gs_fence:10; - GLuint clp_fence:10; + GLuint vs_fence:10; + GLuint gs_fence:10; + GLuint clp_fence:10; GLuint pad:2; } bits0; struct { - GLuint sf_fence:10; - GLuint vf_fence:10; - GLuint cs_fence:11; + GLuint sf_fence:10; + GLuint vf_fence:10; + GLuint cs_fence:11; GLuint pad:1; } bits1; }; @@ -454,9 +454,9 @@ struct brw_cs_urb_state struct { - GLuint nr_urb_entries:3; + GLuint nr_urb_entries:3; GLuint pad:1; - GLuint urb_entry_size:5; + GLuint urb_entry_size:5; GLuint pad0:23; } bits0; }; @@ -465,16 +465,16 @@ struct brw_constant_buffer { struct { - GLuint length:8; - GLuint valid:1; + GLuint length:8; + GLuint valid:1; GLuint pad:7; - GLuint opcode:16; + GLuint opcode:16; } header; struct { - GLuint buffer_length:6; - GLuint buffer_address:26; + GLuint buffer_length:6; + GLuint buffer_address:26; } bits0; }; @@ -486,35 +486,35 @@ struct brw_state_base_address { GLuint modify_enable:1; GLuint pad:4; - GLuint general_state_address:27; + GLuint general_state_address:27; } bits0; struct { GLuint modify_enable:1; GLuint pad:4; - GLuint surface_state_address:27; + GLuint surface_state_address:27; } bits1; struct { GLuint modify_enable:1; GLuint pad:4; - GLuint indirect_object_state_address:27; + GLuint indirect_object_state_address:27; } bits2; struct { GLuint modify_enable:1; GLuint pad:11; - GLuint general_state_upper_bound:20; + GLuint general_state_upper_bound:20; } bits3; struct { GLuint modify_enable:1; GLuint pad:11; - GLuint indirect_object_state_upper_bound:20; + GLuint indirect_object_state_upper_bound:20; } bits4; }; @@ -524,9 +524,9 @@ struct brw_state_prefetch struct { - GLuint prefetch_count:3; + GLuint prefetch_count:3; GLuint pad:3; - GLuint prefetch_pointer:26; + GLuint prefetch_pointer:26; } bits0; }; @@ -537,7 +537,7 @@ struct brw_system_instruction_pointer struct { GLuint pad:4; - GLuint system_instruction_pointer:28; + GLuint system_instruction_pointer:28; } bits0; }; @@ -551,46 +551,46 @@ struct brw_system_instruction_pointer struct thread0 { GLuint pad0:1; - GLuint grf_reg_count:3; + GLuint grf_reg_count:3; GLuint pad1:2; GLuint kernel_start_pointer:26; /* Offset from GENERAL_STATE_BASE */ }; struct thread1 { - GLuint ext_halt_exception_enable:1; - GLuint sw_exception_enable:1; - GLuint mask_stack_exception_enable:1; - GLuint timeout_exception_enable:1; - GLuint illegal_op_exception_enable:1; + GLuint ext_halt_exception_enable:1; + GLuint sw_exception_enable:1; + GLuint mask_stack_exception_enable:1; + GLuint timeout_exception_enable:1; + GLuint illegal_op_exception_enable:1; GLuint pad0:3; GLuint depth_coef_urb_read_offset:6; /* WM only */ GLuint pad1:2; - GLuint floating_point_mode:1; - GLuint thread_priority:1; - GLuint binding_table_entry_count:8; + GLuint floating_point_mode:1; + GLuint thread_priority:1; + GLuint binding_table_entry_count:8; GLuint pad3:5; - GLuint single_program_flow:1; + GLuint single_program_flow:1; }; struct thread2 { - GLuint per_thread_scratch_space:4; + GLuint per_thread_scratch_space:4; GLuint pad0:6; - GLuint scratch_space_base_pointer:22; + GLuint scratch_space_base_pointer:22; }; - + struct thread3 { - GLuint dispatch_grf_start_reg:4; - GLuint urb_entry_read_offset:6; + GLuint dispatch_grf_start_reg:4; + GLuint urb_entry_read_offset:6; GLuint pad0:1; - GLuint urb_entry_read_length:6; + GLuint urb_entry_read_length:6; GLuint pad1:1; - GLuint const_urb_entry_read_offset:6; + GLuint const_urb_entry_read_offset:6; GLuint pad2:1; - GLuint const_urb_entry_read_length:6; + GLuint const_urb_entry_read_length:6; GLuint pad3:1; }; @@ -622,41 +622,41 @@ struct brw_clip_unit_state { GLuint pad0:9; GLuint gs_output_stats:1; /* not always */ - GLuint stats_enable:1; - GLuint nr_urb_entries:7; + GLuint stats_enable:1; + GLuint nr_urb_entries:7; GLuint pad1:1; - GLuint urb_entry_allocation_size:5; + GLuint urb_entry_allocation_size:5; GLuint pad2:1; GLuint max_threads:5; /* may be less */ GLuint pad3:2; - } thread4; - + } thread4; + struct { GLuint pad0:13; - GLuint clip_mode:3; - GLuint userclip_enable_flags:8; - GLuint userclip_must_clip:1; + GLuint clip_mode:3; + GLuint userclip_enable_flags:8; + GLuint userclip_must_clip:1; GLuint negative_w_clip_test:1; - GLuint guard_band_enable:1; - GLuint viewport_z_clip_enable:1; - GLuint viewport_xy_clip_enable:1; - GLuint vertex_position_space:1; - GLuint api_mode:1; + GLuint guard_band_enable:1; + GLuint viewport_z_clip_enable:1; + GLuint viewport_xy_clip_enable:1; + GLuint vertex_position_space:1; + GLuint api_mode:1; GLuint pad2:1; } clip5; - + struct { GLuint pad0:5; - GLuint clipper_viewport_state_ptr:27; + GLuint clipper_viewport_state_ptr:27; } clip6; - - GLfloat viewport_xmin; - GLfloat viewport_xmax; - GLfloat viewport_ymin; - GLfloat viewport_ymax; + + GLfloat viewport_xmin; + GLfloat viewport_xmax; + GLfloat viewport_ymin; + GLfloat viewport_ymax; }; @@ -666,88 +666,88 @@ struct brw_cc_unit_state struct brw_cc0 { GLuint pad0:3; - GLuint bf_stencil_pass_depth_pass_op:3; - GLuint bf_stencil_pass_depth_fail_op:3; - GLuint bf_stencil_fail_op:3; - GLuint bf_stencil_func:3; - GLuint bf_stencil_enable:1; + GLuint bf_stencil_pass_depth_pass_op:3; + GLuint bf_stencil_pass_depth_fail_op:3; + GLuint bf_stencil_fail_op:3; + GLuint bf_stencil_func:3; + GLuint bf_stencil_enable:1; GLuint pad1:2; - GLuint stencil_write_enable:1; - GLuint stencil_pass_depth_pass_op:3; - GLuint stencil_pass_depth_fail_op:3; - GLuint stencil_fail_op:3; - GLuint stencil_func:3; - GLuint stencil_enable:1; + GLuint stencil_write_enable:1; + GLuint stencil_pass_depth_pass_op:3; + GLuint stencil_pass_depth_fail_op:3; + GLuint stencil_fail_op:3; + GLuint stencil_func:3; + GLuint stencil_enable:1; } cc0; - + struct brw_cc1 { - GLuint bf_stencil_ref:8; - GLuint stencil_write_mask:8; - GLuint stencil_test_mask:8; - GLuint stencil_ref:8; + GLuint bf_stencil_ref:8; + GLuint stencil_write_mask:8; + GLuint stencil_test_mask:8; + GLuint stencil_ref:8; } cc1; - + struct brw_cc2 { - GLuint logicop_enable:1; + GLuint logicop_enable:1; GLuint pad0:10; - GLuint depth_write_enable:1; - GLuint depth_test_function:3; - GLuint depth_test:1; - GLuint bf_stencil_write_mask:8; - GLuint bf_stencil_test_mask:8; + GLuint depth_write_enable:1; + GLuint depth_test_function:3; + GLuint depth_test:1; + GLuint bf_stencil_write_mask:8; + GLuint bf_stencil_test_mask:8; } cc2; - + struct brw_cc3 { GLuint pad0:8; - GLuint alpha_test_func:3; - GLuint alpha_test:1; - GLuint blend_enable:1; - GLuint ia_blend_enable:1; + GLuint alpha_test_func:3; + GLuint alpha_test:1; + GLuint blend_enable:1; + GLuint ia_blend_enable:1; GLuint pad1:1; GLuint alpha_test_format:1; GLuint pad2:16; } cc3; - + struct brw_cc4 { - GLuint pad0:5; + GLuint pad0:5; GLuint cc_viewport_state_offset:27; /* Offset from GENERAL_STATE_BASE */ } cc4; - + struct brw_cc5 { GLuint pad0:2; - GLuint ia_dest_blend_factor:5; - GLuint ia_src_blend_factor:5; - GLuint ia_blend_function:3; - GLuint statistics_enable:1; - GLuint logicop_func:4; + GLuint ia_dest_blend_factor:5; + GLuint ia_src_blend_factor:5; + GLuint ia_blend_function:3; + GLuint statistics_enable:1; + GLuint logicop_func:4; GLuint pad1:11; - GLuint dither_enable:1; + GLuint dither_enable:1; } cc5; struct brw_cc6 { - GLuint clamp_post_alpha_blend:1; - GLuint clamp_pre_alpha_blend:1; - GLuint clamp_range:2; + GLuint clamp_post_alpha_blend:1; + GLuint clamp_pre_alpha_blend:1; + GLuint clamp_range:2; GLuint pad0:11; - GLuint y_dither_offset:2; - GLuint x_dither_offset:2; - GLuint dest_blend_factor:5; - GLuint src_blend_factor:5; - GLuint blend_function:3; + GLuint y_dither_offset:2; + GLuint x_dither_offset:2; + GLuint dest_blend_factor:5; + GLuint src_blend_factor:5; + GLuint blend_function:3; } cc6; struct brw_cc7 { union { - GLfloat f; + GLfloat f; GLubyte ub[4]; } alpha_ref; } cc7; @@ -765,51 +765,51 @@ struct brw_sf_unit_state struct { GLuint pad0:10; - GLuint stats_enable:1; - GLuint nr_urb_entries:7; + GLuint stats_enable:1; + GLuint nr_urb_entries:7; GLuint pad1:1; - GLuint urb_entry_allocation_size:5; + GLuint urb_entry_allocation_size:5; GLuint pad2:1; - GLuint max_threads:6; + GLuint max_threads:6; GLuint pad3:1; - } thread4; + } thread4; struct { - GLuint front_winding:1; - GLuint viewport_transform:1; + GLuint front_winding:1; + GLuint viewport_transform:1; GLuint pad0:3; GLuint sf_viewport_state_offset:27; /* Offset from GENERAL_STATE_BASE */ } sf5; - + struct { GLuint pad0:9; - GLuint dest_org_vbias:4; - GLuint dest_org_hbias:4; - GLuint scissor:1; - GLuint disable_2x2_trifilter:1; - GLuint disable_zero_pix_trifilter:1; - GLuint point_rast_rule:2; - GLuint line_endcap_aa_region_width:2; - GLuint line_width:4; - GLuint fast_scissor_disable:1; - GLuint cull_mode:2; - GLuint aa_enable:1; + GLuint dest_org_vbias:4; + GLuint dest_org_hbias:4; + GLuint scissor:1; + GLuint disable_2x2_trifilter:1; + GLuint disable_zero_pix_trifilter:1; + GLuint point_rast_rule:2; + GLuint line_endcap_aa_region_width:2; + GLuint line_width:4; + GLuint fast_scissor_disable:1; + GLuint cull_mode:2; + GLuint aa_enable:1; } sf6; struct { - GLuint point_size:11; - GLuint use_point_size_state:1; - GLuint subpixel_precision:1; - GLuint sprite_point:1; + GLuint point_size:11; + GLuint use_point_size_state:1; + GLuint subpixel_precision:1; + GLuint sprite_point:1; GLuint pad0:10; GLuint aa_line_distance_mode:1; - GLuint trifan_pv:2; - GLuint linestrip_pv:2; - GLuint tristrip_pv:2; - GLuint line_last_pixel_enable:1; + GLuint trifan_pv:2; + GLuint linestrip_pv:2; + GLuint tristrip_pv:2; + GLuint line_last_pixel_enable:1; } sf7; }; @@ -827,33 +827,33 @@ struct brw_gs_unit_state GLuint pad0:8; GLuint rendering_enable:1; /* for IGDNG */ GLuint pad4:1; - GLuint stats_enable:1; - GLuint nr_urb_entries:7; + GLuint stats_enable:1; + GLuint nr_urb_entries:7; GLuint pad1:1; - GLuint urb_entry_allocation_size:5; + GLuint urb_entry_allocation_size:5; GLuint pad2:1; - GLuint max_threads:5; + GLuint max_threads:5; GLuint pad3:2; - } thread4; - + } thread4; + struct { - GLuint sampler_count:3; + GLuint sampler_count:3; GLuint pad0:2; - GLuint sampler_state_pointer:27; + GLuint sampler_state_pointer:27; } gs5; - + struct { - GLuint max_vp_index:4; + GLuint max_vp_index:4; GLuint pad0:12; GLuint svbi_post_inc_value:10; GLuint pad1:1; GLuint svbi_post_inc_enable:1; GLuint svbi_payload:1; GLuint discard_adjaceny:1; - GLuint reorder_enable:1; + GLuint reorder_enable:1; GLuint pad2:1; } gs6; }; @@ -865,30 +865,30 @@ struct brw_vs_unit_state struct thread1 thread1; struct thread2 thread2; struct thread3 thread3; - + struct { GLuint pad0:10; - GLuint stats_enable:1; - GLuint nr_urb_entries:7; + GLuint stats_enable:1; + GLuint nr_urb_entries:7; GLuint pad1:1; - GLuint urb_entry_allocation_size:5; + GLuint urb_entry_allocation_size:5; GLuint pad2:1; - GLuint max_threads:6; + GLuint max_threads:6; GLuint pad3:1; - } thread4; + } thread4; struct { - GLuint sampler_count:3; + GLuint sampler_count:3; GLuint pad0:2; - GLuint sampler_state_pointer:27; + GLuint sampler_state_pointer:27; } vs5; struct { - GLuint vs_enable:1; - GLuint vert_cache_disable:1; + GLuint vs_enable:1; + GLuint vert_cache_disable:1; GLuint pad0:30; } vs6; }; @@ -900,62 +900,62 @@ struct brw_wm_unit_state struct thread1 thread1; struct thread2 thread2; struct thread3 thread3; - + struct { - GLuint stats_enable:1; + GLuint stats_enable:1; GLuint depth_buffer_clear:1; - GLuint sampler_count:3; - GLuint sampler_state_pointer:27; + GLuint sampler_count:3; + GLuint sampler_state_pointer:27; } wm4; - + struct { - GLuint enable_8_pix:1; - GLuint enable_16_pix:1; - GLuint enable_32_pix:1; + GLuint enable_8_pix:1; + GLuint enable_16_pix:1; + GLuint enable_32_pix:1; GLuint enable_con_32_pix:1; GLuint enable_con_64_pix:1; GLuint pad0:5; - GLuint legacy_global_depth_bias:1; - GLuint line_stipple:1; - GLuint depth_offset:1; - GLuint polygon_stipple:1; - GLuint line_aa_region_width:2; - GLuint line_endcap_aa_region_width:2; - GLuint early_depth_test:1; - GLuint thread_dispatch_enable:1; - GLuint program_uses_depth:1; - GLuint program_computes_depth:1; - GLuint program_uses_killpixel:1; - GLuint legacy_line_rast: 1; - GLuint transposed_urb_read_enable:1; - GLuint max_threads:7; + GLuint legacy_global_depth_bias:1; + GLuint line_stipple:1; + GLuint depth_offset:1; + GLuint polygon_stipple:1; + GLuint line_aa_region_width:2; + GLuint line_endcap_aa_region_width:2; + GLuint early_depth_test:1; + GLuint thread_dispatch_enable:1; + GLuint program_uses_depth:1; + GLuint program_computes_depth:1; + GLuint program_uses_killpixel:1; + GLuint legacy_line_rast: 1; + GLuint transposed_urb_read_enable:1; + GLuint max_threads:7; } wm5; - - GLfloat global_depth_offset_constant; - GLfloat global_depth_offset_scale; - + + GLfloat global_depth_offset_constant; + GLfloat global_depth_offset_scale; + /* for IGDNG only */ struct { GLuint pad0:1; - GLuint grf_reg_count_1:3; + GLuint grf_reg_count_1:3; GLuint pad1:2; GLuint kernel_start_pointer_1:26; - } wm8; + } wm8; struct { GLuint pad0:1; - GLuint grf_reg_count_2:3; + GLuint grf_reg_count_2:3; GLuint pad1:2; GLuint kernel_start_pointer_2:26; - } wm9; + } wm9; struct { GLuint pad0:1; - GLuint grf_reg_count_3:3; + GLuint grf_reg_count_3:3; GLuint pad1:2; GLuint kernel_start_pointer_3:26; - } wm10; + } wm10; }; struct brw_sampler_default_color { @@ -964,75 +964,75 @@ struct brw_sampler_default_color { struct brw_sampler_state { - + struct brw_ss0 { - GLuint shadow_function:3; - GLuint lod_bias:11; - GLuint min_filter:3; - GLuint mag_filter:3; - GLuint mip_filter:2; - GLuint base_level:5; + GLuint shadow_function:3; + GLuint lod_bias:11; + GLuint min_filter:3; + GLuint mag_filter:3; + GLuint mip_filter:2; + GLuint base_level:5; GLuint pad:1; - GLuint lod_preclamp:1; - GLuint default_color_mode:1; + GLuint lod_preclamp:1; + GLuint default_color_mode:1; GLuint pad0:1; - GLuint disable:1; + GLuint disable:1; } ss0; struct brw_ss1 { - GLuint r_wrap_mode:3; - GLuint t_wrap_mode:3; - GLuint s_wrap_mode:3; + GLuint r_wrap_mode:3; + GLuint t_wrap_mode:3; + GLuint s_wrap_mode:3; GLuint pad:3; - GLuint max_lod:10; - GLuint min_lod:10; + GLuint max_lod:10; + GLuint min_lod:10; } ss1; - + struct brw_ss2 { GLuint pad:5; - GLuint default_color_pointer:27; + GLuint default_color_pointer:27; } ss2; - + struct brw_ss3 { GLuint pad:19; - GLuint max_aniso:3; - GLuint chroma_key_mode:1; - GLuint chroma_key_index:2; - GLuint chroma_key_enable:1; - GLuint monochrome_filter_width:3; - GLuint monochrome_filter_height:3; + GLuint max_aniso:3; + GLuint chroma_key_mode:1; + GLuint chroma_key_index:2; + GLuint chroma_key_enable:1; + GLuint monochrome_filter_width:3; + GLuint monochrome_filter_height:3; } ss3; }; struct brw_clipper_viewport { - GLfloat xmin; - GLfloat xmax; - GLfloat ymin; - GLfloat ymax; + GLfloat xmin; + GLfloat xmax; + GLfloat ymin; + GLfloat ymax; }; struct brw_cc_viewport { - GLfloat min_depth; - GLfloat max_depth; + GLfloat min_depth; + GLfloat max_depth; }; struct brw_sf_viewport { struct { - GLfloat m00; - GLfloat m11; - GLfloat m22; - GLfloat m30; - GLfloat m31; - GLfloat m32; + GLfloat m00; + GLfloat m11; + GLfloat m22; + GLfloat m30; + GLfloat m31; + GLfloat m32; } viewport; /* scissor coordinates are inclusive */ @@ -1049,46 +1049,46 @@ struct brw_sf_viewport struct brw_surface_state { struct brw_surf_ss0 { - GLuint cube_pos_z:1; - GLuint cube_neg_z:1; - GLuint cube_pos_y:1; - GLuint cube_neg_y:1; - GLuint cube_pos_x:1; - GLuint cube_neg_x:1; + GLuint cube_pos_z:1; + GLuint cube_neg_z:1; + GLuint cube_pos_y:1; + GLuint cube_neg_y:1; + GLuint cube_pos_x:1; + GLuint cube_neg_x:1; GLuint pad:4; - GLuint mipmap_layout_mode:1; - GLuint vert_line_stride_ofs:1; - GLuint vert_line_stride:1; - GLuint color_blend:1; - GLuint writedisable_blue:1; - GLuint writedisable_green:1; - GLuint writedisable_red:1; - GLuint writedisable_alpha:1; + GLuint mipmap_layout_mode:1; + GLuint vert_line_stride_ofs:1; + GLuint vert_line_stride:1; + GLuint color_blend:1; + GLuint writedisable_blue:1; + GLuint writedisable_green:1; + GLuint writedisable_red:1; + GLuint writedisable_alpha:1; GLuint surface_format:9; /**< BRW_SURFACEFORMAT_x */ - GLuint data_return_format:1; + GLuint data_return_format:1; GLuint pad0:1; GLuint surface_type:3; /**< BRW_SURFACE_1D/2D/3D/CUBE */ } ss0; - + struct brw_surf_ss1 { - GLuint base_addr; + GLuint base_addr; } ss1; - + struct brw_surf_ss2 { GLuint pad:2; - GLuint mip_count:4; - GLuint width:13; - GLuint height:13; + GLuint mip_count:4; + GLuint width:13; + GLuint height:13; } ss2; struct brw_surf_ss3 { - GLuint tile_walk:1; - GLuint tiled_surface:1; - GLuint pad:1; - GLuint pitch:18; - GLuint depth:11; + GLuint tile_walk:1; + GLuint tiled_surface:1; + GLuint pad:1; + GLuint pitch:18; + GLuint depth:11; } ss3; - + struct brw_surf_ss4 { GLuint multisample_position_palette_index:3; GLuint pad1:1; @@ -1096,7 +1096,7 @@ struct brw_surface_state GLuint pad0:1; GLuint render_target_view_extent:9; GLuint min_array_elt:11; - GLuint min_lod:4; + GLuint min_lod:4; } ss4; struct brw_surf_ss5 { @@ -1117,14 +1117,14 @@ struct brw_surface_state struct brw_vertex_buffer_state { struct { - GLuint pitch:11; + GLuint pitch:11; GLuint pad:15; - GLuint access_type:1; - GLuint vb_index:5; + GLuint access_type:1; + GLuint vb_index:5; } vb0; - - GLuint start_addr; - GLuint max_index; + + GLuint start_addr; + GLuint max_index; #if 1 GLuint instance_data_step_rate; /* not included for sequential/random vertices? */ #endif @@ -1142,22 +1142,22 @@ struct brw_vertex_element_state { struct { - GLuint src_offset:11; + GLuint src_offset:11; GLuint pad:5; - GLuint src_format:9; + GLuint src_format:9; GLuint pad0:1; - GLuint valid:1; - GLuint vertex_buffer_index:5; + GLuint valid:1; + GLuint vertex_buffer_index:5; } ve0; struct { - GLuint dst_offset:8; + GLuint dst_offset:8; GLuint pad:8; - GLuint vfcomponent3:4; - GLuint vfcomponent2:4; - GLuint vfcomponent1:4; - GLuint vfcomponent0:4; + GLuint vfcomponent3:4; + GLuint vfcomponent2:4; + GLuint vfcomponent1:4; + GLuint vfcomponent0:4; } ve1; }; @@ -1172,7 +1172,7 @@ struct brw_vertex_element_packet { struct brw_urb_immediate { GLuint opcode:4; GLuint offset:6; - GLuint swizzle_control:2; + GLuint swizzle_control:2; GLuint pad:1; GLuint allocate:1; GLuint used:1; @@ -1186,10 +1186,10 @@ struct brw_urb_immediate { /* Instruction format for the execution units: */ - + struct brw_instruction { - struct + struct { GLuint opcode:7; GLuint pad:1; @@ -1296,7 +1296,7 @@ struct brw_instruction GLuint src0_width:3; GLuint src0_vert_stride:4; GLuint flag_reg_nr:1; - GLuint pad:6; + GLuint pad:6; } ia1; struct @@ -1333,7 +1333,7 @@ struct brw_instruction GLuint pad1:6; } ia16; - struct + struct { GLuint pad:26; GLuint end_of_thread:1; @@ -1385,7 +1385,7 @@ struct brw_instruction GLuint src1_width:3; GLuint src1_vert_stride:4; GLuint flag_reg_nr:1; - GLuint pad1:6; + GLuint pad1:6; } ia1; struct @@ -1445,8 +1445,8 @@ struct brw_instruction struct { GLuint binding_table_index:8; GLuint sampler:4; - GLuint return_format:2; - GLuint msg_type:2; + GLuint return_format:2; + GLuint msg_type:2; GLuint response_length:4; GLuint msg_length:4; GLuint msg_target:4; @@ -1483,7 +1483,7 @@ struct brw_instruction struct { GLuint opcode:4; GLuint offset:6; - GLuint swizzle_control:2; + GLuint swizzle_control:2; GLuint pad:1; GLuint allocate:1; GLuint used:1; @@ -1498,9 +1498,9 @@ struct brw_instruction struct { GLuint binding_table_index:8; - GLuint msg_control:4; - GLuint msg_type:2; - GLuint target_cache:2; + GLuint msg_control:4; + GLuint msg_type:2; + GLuint target_cache:2; GLuint response_length:4; GLuint msg_length:4; GLuint msg_target:4; @@ -1510,9 +1510,9 @@ struct brw_instruction struct { GLuint binding_table_index:8; - GLuint msg_control:3; - GLuint msg_type:3; - GLuint target_cache:2; + GLuint msg_control:3; + GLuint msg_type:3; + GLuint target_cache:2; GLuint pad0:3; GLuint header_present:1; GLuint response_length:5; @@ -1525,7 +1525,7 @@ struct brw_instruction GLuint binding_table_index:8; GLuint msg_control:3; GLuint pixel_scoreboard_clear:1; - GLuint msg_type:3; + GLuint msg_type:3; GLuint send_commit_msg:1; GLuint response_length:4; GLuint msg_length:4; @@ -1538,7 +1538,7 @@ struct brw_instruction GLuint binding_table_index:8; GLuint msg_control:3; GLuint pixel_scoreboard_clear:1; - GLuint msg_type:3; + GLuint msg_type:3; GLuint send_commit_msg:1; GLuint pad0:3; GLuint header_present:1; diff --git a/src/gallium/drivers/i965/brw_swtnl.c b/src/gallium/drivers/i965/brw_swtnl.c index f96301e..9bde564 100644 --- a/src/gallium/drivers/i965/brw_swtnl.c +++ b/src/gallium/drivers/i965/brw_swtnl.c @@ -9,7 +9,7 @@ static GLboolean need_swtnl( struct brw_context *brw ) { const struct pipe_rasterizer_state *rast = &brw->curr.rast->templ; - /* If we don't require strict OpenGL conformance, never + /* If we don't require strict OpenGL conformance, never * use fallbacks. If we're forcing fallbacks, always * use fallfacks. */ @@ -33,7 +33,7 @@ static GLboolean need_swtnl( struct brw_context *brw ) */ { int ve0_vb = brw->curr.vertex_element[0].vertex_buffer_index; - + if (brw->curr.vertex_buffer[ve0_vb].stride == 0) return TRUE; } @@ -47,7 +47,7 @@ static GLboolean need_swtnl( struct brw_context *brw ) return TRUE; } - + if (brw->reduced_primitive == PIPE_PRIM_LINES || (brw->reduced_primitive == PIPE_PRIM_TRIANGLES && (rast->fill_cw == PIPE_POLYGON_MODE_LINE || @@ -65,12 +65,12 @@ static GLboolean need_swtnl( struct brw_context *brw ) */ if (rast->line_stipple_enable && (brw->reduced_primitive == PIPE_PRIM_TRIANGLES || - brw->primitive == PIPE_PRIM_LINE_LOOP || + brw->primitive == PIPE_PRIM_LINE_LOOP || brw->primitive == PIPE_PRIM_LINE_STRIP)) return TRUE; } - + if (brw->reduced_primitive == PIPE_PRIM_POINTS || (brw->reduced_primitive == PIPE_PRIM_TRIANGLES && (rast->fill_cw == PIPE_POLYGON_MODE_POINT || @@ -87,7 +87,7 @@ static GLboolean need_swtnl( struct brw_context *brw ) * * XXX: need a workaround for this. */ - + /* Nothing stopping us from the fast path now */ return FALSE; } diff --git a/src/gallium/drivers/i965/brw_urb.c b/src/gallium/drivers/i965/brw_urb.c index 907ec56..abd3ce9 100644 --- a/src/gallium/drivers/i965/brw_urb.c +++ b/src/gallium/drivers/i965/brw_urb.c @@ -2,7 +2,7 @@ Copyright (C) Intel Corp. 2006. All Rights Reserved. Intel funded Tungsten Graphics (http://www.tungstengraphics.com) to develop this 3D driver. - + 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, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - + The above copyright notice and this permission notice (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 NONINFRINGEMENT. @@ -22,13 +22,13 @@ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - + **********************************************************************/ /* * Authors: * Keith Whitwell */ - + #include "brw_batchbuffer.h" @@ -133,17 +133,17 @@ static int recalculate_urb_fence( struct brw_context *brw ) (brw->urb.constrained && (brw->urb.vsize > vsize || brw->urb.sfsize > sfsize || brw->urb.csize > csize))) { - + brw->urb.csize = csize; brw->urb.sfsize = sfsize; brw->urb.vsize = vsize; - brw->urb.nr_vs_entries = limits[VS].preferred_nr_entries; - brw->urb.nr_gs_entries = limits[GS].preferred_nr_entries; + brw->urb.nr_vs_entries = limits[VS].preferred_nr_entries; + brw->urb.nr_gs_entries = limits[GS].preferred_nr_entries; brw->urb.nr_clip_entries = limits[CLP].preferred_nr_entries; - brw->urb.nr_sf_entries = limits[SF].preferred_nr_entries; - brw->urb.nr_cs_entries = limits[CS].preferred_nr_entries; + brw->urb.nr_sf_entries = limits[SF].preferred_nr_entries; + brw->urb.nr_cs_entries = limits[CS].preferred_nr_entries; brw->urb.constrained = 0; @@ -168,27 +168,27 @@ static int recalculate_urb_fence( struct brw_context *brw ) } if (BRW_DEBUG & DEBUG_MIN_URB) { - brw->urb.nr_vs_entries = limits[VS].min_nr_entries; - brw->urb.nr_gs_entries = limits[GS].min_nr_entries; + brw->urb.nr_vs_entries = limits[VS].min_nr_entries; + brw->urb.nr_gs_entries = limits[GS].min_nr_entries; brw->urb.nr_clip_entries = limits[CLP].min_nr_entries; - brw->urb.nr_sf_entries = limits[SF].min_nr_entries; - brw->urb.nr_cs_entries = limits[CS].min_nr_entries; + brw->urb.nr_sf_entries = limits[SF].min_nr_entries; + brw->urb.nr_cs_entries = limits[CS].min_nr_entries; brw->urb.constrained = 1; } if (!check_urb_layout(brw)) { - brw->urb.nr_vs_entries = limits[VS].min_nr_entries; - brw->urb.nr_gs_entries = limits[GS].min_nr_entries; + brw->urb.nr_vs_entries = limits[VS].min_nr_entries; + brw->urb.nr_gs_entries = limits[GS].min_nr_entries; brw->urb.nr_clip_entries = limits[CLP].min_nr_entries; - brw->urb.nr_sf_entries = limits[SF].min_nr_entries; - brw->urb.nr_cs_entries = limits[CS].min_nr_entries; + brw->urb.nr_sf_entries = limits[SF].min_nr_entries; + brw->urb.nr_cs_entries = limits[CS].min_nr_entries; /* Mark us as operating with constrained nr_entries, so that next * time we recalculate we'll resize the fences in the hope of * escaping constrained mode and getting back to normal performance. */ brw->urb.constrained = 1; - + if (!check_urb_layout(brw)) { /* This is impossible, given the maximal sizes of urb * entries and the values for minimum nr of entries @@ -197,7 +197,7 @@ static int recalculate_urb_fence( struct brw_context *brw ) debug_printf("couldn't calculate URB layout!\n"); exit(1); } - + if (BRW_DEBUG & (DEBUG_URB|DEBUG_FALLBACKS)) debug_printf("URB CONSTRAINED\n"); } @@ -209,9 +209,9 @@ static int recalculate_urb_fence( struct brw_context *brw ) brw->urb.gs_start, brw->urb.clip_start, brw->urb.sf_start, - brw->urb.cs_start, + brw->urb.cs_start, URB_SIZES(brw)); - + brw->state.dirty.brw |= BRW_NEW_URB_FENCE; } @@ -253,9 +253,9 @@ int brw_upload_urb_fence(struct brw_context *brw) * There are 256/384 urb reg pairs in total. */ uf.bits0.vs_fence = brw->urb.gs_start; - uf.bits0.gs_fence = brw->urb.clip_start; - uf.bits0.clp_fence = brw->urb.sf_start; - uf.bits1.sf_fence = brw->urb.cs_start; + uf.bits0.gs_fence = brw->urb.clip_start; + uf.bits0.clp_fence = brw->urb.sf_start; + uf.bits1.sf_fence = brw->urb.cs_start; uf.bits1.cs_fence = URB_SIZES(brw); BRW_BATCH_STRUCT(brw, &uf); diff --git a/src/gallium/drivers/i965/brw_util.h b/src/gallium/drivers/i965/brw_util.h index b5f9a36..6ff2424 100644 --- a/src/gallium/drivers/i965/brw_util.h +++ b/src/gallium/drivers/i965/brw_util.h @@ -2,7 +2,7 @@ Copyright (C) Intel Corp. 2006. All Rights Reserved. Intel funded Tungsten Graphics (http://www.tungstengraphics.com) to develop this 3D driver. - + 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, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - + The above copyright notice and this permission notice (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 NONINFRINGEMENT. @@ -22,13 +22,13 @@ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - + **********************************************************************/ /* * Authors: * Keith Whitwell */ - + #ifndef BRW_UTIL_H #define BRW_UTIL_H diff --git a/src/gallium/drivers/i965/brw_vs.c b/src/gallium/drivers/i965/brw_vs.c index ca8ee79..f5a52ae 100644 --- a/src/gallium/drivers/i965/brw_vs.c +++ b/src/gallium/drivers/i965/brw_vs.c @@ -2,7 +2,7 @@ Copyright (C) Intel Corp. 2006. All Rights Reserved. Intel funded Tungsten Graphics (http://www.tungstengraphics.com) to develop this 3D driver. - + 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, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - + The above copyright notice and this permission notice (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 NONINFRINGEMENT. @@ -22,14 +22,14 @@ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - + **********************************************************************/ /* * Authors: * Keith Whitwell */ -#include "tgsi/tgsi_dump.h" +#include "tgsi/tgsi_dump.h" #include "brw_context.h" #include "brw_vs.h" @@ -37,7 +37,7 @@ -static enum pipe_error do_vs_prog( struct brw_context *brw, +static enum pipe_error do_vs_prog( struct brw_context *brw, struct brw_vertex_shader *vp, struct brw_vs_prog_key *key, struct brw_winsys_buffer **bo_out) @@ -119,7 +119,7 @@ static enum pipe_error brw_upload_vs_prog(struct brw_context *brw) */ const struct brw_tracked_state brw_vs_prog = { .dirty = { - .mesa = (PIPE_NEW_CLIP | + .mesa = (PIPE_NEW_CLIP | PIPE_NEW_RAST | PIPE_NEW_FRAGMENT_SIGNATURE), .brw = BRW_NEW_VERTEX_PROGRAM, diff --git a/src/gallium/drivers/i965/brw_vs.h b/src/gallium/drivers/i965/brw_vs.h index 944d88c..c714a24 100644 --- a/src/gallium/drivers/i965/brw_vs.h +++ b/src/gallium/drivers/i965/brw_vs.h @@ -2,7 +2,7 @@ Copyright (C) Intel Corp. 2006. All Rights Reserved. Intel funded Tungsten Graphics (http://www.tungstengraphics.com) to develop this 3D driver. - + 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, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - + The above copyright notice and this permission notice (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 NONINFRINGEMENT. @@ -22,13 +22,13 @@ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - + **********************************************************************/ /* * Authors: * Keith Whitwell */ - + #ifndef BRW_VS_H #define BRW_VS_H @@ -77,7 +77,7 @@ struct brw_vs_compile { struct brw_reg tmp; struct brw_reg stack; - struct { + struct { GLboolean used_in_src; struct brw_reg reg; } output_regs[128]; diff --git a/src/gallium/drivers/i965/brw_vs_emit.c b/src/gallium/drivers/i965/brw_vs_emit.c index 5dcbd59..ee0edfe 100644 --- a/src/gallium/drivers/i965/brw_vs_emit.c +++ b/src/gallium/drivers/i965/brw_vs_emit.c @@ -2,7 +2,7 @@ Copyright (C) Intel Corp. 2006. All Rights Reserved. Intel funded Tungsten Graphics (http://www.tungstengraphics.com) to develop this 3D driver. - + 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, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - + The above copyright notice and this permission notice (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 NONINFRINGEMENT. @@ -22,7 +22,7 @@ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - + **********************************************************************/ /* * Authors: @@ -30,7 +30,7 @@ */ #include "pipe/p_shader_tokens.h" - + #include "util/u_memory.h" #include "util/u_math.h" @@ -69,7 +69,7 @@ static void release_tmp( struct brw_vs_compile *c, struct brw_reg tmp ) if (tmp.nr == c->last_tmp-1) c->last_tmp--; } - + static void release_tmps( struct brw_vs_compile *c ) { c->last_tmp = c->first_tmp; @@ -82,7 +82,7 @@ static boolean is_position_output( struct brw_vs_compile *c, const struct brw_vertex_shader *vs = c->vp; unsigned semantic = vs->info.output_semantic_name[vs_output]; unsigned index = vs->info.output_semantic_index[vs_output]; - + return (semantic == TGSI_SEMANTIC_POSITION && index == 0); } @@ -144,7 +144,7 @@ static void brw_vs_alloc_regs( struct brw_vs_compile *c ) c->r0 = brw_vec8_grf(reg, 0); reg++; - /* User clip planes from curbe: + /* User clip planes from curbe: */ if (c->key.nr_userclip) { /* Skip over fixed planes: Or never read them into vs unit? @@ -152,9 +152,9 @@ static void brw_vs_alloc_regs( struct brw_vs_compile *c ) subreg += 6; for (i = 0; i < c->key.nr_userclip; i++, subreg++) { - c->userplane[i] = + c->userplane[i] = stride( brw_vec4_grf(reg+subreg/2, (subreg%2) * 4), 0, 4, 1); - } + } /* Deal with curbe alignment: */ @@ -170,7 +170,7 @@ static void brw_vs_alloc_regs( struct brw_vs_compile *c ) * here. */ for (i = 0; i < c->vp->info.immediate_count; i++, subreg++) { - c->regs[TGSI_FILE_IMMEDIATE][i] = + c->regs[TGSI_FILE_IMMEDIATE][i] = stride( brw_vec4_grf(reg+subreg/2, (subreg%2) * 4), 0, 4, 1); } c->prog_data.nr_params = c->vp->info.immediate_count * 4; @@ -198,7 +198,7 @@ static void brw_vs_alloc_regs( struct brw_vs_compile *c ) c->prog_data.curb_read_length = reg - 1; - /* Allocate input regs: + /* Allocate input regs: */ c->nr_inputs = c->vp->info.num_inputs; for (i = 0; i < c->nr_inputs; i++) { @@ -223,7 +223,7 @@ static void brw_vs_alloc_regs( struct brw_vs_compile *c ) else mrf = 4; - + if (c->key.fs_signature.nr_inputs > BRW_MAX_MRF) { c->overflow_grf_start = reg; c->overflow_count = c->key.fs_signature.nr_inputs - BRW_MAX_MRF; @@ -243,12 +243,12 @@ static void brw_vs_alloc_regs( struct brw_vs_compile *c ) reg++; } else if (find_output_slot(c, i, &slot)) { - + if (0 /* is_psize_output(c, i) */ ) { /* c->psize_out.grf = reg; */ /* c->psize_out.mrf = i; */ } - + /* The first (16-4) outputs can go straight into the message regs. */ if (slot + mrf < BRW_MAX_MRF) { @@ -262,11 +262,11 @@ static void brw_vs_alloc_regs( struct brw_vs_compile *c ) else { c->regs[TGSI_FILE_OUTPUT][i] = brw_null_reg(); } - } + } /* Allocate program temporaries: */ - + for (i = 0; i < c->vp->info.file_max[TGSI_FILE_TEMPORARY]+1; i++) { c->regs[TGSI_FILE_TEMPORARY][i] = brw_vec8_grf(reg, 0); reg++; @@ -341,7 +341,7 @@ static void brw_vs_alloc_regs( struct brw_vs_compile *c ) c->prog_data.total_grf = reg; if (BRW_DEBUG & DEBUG_VS) { - debug_printf("%s NumAddrRegs %d\n", __FUNCTION__, + debug_printf("%s NumAddrRegs %d\n", __FUNCTION__, c->vp->info.file_max[TGSI_FILE_ADDRESS]+1); debug_printf("%s NumTemps %d\n", __FUNCTION__, c->vp->info.file_max[TGSI_FILE_TEMPORARY]+1); @@ -431,7 +431,7 @@ static void unalias3( struct brw_vs_compile *c, static void emit_sop( struct brw_compile *p, struct brw_reg dst, struct brw_reg arg0, - struct brw_reg arg1, + struct brw_reg arg1, GLuint cond) { brw_MOV(p, dst, brw_imm_f(0.0f)); @@ -455,7 +455,7 @@ static void emit_sne( struct brw_compile *p, { emit_sop(p, dst, arg0, arg1, BRW_CONDITIONAL_NEQ); } -static void emit_slt( struct brw_compile *p, +static void emit_slt( struct brw_compile *p, struct brw_reg dst, struct brw_reg arg0, struct brw_reg arg1 ) @@ -463,7 +463,7 @@ static void emit_slt( struct brw_compile *p, emit_sop(p, dst, arg0, arg1, BRW_CONDITIONAL_L); } -static void emit_sle( struct brw_compile *p, +static void emit_sle( struct brw_compile *p, struct brw_reg dst, struct brw_reg arg0, struct brw_reg arg1 ) @@ -471,7 +471,7 @@ static void emit_sle( struct brw_compile *p, emit_sop(p, dst, arg0, arg1, BRW_CONDITIONAL_LE); } -static void emit_sgt( struct brw_compile *p, +static void emit_sgt( struct brw_compile *p, struct brw_reg dst, struct brw_reg arg0, struct brw_reg arg1 ) @@ -479,7 +479,7 @@ static void emit_sgt( struct brw_compile *p, emit_sop(p, dst, arg0, arg1, BRW_CONDITIONAL_G); } -static void emit_sge( struct brw_compile *p, +static void emit_sge( struct brw_compile *p, struct brw_reg dst, struct brw_reg arg0, struct brw_reg arg1 ) @@ -487,7 +487,7 @@ static void emit_sge( struct brw_compile *p, emit_sop(p, dst, arg0, arg1, BRW_CONDITIONAL_GE); } -static void emit_max( struct brw_compile *p, +static void emit_max( struct brw_compile *p, struct brw_reg dst, struct brw_reg arg0, struct brw_reg arg1 ) @@ -497,7 +497,7 @@ static void emit_max( struct brw_compile *p, brw_set_predicate_control(p, BRW_PREDICATE_NONE); } -static void emit_min( struct brw_compile *p, +static void emit_min( struct brw_compile *p, struct brw_reg dst, struct brw_reg arg0, struct brw_reg arg1 ) @@ -526,10 +526,10 @@ static void emit_math1( struct brw_vs_compile *c, GLboolean need_tmp = (dst.dw1.bits.writemask != 0xf || dst.file != BRW_GENERAL_REGISTER_FILE); - if (need_tmp) + if (need_tmp) tmp = get_tmp(c); - brw_math(p, + brw_math(p, tmp, function, BRW_MATH_SATURATE_NONE, @@ -545,7 +545,7 @@ static void emit_math1( struct brw_vs_compile *c, } -static void emit_math2( struct brw_vs_compile *c, +static void emit_math2( struct brw_vs_compile *c, GLuint function, struct brw_reg dst, struct brw_reg arg0, @@ -557,12 +557,12 @@ static void emit_math2( struct brw_vs_compile *c, GLboolean need_tmp = (dst.dw1.bits.writemask != 0xf || dst.file != BRW_GENERAL_REGISTER_FILE); - if (need_tmp) + if (need_tmp) tmp = get_tmp(c); brw_MOV(p, brw_message_reg(3), arg1); - - brw_math(p, + + brw_math(p, tmp, function, BRW_MATH_SATURATE_NONE, @@ -583,7 +583,7 @@ static void emit_exp_noalias( struct brw_vs_compile *c, struct brw_reg arg0 ) { struct brw_compile *p = &c->func; - + if (dst.dw1.bits.writemask & BRW_WRITEMASK_X) { struct brw_reg tmp = get_tmp(c); @@ -594,15 +594,15 @@ static void emit_exp_noalias( struct brw_vs_compile *c, /* result[0] = 2.0 ^ tmp */ - /* Adjust exponent for floating point: - * exp += 127 + /* Adjust exponent for floating point: + * exp += 127 */ brw_ADD(p, brw_writemask(tmp_d, BRW_WRITEMASK_X), tmp_d, brw_imm_d(127)); - /* Install exponent and sign. - * Excess drops off the edge: + /* Install exponent and sign. + * Excess drops off the edge: */ - brw_SHL(p, brw_writemask(retype(dst, BRW_REGISTER_TYPE_D), BRW_WRITEMASK_X), + brw_SHL(p, brw_writemask(retype(dst, BRW_REGISTER_TYPE_D), BRW_WRITEMASK_X), tmp_d, brw_imm_d(23)); release_tmp(c, tmp); @@ -612,7 +612,7 @@ static void emit_exp_noalias( struct brw_vs_compile *c, /* result[1] = arg0.x - floor(arg0.x) */ brw_FRC(p, brw_writemask(dst, BRW_WRITEMASK_Y), brw_swizzle1(arg0, 0)); } - + if (dst.dw1.bits.writemask & BRW_WRITEMASK_Z) { /* As with the LOG instruction, we might be better off just * doing a taylor expansion here, seeing as we have to do all @@ -621,12 +621,12 @@ static void emit_exp_noalias( struct brw_vs_compile *c, * If mathbox partial precision is too low, consider also: * result[3] = result[0] * EXP(result[1]) */ - emit_math1(c, - BRW_MATH_FUNCTION_EXP, + emit_math1(c, + BRW_MATH_FUNCTION_EXP, brw_writemask(dst, BRW_WRITEMASK_Z), - brw_swizzle1(arg0, 0), + brw_swizzle1(arg0, 0), BRW_MATH_PRECISION_FULL); - } + } if (dst.dw1.bits.writemask & BRW_WRITEMASK_W) { /* result[3] = 1.0; */ @@ -650,7 +650,7 @@ static void emit_log_noalias( struct brw_vs_compile *c, tmp = get_tmp(c); tmp_ud = retype(tmp, BRW_REGISTER_TYPE_UD); } - + /* Perform mant = frexpf(fabsf(x), &exp), adjust exp and mnt * according to spec: * @@ -661,34 +661,34 @@ static void emit_log_noalias( struct brw_vs_compile *c, * result[1].i = (x.i & ((1<<23)-1) + (127<<23) */ if (dst.dw1.bits.writemask & BRW_WRITEMASK_XZ) { - brw_AND(p, + brw_AND(p, brw_writemask(tmp_ud, BRW_WRITEMASK_X), brw_swizzle1(arg0_ud, 0), brw_imm_ud((1U<<31)-1)); - brw_SHR(p, - brw_writemask(tmp_ud, BRW_WRITEMASK_X), + brw_SHR(p, + brw_writemask(tmp_ud, BRW_WRITEMASK_X), tmp_ud, brw_imm_ud(23)); - brw_ADD(p, - brw_writemask(tmp, BRW_WRITEMASK_X), + brw_ADD(p, + brw_writemask(tmp, BRW_WRITEMASK_X), retype(tmp_ud, BRW_REGISTER_TYPE_D), /* does it matter? */ brw_imm_d(-127)); } if (dst.dw1.bits.writemask & BRW_WRITEMASK_YZ) { - brw_AND(p, + brw_AND(p, brw_writemask(tmp_ud, BRW_WRITEMASK_Y), brw_swizzle1(arg0_ud, 0), brw_imm_ud((1<<23)-1)); - brw_OR(p, - brw_writemask(tmp_ud, BRW_WRITEMASK_Y), + brw_OR(p, + brw_writemask(tmp_ud, BRW_WRITEMASK_Y), tmp_ud, brw_imm_ud(127<<23)); } - + if (dst.dw1.bits.writemask & BRW_WRITEMASK_Z) { /* result[2] = result[0] + LOG2(result[1]); */ @@ -696,23 +696,23 @@ static void emit_log_noalias( struct brw_vs_compile *c, * taylor series. Maybe we *should* use a taylor series as by * the time all the above has been done it's almost certainly * quicker than calling the mathbox, even with low precision. - * + * * Options are: * - result[0] + mathbox.LOG2(result[1]) * - mathbox.LOG2(arg0.x) * - result[0] + inline_taylor_approx(result[1]) */ - emit_math1(c, - BRW_MATH_FUNCTION_LOG, - brw_writemask(tmp, BRW_WRITEMASK_Z), - brw_swizzle1(tmp, 1), + emit_math1(c, + BRW_MATH_FUNCTION_LOG, + brw_writemask(tmp, BRW_WRITEMASK_Z), + brw_swizzle1(tmp, 1), BRW_MATH_PRECISION_FULL); - - brw_ADD(p, - brw_writemask(tmp, BRW_WRITEMASK_Z), - brw_swizzle1(tmp, 2), + + brw_ADD(p, + brw_writemask(tmp, BRW_WRITEMASK_Z), + brw_swizzle1(tmp, 2), brw_swizzle1(tmp, 0)); - } + } if (dst.dw1.bits.writemask & BRW_WRITEMASK_W) { /* result[3] = 1.0; */ @@ -728,14 +728,14 @@ static void emit_log_noalias( struct brw_vs_compile *c, /* Need to unalias - consider swizzles: r0 = DST r0.xxxx r1 */ -static void emit_dst_noalias( struct brw_vs_compile *c, +static void emit_dst_noalias( struct brw_vs_compile *c, struct brw_reg dst, struct brw_reg arg0, struct brw_reg arg1) { struct brw_compile *p = &c->func; - /* There must be a better way to do this: + /* There must be a better way to do this: */ if (dst.dw1.bits.writemask & BRW_WRITEMASK_X) brw_MOV(p, brw_writemask(dst, BRW_WRITEMASK_X), brw_imm_f(1.0)); @@ -758,7 +758,7 @@ static void emit_xpd( struct brw_compile *p, } -static void emit_lit_noalias( struct brw_vs_compile *c, +static void emit_lit_noalias( struct brw_vs_compile *c, struct brw_reg dst, struct brw_reg arg0 ) { @@ -767,11 +767,11 @@ static void emit_lit_noalias( struct brw_vs_compile *c, struct brw_reg tmp = dst; GLboolean need_tmp = (dst.file != BRW_GENERAL_REGISTER_FILE); - if (need_tmp) + if (need_tmp) tmp = get_tmp(c); - - brw_MOV(p, brw_writemask(dst, BRW_WRITEMASK_YZ), brw_imm_f(0)); - brw_MOV(p, brw_writemask(dst, BRW_WRITEMASK_XW), brw_imm_f(1)); + + brw_MOV(p, brw_writemask(dst, BRW_WRITEMASK_YZ), brw_imm_f(0)); + brw_MOV(p, brw_writemask(dst, BRW_WRITEMASK_XW), brw_imm_f(1)); /* Need to use BRW_EXECUTE_8 and also do an 8-wide compare in order * to get all channels active inside the IF. In the clipping code @@ -787,12 +787,12 @@ static void emit_lit_noalias( struct brw_vs_compile *c, brw_MOV(p, brw_writemask(tmp, BRW_WRITEMASK_Z), brw_swizzle1(arg0,1)); brw_set_predicate_control(p, BRW_PREDICATE_NONE); - emit_math2(c, - BRW_MATH_FUNCTION_POW, + emit_math2(c, + BRW_MATH_FUNCTION_POW, brw_writemask(dst, BRW_WRITEMASK_Z), brw_swizzle1(tmp, 2), brw_swizzle1(arg0, 3), - BRW_MATH_PRECISION_PARTIAL); + BRW_MATH_PRECISION_PARTIAL); } brw_ENDIF(p, if_insn); @@ -814,7 +814,7 @@ static void emit_lrp_noalias(struct brw_vs_compile *c, } /** 3 or 4-component vector normalization */ -static void emit_nrm( struct brw_vs_compile *c, +static void emit_nrm( struct brw_vs_compile *c, struct brw_reg dst, struct brw_reg arg0, int num_comps) @@ -970,7 +970,7 @@ static struct brw_reg deref( struct brw_vs_compile *c, brw_pop_insn_state(p); } - + /* NOTE: tmp not released */ return vec8(tmp); } @@ -1036,8 +1036,8 @@ static void emit_arl( struct brw_vs_compile *c, struct brw_compile *p = &c->func; struct brw_reg tmp = dst; GLboolean need_tmp = (dst.file != BRW_GENERAL_REGISTER_FILE); - - if (need_tmp) + + if (need_tmp) tmp = get_tmp(c); brw_RNDD(p, tmp, arg0); /* tmp = round(arg0) */ @@ -1065,14 +1065,14 @@ static struct brw_reg get_arg( struct brw_vs_compile *c, src->Register.Index, src->Register.Indirect); - /* Convert 3-bit swizzle to 2-bit. + /* Convert 3-bit swizzle to 2-bit. */ reg.dw1.bits.swizzle = BRW_SWIZZLE4(src->Register.SwizzleX, src->Register.SwizzleY, src->Register.SwizzleZ, src->Register.SwizzleW); - reg.negate = src->Register.Negate ? 1 : 0; + reg.negate = src->Register.Negate ? 1 : 0; /* XXX: abs, absneg */ @@ -1142,7 +1142,7 @@ static void emit_vertex_write( struct brw_vs_compile *c) * workaround. */ if (c->prog_data.writes_psiz || - c->key.nr_userclip || + c->key.nr_userclip || c->chipset.is_965) { struct brw_reg header1 = retype(get_tmp(c), BRW_REGISTER_TYPE_UD); @@ -1150,7 +1150,7 @@ static void emit_vertex_write( struct brw_vs_compile *c) brw_MOV(p, header1, brw_imm_ud(0)); - brw_set_access_mode(p, BRW_ALIGN_16); + brw_set_access_mode(p, BRW_ALIGN_16); if (c->prog_data.writes_psiz) { struct brw_reg psiz = c->regs[TGSI_FILE_OUTPUT][VERT_RESULT_PSIZ]; @@ -1165,9 +1165,9 @@ static void emit_vertex_write( struct brw_vs_compile *c) brw_set_predicate_control(p, BRW_PREDICATE_NONE); } - /* i965 clipping workaround: + /* i965 clipping workaround: * 1) Test for -ve rhw - * 2) If set, + * 2) If set, * set ndc = (0,0,0,0) * set ucp[6] = 1 * @@ -1180,7 +1180,7 @@ static void emit_vertex_write( struct brw_vs_compile *c) BRW_CONDITIONAL_L, brw_swizzle1(ndc, 3), brw_imm_f(0)); - + brw_OR(p, brw_writemask(header1, BRW_WRITEMASK_W), header1, brw_imm_ud(1<<6)); brw_MOV(p, ndc, brw_imm_f(0)); brw_set_predicate_control(p, BRW_PREDICATE_NONE); @@ -1205,9 +1205,9 @@ static void emit_vertex_write( struct brw_vs_compile *c) if (c->chipset.is_igdng) { /* There are 20 DWs (D0-D19) in VUE vertex header on IGDNG */ brw_MOV(p, offset(m0, 3), pos); /* a portion of vertex header */ - /* m4, m5 contain the distances from vertex to the user clip planeXXX. + /* m4, m5 contain the distances from vertex to the user clip planeXXX. * Seems it is useless for us. - * m6 is used for aligning, so that the remainder of vertex element is + * m6 is used for aligning, so that the remainder of vertex element is * reg-aligned. */ brw_MOV(p, offset(m0, 7), pos); /* the remainder of vertex element */ @@ -1219,7 +1219,7 @@ static void emit_vertex_write( struct brw_vs_compile *c) eot = (c->overflow_count == 0); - brw_urb_WRITE(p, + brw_urb_WRITE(p, brw_null_reg(), /* dest */ 0, /* starting mrf reg nr */ c->r0, /* src */ @@ -1246,7 +1246,7 @@ static void emit_vertex_write( struct brw_vs_compile *c) * at mrf[4] atm... */ for (j = 0; j < nr; j++) { - brw_MOV(p, brw_message_reg(4+j), + brw_MOV(p, brw_message_reg(4+j), brw_vec8_grf(c->overflow_grf_start + i + j, 0)); } @@ -1272,7 +1272,7 @@ static void emit_vertex_write( struct brw_vs_compile *c) * \param end_inst points to brw code for END instruction * \param last_inst points to last instruction emitted before vertex write */ -static void +static void post_vs_emit( struct brw_vs_compile *c, struct brw_instruction *end_inst, struct brw_instruction *last_inst ) @@ -1356,8 +1356,8 @@ static void emit_insn(struct brw_vs_compile *c, /* Get dest regs. Note that it is possible for a reg to be both * dst and arg, given the static allocation of registers. So * care needs to be taken emitting multi-operation instructions. - */ - dst = get_dst(c, + */ + dst = get_dst(c, inst->Dst[0].Register.File, inst->Dst[0].Register.Index, inst->Dst[0].Register.WriteMask); @@ -1394,7 +1394,7 @@ static void emit_insn(struct brw_vs_compile *c, emit_nrm(c, dst, args[0], 4); break; case TGSI_OPCODE_DST: - unalias2(c, dst, args[0], args[1], emit_dst_noalias); + unalias2(c, dst, args[0], args[1], emit_dst_noalias); break; case TGSI_OPCODE_EXP: unalias1(c, dst, args[0], emit_exp_noalias); @@ -1440,13 +1440,13 @@ static void emit_insn(struct brw_vs_compile *c, brw_MUL(p, dst, args[0], args[1]); break; case TGSI_OPCODE_POW: - emit_math2(c, BRW_MATH_FUNCTION_POW, dst, args[0], args[1], BRW_MATH_PRECISION_FULL); + emit_math2(c, BRW_MATH_FUNCTION_POW, dst, args[0], args[1], BRW_MATH_PRECISION_FULL); break; case TGSI_OPCODE_RCP: emit_math1(c, BRW_MATH_FUNCTION_INV, dst, args[0], BRW_MATH_PRECISION_FULL); break; case TGSI_OPCODE_RSQ: - emit_math1(c, BRW_MATH_FUNCTION_RSQ, dst, + emit_math1(c, BRW_MATH_FUNCTION_RSQ, dst, brw_swizzle(args[0], 0,0,0,0), BRW_MATH_PRECISION_FULL); break; case TGSI_OPCODE_SEQ: @@ -1493,7 +1493,7 @@ static void emit_insn(struct brw_vs_compile *c, case TGSI_OPCODE_ENDIF: assert(c->if_depth > 0); brw_ENDIF(p, c->if_inst[--c->if_depth]); - break; + break; case TGSI_OPCODE_BGNLOOP: c->loop_inst[c->loop_depth++] = brw_DO(p, BRW_EXECUTE_8); break; @@ -1507,7 +1507,7 @@ static void emit_insn(struct brw_vs_compile *c, brw_CONT(p); brw_set_predicate_control(p, BRW_PREDICATE_NONE); break; - case TGSI_OPCODE_ENDLOOP: + case TGSI_OPCODE_ENDLOOP: { struct brw_instruction *inst0, *inst1; GLuint br = 1; @@ -1553,7 +1553,7 @@ static void emit_insn(struct brw_vs_compile *c, brw_MOV(p, brw_ip_reg(), deref_1d(c->stack_index, 0)); brw_set_access_mode(p, BRW_ALIGN_16); break; - case TGSI_OPCODE_END: + case TGSI_OPCODE_END: c->end_offset = p->nr_insn; /* this instruction will get patched later to jump past subroutine * code, etc. @@ -1568,7 +1568,7 @@ static void emit_insn(struct brw_vs_compile *c, break; default: debug_printf("Unsupported opcode %i (%s) in vertex shader", - opcode, + opcode, tgsi_get_opcode_name(opcode)); } @@ -1604,13 +1604,13 @@ void brw_vs_emit(struct brw_vs_compile *c) struct tgsi_full_instruction *inst; if (BRW_DEBUG & DEBUG_VS) - tgsi_dump(c->vp->tokens, 0); + tgsi_dump(c->vp->tokens, 0); c->stack_index = brw_indirect(0, 0); brw_set_compression_control(p, BRW_COMPRESSION_NONE); brw_set_access_mode(p, BRW_ALIGN_16); - + /* Static register allocation */ diff --git a/src/gallium/drivers/i965/brw_vs_state.c b/src/gallium/drivers/i965/brw_vs_state.c index dadbb62..a41f7b8 100644 --- a/src/gallium/drivers/i965/brw_vs_state.c +++ b/src/gallium/drivers/i965/brw_vs_state.c @@ -2,7 +2,7 @@ Copyright (C) Intel Corp. 2006. All Rights Reserved. Intel funded Tungsten Graphics (http://www.tungstengraphics.com) to develop this 3D driver. - + 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, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - + The above copyright notice and this permission notice (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 NONINFRINGEMENT. @@ -22,13 +22,13 @@ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - + **********************************************************************/ /* * Authors: * Keith Whitwell */ - + #include "util/u_math.h" @@ -79,7 +79,7 @@ vs_unit_populate_key(struct brw_context *brw, struct brw_vs_unit_key *key) } static enum pipe_error -vs_unit_create_from_key(struct brw_context *brw, +vs_unit_create_from_key(struct brw_context *brw, struct brw_vs_unit_key *key, struct brw_winsys_reloc *reloc, struct brw_winsys_buffer **bo_out) diff --git a/src/gallium/drivers/i965/brw_vs_surface_state.c b/src/gallium/drivers/i965/brw_vs_surface_state.c index 424bb0d..399861b 100644 --- a/src/gallium/drivers/i965/brw_vs_surface_state.c +++ b/src/gallium/drivers/i965/brw_vs_surface_state.c @@ -59,7 +59,7 @@ brw_vs_update_constant_buffer(struct brw_context *brw) if (!vp->use_const_buffer) return NULL; - const_buffer = brw->sws->bo_alloc(brw->sws, + const_buffer = brw->sws->bo_alloc(brw->sws, BRW_BUFFER_TYPE_SHADER_CONSTANTS, size, 64); @@ -131,7 +131,7 @@ brw_update_vs_constant_surface( struct brw_context *brw, &brw->vs.surf_bo[surf]); if (ret) return ret; - + return PIPE_OK; } #endif @@ -157,8 +157,8 @@ brw_vs_get_binding_table(struct brw_context *brw, i * 4, brw->vs.surf_bo[i]); } - - ret = brw_cache_data( &brw->surface_cache, + + ret = brw_cache_data( &brw->surface_cache, BRW_SS_SURF_BIND, NULL, 0, reloc, nr_reloc, diff --git a/src/gallium/drivers/i965/brw_winsys.h b/src/gallium/drivers/i965/brw_winsys.h index a06f8bb..2e4e954 100644 --- a/src/gallium/drivers/i965/brw_winsys.h +++ b/src/gallium/drivers/i965/brw_winsys.h @@ -229,12 +229,12 @@ struct brw_winsys_screen { void (*bo_unmap)(struct brw_winsys_buffer *buffer); /*@}*/ - + /* Wait for buffer to go idle. Similar to map+unmap, but doesn't * mark buffer contents as dirty. */ void (*bo_wait_idle)(struct brw_winsys_buffer *buffer); - + /** * Destroy the winsys. */ @@ -272,7 +272,7 @@ bo_reference(struct brw_winsys_buffer **ptr, struct brw_winsys_buffer *buf) extern int BRW_DUMP; #else #define BRW_DUMP 0 -#endif +#endif #define DUMP_ASM 0x1 #define DUMP_STATE 0x2 diff --git a/src/gallium/drivers/i965/brw_wm.c b/src/gallium/drivers/i965/brw_wm.c index 5d66e61..f4a3f39 100644 --- a/src/gallium/drivers/i965/brw_wm.c +++ b/src/gallium/drivers/i965/brw_wm.c @@ -2,7 +2,7 @@ Copyright (C) Intel Corp. 2006. All Rights Reserved. Intel funded Tungsten Graphics (http://www.tungstengraphics.com) to develop this 3D driver. - + 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, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - + The above copyright notice and this permission notice (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 NONINFRINGEMENT. @@ -22,7 +22,7 @@ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - + **********************************************************************/ /* * Authors: @@ -87,7 +87,7 @@ GLuint brw_wm_is_scalar_result( GLuint opcode ) case TGSI_OPCODE_DPH: case TGSI_OPCODE_DST: return 1; - + default: return 0; } @@ -147,7 +147,7 @@ brw_wm_linear_shader_emit(struct brw_context *brw, struct brw_wm_compile *c) * we'll use one of two code generators. */ static enum pipe_error do_wm_prog( struct brw_context *brw, - struct brw_fragment_shader *fp, + struct brw_fragment_shader *fp, struct brw_wm_prog_key *key, struct brw_winsys_buffer **bo_out) { @@ -158,7 +158,7 @@ static enum pipe_error do_wm_prog( struct brw_context *brw, if (brw->wm.compile_data == NULL) { brw->wm.compile_data = MALLOC(sizeof(*brw->wm.compile_data)); - if (!brw->wm.compile_data) + if (!brw->wm.compile_data) return PIPE_ERROR_OUT_OF_MEMORY; } @@ -227,21 +227,21 @@ static void brw_wm_populate_key( struct brw_context *brw, /* PIPE_NEW_RAST - * BRW_NEW_REDUCED_PRIMITIVE + * BRW_NEW_REDUCED_PRIMITIVE */ switch (brw->reduced_primitive) { case PIPE_PRIM_POINTS: line_aa = AA_NEVER; break; case PIPE_PRIM_LINES: - line_aa = (brw->curr.rast->templ.line_smooth ? + line_aa = (brw->curr.rast->templ.line_smooth ? AA_ALWAYS : AA_NEVER); break; default: line_aa = brw->curr.rast->unfilled_aa_line; break; } - + brw_wm_lookup_iz(line_aa, lookup, brw->curr.fragment_shader->uses_depth, @@ -254,7 +254,7 @@ static void brw_wm_populate_key( struct brw_context *brw, /* PIPE_NEW_BOUND_TEXTURES */ for (i = 0; i < brw->curr.num_fragment_sampler_views; i++) { const struct brw_texture *tex = brw_texture(brw->curr.fragment_sampler_views[i]->texture); - + if (tex->b.b.format == PIPE_FORMAT_UYVY) key->yuvtex_mask |= 1 << i; @@ -283,7 +283,7 @@ static enum pipe_error brw_prepare_wm_prog(struct brw_context *brw) struct brw_wm_prog_key key; struct brw_fragment_shader *fs = brw->curr.fragment_shader; enum pipe_error ret; - + brw_wm_populate_key(brw, &key); /* Make an early check for the key. diff --git a/src/gallium/drivers/i965/brw_wm.h b/src/gallium/drivers/i965/brw_wm.h index f1ca9f6..b713b6e 100644 --- a/src/gallium/drivers/i965/brw_wm.h +++ b/src/gallium/drivers/i965/brw_wm.h @@ -2,7 +2,7 @@ Copyright (C) Intel Corp. 2006. All Rights Reserved. Intel funded Tungsten Graphics (http://www.tungstengraphics.com) to develop this 3D driver. - + 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, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - + The above copyright notice and this permission notice (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 NONINFRINGEMENT. @@ -22,13 +22,13 @@ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - + **********************************************************************/ /* * Authors: * Keith Whitwell */ - + #ifndef BRW_WM_H #define BRW_WM_H @@ -100,7 +100,7 @@ struct brw_wm_prog_key { * are hard to reason about and which we translate away in pass0. A * single fragment program register element (eg. temp[0].x) will be * translated to one or more brw_wm_value structs, one for each time - * that temp[0].x is written to during the program. + * that temp[0].x is written to during the program. */ @@ -115,7 +115,7 @@ struct brw_wm_grf { struct brw_wm_value { struct brw_reg hw_reg; /* emitted to this reg, may not always be there */ struct brw_wm_ref *lastuse; - struct brw_wm_grf *resident; + struct brw_wm_grf *resident; GLuint contributes_to_output:1; GLuint spill_slot:16; /* if non-zero, spill immediately after calculation */ }; @@ -230,7 +230,7 @@ struct brw_wm_compile { unsigned nr; } immediate[BRW_WM_MAX_CONST+3]; GLuint nr_immediates; - + struct brw_fp_instruction fp_instructions[BRW_WM_MAX_INSN]; GLuint nr_fp_insns; GLuint fp_temp; diff --git a/src/gallium/drivers/i965/brw_wm_constant_buffer.c b/src/gallium/drivers/i965/brw_wm_constant_buffer.c index df5cd03..5bc0f79 100644 --- a/src/gallium/drivers/i965/brw_wm_constant_buffer.c +++ b/src/gallium/drivers/i965/brw_wm_constant_buffer.c @@ -23,7 +23,7 @@ brw_create_constant_surface( struct brw_context *brw, offsetof(struct brw_surface_state, ss1), key->bo); - + memset(&surf, 0, sizeof(surf)); surf.ss0.mipmap_layout_mode = BRW_SURFACE_MIPMAPLAYOUT_BELOW; @@ -37,7 +37,7 @@ brw_create_constant_surface( struct brw_context *brw, surf.ss3.depth = (w >> 20) & 0x7f; /* bits 26:20 of size or width */ surf.ss3.pitch = (key->pitch * key->cpp) - 1; /* ignored?? */ brw_set_surface_tiling(&surf, key->tiling); /* tiling now allowed */ - + ret = brw_upload_cache(&brw->surface_cache, BRW_SS_SURFACE, key, sizeof(*key), reloc, Elements(reloc), diff --git a/src/gallium/drivers/i965/brw_wm_debug.c b/src/gallium/drivers/i965/brw_wm_debug.c index 1b2aa93..330aad1 100644 --- a/src/gallium/drivers/i965/brw_wm_debug.c +++ b/src/gallium/drivers/i965/brw_wm_debug.c @@ -2,7 +2,7 @@ Copyright (C) Intel Corp. 2006. All Rights Reserved. Intel funded Tungsten Graphics (http://www.tungstengraphics.com) to develop this 3D driver. - + 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, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - + The above copyright notice and this permission notice (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 NONINFRINGEMENT. @@ -22,7 +22,7 @@ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - + **********************************************************************/ /* * Authors: @@ -37,7 +37,7 @@ static void print_writemask( unsigned writemask ) { if (writemask != BRW_WRITEMASK_XYZW) - debug_printf(".%s%s%s%s", + debug_printf(".%s%s%s%s", (writemask & BRW_WRITEMASK_X) ? "x" : "", (writemask & BRW_WRITEMASK_Y) ? "y" : "", (writemask & BRW_WRITEMASK_Z) ? "z" : "", @@ -48,7 +48,7 @@ static void print_swizzle( unsigned swizzle ) { char *swz = "xyzw"; if (swizzle != BRW_SWIZZLE_XYZW) - debug_printf(".%c%c%c%c", + debug_printf(".%c%c%c%c", swz[BRW_GET_SWZ(swizzle, X)], swz[BRW_GET_SWZ(swizzle, Y)], swz[BRW_GET_SWZ(swizzle, Z)], @@ -95,7 +95,7 @@ void brw_wm_print_value( struct brw_wm_compile *c, struct brw_wm_value *value ) { assert(value); - if (c->state >= PASS2_DONE) + if (c->state >= PASS2_DONE) brw_print_reg(value->hw_reg); else if( value == &c->undef_value ) debug_printf("undef"); @@ -111,7 +111,7 @@ void brw_wm_print_value( struct brw_wm_compile *c, else if (value - c->payload.depth >= 0 && value - c->payload.depth < PIPE_MAX_SHADER_INPUTS) debug_printf("d%ld", (long) (value - c->payload.depth)); - else + else debug_printf("?"); } @@ -150,15 +150,15 @@ void brw_wm_print_insn( struct brw_wm_compile *c, } else debug_printf("#"); - if (i < 3) + if (i < 3) debug_printf(","); } debug_printf("]"); print_writemask(inst->writemask); - + debug_printf(" = "); print_opcode(inst->opcode); - + if (inst->saturate) debug_printf("_SAT"); @@ -173,7 +173,7 @@ void brw_wm_print_insn( struct brw_wm_compile *c, else debug_printf("%%"); - if (i < 3) + if (i < 3) debug_printf(","); else debug_printf("]"); @@ -230,7 +230,7 @@ static void brw_wm_print_fp_insn( struct brw_wm_compile *c, debug_printf("]"); debug_printf(nr_args ? ", " : "\n"); - + for (i = 0; i < nr_args; i++) { debug_printf("%s%s%s[%d]%s", inst->src[i].negate ? "-" : "", diff --git a/src/gallium/drivers/i965/brw_wm_emit.c b/src/gallium/drivers/i965/brw_wm_emit.c index 8f983a6..cda5d56 100644 --- a/src/gallium/drivers/i965/brw_wm_emit.c +++ b/src/gallium/drivers/i965/brw_wm_emit.c @@ -2,7 +2,7 @@ Copyright (C) Intel Corp. 2006. All Rights Reserved. Intel funded Tungsten Graphics (http://www.tungstengraphics.com) to develop this 3D driver. - + 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, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - + The above copyright notice and this permission notice (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 NONINFRINGEMENT. @@ -22,7 +22,7 @@ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - + **********************************************************************/ /* * Authors: @@ -162,7 +162,7 @@ static void emit_pixel_w( struct brw_compile *p, /* Don't need this if all you are doing is interpolating color, for * instance. */ - if (mask & BRW_WRITEMASK_W) { + if (mask & BRW_WRITEMASK_W) { struct brw_reg interp3 = brw_vec1_grf(arg0[0].nr+1, 4); /* Calc 1/w - just linterp wpos[3] optimized by putting the @@ -182,7 +182,7 @@ static void emit_pixel_w( struct brw_compile *p, -static void emit_linterp( struct brw_compile *p, +static void emit_linterp( struct brw_compile *p, const struct brw_reg *dst, GLuint mask, const struct brw_reg *arg0, @@ -206,7 +206,7 @@ static void emit_linterp( struct brw_compile *p, } -static void emit_pinterp( struct brw_compile *p, +static void emit_pinterp( struct brw_compile *p, const struct brw_reg *dst, GLuint mask, const struct brw_reg *arg0, @@ -236,7 +236,7 @@ static void emit_pinterp( struct brw_compile *p, } -static void emit_cinterp( struct brw_compile *p, +static void emit_cinterp( struct brw_compile *p, const struct brw_reg *dst, GLuint mask, const struct brw_reg *arg0 ) @@ -359,9 +359,9 @@ void emit_ddxy(struct brw_compile *p, brw_set_saturate(p, 0); } -static void emit_alu1( struct brw_compile *p, - struct brw_instruction *(*func)(struct brw_compile *, - struct brw_reg, +static void emit_alu1( struct brw_compile *p, + struct brw_instruction *(*func)(struct brw_compile *, + struct brw_reg, struct brw_reg), const struct brw_reg *dst, GLuint mask, @@ -383,10 +383,10 @@ static void emit_alu1( struct brw_compile *p, } -static void emit_alu2( struct brw_compile *p, - struct brw_instruction *(*func)(struct brw_compile *, - struct brw_reg, - struct brw_reg, +static void emit_alu2( struct brw_compile *p, + struct brw_instruction *(*func)(struct brw_compile *, + struct brw_reg, + struct brw_reg, struct brw_reg), const struct brw_reg *dst, GLuint mask, @@ -409,7 +409,7 @@ static void emit_alu2( struct brw_compile *p, } -static void emit_mad( struct brw_compile *p, +static void emit_mad( struct brw_compile *p, const struct brw_reg *dst, GLuint mask, const struct brw_reg *arg0, @@ -443,7 +443,7 @@ static void emit_trunc( struct brw_compile *p, } } -static void emit_lrp( struct brw_compile *p, +static void emit_lrp( struct brw_compile *p, const struct brw_reg *dst, GLuint mask, const struct brw_reg *arg0, @@ -455,8 +455,8 @@ static void emit_lrp( struct brw_compile *p, /* Uses dst as a temporary: */ for (i = 0; i < 4; i++) { - if (mask & (1<payload.depth[0].hw_reg, BRW_REGISTER_TYPE_UW), BTI_TEXTURE(inst->tex_unit), sampler, /* sampler index */ inst->writemask, - msg_type, + msg_type, responseLength, msgLength, - 0, + 0, 1, - BRW_SAMPLER_SIMD_MODE_SIMD16); + BRW_SAMPLER_SIMD_MODE_SIMD16); } @@ -922,7 +922,7 @@ static void emit_txb( struct brw_wm_compile *c, else msg_type = BRW_SAMPLER_MESSAGE_SIMD16_SAMPLE_BIAS; - brw_SAMPLE(p, + brw_SAMPLE(p, retype(vec16(dst[0]), BRW_REGISTER_TYPE_UW), 1, retype(c->payload.depth[0].hw_reg, BRW_REGISTER_TYPE_UW), @@ -932,13 +932,13 @@ static void emit_txb( struct brw_wm_compile *c, msg_type, 8, /* responseLength */ msgLength, - 0, + 0, 1, - BRW_SAMPLER_SIMD_MODE_SIMD16); + BRW_SAMPLER_SIMD_MODE_SIMD16); } -static void emit_lit( struct brw_compile *p, +static void emit_lit( struct brw_compile *p, const struct brw_reg *dst, GLuint mask, const struct brw_reg *arg0 ) @@ -965,11 +965,11 @@ static void emit_lit( struct brw_compile *p, */ brw_CMP(p, brw_null_reg(), BRW_CONDITIONAL_LE, arg0[0], brw_imm_f(0)); { - if (mask & BRW_WRITEMASK_Y) + if (mask & BRW_WRITEMASK_Y) brw_MOV(p, dst[1], brw_imm_f(0)); - if (mask & BRW_WRITEMASK_Z) - brw_MOV(p, dst[2], brw_imm_f(0)); + if (mask & BRW_WRITEMASK_Z) + brw_MOV(p, dst[2], brw_imm_f(0)); } brw_set_predicate_control(p, BRW_PREDICATE_NONE); } @@ -984,12 +984,12 @@ static void emit_kil( struct brw_wm_compile *c, struct brw_compile *p = &c->func; struct brw_reg r0uw = retype(brw_vec1_grf(0, 0), BRW_REGISTER_TYPE_UW); GLuint i; - + /* XXX - usually won't need 4 compares! */ for (i = 0; i < 4; i++) { brw_push_insn_state(p); - brw_CMP(p, brw_null_reg(), BRW_CONDITIONAL_GE, arg0[i], brw_imm_f(0)); + brw_CMP(p, brw_null_reg(), BRW_CONDITIONAL_GE, arg0[i], brw_imm_f(0)); brw_set_predicate_control_flag_value(p, 0xff); brw_set_compression_control(p, BRW_COMPRESSION_NONE); brw_AND(p, r0uw, brw_flag_reg(), r0uw); @@ -1019,7 +1019,7 @@ static void fire_fb_write( struct brw_wm_compile *c, GLuint eot ) { struct brw_compile *p = &c->func; - + /* Pass through control information: */ /* mov (8) m1.0<1>:ud r1.0<8;8,1>:ud { Align1 NoMask } */ @@ -1027,7 +1027,7 @@ static void fire_fb_write( struct brw_wm_compile *c, brw_push_insn_state(p); brw_set_mask_control(p, BRW_MASK_DISABLE); /* ? */ brw_set_compression_control(p, BRW_COMPRESSION_NONE); - brw_MOV(p, + brw_MOV(p, brw_message_reg(base_reg + 1), brw_vec8_grf(1, 0)); brw_pop_insn_state(p); @@ -1039,9 +1039,9 @@ static void fire_fb_write( struct brw_wm_compile *c, retype(vec16(brw_null_reg()), BRW_REGISTER_TYPE_UW), base_reg, retype(brw_vec8_grf(0, 0), BRW_REGISTER_TYPE_UW), - target, + target, nr, - 0, + 0, eot); } @@ -1089,7 +1089,7 @@ static void emit_fb_write( struct brw_wm_compile *c, */ { brw_push_insn_state(p); - + for (channel = 0; channel < 4; channel++) { /* mov (8) m2.0<1>:ud r28.0<8;8,1>:ud { Align1 } */ /* mov (8) m6.0<1>:ud r29.0<8;8,1>:ud { Align1 SecHalf } */ @@ -1098,7 +1098,7 @@ static void emit_fb_write( struct brw_wm_compile *c, brw_MOV(p, brw_message_reg(nr + channel), arg0[channel]); - + brw_set_compression_control(p, BRW_COMPRESSION_2NDHALF); brw_MOV(p, brw_message_reg(nr + channel + 4), @@ -1108,15 +1108,15 @@ static void emit_fb_write( struct brw_wm_compile *c, /* skip over the regs populated above: */ nr += 8; - + brw_pop_insn_state(p); } if (c->key.source_depth_to_render_target) { - if (c->key.computes_depth) + if (c->key.computes_depth) brw_MOV(p, brw_message_reg(nr), arg2[2]); - else + else brw_MOV(p, brw_message_reg(nr), arg1[1]); /* ? */ nr += 2; @@ -1152,13 +1152,13 @@ static void emit_fb_write( struct brw_wm_compile *c, struct brw_reg v1_null_ud = vec1(retype(brw_null_reg(), BRW_REGISTER_TYPE_UD)); struct brw_reg ip = brw_ip_reg(); struct brw_instruction *jmp; - + brw_set_compression_control(p, BRW_COMPRESSION_NONE); brw_set_conditionalmod(p, BRW_CONDITIONAL_Z); - brw_AND(p, - v1_null_ud, - get_element_ud(brw_vec8_grf(1,0), 6), - brw_imm_ud(1<<26)); + brw_AND(p, + v1_null_ud, + get_element_ud(brw_vec8_grf(1,0), 6), + brw_imm_ud(1<<26)); jmp = brw_JMPI(p, ip, ip, brw_imm_d(0)); { @@ -1176,7 +1176,7 @@ static void emit_fb_write( struct brw_wm_compile *c, /** - * Move a GPR to scratch memory. + * Move a GPR to scratch memory. */ static void emit_spill( struct brw_wm_compile *c, struct brw_reg reg, @@ -1193,14 +1193,14 @@ static void emit_spill( struct brw_wm_compile *c, mov (1) r0.2<1>:d 0x00000080:d { Align1 NoMask } send (16) null.0<1>:uw m1 r0.0<8;8,1>:uw 0x053003ff:ud { Align1 } */ - brw_dp_WRITE_16(p, + brw_dp_WRITE_16(p, retype(vec16(brw_vec8_grf(0, 0)), BRW_REGISTER_TYPE_UW), slot); } /** - * Load a GPR from scratch memory. + * Load a GPR from scratch memory. */ static void emit_unspill( struct brw_wm_compile *c, struct brw_reg reg, @@ -1262,7 +1262,7 @@ static void spill_values( struct brw_wm_compile *c, GLuint i; for (i = 0; i < nr; i++) - if (values[i].spill_slot) + if (values[i].spill_slot) emit_spill(c, values[i].hw_reg, values[i].spill_slot); } @@ -1281,17 +1281,17 @@ void brw_wm_emit( struct brw_wm_compile *c ) spill_values(c, c->payload.depth, 4); spill_values(c, c->creg, c->nr_creg); spill_values(c, c->payload.input_interp, PIPE_MAX_SHADER_INPUTS); - + for (insn = 0; insn < c->nr_insns; insn++) { struct brw_wm_instruction *inst = &c->instruction[insn]; struct brw_reg args[3][4], dst[4]; GLuint i, dst_flags; - + /* Get argument regs: */ - for (i = 0; i < 3; i++) + for (i = 0; i < 3; i++) get_argument_regs(c, inst->src[i], args[i]); /* Get dest regs: @@ -1301,11 +1301,11 @@ void brw_wm_emit( struct brw_wm_compile *c ) dst[i] = inst->dst[i]->hw_reg; else dst[i] = brw_null_reg(); - + /* Flags */ dst_flags = inst->writemask; - if (inst->saturate) + if (inst->saturate) dst_flags |= SATURATE; switch (inst->opcode) { @@ -1389,7 +1389,7 @@ void brw_wm_emit( struct brw_wm_compile *c ) emit_lrp(p, dst, dst_flags, args[0], args[1], args[2]); break; - case TGSI_OPCODE_MAD: + case TGSI_OPCODE_MAD: emit_mad(p, dst, dst_flags, args[0], args[1], args[2]); break; @@ -1503,14 +1503,14 @@ void brw_wm_emit( struct brw_wm_compile *c ) default: debug_printf("Unsupported opcode %i (%s) in fragment shader\n", - inst->opcode, + inst->opcode, tgsi_get_opcode_info(inst->opcode)->mnemonic); } - + for (i = 0; i < 4; i++) - if (inst->dst[i] && inst->dst[i]->spill_slot) - emit_spill(c, - inst->dst[i]->hw_reg, + if (inst->dst[i] && inst->dst[i]->spill_slot) + emit_spill(c, + inst->dst[i]->hw_reg, inst->dst[i]->spill_slot); } diff --git a/src/gallium/drivers/i965/brw_wm_fp.c b/src/gallium/drivers/i965/brw_wm_fp.c index f7ee55c..94508ec 100644 --- a/src/gallium/drivers/i965/brw_wm_fp.c +++ b/src/gallium/drivers/i965/brw_wm_fp.c @@ -2,7 +2,7 @@ Copyright (C) Intel Corp. 2006. All Rights Reserved. Intel funded Tungsten Graphics (http://www.tungstengraphics.com) to develop this 3D driver. - + 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, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - + The above copyright notice and this permission notice (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 NONINFRINGEMENT. @@ -22,13 +22,13 @@ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - + **********************************************************************/ /* * Authors: * Keith Whitwell */ - + #include "pipe/p_shader_tokens.h" @@ -114,7 +114,7 @@ static int match_or_expand_immediate( const float *v, unsigned *swizzle ) { unsigned i, j; - + *swizzle = 0; for (i = 0; i < nr; i++) { @@ -128,7 +128,7 @@ static int match_or_expand_immediate( const float *v, } if (!found) { - if (*nr2 >= 4) + if (*nr2 >= 4) return FALSE; v2[*nr2] = v[i]; @@ -144,8 +144,8 @@ static int match_or_expand_immediate( const float *v, /* Internally generated immediates: overkill... */ -static struct brw_fp_src src_imm( struct brw_wm_compile *c, - const GLfloat *v, +static struct brw_fp_src src_imm( struct brw_wm_compile *c, + const GLfloat *v, unsigned nr) { unsigned i, j; @@ -156,10 +156,10 @@ static struct brw_fp_src src_imm( struct brw_wm_compile *c, */ for (i = 0; i < c->nr_immediates; i++) { - if (match_or_expand_immediate( v, + if (match_or_expand_immediate( v, nr, c->immediate[i].v, - &c->immediate[i].nr, + &c->immediate[i].nr, &swizzle )) goto out; } @@ -169,7 +169,7 @@ static struct brw_fp_src src_imm( struct brw_wm_compile *c, if (match_or_expand_immediate( v, nr, c->immediate[i].v, - &c->immediate[i].nr, + &c->immediate[i].nr, &swizzle )) goto out; } @@ -268,7 +268,7 @@ static void release_temp( struct brw_wm_compile *c, struct brw_fp_dst temp ) /*********************************************************************** - * Instructions + * Instructions */ static struct brw_fp_instruction *get_fp_inst(struct brw_wm_compile *c) @@ -305,7 +305,7 @@ static struct brw_fp_instruction * emit_tex_op(struct brw_wm_compile *c, return inst; } - + static INLINE void emit_op3(struct brw_wm_compile *c, GLuint op, @@ -384,11 +384,11 @@ static struct brw_fp_src get_pixel_xy( struct brw_wm_compile *c ) if (src_is_undef(c->fp_pixel_xy)) { struct brw_fp_dst pixel_xy = get_temp(c); struct brw_fp_src payload_r0_depth = src_reg(BRW_FILE_PAYLOAD, PAYLOAD_DEPTH); - - + + /* Emit the out calculations, and hold onto the results. Use * two instructions as a temporary is required. - */ + */ /* pixel_xy.xy = PIXELXY payload[0]; */ emit_op1(c, @@ -408,16 +408,16 @@ static struct brw_fp_src get_delta_xy( struct brw_wm_compile *c ) struct brw_fp_dst delta_xy = get_temp(c); struct brw_fp_src pixel_xy = get_pixel_xy(c); struct brw_fp_src payload_r0_depth = src_reg(BRW_FILE_PAYLOAD, PAYLOAD_DEPTH); - + /* deltas.xy = DELTAXY pixel_xy, payload[0] */ emit_op3(c, WM_DELTAXY, dst_mask(delta_xy, BRW_WRITEMASK_XY), - pixel_xy, + pixel_xy, payload_r0_depth, src_undef()); - + c->fp_delta_xy = src_reg_from_dst(delta_xy); } @@ -430,7 +430,7 @@ static struct brw_fp_src get_pixel_w( struct brw_wm_compile *c ) struct brw_fp_dst pixel_w = get_temp(c); struct brw_fp_src deltas = get_delta_xy(c); - /* XXX: assuming position is always first -- valid? + /* XXX: assuming position is always first -- valid? */ struct brw_fp_src interp_wpos = src_reg(BRW_FILE_PAYLOAD, 0); @@ -440,9 +440,9 @@ static struct brw_fp_src get_pixel_w( struct brw_wm_compile *c ) WM_PIXELW, dst_mask(pixel_w, BRW_WRITEMASK_W), interp_wpos, - deltas, + deltas, src_undef()); - + c->fp_pixel_w = src_reg_from_dst(pixel_w); } @@ -476,7 +476,7 @@ static void emit_interp( struct brw_wm_compile *c, WM_WPOSXY, dst_mask(dst, BRW_WRITEMASK_XY), get_pixel_xy(c)); - + /* TGSI_FILE_INPUT.attr.xyzw = INTERP payload.interp[attr].x, deltas.xyw */ emit_op2(c, @@ -536,7 +536,7 @@ static void emit_interp( struct brw_wm_compile *c, emit_op0(c, WM_FRONTFACING, dst_mask(dst, BRW_WRITEMASK_X)); - + emit_op1(c, TGSI_OPCODE_MOV, dst_mask(dst, BRW_WRITEMASK_YZ), @@ -568,7 +568,7 @@ static void emit_interp( struct brw_wm_compile *c, src_imm1f(c, 1.0f)); break; - default: + default: switch (interp_mode) { case TGSI_INTERPOLATE_CONSTANT: emit_op1(c, @@ -600,14 +600,14 @@ static void emit_interp( struct brw_wm_compile *c, /*********************************************************************** - * Expand various instructions here to simpler forms. + * Expand various instructions here to simpler forms. */ static void precalc_dst( struct brw_wm_compile *c, struct brw_fp_dst dst, struct brw_fp_src src0, struct brw_fp_src src1 ) { - if (dst.writemask & BRW_WRITEMASK_Y) { + if (dst.writemask & BRW_WRITEMASK_Y) { /* dst.y = mul src0.y, src1.y */ emit_op2(c, @@ -693,7 +693,7 @@ static void precalc_tex( struct brw_wm_compile *c, tmpsrc = src_reg_from_dst(tmp); /* tmp = abs(src0) */ - emit_op1(c, + emit_op1(c, TGSI_OPCODE_MOV, tmp, src_abs(src0)); @@ -745,10 +745,10 @@ static void precalc_tex( struct brw_wm_compile *c, struct brw_fp_src tmpsrc = src_reg_from_dst(tmp); struct brw_fp_src C0 = src_imm4f( c, -.5, -.0625, -.5, 1.164 ); struct brw_fp_src C1 = src_imm4f( c, 1.596, -0.813, 2.018, -.391 ); - + /* tmp = TEX ... */ - emit_tex_op(c, + emit_tex_op(c, TGSI_OPCODE_TEX, dst_saturate(tmp, dst.saturate), unit, @@ -772,7 +772,7 @@ static void precalc_tex( struct brw_wm_compile *c, tmpsrc, src_scalar(C0, W)); - /* + /* * if (UV swaped) * RGB.xyz = MAD YUV.zzx, C1, YUV.y * else @@ -781,8 +781,8 @@ static void precalc_tex( struct brw_wm_compile *c, emit_op3(c, TGSI_OPCODE_MAD, dst_mask(dst, BRW_WRITEMASK_XYZ), - ( swap_uv ? - src_swizzle(tmpsrc, Z,Z,X,X) : + ( swap_uv ? + src_swizzle(tmpsrc, Z,Z,X,X) : src_swizzle(tmpsrc, X,X,Z,Z)), C1, src_scalar(tmpsrc, Y)); @@ -800,7 +800,7 @@ static void precalc_tex( struct brw_wm_compile *c, } else { /* ordinary RGBA tex instruction */ - emit_tex_op(c, + emit_tex_op(c, TGSI_OPCODE_TEX, dst, unit, @@ -826,7 +826,7 @@ static void precalc_tex( struct brw_wm_compile *c, * Check if the given TXP instruction really needs the divide-by-W step. */ static GLboolean projtex( struct brw_wm_compile *c, - unsigned target, + unsigned target, struct brw_fp_src src ) { /* Only try to detect the simplest cases. Could detect (later) @@ -838,8 +838,8 @@ static GLboolean projtex( struct brw_wm_compile *c, */ if (target == TGSI_TEXTURE_CUBE) return GL_FALSE; /* ut2004 gun rendering !?! */ - - if (src.file == TGSI_FILE_INPUT && + + if (src.file == TGSI_FILE_INPUT && BRW_GET_SWZ(src.swizzle, W) == W && c->fp->info.input_interpolate[src.index] != TGSI_INTERPOLATE_PERSPECTIVE) return GL_FALSE; @@ -878,7 +878,7 @@ static void precalc_txp( struct brw_wm_compile *c, /* dst = TEX tmp0 */ - precalc_tex(c, + precalc_tex(c, dst, target, unit, @@ -931,7 +931,7 @@ static void emit_fb_write( struct brw_wm_compile *c ) for (i = 0 ; i < c->key.nr_cbufs; i++) { struct brw_fp_src outcolor; - + outcolor = find_output_by_semantic(c, TGSI_SEMANTIC_COLOR, i); /* Use emit_tex_op so that we can specify the inst->target @@ -961,12 +961,12 @@ static struct brw_fp_dst translate_dst( struct brw_wm_compile *c, out.writemask = dst->Register.WriteMask; out.indirect = dst->Register.Indirect; out.saturate = (saturate == TGSI_SAT_ZERO_ONE); - + if (out.indirect) { assert(dst->Indirect.File == TGSI_FILE_ADDRESS); assert(dst->Indirect.Index == 0); } - + return out; } @@ -984,7 +984,7 @@ static struct brw_fp_src translate_src( struct brw_wm_compile *c, (src->Register.SwizzleY << 2) | (src->Register.SwizzleZ << 4) | (src->Register.SwizzleW << 6)); - + switch (tgsi_util_get_full_src_register_sign_mode( src, 0 )) { case TGSI_UTIL_SIGN_CLEAR: out.abs = 1; @@ -1012,7 +1012,7 @@ static struct brw_fp_src translate_src( struct brw_wm_compile *c, assert(src->Indirect.File == TGSI_FILE_ADDRESS); assert(src->Indirect.Index == 0); } - + return out; } @@ -1031,27 +1031,27 @@ static void emit_insn( struct brw_wm_compile *c, for (i = 0; i < inst->Instruction.NumSrcRegs; i++) src[i] = translate_src( c, &inst->Src[i] ); - + switch (opcode) { case TGSI_OPCODE_ABS: emit_op1(c, TGSI_OPCODE_MOV, - dst, + dst, src_abs(src[0])); break; - case TGSI_OPCODE_SUB: + case TGSI_OPCODE_SUB: emit_op2(c, TGSI_OPCODE_ADD, dst, src[0], src_negate(src[1])); break; - case TGSI_OPCODE_SCS: + case TGSI_OPCODE_SCS: emit_op1(c, TGSI_OPCODE_SCS, dst_mask(dst, BRW_WRITEMASK_XY), src[0]); break; - + case TGSI_OPCODE_DST: precalc_dst(c, dst, src[0], src[1]); break; @@ -1086,14 +1086,14 @@ static void emit_insn( struct brw_wm_compile *c, src[1]); break; - case TGSI_OPCODE_XPD: + case TGSI_OPCODE_XPD: emit_op2(c, TGSI_OPCODE_XPD, dst_mask(dst, BRW_WRITEMASK_XYZ), - src[0], + src[0], src[1]); break; - case TGSI_OPCODE_KIL: + case TGSI_OPCODE_KIL: emit_op1(c, TGSI_OPCODE_KIL, dst_mask(dst_undef(), 0), src[0]); @@ -1128,7 +1128,7 @@ int brw_wm_pass_fp( struct brw_wm_compile *c ) if (BRW_DEBUG & DEBUG_WM) { debug_printf("pre-fp:\n"); - tgsi_dump(fs->tokens, 0); + tgsi_dump(fs->tokens, 0); } c->fp_pixel_xy = src_undef(); @@ -1173,13 +1173,13 @@ int brw_wm_pass_fp( struct brw_wm_compile *c ) mask = decl->Declaration.UsageMask; for (attrib = first; attrib <= last; attrib++) { - emit_interp(c, - attrib, + emit_interp(c, + attrib, decl->Semantic.Name, decl->Declaration.Interpolate ); } } - + break; case TGSI_TOKEN_TYPE_IMMEDIATE: diff --git a/src/gallium/drivers/i965/brw_wm_glsl.c b/src/gallium/drivers/i965/brw_wm_glsl.c index 3b3afc3..2a37b82 100644 --- a/src/gallium/drivers/i965/brw_wm_glsl.c +++ b/src/gallium/drivers/i965/brw_wm_glsl.c @@ -90,7 +90,7 @@ num_grf_used(const struct brw_wm_compile *c) /** * Record the mapping of a Mesa register to a hardware register. */ -static void set_reg(struct brw_wm_compile *c, int file, int index, +static void set_reg(struct brw_wm_compile *c, int file, int index, int component, struct brw_reg reg) { c->wm_regs[file][index][component].reg = reg; @@ -151,14 +151,14 @@ static void release_tmps(struct brw_wm_compile *c, int mark) * \param neg negate value? * \param abs take absolute value? */ -static struct brw_reg +static struct brw_reg get_reg(struct brw_wm_compile *c, int file, int index, int component, int nr, GLuint neg, GLuint abs) { struct brw_reg reg; switch (file) { case TGSI_FILE_NULL: - return brw_null_reg(); + return brw_null_reg(); case TGSI_FILE_CONSTANT: case TGSI_FILE_TEMPORARY: @@ -331,7 +331,7 @@ static void prealloc_reg(struct brw_wm_compile *c) c->first_free_grf = 0; for (i = 0; i < 4; i++) { - if (i < c->key.nr_depth_regs) + if (i < c->key.nr_depth_regs) reg = brw_vec8_grf(i * 2, 0); else reg = brw_vec8_grf(0, 0); @@ -361,7 +361,7 @@ static void prealloc_reg(struct brw_wm_compile *c) c->prog_data.nr_params = 0; } else { - const struct gl_program_parameter_list *plist = + const struct gl_program_parameter_list *plist = c->fp->program.Base.Parameters; int index = 0; @@ -500,7 +500,7 @@ static void fetch_constants(struct brw_wm_compile *c, /** * Convert Mesa dst register to brw register. */ -static struct brw_reg get_dst_reg(struct brw_wm_compile *c, +static struct brw_reg get_dst_reg(struct brw_wm_compile *c, const struct brw_fp_instruction *inst, GLuint component) { @@ -552,7 +552,7 @@ get_src_reg_const(struct brw_wm_compile *c, /** * Convert Mesa src register to brw register. */ -static struct brw_reg get_src_reg(struct brw_wm_compile *c, +static struct brw_reg get_src_reg(struct brw_wm_compile *c, const struct brw_fp_instruction *inst, GLuint srcRegIndex, GLuint channel) { @@ -576,7 +576,7 @@ static struct brw_reg get_src_reg(struct brw_wm_compile *c, } else { /* other type of source register */ - return get_reg(c, src->File, src->Index, component, nr, + return get_reg(c, src->File, src->Index, component, nr, src->Negate, src->Abs); } } @@ -589,9 +589,9 @@ static struct brw_reg get_src_reg(struct brw_wm_compile *c, * For instructions with more than one operand, only the second can be a * immediate. This means that we treat some immediates as constants * (which why TGSI_FILE_IMMEDIATE is checked in fetch_constants()). - * + * */ -static struct brw_reg get_src_reg_imm(struct brw_wm_compile *c, +static struct brw_reg get_src_reg_imm(struct brw_wm_compile *c, const struct brw_fp_instruction *inst, GLuint srcRegIndex, GLuint channel) { @@ -633,7 +633,7 @@ static void invoke_subroutine( struct brw_wm_compile *c, struct brw_compile *p = &c->func; assert( subroutine < BRW_WM_MAX_SUBROUTINE ); - + if( c->subroutines[ subroutine ] ) { /* subroutine previously emitted: reuse existing instructions */ @@ -641,7 +641,7 @@ static void invoke_subroutine( struct brw_wm_compile *c, struct brw_reg return_address = retype( alloc_tmp( c ), BRW_REGISTER_TYPE_UD ); int here = p->nr_insn; - + brw_push_insn_state(p); brw_set_mask_control(p, BRW_MASK_DISABLE); brw_ADD( p, return_address, brw_ip_reg(), brw_imm_ud( 2 << 4 ) ); @@ -654,29 +654,29 @@ static void invoke_subroutine( struct brw_wm_compile *c, release_tmps( c, mark ); } else { /* previously unused subroutine: emit, and mark for later reuse */ - + int mark = mark_tmps( c ); struct brw_reg return_address = retype( alloc_tmp( c ), BRW_REGISTER_TYPE_UD ); struct brw_instruction *calc; int base = p->nr_insn; - + brw_push_insn_state(p); brw_set_mask_control(p, BRW_MASK_DISABLE); calc = brw_ADD( p, return_address, brw_ip_reg(), brw_imm_ud( 0 ) ); brw_pop_insn_state(p); - + c->subroutines[ subroutine ] = p->nr_insn; emit( c ); - + brw_push_insn_state(p); brw_set_mask_control(p, BRW_MASK_DISABLE); brw_MOV( p, brw_ip_reg(), return_address ); brw_pop_insn_state(p); brw_set_src1( calc, brw_imm_ud( ( p->nr_insn - base ) << 4 ) ); - + release_tmps( c, mark ); } } @@ -803,7 +803,7 @@ static void fire_fb_write( struct brw_wm_compile *c, retype(vec8(brw_null_reg()), BRW_REGISTER_TYPE_UW), base_reg, retype(brw_vec8_grf(0, 0), BRW_REGISTER_TYPE_UW), - target, + target, nr, 0, eot); @@ -988,7 +988,7 @@ static void emit_pinterp(struct brw_wm_compile *c, if (mask & (1<func; struct brw_reg src0, addr_reg; brw_set_saturate(p, (inst->SaturateMode != SATURATE_OFF) ? 1 : 0); - addr_reg = brw_uw8_reg(BRW_ARCHITECTURE_REGISTER_FILE, + addr_reg = brw_uw8_reg(BRW_ARCHITECTURE_REGISTER_FILE, BRW_ARF_ADDRESS, 0); src0 = get_src_reg(c, inst, 0, 0); /* channel 0 */ brw_MOV(p, addr_reg, src0); @@ -1527,7 +1527,7 @@ static INLINE struct brw_reg odd_bytes( struct brw_reg reg ) } - + static void emit_wpos_xy(struct brw_wm_compile *c, const struct brw_fp_instruction *inst) { @@ -1562,7 +1562,7 @@ static void emit_wpos_xy(struct brw_wm_compile *c, /* TODO BIAS on SIMD8 not working yet... - */ + */ static void emit_txb(struct brw_wm_compile *c, const struct brw_fp_instruction *inst) { @@ -1577,7 +1577,7 @@ static void emit_txb(struct brw_wm_compile *c, payload_reg = get_reg(c, TGSI_FILE_PAYLOAD, PAYLOAD_DEPTH, 0, 1, 0, 0); - for (i = 0; i < 4; i++) + for (i = 0; i < 4; i++) dst[i] = get_dst_reg(c, inst, i); for (i = 0; i < 4; i++) src[i] = get_src_reg(c, inst, 0, i); @@ -1626,7 +1626,7 @@ static void emit_txb(struct brw_wm_compile *c, 4, /* msg_length */ 0, /* eot */ 1, - BRW_SAMPLER_SIMD_MODE_SIMD8); + BRW_SAMPLER_SIMD_MODE_SIMD8); } @@ -1647,7 +1647,7 @@ static void emit_tex(struct brw_wm_compile *c, payload_reg = get_reg(c, TGSI_FILE_PAYLOAD, PAYLOAD_DEPTH, 0, 1, 0, 0); - for (i = 0; i < 4; i++) + for (i = 0; i < 4; i++) dst[i] = get_dst_reg(c, inst, i); for (i = 0; i < 4; i++) src[i] = get_src_reg(c, inst, 0, i); @@ -1697,7 +1697,7 @@ static void emit_tex(struct brw_wm_compile *c, /* Does it work for shadow on SIMD8 ? */ msg_type = BRW_SAMPLER_MESSAGE_SIMD8_SAMPLE; } - + brw_SAMPLE(p, retype(vec8(dst[0]), BRW_REGISTER_TYPE_UW), /* dest */ 1, /* msg_reg_nr */ @@ -1710,7 +1710,7 @@ static void emit_tex(struct brw_wm_compile *c, shadow ? 6 : 4, /* msg_length */ 0, /* eot */ 1, - BRW_SAMPLER_SIMD_MODE_SIMD8); + BRW_SAMPLER_SIMD_MODE_SIMD8); if (shadow) brw_MOV(p, dst[3], brw_imm_f(1.0)); @@ -1785,12 +1785,12 @@ static void brw_wm_emit_branching_shader(struct brw_context *brw, struct brw_wm_ case WM_PIXELXY: emit_pixel_xy(c, inst); break; - case WM_DELTAXY: + case WM_DELTAXY: emit_delta_xy(c, inst); break; case WM_PIXELW: emit_pixel_w(c, inst); - break; + break; case WM_LINTERP: emit_linterp(c, inst); break; @@ -1860,8 +1860,8 @@ static void brw_wm_emit_branching_shader(struct brw_context *brw, struct brw_wm_ case OPCODE_LG2: emit_lg2(c, inst); break; - case OPCODE_MIN: - case OPCODE_MAX: + case OPCODE_MIN: + case OPCODE_MAX: emit_min_max(c, inst); break; case OPCODE_DDX: @@ -1929,7 +1929,7 @@ static void brw_wm_emit_branching_shader(struct brw_context *brw, struct brw_wm_ case OPCODE_ENDSUB: /* no-op */ break; - case OPCODE_CAL: + case OPCODE_CAL: brw_push_insn_state(p); brw_set_mask_control(p, BRW_MASK_DISABLE); brw_set_access_mode(p, BRW_ALIGN_1); @@ -1965,14 +1965,14 @@ static void brw_wm_emit_branching_shader(struct brw_context *brw, struct brw_wm_ brw_CONT(p); brw_set_predicate_control(p, BRW_PREDICATE_NONE); break; - case OPCODE_ENDLOOP: + case OPCODE_ENDLOOP: { struct brw_instruction *inst0, *inst1; GLuint br = 1; if (BRW_IS_IGDNG(brw)) br = 2; - + loop_depth--; inst0 = inst1 = brw_WHILE(p, loop_inst[loop_depth]); /* patch all the BREAK/CONT instructions from last BGNLOOP */ @@ -2009,7 +2009,7 @@ static void brw_wm_emit_branching_shader(struct brw_context *brw, struct brw_wm_ /** * Do GPU code generation for shaders that use GLSL features such as - * flow control. Other shaders will be compiled with the + * flow control. Other shaders will be compiled with the */ void brw_wm_branching_shader_emit(struct brw_context *brw, struct brw_wm_compile *c) { diff --git a/src/gallium/drivers/i965/brw_wm_iz.c b/src/gallium/drivers/i965/brw_wm_iz.c index 6f1e9fc..d834f64 100644 --- a/src/gallium/drivers/i965/brw_wm_iz.c +++ b/src/gallium/drivers/i965/brw_wm_iz.c @@ -2,7 +2,7 @@ Copyright (C) Intel Corp. 2006. All Rights Reserved. Intel funded Tungsten Graphics (http://www.tungstengraphics.com) to develop this 3D driver. - + 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, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - + The above copyright notice and this permission notice (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 NONINFRINGEMENT. @@ -22,13 +22,13 @@ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - + **********************************************************************/ /* * Authors: * Keith Whitwell */ - + #include "brw_wm.h" @@ -49,70 +49,70 @@ const struct { GLuint ds_present:1; } wm_iz_table[IZ_BIT_MAX] = { - { P, 0, 0, 0, 0 }, - { P, 0, 0, 0, 0 }, - { P, 0, 0, 0, 0 }, - { P, 0, 0, 0, 0 }, - { P, 0, 0, 0, 0 }, - { N, 1, 1, 0, 0 }, - { N, 0, 1, 0, 0 }, - { N, 0, 1, 0, 0 }, - { P, 0, 0, 0, 0 }, - { P, 0, 0, 0, 0 }, - { C, 0, 1, 1, 0 }, - { C, 0, 1, 1, 0 }, - { P, 0, 0, 0, 0 }, - { N, 1, 1, 0, 0 }, - { C, 0, 1, 1, 0 }, - { C, 0, 1, 1, 0 }, - { P, 0, 0, 0, 0 }, - { P, 0, 0, 0, 0 }, - { P, 0, 0, 0, 0 }, - { P, 0, 0, 0, 0 }, - { P, 0, 0, 0, 0 }, - { N, 1, 1, 0, 0 }, - { N, 0, 1, 0, 0 }, - { N, 0, 1, 0, 0 }, - { P, 0, 0, 0, 0 }, - { P, 0, 0, 0, 0 }, - { C, 0, 1, 1, 0 }, - { C, 0, 1, 1, 0 }, - { P, 0, 0, 0, 0 }, - { N, 1, 1, 0, 0 }, - { C, 0, 1, 1, 0 }, - { C, 0, 1, 1, 0 }, - { P, 0, 0, 0, 0 }, - { P, 0, 0, 0, 0 }, - { P, 0, 0, 0, 0 }, - { P, 0, 0, 0, 0 }, - { P, 0, 0, 0, 0 }, - { N, 1, 1, 0, 1 }, - { N, 0, 1, 0, 1 }, - { N, 0, 1, 0, 1 }, - { P, 0, 0, 0, 0 }, - { P, 0, 0, 0, 0 }, - { C, 0, 1, 1, 1 }, - { C, 0, 1, 1, 1 }, - { P, 0, 0, 0, 0 }, - { N, 1, 1, 0, 1 }, - { C, 0, 1, 1, 1 }, - { C, 0, 1, 1, 1 }, - { P, 0, 0, 0, 0 }, - { C, 0, 0, 0, 1 }, - { P, 0, 0, 0, 0 }, - { C, 0, 1, 0, 1 }, - { P, 0, 0, 0, 0 }, - { C, 1, 1, 0, 1 }, - { C, 0, 1, 0, 1 }, - { C, 0, 1, 0, 1 }, - { P, 0, 0, 0, 0 }, - { C, 1, 1, 1, 1 }, - { C, 0, 1, 1, 1 }, - { C, 0, 1, 1, 1 }, - { P, 0, 0, 0, 0 }, - { C, 1, 1, 1, 1 }, - { C, 0, 1, 1, 1 }, - { C, 0, 1, 1, 1 } + { P, 0, 0, 0, 0 }, + { P, 0, 0, 0, 0 }, + { P, 0, 0, 0, 0 }, + { P, 0, 0, 0, 0 }, + { P, 0, 0, 0, 0 }, + { N, 1, 1, 0, 0 }, + { N, 0, 1, 0, 0 }, + { N, 0, 1, 0, 0 }, + { P, 0, 0, 0, 0 }, + { P, 0, 0, 0, 0 }, + { C, 0, 1, 1, 0 }, + { C, 0, 1, 1, 0 }, + { P, 0, 0, 0, 0 }, + { N, 1, 1, 0, 0 }, + { C, 0, 1, 1, 0 }, + { C, 0, 1, 1, 0 }, + { P, 0, 0, 0, 0 }, + { P, 0, 0, 0, 0 }, + { P, 0, 0, 0, 0 }, + { P, 0, 0, 0, 0 }, + { P, 0, 0, 0, 0 }, + { N, 1, 1, 0, 0 }, + { N, 0, 1, 0, 0 }, + { N, 0, 1, 0, 0 }, + { P, 0, 0, 0, 0 }, + { P, 0, 0, 0, 0 }, + { C, 0, 1, 1, 0 }, + { C, 0, 1, 1, 0 }, + { P, 0, 0, 0, 0 }, + { N, 1, 1, 0, 0 }, + { C, 0, 1, 1, 0 }, + { C, 0, 1, 1, 0 }, + { P, 0, 0, 0, 0 }, + { P, 0, 0, 0, 0 }, + { P, 0, 0, 0, 0 }, + { P, 0, 0, 0, 0 }, + { P, 0, 0, 0, 0 }, + { N, 1, 1, 0, 1 }, + { N, 0, 1, 0, 1 }, + { N, 0, 1, 0, 1 }, + { P, 0, 0, 0, 0 }, + { P, 0, 0, 0, 0 }, + { C, 0, 1, 1, 1 }, + { C, 0, 1, 1, 1 }, + { P, 0, 0, 0, 0 }, + { N, 1, 1, 0, 1 }, + { C, 0, 1, 1, 1 }, + { C, 0, 1, 1, 1 }, + { P, 0, 0, 0, 0 }, + { C, 0, 0, 0, 1 }, + { P, 0, 0, 0, 0 }, + { C, 0, 1, 0, 1 }, + { P, 0, 0, 0, 0 }, + { C, 1, 1, 0, 1 }, + { C, 0, 1, 0, 1 }, + { C, 0, 1, 0, 1 }, + { P, 0, 0, 0, 0 }, + { C, 1, 1, 1, 1 }, + { C, 0, 1, 1, 1 }, + { C, 0, 1, 1, 1 }, + { P, 0, 0, 0, 0 }, + { C, 1, 1, 1, 1 }, + { C, 0, 1, 1, 1 }, + { C, 0, 1, 1, 1 } }; /** @@ -127,7 +127,7 @@ void brw_wm_lookup_iz( GLuint line_aa, GLuint reg = 2; assert (lookup < IZ_BIT_MAX); - + if (lookup & IZ_PS_COMPUTES_DEPTH_BIT) key->computes_depth = 1; diff --git a/src/gallium/drivers/i965/brw_wm_pass0.c b/src/gallium/drivers/i965/brw_wm_pass0.c index 0bacad2..a797e1c 100644 --- a/src/gallium/drivers/i965/brw_wm_pass0.c +++ b/src/gallium/drivers/i965/brw_wm_pass0.c @@ -2,7 +2,7 @@ Copyright (C) Intel Corp. 2006. All Rights Reserved. Intel funded Tungsten Graphics (http://www.tungstengraphics.com) to develop this 3D driver. - + 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, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - + The above copyright notice and this permission notice (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 NONINFRINGEMENT. @@ -22,7 +22,7 @@ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - + **********************************************************************/ /* * Authors: @@ -97,12 +97,12 @@ static void pass0_set_fpreg_ref( struct brw_wm_compile *c, c->pass0_fp_reg[file][idx][component] = src_ref; } -static const struct brw_wm_ref *get_param_ref( struct brw_wm_compile *c, +static const struct brw_wm_ref *get_param_ref( struct brw_wm_compile *c, unsigned idx, unsigned component) { GLuint i = idx * 4 + component; - + if (i >= BRW_WM_MAX_PARAM) { debug_printf("%s: out of params\n", __FUNCTION__); c->prog_data.error = 1; @@ -147,13 +147,13 @@ static const struct brw_wm_ref *pass0_get_reg( struct brw_wm_compile *c, break; case TGSI_FILE_CONSTANT: - ref = get_param_ref(c, + ref = get_param_ref(c, c->fp->info.immediate_count + idx, component); break; case TGSI_FILE_IMMEDIATE: - ref = get_param_ref(c, + ref = get_param_ref(c, idx, component); break; @@ -273,7 +273,7 @@ translate_insn(struct brw_wm_compile *c, /*********************************************************************** * Optimize moves and swizzles away: - */ + */ static void pass0_precalc_mov( struct brw_wm_compile *c, const struct brw_fp_instruction *inst ) { @@ -293,7 +293,7 @@ static void pass0_precalc_mov( struct brw_wm_compile *c, refs[i] = get_new_ref(c, inst->src[0], i, NULL); } for (i = 0; i < 4; i++) { - if (writemask & (1 << i)) { + if (writemask & (1 << i)) { pass0_set_fpreg_ref( c, dst.file, dst.index, i, refs[i]); } } @@ -308,13 +308,13 @@ static void pass0_init_payload( struct brw_wm_compile *c ) for (i = 0; i < 4; i++) { GLuint j = i >= c->key.nr_depth_regs ? 0 : i; - pass0_set_fpreg_value( c, BRW_FILE_PAYLOAD, PAYLOAD_DEPTH, i, + pass0_set_fpreg_value( c, BRW_FILE_PAYLOAD, PAYLOAD_DEPTH, i, &c->payload.depth[j] ); } for (i = 0; i < c->key.nr_inputs; i++) - pass0_set_fpreg_value( c, BRW_FILE_PAYLOAD, i, 0, - &c->payload.input_interp[i] ); + pass0_set_fpreg_value( c, BRW_FILE_PAYLOAD, i, 0, + &c->payload.input_interp[i] ); } @@ -344,9 +344,9 @@ void brw_wm_pass0( struct brw_wm_compile *c ) const struct brw_fp_instruction *inst = &c->fp_instructions[insn]; /* Optimize away moves, otherwise emit translated instruction: - */ + */ switch (inst->opcode) { - case TGSI_OPCODE_MOV: + case TGSI_OPCODE_MOV: if (!inst->dst.saturate) { pass0_precalc_mov(c, inst); } @@ -359,7 +359,7 @@ void brw_wm_pass0( struct brw_wm_compile *c ) break; } } - + if (BRW_DEBUG & DEBUG_WM) { brw_wm_print_program(c, "pass0"); } diff --git a/src/gallium/drivers/i965/brw_wm_pass1.c b/src/gallium/drivers/i965/brw_wm_pass1.c index 005747f..952b2b5 100644 --- a/src/gallium/drivers/i965/brw_wm_pass1.c +++ b/src/gallium/drivers/i965/brw_wm_pass1.c @@ -2,7 +2,7 @@ Copyright (C) Intel Corp. 2006. All Rights Reserved. Intel funded Tungsten Graphics (http://www.tungstengraphics.com) to develop this 3D driver. - + 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, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - + The above copyright notice and this permission notice (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 NONINFRINGEMENT. @@ -22,13 +22,13 @@ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - + **********************************************************************/ /* * Authors: * Keith Whitwell */ - + #include "brw_wm.h" #include "brw_debug.h" @@ -105,14 +105,14 @@ static GLuint get_texcoord_mask( GLuint tex_idx ) case TGSI_TEXTURE_SHADOW2D: case TGSI_TEXTURE_SHADOWRECT: return BRW_WRITEMASK_XYZ; - default: + default: assert(0); return 0; } } -/* Step two: Basically this is dead code elimination. +/* Step two: Basically this is dead code elimination. * * Iterate backwards over instructions, noting which values * contribute to the final result. Adjust writemasks to only @@ -133,13 +133,13 @@ void brw_wm_pass1( struct brw_wm_compile *c ) } if (inst->opcode == WM_FB_WRITE) { - track_arg(c, inst, 0, BRW_WRITEMASK_XYZW); - track_arg(c, inst, 1, BRW_WRITEMASK_XYZW); + track_arg(c, inst, 0, BRW_WRITEMASK_XYZW); + track_arg(c, inst, 1, BRW_WRITEMASK_XYZW); if (c->key.source_depth_to_render_target && c->key.computes_depth) - track_arg(c, inst, 2, BRW_WRITEMASK_Z); + track_arg(c, inst, 2, BRW_WRITEMASK_Z); else - track_arg(c, inst, 2, 0); + track_arg(c, inst, 2, 0); continue; } @@ -189,17 +189,17 @@ void brw_wm_pass1( struct brw_wm_compile *c ) read0 = writemask; break; - case TGSI_OPCODE_MAD: + case TGSI_OPCODE_MAD: case TGSI_OPCODE_CMP: case TGSI_OPCODE_LRP: read0 = writemask; - read1 = writemask; - read2 = writemask; + read1 = writemask; + read2 = writemask; break; - case TGSI_OPCODE_XPD: - if (writemask & BRW_WRITEMASK_X) read0 |= BRW_WRITEMASK_YZ; - if (writemask & BRW_WRITEMASK_Y) read0 |= BRW_WRITEMASK_XZ; + case TGSI_OPCODE_XPD: + if (writemask & BRW_WRITEMASK_X) read0 |= BRW_WRITEMASK_YZ; + if (writemask & BRW_WRITEMASK_Y) read0 |= BRW_WRITEMASK_XZ; if (writemask & BRW_WRITEMASK_Z) read0 |= BRW_WRITEMASK_XY; read1 = read0; break; @@ -255,7 +255,7 @@ void brw_wm_pass1( struct brw_wm_compile *c ) read2 = BRW_WRITEMASK_W; /* pixel w */ break; - case TGSI_OPCODE_DP3: + case TGSI_OPCODE_DP3: read0 = BRW_WRITEMASK_XYZ; read1 = BRW_WRITEMASK_XYZ; break; @@ -270,7 +270,7 @@ void brw_wm_pass1( struct brw_wm_compile *c ) read1 = BRW_WRITEMASK_XYZW; break; - case TGSI_OPCODE_LIT: + case TGSI_OPCODE_LIT: read0 = BRW_WRITEMASK_XYW; break; diff --git a/src/gallium/drivers/i965/brw_wm_pass2.c b/src/gallium/drivers/i965/brw_wm_pass2.c index 19248b4..ab4eae7 100644 --- a/src/gallium/drivers/i965/brw_wm_pass2.c +++ b/src/gallium/drivers/i965/brw_wm_pass2.c @@ -2,7 +2,7 @@ Copyright (C) Intel Corp. 2006. All Rights Reserved. Intel funded Tungsten Graphics (http://www.tungstengraphics.com) to develop this 3D driver. - + 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, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - + The above copyright notice and this permission notice (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 NONINFRINGEMENT. @@ -22,13 +22,13 @@ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - + **********************************************************************/ /* * Authors: * Keith Whitwell */ - + #include "brw_debug.h" #include "brw_wm.h" @@ -72,15 +72,15 @@ static void init_registers( struct brw_wm_compile *c ) GLuint reg = 0; GLuint j; - for (j = 0; j < c->grf_limit; j++) + for (j = 0; j < c->grf_limit; j++) c->pass2_grf[j].nextuse = BRW_WM_MAX_INSN; /* Pre-allocate incoming payload regs: */ - for (j = 0; j < c->key.nr_depth_regs; j++) + for (j = 0; j < c->key.nr_depth_regs; j++) prealloc_reg(c, &c->payload.depth[j], reg++); - for (j = 0; j < c->nr_creg; j++) + for (j = 0; j < c->nr_creg; j++) prealloc_reg(c, &c->creg[j], reg++); reg++; /* XXX: skip over position output */ @@ -137,12 +137,12 @@ static void update_register_usage(struct brw_wm_compile *c, static void spill_value(struct brw_wm_compile *c, struct brw_wm_value *value) -{ +{ /* Allocate a spill slot. Note that allocations start from 0x40 - * the first slot is reserved to mean "undef" in brw_wm_emit.c */ if (!value->spill_slot) { - c->last_scratch += 0x40; + c->last_scratch += 0x40; value->spill_slot = c->last_scratch; } @@ -193,7 +193,7 @@ static GLuint search_contiguous_regs(struct brw_wm_compile *c, /* Any non-empty regs will need to be spilled: */ - for (j = 0; j < nr; j++) + for (j = 0; j < nr; j++) if (grf[reg+j].value) spill_value(c, grf[reg+j].value); @@ -201,7 +201,7 @@ static GLuint search_contiguous_regs(struct brw_wm_compile *c, } -static void alloc_contiguous_dest(struct brw_wm_compile *c, +static void alloc_contiguous_dest(struct brw_wm_compile *c, struct brw_wm_value *dst[], GLuint nr, GLuint thisinsn) @@ -234,7 +234,7 @@ static void alloc_contiguous_dest(struct brw_wm_compile *c, } -static void load_args(struct brw_wm_compile *c, +static void load_args(struct brw_wm_compile *c, struct brw_wm_instruction *inst) { GLuint thisinsn = inst - c->instruction; @@ -316,7 +316,7 @@ void brw_wm_pass2( struct brw_wm_compile *c ) } if (TEST_DST_SPILLS && inst->opcode != WM_PIXELXY) { - for (i = 0; i < 4; i++) + for (i = 0; i < 4; i++) if (inst->dst[i]) spill_value(c, inst->dst[i]); } diff --git a/src/gallium/drivers/i965/brw_wm_sampler_state.c b/src/gallium/drivers/i965/brw_wm_sampler_state.c index 8406a1a..4c29301 100644 --- a/src/gallium/drivers/i965/brw_wm_sampler_state.c +++ b/src/gallium/drivers/i965/brw_wm_sampler_state.c @@ -2,7 +2,7 @@ Copyright (C) Intel Corp. 2006. All Rights Reserved. Intel funded Tungsten Graphics (http://www.tungstengraphics.com) to develop this 3D driver. - + 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, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - + The above copyright notice and this permission notice (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 NONINFRINGEMENT. @@ -22,13 +22,13 @@ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - + **********************************************************************/ /* * Authors: * Keith Whitwell */ - + #include "util/u_math.h" #include "util/u_format.h" @@ -52,8 +52,8 @@ upload_default_color( struct brw_context *brw, struct brw_sampler_default_color sdc; enum pipe_error ret; - COPY_4V(sdc.color, color); - + COPY_4V(sdc.color, color); + ret = brw_cache_data( &brw->cache, BRW_SAMPLER_DEFAULT_COLOR, &sdc, NULL, 0, bo_out ); if (ret) @@ -96,7 +96,7 @@ brw_wm_sampler_populate_key(struct brw_context *brw, */ if (tex->b.b.target == PIPE_TEXTURE_CUBE) { if (FALSE && - (sampler->ss0.min_filter != BRW_MAPFILTER_NEAREST || + (sampler->ss0.min_filter != BRW_MAPFILTER_NEAREST || sampler->ss0.mag_filter != BRW_MAPFILTER_NEAREST)) { entry->ss1.r_wrap_mode = BRW_TEXCOORDMODE_CUBE; entry->ss1.s_wrap_mode = BRW_TEXCOORDMODE_CUBE; @@ -136,7 +136,7 @@ brw_wm_sampler_update_default_colors(struct brw_context *brw) sampler->border_color[0], sampler->border_color[0] }; - + if (util_format_is_depth_or_stencil(tex->b.b.format)) { bc = bordercolor; } @@ -148,10 +148,10 @@ brw_wm_sampler_update_default_colors(struct brw_context *brw) * R channel, while the hardware uses A. Spam R into all the * channels for safety. */ - ret = upload_default_color(brw, + ret = upload_default_color(brw, bc, &brw->wm.sdc_bo[i]); - if (ret) + if (ret) return ret; } @@ -160,7 +160,7 @@ brw_wm_sampler_update_default_colors(struct brw_context *brw) -/* All samplers must be uploaded in a single contiguous array. +/* All samplers must be uploaded in a single contiguous array. */ static int upload_wm_samplers( struct brw_context *brw ) { diff --git a/src/gallium/drivers/i965/brw_wm_state.c b/src/gallium/drivers/i965/brw_wm_state.c index efc2d96..7853531 100644 --- a/src/gallium/drivers/i965/brw_wm_state.c +++ b/src/gallium/drivers/i965/brw_wm_state.c @@ -2,7 +2,7 @@ Copyright (C) Intel Corp. 2006. All Rights Reserved. Intel funded Tungsten Graphics (http://www.tungstengraphics.com) to develop this 3D driver. - + 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, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - + The above copyright notice and this permission notice (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 NONINFRINGEMENT. @@ -22,13 +22,13 @@ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - + **********************************************************************/ /* * Authors: * Keith Whitwell */ - + #include "util/u_math.h" #include "brw_context.h" @@ -113,7 +113,7 @@ wm_unit_populate_key(struct brw_context *brw, struct brw_wm_unit_key *key) key->computes_depth = 0; /* PIPE_NEW_DEPTH_STENCIL_ALPHA */ - key->uses_kill = (fp->info.uses_kill || + key->uses_kill = (fp->info.uses_kill || brw->curr.zstencil->cc3.alpha_test); key->has_flow_control = fp->has_flow_control; @@ -174,7 +174,7 @@ wm_unit_create_from_key(struct brw_context *brw, struct brw_wm_unit_key *key, wm.thread3.const_urb_entry_read_length = key->curb_entry_read_length; wm.thread3.const_urb_entry_read_offset = key->curbe_offset * 2; - if (BRW_IS_IGDNG(brw)) + if (BRW_IS_IGDNG(brw)) wm.wm4.sampler_count = 0; /* hardware requirement */ else wm.wm4.sampler_count = (key->sampler_count + 1) / 4; @@ -257,7 +257,7 @@ static enum pipe_error upload_wm_unit( struct brw_context *brw ) /* Do we need a new buffer: */ - if (brw->wm.scratch_bo && total > brw->wm.scratch_bo->size) + if (brw->wm.scratch_bo && total > brw->wm.scratch_bo->size) bo_reference(&brw->wm.scratch_bo, NULL); if (brw->wm.scratch_bo == NULL) { @@ -312,7 +312,7 @@ static enum pipe_error upload_wm_unit( struct brw_context *brw ) &brw->wm.state_bo)) return PIPE_OK; - ret = wm_unit_create_from_key(brw, &key, + ret = wm_unit_create_from_key(brw, &key, reloc, nr_reloc, &brw->wm.state_bo); if (ret) @@ -325,7 +325,7 @@ const struct brw_tracked_state brw_wm_unit = { .dirty = { .mesa = (PIPE_NEW_FRAGMENT_SHADER | PIPE_NEW_DEPTH_BUFFER | - PIPE_NEW_RAST | + PIPE_NEW_RAST | PIPE_NEW_DEPTH_STENCIL_ALPHA | PIPE_NEW_QUERY), diff --git a/src/gallium/drivers/i965/brw_wm_surface_state.c b/src/gallium/drivers/i965/brw_wm_surface_state.c index 0d80a01..7bed3d6 100644 --- a/src/gallium/drivers/i965/brw_wm_surface_state.c +++ b/src/gallium/drivers/i965/brw_wm_surface_state.c @@ -2,7 +2,7 @@ Copyright (C) Intel Corp. 2006. All Rights Reserved. Intel funded Tungsten Graphics (http://www.tungstengraphics.com) to develop this 3D driver. - + 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, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - + The above copyright notice and this permission notice (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 NONINFRINGEMENT. @@ -22,13 +22,13 @@ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - + **********************************************************************/ /* * Authors: * Keith Whitwell */ - + #include "pipe/p_format.h" #include "brw_batchbuffer.h" @@ -122,7 +122,7 @@ brw_update_render_surface(struct brw_context *brw, NULL, bo_out)) return PIPE_OK; - + ret = brw_upload_cache(&brw->surface_cache, BRW_SS_SURFACE, &ss, sizeof ss, @@ -155,7 +155,7 @@ brw_wm_get_binding_table(struct brw_context *brw, assert(brw->wm.nr_surfaces <= BRW_WM_MAX_SURF); assert(brw->wm.nr_surfaces > 0); - /* Emit binding table relocations to surface state + /* Emit binding table relocations to surface state */ for (i = 0; i < brw->wm.nr_surfaces; i++) { if (brw->wm.surf_bo[i]) { @@ -209,12 +209,12 @@ static enum pipe_error prepare_wm_surfaces(struct brw_context *brw ) * XXX: no color buffer case */ for (i = 0; i < brw->curr.fb.nr_cbufs; i++) { - ret = brw_update_render_surface(brw, - brw_surface(brw->curr.fb.cbufs[i]), + ret = brw_update_render_surface(brw, + brw_surface(brw->curr.fb.cbufs[i]), &brw->wm.surf_bo[BTI_COLOR_BUF(i)]); if (ret) return ret; - + nr_surfaces = BTI_COLOR_BUF(i) + 1; } @@ -225,8 +225,8 @@ static enum pipe_error prepare_wm_surfaces(struct brw_context *brw ) #if 0 if (brw->curr.fragment_constants) { ret = brw_update_fragment_constant_surface( - brw, - brw->curr.fragment_constants, + brw, + brw->curr.fragment_constants, &brw->wm.surf_bo[BTI_FRAGMENT_CONSTANTS]); if (ret) @@ -235,15 +235,15 @@ static enum pipe_error prepare_wm_surfaces(struct brw_context *brw ) nr_surfaces = BTI_FRAGMENT_CONSTANTS + 1; } else { - bo_reference(&brw->wm.surf_bo[SURF_FRAG_CONSTANTS], NULL); + bo_reference(&brw->wm.surf_bo[SURF_FRAG_CONSTANTS], NULL); } #endif - /* PIPE_NEW_TEXTURE + /* PIPE_NEW_TEXTURE */ for (i = 0; i < brw->curr.num_fragment_sampler_views; i++) { - ret = brw_update_texture_surface(brw, + ret = brw_update_texture_surface(brw, brw_texture(brw->curr.fragment_sampler_views[i]->texture), &brw->wm.surf_bo[BTI_TEXTURE(i)]); if (ret) @@ -254,11 +254,11 @@ static enum pipe_error prepare_wm_surfaces(struct brw_context *brw ) /* Clear any inactive entries: */ - for (i = brw->curr.fb.nr_cbufs; i < BRW_MAX_DRAW_BUFFERS; i++) + for (i = brw->curr.fb.nr_cbufs; i < BRW_MAX_DRAW_BUFFERS; i++) bo_reference(&brw->wm.surf_bo[BTI_COLOR_BUF(i)], NULL); if (!brw->curr.fragment_constants) - bo_reference(&brw->wm.surf_bo[BTI_FRAGMENT_CONSTANTS], NULL); + bo_reference(&brw->wm.surf_bo[BTI_FRAGMENT_CONSTANTS], NULL); /* XXX: no pipe_max_textures define?? */ for (i = brw->curr.num_fragment_sampler_views; i < PIPE_MAX_SAMPLERS; i++) diff --git a/src/gallium/drivers/i965/intel_structs.h b/src/gallium/drivers/i965/intel_structs.h index 522e3bd..f194a57 100644 --- a/src/gallium/drivers/i965/intel_structs.h +++ b/src/gallium/drivers/i965/intel_structs.h @@ -12,7 +12,7 @@ struct br0 { GLuint client:3; }; - + struct br13 { GLint dest_pitch:16; GLuint rop:8; @@ -42,7 +42,7 @@ struct xy_color_blit { GLuint dest_x2:16; GLuint dest_y2:16; } dw3; - + GLuint dest_base_addr; GLuint color; }; @@ -60,7 +60,7 @@ struct xy_src_copy_blit { GLuint dest_x2:16; GLuint dest_y2:16; } dw3; - + GLuint dest_base_addr; struct { @@ -72,7 +72,7 @@ struct xy_src_copy_blit { GLint src_pitch:16; GLuint pad:16; } dw6; - + GLuint src_base_addr; }; @@ -89,7 +89,7 @@ struct xy_setup_blit { GLuint clip_x2:16; GLuint clip_y2:16; } dw3; - + GLuint dest_base_addr; GLuint background_color; GLuint foreground_color; @@ -117,7 +117,7 @@ struct xy_text_immediate_blit { struct { GLuint dest_x2:16; GLuint dest_y2:16; - } dw2; + } dw2; /* Src bitmap data follows as inline dwords. */ diff --git a/src/gallium/drivers/identity/id_context.c b/src/gallium/drivers/identity/id_context.c index 3efbd6a..b5e38b9 100644 --- a/src/gallium/drivers/identity/id_context.c +++ b/src/gallium/drivers/identity/id_context.c @@ -829,7 +829,7 @@ identity_context_transfer_unmap(struct pipe_context *_context, } -static void +static void identity_context_transfer_inline_write(struct pipe_context *_context, struct pipe_resource *_resource, unsigned level, diff --git a/src/gallium/drivers/llvmpipe/SConscript b/src/gallium/drivers/llvmpipe/SConscript index 26b258b..907821d 100644 --- a/src/gallium/drivers/llvmpipe/SConscript +++ b/src/gallium/drivers/llvmpipe/SConscript @@ -20,8 +20,8 @@ env.CodeGenerate( # XXX: Our dependency scanner only finds depended modules in relative dirs. env.Depends('lp_tile_soa.c', [ - '#src/gallium/auxiliary/util/u_format_parse.py', - '#src/gallium/auxiliary/util/u_format_pack.py', + '#src/gallium/auxiliary/util/u_format_parse.py', + '#src/gallium/auxiliary/util/u_format_pack.py', ]) diff --git a/src/gallium/drivers/llvmpipe/lp_bld_blend.h b/src/gallium/drivers/llvmpipe/lp_bld_blend.h index f82ae30..b2db298 100644 --- a/src/gallium/drivers/llvmpipe/lp_bld_blend.h +++ b/src/gallium/drivers/llvmpipe/lp_bld_blend.h @@ -31,7 +31,7 @@ #include "gallivm/lp_bld.h" #include "gallivm/lp_bld_init.h" - + #include "pipe/p_format.h" diff --git a/src/gallium/drivers/llvmpipe/lp_bld_blend_aos.c b/src/gallium/drivers/llvmpipe/lp_bld_blend_aos.c index c342346..60af138 100644 --- a/src/gallium/drivers/llvmpipe/lp_bld_blend_aos.c +++ b/src/gallium/drivers/llvmpipe/lp_bld_blend_aos.c @@ -64,7 +64,7 @@ struct lp_build_blend_aos_context { struct lp_build_context base; - + LLVMValueRef src; LLVMValueRef dst; LLVMValueRef const_; @@ -185,8 +185,8 @@ lp_build_blend_factor_swizzle(unsigned factor) static LLVMValueRef lp_build_blend_swizzle(struct lp_build_blend_aos_context *bld, - LLVMValueRef rgb, - LLVMValueRef alpha, + LLVMValueRef rgb, + LLVMValueRef alpha, enum lp_build_blend_swizzle rgb_swizzle, unsigned alpha_swizzle) { @@ -279,7 +279,7 @@ lp_build_blend_func_reverse(unsigned rgb_func, unsigned alpha_func) LLVMValueRef lp_build_blend_func(struct lp_build_context *bld, unsigned func, - LLVMValueRef term1, + LLVMValueRef term1, LLVMValueRef term2) { switch (func) { diff --git a/src/gallium/drivers/llvmpipe/lp_bld_depth.c b/src/gallium/drivers/llvmpipe/lp_bld_depth.c index 1bf7411..6d75ab9 100644 --- a/src/gallium/drivers/llvmpipe/lp_bld_depth.c +++ b/src/gallium/drivers/llvmpipe/lp_bld_depth.c @@ -38,7 +38,7 @@ * * We are free to use a different pixel layout though. Since our basic * processing unit is a quad (2x2 pixel block) we store the depth/stencil - * values tiled, a quad at time. That is, a depth buffer containing + * values tiled, a quad at time. That is, a depth buffer containing * * Z11 Z12 Z13 Z14 ... * Z21 Z22 Z23 Z24 ... @@ -342,7 +342,7 @@ get_z_shift_and_mask(const struct util_format_description *format_desc, unsigned z_swizzle; unsigned chan; unsigned padding_left, padding_right; - + assert(format_desc->colorspace == UTIL_FORMAT_COLORSPACE_ZS); assert(format_desc->block.width == 1); assert(format_desc->block.height == 1); diff --git a/src/gallium/drivers/llvmpipe/lp_bld_depth.h b/src/gallium/drivers/llvmpipe/lp_bld_depth.h index 038b136..ff191af 100644 --- a/src/gallium/drivers/llvmpipe/lp_bld_depth.h +++ b/src/gallium/drivers/llvmpipe/lp_bld_depth.h @@ -38,7 +38,7 @@ #include "gallivm/lp_bld.h" - + struct pipe_depth_state; struct util_format_description; struct lp_type; diff --git a/src/gallium/drivers/llvmpipe/lp_bld_interp.c b/src/gallium/drivers/llvmpipe/lp_bld_interp.c index 45ddf54..7db72df 100644 --- a/src/gallium/drivers/llvmpipe/lp_bld_interp.c +++ b/src/gallium/drivers/llvmpipe/lp_bld_interp.c @@ -1,9 +1,9 @@ /************************************************************************** - * + * * Copyright 2009 VMware, Inc. * Copyright 2007-2008 Tungsten Graphics, Inc., Cedar Park, Texas. * 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 @@ -11,11 +11,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. @@ -23,7 +23,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. - * + * **************************************************************************/ /** diff --git a/src/gallium/drivers/llvmpipe/lp_clear.c b/src/gallium/drivers/llvmpipe/lp_clear.c index b486b24..bc0bc59 100644 --- a/src/gallium/drivers/llvmpipe/lp_clear.c +++ b/src/gallium/drivers/llvmpipe/lp_clear.c @@ -1,9 +1,9 @@ /************************************************************************** - * + * * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas. * All Rights Reserved. * Copyright 2009 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 @@ -11,11 +11,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. @@ -23,7 +23,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. - * + * **************************************************************************/ /* Author: @@ -44,7 +44,7 @@ * No masking, no scissor (clear entire buffer). */ void -llvmpipe_clear(struct pipe_context *pipe, +llvmpipe_clear(struct pipe_context *pipe, unsigned buffers, const float *rgba, double depth, diff --git a/src/gallium/drivers/llvmpipe/lp_clear.h b/src/gallium/drivers/llvmpipe/lp_clear.h index 6d4ffcc..24cc872 100644 --- a/src/gallium/drivers/llvmpipe/lp_clear.h +++ b/src/gallium/drivers/llvmpipe/lp_clear.h @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ /* Author: diff --git a/src/gallium/drivers/llvmpipe/lp_context.c b/src/gallium/drivers/llvmpipe/lp_context.c index 2de20d6..bc02fc8 100644 --- a/src/gallium/drivers/llvmpipe/lp_context.c +++ b/src/gallium/drivers/llvmpipe/lp_context.c @@ -1,9 +1,9 @@ /************************************************************************** - * + * * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas. * All Rights Reserved. * Copyright 2008 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 @@ -11,11 +11,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. @@ -23,7 +23,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. - * + * **************************************************************************/ /* Author: @@ -205,7 +205,7 @@ llvmpipe_create_context( struct pipe_screen *screen, void *priv ) draw_install_aapoint_stage(llvmpipe->draw, &llvmpipe->pipe); draw_install_pstipple_stage(llvmpipe->draw, &llvmpipe->pipe); - /* convert points and lines into triangles: + /* convert points and lines into triangles: * (otherwise, draw points and lines natively) */ draw_wide_point_sprites(llvmpipe->draw, FALSE); diff --git a/src/gallium/drivers/llvmpipe/lp_context.h b/src/gallium/drivers/llvmpipe/lp_context.h index 503f09d..14d2a77 100644 --- a/src/gallium/drivers/llvmpipe/lp_context.h +++ b/src/gallium/drivers/llvmpipe/lp_context.h @@ -1,5 +1,5 @@ /************************************************************************** - * + * * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas. * All Rights Reserved. * @@ -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. - * + * **************************************************************************/ /* Authors: Keith Whitwell @@ -100,10 +100,10 @@ struct llvmpipe_context { /** Mapped vertex buffers */ ubyte *mapped_vbuffer[PIPE_MAX_ATTRIBS]; - + /** Vertex format */ struct vertex_info vertex_info; - + /** Which vertex shader output slot contains color */ int color_slot[2]; @@ -113,9 +113,9 @@ struct llvmpipe_context { /** Which vertex shader output slot contains point size */ int psize_slot; - /**< minimum resolvable depth value, for polygon offset */ + /**< minimum resolvable depth value, for polygon offset */ double mrd; - + /** The tiling engine */ struct lp_setup_context *setup; struct lp_setup_variant setup_variant; diff --git a/src/gallium/drivers/llvmpipe/lp_debug.h b/src/gallium/drivers/llvmpipe/lp_debug.h index 15dca52..af0a902 100644 --- a/src/gallium/drivers/llvmpipe/lp_debug.h +++ b/src/gallium/drivers/llvmpipe/lp_debug.h @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ diff --git a/src/gallium/drivers/llvmpipe/lp_draw_arrays.c b/src/gallium/drivers/llvmpipe/lp_draw_arrays.c index 3af5c8d..5ad8f85 100644 --- a/src/gallium/drivers/llvmpipe/lp_draw_arrays.c +++ b/src/gallium/drivers/llvmpipe/lp_draw_arrays.c @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ /* Author: diff --git a/src/gallium/drivers/llvmpipe/lp_fence.h b/src/gallium/drivers/llvmpipe/lp_fence.h index 3c59118..7f3a9c9 100644 --- a/src/gallium/drivers/llvmpipe/lp_fence.h +++ b/src/gallium/drivers/llvmpipe/lp_fence.h @@ -81,7 +81,7 @@ lp_fence_reference(struct lp_fence **ptr, if (pipe_reference(&old->reference, &f->reference)) { lp_fence_destroy(old); } - + *ptr = f; } diff --git a/src/gallium/drivers/llvmpipe/lp_flush.c b/src/gallium/drivers/llvmpipe/lp_flush.c index 85e3cde..b4c0642 100644 --- a/src/gallium/drivers/llvmpipe/lp_flush.c +++ b/src/gallium/drivers/llvmpipe/lp_flush.c @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ /* Author: diff --git a/src/gallium/drivers/llvmpipe/lp_flush.h b/src/gallium/drivers/llvmpipe/lp_flush.h index 579d24c..2cd94b7 100644 --- a/src/gallium/drivers/llvmpipe/lp_flush.h +++ b/src/gallium/drivers/llvmpipe/lp_flush.h @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ #ifndef LP_FLUSH_H diff --git a/src/gallium/drivers/llvmpipe/lp_jit.c b/src/gallium/drivers/llvmpipe/lp_jit.c index a775990..4a47145 100644 --- a/src/gallium/drivers/llvmpipe/lp_jit.c +++ b/src/gallium/drivers/llvmpipe/lp_jit.c @@ -66,7 +66,7 @@ lp_jit_create_types(struct llvmpipe_context *lp) elem_types[LP_JIT_TEXTURE_MIN_LOD] = elem_types[LP_JIT_TEXTURE_MAX_LOD] = elem_types[LP_JIT_TEXTURE_LOD_BIAS] = LLVMFloatTypeInContext(lc); - elem_types[LP_JIT_TEXTURE_BORDER_COLOR] = + elem_types[LP_JIT_TEXTURE_BORDER_COLOR] = LLVMArrayType(LLVMFloatTypeInContext(lc), 4); texture_type = LLVMStructTypeInContext(lc, elem_types, diff --git a/src/gallium/drivers/llvmpipe/lp_limits.h b/src/gallium/drivers/llvmpipe/lp_limits.h index 2538164..bd5f2bf 100644 --- a/src/gallium/drivers/llvmpipe/lp_limits.h +++ b/src/gallium/drivers/llvmpipe/lp_limits.h @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2010 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. - * + * **************************************************************************/ /** diff --git a/src/gallium/drivers/llvmpipe/lp_memory.c b/src/gallium/drivers/llvmpipe/lp_memory.c index 0f55d4a..7946497 100644 --- a/src/gallium/drivers/llvmpipe/lp_memory.c +++ b/src/gallium/drivers/llvmpipe/lp_memory.c @@ -1,5 +1,5 @@ /************************************************************************** - * + * * Copyright 2010 VMware, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a @@ -9,11 +9,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. @@ -21,7 +21,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. - * + * **************************************************************************/ @@ -39,7 +39,7 @@ PIPE_ALIGN_VAR(16) uint8_t lp_swizzled_cbuf[LP_MAX_THREADS][PIPE_MAX_COLOR_BUFS][TILE_SIZE * TILE_SIZE * 4]; -/* A single dummy tile used in a couple of out-of-memory situations. +/* A single dummy tile used in a couple of out-of-memory situations. */ PIPE_ALIGN_VAR(16) uint8_t lp_dummy_tile[TILE_SIZE * TILE_SIZE * 4]; diff --git a/src/gallium/drivers/llvmpipe/lp_memory.h b/src/gallium/drivers/llvmpipe/lp_memory.h index f7418f5..b84c90e 100644 --- a/src/gallium/drivers/llvmpipe/lp_memory.h +++ b/src/gallium/drivers/llvmpipe/lp_memory.h @@ -1,5 +1,5 @@ /************************************************************************** - * + * * Copyright 2010 VMware, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a @@ -9,11 +9,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. @@ -21,7 +21,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. - * + * **************************************************************************/ diff --git a/src/gallium/drivers/llvmpipe/lp_perf.c b/src/gallium/drivers/llvmpipe/lp_perf.c index e22532f..2f9573b 100644 --- a/src/gallium/drivers/llvmpipe/lp_perf.c +++ b/src/gallium/drivers/llvmpipe/lp_perf.c @@ -51,7 +51,7 @@ lp_print_counters(void) debug_printf("llvmpipe: nr_triangles: %9u\n", lp_count.nr_tris); debug_printf("llvmpipe: nr_culled_triangles: %9u\n", lp_count.nr_culled_tris); - total_64 = (lp_count.nr_empty_64 + + total_64 = (lp_count.nr_empty_64 + lp_count.nr_fully_covered_64 + lp_count.nr_partially_covered_64); @@ -70,7 +70,7 @@ lp_print_counters(void) debug_printf("llvmpipe: nr_partially_covered_64x64: %9u (%3.0f%% of %u)\n", lp_count.nr_partially_covered_64, p3, total_64); debug_printf("llvmpipe: nr_empty_64x64: %9u (%3.0f%% of %u)\n", lp_count.nr_empty_64, p1, total_64); - total_16 = (lp_count.nr_empty_16 + + total_16 = (lp_count.nr_empty_16 + lp_count.nr_fully_covered_16 + lp_count.nr_partially_covered_16); diff --git a/src/gallium/drivers/llvmpipe/lp_query.c b/src/gallium/drivers/llvmpipe/lp_query.c index 84c66dd..8152596 100644 --- a/src/gallium/drivers/llvmpipe/lp_query.c +++ b/src/gallium/drivers/llvmpipe/lp_query.c @@ -1,9 +1,9 @@ /************************************************************************** - * + * * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas. * Copyright 2010 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 @@ -11,11 +11,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. @@ -23,7 +23,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. - * + * **************************************************************************/ /* Authors: @@ -46,7 +46,7 @@ static struct llvmpipe_query *llvmpipe_query( struct pipe_query *p ) } static struct pipe_query * -llvmpipe_create_query(struct pipe_context *pipe, +llvmpipe_create_query(struct pipe_context *pipe, unsigned type) { struct llvmpipe_query *pq; @@ -82,7 +82,7 @@ llvmpipe_destroy_query(struct pipe_context *pipe, struct pipe_query *q) static boolean -llvmpipe_get_query_result(struct pipe_context *pipe, +llvmpipe_get_query_result(struct pipe_context *pipe, struct pipe_query *q, boolean wait, void *vresult) @@ -100,7 +100,7 @@ llvmpipe_get_query_result(struct pipe_context *pipe, if (!lp_fence_signalled(pq->fence)) { if (!lp_fence_issued(pq->fence)) llvmpipe_flush(pipe, 0, NULL, __FUNCTION__); - + if (!wait) return FALSE; diff --git a/src/gallium/drivers/llvmpipe/lp_query.h b/src/gallium/drivers/llvmpipe/lp_query.h index e93842a..c02a6e3 100644 --- a/src/gallium/drivers/llvmpipe/lp_query.h +++ b/src/gallium/drivers/llvmpipe/lp_query.h @@ -1,9 +1,9 @@ /************************************************************************** - * + * * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas. * Copyright 2010 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 @@ -11,11 +11,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. @@ -23,7 +23,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. - * + * **************************************************************************/ /* Authors: diff --git a/src/gallium/drivers/llvmpipe/lp_rast.c b/src/gallium/drivers/llvmpipe/lp_rast.c index dafadc1..ef401d2 100644 --- a/src/gallium/drivers/llvmpipe/lp_rast.c +++ b/src/gallium/drivers/llvmpipe/lp_rast.c @@ -154,7 +154,7 @@ lp_rast_clear_color(struct lp_rasterizer_task *task, unsigned i; - LP_DBG(DEBUG_RAST, "%s 0x%x,0x%x,0x%x,0x%x\n", __FUNCTION__, + LP_DBG(DEBUG_RAST, "%s 0x%x,0x%x,0x%x,0x%x\n", __FUNCTION__, clear_color[0], clear_color[1], clear_color[2], @@ -668,7 +668,7 @@ rasterize_bin(struct lp_rasterizer_task *task, * stores them again unchanged. This typically happens when bins have * been flushed for some reason in the middle of a frame, or when * incremental updates are being made to a render target. - * + * * Try to avoid doing pointless work in this case. */ static boolean @@ -798,7 +798,7 @@ static PIPE_THREAD_ROUTINE( thread_func, init_data ) * - get next scene to rasterize * - map the framebuffer surfaces */ - lp_rast_begin( rast, + lp_rast_begin( rast, lp_scene_dequeue( rast->full_scenes, TRUE ) ); } @@ -813,7 +813,7 @@ static PIPE_THREAD_ROUTINE( thread_func, init_data ) rasterize_scene(task, rast->curr_scene); - + /* wait for all threads to finish with this scene */ pipe_barrier_wait( &rast->barrier ); diff --git a/src/gallium/drivers/llvmpipe/lp_rast.h b/src/gallium/drivers/llvmpipe/lp_rast.h index a64c152..5fbe06b 100644 --- a/src/gallium/drivers/llvmpipe/lp_rast.h +++ b/src/gallium/drivers/llvmpipe/lp_rast.h @@ -64,7 +64,7 @@ struct lp_rast_state { * the fragment shader, such as blend color and alpha ref value. */ struct lp_jit_context jit_context; - + /* The shader itself. Probably we also need to pass a pointer to * the tile color/z/stencil data somehow */ @@ -137,7 +137,7 @@ lp_rast_destroy( struct lp_rasterizer * ); unsigned lp_rast_get_num_threads( struct lp_rasterizer * ); -void +void lp_rast_queue_scene( struct lp_rasterizer *rast, struct lp_scene *scene ); diff --git a/src/gallium/drivers/llvmpipe/lp_rast_debug.c b/src/gallium/drivers/llvmpipe/lp_rast_debug.c index 64ac616..332cf3d 100644 --- a/src/gallium/drivers/llvmpipe/lp_rast_debug.c +++ b/src/gallium/drivers/llvmpipe/lp_rast_debug.c @@ -29,7 +29,7 @@ static char get_label( int i ) -static const char *cmd_names[LP_RAST_OP_MAX] = +static const char *cmd_names[LP_RAST_OP_MAX] = { "clear_color", "clear_zstencil", @@ -100,7 +100,7 @@ debug_bin( const struct cmd_bin *bin ) int i, j = 0; debug_printf("bin %d,%d:\n", bin->x, bin->y); - + while (head) { for (i = 0; i < head->count; i++, j++) { if (head->cmd[i] == LP_RAST_OP_SET_STATE) @@ -205,7 +205,7 @@ debug_triangle(int tilex, int tiley, for (i = 0; i < nr_planes; i++) if (plane[i].c <= 0) goto out; - + plot(tile, x, y, val, blend); count++; @@ -247,13 +247,13 @@ do_debug_bin( struct tile *tile, boolean blend = is_blend(tile->state, block, k); char val = get_label(j); int count = 0; - + if (print_cmds) debug_printf("%c: %15s", val, cmd_name(block->cmd[k])); if (block->cmd[k] == LP_RAST_OP_SET_STATE) tile->state = block->arg[k].state; - + if (block->cmd[k] == LP_RAST_OP_CLEAR_COLOR || block->cmd[k] == LP_RAST_OP_CLEAR_ZSTENCIL) count = debug_clear_tile(tx, ty, block->arg[k], tile, val); @@ -276,7 +276,7 @@ do_debug_bin( struct tile *tile, if (blend) debug_printf(" blended"); - + debug_printf("\n"); } } diff --git a/src/gallium/drivers/llvmpipe/lp_rast_priv.h b/src/gallium/drivers/llvmpipe/lp_rast_priv.h index cd686bc..28a408c 100644 --- a/src/gallium/drivers/llvmpipe/lp_rast_priv.h +++ b/src/gallium/drivers/llvmpipe/lp_rast_priv.h @@ -275,36 +275,36 @@ lp_rast_shade_quads_all( struct lp_rasterizer_task *task, END_JIT_CALL(); } -void lp_rast_triangle_1( struct lp_rasterizer_task *, +void lp_rast_triangle_1( struct lp_rasterizer_task *, const union lp_rast_cmd_arg ); -void lp_rast_triangle_2( struct lp_rasterizer_task *, +void lp_rast_triangle_2( struct lp_rasterizer_task *, const union lp_rast_cmd_arg ); -void lp_rast_triangle_3( struct lp_rasterizer_task *, +void lp_rast_triangle_3( struct lp_rasterizer_task *, const union lp_rast_cmd_arg ); -void lp_rast_triangle_4( struct lp_rasterizer_task *, +void lp_rast_triangle_4( struct lp_rasterizer_task *, const union lp_rast_cmd_arg ); -void lp_rast_triangle_5( struct lp_rasterizer_task *, +void lp_rast_triangle_5( struct lp_rasterizer_task *, const union lp_rast_cmd_arg ); -void lp_rast_triangle_6( struct lp_rasterizer_task *, +void lp_rast_triangle_6( struct lp_rasterizer_task *, const union lp_rast_cmd_arg ); -void lp_rast_triangle_7( struct lp_rasterizer_task *, +void lp_rast_triangle_7( struct lp_rasterizer_task *, const union lp_rast_cmd_arg ); -void lp_rast_triangle_8( struct lp_rasterizer_task *, +void lp_rast_triangle_8( struct lp_rasterizer_task *, const union lp_rast_cmd_arg ); void lp_rast_triangle_3_4(struct lp_rasterizer_task *, const union lp_rast_cmd_arg ); -void lp_rast_triangle_3_16( struct lp_rasterizer_task *, +void lp_rast_triangle_3_16( struct lp_rasterizer_task *, const union lp_rast_cmd_arg ); -void lp_rast_triangle_4_16( struct lp_rasterizer_task *, +void lp_rast_triangle_4_16( struct lp_rasterizer_task *, const union lp_rast_cmd_arg ); void lp_rast_set_state(struct lp_rasterizer_task *task, const union lp_rast_cmd_arg arg); - + void lp_debug_bin( const struct cmd_bin *bin ); diff --git a/src/gallium/drivers/llvmpipe/lp_rast_tri.c b/src/gallium/drivers/llvmpipe/lp_rast_tri.c index 042c315..a608bad 100644 --- a/src/gallium/drivers/llvmpipe/lp_rast_tri.c +++ b/src/gallium/drivers/llvmpipe/lp_rast_tri.c @@ -86,7 +86,7 @@ build_mask_linear(int c, int dcdx, int dcdy) mask |= ((c1 + 0 * dcdx) >> 31) & (1 << 4); mask |= ((c1 + 1 * dcdx) >> 31) & (1 << 5); mask |= ((c1 + 2 * dcdx) >> 31) & (1 << 6); - mask |= ((c1 + 3 * dcdx) >> 31) & (1 << 7); + mask |= ((c1 + 3 * dcdx) >> 31) & (1 << 7); mask |= ((c2 + 0 * dcdx) >> 31) & (1 << 8); mask |= ((c2 + 1 * dcdx) >> 31) & (1 << 9); mask |= ((c2 + 2 * dcdx) >> 31) & (1 << 10); @@ -95,13 +95,13 @@ build_mask_linear(int c, int dcdx, int dcdy) mask |= ((c3 + 1 * dcdx) >> 31) & (1 << 13); mask |= ((c3 + 2 * dcdx) >> 31) & (1 << 14); mask |= ((c3 + 3 * dcdx) >> 31) & (1 << 15); - + return mask; } static INLINE void -build_masks(int c, +build_masks(int c, int cdiff, int dcdx, int dcdy, @@ -145,7 +145,7 @@ lp_rast_triangle_3_4(struct lp_rasterizer_task *task, static INLINE void -build_masks(int c, +build_masks(int c, int cdiff, int dcdx, int dcdy, @@ -273,12 +273,12 @@ lp_rast_triangle_3_16(struct lp_rasterizer_task *task, __m128i dcdx2; __m128i dcdx3; - + __m128i span_0; /* 0,dcdx,2dcdx,3dcdx for plane 0 */ __m128i span_1; /* 0,dcdx,2dcdx,3dcdx for plane 1 */ __m128i span_2; /* 0,dcdx,2dcdx,3dcdx for plane 2 */ __m128i unused; - + transpose4_epi32(&p0, &p1, &p2, &zero, &c, &dcdx, &dcdy, &rej4); @@ -378,12 +378,12 @@ lp_rast_triangle_3_4(struct lp_rasterizer_task *task, __m128i dcdx2; __m128i dcdx3; - + __m128i span_0; /* 0,dcdx,2dcdx,3dcdx for plane 0 */ __m128i span_1; /* 0,dcdx,2dcdx,3dcdx for plane 1 */ __m128i span_2; /* 0,dcdx,2dcdx,3dcdx for plane 2 */ __m128i unused; - + transpose4_epi32(&p0, &p1, &p2, &zero, &c, &dcdx, &dcdy, &unused); @@ -405,7 +405,7 @@ lp_rast_triangle_3_4(struct lp_rasterizer_task *task, __m128i c0_0 = _mm_add_epi32(SCALAR_EPI32(c, 0), span_0); __m128i c1_0 = _mm_add_epi32(SCALAR_EPI32(c, 1), span_1); __m128i c2_0 = _mm_add_epi32(SCALAR_EPI32(c, 2), span_2); - + __m128i c_0 = _mm_or_si128(_mm_or_si128(c0_0, c1_0), c2_0); __m128i c0_1 = _mm_add_epi32(c0_0, SCALAR_EPI32(dcdy, 0)); diff --git a/src/gallium/drivers/llvmpipe/lp_rast_tri_tmp.h b/src/gallium/drivers/llvmpipe/lp_rast_tri_tmp.h index 4825d65..10515b9 100644 --- a/src/gallium/drivers/llvmpipe/lp_rast_tri_tmp.h +++ b/src/gallium/drivers/llvmpipe/lp_rast_tri_tmp.h @@ -50,7 +50,7 @@ TAG(do_block_4)(struct lp_rasterizer_task *task, int j; for (j = 0; j < NR_PLANES; j++) { - mask &= ~build_mask_linear(c[j] - 1, + mask &= ~build_mask_linear(c[j] - 1, -plane[j].dcdx, plane[j].dcdy); } @@ -87,7 +87,7 @@ TAG(do_block_16)(struct lp_rasterizer_task *task, build_masks(c[j] + cox, cio - cox, - dcdx, dcdy, + dcdx, dcdy, &outmask, /* sign bits from c[i][0..15] + cox */ &partmask); /* sign bits from c[i][0..15] + cio */ } @@ -115,7 +115,7 @@ TAG(do_block_16)(struct lp_rasterizer_task *task, int ix = (i & 3) * 4; int iy = (i >> 2) * 4; int px = x + ix; - int py = y + iy; + int py = y + iy; int cx[NR_PLANES]; partial_mask &= ~(1 << i); @@ -123,21 +123,21 @@ TAG(do_block_16)(struct lp_rasterizer_task *task, LP_COUNT(nr_partially_covered_4); for (j = 0; j < NR_PLANES; j++) - cx[j] = (c[j] + cx[j] = (c[j] - plane[j].dcdx * ix + plane[j].dcdy * iy); TAG(do_block_4)(task, tri, plane, px, py, cx); } - /* Iterate over fulls: + /* Iterate over fulls: */ while (inmask) { int i = ffs(inmask) - 1; int ix = (i & 3) * 4; int iy = (i >> 2) * 4; int px = x + ix; - int py = y + iy; + int py = y + iy; inmask &= ~(1 << i); @@ -187,7 +187,7 @@ TAG(lp_rast_triangle)(struct lp_rasterizer_task *task, build_masks(c[j] + cox, cio - cox, - dcdx, dcdy, + dcdx, dcdy, &outmask, /* sign bits from c[i][0..15] + cox */ &partmask); /* sign bits from c[i][0..15] + cio */ } @@ -232,7 +232,7 @@ TAG(lp_rast_triangle)(struct lp_rasterizer_task *task, TAG(do_block_16)(task, tri, plane, px, py, cx); } - /* Iterate over fulls: + /* Iterate over fulls: */ while (inmask) { int i = ffs(inmask) - 1; @@ -268,7 +268,7 @@ TRI_16(struct lp_rasterizer_task *task, int y = (mask >> 8); outmask = 0; /* outside one or more trivial reject planes */ - + x += task->x; y += task->y; @@ -306,7 +306,7 @@ TRI_16(struct lp_rasterizer_task *task, int ix = (i & 3) * 4; int iy = (i >> 2) * 4; int px = x + ix; - int py = y + iy; + int py = y + iy; unsigned mask = 0xffff; partial_mask &= ~(1 << i); @@ -343,7 +343,7 @@ TRI_4(struct lp_rasterizer_task *task, unsigned mask = 0xffff; for (j = 0; j < NR_PLANES; j++) { - const int cx = (plane[j].c + const int cx = (plane[j].c - plane[j].dcdx * x + plane[j].dcdy * y); diff --git a/src/gallium/drivers/llvmpipe/lp_scene.c b/src/gallium/drivers/llvmpipe/lp_scene.c index 5d0f5f8..001c62a 100644 --- a/src/gallium/drivers/llvmpipe/lp_scene.c +++ b/src/gallium/drivers/llvmpipe/lp_scene.c @@ -155,7 +155,7 @@ lp_scene_begin_rasterization(struct lp_scene *scene) struct pipe_surface *zsbuf = scene->fb.zsbuf; assert(zsbuf->u.tex.first_layer == zsbuf->u.tex.last_layer); scene->zsbuf.stride = llvmpipe_resource_stride(zsbuf->texture, zsbuf->u.tex.level); - scene->zsbuf.blocksize = + scene->zsbuf.blocksize = util_format_get_blocksize(zsbuf->texture->format); scene->zsbuf.map = llvmpipe_resource_map(zsbuf->texture, @@ -304,7 +304,7 @@ lp_scene_new_data_block( struct lp_scene *scene ) struct data_block *block = MALLOC_STRUCT(data_block); if (block == NULL) return NULL; - + scene->scene_size += sizeof *block; block->used = 0; diff --git a/src/gallium/drivers/llvmpipe/lp_scene.h b/src/gallium/drivers/llvmpipe/lp_scene.h index 622c522..571abd4 100644 --- a/src/gallium/drivers/llvmpipe/lp_scene.h +++ b/src/gallium/drivers/llvmpipe/lp_scene.h @@ -68,7 +68,7 @@ struct lp_rast_state; typedef void (*lp_rast_cmd_func)( struct lp_rasterizer_task *, const union lp_rast_cmd_arg ); - + struct cmd_block { uint8_t cmd[CMD_BLOCK_MAX]; union lp_rast_cmd_arg arg[CMD_BLOCK_MAX]; @@ -99,7 +99,7 @@ struct cmd_bin { struct cmd_block *head; struct cmd_block *tail; }; - + /** * This stores bulk data which is used for all memory allocations @@ -138,7 +138,7 @@ struct lp_scene { unsigned stride; unsigned blocksize; } zsbuf, cbufs[PIPE_MAX_COLOR_BUFS]; - + /** the framebuffer to render the scene into */ struct pipe_framebuffer_state fb; @@ -246,7 +246,7 @@ lp_scene_alloc_aligned( struct lp_scene *scene, unsigned size, size + alignment - 1, block->used, DATA_BLOCK_SIZE, scene->scene_size, LP_SCENE_MAX_SIZE); - + if (block->used + size + alignment - 1 > DATA_BLOCK_SIZE) { block = lp_scene_new_data_block( scene ); if (!block) @@ -315,7 +315,7 @@ lp_scene_bin_command( struct lp_scene *scene, tail->arg[i] = arg; tail->count++; } - + return TRUE; } diff --git a/src/gallium/drivers/llvmpipe/lp_scene_queue.c b/src/gallium/drivers/llvmpipe/lp_scene_queue.c index 975db43..e51f2a8 100644 --- a/src/gallium/drivers/llvmpipe/lp_scene_queue.c +++ b/src/gallium/drivers/llvmpipe/lp_scene_queue.c @@ -63,7 +63,7 @@ lp_scene_queue_create(void) if (queue == NULL) return NULL; - queue->ring = util_ringbuffer_create( MAX_SCENE_QUEUE * + queue->ring = util_ringbuffer_create( MAX_SCENE_QUEUE * sizeof( struct scene_packet ) / 4); if (queue->ring == NULL) goto fail; diff --git a/src/gallium/drivers/llvmpipe/lp_screen.c b/src/gallium/drivers/llvmpipe/lp_screen.c index 9459a3c..7e0bbfe 100644 --- a/src/gallium/drivers/llvmpipe/lp_screen.c +++ b/src/gallium/drivers/llvmpipe/lp_screen.c @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ diff --git a/src/gallium/drivers/llvmpipe/lp_screen.h b/src/gallium/drivers/llvmpipe/lp_screen.h index 7f69a11..8b65f7a 100644 --- a/src/gallium/drivers/llvmpipe/lp_screen.h +++ b/src/gallium/drivers/llvmpipe/lp_screen.h @@ -1,5 +1,5 @@ /************************************************************************** - * + * * Copyright 2009 VMware, Inc. * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas. * All Rights Reserved. @@ -11,11 +11,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. @@ -23,7 +23,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. - * + * **************************************************************************/ /** diff --git a/src/gallium/drivers/llvmpipe/lp_setup.c b/src/gallium/drivers/llvmpipe/lp_setup.c index 7b7b272..e8e4750 100644 --- a/src/gallium/drivers/llvmpipe/lp_setup.c +++ b/src/gallium/drivers/llvmpipe/lp_setup.c @@ -80,7 +80,7 @@ lp_setup_get_empty_scene(struct lp_setup_context *setup) } lp_scene_begin_binning(setup->scene, &setup->fb); - + } @@ -208,8 +208,8 @@ begin_binning( struct lp_setup_context *setup ) if (setup->fb.nr_cbufs) { if (setup->clear.flags & PIPE_CLEAR_COLOR) { - ok = lp_scene_bin_everywhere( scene, - LP_RAST_OP_CLEAR_COLOR, + ok = lp_scene_bin_everywhere( scene, + LP_RAST_OP_CLEAR_COLOR, setup->clear.color ); if (!ok) return FALSE; @@ -249,7 +249,7 @@ begin_binning( struct lp_setup_context *setup ) /* This basically bins and then flushes any outstanding full-screen - * clears. + * clears. * * TODO: fast path for fullscreen clears and no triangles. */ @@ -277,7 +277,7 @@ set_scene_state( struct lp_setup_context *setup, if (old_state == new_state) return TRUE; - + if (LP_DEBUG & DEBUG_SCENE) { debug_printf("%s old %s new %s%s%s\n", __FUNCTION__, @@ -292,7 +292,7 @@ set_scene_state( struct lp_setup_context *setup, /* wait for a free/empty scene */ - if (old_state == SETUP_FLUSHED) + if (old_state == SETUP_FLUSHED) lp_setup_get_empty_scene(setup); switch (new_state) { @@ -422,7 +422,7 @@ lp_setup_try_clear( struct lp_setup_context *setup, * a common usage. */ if (flags & PIPE_CLEAR_COLOR) { - if (!lp_scene_bin_everywhere( scene, + if (!lp_scene_bin_everywhere( scene, LP_RAST_OP_CLEAR_COLOR, color_arg )) return FALSE; @@ -457,7 +457,7 @@ lp_setup_try_clear( struct lp_setup_context *setup, sizeof setup->clear.color.clear_color); } } - + return TRUE; } @@ -480,7 +480,7 @@ lp_setup_clear( struct lp_setup_context *setup, -void +void lp_setup_set_triangle_state( struct lp_setup_context *setup, unsigned cull_mode, boolean ccw_is_frontface, @@ -500,7 +500,7 @@ lp_setup_set_triangle_state( struct lp_setup_context *setup, } } -void +void lp_setup_set_line_state( struct lp_setup_context *setup, float line_width) { @@ -509,9 +509,9 @@ lp_setup_set_line_state( struct lp_setup_context *setup, setup->line_width = line_width; } -void +void lp_setup_set_point_state( struct lp_setup_context *setup, - float point_size, + float point_size, boolean point_size_per_vertex, uint sprite_coord_enable, uint sprite_coord_origin) @@ -529,7 +529,7 @@ lp_setup_set_setup_variant( struct lp_setup_context *setup, const struct lp_setup_variant *variant) { LP_DBG(DEBUG_SETUP, "%s\n", __FUNCTION__); - + setup->setup.variant = variant; } @@ -614,7 +614,7 @@ lp_setup_set_scissor( struct lp_setup_context *setup, } -void +void lp_setup_set_flatshade_first( struct lp_setup_context *setup, boolean flatshade_first ) { @@ -622,7 +622,7 @@ lp_setup_set_flatshade_first( struct lp_setup_context *setup, } -void +void lp_setup_set_vertex_info( struct lp_setup_context *setup, struct vertex_info *vertex_info ) { @@ -850,7 +850,7 @@ try_update_scene_state( struct lp_setup_context *setup ) { struct lp_rast_state *stored; uint i; - + /* The fs state that's been stored in the scene is different from * the new, current state. So allocate a new lp_rast_state object * and append it to the bin's setup data buffer. @@ -865,7 +865,7 @@ try_update_scene_state( struct lp_setup_context *setup ) &setup->fs.current, sizeof setup->fs.current); setup->fs.stored = stored; - + /* The scene now references the textures in the rasterization * state record. Note that now. */ @@ -889,7 +889,7 @@ try_update_scene_state( struct lp_setup_context *setup ) &setup->draw_region); } } - + setup->dirty = 0; assert(setup->fs.stored); @@ -918,14 +918,14 @@ lp_setup_update_state( struct lp_setup_context *setup, assert(setup->setup.variant); - /* Will probably need to move this somewhere else, just need + /* Will probably need to move this somewhere else, just need * to know about vertex shader point size attribute. */ setup->psize = lp->psize_slot; assert(lp->dirty == 0); - assert(lp->setup_variant.key.size == + assert(lp->setup_variant.key.size == setup->setup.variant->key.size); assert(memcmp(&lp->setup_variant.key, @@ -971,7 +971,7 @@ lp_setup_update_state( struct lp_setup_context *setup, /* Only caller is lp_setup_vbuf_destroy() */ -void +void lp_setup_destroy( struct lp_setup_context *setup ) { uint i; @@ -1019,7 +1019,7 @@ lp_setup_create( struct pipe_context *pipe, return NULL; lp_setup_init_vbuf(setup); - + /* Used only in update_state(): */ setup->pipe = pipe; @@ -1041,7 +1041,7 @@ lp_setup_create( struct pipe_context *pipe, setup->triangle = first_triangle; setup->line = first_line; setup->point = first_point; - + setup->dirty = ~0; return setup; @@ -1066,7 +1066,7 @@ lp_setup_begin_query(struct lp_setup_context *setup, assert(setup->active_query == NULL); set_scene_state(setup, SETUP_ACTIVE, "begin_query"); - + if (setup->scene) { if (!lp_scene_bin_everywhere(setup->scene, LP_RAST_OP_BEGIN_QUERY, @@ -1132,7 +1132,7 @@ lp_setup_flush_and_restart(struct lp_setup_context *setup) if (!set_scene_state(setup, SETUP_FLUSHED, __FUNCTION__)) return FALSE; - + if (!lp_setup_update_state(setup, TRUE)) return FALSE; diff --git a/src/gallium/drivers/llvmpipe/lp_setup.h b/src/gallium/drivers/llvmpipe/lp_setup.h index 0d6e161..543ee0b 100644 --- a/src/gallium/drivers/llvmpipe/lp_setup.h +++ b/src/gallium/drivers/llvmpipe/lp_setup.h @@ -73,20 +73,20 @@ void lp_setup_bind_framebuffer( struct lp_setup_context *setup, const struct pipe_framebuffer_state *fb ); -void +void lp_setup_set_triangle_state( struct lp_setup_context *setup, unsigned cullmode, boolean front_is_ccw, boolean scissor, boolean gl_rasterization_rules ); -void +void lp_setup_set_line_state( struct lp_setup_context *setup, float line_width); -void +void lp_setup_set_point_state( struct lp_setup_context *setup, - float point_size, + float point_size, boolean point_size_per_vertex, uint sprite_coord_enable, uint sprite_coord_origin); @@ -135,11 +135,11 @@ lp_setup_is_resource_referenced( const struct lp_setup_context *setup, const struct pipe_resource *texture ); void -lp_setup_set_flatshade_first( struct lp_setup_context *setup, +lp_setup_set_flatshade_first( struct lp_setup_context *setup, boolean flatshade_first ); void -lp_setup_set_vertex_info( struct lp_setup_context *setup, +lp_setup_set_vertex_info( struct lp_setup_context *setup, struct vertex_info *info ); void diff --git a/src/gallium/drivers/llvmpipe/lp_setup_context.h b/src/gallium/drivers/llvmpipe/lp_setup_context.h index dc2533b..422e2f1 100644 --- a/src/gallium/drivers/llvmpipe/lp_setup_context.h +++ b/src/gallium/drivers/llvmpipe/lp_setup_context.h @@ -119,7 +119,7 @@ struct lp_setup_context SETUP_CLEARED, /**< scene exists but has only clears */ SETUP_ACTIVE /**< scene exists and has at least one draw/query */ } state; - + struct { const struct lp_rast_state *stored; /**< what's in the scene */ struct lp_rast_state current; /**< currently set state */ diff --git a/src/gallium/drivers/llvmpipe/lp_setup_line.c b/src/gallium/drivers/llvmpipe/lp_setup_line.c index 29c2317..feacf58 100644 --- a/src/gallium/drivers/llvmpipe/lp_setup_line.c +++ b/src/gallium/drivers/llvmpipe/lp_setup_line.c @@ -79,16 +79,16 @@ static void linear_coef( struct lp_setup_context *setup, unsigned vert_attr, unsigned i) { - float a1 = info->v1[vert_attr][i]; + float a1 = info->v1[vert_attr][i]; float a2 = info->v2[vert_attr][i]; - - float da21 = a1 - a2; + + float da21 = a1 - a2; float dadx = da21 * info->dx * info->oneoverarea; float dady = da21 * info->dy * info->oneoverarea; info->dadx[slot][i] = dadx; - info->dady[slot][i] = dady; - + info->dady[slot][i] = dady; + info->a0[slot][i] = (a1 - (dadx * (info->v1[0][0] - setup->pixel_offset) + dady * (info->v1[0][1] - setup->pixel_offset))); @@ -114,13 +114,13 @@ static void perspective_coef( struct lp_setup_context *setup, float a1 = info->v1[vert_attr][i] * info->v1[0][3]; float a2 = info->v2[vert_attr][i] * info->v2[0][3]; - float da21 = a1 - a2; + float da21 = a1 - a2; float dadx = da21 * info->dx * info->oneoverarea; float dady = da21 * info->dy * info->oneoverarea; info->dadx[slot][i] = dadx; info->dady[slot][i] = dady; - + info->a0[slot][i] = (a1 - (dadx * (info->v1[0][0] - setup->pixel_offset) + dady * (info->v1[0][1] - setup->pixel_offset))); @@ -173,7 +173,7 @@ static void setup_line_coefficients( struct lp_setup_context *setup, unsigned vert_attr = key->inputs[slot].src_index; unsigned usage_mask = key->inputs[slot].usage_mask; unsigned i; - + switch (key->inputs[slot].interp) { case LP_INTERP_CONSTANT: if (key->flatshade_first) { @@ -259,8 +259,8 @@ print_line(struct lp_setup_context *setup, static INLINE boolean sign(float x){ - return x >= 0; -} + return x >= 0; +} /* Used on positive floats only: @@ -285,11 +285,11 @@ try_setup_line( struct lp_setup_context *setup, float width = MAX2(1.0, setup->line_width); struct u_rect bbox; unsigned tri_bytes; - int x[4]; + int x[4]; int y[4]; int i; int nr_planes = 4; - + /* linewidth should be interpreted as integer */ int fixed_width = util_iround(width) * FIXED_ONE; @@ -297,7 +297,7 @@ try_setup_line( struct lp_setup_context *setup, float y_offset=0; float x_offset_end=0; float y_offset_end=0; - + float x1diff; float y1diff; float x2diff; @@ -335,7 +335,7 @@ try_setup_line( struct lp_setup_context *setup, info.v1 = v1; info.v2 = v2; - + /* X-MAJOR LINE */ if (fabsf(dx) >= fabsf(dy)) { float dydx = dy / dx; @@ -348,10 +348,10 @@ try_setup_line( struct lp_setup_context *setup, if (y2diff==-0.5 && dy<0){ y2diff = 0.5; } - - /* - * Diamond exit rule test for starting point - */ + + /* + * Diamond exit rule test for starting point + */ if (fabsf(x1diff) + fabsf(y1diff) < 0.5) { draw_start = TRUE; } @@ -368,9 +368,9 @@ try_setup_line( struct lp_setup_context *setup, } - /* - * Diamond exit rule test for ending point - */ + /* + * Diamond exit rule test for ending point + */ if (fabsf(x2diff) + fabsf(y2diff) < 0.5) { draw_end = FALSE; } @@ -421,23 +421,23 @@ try_setup_line( struct lp_setup_context *setup, y_offset_end = x_offset_end * dydx; } } - + /* x/y positions in fixed point */ x[0] = subpixel_snap(v1[0][0] + x_offset - setup->pixel_offset); x[1] = subpixel_snap(v2[0][0] + x_offset_end - setup->pixel_offset); x[2] = subpixel_snap(v2[0][0] + x_offset_end - setup->pixel_offset); x[3] = subpixel_snap(v1[0][0] + x_offset - setup->pixel_offset); - + y[0] = subpixel_snap(v1[0][1] + y_offset - setup->pixel_offset) - fixed_width/2; y[1] = subpixel_snap(v2[0][1] + y_offset_end - setup->pixel_offset) - fixed_width/2; y[2] = subpixel_snap(v2[0][1] + y_offset_end - setup->pixel_offset) + fixed_width/2; y[3] = subpixel_snap(v1[0][1] + y_offset - setup->pixel_offset) + fixed_width/2; - + } else { const float dxdy = dx / dy; - /* Y-MAJOR LINE */ + /* Y-MAJOR LINE */ x1diff = v1[0][0] - (float) floor(v1[0][0]) - 0.5; y1diff = v1[0][1] - (float) floor(v1[0][1]) - 0.5; x2diff = v2[0][0] - (float) floor(v2[0][0]) - 0.5; @@ -447,9 +447,9 @@ try_setup_line( struct lp_setup_context *setup, x2diff = 0.5; } - /* - * Diamond exit rule test for starting point - */ + /* + * Diamond exit rule test for starting point + */ if (fabsf(x1diff) + fabsf(y1diff) < 0.5) { draw_start = TRUE; } @@ -465,9 +465,9 @@ try_setup_line( struct lp_setup_context *setup, draw_start = (xintersect < 1.0 && xintersect > 0.0); } - /* - * Diamond exit rule test for ending point - */ + /* + * Diamond exit rule test for ending point + */ if (fabsf(x2diff) + fabsf(y2diff) < 0.5) { draw_end = FALSE; } @@ -492,7 +492,7 @@ try_setup_line( struct lp_setup_context *setup, /* if v2 is on top of v1, swap pointers */ const float (*temp)[4] = v1; v1 = v2; - v2 = temp; + v2 = temp; dx = -dx; dy = -dy; @@ -511,7 +511,7 @@ try_setup_line( struct lp_setup_context *setup, if (will_draw_start != draw_start) { y_offset = - y1diff - 0.5; x_offset = y_offset * dxdy; - + } if (will_draw_end != draw_end) { y_offset_end = - y2diff - 0.5; @@ -524,8 +524,8 @@ try_setup_line( struct lp_setup_context *setup, x[1] = subpixel_snap(v2[0][0] + x_offset_end - setup->pixel_offset) - fixed_width/2; x[2] = subpixel_snap(v2[0][0] + x_offset_end - setup->pixel_offset) + fixed_width/2; x[3] = subpixel_snap(v1[0][0] + x_offset - setup->pixel_offset) + fixed_width/2; - - y[0] = subpixel_snap(v1[0][1] + y_offset - setup->pixel_offset); + + y[0] = subpixel_snap(v1[0][1] + y_offset - setup->pixel_offset); y[1] = subpixel_snap(v2[0][1] + y_offset_end - setup->pixel_offset); y[2] = subpixel_snap(v2[0][1] + y_offset_end - setup->pixel_offset); y[3] = subpixel_snap(v1[0][1] + y_offset - setup->pixel_offset); @@ -535,7 +535,7 @@ try_setup_line( struct lp_setup_context *setup, LP_COUNT(nr_tris); - + /* Bounding rectangle (in pixels) */ { /* Yes this is necessary to accurately calculate bounding boxes @@ -583,7 +583,7 @@ try_setup_line( struct lp_setup_context *setup, #ifdef DEBUG line->v[0][0] = v1[0][0]; - line->v[1][0] = v2[0][0]; + line->v[1][0] = v2[0][0]; line->v[0][1] = v1[0][1]; line->v[1][1] = v2[0][1]; #endif @@ -606,7 +606,7 @@ try_setup_line( struct lp_setup_context *setup, info.a0 = GET_A0(&line->inputs); info.dadx = GET_DADX(&line->inputs); info.dady = GET_DADY(&line->inputs); - setup_line_coefficients(setup, &info); + setup_line_coefficients(setup, &info); line->inputs.frontfacing = TRUE; line->inputs.disable = FALSE; @@ -619,8 +619,8 @@ try_setup_line( struct lp_setup_context *setup, */ plane[i].c = plane[i].dcdx * x[i] - plane[i].dcdy * y[i]; - - /* correct for top-left vs. bottom-left fill convention. + + /* correct for top-left vs. bottom-left fill convention. * * note that we're overloading gl_rasterization_rules to mean * both (0.5,0.5) pixel centers *and* bottom-left filling @@ -632,10 +632,10 @@ try_setup_line( struct lp_setup_context *setup, * Also, sometimes (in FBO cases) GL will render upside down * to its usual method, in which case it will probably want * to use the opposite, top-left convention. - */ + */ if (plane[i].dcdx < 0) { /* both fill conventions want this - adjust for left edges */ - plane[i].c++; + plane[i].c++; } else if (plane[i].dcdx == 0) { if (setup->pixel_offset == 0) { @@ -664,7 +664,7 @@ try_setup_line( struct lp_setup_context *setup, } - /* + /* * When rasterizing scissored tris, use the intersection of the * triangle bounding box and the scissor rect to generate the * scissor planes. @@ -677,7 +677,7 @@ try_setup_line( struct lp_setup_context *setup, * It's not really clear if it's worth worrying about these tails, * but since we generate the planes for each scissored tri, it's * free to trim them in this case. - * + * * Note that otherwise, the scissor planes only vary in 'C' value, * and even then only on state-changes. Could alternatively store * these planes elsewhere. @@ -725,8 +725,8 @@ static void lp_setup_line( struct lp_setup_context *setup, } -void lp_setup_choose_line( struct lp_setup_context *setup ) -{ +void lp_setup_choose_line( struct lp_setup_context *setup ) +{ setup->line = lp_setup_line; } diff --git a/src/gallium/drivers/llvmpipe/lp_setup_point.c b/src/gallium/drivers/llvmpipe/lp_setup_point.c index 146f1bd..9f0f080 100644 --- a/src/gallium/drivers/llvmpipe/lp_setup_point.c +++ b/src/gallium/drivers/llvmpipe/lp_setup_point.c @@ -50,7 +50,7 @@ struct point_info { float (*a0)[4]; float (*dadx)[4]; float (*dady)[4]; -}; +}; /** @@ -202,7 +202,7 @@ setup_point_fragcoord_coef(struct lp_setup_context *setup, /** * Compute the point->coef[] array dadx, dady, a0 values. */ -static void +static void setup_point_coefficients( struct lp_setup_context *setup, struct point_info *info) { @@ -223,7 +223,7 @@ setup_point_coefficients( struct lp_setup_context *setup, if (perspective & usage_mask) { fragcoord_usage_mask |= TGSI_WRITEMASK_W; } - + switch (interp) { case LP_INTERP_POSITION: /* @@ -308,8 +308,8 @@ try_setup_point( struct lp_setup_context *setup, const float size = (setup->point_size_per_vertex && sizeAttr > 0) ? v0[sizeAttr][0] : setup->point_size; - - /* Point size as fixed point integer, remove rounding errors + + /* Point size as fixed point integer, remove rounding errors * and gives minimum width for very small points */ int fixed_width = MAX2(FIXED_ONE, @@ -317,7 +317,7 @@ try_setup_point( struct lp_setup_context *setup, const int x0 = subpixel_snap(v0[0][0] - setup->pixel_offset) - fixed_width/2; const int y0 = subpixel_snap(v0[0][1] - setup->pixel_offset) - fixed_width/2; - + struct lp_scene *scene = setup->scene; struct lp_rast_triangle *point; unsigned bytes; @@ -345,7 +345,7 @@ try_setup_point( struct lp_setup_context *setup, bbox.x1--; bbox.y1--; } - + if (!u_rect_test_intersection(&setup->draw_region, &bbox)) { if (0) debug_printf("offscreen\n"); LP_COUNT(nr_culled_tris); @@ -374,7 +374,7 @@ try_setup_point( struct lp_setup_context *setup, info.a0 = GET_A0(&point->inputs); info.dadx = GET_DADX(&point->inputs); info.dady = GET_DADY(&point->inputs); - + /* Setup parameter interpolants: */ setup_point_coefficients(setup, &info); @@ -411,7 +411,7 @@ try_setup_point( struct lp_setup_context *setup, } -static void +static void lp_setup_point(struct lp_setup_context *setup, const float (*v0)[4]) { @@ -426,7 +426,7 @@ lp_setup_point(struct lp_setup_context *setup, } -void +void lp_setup_choose_point( struct lp_setup_context *setup ) { setup->point = lp_setup_point; diff --git a/src/gallium/drivers/llvmpipe/lp_setup_tri.c b/src/gallium/drivers/llvmpipe/lp_setup_tri.c index bfb6bf2..6d387c6 100644 --- a/src/gallium/drivers/llvmpipe/lp_setup_tri.c +++ b/src/gallium/drivers/llvmpipe/lp_setup_tri.c @@ -44,7 +44,7 @@ #if defined(PIPE_ARCH_SSE) #include #endif - + static INLINE int subpixel_snap(float a) { @@ -116,7 +116,7 @@ lp_setup_print_vertex(struct lp_setup_context *setup, const float *in = v[key->inputs[i].src_index]; debug_printf(" in[%d] (%s[%d]) %s%s%s%s ", - i, + i, name, key->inputs[i].src_index, (key->inputs[i].usage_mask & 0x1) ? "x" : " ", (key->inputs[i].usage_mask & 0x2) ? "y" : " ", @@ -151,7 +151,7 @@ lp_setup_print_triangle(struct lp_setup_context *setup, /* det = cross(e,f).z */ const float det = ex * fy - ey * fx; - if (det < 0.0f) + if (det < 0.0f) debug_printf(" - ccw\n"); else if (det > 0.0f) debug_printf(" - cw\n"); @@ -212,7 +212,7 @@ lp_setup_whole_tile(struct lp_setup_context *setup, } else { LP_COUNT(nr_shade_64); return lp_scene_bin_cmd_with_state( scene, tx, ty, - setup->fs.stored, + setup->fs.stored, LP_RAST_OP_SHADE_TILE, lp_rast_arg_inputs(inputs) ); } @@ -260,7 +260,7 @@ do_triangle_ccw(struct lp_setup_context *setup, y[1] = subpixel_snap(v1[0][1] - setup->pixel_offset); y[2] = subpixel_snap(v2[0][1] - setup->pixel_offset); y[3] = 0; - + /* Bounding rectangle (in pixels) */ { @@ -414,14 +414,14 @@ do_triangle_ccw(struct lp_setup_context *setup, plane[0].dcdx = y[0] - y[1]; plane[1].dcdx = y[1] - y[2]; plane[2].dcdx = y[2] - y[0]; - + for (i = 0; i < 3; i++) { /* half-edge constants, will be interated over the whole render * target. */ plane[i].c = plane[i].dcdx * x[i] - plane[i].dcdy * y[i]; - /* correct for top-left vs. bottom-left fill convention. + /* correct for top-left vs. bottom-left fill convention. * * note that we're overloading gl_rasterization_rules to mean * both (0.5,0.5) pixel centers *and* bottom-left filling @@ -433,10 +433,10 @@ do_triangle_ccw(struct lp_setup_context *setup, * Also, sometimes (in FBO cases) GL will render upside down * to its usual method, in which case it will probably want * to use the opposite, top-left convention. - */ + */ if (plane[i].dcdx < 0) { /* both fill conventions want this - adjust for left edges */ - plane[i].c++; + plane[i].c++; } else if (plane[i].dcdx == 0) { if (setup->pixel_offset == 0) { @@ -472,13 +472,13 @@ do_triangle_ccw(struct lp_setup_context *setup, plane[0].dcdx, plane[0].dcdy, plane[0].eo); - + debug_printf("p1: %08x/%08x/%08x/%08x\n", plane[1].c, plane[1].dcdx, plane[1].dcdy, plane[1].eo); - + debug_printf("p0: %08x/%08x/%08x/%08x\n", plane[2].c, plane[2].dcdx, @@ -487,7 +487,7 @@ do_triangle_ccw(struct lp_setup_context *setup, } - /* + /* * When rasterizing scissored tris, use the intersection of the * triangle bounding box and the scissor rect to generate the * scissor planes. @@ -500,7 +500,7 @@ do_triangle_ccw(struct lp_setup_context *setup, * It's not really clear if it's worth worrying about these tails, * but since we generate the planes for each scissored tri, it's * free to trim them in this case. - * + * * Note that otherwise, the scissor planes only vary in 'C' value, * and even then only on state-changes. Could alternatively store * these planes elsewhere. @@ -537,7 +537,7 @@ do_triangle_ccw(struct lp_setup_context *setup, * * Undefined if no bit set exists, so code should check against 0 first. */ -static INLINE uint32_t +static INLINE uint32_t floor_pot(uint32_t n) { #if defined(PIPE_CC_GCC) && defined(PIPE_ARCH_X86) @@ -566,7 +566,7 @@ lp_setup_bin_triangle( struct lp_setup_context *setup, int nr_planes ) { struct lp_scene *scene = setup->scene; - struct u_rect trimmed_box = *bbox; + struct u_rect trimmed_box = *bbox; int i; /* What is the largest power-of-two boundary this triangle crosses: @@ -621,7 +621,7 @@ lp_setup_bin_triangle( struct lp_setup_context *setup, lp_rast_arg_triangle(tri, mask) ); } } - else if (nr_planes == 4 && sz < 16) + else if (nr_planes == 4 && sz < 16) { return lp_scene_bin_cmd_with_state(scene, ix0, iy0, setup->fs.stored, @@ -633,7 +633,7 @@ lp_setup_bin_triangle( struct lp_setup_context *setup, /* Triangle is contained in a single tile: */ return lp_scene_bin_cmd_with_state( scene, ix0, iy0, setup->fs.stored, - lp_rast_tri_tab[nr_planes], + lp_rast_tri_tab[nr_planes], lp_rast_arg_triangle(tri, (1<fs.stored, - lp_rast_tri_tab[count], + lp_rast_tri_tab[count], lp_rast_arg_triangle(tri, partial) )) goto fail; @@ -727,7 +727,7 @@ lp_setup_bin_triangle( struct lp_setup_context *setup, for (i = 0; i < nr_planes; i++) cx[i] += xstep[i]; } - + /* Iterate c values down the region: */ for (i = 0; i < nr_planes; i++) @@ -789,7 +789,7 @@ static void triangle_cw( struct lp_setup_context *setup, { float area = calc_area(v0, v1, v2); - if (area < 0.0f) + if (area < 0.0f) retry_triangle_ccw(setup, v0, v2, v1, !setup->ccw_is_frontface); } @@ -801,7 +801,7 @@ static void triangle_ccw( struct lp_setup_context *setup, { float area = calc_area(v0, v1, v2); - if (area > 0.0f) + if (area > 0.0f) retry_triangle_ccw(setup, v0, v1, v2, setup->ccw_is_frontface); } @@ -825,7 +825,7 @@ static void triangle_both( struct lp_setup_context *setup, assert(!util_is_inf_or_nan(area)); } - if (area > 0.0f) + if (area > 0.0f) retry_triangle_ccw( setup, v0, v1, v2, setup->ccw_is_frontface ); else if (area < 0.0f) retry_triangle_ccw( setup, v0, v2, v1, !setup->ccw_is_frontface ); @@ -840,7 +840,7 @@ static void triangle_nop( struct lp_setup_context *setup, } -void +void lp_setup_choose_triangle( struct lp_setup_context *setup ) { switch (setup->cullmode) { diff --git a/src/gallium/drivers/llvmpipe/lp_setup_vbuf.c b/src/gallium/drivers/llvmpipe/lp_setup_vbuf.c index 384242f..c76f179 100644 --- a/src/gallium/drivers/llvmpipe/lp_setup_vbuf.c +++ b/src/gallium/drivers/llvmpipe/lp_setup_vbuf.c @@ -45,7 +45,7 @@ #define LP_MAX_VBUF_INDEXES 1024 #define LP_MAX_VBUF_SIZE 4096 - + /** cast wrapper */ static struct lp_setup_context * @@ -85,7 +85,7 @@ lp_setup_allocate_vertices(struct vbuf_render *vbr, setup->vertex_size = vertex_size; setup->nr_vertices = nr_vertices; - + return setup->vertex_buffer != NULL; } @@ -102,8 +102,8 @@ lp_setup_map_vertices(struct vbuf_render *vbr) return setup->vertex_buffer; } -static void -lp_setup_unmap_vertices(struct vbuf_render *vbr, +static void +lp_setup_unmap_vertices(struct vbuf_render *vbr, ushort min_index, ushort max_index ) { @@ -237,7 +237,7 @@ lp_setup_draw_elements(struct vbuf_render *vbr, const ushort *indices, uint nr) case PIPE_PRIM_QUADS: /* GL quads don't follow provoking vertex convention */ - if (flatshade_first) { + if (flatshade_first) { /* emit last quad vertex as first triangle vertex */ for (i = 3; i < nr; i += 4) { setup->triangle( setup, @@ -269,7 +269,7 @@ lp_setup_draw_elements(struct vbuf_render *vbr, const ushort *indices, uint nr) case PIPE_PRIM_QUAD_STRIP: /* GL quad strips don't follow provoking vertex convention */ - if (flatshade_first) { + if (flatshade_first) { /* emit last quad vertex as first triangle vertex */ for (i = 3; i < nr; i += 2) { setup->triangle( setup, @@ -301,7 +301,7 @@ lp_setup_draw_elements(struct vbuf_render *vbr, const ushort *indices, uint nr) /* Almost same as tri fan but the _first_ vertex specifies the flat * shading color. */ - if (flatshade_first) { + if (flatshade_first) { /* emit first polygon vertex as first triangle vertex */ for (i = 2; i < nr; i += 1) { setup->triangle( setup, @@ -434,7 +434,7 @@ lp_setup_draw_arrays(struct vbuf_render *vbr, uint start, uint nr) case PIPE_PRIM_QUADS: /* GL quads don't follow provoking vertex convention */ - if (flatshade_first) { + if (flatshade_first) { /* emit last quad vertex as first triangle vertex */ for (i = 3; i < nr; i += 4) { setup->triangle( setup, @@ -464,7 +464,7 @@ lp_setup_draw_arrays(struct vbuf_render *vbr, uint start, uint nr) case PIPE_PRIM_QUAD_STRIP: /* GL quad strips don't follow provoking vertex convention */ - if (flatshade_first) { + if (flatshade_first) { /* emit last quad vertex as first triangle vertex */ for (i = 3; i < nr; i += 2) { setup->triangle( setup, @@ -496,7 +496,7 @@ lp_setup_draw_arrays(struct vbuf_render *vbr, uint start, uint nr) /* Almost same as tri fan but the _first_ vertex specifies the flat * shading color. */ - if (flatshade_first) { + if (flatshade_first) { /* emit first polygon vertex as first triangle vertex */ for (i = 2; i < nr; i += 1) { setup->triangle( setup, diff --git a/src/gallium/drivers/llvmpipe/lp_state.h b/src/gallium/drivers/llvmpipe/lp_state.h index 7893e9c..a624c91 100644 --- a/src/gallium/drivers/llvmpipe/lp_state.h +++ b/src/gallium/drivers/llvmpipe/lp_state.h @@ -1,5 +1,5 @@ /************************************************************************** - * + * * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas. * All Rights Reserved. * @@ -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. - * + * **************************************************************************/ /* Authors: Keith Whitwell @@ -97,7 +97,7 @@ llvmpipe_set_framebuffer_state(struct pipe_context *, void llvmpipe_update_fs(struct llvmpipe_context *lp); -void +void llvmpipe_update_setup(struct llvmpipe_context *lp); void diff --git a/src/gallium/drivers/llvmpipe/lp_state_blend.c b/src/gallium/drivers/llvmpipe/lp_state_blend.c index 6bba907..23615ca 100644 --- a/src/gallium/drivers/llvmpipe/lp_state_blend.c +++ b/src/gallium/drivers/llvmpipe/lp_state_blend.c @@ -1,5 +1,5 @@ /************************************************************************** - * + * * Copyright 2009 VMware, Inc. * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas. * All Rights Reserved. @@ -11,11 +11,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. @@ -23,7 +23,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. - * + * **************************************************************************/ /** diff --git a/src/gallium/drivers/llvmpipe/lp_state_clip.c b/src/gallium/drivers/llvmpipe/lp_state_clip.c index 32ae079..9325572 100644 --- a/src/gallium/drivers/llvmpipe/lp_state_clip.c +++ b/src/gallium/drivers/llvmpipe/lp_state_clip.c @@ -1,5 +1,5 @@ /************************************************************************** - * + * * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas. * All Rights Reserved. * @@ -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. - * + * **************************************************************************/ /* Authors: Keith Whitwell diff --git a/src/gallium/drivers/llvmpipe/lp_state_derived.c b/src/gallium/drivers/llvmpipe/lp_state_derived.c index 8725ea3..d9ef154 100644 --- a/src/gallium/drivers/llvmpipe/lp_state_derived.c +++ b/src/gallium/drivers/llvmpipe/lp_state_derived.c @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2003 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ #include "util/u_math.h" @@ -138,7 +138,7 @@ void llvmpipe_update_derived( struct llvmpipe_context *llvmpipe ) llvmpipe->tex_timestamp = lp_screen->timestamp; llvmpipe->dirty |= LP_NEW_SAMPLER_VIEW; } - + if (llvmpipe->dirty & (LP_NEW_RASTERIZER | LP_NEW_FS | LP_NEW_VS)) @@ -166,14 +166,14 @@ void llvmpipe_update_derived( struct llvmpipe_context *llvmpipe ) lp_setup_set_scissor(llvmpipe->setup, &llvmpipe->scissor); if (llvmpipe->dirty & LP_NEW_DEPTH_STENCIL_ALPHA) { - lp_setup_set_alpha_ref_value(llvmpipe->setup, + lp_setup_set_alpha_ref_value(llvmpipe->setup, llvmpipe->depth_stencil->alpha.ref_value); lp_setup_set_stencil_ref_values(llvmpipe->setup, llvmpipe->stencil_ref.ref_value); } if (llvmpipe->dirty & LP_NEW_CONSTANTS) - lp_setup_set_fs_constants(llvmpipe->setup, + lp_setup_set_fs_constants(llvmpipe->setup, llvmpipe->constants[PIPE_SHADER_FRAGMENT][0]); if (llvmpipe->dirty & (LP_NEW_SAMPLER_VIEW)) diff --git a/src/gallium/drivers/llvmpipe/lp_state_fs.c b/src/gallium/drivers/llvmpipe/lp_state_fs.c index 2c4943a..3ce119a 100644 --- a/src/gallium/drivers/llvmpipe/lp_state_fs.c +++ b/src/gallium/drivers/llvmpipe/lp_state_fs.c @@ -1,9 +1,9 @@ /************************************************************************** - * + * * Copyright 2009 VMware, Inc. * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas. * 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 @@ -11,11 +11,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. @@ -23,7 +23,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. - * + * **************************************************************************/ /** @@ -107,7 +107,7 @@ static unsigned fs_no = 0; /** - * Expand the relevent bits of mask_input to a 4-dword mask for the + * Expand the relevent bits of mask_input to a 4-dword mask for the * four pixels in a 2x2 quad. This will set the four elements of the * quad mask vector to 0 or ~0. * @@ -171,7 +171,7 @@ generate_quad_mask(struct gallivm_state *gallivm, bits[1] = LLVMConstInt(i32t, 1 << 1, 0); bits[2] = LLVMConstInt(i32t, 1 << 4, 0); bits[3] = LLVMConstInt(i32t, 1 << 5, 0); - + mask = LLVMBuildAnd(builder, mask, LLVMConstVector(bits, 4), ""); /* @@ -332,7 +332,7 @@ generate_fs(struct gallivm_state *gallivm, } lp_build_interp_soa_update_inputs(interp, gallivm, i); - + /* Build the actual shader */ lp_build_tgsi_soa(gallivm, tokens, type, &mask, consts_ptr, interp->pos, interp->inputs, @@ -358,11 +358,11 @@ generate_fs(struct gallivm_state *gallivm, } /* Late Z test */ - if (depth_mode & LATE_DEPTH_TEST) { + if (depth_mode & LATE_DEPTH_TEST) { int pos0 = find_output_by_semantic(&shader->info.base, TGSI_SEMANTIC_POSITION, 0); - + if (pos0 != -1 && outputs[pos0][2]) { z = LLVMBuildLoad(builder, outputs[pos0][2], "output.z"); } @@ -578,7 +578,7 @@ generate_fragment(struct llvmpipe_context *lp, blend_type.width = 8; /* 8-bit ubyte values */ blend_type.length = 16; /* 16 elements per vector */ - /* + /* * Generate the function prototype. Any change here must be reflected in * lp_jit.h's lp_jit_frag_func function pointer type, and vice-versa. */ @@ -588,7 +588,7 @@ generate_fragment(struct llvmpipe_context *lp, blend_vec_type = lp_build_vec_type(gallivm, blend_type); - util_snprintf(func_name, sizeof(func_name), "fs%u_variant%u_%s", + util_snprintf(func_name, sizeof(func_name), "fs%u_variant%u_%s", shader->no, variant->no, partial_mask ? "partial" : "whole"); arg_types[0] = lp_jit_get_context_type(lp); /* context */ @@ -658,7 +658,7 @@ generate_fragment(struct llvmpipe_context *lp, * shader key, but everything it derives from (TGSI, and flatshade) is * already included in the shader key. */ - lp_build_interp_soa_init(&interp, + lp_build_interp_soa_init(&interp, gallivm, shader->info.base.num_inputs, inputs, @@ -712,12 +712,12 @@ generate_fragment(struct llvmpipe_context *lp, LLVMValueRef blend_in_color[NUM_CHANNELS]; unsigned rt; - /* - * Convert the fs's output color and mask to fit to the blending type. + /* + * Convert the fs's output color and mask to fit to the blending type. */ for(chan = 0; chan < NUM_CHANNELS; ++chan) { LLVMValueRef fs_color_vals[LP_MAX_VECTOR_LENGTH]; - + for (i = 0; i < num_fs; i++) { fs_color_vals[i] = LLVMBuildLoad(builder, fs_out_color[cbuf][chan][i], "fs_color_vals"); @@ -739,7 +739,7 @@ generate_fragment(struct llvmpipe_context *lp, blend_mask = lp_build_const_int_vec(lp->gallivm, blend_type, ~0); } - color_ptr = LLVMBuildLoad(builder, + color_ptr = LLVMBuildLoad(builder, LLVMBuildGEP(builder, color_ptr_ptr, &index, 1, ""), ""); lp_build_name(color_ptr, "color_ptr%d", cbuf); @@ -895,7 +895,7 @@ dump_fs_variant_key(const struct lp_fragment_shader_variant_key *key) void lp_debug_fs_variant(const struct lp_fragment_shader_variant *variant) { - debug_printf("llvmpipe: Fragment shader #%u variant #%u:\n", + debug_printf("llvmpipe: Fragment shader #%u variant #%u:\n", variant->shader->no, variant->no); tgsi_dump(variant->shader->base.tokens, 0); dump_fs_variant_key(&variant->key); @@ -1311,7 +1311,7 @@ make_variant_key(struct llvmpipe_context *lp, * Update fragment shader state. This is called just prior to drawing * something when some fragment-related state has changed. */ -void +void llvmpipe_update_fs(struct llvmpipe_context *lp) { struct lp_fragment_shader *shader = lp->fs; diff --git a/src/gallium/drivers/llvmpipe/lp_state_gs.c b/src/gallium/drivers/llvmpipe/lp_state_gs.c index 1ba6f10..9bc765a 100644 --- a/src/gallium/drivers/llvmpipe/lp_state_gs.c +++ b/src/gallium/drivers/llvmpipe/lp_state_gs.c @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ #include "lp_context.h" diff --git a/src/gallium/drivers/llvmpipe/lp_state_rasterizer.c b/src/gallium/drivers/llvmpipe/lp_state_rasterizer.c index 574f9e9..6bc08a0 100644 --- a/src/gallium/drivers/llvmpipe/lp_state_rasterizer.c +++ b/src/gallium/drivers/llvmpipe/lp_state_rasterizer.c @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ #include "pipe/p_defines.h" @@ -68,7 +68,7 @@ llvmpipe_create_rasterizer_state(struct pipe_context *pipe, /* We rely on draw module to do unfilled polyons, AA lines and * points and stipple. - * + * * Over time, reduce this list of conditions, and expand the list * of flags which get cleared in clear_flags(). */ @@ -124,7 +124,7 @@ llvmpipe_bind_rasterizer_state(struct pipe_context *pipe, void *handle) } else { llvmpipe->rasterizer = NULL; - draw_set_rasterizer_state(llvmpipe->draw, NULL, handle); + draw_set_rasterizer_state(llvmpipe->draw, NULL, handle); } llvmpipe->dirty |= LP_NEW_RASTERIZER; diff --git a/src/gallium/drivers/llvmpipe/lp_state_sampler.c b/src/gallium/drivers/llvmpipe/lp_state_sampler.c index 1dd8661..8c98686 100644 --- a/src/gallium/drivers/llvmpipe/lp_state_sampler.c +++ b/src/gallium/drivers/llvmpipe/lp_state_sampler.c @@ -1,5 +1,5 @@ /************************************************************************** - * + * * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas. * All Rights Reserved. * @@ -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. - * + * **************************************************************************/ /* Authors: diff --git a/src/gallium/drivers/llvmpipe/lp_state_setup.c b/src/gallium/drivers/llvmpipe/lp_state_setup.c index ad751b9..5e57cde 100644 --- a/src/gallium/drivers/llvmpipe/lp_state_setup.c +++ b/src/gallium/drivers/llvmpipe/lp_state_setup.c @@ -145,23 +145,23 @@ store_coef(struct gallivm_state *gallivm, { LLVMBuilderRef builder = gallivm->builder; LLVMValueRef idx = lp_build_const_int32(gallivm, slot); - + LLVMBuildStore(builder, - a0, + a0, LLVMBuildGEP(builder, args->a0, &idx, 1, "")); LLVMBuildStore(builder, - dadx, + dadx, LLVMBuildGEP(builder, args->dadx, &idx, 1, "")); LLVMBuildStore(builder, - dady, + dady, LLVMBuildGEP(builder, args->dady, &idx, 1, "")); } -static void +static void emit_constant_coef4(struct gallivm_state *gallivm, struct lp_setup_args *args, unsigned slot, @@ -178,7 +178,7 @@ emit_constant_coef4(struct gallivm_state *gallivm, * Setup the fragment input attribute with the front-facing value. * \param frontface is the triangle front facing? */ -static void +static void emit_facing_coef(struct gallivm_state *gallivm, struct lp_setup_args *args, unsigned slot ) @@ -237,7 +237,7 @@ lp_twoside(struct gallivm_state *gallivm, LLVMValueRef facing = args->facing; LLVMValueRef front_facing = LLVMBuildICmp(b, LLVMIntEQ, facing, lp_build_const_int32(gallivm, 0), ""); /** need i1 for if condition */ - + a0_back = LLVMBuildLoad(b, LLVMBuildGEP(b, args->v0, &idx2, 1, ""), "v0a_back"); a1_back = LLVMBuildLoad(b, LLVMBuildGEP(b, args->v1, &idx2, 1, ""), "v1a_back"); a2_back = LLVMBuildLoad(b, LLVMBuildGEP(b, args->v2, &idx2, 1, ""), "v2a_back"); @@ -264,7 +264,7 @@ lp_do_offset_tri(struct gallivm_state *gallivm, LLVMValueRef z0_new, z1_new, z2_new; LLVMValueRef dzdx0, dzdx, dzdy0, dzdy; LLVMValueRef max, max_value; - + LLVMValueRef one = lp_build_const_float(gallivm, 1.0); LLVMValueRef zero = lp_build_const_float(gallivm, 0.0); LLVMValueRef two = lp_build_const_int32(gallivm, 2); @@ -279,21 +279,21 @@ lp_do_offset_tri(struct gallivm_state *gallivm, LLVMValueRef v0_z = vert_attrib(gallivm, args->v0, 0, 2, "v0_z"); LLVMValueRef v1_z = vert_attrib(gallivm, args->v1, 0, 2, "v1_z"); LLVMValueRef v2_z = vert_attrib(gallivm, args->v2, 0, 2, "v2_z"); - + /* edge vectors: e = v0 - v2, f = v1 - v2 */ LLVMValueRef dx02 = LLVMBuildFSub(b, v0_x, v2_x, "dx02"); LLVMValueRef dy02 = LLVMBuildFSub(b, v0_y, v2_y, "dy02"); LLVMValueRef dz02 = LLVMBuildFSub(b, v0_z, v2_z, "dz02"); - LLVMValueRef dx12 = LLVMBuildFSub(b, v1_x, v2_x, "dx12"); + LLVMValueRef dx12 = LLVMBuildFSub(b, v1_x, v2_x, "dx12"); LLVMValueRef dy12 = LLVMBuildFSub(b, v1_y, v2_y, "dy12"); LLVMValueRef dz12 = LLVMBuildFSub(b, v1_z, v2_z, "dz12"); - + /* det = cross(e,f).z */ LLVMValueRef dx02_dy12 = LLVMBuildFMul(b, dx02, dy12, "dx02_dy12"); LLVMValueRef dy02_dx12 = LLVMBuildFMul(b, dy02, dx12, "dy02_dx12"); LLVMValueRef det = LLVMBuildFSub(b, dx02_dy12, dy02_dx12, "det"); - LLVMValueRef inv_det = LLVMBuildFDiv(b, one, det, "inv_det"); - + LLVMValueRef inv_det = LLVMBuildFDiv(b, one, det, "inv_det"); + /* (res1,res2) = cross(e,f).xy */ LLVMValueRef dy02_dz12 = LLVMBuildFMul(b, dy02, dz12, "dy02_dz12"); LLVMValueRef dz02_dy12 = LLVMBuildFMul(b, dz02, dy12, "dz02_dy12"); @@ -311,7 +311,7 @@ lp_do_offset_tri(struct gallivm_state *gallivm, /* zoffset = offset->units + MAX2(dzdx, dzdy) * offset->scale */ max = LLVMBuildFCmp(b, LLVMRealUGT, dzdx, dzdy, ""); - max_value = LLVMBuildSelect(b, max, dzdx, dzdy, "max"); + max_value = LLVMBuildSelect(b, max, dzdx, dzdy, "max"); mult = LLVMBuildFMul(b, max_value, lp_build_const_float(gallivm, key->scale), ""); zoffset = LLVMBuildFAdd(b, lp_build_const_float(gallivm, key->units), mult, "zoffset"); @@ -322,7 +322,7 @@ lp_do_offset_tri(struct gallivm_state *gallivm, z2_new = vert_clamp(b, LLVMBuildFAdd(b, v2_z, zoffset, ""), zero, one); /* insert into args->a0.z, a1.z, a2.z: - */ + */ args->v0a = LLVMBuildInsertElement(b, args->v0a, z0_new, two, ""); args->v1a = LLVMBuildInsertElement(b, args->v1a, z1_new, two, ""); args->v2a = LLVMBuildInsertElement(b, args->v2a, z2_new, two, ""); @@ -358,7 +358,7 @@ load_attribute(struct gallivm_state *gallivm, } } -static void +static void emit_coef4( struct gallivm_state *gallivm, struct lp_setup_args *args, unsigned slot, @@ -393,23 +393,23 @@ emit_coef4( struct gallivm_state *gallivm, /* Calculate a0 - the attribute value at the origin */ - LLVMValueRef dadx_x0 = LLVMBuildFMul(b, dadx, x0_center, "dadx_x0"); - LLVMValueRef dady_y0 = LLVMBuildFMul(b, dady, y0_center, "dady_y0"); - LLVMValueRef attr_v0 = LLVMBuildFAdd(b, dadx_x0, dady_y0, "attr_v0"); - LLVMValueRef attr_0 = LLVMBuildFSub(b, a0, attr_v0, "attr_0"); + LLVMValueRef dadx_x0 = LLVMBuildFMul(b, dadx, x0_center, "dadx_x0"); + LLVMValueRef dady_y0 = LLVMBuildFMul(b, dady, y0_center, "dady_y0"); + LLVMValueRef attr_v0 = LLVMBuildFAdd(b, dadx_x0, dady_y0, "attr_v0"); + LLVMValueRef attr_0 = LLVMBuildFSub(b, a0, attr_v0, "attr_0"); store_coef(gallivm, args, slot, attr_0, dadx, dady); } -static void +static void emit_linear_coef( struct gallivm_state *gallivm, struct lp_setup_args *args, unsigned slot) { /* nothing to do anymore */ emit_coef4(gallivm, - args, slot, + args, slot, args->v0a, args->v1a, args->v2a); @@ -424,7 +424,7 @@ emit_linear_coef( struct gallivm_state *gallivm, * Later, when we compute the value at a particular fragment position we'll * divide the interpolated value by the interpolated W at that fragment. */ -static void +static void emit_perspective_coef( struct gallivm_state *gallivm, struct lp_setup_args *args, unsigned slot) @@ -459,7 +459,7 @@ emit_position_coef( struct gallivm_state *gallivm, /** * Compute the inputs-> dadx, dady, a0 values. */ -static void +static void emit_tri_coef( struct gallivm_state *gallivm, const struct lp_setup_variant_key *key, struct lp_setup_args *args ) @@ -608,7 +608,7 @@ init_args(struct gallivm_state *gallivm, LLVMValueRef x0_center = LLVMBuildFSub(b, v0_x, pixel_center, "x0_center" ); LLVMValueRef y0_center = LLVMBuildFSub(b, v0_y, pixel_center, "y0_center" ); - + LLVMValueRef dx01 = LLVMBuildFSub(b, v0_x, v1_x, "dx01"); LLVMValueRef dy01 = LLVMBuildFSub(b, v0_y, v1_y, "dy01"); LLVMValueRef dx20 = LLVMBuildFSub(b, v2_x, v0_x, "dx20"); @@ -737,7 +737,7 @@ generate_setup_variant(struct gallivm_state *gallivm, LP_COUNT_ADD(llvm_compile_time, t1 - t0); LP_COUNT_ADD(nr_llvm_compiles, 1); } - + return variant; fail: @@ -750,7 +750,7 @@ generate_setup_variant(struct gallivm_state *gallivm, } FREE(variant); } - + return NULL; } @@ -764,7 +764,7 @@ lp_make_setup_variant_key(struct llvmpipe_context *lp, unsigned i; assert(sizeof key->inputs[0] == sizeof(ushort)); - + key->num_inputs = fs->info.base.num_inputs; key->flatshade_first = lp->rasterizer->flatshade_first; key->pixel_center_half = lp->rasterizer->gl_rasterization_rules; @@ -842,7 +842,7 @@ cull_setup_variants(struct llvmpipe_context *lp) * prior to drawing something when some fragment-related state has * changed. */ -void +void llvmpipe_update_setup(struct llvmpipe_context *lp) { struct lp_setup_variant_key *key = &lp->setup_variant.key; diff --git a/src/gallium/drivers/llvmpipe/lp_state_setup.h b/src/gallium/drivers/llvmpipe/lp_state_setup.h index 90c55ca..61232c0 100644 --- a/src/gallium/drivers/llvmpipe/lp_state_setup.h +++ b/src/gallium/drivers/llvmpipe/lp_state_setup.h @@ -14,7 +14,7 @@ struct lp_setup_variant_list_item }; -struct lp_setup_variant_key { +struct lp_setup_variant_key { unsigned size:16; unsigned num_inputs:8; unsigned color_slot:8; @@ -28,7 +28,7 @@ struct lp_setup_variant_key { unsigned pad:5; float units; - float scale; + float scale; struct lp_shader_input inputs[PIPE_MAX_SHADER_INPUTS]; }; @@ -52,7 +52,7 @@ typedef void (*lp_jit_setup_triangle)( const float (*v0)[4], */ struct lp_setup_variant { struct lp_setup_variant_key key; - + struct lp_setup_variant_list_item list_item_global; /* XXX: this is a pointer to the LLVM IR. Once jit_function is diff --git a/src/gallium/drivers/llvmpipe/lp_state_surface.c b/src/gallium/drivers/llvmpipe/lp_state_surface.c index 375ceb2..c4bd229 100644 --- a/src/gallium/drivers/llvmpipe/lp_state_surface.c +++ b/src/gallium/drivers/llvmpipe/lp_state_surface.c @@ -1,5 +1,5 @@ /************************************************************************** - * + * * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas. * All Rights Reserved. * @@ -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. - * + * **************************************************************************/ /* Authors: Keith Whitwell diff --git a/src/gallium/drivers/llvmpipe/lp_state_vertex.c b/src/gallium/drivers/llvmpipe/lp_state_vertex.c index fb29423..ad22989 100644 --- a/src/gallium/drivers/llvmpipe/lp_state_vertex.c +++ b/src/gallium/drivers/llvmpipe/lp_state_vertex.c @@ -1,5 +1,5 @@ /************************************************************************** - * + * * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas. * All Rights Reserved. * @@ -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. - * + * **************************************************************************/ /* Authors: Keith Whitwell diff --git a/src/gallium/drivers/llvmpipe/lp_state_vs.c b/src/gallium/drivers/llvmpipe/lp_state_vs.c index f2d8808..b1b563f 100644 --- a/src/gallium/drivers/llvmpipe/lp_state_vs.c +++ b/src/gallium/drivers/llvmpipe/lp_state_vs.c @@ -1,9 +1,9 @@ /************************************************************************** - * + * * Copyright 2009 VMware, Inc. * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas. * 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 @@ -11,11 +11,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. @@ -23,7 +23,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. - * + * **************************************************************************/ @@ -46,7 +46,7 @@ llvmpipe_create_vs_state(struct pipe_context *pipe, struct lp_vertex_shader *state; state = CALLOC_STRUCT(lp_vertex_shader); - if (state == NULL ) + if (state == NULL ) goto fail; /* copy shader tokens, the ones passed in will go away. @@ -56,7 +56,7 @@ llvmpipe_create_vs_state(struct pipe_context *pipe, goto fail; state->draw_data = draw_create_vertex_shader(llvmpipe->draw, templ); - if (state->draw_data == NULL) + if (state->draw_data == NULL) goto fail; if (LP_DEBUG & DEBUG_TGSI) { @@ -85,7 +85,7 @@ llvmpipe_bind_vs_state(struct pipe_context *pipe, void *_vs) if (llvmpipe->vs == vs) return; - draw_bind_vertex_shader(llvmpipe->draw, + draw_bind_vertex_shader(llvmpipe->draw, vs ? vs->draw_data : NULL); llvmpipe->vs = vs; diff --git a/src/gallium/drivers/llvmpipe/lp_surface.c b/src/gallium/drivers/llvmpipe/lp_surface.c index e7e46a6..33a2a11 100644 --- a/src/gallium/drivers/llvmpipe/lp_surface.c +++ b/src/gallium/drivers/llvmpipe/lp_surface.c @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ #include "util/u_rect.h" @@ -85,7 +85,7 @@ lp_resource_copy(struct pipe_context *pipe, /* printf("surface copy from %u lvl %u to %u lvl %u: %u,%u,%u to %u,%u,%u %u x %u x %u\n", - src_tex->id, src_level, dst_tex->id, dst_level, + src_tex->id, src_level, dst_tex->id, dst_level, src_box->x, src_box->y, src_box->z, dstx, dsty, dstz, src_box->width, src_box->height, src_box->depth); */ diff --git a/src/gallium/drivers/llvmpipe/lp_surface.h b/src/gallium/drivers/llvmpipe/lp_surface.h index b1b896e..c428c96 100644 --- a/src/gallium/drivers/llvmpipe/lp_surface.h +++ b/src/gallium/drivers/llvmpipe/lp_surface.h @@ -1,5 +1,5 @@ /************************************************************************** - * + * * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas. * All Rights Reserved. * @@ -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. - * + * **************************************************************************/ /* Authors: Keith Whitwell diff --git a/src/gallium/drivers/llvmpipe/lp_test_blend.c b/src/gallium/drivers/llvmpipe/lp_test_blend.c index b3ca134..0417f30 100644 --- a/src/gallium/drivers/llvmpipe/lp_test_blend.c +++ b/src/gallium/drivers/llvmpipe/lp_test_blend.c @@ -824,7 +824,7 @@ test_some(struct gallivm_state *gallivm, unsigned verbose, FILE *fp, alpha_func = &blend_funcs[rand() % num_funcs]; rgb_src_factor = &blend_factors[rand() % num_factors]; alpha_src_factor = &blend_factors[rand() % num_factors]; - + do { rgb_dst_factor = &blend_factors[rand() % num_factors]; } while(*rgb_dst_factor == PIPE_BLENDFACTOR_SRC_ALPHA_SATURATE); diff --git a/src/gallium/drivers/llvmpipe/lp_test_conv.c b/src/gallium/drivers/llvmpipe/lp_test_conv.c index f4a2f36..834c1e9 100644 --- a/src/gallium/drivers/llvmpipe/lp_test_conv.c +++ b/src/gallium/drivers/llvmpipe/lp_test_conv.c @@ -407,7 +407,7 @@ test_some(struct gallivm_state *gallivm, unsigned verbose, FILE *fp, for(i = 0; i < n; ++i) { src_type = &conv_types[rand() % num_types]; - + do { dst_type = &conv_types[rand() % num_types]; } while (src_type == dst_type || src_type->norm != dst_type->norm); diff --git a/src/gallium/drivers/llvmpipe/lp_test_main.c b/src/gallium/drivers/llvmpipe/lp_test_main.c index 149ee6f..e0de60b 100644 --- a/src/gallium/drivers/llvmpipe/lp_test_main.c +++ b/src/gallium/drivers/llvmpipe/lp_test_main.c @@ -405,7 +405,7 @@ int main(int argc, char **argv) write_tsv_header(fp); } - + if (single) success = test_single(gallivm, verbose, fp); else if (n) diff --git a/src/gallium/drivers/llvmpipe/lp_tex_sample.c b/src/gallium/drivers/llvmpipe/lp_tex_sample.c index ed42829..c622d42 100644 --- a/src/gallium/drivers/llvmpipe/lp_tex_sample.c +++ b/src/gallium/drivers/llvmpipe/lp_tex_sample.c @@ -1,5 +1,5 @@ /************************************************************************** - * + * * Copyright 2009 VMware, Inc. * All rights reserved. * @@ -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. - * + * **************************************************************************/ /** @@ -186,7 +186,7 @@ lp_llvm_sampler_soa_emit_fetch_texel(const struct lp_build_sampler_soa *base, struct lp_llvm_sampler_soa *sampler = (struct lp_llvm_sampler_soa *)base; assert(unit < PIPE_MAX_SAMPLERS); - + if (LP_PERF & PERF_NO_TEX) { lp_build_sample_nop(gallivm, type, texel); return; diff --git a/src/gallium/drivers/llvmpipe/lp_tex_sample.h b/src/gallium/drivers/llvmpipe/lp_tex_sample.h index 1228a83..e2217cb 100644 --- a/src/gallium/drivers/llvmpipe/lp_tex_sample.h +++ b/src/gallium/drivers/llvmpipe/lp_tex_sample.h @@ -1,5 +1,5 @@ /************************************************************************** - * + * * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas. * All Rights Reserved. * @@ -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. - * + * **************************************************************************/ #ifndef LP_TEX_SAMPLE_H diff --git a/src/gallium/drivers/llvmpipe/lp_texture.c b/src/gallium/drivers/llvmpipe/lp_texture.c index 9753da5..b446886 100644 --- a/src/gallium/drivers/llvmpipe/lp_texture.c +++ b/src/gallium/drivers/llvmpipe/lp_texture.c @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2006 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ /* * Authors: @@ -537,7 +537,7 @@ llvmpipe_create_surface(struct pipe_context *pipe, } -static void +static void llvmpipe_surface_destroy(struct pipe_context *pipe, struct pipe_surface *surf) { @@ -607,7 +607,7 @@ llvmpipe_get_transfer(struct pipe_context *pipe, } -static void +static void llvmpipe_transfer_destroy(struct pipe_context *pipe, struct pipe_transfer *transfer) { @@ -1269,7 +1269,7 @@ llvmpipe_unswizzle_cbuf_tile(struct llvmpipe_resource *lpr, uint ii = x, jj = y; uint tile_offset = jj / TILE_SIZE + ii / TILE_SIZE; uint byte_offset = tile_offset * TILE_SIZE * TILE_SIZE * 4; - + /* Note that lp_tiled_to_linear expects the tile parameter to * point at the first tile in a whole-image sized array. In * this code, we have only a single tile and have to do some @@ -1402,7 +1402,7 @@ llvmpipe_init_context_resource_funcs(struct pipe_context *pipe) pipe->transfer_map = llvmpipe_transfer_map; pipe->transfer_unmap = llvmpipe_transfer_unmap; pipe->is_resource_referenced = llvmpipe_is_resource_referenced; - + pipe->transfer_flush_region = u_default_transfer_flush_region; pipe->transfer_inline_write = u_default_transfer_inline_write; diff --git a/src/gallium/drivers/llvmpipe/lp_texture.h b/src/gallium/drivers/llvmpipe/lp_texture.h index b789c0f..d914661 100644 --- a/src/gallium/drivers/llvmpipe/lp_texture.h +++ b/src/gallium/drivers/llvmpipe/lp_texture.h @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ #ifndef LP_TEXTURE_H diff --git a/src/gallium/drivers/llvmpipe/lp_tile_image.c b/src/gallium/drivers/llvmpipe/lp_tile_image.c index 0938f7a..777b0fb 100644 --- a/src/gallium/drivers/llvmpipe/lp_tile_image.c +++ b/src/gallium/drivers/llvmpipe/lp_tile_image.c @@ -1,7 +1,7 @@ /************************************************************************** - * + * * Copyright 2010 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 @@ -9,11 +9,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. @@ -21,7 +21,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. - * + * **************************************************************************/ diff --git a/src/gallium/drivers/llvmpipe/lp_tile_image.h b/src/gallium/drivers/llvmpipe/lp_tile_image.h index 8de8efc..987b0ce 100644 --- a/src/gallium/drivers/llvmpipe/lp_tile_image.h +++ b/src/gallium/drivers/llvmpipe/lp_tile_image.h @@ -1,7 +1,7 @@ /************************************************************************** - * + * * Copyright 2010 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 @@ -9,11 +9,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. @@ -21,7 +21,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. - * + * **************************************************************************/ diff --git a/src/gallium/drivers/llvmpipe/lp_tile_soa.h b/src/gallium/drivers/llvmpipe/lp_tile_soa.h index 12dac1d..f6c1fce 100644 --- a/src/gallium/drivers/llvmpipe/lp_tile_soa.h +++ b/src/gallium/drivers/llvmpipe/lp_tile_soa.h @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ #ifndef LP_TILE_SOA_H diff --git a/src/gallium/drivers/llvmpipe/sse_mathfun.h b/src/gallium/drivers/llvmpipe/sse_mathfun.h index 0077f34..e8c5faf 100644 --- a/src/gallium/drivers/llvmpipe/sse_mathfun.h +++ b/src/gallium/drivers/llvmpipe/sse_mathfun.h @@ -35,7 +35,7 @@ #ifdef _MSC_VER /* visual c++ */ # define ALIGN16_BEG __declspec(align(16)) -# define ALIGN16_END +# define ALIGN16_END #else /* gcc or icc */ # define ALIGN16_BEG # define ALIGN16_END __attribute__((aligned(16))) @@ -112,7 +112,7 @@ typedef union xmm_mm_union { #endif // USE_SSE2 -/* natural logarithm computed for 4 simultaneous float +/* natural logarithm computed for 4 simultaneous float return NaN for x <= 0 */ v4sf log_ps(v4sf x) { @@ -153,7 +153,7 @@ v4sf log_ps(v4sf x) { e = _mm_add_ps(e, one); - /* part2: + /* part2: if( x < SQRTHF ) { e -= 1; x = x + x - 1.0; @@ -189,7 +189,7 @@ v4sf log_ps(v4sf x) { y = _mm_mul_ps(y, x); y = _mm_mul_ps(y, z); - + tmp = _mm_mul_ps(e, *(v4sf*)_ps_cephes_log_q1); y = _mm_add_ps(y, tmp); @@ -227,7 +227,7 @@ v4sf exp_ps(v4sf x) { v2si mm0, mm1; #endif v4sf one = *(v4sf*)_ps_1; - v4sf mask, z, y, pow2n; + v4sf mask, z, y, pow2n; x = _mm_min_ps(x, *(v4sf*)_ps_exp_hi); x = _mm_max_ps(x, *(v4sf*)_ps_exp_lo); @@ -249,7 +249,7 @@ v4sf exp_ps(v4sf x) { tmp = _mm_cvtepi32_ps(emm0); #endif /* if greater, substract 1 */ - mask = _mm_cmpgt_ps(tmp, fx); + mask = _mm_cmpgt_ps(tmp, fx); mask = _mm_and_ps(mask, one); fx = _mm_sub_ps(tmp, mask); @@ -259,7 +259,7 @@ v4sf exp_ps(v4sf x) { x = _mm_sub_ps(x, z); z = _mm_mul_ps(x,x); - + y = *(v4sf*)_ps_cephes_exp_p0; y = _mm_mul_ps(y, x); y = _mm_add_ps(y, *(v4sf*)_ps_cephes_exp_p1); @@ -282,9 +282,9 @@ v4sf exp_ps(v4sf x) { mm1 = _mm_cvttps_pi32(z); mm0 = _mm_add_pi32(mm0, *(v2si*)_pi32_0x7f); mm1 = _mm_add_pi32(mm1, *(v2si*)_pi32_0x7f); - mm0 = _mm_slli_pi32(mm0, 23); + mm0 = _mm_slli_pi32(mm0, 23); mm1 = _mm_slli_pi32(mm1, 23); - + COPY_MM_TO_XMM(mm0, mm1, pow2n); _mm_empty(); #else @@ -352,11 +352,11 @@ v4sf sin_ps(v4sf x) { // any x x = _mm_and_ps(x, *(v4sf*)_ps_inv_sign_mask); /* extract the sign bit (upper one) */ sign_bit = _mm_and_ps(sign_bit, *(v4sf*)_ps_sign_mask); - + /* scale by 4/Pi */ y = _mm_mul_ps(x, *(v4sf*)_ps_cephes_FOPI); - //printf("plop:"); print4(y); + //printf("plop:"); print4(y); #ifdef USE_SSE2 /* store the integer part of y in mm0 */ emm2 = _mm_cvttps_epi32(y); @@ -367,7 +367,7 @@ v4sf sin_ps(v4sf x) { // any x /* get the swap sign flag */ emm0 = _mm_and_si128(emm2, *(v4si*)_pi32_4); emm0 = _mm_slli_epi32(emm0, 29); - /* get the polynom selection mask + /* get the polynom selection mask there is one polynom for 0 <= x <= Pi/4 and another one for Pi/4dt = winsys->displaytarget_create(winsys, nresource->base.bind, nresource->base.format, - nresource->base.width0, + nresource->base.width0, nresource->base.height0, 16, &stride); } diff --git a/src/gallium/drivers/nouveau/Makefile b/src/gallium/drivers/nouveau/Makefile index db591b7..c9608b4 100644 --- a/src/gallium/drivers/nouveau/Makefile +++ b/src/gallium/drivers/nouveau/Makefile @@ -6,6 +6,6 @@ LIBNAME = nouveau LIBRARY_INCLUDES = \ -I$(TOP)/src/gallium/drivers/nouveau/include -C_SOURCES = nouveau_screen.c +C_SOURCES = nouveau_screen.c include ../../Makefile.template diff --git a/src/gallium/drivers/nouveau/nouveau_screen.c b/src/gallium/drivers/nouveau/nouveau_screen.c index a9426df..a395cc5 100644 --- a/src/gallium/drivers/nouveau/nouveau_screen.c +++ b/src/gallium/drivers/nouveau/nouveau_screen.c @@ -178,7 +178,7 @@ nouveau_screen_bo_from_handle(struct pipe_screen *pscreen, struct nouveau_device *dev = nouveau_screen(pscreen)->device; struct nouveau_bo *bo = 0; int ret; - + ret = nouveau_bo_handle_ref(dev, whandle->handle, &bo); if (ret) { debug_printf("%s: ref name 0x%08x failed with %d\n", @@ -199,7 +199,7 @@ nouveau_screen_bo_get_handle(struct pipe_screen *pscreen, { whandle->stride = stride; - if (whandle->type == DRM_API_HANDLE_TYPE_SHARED) { + if (whandle->type == DRM_API_HANDLE_TYPE_SHARED) { return nouveau_bo_handle_get(bo, &whandle->handle) == 0; } else if (whandle->type == DRM_API_HANDLE_TYPE_KMS) { whandle->handle = bo->handle; diff --git a/src/gallium/drivers/nv50/nv50_buffer.c b/src/gallium/drivers/nv50/nv50_buffer.c index 45356f9..8896bd6 100644 --- a/src/gallium/drivers/nv50/nv50_buffer.c +++ b/src/gallium/drivers/nv50/nv50_buffer.c @@ -38,7 +38,7 @@ nv50_buffer_transfer_map( struct pipe_context *pipe, nouveau_screen_transfer_flags(transfer->usage) ); if (map == NULL) return NULL; - + return map + transfer->box.x; } @@ -141,7 +141,7 @@ nv50_user_buffer_create(struct pipe_screen *pscreen, buffer->bo = nouveau_screen_bo_user(pscreen, ptr, bytes); if (!buffer->bo) goto fail; - + return &buffer->base; fail: diff --git a/src/gallium/drivers/nv50/nv50_pc.h b/src/gallium/drivers/nv50/nv50_pc.h index 2ead804..cb20a99 100644 --- a/src/gallium/drivers/nv50/nv50_pc.h +++ b/src/gallium/drivers/nv50/nv50_pc.h @@ -208,7 +208,7 @@ struct nv_range { }; struct nv_value { - struct nv_reg reg; + struct nv_reg reg; struct nv_instruction *insn; struct nv_value *join; int n; diff --git a/src/gallium/drivers/nv50/nv50_pc_emit.c b/src/gallium/drivers/nv50/nv50_pc_emit.c index f37dc51..461dd28 100644 --- a/src/gallium/drivers/nv50/nv50_pc_emit.c +++ b/src/gallium/drivers/nv50/nv50_pc_emit.c @@ -676,7 +676,7 @@ emit_minmax(struct nv_pc *pc, struct nv_instruction *i) pc->emit[1] |= 0x84000000; break; } - + emit_form_MAD(pc, i); if (i->src[0]->mod & NV_MOD_ABS) pc->emit[1] |= 0x00100000; diff --git a/src/gallium/drivers/nv50/nv50_pc_regalloc.c b/src/gallium/drivers/nv50/nv50_pc_regalloc.c index 39ae366..132a53f 100644 --- a/src/gallium/drivers/nv50/nv50_pc_regalloc.c +++ b/src/gallium/drivers/nv50/nv50_pc_regalloc.c @@ -327,9 +327,9 @@ do_join_values(struct nv_pc_pass *ctx, struct nv_value *a, struct nv_value *b) #ifdef NV50_RA_DEBUG_JOIN debug_printf("joining %i to %i\n", b->n, a->n); #endif - + /* make a->join the new representative */ - for (j = 0; j < ctx->pc->num_values; ++j) + for (j = 0; j < ctx->pc->num_values; ++j) if (ctx->pc->values[j].join == bjoin) ctx->pc->values[j].join = a->join; diff --git a/src/gallium/drivers/nv50/nv50_program.c b/src/gallium/drivers/nv50/nv50_program.c index db68176..8ebd239 100644 --- a/src/gallium/drivers/nv50/nv50_program.c +++ b/src/gallium/drivers/nv50/nv50_program.c @@ -455,7 +455,7 @@ nv50_fragprog_prepare(struct nv50_translation_info *ti) if (sn[i] == TGSI_SEMANTIC_COLOR) p->vp.bfc[si[i]] = j; - + p->in[j].linear = (ti->interp_mode[i] & NV50_INTERP_LINEAR) ? 1 : 0; p->in[j].id = i; p->in[j].sn = sn[i]; diff --git a/src/gallium/drivers/nv50/nv50_resource.h b/src/gallium/drivers/nv50/nv50_resource.h index 4b2a75e..e937a61 100644 --- a/src/gallium/drivers/nv50/nv50_resource.h +++ b/src/gallium/drivers/nv50/nv50_resource.h @@ -45,7 +45,7 @@ nv50_miptree(struct pipe_resource *pt) } -static INLINE +static INLINE struct nv50_resource *nv50_resource(struct pipe_resource *resource) { return (struct nv50_resource *)resource; diff --git a/src/gallium/drivers/nv50/nv50_surface.c b/src/gallium/drivers/nv50/nv50_surface.c index ce48022..4dde927 100644 --- a/src/gallium/drivers/nv50/nv50_surface.c +++ b/src/gallium/drivers/nv50/nv50_surface.c @@ -115,7 +115,7 @@ nv50_surface_set(struct nv50_screen *screen, struct pipe_surface *ps, int dst) OUT_RELOCh(chan, bo, ((struct nv50_surface *)ps)->offset, flags); OUT_RELOCl(chan, bo, ((struct nv50_surface *)ps)->offset, flags); } - + #if 0 if (dst) { BEGIN_RING(chan, eng2d, NV50_2D_CLIP_X, 4); @@ -125,7 +125,7 @@ nv50_surface_set(struct nv50_screen *screen, struct pipe_surface *ps, int dst) OUT_RING (chan, surf->height); } #endif - + return 0; } diff --git a/src/gallium/drivers/nv50/nv50_tgsi_to_nc.c b/src/gallium/drivers/nv50/nv50_tgsi_to_nc.c index ce9300a..d18e7d3 100644 --- a/src/gallium/drivers/nv50/nv50_tgsi_to_nc.c +++ b/src/gallium/drivers/nv50/nv50_tgsi_to_nc.c @@ -527,7 +527,7 @@ bld_insn_1(struct bld_context *bld, uint opcode, struct nv_value *src0) struct nv_instruction *insn = new_instruction(bld->pc, opcode); nv_reference(bld->pc, &insn->src[0], src0); - + return bld_def(insn, 0, new_value(bld->pc, NV_FILE_GPR, src0->reg.as_type)); } @@ -1159,7 +1159,7 @@ emit_fetch(struct bld_context *bld, const struct tgsi_full_instruction *insn, default: NOUVEAU_ERR("illegal/unhandled src reg file: %d\n", src->Register.File); abort(); - break; + break; } if (!res) return bld_undef(bld, NV_FILE_GPR); @@ -1549,7 +1549,7 @@ bld_instruction(struct bld_context *bld, #ifdef NV50_TGSI2NC_DEBUG debug_printf("bld_instruction:"); tgsi_dump_instruction(insn, 1); #endif - + switch (insn->Instruction.Opcode) { case TGSI_OPCODE_ADD: case TGSI_OPCODE_MAX: @@ -1804,7 +1804,7 @@ bld_instruction(struct bld_context *bld, FOR_EACH_DST0_ENABLED_CHANNEL(c, insn) { src0 = emit_fetch(bld, insn, 0, c); dst0[c] = bld_insn_1(bld, opcode, src0); - } + } break; case TGSI_OPCODE_LIT: bld_lit(bld, dst0, insn); diff --git a/src/gallium/drivers/nv50/nv50_vbo.c b/src/gallium/drivers/nv50/nv50_vbo.c index d41a59d..4c1b253 100644 --- a/src/gallium/drivers/nv50/nv50_vbo.c +++ b/src/gallium/drivers/nv50/nv50_vbo.c @@ -340,7 +340,7 @@ nv50_draw_elements_instanced(struct pipe_context *pipe, if (indexSize == 4) { BEGIN_RING(chan, tesla, NV50TCL_VB_ELEMENT_U32 | 0x30000, 0); OUT_RING (chan, count); - nouveau_pushbuf_submit(chan, + nouveau_pushbuf_submit(chan, nv50_resource(indexBuffer)->bo, start << 2, count << 2); } else diff --git a/src/gallium/drivers/r300/SConscript b/src/gallium/drivers/r300/SConscript index b49db93..a45293e 100644 --- a/src/gallium/drivers/r300/SConscript +++ b/src/gallium/drivers/r300/SConscript @@ -5,9 +5,9 @@ r300compiler = SConscript('#/src/mesa/drivers/dri/r300/compiler/SConscript') env = env.Clone() # add the paths for r300compiler env.Append(CPPPATH = [ - '#/src/mesa/drivers/dri/r300/compiler', + '#/src/mesa/drivers/dri/r300/compiler', '#/src/gallium/winsys/drm/radeon/core', - '#/include', + '#/include', '#/src/mesa', ]) diff --git a/src/gallium/drivers/r300/r300_emit.c b/src/gallium/drivers/r300/r300_emit.c index 972f58f..16d4de2 100644 --- a/src/gallium/drivers/r300/r300_emit.c +++ b/src/gallium/drivers/r300/r300_emit.c @@ -665,7 +665,7 @@ void r300_emit_query_end(struct r300_context* r300) rv530_emit_query_end_double_z(r300, query); else rv530_emit_query_end_single_z(r300, query); - } else + } else r300_emit_query_end_frag_pipes(r300, query); query->begin_emitted = FALSE; @@ -1128,7 +1128,7 @@ void r300_emit_hiz_clear(struct r300_context *r300, unsigned size, void *state) /* convert from pixels to 4x4 blocks */ stride = ALIGN_DIVUP(stride, 4); - stride = ALIGN_DIVUP(stride, r300screen->caps.num_frag_pipes); + stride = ALIGN_DIVUP(stride, r300screen->caps.num_frag_pipes); /* there are 4 blocks per dwords */ stride = ALIGN_DIVUP(stride, 4); diff --git a/src/gallium/drivers/r300/r300_hyperz.c b/src/gallium/drivers/r300/r300_hyperz.c index c22e307..c088fb6 100644 --- a/src/gallium/drivers/r300/r300_hyperz.c +++ b/src/gallium/drivers/r300/r300_hyperz.c @@ -31,7 +31,7 @@ #include "util/u_mm.h" /* - HiZ rules - taken from various docs + HiZ rules - taken from various docs 1. HiZ only works on depth values 2. Cannot HiZ if stencil fail or zfail is !KEEP 3. on R300/400, HiZ is disabled if depth test is EQUAL @@ -127,7 +127,7 @@ static boolean r300_can_hiz(struct r300_context *r300) z->current_func, dsa_state->z_stencil_control); return FALSE; } - } + } return TRUE; } diff --git a/src/gallium/drivers/r300/r300_screen_buffer.c b/src/gallium/drivers/r300/r300_screen_buffer.c index 0d52da9..655ec2a 100644 --- a/src/gallium/drivers/r300/r300_screen_buffer.c +++ b/src/gallium/drivers/r300/r300_screen_buffer.c @@ -298,7 +298,7 @@ static void r300_buffer_transfer_inline_write(struct pipe_context *pipe, r300_buffer_transfer_destroy(pipe, transfer); } -struct u_resource_vtbl r300_buffer_vtbl = +struct u_resource_vtbl r300_buffer_vtbl = { u_default_resource_get_handle, /* get_handle */ r300_buffer_destroy, /* resource_destroy */ diff --git a/src/gallium/drivers/r300/r300_state.c b/src/gallium/drivers/r300/r300_state.c index f902db5..e348049 100644 --- a/src/gallium/drivers/r300/r300_state.c +++ b/src/gallium/drivers/r300/r300_state.c @@ -754,7 +754,7 @@ static void r300->validate_buffers = TRUE; r300->z_compression = false; - + if (state->zsbuf) { blocksize = util_format_get_blocksize(state->zsbuf->texture->format); switch (blocksize) { @@ -775,7 +775,7 @@ static void /* work out whether we can support hiz on this buffer */ r300_hiz_alloc_block(r300, zs_surf); - + /* work out whether we can support zmask features on this buffer */ r300_zmask_alloc_block(r300, zs_surf, compress); @@ -997,7 +997,7 @@ static void* r300_create_rs_state(struct pipe_context* pipe, } /* Front face */ - if (state->front_ccw) + if (state->front_ccw) cull_mode = R300_FRONT_FACE_CCW; else cull_mode = R300_FRONT_FACE_CW; diff --git a/src/gallium/drivers/r300/r300_vs_draw.c b/src/gallium/drivers/r300/r300_vs_draw.c index 2939963..bb94fed 100644 --- a/src/gallium/drivers/r300/r300_vs_draw.c +++ b/src/gallium/drivers/r300/r300_vs_draw.c @@ -1,5 +1,5 @@ /************************************************************************** - * + * * Copyright 2009 Marek Olšák * * Permission is hereby granted, free of charge, to any person obtaining a @@ -9,11 +9,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. @@ -21,7 +21,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. - * + * **************************************************************************/ /* This file contains the vertex shader tranformations for SW TCL needed diff --git a/src/gallium/drivers/r600/SConscript b/src/gallium/drivers/r600/SConscript index 6498014..e51f50c 100644 --- a/src/gallium/drivers/r600/SConscript +++ b/src/gallium/drivers/r600/SConscript @@ -9,7 +9,7 @@ except OSError: Return() env.Append(CPPPATH = [ - '#/include', + '#/include', '#/src/mesa', ]) diff --git a/src/gallium/drivers/r600/eg_states_inc.h b/src/gallium/drivers/r600/eg_states_inc.h index 1379c11..1738ba5 100644 --- a/src/gallium/drivers/r600/eg_states_inc.h +++ b/src/gallium/drivers/r600/eg_states_inc.h @@ -49,7 +49,7 @@ #define EG_CONFIG__VGT_STRMOUT_CONFIG 44 #define EG_CONFIG__VGT_STRMOUT_BUFFER_CONFIG 45 #define EG_CONFIG_SIZE 46 -#define EG_CONFIG_PM4 128 +#define EG_CONFIG_PM4 128 /* EG_CB_CNTL */ #define EG_CB_CNTL__CB_TARGET_MASK 0 @@ -59,7 +59,7 @@ #define EG_CB_CNTL__PA_SC_AA_SAMPLE_LOCS_MCTX 4 #define EG_CB_CNTL__PA_SC_AA_MASK 5 #define EG_CB_CNTL_SIZE 6 -#define EG_CB_CNTL_PM4 128 +#define EG_CB_CNTL_PM4 128 /* EG_RASTERIZER */ #define EG_RASTERIZER__SPI_INTERP_CONTROL_0 0 @@ -84,7 +84,7 @@ #define EG_RASTERIZER__PA_SU_POLY_OFFSET_BACK_SCALE 19 #define EG_RASTERIZER__PA_SU_POLY_OFFSET_BACK_OFFSET 20 #define EG_RASTERIZER_SIZE 21 -#define EG_RASTERIZER_PM4 128 +#define EG_RASTERIZER_PM4 128 /* EG_VIEWPORT */ #define EG_VIEWPORT__PA_SC_VPORT_ZMIN_0 0 @@ -97,7 +97,7 @@ #define EG_VIEWPORT__PA_CL_VPORT_ZOFFSET_0 7 #define EG_VIEWPORT__PA_CL_VTE_CNTL 8 #define EG_VIEWPORT_SIZE 9 -#define EG_VIEWPORT_PM4 128 +#define EG_VIEWPORT_PM4 128 /* EG_SCISSOR */ #define EG_SCISSOR__PA_SC_SCREEN_SCISSOR_TL 0 @@ -121,7 +121,7 @@ #define EG_SCISSOR__PA_SC_VPORT_SCISSOR_0_BR 18 #define EG_SCISSOR__PA_SU_HARDWARE_SCREEN_OFFSET 19 #define EG_SCISSOR_SIZE 20 -#define EG_SCISSOR_PM4 128 +#define EG_SCISSOR_PM4 128 /* EG_BLEND */ #define EG_BLEND__CB_BLEND_RED 0 @@ -137,7 +137,7 @@ #define EG_BLEND__CB_BLEND6_CONTROL 10 #define EG_BLEND__CB_BLEND7_CONTROL 11 #define EG_BLEND_SIZE 12 -#define EG_BLEND_PM4 128 +#define EG_BLEND_PM4 128 /* EG_DSA */ #define EG_DSA__DB_STENCIL_CLEAR 0 @@ -158,7 +158,7 @@ #define EG_DSA__DB_PRELOAD_CONTROL 15 #define EG_DSA__DB_ALPHA_TO_MASK 16 #define EG_DSA_SIZE 17 -#define EG_DSA_PM4 128 +#define EG_DSA_PM4 128 /* EG_VS_SHADER */ #define EG_VS_SHADER__SQ_VTX_SEMANTIC_0 0 @@ -210,7 +210,7 @@ #define EG_VS_SHADER__SQ_PGM_START_FS 46 #define EG_VS_SHADER__SQ_PGM_RESOURCES_FS 47 #define EG_VS_SHADER_SIZE 48 -#define EG_VS_SHADER_PM4 128 +#define EG_VS_SHADER_PM4 128 /* EG_PS_SHADER */ #define EG_PS_SHADER__SPI_PS_INPUT_CNTL_0 0 @@ -257,7 +257,7 @@ #define EG_PS_SHADER__SQ_PGM_RESOURCES_2_PS 41 #define EG_PS_SHADER__SQ_PGM_EXPORTS_PS 42 #define EG_PS_SHADER_SIZE 43 -#define EG_PS_SHADER_PM4 128 +#define EG_PS_SHADER_PM4 128 /* EG_UCP */ #define EG_UCP__PA_CL_UCP0_X 0 @@ -285,19 +285,19 @@ #define EG_UCP__PA_CL_UCP5_Z 22 #define EG_UCP__PA_CL_UCP5_W 23 #define EG_UCP_SIZE 24 -#define EG_UCP_PM4 128 +#define EG_UCP_PM4 128 /* EG_VS_CBUF */ #define EG_VS_CBUF__ALU_CONST_BUFFER_SIZE_VS_0 0 #define EG_VS_CBUF__ALU_CONST_CACHE_VS_0 1 #define EG_VS_CBUF_SIZE 2 -#define EG_VS_CBUF_PM4 128 +#define EG_VS_CBUF_PM4 128 /* EG_PS_CBUF */ #define EG_PS_CBUF__ALU_CONST_BUFFER_SIZE_PS_0 0 #define EG_PS_CBUF__ALU_CONST_CACHE_PS_0 1 #define EG_PS_CBUF_SIZE 2 -#define EG_PS_CBUF_PM4 128 +#define EG_PS_CBUF_PM4 128 /* EG_PS_RESOURCE */ #define EG_PS_RESOURCE__RESOURCE0_WORD0 0 @@ -309,7 +309,7 @@ #define EG_PS_RESOURCE__RESOURCE0_WORD6 6 #define EG_PS_RESOURCE__RESOURCE0_WORD7 7 #define EG_PS_RESOURCE_SIZE 8 -#define EG_PS_RESOURCE_PM4 128 +#define EG_PS_RESOURCE_PM4 128 /* EG_VS_RESOURCE */ #define EG_VS_RESOURCE__RESOURCE160_WORD0 0 @@ -321,7 +321,7 @@ #define EG_VS_RESOURCE__RESOURCE160_WORD6 6 #define EG_VS_RESOURCE__RESOURCE160_WORD7 7 #define EG_VS_RESOURCE_SIZE 8 -#define EG_VS_RESOURCE_PM4 128 +#define EG_VS_RESOURCE_PM4 128 /* EG_FS_RESOURCE */ #define EG_FS_RESOURCE__RESOURCE320_WORD0 0 @@ -333,7 +333,7 @@ #define EG_FS_RESOURCE__RESOURCE320_WORD6 6 #define EG_FS_RESOURCE__RESOURCE320_WORD7 7 #define EG_FS_RESOURCE_SIZE 8 -#define EG_FS_RESOURCE_PM4 128 +#define EG_FS_RESOURCE_PM4 128 /* EG_GS_RESOURCE */ #define EG_GS_RESOURCE__RESOURCE336_WORD0 0 @@ -345,28 +345,28 @@ #define EG_GS_RESOURCE__RESOURCE336_WORD6 6 #define EG_GS_RESOURCE__RESOURCE336_WORD7 7 #define EG_GS_RESOURCE_SIZE 8 -#define EG_GS_RESOURCE_PM4 128 +#define EG_GS_RESOURCE_PM4 128 /* EG_PS_SAMPLER */ #define EG_PS_SAMPLER__SQ_TEX_SAMPLER_WORD0_0 0 #define EG_PS_SAMPLER__SQ_TEX_SAMPLER_WORD1_0 1 #define EG_PS_SAMPLER__SQ_TEX_SAMPLER_WORD2_0 2 #define EG_PS_SAMPLER_SIZE 3 -#define EG_PS_SAMPLER_PM4 128 +#define EG_PS_SAMPLER_PM4 128 /* EG_VS_SAMPLER */ #define EG_VS_SAMPLER__SQ_TEX_SAMPLER_WORD0_18 0 #define EG_VS_SAMPLER__SQ_TEX_SAMPLER_WORD1_18 1 #define EG_VS_SAMPLER__SQ_TEX_SAMPLER_WORD2_18 2 #define EG_VS_SAMPLER_SIZE 3 -#define EG_VS_SAMPLER_PM4 128 +#define EG_VS_SAMPLER_PM4 128 /* EG_GS_SAMPLER */ #define EG_GS_SAMPLER__SQ_TEX_SAMPLER_WORD0_36 0 #define EG_GS_SAMPLER__SQ_TEX_SAMPLER_WORD1_36 1 #define EG_GS_SAMPLER__SQ_TEX_SAMPLER_WORD2_36 2 #define EG_GS_SAMPLER_SIZE 3 -#define EG_GS_SAMPLER_PM4 128 +#define EG_GS_SAMPLER_PM4 128 /* EG_PS_SAMPLER_BORDER */ #define EG_PS_SAMPLER_BORDER__TD_PS_SAMPLER0_BORDER_INDEX 0 @@ -375,7 +375,7 @@ #define EG_PS_SAMPLER_BORDER__TD_PS_SAMPLER0_BORDER_BLUE 3 #define EG_PS_SAMPLER_BORDER__TD_PS_SAMPLER0_BORDER_ALPHA 4 #define EG_PS_SAMPLER_BORDER_SIZE 5 -#define EG_PS_SAMPLER_BORDER_PM4 128 +#define EG_PS_SAMPLER_BORDER_PM4 128 /* EG_VS_SAMPLER_BORDER */ #define EG_VS_SAMPLER_BORDER__TD_VS_SAMPLER0_BORDER_INDEX 0 @@ -384,7 +384,7 @@ #define EG_VS_SAMPLER_BORDER__TD_VS_SAMPLER0_BORDER_BLUE 3 #define EG_VS_SAMPLER_BORDER__TD_VS_SAMPLER0_BORDER_ALPHA 4 #define EG_VS_SAMPLER_BORDER_SIZE 5 -#define EG_VS_SAMPLER_BORDER_PM4 128 +#define EG_VS_SAMPLER_BORDER_PM4 128 /* EG_GS_SAMPLER_BORDER */ #define EG_GS_SAMPLER_BORDER__TD_GS_SAMPLER0_BORDER_INDEX 0 @@ -393,7 +393,7 @@ #define EG_GS_SAMPLER_BORDER__TD_GS_SAMPLER0_BORDER_BLUE 3 #define EG_GS_SAMPLER_BORDER__TD_GS_SAMPLER0_BORDER_ALPHA 4 #define EG_GS_SAMPLER_BORDER_SIZE 5 -#define EG_GS_SAMPLER_BORDER_PM4 128 +#define EG_GS_SAMPLER_BORDER_PM4 128 /* EG_CB */ #define EG_CB__CB_COLOR0_BASE 0 @@ -404,7 +404,7 @@ #define EG_CB__CB_COLOR0_ATTRIB 5 #define EG_CB__CB_COLOR0_DIM 6 #define EG_CB_SIZE 7 -#define EG_CB_PM4 128 +#define EG_CB_PM4 128 /* EG_DB */ #define EG_DB__DB_HTILE_DATA_BASE 0 @@ -419,7 +419,7 @@ #define EG_DB__DB_Z_WRITE_BASE 9 #define EG_DB__DB_STENCIL_WRITE_BASE 10 #define EG_DB_SIZE 11 -#define EG_DB_PM4 128 +#define EG_DB_PM4 128 /* EG_VGT */ #define EG_VGT__VGT_PRIMITIVE_TYPE 0 @@ -433,7 +433,7 @@ #define EG_VGT__VGT_INSTANCE_STEP_RATE_0 8 #define EG_VGT__VGT_INSTANCE_STEP_RATE_1 9 #define EG_VGT_SIZE 10 -#define EG_VGT_PM4 128 +#define EG_VGT_PM4 128 /* EG_DRAW */ #define EG_DRAW__VGT_NUM_INDICES 0 @@ -441,18 +441,18 @@ #define EG_DRAW__VGT_DMA_BASE 2 #define EG_DRAW__VGT_DRAW_INITIATOR 3 #define EG_DRAW_SIZE 4 -#define EG_DRAW_PM4 128 +#define EG_DRAW_PM4 128 /* EG_VGT_EVENT */ #define EG_VGT_EVENT__VGT_EVENT_INITIATOR 0 #define EG_VGT_EVENT_SIZE 1 -#define EG_VGT_EVENT_PM4 128 +#define EG_VGT_EVENT_PM4 128 /* EG_CB_FLUSH */ #define EG_CB_FLUSH_SIZE 0 -#define EG_CB_FLUSH_PM4 128 +#define EG_CB_FLUSH_PM4 128 /* EG_DB_FLUSH */ #define EG_DB_FLUSH_SIZE 0 -#define EG_DB_FLUSH_PM4 128 +#define EG_DB_FLUSH_PM4 128 diff --git a/src/gallium/drivers/r600/r600_asm.c b/src/gallium/drivers/r600/r600_asm.c index 9b9f033..1fbed2d 100644 --- a/src/gallium/drivers/r600/r600_asm.c +++ b/src/gallium/drivers/r600/r600_asm.c @@ -45,10 +45,10 @@ static inline unsigned int r600_bc_get_num_operands(struct r600_bc_alu *alu) case V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_KILLGT: case V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_KILLGE: case V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_KILLNE: - case V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_MUL: + case V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_MUL: case V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_MAX: case V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_MIN: - case V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_SETE: + case V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_SETE: case V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_SETNE: case V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_SETGT: case V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_SETGE: @@ -61,7 +61,7 @@ static inline unsigned int r600_bc_get_num_operands(struct r600_bc_alu *alu) case V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_CUBE: return 2; - case V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_MOV: + case V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_MOV: case V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_MOVA_FLOOR: case V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_FRACT: case V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_FLOOR: @@ -76,7 +76,7 @@ static inline unsigned int r600_bc_get_num_operands(struct r600_bc_alu *alu) case V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_COS: return 1; default: R600_ERR( - "Need instruction operand number for 0x%x.\n", alu->inst); + "Need instruction operand number for 0x%x.\n", alu->inst); }; return 3; @@ -365,8 +365,8 @@ static int check_scalar(struct r600_bc *bc, struct r600_bc_alu *alu) alu->bank_swizzle = alu->bank_swizzle_force; return 0; } - swizzle_key = (is_const(alu->src[0].sel) ? 4 : 0 ) + - (is_const(alu->src[1].sel) ? 2 : 0 ) + + swizzle_key = (is_const(alu->src[0].sel) ? 4 : 0 ) + + (is_const(alu->src[1].sel) ? 2 : 0 ) + (is_const(alu->src[2].sel) ? 1 : 0 ); alu->bank_swizzle = bank_swizzle_scl[swizzle_key]; @@ -381,8 +381,8 @@ static int check_vector(struct r600_bc *bc, struct r600_bc_alu *alu) alu->bank_swizzle = alu->bank_swizzle_force; return 0; } - swizzle_key = (is_const(alu->src[0].sel) ? 4 : 0 ) + - (is_const(alu->src[1].sel) ? 2 : 0 ) + + swizzle_key = (is_const(alu->src[0].sel) ? 4 : 0 ) + + (is_const(alu->src[1].sel) ? 2 : 0 ) + (is_const(alu->src[2].sel) ? 1 : 0 ); alu->bank_swizzle = bank_swizzle_vec[swizzle_key]; @@ -402,7 +402,7 @@ static int check_and_set_bank_swizzle(struct r600_bc *bc, struct r600_bc_alu *al if (num_instr == 1) { check_scalar(bc, alu_first); - + } else { /* check_read_slots(bc, bc->cf_last->curr_bs_head);*/ check_vector(bc, alu_first); diff --git a/src/gallium/drivers/r600/r600_pipe.h b/src/gallium/drivers/r600/r600_pipe.h index 43dbee9..88e38ac 100644 --- a/src/gallium/drivers/r600/r600_pipe.h +++ b/src/gallium/drivers/r600/r600_pipe.h @@ -241,7 +241,7 @@ int r600_conv_pipe_prim(unsigned pprim, unsigned *prim); void r600_init_screen_texture_functions(struct pipe_screen *screen); void r600_init_surface_functions(struct r600_pipe_context *r600); uint32_t r600_translate_texformat(enum pipe_format format, - const unsigned char *swizzle_view, + const unsigned char *swizzle_view, uint32_t *word4_p, uint32_t *yuv_format_p); unsigned r600_texture_get_offset(struct r600_resource_texture *rtex, unsigned level, unsigned layer); diff --git a/src/gallium/drivers/r600/r600_state_inlines.h b/src/gallium/drivers/r600/r600_state_inlines.h index d994196..cac060e 100644 --- a/src/gallium/drivers/r600/r600_state_inlines.h +++ b/src/gallium/drivers/r600/r600_state_inlines.h @@ -618,7 +618,7 @@ static INLINE uint32_t r600_translate_vertex_data_type(enum pipe_format format) default: goto out_unknown; } - + result = S_038008_DATA_FORMAT(result); if (desc->channel[i].type == UTIL_FORMAT_TYPE_SIGNED) { diff --git a/src/gallium/drivers/r600/r600_states_inc.h b/src/gallium/drivers/r600/r600_states_inc.h index 1c8075e..68afd37 100644 --- a/src/gallium/drivers/r600/r600_states_inc.h +++ b/src/gallium/drivers/r600/r600_states_inc.h @@ -43,7 +43,7 @@ #define R600_CONFIG__VGT_VTX_CNT_EN 38 #define R600_CONFIG__VGT_STRMOUT_BUFFER_EN 39 #define R600_CONFIG_SIZE 40 -#define R600_CONFIG_PM4 128 +#define R600_CONFIG_PM4 128 /* R600_CB_CNTL */ #define R600_CB_CNTL__CB_CLEAR_RED 0 @@ -66,7 +66,7 @@ #define R600_CB_CNTL__PA_SC_AA_MASK 17 #define R600_CB_CNTL__CB_SHADER_CONTROL 18 #define R600_CB_CNTL_SIZE 19 -#define R600_CB_CNTL_PM4 128 +#define R600_CB_CNTL_PM4 128 /* R600_RASTERIZER */ #define R600_RASTERIZER__SPI_INTERP_CONTROL_0 0 @@ -91,7 +91,7 @@ #define R600_RASTERIZER__PA_SU_POLY_OFFSET_BACK_SCALE 19 #define R600_RASTERIZER__PA_SU_POLY_OFFSET_BACK_OFFSET 20 #define R600_RASTERIZER_SIZE 21 -#define R600_RASTERIZER_PM4 128 +#define R600_RASTERIZER_PM4 128 /* R600_VIEWPORT */ #define R600_VIEWPORT__PA_SC_VPORT_ZMIN_0 0 @@ -104,7 +104,7 @@ #define R600_VIEWPORT__PA_CL_VPORT_ZOFFSET_0 7 #define R600_VIEWPORT__PA_CL_VTE_CNTL 8 #define R600_VIEWPORT_SIZE 9 -#define R600_VIEWPORT_PM4 128 +#define R600_VIEWPORT_PM4 128 /* R600_SCISSOR */ #define R600_SCISSOR__PA_SC_SCREEN_SCISSOR_TL 0 @@ -127,7 +127,7 @@ #define R600_SCISSOR__PA_SC_VPORT_SCISSOR_0_TL 17 #define R600_SCISSOR__PA_SC_VPORT_SCISSOR_0_BR 18 #define R600_SCISSOR_SIZE 19 -#define R600_SCISSOR_PM4 128 +#define R600_SCISSOR_PM4 128 /* R600_BLEND */ #define R600_BLEND__CB_BLEND_RED 0 @@ -144,7 +144,7 @@ #define R600_BLEND__CB_BLEND7_CONTROL 11 #define R600_BLEND__CB_BLEND_CONTROL 12 #define R600_BLEND_SIZE 13 -#define R600_BLEND_PM4 128 +#define R600_BLEND_PM4 128 /* R600_DSA */ #define R600_DSA__DB_STENCIL_CLEAR 0 @@ -164,7 +164,7 @@ #define R600_DSA__DB_PRELOAD_CONTROL 14 #define R600_DSA__DB_ALPHA_TO_MASK 15 #define R600_DSA_SIZE 16 -#define R600_DSA_PM4 128 +#define R600_DSA_PM4 128 /* R600_VS_SHADER */ #define R600_VS_SHADER__SQ_VTX_SEMANTIC_0 0 @@ -217,7 +217,7 @@ #define R600_VS_SHADER__SQ_PGM_CF_OFFSET_VS 47 #define R600_VS_SHADER__SQ_PGM_CF_OFFSET_FS 48 #define R600_VS_SHADER_SIZE 49 -#define R600_VS_SHADER_PM4 128 +#define R600_VS_SHADER_PM4 128 /* R600_PS_SHADER */ #define R600_PS_SHADER__SPI_PS_INPUT_CNTL_0 0 @@ -260,19 +260,19 @@ #define R600_PS_SHADER__SQ_PGM_EXPORTS_PS 37 #define R600_PS_SHADER__SQ_PGM_CF_OFFSET_PS 38 #define R600_PS_SHADER_SIZE 39 -#define R600_PS_SHADER_PM4 128 +#define R600_PS_SHADER_PM4 128 /* R600_VS_CBUF */ #define R600_VS_CBUF__ALU_CONST_BUFFER_SIZE_VS_0 0 #define R600_VS_CBUF__ALU_CONST_CACHE_VS_0 1 #define R600_VS_CBUF_SIZE 2 -#define R600_VS_CBUF_PM4 128 +#define R600_VS_CBUF_PM4 128 /* R600_PS_CBUF */ #define R600_PS_CBUF__ALU_CONST_BUFFER_SIZE_PS_0 0 #define R600_PS_CBUF__ALU_CONST_CACHE_PS_0 1 #define R600_PS_CBUF_SIZE 2 -#define R600_PS_CBUF_PM4 128 +#define R600_PS_CBUF_PM4 128 /* R600_PS_CONSTANT */ #define R600_PS_CONSTANT__SQ_ALU_CONSTANT0_0 0 @@ -280,7 +280,7 @@ #define R600_PS_CONSTANT__SQ_ALU_CONSTANT2_0 2 #define R600_PS_CONSTANT__SQ_ALU_CONSTANT3_0 3 #define R600_PS_CONSTANT_SIZE 4 -#define R600_PS_CONSTANT_PM4 128 +#define R600_PS_CONSTANT_PM4 128 /* R600_VS_CONSTANT */ #define R600_VS_CONSTANT__SQ_ALU_CONSTANT0_256 0 @@ -288,7 +288,7 @@ #define R600_VS_CONSTANT__SQ_ALU_CONSTANT2_256 2 #define R600_VS_CONSTANT__SQ_ALU_CONSTANT3_256 3 #define R600_VS_CONSTANT_SIZE 4 -#define R600_VS_CONSTANT_PM4 128 +#define R600_VS_CONSTANT_PM4 128 /* R600_UCP */ #define R600_UCP__PA_CL_UCP0_X 0 @@ -316,7 +316,7 @@ #define R600_UCP__PA_CL_UCP5_Z 22 #define R600_UCP__PA_CL_UCP5_W 23 #define R600_UCP_SIZE 24 -#define R600_UCP_PM4 128 +#define R600_UCP_PM4 128 /* R600_PS_RESOURCE */ #define R600_PS_RESOURCE__RESOURCE0_WORD0 0 @@ -327,7 +327,7 @@ #define R600_PS_RESOURCE__RESOURCE0_WORD5 5 #define R600_PS_RESOURCE__RESOURCE0_WORD6 6 #define R600_PS_RESOURCE_SIZE 7 -#define R600_PS_RESOURCE_PM4 128 +#define R600_PS_RESOURCE_PM4 128 /* R600_VS_RESOURCE */ #define R600_VS_RESOURCE__RESOURCE160_WORD0 0 @@ -338,7 +338,7 @@ #define R600_VS_RESOURCE__RESOURCE160_WORD5 5 #define R600_VS_RESOURCE__RESOURCE160_WORD6 6 #define R600_VS_RESOURCE_SIZE 7 -#define R600_VS_RESOURCE_PM4 128 +#define R600_VS_RESOURCE_PM4 128 /* R600_FS_RESOURCE */ #define R600_FS_RESOURCE__RESOURCE320_WORD0 0 @@ -349,7 +349,7 @@ #define R600_FS_RESOURCE__RESOURCE320_WORD5 5 #define R600_FS_RESOURCE__RESOURCE320_WORD6 6 #define R600_FS_RESOURCE_SIZE 7 -#define R600_FS_RESOURCE_PM4 128 +#define R600_FS_RESOURCE_PM4 128 /* R600_GS_RESOURCE */ #define R600_GS_RESOURCE__RESOURCE336_WORD0 0 @@ -360,28 +360,28 @@ #define R600_GS_RESOURCE__RESOURCE336_WORD5 5 #define R600_GS_RESOURCE__RESOURCE336_WORD6 6 #define R600_GS_RESOURCE_SIZE 7 -#define R600_GS_RESOURCE_PM4 128 +#define R600_GS_RESOURCE_PM4 128 /* R600_PS_SAMPLER */ #define R600_PS_SAMPLER__SQ_TEX_SAMPLER_WORD0_0 0 #define R600_PS_SAMPLER__SQ_TEX_SAMPLER_WORD1_0 1 #define R600_PS_SAMPLER__SQ_TEX_SAMPLER_WORD2_0 2 #define R600_PS_SAMPLER_SIZE 3 -#define R600_PS_SAMPLER_PM4 128 +#define R600_PS_SAMPLER_PM4 128 /* R600_VS_SAMPLER */ #define R600_VS_SAMPLER__SQ_TEX_SAMPLER_WORD0_18 0 #define R600_VS_SAMPLER__SQ_TEX_SAMPLER_WORD1_18 1 #define R600_VS_SAMPLER__SQ_TEX_SAMPLER_WORD2_18 2 #define R600_VS_SAMPLER_SIZE 3 -#define R600_VS_SAMPLER_PM4 128 +#define R600_VS_SAMPLER_PM4 128 /* R600_GS_SAMPLER */ #define R600_GS_SAMPLER__SQ_TEX_SAMPLER_WORD0_36 0 #define R600_GS_SAMPLER__SQ_TEX_SAMPLER_WORD1_36 1 #define R600_GS_SAMPLER__SQ_TEX_SAMPLER_WORD2_36 2 #define R600_GS_SAMPLER_SIZE 3 -#define R600_GS_SAMPLER_PM4 128 +#define R600_GS_SAMPLER_PM4 128 /* R600_PS_SAMPLER_BORDER */ #define R600_PS_SAMPLER_BORDER__TD_PS_SAMPLER0_BORDER_RED 0 @@ -389,7 +389,7 @@ #define R600_PS_SAMPLER_BORDER__TD_PS_SAMPLER0_BORDER_BLUE 2 #define R600_PS_SAMPLER_BORDER__TD_PS_SAMPLER0_BORDER_ALPHA 3 #define R600_PS_SAMPLER_BORDER_SIZE 4 -#define R600_PS_SAMPLER_BORDER_PM4 128 +#define R600_PS_SAMPLER_BORDER_PM4 128 /* R600_VS_SAMPLER_BORDER */ #define R600_VS_SAMPLER_BORDER__TD_VS_SAMPLER0_BORDER_RED 0 @@ -397,7 +397,7 @@ #define R600_VS_SAMPLER_BORDER__TD_VS_SAMPLER0_BORDER_BLUE 2 #define R600_VS_SAMPLER_BORDER__TD_VS_SAMPLER0_BORDER_ALPHA 3 #define R600_VS_SAMPLER_BORDER_SIZE 4 -#define R600_VS_SAMPLER_BORDER_PM4 128 +#define R600_VS_SAMPLER_BORDER_PM4 128 /* R600_GS_SAMPLER_BORDER */ #define R600_GS_SAMPLER_BORDER__TD_GS_SAMPLER0_BORDER_RED 0 @@ -405,7 +405,7 @@ #define R600_GS_SAMPLER_BORDER__TD_GS_SAMPLER0_BORDER_BLUE 2 #define R600_GS_SAMPLER_BORDER__TD_GS_SAMPLER0_BORDER_ALPHA 3 #define R600_GS_SAMPLER_BORDER_SIZE 4 -#define R600_GS_SAMPLER_BORDER_PM4 128 +#define R600_GS_SAMPLER_BORDER_PM4 128 /* R600_CB0 */ #define R600_CB0__CB_COLOR0_BASE 0 @@ -416,7 +416,7 @@ #define R600_CB0__CB_COLOR0_TILE 5 #define R600_CB0__CB_COLOR0_MASK 6 #define R600_CB0_SIZE 7 -#define R600_CB0_PM4 128 +#define R600_CB0_PM4 128 /* R600_CB1 */ #define R600_CB1__CB_COLOR1_BASE 0 @@ -427,7 +427,7 @@ #define R600_CB1__CB_COLOR1_TILE 5 #define R600_CB1__CB_COLOR1_MASK 6 #define R600_CB1_SIZE 7 -#define R600_CB1_PM4 128 +#define R600_CB1_PM4 128 /* R600_CB2 */ #define R600_CB2__CB_COLOR2_BASE 0 @@ -438,7 +438,7 @@ #define R600_CB2__CB_COLOR2_TILE 5 #define R600_CB2__CB_COLOR2_MASK 6 #define R600_CB2_SIZE 7 -#define R600_CB2_PM4 128 +#define R600_CB2_PM4 128 /* R600_CB3 */ #define R600_CB3__CB_COLOR3_BASE 0 @@ -449,7 +449,7 @@ #define R600_CB3__CB_COLOR3_TILE 5 #define R600_CB3__CB_COLOR3_MASK 6 #define R600_CB3_SIZE 7 -#define R600_CB3_PM4 128 +#define R600_CB3_PM4 128 /* R600_CB4 */ #define R600_CB4__CB_COLOR4_BASE 0 @@ -460,7 +460,7 @@ #define R600_CB4__CB_COLOR4_TILE 5 #define R600_CB4__CB_COLOR4_MASK 6 #define R600_CB4_SIZE 7 -#define R600_CB4_PM4 128 +#define R600_CB4_PM4 128 /* R600_CB5 */ #define R600_CB5__CB_COLOR5_BASE 0 @@ -471,7 +471,7 @@ #define R600_CB5__CB_COLOR5_TILE 5 #define R600_CB5__CB_COLOR5_MASK 6 #define R600_CB5_SIZE 7 -#define R600_CB5_PM4 128 +#define R600_CB5_PM4 128 /* R600_CB6 */ #define R600_CB6__CB_COLOR6_BASE 0 @@ -482,7 +482,7 @@ #define R600_CB6__CB_COLOR6_TILE 5 #define R600_CB6__CB_COLOR6_MASK 6 #define R600_CB6_SIZE 7 -#define R600_CB6_PM4 128 +#define R600_CB6_PM4 128 /* R600_CB7 */ #define R600_CB7__CB_COLOR7_BASE 0 @@ -493,7 +493,7 @@ #define R600_CB7__CB_COLOR7_TILE 5 #define R600_CB7__CB_COLOR7_MASK 6 #define R600_CB7_SIZE 7 -#define R600_CB7_PM4 128 +#define R600_CB7_PM4 128 /* R600_DB */ #define R600_DB__DB_DEPTH_BASE 0 @@ -503,7 +503,7 @@ #define R600_DB__DB_HTILE_SURFACE 4 #define R600_DB__DB_PREFETCH_LIMIT 5 #define R600_DB_SIZE 6 -#define R600_DB_PM4 128 +#define R600_DB_PM4 128 /* R600_VGT */ #define R600_VGT__VGT_PRIMITIVE_TYPE 0 @@ -518,7 +518,7 @@ #define R600_VGT__VGT_INSTANCE_STEP_RATE_0 9 #define R600_VGT__VGT_INSTANCE_STEP_RATE_1 10 #define R600_VGT_SIZE 11 -#define R600_VGT_PM4 128 +#define R600_VGT_PM4 128 /* R600_DRAW */ #define R600_DRAW__VGT_NUM_INDICES 0 @@ -526,18 +526,18 @@ #define R600_DRAW__VGT_DMA_BASE 2 #define R600_DRAW__VGT_DRAW_INITIATOR 3 #define R600_DRAW_SIZE 4 -#define R600_DRAW_PM4 128 +#define R600_DRAW_PM4 128 /* R600_VGT_EVENT */ #define R600_VGT_EVENT__VGT_EVENT_INITIATOR 0 #define R600_VGT_EVENT_SIZE 1 -#define R600_VGT_EVENT_PM4 128 +#define R600_VGT_EVENT_PM4 128 /* R600_CB_FLUSH */ #define R600_CB_FLUSH_SIZE 0 -#define R600_CB_FLUSH_PM4 128 +#define R600_CB_FLUSH_PM4 128 /* R600_DB_FLUSH */ #define R600_DB_FLUSH_SIZE 0 -#define R600_DB_FLUSH_PM4 128 +#define R600_DB_FLUSH_PM4 128 diff --git a/src/gallium/drivers/r600/r600_texture.c b/src/gallium/drivers/r600/r600_texture.c index d4d9b07..d76e6b3 100644 --- a/src/gallium/drivers/r600/r600_texture.c +++ b/src/gallium/drivers/r600/r600_texture.c @@ -796,7 +796,7 @@ static unsigned r600_get_swizzle_combined(const unsigned char *swizzle_format, /* texture format translate */ uint32_t r600_translate_texformat(enum pipe_format format, - const unsigned char *swizzle_view, + const unsigned char *swizzle_view, uint32_t *word4_p, uint32_t *yuv_format_p) { uint32_t result = 0, word4 = 0, yuv_format = 0; @@ -850,7 +850,7 @@ uint32_t r600_translate_texformat(enum pipe_format format, break; } goto out_unknown; /* TODO */ - + case UTIL_FORMAT_COLORSPACE_SRGB: word4 |= S_038010_FORCE_DEGAMMA(1); if (format == PIPE_FORMAT_L8A8_SRGB || format == PIPE_FORMAT_L8_SRGB) @@ -866,7 +866,7 @@ uint32_t r600_translate_texformat(enum pipe_format format, static int r600_enable_s3tc = -1; if (r600_enable_s3tc == -1) - r600_enable_s3tc = + r600_enable_s3tc = debug_get_bool_option("R600_ENABLE_S3TC", FALSE); if (!r600_enable_s3tc) @@ -889,7 +889,7 @@ uint32_t r600_translate_texformat(enum pipe_format format, } - for (i = 0; i < desc->nr_channels; i++) { + for (i = 0; i < desc->nr_channels; i++) { if (desc->channel[i].type == UTIL_FORMAT_TYPE_SIGNED) { word4 |= sign_bit[i]; } @@ -903,7 +903,7 @@ uint32_t r600_translate_texformat(enum pipe_format format, for (i = 1; i < desc->nr_channels; i++) { uniform = uniform && desc->channel[0].size == desc->channel[i].size; } - + /* Non-uniform formats. */ if (!uniform) { switch(desc->nr_channels) { @@ -1021,7 +1021,7 @@ uint32_t r600_translate_texformat(enum pipe_format format, goto out_word4; } } - + } out_word4: if (word4_p) diff --git a/src/gallium/drivers/softpipe/sp_clear.c b/src/gallium/drivers/softpipe/sp_clear.c index ae3f00f..1678194 100644 --- a/src/gallium/drivers/softpipe/sp_clear.c +++ b/src/gallium/drivers/softpipe/sp_clear.c @@ -1,9 +1,9 @@ /************************************************************************** - * + * * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas. * All Rights Reserved. * Copyright 2009 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 @@ -11,11 +11,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. @@ -23,7 +23,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. - * + * **************************************************************************/ /* Author: diff --git a/src/gallium/drivers/softpipe/sp_clear.h b/src/gallium/drivers/softpipe/sp_clear.h index 9be3b86..fa7436c 100644 --- a/src/gallium/drivers/softpipe/sp_clear.h +++ b/src/gallium/drivers/softpipe/sp_clear.h @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ /* Author: diff --git a/src/gallium/drivers/softpipe/sp_context.c b/src/gallium/drivers/softpipe/sp_context.c index e935ce6..3040c77 100644 --- a/src/gallium/drivers/softpipe/sp_context.c +++ b/src/gallium/drivers/softpipe/sp_context.c @@ -1,9 +1,9 @@ /************************************************************************** - * + * * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas. * All Rights Reserved. * Copyright 2008 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 @@ -11,11 +11,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. @@ -23,7 +23,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. - * + * **************************************************************************/ /* Author: @@ -157,17 +157,17 @@ softpipe_is_resource_referenced( struct pipe_context *pipe, /* check if any of the bound drawing surfaces are this texture */ if (softpipe->dirty_render_cache) { for (i = 0; i < softpipe->framebuffer.nr_cbufs; i++) { - if (softpipe->framebuffer.cbufs[i] && + if (softpipe->framebuffer.cbufs[i] && softpipe->framebuffer.cbufs[i]->texture == texture) { return PIPE_REFERENCED_FOR_WRITE; } } - if (softpipe->framebuffer.zsbuf && + if (softpipe->framebuffer.zsbuf && softpipe->framebuffer.zsbuf->texture == texture) { return PIPE_REFERENCED_FOR_WRITE; } } - + /* check if any of the tex_cache textures are this texture */ for (i = 0; i < PIPE_MAX_SAMPLERS; i++) { if (softpipe->tex_cache[i] && @@ -280,7 +280,7 @@ softpipe_create_context( struct pipe_screen *screen, * Create drawing context and plug our rendering stage into it. */ softpipe->draw = draw_create(&softpipe->pipe); - if (!softpipe->draw) + if (!softpipe->draw) goto fail; draw_texture_samplers(softpipe->draw, diff --git a/src/gallium/drivers/softpipe/sp_context.h b/src/gallium/drivers/softpipe/sp_context.h index 9361a3d..d3d9649 100644 --- a/src/gallium/drivers/softpipe/sp_context.h +++ b/src/gallium/drivers/softpipe/sp_context.h @@ -1,5 +1,5 @@ /************************************************************************** - * + * * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas. * All Rights Reserved. * @@ -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. - * + * **************************************************************************/ /* Authors: Keith Whitwell diff --git a/src/gallium/drivers/softpipe/sp_draw_arrays.c b/src/gallium/drivers/softpipe/sp_draw_arrays.c index 01b4ca9..e906f49 100644 --- a/src/gallium/drivers/softpipe/sp_draw_arrays.c +++ b/src/gallium/drivers/softpipe/sp_draw_arrays.c @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ /* Author: diff --git a/src/gallium/drivers/softpipe/sp_flush.c b/src/gallium/drivers/softpipe/sp_flush.c index 4258395..f9ff0bd 100644 --- a/src/gallium/drivers/softpipe/sp_flush.c +++ b/src/gallium/drivers/softpipe/sp_flush.c @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ /* Author: @@ -87,7 +87,7 @@ softpipe_flush( struct pipe_context *pipe, if (softpipe->zsbuf_cache) sp_flush_tile_cache(softpipe->zsbuf_cache); - + softpipe->dirty_render_cache = FALSE; } @@ -103,7 +103,7 @@ softpipe_flush( struct pipe_context *pipe, ++frame_no; } #endif - + if (fence) *fence = NULL; } diff --git a/src/gallium/drivers/softpipe/sp_flush.h b/src/gallium/drivers/softpipe/sp_flush.h index 22a5cee..1cfd628 100644 --- a/src/gallium/drivers/softpipe/sp_flush.h +++ b/src/gallium/drivers/softpipe/sp_flush.h @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ #ifndef SP_FLUSH_H diff --git a/src/gallium/drivers/softpipe/sp_fs.h b/src/gallium/drivers/softpipe/sp_fs.h index 4792ace..f2cd9b7 100644 --- a/src/gallium/drivers/softpipe/sp_fs.h +++ b/src/gallium/drivers/softpipe/sp_fs.h @@ -1,5 +1,5 @@ /************************************************************************** - * + * * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas. * All Rights Reserved. * @@ -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. - * + * **************************************************************************/ /* Authors: Keith Whitwell diff --git a/src/gallium/drivers/softpipe/sp_fs_exec.c b/src/gallium/drivers/softpipe/sp_fs_exec.c index 346e1b4..f78edbb 100644 --- a/src/gallium/drivers/softpipe/sp_fs_exec.c +++ b/src/gallium/drivers/softpipe/sp_fs_exec.c @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ /** @@ -117,14 +117,14 @@ setup_pos_vector(const struct tgsi_interp_coef *coef, /* TODO: hide the machine struct in here somewhere, remove from this * interface: */ -static unsigned +static unsigned exec_run( const struct sp_fragment_shader *base, struct tgsi_exec_machine *machine, struct quad_header *quad ) { /* Compute X, Y, Z, W vals for this quad */ - setup_pos_vector(quad->posCoef, - (float)quad->input.x0, (float)quad->input.y0, + setup_pos_vector(quad->posCoef, + (float)quad->input.x0, (float)quad->input.y0, &machine->QuadPos); /* convert 0 to 1.0 and 1 to -1.0 */ @@ -179,7 +179,7 @@ exec_run( const struct sp_fragment_shader *base, } -static void +static void exec_delete( struct sp_fragment_shader *base ) { FREE((void *) base->shader.tokens); diff --git a/src/gallium/drivers/softpipe/sp_fs_sse.c b/src/gallium/drivers/softpipe/sp_fs_sse.c index 5b18cd0..041d634 100644 --- a/src/gallium/drivers/softpipe/sp_fs_sse.c +++ b/src/gallium/drivers/softpipe/sp_fs_sse.c @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ /** @@ -118,7 +118,7 @@ setup_pos_vector(const struct tgsi_interp_coef *coef, * TODO: push Position calculation into the generated shader * TODO: process >1 quad at a time */ -static unsigned +static unsigned fs_sse_run( const struct sp_fragment_shader *base, struct tgsi_exec_machine *machine, struct quad_header *quad ) @@ -126,8 +126,8 @@ fs_sse_run( const struct sp_fragment_shader *base, struct sp_sse_fragment_shader *shader = sp_sse_fragment_shader(base); /* Compute X, Y, Z, W vals for this quad -- place in temp[0] for now */ - setup_pos_vector(quad->posCoef, - (float)quad->input.x0, (float)quad->input.y0, + setup_pos_vector(quad->posCoef, + (float)quad->input.x0, (float)quad->input.y0, machine->Temps); /* init kill mask */ @@ -188,7 +188,7 @@ fs_sse_run( const struct sp_fragment_shader *base, } -static void +static void fs_sse_delete( struct sp_fragment_shader *base ) { struct sp_sse_fragment_shader *shader = sp_sse_fragment_shader(base); @@ -212,7 +212,7 @@ softpipe_create_fs_sse(struct softpipe_context *softpipe, return NULL; x86_init_func( &shader->sse2_program ); - + if (!tgsi_emit_sse2( templ->tokens, &shader->sse2_program, shader->immediates, FALSE )) { FREE(shader); diff --git a/src/gallium/drivers/softpipe/sp_limits.h b/src/gallium/drivers/softpipe/sp_limits.h index a7a24c9..1c3b697 100644 --- a/src/gallium/drivers/softpipe/sp_limits.h +++ b/src/gallium/drivers/softpipe/sp_limits.h @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2010 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. - * + * **************************************************************************/ #ifndef SP_LIMITS_H diff --git a/src/gallium/drivers/softpipe/sp_prim_vbuf.c b/src/gallium/drivers/softpipe/sp_prim_vbuf.c index c60249d..4c40cc2 100644 --- a/src/gallium/drivers/softpipe/sp_prim_vbuf.c +++ b/src/gallium/drivers/softpipe/sp_prim_vbuf.c @@ -100,7 +100,7 @@ sp_vbuf_allocate_vertices(struct vbuf_render *vbr, cvbr->vertex_size = vertex_size; cvbr->nr_vertices = nr_vertices; - + return cvbr->vertex_buffer != NULL; } @@ -120,8 +120,8 @@ sp_vbuf_map_vertices(struct vbuf_render *vbr) } -static void -sp_vbuf_unmap_vertices(struct vbuf_render *vbr, +static void +sp_vbuf_unmap_vertices(struct vbuf_render *vbr, ushort min_index, ushort max_index ) { @@ -137,7 +137,7 @@ sp_vbuf_set_primitive(struct vbuf_render *vbr, unsigned prim) { struct softpipe_vbuf_render *cvbr = softpipe_vbuf_render(vbr); struct setup_context *setup_ctx = cvbr->setup; - + sp_setup_prepare( setup_ctx ); cvbr->softpipe->reduced_prim = u_reduced_prim(prim); @@ -259,7 +259,7 @@ sp_vbuf_draw_elements(struct vbuf_render *vbr, const ushort *indices, uint nr) case PIPE_PRIM_QUADS: /* GL quads don't follow provoking vertex convention */ - if (flatshade_first) { + if (flatshade_first) { /* emit last quad vertex as first triangle vertex */ for (i = 3; i < nr; i += 4) { sp_setup_tri( setup, @@ -291,7 +291,7 @@ sp_vbuf_draw_elements(struct vbuf_render *vbr, const ushort *indices, uint nr) case PIPE_PRIM_QUAD_STRIP: /* GL quad strips don't follow provoking vertex convention */ - if (flatshade_first) { + if (flatshade_first) { /* emit last quad vertex as first triangle vertex */ for (i = 3; i < nr; i += 2) { sp_setup_tri( setup, @@ -323,7 +323,7 @@ sp_vbuf_draw_elements(struct vbuf_render *vbr, const ushort *indices, uint nr) /* Almost same as tri fan but the _first_ vertex specifies the flat * shading color. */ - if (flatshade_first) { + if (flatshade_first) { /* emit first polygon vertex as first triangle vertex */ for (i = 2; i < nr; i += 1) { sp_setup_tri( setup, @@ -455,7 +455,7 @@ sp_vbuf_draw_arrays(struct vbuf_render *vbr, uint start, uint nr) case PIPE_PRIM_QUADS: /* GL quads don't follow provoking vertex convention */ - if (flatshade_first) { + if (flatshade_first) { /* emit last quad vertex as first triangle vertex */ for (i = 3; i < nr; i += 4) { sp_setup_tri( setup, @@ -485,7 +485,7 @@ sp_vbuf_draw_arrays(struct vbuf_render *vbr, uint start, uint nr) case PIPE_PRIM_QUAD_STRIP: /* GL quad strips don't follow provoking vertex convention */ - if (flatshade_first) { + if (flatshade_first) { /* emit last quad vertex as first triangle vertex */ for (i = 3; i < nr; i += 2) { sp_setup_tri( setup, @@ -517,7 +517,7 @@ sp_vbuf_draw_arrays(struct vbuf_render *vbr, uint start, uint nr) /* Almost same as tri fan but the _first_ vertex specifies the flat * shading color. */ - if (flatshade_first) { + if (flatshade_first) { /* emit first polygon vertex as first triangle vertex */ for (i = 2; i < nr; i += 1) { sp_setup_tri( setup, diff --git a/src/gallium/drivers/softpipe/sp_prim_vbuf.h b/src/gallium/drivers/softpipe/sp_prim_vbuf.h index ad01cc2..74fe876 100644 --- a/src/gallium/drivers/softpipe/sp_prim_vbuf.h +++ b/src/gallium/drivers/softpipe/sp_prim_vbuf.h @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ #ifndef SP_VBUF_H diff --git a/src/gallium/drivers/softpipe/sp_quad.h b/src/gallium/drivers/softpipe/sp_quad.h index e745aa8..a43a4b5 100644 --- a/src/gallium/drivers/softpipe/sp_quad.h +++ b/src/gallium/drivers/softpipe/sp_quad.h @@ -1,5 +1,5 @@ /************************************************************************** - * + * * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas. * All Rights Reserved. * @@ -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. - * + * **************************************************************************/ /* Authors: Keith Whitwell @@ -91,7 +91,7 @@ struct quad_header_output /** * Encodes everything we need to know about a 2x2 pixel block. Uses - * "Channel-Serial" or "SoA" layout. + * "Channel-Serial" or "SoA" layout. */ struct quad_header { struct quad_header_input input; diff --git a/src/gallium/drivers/softpipe/sp_quad_blend.c b/src/gallium/drivers/softpipe/sp_quad_blend.c index 6af1b2d..dd659cc 100644 --- a/src/gallium/drivers/softpipe/sp_quad_blend.c +++ b/src/gallium/drivers/softpipe/sp_quad_blend.c @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ /** @@ -117,7 +117,7 @@ do { \ static void -logicop_quad(struct quad_stage *qs, +logicop_quad(struct quad_stage *qs, float (*quadColor)[4], float (*dest)[4]) { @@ -229,7 +229,7 @@ logicop_quad(struct quad_stage *qs, * \param has_dst_alpha does the dest color buffer have an alpha channel? */ static void -blend_quad(struct quad_stage *qs, +blend_quad(struct quad_stage *qs, float (*quadColor)[4], float (*dest)[4], unsigned blend_index, @@ -273,7 +273,7 @@ blend_quad(struct quad_stage *qs, VEC4_MUL(source[0], quadColor[0], alpha); /* R */ VEC4_MUL(source[1], quadColor[1], alpha); /* G */ VEC4_MUL(source[2], quadColor[2], alpha); /* B */ - } + } else { VEC4_COPY(source[0], quadColor[0]); /* R */ VEC4_COPY(source[1], quadColor[1]); /* G */ @@ -787,7 +787,7 @@ colormask_quad(unsigned colormask, static void -blend_fallback(struct quad_stage *qs, +blend_fallback(struct quad_stage *qs, struct quad_header *quads[], unsigned nr) { @@ -795,14 +795,14 @@ blend_fallback(struct quad_stage *qs, const struct pipe_blend_state *blend = softpipe->blend; unsigned cbuf; - for (cbuf = 0; cbuf < softpipe->framebuffer.nr_cbufs; cbuf++) + for (cbuf = 0; cbuf < softpipe->framebuffer.nr_cbufs; cbuf++) { /* which blend/mask state index to use: */ const uint blend_buf = blend->independent_blend_enable ? cbuf : 0; float dest[4][QUAD_SIZE]; struct softpipe_cached_tile *tile = sp_get_cached_tile(softpipe->cbuf_cache[cbuf], - quads[0]->input.x0, + quads[0]->input.x0, quads[0]->input.y0); boolean has_dst_alpha = util_format_has_alpha(softpipe->framebuffer.cbufs[cbuf]->format); @@ -814,7 +814,7 @@ blend_fallback(struct quad_stage *qs, const int itx = (quad->input.x0 & (TILE_SIZE-1)); const int ity = (quad->input.y0 & (TILE_SIZE-1)); - /* get/swizzle dest colors + /* get/swizzle dest colors */ for (j = 0; j < QUAD_SIZE; j++) { int x = itx + (j & 1); @@ -834,7 +834,7 @@ blend_fallback(struct quad_stage *qs, if (blend->rt[blend_buf].colormask != 0xf) colormask_quad( blend->rt[cbuf].colormask, quadColor, dest); - + /* Output color values */ for (j = 0; j < QUAD_SIZE; j++) { @@ -852,7 +852,7 @@ blend_fallback(struct quad_stage *qs, static void -blend_single_add_src_alpha_inv_src_alpha(struct quad_stage *qs, +blend_single_add_src_alpha_inv_src_alpha(struct quad_stage *qs, struct quad_header *quads[], unsigned nr) { @@ -864,7 +864,7 @@ blend_single_add_src_alpha_inv_src_alpha(struct quad_stage *qs, struct softpipe_cached_tile *tile = sp_get_cached_tile(qs->softpipe->cbuf_cache[0], - quads[0]->input.x0, + quads[0]->input.x0, quads[0]->input.y0); for (q = 0; q < nr; q++) { @@ -873,7 +873,7 @@ blend_single_add_src_alpha_inv_src_alpha(struct quad_stage *qs, const float *alpha = quadColor[3]; const int itx = (quad->input.x0 & (TILE_SIZE-1)); const int ity = (quad->input.y0 & (TILE_SIZE-1)); - + /* get/swizzle dest colors */ for (j = 0; j < QUAD_SIZE; j++) { int x = itx + (j & 1); @@ -912,7 +912,7 @@ blend_single_add_src_alpha_inv_src_alpha(struct quad_stage *qs, } static void -blend_single_add_one_one(struct quad_stage *qs, +blend_single_add_one_one(struct quad_stage *qs, struct quad_header *quads[], unsigned nr) { @@ -921,7 +921,7 @@ blend_single_add_one_one(struct quad_stage *qs, struct softpipe_cached_tile *tile = sp_get_cached_tile(qs->softpipe->cbuf_cache[0], - quads[0]->input.x0, + quads[0]->input.x0, quads[0]->input.y0); for (q = 0; q < nr; q++) { @@ -929,7 +929,7 @@ blend_single_add_one_one(struct quad_stage *qs, float (*quadColor)[4] = quad->output.color[0]; const int itx = (quad->input.x0 & (TILE_SIZE-1)); const int ity = (quad->input.y0 & (TILE_SIZE-1)); - + /* get/swizzle dest colors */ for (j = 0; j < QUAD_SIZE; j++) { int x = itx + (j & 1); @@ -938,7 +938,7 @@ blend_single_add_one_one(struct quad_stage *qs, dest[i][j] = tile->data.color[y][x][i]; } } - + VEC4_ADD_SAT(quadColor[0], quadColor[0], dest[0]); /* R */ VEC4_ADD_SAT(quadColor[1], quadColor[1], dest[1]); /* G */ VEC4_ADD_SAT(quadColor[2], quadColor[2], dest[2]); /* B */ @@ -958,7 +958,7 @@ blend_single_add_one_one(struct quad_stage *qs, static void -single_output_color(struct quad_stage *qs, +single_output_color(struct quad_stage *qs, struct quad_header *quads[], unsigned nr) { @@ -966,7 +966,7 @@ single_output_color(struct quad_stage *qs, struct softpipe_cached_tile *tile = sp_get_cached_tile(qs->softpipe->cbuf_cache[0], - quads[0]->input.x0, + quads[0]->input.x0, quads[0]->input.y0); for (q = 0; q < nr; q++) { @@ -974,7 +974,7 @@ single_output_color(struct quad_stage *qs, float (*quadColor)[4] = quad->output.color[0]; const int itx = (quad->input.x0 & (TILE_SIZE-1)); const int ity = (quad->input.y0 & (TILE_SIZE-1)); - + for (j = 0; j < QUAD_SIZE; j++) { if (quad->inout.mask & (1 << j)) { int x = itx + (j & 1); @@ -988,7 +988,7 @@ single_output_color(struct quad_stage *qs, } static void -blend_noop(struct quad_stage *qs, +blend_noop(struct quad_stage *qs, struct quad_header *quads[], unsigned nr) { @@ -996,7 +996,7 @@ blend_noop(struct quad_stage *qs, static void -choose_blend_quad(struct quad_stage *qs, +choose_blend_quad(struct quad_stage *qs, struct quad_header *quads[], unsigned nr) { @@ -1004,7 +1004,7 @@ choose_blend_quad(struct quad_stage *qs, const struct pipe_blend_state *blend = softpipe->blend; qs->run = blend_fallback; - + if (softpipe->framebuffer.nr_cbufs == 0) { qs->run = blend_noop; } diff --git a/src/gallium/drivers/softpipe/sp_quad_depth_test.c b/src/gallium/drivers/softpipe/sp_quad_depth_test.c index 89b2a91..861f7e1 100644 --- a/src/gallium/drivers/softpipe/sp_quad_depth_test.c +++ b/src/gallium/drivers/softpipe/sp_quad_depth_test.c @@ -1,9 +1,9 @@ /************************************************************************** - * + * * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas. * Copyright 2010 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 @@ -11,11 +11,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. @@ -23,7 +23,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. - * + * **************************************************************************/ /** @@ -132,7 +132,7 @@ interpolate_quad_depth( struct quad_header *quad ) * Compute the depth_data::qzzzz[] values from the float fragment Z values. */ static void -convert_quad_depth( struct depth_data *data, +convert_quad_depth( struct depth_data *data, const struct quad_header *quad ) { unsigned j; @@ -192,7 +192,7 @@ convert_quad_depth( struct depth_data *data, * Compute the depth_data::shader_stencil_refs[] values from the float fragment stencil values. */ static void -convert_quad_stencil( struct depth_data *data, +convert_quad_stencil( struct depth_data *data, const struct quad_header *quad ) { unsigned j; @@ -306,7 +306,7 @@ do_stencil_test(struct depth_data *data, for (j = 0; j < QUAD_SIZE; j++) { if (data->use_shader_stencil_refs) refs[j] = data->shader_stencil_refs[j] & valMask; - else + else refs[j] = ref & valMask; } @@ -470,7 +470,7 @@ apply_stencil_op(struct depth_data *data, } } - + /** * To increase efficiency, we should probably have multiple versions @@ -478,7 +478,7 @@ apply_stencil_op(struct depth_data *data, * Try to effectively do that with codegen... */ static boolean -depth_test_quad(struct quad_stage *qs, +depth_test_quad(struct quad_stage *qs, struct depth_data *data, struct quad_header *quad) { @@ -491,41 +491,41 @@ depth_test_quad(struct quad_stage *qs, /* zmask = 0 */ break; case PIPE_FUNC_LESS: - /* Note this is pretty much a single sse or cell instruction. + /* Note this is pretty much a single sse or cell instruction. * Like this: quad->mask &= (quad->outputs.depth < zzzz); */ for (j = 0; j < QUAD_SIZE; j++) { - if (data->qzzzz[j] < data->bzzzz[j]) + if (data->qzzzz[j] < data->bzzzz[j]) zmask |= 1 << j; } break; case PIPE_FUNC_EQUAL: for (j = 0; j < QUAD_SIZE; j++) { - if (data->qzzzz[j] == data->bzzzz[j]) + if (data->qzzzz[j] == data->bzzzz[j]) zmask |= 1 << j; } break; case PIPE_FUNC_LEQUAL: for (j = 0; j < QUAD_SIZE; j++) { - if (data->qzzzz[j] <= data->bzzzz[j]) + if (data->qzzzz[j] <= data->bzzzz[j]) zmask |= (1 << j); } break; case PIPE_FUNC_GREATER: for (j = 0; j < QUAD_SIZE; j++) { - if (data->qzzzz[j] > data->bzzzz[j]) + if (data->qzzzz[j] > data->bzzzz[j]) zmask |= (1 << j); } break; case PIPE_FUNC_NOTEQUAL: for (j = 0; j < QUAD_SIZE; j++) { - if (data->qzzzz[j] != data->bzzzz[j]) + if (data->qzzzz[j] != data->bzzzz[j]) zmask |= (1 << j); } break; case PIPE_FUNC_GEQUAL: for (j = 0; j < QUAD_SIZE; j++) { - if (data->qzzzz[j] >= data->bzzzz[j]) + if (data->qzzzz[j] >= data->bzzzz[j]) zmask |= (1 << j); } break; @@ -562,7 +562,7 @@ depth_test_quad(struct quad_stage *qs, * depth testing. */ static void -depth_stencil_test_quad(struct quad_stage *qs, +depth_stencil_test_quad(struct quad_stage *qs, struct depth_data *data, struct quad_header *quad) { @@ -668,8 +668,8 @@ ALPHATEST( GEQUAL, >= ) /* XXX: Incorporate into shader using KILP. */ static int -alpha_test_quads(struct quad_stage *qs, - struct quad_header *quads[], +alpha_test_quads(struct quad_stage *qs, + struct quad_header *quads[], unsigned nr) { switch (qs->softpipe->depth_stencil->alpha.func) { @@ -695,7 +695,7 @@ alpha_test_quads(struct quad_stage *qs, } -static unsigned mask_count[16] = +static unsigned mask_count[16] = { 0, /* 0x0 */ 1, /* 0x1 */ @@ -721,7 +721,7 @@ static unsigned mask_count[16] = * General depth/stencil test function. Used when there's no fast-path. */ static void -depth_test_quads_fallback(struct quad_stage *qs, +depth_test_quads_fallback(struct quad_stage *qs, struct quad_header *quads[], unsigned nr) { @@ -743,8 +743,8 @@ depth_test_quads_fallback(struct quad_stage *qs, data.ps = qs->softpipe->framebuffer.zsbuf; data.format = data.ps->format; - data.tile = sp_get_cached_tile(qs->softpipe->zsbuf_cache, - quads[0]->input.x0, + data.tile = sp_get_cached_tile(qs->softpipe->zsbuf_cache, + quads[0]->input.x0, quads[0]->input.y0); for (i = 0; i < nr; i++) { @@ -760,7 +760,7 @@ depth_test_quads_fallback(struct quad_stage *qs, if (qs->softpipe->depth_stencil->stencil[0].enabled) { if (shader_stencil_ref) convert_quad_stencil(&data, quads[i]); - + depth_stencil_test_quad(qs, &data, quads[i]); write_depth_stencil_values(&data, quads[i]); } @@ -779,7 +779,7 @@ depth_test_quads_fallback(struct quad_stage *qs, } if (qs->softpipe->active_query_count) { - for (i = 0; i < nr; i++) + for (i = 0; i < nr; i++) qs->softpipe->occlusion_count += mask_count[quads[i]->inout.mask]; } @@ -823,7 +823,7 @@ depth_test_quads_fallback(struct quad_stage *qs, static void -depth_noop(struct quad_stage *qs, +depth_noop(struct quad_stage *qs, struct quad_header *quads[], unsigned nr) { @@ -833,7 +833,7 @@ depth_noop(struct quad_stage *qs, static void -choose_depth_test(struct quad_stage *qs, +choose_depth_test(struct quad_stage *qs, struct quad_header *quads[], unsigned nr) { @@ -864,12 +864,12 @@ choose_depth_test(struct quad_stage *qs, !stencil) { qs->run = depth_noop; } - else if (!alpha && - interp_depth && - depth && - depthwrite && + else if (!alpha && + interp_depth && + depth && + depthwrite && !occlusion && - !stencil) + !stencil) { if (qs->softpipe->framebuffer.zsbuf->format == PIPE_FORMAT_Z16_UNORM) { switch (depthfunc) { diff --git a/src/gallium/drivers/softpipe/sp_quad_depth_test_tmp.h b/src/gallium/drivers/softpipe/sp_quad_depth_test_tmp.h index 25af415..41916d8 100644 --- a/src/gallium/drivers/softpipe/sp_quad_depth_test_tmp.h +++ b/src/gallium/drivers/softpipe/sp_quad_depth_test_tmp.h @@ -1,7 +1,7 @@ /************************************************************************** - * + * * Copyright 2010 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 @@ -9,11 +9,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. @@ -21,7 +21,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. - * + * **************************************************************************/ @@ -46,7 +46,7 @@ * triangles may generate non-sequential quads. */ static void -NAME(struct quad_stage *qs, +NAME(struct quad_stage *qs, struct quad_header *quads[], unsigned nr) { @@ -77,7 +77,7 @@ NAME(struct quad_stage *qs, const unsigned outmask = quads[i]->inout.mask; const int dx = quads[i]->input.x0 - ix; unsigned mask = 0; - + /* compute depth for this quad */ idepth[0] = init_idepth[0] + dx * depth_step; idepth[1] = init_idepth[1] + dx * depth_step; diff --git a/src/gallium/drivers/softpipe/sp_quad_fs.c b/src/gallium/drivers/softpipe/sp_quad_fs.c index 90f4787..75439c3 100644 --- a/src/gallium/drivers/softpipe/sp_quad_fs.c +++ b/src/gallium/drivers/softpipe/sp_quad_fs.c @@ -1,9 +1,9 @@ /************************************************************************** - * + * * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas. * All Rights Reserved. * Copyright 2008 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 @@ -11,11 +11,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. @@ -23,7 +23,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. - * + * **************************************************************************/ /* Vertices are just an array of floats, with all the attributes @@ -103,7 +103,7 @@ coverage_quad(struct quad_stage *qs, struct quad_header *quad) * Called via quad_stage::run() */ static void -shade_quads(struct quad_stage *qs, +shade_quads(struct quad_stage *qs, struct quad_header *quads[], unsigned nr) { @@ -126,11 +126,11 @@ shade_quads(struct quad_stage *qs, quads[nr_quads++] = quads[i]; } - + if (nr_quads) qs->next->run(qs->next, quads, nr_quads); } - + /** * Per-primitive (or per-begin?) setup @@ -140,7 +140,7 @@ shade_begin(struct quad_stage *qs) { struct softpipe_context *softpipe = qs->softpipe; - softpipe->fs->prepare( softpipe->fs, + softpipe->fs->prepare( softpipe->fs, softpipe->fs_machine, (struct tgsi_sampler **) softpipe->tgsi.frag_samplers_list ); diff --git a/src/gallium/drivers/softpipe/sp_quad_pipe.c b/src/gallium/drivers/softpipe/sp_quad_pipe.c index 2cfd02a..bede2eb 100644 --- a/src/gallium/drivers/softpipe/sp_quad_pipe.c +++ b/src/gallium/drivers/softpipe/sp_quad_pipe.c @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ diff --git a/src/gallium/drivers/softpipe/sp_quad_pipe.h b/src/gallium/drivers/softpipe/sp_quad_pipe.h index c0aa134..f21dc01 100644 --- a/src/gallium/drivers/softpipe/sp_quad_pipe.h +++ b/src/gallium/drivers/softpipe/sp_quad_pipe.h @@ -1,5 +1,5 @@ /************************************************************************** - * + * * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas. * All Rights Reserved. * @@ -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. - * + * **************************************************************************/ /* Authors: Keith Whitwell diff --git a/src/gallium/drivers/softpipe/sp_query.c b/src/gallium/drivers/softpipe/sp_query.c index 4ae69c1..ec0abb1 100644 --- a/src/gallium/drivers/softpipe/sp_query.c +++ b/src/gallium/drivers/softpipe/sp_query.c @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ /* Author: @@ -51,7 +51,7 @@ static struct softpipe_query *softpipe_query( struct pipe_query *p ) } static struct pipe_query * -softpipe_create_query(struct pipe_context *pipe, +softpipe_create_query(struct pipe_context *pipe, unsigned type) { struct softpipe_query* sq; @@ -136,7 +136,7 @@ softpipe_end_query(struct pipe_context *pipe, struct pipe_query *q) static boolean -softpipe_get_query_result(struct pipe_context *pipe, +softpipe_get_query_result(struct pipe_context *pipe, struct pipe_query *q, boolean wait, void *vresult) diff --git a/src/gallium/drivers/softpipe/sp_query.h b/src/gallium/drivers/softpipe/sp_query.h index 736c033..9c2d9cb 100644 --- a/src/gallium/drivers/softpipe/sp_query.h +++ b/src/gallium/drivers/softpipe/sp_query.h @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ /* Author: diff --git a/src/gallium/drivers/softpipe/sp_screen.c b/src/gallium/drivers/softpipe/sp_screen.c index cbdea19..017f49c 100644 --- a/src/gallium/drivers/softpipe/sp_screen.c +++ b/src/gallium/drivers/softpipe/sp_screen.c @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ diff --git a/src/gallium/drivers/softpipe/sp_screen.h b/src/gallium/drivers/softpipe/sp_screen.h index f741454..1ac1382 100644 --- a/src/gallium/drivers/softpipe/sp_screen.h +++ b/src/gallium/drivers/softpipe/sp_screen.h @@ -1,5 +1,5 @@ /************************************************************************** - * + * * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas. * All Rights Reserved. * @@ -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. - * + * **************************************************************************/ /* Authors: Keith Whitwell @@ -45,7 +45,7 @@ struct softpipe_screen { /* Increments whenever textures are modified. Contexts can track * this. */ - unsigned timestamp; + unsigned timestamp; }; diff --git a/src/gallium/drivers/softpipe/sp_setup.c b/src/gallium/drivers/softpipe/sp_setup.c index 0ce28f4..583ca82 100644 --- a/src/gallium/drivers/softpipe/sp_setup.c +++ b/src/gallium/drivers/softpipe/sp_setup.c @@ -371,8 +371,8 @@ setup_sort_vertices(struct setup_context *setup, * - two-sided stencil test * 0 = front-facing, 1 = back-facing */ - setup->facing = - ((det < 0.0) ^ + setup->facing = + ((det < 0.0) ^ (setup->softpipe->rasterizer->front_ccw)); { @@ -808,7 +808,7 @@ sp_setup_tri(struct setup_context *setup, if (setup->softpipe->no_rast) return; - + det = calc_det(v0, v1, v2); /* debug_printf("%s\n", __FUNCTION__ ); diff --git a/src/gallium/drivers/softpipe/sp_setup.h b/src/gallium/drivers/softpipe/sp_setup.h index 9c8844d..7f4af3c 100644 --- a/src/gallium/drivers/softpipe/sp_setup.h +++ b/src/gallium/drivers/softpipe/sp_setup.h @@ -30,7 +30,7 @@ struct setup_context; struct softpipe_context; -void +void sp_setup_tri( struct setup_context *setup, const float (*v0)[4], const float (*v1)[4], diff --git a/src/gallium/drivers/softpipe/sp_state.h b/src/gallium/drivers/softpipe/sp_state.h index 525bf23..54dc766 100644 --- a/src/gallium/drivers/softpipe/sp_state.h +++ b/src/gallium/drivers/softpipe/sp_state.h @@ -1,5 +1,5 @@ /************************************************************************** - * + * * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas. * All Rights Reserved. * @@ -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. - * + * **************************************************************************/ /* Authors: Keith Whitwell diff --git a/src/gallium/drivers/softpipe/sp_state_blend.c b/src/gallium/drivers/softpipe/sp_state_blend.c index 1286382..1f7e938 100644 --- a/src/gallium/drivers/softpipe/sp_state_blend.c +++ b/src/gallium/drivers/softpipe/sp_state_blend.c @@ -1,5 +1,5 @@ /************************************************************************** - * + * * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas. * All Rights Reserved. * @@ -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. - * + * **************************************************************************/ /* Authors: Keith Whitwell diff --git a/src/gallium/drivers/softpipe/sp_state_clip.c b/src/gallium/drivers/softpipe/sp_state_clip.c index f3a4c23..8f1d636 100644 --- a/src/gallium/drivers/softpipe/sp_state_clip.c +++ b/src/gallium/drivers/softpipe/sp_state_clip.c @@ -1,5 +1,5 @@ /************************************************************************** - * + * * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas. * All Rights Reserved. * @@ -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. - * + * **************************************************************************/ /* Authors: Keith Whitwell diff --git a/src/gallium/drivers/softpipe/sp_state_derived.c b/src/gallium/drivers/softpipe/sp_state_derived.c index 3ba4d93..8269545 100644 --- a/src/gallium/drivers/softpipe/sp_state_derived.c +++ b/src/gallium/drivers/softpipe/sp_state_derived.c @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2003 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ #include "util/u_math.h" @@ -254,10 +254,10 @@ void softpipe_update_derived( struct softpipe_context *softpipe ) softpipe->tex_timestamp = sp_screen->timestamp; softpipe->dirty |= SP_NEW_TEXTURE; } - + if (softpipe->dirty & (SP_NEW_SAMPLER | SP_NEW_TEXTURE | - SP_NEW_FS | + SP_NEW_FS | SP_NEW_VS)) update_tgsi_samplers( softpipe ); diff --git a/src/gallium/drivers/softpipe/sp_state_rasterizer.c b/src/gallium/drivers/softpipe/sp_state_rasterizer.c index 3cd4acd..3179a53 100644 --- a/src/gallium/drivers/softpipe/sp_state_rasterizer.c +++ b/src/gallium/drivers/softpipe/sp_state_rasterizer.c @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ #include "pipe/p_defines.h" diff --git a/src/gallium/drivers/softpipe/sp_state_sampler.c b/src/gallium/drivers/softpipe/sp_state_sampler.c index b59fbc3..edf180f 100644 --- a/src/gallium/drivers/softpipe/sp_state_sampler.c +++ b/src/gallium/drivers/softpipe/sp_state_sampler.c @@ -1,5 +1,5 @@ /************************************************************************** - * + * * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas. * All Rights Reserved. * @@ -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. - * + * **************************************************************************/ /* Authors: @@ -305,7 +305,7 @@ get_sampler_varient( unsigned unit, key.bits.unit = unit; key.bits.pad = 0; - if (sampler->current && + if (sampler->current && key.value == sampler->current->key.value) { v = sampler->current; } @@ -321,7 +321,7 @@ get_sampler_varient( unsigned unit, sampler->varients = v; } } - + sampler->current = v; return v; } @@ -344,13 +344,13 @@ softpipe_reset_sampler_varients(struct softpipe_context *softpipe) texture = softpipe->vertex_sampler_views[i]->texture; } - softpipe->tgsi.vert_samplers_list[i] = + softpipe->tgsi.vert_samplers_list[i] = get_sampler_varient( i, sp_sampler(softpipe->vertex_samplers[i]), texture, TGSI_PROCESSOR_VERTEX ); - sp_sampler_varient_bind_texture( softpipe->tgsi.vert_samplers_list[i], + sp_sampler_varient_bind_texture( softpipe->tgsi.vert_samplers_list[i], softpipe->vertex_tex_cache[i], texture ); } @@ -394,7 +394,7 @@ softpipe_reset_sampler_varients(struct softpipe_context *softpipe) texture, TGSI_PROCESSOR_FRAGMENT ); - sp_sampler_varient_bind_texture( softpipe->tgsi.frag_samplers_list[i], + sp_sampler_varient_bind_texture( softpipe->tgsi.frag_samplers_list[i], softpipe->tex_cache[i], texture ); } diff --git a/src/gallium/drivers/softpipe/sp_state_shader.c b/src/gallium/drivers/softpipe/sp_state_shader.c index 7fff338..ec65999 100644 --- a/src/gallium/drivers/softpipe/sp_state_shader.c +++ b/src/gallium/drivers/softpipe/sp_state_shader.c @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ #include "sp_context.h" @@ -51,7 +51,7 @@ softpipe_create_fs_state(struct pipe_context *pipe, unsigned i; /* debug */ - if (softpipe->dump_fs) + if (softpipe->dump_fs) tgsi_dump(templ->tokens, 0); /* codegen */ @@ -134,7 +134,7 @@ softpipe_create_vs_state(struct pipe_context *pipe, struct sp_vertex_shader *state; state = CALLOC_STRUCT(sp_vertex_shader); - if (state == NULL ) + if (state == NULL ) goto fail; /* copy shader tokens, the ones passed in will go away. @@ -144,7 +144,7 @@ softpipe_create_vs_state(struct pipe_context *pipe, goto fail; state->draw_data = draw_create_vertex_shader(softpipe->draw, templ); - if (state->draw_data == NULL) + if (state->draw_data == NULL) goto fail; state->max_sampler = state->draw_data->info.file_max[TGSI_FILE_SAMPLER]; diff --git a/src/gallium/drivers/softpipe/sp_state_surface.c b/src/gallium/drivers/softpipe/sp_state_surface.c index 2db6fae..3ab0ada 100644 --- a/src/gallium/drivers/softpipe/sp_state_surface.c +++ b/src/gallium/drivers/softpipe/sp_state_surface.c @@ -1,5 +1,5 @@ /************************************************************************** - * + * * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas. * All Rights Reserved. * @@ -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. - * + * **************************************************************************/ /* Authors: Keith Whitwell diff --git a/src/gallium/drivers/softpipe/sp_state_vertex.c b/src/gallium/drivers/softpipe/sp_state_vertex.c index 7d8055f..03a0806 100644 --- a/src/gallium/drivers/softpipe/sp_state_vertex.c +++ b/src/gallium/drivers/softpipe/sp_state_vertex.c @@ -1,5 +1,5 @@ /************************************************************************** - * + * * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas. * All Rights Reserved. * @@ -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. - * + * **************************************************************************/ /* Authors: Keith Whitwell diff --git a/src/gallium/drivers/softpipe/sp_surface.c b/src/gallium/drivers/softpipe/sp_surface.c index 55b27e6..f85c23d 100644 --- a/src/gallium/drivers/softpipe/sp_surface.c +++ b/src/gallium/drivers/softpipe/sp_surface.c @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ #include "util/u_surface.h" diff --git a/src/gallium/drivers/softpipe/sp_surface.h b/src/gallium/drivers/softpipe/sp_surface.h index 22de3ba..e3b04c7 100644 --- a/src/gallium/drivers/softpipe/sp_surface.h +++ b/src/gallium/drivers/softpipe/sp_surface.h @@ -1,5 +1,5 @@ /************************************************************************** - * + * * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas. * All Rights Reserved. * @@ -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. - * + * **************************************************************************/ /* Authors: Keith Whitwell diff --git a/src/gallium/drivers/softpipe/sp_tex_sample.c b/src/gallium/drivers/softpipe/sp_tex_sample.c index 2eac4c7..5fccdd4 100644 --- a/src/gallium/drivers/softpipe/sp_tex_sample.c +++ b/src/gallium/drivers/softpipe/sp_tex_sample.c @@ -1,5 +1,5 @@ /************************************************************************** - * + * * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas. * All Rights Reserved. * Copyright 2008-2010 VMware, Inc. All rights reserved. @@ -11,11 +11,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. @@ -23,7 +23,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. - * + * **************************************************************************/ /** @@ -672,8 +672,8 @@ get_texel_2d(const struct sp_sampler_varient *samp, */ static INLINE void get_texel_quad_2d_no_border_single_tile(const struct sp_sampler_varient *samp, - union tex_tile_address addr, - unsigned x, unsigned y, + union tex_tile_address addr, + unsigned x, unsigned y, const float *out[4]) { const struct softpipe_tex_cached_tile *tile; @@ -684,7 +684,7 @@ get_texel_quad_2d_no_border_single_tile(const struct sp_sampler_varient *samp, x %= TILE_SIZE; tile = sp_get_cached_tile_tex(samp->cache, addr); - + out[0] = &tile->data.color[y ][x ][0]; out[1] = &tile->data.color[y ][x+1][0]; out[2] = &tile->data.color[y+1][x ][0]; @@ -697,7 +697,7 @@ get_texel_quad_2d_no_border_single_tile(const struct sp_sampler_varient *samp, static INLINE void get_texel_quad_2d_no_border(const struct sp_sampler_varient *samp, union tex_tile_address addr, - int x0, int y0, + int x0, int y0, int x1, int y1, const float *out[4]) { @@ -712,7 +712,7 @@ get_texel_quad_2d_no_border(const struct sp_sampler_varient *samp, static INLINE void get_texel_quad_2d(const struct sp_sampler_varient *samp, union tex_tile_address addr, - int x0, int y0, + int x0, int y0, int x1, int y1, const float *out[4]) { @@ -827,8 +827,8 @@ img_filter_2d_linear_repeat_POT(struct tgsi_sampler *tgsi_sampler, int x0 = uflr & (xpot - 1); int y0 = vflr & (ypot - 1); - const float *tx[4]; - + const float *tx[4]; + /* Can we fetch all four at once: */ if (x0 < xmax && y0 < ymax) { @@ -842,8 +842,8 @@ img_filter_2d_linear_repeat_POT(struct tgsi_sampler *tgsi_sampler, /* interpolate R, G, B, A */ for (c = 0; c < 4; c++) { - rgba[c][j] = lerp_2d(xw, yw, - tx[0][c], tx[1][c], + rgba[c][j] = lerp_2d(xw, yw, + tx[0][c], tx[1][c], tx[2][c], tx[3][c]); } } @@ -927,17 +927,17 @@ img_filter_2d_nearest_clamp_POT(struct tgsi_sampler *tgsi_sampler, const float *out; x0 = util_ifloor(u); - if (x0 < 0) + if (x0 < 0) x0 = 0; else if (x0 > xpot - 1) x0 = xpot - 1; y0 = util_ifloor(v); - if (y0 < 0) + if (y0 < 0) y0 = 0; else if (y0 > ypot - 1) y0 = ypot - 1; - + out = get_texel_2d_no_border(samp, addr, x0, y0); for (c = 0; c < 4; c++) { @@ -1014,7 +1014,7 @@ img_filter_2d_nearest(struct tgsi_sampler *tgsi_sampler, assert(width > 0); assert(height > 0); - + addr.value = 0; addr.bits.level = samp->level; @@ -1066,7 +1066,7 @@ img_filter_cube_nearest(struct tgsi_sampler *tgsi_sampler, assert(width > 0); assert(height > 0); - + addr.value = 0; addr.bits.level = samp->level; @@ -1124,7 +1124,7 @@ img_filter_3d_nearest(struct tgsi_sampler *tgsi_sampler, int c; for (c = 0; c < 4; c++) { rgba[c][j] = out[c]; - } + } } } @@ -1305,12 +1305,12 @@ img_filter_3d_linear(struct tgsi_sampler *tgsi_sampler, const float *tx01 = get_texel_3d(samp, addr, x1[j], y0[j], z0[j]); const float *tx02 = get_texel_3d(samp, addr, x0[j], y1[j], z0[j]); const float *tx03 = get_texel_3d(samp, addr, x1[j], y1[j], z0[j]); - + const float *tx10 = get_texel_3d(samp, addr, x0[j], y0[j], z1[j]); const float *tx11 = get_texel_3d(samp, addr, x1[j], y0[j], z1[j]); const float *tx12 = get_texel_3d(samp, addr, x0[j], y1[j], z1[j]); const float *tx13 = get_texel_3d(samp, addr, x1[j], y1[j], z1[j]); - + /* interpolate R, G, B, A */ for (c = 0; c < 4; c++) { rgba[c][j] = lerp_3d(xw[j], yw[j], zw[j], @@ -1370,7 +1370,7 @@ mip_filter_linear(struct tgsi_sampler *tgsi_sampler, lambda = lod[0]; level0 = (int)lambda; - if (lambda < 0.0) { + if (lambda < 0.0) { samp->level = 0; samp->mag_img_filter(tgsi_sampler, s, t, p, NULL, tgsi_sampler_lod_bias, rgba); } @@ -1435,7 +1435,7 @@ mip_filter_nearest(struct tgsi_sampler *tgsi_sampler, */ lambda = lod[0]; - if (lambda < 0.0) { + if (lambda < 0.0) { samp->level = 0; samp->mag_img_filter(tgsi_sampler, s, t, p, NULL, tgsi_sampler_lod_bias, rgba); } @@ -1477,7 +1477,7 @@ mip_filter_none(struct tgsi_sampler *tgsi_sampler, */ lambda = lod[0]; - if (lambda < 0.0) { + if (lambda < 0.0) { samp->mag_img_filter(tgsi_sampler, s, t, p, NULL, tgsi_sampler_lod_bias, rgba); } else { @@ -1523,7 +1523,7 @@ mip_filter_linear_2d_linear_repeat_POT( /* Catches both negative and large values of level0: */ - if ((unsigned)level0 >= texture->last_level) { + if ((unsigned)level0 >= texture->last_level) { if (level0 < 0) samp->level = 0; else @@ -1825,7 +1825,7 @@ get_lambda_func(const union sp_sampler_key key) { if (key.bits.processor == TGSI_PROCESSOR_VERTEX) return compute_lambda_vert; - + switch (key.bits.target) { case PIPE_TEXTURE_1D: return compute_lambda_1d; @@ -1849,7 +1849,7 @@ get_img_filter(const union sp_sampler_key key, { switch (key.bits.target) { case PIPE_TEXTURE_1D: - if (filter == PIPE_TEX_FILTER_NEAREST) + if (filter == PIPE_TEX_FILTER_NEAREST) return img_filter_1d_nearest; else return img_filter_1d_linear; @@ -1860,7 +1860,7 @@ get_img_filter(const union sp_sampler_key key, */ if (key.bits.is_pot && sampler->wrap_s == sampler->wrap_t && - sampler->normalized_coords) + sampler->normalized_coords) { switch (sampler->wrap_s) { case PIPE_TEX_WRAP_REPEAT: @@ -1884,19 +1884,19 @@ get_img_filter(const union sp_sampler_key key, } /* Otherwise use default versions: */ - if (filter == PIPE_TEX_FILTER_NEAREST) + if (filter == PIPE_TEX_FILTER_NEAREST) return img_filter_2d_nearest; else return img_filter_2d_linear; break; case PIPE_TEXTURE_CUBE: - if (filter == PIPE_TEX_FILTER_NEAREST) + if (filter == PIPE_TEX_FILTER_NEAREST) return img_filter_cube_nearest; else return img_filter_cube_linear; break; case PIPE_TEXTURE_3D: - if (filter == PIPE_TEX_FILTER_NEAREST) + if (filter == PIPE_TEX_FILTER_NEAREST) return img_filter_3d_nearest; else return img_filter_3d_linear; @@ -1955,7 +1955,7 @@ sp_create_sampler_varient( const struct pipe_sampler_state *sampler, samp->linear_texcoord_s = get_linear_wrap( sampler->wrap_s ); samp->linear_texcoord_t = get_linear_wrap( sampler->wrap_t ); samp->linear_texcoord_p = get_linear_wrap( sampler->wrap_r ); - + samp->nearest_texcoord_s = get_nearest_wrap( sampler->wrap_s ); samp->nearest_texcoord_t = get_nearest_wrap( sampler->wrap_t ); samp->nearest_texcoord_p = get_nearest_wrap( sampler->wrap_r ); @@ -1964,12 +1964,12 @@ sp_create_sampler_varient( const struct pipe_sampler_state *sampler, samp->linear_texcoord_s = get_linear_unorm_wrap( sampler->wrap_s ); samp->linear_texcoord_t = get_linear_unorm_wrap( sampler->wrap_t ); samp->linear_texcoord_p = get_linear_unorm_wrap( sampler->wrap_r ); - + samp->nearest_texcoord_s = get_nearest_unorm_wrap( sampler->wrap_s ); samp->nearest_texcoord_t = get_nearest_unorm_wrap( sampler->wrap_t ); samp->nearest_texcoord_p = get_nearest_unorm_wrap( sampler->wrap_r ); } - + samp->compute_lambda = get_lambda_func( key ); samp->min_img_filter = get_img_filter(key, sampler->min_img_filter, sampler); @@ -1977,8 +1977,8 @@ sp_create_sampler_varient( const struct pipe_sampler_state *sampler, switch (sampler->min_mip_filter) { case PIPE_TEX_MIPFILTER_NONE: - if (sampler->min_img_filter == sampler->mag_img_filter) - samp->mip_filter = samp->min_img_filter; + if (sampler->min_img_filter == sampler->mag_img_filter) + samp->mip_filter = samp->min_img_filter; else samp->mip_filter = mip_filter_none; break; @@ -1997,7 +1997,7 @@ sp_create_sampler_varient( const struct pipe_sampler_state *sampler, { samp->mip_filter = mip_filter_linear_2d_linear_repeat_POT; } - else + else { samp->mip_filter = mip_filter_linear; } @@ -2013,7 +2013,7 @@ sp_create_sampler_varient( const struct pipe_sampler_state *sampler, */ samp->compare = samp->mip_filter; } - + if (key.bits.target == PIPE_TEXTURE_CUBE) { samp->base.get_samples = sample_cube; } diff --git a/src/gallium/drivers/softpipe/sp_tex_sample.h b/src/gallium/drivers/softpipe/sp_tex_sample.h index 6114acf..6d2cfc1 100644 --- a/src/gallium/drivers/softpipe/sp_tex_sample.h +++ b/src/gallium/drivers/softpipe/sp_tex_sample.h @@ -1,5 +1,5 @@ /************************************************************************** - * + * * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas. * All Rights Reserved. * Copyright 2010 VMware, Inc. All rights reserved. @@ -11,11 +11,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. @@ -23,7 +23,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. - * + * **************************************************************************/ #ifndef SP_TEX_SAMPLE_H @@ -38,7 +38,7 @@ typedef void (*wrap_nearest_func)(const float s[4], unsigned size, int icoord[4]); -typedef void (*wrap_linear_func)(const float s[4], +typedef void (*wrap_linear_func)(const float s[4], unsigned size, int icoord0[4], int icoord1[4], @@ -97,7 +97,7 @@ struct sp_sampler_varient unsigned level; unsigned faces[4]; - + wrap_nearest_func nearest_texcoord_s; wrap_nearest_func nearest_texcoord_t; wrap_nearest_func nearest_texcoord_p; @@ -113,7 +113,7 @@ struct sp_sampler_varient filter_func mip_filter; filter_func compare; - + /* Linked list: */ struct sp_sampler_varient *next; @@ -121,7 +121,7 @@ struct sp_sampler_varient struct sp_sampler; -/* Create a sampler varient for a given set of non-orthogonal state. Currently the +/* Create a sampler varient for a given set of non-orthogonal state. Currently the */ struct sp_sampler_varient * sp_create_sampler_varient( const struct pipe_sampler_state *sampler, diff --git a/src/gallium/drivers/softpipe/sp_tex_tile_cache.c b/src/gallium/drivers/softpipe/sp_tex_tile_cache.c index 1393164..aa208bd 100644 --- a/src/gallium/drivers/softpipe/sp_tex_tile_cache.c +++ b/src/gallium/drivers/softpipe/sp_tex_tile_cache.c @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ /** @@ -40,7 +40,7 @@ #include "sp_texture.h" #include "sp_tex_tile_cache.h" - + struct softpipe_tex_tile_cache * sp_create_tex_tile_cache( struct pipe_context *pipe ) @@ -210,10 +210,10 @@ sp_flush_tex_tile_cache(struct softpipe_tex_tile_cache *tc) static INLINE uint tex_cache_pos( union tex_tile_address addr ) { - uint entry = (addr.bits.x + - addr.bits.y * 9 + - addr.bits.z * 3 + - addr.bits.face + + uint entry = (addr.bits.x + + addr.bits.y * 9 + + addr.bits.z * 3 + + addr.bits.face + addr.bits.level * 7); return entry % NUM_ENTRIES; @@ -224,11 +224,11 @@ tex_cache_pos( union tex_tile_address addr ) * Tiles are read-only and indexed with more params. */ const struct softpipe_tex_cached_tile * -sp_find_cached_tile_tex(struct softpipe_tex_tile_cache *tc, +sp_find_cached_tile_tex(struct softpipe_tex_tile_cache *tc, union tex_tile_address addr ) { struct softpipe_tex_cached_tile *tile; - + tile = tc->entries + tex_cache_pos( addr ); if (addr.value != tile->addr.value) { @@ -262,7 +262,7 @@ sp_find_cached_tile_tex(struct softpipe_tex_tile_cache *tc, tc->tex_trans = NULL; } - tc->tex_trans = + tc->tex_trans = pipe_get_transfer(tc->pipe, tc->texture, addr.bits.level, addr.bits.face + addr.bits.z, @@ -281,7 +281,7 @@ sp_find_cached_tile_tex(struct softpipe_tex_tile_cache *tc, /* get tile from the transfer (view into texture) */ pipe_get_tile_swizzle(tc->pipe, tc->tex_trans, - addr.bits.x * TILE_SIZE, + addr.bits.x * TILE_SIZE, addr.bits.y * TILE_SIZE, TILE_SIZE, TILE_SIZE, diff --git a/src/gallium/drivers/softpipe/sp_tex_tile_cache.h b/src/gallium/drivers/softpipe/sp_tex_tile_cache.h index e0b66bf..4055ddb 100644 --- a/src/gallium/drivers/softpipe/sp_tex_tile_cache.h +++ b/src/gallium/drivers/softpipe/sp_tex_tile_cache.h @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ #ifndef SP_TEX_TILE_CACHE_H @@ -126,7 +126,7 @@ sp_flush_tex_tile_cache(struct softpipe_tex_tile_cache *tc); extern const struct softpipe_tex_cached_tile * -sp_find_cached_tile_tex(struct softpipe_tex_tile_cache *tc, +sp_find_cached_tile_tex(struct softpipe_tex_tile_cache *tc, union tex_tile_address addr ); static INLINE union tex_tile_address @@ -151,7 +151,7 @@ tex_tile_address( unsigned x, /* Quickly retrieve tile if it matches last lookup. */ static INLINE const struct softpipe_tex_cached_tile * -sp_get_cached_tile_tex(struct softpipe_tex_tile_cache *tc, +sp_get_cached_tile_tex(struct softpipe_tex_tile_cache *tc, union tex_tile_address addr ) { if (tc->last_tile->addr.value == addr.value) diff --git a/src/gallium/drivers/softpipe/sp_texture.c b/src/gallium/drivers/softpipe/sp_texture.c index 509d998..9109900 100644 --- a/src/gallium/drivers/softpipe/sp_texture.c +++ b/src/gallium/drivers/softpipe/sp_texture.c @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2006 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ /* * Authors: @@ -95,7 +95,7 @@ softpipe_displaytarget_layout(struct pipe_screen *screen, spr->dt = winsys->displaytarget_create(winsys, spr->base.bind, spr->base.format, - spr->base.width0, + spr->base.width0, spr->base.height0, 16, &spr->stride[0] ); @@ -135,7 +135,7 @@ softpipe_resource_create(struct pipe_screen *screen, if (!softpipe_resource_layout(screen, spr)) goto fail; } - + return &spr->base; fail: @@ -273,7 +273,7 @@ softpipe_create_surface(struct pipe_context *pipe, /** * Free a pipe_surface which was created with softpipe_create_surface(). */ -static void +static void softpipe_surface_destroy(struct pipe_context *pipe, struct pipe_surface *surf) { @@ -350,8 +350,8 @@ softpipe_get_transfer(struct pipe_context *pipe, pt->layer_stride = pt->stride * nblocksy; spt->offset = sp_get_tex_image_offset(spr, level, box->z); - - spt->offset += + + spt->offset += box->y / util_format_get_blockheight(format) * spt->base.stride + box->x / util_format_get_blockwidth(format) * util_format_get_blocksize(format); @@ -365,7 +365,7 @@ softpipe_get_transfer(struct pipe_context *pipe, * Free a pipe_transfer object which was created with * softpipe_get_transfer(). */ -static void +static void softpipe_transfer_destroy(struct pipe_context *pipe, struct pipe_transfer *transfer) { @@ -385,7 +385,7 @@ softpipe_transfer_map(struct pipe_context *pipe, struct softpipe_resource *spr = softpipe_resource(transfer->resource); struct sw_winsys *winsys = softpipe_screen(pipe->screen)->winsys; uint8_t *map; - + /* resources backed by display target treated specially: */ if (spr->dt) { diff --git a/src/gallium/drivers/softpipe/sp_texture.h b/src/gallium/drivers/softpipe/sp_texture.h index 5603110..f914084 100644 --- a/src/gallium/drivers/softpipe/sp_texture.h +++ b/src/gallium/drivers/softpipe/sp_texture.h @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ #ifndef SP_TEXTURE_H diff --git a/src/gallium/drivers/softpipe/sp_tile_cache.c b/src/gallium/drivers/softpipe/sp_tile_cache.c index 480860a..ab899e8 100644 --- a/src/gallium/drivers/softpipe/sp_tile_cache.c +++ b/src/gallium/drivers/softpipe/sp_tile_cache.c @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ /** @@ -65,7 +65,7 @@ is_clear_flag_set(const uint *bitvec, union tile_address addr) bit = bitvec[pos / 32] & (1 << (pos & 31)); return bit; } - + /** * Mark the tile at (x,y) as not cleared. @@ -78,7 +78,7 @@ clear_clear_flag(uint *bitvec, union tile_address addr) assert(pos / 32 < (MAX_WIDTH / TILE_SIZE) * (MAX_HEIGHT / TILE_SIZE) / 32); bitvec[pos / 32] &= ~(1 << (pos & 31)); } - + struct softpipe_tile_cache * sp_create_tile_cache( struct pipe_context *pipe ) @@ -440,11 +440,11 @@ sp_alloc_tile(struct softpipe_tile_cache *tc) * \param x, y position of tile, in pixels */ struct softpipe_cached_tile * -sp_find_cached_tile(struct softpipe_tile_cache *tc, +sp_find_cached_tile(struct softpipe_tile_cache *tc, union tile_address addr ) { struct pipe_transfer *pt = tc->transfer; - + /* cache pos/entry: */ const int pos = CACHE_POS(addr.bits.x, addr.bits.y); diff --git a/src/gallium/drivers/softpipe/sp_tile_cache.h b/src/gallium/drivers/softpipe/sp_tile_cache.h index 68140b1..58c1338 100644 --- a/src/gallium/drivers/softpipe/sp_tile_cache.h +++ b/src/gallium/drivers/softpipe/sp_tile_cache.h @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ #ifndef SP_TILE_CACHE_H @@ -123,7 +123,7 @@ sp_tile_cache_clear(struct softpipe_tile_cache *tc, const float *rgba, uint clearValue); extern struct softpipe_cached_tile * -sp_find_cached_tile(struct softpipe_tile_cache *tc, +sp_find_cached_tile(struct softpipe_tile_cache *tc, union tile_address addr ); @@ -136,14 +136,14 @@ tile_address( unsigned x, addr.value = 0; addr.bits.x = x / TILE_SIZE; addr.bits.y = y / TILE_SIZE; - + return addr; } /* Quickly retrieve tile if it matches last lookup. */ static INLINE struct softpipe_cached_tile * -sp_get_cached_tile(struct softpipe_tile_cache *tc, +sp_get_cached_tile(struct softpipe_tile_cache *tc, int x, int y ) { union tile_address addr = tile_address( x, y ); diff --git a/src/gallium/drivers/svga/Makefile b/src/gallium/drivers/svga/Makefile index 2728779..47161f8 100644 --- a/src/gallium/drivers/svga/Makefile +++ b/src/gallium/drivers/svga/Makefile @@ -49,7 +49,7 @@ C_SOURCES = \ svga_resource.c \ svga_resource_texture.c \ svga_resource_buffer.c \ - svga_resource_buffer_upload.c + svga_resource_buffer_upload.c LIBRARY_INCLUDES = \ diff --git a/src/gallium/drivers/svga/SConscript b/src/gallium/drivers/svga/SConscript index 5455ed0..75e7303 100644 --- a/src/gallium/drivers/svga/SConscript +++ b/src/gallium/drivers/svga/SConscript @@ -7,10 +7,10 @@ if env['platform'] in ['linux']: if env['gcc']: env.Append(CPPDEFINES = [ - 'HAVE_STDINT_H', + 'HAVE_STDINT_H', 'HAVE_SYS_TYPES_H', ]) - + env.Prepend(CPPPATH = [ 'include', ]) @@ -62,7 +62,7 @@ sources = [ 'svga_tgsi_decl_sm20.c', 'svga_tgsi_decl_sm30.c', 'svga_tgsi_insn.c', - + 'svgadump/svga_dump.c', 'svgadump/svga_shader_dump.c', 'svgadump/svga_shader_op.c', diff --git a/src/gallium/drivers/svga/svga_cmd.c b/src/gallium/drivers/svga/svga_cmd.c index 05eab8a..9d39339 100644 --- a/src/gallium/drivers/svga/svga_cmd.c +++ b/src/gallium/drivers/svga/svga_cmd.c @@ -168,7 +168,7 @@ SVGA3D_DefineContext(struct svga_winsys_context *swc) // IN cmd->cid = swc->cid; swc->commit(swc); - + return PIPE_OK; } @@ -193,16 +193,16 @@ enum pipe_error SVGA3D_DestroyContext(struct svga_winsys_context *swc) // IN { SVGA3dCmdDestroyContext *cmd; - + cmd = SVGA3D_FIFOReserve(swc, SVGA_3D_CMD_CONTEXT_DESTROY, sizeof *cmd, 0); if(!cmd) return PIPE_ERROR_OUT_OF_MEMORY; - + cmd->cid = swc->cid; - + swc->commit(swc); - + return PIPE_OK; } @@ -289,7 +289,7 @@ SVGA3D_BeginDefineSurface(struct svga_winsys_context *swc, memset(*faces, 0, sizeof **faces * SVGA3D_MAX_SURFACE_FACES); memset(*mipSizes, 0, sizeof **mipSizes * numMipSizes); - + return PIPE_OK; } @@ -332,9 +332,9 @@ SVGA3D_DefineSurface2D(struct svga_winsys_context *swc, // IN mipSizes[0].width = width; mipSizes[0].height = height; mipSizes[0].depth = 1; - + swc->commit(swc);; - + return PIPE_OK; } @@ -360,15 +360,15 @@ SVGA3D_DestroySurface(struct svga_winsys_context *swc, struct svga_winsys_surface *sid) // IN { SVGA3dCmdDestroySurface *cmd; - + cmd = SVGA3D_FIFOReserve(swc, SVGA_3D_CMD_SURFACE_DESTROY, sizeof *cmd, 1); if(!cmd) return PIPE_ERROR_OUT_OF_MEMORY; - + swc->surface_relocation(swc, &cmd->sid, sid, SVGA_RELOC_READ); swc->commit(swc);; - + return PIPE_OK; } @@ -424,13 +424,13 @@ SVGA3D_SurfaceDMA(struct svga_winsys_context *swc, const SVGA3dCopyBox *boxes, // IN uint32 numBoxes) // IN { - struct svga_texture *texture = svga_texture(st->base.resource); + struct svga_texture *texture = svga_texture(st->base.resource); SVGA3dCmdSurfaceDMA *cmd; SVGA3dCmdSurfaceDMASuffix *pSuffix; uint32 boxesSize = sizeof *boxes * numBoxes; unsigned region_flags; unsigned surface_flags; - + if(transfer == SVGA3D_WRITE_HOST_VRAM) { region_flags = SVGA_RELOC_READ; surface_flags = SVGA_RELOC_WRITE; @@ -443,7 +443,7 @@ SVGA3D_SurfaceDMA(struct svga_winsys_context *swc, assert(0); return PIPE_ERROR_BAD_INPUT; } - + cmd = SVGA3D_FIFOReserve(swc, SVGA_3D_CMD_SURFACE_DMA, sizeof *cmd + boxesSize + sizeof *pSuffix, @@ -461,7 +461,7 @@ SVGA3D_SurfaceDMA(struct svga_winsys_context *swc, cmd->transfer = transfer; memcpy(&cmd[1], boxes, boxesSize); - + pSuffix = (SVGA3dCmdSurfaceDMASuffix *)((uint8_t*)cmd + sizeof *cmd + boxesSize); pSuffix->suffixSize = sizeof *pSuffix; pSuffix->maximumOffset = st->hw_nblocksy*st->base.stride; @@ -488,7 +488,7 @@ SVGA3D_BufferDMA(struct svga_winsys_context *swc, SVGA3dCmdSurfaceDMASuffix *pSuffix; unsigned region_flags; unsigned surface_flags; - + if(transfer == SVGA3D_WRITE_HOST_VRAM) { region_flags = SVGA_RELOC_READ; surface_flags = SVGA_RELOC_WRITE; @@ -501,7 +501,7 @@ SVGA3D_BufferDMA(struct svga_winsys_context *swc, assert(0); return PIPE_ERROR_BAD_INPUT; } - + cmd = SVGA3D_FIFOReserve(swc, SVGA_3D_CMD_SURFACE_DMA, sizeof *cmd + sizeof *box + sizeof *pSuffix, @@ -528,7 +528,7 @@ SVGA3D_BufferDMA(struct svga_winsys_context *swc, box->srcx = guest_offset; box->srcy = 0; box->srcz = 0; - + pSuffix = (SVGA3dCmdSurfaceDMASuffix *)((uint8_t*)cmd + sizeof *cmd + sizeof *box); pSuffix->suffixSize = sizeof *pSuffix; pSuffix->maximumOffset = guest_offset + size; @@ -574,7 +574,7 @@ SVGA3D_SetRenderTarget(struct svga_winsys_context *swc, struct pipe_surface *surface) // IN { SVGA3dCmdSetRenderTarget *cmd; - + cmd = SVGA3D_FIFOReserve(swc, SVGA_3D_CMD_SETRENDERTARGET, sizeof *cmd, 1); if(!cmd) @@ -677,7 +677,7 @@ SVGA3D_DestroyShader(struct svga_winsys_context *swc, SVGA3dShaderType type) // IN { SVGA3dCmdDestroyShader *cmd; - + cmd = SVGA3D_FIFOReserve(swc, SVGA_3D_CMD_SHADER_DESTROY, sizeof *cmd, 0); @@ -724,7 +724,7 @@ SVGA3D_SetShaderConst(struct svga_winsys_context *swc, const void *value) // IN { SVGA3dCmdSetShaderConst *cmd; - + cmd = SVGA3D_FIFOReserve(swc, SVGA_3D_CMD_SET_SHADER_CONST, sizeof *cmd, 0); @@ -788,13 +788,13 @@ SVGA3D_SetShader(struct svga_winsys_context *swc, uint32 shid) // IN { SVGA3dCmdSetShader *cmd; - + cmd = SVGA3D_FIFOReserve(swc, SVGA_3D_CMD_SET_SHADER, sizeof *cmd, 0); if(!cmd) return PIPE_ERROR_OUT_OF_MEMORY; - + cmd->cid = swc->cid; cmd->type = type; cmd->shid = shid; @@ -839,9 +839,9 @@ SVGA3D_BeginClear(struct svga_winsys_context *swc, uint32 numRects) // IN { SVGA3dCmdClear *cmd; - + cmd = SVGA3D_FIFOReserve(swc, - SVGA_3D_CMD_CLEAR, + SVGA_3D_CMD_CLEAR, sizeof *cmd + sizeof **rects * numRects, 0); if(!cmd) @@ -942,7 +942,7 @@ SVGA3D_BeginDrawPrimitives(struct svga_winsys_context *swc, uint32 rangeSize = sizeof **ranges * numRanges; cmd = SVGA3D_FIFOReserve(swc, - SVGA_3D_CMD_DRAW_PRIMITIVES, + SVGA_3D_CMD_DRAW_PRIMITIVES, sizeof *cmd + declSize + rangeSize, numVertexDecls + numRanges); if(!cmd) @@ -1037,7 +1037,7 @@ SVGA3D_SurfaceStretchBlt(struct svga_winsys_context *swc, SVGA3dStretchBltMode mode) // IN { SVGA3dCmdSurfaceStretchBlt *cmd; - + cmd = SVGA3D_FIFOReserve(swc, SVGA_3D_CMD_SURFACE_STRETCHBLT, sizeof *cmd, 2); @@ -1078,7 +1078,7 @@ SVGA3D_SetViewport(struct svga_winsys_context *swc, SVGA3dRect *rect) // IN { SVGA3dCmdSetViewport *cmd; - + cmd = SVGA3D_FIFOReserve(swc, SVGA_3D_CMD_SETVIEWPORT, sizeof *cmd, 0); @@ -1117,7 +1117,7 @@ SVGA3D_SetScissorRect(struct svga_winsys_context *swc, SVGA3dRect *rect) // IN { SVGA3dCmdSetScissorRect *cmd; - + cmd = SVGA3D_FIFOReserve(swc, SVGA_3D_CMD_SETSCISSORRECT, sizeof *cmd, 0); @@ -1153,7 +1153,7 @@ enum pipe_error SVGA3D_SetClipPlane(struct svga_winsys_context *swc, uint32 index, const float *plane) { SVGA3dCmdSetClipPlane *cmd; - + cmd = SVGA3D_FIFOReserve(swc, SVGA_3D_CMD_SETCLIPPLANE, sizeof *cmd, 0); @@ -1194,7 +1194,7 @@ SVGA3D_SetZRange(struct svga_winsys_context *swc, float zMax) // IN { SVGA3dCmdSetZRange *cmd; - + cmd = SVGA3D_FIFOReserve(swc, SVGA_3D_CMD_SETZRANGE, sizeof *cmd, 0); @@ -1241,9 +1241,9 @@ SVGA3D_BeginSetTextureState(struct svga_winsys_context *swc, uint32 numStates) // IN { SVGA3dCmdSetTextureState *cmd; - + cmd = SVGA3D_FIFOReserve(swc, - SVGA_3D_CMD_SETTEXTURESTATE, + SVGA_3D_CMD_SETTEXTURESTATE, sizeof *cmd + sizeof **states * numStates, numStates); if(!cmd) @@ -1287,9 +1287,9 @@ SVGA3D_BeginSetRenderState(struct svga_winsys_context *swc, uint32 numStates) // IN { SVGA3dCmdSetRenderState *cmd; - + cmd = SVGA3D_FIFOReserve(swc, - SVGA_3D_CMD_SETRENDERSTATE, + SVGA_3D_CMD_SETRENDERSTATE, sizeof *cmd + sizeof **states * numStates, 0); if(!cmd) @@ -1335,7 +1335,7 @@ SVGA3D_BeginQuery(struct svga_winsys_context *swc, cmd->type = type; swc->commit(swc); - + return PIPE_OK; } @@ -1364,7 +1364,7 @@ SVGA3D_EndQuery(struct svga_winsys_context *swc, SVGA3dCmdEndQuery *cmd; cmd = SVGA3D_FIFOReserve(swc, - SVGA_3D_CMD_END_QUERY, + SVGA_3D_CMD_END_QUERY, sizeof *cmd, 1); if(!cmd) @@ -1377,7 +1377,7 @@ SVGA3D_EndQuery(struct svga_winsys_context *swc, SVGA_RELOC_WRITE); swc->commit(swc); - + return PIPE_OK; } @@ -1411,7 +1411,7 @@ SVGA3D_WaitForQuery(struct svga_winsys_context *swc, SVGA3dCmdWaitForQuery *cmd; cmd = SVGA3D_FIFOReserve(swc, - SVGA_3D_CMD_WAIT_FOR_QUERY, + SVGA_3D_CMD_WAIT_FOR_QUERY, sizeof *cmd, 1); if(!cmd) @@ -1419,11 +1419,11 @@ SVGA3D_WaitForQuery(struct svga_winsys_context *swc, cmd->cid = swc->cid; cmd->type = type; - + swc->region_relocation(swc, &cmd->guestResult, buffer, 0, SVGA_RELOC_WRITE); swc->commit(swc); - + return PIPE_OK; } diff --git a/src/gallium/drivers/svga/svga_context.c b/src/gallium/drivers/svga/svga_context.c index 1e513f1..c2c23c8 100644 --- a/src/gallium/drivers/svga/svga_context.c +++ b/src/gallium/drivers/svga/svga_context.c @@ -55,9 +55,9 @@ static void svga_destroy( struct pipe_context *pipe ) svga_hwtnl_destroy( svga->hwtnl ); svga_cleanup_vertex_state(svga); - + svga->swc->destroy(svga->swc); - + svga_destroy_swtnl( svga ); u_upload_destroy( svga->upload_vb ); @@ -153,11 +153,11 @@ struct pipe_context *svga_context_create( struct pipe_screen *screen, ret = svga_emit_initial_state( svga ); if (ret) goto no_state; - + /* Avoid shortcircuiting state with initial value of zero. */ memset(&svga->state.hw_clear, 0xcd, sizeof(svga->state.hw_clear)); - memset(&svga->state.hw_clear.framebuffer, 0x0, + memset(&svga->state.hw_clear.framebuffer, 0x0, sizeof(svga->state.hw_clear.framebuffer)); memset(&svga->state.hw_draw, 0xcd, sizeof(svga->state.hw_draw)); @@ -191,7 +191,7 @@ struct pipe_context *svga_context_create( struct pipe_screen *screen, } -void svga_context_flush( struct svga_context *svga, +void svga_context_flush( struct svga_context *svga, struct pipe_fence_handle **pfence ) { struct svga_screen *svgascreen = svga_screen(svga->pipe.screen); @@ -199,7 +199,7 @@ void svga_context_flush( struct svga_context *svga, svga->curr.nr_fbs = 0; - /* Unmap upload manager buffers: + /* Unmap upload manager buffers: */ u_upload_flush(svga->upload_vb); u_upload_flush(svga->upload_ib); diff --git a/src/gallium/drivers/svga/svga_context.h b/src/gallium/drivers/svga/svga_context.h index 04e281a..c96b0b2 100644 --- a/src/gallium/drivers/svga/svga_context.h +++ b/src/gallium/drivers/svga/svga_context.h @@ -88,7 +88,7 @@ struct svga_blend_state { uint8_t srcblend; uint8_t dstblend; uint8_t blendeq; - + boolean separate_alpha_blend_enable; uint8_t srcblend_alpha; uint8_t dstblend_alpha; @@ -104,7 +104,7 @@ struct svga_depth_stencil_state { unsigned alphatestenable:1; unsigned alphafunc:8; - + struct { unsigned enabled:1; unsigned func:8; @@ -112,7 +112,7 @@ struct svga_depth_stencil_state { unsigned zfail:8; unsigned pass:8; } stencil[2]; - + /* SVGA3D has one ref/mask/writemask triple shared between front & * back face stencil. We really need two: */ @@ -145,7 +145,7 @@ struct svga_rasterizer_state { float slopescaledepthbias; float depthbias; float pointsize; - + unsigned hw_unfilled:16; /* PIPE_POLYGON_MODE_x */ unsigned need_pipeline:16; /* which prims do we need help for? */ }; @@ -175,9 +175,9 @@ struct svga_velems_state { }; /* Use to calculate differences between state emitted to hardware and - * current driver-calculated state. + * current driver-calculated state. */ -struct svga_state +struct svga_state { const struct svga_blend_state *blend; const struct svga_depth_stencil_state *depth; @@ -248,7 +248,7 @@ struct svga_hw_clear_state struct { float zmin, zmax; } depthrange; - + struct pipe_framebuffer_state framebuffer; struct svga_prescale prescale; }; @@ -331,7 +331,7 @@ struct svga_context unsigned texture_timestamp; - /* + /* */ struct svga_sw_state sw; struct svga_hw_draw_state hw_draw; @@ -389,9 +389,9 @@ struct svga_context /*********************************************************************** - * svga_clear.c: + * svga_clear.c: */ -void svga_clear(struct pipe_context *pipe, +void svga_clear(struct pipe_context *pipe, unsigned buffers, const float *rgba, double depth, @@ -399,7 +399,7 @@ void svga_clear(struct pipe_context *pipe, /*********************************************************************** - * svga_screen_texture.c: + * svga_screen_texture.c: */ void svga_mark_surfaces_dirty(struct svga_context *svga); diff --git a/src/gallium/drivers/svga/svga_debug.h b/src/gallium/drivers/svga/svga_debug.h index 3a3fcd8..e210b15 100644 --- a/src/gallium/drivers/svga/svga_debug.h +++ b/src/gallium/drivers/svga/svga_debug.h @@ -56,7 +56,7 @@ extern int SVGA_DEBUG; static INLINE void SVGA_DBG( unsigned flag, const char *fmt, ... ) { -#ifdef DEBUG +#ifdef DEBUG if (SVGA_DEBUG & flag) { va_list args; diff --git a/src/gallium/drivers/svga/svga_draw.c b/src/gallium/drivers/svga/svga_draw.c index 81dd477..b9fc1bb 100644 --- a/src/gallium/drivers/svga/svga_draw.c +++ b/src/gallium/drivers/svga/svga_draw.c @@ -51,7 +51,7 @@ struct svga_hwtnl *svga_hwtnl_create( struct svga_context *svga, hwtnl->svga = svga; hwtnl->upload_ib = upload_ib; - + hwtnl->cmd.swc = swc; return hwtnl; @@ -76,7 +76,7 @@ void svga_hwtnl_destroy( struct svga_hwtnl *hwtnl ) for (i = 0; i < hwtnl->cmd.prim_count; i++) pipe_resource_reference(&hwtnl->cmd.prim_ib[i], NULL); - + FREE(hwtnl); } @@ -88,13 +88,13 @@ void svga_hwtnl_set_flatshade( struct svga_hwtnl *hwtnl, { hwtnl->hw_pv = PV_FIRST; hwtnl->api_pv = (flatshade && !flatshade_first) ? PV_LAST : PV_FIRST; -} +} void svga_hwtnl_set_unfilled( struct svga_hwtnl *hwtnl, unsigned mode ) { hwtnl->api_fillmode = mode; -} +} void svga_hwtnl_reset_vdecl( struct svga_hwtnl *hwtnl, unsigned count ) @@ -123,7 +123,7 @@ void svga_hwtnl_vdecl( struct svga_hwtnl *hwtnl, hwtnl->cmd.vdecl[i] = *decl; - pipe_resource_reference(&hwtnl->cmd.vdecl_vb[i], vb); + pipe_resource_reference(&hwtnl->cmd.vdecl_vb[i], vb); } @@ -168,22 +168,22 @@ svga_hwtnl_flush( struct svga_hwtnl *hwtnl ) svga_surface(svga->curr.framebuffer.cbufs[0])->handle : NULL, hwtnl->cmd.prim_count); - ret = SVGA3D_BeginDrawPrimitives(swc, - &vdecl, - hwtnl->cmd.vdecl_count, - &prim, + ret = SVGA3D_BeginDrawPrimitives(swc, + &vdecl, + hwtnl->cmd.vdecl_count, + &prim, hwtnl->cmd.prim_count); - if (ret != PIPE_OK) + if (ret != PIPE_OK) return ret; - + memcpy( vdecl, hwtnl->cmd.vdecl, hwtnl->cmd.vdecl_count * sizeof hwtnl->cmd.vdecl[0]); for (i = 0; i < hwtnl->cmd.vdecl_count; i++) { - /* Given rangeHint is considered to be relative to indexBias, and - * indexBias varies per primitive, we cannot accurately supply an + /* Given rangeHint is considered to be relative to indexBias, and + * indexBias varies per primitive, we cannot accurately supply an * rangeHint when emitting more than one primitive per draw command. */ if (hwtnl->cmd.prim_count == 1) { @@ -212,7 +212,7 @@ svga_hwtnl_flush( struct svga_hwtnl *hwtnl ) SVGA_RELOC_READ); pipe_resource_reference(&hwtnl->cmd.prim_ib[i], NULL); } - + SVGA_FIFOCommitAll( swc ); hwtnl->cmd.prim_count = 0; } @@ -368,7 +368,7 @@ enum pipe_error svga_hwtnl_prim( struct svga_hwtnl *hwtnl, if (ret != PIPE_OK) return ret; } - + /* min/max indices are relative to bias */ hwtnl->cmd.min_index[hwtnl->cmd.prim_count] = min_index; hwtnl->cmd.max_index[hwtnl->cmd.prim_count] = max_index; diff --git a/src/gallium/drivers/svga/svga_draw.h b/src/gallium/drivers/svga/svga_draw.h index a2403d8..d734c02 100644 --- a/src/gallium/drivers/svga/svga_draw.h +++ b/src/gallium/drivers/svga/svga_draw.h @@ -59,10 +59,10 @@ void svga_hwtnl_reset_vdecl( struct svga_hwtnl *hwtnl, unsigned count ); -enum pipe_error +enum pipe_error svga_hwtnl_draw_arrays( struct svga_hwtnl *hwtnl, - unsigned prim, - unsigned start, + unsigned prim, + unsigned start, unsigned count); enum pipe_error @@ -72,8 +72,8 @@ svga_hwtnl_draw_range_elements( struct svga_hwtnl *hwtnl, int index_bias, unsigned min_index, unsigned max_index, - unsigned prim, - unsigned start, + unsigned prim, + unsigned start, unsigned count ); enum pipe_error diff --git a/src/gallium/drivers/svga/svga_draw_arrays.c b/src/gallium/drivers/svga/svga_draw_arrays.c index da33fae..4b954f3 100644 --- a/src/gallium/drivers/svga/svga_draw_arrays.c +++ b/src/gallium/drivers/svga/svga_draw_arrays.c @@ -51,8 +51,8 @@ static enum pipe_error generate_indices( struct svga_hwtnl *hwtnl, struct pipe_resource *dst = NULL; void *dst_map = NULL; - dst = pipe_buffer_create( pipe->screen, - PIPE_BIND_INDEX_BUFFER, + dst = pipe_buffer_create( pipe->screen, + PIPE_BIND_INDEX_BUFFER, size ); if (dst == NULL) goto fail; @@ -76,7 +76,7 @@ static enum pipe_error generate_indices( struct svga_hwtnl *hwtnl, if (dst) pipe->screen->resource_destroy( pipe->screen, dst ); - + return PIPE_ERROR_OUT_OF_MEMORY; } @@ -110,18 +110,18 @@ static enum pipe_error retrieve_or_generate_indices( struct svga_hwtnl *hwtnl, pipe_resource_reference( out_buf, hwtnl->index_cache[prim][i].buffer ); - if (DBG) + if (DBG) debug_printf("%s retrieve %d/%d\n", __FUNCTION__, i, gen_nr); return PIPE_OK; } - else if (gen_type == U_GENERATE_REUSABLE) + else if (gen_type == U_GENERATE_REUSABLE) { pipe_resource_reference( &hwtnl->index_cache[prim][i].buffer, NULL ); - if (DBG) - debug_printf("%s discard %d/%d\n", __FUNCTION__, + if (DBG) + debug_printf("%s discard %d/%d\n", __FUNCTION__, i, hwtnl->index_cache[prim][i].gen_nr); break; @@ -133,7 +133,7 @@ static enum pipe_error retrieve_or_generate_indices( struct svga_hwtnl *hwtnl, { unsigned smallest = 0; unsigned smallest_size = ~0; - + for (i = 0; i < IDX_CACHE_MAX && smallest_size; i++) { if (hwtnl->index_cache[prim][i].buffer == NULL) { @@ -153,14 +153,14 @@ static enum pipe_error retrieve_or_generate_indices( struct svga_hwtnl *hwtnl, NULL ); if (DBG) - debug_printf("%s discard smallest %d/%d\n", __FUNCTION__, + debug_printf("%s discard smallest %d/%d\n", __FUNCTION__, smallest, smallest_size); - + i = smallest; } - - - ret = generate_indices( hwtnl, + + + ret = generate_indices( hwtnl, gen_nr, gen_size, generate, @@ -175,7 +175,7 @@ static enum pipe_error retrieve_or_generate_indices( struct svga_hwtnl *hwtnl, *out_buf ); if (DBG) - debug_printf("%s cache %d/%d\n", __FUNCTION__, + debug_printf("%s cache %d/%d\n", __FUNCTION__, i, hwtnl->index_cache[prim][i].gen_nr); return PIPE_OK; @@ -194,7 +194,7 @@ simple_draw_arrays( struct svga_hwtnl *hwtnl, hw_prim = svga_translate_prim(prim, count, &hw_count); if (hw_count == 0) return PIPE_ERROR_BAD_INPUT; - + range.primType = hw_prim; range.primitiveCount = hw_count; range.indexArray.surfaceId = SVGA3D_INVALID_ID; @@ -220,18 +220,18 @@ simple_draw_arrays( struct svga_hwtnl *hwtnl, -enum pipe_error +enum pipe_error svga_hwtnl_draw_arrays( struct svga_hwtnl *hwtnl, - unsigned prim, - unsigned start, + unsigned prim, + unsigned start, unsigned count) { unsigned gen_prim, gen_size, gen_nr, gen_type; u_generate_func gen_func; enum pipe_error ret = PIPE_OK; - if (hwtnl->api_fillmode != PIPE_POLYGON_MODE_FILL && - prim >= PIPE_PRIM_TRIANGLES) + if (hwtnl->api_fillmode != PIPE_POLYGON_MODE_FILL && + prim >= PIPE_PRIM_TRIANGLES) { gen_type = u_unfilled_generator( prim, start, @@ -261,7 +261,7 @@ svga_hwtnl_draw_arrays( struct svga_hwtnl *hwtnl, else { struct pipe_resource *gen_buf = NULL; - /* Need to draw as indexed primitive. + /* Need to draw as indexed primitive. * Potentially need to run the gen func to build an index buffer. */ ret = retrieve_or_generate_indices( hwtnl, diff --git a/src/gallium/drivers/svga/svga_draw_elements.c b/src/gallium/drivers/svga/svga_draw_elements.c index c457917..d2cc984 100644 --- a/src/gallium/drivers/svga/svga_draw_elements.c +++ b/src/gallium/drivers/svga/svga_draw_elements.c @@ -54,8 +54,8 @@ translate_indices( struct svga_hwtnl *hwtnl, struct pipe_resource *dst = NULL; void *dst_map = NULL; - dst = pipe_buffer_create( pipe->screen, - PIPE_BIND_INDEX_BUFFER, + dst = pipe_buffer_create( pipe->screen, + PIPE_BIND_INDEX_BUFFER, size ); if (dst == NULL) goto fail; @@ -102,7 +102,7 @@ svga_hwtnl_simple_draw_range_elements( struct svga_hwtnl *hwtnl, int index_bias, unsigned min_index, unsigned max_index, - unsigned prim, + unsigned prim, unsigned start, unsigned count ) { @@ -117,8 +117,8 @@ svga_hwtnl_simple_draw_range_elements( struct svga_hwtnl *hwtnl, if (hw_count == 0) goto done; - if (index_buffer && - svga_buffer_is_user_buffer(index_buffer)) + if (index_buffer && + svga_buffer_is_user_buffer(index_buffer)) { assert( index_buffer->width0 >= index_offset + count * index_size ); @@ -144,7 +144,7 @@ svga_hwtnl_simple_draw_range_elements( struct svga_hwtnl *hwtnl, range.indexArray.stride = index_size; range.indexWidth = index_size; range.indexBias = index_bias; - + ret = svga_hwtnl_prim( hwtnl, &range, min_index, max_index, index_buffer ); if (ret) goto done; @@ -172,8 +172,8 @@ svga_hwtnl_draw_range_elements( struct svga_hwtnl *hwtnl, u_translate_func gen_func; enum pipe_error ret = PIPE_OK; - if (hwtnl->api_fillmode != PIPE_POLYGON_MODE_FILL && - prim >= PIPE_PRIM_TRIANGLES) + if (hwtnl->api_fillmode != PIPE_POLYGON_MODE_FILL && + prim >= PIPE_PRIM_TRIANGLES) { gen_type = u_unfilled_translator( prim, index_size, @@ -198,9 +198,9 @@ svga_hwtnl_draw_range_elements( struct svga_hwtnl *hwtnl, &gen_func ); } - + if (gen_type == U_TRANSLATE_MEMCPY) { - /* No need for translation, just pass through to hardware: + /* No need for translation, just pass through to hardware: */ return svga_hwtnl_simple_draw_range_elements( hwtnl, index_buffer, index_size, diff --git a/src/gallium/drivers/svga/svga_draw_private.h b/src/gallium/drivers/svga/svga_draw_private.h index 11afb59..2697fe4 100644 --- a/src/gallium/drivers/svga/svga_draw_private.h +++ b/src/gallium/drivers/svga/svga_draw_private.h @@ -37,7 +37,7 @@ struct u_upload_mgr; /* Should include polygon? */ -static const unsigned svga_hw_prims = +static const unsigned svga_hw_prims = ((1 << PIPE_PRIM_POINTS) | (1 << PIPE_PRIM_LINES) | (1 << PIPE_PRIM_LINE_STRIP) | @@ -46,7 +46,7 @@ static const unsigned svga_hw_prims = (1 << PIPE_PRIM_TRIANGLE_FAN)); -static INLINE unsigned svga_translate_prim(unsigned mode, +static INLINE unsigned svga_translate_prim(unsigned mode, unsigned count, unsigned *out_count) { @@ -57,23 +57,23 @@ static INLINE unsigned svga_translate_prim(unsigned mode, case PIPE_PRIM_LINES: *out_count = count / 2; - return SVGA3D_PRIMITIVE_LINELIST; + return SVGA3D_PRIMITIVE_LINELIST; case PIPE_PRIM_LINE_STRIP: *out_count = count - 1; - return SVGA3D_PRIMITIVE_LINESTRIP; + return SVGA3D_PRIMITIVE_LINESTRIP; case PIPE_PRIM_TRIANGLES: *out_count = count / 3; - return SVGA3D_PRIMITIVE_TRIANGLELIST; + return SVGA3D_PRIMITIVE_TRIANGLELIST; case PIPE_PRIM_TRIANGLE_STRIP: *out_count = count - 2; - return SVGA3D_PRIMITIVE_TRIANGLESTRIP; + return SVGA3D_PRIMITIVE_TRIANGLESTRIP; case PIPE_PRIM_TRIANGLE_FAN: *out_count = count - 2; - return SVGA3D_PRIMITIVE_TRIANGLEFAN; + return SVGA3D_PRIMITIVE_TRIANGLEFAN; default: assert(0); @@ -87,7 +87,7 @@ struct index_cache { u_generate_func generate; unsigned gen_nr; - /* If non-null, this buffer is filled by calling + /* If non-null, this buffer is filled by calling * generate(nr, map(buffer)) */ struct pipe_resource *buffer; @@ -114,7 +114,7 @@ struct draw_cmd { struct svga_hwtnl { struct svga_context *svga; struct u_upload_mgr *upload_ib; - + /* Flatshade information: */ unsigned api_pv; @@ -136,7 +136,7 @@ struct svga_hwtnl { /*********************************************************************** * Internal functions */ -enum pipe_error +enum pipe_error svga_hwtnl_prim( struct svga_hwtnl *hwtnl, const SVGA3dPrimitiveRange *range, unsigned min_index, @@ -150,7 +150,7 @@ svga_hwtnl_simple_draw_range_elements( struct svga_hwtnl *hwtnl, int index_bias, unsigned min_index, unsigned max_index, - unsigned prim, + unsigned prim, unsigned start, unsigned count ); diff --git a/src/gallium/drivers/svga/svga_pipe_blend.c b/src/gallium/drivers/svga/svga_pipe_blend.c index 594eec7..ea07f69 100644 --- a/src/gallium/drivers/svga/svga_pipe_blend.c +++ b/src/gallium/drivers/svga/svga_pipe_blend.c @@ -81,7 +81,7 @@ svga_create_blend_state(struct pipe_context *pipe, struct svga_blend_state *blend = CALLOC_STRUCT( svga_blend_state ); unsigned i; - + /* Fill in the per-rendertarget blend state. We currently only * have one rendertarget. */ diff --git a/src/gallium/drivers/svga/svga_pipe_clear.c b/src/gallium/drivers/svga/svga_pipe_clear.c index 41f239c..1850427 100644 --- a/src/gallium/drivers/svga/svga_pipe_clear.c +++ b/src/gallium/drivers/svga/svga_pipe_clear.c @@ -35,7 +35,7 @@ static enum pipe_error -try_clear(struct svga_context *svga, +try_clear(struct svga_context *svga, unsigned buffers, const float *rgba, double depth, @@ -88,7 +88,7 @@ try_clear(struct svga_context *svga, memcpy(&rect, &svga->state.hw_clear.viewport, sizeof rect); ret = SVGA3D_SetViewport(svga->swc, &rect); } - + return ret; } diff --git a/src/gallium/drivers/svga/svga_pipe_constants.c b/src/gallium/drivers/svga/svga_pipe_constants.c index 2fa2142..090a8b2 100644 --- a/src/gallium/drivers/svga/svga_pipe_constants.c +++ b/src/gallium/drivers/svga/svga_pipe_constants.c @@ -31,10 +31,10 @@ #include "svga_context.h" /*********************************************************************** - * Constant buffers + * Constant buffers */ -struct svga_constbuf +struct svga_constbuf { unsigned type; float (*data)[4]; diff --git a/src/gallium/drivers/svga/svga_pipe_depthstencil.c b/src/gallium/drivers/svga/svga_pipe_depthstencil.c index c84615a..6db6b74 100644 --- a/src/gallium/drivers/svga/svga_pipe_depthstencil.c +++ b/src/gallium/drivers/svga/svga_pipe_depthstencil.c @@ -85,7 +85,7 @@ svga_create_depth_stencil_state(struct pipe_context *pipe, ds->stencil[0].fail = svga_translate_stencil_op(templ->stencil[0].fail_op); ds->stencil[0].zfail = svga_translate_stencil_op(templ->stencil[0].zfail_op); ds->stencil[0].pass = svga_translate_stencil_op(templ->stencil[0].zpass_op); - + /* SVGA3D has one ref/mask/writemask triple shared between front & * back face stencil. We really need two: */ diff --git a/src/gallium/drivers/svga/svga_pipe_draw.c b/src/gallium/drivers/svga/svga_pipe_draw.c index 001ec36..efad4e7 100644 --- a/src/gallium/drivers/svga/svga_pipe_draw.c +++ b/src/gallium/drivers/svga/svga_pipe_draw.c @@ -47,8 +47,8 @@ retry_draw_range_elements( struct svga_context *svga, int index_bias, unsigned min_index, unsigned max_index, - unsigned prim, - unsigned start, + unsigned prim, + unsigned start, unsigned count, boolean do_retry ) { @@ -99,8 +99,8 @@ retry_draw_range_elements( struct svga_context *svga, static enum pipe_error retry_draw_arrays( struct svga_context *svga, - unsigned prim, - unsigned start, + unsigned prim, + unsigned start, unsigned count, boolean do_retry ) { @@ -131,7 +131,7 @@ retry_draw_arrays( struct svga_context *svga, return 0; retry: - if (ret == PIPE_ERROR_OUT_OF_MEMORY && do_retry) + if (ret == PIPE_ERROR_OUT_OF_MEMORY && do_retry) { svga_context_flush( svga, NULL ); @@ -170,7 +170,7 @@ svga_draw_vbo(struct pipe_context *pipe, const struct pipe_draw_info *info) svga->curr.reduced_prim = reduced_prim; svga->dirty |= SVGA_NEW_REDUCED_PRIMITIVE; } - + svga_update_state_retry( svga, SVGA_STATE_NEED_SWTNL ); #ifdef DEBUG diff --git a/src/gallium/drivers/svga/svga_pipe_fs.c b/src/gallium/drivers/svga/svga_pipe_fs.c index b71bc66..600a143 100644 --- a/src/gallium/drivers/svga/svga_pipe_fs.c +++ b/src/gallium/drivers/svga/svga_pipe_fs.c @@ -38,7 +38,7 @@ /*********************************************************************** - * Fragment shaders + * Fragment shaders */ static void * @@ -61,7 +61,7 @@ svga_create_fs_state(struct pipe_context *pipe, fs->base.id = svga->debug.shader_id++; fs->base.use_sm30 = svgascreen->use_ps30; - + if (SVGA_DEBUG & DEBUG_TGSI || 0) { debug_printf("%s id: %u, inputs: %u, outputs: %u\n", __FUNCTION__, fs->base.id, @@ -94,12 +94,12 @@ void svga_delete_fs_state(struct pipe_context *pipe, void *shader) for (result = fs->base.results; result; result = tmp ) { tmp = result->next; - ret = SVGA3D_DestroyShader(svga->swc, + ret = SVGA3D_DestroyShader(svga->swc, result->id, SVGA3D_SHADERTYPE_PS ); if(ret != PIPE_OK) { svga_context_flush(svga, NULL); - ret = SVGA3D_DestroyShader(svga->swc, + ret = SVGA3D_DestroyShader(svga->swc, result->id, SVGA3D_SHADERTYPE_PS ); assert(ret == PIPE_OK); diff --git a/src/gallium/drivers/svga/svga_pipe_misc.c b/src/gallium/drivers/svga/svga_pipe_misc.c index 8c24fb3..4ff5071 100644 --- a/src/gallium/drivers/svga/svga_pipe_misc.c +++ b/src/gallium/drivers/svga/svga_pipe_misc.c @@ -91,7 +91,7 @@ static void svga_set_framebuffer_state(struct pipe_context *pipe, if (propagate) { /* make sure that drawing calls comes before propagation calls */ svga_hwtnl_flush_retry( svga ); - + for (i = 0; i < PIPE_MAX_COLOR_BUFS; i++) if (dst->cbufs[i] && dst->cbufs[i] != fb->cbufs[i]) svga_propagate_surface(pipe, dst->cbufs[i]); @@ -102,8 +102,8 @@ static void svga_set_framebuffer_state(struct pipe_context *pipe, * know that make no such assumption here. */ for(i = 0; i < fb->nr_cbufs; ++i) { if (fb->zsbuf && fb->cbufs[i]) { - assert(fb->zsbuf->width == fb->cbufs[i]->width); - assert(fb->zsbuf->height == fb->cbufs[i]->height); + assert(fb->zsbuf->width == fb->cbufs[i]->width); + assert(fb->zsbuf->height == fb->cbufs[i]->height); } } diff --git a/src/gallium/drivers/svga/svga_pipe_query.c b/src/gallium/drivers/svga/svga_pipe_query.c index 579f803..b5461a7 100644 --- a/src/gallium/drivers/svga/svga_pipe_query.c +++ b/src/gallium/drivers/svga/svga_pipe_query.c @@ -60,7 +60,7 @@ svga_query( struct pipe_query *q ) return (struct svga_query *)q; } -static boolean svga_get_query_result(struct pipe_context *pipe, +static boolean svga_get_query_result(struct pipe_context *pipe, struct pipe_query *q, boolean wait, void *result); @@ -87,9 +87,9 @@ static struct pipe_query *svga_create_query( struct pipe_context *pipe, sizeof *sq->queryResult); if(!sq->hwbuf) goto no_hwbuf; - - sq->queryResult = (SVGA3dQueryResult *)sws->buffer_map(sws, - sq->hwbuf, + + sq->queryResult = (SVGA3dQueryResult *)sws->buffer_map(sws, + sq->hwbuf, PIPE_TRANSFER_WRITE); if(!sq->queryResult) goto no_query_result; @@ -99,7 +99,7 @@ static struct pipe_query *svga_create_query( struct pipe_context *pipe, /* * We request the buffer to be pinned and assume it is always mapped. - * + * * The reason is that we don't want to wait for fences when checking the * query status. */ @@ -128,7 +128,7 @@ static void svga_destroy_query(struct pipe_context *pipe, FREE(sq); } -static void svga_begin_query(struct pipe_context *pipe, +static void svga_begin_query(struct pipe_context *pipe, struct pipe_query *q) { struct svga_screen *svgascreen = svga_screen(pipe->screen); @@ -138,14 +138,14 @@ static void svga_begin_query(struct pipe_context *pipe, enum pipe_error ret; SVGA_DBG(DEBUG_QUERY, "%s\n", __FUNCTION__); - + assert(!svga->sq); /* Need to flush out buffered drawing commands so that they don't * get counted in the query results. */ svga_hwtnl_flush_retry(svga); - + if(sq->queryResult->state == SVGA3D_QUERYSTATE_PENDING) { /* The application doesn't care for the pending query result. We cannot * let go the existing buffer and just get a new one because its storage @@ -157,10 +157,10 @@ static void svga_begin_query(struct pipe_context *pipe, uint64_t result; svga_get_query_result(pipe, q, TRUE, &result); - + assert(sq->queryResult->state != SVGA3D_QUERYSTATE_PENDING); } - + sq->queryResult->state = SVGA3D_QUERYSTATE_NEW; sws->fence_reference(sws, &sq->fence, NULL); @@ -174,7 +174,7 @@ static void svga_begin_query(struct pipe_context *pipe, svga->sq = sq; } -static void svga_end_query(struct pipe_context *pipe, +static void svga_end_query(struct pipe_context *pipe, struct pipe_query *q) { struct svga_context *svga = svga_context( pipe ); @@ -185,7 +185,7 @@ static void svga_end_query(struct pipe_context *pipe, assert(svga->sq == sq); svga_hwtnl_flush_retry(svga); - + /* Set to PENDING before sending EndQuery. */ sq->queryResult->state = SVGA3D_QUERYSTATE_PENDING; @@ -195,8 +195,8 @@ static void svga_end_query(struct pipe_context *pipe, ret = SVGA3D_EndQuery( svga->swc, sq->type, sq->hwbuf); assert(ret == PIPE_OK); } - - /* TODO: Delay flushing. We don't really need to flush here, just ensure + + /* TODO: Delay flushing. We don't really need to flush here, just ensure * that there is one flush before svga_get_query_result attempts to get the * result */ svga_context_flush(svga, NULL); @@ -204,7 +204,7 @@ static void svga_end_query(struct pipe_context *pipe, svga->sq = NULL; } -static boolean svga_get_query_result(struct pipe_context *pipe, +static boolean svga_get_query_result(struct pipe_context *pipe, struct pipe_query *q, boolean wait, void *vresult) @@ -215,11 +215,11 @@ static boolean svga_get_query_result(struct pipe_context *pipe, struct svga_query *sq = svga_query( q ); SVGA3dQueryState state; uint64_t *result = (uint64_t*)vresult; - + SVGA_DBG(DEBUG_QUERY, "%s wait: %d\n", __FUNCTION__); - /* The query status won't be updated by the host unless - * SVGA_3D_CMD_WAIT_FOR_QUERY is emitted. Unfortunately this will cause a + /* The query status won't be updated by the host unless + * SVGA_3D_CMD_WAIT_FOR_QUERY is emitted. Unfortunately this will cause a * synchronous wait on the host */ if(!sq->fence) { enum pipe_error ret; @@ -230,9 +230,9 @@ static boolean svga_get_query_result(struct pipe_context *pipe, ret = SVGA3D_WaitForQuery( svga->swc, sq->type, sq->hwbuf); assert(ret == PIPE_OK); } - + svga_context_flush(svga, &sq->fence); - + assert(sq->fence); } @@ -240,15 +240,15 @@ static boolean svga_get_query_result(struct pipe_context *pipe, if(state == SVGA3D_QUERYSTATE_PENDING) { if(!wait) return FALSE; - + sws->fence_finish(sws, sq->fence, 0); - + state = sq->queryResult->state; } - assert(state == SVGA3D_QUERYSTATE_SUCCEEDED || + assert(state == SVGA3D_QUERYSTATE_SUCCEEDED || state == SVGA3D_QUERYSTATE_FAILED); - + *result = (uint64_t)sq->queryResult->result32; SVGA_DBG(DEBUG_QUERY, "%s result %d\n", __FUNCTION__, (unsigned)*result); diff --git a/src/gallium/drivers/svga/svga_pipe_rasterizer.c b/src/gallium/drivers/svga/svga_pipe_rasterizer.c index 660eb07..a17f128 100644 --- a/src/gallium/drivers/svga/svga_pipe_rasterizer.c +++ b/src/gallium/drivers/svga/svga_pipe_rasterizer.c @@ -82,7 +82,7 @@ svga_create_rasterizer_state(struct pipe_context *pipe, /* fill_cw, fill_ccw - draw module or index translation */ rast->shademode = svga_translate_flatshade( templ->flatshade ); - rast->cullmode = svga_translate_cullmode( templ->cull_face, + rast->cullmode = svga_translate_cullmode( templ->cull_face, templ->front_ccw ); rast->scissortestenable = templ->scissor; rast->multisampleantialias = templ->multisample; @@ -101,7 +101,7 @@ svga_create_rasterizer_state(struct pipe_context *pipe, rast->need_pipeline |= SVGA_PIPELINE_FLAG_LINES; if (templ->line_stipple_enable) { - /* LinePattern not implemented on all backends. + /* LinePattern not implemented on all backends. */ if (0) { SVGA3dLinePattern lp; @@ -112,7 +112,7 @@ svga_create_rasterizer_state(struct pipe_context *pipe, else { rast->need_pipeline |= SVGA_PIPELINE_FLAG_LINES; } - } + } if (templ->point_smooth) rast->need_pipeline |= SVGA_PIPELINE_FLAG_POINTS; @@ -142,7 +142,7 @@ svga_create_rasterizer_state(struct pipe_context *pipe, break; case PIPE_FACE_NONE: - if (fill_front != fill_back || offset_front != offset_back) + if (fill_front != fill_back || offset_front != offset_back) { /* Always need the draw module to work out different * front/back fill modes: @@ -168,7 +168,7 @@ svga_create_rasterizer_state(struct pipe_context *pipe, (templ->flatshade || templ->light_twoside || offset || - templ->cull_face != PIPE_FACE_NONE)) + templ->cull_face != PIPE_FACE_NONE)) { fill = PIPE_POLYGON_MODE_FILL; rast->need_pipeline |= SVGA_PIPELINE_FLAG_TRIS; @@ -225,7 +225,7 @@ static void svga_bind_rasterizer_state( struct pipe_context *pipe, draw_set_rasterizer_state(svga->swtnl.draw, raster ? &raster->templ : NULL, state); - + svga->dirty |= SVGA_NEW_RAST; } diff --git a/src/gallium/drivers/svga/svga_pipe_sampler.c b/src/gallium/drivers/svga/svga_pipe_sampler.c index f44a0e1..1b4993f 100644 --- a/src/gallium/drivers/svga/svga_pipe_sampler.c +++ b/src/gallium/drivers/svga/svga_pipe_sampler.c @@ -38,27 +38,27 @@ static INLINE unsigned translate_wrap_mode(unsigned wrap) { switch (wrap) { - case PIPE_TEX_WRAP_REPEAT: + case PIPE_TEX_WRAP_REPEAT: return SVGA3D_TEX_ADDRESS_WRAP; - case PIPE_TEX_WRAP_CLAMP: + case PIPE_TEX_WRAP_CLAMP: return SVGA3D_TEX_ADDRESS_CLAMP; - case PIPE_TEX_WRAP_CLAMP_TO_EDGE: + case PIPE_TEX_WRAP_CLAMP_TO_EDGE: /* Unfortunately SVGA3D_TEX_ADDRESS_EDGE not respected by * hardware. */ return SVGA3D_TEX_ADDRESS_CLAMP; - case PIPE_TEX_WRAP_CLAMP_TO_BORDER: + case PIPE_TEX_WRAP_CLAMP_TO_BORDER: return SVGA3D_TEX_ADDRESS_BORDER; - case PIPE_TEX_WRAP_MIRROR_REPEAT: + case PIPE_TEX_WRAP_MIRROR_REPEAT: return SVGA3D_TEX_ADDRESS_MIRROR; - case PIPE_TEX_WRAP_MIRROR_CLAMP: - case PIPE_TEX_WRAP_MIRROR_CLAMP_TO_EDGE: - case PIPE_TEX_WRAP_MIRROR_CLAMP_TO_BORDER: + case PIPE_TEX_WRAP_MIRROR_CLAMP: + case PIPE_TEX_WRAP_MIRROR_CLAMP_TO_EDGE: + case PIPE_TEX_WRAP_MIRROR_CLAMP_TO_BORDER: return SVGA3D_TEX_ADDRESS_MIRRORONCE; default: @@ -96,7 +96,7 @@ svga_create_sampler_state(struct pipe_context *pipe, { struct svga_context *svga = svga_context(pipe); struct svga_sampler_state *cso = CALLOC_STRUCT( svga_sampler_state ); - + cso->mipfilter = translate_mip_filter(sampler->min_mip_filter); cso->magfilter = translate_img_filter( sampler->mag_img_filter ); cso->minfilter = translate_img_filter( sampler->min_img_filter ); @@ -243,12 +243,12 @@ static void svga_set_sampler_views(struct pipe_context *pipe, svga->dirty |= SVGA_NEW_TEXTURE_BINDING; if (flag_srgb != svga->curr.tex_flags.flag_srgb || - flag_1d != svga->curr.tex_flags.flag_1d) + flag_1d != svga->curr.tex_flags.flag_1d) { svga->dirty |= SVGA_NEW_TEXTURE_FLAGS; svga->curr.tex_flags.flag_1d = flag_1d; svga->curr.tex_flags.flag_srgb = flag_srgb; - } + } } diff --git a/src/gallium/drivers/svga/svga_pipe_vertex.c b/src/gallium/drivers/svga/svga_pipe_vertex.c index 86c7945..497449e 100644 --- a/src/gallium/drivers/svga/svga_pipe_vertex.c +++ b/src/gallium/drivers/svga/svga_pipe_vertex.c @@ -118,7 +118,7 @@ static void svga_delete_vertex_elements_state(struct pipe_context *pipe, void svga_cleanup_vertex_state( struct svga_context *svga ) { unsigned i; - + for (i = 0 ; i < svga->curr.num_vertex_buffers; i++) pipe_resource_reference(&svga->curr.vb[i].buffer, NULL); } diff --git a/src/gallium/drivers/svga/svga_pipe_vs.c b/src/gallium/drivers/svga/svga_pipe_vs.c index de8c919..b17a6e2 100644 --- a/src/gallium/drivers/svga/svga_pipe_vs.c +++ b/src/gallium/drivers/svga/svga_pipe_vs.c @@ -39,7 +39,7 @@ #include "svga_debug.h" -static const struct tgsi_token *substitute_vs( +static const struct tgsi_token *substitute_vs( unsigned shader_id, const struct tgsi_token *old_tokens ) { @@ -47,7 +47,7 @@ static const struct tgsi_token *substitute_vs( if (shader_id == 12) { static struct tgsi_token tokens[300]; - const char *text = + const char *text = "VERT\n" "DCL IN[0]\n" "DCL IN[1]\n" @@ -93,7 +93,7 @@ static const struct tgsi_token *substitute_vs( /*********************************************************************** - * Vertex shaders + * Vertex shaders */ static void * @@ -157,16 +157,16 @@ static void svga_delete_vs_state(struct pipe_context *pipe, void *shader) svga_hwtnl_flush_retry( svga ); draw_delete_vertex_shader(svga->swtnl.draw, vs->draw_shader); - + for (result = vs->base.results; result; result = tmp ) { tmp = result->next; - ret = SVGA3D_DestroyShader(svga->swc, + ret = SVGA3D_DestroyShader(svga->swc, result->id, SVGA3D_SHADERTYPE_VS ); if(ret != PIPE_OK) { svga_context_flush(svga, NULL); - ret = SVGA3D_DestroyShader(svga->swc, + ret = SVGA3D_DestroyShader(svga->swc, result->id, SVGA3D_SHADERTYPE_VS ); assert(ret == PIPE_OK); diff --git a/src/gallium/drivers/svga/svga_resource.h b/src/gallium/drivers/svga/svga_resource.h index 851e3b5..356a03a 100644 --- a/src/gallium/drivers/svga/svga_resource.h +++ b/src/gallium/drivers/svga/svga_resource.h @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ #ifndef SVGA_RESOURCE_H diff --git a/src/gallium/drivers/svga/svga_resource_buffer.c b/src/gallium/drivers/svga/svga_resource_buffer.c index f12e2b6..cf63bbe 100644 --- a/src/gallium/drivers/svga/svga_resource_buffer.c +++ b/src/gallium/drivers/svga/svga_resource_buffer.c @@ -94,7 +94,7 @@ svga_buffer_map_range( struct pipe_screen *screen, unsigned length, unsigned usage ) { - struct svga_screen *ss = svga_screen(screen); + struct svga_screen *ss = svga_screen(screen); struct svga_winsys_screen *sws = ss->sws; struct svga_buffer *sbuf = svga_buffer( buf ); void *map; @@ -134,20 +134,20 @@ svga_buffer_map_range( struct pipe_screen *screen, sbuf->map.flush_explicit = TRUE; } } - + return map; } -static void +static void svga_buffer_flush_mapped_range( struct pipe_screen *screen, struct pipe_resource *buf, unsigned offset, unsigned length) { struct svga_buffer *sbuf = svga_buffer( buf ); struct svga_screen *ss = svga_screen(screen); - + pipe_mutex_lock(ss->swc_mutex); assert(sbuf->map.writing); if(sbuf->map.writing) { @@ -157,16 +157,16 @@ svga_buffer_flush_mapped_range( struct pipe_screen *screen, pipe_mutex_unlock(ss->swc_mutex); } -static void +static void svga_buffer_unmap( struct pipe_screen *screen, struct pipe_resource *buf) { - struct svga_screen *ss = svga_screen(screen); + struct svga_screen *ss = svga_screen(screen); struct svga_winsys_screen *sws = ss->sws; struct svga_buffer *sbuf = svga_buffer( buf ); - + pipe_mutex_lock(ss->swc_mutex); - + assert(sbuf->map.count); if(sbuf->map.count) --sbuf->map.count; @@ -178,10 +178,10 @@ svga_buffer_unmap( struct pipe_screen *screen, if(!sbuf->map.flush_explicit) { /* No mapped range was flushed -- flush the whole buffer */ SVGA_DBG(DEBUG_DMA, "flushing the whole buffer\n"); - + svga_buffer_add_range(sbuf, 0, sbuf->b.b.width0); } - + sbuf->map.writing = FALSE; sbuf->map.flush_explicit = FALSE; } @@ -195,25 +195,25 @@ static void svga_buffer_destroy( struct pipe_screen *screen, struct pipe_resource *buf ) { - struct svga_screen *ss = svga_screen(screen); + struct svga_screen *ss = svga_screen(screen); struct svga_buffer *sbuf = svga_buffer( buf ); assert(!p_atomic_read(&buf->reference.count)); - + assert(!sbuf->dma.pending); if(sbuf->handle) svga_buffer_destroy_host_surface(ss, sbuf); - + if(sbuf->uploaded.buffer) pipe_resource_reference(&sbuf->uploaded.buffer, NULL); if(sbuf->hwbuf) svga_buffer_destroy_hw_storage(ss, sbuf); - + if(sbuf->swbuf && !sbuf->user) align_free(sbuf->swbuf); - + FREE(sbuf); } @@ -267,7 +267,7 @@ static void svga_buffer_transfer_unmap( struct pipe_context *pipe, -struct u_resource_vtbl svga_buffer_vtbl = +struct u_resource_vtbl svga_buffer_vtbl = { u_default_resource_get_handle, /* get_handle */ svga_buffer_destroy, /* resource_destroy */ @@ -288,11 +288,11 @@ svga_buffer_create(struct pipe_screen *screen, { struct svga_screen *ss = svga_screen(screen); struct svga_buffer *sbuf; - + sbuf = CALLOC_STRUCT(svga_buffer); if(!sbuf) goto error1; - + sbuf->b.b = *template; sbuf->b.vtbl = &svga_buffer_vtbl; pipe_reference_init(&sbuf->b.b.reference, 1); @@ -307,8 +307,8 @@ svga_buffer_create(struct pipe_screen *screen, if(!sbuf->swbuf) goto error2; } - - return &sbuf->b.b; + + return &sbuf->b.b; error2: FREE(sbuf); @@ -323,11 +323,11 @@ svga_user_buffer_create(struct pipe_screen *screen, unsigned bind) { struct svga_buffer *sbuf; - + sbuf = CALLOC_STRUCT(svga_buffer); if(!sbuf) goto no_sbuf; - + pipe_reference_init(&sbuf->b.b.reference, 1); sbuf->b.vtbl = &svga_buffer_vtbl; sbuf->b.b.screen = screen; @@ -341,8 +341,8 @@ svga_user_buffer_create(struct pipe_screen *screen, sbuf->swbuf = ptr; sbuf->user = TRUE; - - return &sbuf->b.b; + + return &sbuf->b.b; no_sbuf: return NULL; diff --git a/src/gallium/drivers/svga/svga_resource_buffer.h b/src/gallium/drivers/svga/svga_resource_buffer.h index d3ec11b..384b482 100644 --- a/src/gallium/drivers/svga/svga_resource_buffer.h +++ b/src/gallium/drivers/svga/svga_resource_buffer.h @@ -60,36 +60,36 @@ struct svga_buffer_range /** * SVGA pipe buffer. */ -struct svga_buffer +struct svga_buffer { struct u_resource b; /** * Regular (non DMA'able) memory. - * + * * Used for user buffers or for buffers which we know before hand that can * never be used by the virtual hardware directly, such as constant buffers. */ void *swbuf; - - /** + + /** * Whether swbuf was created by the user or not. */ boolean user; - + /** * Creation key for the host surface handle. - * - * This structure describes all the host surface characteristics so that it + * + * This structure describes all the host surface characteristics so that it * can be looked up in cache, since creating a host surface is often a slow * operation. */ struct svga_host_surface_cache_key key; - + /** * Host surface handle. - * - * This is a platform independent abstraction for host SID. We create when + * + * This is a platform independent abstraction for host SID. We create when * trying to bind */ struct svga_winsys_surface *handle; @@ -200,7 +200,7 @@ svga_buffer(struct pipe_resource *buffer) * Returns TRUE for user buffers. We may * decide to use an alternate upload path for these buffers. */ -static INLINE boolean +static INLINE boolean svga_buffer_is_user_buffer( struct pipe_resource *buffer ) { return svga_buffer(buffer)->user; @@ -239,7 +239,7 @@ svga_context_flush_buffers(struct svga_context *svga); struct svga_winsys_buffer * svga_winsys_buffer_create(struct svga_context *svga, - unsigned alignment, + unsigned alignment, unsigned usage, unsigned size); diff --git a/src/gallium/drivers/svga/svga_resource_buffer_upload.c b/src/gallium/drivers/svga/svga_resource_buffer_upload.c index 3de5216..e66f1b8 100644 --- a/src/gallium/drivers/svga/svga_resource_buffer_upload.c +++ b/src/gallium/drivers/svga/svga_resource_buffer_upload.c @@ -49,26 +49,26 @@ */ struct svga_winsys_buffer * svga_winsys_buffer_create( struct svga_context *svga, - unsigned alignment, + unsigned alignment, unsigned usage, unsigned size ) { struct svga_screen *svgascreen = svga_screen(svga->pipe.screen); struct svga_winsys_screen *sws = svgascreen->sws; struct svga_winsys_buffer *buf; - + /* Just try */ buf = sws->buffer_create(sws, alignment, usage, size); if(!buf) { - SVGA_DBG(DEBUG_DMA|DEBUG_PERF, "flushing screen to find %d bytes GMR\n", - size); - + SVGA_DBG(DEBUG_DMA|DEBUG_PERF, "flushing screen to find %d bytes GMR\n", + size); + /* Try flushing all pending DMAs */ svga_context_flush(svga, NULL); buf = sws->buffer_create(sws, alignment, usage, size); } - + return buf; } @@ -89,8 +89,8 @@ svga_buffer_destroy_hw_storage(struct svga_screen *ss, struct svga_buffer *sbuf) /** - * Allocate DMA'ble storage for the buffer. - * + * Allocate DMA'ble storage for the buffer. + * * Called before mapping a buffer. */ enum pipe_error @@ -104,14 +104,14 @@ svga_buffer_create_hw_storage(struct svga_screen *ss, unsigned alignment = 16; unsigned usage = 0; unsigned size = sbuf->b.b.width0; - + sbuf->hwbuf = sws->buffer_create(sws, alignment, usage, size); if(!sbuf->hwbuf) return PIPE_ERROR_OUT_OF_MEMORY; - + assert(!sbuf->dma.pending); } - + return PIPE_OK; } @@ -123,27 +123,27 @@ svga_buffer_create_host_surface(struct svga_screen *ss, { if(!sbuf->handle) { sbuf->key.flags = 0; - + sbuf->key.format = SVGA3D_BUFFER; if(sbuf->b.b.bind & PIPE_BIND_VERTEX_BUFFER) sbuf->key.flags |= SVGA3D_SURFACE_HINT_VERTEXBUFFER; if(sbuf->b.b.bind & PIPE_BIND_INDEX_BUFFER) sbuf->key.flags |= SVGA3D_SURFACE_HINT_INDEXBUFFER; - + sbuf->key.size.width = sbuf->b.b.width0; sbuf->key.size.height = 1; sbuf->key.size.depth = 1; - + sbuf->key.numFaces = 1; sbuf->key.numMipLevels = 1; sbuf->key.cachable = 1; - + SVGA_DBG(DEBUG_DMA, "surface_create for buffer sz %d\n", sbuf->b.b.width0); sbuf->handle = svga_screen_surface_create(ss, &sbuf->key); if(!sbuf->handle) return PIPE_ERROR_OUT_OF_MEMORY; - + /* Always set the discard flag on the first time the buffer is written * as svga_screen_surface_create might have passed a recycled host * buffer. @@ -152,9 +152,9 @@ svga_buffer_create_host_surface(struct svga_screen *ss, SVGA_DBG(DEBUG_DMA, " --> got sid %p sz %d (buffer)\n", sbuf->handle, sbuf->b.b.width0); } - + return PIPE_OK; -} +} void @@ -165,7 +165,7 @@ svga_buffer_destroy_host_surface(struct svga_screen *ss, SVGA_DBG(DEBUG_DMA, " ungrab sid %p sz %d\n", sbuf->handle, sbuf->b.b.width0); svga_screen_surface_destroy(ss, &sbuf->key, &sbuf->handle); } -} +} /** @@ -249,12 +249,12 @@ svga_buffer_upload_flush(struct svga_context *svga, SVGA3dCopyBox *boxes; unsigned i; - assert(sbuf->handle); + assert(sbuf->handle); assert(sbuf->hwbuf); assert(sbuf->map.num_ranges); assert(sbuf->dma.svga == svga); assert(sbuf->dma.boxes); - + /* * Patch the DMA command with the final copy box. */ @@ -282,7 +282,7 @@ svga_buffer_upload_flush(struct svga_context *svga, assert(sbuf->head.prev && sbuf->head.next); LIST_DEL(&sbuf->head); #ifdef DEBUG - sbuf->head.next = sbuf->head.prev = NULL; + sbuf->head.next = sbuf->head.prev = NULL; #endif sbuf->dma.pending = FALSE; @@ -302,7 +302,7 @@ svga_buffer_upload_flush(struct svga_context *svga, * This function only notes the range down. It doesn't actually emit a DMA * upload command. That only happens when a context tries to refer to this * buffer, and the DMA upload command is added to that context's command buffer. - * + * * We try to lump as many contiguous DMA transfers together as possible. */ void @@ -315,7 +315,7 @@ svga_buffer_add_range(struct svga_buffer *sbuf, unsigned nearest_dist; assert(end > start); - + if (sbuf->map.num_ranges < SVGA_BUFFER_MAX_RANGES) { nearest_range = sbuf->map.num_ranges; nearest_dist = ~0; @@ -411,11 +411,11 @@ svga_buffer_update_hw(struct svga_screen *ss, struct svga_buffer *sbuf) if(!sbuf->hwbuf) { enum pipe_error ret; void *map; - + assert(sbuf->swbuf); if(!sbuf->swbuf) return PIPE_ERROR; - + ret = svga_buffer_create_hw_storage(ss, sbuf); if(ret != PIPE_OK) return ret; @@ -441,10 +441,10 @@ svga_buffer_update_hw(struct svga_screen *ss, struct svga_buffer *sbuf) align_free(sbuf->swbuf); sbuf->swbuf = NULL; } - + pipe_mutex_unlock(ss->swc_mutex); } - + return PIPE_OK; } @@ -547,10 +547,10 @@ svga_buffer_handle(struct svga_context *svga, return NULL; sbuf = svga_buffer(buf); - + assert(!sbuf->map.count); assert(!sbuf->user); - + if(!sbuf->handle) { ret = svga_buffer_create_host_surface(ss, sbuf); if(ret != PIPE_OK) @@ -631,10 +631,10 @@ svga_context_flush_buffers(struct svga_context *svga) assert(p_atomic_read(&sbuf->b.b.reference.count) != 0); assert(sbuf->dma.pending); - + svga_buffer_upload_flush(svga, sbuf); - curr = next; + curr = next; next = curr->next; } } diff --git a/src/gallium/drivers/svga/svga_resource_texture.c b/src/gallium/drivers/svga/svga_resource_texture.c index 7c9e600..e52ff9e 100644 --- a/src/gallium/drivers/svga/svga_resource_texture.c +++ b/src/gallium/drivers/svga/svga_resource_texture.c @@ -81,7 +81,7 @@ SVGA3dSurfaceFormat svga_translate_format(enum pipe_format format) { switch(format) { - + case PIPE_FORMAT_B8G8R8A8_UNORM: return SVGA3D_A8R8G8B8; case PIPE_FORMAT_B8G8R8X8_UNORM: @@ -99,7 +99,7 @@ svga_translate_format(enum pipe_format format) case PIPE_FORMAT_B4G4R4A4_UNORM: return SVGA3D_A4R4G4B4; - + /* XXX: Doesn't seem to work properly. case PIPE_FORMAT_Z32_UNORM: return SVGA3D_Z_D32; @@ -133,7 +133,7 @@ svga_translate_format(enum pipe_format format) SVGA3dSurfaceFormat svga_translate_format_render(enum pipe_format format) { - switch(format) { + switch(format) { case PIPE_FORMAT_B8G8R8A8_UNORM: case PIPE_FORMAT_B8G8R8X8_UNORM: case PIPE_FORMAT_B5G5R5A1_UNORM: @@ -168,10 +168,10 @@ svga_transfer_dma_band(struct svga_context *svga, SVGA3dTransferType transfer, unsigned y, unsigned h, unsigned srcy) { - struct svga_texture *texture = svga_texture(st->base.resource); + struct svga_texture *texture = svga_texture(st->base.resource); SVGA3dCopyBox box; enum pipe_error ret; - + box.x = st->base.box.x; box.y = y; box.z = st->base.box.z; @@ -190,7 +190,7 @@ svga_transfer_dma_band(struct svga_context *svga, st->face = 0; SVGA_DBG(DEBUG_DMA, "dma %s sid %p, face %u, (%u, %u, %u) - (%u, %u, %u), %ubpp\n", - transfer == SVGA3D_WRITE_HOST_VRAM ? "to" : "from", + transfer == SVGA3D_WRITE_HOST_VRAM ? "to" : "from", texture->handle, st->face, st->base.box.x, @@ -216,7 +216,7 @@ svga_transfer_dma(struct svga_context *svga, struct svga_transfer *st, SVGA3dTransferType transfer) { - struct svga_texture *texture = svga_texture(st->base.resource); + struct svga_texture *texture = svga_texture(st->base.resource); struct svga_screen *screen = svga_screen(texture->b.b.screen); struct svga_winsys_screen *sws = screen->sws; struct pipe_fence_handle *fence = NULL; @@ -296,7 +296,7 @@ svga_transfer_dma(struct svga_context *svga, -static boolean +static boolean svga_texture_get_handle(struct pipe_screen *screen, struct pipe_resource *texture, struct winsys_handle *whandle) @@ -374,12 +374,12 @@ svga_texture_get_transfer(struct pipe_context *pipe, st->hw_nblocksy = nblocksy; st->hwbuf = svga_winsys_buffer_create(svga, - 1, + 1, 0, st->hw_nblocksy*st->base.stride); while(!st->hwbuf && (st->hw_nblocksy /= 2)) { st->hwbuf = svga_winsys_buffer_create(svga, - 1, + 1, 0, st->hw_nblocksy*st->base.stride); } @@ -388,7 +388,7 @@ svga_texture_get_transfer(struct pipe_context *pipe, goto no_hwbuf; if(st->hw_nblocksy < nblocksy) { - /* We couldn't allocate a hardware buffer big enough for the transfer, + /* We couldn't allocate a hardware buffer big enough for the transfer, * so allocate regular malloc memory instead */ debug_printf("%s: failed to allocate %u KB of DMA, splitting into %u x %u KB DMA transfers\n", __FUNCTION__, @@ -443,7 +443,7 @@ svga_texture_transfer_unmap(struct pipe_context *pipe, struct svga_screen *ss = svga_screen(pipe->screen); struct svga_winsys_screen *sws = ss->sws; struct svga_transfer *st = svga_transfer(transfer); - + if(!st->swbuf) sws->buffer_unmap(sws, st->hwbuf); } @@ -479,7 +479,7 @@ svga_texture_transfer_destroy(struct pipe_context *pipe, -struct u_resource_vtbl svga_texture_vtbl = +struct u_resource_vtbl svga_texture_vtbl = { svga_texture_get_handle, /* get_handle */ svga_texture_destroy, /* resource_destroy */ @@ -513,7 +513,7 @@ svga_texture_create(struct pipe_screen *screen, assert(template->last_level < SVGA_MAX_TEXTURE_LEVELS); if(template->last_level >= SVGA_MAX_TEXTURE_LEVELS) goto error2; - + tex->key.flags = 0; tex->key.size.width = template->width0; tex->key.size.height = template->height0; @@ -544,8 +544,8 @@ svga_texture_create(struct pipe_screen *screen, tex->key.flags |= SVGA3D_SURFACE_HINT_SCANOUT; tex->key.cachable = 0; } - - /* + + /* * XXX: Never pass the SVGA3D_SURFACE_HINT_RENDERTARGET hint. Mesa cannot * know beforehand whether a texture will be used as a rendertarget or not * and it always requests PIPE_BIND_RENDER_TARGET, therefore @@ -556,12 +556,12 @@ svga_texture_create(struct pipe_screen *screen, !util_format_is_s3tc(template->format)) tex->key.flags |= SVGA3D_SURFACE_HINT_RENDERTARGET; #endif - + if(template->bind & PIPE_BIND_DEPTH_STENCIL) tex->key.flags |= SVGA3D_SURFACE_HINT_DEPTHSTENCIL; - + tex->key.numMipLevels = template->last_level + 1; - + tex->key.format = svga_translate_format(template->format); if(tex->key.format == SVGA3D_FORMAT_INVALID) goto error2; diff --git a/src/gallium/drivers/svga/svga_resource_texture.h b/src/gallium/drivers/svga/svga_resource_texture.h index 9a2911c..94e8916 100644 --- a/src/gallium/drivers/svga/svga_resource_texture.h +++ b/src/gallium/drivers/svga/svga_resource_texture.h @@ -46,12 +46,12 @@ enum SVGA3dSurfaceFormat; extern struct u_resource_vtbl svga_texture_vtbl; -struct svga_texture +struct svga_texture { struct u_resource b; boolean defined[6][SVGA_MAX_TEXTURE_LEVELS]; - + struct svga_sampler_view *cached_view; unsigned view_age[SVGA_MAX_TEXTURE_LEVELS]; @@ -61,8 +61,8 @@ struct svga_texture /** * Creation key for the host surface handle. - * - * This structure describes all the host surface characteristics so that it + * + * This structure describes all the host surface characteristics so that it * can be looked up in cache, since creating a host surface is often a slow * operation. */ diff --git a/src/gallium/drivers/svga/svga_sampler_view.c b/src/gallium/drivers/svga/svga_sampler_view.c index 6911f13..794cf28 100644 --- a/src/gallium/drivers/svga/svga_sampler_view.c +++ b/src/gallium/drivers/svga/svga_sampler_view.c @@ -47,7 +47,7 @@ svga_get_tex_sampler_view(struct pipe_context *pipe, unsigned min_lod, unsigned max_lod) { struct svga_screen *ss = svga_screen(pt->screen); - struct svga_texture *tex = svga_texture(pt); + struct svga_texture *tex = svga_texture(pt); struct svga_sampler_view *sv = NULL; SVGA3dSurfaceFormat format = svga_translate_format(pt->format); boolean view = TRUE; diff --git a/src/gallium/drivers/svga/svga_screen.c b/src/gallium/drivers/svga/svga_screen.c index 0781903..3fc4acc 100644 --- a/src/gallium/drivers/svga/svga_screen.c +++ b/src/gallium/drivers/svga/svga_screen.c @@ -294,7 +294,7 @@ static INLINE SVGA3dDevCapIndex svga_translate_format_cap(enum pipe_format format) { switch(format) { - + case PIPE_FORMAT_B8G8R8A8_UNORM: return SVGA3D_DEVCAP_SURFACEFMT_A8R8G8B8; case PIPE_FORMAT_B8G8R8X8_UNORM: @@ -352,7 +352,7 @@ svga_is_format_supported( struct pipe_screen *screen, /* Override host capabilities */ if (tex_usage & PIPE_BIND_RENDER_TARGET) { - switch(format) { + switch(format) { /* Often unsupported/problematic. This means we end up with the same * visuals for all virtual hardware implementations. @@ -360,7 +360,7 @@ svga_is_format_supported( struct pipe_screen *screen, case PIPE_FORMAT_B4G4R4A4_UNORM: case PIPE_FORMAT_B5G5R5A1_UNORM: return FALSE; - + /* Simulate ability to render into compressed textures */ case PIPE_FORMAT_DXT1_RGB: case PIPE_FORMAT_DXT1_RGBA: @@ -372,14 +372,14 @@ svga_is_format_supported( struct pipe_screen *screen, break; } } - + /* Try to query the host */ index = svga_translate_format_cap(format); - if( index < SVGA3D_DEVCAP_MAX && + if( index < SVGA3D_DEVCAP_MAX && sws->get_cap(sws, index, &result) ) { SVGA3dSurfaceFormatCaps mask; - + mask.value = 0; if (tex_usage & PIPE_BIND_RENDER_TARGET) mask.offscreenRenderTarget = 1; @@ -443,14 +443,14 @@ static void svga_destroy_screen( struct pipe_screen *screen ) { struct svga_screen *svgascreen = svga_screen(screen); - + svga_screen_cache_cleanup(svgascreen); pipe_mutex_destroy(svgascreen->swc_mutex); pipe_mutex_destroy(svgascreen->tex_mutex); svgascreen->sws->destroy(svgascreen->sws); - + FREE(svgascreen); } diff --git a/src/gallium/drivers/svga/svga_screen.h b/src/gallium/drivers/svga/svga_screen.h index 86ec89d..b0048fe 100644 --- a/src/gallium/drivers/svga/svga_screen.h +++ b/src/gallium/drivers/svga/svga_screen.h @@ -51,7 +51,7 @@ struct svga_screen unsigned use_ps30; unsigned use_vs30; - + struct { boolean force_level_surface_view; boolean force_surface_view; @@ -61,7 +61,7 @@ struct svga_screen } debug; unsigned texture_timestamp; - pipe_mutex tex_mutex; + pipe_mutex tex_mutex; pipe_mutex swc_mutex; /* Used for buffer uploads */ diff --git a/src/gallium/drivers/svga/svga_screen_cache.c b/src/gallium/drivers/svga/svga_screen_cache.c index eff36e0..683f312 100644 --- a/src/gallium/drivers/svga/svga_screen_cache.c +++ b/src/gallium/drivers/svga/svga_screen_cache.c @@ -35,8 +35,8 @@ #define SVGA_SURFACE_CACHE_ENABLED 1 -/** - * Compute the bucket for this key. +/** + * Compute the bucket for this key. */ static INLINE unsigned svga_screen_cache_bucket(const struct svga_host_surface_cache_key *key) @@ -67,37 +67,37 @@ svga_screen_cache_lookup(struct svga_screen *svgascreen, next = curr->next; while(curr != &cache->bucket[bucket]) { ++tries; - + entry = LIST_ENTRY(struct svga_host_surface_cache_entry, curr, bucket_head); assert(entry->handle); - + if(memcmp(&entry->key, key, sizeof *key) == 0 && sws->fence_signalled( sws, entry->fence, 0 ) == 0) { assert(sws->surface_is_flushed(sws, entry->handle)); - + handle = entry->handle; // Reference is transfered here. entry->handle = NULL; - + LIST_DEL(&entry->bucket_head); LIST_DEL(&entry->head); - + LIST_ADD(&entry->head, &cache->empty); break; } - curr = next; + curr = next; next = curr->next; } pipe_mutex_unlock(cache->mutex); - + if (SVGA_DEBUG & DEBUG_DMA) - debug_printf("%s: cache %s after %u tries (bucket %d)\n", __FUNCTION__, + debug_printf("%s: cache %s after %u tries (bucket %d)\n", __FUNCTION__, handle ? "hit" : "miss", tries, bucket); - + return handle; } @@ -105,30 +105,30 @@ svga_screen_cache_lookup(struct svga_screen *svgascreen, /* * Transfers a handle reference. */ - + static INLINE void svga_screen_cache_add(struct svga_screen *svgascreen, - const struct svga_host_surface_cache_key *key, + const struct svga_host_surface_cache_key *key, struct svga_winsys_surface **p_handle) { struct svga_host_surface_cache *cache = &svgascreen->cache; struct svga_winsys_screen *sws = svgascreen->sws; struct svga_host_surface_cache_entry *entry = NULL; struct svga_winsys_surface *handle = *p_handle; - + assert(key->cachable); assert(handle); if(!handle) return; - + *p_handle = NULL; pipe_mutex_lock(cache->mutex); - + if(!LIST_IS_EMPTY(&cache->empty)) { /* use the first empty entry */ entry = LIST_ENTRY(struct svga_host_surface_cache_entry, cache->empty.next, head); - + LIST_DEL(&entry->head); } else if(!LIST_IS_EMPTY(&cache->unused)) { @@ -146,7 +146,7 @@ svga_screen_cache_add(struct svga_screen *svgascreen, if(entry) { entry->handle = handle; memcpy(&entry->key, key, sizeof entry->key); - + SVGA_DBG(DEBUG_CACHE|DEBUG_DMA, "cache sid %p\n", entry->handle); LIST_ADD(&entry->head, &cache->validated); @@ -157,7 +157,7 @@ svga_screen_cache_add(struct svga_screen *svgascreen, "unref sid %p (couldn't find space)\n", handle); sws->surface_reference(sws, &handle, NULL); } - + pipe_mutex_unlock(cache->mutex); } @@ -187,7 +187,7 @@ svga_screen_cache_flush(struct svga_screen *svgascreen, if(sws->surface_is_flushed(sws, entry->handle)) { LIST_DEL(&entry->head); - + svgascreen->sws->fence_reference(svgascreen->sws, &entry->fence, fence); LIST_ADD(&entry->head, &cache->unused); @@ -196,7 +196,7 @@ svga_screen_cache_flush(struct svga_screen *svgascreen, LIST_ADD(&entry->bucket_head, &cache->bucket[bucket]); } - curr = next; + curr = next; next = curr->next; } @@ -210,7 +210,7 @@ svga_screen_cache_cleanup(struct svga_screen *svgascreen) struct svga_host_surface_cache *cache = &svgascreen->cache; struct svga_winsys_screen *sws = svgascreen->sws; unsigned i; - + for(i = 0; i < SVGA_HOST_SURFACE_CACHE_SIZE; ++i) { if(cache->entries[i].handle) { SVGA_DBG(DEBUG_CACHE|DEBUG_DMA, @@ -221,7 +221,7 @@ svga_screen_cache_cleanup(struct svga_screen *svgascreen) if(cache->entries[i].fence) svgascreen->sws->fence_reference(svgascreen->sws, &cache->entries[i].fence, NULL); } - + pipe_mutex_destroy(cache->mutex); } @@ -233,14 +233,14 @@ svga_screen_cache_init(struct svga_screen *svgascreen) unsigned i; pipe_mutex_init(cache->mutex); - + for(i = 0; i < SVGA_HOST_SURFACE_CACHE_BUCKETS; ++i) LIST_INITHEAD(&cache->bucket[i]); LIST_INITHEAD(&cache->unused); - + LIST_INITHEAD(&cache->validated); - + LIST_INITHEAD(&cache->empty); for(i = 0; i < SVGA_HOST_SURFACE_CACHE_SIZE; ++i) LIST_ADDTAIL(&cache->entries[i].head, &cache->empty); @@ -248,7 +248,7 @@ svga_screen_cache_init(struct svga_screen *svgascreen) return PIPE_OK; } - + struct svga_winsys_surface * svga_screen_surface_create(struct svga_screen *svgascreen, struct svga_host_surface_cache_key *key) @@ -258,7 +258,7 @@ svga_screen_surface_create(struct svga_screen *svgascreen, boolean cachable = SVGA_SURFACE_CACHE_ENABLED && key->cachable; SVGA_DBG(DEBUG_CACHE|DEBUG_DMA, - "%s sz %dx%dx%d mips %d faces %d cachable %d\n", + "%s sz %dx%dx%d mips %d faces %d cachable %d\n", __FUNCTION__, key->size.width, key->size.height, @@ -292,11 +292,11 @@ svga_screen_surface_create(struct svga_screen *svgascreen, if (handle) { if (key->format == SVGA3D_BUFFER) SVGA_DBG(DEBUG_CACHE|DEBUG_DMA, - "reuse sid %p sz %d (buffer)\n", handle, + "reuse sid %p sz %d (buffer)\n", handle, key->size.width); else SVGA_DBG(DEBUG_CACHE|DEBUG_DMA, - "reuse sid %p sz %dx%dx%d mips %d faces %d\n", handle, + "reuse sid %p sz %dx%dx%d mips %d faces %d\n", handle, key->size.width, key->size.height, key->size.depth, @@ -309,13 +309,13 @@ svga_screen_surface_create(struct svga_screen *svgascreen, handle = sws->surface_create(sws, key->flags, key->format, - key->size, - key->numFaces, + key->size, + key->numFaces, key->numMipLevels); if (handle) SVGA_DBG(DEBUG_CACHE|DEBUG_DMA, - " CREATE sid %p sz %dx%dx%d\n", - handle, + " CREATE sid %p sz %dx%dx%d\n", + handle, key->size.width, key->size.height, key->size.depth); @@ -331,7 +331,7 @@ svga_screen_surface_destroy(struct svga_screen *svgascreen, struct svga_winsys_surface **p_handle) { struct svga_winsys_screen *sws = svgascreen->sws; - + /* We only set the cachable flag for surfaces of which we are the * exclusive owner. So just hold onto our existing reference in * that case. diff --git a/src/gallium/drivers/svga/svga_screen_cache.h b/src/gallium/drivers/svga/svga_screen_cache.h index 62156e3..062caec 100644 --- a/src/gallium/drivers/svga/svga_screen_cache.h +++ b/src/gallium/drivers/svga/svga_screen_cache.h @@ -38,7 +38,7 @@ /* Guess the storage size of cached surfaces and try and keep it under * this amount: - */ + */ #define SVGA_HOST_SURFACE_CACHE_BYTES 16*1024*1024 /* Maximum number of discrete surfaces in the cache: @@ -67,51 +67,51 @@ struct svga_host_surface_cache_key }; -struct svga_host_surface_cache_entry +struct svga_host_surface_cache_entry { - /** + /** * Head for the LRU list, svga_host_surface_cache::unused, and * svga_host_surface_cache::empty */ struct list_head head; - + /** Head for the bucket lists. */ struct list_head bucket_head; struct svga_host_surface_cache_key key; struct svga_winsys_surface *handle; - + struct pipe_fence_handle *fence; }; /** * Cache of the host surfaces. - * + * * A cache entry can be in the following stages: * 1. empty * 2. holding a buffer in a validate list * 3. holding a flushed buffer (not in any validate list) with an active fence * 4. holding a flushed buffer with an expired fence - * - * An entry progresses from 1 -> 2 -> 3 -> 4. When we need an entry to put a - * buffer into we preferencial take from 1, or from the least recentely used + * + * An entry progresses from 1 -> 2 -> 3 -> 4. When we need an entry to put a + * buffer into we preferencial take from 1, or from the least recentely used * buffer from 3/4. */ -struct svga_host_surface_cache +struct svga_host_surface_cache { pipe_mutex mutex; - + /* Unused buffers are put in buckets to speed up lookups */ struct list_head bucket[SVGA_HOST_SURFACE_CACHE_BUCKETS]; - - /* Entries with unused buffers, ordered from most to least recently used + + /* Entries with unused buffers, ordered from most to least recently used * (3 and 4) */ struct list_head unused; - + /* Entries with buffers still in validate lists (2) */ struct list_head validated; - + /** Empty entries (1) */ struct list_head empty; diff --git a/src/gallium/drivers/svga/svga_state.c b/src/gallium/drivers/svga/svga_state.c index 1c21d3a..1de2c16 100644 --- a/src/gallium/drivers/svga/svga_state.c +++ b/src/gallium/drivers/svga/svga_state.c @@ -87,7 +87,7 @@ static const struct svga_tracked_state *swtnl_draw_state[] = /* Flattens the graph of state dependencies. Could swap the positions * of hw_clear_state and need_swtnl_state without breaking anything. */ -static const struct svga_tracked_state **state_levels[] = +static const struct svga_tracked_state **state_levels[] = { need_swtnl_state, hw_clear_state, @@ -136,15 +136,15 @@ static int update_state( struct svga_context *svga, * state flags which are generated and checked to help ensure * state atoms are ordered correctly in the list. */ - unsigned examined, prev; + unsigned examined, prev; examined = 0; prev = *state; - for (i = 0; atoms[i] != NULL; i++) { + for (i = 0; atoms[i] != NULL; i++) { unsigned generated; - assert(atoms[i]->dirty); + assert(atoms[i]->dirty); assert(atoms[i]->update); if (check_state(*state, atoms[i]->dirty)) { @@ -161,17 +161,17 @@ static int update_state( struct svga_context *svga, */ xor_states(&generated, prev, *state); if (check_state(examined, generated)) { - debug_printf("state atom %s generated state already examined\n", + debug_printf("state atom %s generated state already examined\n", atoms[i]->name); assert(0); } - + prev = *state; accumulate_state(&examined, atoms[i]->dirty); } } else { - for (i = 0; atoms[i] != NULL; i++) { + for (i = 0; atoms[i] != NULL; i++) { if (check_state(*state, atoms[i]->dirty)) { ret = atoms[i]->update( svga, *state ); if (ret != 0) @@ -205,8 +205,8 @@ int svga_update_state( struct svga_context *svga, svga->dirty |= svga->state.dirty[i]; if (svga->dirty) { - ret = update_state( svga, - state_levels[i], + ret = update_state( svga, + state_levels[i], &svga->dirty ); if (ret != 0) return ret; @@ -214,8 +214,8 @@ int svga_update_state( struct svga_context *svga, svga->state.dirty[i] = 0; } } - - for (; i < SVGA_STATE_MAX; i++) + + for (; i < SVGA_STATE_MAX; i++) svga->state.dirty[i] |= svga->dirty; svga->dirty = 0; @@ -269,7 +269,7 @@ enum pipe_error svga_emit_initial_state( struct svga_context *svga ) */ EMIT_RS(rs, count, SVGA3D_RS_COORDINATETYPE, SVGA3D_COORDINATE_LEFTHANDED ); EMIT_RS(rs, count, SVGA3D_RS_FRONTWINDING, SVGA3D_FRONTWINDING_CW ); - + assert( COUNT == count ); SVGA_FIFOCommitAll( svga->swc ); diff --git a/src/gallium/drivers/svga/svga_state_constants.c b/src/gallium/drivers/svga/svga_state_constants.c index 97c818c..caa8013 100644 --- a/src/gallium/drivers/svga/svga_state_constants.c +++ b/src/gallium/drivers/svga/svga_state_constants.c @@ -35,7 +35,7 @@ #include "svga_hw_reg.h" /*********************************************************************** - * Hardware update + * Hardware update */ /* Convert from PIPE_SHADER_* to SVGA3D_SHADERTYPE_* @@ -64,7 +64,7 @@ static int emit_const( struct svga_context *svga, value[2], value[3]); - ret = SVGA3D_SetShaderConst( svga->swc, + ret = SVGA3D_SetShaderConst( svga->swc, i, svga_shader_type(unit), SVGA3D_CONST_TYPE_FLOAT, @@ -74,7 +74,7 @@ static int emit_const( struct svga_context *svga, memcpy(svga->state.hw_draw.cb[unit][i], value, 4 * sizeof(float)); } - + return ret; } @@ -114,7 +114,7 @@ static int emit_consts( struct svga_context *svga, return ret; } - + static int emit_fs_consts( struct svga_context *svga, unsigned dirty ) { @@ -162,7 +162,7 @@ static int emit_fs_consts( struct svga_context *svga, } -struct svga_tracked_state svga_hw_fs_parameters = +struct svga_tracked_state svga_hw_fs_parameters = { "hw fs params", (SVGA_NEW_FS_CONST_BUFFER | @@ -184,10 +184,10 @@ static int emit_vs_consts( struct svga_context *svga, /* SVGA_NEW_VS_RESULT */ - if (result == NULL) + if (result == NULL) return 0; - /* SVGA_NEW_VS_CONST_BUFFER + /* SVGA_NEW_VS_CONST_BUFFER */ ret = emit_consts( svga, 0, PIPE_SHADER_VERTEX ); if (ret) @@ -229,7 +229,7 @@ static int emit_vs_consts( struct svga_context *svga, } -struct svga_tracked_state svga_hw_vs_parameters = +struct svga_tracked_state svga_hw_vs_parameters = { "hw vs params", (SVGA_NEW_PRESCALE | diff --git a/src/gallium/drivers/svga/svga_state_framebuffer.c b/src/gallium/drivers/svga/svga_state_framebuffer.c index fcbb35e..df5621c 100644 --- a/src/gallium/drivers/svga/svga_state_framebuffer.c +++ b/src/gallium/drivers/svga/svga_state_framebuffer.c @@ -51,7 +51,7 @@ static int emit_framebuffer( struct svga_context *svga, * We need to reemit non-null surface bindings, even when they are not * dirty, to ensure that the resources are paged in. */ - + for(i = 0; i < PIPE_MAX_COLOR_BUFS; ++i) { if (curr->cbufs[i] != hw->cbufs[i] || (reemit && hw->cbufs[i])) { @@ -61,12 +61,12 @@ static int emit_framebuffer( struct svga_context *svga, ret = SVGA3D_SetRenderTarget(svga->swc, SVGA3D_RT_COLOR0 + i, curr->cbufs[i]); if (ret != PIPE_OK) return ret; - + pipe_surface_reference(&hw->cbufs[i], curr->cbufs[i]); } } - + if (curr->zsbuf != hw->zsbuf || (reemit && hw->zsbuf)) { ret = SVGA3D_SetRenderTarget(svga->swc, SVGA3D_RT_DEPTH, curr->zsbuf); @@ -84,7 +84,7 @@ static int emit_framebuffer( struct svga_context *svga, if (ret != PIPE_OK) return ret; } - + pipe_surface_reference(&hw->zsbuf, curr->zsbuf); } @@ -93,7 +93,7 @@ static int emit_framebuffer( struct svga_context *svga, } -struct svga_tracked_state svga_hw_framebuffer = +struct svga_tracked_state svga_hw_framebuffer = { "hw framebuffer state", SVGA_NEW_FRAME_BUFFER | @@ -104,7 +104,7 @@ struct svga_tracked_state svga_hw_framebuffer = -/*********************************************************************** +/*********************************************************************** */ static int emit_viewport( struct svga_context *svga, @@ -127,8 +127,8 @@ static int emit_viewport( struct svga_context *svga, float fx = viewport->scale[0] * -1.0 + viewport->translate[0]; float fy = flip * viewport->scale[1] * -1.0 + viewport->translate[1]; - float fw = viewport->scale[0] * 2; - float fh = flip * viewport->scale[1] * 2; + float fw = viewport->scale[0] * 2; + float fh = flip * viewport->scale[1] * 2; memset( &prescale, 0, sizeof(prescale) ); @@ -172,24 +172,24 @@ static int emit_viewport( struct svga_context *svga, if (fx < 0) { prescale.translate[0] += fx; - prescale.scale[0] *= fw / (fw + fx); + prescale.scale[0] *= fw / (fw + fx); fw += fx; fx = 0; } if (fy < 0) { prescale.translate[1] += fy; - prescale.scale[1] *= fh / (fh + fy); + prescale.scale[1] *= fh / (fh + fy); fh += fy; fy = 0; } if (fx + fw > fb_width) { - prescale.scale[0] *= fw / (fb_width - fx); + prescale.scale[0] *= fw / (fb_width - fx); prescale.translate[0] -= fx * (fw / (fb_width - fx)); prescale.translate[0] += fx; fw = fb_width - fx; - + } if (fy + fh > fb_height) { @@ -268,8 +268,8 @@ static int emit_viewport( struct svga_context *svga, */ if (range_min > range_max) { float range_tmp; - range_tmp = range_min; - range_min = range_max; + range_tmp = range_min; + range_min = range_max; range_max = range_tmp; prescale.scale[2] = -prescale.scale[2]; } @@ -302,7 +302,7 @@ static int emit_viewport( struct svga_context *svga, /* Adjust prescale to take into account the fact that it is * going to be applied prior to the perspective divide and * viewport transformation. - * + * * Vwin = H(Vc/Vc.w) + J * * We want to tweak Vwin with scale and translation from above, @@ -352,7 +352,7 @@ static int emit_viewport( struct svga_context *svga, } if (svga->state.hw_clear.depthrange.zmin != range_min || - svga->state.hw_clear.depthrange.zmax != range_max) + svga->state.hw_clear.depthrange.zmax != range_max) { ret = SVGA3D_SetZRange(svga->swc, range_min, range_max ); if(ret != PIPE_OK) @@ -371,7 +371,7 @@ static int emit_viewport( struct svga_context *svga, } -struct svga_tracked_state svga_hw_viewport = +struct svga_tracked_state svga_hw_viewport = { "hw viewport state", ( SVGA_NEW_FRAME_BUFFER | @@ -395,12 +395,12 @@ static int emit_scissor_rect( struct svga_context *svga, rect.y = scissor->miny; rect.w = scissor->maxx - scissor->minx; /* + 1 ?? */ rect.h = scissor->maxy - scissor->miny; /* + 1 ?? */ - + return SVGA3D_SetScissorRect(svga->swc, &rect); } -struct svga_tracked_state svga_hw_scissor = +struct svga_tracked_state svga_hw_scissor = { "hw scissor state", SVGA_NEW_SCISSOR, @@ -432,7 +432,7 @@ static int emit_clip_planes( struct svga_context *svga, } -struct svga_tracked_state svga_hw_clip_planes = +struct svga_tracked_state svga_hw_clip_planes = { "hw viewport state", SVGA_NEW_CLIP, diff --git a/src/gallium/drivers/svga/svga_state_fs.c b/src/gallium/drivers/svga/svga_state_fs.c index ad6f294..804aff3 100644 --- a/src/gallium/drivers/svga/svga_state_fs.c +++ b/src/gallium/drivers/svga/svga_state_fs.c @@ -61,7 +61,7 @@ static struct svga_shader_result *search_fs_key( struct svga_fragment_shader *fs if (compare_fs_keys( key, &result->key.fkey ) == 0) return result; } - + return NULL; } @@ -86,10 +86,10 @@ static enum pipe_error compile_fs( struct svga_context *svga, goto fail; } - ret = SVGA3D_DefineShader(svga->swc, + ret = SVGA3D_DefineShader(svga->swc, result->id, SVGA3D_SHADERTYPE_PS, - result->tokens, + result->tokens, result->nr_tokens * sizeof result->tokens[0]); if (ret) goto fail; @@ -138,20 +138,20 @@ static int make_fs_key( const struct svga_context *svga, * requires that the incoming fragment color be white. This change * achieves that by creating a varient of the current fragment * shader that overrides all output colors with 1,1,1,1 - * + * * This will work for most shaders, including those containing * TEXKIL and/or depth-write. However, it will break on the * combination of xor-logicop plus alphatest. * * Ultimately, we could implement alphatest in the shader using * texkil prior to overriding the outgoing fragment color. - * + * * SVGA_NEW_BLEND */ if (svga->curr.blend->need_white_fragments) { key->white_fragments = 1; } - + /* XXX: want to limit this to the textures that the shader actually * refers to. * @@ -224,13 +224,13 @@ static int emit_hw_fs( struct svga_context *svga, return ret; svga->dirty |= SVGA_NEW_FS_RESULT; - svga->state.hw_draw.fs = result; + svga->state.hw_draw.fs = result; } return 0; } -struct svga_tracked_state svga_hw_fs = +struct svga_tracked_state svga_hw_fs = { "fragment shader (hwtnl)", (SVGA_NEW_FS | diff --git a/src/gallium/drivers/svga/svga_state_need_swtnl.c b/src/gallium/drivers/svga/svga_state_need_swtnl.c index 66fea02..38891f7 100644 --- a/src/gallium/drivers/svga/svga_state_need_swtnl.c +++ b/src/gallium/drivers/svga/svga_state_need_swtnl.c @@ -35,7 +35,7 @@ /*********************************************************************** */ -static INLINE SVGA3dDeclType +static INLINE SVGA3dDeclType svga_translate_vertex_format(enum pipe_format format) { switch (format) { @@ -89,11 +89,11 @@ static int update_need_swvfetch( struct svga_context *svga, svga->state.sw.need_swvfetch = need_swvfetch; svga->dirty |= SVGA_NEW_NEED_SWVFETCH; } - + return 0; } -struct svga_tracked_state svga_update_need_swvfetch = +struct svga_tracked_state svga_update_need_swvfetch = { "update need_swvfetch", ( SVGA_NEW_VELEMENT ), @@ -101,13 +101,13 @@ struct svga_tracked_state svga_update_need_swvfetch = }; -/*********************************************************************** +/*********************************************************************** */ static int update_need_pipeline( struct svga_context *svga, unsigned dirty ) { - + boolean need_pipeline = FALSE; struct svga_vertex_shader *vs = svga->curr.vs; @@ -128,7 +128,7 @@ static int update_need_pipeline( struct svga_context *svga, need_pipeline = TRUE; } - /* SVGA_NEW_CLIP + /* SVGA_NEW_CLIP */ if (svga->curr.clip.nr) { SVGA_DBG(DEBUG_SWTNL, "%s: userclip\n", __FUNCTION__); @@ -144,7 +144,7 @@ static int update_need_pipeline( struct svga_context *svga, } -struct svga_tracked_state svga_update_need_pipeline = +struct svga_tracked_state svga_update_need_pipeline = { "need pipeline", (SVGA_NEW_RAST | @@ -155,7 +155,7 @@ struct svga_tracked_state svga_update_need_pipeline = }; -/*********************************************************************** +/*********************************************************************** */ static int update_need_swtnl( struct svga_context *svga, @@ -186,7 +186,7 @@ static int update_need_swtnl( struct svga_context *svga, svga->dirty |= SVGA_NEW_NEED_SWTNL; svga->swtnl.new_vdecl = TRUE; } - + return 0; } diff --git a/src/gallium/drivers/svga/svga_state_rss.c b/src/gallium/drivers/svga/svga_state_rss.c index ab13f3f..a4a2f3d 100644 --- a/src/gallium/drivers/svga/svga_state_rss.c +++ b/src/gallium/drivers/svga/svga_state_rss.c @@ -89,7 +89,7 @@ static int emit_rss( struct svga_context *svga, EMIT_RS( svga, curr->rt[0].dstblend, DSTBLEND, fail ); EMIT_RS( svga, curr->rt[0].blendeq, BLENDEQUATION, fail ); - EMIT_RS( svga, curr->rt[0].separate_alpha_blend_enable, + EMIT_RS( svga, curr->rt[0].separate_alpha_blend_enable, SEPARATEALPHABLENDENABLE, fail ); if (curr->rt[0].separate_alpha_blend_enable) { @@ -113,10 +113,10 @@ static int emit_rss( struct svga_context *svga, } if (dirty & (SVGA_NEW_DEPTH_STENCIL | SVGA_NEW_RAST)) { - const struct svga_depth_stencil_state *curr = svga->curr.depth; - const struct svga_rasterizer_state *rast = svga->curr.rast; + const struct svga_depth_stencil_state *curr = svga->curr.depth; + const struct svga_rasterizer_state *rast = svga->curr.rast; - if (!curr->stencil[0].enabled) + if (!curr->stencil[0].enabled) { /* Stencil disabled */ @@ -138,7 +138,7 @@ static int emit_rss( struct svga_context *svga, EMIT_RS( svga, curr->stencil_mask, STENCILMASK, fail ); EMIT_RS( svga, curr->stencil_writemask, STENCILWRITEMASK, fail ); } - else + else { int cw, ccw; @@ -193,7 +193,7 @@ static int emit_rss( struct svga_context *svga, if (dirty & (SVGA_NEW_RAST | SVGA_NEW_NEED_PIPELINE)) { - const struct svga_rasterizer_state *curr = svga->curr.rast; + const struct svga_rasterizer_state *curr = svga->curr.rast; unsigned cullmode = curr->cullmode; /* Shademode: still need to rearrange index list to move @@ -221,7 +221,7 @@ static int emit_rss( struct svga_context *svga, if (dirty & (SVGA_NEW_RAST | SVGA_NEW_FRAME_BUFFER | SVGA_NEW_NEED_PIPELINE)) { - const struct svga_rasterizer_state *curr = svga->curr.rast; + const struct svga_rasterizer_state *curr = svga->curr.rast; float slope = 0.0; float bias = 0.0; @@ -270,7 +270,7 @@ static int emit_rss( struct svga_context *svga, } -struct svga_tracked_state svga_hw_rss = +struct svga_tracked_state svga_hw_rss = { "hw rss state", diff --git a/src/gallium/drivers/svga/svga_state_tss.c b/src/gallium/drivers/svga/svga_state_tss.c index f8b269a..87b856d 100644 --- a/src/gallium/drivers/svga/svga_state_tss.c +++ b/src/gallium/drivers/svga/svga_state_tss.c @@ -53,7 +53,7 @@ void svga_cleanup_tss_binding(struct svga_context *svga) static int -update_tss_binding(struct svga_context *svga, +update_tss_binding(struct svga_context *svga, unsigned dirty ) { boolean reemit = !!(dirty & SVGA_NEW_COMMAND_BUFFER); @@ -74,7 +74,7 @@ update_tss_binding(struct svga_context *svga, } queue; queue.bind_count = 0; - + for (i = 0; i < count; i++) { const struct svga_sampler_state *s = svga->curr.sampler[i]; struct svga_hw_view_state *view = &svga->state.hw_draw.views[i]; @@ -102,8 +102,8 @@ update_tss_binding(struct svga_context *svga, view->max_lod = max_lod; if (texture) - view->v = svga_get_tex_sampler_view(&svga->pipe, - texture, + view->v = svga_get_tex_sampler_view(&svga->pipe, + texture, min_lod, max_lod); } @@ -118,7 +118,7 @@ update_tss_binding(struct svga_context *svga, queue.bind[queue.bind_count].unit = i; queue.bind[queue.bind_count].view = view; queue.bind_count++; - } + } if (!view->dirty && view->v) { svga_validate_sampler_view(svga, view->v); } @@ -150,7 +150,7 @@ update_tss_binding(struct svga_context *svga, &ts[i].value, handle, SVGA_RELOC_READ); - + queue.bind[i].view->dirty = FALSE; } @@ -200,7 +200,7 @@ do { \ } while (0) -static INLINE void +static INLINE void svga_queue_tss( struct ts_queue *q, unsigned unit, unsigned tss, @@ -215,7 +215,7 @@ svga_queue_tss( struct ts_queue *q, static int -update_tss(struct svga_context *svga, +update_tss(struct svga_context *svga, unsigned dirty ) { unsigned i; @@ -250,7 +250,7 @@ update_tss(struct svga_context *svga, } } - + if (queue.ts_count) { SVGA3dTextureState *ts; @@ -262,7 +262,7 @@ update_tss(struct svga_context *svga, memcpy( ts, queue.ts, queue.ts_count * sizeof queue.ts[0]); - + SVGA_FIFOCommitAll( svga->swc ); } diff --git a/src/gallium/drivers/svga/svga_state_vdecl.c b/src/gallium/drivers/svga/svga_state_vdecl.c index 3af7bf2..518bd6d 100644 --- a/src/gallium/drivers/svga/svga_state_vdecl.c +++ b/src/gallium/drivers/svga/svga_state_vdecl.c @@ -45,12 +45,12 @@ upload_user_buffers( struct svga_context *svga ) int i; int nr; - if (0) + if (0) debug_printf("%s: %d\n", __FUNCTION__, svga->curr.num_vertex_buffers); nr = svga->curr.num_vertex_buffers; - for (i = 0; i < nr; i++) + for (i = 0; i < nr; i++) { if (svga_buffer_is_user_buffer(svga->curr.vb[i].buffer)) { @@ -102,7 +102,7 @@ static int emit_hw_vs_vdecl( struct svga_context *svga, assert(svga->curr.velems->count >= svga->curr.vs->base.info.file_count[TGSI_FILE_INPUT]); - svga_hwtnl_reset_vdecl( svga->hwtnl, + svga_hwtnl_reset_vdecl( svga->hwtnl, svga->curr.velems->count ); for (i = 0; i < svga->curr.velems->count; i++) { @@ -160,7 +160,7 @@ static int emit_hw_vdecl( struct svga_context *svga, } -struct svga_tracked_state svga_hw_vdecl = +struct svga_tracked_state svga_hw_vdecl = { "hw vertex decl state (hwtnl version)", ( SVGA_NEW_NEED_SWTNL | diff --git a/src/gallium/drivers/svga/svga_state_vs.c b/src/gallium/drivers/svga/svga_state_vs.c index 5133c70..5bc39b7 100644 --- a/src/gallium/drivers/svga/svga_state_vs.c +++ b/src/gallium/drivers/svga/svga_state_vs.c @@ -60,7 +60,7 @@ static struct svga_shader_result *search_vs_key( struct svga_vertex_shader *vs, if (compare_vs_keys( key, &result->key.vkey ) == 0) return result; } - + return NULL; } @@ -85,10 +85,10 @@ static enum pipe_error compile_vs( struct svga_context *svga, goto fail; } - ret = SVGA3D_DefineShader(svga->swc, + ret = SVGA3D_DefineShader(svga->swc, result->id, SVGA3D_SHADERTYPE_VS, - result->tokens, + result->tokens, result->nr_tokens * sizeof result->tokens[0]); if (ret) goto fail; @@ -159,13 +159,13 @@ static int emit_hw_vs( struct svga_context *svga, return ret; svga->dirty |= SVGA_NEW_VS_RESULT; - svga->state.hw_draw.vs = result; + svga->state.hw_draw.vs = result; } return 0; } -struct svga_tracked_state svga_hw_vs = +struct svga_tracked_state svga_hw_vs = { "vertex shader (hwtnl)", (SVGA_NEW_VS | @@ -219,8 +219,8 @@ static int update_zero_stride( struct svga_context *svga, translate = translate_generic_create(&key); assert(vel->src_offset == 0); - - mapped_buffer = pipe_buffer_map_range(&svga->pipe, + + mapped_buffer = pipe_buffer_map_range(&svga->pipe, vbuffer->buffer, vel->src_offset, util_format_get_blocksize(vel->src_format), diff --git a/src/gallium/drivers/svga/svga_surface.c b/src/gallium/drivers/svga/svga_surface.c index 3e4bed7..bbe6d95 100644 --- a/src/gallium/drivers/svga/svga_surface.c +++ b/src/gallium/drivers/svga/svga_surface.c @@ -114,7 +114,7 @@ svga_texture_view_surface(struct pipe_context *pipe, uint32_t i, j; unsigned z_offset = 0; - SVGA_DBG(DEBUG_PERF, + SVGA_DBG(DEBUG_PERF, "svga: Create surface view: face %d zslice %d mips %d..%d\n", face_pick, zslice_pick, start_mip, start_mip+num_mip-1); @@ -126,7 +126,7 @@ svga_texture_view_surface(struct pipe_context *pipe, key->size.depth = zslice_pick < 0 ? u_minify(tex->b.b.depth0, start_mip) : 1; key->cachable = 1; assert(key->size.depth == 1); - + if(tex->b.b.target == PIPE_TEXTURE_CUBE && face_pick < 0) { key->flags |= SVGA3D_SURFACE_CUBEMAP; key->numFaces = 6; @@ -162,9 +162,9 @@ svga_texture_view_surface(struct pipe_context *pipe, 1); svga_texture_copy_handle(svga_context(pipe), - tex->handle, - 0, 0, z_offset, - i + start_mip, + tex->handle, + 0, 0, z_offset, + i + start_mip, j + face_pick, handle, 0, 0, 0, i, j, u_minify(tex->b.b.width0, i + start_mip), @@ -230,7 +230,7 @@ svga_create_surface(struct pipe_context *pipe, view = TRUE; /* Currently only used for compressed textures */ - if (render && + if (render && format != svga_translate_format(surf_tmpl->format)) { view = TRUE; } @@ -287,7 +287,7 @@ svga_surface_destroy(struct pipe_context *pipe, } -static INLINE void +static INLINE void svga_mark_surface_dirty(struct pipe_surface *surf) { struct svga_surface *s = svga_surface(surf); diff --git a/src/gallium/drivers/svga/svga_swtnl_backend.c b/src/gallium/drivers/svga/svga_swtnl_backend.c index ff3da84..0914bb7 100644 --- a/src/gallium/drivers/svga/svga_swtnl_backend.c +++ b/src/gallium/drivers/svga/svga_swtnl_backend.c @@ -118,7 +118,7 @@ svga_vbuf_render_map_vertices( struct vbuf_render *render ) char *ptr = (char*)pipe_buffer_map(&svga->pipe, svga_render->vbuf, - PIPE_TRANSFER_WRITE | + PIPE_TRANSFER_WRITE | PIPE_TRANSFER_FLUSH_EXPLICIT | PIPE_TRANSFER_DISCARD | PIPE_TRANSFER_UNSYNCHRONIZED, @@ -252,7 +252,7 @@ svga_vbuf_render_draw_elements( struct vbuf_render *render, size_t size = 2 * nr_indices; assert(( svga_render->vbuf_offset - svga_render->vdecl_offset) % svga_render->vertex_size == 0); - + if (svga_render->ibuf_size < svga_render->ibuf_offset + size) pipe_resource_reference(&svga_render->ibuf, NULL); diff --git a/src/gallium/drivers/svga/svga_swtnl_draw.c b/src/gallium/drivers/svga/svga_swtnl_draw.c index 814e8ed..31dda18 100644 --- a/src/gallium/drivers/svga/svga_swtnl_draw.c +++ b/src/gallium/drivers/svga/svga_swtnl_draw.c @@ -101,12 +101,12 @@ svga_swtnl_draw_vbo(struct svga_context *svga, /* Ensure the draw module didn't touch this */ assert(i == svga->curr.num_vertex_buffers); - + /* * unmap vertex/index buffers */ for (i = 0; i < svga->curr.num_vertex_buffers; i++) { - pipe_buffer_unmap(&svga->pipe, svga->curr.vb[i].buffer, + pipe_buffer_unmap(&svga->pipe, svga->curr.vb[i].buffer, vb_transfer[i]); draw_set_mapped_vertex_buffer(draw, i, NULL); } @@ -142,7 +142,7 @@ boolean svga_init_swtnl( struct svga_context *svga ) goto fail; - draw_set_rasterize_stage(svga->swtnl.draw, + draw_set_rasterize_stage(svga->swtnl.draw, draw_vbuf_stage( svga->swtnl.draw, svga->swtnl.backend )); draw_set_render(svga->swtnl.draw, svga->swtnl.backend); diff --git a/src/gallium/drivers/svga/svga_swtnl_state.c b/src/gallium/drivers/svga/svga_swtnl_state.c index a759238..c2cd5f9 100644 --- a/src/gallium/drivers/svga/svga_swtnl_state.c +++ b/src/gallium/drivers/svga/svga_swtnl_state.c @@ -61,7 +61,7 @@ static void set_draw_viewport( struct svga_context *svga ) * going to be drawn with triangles, but we're not catching all * cases where that will happen. */ - if (svga->curr.rast->templ.line_width > 1.0) + if (svga->curr.rast->templ.line_width > 1.0) { adjx = SVGA_LINE_ADJ_X + 0.175; adjy = SVGA_LINE_ADJ_Y - 0.175; @@ -88,26 +88,26 @@ static int update_swtnl_draw( struct svga_context *svga, { draw_flush( svga->swtnl.draw ); - if (dirty & SVGA_NEW_VS) + if (dirty & SVGA_NEW_VS) draw_bind_vertex_shader(svga->swtnl.draw, svga->curr.vs->draw_shader); if (dirty & SVGA_NEW_VBUFFER) - draw_set_vertex_buffers(svga->swtnl.draw, - svga->curr.num_vertex_buffers, + draw_set_vertex_buffers(svga->swtnl.draw, + svga->curr.num_vertex_buffers, svga->curr.vb); if (dirty & SVGA_NEW_VELEMENT) - draw_set_vertex_elements(svga->swtnl.draw, - svga->curr.velems->count, + draw_set_vertex_elements(svga->swtnl.draw, + svga->curr.velems->count, svga->curr.velems->velem ); if (dirty & SVGA_NEW_CLIP) - draw_set_clip_state(svga->swtnl.draw, + draw_set_clip_state(svga->swtnl.draw, &svga->curr.clip); if (dirty & (SVGA_NEW_VIEWPORT | - SVGA_NEW_REDUCED_PRIMITIVE | + SVGA_NEW_REDUCED_PRIMITIVE | SVGA_NEW_RAST)) set_draw_viewport( svga ); @@ -117,7 +117,7 @@ static int update_swtnl_draw( struct svga_context *svga, (void *) svga->curr.rast); if (dirty & SVGA_NEW_FRAME_BUFFER) - draw_set_mrd(svga->swtnl.draw, + draw_set_mrd(svga->swtnl.draw, svga->curr.depthscale); return 0; diff --git a/src/gallium/drivers/svga/svga_tgsi.c b/src/gallium/drivers/svga/svga_tgsi.c index 781fe63..24f3135 100644 --- a/src/gallium/drivers/svga/svga_tgsi.c +++ b/src/gallium/drivers/svga/svga_tgsi.c @@ -78,7 +78,7 @@ static boolean svga_shader_expand( struct svga_shader_emitter *emit ) emit->ptr = new_buf + (emit->ptr - emit->buf); emit->buf = new_buf; return TRUE; -} +} static INLINE boolean reserve( struct svga_shader_emitter *emit, unsigned nr_dwords ) @@ -126,11 +126,11 @@ boolean svga_shader_emit_opcode( struct svga_shader_emitter *emit, here->value = opcode; if (emit->insn_offset) { - SVGA3dShaderInstToken *prev = (SVGA3dShaderInstToken *)(emit->buf + + SVGA3dShaderInstToken *prev = (SVGA3dShaderInstToken *)(emit->buf + emit->insn_offset); prev->size = (here - prev) - 1; } - + emit->insn_offset = emit->ptr - emit->buf; emit->ptr += sizeof(unsigned); return TRUE; @@ -153,7 +153,7 @@ static boolean svga_shader_emit_header( struct svga_shader_emitter *emit ) header.value = emit->use_sm30 ? SVGA3D_VS_30 : SVGA3D_VS_2X; break; } - + return svga_shader_emit_dword( emit, header.value ); } @@ -162,7 +162,7 @@ static boolean svga_shader_emit_header( struct svga_shader_emitter *emit ) /* Parse TGSI shader and translate to SVGA/DX9 serialized - * representation. + * representation. * * In this function SVGA shader is emitted to an in-memory buffer that * can be dynamically grown. Once we've finished and know how large @@ -194,7 +194,7 @@ svga_tgsi_translate( const struct svga_shader *shader, tgsi_scan_shader( shader->tokens, &emit.info); emit.imm_start = emit.info.file_max[TGSI_FILE_CONSTANT] + 1; - + if (unit == PIPE_SHADER_FRAGMENT) emit.imm_start += key.fkey.num_unnormalized_coords; @@ -213,7 +213,7 @@ svga_tgsi_translate( const struct svga_shader *shader, if (!svga_shader_emit_instructions( &emit, shader->tokens )) goto fail; - + result = CALLOC_STRUCT(svga_shader_result); if (result == NULL) goto fail; @@ -224,7 +224,7 @@ svga_tgsi_translate( const struct svga_shader *shader, memcpy(&result->key, &key, sizeof key); result->id = UTIL_BITMASK_INVALID_INDEX; - if (SVGA_DEBUG & DEBUG_TGSI) + if (SVGA_DEBUG & DEBUG_TGSI) { debug_printf( "#####################################\n" ); debug_printf( "Shader %u below\n", shader->id ); @@ -256,7 +256,7 @@ svga_translate_fragment_program( const struct svga_fragment_shader *fs, union svga_compile_key key; memcpy(&key.fkey, fkey, sizeof *fkey); - return svga_tgsi_translate( &fs->base, + return svga_tgsi_translate( &fs->base, key, PIPE_SHADER_FRAGMENT ); } @@ -268,7 +268,7 @@ svga_translate_vertex_program( const struct svga_vertex_shader *vs, union svga_compile_key key; memcpy(&key.vkey, vkey, sizeof *vkey); - return svga_tgsi_translate( &vs->base, + return svga_tgsi_translate( &vs->base, key, PIPE_SHADER_VERTEX ); } diff --git a/src/gallium/drivers/svga/svga_tgsi.h b/src/gallium/drivers/svga/svga_tgsi.h index 7ea909c..fba1c2d 100644 --- a/src/gallium/drivers/svga/svga_tgsi.h +++ b/src/gallium/drivers/svga/svga_tgsi.h @@ -82,7 +82,7 @@ struct svga_shader_result /* SVGA Shader ID: */ unsigned id; - + /* Next compilation result: */ struct svga_shader_result *next; diff --git a/src/gallium/drivers/svga/svga_tgsi_decl_sm20.c b/src/gallium/drivers/svga/svga_tgsi_decl_sm20.c index 1ae9906..d882fc2 100644 --- a/src/gallium/drivers/svga/svga_tgsi_decl_sm20.c +++ b/src/gallium/drivers/svga/svga_tgsi_decl_sm20.c @@ -47,11 +47,11 @@ static boolean ps20_input( struct svga_shader_emitter *emit, case TGSI_SEMANTIC_POSITION: /* Special case: */ - reg = src_register( SVGA3DREG_MISCTYPE, + reg = src_register( SVGA3DREG_MISCTYPE, SVGA3DMISCREG_POSITION ); break; case TGSI_SEMANTIC_COLOR: - reg = src_register( SVGA3DREG_INPUT, + reg = src_register( SVGA3DREG_INPUT, semantic.Index ); break; case TGSI_SEMANTIC_FOG: @@ -95,7 +95,7 @@ static boolean ps20_output( struct svga_shader_emitter *emit, emit->output_map[idx] = dst_register( SVGA3DREG_TEMP, emit->nr_hw_temp++ ); emit->temp_col[cbuf] = emit->output_map[idx]; - emit->true_col[cbuf] = dst_register( SVGA3DREG_COLOROUT, + emit->true_col[cbuf] = dst_register( SVGA3DREG_COLOROUT, semantic.Index ); } else { @@ -107,7 +107,7 @@ static boolean ps20_output( struct svga_shader_emitter *emit, emit->output_map[idx] = dst_register( SVGA3DREG_TEMP, emit->nr_hw_temp++ ); emit->temp_pos = emit->output_map[idx]; - emit->true_pos = dst_register( SVGA3DREG_DEPTHOUT, + emit->true_pos = dst_register( SVGA3DREG_DEPTHOUT, semantic.Index ); break; default: @@ -164,7 +164,7 @@ static boolean vs20_output( struct svga_shader_emitter *emit, /* Don't emit dcl instruction for vs20 inputs */ - /* Just build the register map table: + /* Just build the register map table: */ switch (semantic.Name) { case TGSI_SEMANTIC_POSITION: @@ -172,7 +172,7 @@ static boolean vs20_output( struct svga_shader_emitter *emit, emit->output_map[idx] = dst_register( SVGA3DREG_TEMP, emit->nr_hw_temp++ ); emit->temp_pos = emit->output_map[idx]; - emit->true_pos = dst_register( SVGA3DREG_RASTOUT, + emit->true_pos = dst_register( SVGA3DREG_RASTOUT, SVGA3DRASTOUT_POSITION); break; case TGSI_SEMANTIC_PSIZE: @@ -180,7 +180,7 @@ static boolean vs20_output( struct svga_shader_emitter *emit, emit->output_map[idx] = dst_register( SVGA3DREG_TEMP, emit->nr_hw_temp++ ); emit->temp_psiz = emit->output_map[idx]; - emit->true_psiz = dst_register( SVGA3DREG_RASTOUT, + emit->true_psiz = dst_register( SVGA3DREG_RASTOUT, SVGA3DRASTOUT_PSIZE ); break; case TGSI_SEMANTIC_FOG: @@ -232,7 +232,7 @@ boolean svga_translate_decl_sm20( struct svga_shader_emitter *emit, unsigned semantic = 0; unsigned semantic_idx = 0; unsigned idx; - + if (decl->Declaration.Semantic) { semantic = decl->Semantic.Name; semantic_idx = decl->Semantic.Index; diff --git a/src/gallium/drivers/svga/svga_tgsi_decl_sm30.c b/src/gallium/drivers/svga/svga_tgsi_decl_sm30.c index 73102a7..216f4ca 100644 --- a/src/gallium/drivers/svga/svga_tgsi_decl_sm30.c +++ b/src/gallium/drivers/svga/svga_tgsi_decl_sm30.c @@ -35,11 +35,11 @@ static boolean translate_vs_ps_semantic( struct tgsi_declaration_semantic semant unsigned *idx ) { switch (semantic.Name) { - case TGSI_SEMANTIC_POSITION: + case TGSI_SEMANTIC_POSITION: *idx = semantic.Index; *usage = SVGA3D_DECLUSAGE_POSITION; break; - case TGSI_SEMANTIC_COLOR: + case TGSI_SEMANTIC_COLOR: *idx = semantic.Index; *usage = SVGA3D_DECLUSAGE_COLOR; @@ -48,20 +48,20 @@ static boolean translate_vs_ps_semantic( struct tgsi_declaration_semantic semant *idx = semantic.Index + 2; /* sharing with COLOR */ *usage = SVGA3D_DECLUSAGE_COLOR; break; - case TGSI_SEMANTIC_FOG: + case TGSI_SEMANTIC_FOG: *idx = 0; assert(semantic.Index == 0); *usage = SVGA3D_DECLUSAGE_TEXCOORD; break; - case TGSI_SEMANTIC_PSIZE: + case TGSI_SEMANTIC_PSIZE: *idx = semantic.Index; *usage = SVGA3D_DECLUSAGE_PSIZE; break; - case TGSI_SEMANTIC_GENERIC: + case TGSI_SEMANTIC_GENERIC: *idx = semantic.Index + 1; /* texcoord[0] is reserved for fog */ *usage = SVGA3D_DECLUSAGE_TEXCOORD; break; - case TGSI_SEMANTIC_NORMAL: + case TGSI_SEMANTIC_NORMAL: *idx = semantic.Index; *usage = SVGA3D_DECLUSAGE_NORMAL; break; @@ -78,7 +78,7 @@ static boolean translate_vs_ps_semantic( struct tgsi_declaration_semantic semant static boolean emit_decl( struct svga_shader_emitter *emit, SVGA3dShaderDestToken reg, - unsigned usage, + unsigned usage, unsigned index ) { SVGA3DOpDclArgs dcl; @@ -200,11 +200,11 @@ static boolean ps30_output( struct svga_shader_emitter *emit, emit->output_map[idx] = dst_register( SVGA3DREG_TEMP, emit->nr_hw_temp++ ); emit->temp_col[idx] = emit->output_map[idx]; - emit->true_col[idx] = dst_register( SVGA3DREG_COLOROUT, + emit->true_col[idx] = dst_register( SVGA3DREG_COLOROUT, semantic.Index ); } else { - emit->output_map[idx] = dst_register( SVGA3DREG_COLOROUT, + emit->output_map[idx] = dst_register( SVGA3DREG_COLOROUT, semantic.Index ); } break; @@ -212,7 +212,7 @@ static boolean ps30_output( struct svga_shader_emitter *emit, emit->output_map[idx] = dst_register( SVGA3DREG_TEMP, emit->nr_hw_temp++ ); emit->temp_pos = emit->output_map[idx]; - emit->true_pos = dst_register( SVGA3DREG_DEPTHOUT, + emit->true_pos = dst_register( SVGA3DREG_DEPTHOUT, semantic.Index ); break; default: @@ -305,7 +305,7 @@ static boolean vs30_output( struct svga_shader_emitter *emit, emit->nr_hw_temp++ ); emit->temp_psiz = emit->output_map[idx]; - /* This has the effect of not declaring psiz (below) and not + /* This has the effect of not declaring psiz (below) and not * emitting the final MOV to true_psiz in the postamble. */ if (!emit->key.vkey.allow_psiz) diff --git a/src/gallium/drivers/svga/svga_tgsi_emit.h b/src/gallium/drivers/svga/svga_tgsi_emit.h index 63ef7f8..e4ec9a4 100644 --- a/src/gallium/drivers/svga/svga_tgsi_emit.h +++ b/src/gallium/drivers/svga/svga_tgsi_emit.h @@ -51,7 +51,7 @@ struct svga_arl_consts { struct svga_shader_emitter { boolean use_sm30; - + unsigned size; char *buf; char *ptr; @@ -65,7 +65,7 @@ struct svga_shader_emitter int nr_hw_float_const; int nr_hw_int_const; int nr_hw_temp; - + int insn_offset; int internal_temp_count; @@ -245,7 +245,7 @@ inst_token( unsigned opcode ) return inst; } -static INLINE SVGA3dShaderDestToken +static INLINE SVGA3dShaderDestToken dst_register( unsigned file, int number ) { @@ -261,7 +261,7 @@ dst_register( unsigned file, dest.shfScale = 0; dest.type_lower = file & 0x7; dest.reserved0 = 1; /* is_reg */ - + return dest; } @@ -275,7 +275,7 @@ writemask( SVGA3dShaderDestToken dest, } -static INLINE SVGA3dShaderSrcToken +static INLINE SVGA3dShaderSrcToken src_token( unsigned file, int number ) { SVGA3dShaderSrcToken src; @@ -294,7 +294,7 @@ src_token( unsigned file, int number ) } -static INLINE struct src_register +static INLINE struct src_register absolute( struct src_register src ) { src.base.srcMod = SVGA3DSRCMOD_ABS; @@ -303,7 +303,7 @@ absolute( struct src_register src ) } -static INLINE struct src_register +static INLINE struct src_register negate( struct src_register src ) { switch (src.base.srcMod) { @@ -324,11 +324,11 @@ negate( struct src_register src ) } -static INLINE struct src_register +static INLINE struct src_register src_register( unsigned file, int number ) { struct src_register src; - + src.base = src_token( file, number ); src.indirect.value = 0; diff --git a/src/gallium/drivers/svga/svga_tgsi_insn.c b/src/gallium/drivers/svga/svga_tgsi_insn.c index f2591c5..95c0cfc 100644 --- a/src/gallium/drivers/svga/svga_tgsi_insn.c +++ b/src/gallium/drivers/svga/svga_tgsi_insn.c @@ -37,7 +37,7 @@ static boolean emit_ps_postamble( struct svga_shader_emitter *emit ); - + static unsigned translate_opcode( uint opcode ) @@ -87,7 +87,7 @@ static unsigned translate_file( unsigned file ) -static SVGA3dShaderDestToken +static SVGA3dShaderDestToken translate_dst_register( struct svga_shader_emitter *emit, const struct tgsi_full_instruction *insn, unsigned idx ) @@ -112,14 +112,14 @@ translate_dst_register( struct svga_shader_emitter *emit, dest.mask = reg->Register.WriteMask; assert(dest.mask); - if (insn->Instruction.Saturate) + if (insn->Instruction.Saturate) dest.dstMod = SVGA3DDSTMOD_SATURATE; return dest; } -static struct src_register +static struct src_register swizzle( struct src_register src, int x, int y, @@ -167,7 +167,7 @@ svga_arl_adjustment( const struct svga_shader_emitter *emit ) return 0; } -static struct src_register +static struct src_register translate_src_register( const struct svga_shader_emitter *emit, const struct tgsi_full_src_register *reg ) { @@ -180,13 +180,13 @@ translate_src_register( const struct svga_shader_emitter *emit, */ src = emit->input_map[reg->Register.Index]; break; - + case TGSI_FILE_IMMEDIATE: /* Immediates are appended after TGSI constants in the D3D * constant buffer. */ src = src_register( translate_file( reg->Register.File ), - reg->Register.Index + + reg->Register.Index + emit->imm_start ); break; @@ -259,7 +259,7 @@ translate_src_register( const struct svga_shader_emitter *emit, /* * Get a temporary register, return -1 if none available */ -static INLINE SVGA3dShaderDestToken +static INLINE SVGA3dShaderDestToken get_temp( struct svga_shader_emitter *emit ) { int i = emit->nr_hw_temp + emit->internal_temp_count++; @@ -271,7 +271,7 @@ get_temp( struct svga_shader_emitter *emit ) * allocated temp, otherwise release will be delayed until the next * call to reset_temp_regs(). */ -static INLINE void +static INLINE void release_temp( struct svga_shader_emitter *emit, SVGA3dShaderDestToken temp ) { @@ -283,13 +283,13 @@ static void reset_temp_regs( struct svga_shader_emitter *emit ) { emit->internal_temp_count = 0; } - + static boolean submit_op0( struct svga_shader_emitter *emit, SVGA3dShaderInstToken inst, SVGA3dShaderDestToken dest ) { - return (emit_instruction( emit, inst ) && + return (emit_instruction( emit, inst ) && emit_dst( emit, dest )); } @@ -399,10 +399,10 @@ static boolean submit_op3( struct svga_shader_emitter *emit, if (need_temp0) { temp0 = get_temp( emit ); - + if (!emit_op1( emit, inst_token( SVGA3DOP_MOV ), temp0, src0 )) return FALSE; - + src0 = src( temp0 ); } @@ -481,10 +481,10 @@ static boolean submit_op4( struct svga_shader_emitter *emit, if (need_temp0) { temp0 = get_temp( emit ); - + if (!emit_op1( emit, inst_token( SVGA3DOP_MOV ), temp0, src0 )) return FALSE; - + src0 = src( temp0 ); } @@ -653,7 +653,7 @@ static INLINE struct src_register get_vface( struct svga_shader_emitter *emit ) { assert(emit->emitted_vface); - return src_register(SVGA3DREG_MISCTYPE, + return src_register(SVGA3DREG_MISCTYPE, SVGA3DMISCREG_FACE); } @@ -866,8 +866,8 @@ static boolean emit_div(struct svga_shader_emitter *emit, unsigned channel = 1 << i; if (dst.mask & channel) { /* RCP TMP.?, SRC1.???? */ - if (!submit_op1( emit, inst_token( SVGA3DOP_RCP ), - writemask(temp, channel), + if (!submit_op1( emit, inst_token( SVGA3DOP_RCP ), + writemask(temp, channel), scalar(src1, i) )) return FALSE; } @@ -1145,7 +1145,7 @@ static boolean emit_kilp(struct svga_shader_emitter *emit, * * SETP src0, cmp, src1 -- do this first to avoid aliasing problems. * MOV dst, fail - * MOV dst, pass, p0 + * MOV dst, pass, p0 */ static boolean emit_conditional(struct svga_shader_emitter *emit, @@ -1270,7 +1270,7 @@ static boolean emit_select_op(struct svga_shader_emitter *emit, emit, &insn->Src[0] ); struct src_register src1 = translate_src_register( emit, &insn->Src[1] ); - + return emit_select( emit, compare, dst, src0, src1 ); } @@ -1285,7 +1285,7 @@ static boolean emit_tex2(struct svga_shader_emitter *emit, struct src_register texcoord; struct src_register sampler; SVGA3dShaderDestToken tmp; - + inst.value = 0; switch (insn->Instruction.Opcode) { @@ -1331,12 +1331,12 @@ static boolean emit_tex2(struct svga_shader_emitter *emit, return FALSE; /* MOV tmp.w, zero */ - if (!submit_op1( emit, + if (!submit_op1( emit, inst_token( SVGA3DOP_MOV ), - writemask( tmp, TGSI_WRITEMASK_W ), + writemask( tmp, TGSI_WRITEMASK_W ), scalar( zero, TGSI_SWIZZLE_X ))) return FALSE; - + texcoord = src( tmp ); inst.op = SVGA3DOP_TEXLDL; } @@ -1380,7 +1380,7 @@ static boolean emit_tex4(struct svga_shader_emitter *emit, inst.value = 0; switch (insn->Instruction.Opcode) { - case TGSI_OPCODE_TXD: + case TGSI_OPCODE_TXD: inst.op = SVGA3DOP_TEXLDD; /* 4 args! */ break; default: @@ -1395,7 +1395,7 @@ static boolean emit_tex4(struct svga_shader_emitter *emit, static boolean emit_tex(struct svga_shader_emitter *emit, const struct tgsi_full_instruction *insn ) { - SVGA3dShaderDestToken dst = + SVGA3dShaderDestToken dst = translate_dst_register( emit, insn, 0 ); struct src_register src0 = translate_src_register( emit, &insn->Src[0] ); @@ -1475,7 +1475,7 @@ static boolean emit_tex(struct svga_shader_emitter *emit, return TRUE; } - else if (!emit->use_sm30 && dst.mask != TGSI_WRITEMASK_XYZW) + else if (!emit->use_sm30 && dst.mask != TGSI_WRITEMASK_XYZW) { if (!emit_op1( emit, inst_token( SVGA3DOP_MOV ), dst, src(tex_result) )) return FALSE; @@ -1569,21 +1569,21 @@ static boolean emit_deriv(struct svga_shader_emitter *emit, const struct tgsi_full_instruction *insn ) { if (emit->dynamic_branching_level > 0 && - insn->Src[0].Register.File == TGSI_FILE_TEMPORARY) + insn->Src[0].Register.File == TGSI_FILE_TEMPORARY) { struct src_register zero = get_zero_immediate( emit ); - SVGA3dShaderDestToken dst = + SVGA3dShaderDestToken dst = translate_dst_register( emit, insn, 0 ); /* Deriv opcodes not valid inside dynamic branching, workaround * by zeroing out the destination. */ - if (!submit_op1(emit, - inst_token( SVGA3DOP_MOV ), + if (!submit_op1(emit, + inst_token( SVGA3DOP_MOV ), dst, scalar(zero, TGSI_SWIZZLE_X))) return FALSE; - + return TRUE; } else { @@ -1630,7 +1630,7 @@ static boolean alias_src_dst( struct src_register src, if (src.base.num != dst.num) return FALSE; - if (SVGA3dShaderGetRegType(dst.value) != + if (SVGA3dShaderGetRegType(dst.value) != SVGA3dShaderGetRegType(src.base.value)) return FALSE; @@ -1646,11 +1646,11 @@ static boolean emit_pow(struct svga_shader_emitter *emit, struct src_register src1 = translate_src_register( emit, &insn->Src[1] ); boolean need_tmp = FALSE; - + /* POW can only output to a temporary */ if (insn->Dst[0].Register.File != TGSI_FILE_TEMPORARY) need_tmp = TRUE; - + /* POW src1 must not be the same register as dst */ if (alias_src_dst( src1, dst )) need_tmp = TRUE; @@ -1666,7 +1666,7 @@ static boolean emit_pow(struct svga_shader_emitter *emit, return FALSE; return submit_op1(emit, inst_token( SVGA3DOP_MOV ), dst, scalar(src(tmp), 0) ); - } + } else { return submit_op2(emit, inst_token( SVGA3DOP_POW ), dst, src0, src1); } @@ -1683,7 +1683,7 @@ static boolean emit_xpd(struct svga_shader_emitter *emit, boolean need_dst_tmp = FALSE; /* XPD can only output to a temporary */ - if (SVGA3dShaderGetRegType(dst.value) != SVGA3DREG_TEMP) + if (SVGA3dShaderGetRegType(dst.value) != SVGA3DREG_TEMP) need_dst_tmp = TRUE; /* The dst reg must not be the same as src0 or src1*/ @@ -1703,7 +1703,7 @@ static boolean emit_xpd(struct svga_shader_emitter *emit, if (!submit_op1(emit, inst_token( SVGA3DOP_MOV ), dst, src( tmp ))) return FALSE; - } + } else { if (!submit_op2(emit, inst_token( SVGA3DOP_CRS ), dst, src0, src1)) return FALSE; @@ -1714,8 +1714,8 @@ static boolean emit_xpd(struct svga_shader_emitter *emit, if (dst.mask & TGSI_WRITEMASK_W) { struct src_register zero = get_zero_immediate( emit ); - if (!submit_op1(emit, - inst_token( SVGA3DOP_MOV ), + if (!submit_op1(emit, + inst_token( SVGA3DOP_MOV ), writemask(dst, TGSI_WRITEMASK_W), zero)) return FALSE; @@ -1756,8 +1756,8 @@ static boolean emit_lrp(struct svga_shader_emitter *emit, if (need_dst_tmp) { if (!submit_op1(emit, inst_token( SVGA3DOP_MOV ), dst, src( tmp ))) - return FALSE; - } + return FALSE; + } return TRUE; } @@ -1803,16 +1803,16 @@ static boolean emit_dst_insn(struct svga_shader_emitter *emit, /* tmp.xw = 1.0 */ if (tmp.mask & TGSI_WRITEMASK_XW) { - if (!submit_op1( emit, inst_token( SVGA3DOP_MOV ), + if (!submit_op1( emit, inst_token( SVGA3DOP_MOV ), writemask(tmp, TGSI_WRITEMASK_XW ), scalar( zero, 3 ))) return FALSE; } - + /* tmp.yz = src0 */ if (tmp.mask & TGSI_WRITEMASK_YZ) { - if (!submit_op1( emit, inst_token( SVGA3DOP_MOV ), + if (!submit_op1( emit, inst_token( SVGA3DOP_MOV ), writemask(tmp, TGSI_WRITEMASK_YZ ), src0)) return FALSE; @@ -1821,7 +1821,7 @@ static boolean emit_dst_insn(struct svga_shader_emitter *emit, /* tmp.yw = tmp * src1 */ if (tmp.mask & TGSI_WRITEMASK_YW) { - if (!submit_op2( emit, inst_token( SVGA3DOP_MUL ), + if (!submit_op2( emit, inst_token( SVGA3DOP_MUL ), writemask(tmp, TGSI_WRITEMASK_YW ), src(tmp), src1)) @@ -1831,13 +1831,13 @@ static boolean emit_dst_insn(struct svga_shader_emitter *emit, /* dst = tmp */ if (need_tmp) { - if (!submit_op1( emit, inst_token( SVGA3DOP_MOV ), + if (!submit_op1( emit, inst_token( SVGA3DOP_MOV ), dst, src(tmp))) return FALSE; - } + } } - + return TRUE; } @@ -1945,9 +1945,9 @@ static boolean emit_lit(struct svga_shader_emitter *emit, /* tmp = pow(src.y, src.w) */ if (dst.mask & TGSI_WRITEMASK_Z) { - if (!submit_op2(emit, inst_token( SVGA3DOP_POW ), - tmp, - scalar(src0, 1), + if (!submit_op2(emit, inst_token( SVGA3DOP_POW ), + tmp, + scalar(src0, 1), scalar(src0, 3))) return FALSE; } @@ -1955,12 +1955,12 @@ static boolean emit_lit(struct svga_shader_emitter *emit, /* tmp.y = src.x */ if (dst.mask & TGSI_WRITEMASK_Y) { - if (!submit_op1( emit, inst_token( SVGA3DOP_MOV ), + if (!submit_op1( emit, inst_token( SVGA3DOP_MOV ), writemask(tmp, TGSI_WRITEMASK_Y ), scalar(src0, 0))) return FALSE; } - + /* Can't quite do this with emit conditional due to the extra * writemask on the predicated mov: */ @@ -1983,10 +1983,10 @@ static boolean emit_lit(struct svga_shader_emitter *emit, /* SETP src0.xxyy, GT, {0}.x */ if (!submit_op2( emit, setp_token, pred_reg, - predsrc, + predsrc, swizzle(zero, 0, 0, 0, 0) )) return FALSE; - + /* MOV dst, fail */ if (!submit_op1( emit, inst_token( SVGA3DOP_MOV ), dst, swizzle(zero, 3, 0, 0, 3 ))) @@ -2157,7 +2157,7 @@ static boolean emit_bgnsub( struct svga_shader_emitter *emit, * shader. */ emit->in_main_func = FALSE; - + for (i = 0; i < emit->nr_labels; i++) { if (emit->label[i] == position) { return (emit_instruction( emit, inst_token( SVGA3DOP_RET ) ) && @@ -2175,9 +2175,9 @@ static boolean emit_call( struct svga_shader_emitter *emit, { unsigned position = insn->Label.Label; unsigned i; - + for (i = 0; i < emit->nr_labels; i++) { - if (emit->label[i] == position) + if (emit->label[i] == position) break; } @@ -2441,7 +2441,7 @@ static boolean emit_ps_preamble( struct svga_shader_emitter *emit ) struct src_register zero = get_zero_immediate( emit ); for (i = 0; i < PIPE_MAX_COLOR_BUFS; i++) { if (SVGA3dShaderGetRegType(emit->true_col[i].value) != 0) { - + if (!submit_op1( emit, inst_token(SVGA3DOP_MOV), emit->temp_col[i], @@ -2450,7 +2450,7 @@ static boolean emit_ps_preamble( struct svga_shader_emitter *emit ) } } } - + return TRUE; } @@ -2514,7 +2514,7 @@ static boolean emit_vs_postamble( struct svga_shader_emitter *emit ) * touch PSIZ with a hand-crafted MOV below. */ if (SVGA3dShaderGetRegType(emit->true_psiz.value) != 0) { - + if (!submit_op1( emit, inst_token(SVGA3DOP_MOV), emit->true_psiz, @@ -2529,25 +2529,25 @@ static boolean emit_vs_postamble( struct svga_shader_emitter *emit ) SVGA3dShaderDestToken temp_pos = emit->temp_pos; SVGA3dShaderDestToken pos = emit->true_pos; unsigned offset = emit->info.file_max[TGSI_FILE_CONSTANT] + 1; - struct src_register prescale_scale = src_register( SVGA3DREG_CONST, - offset + 0 ); - struct src_register prescale_trans = src_register( SVGA3DREG_CONST, - offset + 1 ); + struct src_register prescale_scale = src_register( SVGA3DREG_CONST, + offset + 0 ); + struct src_register prescale_trans = src_register( SVGA3DREG_CONST, + offset + 1 ); /* MUL temp_pos.xyz, temp_pos, prescale.scale * MAD result.position, temp_pos.wwww, prescale.trans, temp_pos * --> Note that prescale.trans.w == 0 */ - if (!submit_op2( emit, - inst_token(SVGA3DOP_MUL), - writemask(temp_pos, TGSI_WRITEMASK_XYZ), + if (!submit_op2( emit, + inst_token(SVGA3DOP_MUL), + writemask(temp_pos, TGSI_WRITEMASK_XYZ), src(temp_pos), prescale_scale )) return FALSE; - if (!submit_op3( emit, - inst_token(SVGA3DOP_MAD), - pos, + if (!submit_op3( emit, + inst_token(SVGA3DOP_MAD), + pos, swizzle(src(temp_pos), 3, 3, 3, 3), prescale_trans, src(temp_pos))) @@ -2561,12 +2561,12 @@ static boolean emit_vs_postamble( struct svga_shader_emitter *emit ) /* Adjust GL clipping coordinate space to hardware (D3D-style): * * DP4 temp_pos.z, {0,0,.5,.5}, temp_pos - * MOV result.position, temp_pos + * MOV result.position, temp_pos */ - if (!submit_op2( emit, - inst_token(SVGA3DOP_DP4), - writemask(temp_pos, TGSI_WRITEMASK_Z), - imm_0055, + if (!submit_op2( emit, + inst_token(SVGA3DOP_DP4), + writemask(temp_pos, TGSI_WRITEMASK_Z), + imm_0055, src(temp_pos) )) return FALSE; @@ -2608,7 +2608,7 @@ static boolean emit_light_twoside( struct svga_shader_emitter *emit ) * to reset_temp_regs(). */ for (i = 0; i < count; i++) { - color[i] = dst_register( SVGA3DREG_TEMP, + color[i] = dst_register( SVGA3DREG_TEMP, emit->nr_hw_temp++ ); front[i] = emit->input_map[emit->internal_color_idx[i]]; @@ -2622,7 +2622,7 @@ static boolean emit_light_twoside( struct svga_shader_emitter *emit ) */ emit->input_map[emit->internal_color_idx[i]] = src(color[i]); } - + if_token = inst_token( SVGA3DOP_IFC ); if (emit->key.fkey.front_ccw) @@ -2644,7 +2644,7 @@ static boolean emit_light_twoside( struct svga_shader_emitter *emit ) if (!(emit_instruction( emit, inst_token( SVGA3DOP_ELSE)))) return FALSE; - + for (i = 0; i < count; i++) { if (!submit_op1( emit, inst_token( SVGA3DOP_MOV ), color[i], back[i] )) return FALSE; @@ -2924,14 +2924,14 @@ boolean svga_shader_emit_instructions( struct svga_shader_emitter *emit, if (!ret) goto done; break; - + case TGSI_TOKEN_TYPE_INSTRUCTION: if (!helpers_emitted) { if (!svga_shader_emit_helpers( emit )) goto done; helpers_emitted = TRUE; } - ret = svga_emit_instruction( emit, + ret = svga_emit_instruction( emit, line_nr++, &parse.FullToken.FullInstruction ); if (!ret) @@ -2940,7 +2940,7 @@ boolean svga_shader_emit_instructions( struct svga_shader_emitter *emit, default: break; } - + reset_temp_regs( emit ); } diff --git a/src/gallium/drivers/svga/svga_winsys.h b/src/gallium/drivers/svga/svga_winsys.h index 5e4bdef..b22dcb4 100644 --- a/src/gallium/drivers/svga/svga_winsys.h +++ b/src/gallium/drivers/svga/svga_winsys.h @@ -26,9 +26,9 @@ /** * @file * VMware SVGA specific winsys interface. - * + * * @author Jose Fonseca - * + * * Documentation taken from the VMware SVGA DDK. */ @@ -78,49 +78,49 @@ struct svga_winsys_context void (*destroy)(struct svga_winsys_context *swc); - void * - (*reserve)(struct svga_winsys_context *swc, + void * + (*reserve)(struct svga_winsys_context *swc, uint32_t nr_bytes, uint32_t nr_relocs ); - + /** * Emit a relocation for a host surface. - * + * * @param flags bitmask of SVGA_RELOC_* flags - * + * * NOTE: Order of this call does matter. It should be the same order * as relocations appear in the command buffer. */ void - (*surface_relocation)(struct svga_winsys_context *swc, - uint32 *sid, + (*surface_relocation)(struct svga_winsys_context *swc, + uint32 *sid, struct svga_winsys_surface *surface, unsigned flags); - + /** * Emit a relocation for a guest memory region. - * + * * @param flags bitmask of SVGA_RELOC_* flags - * + * * NOTE: Order of this call does matter. It should be the same order * as relocations appear in the command buffer. */ void - (*region_relocation)(struct svga_winsys_context *swc, - struct SVGAGuestPtr *ptr, + (*region_relocation)(struct svga_winsys_context *swc, + struct SVGAGuestPtr *ptr, struct svga_winsys_buffer *buffer, uint32 offset, unsigned flags); void (*commit)(struct svga_winsys_context *swc); - + enum pipe_error - (*flush)(struct svga_winsys_context *swc, + (*flush)(struct svga_winsys_context *swc, struct pipe_fence_handle **pfence); - /** + /** * Context ID used to fill in the commands - * + * * Context IDs are arbitrary small non-negative integers, * global to the entire SVGA device. */ @@ -135,12 +135,12 @@ struct svga_winsys_screen { void (*destroy)(struct svga_winsys_screen *sws); - + boolean (*get_cap)(struct svga_winsys_screen *sws, SVGA3dDevCapIndex index, SVGA3dDevCapResult *result); - + /** * Create a new context. * @@ -153,8 +153,8 @@ struct svga_winsys_screen */ struct svga_winsys_context * (*context_create)(struct svga_winsys_screen *sws); - - + + /** * This creates a "surface" object in the SVGA3D device, * and returns the surface ID (sid). Surfaces are generic @@ -222,7 +222,7 @@ struct svga_winsys_screen * Reference a SVGA3D surface object. This allows sharing of a * surface between different objects. */ - void + void (*surface_reference)(struct svga_winsys_screen *sws, struct svga_winsys_surface **pdst, struct svga_winsys_surface *src); @@ -236,25 +236,25 @@ struct svga_winsys_screen * SSE instructions. */ struct svga_winsys_buffer * - (*buffer_create)( struct svga_winsys_screen *sws, - unsigned alignment, + (*buffer_create)( struct svga_winsys_screen *sws, + unsigned alignment, unsigned usage, unsigned size ); - /** + /** * Map the entire data store of a buffer object into the client's address. * flags is a bitmaks of PIPE_TRANSFER_* */ void * - (*buffer_map)( struct svga_winsys_screen *sws, + (*buffer_map)( struct svga_winsys_screen *sws, struct svga_winsys_buffer *buf, unsigned flags ); - - void - (*buffer_unmap)( struct svga_winsys_screen *sws, + + void + (*buffer_unmap)( struct svga_winsys_screen *sws, struct svga_winsys_buffer *buf ); - void + void (*buffer_destroy)( struct svga_winsys_screen *sws, struct svga_winsys_buffer *buf ); diff --git a/src/gallium/drivers/svga/svgadump/svga_dump.c b/src/gallium/drivers/svga/svgadump/svga_dump.c index d59fb89..f43eeab 100644 --- a/src/gallium/drivers/svga/svgadump/svga_dump.c +++ b/src/gallium/drivers/svga/svgadump/svga_dump.c @@ -1443,12 +1443,12 @@ dump_SVGA3dCmdBlitSurfaceToScreen(const SVGA3dCmdBlitSurfaceToScreen *cmd) } -void +void svga_dump_command(uint32_t cmd_id, const void *data, uint32_t size) { const uint8_t *body = (const uint8_t *)data; const uint8_t *next = body + size; - + switch(cmd_id) { case SVGA_3D_CMD_SURFACE_DEFINE: _debug_printf("\tSVGA_3D_CMD_SURFACE_DEFINE\n"); @@ -1640,7 +1640,7 @@ svga_dump_command(uint32_t cmd_id, const void *data, uint32_t size) const SVGA3dCmdDefineShader *cmd = (const SVGA3dCmdDefineShader *)body; dump_SVGA3dCmdDefineShader(cmd); body = (const uint8_t *)&cmd[1]; - svga_shader_dump((const uint32_t *)body, + svga_shader_dump((const uint32_t *)body, (unsigned)(next - body)/sizeof(uint32_t), FALSE ); body = next; @@ -1749,14 +1749,14 @@ svga_dump_command(uint32_t cmd_id, const void *data, uint32_t size) } -void +void svga_dump_commands(const void *commands, uint32_t size) { const uint8_t *next = commands; const uint8_t *last = next + size; - + assert(size % sizeof(uint32_t) == 0); - + while(next < last) { const uint32_t cmd_id = *(const uint32_t *)next; diff --git a/src/gallium/drivers/svga/svgadump/svga_dump.h b/src/gallium/drivers/svga/svgadump/svga_dump.h index ca01543..7f3df4a 100644 --- a/src/gallium/drivers/svga/svgadump/svga_dump.h +++ b/src/gallium/drivers/svga/svgadump/svga_dump.h @@ -28,7 +28,7 @@ #include "pipe/p_compiler.h" -void +void svga_dump_command(uint32_t cmd_id, const void *data, uint32_t size); void diff --git a/src/gallium/drivers/svga/svgadump/svga_shader.h b/src/gallium/drivers/svga/svgadump/svga_shader.h index 5db64bf..d361e78 100644 --- a/src/gallium/drivers/svga/svgadump/svga_shader.h +++ b/src/gallium/drivers/svga/svgadump/svga_shader.h @@ -26,7 +26,7 @@ /** * @file * SVGA Shader Token Definitions - * + * * @author Michal Krol */ diff --git a/src/gallium/drivers/svga/svgadump/svga_shader_dump.c b/src/gallium/drivers/svga/svgadump/svga_shader_dump.c index 4ee1bf2..1db441a 100644 --- a/src/gallium/drivers/svga/svgadump/svga_shader_dump.c +++ b/src/gallium/drivers/svga/svgadump/svga_shader_dump.c @@ -26,7 +26,7 @@ /** * @file * SVGA Shader Dump Facilities - * + * * @author Michal Krol */ diff --git a/src/gallium/drivers/svga/svgadump/svga_shader_dump.h b/src/gallium/drivers/svga/svgadump/svga_shader_dump.h index a2657ac..0147509 100644 --- a/src/gallium/drivers/svga/svgadump/svga_shader_dump.h +++ b/src/gallium/drivers/svga/svgadump/svga_shader_dump.h @@ -26,7 +26,7 @@ /** * @file * SVGA Shader Dump Facilities - * + * * @author Michal Krol */ diff --git a/src/gallium/drivers/svga/svgadump/svga_shader_op.c b/src/gallium/drivers/svga/svgadump/svga_shader_op.c index 95612a8..b7bfaca 100644 --- a/src/gallium/drivers/svga/svgadump/svga_shader_op.c +++ b/src/gallium/drivers/svga/svgadump/svga_shader_op.c @@ -26,7 +26,7 @@ /** * @file * SVGA Shader Token Opcode Info - * + * * @author Michal Krol */ diff --git a/src/gallium/drivers/svga/svgadump/svga_shader_op.h b/src/gallium/drivers/svga/svgadump/svga_shader_op.h index a5ccae5..d9709d1 100644 --- a/src/gallium/drivers/svga/svgadump/svga_shader_op.h +++ b/src/gallium/drivers/svga/svgadump/svga_shader_op.h @@ -26,7 +26,7 @@ /** * @file * SVGA Shader Token Opcode Info - * + * * @author Michal Krol */ diff --git a/src/gallium/drivers/trace/tr_context.h b/src/gallium/drivers/trace/tr_context.h index dadbe56..faab674 100644 --- a/src/gallium/drivers/trace/tr_context.h +++ b/src/gallium/drivers/trace/tr_context.h @@ -41,7 +41,7 @@ extern "C" { struct trace_screen; - + struct trace_context { struct pipe_context base; diff --git a/src/gallium/drivers/trace/tr_screen.c b/src/gallium/drivers/trace/tr_screen.c index c2de2da..fe70463 100644 --- a/src/gallium/drivers/trace/tr_screen.c +++ b/src/gallium/drivers/trace/tr_screen.c @@ -380,7 +380,7 @@ trace_screen_fence_reference(struct pipe_screen *_screen, assert(pdst); dst = *pdst; - + trace_dump_call_begin("pipe_screen", "fence_reference"); trace_dump_arg(ptr, screen); diff --git a/src/gallium/include/pipe/p_compiler.h b/src/gallium/include/pipe/p_compiler.h index 3d6b5b5..abfb16f 100644 --- a/src/gallium/include/pipe/p_compiler.h +++ b/src/gallium/include/pipe/p_compiler.h @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2007-2008 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ #ifndef P_COMPILER_H diff --git a/src/gallium/include/pipe/p_config.h b/src/gallium/include/pipe/p_config.h index 74a1fa2..c9fb0b3 100644 --- a/src/gallium/include/pipe/p_config.h +++ b/src/gallium/include/pipe/p_config.h @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas. * 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,24 +22,24 @@ * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * + * **************************************************************************/ /** * @file * Gallium configuration defines. - * - * This header file sets several defines based on the compiler, processor - * architecture, and operating system being used. These defines should be used - * throughout the code to facilitate porting to new platforms. It is likely that - * this file is auto-generated by an autoconf-like tool at some point, as some - * things cannot be determined by pre-defined environment alone. - * + * + * This header file sets several defines based on the compiler, processor + * architecture, and operating system being used. These defines should be used + * throughout the code to facilitate porting to new platforms. It is likely that + * this file is auto-generated by an autoconf-like tool at some point, as some + * things cannot be determined by pre-defined environment alone. + * * See also: * - http://gcc.gnu.org/onlinedocs/cpp/Common-Predefined-Macros.html * - echo | gcc -dM -E - | sort * - http://msdn.microsoft.com/en-us/library/b0084kay.aspx - * + * * @author José Fonseca */ @@ -61,8 +61,8 @@ * - 1400: Visual C++ 2005 * - 1310: Visual C++ .NET 2003 * - 1300: Visual C++ .NET 2002 - * - * __MSC__ seems to be an old macro -- it is not pre-defined on recent MSVC + * + * __MSC__ seems to be an old macro -- it is not pre-defined on recent MSVC * versions. */ #if defined(_MSC_VER) || defined(__MSC__) @@ -124,7 +124,7 @@ /* * Auto-detect the operating system family. - * + * * See subsystem below for a more fine-grained distinction. */ @@ -182,7 +182,7 @@ /* * Try to auto-detect the subsystem. - * + * * NOTE: There is no way to auto-detect most of these. */ @@ -192,9 +192,9 @@ #if defined(PIPE_OS_WINDOWS) #if defined(PIPE_SUBSYSTEM_WINDOWS_DISPLAY) -/* Windows 2000/XP Display Driver */ +/* Windows 2000/XP Display Driver */ #elif defined(PIPE_SUBSYSTEM_WINDOWS_MINIPORT) -/* Windows 2000/XP Miniport Driver */ +/* Windows 2000/XP Miniport Driver */ #elif defined(PIPE_SUBSYSTEM_WINDOWS_USER) /* Windows User-space Library */ #elif defined(PIPE_SUBSYSTEM_WINDOWS_CE) @@ -203,7 +203,7 @@ #ifdef _WIN32_WCE #define PIPE_SUBSYSTEM_WINDOWS_CE #else /* !_WIN32_WCE */ -#error No PIPE_SUBSYSTEM_WINDOWS_xxx subsystem defined. +#error No PIPE_SUBSYSTEM_WINDOWS_xxx subsystem defined. #endif /* !_WIN32_WCE */ #endif #endif /* PIPE_OS_WINDOWS */ diff --git a/src/gallium/include/pipe/p_context.h b/src/gallium/include/pipe/p_context.h index 589cac2..da0d6fa 100644 --- a/src/gallium/include/pipe/p_context.h +++ b/src/gallium/include/pipe/p_context.h @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ #ifndef PIPE_CONTEXT_H diff --git a/src/gallium/include/pipe/p_defines.h b/src/gallium/include/pipe/p_defines.h index f5af15f..bcabcbc 100644 --- a/src/gallium/include/pipe/p_defines.h +++ b/src/gallium/include/pipe/p_defines.h @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ #ifndef PIPE_DEFINES_H @@ -92,7 +92,7 @@ enum pipe_error { #define PIPE_LOGICOP_COPY 12 #define PIPE_LOGICOP_OR_REVERSE 13 #define PIPE_LOGICOP_OR 14 -#define PIPE_LOGICOP_SET 15 +#define PIPE_LOGICOP_SET 15 #define PIPE_MASK_R 0x1 #define PIPE_MASK_G 0x2 @@ -172,7 +172,7 @@ enum pipe_texture_target { #define PIPE_TEX_MIPFILTER_LINEAR 1 #define PIPE_TEX_MIPFILTER_NONE 2 -/* Within a mipmap, ie min/mag filter +/* Within a mipmap, ie min/mag filter */ #define PIPE_TEX_FILTER_NEAREST 0 #define PIPE_TEX_FILTER_LINEAR 1 @@ -199,7 +199,7 @@ enum pipe_transfer_usage { * create time. */ PIPE_TRANSFER_READ = (1 << 0), - + /** * Resource contents will be written back at transfer_destroy * time (or modified as a result of being accessed directly). @@ -211,7 +211,7 @@ enum pipe_transfer_usage { */ PIPE_TRANSFER_READ_WRITE = PIPE_TRANSFER_READ | PIPE_TRANSFER_WRITE, - /** + /** * The transfer should map the texture storage directly. The driver may * return NULL if that isn't possible, and the state tracker needs to cope * with that and use an alternative path without this flag. @@ -332,7 +332,7 @@ enum pipe_transfer_usage { #define PIPE_TEXTURE_GEOM_NON_POWER_OF_TWO 0x2 -/** +/** * Flush types: */ #define PIPE_FLUSH_RENDER_CACHE 0x1 diff --git a/src/gallium/include/pipe/p_format.h b/src/gallium/include/pipe/p_format.h index 22cc7aa..25ec754 100644 --- a/src/gallium/include/pipe/p_format.h +++ b/src/gallium/include/pipe/p_format.h @@ -1,9 +1,9 @@ /************************************************************************** - * + * * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas. * Copyright (c) 2008 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 @@ -11,11 +11,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. @@ -23,7 +23,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. - * + * **************************************************************************/ #ifndef PIPE_FORMAT_H diff --git a/src/gallium/include/pipe/p_screen.h b/src/gallium/include/pipe/p_screen.h index 850eb84..e5efaa4 100644 --- a/src/gallium/include/pipe/p_screen.h +++ b/src/gallium/include/pipe/p_screen.h @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas. * 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,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. - * + * **************************************************************************/ /** * @file - * + * * Screen, Adapter or GPU * * These are driver functions/facilities that are context independent. diff --git a/src/gallium/include/pipe/p_shader_tokens.h b/src/gallium/include/pipe/p_shader_tokens.h index ba433b2..74cbb9c 100644 --- a/src/gallium/include/pipe/p_shader_tokens.h +++ b/src/gallium/include/pipe/p_shader_tokens.h @@ -1,9 +1,9 @@ /************************************************************************** - * + * * Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas. * Copyright 2009-2010 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 @@ -11,11 +11,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. @@ -23,7 +23,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. - * + * **************************************************************************/ #ifndef P_SHADER_TOKENS_H @@ -196,8 +196,8 @@ struct tgsi_property_data { unsigned Data; }; -/* TGSI opcodes. - * +/* TGSI opcodes. + * * For more information on semantics of opcodes and * which APIs are known to use which opcodes, see * gallium/docs/source/tgsi.rst @@ -376,9 +376,9 @@ struct tgsi_instruction * If tgsi_instruction::Label is TRUE, tgsi_instruction_label follows. * * If tgsi_instruction::Texture is TRUE, tgsi_instruction_texture follows. - * + * * Then, tgsi_instruction::NumDstRegs of tgsi_dst_register follow. - * + * * Then, tgsi_instruction::NumSrcRegs of tgsi_src_register follow. * * tgsi_instruction::NrTokens contains the total number of words that make the @@ -460,7 +460,7 @@ struct tgsi_src_register /** * If tgsi_src_register::Modifier is TRUE, tgsi_src_register_modifier follows. - * + * * Then, if tgsi_src_register::Indirect is TRUE, another tgsi_src_register * follows. * diff --git a/src/gallium/include/pipe/p_state.h b/src/gallium/include/pipe/p_state.h index 226ae86..b362c7c 100644 --- a/src/gallium/include/pipe/p_state.h +++ b/src/gallium/include/pipe/p_state.h @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas. * All Rights Reserved. - * + * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including @@ -10,11 +10,11 @@ * distribute, sub license, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: - * + * * The above copyright notice and this permission notice (including the * next paragraph) shall be included in all copies or substantial portions * of the Software. - * + * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. @@ -22,13 +22,13 @@ * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * + * **************************************************************************/ /** * @file - * + * * Abstract graphics pipe state objects. * * Basic notes: @@ -102,13 +102,13 @@ struct pipe_rasterizer_state unsigned line_stipple_pattern:16; unsigned line_last_pixel:1; - /** + /** * Use the first vertex of a primitive as the provoking vertex for * flat shading. */ - unsigned flatshade_first:1; + unsigned flatshade_first:1; - /** + /** * When true, triangle rasterization uses (0.5, 0.5) pixel centers * for determining pixel ownership. * @@ -164,7 +164,7 @@ struct pipe_shader_state }; -struct pipe_depth_state +struct pipe_depth_state { unsigned enabled:1; /**< depth test enabled? */ unsigned writemask:1; /**< allow depth buffer writes? */ @@ -430,7 +430,7 @@ struct pipe_vertex_element * this attribute live in? */ unsigned vertex_buffer_index; - + enum pipe_format src_format; }; @@ -479,5 +479,5 @@ struct pipe_draw_info #ifdef __cplusplus } #endif - + #endif diff --git a/src/gallium/include/state_tracker/sw_winsys.h b/src/gallium/include/state_tracker/sw_winsys.h index 0b11fe3..dd615f5 100644 --- a/src/gallium/include/state_tracker/sw_winsys.h +++ b/src/gallium/include/state_tracker/sw_winsys.h @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2007-2009 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. - * + * **************************************************************************/ /** @@ -59,29 +59,29 @@ struct sw_displaytarget; /** * This is the interface that sw expects any window system * hosting it to implement. - * + * * sw is for the most part a self sufficient driver. The only thing it * does not know is how to display a surface. */ struct sw_winsys { - void + void (*destroy)( struct sw_winsys *ws ); boolean (*is_displaytarget_format_supported)( struct sw_winsys *ws, unsigned tex_usage, enum pipe_format format ); - + /** * Allocate storage for a render target. - * + * * Often surfaces which are meant to be blitted to the front screen (i.e., - * display targets) must be allocated with special characteristics, memory + * display targets) must be allocated with special characteristics, memory * pools, or obtained directly from the windowing system. - * + * * This callback is invoked by the pipe_screen when creating a texture marked - * with the PIPE_BIND_DISPLAY_TARGET flag to get the underlying + * with the PIPE_BIND_DISPLAY_TARGET flag to get the underlying * storage. */ struct sw_displaytarget * @@ -113,7 +113,7 @@ struct sw_winsys * \param flags bitmask of PIPE_TRANSFER_x flags */ void * - (*displaytarget_map)( struct sw_winsys *ws, + (*displaytarget_map)( struct sw_winsys *ws, struct sw_displaytarget *dt, unsigned flags ); @@ -127,12 +127,12 @@ struct sw_winsys * This call will likely become asynchronous eventually. */ void - (*displaytarget_display)( struct sw_winsys *ws, + (*displaytarget_display)( struct sw_winsys *ws, struct sw_displaytarget *dt, void *context_private ); - void - (*displaytarget_destroy)( struct sw_winsys *ws, + void + (*displaytarget_destroy)( struct sw_winsys *ws, struct sw_displaytarget *dt ); }; diff --git a/src/gallium/state_trackers/d3d1x/gd3d10/Makefile b/src/gallium/state_trackers/d3d1x/gd3d10/Makefile index 300149d..cd2d44e 100644 --- a/src/gallium/state_trackers/d3d1x/gd3d10/Makefile +++ b/src/gallium/state_trackers/d3d1x/gd3d10/Makefile @@ -7,7 +7,7 @@ GEN_D3D10=perl d3d10.pl include ../Makefile.inc d3d10.generated.o: d3d10_objects.generated.h d3d10_screen.generated.h d3d10_context.generated.h d3d10_misc.generated.h - + d3d10.generated.cpp: ../gd3d11/d3d11.cpp d3d10.pl $(GEN_D3D10) $< > $@ d3d10_objects.generated.h: ../gd3d11/d3d11_objects.h d3d10.pl diff --git a/src/gallium/state_trackers/d3d1x/gd3d11/d3d11_context.h b/src/gallium/state_trackers/d3d1x/gd3d11/d3d11_context.h index e1ba6c1..9ee2604 100644 --- a/src/gallium/state_trackers/d3d1x/gd3d11/d3d11_context.h +++ b/src/gallium/state_trackers/d3d1x/gd3d11/d3d11_context.h @@ -1441,8 +1441,8 @@ struct GalliumD3D10Device : public GalliumD3D10ScreenImpl return subresource / levels; } } - - + + /* TODO: deferred contexts will need a different implementation of this, * because we can't put the transfer info into the resource itself. * Also, there are very different restrictions, for obvious reasons. diff --git a/src/gallium/state_trackers/dri/common/dri_drawable.c b/src/gallium/state_trackers/dri/common/dri_drawable.c index 6193670..203d373 100644 --- a/src/gallium/state_trackers/dri/common/dri_drawable.c +++ b/src/gallium/state_trackers/dri/common/dri_drawable.c @@ -37,7 +37,7 @@ #include "util/u_format.h" #include "util/u_memory.h" #include "util/u_inlines.h" - + static boolean dri_st_framebuffer_validate(struct st_framebuffer_iface *stfbi, diff --git a/src/gallium/state_trackers/egl/Makefile b/src/gallium/state_trackers/egl/Makefile index da91221..059ff31 100644 --- a/src/gallium/state_trackers/egl/Makefile +++ b/src/gallium/state_trackers/egl/Makefile @@ -70,7 +70,7 @@ default: depend libegl.a libegl.a: $(EGL_OBJECTS) Makefile $(MKLIB) -o egl -static $(EGL_OBJECTS) -depend: +depend: rm -f depend touch depend $(MKDEP) $(MKDEP_OPTIONS) $(ALL_INCLUDES) $(ALL_SOURCES) 2> /dev/null diff --git a/src/gallium/state_trackers/egl/common/egl_g3d.c b/src/gallium/state_trackers/egl/common/egl_g3d.c index 65826a7..48686c3 100644 --- a/src/gallium/state_trackers/egl/common/egl_g3d.c +++ b/src/gallium/state_trackers/egl/common/egl_g3d.c @@ -412,7 +412,7 @@ egl_g3d_invalid_surface(struct native_display *ndpy, /* XXX not thread safe? */ struct egl_g3d_surface *gsurf = egl_g3d_surface(nsurf->user_data); struct egl_g3d_context *gctx; - + /* * Some functions such as egl_g3d_copy_buffers create a temporary native * surface. There is no gsurf associated with it. diff --git a/src/gallium/state_trackers/egl/common/egl_g3d_st.c b/src/gallium/state_trackers/egl/common/egl_g3d_st.c index 2b944b5..dc336ea 100644 --- a/src/gallium/state_trackers/egl/common/egl_g3d_st.c +++ b/src/gallium/state_trackers/egl/common/egl_g3d_st.c @@ -196,7 +196,7 @@ egl_g3d_st_framebuffer_flush_front(struct st_framebuffer_iface *stfbi, NATIVE_ATTACHMENT_FRONT_LEFT, FALSE, 0); } -static boolean +static boolean egl_g3d_st_framebuffer_validate(struct st_framebuffer_iface *stfbi, const enum st_attachment_type *statts, unsigned count, diff --git a/src/gallium/state_trackers/egl/psl1ght/native_psl1ght.c b/src/gallium/state_trackers/egl/psl1ght/native_psl1ght.c index 39a4df7..08ac0c5 100644 --- a/src/gallium/state_trackers/egl/psl1ght/native_psl1ght.c +++ b/src/gallium/state_trackers/egl/psl1ght/native_psl1ght.c @@ -446,7 +446,7 @@ psl1ght_display_add_modes(struct native_connector *nconn, return FALSE; for (i=0; irefreshRates & rates[i].from) - if (!psl1ght_display_add_mode(nconn, vmode, &vres, rates[i].from, + if (!psl1ght_display_add_mode(nconn, vmode, &vres, rates[i].from, rates[i].to, rates[i].name)) return FALSE; return TRUE; @@ -465,7 +465,7 @@ psl1ght_display_init_connector(struct native_connector *nconn, u32 videoOut) for(i=0; ideviceInfo.availableModeCount; i++) if (!psl1ght_display_add_modes(nconn, &psconn->deviceInfo.availableModes[i])) return FALSE; - + return TRUE; } diff --git a/src/gallium/state_trackers/egl/x11/glcore.h b/src/gallium/state_trackers/egl/x11/glcore.h index 547b111..3879727 100644 --- a/src/gallium/state_trackers/egl/x11/glcore.h +++ b/src/gallium/state_trackers/egl/x11/glcore.h @@ -58,11 +58,11 @@ typedef struct __GLcontextRec __GLcontext; * kept around in the context so that values can be used during * command execution, and for returning information about the * context to the application. - * + * * Instances of this structure are shared by the driver and the loader. To * maintain binary compatability, new fields \b must be added only to the * end of the structure. - * + * * \sa _gl_context_modes_create */ typedef struct __GLcontextModesRec { @@ -95,7 +95,7 @@ typedef struct __GLcontextModesRec { /* GLX */ GLint visualID; - GLint visualType; /**< One of the GLX X visual types. (i.e., + GLint visualType; /**< One of the GLX X visual types. (i.e., * \c GLX_TRUE_COLOR, etc.) */ diff --git a/src/gallium/state_trackers/glx/xlib/glx_api.c b/src/gallium/state_trackers/glx/xlib/glx_api.c index 205a7e3..def520a 100644 --- a/src/gallium/state_trackers/glx/xlib/glx_api.c +++ b/src/gallium/state_trackers/glx/xlib/glx_api.c @@ -243,8 +243,8 @@ save_glx_visual( Display *dpy, XVisualInfo *vinfo, */ xmvis->vishandle = vinfo; /* Allocate more space for additional visual */ - VisualTable = (XMesaVisual *) _mesa_realloc( VisualTable, - sizeof(XMesaVisual) * NumVisuals, + VisualTable = (XMesaVisual *) _mesa_realloc( VisualTable, + sizeof(XMesaVisual) * NumVisuals, sizeof(XMesaVisual) * (NumVisuals + 1)); /* add xmvis to the list */ VisualTable[NumVisuals] = xmvis; @@ -408,7 +408,7 @@ get_visual( Display *dpy, int scr, unsigned int depth, int xclass ) return NULL; } } - + return vis; } @@ -461,7 +461,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 @@ -974,13 +974,13 @@ choose_visual( Display *dpy, int screen, const int *list, GLboolean fbConfig ) if (stencil_size > 0) stencil_size = STENCIL_BITS; - 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; @@ -1130,7 +1130,7 @@ glXMakeContextCurrent( Display *dpy, GLXDrawable draw, MakeCurrent_PrevDrawBuffer == drawBuffer && MakeCurrent_PrevReadBuffer == readBuffer) return True; - + MakeCurrent_PrevContext = ctx; MakeCurrent_PrevDrawable = draw; MakeCurrent_PrevReadable = read; @@ -1796,7 +1796,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 */ diff --git a/src/gallium/state_trackers/glx/xlib/glx_getproc.c b/src/gallium/state_trackers/glx/xlib/glx_getproc.c index 26fcae7..7d68b8c 100644 --- a/src/gallium/state_trackers/glx/xlib/glx_getproc.c +++ b/src/gallium/state_trackers/glx/xlib/glx_getproc.c @@ -1,20 +1,20 @@ /* * Mesa 3-D graphics library * Version: 7.6 - * + * * Copyright (C) 1999-2008 Brian Paul All Rights Reserved. * Copyright (C) 2009 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 without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: - * + * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. - * + * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL diff --git a/src/gallium/state_trackers/glx/xlib/xm_api.c b/src/gallium/state_trackers/glx/xlib/xm_api.c index 7c47a25..dac7e6d 100644 --- a/src/gallium/state_trackers/glx/xlib/xm_api.c +++ b/src/gallium/state_trackers/glx/xlib/xm_api.c @@ -315,7 +315,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 @@ -607,12 +607,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. @@ -901,9 +901,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); */ @@ -1196,7 +1196,7 @@ void XMesaSwapBuffers( XMesaBuffer b ) if (xmctx && xmctx->xm_buffer == b) { xmctx->st->flush( xmctx->st, - PIPE_FLUSH_RENDER_CACHE | + PIPE_FLUSH_RENDER_CACHE | PIPE_FLUSH_SWAPBUFFERS | PIPE_FLUSH_FRAME, NULL); diff --git a/src/gallium/state_trackers/glx/xlib/xm_api.h b/src/gallium/state_trackers/glx/xlib/xm_api.h index 4ea42dc..82f0b32 100644 --- a/src/gallium/state_trackers/glx/xlib/xm_api.h +++ b/src/gallium/state_trackers/glx/xlib/xm_api.h @@ -1,19 +1,19 @@ /* * Mesa 3-D graphics library * Version: 7.1 - * + * * Copyright (C) 1999-2007 Brian Paul All Rights Reserved. - * + * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: - * + * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. - * + * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL diff --git a/src/gallium/state_trackers/glx/xlib/xm_public.h b/src/gallium/state_trackers/glx/xlib/xm_public.h index 950eb21..9f6c201 100644 --- a/src/gallium/state_trackers/glx/xlib/xm_public.h +++ b/src/gallium/state_trackers/glx/xlib/xm_public.h @@ -1,9 +1,9 @@ /************************************************************************** - * + * * Copyright 2006 Tungsten Graphics, Inc., Cedar Park, Texas. * 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 @@ -11,11 +11,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. @@ -23,7 +23,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. - * + * **************************************************************************/ #ifndef XM_PUBLIC_H @@ -34,7 +34,7 @@ struct pipe_screen; struct st_api; -/* This is the driver interface required by the glx/xlib state tracker. +/* This is the driver interface required by the glx/xlib state tracker. */ struct xm_driver { struct pipe_screen *(*create_pipe_screen)( Display *display ); diff --git a/src/gallium/state_trackers/glx/xlib/xm_st.c b/src/gallium/state_trackers/glx/xlib/xm_st.c index 6bfe8b0..9bf25f1 100644 --- a/src/gallium/state_trackers/glx/xlib/xm_st.c +++ b/src/gallium/state_trackers/glx/xlib/xm_st.c @@ -196,7 +196,7 @@ xmesa_st_framebuffer_validate_textures(struct st_framebuffer_iface *stfbi, * \param count number of framebuffer attachments in statts[] * \param out returns resources for each of the attachments */ -static boolean +static boolean xmesa_st_framebuffer_validate(struct st_framebuffer_iface *stfbi, const enum st_attachment_type *statts, unsigned count, diff --git a/src/gallium/state_trackers/python/st_device.c b/src/gallium/state_trackers/python/st_device.c index d0a4295..51b13d7 100644 --- a/src/gallium/state_trackers/python/st_device.c +++ b/src/gallium/state_trackers/python/st_device.c @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ @@ -42,17 +42,17 @@ static void -st_device_really_destroy(struct st_device *st_dev) +st_device_really_destroy(struct st_device *st_dev) { if(st_dev->screen) { - /* FIXME: Don't really destroy until we keep track of every single - * reference or we end up causing a segmentation fault every time + /* FIXME: Don't really destroy until we keep track of every single + * reference or we end up causing a segmentation fault every time * python exits. */ #if 0 st_dev->screen->destroy(st_dev->screen); #endif } - + FREE(st_dev); } @@ -69,7 +69,7 @@ st_device_reference(struct st_device **ptr, struct st_device *st_dev) void -st_device_destroy(struct st_device *st_dev) +st_device_destroy(struct st_device *st_dev) { st_device_reference(&st_dev, NULL); } @@ -93,10 +93,10 @@ st_device_create(boolean hardware) st_dev = CALLOC_STRUCT(st_device); if (!st_dev) goto no_device; - + pipe_reference_init(&st_dev->reference, 1); st_dev->screen = screen; - + return st_dev; no_device: @@ -107,23 +107,23 @@ st_device_create(boolean hardware) void -st_context_destroy(struct st_context *st_ctx) +st_context_destroy(struct st_context *st_ctx) { unsigned i; - + if(st_ctx) { struct st_device *st_dev = st_ctx->st_dev; - + if(st_ctx->cso) { cso_delete_vertex_shader(st_ctx->cso, st_ctx->vs); cso_delete_fragment_shader(st_ctx->cso, st_ctx->fs); - + cso_destroy_context(st_ctx->cso); } - + if(st_ctx->pipe) st_ctx->pipe->destroy(st_ctx->pipe); - + for(i = 0; i < PIPE_MAX_SAMPLERS; ++i) pipe_sampler_view_reference(&st_ctx->fragment_sampler_views[i], NULL); for(i = 0; i < PIPE_MAX_VERTEX_SAMPLERS; ++i) @@ -131,23 +131,23 @@ st_context_destroy(struct st_context *st_ctx) pipe_resource_reference(&st_ctx->default_texture, NULL); FREE(st_ctx); - + st_device_reference(&st_dev, NULL); } } struct st_context * -st_context_create(struct st_device *st_dev) +st_context_create(struct st_device *st_dev) { struct st_context *st_ctx; - + st_ctx = CALLOC_STRUCT(st_context); if(!st_ctx) return NULL; - + st_device_reference(&st_ctx->st_dev, st_dev); - + st_ctx->pipe = st_dev->screen->context_create(st_dev->screen, NULL); if(!st_ctx->pipe) { st_context_destroy(st_ctx); @@ -159,7 +159,7 @@ st_context_create(struct st_device *st_dev) st_context_destroy(st_ctx); return NULL; } - + /* disabled blending/masking */ { struct pipe_blend_state blend; @@ -243,12 +243,12 @@ st_context_create(struct st_device *st_dev) templat.array_size = 1; templat.last_level = 0; templat.bind = PIPE_BIND_SAMPLER_VIEW; - + st_ctx->default_texture = screen->resource_create( screen, &templat ); if(st_ctx->default_texture) { struct pipe_box box; uint32_t zero = 0; - + u_box_origin_2d( 1, 1, &box ); pipe->transfer_inline_write(pipe, @@ -282,14 +282,14 @@ st_context_create(struct st_device *st_dev) pipe_sampler_view_reference(&view, NULL); } - + /* vertex shader */ { const uint semantic_names[] = { TGSI_SEMANTIC_POSITION, TGSI_SEMANTIC_GENERIC }; const uint semantic_indexes[] = { 0, 0 }; - st_ctx->vs = util_make_vertex_passthrough_shader(st_ctx->pipe, - 2, + st_ctx->vs = util_make_vertex_passthrough_shader(st_ctx->pipe, + 2, semantic_names, semantic_indexes); cso_set_vertex_shader_handle(st_ctx->cso, st_ctx->vs); diff --git a/src/gallium/state_trackers/python/st_device.h b/src/gallium/state_trackers/python/st_device.h index 53e2556..506bd2e 100644 --- a/src/gallium/state_trackers/python/st_device.h +++ b/src/gallium/state_trackers/python/st_device.h @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ @@ -35,7 +35,7 @@ struct cso_context; struct pipe_screen; struct pipe_context; -struct st_winsys; +struct st_winsys; struct st_surface @@ -49,11 +49,11 @@ struct st_surface struct st_context { struct st_device *st_dev; - + struct pipe_context *pipe; - + struct cso_context *cso; - + void *vs; void *fs; void *gs; @@ -61,13 +61,13 @@ struct st_context struct pipe_resource *default_texture; struct pipe_sampler_view *fragment_sampler_views[PIPE_MAX_SAMPLERS]; struct pipe_sampler_view *vertex_sampler_views[PIPE_MAX_VERTEX_SAMPLERS]; - + unsigned num_vertex_buffers; struct pipe_vertex_buffer vertex_buffers[PIPE_MAX_ATTRIBS]; - + unsigned num_vertex_elements; struct pipe_vertex_element vertex_elements[PIPE_MAX_ATTRIBS]; - + struct pipe_framebuffer_state framebuffer; }; @@ -82,7 +82,7 @@ struct st_device static INLINE struct pipe_surface * -st_pipe_surface(struct pipe_context *pipe, struct st_surface *surface, unsigned usage) +st_pipe_surface(struct pipe_context *pipe, struct st_surface *surface, unsigned usage) { struct pipe_resource *texture = surface->texture; struct pipe_surface surf_tmpl; diff --git a/src/gallium/state_trackers/python/st_hardpipe_winsys.c b/src/gallium/state_trackers/python/st_hardpipe_winsys.c index c6743db..b01c343 100644 --- a/src/gallium/state_trackers/python/st_hardpipe_winsys.c +++ b/src/gallium/state_trackers/python/st_hardpipe_winsys.c @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2008 Tungsten Graphics, Inc., Bismarck, ND., USA * 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,20 +10,20 @@ * 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 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. IN NO EVENT SHALL * THE COPYRIGHT HOLDERS, AUTHORS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, - * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR - * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE + * 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. * * The above copyright notice and this permission notice (including the * next paragraph) shall be included in all copies or substantial portions * of the Software. - * - * + * + * **************************************************************************/ /** @@ -155,7 +155,7 @@ st_hardpipe_load(void) return FALSE; scrnum = 0; - + root = RootWindow(dpy, scrnum); visinfo = glXChooseVisual(dpy, scrnum, attribSingle); @@ -163,7 +163,7 @@ st_hardpipe_load(void) visinfo = glXChooseVisual(dpy, scrnum, attribDouble); if (!visinfo) return FALSE; - + ctx = glXCreateContext( dpy, visinfo, NULL, True ); if (!ctx) @@ -173,9 +173,9 @@ st_hardpipe_load(void) attr.border_pixel = 0; attr.colormap = XCreateColormap(dpy, root, visinfo->visual, AllocNone); attr.event_mask = StructureNotifyMask | ExposureMask; - + mask = CWBackPixel | CWBorderPixel | CWColormap | CWEventMask; - + win = XCreateWindow(dpy, root, 0, 0, width, height, 0, visinfo->depth, InputOutput, visinfo->visual, mask, &attr); diff --git a/src/gallium/state_trackers/python/st_sample.c b/src/gallium/state_trackers/python/st_sample.c index cac9a1a..3912586 100644 --- a/src/gallium/state_trackers/python/st_sample.c +++ b/src/gallium/state_trackers/python/st_sample.c @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ @@ -42,14 +42,14 @@ /** * Use our own pseudo random generator to ensure consistent runs among * multiple runs and platforms. - * + * * @sa http://en.wikipedia.org/wiki/Linear_congruential_generator */ static uint32_t st_random(void) { static uint64_t seed = UINT64_C(0xbb9a063afb0a739d); seed = UINT64_C(134775813) * seed + UINT64_C(1); - + return (uint32_t)(seed >> 32); } @@ -57,7 +57,7 @@ static uint32_t st_random(void) { /** * We don't want to include the patent-encumbered DXT code here, so instead * we store several uncompressed/compressed data pairs for hardware testing - * purposes. + * purposes. */ struct dxt_data { @@ -66,7 +66,7 @@ struct dxt_data }; -static const struct dxt_data +static const struct dxt_data dxt1_rgb_data[] = { { { @@ -155,7 +155,7 @@ dxt1_rgb_data[] = { }; -static const struct dxt_data +static const struct dxt_data dxt1_rgba_data[] = { { { @@ -244,7 +244,7 @@ dxt1_rgba_data[] = { }; -static const struct dxt_data +static const struct dxt_data dxt3_rgba_data[] = { { { @@ -333,7 +333,7 @@ dxt3_rgba_data[] = { }; -static const struct dxt_data +static const struct dxt_data dxt5_rgba_data[] = { { { @@ -422,17 +422,17 @@ dxt5_rgba_data[] = { }; -static INLINE void -st_sample_dxt_pixel_block(enum pipe_format format, +static INLINE void +st_sample_dxt_pixel_block(enum pipe_format format, uint8_t *raw, - float *rgba, unsigned rgba_stride, + float *rgba, unsigned rgba_stride, unsigned w, unsigned h) { const struct dxt_data *data; unsigned n; unsigned i; unsigned x, y, ch; - + switch(format) { case PIPE_FORMAT_DXT1_RGB: data = dxt1_rgb_data; @@ -454,20 +454,20 @@ st_sample_dxt_pixel_block(enum pipe_format format, assert(0); return; } - + i = st_random() % n; - + for(y = 0; y < h; ++y) for(x = 0; x < w; ++x) for(ch = 0; ch < 4; ++ch) rgba[y*rgba_stride + x*4 + ch] = (float)(data[i].rgba[y*4*4 + x*4 + ch])/255.0f; - + memcpy(raw, data[i].raw, util_format_get_blocksize(format)); } -static INLINE void -st_sample_generic_pixel_block(enum pipe_format format, +static INLINE void +st_sample_generic_pixel_block(enum pipe_format format, uint8_t *raw, float *rgba, unsigned rgba_stride, unsigned w, unsigned h, @@ -476,7 +476,7 @@ st_sample_generic_pixel_block(enum pipe_format format, unsigned i; unsigned x, y, ch; int blocksize = util_format_get_blocksize(format); - + if (norm) { for (y = 0; y < h; ++y) { for (x = 0; x < w; ++x) { @@ -518,7 +518,7 @@ st_sample_generic_pixel_block(enum pipe_format format, /** * Randomly sample pixels. */ -void +void st_sample_pixel_block(enum pipe_format format, void *raw, float *rgba, unsigned rgba_stride, diff --git a/src/gallium/state_trackers/python/st_sample.h b/src/gallium/state_trackers/python/st_sample.h index 2fdbb39..a7acdf8 100644 --- a/src/gallium/state_trackers/python/st_sample.h +++ b/src/gallium/state_trackers/python/st_sample.h @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ @@ -36,7 +36,7 @@ struct pipe_context; struct st_surface; -void +void st_sample_pixel_block(enum pipe_format format, void *raw, float *rgba, unsigned rgba_stride, diff --git a/src/gallium/state_trackers/python/st_softpipe_winsys.c b/src/gallium/state_trackers/python/st_softpipe_winsys.c index 8584bad..5a5b992 100644 --- a/src/gallium/state_trackers/python/st_softpipe_winsys.c +++ b/src/gallium/state_trackers/python/st_softpipe_winsys.c @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2007 Tungsten Graphics, Inc., Bismarck, ND., USA * 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,20 +10,20 @@ * 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 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. IN NO EVENT SHALL * THE COPYRIGHT HOLDERS, AUTHORS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, - * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR - * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE + * 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. * * The above copyright notice and this permission notice (including the * next paragraph) shall be included in all copies or substantial portions * of the Software. - * - * + * + * **************************************************************************/ #include "util/u_debug.h" diff --git a/src/gallium/state_trackers/python/st_winsys.h b/src/gallium/state_trackers/python/st_winsys.h index 7d4066d..7e8144a 100644 --- a/src/gallium/state_trackers/python/st_winsys.h +++ b/src/gallium/state_trackers/python/st_winsys.h @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ diff --git a/src/gallium/state_trackers/vega/api_params.c b/src/gallium/state_trackers/vega/api_params.c index a73b6c3..e27a66f 100644 --- a/src/gallium/state_trackers/vega/api_params.c +++ b/src/gallium/state_trackers/vega/api_params.c @@ -1415,7 +1415,7 @@ VGfloat vegaGetParameterf(VGHandle object, case VG_IMAGE_WIDTH: case VG_IMAGE_HEIGHT: #ifdef OPENVG_VERSION_1_1 - case VG_FONT_NUM_GLYPHS: + case VG_FONT_NUM_GLYPHS: return vgGetParameteri(object, paramType); break; #endif diff --git a/src/gallium/state_trackers/wgl/SConscript b/src/gallium/state_trackers/wgl/SConscript index 1b7597d..bb05e2b 100644 --- a/src/gallium/state_trackers/wgl/SConscript +++ b/src/gallium/state_trackers/wgl/SConscript @@ -12,7 +12,7 @@ env.Append(CPPPATH = [ env.AppendUnique(CPPDEFINES = [ '_GDI32_', # prevent wgl* being declared __declspec(dllimport) - 'BUILD_GL32', # declare gl* as __declspec(dllexport) in Mesa headers + 'BUILD_GL32', # declare gl* as __declspec(dllexport) in Mesa headers 'WIN32_LEAN_AND_MEAN', # http://msdn2.microsoft.com/en-us/library/6dwk3a1z.aspx ]) diff --git a/src/gallium/state_trackers/wgl/stw_context.c b/src/gallium/state_trackers/wgl/stw_context.c index cd4f3c8..1b013a2 100644 --- a/src/gallium/state_trackers/wgl/stw_context.c +++ b/src/gallium/state_trackers/wgl/stw_context.c @@ -66,11 +66,11 @@ DrvCopyContext( return FALSE; pipe_mutex_lock( stw_dev->ctx_mutex ); - + src = stw_lookup_context_locked( dhrcSource ); dst = stw_lookup_context_locked( dhrcDest ); - if (src && dst) { + if (src && dst) { /* FIXME */ assert(0); (void) src; @@ -79,7 +79,7 @@ DrvCopyContext( } pipe_mutex_unlock( stw_dev->ctx_mutex ); - + return ret; } @@ -96,7 +96,7 @@ DrvShareLists( return FALSE; pipe_mutex_lock( stw_dev->ctx_mutex ); - + ctx1 = stw_lookup_context_locked( dhglrc1 ); ctx2 = stw_lookup_context_locked( dhglrc2 ); @@ -104,7 +104,7 @@ DrvShareLists( ret = ctx2->st->share(ctx2->st, ctx1->st); pipe_mutex_unlock( stw_dev->ctx_mutex ); - + return ret; } @@ -124,19 +124,19 @@ DrvCreateLayerContext( const struct stw_pixelformat_info *pfi; struct st_context_attribs attribs; struct stw_context *ctx = NULL; - + if(!stw_dev) return 0; - + if (iLayerPlane != 0) return 0; iPixelFormat = GetPixelFormat(hdc); if(!iPixelFormat) return 0; - + pfi = stw_pixelformat_get_info( iPixelFormat - 1 ); - + ctx = CALLOC_STRUCT( stw_context ); if (ctx == NULL) goto no_ctx; @@ -150,7 +150,7 @@ DrvCreateLayerContext( ctx->st = stw_dev->stapi->create_context(stw_dev->stapi, stw_dev->smapi, &attribs, NULL); - if (ctx->st == NULL) + if (ctx->st == NULL) goto no_st_ctx; ctx->st->st_manager_private = (void *) ctx; @@ -177,7 +177,7 @@ DrvDeleteContext( { struct stw_context *ctx ; BOOL ret = FALSE; - + if (!stw_dev) return FALSE; @@ -188,7 +188,7 @@ DrvDeleteContext( if (ctx) { struct stw_context *curctx = stw_current_context(); - + /* Unbind current if deleting current context. */ if (curctx == ctx) stw_dev->stapi->make_current(stw_dev->stapi, NULL, NULL, NULL); @@ -217,7 +217,7 @@ DrvReleaseContext( if (!ctx) return FALSE; - + /* The expectation is that ctx is the same context which is * current for this thread. We should check that and return False * if not the case. @@ -240,7 +240,7 @@ stw_get_current_context( void ) ctx = stw_current_context(); if(!ctx) return 0; - + return ctx->dhglrc; } @@ -252,7 +252,7 @@ stw_get_current_dc( void ) ctx = stw_current_context(); if(!ctx) return NULL; - + return ctx->hdc; } @@ -304,7 +304,7 @@ stw_make_current( if (!fb) goto fail; } - + if (fb->iPixelFormat != ctx->iPixelFormat) { SetLastError(ERROR_INVALID_PIXEL_FORMAT); goto fail; @@ -318,7 +318,7 @@ stw_make_current( } else { ret = stw_dev->stapi->make_current(stw_dev->stapi, NULL, NULL, NULL); } - + fail: if (fb) { @@ -352,7 +352,7 @@ stw_flush_current_locked( struct stw_framebuffer *fb ) if (ctx && ctx->current_framebuffer == fb) { ctx->st->flush(ctx->st, - PIPE_FLUSH_RENDER_CACHE | + PIPE_FLUSH_RENDER_CACHE | PIPE_FLUSH_SWAPBUFFERS | PIPE_FLUSH_FRAME, NULL); diff --git a/src/gallium/state_trackers/wgl/stw_device.c b/src/gallium/state_trackers/wgl/stw_device.c index c4822d4..86a3930 100644 --- a/src/gallium/state_trackers/wgl/stw_device.c +++ b/src/gallium/state_trackers/wgl/stw_device.c @@ -60,7 +60,7 @@ stw_init(const struct stw_winsys *stw_winsys) struct pipe_screen *screen; debug_printf("%s\n", __FUNCTION__); - + assert(!stw_dev); stw_tls_init(); @@ -71,7 +71,7 @@ stw_init(const struct stw_winsys *stw_winsys) #ifdef DEBUG stw_dev->memdbg_no = debug_memory_begin(); #endif - + stw_dev->stw_winsys = stw_winsys; _glthread_INIT_MUTEX(OneTimeLock); @@ -142,7 +142,7 @@ stw_cleanup(void) if (!stw_dev) return; - + /* * Abort cleanup if there are still active contexts. In some situations * this DLL may be unloaded before the DLL that is using GL contexts is. @@ -159,10 +159,10 @@ stw_cleanup(void) handle_table_destroy(stw_dev->ctx_table); stw_framebuffer_cleanup(); - + pipe_mutex_destroy( stw_dev->fb_mutex ); pipe_mutex_destroy( stw_dev->ctx_mutex ); - + FREE(stw_dev->smapi); stw_dev->stapi->destroy(stw_dev->stapi); diff --git a/src/gallium/state_trackers/wgl/stw_device.h b/src/gallium/state_trackers/wgl/stw_device.h index 3c2b6d9..8020b84 100644 --- a/src/gallium/state_trackers/wgl/stw_device.h +++ b/src/gallium/state_trackers/wgl/stw_device.h @@ -47,9 +47,9 @@ struct stw_framebuffer; struct stw_device { const struct stw_winsys *stw_winsys; - + struct pipe_screen *screen; - + /* Cache some PIPE_CAP_* */ unsigned max_2d_levels; unsigned max_2d_length; @@ -67,10 +67,10 @@ struct stw_device pipe_mutex ctx_mutex; struct handle_table *ctx_table; - + pipe_mutex fb_mutex; struct stw_framebuffer *fb_head; - + #ifdef DEBUG unsigned long memdbg_no; #endif diff --git a/src/gallium/state_trackers/wgl/stw_ext_extensionsstring.c b/src/gallium/state_trackers/wgl/stw_ext_extensionsstring.c index ecb326f..5452219 100644 --- a/src/gallium/state_trackers/wgl/stw_ext_extensionsstring.c +++ b/src/gallium/state_trackers/wgl/stw_ext_extensionsstring.c @@ -1,9 +1,9 @@ /************************************************************************** - * + * * Copyright 2009 VMware, Inc. * Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas. * 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 @@ -11,11 +11,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. @@ -23,7 +23,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. - * + * **************************************************************************/ #include @@ -34,7 +34,7 @@ #include -static const char *stw_extension_string = +static const char *stw_extension_string = "WGL_ARB_extensions_string " "WGL_ARB_multisample " "WGL_ARB_pbuffer " diff --git a/src/gallium/state_trackers/wgl/stw_ext_pbuffer.c b/src/gallium/state_trackers/wgl/stw_ext_pbuffer.c index 32636c6..42e1e81 100644 --- a/src/gallium/state_trackers/wgl/stw_ext_pbuffer.c +++ b/src/gallium/state_trackers/wgl/stw_ext_pbuffer.c @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2010 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. - * + * **************************************************************************/ #include diff --git a/src/gallium/state_trackers/wgl/stw_ext_pixelformat.c b/src/gallium/state_trackers/wgl/stw_ext_pixelformat.c index d0a9586..320884f 100644 --- a/src/gallium/state_trackers/wgl/stw_ext_pixelformat.c +++ b/src/gallium/state_trackers/wgl/stw_ext_pixelformat.c @@ -27,9 +27,9 @@ /** * @file - * + * * WGL_ARB_pixel_format extension implementation. - * + * * @sa http://www.opengl.org/registry/specs/ARB/wgl_pixel_format.txt */ diff --git a/src/gallium/state_trackers/wgl/stw_ext_swapinterval.c b/src/gallium/state_trackers/wgl/stw_ext_swapinterval.c index 9eac6a1..06062dc 100644 --- a/src/gallium/state_trackers/wgl/stw_ext_swapinterval.c +++ b/src/gallium/state_trackers/wgl/stw_ext_swapinterval.c @@ -1,9 +1,9 @@ /************************************************************************** - * + * * Copyright 2009 VMware, Inc. * Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas. * 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 @@ -11,11 +11,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. @@ -23,7 +23,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. - * + * **************************************************************************/ #include diff --git a/src/gallium/state_trackers/wgl/stw_framebuffer.c b/src/gallium/state_trackers/wgl/stw_framebuffer.c index 733222a..ccea617 100644 --- a/src/gallium/state_trackers/wgl/stw_framebuffer.c +++ b/src/gallium/state_trackers/wgl/stw_framebuffer.c @@ -91,11 +91,11 @@ stw_framebuffer_destroy_locked( stw_dev->stw_winsys->shared_surface_close(stw_dev->screen, fb->shared_surface); stw_st_destroy_framebuffer_locked(fb->stfb); - + pipe_mutex_unlock( fb->mutex ); pipe_mutex_destroy( fb->mutex ); - + FREE( fb ); } @@ -118,7 +118,7 @@ stw_framebuffer_get_size( struct stw_framebuffer *fb ) POINT client_pos; assert(fb->hWnd); - + /* Get the client area size. */ GetClientRect( fb->hWnd, &client_rect ); assert(client_rect.left == 0); @@ -133,8 +133,8 @@ stw_framebuffer_get_size( struct stw_framebuffer *fb ) if(width != fb->width || height != fb->height) { fb->must_resize = TRUE; - fb->width = width; - fb->height = height; + fb->width = width; + fb->height = height; } client_pos.x = 0; @@ -177,26 +177,26 @@ stw_call_window_proc( struct stw_tls_data *tls_data; PCWPSTRUCT pParams = (PCWPSTRUCT)lParam; struct stw_framebuffer *fb; - + tls_data = stw_tls_get_data(); if(!tls_data) return 0; - + if (nCode < 0 || !stw_dev) return CallNextHookEx(tls_data->hCallWndProcHook, nCode, wParam, lParam); if (pParams->message == WM_WINDOWPOSCHANGED) { /* We handle WM_WINDOWPOSCHANGED instead of WM_SIZE because according to - * http://blogs.msdn.com/oldnewthing/archive/2008/01/15/7113860.aspx - * WM_SIZE is generated from WM_WINDOWPOSCHANGED by DefWindowProc so it + * http://blogs.msdn.com/oldnewthing/archive/2008/01/15/7113860.aspx + * WM_SIZE is generated from WM_WINDOWPOSCHANGED by DefWindowProc so it * can be masked out by the application. */ LPWINDOWPOS lpWindowPos = (LPWINDOWPOS)pParams->lParam; - if((lpWindowPos->flags & SWP_SHOWWINDOW) || + if((lpWindowPos->flags & SWP_SHOWWINDOW) || !(lpWindowPos->flags & SWP_NOMOVE) || !(lpWindowPos->flags & SWP_NOSIZE)) { fb = stw_framebuffer_from_hwnd( pParams->hwnd ); if(fb) { - /* Size in WINDOWPOS includes the window frame, so get the size + /* Size in WINDOWPOS includes the window frame, so get the size * of the client area via GetClientRect. */ stw_framebuffer_get_size(fb); stw_framebuffer_release(fb); @@ -228,7 +228,7 @@ stw_framebuffer_create( hWnd = WindowFromDC( hdc ); if(!hWnd) return NULL; - + fb = CALLOC_STRUCT( stw_framebuffer ); if (fb == NULL) return NULL; @@ -302,15 +302,15 @@ stw_framebuffer_update( assert(fb->stfb); assert(fb->height); assert(fb->width); - - /* XXX: It would be nice to avoid checking the size again -- in theory - * stw_call_window_proc would have cought the resize and stored the right - * size already, but unfortunately threads created before the DllMain is + + /* XXX: It would be nice to avoid checking the size again -- in theory + * stw_call_window_proc would have cought the resize and stored the right + * size already, but unfortunately threads created before the DllMain is * called don't get a DLL_THREAD_ATTACH notification, and there is no way * to know of their existing without using the not very portable PSAPI. */ stw_framebuffer_get_size(fb); -} +} void @@ -327,14 +327,14 @@ stw_framebuffer_cleanup( void ) fb = stw_dev->fb_head; while (fb) { next = fb->next; - + pipe_mutex_lock(fb->mutex); stw_framebuffer_destroy_locked(fb); - + fb = next; } stw_dev->fb_head = NULL; - + pipe_mutex_unlock( stw_dev->fb_mutex ); } @@ -349,15 +349,15 @@ stw_framebuffer_from_hdc_locked( HWND hwnd; struct stw_framebuffer *fb; - /* - * Some applications create and use several HDCs for the same window, so + /* + * Some applications create and use several HDCs for the same window, so * looking up the framebuffer by the HDC is not reliable. Use HWND whenever * possible. - */ + */ hwnd = WindowFromDC(hdc); if(hwnd) return stw_framebuffer_from_hwnd_locked(hwnd); - + for (fb = stw_dev->fb_head; fb != NULL; fb = fb->next) if (fb->hDC == hdc) { pipe_mutex_lock(fb->mutex); @@ -433,16 +433,16 @@ DrvSetPixelFormat( if(!fb) { return FALSE; } - + stw_framebuffer_release( fb ); - /* Some applications mistakenly use the undocumented wglSetPixelFormat - * function instead of SetPixelFormat, so we call SetPixelFormat here to + /* Some applications mistakenly use the undocumented wglSetPixelFormat + * function instead of SetPixelFormat, so we call SetPixelFormat here to * avoid opengl32.dll's wglCreateContext to fail */ if (GetPixelFormat(hdc) == 0) { SetPixelFormat(hdc, iPixelFormat, NULL); } - + return TRUE; } @@ -459,7 +459,7 @@ stw_pixelformat_get( iPixelFormat = fb->iPixelFormat; stw_framebuffer_release(fb); } - + return iPixelFormat; } diff --git a/src/gallium/state_trackers/wgl/stw_framebuffer.h b/src/gallium/state_trackers/wgl/stw_framebuffer.h index 6604e54..d229f43 100644 --- a/src/gallium/state_trackers/wgl/stw_framebuffer.h +++ b/src/gallium/state_trackers/wgl/stw_framebuffer.h @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ #ifndef STW_FRAMEBUFFER_H @@ -45,19 +45,19 @@ struct stw_framebuffer * This mutex has two purposes: * - protect the access to the mutable data members below * - prevent the framebuffer from being deleted while being accessed. - * - * It is OK to lock this mutex while holding the stw_device::fb_mutex lock, + * + * It is OK to lock this mutex while holding the stw_device::fb_mutex lock, * but the opposite must never happen. */ pipe_mutex mutex; - + /* * Immutable members. - * - * Note that even access to immutable members implies acquiring the mutex + * + * Note that even access to immutable members implies acquiring the mutex * above, to prevent the framebuffer from being destroyed. */ - + HDC hDC; HWND hWnd; @@ -67,18 +67,18 @@ struct stw_framebuffer struct st_framebuffer_iface *stfb; /* - * Mutable members. + * Mutable members. */ unsigned refcnt; - + /* FIXME: Make this work for multiple contexts bound to the same framebuffer */ boolean must_resize; unsigned width; unsigned height; - + /** * Client area rectangle, relative to the window upper-left corner. * @@ -89,13 +89,13 @@ struct stw_framebuffer HANDLE hSharedSurface; struct stw_shared_surface *shared_surface; - /** + /** * This is protected by stw_device::fb_mutex, not the mutex above. - * + * * Deletions must be done by first acquiring stw_device::fb_mutex, and then - * acquiring the stw_framebuffer::mutex of the framebuffer to be deleted. + * acquiring the stw_framebuffer::mutex of the framebuffer to be deleted. * This ensures that nobody else is reading/writing to the. - * + * * It is not necessary to aquire the mutex above to navigate the linked list * given that deletions are done with stw_device::fb_mutex held, so no other * thread can delete. @@ -106,9 +106,9 @@ struct stw_framebuffer /** * Create a new framebuffer object which will correspond to the given HDC. - * + * * This function will acquire stw_framebuffer::mutex. stw_framebuffer_release - * must be called when done + * must be called when done */ struct stw_framebuffer * stw_framebuffer_create( @@ -122,9 +122,9 @@ stw_framebuffer_reference( /** * Search a framebuffer with a matching HWND. - * + * * This function will acquire stw_framebuffer::mutex. stw_framebuffer_release - * must be called when done + * must be called when done */ struct stw_framebuffer * stw_framebuffer_from_hwnd( @@ -132,9 +132,9 @@ stw_framebuffer_from_hwnd( /** * Search a framebuffer with a matching HDC. - * + * * This function will acquire stw_framebuffer::mutex. stw_framebuffer_release - * must be called when done + * must be called when done */ struct stw_framebuffer * stw_framebuffer_from_hdc( diff --git a/src/gallium/state_trackers/wgl/stw_pixelformat.c b/src/gallium/state_trackers/wgl/stw_pixelformat.c index 5ede1d4..22a07cf 100644 --- a/src/gallium/state_trackers/wgl/stw_pixelformat.c +++ b/src/gallium/state_trackers/wgl/stw_pixelformat.c @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ #include "pipe/p_format.h" @@ -86,7 +86,7 @@ stw_pf_color[] = { }; -static const struct stw_pf_depth_info +static const struct stw_pf_depth_info stw_pf_depth_stencil[] = { /* pure depth */ { PIPE_FORMAT_Z32_UNORM, {32, 0} }, @@ -99,14 +99,14 @@ stw_pf_depth_stencil[] = { }; -static const boolean +static const boolean stw_pf_doublebuffer[] = { FALSE, TRUE, }; -const unsigned +const unsigned stw_pf_multisample[] = { 0, 4 @@ -124,7 +124,7 @@ stw_pixelformat_add( { boolean extended = FALSE; struct stw_pixelformat_info *pfi; - + assert(stw_dev->pixelformat_extended_count < STW_MAX_PIXELFORMATS); if(stw_dev->pixelformat_extended_count >= STW_MAX_PIXELFORMATS) return; @@ -135,16 +135,16 @@ stw_pixelformat_add( assert(util_format_get_component_bits(color->format, UTIL_FORMAT_COLORSPACE_RGB, 3) == color->bits.alpha); assert(util_format_get_component_bits(depth->format, UTIL_FORMAT_COLORSPACE_ZS, 0) == depth->bits.depth); assert(util_format_get_component_bits(depth->format, UTIL_FORMAT_COLORSPACE_ZS, 1) == depth->bits.stencil); - + pfi = &stw_dev->pixelformats[stw_dev->pixelformat_extended_count]; - + memset(pfi, 0, sizeof *pfi); - + pfi->pfd.nSize = sizeof pfi->pfd; pfi->pfd.nVersion = 1; pfi->pfd.dwFlags = PFD_SUPPORT_OPENGL; - + /* TODO: also support non-native pixel formats */ pfi->pfd.dwFlags |= PFD_DRAW_TO_WINDOW; @@ -153,7 +153,7 @@ stw_pixelformat_add( if (doublebuffer) pfi->pfd.dwFlags |= PFD_DOUBLEBUFFER | PFD_SWAP_COPY; - + pfi->pfd.iPixelType = PFD_TYPE_RGBA; pfi->pfd.cColorBits = color->bits.red + color->bits.green + color->bits.blue + color->bits.alpha; @@ -195,9 +195,9 @@ stw_pixelformat_add( pfi->stvis.samples = samples; pfi->stvis.render_buffer = ST_ATTACHMENT_INVALID; - + ++stw_dev->pixelformat_extended_count; - + if(!extended) { ++stw_dev->pixelformat_count; assert(stw_dev->pixelformat_count == stw_dev->pixelformat_extended_count); @@ -209,32 +209,32 @@ stw_pixelformat_init( void ) { struct pipe_screen *screen = stw_dev->screen; unsigned i, j, k, l; - + assert( !stw_dev->pixelformat_count ); assert( !stw_dev->pixelformat_extended_count ); for(i = 0; i < Elements(stw_pf_multisample); ++i) { unsigned samples = stw_pf_multisample[i]; - + /* FIXME: re-enabled MSAA when we can query it */ if(samples) continue; for(j = 0; j < Elements(stw_pf_color); ++j) { const struct stw_pf_color_info *color = &stw_pf_color[j]; - + if(!screen->is_format_supported(screen, color->format, PIPE_TEXTURE_2D, 0, PIPE_BIND_RENDER_TARGET | PIPE_BIND_DISPLAY_TARGET, 0)) continue; - + for(k = 0; k < Elements(stw_pf_doublebuffer); ++k) { unsigned doublebuffer = stw_pf_doublebuffer[k]; - + for(l = 0; l < Elements(stw_pf_depth_stencil); ++l) { const struct stw_pf_depth_info *depth = &stw_pf_depth_stencil[l]; - - if(!screen->is_format_supported(screen, depth->format, PIPE_TEXTURE_2D, + + if(!screen->is_format_supported(screen, depth->format, PIPE_TEXTURE_2D, 0, PIPE_BIND_DEPTH_STENCIL, 0)) continue; @@ -244,7 +244,7 @@ stw_pixelformat_init( void ) } } } - + assert( stw_dev->pixelformat_count <= stw_dev->pixelformat_extended_count ); assert( stw_dev->pixelformat_extended_count <= STW_MAX_PIXELFORMATS ); } @@ -295,7 +295,7 @@ DrvDescribePixelFormat( return 0; pfi = stw_pixelformat_get_info( index ); - + memcpy(ppfd, &pfi->pfd, sizeof( PIXELFORMATDESCRIPTOR )); return count; diff --git a/src/gallium/state_trackers/wgl/stw_pixelformat.h b/src/gallium/state_trackers/wgl/stw_pixelformat.h index 282c9f6..7b3c7e8 100644 --- a/src/gallium/state_trackers/wgl/stw_pixelformat.h +++ b/src/gallium/state_trackers/wgl/stw_pixelformat.h @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ #ifndef STW_PIXELFORMAT_H @@ -41,7 +41,7 @@ struct stw_pixelformat_info { PIXELFORMATDESCRIPTOR pfd; - + struct st_visual stvis; }; diff --git a/src/gallium/state_trackers/wgl/stw_st.c b/src/gallium/state_trackers/wgl/stw_st.c index b58d916..5fa5aeb 100644 --- a/src/gallium/state_trackers/wgl/stw_st.c +++ b/src/gallium/state_trackers/wgl/stw_st.c @@ -119,7 +119,7 @@ stw_st_framebuffer_validate_locked(struct st_framebuffer_iface *stfb, stwfb->texture_mask = mask; } -static boolean +static boolean stw_st_framebuffer_validate(struct st_framebuffer_iface *stfb, const enum st_attachment_type *statts, unsigned count, diff --git a/src/gallium/state_trackers/wgl/stw_tls.c b/src/gallium/state_trackers/wgl/stw_tls.c index 4bd6a92..f292364 100644 --- a/src/gallium/state_trackers/wgl/stw_tls.c +++ b/src/gallium/state_trackers/wgl/stw_tls.c @@ -98,12 +98,12 @@ stw_tls_cleanup_thread(void) data = (struct stw_tls_data *) TlsGetValue(tlsIndex); if(data) { TlsSetValue(tlsIndex, NULL); - + if(data->hCallWndProcHook) { UnhookWindowsHookEx(data->hCallWndProcHook); data->hCallWndProcHook = NULL; } - + FREE(data); } } @@ -121,14 +121,14 @@ struct stw_tls_data * stw_tls_get_data(void) { struct stw_tls_data *data; - + if (tlsIndex == TLS_OUT_OF_INDEXES) { return NULL; } - + data = (struct stw_tls_data *) TlsGetValue(tlsIndex); if(!data) { - /* DllMain is called with DLL_THREAD_ATTACH only by threads created after + /* DllMain is called with DLL_THREAD_ATTACH only by threads created after * the DLL is loaded by the process */ data = stw_tls_data_create(); if(!data) diff --git a/src/gallium/state_trackers/xorg/xorg_composite.c b/src/gallium/state_trackers/xorg/xorg_composite.c index d4dc84a..9c6f96b 100644 --- a/src/gallium/state_trackers/xorg/xorg_composite.c +++ b/src/gallium/state_trackers/xorg/xorg_composite.c @@ -547,7 +547,7 @@ boolean xorg_solid_bind_state(struct exa_context *exa, vs_traits = VS_SOLID_FILL; fs_traits = FS_SOLID_FILL; - renderer_bind_destination(exa->renderer, dst_surf, + renderer_bind_destination(exa->renderer, dst_surf, pixmap->width, pixmap->height); bind_blend_state(exa, PictOpSrc, NULL, NULL, NULL); cso_set_samplers(exa->renderer->cso, 0, NULL); diff --git a/src/gallium/state_trackers/xorg/xorg_driver.c b/src/gallium/state_trackers/xorg/xorg_driver.c index 66685ec..dbf1101 100644 --- a/src/gallium/state_trackers/xorg/xorg_driver.c +++ b/src/gallium/state_trackers/xorg/xorg_driver.c @@ -549,12 +549,12 @@ void xorg_flush(ScreenPtr pScreen) ms->dirtyThrottling ? &ms->fence[XORG_NR_FENCES-1] : NULL); - + if (ms->dirtyThrottling) { if (ms->fence[0]) ms->ctx->screen->fence_finish(ms->ctx->screen, ms->fence[0], 0); - + /* The amount of rendering generated by a block handler can be * quite small. Let us get a fair way ahead of hardware before * throttling. diff --git a/src/gallium/state_trackers/xorg/xorg_exa.c b/src/gallium/state_trackers/xorg/xorg_exa.c index 718a345..eb80d17 100644 --- a/src/gallium/state_trackers/xorg/xorg_exa.c +++ b/src/gallium/state_trackers/xorg/xorg_exa.c @@ -272,7 +272,7 @@ ExaPrepareAccess(PixmapPtr pPix, int index) PIPE_TRANSFER_MAP_DIRECTLY | #endif PIPE_TRANSFER_READ_WRITE, - 0, 0, + 0, 0, pPix->drawable.width, pPix->drawable.height ); if (!priv->map_transfer) @@ -388,7 +388,7 @@ ExaDoneSolid(PixmapPtr pPixmap) if (!priv) return; - + xorg_composite_done(exa); } @@ -470,7 +470,7 @@ ExaPrepareCopy(PixmapPtr pSrcPixmap, PixmapPtr pDstPixmap, int xdir, &surf_tmpl); - renderer_copy_prepare(exa->renderer, + renderer_copy_prepare(exa->renderer, exa->copy.dst_surface, exa->copy.src_texture ); } @@ -507,7 +507,7 @@ ExaCopy(PixmapPtr pDstPixmap, int srcX, int srcY, int dstX, int dstY, 0, &src_box); } else { - renderer_copy_pixmap(exa->renderer, + renderer_copy_pixmap(exa->renderer, dstX, dstY, srcX, srcY, width, height, @@ -823,10 +823,10 @@ ExaModifyPixmapHeader(PixmapPtr pPixmap, int width, int height, if (0) { debug_printf("%s pixmap %p sz %dx%dx%d devKind %d\n", __FUNCTION__, pPixmap, width, height, bitsPerPixel, devKind); - + if (priv->tex) debug_printf(" ==> old texture %dx%d\n", - priv->tex->width0, + priv->tex->width0, priv->tex->height0); } diff --git a/src/gallium/state_trackers/xorg/xorg_renderer.c b/src/gallium/state_trackers/xorg/xorg_renderer.c index a3d7c5a..aaa1461 100644 --- a/src/gallium/state_trackers/xorg/xorg_renderer.c +++ b/src/gallium/state_trackers/xorg/xorg_renderer.c @@ -358,7 +358,7 @@ void renderer_bind_destination(struct xorg_renderer *r, /* Constant buffer set up to match viewport dimensions: */ if (r->fb_width != width || - r->fb_height != height) + r->fb_height != height) { float vs_consts[8] = { 2.f/width, 2.f/height, 1, 1, @@ -481,7 +481,7 @@ void renderer_copy_prepare(struct xorg_renderer *r, cso_single_sampler_done(r->cso); } - renderer_bind_destination(r, dst_surface, + renderer_bind_destination(r, dst_surface, dst_surface->width, dst_surface->height); diff --git a/src/gallium/state_trackers/xorg/xorg_xv.c b/src/gallium/state_trackers/xorg/xorg_xv.c index c72ba9e..0647ede 100644 --- a/src/gallium/state_trackers/xorg/xorg_xv.c +++ b/src/gallium/state_trackers/xorg/xorg_xv.c @@ -548,7 +548,7 @@ display_video(ScrnInfoPtr pScrn, struct xorg_xv_port_priv *pPriv, int id, pbox = REGION_RECTS(dstRegion); nbox = REGION_NUM_RECTS(dstRegion); - renderer_bind_destination(pPriv->r, dst_surf, + renderer_bind_destination(pPriv->r, dst_surf, dst_surf->width, dst_surf->height); bind_blend_state(pPriv); diff --git a/src/gallium/targets/Makefile.dri b/src/gallium/targets/Makefile.dri index 3fb4cc6..468392e 100644 --- a/src/gallium/targets/Makefile.dri +++ b/src/gallium/targets/Makefile.dri @@ -32,7 +32,7 @@ INCLUDES = $(SHARED_INCLUDES) $(EXPAT_INCLUDES) OBJECTS = \ $(C_SOURCES:.c=.o) \ - $(ASM_SOURCES:.S=.o) + $(ASM_SOURCES:.S=.o) ### Include directories diff --git a/src/gallium/targets/graw-gdi/graw_gdi.c b/src/gallium/targets/graw-gdi/graw_gdi.c index 17ca2a7..40040fd 100644 --- a/src/gallium/targets/graw-gdi/graw_gdi.c +++ b/src/gallium/targets/graw-gdi/graw_gdi.c @@ -128,7 +128,7 @@ graw_create_window_and_screen(int x, return NULL; } -void +void graw_set_display_func(void (* draw)(void)) { graw.draw = draw; diff --git a/src/gallium/targets/graw-null/graw_null.c b/src/gallium/targets/graw-null/graw_null.c index f1fe387..04effe7 100644 --- a/src/gallium/targets/graw-null/graw_null.c +++ b/src/gallium/targets/graw-null/graw_null.c @@ -16,7 +16,7 @@ graw_create_window_and_screen( int x, -void +void graw_set_display_func( void (*draw)( void ) ) { } diff --git a/src/gallium/targets/graw-xlib/graw_xlib.c b/src/gallium/targets/graw-xlib/graw_xlib.c index 578086f..46c954b 100644 --- a/src/gallium/targets/graw-xlib/graw_xlib.c +++ b/src/gallium/targets/graw-xlib/graw_xlib.c @@ -123,7 +123,7 @@ graw_create_window_and_screen( int x, break; } } - + xlib_handle->visual = visinfo->visual; xlib_handle->drawable = (Drawable)win; xlib_handle->depth = visinfo->depth; @@ -153,7 +153,7 @@ graw_create_window_and_screen( int x, } -void +void graw_set_display_func( void (*draw)( void ) ) { graw.draw = draw; diff --git a/src/gallium/targets/libgl-gdi/SConscript b/src/gallium/targets/libgl-gdi/SConscript index ec7dbad..f3b0739 100644 --- a/src/gallium/targets/libgl-gdi/SConscript +++ b/src/gallium/targets/libgl-gdi/SConscript @@ -31,7 +31,7 @@ if env['gcc']: sources += ['#src/gallium/state_trackers/wgl/opengl32.mingw.def'] else: sources += ['#src/gallium/state_trackers/wgl/opengl32.def'] - + drivers += [trace, rbug] env['no_import_lib'] = 1 diff --git a/src/gallium/targets/libgl-gdi/libgl_gdi.c b/src/gallium/targets/libgl-gdi/libgl_gdi.c index 112904a..9858596 100644 --- a/src/gallium/targets/libgl-gdi/libgl_gdi.c +++ b/src/gallium/targets/libgl-gdi/libgl_gdi.c @@ -90,7 +90,7 @@ gdi_screen_create(void) goto no_screen; return screen; - + no_screen: winsys->destroy(winsys); no_winsys: diff --git a/src/gallium/targets/libgl-xlib/Makefile b/src/gallium/targets/libgl-xlib/Makefile index fb537c3..ed8eaa6 100644 --- a/src/gallium/targets/libgl-xlib/Makefile +++ b/src/gallium/targets/libgl-xlib/Makefile @@ -56,7 +56,7 @@ LIBS = \ # LLVM ifeq ($(MESA_LLVM),1) DEFINES += -DGALLIUM_LLVMPIPE -GL_LIB_DEPS += $(LLVM_LIBS) +GL_LIB_DEPS += $(LLVM_LIBS) LDFLAGS += $(LLVM_LDFLAGS) endif diff --git a/src/gallium/targets/libgl-xlib/SConscript b/src/gallium/targets/libgl-xlib/SConscript index 7f0f245..68abde2 100644 --- a/src/gallium/targets/libgl-xlib/SConscript +++ b/src/gallium/targets/libgl-xlib/SConscript @@ -36,7 +36,7 @@ if True: if env['llvm']: env.Append(CPPDEFINES = ['GALLIUM_LLVMPIPE']) env.Prepend(LIBS = [llvmpipe]) - + if False: # TODO: Detect Cell SDK env.Append(CPPDEFINES = 'GALLIUM_CELL') diff --git a/src/gallium/targets/libgl-xlib/xlib.c b/src/gallium/targets/libgl-xlib/xlib.c index 9a3e0e0..023b579 100644 --- a/src/gallium/targets/libgl-xlib/xlib.c +++ b/src/gallium/targets/libgl-xlib/xlib.c @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2007 Tungsten Graphics, Inc., Bismarck, ND., USA * 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,20 +10,20 @@ * 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 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. IN NO EVENT SHALL * THE COPYRIGHT HOLDERS, AUTHORS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, - * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR - * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE + * 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. * * The above copyright notice and this permission notice (including the * next paragraph) shall be included in all copies or substantial portions * of the Software. - * - * + * + * **************************************************************************/ /* @@ -76,7 +76,7 @@ swrast_xlib_create_screen( Display *display ) return NULL; } -static struct xm_driver xlib_driver = +static struct xm_driver xlib_driver = { .create_pipe_screen = swrast_xlib_create_screen, .create_st_api = st_gl_api_create, diff --git a/src/gallium/targets/xorg-vmwgfx/vmw_ioctl.c b/src/gallium/targets/xorg-vmwgfx/vmw_ioctl.c index 7625d2f..2887136 100644 --- a/src/gallium/targets/xorg-vmwgfx/vmw_ioctl.c +++ b/src/gallium/targets/xorg-vmwgfx/vmw_ioctl.c @@ -199,20 +199,20 @@ vmw_ioctl_buffer_create(struct vmw_customizer *vmw, uint32_t size, unsigned *han void vmw_ioctl_buffer_destroy(struct vmw_customizer *vmw, struct vmw_dma_buffer *buf) -{ - struct drm_vmw_unref_dmabuf_arg arg; +{ + struct drm_vmw_unref_dmabuf_arg arg; - if (buf->data) { - munmap(buf->data, buf->size); - buf->data = NULL; - } + if (buf->data) { + munmap(buf->data, buf->size); + buf->data = NULL; + } - memset(&arg, 0, sizeof(arg)); - arg.handle = buf->handle; - drmCommandWrite(vmw->fd, DRM_VMW_UNREF_DMABUF, &arg, sizeof(arg)); + memset(&arg, 0, sizeof(arg)); + arg.handle = buf->handle; + drmCommandWrite(vmw->fd, DRM_VMW_UNREF_DMABUF, &arg, sizeof(arg)); free(buf); -} +} void * vmw_ioctl_buffer_map(struct vmw_customizer *vmw, struct vmw_dma_buffer *buf) diff --git a/src/gallium/tests/graw/SConscript b/src/gallium/tests/graw/SConscript index 3341b88..77066a1 100644 --- a/src/gallium/tests/graw/SConscript +++ b/src/gallium/tests/graw/SConscript @@ -6,7 +6,7 @@ env.Prepend(LIBS = [gallium]) env.Prepend(LIBPATH = [graw.dir]) env.Prepend(LIBS = ['graw']) - + if env['platform'] in ('freebsd8', 'sunos5'): env.Append(LIBS = ['m']) diff --git a/src/gallium/tests/graw/clear.c b/src/gallium/tests/graw/clear.c index 1ff80ca..20c3f9c 100644 --- a/src/gallium/tests/graw/clear.c +++ b/src/gallium/tests/graw/clear.c @@ -48,17 +48,17 @@ static void init( void ) * Also, no easy way of querying supported formats if the screen * cannot be created first. */ - for (i = 0; + for (i = 0; window == NULL && formats[i] != PIPE_FORMAT_NONE; i++) { - + screen = graw_create_window_and_screen(0,0,300,300, formats[i], &window); } if (window == NULL) exit(2); - + ctx = screen->context_create(screen, NULL); if (ctx == NULL) exit(3); @@ -73,7 +73,7 @@ static void init( void ) templat.nr_samples = 1; templat.bind = (PIPE_BIND_RENDER_TARGET | PIPE_BIND_DISPLAY_TARGET); - + tex = screen->resource_create(screen, &templat); if (tex == NULL) diff --git a/src/gallium/tests/graw/fs-test.c b/src/gallium/tests/graw/fs-test.c index 37be2d0..9167286 100644 --- a/src/gallium/tests/graw/fs-test.c +++ b/src/gallium/tests/graw/fs-test.c @@ -13,7 +13,7 @@ #include "util/u_inlines.h" #include "util/u_memory.h" /* Offset() */ #include "util/u_draw_quad.h" -#include "util/u_box.h" +#include "util/u_box.h" static const char *filename = NULL; unsigned show_fps = 0; @@ -74,7 +74,7 @@ static struct vertex vertices[] = { -1, 0, 0, 1 } }, }; -static float constants1[] = +static float constants1[] = { 0.4, 0, 0, 1, 1, 1, 1, 1, 2, 2, 2, 2, @@ -92,7 +92,7 @@ static float constants1[] = }; -static float constants2[] = +static float constants2[] = { 1, 0, 0, 1, 0, 1, 0, 1, 0, 0, 1, 1, @@ -287,7 +287,7 @@ static void draw( void ) #define SIZE 16 static void init_tex( void ) -{ +{ struct pipe_sampler_view sv_template; struct pipe_sampler_state sampler_desc; struct pipe_resource templat; @@ -346,7 +346,7 @@ static void init_tex( void ) templat.nr_samples = 1; templat.bind = PIPE_BIND_SAMPLER_VIEW; - + samptex = screen->resource_create(screen, &templat); if (samptex == NULL) @@ -398,7 +398,7 @@ static void init_tex( void ) exit(5); ctx->set_fragment_sampler_views(ctx, 1, &sv); - + memset(&sampler_desc, 0, sizeof sampler_desc); sampler_desc.wrap_s = PIPE_TEX_WRAP_REPEAT; @@ -411,13 +411,13 @@ static void init_tex( void ) sampler_desc.compare_func = 0; sampler_desc.normalized_coords = 1; sampler_desc.max_anisotropy = 0; - + sampler = ctx->create_sampler_state(ctx, &sampler_desc); if (sampler == NULL) exit(6); ctx->bind_fragment_sampler_states(ctx, 1, &sampler); - + } static void init( void ) @@ -433,15 +433,15 @@ static void init( void ) * Also, no easy way of querying supported formats if the screen * cannot be created first. */ - for (i = 0; + for (i = 0; window == NULL && formats[i] != PIPE_FORMAT_NONE; i++) { - + screen = graw_create_window_and_screen(0,0,WIDTH,HEIGHT, formats[i], &window); } - + ctx = screen->context_create(screen, NULL); if (ctx == NULL) exit(3); @@ -456,7 +456,7 @@ static void init( void ) templat.nr_samples = 1; templat.bind = (PIPE_BIND_RENDER_TARGET | PIPE_BIND_DISPLAY_TARGET); - + rttex = screen->resource_create(screen, &templat); if (rttex == NULL) @@ -478,7 +478,7 @@ static void init( void ) fb.cbufs[0] = surf; ctx->set_framebuffer_state(ctx, &fb); - + { struct pipe_blend_state blend; void *handle; diff --git a/src/gallium/tests/graw/gs-test.c b/src/gallium/tests/graw/gs-test.c index 812666a..808e84b 100644 --- a/src/gallium/tests/graw/gs-test.c +++ b/src/gallium/tests/graw/gs-test.c @@ -13,7 +13,7 @@ #include "util/u_inlines.h" #include "util/u_memory.h" /* Offset() */ #include "util/u_draw_quad.h" -#include "util/u_box.h" +#include "util/u_box.h" static const char *filename = NULL; unsigned show_fps = 0; @@ -351,7 +351,7 @@ static void draw( void ) #define SIZE 16 static void init_tex( void ) -{ +{ struct pipe_sampler_view sv_template; struct pipe_sampler_state sampler_desc; struct pipe_resource templat; @@ -410,7 +410,7 @@ static void init_tex( void ) templat.nr_samples = 1; templat.bind = PIPE_BIND_SAMPLER_VIEW; - + samptex = screen->resource_create(screen, &templat); if (samptex == NULL) @@ -462,7 +462,7 @@ static void init_tex( void ) exit(5); ctx->set_fragment_sampler_views(ctx, 1, &sv); - + memset(&sampler_desc, 0, sizeof sampler_desc); sampler_desc.wrap_s = PIPE_TEX_WRAP_REPEAT; @@ -475,13 +475,13 @@ static void init_tex( void ) sampler_desc.compare_func = 0; sampler_desc.normalized_coords = 1; sampler_desc.max_anisotropy = 0; - + sampler = ctx->create_sampler_state(ctx, &sampler_desc); if (sampler == NULL) exit(6); ctx->bind_fragment_sampler_states(ctx, 1, &sampler); - + } static void init( void ) @@ -497,15 +497,15 @@ static void init( void ) * Also, no easy way of querying supported formats if the screen * cannot be created first. */ - for (i = 0; + for (i = 0; window == NULL && formats[i] != PIPE_FORMAT_NONE; i++) { - + screen = graw_create_window_and_screen(0,0,WIDTH,HEIGHT, formats[i], &window); } - + ctx = screen->context_create(screen, NULL); if (ctx == NULL) exit(3); @@ -520,7 +520,7 @@ static void init( void ) templat.nr_samples = 1; templat.bind = (PIPE_BIND_RENDER_TARGET | PIPE_BIND_DISPLAY_TARGET); - + rttex = screen->resource_create(screen, &templat); if (rttex == NULL) @@ -542,7 +542,7 @@ static void init( void ) fb.cbufs[0] = surf; ctx->set_framebuffer_state(ctx, &fb); - + { struct pipe_blend_state blend; void *handle; diff --git a/src/gallium/tests/graw/quad-tex.c b/src/gallium/tests/graw/quad-tex.c index 952131d..8fa846d 100644 --- a/src/gallium/tests/graw/quad-tex.c +++ b/src/gallium/tests/graw/quad-tex.c @@ -12,7 +12,7 @@ #include "util/u_inlines.h" #include "util/u_memory.h" /* Offset() */ #include "util/u_draw_quad.h" -#include "util/u_box.h" +#include "util/u_box.h" enum pipe_format formats[] = { PIPE_FORMAT_R8G8B8A8_UNORM, @@ -157,7 +157,7 @@ static void draw( void ) #define SIZE 16 static void init_tex( void ) -{ +{ struct pipe_sampler_view sv_template; struct pipe_sampler_state sampler_desc; struct pipe_resource templat; @@ -216,7 +216,7 @@ static void init_tex( void ) templat.nr_samples = 1; templat.bind = PIPE_BIND_SAMPLER_VIEW; - + samptex = screen->resource_create(screen, &templat); if (samptex == NULL) @@ -268,7 +268,7 @@ static void init_tex( void ) exit(5); ctx->set_fragment_sampler_views(ctx, 1, &sv); - + memset(&sampler_desc, 0, sizeof sampler_desc); sampler_desc.wrap_s = PIPE_TEX_WRAP_REPEAT; @@ -281,13 +281,13 @@ static void init_tex( void ) sampler_desc.compare_func = 0; sampler_desc.normalized_coords = 1; sampler_desc.max_anisotropy = 0; - + sampler = ctx->create_sampler_state(ctx, &sampler_desc); if (sampler == NULL) exit(6); ctx->bind_fragment_sampler_states(ctx, 1, &sampler); - + } static void init( void ) @@ -303,15 +303,15 @@ static void init( void ) * Also, no easy way of querying supported formats if the screen * cannot be created first. */ - for (i = 0; + for (i = 0; window == NULL && formats[i] != PIPE_FORMAT_NONE; i++) { - + screen = graw_create_window_and_screen(0,0,300,300, formats[i], &window); } - + ctx = screen->context_create(screen, NULL); if (ctx == NULL) exit(3); @@ -326,7 +326,7 @@ static void init( void ) templat.nr_samples = 1; templat.bind = (PIPE_BIND_RENDER_TARGET | PIPE_BIND_DISPLAY_TARGET); - + rttex = screen->resource_create(screen, &templat); if (rttex == NULL) @@ -348,7 +348,7 @@ static void init( void ) fb.cbufs[0] = surf; ctx->set_framebuffer_state(ctx, &fb); - + { struct pipe_blend_state blend; void *handle; diff --git a/src/gallium/tests/graw/shader-leak.c b/src/gallium/tests/graw/shader-leak.c index b53f0a0..03f08ea 100644 --- a/src/gallium/tests/graw/shader-leak.c +++ b/src/gallium/tests/graw/shader-leak.c @@ -176,15 +176,15 @@ static void init( void ) * Also, no easy way of querying supported formats if the screen * cannot be created first. */ - for (i = 0; + for (i = 0; window == NULL && formats[i] != PIPE_FORMAT_NONE; i++) { - + screen = graw_create_window_and_screen(0,0,300,300, formats[i], &window); } - + ctx = screen->context_create(screen, NULL); if (ctx == NULL) exit(3); @@ -198,7 +198,7 @@ static void init( void ) templat.nr_samples = 1; templat.bind = (PIPE_BIND_RENDER_TARGET | PIPE_BIND_DISPLAY_TARGET); - + tex = screen->resource_create(screen, &templat); if (tex == NULL) { fprintf(stderr, "Unable to create screen texture!\n"); @@ -223,7 +223,7 @@ static void init( void ) fb.cbufs[0] = surf; ctx->set_framebuffer_state(ctx, &fb); - + { struct pipe_blend_state blend; void *handle; diff --git a/src/gallium/tests/graw/tri-gs.c b/src/gallium/tests/graw/tri-gs.c index 84ff3e6..40b13d0 100644 --- a/src/gallium/tests/graw/tri-gs.c +++ b/src/gallium/tests/graw/tri-gs.c @@ -155,7 +155,7 @@ static void set_geometry_shader( void ) handle = graw_parse_geometry_shader(ctx, text); ctx->bind_gs_state(ctx, handle); -} +} static void draw( void ) { @@ -182,15 +182,15 @@ static void init( void ) * Also, no easy way of querying supported formats if the screen * cannot be created first. */ - for (i = 0; + for (i = 0; window == NULL && formats[i] != PIPE_FORMAT_NONE; i++) { - + screen = graw_create_window_and_screen(0,0,300,300, formats[i], &window); } - + ctx = screen->context_create(screen, NULL); if (ctx == NULL) exit(3); @@ -205,7 +205,7 @@ static void init( void ) templat.nr_samples = 1; templat.bind = (PIPE_BIND_RENDER_TARGET | PIPE_BIND_DISPLAY_TARGET); - + tex = screen->resource_create(screen, &templat); if (tex == NULL) @@ -227,7 +227,7 @@ static void init( void ) fb.cbufs[0] = surf; ctx->set_framebuffer_state(ctx, &fb); - + { struct pipe_blend_state blend; void *handle; diff --git a/src/gallium/tests/graw/tri-instanced.c b/src/gallium/tests/graw/tri-instanced.c index f33c061..007654f 100644 --- a/src/gallium/tests/graw/tri-instanced.c +++ b/src/gallium/tests/graw/tri-instanced.c @@ -234,15 +234,15 @@ static void init( void ) * Also, no easy way of querying supported formats if the screen * cannot be created first. */ - for (i = 0; + for (i = 0; window == NULL && formats[i] != PIPE_FORMAT_NONE; i++) { - + screen = graw_create_window_and_screen(0,0,300,300, formats[i], &window); } - + ctx = screen->context_create(screen, NULL); if (ctx == NULL) exit(3); @@ -257,7 +257,7 @@ static void init( void ) templat.nr_samples = 1; templat.bind = (PIPE_BIND_RENDER_TARGET | PIPE_BIND_DISPLAY_TARGET); - + tex = screen->resource_create(screen, &templat); if (tex == NULL) @@ -279,7 +279,7 @@ static void init( void ) fb.cbufs[0] = surf; ctx->set_framebuffer_state(ctx, &fb); - + { struct pipe_blend_state blend; void *handle; diff --git a/src/gallium/tests/graw/tri.c b/src/gallium/tests/graw/tri.c index 2742c7c..594deae 100644 --- a/src/gallium/tests/graw/tri.c +++ b/src/gallium/tests/graw/tri.c @@ -162,15 +162,15 @@ static void init( void ) * Also, no easy way of querying supported formats if the screen * cannot be created first. */ - for (i = 0; + for (i = 0; window == NULL && formats[i] != PIPE_FORMAT_NONE; i++) { - + screen = graw_create_window_and_screen(0,0,300,300, formats[i], &window); } - + ctx = screen->context_create(screen, NULL); if (ctx == NULL) { fprintf(stderr, "Unable to create context!\n"); @@ -187,7 +187,7 @@ static void init( void ) templat.nr_samples = 1; templat.bind = (PIPE_BIND_RENDER_TARGET | PIPE_BIND_DISPLAY_TARGET); - + tex = screen->resource_create(screen, &templat); if (tex == NULL) { @@ -213,7 +213,7 @@ static void init( void ) fb.cbufs[0] = surf; ctx->set_framebuffer_state(ctx, &fb); - + { struct pipe_blend_state blend; void *handle; diff --git a/src/gallium/tests/graw/vs-test.c b/src/gallium/tests/graw/vs-test.c index 58908f3..ddf64e9 100644 --- a/src/gallium/tests/graw/vs-test.c +++ b/src/gallium/tests/graw/vs-test.c @@ -14,7 +14,7 @@ #include "util/u_inlines.h" #include "util/u_memory.h" /* Offset() */ #include "util/u_draw_quad.h" -#include "util/u_box.h" +#include "util/u_box.h" static const char *filename = NULL; unsigned show_fps = 0; @@ -60,7 +60,7 @@ struct vertex { #define MESH_SZ 16 static struct vertex vertices[MESH_SZ * MESH_SZ]; -static float constants[] = +static float constants[] = { 0.4, 0, 0, 1, 1, 1, 1, 1, 2, 2, 2, 2, @@ -238,7 +238,7 @@ static void draw( void ) #define SIZE 16 static void init_tex( void ) -{ +{ struct pipe_sampler_view sv_template; struct pipe_sampler_state sampler_desc; struct pipe_resource templat; @@ -297,7 +297,7 @@ static void init_tex( void ) templat.nr_samples = 1; templat.bind = PIPE_BIND_SAMPLER_VIEW; - + samptex = screen->resource_create(screen, &templat); if (samptex == NULL) @@ -349,7 +349,7 @@ static void init_tex( void ) exit(5); ctx->set_fragment_sampler_views(ctx, 1, &sv); - + memset(&sampler_desc, 0, sizeof sampler_desc); sampler_desc.wrap_s = PIPE_TEX_WRAP_REPEAT; @@ -362,13 +362,13 @@ static void init_tex( void ) sampler_desc.compare_func = 0; sampler_desc.normalized_coords = 1; sampler_desc.max_anisotropy = 0; - + sampler = ctx->create_sampler_state(ctx, &sampler_desc); if (sampler == NULL) exit(6); ctx->bind_fragment_sampler_states(ctx, 1, &sampler); - + } static void init( void ) @@ -384,15 +384,15 @@ static void init( void ) * Also, no easy way of querying supported formats if the screen * cannot be created first. */ - for (i = 0; + for (i = 0; window == NULL && formats[i] != PIPE_FORMAT_NONE; i++) { - + screen = graw_create_window_and_screen(0,0,WIDTH,HEIGHT, formats[i], &window); } - + ctx = screen->context_create(screen, NULL); if (ctx == NULL) exit(3); @@ -407,7 +407,7 @@ static void init( void ) templat.nr_samples = 1; templat.bind = (PIPE_BIND_RENDER_TARGET | PIPE_BIND_DISPLAY_TARGET); - + rttex = screen->resource_create(screen, &templat); if (rttex == NULL) @@ -429,7 +429,7 @@ static void init( void ) fb.cbufs[0] = surf; ctx->set_framebuffer_state(ctx, &fb); - + { struct pipe_blend_state blend; void *handle; diff --git a/src/gallium/tests/unit/SConscript b/src/gallium/tests/unit/SConscript index 655e8a9..fdf47ee 100644 --- a/src/gallium/tests/unit/SConscript +++ b/src/gallium/tests/unit/SConscript @@ -24,7 +24,7 @@ for prog in progs: target = prog, source = prog + '.c', ) - + env.InstallProgram(prog) # http://www.scons.org/wiki/UnitTests diff --git a/src/gallium/winsys/i915/drm/i915_drm_buffer.c b/src/gallium/winsys/i915/drm/i915_drm_buffer.c index 01dd4bf..e7d0f12 100644 --- a/src/gallium/winsys/i915/drm/i915_drm_buffer.c +++ b/src/gallium/winsys/i915/drm/i915_drm_buffer.c @@ -54,7 +54,7 @@ i915_drm_buffer_create(struct i915_winsys *iws, static struct i915_winsys_buffer * i915_drm_buffer_create_tiled(struct i915_winsys *iws, - unsigned *stride, unsigned height, + unsigned *stride, unsigned height, enum i915_winsys_buffer_tile *tiling, enum i915_winsys_buffer_type type) { diff --git a/src/gallium/winsys/i915/sw/i915_sw_buffer.c b/src/gallium/winsys/i915/sw/i915_sw_buffer.c index 834805e..2678dbe 100644 --- a/src/gallium/winsys/i915/sw/i915_sw_buffer.c +++ b/src/gallium/winsys/i915/sw/i915_sw_buffer.c @@ -29,7 +29,7 @@ i915_sw_buffer_create(struct i915_winsys *iws, static struct i915_winsys_buffer * i915_sw_buffer_create_tiled(struct i915_winsys *iws, - unsigned *stride, unsigned height, + unsigned *stride, unsigned height, enum i915_winsys_buffer_tile *tiling, enum i915_winsys_buffer_type type) { diff --git a/src/gallium/winsys/i965/drm/i965_drm_buffer.c b/src/gallium/winsys/i965/drm/i965_drm_buffer.c index ed62db6..d6cc1de 100644 --- a/src/gallium/winsys/i965/drm/i965_drm_buffer.c +++ b/src/gallium/winsys/i965/drm/i965_drm_buffer.c @@ -62,7 +62,7 @@ const char *data_types[BRW_DATA_MAX] = "(untyped)" }; -static enum pipe_error +static enum pipe_error i965_libdrm_bo_alloc(struct brw_winsys_screen *sws, enum brw_buffer_type type, unsigned size, @@ -102,9 +102,9 @@ i965_libdrm_bo_alloc(struct brw_winsys_screen *sws, break; } - buf->bo = drm_intel_bo_alloc(idws->gem, - names[type], - size, + buf->bo = drm_intel_bo_alloc(idws->gem, + names[type], + size, alignment); if (!buf->bo) @@ -195,7 +195,7 @@ i965_libdrm_bo_get_handle(struct brw_winsys_buffer *buffer, return PIPE_OK; } -static void +static void i965_libdrm_bo_destroy(struct brw_winsys_buffer *buffer) { struct i965_libdrm_buffer *buf = i965_libdrm_buffer(buffer); @@ -221,7 +221,7 @@ i965_libdrm_bo_emit_reloc(struct brw_winsys_buffer *buffer, if (BRW_DUMP) debug_printf("%s buf %p offset %x delta %x buf2 %p/%s/%s\n", - __FUNCTION__, (void *)buffer, + __FUNCTION__, (void *)buffer, offset, delta, (void *)buffer2, names[buf2->data_type], usages[usage]); @@ -279,7 +279,7 @@ i965_libdrm_bo_emit_reloc(struct brw_winsys_buffer *buffer, return 0; } -static enum pipe_error +static enum pipe_error i965_libdrm_bo_exec(struct brw_winsys_buffer *buffer, unsigned bytes_used) { @@ -315,16 +315,16 @@ i965_libdrm_bo_subdata(struct brw_winsys_buffer *buffer, (void)data_type; if (BRW_DUMP) - debug_printf("%s buf %p off %d sz %d %s relocs: %d\n", - __FUNCTION__, - (void *)buffer, offset, size, + debug_printf("%s buf %p off %d sz %d %s relocs: %d\n", + __FUNCTION__, + (void *)buffer, offset, size, data_types[data_type], nr_reloc); if (BRW_DUMP) brw_dump_data( idws->base.pci_id, data_type, - buf->bo->offset + offset, + buf->bo->offset + offset, data, size ); /* XXX: use bo_map_gtt/memcpy/unmap_gtt under some circumstances??? @@ -332,7 +332,7 @@ i965_libdrm_bo_subdata(struct brw_winsys_buffer *buffer, ret = drm_intel_bo_subdata(buf->bo, offset, size, (void*)data); if (ret) return PIPE_ERROR; - + for (i = 0; i < nr_reloc; i++) { i965_libdrm_bo_emit_reloc(buffer, reloc[i].usage, reloc[i].delta, reloc[i].offset, reloc[i].bo); @@ -341,7 +341,7 @@ i965_libdrm_bo_subdata(struct brw_winsys_buffer *buffer, return PIPE_OK; } -static boolean +static boolean i965_libdrm_bo_is_busy(struct brw_winsys_buffer *buffer) { struct i965_libdrm_buffer *buf = i965_libdrm_buffer(buffer); @@ -358,7 +358,7 @@ i965_libdrm_bo_is_busy(struct brw_winsys_buffer *buffer) return ret; } -static boolean +static boolean i965_libdrm_bo_references(struct brw_winsys_buffer *a, struct brw_winsys_buffer *b) { @@ -424,7 +424,7 @@ i965_libdrm_bo_map(struct brw_winsys_buffer *buffer, if (BRW_DUMP) - debug_printf("%s %p %s %s\n", __FUNCTION__, (void *)buffer, + debug_printf("%s %p %s %s\n", __FUNCTION__, (void *)buffer, write ? "read/write" : "read", write ? data_types[data_type] : ""); @@ -462,12 +462,12 @@ i965_libdrm_bo_flush_range(struct brw_winsys_buffer *buffer, if (BRW_DUMP) brw_dump_data( idws->base.pci_id, buf->data_type, - buf->bo->offset + offset, - (char*)buf->bo->virtual + offset, + buf->bo->offset + offset, + (char*)buf->bo->virtual + offset, length ); } -static void +static void i965_libdrm_bo_unmap(struct brw_winsys_buffer *buffer) { struct i965_libdrm_buffer *buf = i965_libdrm_buffer(buffer); diff --git a/src/gallium/winsys/i965/drm/i965_drm_winsys.h b/src/gallium/winsys/i965/drm/i965_drm_winsys.h index 82dbe61..d85bd9b 100644 --- a/src/gallium/winsys/i965/drm/i965_drm_winsys.h +++ b/src/gallium/winsys/i965/drm/i965_drm_winsys.h @@ -33,7 +33,7 @@ i965_libdrm_winsys(struct brw_winsys_screen *iws) void i965_libdrm_winsys_init_buffer_functions(struct i965_libdrm_winsys *idws); -/* Buffer. +/* Buffer. */ struct i965_libdrm_buffer { struct brw_winsys_buffer base; diff --git a/src/gallium/winsys/i965/xlib/Makefile b/src/gallium/winsys/i965/xlib/Makefile index cc82493..1183e4c 100644 --- a/src/gallium/winsys/i965/xlib/Makefile +++ b/src/gallium/winsys/i965/xlib/Makefile @@ -40,7 +40,7 @@ LIBS = \ $(TOP)/src/gallium/state_trackers/glx/xlib/libxlib.a \ $(TOP)/src/mapi/glapi/libglapi.a \ $(TOP)/src/mesa/libmesagallium.a \ - $(GALLIUM_AUXILIARIES) + $(GALLIUM_AUXILIARIES) # $(TOP)/src/gallium/drivers/i965/lib/libi9xx.a \ diff --git a/src/gallium/winsys/i965/xlib/xlib_i965.c b/src/gallium/winsys/i965/xlib/xlib_i965.c index c22df66..df428dd 100644 --- a/src/gallium/winsys/i965/xlib/xlib_i965.c +++ b/src/gallium/winsys/i965/xlib/xlib_i965.c @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2007 Tungsten Graphics, Inc., Bismarck, ND., USA * 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,20 +10,20 @@ * 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 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. IN NO EVENT SHALL * THE COPYRIGHT HOLDERS, AUTHORS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, - * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR - * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE + * 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. * * The above copyright notice and this permission notice (including the * next paragraph) shall be included in all copies or substantial portions * of the Software. - * - * + * + * **************************************************************************/ /* @@ -50,11 +50,11 @@ -extern int brw_disasm (FILE *file, +extern int brw_disasm (FILE *file, const struct brw_instruction *inst, unsigned count ); -extern int intel_decode(const uint32_t *data, +extern int intel_decode(const uint32_t *data, int count, uint32_t hw_offset, uint32_t devid); @@ -193,7 +193,7 @@ xlib_brw_bo_alloc( struct brw_winsys_screen *sws, return PIPE_ERROR_OUT_OF_MEMORY; } -static void +static void xlib_brw_bo_destroy( struct brw_winsys_buffer *buffer ) { struct xlib_brw_buffer *buf = xlib_brw_buffer(buffer); @@ -201,7 +201,7 @@ xlib_brw_bo_destroy( struct brw_winsys_buffer *buffer ) FREE(buf); } -static int +static int xlib_brw_bo_emit_reloc( struct brw_winsys_buffer *buffer, enum brw_buffer_usage usage, unsigned delta, @@ -222,7 +222,7 @@ xlib_brw_bo_emit_reloc( struct brw_winsys_buffer *buffer, return 0; } -static int +static int xlib_brw_bo_exec( struct brw_winsys_buffer *buffer, unsigned bytes_used ) { @@ -249,9 +249,9 @@ xlib_brw_bo_subdata(struct brw_winsys_buffer *buffer, unsigned i; if (BRW_DEBUG & DEBUG_WINSYS) - debug_printf("%s buf %p off %d sz %d %s relocs: %d\n", - __FUNCTION__, - (void *)buffer, offset, size, + debug_printf("%s buf %p off %d sz %d %s relocs: %d\n", + __FUNCTION__, + (void *)buffer, offset, size, data_types[data_type], nr_relocs); @@ -262,18 +262,18 @@ xlib_brw_bo_subdata(struct brw_winsys_buffer *buffer, */ for (i = 0; i < nr_relocs; i++) { if (BRW_DEBUG & DEBUG_WINSYS) - debug_printf("\treloc[%d] usage %s off %d value %x+%x\n", + debug_printf("\treloc[%d] usage %s off %d value %x+%x\n", i, usages[reloc[i].usage], reloc[i].offset, xlib_brw_buffer(reloc[i].bo)->offset, reloc[i].delta); - *(unsigned *)(buf->virtual + offset + reloc[i].offset) = + *(unsigned *)(buf->virtual + offset + reloc[i].offset) = xlib_brw_buffer(reloc[i].bo)->offset + reloc[i].delta; } if (BRW_DUMP) brw_dump_data( xbw->chipset.pci_id, data_type, - buf->offset + offset, + buf->offset + offset, buf->virtual + offset, size ); @@ -281,7 +281,7 @@ xlib_brw_bo_subdata(struct brw_winsys_buffer *buffer, } -static boolean +static boolean xlib_brw_bo_is_busy(struct brw_winsys_buffer *buffer) { if (BRW_DEBUG & DEBUG_WINSYS) @@ -289,7 +289,7 @@ xlib_brw_bo_is_busy(struct brw_winsys_buffer *buffer) return TRUE; } -static boolean +static boolean xlib_brw_bo_references(struct brw_winsys_buffer *a, struct brw_winsys_buffer *b) { @@ -310,8 +310,8 @@ xlib_brw_check_aperture_space( struct brw_winsys_screen *iws, tot_size += buffers[i]->size; if (BRW_DEBUG & DEBUG_WINSYS) - debug_printf("%s %d bufs, tot_size: %d kb\n", - __FUNCTION__, count, + debug_printf("%s %d bufs, tot_size: %d kb\n", + __FUNCTION__, count, (tot_size + 1023) / 1024); return PIPE_OK; @@ -329,7 +329,7 @@ xlib_brw_bo_map(struct brw_winsys_buffer *buffer, struct xlib_brw_buffer *buf = xlib_brw_buffer(buffer); if (BRW_DEBUG & DEBUG_WINSYS) - debug_printf("%s %p %s %s\n", __FUNCTION__, (void *)buffer, + debug_printf("%s %p %s %s\n", __FUNCTION__, (void *)buffer, write ? "read/write" : "read", write ? data_types[data_type] : ""); @@ -349,7 +349,7 @@ xlib_brw_bo_flush_range( struct brw_winsys_buffer *buffer, } -static void +static void xlib_brw_bo_unmap(struct brw_winsys_buffer *buffer) { struct xlib_brw_buffer *buf = xlib_brw_buffer(buffer); @@ -364,7 +364,7 @@ xlib_brw_bo_unmap(struct brw_winsys_buffer *buffer) buf->modified) { buf->modified = 0; - + /* Consider dumping new buffer contents here, using the * flush-range info to minimize verbosity. */ @@ -477,14 +477,14 @@ xlib_create_i965_screen( void ) -struct xm_driver xlib_i965_driver = +struct xm_driver xlib_i965_driver = { .create_pipe_screen = xlib_create_i965_screen, .display_surface = xlib_i965_display_surface }; -/* Register this driver at library load: +/* Register this driver at library load: */ static void _init( void ) __attribute__((constructor)); static void _init( void ) diff --git a/src/gallium/winsys/psl1ght/Makefile b/src/gallium/winsys/psl1ght/Makefile index 2a82430..339e0fe 100644 --- a/src/gallium/winsys/psl1ght/Makefile +++ b/src/gallium/winsys/psl1ght/Makefile @@ -28,7 +28,7 @@ LIBS = \ $(TOP)/src/gallium/drivers/trace/libtrace.a \ $(TOP)/src/mapi/glapi/libglapi.a \ $(TOP)/src/mesa/libmesagallium.a \ - $(GALLIUM_AUXILIARIES) + $(GALLIUM_AUXILIARIES) .c.o: $(CC) -c $(INCLUDE_DIRS) $(DEFINES) $(CFLAGS) $< -o $@ diff --git a/src/gallium/winsys/psl1ght/nouveau/nouveau_bo.c b/src/gallium/winsys/psl1ght/nouveau/nouveau_bo.c index cf31e0f..5e0263e 100644 --- a/src/gallium/winsys/psl1ght/nouveau/nouveau_bo.c +++ b/src/gallium/winsys/psl1ght/nouveau/nouveau_bo.c @@ -277,13 +277,13 @@ nouveau_bo_handle_get(struct nouveau_bo *bo, uint32_t *handle) struct nouveau_device_priv *nvdev = nouveau_device(bo->device); struct nouveau_bo_priv *nvbo = nouveau_bo(bo); int ret; - + if (!bo || !handle) return -EINVAL; if (!nvbo->global_handle) { struct drm_gem_flink req; - + ret = nouveau_bo_kalloc(nvbo, NULL); if (ret) return ret; @@ -297,7 +297,7 @@ nouveau_bo_handle_get(struct nouveau_bo *bo, uint32_t *handle) nvbo->global_handle = req.name; } - + *handle = nvbo->global_handle; #else printf("nouveau_bo_handle_get not implemented\n"); @@ -305,7 +305,7 @@ nouveau_bo_handle_get(struct nouveau_bo *bo, uint32_t *handle) #endif return 0; } - + int nouveau_bo_handle_ref(struct nouveau_device *dev, uint32_t handle, struct nouveau_bo **bo) @@ -336,7 +336,7 @@ nouveau_bo_handle_ref(struct nouveau_device *dev, uint32_t handle, abort(); #endif return 0; -} +} static void nouveau_bo_del(struct nouveau_bo **bo) diff --git a/src/gallium/winsys/psl1ght/nouveau/nouveau_grobj.c b/src/gallium/winsys/psl1ght/nouveau/nouveau_grobj.c index d7bcbc3..2d3389c 100644 --- a/src/gallium/winsys/psl1ght/nouveau/nouveau_grobj.c +++ b/src/gallium/winsys/psl1ght/nouveau/nouveau_grobj.c @@ -110,7 +110,7 @@ nouveau_grobj_free(struct nouveau_grobj **grobj) f.channel = chan->drm.channel; f.handle = nvgrobj->base.handle; drmCommandWrite(nvdev->fd, DRM_NOUVEAU_GPUOBJ_FREE, - &f, sizeof(f)); + &f, sizeof(f)); } free(nvgrobj); #else diff --git a/src/gallium/winsys/psl1ght/nouveau/nouveau_notifier.c b/src/gallium/winsys/psl1ght/nouveau/nouveau_notifier.c index 59b1db0..3526596 100644 --- a/src/gallium/winsys/psl1ght/nouveau/nouveau_notifier.c +++ b/src/gallium/winsys/psl1ght/nouveau/nouveau_notifier.c @@ -90,7 +90,7 @@ nouveau_notifier_free(struct nouveau_notifier **notifier) f.channel = nvchan->drm.channel; f.handle = nvnotify->base.handle; - drmCommandWrite(nvdev->fd, DRM_NOUVEAU_GPUOBJ_FREE, &f, sizeof(f)); + drmCommandWrite(nvdev->fd, DRM_NOUVEAU_GPUOBJ_FREE, &f, sizeof(f)); free(nvnotify); #else printf("nouveau_notifier_kfree not implemented\n"); diff --git a/src/gallium/winsys/psl1ght/nouveau/nouveau_pushbuf.h b/src/gallium/winsys/psl1ght/nouveau/nouveau_pushbuf.h index 52d13a0..af383ce 100644 --- a/src/gallium/winsys/psl1ght/nouveau/nouveau_pushbuf.h +++ b/src/gallium/winsys/psl1ght/nouveau/nouveau_pushbuf.h @@ -125,7 +125,7 @@ static __inline__ void BIND_RING(struct nouveau_channel *chan, struct nouveau_grobj *gr, unsigned sc) { struct nouveau_subchannel *subc = &gr->channel->subc[sc]; - + if (subc->gr) { if (subc->gr->bound == NOUVEAU_GROBJ_BOUND_EXPLICIT) assert(0); diff --git a/src/gallium/winsys/psl1ght/nouveau/nouveau_resource.c b/src/gallium/winsys/psl1ght/nouveau/nouveau_resource.c index 7acaf7d..5407c3b 100644 --- a/src/gallium/winsys/psl1ght/nouveau/nouveau_resource.c +++ b/src/gallium/winsys/psl1ght/nouveau/nouveau_resource.c @@ -81,7 +81,7 @@ nouveau_resource_alloc(struct nouveau_resource *heap, unsigned size, void *priv, *res = r; return 0; } - + heap = heap->next; } @@ -120,5 +120,5 @@ nouveau_resource_free(struct nouveau_resource **res) r->prev->size += r->size; free(r); } - + } diff --git a/src/gallium/winsys/r600/drm/bof.c b/src/gallium/winsys/r600/drm/bof.c index 0598cc6..5c923ad 100644 --- a/src/gallium/winsys/r600/drm/bof.c +++ b/src/gallium/winsys/r600/drm/bof.c @@ -46,7 +46,7 @@ static int bof_entry_grow(bof_t *bof) } /* - * object + * object */ bof_t *bof_object(void) { diff --git a/src/gallium/winsys/r600/drm/radeon_bo.c b/src/gallium/winsys/r600/drm/radeon_bo.c index 7e5f392..999de82 100644 --- a/src/gallium/winsys/r600/drm/radeon_bo.c +++ b/src/gallium/winsys/r600/drm/radeon_bo.c @@ -206,13 +206,13 @@ int radeon_bo_get_tiling_flags(struct radeon *radeon, { struct drm_radeon_gem_get_tiling args; int ret; - + args.handle = bo->handle; ret = drmCommandWriteRead(radeon->fd, DRM_RADEON_GEM_GET_TILING, &args, sizeof(args)); if (ret) return ret; - + *tiling_flags = args.tiling_flags; *pitch = args.pitch; return ret; diff --git a/src/gallium/winsys/r600/drm/radeon_pciid.c b/src/gallium/winsys/r600/drm/radeon_pciid.c index 4e1e746..851ab9f 100644 --- a/src/gallium/winsys/r600/drm/radeon_pciid.c +++ b/src/gallium/winsys/r600/drm/radeon_pciid.c @@ -40,29 +40,29 @@ struct pci_id radeon_pci_id[] = { {0x1002, 0x3E54, CHIP_RV380}, {0x1002, 0x4136, CHIP_RS100}, {0x1002, 0x4137, CHIP_RS200}, - {0x1002, 0x4144, CHIP_R300}, - {0x1002, 0x4145, CHIP_R300}, - {0x1002, 0x4146, CHIP_R300}, - {0x1002, 0x4147, CHIP_R300}, - {0x1002, 0x4148, CHIP_R350}, - {0x1002, 0x4149, CHIP_R350}, - {0x1002, 0x414A, CHIP_R350}, - {0x1002, 0x414B, CHIP_R350}, - {0x1002, 0x4150, CHIP_RV350}, - {0x1002, 0x4151, CHIP_RV350}, - {0x1002, 0x4152, CHIP_RV350}, - {0x1002, 0x4153, CHIP_RV350}, - {0x1002, 0x4154, CHIP_RV350}, - {0x1002, 0x4155, CHIP_RV350}, - {0x1002, 0x4156, CHIP_RV350}, + {0x1002, 0x4144, CHIP_R300}, + {0x1002, 0x4145, CHIP_R300}, + {0x1002, 0x4146, CHIP_R300}, + {0x1002, 0x4147, CHIP_R300}, + {0x1002, 0x4148, CHIP_R350}, + {0x1002, 0x4149, CHIP_R350}, + {0x1002, 0x414A, CHIP_R350}, + {0x1002, 0x414B, CHIP_R350}, + {0x1002, 0x4150, CHIP_RV350}, + {0x1002, 0x4151, CHIP_RV350}, + {0x1002, 0x4152, CHIP_RV350}, + {0x1002, 0x4153, CHIP_RV350}, + {0x1002, 0x4154, CHIP_RV350}, + {0x1002, 0x4155, CHIP_RV350}, + {0x1002, 0x4156, CHIP_RV350}, {0x1002, 0x4237, CHIP_RS200}, - {0x1002, 0x4242, CHIP_R200}, - {0x1002, 0x4243, CHIP_R200}, + {0x1002, 0x4242, CHIP_R200}, + {0x1002, 0x4243, CHIP_R200}, {0x1002, 0x4336, CHIP_RS100}, {0x1002, 0x4337, CHIP_RS200}, {0x1002, 0x4437, CHIP_RS200}, - {0x1002, 0x4966, CHIP_RV250}, - {0x1002, 0x4967, CHIP_RV250}, + {0x1002, 0x4966, CHIP_RV250}, + {0x1002, 0x4967, CHIP_RV250}, {0x1002, 0x4A48, CHIP_R420}, {0x1002, 0x4A49, CHIP_R420}, {0x1002, 0x4A4A, CHIP_R420}, @@ -85,14 +85,14 @@ struct pci_id radeon_pci_id[] = { {0x1002, 0x4C64, CHIP_RV250}, {0x1002, 0x4C66, CHIP_RV250}, {0x1002, 0x4C67, CHIP_RV250}, - {0x1002, 0x4E44, CHIP_R300}, - {0x1002, 0x4E45, CHIP_R300}, - {0x1002, 0x4E46, CHIP_R300}, - {0x1002, 0x4E47, CHIP_R300}, - {0x1002, 0x4E48, CHIP_R350}, - {0x1002, 0x4E49, CHIP_R350}, - {0x1002, 0x4E4A, CHIP_R350}, - {0x1002, 0x4E4B, CHIP_R350}, + {0x1002, 0x4E44, CHIP_R300}, + {0x1002, 0x4E45, CHIP_R300}, + {0x1002, 0x4E46, CHIP_R300}, + {0x1002, 0x4E47, CHIP_R300}, + {0x1002, 0x4E48, CHIP_R350}, + {0x1002, 0x4E49, CHIP_R350}, + {0x1002, 0x4E4A, CHIP_R350}, + {0x1002, 0x4E4B, CHIP_R350}, {0x1002, 0x4E50, CHIP_RV350}, {0x1002, 0x4E51, CHIP_RV350}, {0x1002, 0x4E52, CHIP_RV350}, @@ -103,13 +103,13 @@ struct pci_id radeon_pci_id[] = { {0x1002, 0x5145, CHIP_R100}, {0x1002, 0x5146, CHIP_R100}, {0x1002, 0x5147, CHIP_R100}, - {0x1002, 0x5148, CHIP_R200}, - {0x1002, 0x514C, CHIP_R200}, - {0x1002, 0x514D, CHIP_R200}, - {0x1002, 0x5157, CHIP_RV200}, - {0x1002, 0x5158, CHIP_RV200}, - {0x1002, 0x5159, CHIP_RV100}, - {0x1002, 0x515A, CHIP_RV100}, + {0x1002, 0x5148, CHIP_R200}, + {0x1002, 0x514C, CHIP_R200}, + {0x1002, 0x514D, CHIP_R200}, + {0x1002, 0x5157, CHIP_RV200}, + {0x1002, 0x5158, CHIP_RV200}, + {0x1002, 0x5159, CHIP_RV100}, + {0x1002, 0x515A, CHIP_RV100}, {0x1002, 0x515E, CHIP_RV100}, {0x1002, 0x5460, CHIP_RV380}, {0x1002, 0x5462, CHIP_RV380}, @@ -138,10 +138,10 @@ struct pci_id radeon_pci_id[] = { {0x1002, 0x5955, CHIP_RS480}, {0x1002, 0x5974, CHIP_RS480}, {0x1002, 0x5975, CHIP_RS480}, - {0x1002, 0x5960, CHIP_RV280}, - {0x1002, 0x5961, CHIP_RV280}, - {0x1002, 0x5962, CHIP_RV280}, - {0x1002, 0x5964, CHIP_RV280}, + {0x1002, 0x5960, CHIP_RV280}, + {0x1002, 0x5961, CHIP_RV280}, + {0x1002, 0x5962, CHIP_RV280}, + {0x1002, 0x5964, CHIP_RV280}, {0x1002, 0x5965, CHIP_RV280}, {0x1002, 0x5969, CHIP_RV100}, {0x1002, 0x5a41, CHIP_RS400}, diff --git a/src/gallium/winsys/radeon/drm/radeon_drm_buffer.c b/src/gallium/winsys/radeon/drm/radeon_drm_buffer.c index dc4b517..4a1d472 100644 --- a/src/gallium/winsys/radeon/drm/radeon_drm_buffer.c +++ b/src/gallium/winsys/radeon/drm/radeon_drm_buffer.c @@ -313,7 +313,7 @@ radeon_drm_bufmgr_create_buffer(struct pb_manager *_mgr, error2: FREE(buf); error1: - return NULL; + return NULL; } static void diff --git a/src/gallium/winsys/svga/drm/SConscript b/src/gallium/winsys/svga/drm/SConscript index b049ea6..5864533 100644 --- a/src/gallium/winsys/svga/drm/SConscript +++ b/src/gallium/winsys/svga/drm/SConscript @@ -7,11 +7,11 @@ env.ParseConfig('pkg-config --cflags libdrm') if env['gcc']: env.Append(CCFLAGS = ['-fvisibility=hidden']) env.Append(CPPDEFINES = [ - 'HAVE_STDINT_H', + 'HAVE_STDINT_H', 'HAVE_SYS_TYPES_H', '-D_FILE_OFFSET_BITS=64', ]) - + env.Prepend(CPPPATH = [ 'include', '#/src/gallium/drivers/svga', diff --git a/src/gallium/winsys/svga/drm/vmw_buffer.c b/src/gallium/winsys/svga/drm/vmw_buffer.c index eca174a..58ab1d0 100644 --- a/src/gallium/winsys/svga/drm/vmw_buffer.c +++ b/src/gallium/winsys/svga/drm/vmw_buffer.c @@ -26,15 +26,15 @@ /** * @file * SVGA buffer manager for Guest Memory Regions (GMRs). - * + * * GMRs are used for pixel and vertex data upload/download to/from the virtual - * SVGA hardware. There is a limited number of GMRs available, and - * creating/destroying them is also a slow operation so we must suballocate + * SVGA hardware. There is a limited number of GMRs available, and + * creating/destroying them is also a slow operation so we must suballocate * them. - * + * * This file implements a pipebuffer library's buffer manager, so that we can - * use pipepbuffer's suballocation, fencing, and debugging facilities with GMRs. - * + * use pipepbuffer's suballocation, fencing, and debugging facilities with GMRs. + * * @author Jose Fonseca */ @@ -58,12 +58,12 @@ struct vmw_gmr_bufmgr; struct vmw_gmr_buffer { struct pb_buffer base; - + struct vmw_gmr_bufmgr *mgr; - + struct vmw_region *region; void *map; - + #ifdef DEBUG struct pipe_fence_handle *last_fence; #endif @@ -85,7 +85,7 @@ vmw_gmr_buffer(struct pb_buffer *buf) struct vmw_gmr_bufmgr { struct pb_manager base; - + struct vmw_winsys_screen *vws; }; @@ -111,7 +111,7 @@ vmw_gmr_buffer_destroy(struct pb_buffer *_buf) #endif vmw_ioctl_region_unmap(buf->region); - + vmw_ioctl_region_destroy(buf->region); FREE(buf); @@ -146,7 +146,7 @@ vmw_gmr_buffer_get_base_buffer(struct pb_buffer *buf, static enum pipe_error -vmw_gmr_buffer_validate( struct pb_buffer *_buf, +vmw_gmr_buffer_validate( struct pb_buffer *_buf, struct pb_validate *vl, unsigned flags ) { @@ -156,11 +156,11 @@ vmw_gmr_buffer_validate( struct pb_buffer *_buf, static void -vmw_gmr_buffer_fence( struct pb_buffer *_buf, +vmw_gmr_buffer_fence( struct pb_buffer *_buf, struct pipe_fence_handle *fence ) { /* We don't need to do anything, as the pipebuffer library - * will take care of delaying the destruction of fenced buffers */ + * will take care of delaying the destruction of fenced buffers */ #ifdef DEBUG struct vmw_gmr_buffer *buf = vmw_gmr_buffer(_buf); if(fence) @@ -182,12 +182,12 @@ const struct pb_vtbl vmw_gmr_buffer_vtbl = { static struct pb_buffer * vmw_gmr_bufmgr_create_buffer(struct pb_manager *_mgr, pb_size size, - const struct pb_desc *desc) + const struct pb_desc *desc) { struct vmw_gmr_bufmgr *mgr = vmw_gmr_bufmgr(_mgr); struct vmw_winsys_screen *vws = mgr->vws; struct vmw_gmr_buffer *buf; - + buf = CALLOC_STRUCT(vmw_gmr_buffer); if(!buf) goto error1; @@ -202,7 +202,7 @@ vmw_gmr_bufmgr_create_buffer(struct pb_manager *_mgr, buf->region = vmw_ioctl_region_create(vws, size); if(!buf->region) goto error2; - + buf->map = vmw_ioctl_region_map(buf->region); if(!buf->map) goto error3; @@ -219,14 +219,14 @@ vmw_gmr_bufmgr_create_buffer(struct pb_manager *_mgr, static void -vmw_gmr_bufmgr_flush(struct pb_manager *mgr) +vmw_gmr_bufmgr_flush(struct pb_manager *mgr) { /* No-op */ } static void -vmw_gmr_bufmgr_destroy(struct pb_manager *_mgr) +vmw_gmr_bufmgr_destroy(struct pb_manager *_mgr) { struct vmw_gmr_bufmgr *mgr = vmw_gmr_bufmgr(_mgr); FREE(mgr); @@ -234,10 +234,10 @@ vmw_gmr_bufmgr_destroy(struct pb_manager *_mgr) struct pb_manager * -vmw_gmr_bufmgr_create(struct vmw_winsys_screen *vws) +vmw_gmr_bufmgr_create(struct vmw_winsys_screen *vws) { struct vmw_gmr_bufmgr *mgr; - + mgr = CALLOC_STRUCT(vmw_gmr_bufmgr); if(!mgr) return NULL; @@ -245,30 +245,30 @@ vmw_gmr_bufmgr_create(struct vmw_winsys_screen *vws) mgr->base.destroy = vmw_gmr_bufmgr_destroy; mgr->base.create_buffer = vmw_gmr_bufmgr_create_buffer; mgr->base.flush = vmw_gmr_bufmgr_flush; - + mgr->vws = vws; - + return &mgr->base; } boolean -vmw_gmr_bufmgr_region_ptr(struct pb_buffer *buf, +vmw_gmr_bufmgr_region_ptr(struct pb_buffer *buf, struct SVGAGuestPtr *ptr) { struct pb_buffer *base_buf; unsigned offset = 0; struct vmw_gmr_buffer *gmr_buf; - + pb_get_base_buffer( buf, &base_buf, &offset ); - + gmr_buf = vmw_gmr_buffer(base_buf); if(!gmr_buf) return FALSE; - + *ptr = vmw_ioctl_region_ptr(gmr_buf->region); - + ptr->offset += offset; - + return TRUE; } diff --git a/src/gallium/winsys/svga/drm/vmw_buffer.h b/src/gallium/winsys/svga/drm/vmw_buffer.h index 41fb447..b650b4c 100644 --- a/src/gallium/winsys/svga/drm/vmw_buffer.h +++ b/src/gallium/winsys/svga/drm/vmw_buffer.h @@ -58,7 +58,7 @@ struct pb_manager * vmw_gmr_bufmgr_create(struct vmw_winsys_screen *vws); boolean -vmw_gmr_bufmgr_region_ptr(struct pb_buffer *buf, +vmw_gmr_bufmgr_region_ptr(struct pb_buffer *buf, struct SVGAGuestPtr *ptr); diff --git a/src/gallium/winsys/svga/drm/vmw_context.c b/src/gallium/winsys/svga/drm/vmw_context.c index 11626ee..be0d28a 100644 --- a/src/gallium/winsys/svga/drm/vmw_context.c +++ b/src/gallium/winsys/svga/drm/vmw_context.c @@ -78,7 +78,7 @@ struct vmw_svga_winsys_context uint32_t staged; uint32_t reserved; } surface; - + struct { struct vmw_region_relocation relocs[VMW_REGION_RELOCS]; uint32_t size; @@ -143,7 +143,7 @@ vmw_swc_flush(struct svga_winsys_context *swc, ret = pb_validate_validate(vswc->validate); assert(ret == PIPE_OK); if(ret == PIPE_OK) { - + /* Apply relocations */ for(i = 0; i < vswc->region.used; ++i) { struct vmw_region_relocation *reloc = &vswc->region.relocs[i]; @@ -240,13 +240,13 @@ vmw_swc_reserve(struct svga_winsys_context *swc, assert(vswc->command.used + nr_bytes <= vswc->command.size); assert(vswc->surface.used + nr_relocs <= vswc->surface.size); assert(vswc->region.used + nr_relocs <= vswc->region.size); - + vswc->command.reserved = nr_bytes; vswc->surface.reserved = nr_relocs; vswc->surface.staged = 0; vswc->region.reserved = nr_relocs; vswc->region.staged = 0; - + return vswc->command.buffer + vswc->command.used; } @@ -288,7 +288,7 @@ vmw_swc_region_relocation(struct svga_winsys_context *swc, struct vmw_region_relocation *reloc; unsigned translated_flags; enum pipe_error ret; - + assert(vswc->region.staged < vswc->region.reserved); reloc = &vswc->region.relocs[vswc->region.used + vswc->region.staged]; diff --git a/src/gallium/winsys/svga/drm/vmw_fence.c b/src/gallium/winsys/svga/drm/vmw_fence.c index 873dd51..31d56fe 100644 --- a/src/gallium/winsys/svga/drm/vmw_fence.c +++ b/src/gallium/winsys/svga/drm/vmw_fence.c @@ -32,7 +32,7 @@ -struct vmw_fence_ops +struct vmw_fence_ops { struct pb_fence_ops base; @@ -87,7 +87,7 @@ vmw_fence_ops_destroy(struct pb_fence_ops *ops) struct pb_fence_ops * -vmw_fence_ops_create(struct vmw_winsys_screen *vws) +vmw_fence_ops_create(struct vmw_winsys_screen *vws) { struct vmw_fence_ops *ops; diff --git a/src/gallium/winsys/svga/drm/vmw_fence.h b/src/gallium/winsys/svga/drm/vmw_fence.h index 5357b4f..430e808 100644 --- a/src/gallium/winsys/svga/drm/vmw_fence.h +++ b/src/gallium/winsys/svga/drm/vmw_fence.h @@ -53,7 +53,7 @@ vmw_pipe_fence( uint32_t fence ) struct pb_fence_ops * -vmw_fence_ops_create(struct vmw_winsys_screen *vws); +vmw_fence_ops_create(struct vmw_winsys_screen *vws); #endif /* VMW_FENCE_H_ */ diff --git a/src/gallium/winsys/svga/drm/vmw_screen_ioctl.c b/src/gallium/winsys/svga/drm/vmw_screen_ioctl.c index d92ba38..648e126 100644 --- a/src/gallium/winsys/svga/drm/vmw_screen_ioctl.c +++ b/src/gallium/winsys/svga/drm/vmw_screen_ioctl.c @@ -418,14 +418,14 @@ vmw_ioctl_fence_signalled(struct vmw_winsys_screen *vws, { uint32_t expected; uint32_t current; - + assert(fence); if(!fence) return 0; - + expected = fence; current = vws->ioctl.fifo_map[SVGA_FIFO_FENCE]; - + if ((int32)(current - expected) >= 0) return 0; /* fence passed */ else @@ -434,7 +434,7 @@ vmw_ioctl_fence_signalled(struct vmw_winsys_screen *vws, static void -vmw_ioctl_sync(struct vmw_winsys_screen *vws, +vmw_ioctl_sync(struct vmw_winsys_screen *vws, uint32_t fence) { uint32_t cur_fence; @@ -466,13 +466,13 @@ vmw_ioctl_fence_finish(struct vmw_winsys_screen *vws, uint32_t fence) { assert(fence); - + if(fence) { if(vmw_ioctl_fence_signalled(vws, fence) != 0) { vmw_ioctl_sync(vws, fence); } } - + return 0; } diff --git a/src/gallium/winsys/svga/drm/vmw_surface.h b/src/gallium/winsys/svga/drm/vmw_surface.h index 3d61595..619bd3d 100644 --- a/src/gallium/winsys/svga/drm/vmw_surface.h +++ b/src/gallium/winsys/svga/drm/vmw_surface.h @@ -26,7 +26,7 @@ /** * @file * Surfaces for VMware SVGA winsys. - * + * * @author Jose Fonseca */ diff --git a/src/gallium/winsys/sw/gdi/gdi_sw_winsys.c b/src/gallium/winsys/sw/gdi/gdi_sw_winsys.c index 2e12f6e..0c0323d 100644 --- a/src/gallium/winsys/sw/gdi/gdi_sw_winsys.c +++ b/src/gallium/winsys/sw/gdi/gdi_sw_winsys.c @@ -79,9 +79,9 @@ gdi_sw_is_displaytarget_format_supported( struct sw_winsys *ws, case PIPE_FORMAT_B8G8R8A8_UNORM: return TRUE; - /* TODO: Support other formats possible with BMPs, as described in + /* TODO: Support other formats possible with BMPs, as described in * http://msdn.microsoft.com/en-us/library/dd183376(VS.85).aspx */ - + default: return FALSE; } @@ -129,7 +129,7 @@ gdi_sw_displaytarget_create(struct sw_winsys *winsys, struct gdi_sw_displaytarget *gdt; unsigned cpp; unsigned bpp; - + gdt = CALLOC_STRUCT(gdi_sw_displaytarget); if(!gdt) goto no_gdt; @@ -140,10 +140,10 @@ gdi_sw_displaytarget_create(struct sw_winsys *winsys, bpp = util_format_get_blocksizebits(format); cpp = util_format_get_blocksize(format); - + gdt->stride = align(width * cpp, alignment); gdt->size = gdt->stride * height; - + gdt->data = align_malloc(gdt->size, alignment); if(!gdt->data) goto no_data; @@ -205,7 +205,7 @@ gdi_sw_display( struct sw_winsys *winsys, } static void -gdi_sw_displaytarget_display(struct sw_winsys *winsys, +gdi_sw_displaytarget_display(struct sw_winsys *winsys, struct sw_displaytarget *dt, void *context_private) { diff --git a/src/gallium/winsys/sw/null/Makefile b/src/gallium/winsys/sw/null/Makefile index b1882b5..620434e 100644 --- a/src/gallium/winsys/sw/null/Makefile +++ b/src/gallium/winsys/sw/null/Makefile @@ -9,7 +9,7 @@ LIBRARY_INCLUDES = \ -I$(TOP)/src/gallium/auxiliary C_SOURCES = \ - null_sw_winsys.c + null_sw_winsys.c include ../../../Makefile.template diff --git a/src/gallium/winsys/sw/null/null_sw_winsys.c b/src/gallium/winsys/sw/null/null_sw_winsys.c index 73b777f..4e8457d 100644 --- a/src/gallium/winsys/sw/null/null_sw_winsys.c +++ b/src/gallium/winsys/sw/null/null_sw_winsys.c @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2010 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,25 +10,25 @@ * 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 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. IN NO EVENT SHALL * THE COPYRIGHT HOLDERS, AUTHORS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, - * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR - * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE + * 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. * * The above copyright notice and this permission notice (including the * next paragraph) shall be included in all copies or substantial portions * of the Software. - * + * **************************************************************************/ /** * @file * Null software rasterizer winsys. - * + * * There is no present support. Framebuffer data needs to be obtained via * transfers. * diff --git a/src/gallium/winsys/sw/xlib/Makefile b/src/gallium/winsys/sw/xlib/Makefile index c669389..02e39af 100644 --- a/src/gallium/winsys/sw/xlib/Makefile +++ b/src/gallium/winsys/sw/xlib/Makefile @@ -10,7 +10,7 @@ LIBRARY_INCLUDES = \ $(X11_CFLAGS) C_SOURCES = \ - xlib_sw_winsys.c + xlib_sw_winsys.c include ../../../Makefile.template diff --git a/src/gallium/winsys/sw/xlib/xlib_sw_winsys.c b/src/gallium/winsys/sw/xlib/xlib_sw_winsys.c index 3aef8da..e8b3e9f 100644 --- a/src/gallium/winsys/sw/xlib/xlib_sw_winsys.c +++ b/src/gallium/winsys/sw/xlib/xlib_sw_winsys.c @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2007 Tungsten Graphics, Inc., Bismarck, ND., USA * 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,20 +10,20 @@ * 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 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. IN NO EVENT SHALL * THE COPYRIGHT HOLDERS, AUTHORS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, - * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR - * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE + * 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. * * The above copyright notice and this permission notice (including the * next paragraph) shall be included in all copies or substantial portions * of the Software. - * - * + * + * **************************************************************************/ /* @@ -252,7 +252,7 @@ xlib_displaytarget_destroy(struct sw_winsys *ws, if (xlib_dt->shminfo.shmid >= 0) { shmdt(xlib_dt->shminfo.shmaddr); shmctl(xlib_dt->shminfo.shmid, IPC_RMID, 0); - + xlib_dt->shminfo.shmid = -1; xlib_dt->shminfo.shmaddr = (char *) -1; diff --git a/src/glsl/README b/src/glsl/README index dd80a53..4b03b28 100644 --- a/src/glsl/README +++ b/src/glsl/README @@ -134,9 +134,9 @@ or vector level? If we do it at the vector level, we're going to end up with many different versions of the variable when encountering code like: -(assign (constant bool (1)) (swiz x (var_ref __retval) ) (var_ref a) ) -(assign (constant bool (1)) (swiz y (var_ref __retval) ) (var_ref b) ) -(assign (constant bool (1)) (swiz z (var_ref __retval) ) (var_ref c) ) +(assign (constant bool (1)) (swiz x (var_ref __retval) ) (var_ref a) ) +(assign (constant bool (1)) (swiz y (var_ref __retval) ) (var_ref b) ) +(assign (constant bool (1)) (swiz z (var_ref __retval) ) (var_ref c) ) If every masked update of a component relies on the previous value of the variable, then we're probably going to be quite limited in our diff --git a/src/glsl/ast.h b/src/glsl/ast.h index da11f5a..e547247 100644 --- a/src/glsl/ast.h +++ b/src/glsl/ast.h @@ -309,7 +309,7 @@ class ast_declaration : public ast_node { virtual void print(void) const; char *identifier; - + int is_array; ast_expression *array_size; @@ -439,7 +439,7 @@ class ast_type_specifier : public ast_node { ast_type_specifier(int specifier); /** Construct a type specifier from a type name */ - ast_type_specifier(const char *name) + ast_type_specifier(const char *name) : type_specifier(ast_type_name), type_name(name), structure(NULL), is_array(false), array_size(NULL), precision(ast_precision_none), is_precision_statement(false) @@ -661,7 +661,7 @@ class ast_iteration_statement : public ast_node { ast_while, ast_do_while } mode; - + ast_node *init_statement; ast_node *condition; diff --git a/src/glsl/ast_function.cpp b/src/glsl/ast_function.cpp index 9ff0c0d..a35694b 100644 --- a/src/glsl/ast_function.cpp +++ b/src/glsl/ast_function.cpp @@ -1258,7 +1258,7 @@ ast_function_expression::hir(exec_list *instructions, process_parameters(instructions, &actual_parameters, &this->expressions, state); - return match_function_by_name(instructions, + return match_function_by_name(instructions, id->primary_expression.identifier, & loc, &actual_parameters, state); } diff --git a/src/glsl/ast_to_hir.cpp b/src/glsl/ast_to_hir.cpp index ec25bcb..4ffe878 100644 --- a/src/glsl/ast_to_hir.cpp +++ b/src/glsl/ast_to_hir.cpp @@ -1630,7 +1630,7 @@ ast_expression::hir(exec_list *instructions, * tree. This particular use must be at location specified in the grammar * as 'variable_identifier'. */ - ir_variable *var = + ir_variable *var = state->symbols->get_variable(this->primary_expression.identifier); result = new(ctx) ir_dereference_variable(var); diff --git a/src/glsl/glcpp/glcpp-lex.c b/src/glsl/glcpp/glcpp-lex.c index 3e1b918..3ec49ac 100644 --- a/src/glsl/glcpp/glcpp-lex.c +++ b/src/glsl/glcpp/glcpp-lex.c @@ -34,7 +34,7 @@ #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L /* C99 says to define __STDC_LIMIT_MACROS before including stdint.h, - * if you want the limit (max/min) macros for int types. + * if you want the limit (max/min) macros for int types. */ #ifndef __STDC_LIMIT_MACROS #define __STDC_LIMIT_MACROS 1 @@ -51,7 +51,7 @@ typedef uint32_t flex_uint32_t; typedef signed char flex_int8_t; typedef short int flex_int16_t; typedef int flex_int32_t; -typedef unsigned char flex_uint8_t; +typedef unsigned char flex_uint8_t; typedef unsigned short int flex_uint16_t; typedef unsigned int flex_uint32_t; #endif /* ! C99 */ @@ -175,7 +175,7 @@ typedef struct yy_buffer_state *YY_BUFFER_STATE; #define EOB_ACT_LAST_MATCH 2 #define YY_LESS_LINENO(n) - + /* Return all but the first "n" matched characters back to the input stream. */ #define yyless(n) \ do \ @@ -237,7 +237,7 @@ struct yy_buffer_state int yy_bs_lineno; /**< The line count. */ int yy_bs_column; /**< The column count. */ - + /* Whether to try to fill the input buffer when we reach the * end of it. */ @@ -704,9 +704,9 @@ static int yy_init_globals (yyscan_t yyscanner ); /* This must go here because YYSTYPE and YYLTYPE are included * from bison output in section 1.*/ # define yylval yyg->yylval_r - + # define yylloc yyg->yylloc_r - + int glcpp_lex_init (yyscan_t* scanner); int glcpp_lex_init_extra (YY_EXTRA_TYPE user_defined,yyscan_t* scanner); @@ -749,9 +749,9 @@ YYSTYPE * glcpp_get_lval (yyscan_t yyscanner ); void glcpp_set_lval (YYSTYPE * yylval_param ,yyscan_t yyscanner ); YYLTYPE *glcpp_get_lloc (yyscan_t yyscanner ); - + void glcpp_set_lloc (YYLTYPE * yylloc_param ,yyscan_t yyscanner ); - + /* Macros after this point can all be overridden by user definitions in * section 1. */ @@ -765,7 +765,7 @@ extern int glcpp_wrap (yyscan_t yyscanner ); #endif static void yyunput (int c,char *buf_ptr ,yyscan_t yyscanner); - + #ifndef yytext_ptr static void yy_flex_strncpy (char *,yyconst char *,int ,yyscan_t yyscanner); #endif @@ -785,11 +785,11 @@ static int input (yyscan_t yyscanner ); #endif static void yy_push_state (int new_state ,yyscan_t yyscanner); - + static void yy_pop_state (yyscan_t yyscanner ); - + static int yy_top_state (yyscan_t yyscanner ); - + /* Amount of stuff to slurp up with each read. */ #ifndef YY_READ_BUF_SIZE #define YY_READ_BUF_SIZE 8192 @@ -1896,7 +1896,7 @@ static void glcpp__load_buffer_state (yyscan_t yyscanner) YY_BUFFER_STATE glcpp__create_buffer (FILE * file, int size , yyscan_t yyscanner) { YY_BUFFER_STATE b; - + b = (YY_BUFFER_STATE) glcpp_alloc(sizeof( struct yy_buffer_state ) ,yyscanner ); if ( ! b ) YY_FATAL_ERROR( "out of dynamic memory in glcpp__create_buffer()" ); @@ -1962,7 +1962,7 @@ static void glcpp__load_buffer_state (yyscan_t yyscanner) } b->yy_is_interactive = 0; - + errno = oerrno; } @@ -2068,9 +2068,9 @@ static void glcpp_ensure_buffer_stack (yyscan_t yyscanner) , yyscanner); if ( ! yyg->yy_buffer_stack ) YY_FATAL_ERROR( "out of dynamic memory in glcpp_ensure_buffer_stack()" ); - + memset(yyg->yy_buffer_stack, 0, num_to_alloc * sizeof(struct yy_buffer_state*)); - + yyg->yy_buffer_stack_max = num_to_alloc; yyg->yy_buffer_stack_top = 0; return; @@ -2099,12 +2099,12 @@ static void glcpp_ensure_buffer_stack (yyscan_t yyscanner) * @param base the character buffer * @param size the size in bytes of the character buffer * @param yyscanner The scanner object. - * @return the newly allocated buffer state object. + * @return the newly allocated buffer state object. */ YY_BUFFER_STATE glcpp__scan_buffer (char * base, yy_size_t size , yyscan_t yyscanner) { YY_BUFFER_STATE b; - + if ( size < 2 || base[size-2] != YY_END_OF_BUFFER_CHAR || base[size-1] != YY_END_OF_BUFFER_CHAR ) @@ -2140,7 +2140,7 @@ YY_BUFFER_STATE glcpp__scan_buffer (char * base, yy_size_t size , yyscan_t yys */ YY_BUFFER_STATE glcpp__scan_string (yyconst char * yystr , yyscan_t yyscanner) { - + return glcpp__scan_bytes(yystr,strlen(yystr) ,yyscanner); } @@ -2157,7 +2157,7 @@ YY_BUFFER_STATE glcpp__scan_bytes (yyconst char * yybytes, int _yybytes_len , char *buf; yy_size_t n; int i; - + /* Get memory for full buffer, including space for trailing EOB's. */ n = _yybytes_len + 2; buf = (char *) glcpp_alloc(n ,yyscanner ); @@ -2265,10 +2265,10 @@ YY_EXTRA_TYPE glcpp_get_extra (yyscan_t yyscanner) int glcpp_get_lineno (yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - + if (! YY_CURRENT_BUFFER) return 0; - + return yylineno; } @@ -2278,10 +2278,10 @@ int glcpp_get_lineno (yyscan_t yyscanner) int glcpp_get_column (yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - + if (! YY_CURRENT_BUFFER) return 0; - + return yycolumn; } @@ -2342,8 +2342,8 @@ void glcpp_set_lineno (int line_number , yyscan_t yyscanner) /* lineno is only valid if an input buffer exists. */ if (! YY_CURRENT_BUFFER ) - yy_fatal_error( "glcpp_set_lineno called with no buffer" , yyscanner); - + yy_fatal_error( "glcpp_set_lineno called with no buffer" , yyscanner); + yylineno = line_number; } @@ -2357,8 +2357,8 @@ void glcpp_set_column (int column_no , yyscan_t yyscanner) /* column is only valid if an input buffer exists. */ if (! YY_CURRENT_BUFFER ) - yy_fatal_error( "glcpp_set_column called with no buffer" , yyscanner); - + yy_fatal_error( "glcpp_set_column called with no buffer" , yyscanner); + yycolumn = column_no; } @@ -2411,13 +2411,13 @@ YYLTYPE *glcpp_get_lloc (yyscan_t yyscanner) struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; return yylloc; } - + void glcpp_set_lloc (YYLTYPE * yylloc_param , yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; yylloc = yylloc_param; } - + /* User-visible API */ /* glcpp_lex_init is special because it creates the scanner itself, so it is @@ -2465,20 +2465,20 @@ int glcpp_lex_init_extra(YY_EXTRA_TYPE yy_user_defined,yyscan_t* ptr_yy_globals errno = EINVAL; return 1; } - + *ptr_yy_globals = (yyscan_t) glcpp_alloc ( sizeof( struct yyguts_t ), &dummy_yyguts ); - + if (*ptr_yy_globals == NULL){ errno = ENOMEM; return 1; } - + /* By setting to 0xAA, we expose bugs in yy_init_globals. Leave at 0x00 for releases. */ memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t)); - + glcpp_set_extra (yy_user_defined, *ptr_yy_globals); - + return yy_init_globals ( *ptr_yy_globals ); } diff --git a/src/glsl/glcpp/glcpp-parse.c b/src/glsl/glcpp/glcpp-parse.c index 46e690d..34263f6 100644 --- a/src/glsl/glcpp/glcpp-parse.c +++ b/src/glsl/glcpp/glcpp-parse.c @@ -1,20 +1,20 @@ /* A Bison parser, made by GNU Bison 2.4.3. */ /* Skeleton implementation for Bison's Yacc-like parsers in C - + Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009, 2010 Free Software Foundation, Inc. - + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - + You should have received a copy of the GNU General Public License along with this program. If not, see . */ @@ -27,7 +27,7 @@ special exception, which will cause the skeleton and the resulting Bison output files to be licensed under the GNU General Public License without this special exception. - + This special exception was added by the Free Software Foundation in version 2.2 of Bison. */ @@ -1894,7 +1894,7 @@ YYLTYPE yylloc; parser->skip_stack->type == SKIP_NO_SKIP) { _glcpp_parser_expand_if (parser, IF_EXPANDED, (yyvsp[(2) - (3)].token_list)); - } + } else { _glcpp_parser_skip_stack_push_if (parser, & (yylsp[(1) - (3)]), 0); @@ -1914,7 +1914,7 @@ YYLTYPE yylloc; parser->skip_stack->type == SKIP_NO_SKIP) { glcpp_error(& (yylsp[(1) - (2)]), parser, "#if with no expression"); - } + } _glcpp_parser_skip_stack_push_if (parser, & (yylsp[(1) - (2)]), 0); ;} break; @@ -2289,7 +2289,7 @@ YYLTYPE yylloc; /* Line 1464 of yacc.c */ #line 432 "glcpp/glcpp-parse.y" { - (yyval.string_list) = (yyvsp[(1) - (3)].string_list); + (yyval.string_list) = (yyvsp[(1) - (3)].string_list); _string_list_append_item ((yyval.string_list), (yyvsp[(3) - (3)].str)); ralloc_steal ((yyval.string_list), (yyvsp[(3) - (3)].str)); ;} @@ -3206,7 +3206,7 @@ _token_list_equal_ignoring_space (token_list_t *a, token_list_t *b) switch (node_a->token->type) { case INTEGER: - if (node_a->token->value.ival != + if (node_a->token->value.ival != node_b->token->value.ival) { return 0; @@ -3494,7 +3494,7 @@ typedef enum function_status * * FUNCTION_STATUS_SUCCESS: * - * Successfully parsed a set of function arguments. + * Successfully parsed a set of function arguments. * * FUNCTION_NOT_A_FUNCTION: * @@ -3613,7 +3613,7 @@ static token_list_t * _glcpp_parser_expand_function (glcpp_parser_t *parser, token_node_t *node, token_node_t **last) - + { macro_t *macro; const char *identifier; @@ -3647,7 +3647,7 @@ _glcpp_parser_expand_function (glcpp_parser_t *parser, return _token_list_create_with_one_space (parser); } - if (! ((_argument_list_length (arguments) == + if (! ((_argument_list_length (arguments) == _string_list_length (macro->parameters)) || (_string_list_length (macro->parameters) == 0 && _argument_list_length (arguments) == 1 && @@ -3914,7 +3914,7 @@ _glcpp_parser_expand_token_list (glcpp_parser_t *parser, parser->active = _active_list_push (parser->active, node->token->value.str, last->next); - + /* Splice expansion into list, supporting a * simple deletion if the expansion is * empty. */ diff --git a/src/glsl/glcpp/glcpp-parse.h b/src/glsl/glcpp/glcpp-parse.h index 4055685..0959dc8 100644 --- a/src/glsl/glcpp/glcpp-parse.h +++ b/src/glsl/glcpp/glcpp-parse.h @@ -1,20 +1,20 @@ /* A Bison parser, made by GNU Bison 2.4.3. */ /* Skeleton interface for Bison's Yacc-like parsers in C - + Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009, 2010 Free Software Foundation, Inc. - + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - + You should have received a copy of the GNU General Public License along with this program. If not, see . */ @@ -27,7 +27,7 @@ special exception, which will cause the skeleton and the resulting Bison output files to be licensed under the GNU General Public License without this special exception. - + This special exception was added by the Free Software Foundation in version 2.2 of Bison. */ diff --git a/src/glsl/glcpp/glcpp-parse.y b/src/glsl/glcpp/glcpp-parse.y index 7c51299..577add0 100644 --- a/src/glsl/glcpp/glcpp-parse.y +++ b/src/glsl/glcpp/glcpp-parse.y @@ -235,7 +235,7 @@ control_line: parser->skip_stack->type == SKIP_NO_SKIP) { _glcpp_parser_expand_if (parser, IF_EXPANDED, $2); - } + } else { _glcpp_parser_skip_stack_push_if (parser, & @1, 0); @@ -249,7 +249,7 @@ control_line: parser->skip_stack->type == SKIP_NO_SKIP) { glcpp_error(& @1, parser, "#if with no expression"); - } + } _glcpp_parser_skip_stack_push_if (parser, & @1, 0); } | HASH_IFDEF IDENTIFIER junk NEWLINE { @@ -430,7 +430,7 @@ identifier_list: ralloc_steal ($$, $1); } | identifier_list ',' IDENTIFIER { - $$ = $1; + $$ = $1; _string_list_append_item ($$, $3); ralloc_steal ($$, $3); } @@ -881,7 +881,7 @@ _token_list_equal_ignoring_space (token_list_t *a, token_list_t *b) switch (node_a->token->type) { case INTEGER: - if (node_a->token->value.ival != + if (node_a->token->value.ival != node_b->token->value.ival) { return 0; @@ -1169,7 +1169,7 @@ typedef enum function_status * * FUNCTION_STATUS_SUCCESS: * - * Successfully parsed a set of function arguments. + * Successfully parsed a set of function arguments. * * FUNCTION_NOT_A_FUNCTION: * @@ -1288,7 +1288,7 @@ static token_list_t * _glcpp_parser_expand_function (glcpp_parser_t *parser, token_node_t *node, token_node_t **last) - + { macro_t *macro; const char *identifier; @@ -1322,7 +1322,7 @@ _glcpp_parser_expand_function (glcpp_parser_t *parser, return _token_list_create_with_one_space (parser); } - if (! ((_argument_list_length (arguments) == + if (! ((_argument_list_length (arguments) == _string_list_length (macro->parameters)) || (_string_list_length (macro->parameters) == 0 && _argument_list_length (arguments) == 1 && @@ -1589,7 +1589,7 @@ _glcpp_parser_expand_token_list (glcpp_parser_t *parser, parser->active = _active_list_push (parser->active, node->token->value.str, last->next); - + /* Splice expansion into list, supporting a * simple deletion if the expansion is * empty. */ diff --git a/src/glsl/glsl_lexer.cpp b/src/glsl/glsl_lexer.cpp index 08a2f70..b86e058 100644 --- a/src/glsl/glsl_lexer.cpp +++ b/src/glsl/glsl_lexer.cpp @@ -34,7 +34,7 @@ #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L /* C99 says to define __STDC_LIMIT_MACROS before including stdint.h, - * if you want the limit (max/min) macros for int types. + * if you want the limit (max/min) macros for int types. */ #ifndef __STDC_LIMIT_MACROS #define __STDC_LIMIT_MACROS 1 @@ -51,7 +51,7 @@ typedef uint32_t flex_uint32_t; typedef signed char flex_int8_t; typedef short int flex_int16_t; typedef int flex_int32_t; -typedef unsigned char flex_uint8_t; +typedef unsigned char flex_uint8_t; typedef unsigned short int flex_uint16_t; typedef unsigned int flex_uint32_t; #endif /* ! C99 */ @@ -175,7 +175,7 @@ typedef struct yy_buffer_state *YY_BUFFER_STATE; #define EOB_ACT_LAST_MATCH 2 #define YY_LESS_LINENO(n) - + /* Return all but the first "n" matched characters back to the input stream. */ #define yyless(n) \ do \ @@ -237,7 +237,7 @@ struct yy_buffer_state int yy_bs_lineno; /**< The line count. */ int yy_bs_column; /**< The column count. */ - + /* Whether to try to fill the input buffer when we reach the * end of it. */ @@ -1120,9 +1120,9 @@ static int yy_init_globals (yyscan_t yyscanner ); /* This must go here because YYSTYPE and YYLTYPE are included * from bison output in section 1.*/ # define yylval yyg->yylval_r - + # define yylloc yyg->yylloc_r - + int _mesa_glsl_lex_init (yyscan_t* scanner); int _mesa_glsl_lex_init_extra (YY_EXTRA_TYPE user_defined,yyscan_t* scanner); @@ -1165,9 +1165,9 @@ YYSTYPE * _mesa_glsl_get_lval (yyscan_t yyscanner ); void _mesa_glsl_set_lval (YYSTYPE * yylval_param ,yyscan_t yyscanner ); YYLTYPE *_mesa_glsl_get_lloc (yyscan_t yyscanner ); - + void _mesa_glsl_set_lloc (YYLTYPE * yylloc_param ,yyscan_t yyscanner ); - + /* Macros after this point can all be overridden by user definitions in * section 1. */ @@ -1399,7 +1399,7 @@ YY_RULE_SETUP #line 99 "glsl_lexer.lpp" ; YY_BREAK -/* Preprocessor tokens. */ +/* Preprocessor tokens. */ case 2: *yy_cp = yyg->yy_hold_char; /* undo effects of setting up yytext */ yyg->yy_c_buf_p = yy_cp -= 1; @@ -2537,7 +2537,7 @@ YY_RULE_SETUP #line 419 "glsl_lexer.lpp" { struct _mesa_glsl_parse_state *state = yyextra; - void *ctx = state; + void *ctx = state; yylval->identifier = ralloc_strdup(ctx, yytext); return classify_identifier(state, yytext); } @@ -3038,7 +3038,7 @@ static void _mesa_glsl__load_buffer_state (yyscan_t yyscanner) YY_BUFFER_STATE _mesa_glsl__create_buffer (FILE * file, int size , yyscan_t yyscanner) { YY_BUFFER_STATE b; - + b = (YY_BUFFER_STATE) _mesa_glsl_alloc(sizeof( struct yy_buffer_state ) ,yyscanner ); if ( ! b ) YY_FATAL_ERROR( "out of dynamic memory in _mesa_glsl__create_buffer()" ); @@ -3104,7 +3104,7 @@ static void _mesa_glsl__load_buffer_state (yyscan_t yyscanner) } b->yy_is_interactive = 0; - + errno = oerrno; } @@ -3210,9 +3210,9 @@ static void _mesa_glsl_ensure_buffer_stack (yyscan_t yyscanner) , yyscanner); if ( ! yyg->yy_buffer_stack ) YY_FATAL_ERROR( "out of dynamic memory in _mesa_glsl_ensure_buffer_stack()" ); - + memset(yyg->yy_buffer_stack, 0, num_to_alloc * sizeof(struct yy_buffer_state*)); - + yyg->yy_buffer_stack_max = num_to_alloc; yyg->yy_buffer_stack_top = 0; return; @@ -3241,12 +3241,12 @@ static void _mesa_glsl_ensure_buffer_stack (yyscan_t yyscanner) * @param base the character buffer * @param size the size in bytes of the character buffer * @param yyscanner The scanner object. - * @return the newly allocated buffer state object. + * @return the newly allocated buffer state object. */ YY_BUFFER_STATE _mesa_glsl__scan_buffer (char * base, yy_size_t size , yyscan_t yyscanner) { YY_BUFFER_STATE b; - + if ( size < 2 || base[size-2] != YY_END_OF_BUFFER_CHAR || base[size-1] != YY_END_OF_BUFFER_CHAR ) @@ -3282,7 +3282,7 @@ YY_BUFFER_STATE _mesa_glsl__scan_buffer (char * base, yy_size_t size , yyscan_ */ YY_BUFFER_STATE _mesa_glsl__scan_string (yyconst char * yystr , yyscan_t yyscanner) { - + return _mesa_glsl__scan_bytes(yystr,strlen(yystr) ,yyscanner); } @@ -3299,7 +3299,7 @@ YY_BUFFER_STATE _mesa_glsl__scan_bytes (yyconst char * yybytes, int _yybytes_l char *buf; yy_size_t n; int i; - + /* Get memory for full buffer, including space for trailing EOB's. */ n = _yybytes_len + 2; buf = (char *) _mesa_glsl_alloc(n ,yyscanner ); @@ -3367,10 +3367,10 @@ YY_EXTRA_TYPE _mesa_glsl_get_extra (yyscan_t yyscanner) int _mesa_glsl_get_lineno (yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - + if (! YY_CURRENT_BUFFER) return 0; - + return yylineno; } @@ -3380,10 +3380,10 @@ int _mesa_glsl_get_lineno (yyscan_t yyscanner) int _mesa_glsl_get_column (yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - + if (! YY_CURRENT_BUFFER) return 0; - + return yycolumn; } @@ -3444,8 +3444,8 @@ void _mesa_glsl_set_lineno (int line_number , yyscan_t yyscanner) /* lineno is only valid if an input buffer exists. */ if (! YY_CURRENT_BUFFER ) - yy_fatal_error( "_mesa_glsl_set_lineno called with no buffer" , yyscanner); - + yy_fatal_error( "_mesa_glsl_set_lineno called with no buffer" , yyscanner); + yylineno = line_number; } @@ -3459,8 +3459,8 @@ void _mesa_glsl_set_column (int column_no , yyscan_t yyscanner) /* column is only valid if an input buffer exists. */ if (! YY_CURRENT_BUFFER ) - yy_fatal_error( "_mesa_glsl_set_column called with no buffer" , yyscanner); - + yy_fatal_error( "_mesa_glsl_set_column called with no buffer" , yyscanner); + yycolumn = column_no; } @@ -3513,13 +3513,13 @@ YYLTYPE *_mesa_glsl_get_lloc (yyscan_t yyscanner) struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; return yylloc; } - + void _mesa_glsl_set_lloc (YYLTYPE * yylloc_param , yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; yylloc = yylloc_param; } - + /* User-visible API */ /* _mesa_glsl_lex_init is special because it creates the scanner itself, so it is @@ -3567,20 +3567,20 @@ int _mesa_glsl_lex_init_extra(YY_EXTRA_TYPE yy_user_defined,yyscan_t* ptr_yy_glo errno = EINVAL; return 1; } - + *ptr_yy_globals = (yyscan_t) _mesa_glsl_alloc ( sizeof( struct yyguts_t ), &dummy_yyguts ); - + if (*ptr_yy_globals == NULL){ errno = ENOMEM; return 1; } - + /* By setting to 0xAA, we expose bugs in yy_init_globals. Leave at 0x00 for releases. */ memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t)); - + _mesa_glsl_set_extra (yy_user_defined, *ptr_yy_globals); - + return yy_init_globals ( *ptr_yy_globals ); } diff --git a/src/glsl/glsl_lexer.lpp b/src/glsl/glsl_lexer.lpp index 4dc39d2..dff6955 100644 --- a/src/glsl/glsl_lexer.lpp +++ b/src/glsl/glsl_lexer.lpp @@ -98,7 +98,7 @@ HASH ^{SPC}#{SPC} [ \r\t]+ ; - /* Preprocessor tokens. */ + /* Preprocessor tokens. */ ^[ \t]*#[ \t]*$ ; ^[ \t]*#[ \t]*version { BEGIN PP; return VERSION; } ^[ \t]*#[ \t]*extension { BEGIN PP; return EXTENSION; } @@ -418,7 +418,7 @@ row_major KEYWORD(130, 999, ROW_MAJOR); [_a-zA-Z][_a-zA-Z0-9]* { struct _mesa_glsl_parse_state *state = yyextra; - void *ctx = state; + void *ctx = state; yylval->identifier = ralloc_strdup(ctx, yytext); return classify_identifier(state, yytext); } diff --git a/src/glsl/glsl_parser.cpp b/src/glsl/glsl_parser.cpp index 70a0fdb..8579393 100644 --- a/src/glsl/glsl_parser.cpp +++ b/src/glsl/glsl_parser.cpp @@ -1,20 +1,20 @@ /* A Bison parser, made by GNU Bison 2.4.3. */ /* Skeleton implementation for Bison's Yacc-like parsers in C - + Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009, 2010 Free Software Foundation, Inc. - + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - + You should have received a copy of the GNU General Public License along with this program. If not, see . */ @@ -27,7 +27,7 @@ special exception, which will cause the skeleton and the resulting Bison output files to be licensed under the GNU General Public License without this special exception. - + This special exception was added by the Free Software Foundation in version 2.2 of Bison. */ @@ -103,7 +103,7 @@ #include #include #include - + #include "ast.h" #include "glsl_parser_extras.h" #include "glsl_types.h" diff --git a/src/glsl/glsl_parser.h b/src/glsl/glsl_parser.h index 7f36492..2c361e5 100644 --- a/src/glsl/glsl_parser.h +++ b/src/glsl/glsl_parser.h @@ -1,20 +1,20 @@ /* A Bison parser, made by GNU Bison 2.4.3. */ /* Skeleton interface for Bison's Yacc-like parsers in C - + Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009, 2010 Free Software Foundation, Inc. - + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - + You should have received a copy of the GNU General Public License along with this program. If not, see . */ @@ -27,7 +27,7 @@ special exception, which will cause the skeleton and the resulting Bison output files to be licensed under the GNU General Public License without this special exception. - + This special exception was added by the Free Software Foundation in version 2.2 of Bison. */ diff --git a/src/glsl/glsl_parser.ypp b/src/glsl/glsl_parser.ypp index eaace32..236b924 100644 --- a/src/glsl/glsl_parser.ypp +++ b/src/glsl/glsl_parser.ypp @@ -25,7 +25,7 @@ #include #include #include - + #include "ast.h" #include "glsl_parser_extras.h" #include "glsl_types.h" @@ -213,7 +213,7 @@ %type for_rest_statement %% -translation_unit: +translation_unit: version_statement extension_statement_list { _mesa_glsl_initialize_types(state); @@ -446,7 +446,7 @@ function_call_header_with_parameters: } ; - // Grammar Note: Constructors look like functions, but lexical + // Grammar Note: Constructors look like functions, but lexical // analysis recognized most of them as keywords. They are now // recognized through "type_specifier". function_call_header: @@ -501,7 +501,7 @@ method_call_header_with_parameters: } ; - // Grammar Note: Constructors look like methods, but lexical + // Grammar Note: Constructors look like methods, but lexical // analysis recognized most of them as keywords. They are now // recognized through "type_specifier". method_call_header: @@ -1680,7 +1680,7 @@ for_rest_statement: // Grammar Note: No 'goto'. Gotos are not supported. jump_statement: - CONTINUE ';' + CONTINUE ';' { void *ctx = state; $$ = new(ctx) ast_jump_statement(ast_jump_statement::ast_continue, NULL); diff --git a/src/glsl/glsl_parser_extras.cpp b/src/glsl/glsl_parser_extras.cpp index 3a17db8..eb10c46 100644 --- a/src/glsl/glsl_parser_extras.cpp +++ b/src/glsl/glsl_parser_extras.cpp @@ -331,7 +331,7 @@ void ast_compound_statement::print(void) const { printf("{\n"); - + foreach_list_const(n, &this->statements) { ast_node *ast = exec_node_data(ast_node, n, link); ast->print(); @@ -640,7 +640,7 @@ ast_selection_statement::print(void) const printf("else "); else_statement->print(); } - + } diff --git a/src/glsl/glsl_parser_extras.h b/src/glsl/glsl_parser_extras.h index 819333d..5b73e9a 100644 --- a/src/glsl/glsl_parser_extras.h +++ b/src/glsl/glsl_parser_extras.h @@ -225,7 +225,7 @@ extern void _mesa_glsl_lexer_ctor(struct _mesa_glsl_parse_state *state, extern void _mesa_glsl_lexer_dtor(struct _mesa_glsl_parse_state *state); union YYSTYPE; -extern int _mesa_glsl_lex(union YYSTYPE *yylval, YYLTYPE *yylloc, +extern int _mesa_glsl_lex(union YYSTYPE *yylval, YYLTYPE *yylloc, void *scanner); extern int _mesa_glsl_parse(struct _mesa_glsl_parse_state *); diff --git a/src/glsl/glsl_symbol_table.h b/src/glsl/glsl_symbol_table.h index 637bc03..a98d6f8 100644 --- a/src/glsl/glsl_symbol_table.h +++ b/src/glsl/glsl_symbol_table.h @@ -73,7 +73,7 @@ struct glsl_symbol_table { ralloc_set_destructor(table, NULL); ralloc_free(table); } - + glsl_symbol_table(); ~glsl_symbol_table(); diff --git a/src/glsl/ir_reader.cpp b/src/glsl/ir_reader.cpp index 0e18881..3da0590 100644 --- a/src/glsl/ir_reader.cpp +++ b/src/glsl/ir_reader.cpp @@ -76,7 +76,7 @@ _mesa_glsl_read_ir(_mesa_glsl_parse_state *state, exec_list *instructions, ir_read_error(state, NULL, "couldn't parse S-Expression."); return; } - + if (scan_for_protos) { scan_for_prototypes(state, instructions, expr); if (state->error) @@ -155,7 +155,7 @@ read_type(_mesa_glsl_parse_state *st, s_expression *expr) return NULL; } } - + s_symbol *type_sym = SX_AS_SYMBOL(expr); if (type_sym == NULL) { ir_read_error(st, expr, "expected (symbol or list)"); @@ -734,8 +734,8 @@ read_expression(_mesa_glsl_parse_state *st, s_list *list) ir_read_error(st, list, "invalid operator: %s", op_sym->value()); return NULL; } - - /* Now that we know the operator, check for the right number of operands */ + + /* Now that we know the operator, check for the right number of operands */ if (ir_expression::get_num_operands(op) == 2) { if (list_length != 5) { ir_read_error(st, list, "expected (expression %s " diff --git a/src/glsl/list.h b/src/glsl/list.h index 1d46365..eed14ee 100644 --- a/src/glsl/list.h +++ b/src/glsl/list.h @@ -470,7 +470,7 @@ inline void exec_node::insert_before(exec_list *before) /** * This version is safe even if the current node is removed. - */ + */ #define foreach_list_safe(__node, __list) \ for (exec_node * __node = (__list)->head, * __next = __node->next \ ; __next != NULL \ diff --git a/src/glu/sgi/Makefile.mgw b/src/glu/sgi/Makefile.mgw index d00d97a..70c4f57 100644 --- a/src/glu/sgi/Makefile.mgw +++ b/src/glu/sgi/Makefile.mgw @@ -1,18 +1,18 @@ # Mesa 3-D graphics library # Version: 5.1 -# +# # Copyright (C) 1999-2003 Brian Paul All Rights Reserved. -# +# # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and associated documentation files (the "Software"), # to deal in the Software without restriction, including without limitation # the rights to use, copy, modify, merge, publish, distribute, sublicense, # and/or sell copies of the Software, and to permit persons to whom the # Software is furnished to do so, subject to the following conditions: -# +# # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. -# +# # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL @@ -30,10 +30,10 @@ # # Updated : by Heromyth, on 2007-7-21 # Email : zxpmyth@yahoo.com.cn -# Bugs : 1) All the default settings work fine. But the setting X86=1 can't work. +# Bugs : 1) All the default settings work fine. But the setting X86=1 can't work. # The others havn't been tested yet. # 2) The generated DLLs are *not* compatible with the ones built -# with the other compilers like VC8, especially for GLUT. +# with the other compilers like VC8, especially for GLUT. # 3) Although more tests are needed, it can be used individually! # diff --git a/src/glu/sgi/Makefile.win b/src/glu/sgi/Makefile.win index 9321732..7d9ed26 100644 --- a/src/glu/sgi/Makefile.win +++ b/src/glu/sgi/Makefile.win @@ -113,7 +113,7 @@ LFLAGS = $(dlllflags) $(lcommon) $(LFLAGS) LIBS = ../lib/$(MESALIB) winmm.lib $(guilibsdll) OBJS = $(GLU_SRCS_CC:.cc=.obj) $(GLU_SRCS:.c=.obj) -NURBSINC = -Ilibnurbs\interface -Ilibnurbs\internals -Ilibnurbs\nurbtess +NURBSINC = -Ilibnurbs\interface -Ilibnurbs\internals -Ilibnurbs\nurbtess CFLAGS = $(CFLAGS) $(NURBSINC) $(GLUDLL): $(OBJS) glu.def @@ -132,12 +132,12 @@ install : $(GLUDLL) $(GLULIB) -copy $(GLULIB) $(LIBINSTALL) clean :: - @del /f libtess\*.obj libutil\*.obj - @del /f libnurbs\interface\*.obj libnurbs\internals\*.obj + @del /f libtess\*.obj libutil\*.obj + @del /f libnurbs\interface\*.obj libnurbs\internals\*.obj @del /f libnurbs\nurbtess\*.obj # override default inference rule with one that writes the object to -# the same subdir as the c file. +# the same subdir as the c file. .c.obj : $(cc) $(CFLAGS) -I. $< /Fo$*.obj diff --git a/src/glu/sgi/glu.def b/src/glu/sgi/glu.def index 0c8b021..16f56e6 100644 --- a/src/glu/sgi/glu.def +++ b/src/glu/sgi/glu.def @@ -11,7 +11,7 @@ VERSION 5.1 ; ; The linker exports STDCALL entry points with ; 'decorated' names; e.g., _glBegin@0, where the -; trailing number is the number of bytes of +; trailing number is the number of bytes of ; parameter data pushed onto the stack. The ; callee is responsible for popping this data ; off the stack, usually via a RETF n instruction. diff --git a/src/glu/sgi/libnurbs/interface/bezierPatch.cc b/src/glu/sgi/libnurbs/interface/bezierPatch.cc index dbab3a1..1324720 100644 --- a/src/glu/sgi/libnurbs/interface/bezierPatch.cc +++ b/src/glu/sgi/libnurbs/interface/bezierPatch.cc @@ -6,21 +6,21 @@ ** this file except in compliance with the License. You may obtain a copy ** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600 ** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at: -** +** ** http://oss.sgi.com/projects/FreeB -** +** ** Note that, as provided in the License, the Software is distributed on an ** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS ** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND ** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A ** PARTICULAR PURPOSE, AND NON-INFRINGEMENT. -** +** ** Original Code. The Original Code is: OpenGL Sample Implementation, ** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, ** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. ** Copyright in any portions created by third parties is as indicated ** elsewhere herein. All Rights Reserved. -** +** ** Additional Notice Provisions: The application programming interfaces ** established by SGI in conjunction with the Original Code are The ** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released @@ -45,7 +45,7 @@ /* *allocate an instance of bezierPatch. The control points are unknown. But - *the space of this array is allocated with size of + *the space of this array is allocated with size of * uorder*vorder*dimension * */ @@ -89,7 +89,7 @@ bezierPatch* bezierPatchMake2(float umin, float vmin, float umax, float vmax, in for(int j=0; jctlpoints[i * the_ustride + j*the_vstride+k] = ctlpoints[i*ustride+j*vstride+k]; - + ret->next = NULL; return ret; @@ -112,7 +112,7 @@ void bezierPatchDeleteList(bezierPatch *b) while (b != NULL) { temp = b; b = b->next; - bezierPatchDelete(temp); + bezierPatchDelete(temp); } } @@ -130,7 +130,7 @@ void bezierPatchPrint(bezierPatch *b) printf("uorder=%i, vorder=%i\n", b->uorder, b->vorder); printf("idmension = %i\n", b->dimension); } - + /*print the whole list*/ void bezierPatchPrintList(bezierPatch *list) { @@ -150,15 +150,15 @@ void bezierPatchEval(bezierPatch *b, float u, float v, float ret[]) } else if(b->next != NULL) bezierPatchEval(b->next, u,v, ret); - else - bezierSurfEval(b->umin, b->umax, b->uorder, b->vmin, b->vmax, b->vorder, b->dimension, b->ctlpoints, b->dimension * b->vorder, b->dimension, u, v, ret); + else + bezierSurfEval(b->umin, b->umax, b->uorder, b->vmin, b->vmax, b->vorder, b->dimension, b->ctlpoints, b->dimension * b->vorder, b->dimension, u, v, ret); } /*the returned normal is normlized */ void bezierPatchEvalNormal(bezierPatch *b, float u, float v, float ret[]) { - bezierSurfEvalNormal(b->umin, b->umax, b->uorder, b->vmin, b->vmax, b->vorder, b->dimension, b->ctlpoints, b->dimension * b->vorder, b->dimension, u, v, ret); + bezierSurfEvalNormal(b->umin, b->umax, b->uorder, b->vmin, b->vmax, b->vorder, b->dimension, b->ctlpoints, b->dimension * b->vorder, b->dimension, u, v, ret); if( u >= b->umin && u<= b->umax && v >= b->vmin && v<= b->vmax) @@ -167,8 +167,8 @@ void bezierPatchEvalNormal(bezierPatch *b, float u, float v, float ret[]) } else if(b->next != NULL) bezierPatchEvalNormal(b->next, u,v, ret); - else - bezierSurfEvalNormal(b->umin, b->umax, b->uorder, b->vmin, b->vmax, b->vorder, b->dimension, b->ctlpoints, b->dimension * b->vorder, b->dimension, u, v, ret); + else + bezierSurfEvalNormal(b->umin, b->umax, b->uorder, b->vmin, b->vmax, b->vorder, b->dimension, b->ctlpoints, b->dimension * b->vorder, b->dimension, u, v, ret); } @@ -177,9 +177,9 @@ void bezierPatchDraw(bezierPatch *bpatch, int u_reso, int v_reso) if(bpatch->dimension == 3) glMap2f(GL_MAP2_VERTEX_3, bpatch->umin, bpatch->umax, 3*bpatch->vorder, bpatch->uorder, bpatch->vmin, bpatch->vmax,3, bpatch->vorder, (GLfloat*) bpatch->ctlpoints); else - glMap2f(GL_MAP2_VERTEX_4, bpatch->umin, bpatch->umax, 4*bpatch->vorder, bpatch->uorder, bpatch->vmin, bpatch->vmax,3, bpatch->vorder, (GLfloat*) bpatch->ctlpoints); + glMap2f(GL_MAP2_VERTEX_4, bpatch->umin, bpatch->umax, 4*bpatch->vorder, bpatch->uorder, bpatch->vmin, bpatch->vmax,3, bpatch->vorder, (GLfloat*) bpatch->ctlpoints); - glMapGrid2f(u_reso, bpatch->umin, bpatch->umax, + glMapGrid2f(u_reso, bpatch->umin, bpatch->umax, v_reso, bpatch->vmin, bpatch->vmax); glEvalMesh2(GL_LINE, 0, u_reso, 0, v_reso); } @@ -201,6 +201,6 @@ printf("mapmap\n"); for(temp = list; temp != NULL; temp = temp->next) bezierPatchDraw(temp, u_reso, v_reso); } - + diff --git a/src/glu/sgi/libnurbs/interface/bezierPatch.h b/src/glu/sgi/libnurbs/interface/bezierPatch.h index 981183a..348289a 100644 --- a/src/glu/sgi/libnurbs/interface/bezierPatch.h +++ b/src/glu/sgi/libnurbs/interface/bezierPatch.h @@ -36,7 +36,7 @@ typedef struct bezierPatch{ float umin, vmin, umax, vmax; int uorder; /*order= degree + 1*/ - int vorder; + int vorder; /* *the control points are stored in a one dimensional array. @@ -45,13 +45,13 @@ typedef struct bezierPatch{ *where P(i,j) are the control points, B_i(.) are Bezier *basis functions. *Each control point can have dimension 3 or 4: (x,y,z,w). - *The components of P(i,j) are stored in a one dimensional - *array: + *The components of P(i,j) are stored in a one dimensional + *array: * ctlpoints[] *in the order of: * P[0,0], P[0,1], ..., P[0,vorder-1], * P[1,0], P[1,1], ..., P[1,vorder-1], - * ... + * ... * P[uorder-1,0], P[uorder-1,1], ..., P[uorder-1,vorder-1]. */ int dimension; @@ -60,7 +60,7 @@ typedef struct bezierPatch{ /* *in case we have to manage multiple bezierPatches. */ - struct bezierPatch *next; + struct bezierPatch *next; } bezierPatch; diff --git a/src/glu/sgi/libnurbs/interface/bezierPatchMesh.cc b/src/glu/sgi/libnurbs/interface/bezierPatchMesh.cc index ac7ff84..19f6ca8 100644 --- a/src/glu/sgi/libnurbs/interface/bezierPatchMesh.cc +++ b/src/glu/sgi/libnurbs/interface/bezierPatchMesh.cc @@ -6,21 +6,21 @@ ** this file except in compliance with the License. You may obtain a copy ** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600 ** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at: -** +** ** http://oss.sgi.com/projects/FreeB -** +** ** Note that, as provided in the License, the Software is distributed on an ** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS ** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND ** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A ** PARTICULAR PURPOSE, AND NON-INFRINGEMENT. -** +** ** Original Code. The Original Code is: OpenGL Sample Implementation, ** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, ** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. ** Copyright in any portions created by third parties is as indicated ** elsewhere herein. All Rights Reserved. -** +** ** Additional Notice Provisions: The application programming interfaces ** established by SGI in conjunction with the Original Code are The ** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released @@ -76,7 +76,7 @@ void bezierPatchMeshListDelete(bezierPatchMesh *list) { if(list == NULL) return; bezierPatchMeshListDelete(list->next); - bezierPatchMeshDelete(list); + bezierPatchMeshDelete(list); } @@ -126,7 +126,7 @@ bezierPatchMesh *bezierPatchMeshMake(int maptype, float umin, float umax, int us for(j=0; jbpatch->ctlpoints[i * the_ustride + j*the_vstride+k] = ctlpoints[i*ustride+j*vstride+k]; - + ret->size_UVarray = size_UVarray; ret->size_length_array = size_length_array; @@ -203,18 +203,18 @@ void bezierPatchMeshPutPatch(bezierPatchMesh *bpm, int maptype, float umin, floa break; case GL_MAP2_TEXTURE_COORD_2: bpm->bpatch_texcoord = bezierPatchMake2(umin, vmin, umax, vmax, uorder, vorder, 2, ustride, vstride, ctlpoints); - break; + break; case GL_MAP2_TEXTURE_COORD_3: bpm->bpatch_texcoord = bezierPatchMake2(umin, vmin, umax, vmax, uorder, vorder, 3, ustride, vstride, ctlpoints); - break; + break; case GL_MAP2_TEXTURE_COORD_4: bpm->bpatch_texcoord = bezierPatchMake2(umin, vmin, umax, vmax, uorder, vorder, 4, ustride, vstride, ctlpoints); - break; + break; default: fprintf(stderr, "error in bezierPatchMeshPutPatch, maptype=%i is wrong, maptype,map is invalid\n", maptype); } } - + /*delete everything including the arrays. So if you want to output the *pointers of the arrays, you should not use this function to deallocate space. @@ -230,7 +230,7 @@ void bezierPatchMeshDelete(bezierPatchMesh *bpm) bezierPatchDelete(bpm->bpatch_color); if(bpm->bpatch_texcoord != NULL) bezierPatchDelete(bpm->bpatch_texcoord); - + free(bpm->UVarray); free(bpm->length_array); free(bpm->vertex_array); @@ -238,7 +238,7 @@ void bezierPatchMeshDelete(bezierPatchMesh *bpm) free(bpm->type_array); free(bpm); } - + /*begin a strip *type is the primitive type: */ @@ -252,10 +252,10 @@ void bezierPatchMeshBeginStrip(bezierPatchMesh *bpm, GLenum type) void bezierPatchMeshEndStrip(bezierPatchMesh *bpm) { int i; - + /*if there are no vertices in this strip, then nothing needs to be done*/ if(bpm->counter == 0) return; - + /*if the length_array is full, it should be expanded*/ if(bpm->index_length_array >= bpm->size_length_array) { @@ -265,18 +265,18 @@ void bezierPatchMeshEndStrip(bezierPatchMesh *bpm) assert(temp_type); /*update the size*/ bpm->size_length_array = bpm->size_length_array*2 + 1; - + /*copy*/ for(i=0; iindex_length_array; i++) { temp[i] = bpm->length_array[i]; temp_type[i] = bpm->type_array[i]; } - + /*deallocate old array*/ free(bpm->length_array); free(bpm->type_array); - + /*point to the new array which is twice as bigger*/ bpm->length_array = temp; bpm->type_array = temp_type; @@ -295,19 +295,19 @@ void bezierPatchMeshInsertUV(bezierPatchMesh *bpm, float u, float v) { float *temp = (float*) malloc(sizeof(float) * (bpm->size_UVarray * 2 + 2)); assert(temp); - + /*update the size*/ bpm->size_UVarray = bpm->size_UVarray*2 + 2; - + /*copy*/ for(i=0; iindex_UVarray; i++) { temp[i] = bpm->UVarray[i]; } - + /*deallocate old array*/ free(bpm->UVarray); - + /*pointing to the new arrays*/ bpm->UVarray = temp; } @@ -445,7 +445,7 @@ void bezierPatchMeshDelDeg(bezierPatchMesh* bpm) index_new_UVarray=0; k=0; for(i=0; iindex_length_array; i++){ - + /*(if not degenerate, we have to copy*/ if( (bpm->length_array[i] != 3) || (!isDegenerate(bpm->UVarray+k, bpm->UVarray+k+2, bpm->UVarray+k+4))) { @@ -460,7 +460,7 @@ void bezierPatchMeshDelDeg(bezierPatchMesh* bpm) { k += 6; } - } + } free(bpm->UVarray); free(bpm->length_array); free(bpm->type_array); @@ -469,11 +469,11 @@ void bezierPatchMeshDelDeg(bezierPatchMesh* bpm) bpm->type_array=new_type_array; bpm->index_UVarray = index_new_UVarray; bpm->index_length_array = index_new_length_array; - + } /*(u,v) to XYZ - *the xyz and normals are stored in vertex_array, + *the xyz and normals are stored in vertex_array, *and normal_array. the spaces of both are allocated here */ void bezierPatchMeshEval(bezierPatchMesh* bpm) @@ -490,7 +490,7 @@ void bezierPatchMeshEval(bezierPatchMesh* bpm) int ustride = dimension * vorder; int vstride = dimension; float *ctlpoints = bpm->bpatch->ctlpoints; - + bpm->vertex_array = (float*) malloc(sizeof(float)* (bpm->index_UVarray/2) * 3); assert(bpm->vertex_array); bpm->normal_array = (float*) malloc(sizeof(float)* (bpm->index_UVarray/2) * 3); @@ -511,7 +511,7 @@ void bezierPatchMeshEval(bezierPatchMesh* bpm) } } } - + void bezierPatchMeshListEval(bezierPatchMesh* list) { bezierPatchMesh* temp; @@ -559,13 +559,13 @@ void bezierPatchMeshListCollect(bezierPatchMesh* list, float **vertex_array, flo assert(*normal_array); *num_strips = bezierPatchMeshListTotalStrips(list); - + *length_array = (int*) malloc(sizeof(int) * (*num_strips)); assert(*length_array); *type_array = (GLenum*) malloc(sizeof(GLenum) * (*num_strips)); assert(*type_array); - + k=0; l=0; for(temp = list; temp != NULL; temp = temp->next) diff --git a/src/glu/sgi/libnurbs/interface/bezierPatchMesh.h b/src/glu/sgi/libnurbs/interface/bezierPatchMesh.h index ba6868a..1418edc 100644 --- a/src/glu/sgi/libnurbs/interface/bezierPatchMesh.h +++ b/src/glu/sgi/libnurbs/interface/bezierPatchMesh.h @@ -38,7 +38,7 @@ typedef struct bezierPatchMesh{ bezierPatch *bpatch; /*vertex*/ - bezierPatch *bpatch_normal; + bezierPatch *bpatch_normal; bezierPatch *bpatch_texcoord; /*s,t,r,q*/ bezierPatch *bpatch_color; /*RGBA*/ @@ -51,10 +51,10 @@ typedef struct bezierPatchMesh{ int index_UVarray; int size_length_array; int index_length_array; - + int counter; /*track the current strip size*/ GLenum type; /*track the current type: 0: GL_TRIANGLES, 1: GL_TRIANGLE_STRIP*/ - + /*we eventually want to evaluate from (u,v) to (x,y,z) and draw them*/ float *vertex_array; /*each vertex contains three components*/ float *normal_array; /*each normal contains three components*/ @@ -102,7 +102,7 @@ void bezierPatchMeshDelDeg(bezierPatchMesh* bpm); void bezierPatchMeshEval(bezierPatchMesh* bpm); - + void bezierPatchMeshDraw(bezierPatchMesh* bpm); void bezierPatchMeshListDraw(bezierPatchMesh* list); diff --git a/src/glu/sgi/libnurbs/interface/glcurveval.cc b/src/glu/sgi/libnurbs/interface/glcurveval.cc index b6591db..158d8b3 100644 --- a/src/glu/sgi/libnurbs/interface/glcurveval.cc +++ b/src/glu/sgi/libnurbs/interface/glcurveval.cc @@ -44,8 +44,8 @@ #include "glrenderer.h" #include "glcurveval.h" #include "nurbsconsts.h" - -OpenGLCurveEvaluator::OpenGLCurveEvaluator(void) + +OpenGLCurveEvaluator::OpenGLCurveEvaluator(void) { //no default callback functions beginCallBackN = NULL; @@ -62,7 +62,7 @@ OpenGLCurveEvaluator::OpenGLCurveEvaluator(void) texcoordCallBackData = NULL; userData = NULL; - + vertex_flag = 0; normal_flag = 0; color_flag = 0; @@ -75,8 +75,8 @@ OpenGLCurveEvaluator::OpenGLCurveEvaluator(void) output_triangles = 0; // don't output triangles by default } -OpenGLCurveEvaluator::~OpenGLCurveEvaluator(void) -{ +OpenGLCurveEvaluator::~OpenGLCurveEvaluator(void) +{ } /* added nonsense to avoid the warning messages at compile time */ @@ -143,7 +143,7 @@ OpenGLCurveEvaluator::enable(long type) * mapgrid1f - define a lattice of points with origin and offset *------------------------------------------------------------------------- */ -void +void OpenGLCurveEvaluator::mapgrid1f(long nu, REAL u0, REAL u1) { if(output_triangles) @@ -185,7 +185,7 @@ OpenGLCurveEvaluator::endmap1f(void) { if(output_triangles) { - + } else glPopAttrib(); @@ -238,7 +238,7 @@ OpenGLCurveEvaluator::map1f( which=3; dimension = 2; break; - + case GL_MAP1_TEXTURE_COORD_3: which=3; dimension = 3; @@ -246,12 +246,12 @@ OpenGLCurveEvaluator::map1f( case GL_MAP1_TEXTURE_COORD_4: which=3; dimension = 4; - break; + break; } - inMap1f(which, dimension, ulo, uhi, stride, order, pts); - } + inMap1f(which, dimension, ulo, uhi, stride, order, pts); + } else - glMap1f((GLenum) type, (GLfloat) ulo, (GLfloat) uhi, (GLint) stride, + glMap1f((GLenum) type, (GLfloat) ulo, (GLfloat) uhi, (GLint) stride, (GLint) order, (const GLfloat *) pts); } @@ -263,7 +263,7 @@ void OpenGLCurveEvaluator::mapmesh1f(long style, long from, long to) { if(output_triangles) { - inMapMesh1f((int) from, (int) to); + inMapMesh1f((int) from, (int) to); } else { diff --git a/src/glu/sgi/libnurbs/interface/glcurveval.h b/src/glu/sgi/libnurbs/interface/glcurveval.h index 8fa4930..c688396 100644 --- a/src/glu/sgi/libnurbs/interface/glcurveval.h +++ b/src/glu/sgi/libnurbs/interface/glcurveval.h @@ -47,9 +47,9 @@ class CurveMap; #ifndef IN_MAX_BEZIER_ORDER #define IN_MAX_BEZIER_ORDER 40 /*XXX should be bigger than machine order*/ #endif - + #ifndef IN_MAX_DIMENSION -#define IN_MAX_DIMENSION 4 +#define IN_MAX_DIMENSION 4 #endif typedef struct curveEvalMachine{ @@ -63,7 +63,7 @@ typedef struct curveEvalMachine{ REAL ucoeff[IN_MAX_BEZIER_ORDER];//cache the polynomial values } curveEvalMachine; -class OpenGLCurveEvaluator : public BasicCurveEvaluator { +class OpenGLCurveEvaluator : public BasicCurveEvaluator { public: OpenGLCurveEvaluator(void); virtual ~OpenGLCurveEvaluator(void); diff --git a/src/glu/sgi/libnurbs/interface/glinterface.cc b/src/glu/sgi/libnurbs/interface/glinterface.cc index ba64bcd..7efa998 100644 --- a/src/glu/sgi/libnurbs/interface/glinterface.cc +++ b/src/glu/sgi/libnurbs/interface/glinterface.cc @@ -6,21 +6,21 @@ ** this file except in compliance with the License. You may obtain a copy ** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600 ** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at: -** +** ** http://oss.sgi.com/projects/FreeB -** +** ** Note that, as provided in the License, the Software is distributed on an ** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS ** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND ** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A ** PARTICULAR PURPOSE, AND NON-INFRINGEMENT. -** +** ** Original Code. The Original Code is: OpenGL Sample Implementation, ** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, ** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. ** Copyright in any portions created by third parties is as indicated ** elsewhere herein. All Rights Reserved. -** +** ** Additional Notice Provisions: The application programming interfaces ** established by SGI in conjunction with the Original Code are The ** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released @@ -66,7 +66,7 @@ GLUnurbs * GLAPIENTRY gluNewNurbsRenderer(void) { GLUnurbs *t; - + t = new GLUnurbs(); return t; } @@ -92,19 +92,19 @@ gluBeginSurface(GLUnurbs *r) surfcount++; tempTrim = OTL_make(10,10); #endif - r->bgnsurface(0); + r->bgnsurface(0); } void GLAPIENTRY gluBeginCurve(GLUnurbs *r) { - r->bgncurve(0); + r->bgncurve(0); } void GLAPIENTRY gluEndCurve(GLUnurbs *r) { - r->endcurve(); + r->endcurve(); } void GLAPIENTRY @@ -124,7 +124,7 @@ OTN_write(otn, "out.otn"); } #endif - r->endsurface(); + r->endsurface(); } void GLAPIENTRY @@ -134,7 +134,7 @@ gluBeginTrim(GLUnurbs *r) OTL_bgnTrim(tempTrim); #endif - r->bgntrim(); + r->bgntrim(); } void GLAPIENTRY @@ -143,11 +143,11 @@ gluEndTrim(GLUnurbs *r) #ifdef DOWN_LOAD_NURBS OTL_endTrim(tempTrim); #endif - r->endtrim(); + r->endtrim(); } void GLAPIENTRY -gluPwlCurve(GLUnurbs *r, GLint count, INREAL array[], +gluPwlCurve(GLUnurbs *r, GLint count, INREAL array[], GLint stride, GLenum type) { #ifdef DOWN_LOAD_NURBS @@ -170,7 +170,7 @@ OTL_pwlCurve(tempTrim, count, array, stride, type); } void GLAPIENTRY -gluNurbsCurve(GLUnurbs *r, GLint nknots, INREAL knot[], GLint stride, +gluNurbsCurve(GLUnurbs *r, GLint nknots, INREAL knot[], GLint stride, INREAL ctlarray[], GLint order, GLenum type) { #ifdef DOWN_LOAD_NURBS @@ -191,15 +191,15 @@ OTL_nurbsCurve(tempTrim, nknots, knot, stride, ctlarray, order, type); break; } - r->nurbscurve(nknots, knot, sizeof(INREAL) * stride, ctlarray, order, + r->nurbscurve(nknots, knot, sizeof(INREAL) * stride, ctlarray, order, realType); } void GLAPIENTRY -gluNurbsSurface(GLUnurbs *r, GLint sknot_count, GLfloat *sknot, - GLint tknot_count, GLfloat *tknot, - GLint s_stride, GLint t_stride, - GLfloat *ctlarray, GLint sorder, GLint torder, +gluNurbsSurface(GLUnurbs *r, GLint sknot_count, GLfloat *sknot, + GLint tknot_count, GLfloat *tknot, + GLint s_stride, GLint t_stride, + GLfloat *ctlarray, GLint sorder, GLint torder, GLenum type) { #ifdef DOWN_LOAD_NURBS @@ -222,18 +222,18 @@ tempNurb = nurbSurfMake(sknot_count, sknot, dimension, ctlarray, s_stride, t_stride); - + } #endif - r->nurbssurface(sknot_count, sknot, tknot_count, tknot, - sizeof(INREAL) * s_stride, sizeof(INREAL) * t_stride, + r->nurbssurface(sknot_count, sknot, tknot_count, tknot, + sizeof(INREAL) * s_stride, sizeof(INREAL) * t_stride, ctlarray, sorder, torder, type); } void GLAPIENTRY gluLoadSamplingMatrices(GLUnurbs *r, const GLfloat modelMatrix[16], - const GLfloat projMatrix[16], + const GLfloat projMatrix[16], const GLint viewport[4]) { r->useGLMatrices(modelMatrix, projMatrix, viewport); @@ -243,9 +243,9 @@ void GLAPIENTRY gluNurbsProperty(GLUnurbs *r, GLenum property, GLfloat value) { GLfloat nurbsValue; - + switch (property) { - case GLU_AUTO_LOAD_MATRIX: + case GLU_AUTO_LOAD_MATRIX: r->setautoloadmode(value); return; @@ -272,11 +272,11 @@ gluNurbsProperty(GLUnurbs *r, GLenum property, GLfloat value) } else if (value == GLU_OBJECT_PARAMETRIC_ERROR) { nurbsValue = N_OBJECTSPACE_PARA; - r->setautoloadmode( 0.0 ); + r->setautoloadmode( 0.0 ); r->setSamplingMatrixIdentity(); } else if (value == GLU_OBJECT_PATH_LENGTH) { nurbsValue = N_OBJECTSPACE_PATH; - r->setautoloadmode( 0.0 ); + r->setautoloadmode( 0.0 ); r->setSamplingMatrixIdentity(); } else { r->postError(GLU_INVALID_VALUE); @@ -302,10 +302,10 @@ gluNurbsProperty(GLUnurbs *r, GLenum property, GLfloat value) r->setnurbsproperty(GL_MAP1_VERTEX_3, N_ERROR_TOLERANCE, value); r->setnurbsproperty(GL_MAP1_VERTEX_4, N_ERROR_TOLERANCE, value); return; - + case GLU_DISPLAY_MODE: - + if (value == GLU_FILL) { nurbsValue = N_FILL; } else if (value == GLU_OUTLINE_POLYGON) { @@ -317,7 +317,7 @@ gluNurbsProperty(GLUnurbs *r, GLenum property, GLfloat value) return; } r->setnurbsproperty(N_DISPLAY, nurbsValue); - + break; case GLU_U_STEP: @@ -325,7 +325,7 @@ gluNurbsProperty(GLUnurbs *r, GLenum property, GLfloat value) r->setnurbsproperty(GL_MAP1_VERTEX_4, N_S_STEPS, value); r->setnurbsproperty(GL_MAP2_VERTEX_3, N_S_STEPS, value); r->setnurbsproperty(GL_MAP2_VERTEX_4, N_S_STEPS, value); - + //added for optimizing untrimmed case r->set_domain_distance_u_rate(value); break; @@ -339,7 +339,7 @@ gluNurbsProperty(GLUnurbs *r, GLenum property, GLfloat value) //added for optimizing untrimmed case r->set_domain_distance_v_rate(value); break; - + case GLU_NURBS_MODE: if(value == GLU_NURBS_RENDERER) r->put_callbackFlag(0); @@ -351,7 +351,7 @@ gluNurbsProperty(GLUnurbs *r, GLenum property, GLfloat value) default: r->postError(GLU_INVALID_ENUM); - return; + return; } } @@ -387,7 +387,7 @@ gluGetNurbsProperty(GLUnurbs *r, GLenum property, GLfloat *value) else if(*value == N_OBJECTSPACE_PATH) *value = GLU_OBJECT_PATH_LENGTH; else if(*value == N_OBJECTSPACE_PARA) - *value = GLU_OBJECT_PARAMETRIC_ERROR; + *value = GLU_OBJECT_PARAMETRIC_ERROR; break; case GLU_SAMPLING_TOLERANCE: r->getnurbsproperty(GL_MAP2_VERTEX_3, N_PIXEL_TOLERANCE, value); @@ -419,7 +419,7 @@ gluGetNurbsProperty(GLUnurbs *r, GLenum property, GLfloat *value) else *value = GLU_NURBS_RENDERER; break; - + default: r->postError(GLU_INVALID_ENUM); return; @@ -441,7 +441,7 @@ gluNurbsCallback(GLUnurbs *r, GLenum which, _GLUfuncptr fn ) case GLU_NURBS_VERTEX_DATA: case GLU_NURBS_NORMAL_DATA: case GLU_NURBS_TEXTURE_COORD_DATA: - case GLU_NURBS_COLOR_DATA: + case GLU_NURBS_COLOR_DATA: r->putSurfCallBack(which, fn); break; diff --git a/src/glu/sgi/libnurbs/interface/glrenderer.h b/src/glu/sgi/libnurbs/interface/glrenderer.h index 3b72d44..a2d4e60 100644 --- a/src/glu/sgi/libnurbs/interface/glrenderer.h +++ b/src/glu/sgi/libnurbs/interface/glrenderer.h @@ -51,7 +51,7 @@ class GLUnurbs : public NurbsTessellator { public: GLUnurbs( void ); void loadGLMatrices( void ); - void useGLMatrices( const GLfloat modelMatrix[16], + void useGLMatrices( const GLfloat modelMatrix[16], const GLfloat projMatrix[16], const GLint viewport[4] ); void setSamplingMatrixIdentity( void ); @@ -60,16 +60,16 @@ class GLUnurbs : public NurbsTessellator { void bgnrender( void ); void endrender( void ); void setautoloadmode( INREAL value ) - { - - if (value) autoloadmode = GL_TRUE; - else autoloadmode = GL_FALSE; - + { + + if (value) autoloadmode = GL_TRUE; + else autoloadmode = GL_FALSE; + } GLboolean getautoloadmode( void ) { return autoloadmode; } errorCallbackType errorCallback; - void postError( int which ) + void postError( int which ) { if (errorCallback) (errorCallback)( (GLenum)which ); } #ifdef _WIN32 void putSurfCallBack(GLenum which, void (GLAPIENTRY *fn)() ) @@ -85,7 +85,7 @@ class GLUnurbs : public NurbsTessellator { { return surfaceEvaluator.get_vertices_call_back(); } - + void put_vertices_call_back(int flag) { surfaceEvaluator.put_vertices_call_back(flag); @@ -95,7 +95,7 @@ class GLUnurbs : public NurbsTessellator { { return surfaceEvaluator.get_callback_auto_normal(); } - + void put_callback_auto_normal(int flag) { surfaceEvaluator.put_callback_auto_normal(flag); @@ -131,11 +131,11 @@ class GLUnurbs : public NurbsTessellator { OpenGLSurfaceEvaluator surfaceEvaluator; OpenGLCurveEvaluator curveEvaluator; - void loadSamplingMatrix( const GLfloat vmat[4][4], + void loadSamplingMatrix( const GLfloat vmat[4][4], const GLint viewport[4] ); void loadCullingMatrix( GLfloat vmat[4][4] ); static void grabGLMatrix( GLfloat vmat[4][4] ); - static void transform4d( GLfloat A[4], GLfloat B[4], + static void transform4d( GLfloat A[4], GLfloat B[4], GLfloat mat[4][4] ); static void multmatrix4d( GLfloat n[4][4], const GLfloat left[4][4], const GLfloat right[4][4] ); diff --git a/src/glu/sgi/libnurbs/interface/glsurfeval.cc b/src/glu/sgi/libnurbs/interface/glsurfeval.cc index b5bfab1..d32b8d8 100644 --- a/src/glu/sgi/libnurbs/interface/glsurfeval.cc +++ b/src/glu/sgi/libnurbs/interface/glsurfeval.cc @@ -118,7 +118,7 @@ OpenGLSurfaceEvaluator::OpenGLSurfaceEvaluator() global_uorder_BV = 0; global_vorder_BV = 0; global_baseData = NULL; - + global_bpm = NULL; output_triangles = 0; //don't output triangles by default @@ -199,7 +199,7 @@ OpenGLSurfaceEvaluator::mapgrid2f(long nu, REAL u0, REAL u1, long nv, REAL v0, R (REAL) v0, (REAL) v1); #else - if(output_triangles) + if(output_triangles) { global_grid_u0 = u0; global_grid_u1 = u1; @@ -223,7 +223,7 @@ OpenGLSurfaceEvaluator::polymode(long style) switch(style) { default: case N_MESHFILL: - + glPolygonMode((GLenum) GL_FRONT_AND_BACK, (GLenum) GL_FILL); break; case N_MESHLINE: @@ -419,7 +419,7 @@ OpenGLSurfaceEvaluator::evalUStrip(int n_upper, REAL v_upper, REAL* upper_val, i coord2f(leftMostV[0], leftMostV[1]); // glNormal3fv(leftMostNormal); // glVertex3fv(leftMostXYZ); - + for(k=n_upper-1; k>=i; k--) /*reverse order for two-side lighting*/ { coord2f(upper_val[k], v_upper); @@ -483,11 +483,11 @@ OpenGLSurfaceEvaluator::evalUStrip(int n_upper, REAL v_upper, REAL* upper_val, i coord2f(upper_val[i], v_upper); // glNormal3fv(upperNormal[i]); // glVertex3fv(upperXYZ[i]); - + coord2f(leftMostV[0], leftMostV[1]); // glNormal3fv(leftMostNormal); // glVertex3fv(leftMostXYZ); - + /*find the last k>=j such that *lowerverts[k][0] < upperverts[i][0] @@ -602,7 +602,7 @@ OpenGLSurfaceEvaluator::evalVStrip(int n_left, REAL u_left, REAL* left_val, int coord2f(botMostV[0], botMostV[1]); // glNormal3fv(botMostNormal); // glVertex3fv(botMostXYZ); - + for(k=n_left-1; k>=i; k--) /*reverse order for two-side lighting*/ { coord2f(u_left, left_val[k]); @@ -666,11 +666,11 @@ OpenGLSurfaceEvaluator::evalVStrip(int n_left, REAL u_left, REAL* left_val, int coord2f(u_left, left_val[i]); // glNormal3fv(leftNormal[i]); // glVertex3fv(leftXYZ[i]); - + coord2f(botMostV[0], botMostV[1]); // glNormal3fv(botMostNormal); // glVertex3fv(botMostXYZ); - + /*find the last k>=j such that *rightverts[k][0] < leftverts[i][0] @@ -787,7 +787,7 @@ OpenGLSurfaceEvaluator::bgnmap2f(long) glPushAttrib((GLbitfield) GL_EVAL_BIT); /*to avoid side effect, we restor the opengl state for GL_POLYGON_MODE - */ + */ glGetIntegerv(GL_POLYGON_MODE, gl_polygon_mode); } @@ -984,7 +984,7 @@ if(output_triangles) bgnqstrip(); for(j=vmax; j>=vmin; j--){ REAL v1 = (j == global_grid_nv)? global_grid_v1: (global_grid_v0 +j*dv); - + coord2f(u1, v1); coord2f(u2, v1); } @@ -999,7 +999,7 @@ if(output_triangles) bgnqstrip(); for(j=umax; j>=umin; j--){ - REAL u1 = (j == global_grid_nu)? global_grid_u1: (global_grid_u0 +j*du); + REAL u1 = (j == global_grid_nu)? global_grid_u1: (global_grid_u0 +j*du); coord2f(u1, v2); coord2f(u1, v1); } diff --git a/src/glu/sgi/libnurbs/interface/glsurfeval.h b/src/glu/sgi/libnurbs/interface/glsurfeval.h index 621e593..21d6d06 100644 --- a/src/glu/sgi/libnurbs/interface/glsurfeval.h +++ b/src/glu/sgi/libnurbs/interface/glsurfeval.h @@ -55,9 +55,9 @@ class StoredVertex; #ifndef IN_MAX_BEZIER_ORDER #define IN_MAX_BEZIER_ORDER 40 /*XXX should be bigger than machine order*/ #endif - + #ifndef IN_MAX_DIMENSION -#define IN_MAX_DIMENSION 4 +#define IN_MAX_DIMENSION 4 #endif typedef struct surfEvalMachine{ @@ -78,14 +78,14 @@ typedef struct surfEvalMachine{ REAL ucoeffDeriv[IN_MAX_BEZIER_ORDER]; /*cache the polynomial derivatives*/ REAL vcoeffDeriv[IN_MAX_BEZIER_ORDER]; } surfEvalMachine; - - + + class StoredVertex { public: StoredVertex() { type = 0; coord[0] = 0; coord[1] = 0; point[0] = 0; point[1] = 0; } ~StoredVertex(void) {} - void saveEvalCoord(REAL x, REAL y) + void saveEvalCoord(REAL x, REAL y) {coord[0] = x; coord[1] = y; type = TYPECOORD; } void saveEvalPoint(long x, long y) {point[0] = x; point[1] = y; type = TYPEPOINT; } @@ -109,7 +109,7 @@ class OpenGLSurfaceEvaluator : public BasicSurfaceEvaluator { void enable( long ); void disable( long ); void bgnmap2f( long ); - void map2f( long, REAL, REAL, long, long, + void map2f( long, REAL, REAL, long, long, REAL, REAL, long, long, REAL * ); void mapgrid2f( long, REAL, REAL, long, REAL, REAL ); void mapmesh2f( long, long, long, long, long ); @@ -158,7 +158,7 @@ class OpenGLSurfaceEvaluator : public BasicSurfaceEvaluator { void put_callback_auto_normal(int flag) { callback_auto_normal = flag; - } + } int get_callback_auto_normal() { @@ -175,7 +175,7 @@ class OpenGLSurfaceEvaluator : public BasicSurfaceEvaluator { - + private: StoredVertex *vertexCache[VERTEX_CACHE_SIZE]; int tmeshing; @@ -218,14 +218,14 @@ class OpenGLSurfaceEvaluator : public BasicSurfaceEvaluator { void LOD_triangle(REAL A[2], REAL B[2], REAL C[2], int level); void LOD_eval(int num_vert, REAL* verts, int type, int level); - + int LOD_eval_level; //set by LOD_eval_list() /*************begin for internal evaluators*****************/ - - /*the following global variables are only defined in this file. + + /*the following global variables are only defined in this file. *They are used to cache the precomputed Bezier polynomial values. - *These calues may be used consecutively in which case we don't have + *These calues may be used consecutively in which case we don't have *recompute these values again. */ int global_uorder; /*store the uorder in the previous evaluation*/ @@ -269,9 +269,9 @@ class OpenGLSurfaceEvaluator : public BasicSurfaceEvaluator { int global_grid_nv; /*functions*/ - void inDoDomain2WithDerivs(int k, REAL u, REAL v, - REAL u1, REAL u2, int uorder, - REAL v1, REAL v2, int vorder, + void inDoDomain2WithDerivs(int k, REAL u, REAL v, + REAL u1, REAL u2, int uorder, + REAL v1, REAL v2, int vorder, REAL *baseData, REAL *retPoint, REAL *retdu, REAL *retdv); void inPreEvaluate(int order, REAL vprime, REAL *coeff); @@ -293,20 +293,20 @@ class OpenGLSurfaceEvaluator : public BasicSurfaceEvaluator { int vorder, REAL *ctlPoints); - void inMapGrid2f(int nu, REAL u0, REAL u1, + void inMapGrid2f(int nu, REAL u0, REAL u1, int nv, REAL v0, REAL v1); void inEvalMesh2(int lowU, int lowV, int highU, int highV); void inEvalPoint2(int i, int j); void inEvalCoord2f(REAL u, REAL v); -void inEvalULine(int n_points, REAL v, REAL* u_vals, +void inEvalULine(int n_points, REAL v, REAL* u_vals, int stride, REAL ret_points[][3], REAL ret_normals[][3]); -void inEvalVLine(int n_points, REAL u, REAL* v_vals, +void inEvalVLine(int n_points, REAL u, REAL* v_vals, int stride, REAL ret_points[][3], REAL ret_normals[][3]); -void inEvalUStrip(int n_upper, REAL v_upper, REAL* upper_val, +void inEvalUStrip(int n_upper, REAL v_upper, REAL* upper_val, int n_lower, REAL v_lower, REAL* lower_val ); void inEvalVStrip(int n_left, REAL u_left, REAL* left_val, int n_right, REAL u_right, REAL* right_val); @@ -320,7 +320,7 @@ void inPreEvaluateBV_intfac(REAL v ) void inPreEvaluateBU_intfac(REAL u) { - inPreEvaluateBU(global_ev_k, global_ev_uorder, global_ev_vorder, (u-global_ev_u1)/(global_ev_u2-global_ev_u1), global_ev_ctlPoints); + inPreEvaluateBU(global_ev_k, global_ev_uorder, global_ev_vorder, (u-global_ev_u1)/(global_ev_u2-global_ev_u1), global_ev_ctlPoints); } void inDoDomain2WithDerivsBV(int k, REAL u, REAL v, @@ -371,9 +371,9 @@ void inMap2fEM(int which, //0:vert,1:norm,2:color,3:tex int vorder, REAL *ctlPoints); -void inDoDomain2WithDerivsEM(surfEvalMachine *em, REAL u, REAL v, +void inDoDomain2WithDerivsEM(surfEvalMachine *em, REAL u, REAL v, REAL *retPoint, REAL *retdu, REAL *retdv); -void inDoDomain2EM(surfEvalMachine *em, REAL u, REAL v, +void inDoDomain2EM(surfEvalMachine *em, REAL u, REAL v, REAL *retPoint); void inDoEvalCoord2EM(REAL u, REAL v); @@ -384,7 +384,7 @@ void inBPMListEvalEM(bezierPatchMesh* list); /*************end for internal evaluators*****************/ - + }; inline void StoredVertex::invoke(OpenGLSurfaceEvaluator *eval) diff --git a/src/glu/sgi/libnurbs/interface/incurveeval.cc b/src/glu/sgi/libnurbs/interface/incurveeval.cc index 96ea889..966191a 100644 --- a/src/glu/sgi/libnurbs/interface/incurveeval.cc +++ b/src/glu/sgi/libnurbs/interface/incurveeval.cc @@ -6,21 +6,21 @@ ** this file except in compliance with the License. You may obtain a copy ** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600 ** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at: -** +** ** http://oss.sgi.com/projects/FreeB -** +** ** Note that, as provided in the License, the Software is distributed on an ** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS ** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND ** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A ** PARTICULAR PURPOSE, AND NON-INFRINGEMENT. -** +** ** Original Code. The Original Code is: OpenGL Sample Implementation, ** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, ** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. ** Copyright in any portions created by third parties is as indicated ** elsewhere herein. All Rights Reserved. -** +** ** Additional Notice Provisions: The application programming interfaces ** established by SGI in conjunction with the Original Code are The ** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released @@ -42,8 +42,8 @@ /* - *compute the Bezier polynomials C[n,j](v) for all j at v with - *return values stored in coeff[], where + *compute the Bezier polynomials C[n,j](v) for all j at v with + *return values stored in coeff[], where * C[n,j](v) = (n,j) * v^j * (1-v)^(n-j), * j=0,1,2,...,n. *order : n+1 @@ -59,7 +59,7 @@ void OpenGLCurveEvaluator::inPreEvaluate(int order, REAL vprime, REAL *coeff) int i, j; REAL oldval, temp; REAL oneMinusvprime; - + /* * Minor optimization * Compute orders 1 and 2 outright, and set coeff[0], coeff[1] to @@ -69,12 +69,12 @@ void OpenGLCurveEvaluator::inPreEvaluate(int order, REAL vprime, REAL *coeff) coeff[0] = 1.0; return; } - + oneMinusvprime = 1-vprime; coeff[0] = oneMinusvprime; coeff[1] = vprime; if (order == 2) return; - + for (i = 2; i < order; i++) { oldval = coeff[0] * vprime; coeff[0] = oneMinusvprime * coeff[0]; @@ -115,7 +115,7 @@ void OpenGLCurveEvaluator::inMap1f(int which, //0: vert, 1: norm, 2: color, 3: t temp_em = &em_texcoord; break; } - + REAL *data = temp_em->ctlpoints; temp_em->uprime = -1; //initialized temp_em->k = k; @@ -130,7 +130,7 @@ void OpenGLCurveEvaluator::inMap1f(int which, //0: vert, 1: norm, 2: color, 3: t } ctlpoints += ustride; data += k; - } + } } void OpenGLCurveEvaluator::inDoDomain1(curveEvalMachine *em, REAL u, REAL *retPoint) @@ -138,7 +138,7 @@ void OpenGLCurveEvaluator::inDoDomain1(curveEvalMachine *em, REAL u, REAL *retPo int j, row; REAL the_uprime; REAL *data; - + if(em->u2 == em->u1) return; the_uprime = (u-em->u1) / (em->u2-em->u1); @@ -147,7 +147,7 @@ void OpenGLCurveEvaluator::inDoDomain1(curveEvalMachine *em, REAL u, REAL *retPo inPreEvaluate(em->uorder, the_uprime, em->ucoeff); em->uprime = the_uprime; } - + for(j=0; jk; j++){ data = em->ctlpoints+j; retPoint[j] = 0.0; @@ -156,7 +156,7 @@ void OpenGLCurveEvaluator::inDoDomain1(curveEvalMachine *em, REAL u, REAL *retPo retPoint[j] += em->ucoeff[row] * (*data); data += em->k; } - } + } } void OpenGLCurveEvaluator::inDoEvalCoord1(REAL u) diff --git a/src/glu/sgi/libnurbs/interface/insurfeval.cc b/src/glu/sgi/libnurbs/interface/insurfeval.cc index 9d0c82a..3a24d98 100644 --- a/src/glu/sgi/libnurbs/interface/insurfeval.cc +++ b/src/glu/sgi/libnurbs/interface/insurfeval.cc @@ -6,21 +6,21 @@ ** this file except in compliance with the License. You may obtain a copy ** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600 ** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at: -** +** ** http://oss.sgi.com/projects/FreeB -** +** ** Note that, as provided in the License, the Software is distributed on an ** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS ** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND ** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A ** PARTICULAR PURPOSE, AND NON-INFRINGEMENT. -** +** ** Original Code. The Original Code is: OpenGL Sample Implementation, ** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, ** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. ** Copyright in any portions created by third parties is as indicated ** elsewhere herein. All Rights Reserved. -** +** ** Additional Notice Provisions: The application programming interfaces ** established by SGI in conjunction with the Original Code are The ** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released @@ -89,8 +89,8 @@ static void LOD_interpolate(REAL A[2], REAL B[2], REAL C[2], int j, int k, int p v = x*A[1] + y*B[1] + z*C[1]; } -void OpenGLSurfaceEvaluator::LOD_triangle(REAL A[2], REAL B[2], REAL C[2], - int level) +void OpenGLSurfaceEvaluator::LOD_triangle(REAL A[2], REAL B[2], REAL C[2], + int level) { int k,j; int pow2_level; @@ -132,7 +132,7 @@ glBegin(GL_TRIANGLE_STRIP); inDoEvalCoord2EM(u,v); #endif } -// endCallBack(); +// endCallBack(); glEnd(); } } @@ -154,13 +154,13 @@ void OpenGLSurfaceEvaluator::LOD_eval(int num_vert, REAL* verts, int type, level ); } - if(num_vert % 2 ==1) + if(num_vert % 2 ==1) { LOD_triangle(verts+2*(num_vert-3), verts+2*(num_vert-2), verts+2*(num_vert-1), level ); } - break; + break; case GL_TRIANGLE_FAN: for(i=1, k=2; i<=num_vert-2; i++, k+=2) { @@ -169,12 +169,12 @@ void OpenGLSurfaceEvaluator::LOD_eval(int num_vert, REAL* verts, int type, ); } break; - + default: fprintf(stderr, "typy not supported in LOD_\n"); } } - + #endif //USE_LOD @@ -227,7 +227,7 @@ static void gTessVertexCyl(float u, float v, float temp_normal[3], float temp_ve temp_vertex[1] = y; temp_vertex[2] = z; -/* +/* glNormal3f(nx,ny,nz); glVertex3f(x,y,z); */ @@ -251,7 +251,7 @@ void OpenGLSurfaceEvaluator::inBPMEval(bezierPatchMesh* bpm) int ustride = bpm->bpatch->dimension * bpm->bpatch->vorder; int vstride = bpm->bpatch->dimension; - inMap2f( + inMap2f( (bpm->bpatch->dimension == 3)? GL_MAP2_VERTEX_3 : GL_MAP2_VERTEX_4, bpm->bpatch->umin, bpm->bpatch->umax, @@ -262,7 +262,7 @@ void OpenGLSurfaceEvaluator::inBPMEval(bezierPatchMesh* bpm) vstride, bpm->bpatch->vorder, bpm->bpatch->ctlpoints); - + bpm->vertex_array = (float*) malloc(sizeof(float)* (bpm->index_UVarray/2) * 3+1); /*in case the origional dimenion is 4, then we need 4 space to pass to evaluator.*/ assert(bpm->vertex_array); bpm->normal_array = (float*) malloc(sizeof(float)* (bpm->index_UVarray/2) * 3); @@ -406,39 +406,39 @@ void OpenGLSurfaceEvaluator::inEvalMesh2(int lowU, int lowV, int highU, int high if(global_grid_nu == 0 || global_grid_nv == 0) return; /*no points need to be output*/ du = (global_grid_u1 - global_grid_u0) / (REAL)global_grid_nu; - dv = (global_grid_v1 - global_grid_v0) / (REAL)global_grid_nv; - + dv = (global_grid_v1 - global_grid_v0) / (REAL)global_grid_nv; + if(global_grid_nu >= global_grid_nv){ for(i=lowU; i=lowV; j--){ REAL v1 = (j == global_grid_nv)? global_grid_v1: (global_grid_v0 +j*dv); - + inDoEvalCoord2(u1, v1, point, normal); inDoEvalCoord2(u2, v1, point, normal); } endqstrip(); } } - + else{ for(i=lowV; i=lowU; j--){ - REAL u1 = (j == global_grid_nu)? global_grid_u1: (global_grid_u0 +j*du); + REAL u1 = (j == global_grid_nu)? global_grid_u1: (global_grid_u0 +j*du); inDoEvalCoord2(u1, v2, point, normal); inDoEvalCoord2(u1, v1, point, normal); } endqstrip(); } } - + } void OpenGLSurfaceEvaluator::inMap2f(int k, @@ -454,7 +454,7 @@ void OpenGLSurfaceEvaluator::inMap2f(int k, { int i,j,x; REAL *data = global_ev_ctlPoints; - + if(k == GL_MAP2_VERTEX_3) k=3; @@ -463,7 +463,7 @@ void OpenGLSurfaceEvaluator::inMap2f(int k, printf("error in inMap2f, maptype=%i is wrong, k,map is not updated\n", k); return; } - + global_ev_k = k; global_ev_u1 = ulower; global_ev_u2 = uupper; @@ -490,12 +490,12 @@ void OpenGLSurfaceEvaluator::inMap2f(int k, /* - *given a point p with homegeneous coordiante (x,y,z,w), + *given a point p with homegeneous coordiante (x,y,z,w), *let pu(x,y,z,w) be its partial derivative vector with *respect to u *and pv(x,y,z,w) be its partial derivative vector with repect to v. *This function returns the partial derivative vectors of the - *inhomegensous coordinates, i.e., + *inhomegensous coordinates, i.e., * (x/w, y/w, z/w) with respect to u and v. */ void OpenGLSurfaceEvaluator::inComputeFirstPartials(REAL *p, REAL *pu, REAL *pv) @@ -517,21 +517,21 @@ void OpenGLSurfaceEvaluator::inComputeFirstPartials(REAL *p, REAL *pu, REAL *pv) */ void OpenGLSurfaceEvaluator::inComputeNormal2(REAL *pu, REAL *pv, REAL *n) { - REAL mag; + REAL mag; n[0] = pu[1]*pv[2] - pu[2]*pv[1]; n[1] = pu[2]*pv[0] - pu[0]*pv[2]; - n[2] = pu[0]*pv[1] - pu[1]*pv[0]; + n[2] = pu[0]*pv[1] - pu[1]*pv[0]; mag = sqrt(n[0]*n[0] + n[1]*n[1] + n[2]*n[2]); if (mag > 0.0) { - n[0] /= mag; + n[0] /= mag; n[1] /= mag; n[2] /= mag; } } - + /*Compute point and normal @@ -545,7 +545,7 @@ void OpenGLSurfaceEvaluator::inDoEvalCoord2(REAL u, REAL v, REAL du[4]; REAL dv[4]; - + assert(global_ev_k>=3 && global_ev_k <= 4); /*compute homegeneous point and partial derivatives*/ inDoDomain2WithDerivs(global_ev_k, u, v, global_ev_u1, global_ev_u2, global_ev_uorder, global_ev_v1, global_ev_v2, global_ev_vorder, global_ev_ctlPoints, retPoint, du, dv); @@ -609,7 +609,7 @@ void OpenGLSurfaceEvaluator::inDoEvalCoord2(REAL u, REAL v, #ifdef DEBUG printf("vertex(%f,%f,%f)\n", retPoint[0],retPoint[1],retPoint[2]); #endif - + } @@ -625,7 +625,7 @@ void OpenGLSurfaceEvaluator::inDoEvalCoord2NOGE_BU(REAL u, REAL v, REAL du[4]; REAL dv[4]; - + assert(global_ev_k>=3 && global_ev_k <= 4); /*compute homegeneous point and partial derivatives*/ // inPreEvaluateBU(global_ev_k, global_ev_uorder, global_ev_vorder, (u-global_ev_u1)/(global_ev_u2-global_ev_u1), global_ev_ctlPoints); @@ -688,7 +688,7 @@ void OpenGLSurfaceEvaluator::inDoEvalCoord2NOGE_BV(REAL u, REAL v, REAL du[4]; REAL dv[4]; - + assert(global_ev_k>=3 && global_ev_k <= 4); /*compute homegeneous point and partial derivatives*/ // inPreEvaluateBV(global_ev_k, global_ev_uorder, global_ev_vorder, (v-global_ev_v1)/(global_ev_v2-global_ev_v1), global_ev_ctlPoints); @@ -740,7 +740,7 @@ void OpenGLSurfaceEvaluator::inDoEvalCoord2NOGE_BV(REAL u, REAL v, break; } } - + /*Compute point and normal *see the head of inDoDomain2WithDerivs @@ -753,7 +753,7 @@ void OpenGLSurfaceEvaluator::inDoEvalCoord2NOGE(REAL u, REAL v, REAL du[4]; REAL dv[4]; - + assert(global_ev_k>=3 && global_ev_k <= 4); /*compute homegeneous point and partial derivatives*/ inDoDomain2WithDerivs(global_ev_k, u, v, global_ev_u1, global_ev_u2, global_ev_uorder, global_ev_v1, global_ev_v2, global_ev_vorder, global_ev_ctlPoints, retPoint, du, dv); @@ -805,14 +805,14 @@ void OpenGLSurfaceEvaluator::inDoEvalCoord2NOGE(REAL u, REAL v, // glNormal3fv(retNormal); // glVertex3fv(retPoint); } - + void OpenGLSurfaceEvaluator::inPreEvaluateBV(int k, int uorder, int vorder, REAL vprime, REAL *baseData) { int j,row,col; REAL p, pdv; REAL *data; - if(global_vprime != vprime || global_vorder != vorder) { + if(global_vprime != vprime || global_vorder != vorder) { inPreEvaluateWithDeriv(vorder, vprime, global_vcoeff, global_vcoeffDeriv); global_vprime = vprime; global_vorder = vorder; @@ -841,7 +841,7 @@ void OpenGLSurfaceEvaluator::inPreEvaluateBU(int k, int uorder, int vorder, REAL REAL p, pdu; REAL *data; - if(global_uprime != uprime || global_uorder != uorder) { + if(global_uprime != uprime || global_uorder != uorder) { inPreEvaluateWithDeriv(uorder, uprime, global_ucoeff, global_ucoeffDeriv); global_uprime = uprime; global_uorder = uorder; @@ -864,7 +864,7 @@ void OpenGLSurfaceEvaluator::inPreEvaluateBU(int k, int uorder, int vorder, REAL } } } - + void OpenGLSurfaceEvaluator::inDoDomain2WithDerivsBU(int k, REAL u, REAL v, REAL u1, REAL u2, int uorder, REAL v1, REAL v2, int vorder, @@ -898,8 +898,8 @@ void OpenGLSurfaceEvaluator::inDoDomain2WithDerivsBU(int k, REAL u, REAL v, retdv[j] += global_BU[col][j] * global_vcoeffDeriv[col]; } } -} - +} + void OpenGLSurfaceEvaluator::inDoDomain2WithDerivsBV(int k, REAL u, REAL v, REAL u1, REAL u2, int uorder, REAL v1, REAL v2, int vorder, @@ -932,7 +932,7 @@ void OpenGLSurfaceEvaluator::inDoDomain2WithDerivsBV(int k, REAL u, REAL v, } } } - + /* *given a Bezier surface, and parameter (u,v), compute the point in the object space, @@ -946,9 +946,9 @@ void OpenGLSurfaceEvaluator::inDoDomain2WithDerivsBV(int k, REAL u, REAL v, *retdu: the computed partial derivative with respect to u. *retdv: the computed partial derivative with respect to v. */ -void OpenGLSurfaceEvaluator::inDoDomain2WithDerivs(int k, REAL u, REAL v, - REAL u1, REAL u2, int uorder, - REAL v1, REAL v2, int vorder, +void OpenGLSurfaceEvaluator::inDoDomain2WithDerivs(int k, REAL u, REAL v, + REAL u1, REAL u2, int uorder, + REAL v1, REAL v2, int vorder, REAL *baseData, REAL *retPoint, REAL *retdu, REAL *retdv) { @@ -963,7 +963,7 @@ void OpenGLSurfaceEvaluator::inDoDomain2WithDerivs(int k, REAL u, REAL v, return; uprime = (u - u1) / (u2 - u1); vprime = (v - v1) / (v2 - v1); - + /* Compute coefficients for values and derivs */ /* Use already cached values if possible */ @@ -972,7 +972,7 @@ void OpenGLSurfaceEvaluator::inDoDomain2WithDerivs(int k, REAL u, REAL v, global_uorder = uorder; global_uprime = uprime; } - if (global_vprime != vprime || + if (global_vprime != vprime || global_vorder != vorder) { inPreEvaluateWithDeriv(vorder, vprime, global_vcoeff, global_vcoeffDeriv); global_vorder = vorder; @@ -983,7 +983,7 @@ void OpenGLSurfaceEvaluator::inDoDomain2WithDerivs(int k, REAL u, REAL v, data=baseData+j; retPoint[j] = retdu[j] = retdv[j] = 0.0; for (row = 0; row < uorder; row++) { - /* + /* ** Minor optimization. ** The col == 0 part of the loop is extracted so we don't ** have to initialize p and pdv to 0. @@ -1002,13 +1002,13 @@ void OpenGLSurfaceEvaluator::inDoDomain2WithDerivs(int k, REAL u, REAL v, retdu[j] += global_ucoeffDeriv[row] * p; retdv[j] += global_ucoeff[row] * pdv; } - } + } } /* - *compute the Bezier polynomials C[n,j](v) for all j at v with - *return values stored in coeff[], where + *compute the Bezier polynomials C[n,j](v) for all j at v with + *return values stored in coeff[], where * C[n,j](v) = (n,j) * v^j * (1-v)^(n-j), * j=0,1,2,...,n. *order : n+1 @@ -1024,7 +1024,7 @@ void OpenGLSurfaceEvaluator::inPreEvaluate(int order, REAL vprime, REAL *coeff) int i, j; REAL oldval, temp; REAL oneMinusvprime; - + /* * Minor optimization * Compute orders 1 and 2 outright, and set coeff[0], coeff[1] to @@ -1034,12 +1034,12 @@ void OpenGLSurfaceEvaluator::inPreEvaluate(int order, REAL vprime, REAL *coeff) coeff[0] = 1.0; return; } - + oneMinusvprime = 1-vprime; coeff[0] = oneMinusvprime; coeff[1] = vprime; if (order == 2) return; - + for (i = 2; i < order; i++) { oldval = coeff[0] * vprime; coeff[0] = oneMinusvprime * coeff[0]; @@ -1053,27 +1053,27 @@ void OpenGLSurfaceEvaluator::inPreEvaluate(int order, REAL vprime, REAL *coeff) } /* - *compute the Bezier polynomials C[n,j](v) and derivatives for all j at v with + *compute the Bezier polynomials C[n,j](v) and derivatives for all j at v with *return values stored in coeff[] and coeffDeriv[]. *see the head of function inPreEvaluate for the definition of C[n,j](v) - *and how to compute the values. + *and how to compute the values. *The algorithm to compute the derivative is: * dC[0,0](v) = 0. * dC[n,j](v) = n*(dC[n-1,j-1](v) - dC[n-1,j](v)). * *This code is copied from opengl/soft/so_eval.c:PreEvaluateWidthDeriv */ -void OpenGLSurfaceEvaluator::inPreEvaluateWithDeriv(int order, REAL vprime, +void OpenGLSurfaceEvaluator::inPreEvaluateWithDeriv(int order, REAL vprime, REAL *coeff, REAL *coeffDeriv) { int i, j; REAL oldval, temp; REAL oneMinusvprime; - + oneMinusvprime = 1-vprime; /* * Minor optimization - * Compute orders 1 and 2 outright, and set coeff[0], coeff[1] to + * Compute orders 1 and 2 outright, and set coeff[0], coeff[1] to * their i==1 loop values to avoid the initialization and the i==1 loop. */ if (order == 1) { @@ -1111,7 +1111,7 @@ void OpenGLSurfaceEvaluator::inPreEvaluateWithDeriv(int order, REAL vprime, j++; } while (j < order - 1); coeffDeriv[j] = coeff[j-1]; - + oldval = coeff[0] * vprime; coeff[0] = oneMinusvprime * coeff[0]; for (j = 1; j < i; j++) { @@ -1122,7 +1122,7 @@ void OpenGLSurfaceEvaluator::inPreEvaluateWithDeriv(int order, REAL vprime, coeff[j] = oldval; } -void OpenGLSurfaceEvaluator::inEvalULine(int n_points, REAL v, REAL* u_vals, +void OpenGLSurfaceEvaluator::inEvalULine(int n_points, REAL v, REAL* u_vals, int stride, REAL ret_points[][3], REAL ret_normals[][3]) { int i,k; @@ -1141,7 +1141,7 @@ inPreEvaluateBV_intfac(v); } -void OpenGLSurfaceEvaluator::inEvalVLine(int n_points, REAL u, REAL* v_vals, +void OpenGLSurfaceEvaluator::inEvalVLine(int n_points, REAL u, REAL* v_vals, int stride, REAL ret_points[][3], REAL ret_normals[][3]) { int i,k; @@ -1155,7 +1155,7 @@ inPreEvaluateBU_intfac(u); ret_points[i][2] = temp[2]; } } - + /*triangulate a strip bounded by two lines which are parallel to U-axis *upperVerts: the verteces on the upper line @@ -1177,7 +1177,7 @@ void OpenGLSurfaceEvaluator::inEvalUStrip(int n_upper, REAL v_upper, REAL* upper assert(lowerXYZ); REAL3* lowerNormal = (REAL3*) malloc(sizeof(REAL3) * n_lower); assert(lowerNormal); - + inEvalULine(n_upper, v_upper, upper_val, 1, upperXYZ, upperNormal); inEvalULine(n_lower, v_lower, lower_val, 1, lowerXYZ, lowerNormal); @@ -1215,10 +1215,10 @@ void OpenGLSurfaceEvaluator::inEvalUStrip(int n_upper, REAL v_upper, REAL* upper leftMostXYZ = lowerXYZ[0]; leftMostNormal = lowerNormal[0]; } - + /*the main loop. - *the invariance is that: - *at the beginning of each loop, the meaning of i,j,and leftMostV are + *the invariance is that: + *at the beginning of each loop, the meaning of i,j,and leftMostV are *maintained */ while(1) @@ -1248,7 +1248,7 @@ void OpenGLSurfaceEvaluator::inEvalUStrip(int n_upper, REAL v_upper, REAL* upper bgntfan(); glNormal3fv(leftMostNormal); glVertex3fv(leftMostXYZ); - + for(k=n_upper-1; k>=i; k--) /*reverse order for two-side lighting*/ { glNormal3fv(upperNormal[k]); @@ -1268,7 +1268,7 @@ void OpenGLSurfaceEvaluator::inEvalUStrip(int n_upper, REAL v_upper, REAL* upper glNormal3fv(lowerNormal[j]); glVertex3fv(lowerXYZ[j]); - /*find the last k>=i such that + /*find the last k>=i such that *upperverts[k][0] <= lowerverts[j][0] */ k=i; @@ -1308,10 +1308,10 @@ void OpenGLSurfaceEvaluator::inEvalUStrip(int n_upper, REAL v_upper, REAL* upper bgntfan(); glNormal3fv(upperNormal[i]); glVertex3fv(upperXYZ[i]); - + glNormal3fv(leftMostNormal); glVertex3fv(leftMostXYZ); - + /*find the last k>=j such that *lowerverts[k][0] < upperverts[i][0] @@ -1336,10 +1336,10 @@ void OpenGLSurfaceEvaluator::inEvalUStrip(int n_upper, REAL v_upper, REAL* upper leftMostNormal = lowerNormal[j-1]; leftMostXYZ = lowerXYZ[j-1]; - } + } } } - //clean up + //clean up free(upperXYZ); free(lowerXYZ); free(upperNormal); @@ -1366,7 +1366,7 @@ void OpenGLSurfaceEvaluator::inEvalVStrip(int n_left, REAL u_left, REAL* left_va assert(rightXYZ); REAL3* rightNormal = (REAL3*) malloc(sizeof(REAL3) * n_right); assert(rightNormal); - + inEvalVLine(n_left, u_left, left_val, 1, leftXYZ, leftNormal); inEvalVLine(n_right, u_right, right_val, 1, rightXYZ, rightNormal); @@ -1379,7 +1379,7 @@ void OpenGLSurfaceEvaluator::inEvalVStrip(int n_left, REAL u_left, REAL* left_va *the algorithm works by scanning from bot to top. *botMostV: the bot most of the remaining verteces (on both left and right). * it could an element of leftVerts or rightVerts. - *i: leftVerts[i] is the first vertex to the top of botMostV on left line + *i: leftVerts[i] is the first vertex to the top of botMostV on left line *j: rightVerts[j] is the first vertex to the top of botMostV on rightline */ /*initialize i,j,and botMostV @@ -1405,10 +1405,10 @@ void OpenGLSurfaceEvaluator::inEvalVStrip(int n_left, REAL u_left, REAL* left_va botMostXYZ = rightXYZ[0]; botMostNormal = rightNormal[0]; } - + /*the main loop. - *the invariance is that: - *at the beginning of each loop, the meaning of i,j,and botMostV are + *the invariance is that: + *at the beginning of each loop, the meaning of i,j,and botMostV are *maintained */ while(1) @@ -1438,7 +1438,7 @@ void OpenGLSurfaceEvaluator::inEvalVStrip(int n_left, REAL u_left, REAL* left_va bgntfan(); glNormal3fv(botMostNormal); glVertex3fv(botMostXYZ); - + for(k=n_left-1; k>=i; k--) /*reverse order for two-side lighting*/ { glNormal3fv(leftNormal[k]); @@ -1458,7 +1458,7 @@ void OpenGLSurfaceEvaluator::inEvalVStrip(int n_left, REAL u_left, REAL* left_va glNormal3fv(rightNormal[j]); glVertex3fv(rightXYZ[j]); - /*find the last k>=i such that + /*find the last k>=i such that *leftverts[k][0] <= rightverts[j][0] */ k=i; @@ -1498,10 +1498,10 @@ void OpenGLSurfaceEvaluator::inEvalVStrip(int n_left, REAL u_left, REAL* left_va bgntfan(); glNormal3fv(leftNormal[i]); glVertex3fv(leftXYZ[i]); - + glNormal3fv(botMostNormal); glVertex3fv(botMostXYZ); - + /*find the last k>=j such that *rightverts[k][0] < leftverts[i][0] @@ -1526,10 +1526,10 @@ void OpenGLSurfaceEvaluator::inEvalVStrip(int n_left, REAL u_left, REAL* left_va botMostNormal = rightNormal[j-1]; botMostXYZ = rightXYZ[j-1]; - } + } } } - //clean up + //clean up free(leftXYZ); free(rightXYZ); free(leftNormal); @@ -1570,7 +1570,7 @@ void OpenGLSurfaceEvaluator::inMap2fEM(int which, int k, } REAL *data = temp_em->ctlPoints; - + temp_em->uprime = -1;//initilized temp_em->vprime = -1; @@ -1597,7 +1597,7 @@ void OpenGLSurfaceEvaluator::inMap2fEM(int which, int k, } } -void OpenGLSurfaceEvaluator::inDoDomain2WithDerivsEM(surfEvalMachine *em, REAL u, REAL v, +void OpenGLSurfaceEvaluator::inDoDomain2WithDerivsEM(surfEvalMachine *em, REAL u, REAL v, REAL *retPoint, REAL *retdu, REAL *retdv) { int j, row, col; @@ -1611,7 +1611,7 @@ void OpenGLSurfaceEvaluator::inDoDomain2WithDerivsEM(surfEvalMachine *em, REAL u return; the_uprime = (u - em->u1) / (em->u2 - em->u1); the_vprime = (v - em->v1) / (em->v2 - em->v1); - + /* Compute coefficients for values and derivs */ /* Use already cached values if possible */ @@ -1628,7 +1628,7 @@ void OpenGLSurfaceEvaluator::inDoDomain2WithDerivsEM(surfEvalMachine *em, REAL u data=em->ctlPoints+j; retPoint[j] = retdu[j] = retdv[j] = 0.0; for (row = 0; row < em->uorder; row++) { - /* + /* ** Minor optimization. ** The col == 0 part of the loop is extracted so we don't ** have to initialize p and pdv to 0. @@ -1647,10 +1647,10 @@ void OpenGLSurfaceEvaluator::inDoDomain2WithDerivsEM(surfEvalMachine *em, REAL u retdu[j] += em->ucoeffDeriv[row] * p; retdv[j] += em->ucoeff[row] * pdv; } - } -} + } +} -void OpenGLSurfaceEvaluator::inDoDomain2EM(surfEvalMachine *em, REAL u, REAL v, +void OpenGLSurfaceEvaluator::inDoDomain2EM(surfEvalMachine *em, REAL u, REAL v, REAL *retPoint) { int j, row, col; @@ -1663,7 +1663,7 @@ void OpenGLSurfaceEvaluator::inDoDomain2EM(surfEvalMachine *em, REAL u, REAL v, return; the_uprime = (u - em->u1) / (em->u2 - em->u1); the_vprime = (v - em->v1) / (em->v2 - em->v1); - + /* Compute coefficients for values and derivs */ /* Use already cached values if possible */ @@ -1680,7 +1680,7 @@ void OpenGLSurfaceEvaluator::inDoDomain2EM(surfEvalMachine *em, REAL u, REAL v, data=em->ctlPoints+j; retPoint[j] = 0.0; for (row = 0; row < em->uorder; row++) { - /* + /* ** Minor optimization. ** The col == 0 part of the loop is extracted so we don't ** have to initialize p and pdv to 0. @@ -1695,8 +1695,8 @@ void OpenGLSurfaceEvaluator::inDoDomain2EM(surfEvalMachine *em, REAL u, REAL v, /* Use p, pdv value to incrementally add up r, du, dv */ retPoint[j] += em->ucoeff[row] * p; } - } -} + } +} void OpenGLSurfaceEvaluator::inDoEvalCoord2EM(REAL u, REAL v) @@ -1721,7 +1721,7 @@ void OpenGLSurfaceEvaluator::inDoEvalCoord2EM(REAL u, REAL v) { inDoDomain2EM(&em_normal, u,v, temp_normal); normalCallBack(temp_normal, userData); - + if(vertex_flag) { inDoDomain2EM(&em_vertex, u,v,temp_vertex); @@ -1729,10 +1729,10 @@ void OpenGLSurfaceEvaluator::inDoEvalCoord2EM(REAL u, REAL v) { temp_vertex[0] /= temp_vertex[3]; temp_vertex[1] /= temp_vertex[3]; - temp_vertex[2] /= temp_vertex[3]; + temp_vertex[2] /= temp_vertex[3]; } temp_vertex[3]=u; - temp_vertex[4]=v; + temp_vertex[4]=v; vertexCallBack(temp_vertex, userData); } } @@ -1740,7 +1740,7 @@ void OpenGLSurfaceEvaluator::inDoEvalCoord2EM(REAL u, REAL v) { REAL du[4]; REAL dv[4]; - + /*compute homegeneous point and partial derivatives*/ inDoDomain2WithDerivsEM(&em_vertex, u,v,temp_vertex,du,dv); @@ -1750,7 +1750,7 @@ void OpenGLSurfaceEvaluator::inDoEvalCoord2EM(REAL u, REAL v) #ifdef AVOID_ZERO_NORMAL if(myabs(dv[0]) <= MYZERO && myabs(dv[1]) <= MYZERO && myabs(dv[2]) <= MYZERO) { - + REAL tempdu[4]; REAL tempdata[4]; REAL u1 = em_vertex.u1; @@ -1762,7 +1762,7 @@ void OpenGLSurfaceEvaluator::inDoEvalCoord2EM(REAL u, REAL v) inDoDomain2WithDerivsEM(&em_vertex,u,v, tempdata, tempdu, dv); if(em_vertex.k ==4) - inComputeFirstPartials(temp_vertex, du, dv); + inComputeFirstPartials(temp_vertex, du, dv); } else if(myabs(du[0]) <= MYZERO && myabs(du[1]) <= MYZERO && myabs(du[2]) <= MYZERO) { @@ -1802,7 +1802,7 @@ void OpenGLSurfaceEvaluator::inDoEvalCoord2EM(REAL u, REAL v) temp_vertex[3] = u; temp_vertex[4] = v; vertexCallBack(temp_vertex, userData); - + }/*end if auto_normal*/ else //no normal map, and no normal callback function { @@ -1813,7 +1813,7 @@ void OpenGLSurfaceEvaluator::inDoEvalCoord2EM(REAL u, REAL v) { temp_vertex[0] /= temp_vertex[3]; temp_vertex[1] /= temp_vertex[3]; - temp_vertex[2] /= temp_vertex[3]; + temp_vertex[2] /= temp_vertex[3]; } temp_vertex[3] = u; temp_vertex[4] = v; @@ -1955,8 +1955,8 @@ void OpenGLSurfaceEvaluator::inBPMEvalEM(bezierPatchMesh* bpm) 0 ); } - k+= 2*bpm->length_array[i]; - + k+= 2*bpm->length_array[i]; + #else //undef USE_LOD #ifdef CRACK_TEST @@ -2042,7 +2042,7 @@ return; #endif //GENERIC_TEST inDoEvalCoord2EM(u,v); - + #endif //USE_LOD k += 2; diff --git a/src/glu/sgi/libnurbs/internals/arc.cc b/src/glu/sgi/libnurbs/internals/arc.cc index cd4c404..da041c3 100644 --- a/src/glu/sgi/libnurbs/internals/arc.cc +++ b/src/glu/sgi/libnurbs/internals/arc.cc @@ -97,7 +97,7 @@ void Arc::markverts( void ) { Arc_ptr jarc = this; - + do { TrimVertex *p = jarc->pwlArc->pts; for( int i=0; ipwlArc->npts; i++ ) @@ -277,7 +277,7 @@ Arc::check( void ) return 0; } if( jarc->tail()[0] != jarc->prev->rhead()[0] ) { - + #ifndef NDEBUG _glu_dprintf( "checkjarc: geometric linkage screwed up 2\n"); jarc->prev->show(); diff --git a/src/glu/sgi/libnurbs/internals/arc.h b/src/glu/sgi/libnurbs/internals/arc.h index ca397f3..ec163ba 100644 --- a/src/glu/sgi/libnurbs/internals/arc.h +++ b/src/glu/sgi/libnurbs/internals/arc.h @@ -45,9 +45,9 @@ class Bin; class Arc; -struct BezierArc; +struct BezierArc; -typedef class Arc *Arc_ptr; +typedef class Arc *Arc_ptr; enum arc_side { arc_none = 0, arc_right, arc_top, arc_left, arc_bottom }; diff --git a/src/glu/sgi/libnurbs/internals/arcsorter.cc b/src/glu/sgi/libnurbs/internals/arcsorter.cc index 1f85cb7..53ea9ca 100644 --- a/src/glu/sgi/libnurbs/internals/arcsorter.cc +++ b/src/glu/sgi/libnurbs/internals/arcsorter.cc @@ -62,17 +62,17 @@ ArcSorter::qsort( Arc **a, int n ) Sorter::qsort( (void *) a, n ); } -void -ArcSorter::qsexc( char *i, char *j )// i<-j, j<-i +void +ArcSorter::qsexc( char *i, char *j )// i<-j, j<-i { Arc **jarc1 = (Arc **) i; Arc **jarc2 = (Arc **) j; Arc *tmp = *jarc1; *jarc1 = *jarc2; *jarc2 = tmp; -} +} -void +void ArcSorter::qstexc( char *i, char *j, char *k )// i<-k, k<-j, j<-i { Arc **jarc1 = (Arc **) i; @@ -83,7 +83,7 @@ ArcSorter::qstexc( char *i, char *j, char *k )// i<-k, k<-j, j<-i *jarc3 = *jarc2; *jarc2 = tmp; } - + ArcSdirSorter::ArcSdirSorter( Subdivider &s ) : ArcSorter(s) { @@ -119,7 +119,7 @@ ArcSdirSorter::qscmp( char *i, char *j ) return subdivider.ccwTurn_sr( jarc1, jarc2 ) ? 1 : -1; } } - } + } } ArcTdirSorter::ArcTdirSorter( Subdivider &s ) : ArcSorter(s) @@ -127,11 +127,11 @@ ArcTdirSorter::ArcTdirSorter( Subdivider &s ) : ArcSorter(s) } /*---------------------------------------------------------------------------- - * ArcTdirSorter::qscmp - - * compare two axis monotone arcs that are incident + * ArcTdirSorter::qscmp - + * compare two axis monotone arcs that are incident * to the line T == compare_value. Determine which of the * two intersects that line with a LESSER S value. If - * jarc1 does, return 1. If jarc2 does, return -1. + * jarc1 does, return 1. If jarc2 does, return -1. *---------------------------------------------------------------------------- */ int @@ -145,7 +145,7 @@ ArcTdirSorter::qscmp( char *i, char *j ) REAL diff = jarc1->pwlArc->pts[v1].param[0] - jarc2->pwlArc->pts[v2].param[0]; - + if( diff < 0.0) return 1; else if( diff > 0.0) diff --git a/src/glu/sgi/libnurbs/internals/arcsorter.h b/src/glu/sgi/libnurbs/internals/arcsorter.h index a55df92..60770ab 100644 --- a/src/glu/sgi/libnurbs/internals/arcsorter.h +++ b/src/glu/sgi/libnurbs/internals/arcsorter.h @@ -49,8 +49,8 @@ class ArcSorter : private Sorter { virtual int qscmp( char *, char * ); Subdivider& subdivider; private: - void qsexc( char *i, char *j ); // i<-j, j<-i - void qstexc( char *i, char *j, char *k ); // i<-k, k<-j, j<-i + void qsexc( char *i, char *j ); // i<-j, j<-i + void qstexc( char *i, char *j, char *k ); // i<-k, k<-j, j<-i }; diff --git a/src/glu/sgi/libnurbs/internals/arctess.cc b/src/glu/sgi/libnurbs/internals/arctess.cc index 29e7cf4..1af6de4 100644 --- a/src/glu/sgi/libnurbs/internals/arctess.cc +++ b/src/glu/sgi/libnurbs/internals/arctess.cc @@ -56,7 +56,7 @@ *----------------------------------------------------------------------------- */ -ArcTessellator::ArcTessellator( TrimVertexPool& t, Pool& p ) +ArcTessellator::ArcTessellator( TrimVertexPool& t, Pool& p ) : pwlarcpool(p), trimvertexpool(t) { } @@ -104,7 +104,7 @@ ArcTessellator::bezier( Arc *arc, REAL s1, REAL s2, REAL t1, REAL t2 ) break; } #endif - + TrimVertex *p = trimvertexpool.get(2); arc->pwlArc = new(pwlarcpool) PwlArc( 2, p ); p[0].param[0] = s1; @@ -283,7 +283,7 @@ ArcTessellator::tessellateLinear( Arc *arc, REAL geo_stepsize, REAL arc_stepsize //we don't need to scale by arc_stepsize if the trim curve //is piecewise linear. Reason: In pwl_right, pwl_left, pwl_top, pwl_left, - //and pwl, the nsteps is computed by deltaU (or V) /stepsize. + //and pwl, the nsteps is computed by deltaU (or V) /stepsize. //The quantity deltaU/arc_stepsize doesn't have any meaning. And //it causes problems: see bug 517641 REAL stepsize = geo_stepsize; /* * arc_stepsize*/; @@ -307,7 +307,7 @@ ArcTessellator::tessellateLinear( Arc *arc, REAL geo_stepsize, REAL arc_stepsize else pwl_left( arc, s1, t1, t2, stepsize ); else if( t1 == t2 ) - if( s1 < s2 ) + if( s1 < s2 ) pwl_bottom( arc, t1, s1, s2, stepsize ); else pwl_top( arc, t1, s1, s2, stepsize ); @@ -329,7 +329,7 @@ ArcTessellator::tessellateNonlinear( Arc *arc, REAL geo_stepsize, REAL arc_steps BezierArc *bezierArc = arc->bezierArc; - REAL size; //bounding box size of the curve in UV + REAL size; //bounding box size of the curve in UV { int i,j; REAL min_u, min_v, max_u,max_v; @@ -342,16 +342,16 @@ ArcTessellator::tessellateNonlinear( Arc *arc, REAL geo_stepsize, REAL arc_steps if(bezierArc->cpts[j] > max_u) max_u = bezierArc->cpts[j]; if(bezierArc->cpts[j+1] < min_v) - min_v = bezierArc->cpts[j+1]; + min_v = bezierArc->cpts[j+1]; if(bezierArc->cpts[j+1] > max_v) - max_v = bezierArc->cpts[j+1]; + max_v = bezierArc->cpts[j+1]; } size = max_u - min_u; if(size < max_v - min_v) size = max_v - min_v; } - + /*int nsteps = 1 + (int) (1.0/stepsize);*/ int nsteps = (int) (size/stepsize); @@ -421,7 +421,7 @@ ArcTessellator::tessellateNonlinear( Arc *arc, REAL geo_stepsize, REAL arc_steps ods = ds; odt = dt; } -#endif +#endif } /* compute last point exactly */ @@ -482,7 +482,7 @@ ArcTessellator::tessellateNonlinear( Arc *arc, REAL geo_stepsize, REAL arc_steps ods = ds; odt = dt; } -#endif +#endif } /* compute last point exactly */ @@ -604,7 +604,7 @@ ArcTessellator::trim_power_coeffs( BezierArc *bez_arc, REAL *p, int coord ) register REAL s = 0.0; register REAL *point = base; register REAL const *mlast = *row + order; - for( REAL const *m = *row; m != mlast; m++, point += stride ) + for( REAL const *m = *row; m != mlast; m++, point += stride ) s += *(m) * (*point); *(p++) = s; } diff --git a/src/glu/sgi/libnurbs/internals/backend.cc b/src/glu/sgi/libnurbs/internals/backend.cc index 27b41eb..45f4f1f 100644 --- a/src/glu/sgi/libnurbs/internals/backend.cc +++ b/src/glu/sgi/libnurbs/internals/backend.cc @@ -68,7 +68,7 @@ Backend::bgnsurf( int wiretris, int wirequads, long nuid ) * GLU_OUTLINE_PATCH. *In fact, GLU_FLL is has the same effect as * set GL_FRONT_AND_BACK to be GL_FILL - * and GLU_OUTLINE_POLY is the same as set + * and GLU_OUTLINE_POLY is the same as set * GL_FRONT_AND_BACK to be GL_LINE *It is more efficient to do this once at the beginning of *each surface than to do it for each primitive. @@ -101,7 +101,7 @@ Backend::surfbbox( long type, REAL *from, REAL *to ) * surfpts - pass a desription of a surface map *------------------------------------------------------------------------- */ -void +void Backend::surfpts( long type, /* geometry, color, texture, normal */ REAL *pts, /* control points */ @@ -186,7 +186,7 @@ Backend::bgntfan( void ) { surfaceEvaluator.bgntfan(); /* - if(wireframetris) + if(wireframetris) surfaceEvaluator.polymode( N_MESHLINE ); else surfaceEvaluator.polymode( N_MESHFILL ); @@ -207,7 +207,7 @@ Backend::bgnqstrip( void ) if(wireframequads) surfaceEvaluator.polymode( N_MESHLINE ); else - surfaceEvaluator.polymode( N_MESHFILL ); + surfaceEvaluator.polymode( N_MESHFILL ); */ } @@ -222,12 +222,12 @@ Backend::evalUStrip(int n_upper, REAL v_upper, REAL* upper_val, int n_lower, REAL v_lower, REAL* lower_val ) { - surfaceEvaluator.evalUStrip(n_upper, v_upper, upper_val, + surfaceEvaluator.evalUStrip(n_upper, v_upper, upper_val, n_lower, v_lower, lower_val); } -void -Backend::evalVStrip(int n_left, REAL u_left, REAL* left_val, +void +Backend::evalVStrip(int n_left, REAL u_left, REAL* left_val, int n_right, REAL u_right, REAL* right_val ) { @@ -236,14 +236,14 @@ Backend::evalVStrip(int n_left, REAL u_left, REAL* left_val, } /***************************************/ - + /*------------------------------------------------------------------------- * bgntmesh - preamble to a triangle mesh *------------------------------------------------------------------------- */ void -Backend::bgntmesh( const char * ) +Backend::bgntmesh( const char * ) { #ifndef NOWIREFRAME @@ -280,7 +280,7 @@ Backend::tmeshvertNOGE(TrimVertex *t) { // surfaceEvaluator.inDoEvalCoord2NOGE( t->param[0], t->param[1], temp, ttt); #ifdef USE_OPTTT - surfaceEvaluator.inDoEvalCoord2NOGE( t->param[0], t->param[1], t->cache_point, t->cache_normal); + surfaceEvaluator.inDoEvalCoord2NOGE( t->param[0], t->param[1], t->cache_point, t->cache_normal); #endif } @@ -289,7 +289,7 @@ void Backend::tmeshvertNOGE_BU(TrimVertex *t) { #ifdef USE_OPTTT - surfaceEvaluator.inDoEvalCoord2NOGE_BU( t->param[0], t->param[1], t->cache_point, t->cache_normal); + surfaceEvaluator.inDoEvalCoord2NOGE_BU( t->param[0], t->param[1], t->cache_point, t->cache_normal); #endif } @@ -298,7 +298,7 @@ void Backend::tmeshvertNOGE_BV(TrimVertex *t) { #ifdef USE_OPTTT - surfaceEvaluator.inDoEvalCoord2NOGE_BV( t->param[0], t->param[1], t->cache_point, t->cache_normal); + surfaceEvaluator.inDoEvalCoord2NOGE_BV( t->param[0], t->param[1], t->cache_point, t->cache_normal); #endif } @@ -308,7 +308,7 @@ Backend::preEvaluateBU(REAL u) surfaceEvaluator.inPreEvaluateBU_intfac(u); } -void +void Backend::preEvaluateBV(REAL v) { surfaceEvaluator.inPreEvaluateBV_intfac(v); @@ -354,7 +354,7 @@ Backend::tmeshvert( TrimVertex *t ) surfaceEvaluator.evalcoord2f( nuid, u, v ); } #else - + surfaceEvaluator.evalcoord2f( 0, u, v ); //for uninitial memory read surfaceEvaluator.evalcoord2f( nuid, u, v ); #endif @@ -366,7 +366,7 @@ Backend::tmeshvert( REAL u, REAL v ) { #ifndef NOWIREFRAME const long nuid = 0; - + npts++; if( wireframetris ) { if( npts >= 3 ) { @@ -391,7 +391,7 @@ Backend::tmeshvert( REAL u, REAL v ) surfaceEvaluator.evalcoord2f( nuid, u, v ); } #else - + surfaceEvaluator.evalcoord2f( 0, u, v ); #endif } @@ -510,7 +510,7 @@ Backend::endoutline( void ) } /*------------------------------------------------------------------------- - * triangle - output a triangle + * triangle - output a triangle *------------------------------------------------------------------------- */ void @@ -525,7 +525,7 @@ Backend::triangle( TrimVertex *a, TrimVertex *b, TrimVertex *c ) /* endtmesh();*/ } -void +void Backend::bgncurv( void ) { curveEvaluator.bgnmap1f( 0 ); @@ -535,10 +535,10 @@ void Backend::segment( REAL ulo, REAL uhi ) { curveEvaluator.domain1f( ulo, uhi ); -} +} -void -Backend::curvpts( +void +Backend::curvpts( long type, /* geometry, color, texture, normal */ REAL *pts, /* control points */ long stride, /* distance to next point */ @@ -551,37 +551,37 @@ Backend::curvpts( curveEvaluator.enable( type ); } -void +void Backend::curvgrid( REAL u0, REAL u1, long nu ) { curveEvaluator.mapgrid1f( nu, u0, u1 ); } -void +void Backend::curvmesh( long from, long n ) { curveEvaluator.mapmesh1f( N_MESHFILL, from, from+n ); } -void +void Backend::curvpt(REAL u) { curveEvaluator.evalcoord1f( 0, u ); } -void -Backend::bgnline( void ) +void +Backend::bgnline( void ) { curveEvaluator.bgnline(); } -void +void Backend::endline( void ) { curveEvaluator.endline(); } -void +void Backend::endcurv( void ) { curveEvaluator.endmap1f(); diff --git a/src/glu/sgi/libnurbs/internals/backend.h b/src/glu/sgi/libnurbs/internals/backend.h index 6840cb1..305ce26 100644 --- a/src/glu/sgi/libnurbs/internals/backend.h +++ b/src/glu/sgi/libnurbs/internals/backend.h @@ -57,8 +57,8 @@ class Backend { void surfpts( long, REAL *, long, long, int, int, REAL, REAL, REAL, REAL ); void surfbbox( long, REAL *, REAL * ); - void surfgrid( REAL, REAL, long, REAL, REAL, long ); - void surfmesh( long, long, long, long ); + void surfgrid( REAL, REAL, long, REAL, REAL, long ); + void surfmesh( long, long, long, long ); void bgntmesh( const char * ); void endtmesh( void ); void swaptmesh( void ); @@ -77,10 +77,10 @@ class Backend { void endtfan(); void bgnqstrip(); void endqstrip(); - void evalUStrip(int n_upper, REAL v_upper, REAL* upper_val, + void evalUStrip(int n_upper, REAL v_upper, REAL* upper_val, int n_lower, REAL v_lower, REAL* lower_val ); - void evalVStrip(int n_left, REAL u_left, REAL* left_val, + void evalVStrip(int n_left, REAL u_left, REAL* left_val, int n_right, REAL v_right, REAL* right_val ); void tmeshvertNOGE(TrimVertex *t); @@ -88,7 +88,7 @@ class Backend { void tmeshvertNOGE_BV(TrimVertex *t); void preEvaluateBU(REAL u); void preEvaluateBV(REAL v); - + /* curve backend routines */ void bgncurv( void ); @@ -96,7 +96,7 @@ class Backend { void curvpts( long, REAL *, long, int, REAL, REAL ); void curvgrid( REAL, REAL, long ); void curvmesh( long, long ); - void curvpt( REAL ); + void curvpt( REAL ); void bgnline( void ); void endline( void ); void endcurv( void ); diff --git a/src/glu/sgi/libnurbs/internals/basicsurfeval.h b/src/glu/sgi/libnurbs/internals/basicsurfeval.h index 8fe18a6..db834ff 100644 --- a/src/glu/sgi/libnurbs/internals/basicsurfeval.h +++ b/src/glu/sgi/libnurbs/internals/basicsurfeval.h @@ -49,8 +49,8 @@ class BasicSurfaceEvaluator : public CachingEvaluator { virtual void enable( long ); virtual void disable( long ); virtual void bgnmap2f( long ); - virtual void map2f( long, REAL, REAL, long, long, - REAL, REAL, long, long, + virtual void map2f( long, REAL, REAL, long, long, + REAL, REAL, long, long, REAL * ); virtual void mapgrid2f( long, REAL, REAL, long, REAL, REAL ); virtual void mapmesh2f( long, long, long, long, long ); @@ -84,7 +84,7 @@ class BasicSurfaceEvaluator : public CachingEvaluator { virtual void inDoEvalCoord2NOGE_BV(REAL u, REAL v, REAL* ret_point, REAL* ret_normal) = 0; virtual void inPreEvaluateBV_intfac(REAL v ) = 0; virtual void inPreEvaluateBU_intfac(REAL u ) = 0; - + }; #endif /* __glubasicsurfeval_h_ */ diff --git a/src/glu/sgi/libnurbs/internals/bin.cc b/src/glu/sgi/libnurbs/internals/bin.cc index ff75b86..b7ed27e 100644 --- a/src/glu/sgi/libnurbs/internals/bin.cc +++ b/src/glu/sgi/libnurbs/internals/bin.cc @@ -62,7 +62,7 @@ Bin::~Bin() *---------------------------------------------------------------------------- */ -void +void Bin::remove_this_arc( Arc_ptr arc ) { Arc_ptr *j; @@ -94,7 +94,7 @@ Bin::numarcs() *---------------------------------------------------------------------------- */ -void +void Bin::adopt() { markall(); @@ -135,7 +135,7 @@ Bin::show( char *name ) *---------------------------------------------------------------------------- */ -void +void Bin::markall() { for( Arc_ptr jarc=firstarc(); jarc; jarc=nextarc() ) @@ -147,12 +147,12 @@ Bin::markall() *---------------------------------------------------------------------------- */ -void +void Bin::listBezier( void ) { for( Arc_ptr jarc=firstarc(); jarc; jarc=nextarc() ) { if( jarc->isbezier( ) ) { - assert( jarc->pwlArc->npts == 2 ); + assert( jarc->pwlArc->npts == 2 ); #ifndef NDEBUG TrimVertex *pts = jarc->pwlArc->pts; REAL s1 = pts[0].param[0]; diff --git a/src/glu/sgi/libnurbs/internals/bin.h b/src/glu/sgi/libnurbs/internals/bin.h index 2f976eb..1b7f727 100644 --- a/src/glu/sgi/libnurbs/internals/bin.h +++ b/src/glu/sgi/libnurbs/internals/bin.h @@ -40,7 +40,7 @@ #include "arc.h" #include "defines.h" -class Bin +class Bin { /* a linked list of jordan arcs */ private: Arc_ptr head;/*first arc on list */ diff --git a/src/glu/sgi/libnurbs/internals/bufpool.cc b/src/glu/sgi/libnurbs/internals/bufpool.cc index 53ac1a5..3a8744b 100644 --- a/src/glu/sgi/libnurbs/internals/bufpool.cc +++ b/src/glu/sgi/libnurbs/internals/bufpool.cc @@ -92,11 +92,11 @@ void Pool::grow( void ) } /*----------------------------------------------------------------------------- - * Pool::clear - free buffers associated with pool but keep pool + * Pool::clear - free buffers associated with pool but keep pool *----------------------------------------------------------------------------- */ -void +void Pool::clear( void ) { assert( (this != 0) && (magic == is_allocated) ); diff --git a/src/glu/sgi/libnurbs/internals/bufpool.h b/src/glu/sgi/libnurbs/internals/bufpool.h index 0fa9433..0065632 100644 --- a/src/glu/sgi/libnurbs/internals/bufpool.h +++ b/src/glu/sgi/libnurbs/internals/bufpool.h @@ -54,7 +54,7 @@ class Pool { inline void* new_buffer( void ); inline void free_buffer( void * ); void clear( void ); - + private: void grow( void ); @@ -94,7 +94,7 @@ Pool::free_buffer( void *b ) *----------------------------------------------------------------------------- */ -inline void * +inline void * Pool::new_buffer( void ) { void *buffer; @@ -104,7 +104,7 @@ Pool::new_buffer( void ) /* find free buffer */ if( freelist ) { - buffer = (void *) freelist; + buffer = (void *) freelist; freelist = freelist->next; } else { if( ! nextfree ) @@ -114,7 +114,7 @@ Pool::new_buffer( void ) } return buffer; } - + class PooledObj { public: inline void * operator new( size_t, Pool & ); diff --git a/src/glu/sgi/libnurbs/internals/cachingeval.cc b/src/glu/sgi/libnurbs/internals/cachingeval.cc index 3fab38c..283219f 100644 --- a/src/glu/sgi/libnurbs/internals/cachingeval.cc +++ b/src/glu/sgi/libnurbs/internals/cachingeval.cc @@ -65,7 +65,7 @@ CachingEvaluator::beginOutput( ServiceMode, int ) void CachingEvaluator::endOutput( void ) { -} +} void CachingEvaluator::discardRecording( int ) diff --git a/src/glu/sgi/libnurbs/internals/cachingeval.h b/src/glu/sgi/libnurbs/internals/cachingeval.h index b390067..7ff1e33 100644 --- a/src/glu/sgi/libnurbs/internals/cachingeval.h +++ b/src/glu/sgi/libnurbs/internals/cachingeval.h @@ -44,7 +44,7 @@ class CachingEvaluator { virtual int canPlayAndRecord( void ); virtual int createHandle( int handle ); virtual void beginOutput( ServiceMode, int handle ); - virtual void endOutput( void ); + virtual void endOutput( void ); virtual void discardRecording( int handle ); virtual void playRecording( int handle ); }; diff --git a/src/glu/sgi/libnurbs/internals/ccw.cc b/src/glu/sgi/libnurbs/internals/ccw.cc index eb01b77..127b54b 100644 --- a/src/glu/sgi/libnurbs/internals/ccw.cc +++ b/src/glu/sgi/libnurbs/internals/ccw.cc @@ -46,11 +46,11 @@ #include "trimvertex.h" #include "simplemath.h" -inline int +inline int Subdivider::bbox( TrimVertex *a, TrimVertex *b, TrimVertex *c, int p ) { - return bbox( a->param[p], b->param[p], c->param[p], - a->param[1-p], b->param[1-p], c->param[1-p] ); + return bbox( a->param[p], b->param[p], c->param[p], + a->param[1-p], b->param[1-p], c->param[1-p] ); } int @@ -124,7 +124,7 @@ Subdivider::ccwTurn_sr( Arc_ptr j1, Arc_ptr j2 ) // dir = 1 return 1; case 0: sgn = ccw( v1next, v1, v2next ); - if( sgn != -1 ) { + if( sgn != -1 ) { return sgn; } else { #ifdef DEBUG @@ -188,7 +188,7 @@ Subdivider::ccwTurn_sl( Arc_ptr j1, Arc_ptr j2 ) // dir = 0 if( v1->param[0] == v1next->param[0] && v2->param[0] == v2next->param[0] ) return 0; - if( v2next->param[0] > v2->param[0] || v1next->param[0] > v1->param[0] ) + if( v2next->param[0] > v2->param[0] || v1next->param[0] > v1->param[0] ) ::mylongjmp( jumpbuffer, 28 ); if( v1->param[1] < v2->param[1] ) @@ -208,7 +208,7 @@ Subdivider::ccwTurn_sl( Arc_ptr j1, Arc_ptr j2 ) // dir = 0 return 1; case 0: sgn = ccw( v1next, v2, v2next ); - if( sgn != -1 ) + if( sgn != -1 ) return sgn; else { v1 = v1next--; @@ -237,7 +237,7 @@ Subdivider::ccwTurn_sl( Arc_ptr j1, Arc_ptr j2 ) // dir = 0 return 0; case 0: sgn = ccw( v1next, v1, v2next ); - if( sgn != -1 ) + if( sgn != -1 ) return sgn; else { v2 = v2next++; @@ -350,7 +350,7 @@ Subdivider::ccwTurn_tr( Arc_ptr j1, Arc_ptr j2 ) // dir = 1 return 0; case 0: sgn = ccw( v1next, v1, v2next ); - if( sgn != -1 ) { + if( sgn != -1 ) { return sgn; } else { #ifdef DEBUG @@ -414,7 +414,7 @@ Subdivider::ccwTurn_tl( Arc_ptr j1, Arc_ptr j2 ) if( v1->param[1] == v1next->param[1] && v2->param[1] == v2next->param[1] ) return 0; - if( v2next->param[1] > v2->param[1] || v1next->param[1] > v1->param[1] ) + if( v2next->param[1] > v2->param[1] || v1next->param[1] > v1->param[1] ) ::mylongjmp( jumpbuffer, 28 ); if( v1->param[0] < v2->param[0] ) @@ -434,7 +434,7 @@ Subdivider::ccwTurn_tl( Arc_ptr j1, Arc_ptr j2 ) return 0; case 0: sgn = ccw( v1next, v2, v2next ); - if( sgn != -1 ) + if( sgn != -1 ) return sgn; else { v1 = v1next--; @@ -463,7 +463,7 @@ Subdivider::ccwTurn_tl( Arc_ptr j1, Arc_ptr j2 ) return 1; case 0: sgn = ccw( v1next, v1, v2next ); - if( sgn != -1 ) + if( sgn != -1 ) return sgn; else { v2 = v2next++; @@ -550,9 +550,9 @@ Subdivider::bbox( register REAL sa, register REAL sb, register REAL sc, /*---------------------------------------------------------------------------- * ccw - determine how three points are oriented by computing their - * determinant. - * Return 1 if the vertices are ccw oriented, - * 0 if they are cw oriented, or + * determinant. + * Return 1 if the vertices are ccw oriented, + * 0 if they are cw oriented, or * -1 if the computation is ill-conditioned. *---------------------------------------------------------------------------- */ diff --git a/src/glu/sgi/libnurbs/internals/coveandtiler.cc b/src/glu/sgi/libnurbs/internals/coveandtiler.cc index ca5bf36..d756ad6 100644 --- a/src/glu/sgi/libnurbs/internals/coveandtiler.cc +++ b/src/glu/sgi/libnurbs/internals/coveandtiler.cc @@ -384,7 +384,7 @@ CoveAndTiler::coveLowerRight( void ) GridVertex gv( bot.uend, top.vindex ); right.last(); - backend.bgntmesh( "coveLowerRight" ); + backend.bgntmesh( "coveLowerRight" ); output( bgv ); output( right.prev() ); output( gv ); diff --git a/src/glu/sgi/libnurbs/internals/curve.cc b/src/glu/sgi/libnurbs/internals/curve.cc index b7c4d4a..bf48853 100644 --- a/src/glu/sgi/libnurbs/internals/curve.cc +++ b/src/glu/sgi/libnurbs/internals/curve.cc @@ -67,14 +67,14 @@ Curve::Curve( Quilt_ptr geo, REAL pta, REAL ptb, Curve *c ) stepsize = 0; minstepsize = 0; - REAL *ps = geo->cpts; + REAL *ps = geo->cpts; Quiltspec_ptr qs = geo->qspec; ps += qs->offset; ps += qs->index * qs->order * qs->stride; if( needsSampling ) mapdesc->xformSampling( ps, qs->order, qs->stride, spts, stride ); - + if( cullval == CULL_ACCEPT ) mapdesc->xformCulling( ps, qs->order, qs->stride, cpts, stride ); @@ -114,7 +114,7 @@ Curve::Curve( Curve& upper, REAL value, Curve *c ) if( needsSampling ) mapdesc->subdivide( upper.spts, lower.spts, d, upper.stride, upper.order ); - if( cullval == CULL_ACCEPT ) + if( cullval == CULL_ACCEPT ) mapdesc->subdivide( upper.cpts, lower.cpts, d, upper.stride, upper.order ); lower.range[0] = upper.range[0]; @@ -160,11 +160,11 @@ Curve::getstepsize( void ) // upper bound on path length between sample points assert( order <= MAXORDER ); - + /* points have been transformed, therefore they are homogeneous */ REAL tmp[MAXORDER][MAXCOORDS]; const int tstride = sizeof(tmp[0]) / sizeof(REAL); - int val = mapdesc->project( spts, stride, &tmp[0][0], tstride, order ); + int val = mapdesc->project( spts, stride, &tmp[0][0], tstride, order ); if( val == 0 ) { // control points cross infinity, therefore derivatives are undefined @@ -197,7 +197,7 @@ Curve::needsSamplingSubdivision( void ) int Curve::cullCheck( void ) { - if( cullval == CULL_ACCEPT ) + if( cullval == CULL_ACCEPT ) cullval = mapdesc->cullCheck( cpts, order, stride ); return cullval; } diff --git a/src/glu/sgi/libnurbs/internals/curvelist.cc b/src/glu/sgi/libnurbs/internals/curvelist.cc index 8f2ee46..5f3525c 100644 --- a/src/glu/sgi/libnurbs/internals/curvelist.cc +++ b/src/glu/sgi/libnurbs/internals/curvelist.cc @@ -48,7 +48,7 @@ Curvelist::Curvelist( Quilt *quilts, REAL pta, REAL ptb ) { curve = 0; - for( Quilt *q = quilts; q; q = q->next ) + for( Quilt *q = quilts; q; q = q->next ) curve = new Curve( q, pta, ptb, curve ); range[0] = pta; range[1] = ptb; diff --git a/src/glu/sgi/libnurbs/internals/curvelist.h b/src/glu/sgi/libnurbs/internals/curvelist.h index 733a511..a5d20d4 100644 --- a/src/glu/sgi/libnurbs/internals/curvelist.h +++ b/src/glu/sgi/libnurbs/internals/curvelist.h @@ -43,7 +43,7 @@ class Mapdesc; class Quilt; class Curve; -class Curvelist +class Curvelist { friend class Subdivider; public: diff --git a/src/glu/sgi/libnurbs/internals/curvesub.cc b/src/glu/sgi/libnurbs/internals/curvesub.cc index 91f2ca8..26d56a5 100644 --- a/src/glu/sgi/libnurbs/internals/curvesub.cc +++ b/src/glu/sgi/libnurbs/internals/curvesub.cc @@ -77,7 +77,7 @@ Subdivider::drawCurves( void ) /*-------------------------------------------------------------------------- - * samplingSplit - recursively subdivide patch, cull check each subpatch + * samplingSplit - recursively subdivide patch, cull check each subpatch *-------------------------------------------------------------------------- */ diff --git a/src/glu/sgi/libnurbs/internals/dataTransform.cc b/src/glu/sgi/libnurbs/internals/dataTransform.cc index 55c0fbb..98b3681 100644 --- a/src/glu/sgi/libnurbs/internals/dataTransform.cc +++ b/src/glu/sgi/libnurbs/internals/dataTransform.cc @@ -6,21 +6,21 @@ ** this file except in compliance with the License. You may obtain a copy ** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600 ** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at: -** +** ** http://oss.sgi.com/projects/FreeB -** +** ** Note that, as provided in the License, the Software is distributed on an ** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS ** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND ** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A ** PARTICULAR PURPOSE, AND NON-INFRINGEMENT. -** +** ** Original Code. The Original Code is: OpenGL Sample Implementation, ** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, ** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. ** Copyright in any portions created by third parties is as indicated ** elsewhere herein. All Rights Reserved. -** +** ** Additional Notice Provisions: The application programming interfaces ** established by SGI in conjunction with the Original Code are The ** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released @@ -56,7 +56,7 @@ static directedLine* copy_loop(Arc_ptr loop, Real2* vertArray, int& index, direc { vertArray[i][0] = loop->pwlArc->pts[j].param[0]; vertArray[i][1] = loop->pwlArc->pts[j].param[1]; - } + } loop->clearmark(); for(Arc_ptr jarc = loop->next; jarc != loop; jarc=jarc->next) @@ -70,7 +70,7 @@ static directedLine* copy_loop(Arc_ptr loop, Real2* vertArray, int& index, direc } //copy the first vertex again vertArray[i][0] = loop->pwlArc->pts[0].param[0]; - vertArray[i][1] = loop->pwlArc->pts[0].param[1]; + vertArray[i][1] = loop->pwlArc->pts[0].param[1]; i++; index=i; @@ -175,7 +175,7 @@ directedLine* o_pwlcurve_to_DLines(directedLine* original, O_pwlcurve* pwl) else ret->insert(dline); } - return ret; + return ret; } directedLine* o_curve_to_DLineLoop(O_curve* cur) diff --git a/src/glu/sgi/libnurbs/internals/defines.h b/src/glu/sgi/libnurbs/internals/defines.h index 32950d6..a0982b4 100644 --- a/src/glu/sgi/libnurbs/internals/defines.h +++ b/src/glu/sgi/libnurbs/internals/defines.h @@ -41,7 +41,7 @@ #define CULL_TRIVIAL_ACCEPT 1 #define CULL_ACCEPT 2 -/* maximum order of a B-Spline */ +/* maximum order of a B-Spline */ #define MAXORDER 24 /* maximum dimension of any B-spline range space */ diff --git a/src/glu/sgi/libnurbs/internals/displaylist.cc b/src/glu/sgi/libnurbs/internals/displaylist.cc index 48593c6..7aae2b4 100644 --- a/src/glu/sgi/libnurbs/internals/displaylist.cc +++ b/src/glu/sgi/libnurbs/internals/displaylist.cc @@ -50,7 +50,7 @@ DisplayList::DisplayList( NurbsTessellator *_nt ) : nt = _nt; } -DisplayList::~DisplayList( void ) +DisplayList::~DisplayList( void ) { for( Dlnode *nextNode; nodes; nodes = nextNode ) { nextNode = nodes->next; @@ -59,20 +59,20 @@ DisplayList::~DisplayList( void ) } } -void +void DisplayList::play( void ) { - for( Dlnode *node = nodes; node; node = node->next ) + for( Dlnode *node = nodes; node; node = node->next ) if( node->work != 0 ) (nt->*node->work)( node->arg ); } -void +void DisplayList::endList( void ) { *lastNode = 0; } -void +void DisplayList::append( PFVS work, void *arg, PFVS cleanup ) { Dlnode *node = new(dlnodePool) Dlnode( work, arg, cleanup ); diff --git a/src/glu/sgi/libnurbs/internals/displaylist.h b/src/glu/sgi/libnurbs/internals/displaylist.h index d009a42..1cdeae5 100644 --- a/src/glu/sgi/libnurbs/internals/displaylist.h +++ b/src/glu/sgi/libnurbs/internals/displaylist.h @@ -54,7 +54,7 @@ struct Dlnode : public PooledObj { }; inline -Dlnode::Dlnode( PFVS _work, void *_arg, PFVS _cleanup ) +Dlnode::Dlnode( PFVS _work, void *_arg, PFVS _cleanup ) { work = _work; arg = _arg; diff --git a/src/glu/sgi/libnurbs/internals/flist.cc b/src/glu/sgi/libnurbs/internals/flist.cc index d3162b9..425d4bb 100644 --- a/src/glu/sgi/libnurbs/internals/flist.cc +++ b/src/glu/sgi/libnurbs/internals/flist.cc @@ -79,7 +79,7 @@ void Flist::filter( void ) start = 0; int j = 0; - for( int i = 1; i < end; i++ ) { + for( int i = 1; i < end; i++ ) { if( pts[i] == pts[i-j-1] ) j++; pts[i-j] = pts[i]; @@ -95,7 +95,7 @@ void Flist::grow( int maxpts ) { if( npts < maxpts ) { if( npts ) delete[] pts; - npts = 2 * maxpts; + npts = 2 * maxpts; pts = new REAL[npts]; assert( pts != 0 ); } diff --git a/src/glu/sgi/libnurbs/internals/flistsorter.h b/src/glu/sgi/libnurbs/internals/flistsorter.h index 65e6a57..2627c7a 100644 --- a/src/glu/sgi/libnurbs/internals/flistsorter.h +++ b/src/glu/sgi/libnurbs/internals/flistsorter.h @@ -45,9 +45,9 @@ class FlistSorter : public Sorter { virtual ~FlistSorter() { /* silence warning*/ } void qsort( REAL *a, int n ); -protected: +protected: virtual int qscmp( char *, char * ); - virtual void qsexc( char *i, char *j ); // i<-j, j<-i - virtual void qstexc( char *i, char *j, char *k ); // i<-k, k<-j, j<-i + virtual void qsexc( char *i, char *j ); // i<-j, j<-i + virtual void qstexc( char *i, char *j, char *k ); // i<-k, k<-j, j<-i }; #endif /* __gluflistsorter_h_ */ diff --git a/src/glu/sgi/libnurbs/internals/gridtrimvertex.h b/src/glu/sgi/libnurbs/internals/gridtrimvertex.h index 707f649..9ee717a 100644 --- a/src/glu/sgi/libnurbs/internals/gridtrimvertex.h +++ b/src/glu/sgi/libnurbs/internals/gridtrimvertex.h @@ -50,7 +50,7 @@ class GridTrimVertex : public PooledObj GridTrimVertex() { g = 0; t = 0; } TrimVertex *t; GridVertex *g; - + inline void set( long, long ); inline void set( REAL, REAL ); inline void set( TrimVertex * ); diff --git a/src/glu/sgi/libnurbs/internals/hull.cc b/src/glu/sgi/libnurbs/internals/hull.cc index 389ba66..f839568 100644 --- a/src/glu/sgi/libnurbs/internals/hull.cc +++ b/src/glu/sgi/libnurbs/internals/hull.cc @@ -105,7 +105,7 @@ Hull::init( void ) /*---------------------------------------------------------------------- * nextupper - find next vertex on upper hull of trim region. - * - if vertex is on trim curve, set vtop point to + * - if vertex is on trim curve, set vtop point to * that vertex. if vertex is on grid, set vtop to * point to temporary area and stuff coordinants into * temporary vertex. Also, place grid coords in temporary @@ -119,23 +119,23 @@ Hull::nextupper( GridTrimVertex *gv ) gv->set( upper.left->prev() ); if( gv->isTrimVert() ) return gv; upper.left = 0; - } + } if( upper.line ) { assert( upper.index <= upper.line->uend ); gv->set( uarray.uarray[upper.index], upper.line->vval ); gv->set( upper.index, upper.line->vindex ); if( upper.index++ == upper.line->uend ) upper.line = 0; - return gv; - } + return gv; + } if( upper.right ) { gv->set( upper.right->next() ); if( gv->isTrimVert() ) return gv; upper.right = 0; - } + } - return 0; + return 0; } GridTrimVertex * @@ -145,20 +145,20 @@ Hull::nextlower( register GridTrimVertex *gv ) gv->set( lower.left->next() ); if( gv->isTrimVert() ) return gv; lower.left = 0; - } + } if( lower.line ) { gv->set( uarray.uarray[lower.index], lower.line->vval ); gv->set( lower.index, lower.line->vindex ); if( lower.index++ == lower.line->uend ) lower.line = 0; return gv; - } + } if( lower.right ) { gv->set( lower.right->prev() ); if( gv->isTrimVert() ) return gv; lower.right = 0; - } + } return 0; } diff --git a/src/glu/sgi/libnurbs/internals/hull.h b/src/glu/sgi/libnurbs/internals/hull.h index dfe8652..738c6bd 100644 --- a/src/glu/sgi/libnurbs/internals/hull.h +++ b/src/glu/sgi/libnurbs/internals/hull.h @@ -58,7 +58,7 @@ class Hull : virtual public TrimRegion { Trimline *right; long index; }; - + Side lower; Side upper; Trimline fakeleft; diff --git a/src/glu/sgi/libnurbs/internals/intersect.cc b/src/glu/sgi/libnurbs/internals/intersect.cc index b39ea21..bce2667 100644 --- a/src/glu/sgi/libnurbs/internals/intersect.cc +++ b/src/glu/sgi/libnurbs/internals/intersect.cc @@ -58,7 +58,7 @@ static enum i_result pwlarc_intersect( PwlArc *, int, REAL, int, int[3] ); void -Subdivider::partition( Bin & bin, Bin & left, Bin & intersections, +Subdivider::partition( Bin & bin, Bin & left, Bin & intersections, Bin & right, Bin & unknown, int param, REAL value ) { Bin headonleft, headonright, tailonleft, tailonright; @@ -153,7 +153,7 @@ Subdivider::partition( Bin & bin, Bin & left, Bin & intersections, } } -inline static void +inline static void vert_interp( TrimVertex *n, TrimVertex *l, TrimVertex *r, int p, REAL val ) { assert( val > l->param[p]); @@ -164,13 +164,13 @@ vert_interp( TrimVertex *n, TrimVertex *l, TrimVertex *r, int p, REAL val ) n->param[p] = val; if( l->param[1-p] != r->param[1-p] ) { REAL ratio = (val - l->param[p]) / (r->param[p] - l->param[p]); - n->param[1-p] = l->param[1-p] + + n->param[1-p] = l->param[1-p] + ratio * (r->param[1-p] - l->param[1-p]); } else { n->param[1-p] = l->param[1-p]; } } - + int Subdivider::arc_split( Arc_ptr jarc, int param, REAL value, int dir ) { @@ -210,13 +210,13 @@ Subdivider::arc_split( Arc_ptr jarc, int param, REAL value, int dir ) #ifndef NOTDEF // The split is between vertices at index j and i, in that // order (j < i) - + // JEB: This code is my idea of how to do the split without // increasing the number of links. I'm doing this so that // the is_rect routine can recognize rectangles created by // subdivision. In exchange for simplifying the curve list, // however, it costs in allocated space and vertex copies. - + TrimVertex *newjunk = trimvertexpool.get(maxvertex -i+1 /*-j*/); int k; for(k=0; knuid; } - + TrimVertex *vcopy = trimvertexpool.get(maxvertex); for(k=0; knuid; v[j].nuid = jarc->nuid; @@ -300,7 +300,7 @@ Subdivider::arc_split( Arc_ptr jarc, int param, REAL value, int dir ) // New vertex adjacent to starting point of arc } else if (i == 1) { jarc1 = new(arcpool) Arc( jarc, new(pwlarcpool) PwlArc( 2, newjunk+1 ) ); - jarc2 = new(arcpool) Arc( jarc, + jarc2 = new(arcpool) Arc( jarc, new(pwlarcpool) PwlArc( maxvertex-1, &jarc->pwlArc->pts[1] ) ); jarc->pwlArc->npts = 2; jarc->pwlArc->pts = newjunk; @@ -354,10 +354,10 @@ pwlarc_intersect( if( dir ) { TrimVertex *v = pwlArc->pts; - int imin = 0; + int imin = 0; int imax = pwlArc->npts - 1; assert( value > v[imin].param[param] ); - assert( value < v[imax].param[param] ); + assert( value < v[imax].param[param] ); while( (imax - imin) > 1 ) { int imid = (imax + imin)/2; if( v[imid].param[param] > value ) @@ -374,10 +374,10 @@ pwlarc_intersect( return INTERSECT_EDGE; } else { TrimVertex *v = pwlArc->pts; - int imax = 0; + int imax = 0; int imin = pwlArc->npts - 1; assert( value > v[imin].param[param] ); - assert( value < v[imax].param[param] ); + assert( value < v[imax].param[param] ); while( (imin - imax) > 1 ) { int imid = (imax + imin)/2; if( v[imid].param[param] > value ) @@ -396,7 +396,7 @@ pwlarc_intersect( } /*---------------------------------------------------------------------------- - * arc_classify - determine which side of a line a jarc lies + * arc_classify - determine which side of a line a jarc lies *---------------------------------------------------------------------------- */ @@ -460,7 +460,7 @@ Subdivider::classify_tailonleft_s( Bin& bin, Bin& in, Bin& out, REAL val ) else in.addarc( j ); } else { - if( j->next->tail()[1] > j->next->head()[1] ) + if( j->next->tail()[1] > j->next->head()[1] ) in.addarc(j); else out.addarc(j); @@ -559,7 +559,7 @@ Subdivider::classify_tailonright_s( Bin& bin, Bin& in, Bin& out, REAL val ) while( (j = bin.removearc()) != NULL ) { assert( arc_classify( j, 0, val ) == 0x12); - + j->clearitail(); REAL diff = j->next->head()[0] - val; @@ -571,7 +571,7 @@ Subdivider::classify_tailonright_s( Bin& bin, Bin& in, Bin& out, REAL val ) } else if( diff < 0.0 ) { in.addarc( j ); } else { - if( j->next->tail()[1] > j->next->head()[1] ) + if( j->next->tail()[1] > j->next->head()[1] ) out.addarc( j ); else in.addarc( j ); @@ -587,7 +587,7 @@ Subdivider::classify_tailonright_t( Bin& bin, Bin& in, Bin& out, REAL val ) while( (j = bin.removearc()) != NULL ) { assert( arc_classify( j, 1, val ) == 0x12); - + j->clearitail(); REAL diff = j->next->head()[1] - val; @@ -596,10 +596,10 @@ Subdivider::classify_tailonright_t( Bin& bin, Bin& in, Bin& out, REAL val ) out.addarc( j ); else in.addarc( j ); - } else if( diff < 0.0 ) { + } else if( diff < 0.0 ) { in.addarc( j ); } else { - if( j->next->tail()[0] > j->next->head()[0] ) + if( j->next->tail()[0] > j->next->head()[0] ) in.addarc( j ); else out.addarc( j ); @@ -615,11 +615,11 @@ Subdivider::classify_headonright_s( Bin& bin, Bin& in, Bin& out, REAL val ) while( (j = bin.removearc()) != NULL ) { assert( arc_classify( j, 0, val ) == 0x21 ); - + j->setitail(); REAL diff = j->prev->tail()[0] - val; - if( diff > 0.0 ) { + if( diff > 0.0 ) { if( ccwTurn_sr( j->prev, j ) ) out.addarc( j ); else @@ -643,11 +643,11 @@ Subdivider::classify_headonright_t( Bin& bin, Bin& in, Bin& out, REAL val ) while( (j = bin.removearc()) != NULL ) { assert( arc_classify( j, 1, val ) == 0x21 ); - + j->setitail(); REAL diff = j->prev->tail()[1] - val; - if( diff > 0.0 ) { + if( diff > 0.0 ) { if( ccwTurn_tr( j->prev, j ) ) out.addarc( j ); else diff --git a/src/glu/sgi/libnurbs/internals/jarcloc.h b/src/glu/sgi/libnurbs/internals/jarcloc.h index 5297036..168d3ef 100644 --- a/src/glu/sgi/libnurbs/internals/jarcloc.h +++ b/src/glu/sgi/libnurbs/internals/jarcloc.h @@ -71,7 +71,7 @@ Jarcloc::getnextpt() } return p++; } - + inline TrimVertex * Jarcloc::getprevpt() { diff --git a/src/glu/sgi/libnurbs/internals/knotvector.cc b/src/glu/sgi/libnurbs/internals/knotvector.cc index dcbf006..c0c4fdb 100644 --- a/src/glu/sgi/libnurbs/internals/knotvector.cc +++ b/src/glu/sgi/libnurbs/internals/knotvector.cc @@ -98,7 +98,7 @@ int Knotvector::validate( void ) // decreasing knot sequence return( 4 ); } - + /* check for valid multiplicity */ /* kindex is currently the index of the last knot. diff --git a/src/glu/sgi/libnurbs/internals/knotvector.h b/src/glu/sgi/libnurbs/internals/knotvector.h index 85b162f..a8b7e98 100644 --- a/src/glu/sgi/libnurbs/internals/knotvector.h +++ b/src/glu/sgi/libnurbs/internals/knotvector.h @@ -54,7 +54,7 @@ struct Knotvector { /* a knot vector */ /* tolerance to test knot coincidence */ #define TOLERANCE 1.0e-5 -inline int +inline int identical( Knot x, Knot y ) { return ((x-y) < TOLERANCE) ? 1 : 0; diff --git a/src/glu/sgi/libnurbs/internals/mapdesc.cc b/src/glu/sgi/libnurbs/internals/mapdesc.cc index d59f8fd..3c72353 100644 --- a/src/glu/sgi/libnurbs/internals/mapdesc.cc +++ b/src/glu/sgi/libnurbs/internals/mapdesc.cc @@ -47,7 +47,7 @@ #include "nurbsconsts.h" #include "mapdesc.h" -Mapdesc::Mapdesc( long _type, int _israt, int _ncoords, Backend& b ) +Mapdesc::Mapdesc( long _type, int _israt, int _ncoords, Backend& b ) : backend( b ) { type = _type; @@ -64,7 +64,7 @@ Mapdesc::Mapdesc( long _type, int _israt, int _ncoords, Backend& b ) pixel_tolerance = 1.0; error_tolerance = 1.0; bbox_subdividing = N_NOBBOXSUBDIVISION; - culling_method = N_NOCULLING; + culling_method = N_NOCULLING; sampling_method = N_NOSAMPLING; clampfactor = N_NOCLAMPING; minsavings = N_NOSAVINGSSUBDIVISION; @@ -101,7 +101,7 @@ Mapdesc::surfbbox( REAL bb[2][MAXCOORDS] ) backend.surfbbox( type, bb[0], bb[1] ); } -void +void Mapdesc::copy( REAL dest[MAXCOORDS][MAXCOORDS], long n, INREAL *src, long rstride, long cstride ) { @@ -120,25 +120,25 @@ Mapdesc::copyPt( REAL *d, REAL *s ) { assert( hcoords > 0 ); switch( hcoords ) { - case 4: + case 4: d[3] = s[3]; d[2] = s[2]; d[1] = s[1]; d[0] = s[0]; break; - case 3: + case 3: d[2] = s[2]; d[1] = s[1]; d[0] = s[0]; break; - case 2: + case 2: d[1] = s[1]; d[0] = s[0]; break; - case 1: + case 1: d[0] = s[0]; break; - case 5: + case 5: d[4] = s[4]; d[3] = s[3]; d[2] = s[2]; @@ -160,25 +160,25 @@ Mapdesc::sumPt( REAL *dst, REAL *src1, REAL *src2, register REAL alpha, register { assert( hcoords > 0 ); switch( hcoords ) { - case 4: + case 4: dst[3] = src1[3] * alpha + src2[3] * beta; dst[2] = src1[2] * alpha + src2[2] * beta; dst[1] = src1[1] * alpha + src2[1] * beta; dst[0] = src1[0] * alpha + src2[0] * beta; break; - case 3: + case 3: dst[2] = src1[2] * alpha + src2[2] * beta; dst[1] = src1[1] * alpha + src2[1] * beta; dst[0] = src1[0] * alpha + src2[0] * beta; break; - case 2: + case 2: dst[1] = src1[1] * alpha + src2[1] * beta; dst[0] = src1[0] * alpha + src2[0] * beta; break; - case 1: + case 1: dst[0] = src1[0] * alpha + src2[0] * beta; break; - case 5: + case 5: dst[4] = src1[4] * alpha + src2[4] * beta; dst[3] = src1[3] * alpha + src2[3] * beta; dst[2] = src1[2] * alpha + src2[2] * beta; @@ -234,16 +234,16 @@ Mapdesc::clipbits( REAL *p ) default: { int bit = 1; for( int i=0; i= nw ) bits |= bit; + if( p[i] >= nw ) bits |= bit; bit <<= 1; - if( p[i] <= pw ) bits |= bit; + if( p[i] <= pw ) bits |= bit; bit <<= 1; } abort(); break; } } - } else { + } else { switch( nc ) { case 3: if( p[2] <= nw ) bits |= (1<<5); @@ -264,11 +264,11 @@ Mapdesc::clipbits( REAL *p ) if( p[0] >= pw ) bits |= (1<<0); return bits; default: { - int bit = 1; + int bit = 1; for( int i=0; i= pw ) bits |= bit; + if( p[i] >= pw ) bits |= bit; bit <<= 1; - if( p[i] <= nw ) bits |= bit; + if( p[i] <= nw ) bits |= bit; bit <<= 1; } abort(); @@ -345,14 +345,14 @@ Mapdesc::xformNonrational( Maxmatrix mat, REAL *d, REAL *s ) } /*-------------------------------------------------------------------------- - * xformAndCullCheck - transform a set of points that may be EITHER + * xformAndCullCheck - transform a set of points that may be EITHER * homogeneous or inhomogeneous depending on the map description and - * check if they are either completely inside, completely outside, + * check if they are either completely inside, completely outside, * or intersecting the viewing frustrum. *-------------------------------------------------------------------------- */ int -Mapdesc::xformAndCullCheck( +Mapdesc::xformAndCullCheck( REAL *pts, int uorder, int ustride, int vorder, int vstride ) { assert( uorder > 0 ); @@ -371,7 +371,7 @@ Mapdesc::xformAndCullCheck( outbits |= bits; inbits &= bits; if( ( outbits == (unsigned int)mask ) && ( inbits != (unsigned int)mask ) ) return CULL_ACCEPT; - } + } } if( outbits != (unsigned int)mask ) { @@ -384,8 +384,8 @@ Mapdesc::xformAndCullCheck( } /*-------------------------------------------------------------------------- - * cullCheck - check if a set of homogeneous transformed points are - * either completely inside, completely outside, + * cullCheck - check if a set of homogeneous transformed points are + * either completely inside, completely outside, * or intersecting the viewing frustrum. *-------------------------------------------------------------------------- */ @@ -403,7 +403,7 @@ Mapdesc::cullCheck( REAL *pts, int uorder, int ustride, int vorder, int vstride outbits |= bits; inbits &= bits; if( ( outbits == (unsigned int)mask ) && ( inbits != (unsigned int)mask ) ) return CULL_ACCEPT; - } + } } if( outbits != (unsigned int)mask ) { @@ -416,8 +416,8 @@ Mapdesc::cullCheck( REAL *pts, int uorder, int ustride, int vorder, int vstride } /*-------------------------------------------------------------------------- - * cullCheck - check if a set of homogeneous transformed points are - * either completely inside, completely outside, + * cullCheck - check if a set of homogeneous transformed points are + * either completely inside, completely outside, * or intersecting the viewing frustrum. *-------------------------------------------------------------------------- */ @@ -445,9 +445,9 @@ Mapdesc::cullCheck( REAL *pts, int order, int stride ) } /*-------------------------------------------------------------------------- - * xformSampling - transform a set of points that may be EITHER - * homogeneous or inhomogeneous depending on the map description - * into sampling space + * xformSampling - transform a set of points that may be EITHER + * homogeneous or inhomogeneous depending on the map description + * into sampling space *-------------------------------------------------------------------------- */ void @@ -463,9 +463,9 @@ Mapdesc::xformBounding( REAL *pts, int order, int stride, REAL *sp, int outstrid } /*-------------------------------------------------------------------------- - * xformCulling - transform a set of points that may be EITHER - * homogeneous or inhomogeneous depending on the map description - * into culling space + * xformCulling - transform a set of points that may be EITHER + * homogeneous or inhomogeneous depending on the map description + * into culling space *-------------------------------------------------------------------------- */ void @@ -475,51 +475,51 @@ Mapdesc::xformCulling( REAL *pts, int order, int stride, REAL *cp, int outstride } /*-------------------------------------------------------------------------- - * xformCulling - transform a set of points that may be EITHER - * homogeneous or inhomogeneous depending on the map description - * into culling space + * xformCulling - transform a set of points that may be EITHER + * homogeneous or inhomogeneous depending on the map description + * into culling space *-------------------------------------------------------------------------- */ void -Mapdesc::xformCulling( REAL *pts, +Mapdesc::xformCulling( REAL *pts, int uorder, int ustride, - int vorder, int vstride, + int vorder, int vstride, REAL *cp, int outustride, int outvstride ) { xformMat( cmat, pts, uorder, ustride, vorder, vstride, cp, outustride, outvstride ); } /*-------------------------------------------------------------------------- - * xformSampling - transform a set of points that may be EITHER - * homogeneous or inhomogeneous depending on the map description - * into sampling space + * xformSampling - transform a set of points that may be EITHER + * homogeneous or inhomogeneous depending on the map description + * into sampling space *-------------------------------------------------------------------------- */ void -Mapdesc::xformSampling( REAL *pts, - int uorder, int ustride, - int vorder, int vstride, +Mapdesc::xformSampling( REAL *pts, + int uorder, int ustride, + int vorder, int vstride, REAL *sp, int outustride, int outvstride ) { xformMat( smat, pts, uorder, ustride, vorder, vstride, sp, outustride, outvstride ); } void -Mapdesc::xformBounding( REAL *pts, - int uorder, int ustride, - int vorder, int vstride, +Mapdesc::xformBounding( REAL *pts, + int uorder, int ustride, + int vorder, int vstride, REAL *sp, int outustride, int outvstride ) { xformMat( bmat, pts, uorder, ustride, vorder, vstride, sp, outustride, outvstride ); } void -Mapdesc::xformMat( - Maxmatrix mat, - REAL * pts, - int order, +Mapdesc::xformMat( + Maxmatrix mat, + REAL * pts, + int order, int stride, - REAL * cp, + REAL * cp, int outstride ) { if( isrational ) { @@ -527,20 +527,20 @@ Mapdesc::xformMat( for( REAL *p = pts ; p != pend; p += stride ) { xformRational( mat, cp, p ); cp += outstride; - } + } } else { REAL *pend = pts + order * stride; for( REAL *p = pts ; p != pend; p += stride ) { xformNonrational( mat, cp, p ); cp += outstride; - } + } } } void -Mapdesc::xformMat( Maxmatrix mat, REAL *pts, - int uorder, int ustride, - int vorder, int vstride, +Mapdesc::xformMat( Maxmatrix mat, REAL *pts, + int uorder, int ustride, + int vorder, int vstride, REAL *cp, int outustride, int outvstride ) { if( isrational ) { @@ -551,7 +551,7 @@ Mapdesc::xformMat( Maxmatrix mat, REAL *pts, for( REAL *q = p; q != qend; q += vstride ) { xformRational( mat, cpts2, q ); cpts2 += outvstride; - } + } cp += outustride; } } else { @@ -562,7 +562,7 @@ Mapdesc::xformMat( Maxmatrix mat, REAL *pts, for( REAL *q = p; q != qend; q += vstride ) { xformNonrational( mat, cpts2, q ); cpts2 += outvstride; - } + } cp += outustride; } } @@ -592,7 +592,7 @@ Mapdesc::subdivide( REAL *src, REAL *dst, REAL v, int stride, int order ) */ void -Mapdesc::subdivide( REAL *src, REAL *dst, REAL v, +Mapdesc::subdivide( REAL *src, REAL *dst, REAL v, int so, int ss, int to, int ts ) { REAL mv = 1.0 - v; @@ -617,7 +617,7 @@ Mapdesc::subdivide( REAL *src, REAL *dst, REAL v, *-------------------------------------------------------------------------- */ int -Mapdesc::project( REAL *src, int rstride, int cstride, +Mapdesc::project( REAL *src, int rstride, int cstride, REAL *dest, int trstride, int tcstride, int nrows, int ncols ) { @@ -652,7 +652,7 @@ Mapdesc::project( REAL *src, int stride, REAL *dest, int tstride, int ncols ) for( REAL *cptr = src, *tcptr = dest; cptr != clast; cptr+=stride, tcptr+=tstride ) { REAL *coordlast = cptr + inhcoords; if( sign( *coordlast ) != s ) return 0; - for( REAL *coord = cptr, *tcoord = tcptr; coord != coordlast; coord++, tcoord++ ) + for( REAL *coord = cptr, *tcoord = tcptr; coord != coordlast; coord++, tcoord++ ) *tcoord = *coord / *coordlast; } @@ -660,8 +660,8 @@ Mapdesc::project( REAL *src, int stride, REAL *dest, int tstride, int ncols ) } int -Mapdesc::bboxTooBig( - REAL *p, +Mapdesc::bboxTooBig( + REAL *p, int rstride, int cstride, int nrows, @@ -670,11 +670,11 @@ Mapdesc::bboxTooBig( { REAL bbpts[MAXORDER][MAXORDER][MAXCOORDS]; const int trstride = sizeof(bbpts[0]) / sizeof(REAL); - const int tcstride = sizeof(bbpts[0][0]) / sizeof(REAL); + const int tcstride = sizeof(bbpts[0][0]) / sizeof(REAL); // points have been transformed, therefore they are homogeneous // project points - int val = project( p, rstride, cstride, + int val = project( p, rstride, cstride, &bbpts[0][0][0], trstride, tcstride, nrows, ncols ); if( val == 0 ) return -1; @@ -689,13 +689,13 @@ Mapdesc::bboxTooBig( for( int k=0; k != inhcoords; k++ ) if( bb[1][k] - bb[0][k] > bboxsize[k] ) return 1; } - return 0; + return 0; } void -Mapdesc::bbox( - REAL bb[2][MAXCOORDS], - REAL *p, +Mapdesc::bbox( + REAL bb[2][MAXCOORDS], + REAL *p, int rstride, int cstride, int nrows, @@ -705,8 +705,8 @@ Mapdesc::bbox( for( k=0; k != inhcoords; k++ ) bb[0][k] = bb[1][k] = p[k]; - for( int i=0; i != nrows; i++ ) - for( int j=0; j != ncols; j++ ) + for( int i=0; i != nrows; i++ ) + for( int j=0; j != ncols; j++ ) for( k=0; k != inhcoords; k++ ) { REAL x = p[i*rstride + j*cstride + k]; if( x < bb[0][k] ) bb[0][k] = x; @@ -715,7 +715,7 @@ Mapdesc::bbox( } /*-------------------------------------------------------------------------- - * calcVelocityRational - calculate upper bound on first partial derivative + * calcVelocityRational - calculate upper bound on first partial derivative * of a homogeneous set of points and bounds on each row of points. *-------------------------------------------------------------------------- */ @@ -726,7 +726,7 @@ Mapdesc::calcVelocityRational( REAL *p, int stride, int ncols ) assert( ncols <= MAXORDER ); - const int tstride = sizeof(tmp[0]) / sizeof(REAL); + const int tstride = sizeof(tmp[0]) / sizeof(REAL); if( project( p, stride, &tmp[0][0], tstride, ncols ) ) { return calcPartialVelocity( &tmp[0][0], tstride, ncols, 1, 1.0 ); @@ -736,7 +736,7 @@ Mapdesc::calcVelocityRational( REAL *p, int stride, int ncols ) } /*-------------------------------------------------------------------------- - * calcVelocityNonrational - calculate upper bound on first partial + * calcVelocityNonrational - calculate upper bound on first partial * derivative of a inhomogeneous set of points. *-------------------------------------------------------------------------- */ diff --git a/src/glu/sgi/libnurbs/internals/mapdesc.h b/src/glu/sgi/libnurbs/internals/mapdesc.h index 6f06154..56a74dd 100644 --- a/src/glu/sgi/libnurbs/internals/mapdesc.h +++ b/src/glu/sgi/libnurbs/internals/mapdesc.h @@ -48,7 +48,7 @@ class Backend; class Mapdesc : public PooledObj { friend class Maplist; - + public: Mapdesc( long, int, int, Backend & ); int isProperty( long ); @@ -123,7 +123,7 @@ class Mapdesc : public PooledObj { Maxmatrix smat; REAL s_steps; /* max samples in s direction */ REAL t_steps; /* max samples in t direction */ - REAL sampling_method; + REAL sampling_method; REAL culling_method; /* check for culling */ REAL bbox_subdividing; Mapdesc * next; @@ -188,62 +188,62 @@ Mapdesc::xformSampling( REAL *d, REAL *s ) xformNonrational( smat, d, s ); } -inline int +inline int Mapdesc::isRational( void ) { return isrational ? 1 : 0; } -inline int -Mapdesc::getNcoords( void ) +inline int +Mapdesc::getNcoords( void ) { - return ncoords; + return ncoords; } -inline int -Mapdesc::isConstantSampling( void ) +inline int +Mapdesc::isConstantSampling( void ) { - return ((sampling_method == N_FIXEDRATE) ? 1 : 0); + return ((sampling_method == N_FIXEDRATE) ? 1 : 0); } -inline int -Mapdesc::isDomainSampling( void ) -{ - return ((sampling_method == N_DOMAINDISTANCE) ? 1 : 0); +inline int +Mapdesc::isDomainSampling( void ) +{ + return ((sampling_method == N_DOMAINDISTANCE) ? 1 : 0); } -inline int -Mapdesc::isParametricDistanceSampling( void ) +inline int +Mapdesc::isParametricDistanceSampling( void ) { return ((sampling_method == N_PARAMETRICDISTANCE) ? 1 : 0); } -inline int -Mapdesc::isObjectSpaceParaSampling( void ) +inline int +Mapdesc::isObjectSpaceParaSampling( void ) { return ((sampling_method == N_OBJECTSPACE_PARA) ? 1 : 0); } -inline int -Mapdesc::isObjectSpacePathSampling( void ) +inline int +Mapdesc::isObjectSpacePathSampling( void ) { return ((sampling_method == N_OBJECTSPACE_PATH) ? 1 : 0); } -inline int -Mapdesc::isSurfaceAreaSampling( void ) +inline int +Mapdesc::isSurfaceAreaSampling( void ) { return ((sampling_method == N_SURFACEAREA) ? 1 : 0); } -inline int -Mapdesc::isPathLengthSampling( void ) +inline int +Mapdesc::isPathLengthSampling( void ) { return ((sampling_method == N_PATHLENGTH) ? 1 : 0); } -inline int -Mapdesc::isRangeSampling( void ) +inline int +Mapdesc::isRangeSampling( void ) { return ( isParametricDistanceSampling() || isPathLengthSampling() || isSurfaceAreaSampling() || @@ -257,14 +257,14 @@ Mapdesc::isSampling( void ) return isRangeSampling() || isConstantSampling() || isDomainSampling(); } -inline int -Mapdesc::isCulling( void ) +inline int +Mapdesc::isCulling( void ) { return ((culling_method != N_NOCULLING) ? 1 : 0); } -inline int -Mapdesc::isBboxSubdividing( void ) +inline int +Mapdesc::isBboxSubdividing( void ) { return ((bbox_subdividing != N_NOBBOXSUBDIVISION) ? 1 : 0); } diff --git a/src/glu/sgi/libnurbs/internals/mapdescv.cc b/src/glu/sgi/libnurbs/internals/mapdescv.cc index 35b38b1..a37f1bd 100644 --- a/src/glu/sgi/libnurbs/internals/mapdescv.cc +++ b/src/glu/sgi/libnurbs/internals/mapdescv.cc @@ -65,13 +65,13 @@ Mapdesc::calcPartialVelocity ( int j, k, t; // copy inhomogeneous control points into temporary array - for( j=0; j != ncols; j++ ) + for( j=0; j != ncols; j++ ) for( k=0; k != inhcoords; k++ ) tmp[j][k] = p[j*stride + k]; - for( t=0; t != partial; t++ ) - for( j=0; j != ncols-t-1; j++ ) - for( k=0; k != inhcoords; k++ ) + for( t=0; t != partial; t++ ) + for( j=0; j != ncols-t-1; j++ ) + for( k=0; k != inhcoords; k++ ) tmp[j][k] = tmp[j+1][k] - tmp[j][k]; // compute magnitude and store in mag array @@ -84,7 +84,7 @@ Mapdesc::calcPartialVelocity ( // compute scale factor REAL fac = 1; REAL invt = 1.0 / range; - for( t = ncols-1; t != ncols-1-partial; t-- ) + for( t = ncols-1; t != ncols-1-partial; t-- ) fac *= t * invt; // compute max magnitude of all entries in array @@ -111,7 +111,7 @@ Mapdesc::calcPartialVelocity ( int ncols, int spartial, int tpartial, - REAL srange, + REAL srange, REAL trange, int side ) { @@ -155,7 +155,7 @@ Mapdesc::calcPartialVelocity ( qj += cstride; } ti += istride; - qi += rstride; + qi += rstride; } } @@ -177,7 +177,7 @@ Mapdesc::calcPartialVelocity ( for( ; tjl != tjll; tjl -= jstride ) for( REAL *tj = tp; tj != tjl; tj += jstride ) for( REAL *ti = tj, *til = ti + id; ti != til; ti += istride ) - for( int k=0; k != inhcoords; k++ ) + for( int k=0; k != inhcoords; k++ ) ti[k] = ti[k+jstride] - ti[k]; } @@ -202,9 +202,9 @@ Mapdesc::calcPartialVelocity ( { REAL invs = 1.0 / srange; REAL invt = 1.0 / trange; - for( int s = nrows-1, slast = s-spartial; s != slast; s-- ) + for( int s = nrows-1, slast = s-spartial; s != slast; s-- ) fac *= s * invs; - for( int t = ncols-1, tlast = t-tpartial; t != tlast; t-- ) + for( int t = ncols-1, tlast = t-tpartial; t != tlast; t-- ) fac *= t * invt; } @@ -215,7 +215,7 @@ Mapdesc::calcPartialVelocity ( for( i=0; i != nrows-spartial; i++ ) { j = 0; if( mag[i][j] > dist[0] ) dist[0] = mag[i][j]; - + j = ncols-tpartial-1; if( mag[i][j] > dist[1] ) dist[1] = mag[i][j]; } @@ -228,7 +228,7 @@ Mapdesc::calcPartialVelocity ( for( j=0; j != ncols-tpartial; j++ ) { i = 0; if( mag[i][j] > dist[0] ) dist[0] = mag[i][j]; - + i = nrows-spartial-1; if( mag[i][j] > dist[1] ) dist[1] = mag[i][j]; } diff --git a/src/glu/sgi/libnurbs/internals/maplist.cc b/src/glu/sgi/libnurbs/internals/maplist.cc index e51a3e8..485dd0c 100644 --- a/src/glu/sgi/libnurbs/internals/maplist.cc +++ b/src/glu/sgi/libnurbs/internals/maplist.cc @@ -44,7 +44,7 @@ #include "nurbsconsts.h" #include "maplist.h" #include "mapdesc.h" - + Maplist::Maplist( Backend& b ) : mapdescPool( sizeof( Mapdesc ), 10, "mapdesc pool" ), backend( b ) @@ -52,7 +52,7 @@ Maplist::Maplist( Backend& b ) maps = 0; lastmap = &maps; } -void +void Maplist::initialize( void ) { freeMaps(); @@ -60,14 +60,14 @@ Maplist::initialize( void ) define( N_P2DR, 1, 3 ); } -void +void Maplist::add( long type, int israt, int ncoords ) { *lastmap = new(mapdescPool) Mapdesc( type, israt, ncoords, backend ); lastmap = &((*lastmap)->next); } -void +void Maplist::define( long type, int israt, int ncoords ) { #ifndef NDEBUG // to avoid warning @@ -77,7 +77,7 @@ Maplist::define( long type, int israt, int ncoords ) add( type, israt, ncoords ); } -void +void Maplist::remove( Mapdesc *m ) { for( Mapdesc **curmap = &maps; *curmap; curmap = &((*curmap)->next) ) { @@ -98,7 +98,7 @@ Maplist::freeMaps( void ) lastmap = &maps; } -Mapdesc * +Mapdesc * Maplist::find( long type ) { Mapdesc *val = locate( type ); @@ -106,7 +106,7 @@ Maplist::find( long type ) return val; } -Mapdesc * +Mapdesc * Maplist::locate( long type ) { Mapdesc *m; diff --git a/src/glu/sgi/libnurbs/internals/maplist.h b/src/glu/sgi/libnurbs/internals/maplist.h index 49720e4..ddc9519 100644 --- a/src/glu/sgi/libnurbs/internals/maplist.h +++ b/src/glu/sgi/libnurbs/internals/maplist.h @@ -71,7 +71,7 @@ Maplist::isMap( long type ) return (locate( type ) ? 1 : 0); } -inline void +inline void Maplist::undefine( long type ) { Mapdesc *m = locate( type ); diff --git a/src/glu/sgi/libnurbs/internals/mesher.cc b/src/glu/sgi/libnurbs/internals/mesher.cc index b2d83f4..fea3f20 100644 --- a/src/glu/sgi/libnurbs/internals/mesher.cc +++ b/src/glu/sgi/libnurbs/internals/mesher.cc @@ -52,8 +52,8 @@ const float Mesher::ZERO = 0.0; -Mesher::Mesher( Backend& b ) - : backend( b ), +Mesher::Mesher( Backend& b ) + : backend( b ), p( sizeof( GridTrimVertex ), 100, "GridTrimVertexPool" ) { stacksize = 0; @@ -61,7 +61,7 @@ Mesher::Mesher( Backend& b ) last[0] = 0; last[1] = 0; itop = 0; - lastedge = 0; //needed to prevent purify UMR + lastedge = 0; //needed to prevent purify UMR } Mesher::~Mesher( void ) @@ -69,15 +69,15 @@ Mesher::~Mesher( void ) if( vdata ) delete[] vdata; } -void +void Mesher::init( unsigned int npts ) { p.clear(); if( stacksize < npts ) { stacksize = 2 * npts; - if( vdata ) delete[] vdata; + if( vdata ) delete[] vdata; vdata = new GridTrimVertex_p[stacksize]; - } + } } inline void @@ -120,9 +120,9 @@ Mesher::clearStack() void Mesher::finishLower( GridTrimVertex *gtlower ) { - for( push(gtlower); - nextlower( gtlower=new(p) GridTrimVertex ); - push(gtlower) ) + for( push(gtlower); + nextlower( gtlower=new(p) GridTrimVertex ); + push(gtlower) ) addLower(); addLast(); } @@ -130,9 +130,9 @@ Mesher::finishLower( GridTrimVertex *gtlower ) void Mesher::finishUpper( GridTrimVertex *gtupper ) { - for( push(gtupper); - nextupper( gtupper=new(p) GridTrimVertex ); - push(gtupper) ) + for( push(gtupper); + nextupper( gtupper=new(p) GridTrimVertex ); + push(gtupper) ) addUpper(); addLast(); } @@ -154,7 +154,7 @@ Mesher::mesh( void ) nextlower( gtlower ); assert( gtupper->t && gtlower->t ); - + if( gtupper->t->param[0] < gtlower->t->param[0] ) { push(gtupper); lastedge = 1; @@ -247,9 +247,9 @@ Mesher::copy( int x, int y ) { last[0] = vdata[x]; last[1] = vdata[y]; } - + inline void -Mesher::move( int x, int y ) +Mesher::move( int x, int y ) { vdata[x] = vdata[y]; } @@ -403,7 +403,7 @@ Mesher::addUpper( ) for( register int i=ilast-2; i>=itop-1; i-- ) { swapMesh(); output( i ); - } + } copy( ilast, itop-1 ); } //for( register int k=itop; k=1; i--) { if(isIncreasing) { isReflex = (area(queue[i-1], queue[i], v) <= 0.0); } else /*decreasing*/{ - isReflex = (area(v, queue[i], queue[i-1]) <= 0.0); + isReflex = (area(v, queue[i], queue[i-1]) <= 0.0); } if(isReflex) { break; @@ -109,10 +109,10 @@ void reflexChain::processNewVertex(Real v[2], Backend* backend) /* *if ibgntfan(); /* @@ -144,7 +144,7 @@ void reflexChain::processNewVertex(Real v[2], Backend* backend) backend->tmeshvert(queue[k][0], queue[k][1]); } } - + backend->endtfan(); } @@ -156,7 +156,7 @@ void reflexChain::processNewVertex(Real v[2], Backend* backend) } -void monoTriangulationRec(Real* topVertex, Real* botVertex, +void monoTriangulationRec(Real* topVertex, Real* botVertex, vertexArray* inc_chain, Int inc_current, vertexArray* dec_chain, Int dec_current, Backend* backend) @@ -175,7 +175,7 @@ void monoTriangulationRec(Real* topVertex, Real* botVertex, { dec_array = dec_chain->getArray(); - dec_nVertices = dec_chain->getNumElements(); + dec_nVertices = dec_chain->getNumElements(); reflexChain rChain(20,0); /*put the top vertex into the reflex chain*/ rChain.processNewVertex(topVertex, backend); @@ -207,7 +207,7 @@ void monoTriangulationRec(Real* topVertex, Real* botVertex, dec_array = dec_chain -> getArray(); inc_nVertices= inc_chain->getNumElements(); dec_nVertices= dec_chain->getNumElements(); - /*if top of inc_chain is 'lower' than top of dec_chain, process all the + /*if top of inc_chain is 'lower' than top of dec_chain, process all the *vertices on the dec_chain which are higher than top of inc_chain */ if(compV2InY(inc_array[inc_current], dec_array[dec_current]) <= 0) @@ -219,11 +219,11 @@ void monoTriangulationRec(Real* topVertex, Real* botVertex, { if(compV2InY(inc_array[inc_current], dec_array[i]) <= 0) rChain.processNewVertex(dec_array[i], backend); - else + else break; } rChain.outputFan(inc_array[inc_current], backend); - monoTriangulationRec(dec_array[i-1], botVertex, + monoTriangulationRec(dec_array[i-1], botVertex, inc_chain, inc_current, dec_chain, i, backend); @@ -235,13 +235,13 @@ void monoTriangulationRec(Real* topVertex, Real* botVertex, rChain.processNewVertex(topVertex, backend); for(i=inc_current; i0) - rChain.processNewVertex(inc_array[i], backend); + if(compV2InY(inc_array[i], dec_array[dec_current]) >0) + rChain.processNewVertex(inc_array[i], backend); else break; } rChain.outputFan(dec_array[dec_current], backend); - monoTriangulationRec(inc_array[i-1], botVertex, + monoTriangulationRec(inc_array[i-1], botVertex, inc_chain, i, dec_chain, dec_current, backend); @@ -281,7 +281,7 @@ void monoTriangulationFunBackend(Arc_ptr loop, Int (*compFun)(Real*, Real*), Bac inc_chain.appendVertex(tempV->pwlArc->pts[i].param); } } - + vertexArray dec_chain(20); for(tempV = topV->prev; tempV != botV; tempV = tempV->prev) { @@ -289,18 +289,18 @@ void monoTriangulationFunBackend(Arc_ptr loop, Int (*compFun)(Real*, Real*), Bac dec_chain.appendVertex(tempV->pwlArc->pts[i].param); } } - for(i=botV->pwlArc->npts-2; i>=1; i--){ + for(i=botV->pwlArc->npts-2; i>=1; i--){ dec_chain.appendVertex(tempV->pwlArc->pts[i].param); } - + monoTriangulationRecFunBackend(topV->tail(), botV->tail(), &inc_chain, 0, &dec_chain, 0, compFun, backend); -} +} /*if compFun == compV2InY, top to bottom: V-monotone *if compFun == compV2InX, right to left: U-monotone */ -void monoTriangulationRecFunBackend(Real* topVertex, Real* botVertex, +void monoTriangulationRecFunBackend(Real* topVertex, Real* botVertex, vertexArray* inc_chain, Int inc_current, vertexArray* dec_chain, Int dec_current, Int (*compFun)(Real*, Real*), @@ -320,7 +320,7 @@ void monoTriangulationRecFunBackend(Real* topVertex, Real* botVertex, { dec_array = dec_chain->getArray(); - dec_nVertices = dec_chain->getNumElements(); + dec_nVertices = dec_chain->getNumElements(); reflexChain rChain(20,0); /*put the top vertex into the reflex chain*/ rChain.processNewVertex(topVertex, backend); @@ -352,7 +352,7 @@ void monoTriangulationRecFunBackend(Real* topVertex, Real* botVertex, dec_array = dec_chain -> getArray(); inc_nVertices= inc_chain->getNumElements(); dec_nVertices= dec_chain->getNumElements(); - /*if top of inc_chain is 'lower' than top of dec_chain, process all the + /*if top of inc_chain is 'lower' than top of dec_chain, process all the *vertices on the dec_chain which are higher than top of inc_chain */ if(compFun(inc_array[inc_current], dec_array[dec_current]) <= 0) @@ -364,11 +364,11 @@ void monoTriangulationRecFunBackend(Real* topVertex, Real* botVertex, { if(compFun(inc_array[inc_current], dec_array[i]) <= 0) rChain.processNewVertex(dec_array[i], backend); - else + else break; } rChain.outputFan(inc_array[inc_current], backend); - monoTriangulationRecFunBackend(dec_array[i-1], botVertex, + monoTriangulationRecFunBackend(dec_array[i-1], botVertex, inc_chain, inc_current, dec_chain, i, compFun, @@ -381,13 +381,13 @@ void monoTriangulationRecFunBackend(Real* topVertex, Real* botVertex, rChain.processNewVertex(topVertex, backend); for(i=inc_current; i0) - rChain.processNewVertex(inc_array[i], backend); + if(compFun(inc_array[i], dec_array[dec_current]) >0) + rChain.processNewVertex(inc_array[i], backend); else break; } rChain.outputFan(dec_array[dec_current], backend); - monoTriangulationRecFunBackend(inc_array[i-1], botVertex, + monoTriangulationRecFunBackend(inc_array[i-1], botVertex, inc_chain, i, dec_chain, dec_current, compFun, diff --git a/src/glu/sgi/libnurbs/internals/monotonizer.cc b/src/glu/sgi/libnurbs/internals/monotonizer.cc index 5845d31..1ca8355 100644 --- a/src/glu/sgi/libnurbs/internals/monotonizer.cc +++ b/src/glu/sgi/libnurbs/internals/monotonizer.cc @@ -61,7 +61,7 @@ Subdivider::decompose( Bin& bin, REAL geo_stepsize ) /* points have not been transformed, therefore they may be either homogeneous or inhomogeneous */ tessellate( jarc, geo_stepsize ); - if( jarc->isDisconnected() || jarc->next->isDisconnected() ) + if( jarc->isDisconnected() || jarc->next->isDisconnected() ) return 1; } } @@ -87,15 +87,15 @@ Subdivider::tessellate( Arc_ptr jarc, REAL geo_stepsize ) if( mapdesc->isRational() ) { REAL max = mapdesc->calcVelocityRational( b->cpts, b->stride, b->order ); - REAL arc_stepsize = (max > 1.0) ? (1.0/max) : 1.0; + REAL arc_stepsize = (max > 1.0) ? (1.0/max) : 1.0; if( jarc->bezierArc->order != 2 ) arctessellator.tessellateNonlinear( jarc, geo_stepsize, arc_stepsize, 1 ); else { arctessellator.tessellateLinear( jarc, geo_stepsize, arc_stepsize, 1 ); } - } else { + } else { REAL max = mapdesc->calcVelocityNonrational( b->cpts, b->stride, b->order ); - REAL arc_stepsize = (max > 1.0) ? (1.0/max) : 1.0; + REAL arc_stepsize = (max > 1.0) ? (1.0/max) : 1.0; if( jarc->bezierArc->order != 2 ) arctessellator.tessellateNonlinear( jarc, geo_stepsize, arc_stepsize, 0 ); else { @@ -131,7 +131,7 @@ Subdivider::monotonize( Arc_ptr jarc, Bin& bin ) change = 0; /* check change relative to s axis, clear degenerate bit if needed */ - REAL sdiff = vert[1].param[0] - vert[0].param[0]; + REAL sdiff = vert[1].param[0] - vert[0].param[0]; if( sdiff == 0 ) { if( sdir != same ) { sdir = same; @@ -150,10 +150,10 @@ Subdivider::monotonize( Arc_ptr jarc, Bin& bin ) } nudegenerate = 0; } - + /* check change relative to t axis, clear degenerate bit if needed */ - REAL tdiff = vert[1].param[1] - vert[0].param[1]; - if( tdiff == 0 ) { + REAL tdiff = vert[1].param[1] - vert[0].param[1]; + if( tdiff == 0 ) { if( tdir != same ) { tdir = same; change = 1; @@ -171,7 +171,7 @@ Subdivider::monotonize( Arc_ptr jarc, Bin& bin ) } nudegenerate = 0; } - + if( change ) { if( ! degenerate ) { /* make last segment into separate pwl curve */ @@ -182,7 +182,7 @@ Subdivider::monotonize( Arc_ptr jarc, Bin& bin ) } firstvert = jarc->pwlArc->pts = vert; degenerate = nudegenerate; - } + } } jarc->pwlArc->npts = vert - firstvert + 1; @@ -199,7 +199,7 @@ Subdivider::monotonize( Arc_ptr jarc, Bin& bin ) jarc->pwlArc->deleteMe( pwlarcpool ); jarc->pwlArc = 0; jarc->deleteMe( arcpool ); - } + } } /*------------------------------------------------------------------------- @@ -218,16 +218,16 @@ Subdivider::isMonotone( Arc_ptr jarc ) enum dir sdir; enum dir tdir; - REAL diff = vert[1].param[0] - vert[0].param[0]; - if( diff == 0.0 ) + REAL diff = vert[1].param[0] - vert[0].param[0]; + if( diff == 0.0 ) sdir = same; else if( diff < 0.0 ) sdir = down; else sdir = up; - diff = vert[1].param[1] - vert[0].param[1]; - if( diff == 0.0 ) + diff = vert[1].param[1] - vert[0].param[1]; + if( diff == 0.0 ) tdir = same; else if( diff < 0.0 ) tdir = down; @@ -235,9 +235,9 @@ Subdivider::isMonotone( Arc_ptr jarc ) tdir = up; if( (sdir == same) && (tdir == same) ) return 0; - + for( ++vert ; vert != lastvert; vert++ ) { - diff = vert[1].param[0] - vert[0].param[0]; + diff = vert[1].param[0] - vert[0].param[0]; if( diff == 0.0 ) { if( sdir != same ) return 0; } else if( diff < 0.0 ) { @@ -246,7 +246,7 @@ Subdivider::isMonotone( Arc_ptr jarc ) if( sdir != up ) return 0; } - diff = vert[1].param[1] - vert[0].param[1]; + diff = vert[1].param[1] - vert[0].param[1]; if( diff == 0.0 ) { if( tdir != same ) return 0; } else if( diff < 0.0 ) { diff --git a/src/glu/sgi/libnurbs/internals/monotonizer.h b/src/glu/sgi/libnurbs/internals/monotonizer.h index e951084..197225f 100644 --- a/src/glu/sgi/libnurbs/internals/monotonizer.h +++ b/src/glu/sgi/libnurbs/internals/monotonizer.h @@ -57,7 +57,7 @@ class Monotonizer { void monotonize( Arc *, Bin & ); int isMonotone( Arc * ); public: - Monotonizer( ArcTessellator& at, Pool& ap, Pool& p, jmp_buf& j ) + Monotonizer( ArcTessellator& at, Pool& ap, Pool& p, jmp_buf& j ) : arctessellator(at), arcpool(ap), pwlarcpool(p), nurbsJmpBuf(j) {} int decompose( Bin &, REAL ); }; diff --git a/src/glu/sgi/libnurbs/internals/mycode.cc b/src/glu/sgi/libnurbs/internals/mycode.cc index 3625cac..e8ec199 100644 --- a/src/glu/sgi/libnurbs/internals/mycode.cc +++ b/src/glu/sgi/libnurbs/internals/mycode.cc @@ -6,21 +6,21 @@ ** this file except in compliance with the License. You may obtain a copy ** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600 ** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at: -** +** ** http://oss.sgi.com/projects/FreeB -** +** ** Note that, as provided in the License, the Software is distributed on an ** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS ** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND ** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A ** PARTICULAR PURPOSE, AND NON-INFRINGEMENT. -** +** ** Original Code. The Original Code is: OpenGL Sample Implementation, ** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, ** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. ** Copyright in any portions created by third parties is as indicated ** elsewhere herein. All Rights Reserved. -** +** ** Additional Notice Provisions: The application programming interfaces ** established by SGI in conjunction with the Original Code are The ** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released diff --git a/src/glu/sgi/libnurbs/internals/mymath.h b/src/glu/sgi/libnurbs/internals/mymath.h index 17ef723..8966d88 100644 --- a/src/glu/sgi/libnurbs/internals/mymath.h +++ b/src/glu/sgi/libnurbs/internals/mymath.h @@ -43,7 +43,7 @@ #if defined(GLBUILD) || defined(STANDALONE) #define M_SQRT2 1.41421356237309504880 #define ceilf myceilf -#define floorf myfloorf +#define floorf myfloorf #define sqrtf sqrt extern "C" double sqrt(double); extern "C" float ceilf(float); diff --git a/src/glu/sgi/libnurbs/internals/mysetjmp.h b/src/glu/sgi/libnurbs/internals/mysetjmp.h index 2a3f6a8..5703e53 100644 --- a/src/glu/sgi/libnurbs/internals/mysetjmp.h +++ b/src/glu/sgi/libnurbs/internals/mysetjmp.h @@ -70,7 +70,7 @@ deleteJumpbuffer(JumpBuffer *jb) } inline void -mylongjmp( JumpBuffer *j, int code ) +mylongjmp( JumpBuffer *j, int code ) { ::longjmp( j->buf, code ); } diff --git a/src/glu/sgi/libnurbs/internals/nurbsconsts.h b/src/glu/sgi/libnurbs/internals/nurbsconsts.h index acc5d7f..6a0b961 100644 --- a/src/glu/sgi/libnurbs/internals/nurbsconsts.h +++ b/src/glu/sgi/libnurbs/internals/nurbsconsts.h @@ -36,7 +36,7 @@ #ifndef __glunurbsconsts_h_ #define __glunurbsconsts_h_ -/* NURBS Properties - one set per map, +/* NURBS Properties - one set per map, each takes a single INREAL arg */ #define N_SAMPLING_TOLERANCE 1 #define N_S_RATE 6 @@ -46,7 +46,7 @@ #define N_MINSAVINGS 14 #define N_NOSAVINGSSUBDIVISION 0.0 -/* NURBS Properties - one set per map, +/* NURBS Properties - one set per map, each takes an enumerated value */ #define N_CULLING 2 #define N_NOCULLING 0.0 @@ -68,7 +68,7 @@ /* NURBS Rendering Properties - one set per renderer each takes an enumerated value */ #define N_DISPLAY 3 -#define N_FILL 1.0 +#define N_FILL 1.0 #define N_OUTLINE_POLY 2.0 #define N_OUTLINE_TRI 3.0 #define N_OUTLINE_QUAD 4.0 @@ -113,8 +113,8 @@ /* type argument for trimming curves */ #ifndef N_P2D -#define N_P2D 0x8 +#define N_P2D 0x8 #define N_P2DR 0xd -#endif +#endif #endif /* __glunurbsconsts_h_ */ diff --git a/src/glu/sgi/libnurbs/internals/nurbsinterfac.cc b/src/glu/sgi/libnurbs/internals/nurbsinterfac.cc index 520bd41..0cfe52a 100644 --- a/src/glu/sgi/libnurbs/internals/nurbsinterfac.cc +++ b/src/glu/sgi/libnurbs/internals/nurbsinterfac.cc @@ -63,7 +63,7 @@ work( );\ } -NurbsTessellator::NurbsTessellator( BasicCurveEvaluator &c, BasicSurfaceEvaluator& e) +NurbsTessellator::NurbsTessellator( BasicCurveEvaluator &c, BasicSurfaceEvaluator& e) : maplist( backend ), backend( c, e ), subdivider( renderhints, backend ), @@ -85,7 +85,7 @@ NurbsTessellator::NurbsTessellator( BasicCurveEvaluator &c, BasicSurfaceEvaluato subdivider.setJumpbuffer( jumpbuffer ); } -NurbsTessellator::~NurbsTessellator( void ) +NurbsTessellator::~NurbsTessellator( void ) { if( inTrim ) { do_nurbserror( 12 ); @@ -100,7 +100,7 @@ NurbsTessellator::~NurbsTessellator( void ) if (jumpbuffer) { deleteJumpbuffer(jumpbuffer); jumpbuffer= 0; - } + } } /*----------------------------------------------------------------------------- @@ -119,7 +119,7 @@ NurbsTessellator::bgnsurface( long nuid ) /*----------------------------------------------------------------------------- * bgncurve - allocate an initialize an o_curve structure - * + * * Client: GL user *----------------------------------------------------------------------------- */ @@ -132,7 +132,7 @@ NurbsTessellator::bgncurve( long nuid ) } /*----------------------------------------------------------------------------- * endcurve - - * + * * Client: *----------------------------------------------------------------------------- */ @@ -299,11 +299,11 @@ NurbsTessellator::nurbscurve( knots.init( nknots, byte_stride, order, knot ); if( do_check_knots( &knots, "curve" ) ) return; - + O_nurbscurve *o_nurbscurve = new(o_nurbscurvePool) O_nurbscurve(type); o_nurbscurve->bezier_curves = new(quiltPool) Quilt(mapdesc); o_nurbscurve->bezier_curves->toBezier( knots,ctlarray, mapdesc->getNcoords() ); - + THREAD( do_nurbscurve, o_nurbscurve, do_freenurbscurve ); } @@ -326,7 +326,7 @@ NurbsTessellator::nurbssurface( long sorder, /* order of the spline in s parameter */ long torder, /* order of the spline in t parameter */ long type) /* description of range space */ -{ +{ Mapdesc *mapdesc = maplist.locate( type ); if( mapdesc == 0 ) { @@ -359,14 +359,14 @@ NurbsTessellator::nurbssurface( o_nurbssurface->bezier_patches = new(quiltPool) Quilt(mapdesc); o_nurbssurface->bezier_patches->toBezier( sknotvector, tknotvector, - ctlarray, mapdesc->getNcoords() ); + ctlarray, mapdesc->getNcoords() ); THREAD( do_nurbssurface, o_nurbssurface, do_freenurbssurface ); } /*----------------------------------------------------------------------------- * setnurbsproperty - - * + * *----------------------------------------------------------------------------- */ void @@ -382,7 +382,7 @@ NurbsTessellator::setnurbsproperty( long tag, INREAL value ) /*----------------------------------------------------------------------------- * setnurbsproperty - - * + * *----------------------------------------------------------------------------- */ void @@ -406,8 +406,8 @@ NurbsTessellator::setnurbsproperty( long type, long tag, INREAL value ) /*----------------------------------------------------------------------------- - * getnurbsproperty - - * + * getnurbsproperty - + * *----------------------------------------------------------------------------- */ @@ -422,8 +422,8 @@ NurbsTessellator::getnurbsproperty( long tag, INREAL *value ) } /*----------------------------------------------------------------------------- - * getnurbsproperty - - * + * getnurbsproperty - + * *----------------------------------------------------------------------------- */ @@ -432,7 +432,7 @@ NurbsTessellator::getnurbsproperty( long type, long tag, INREAL *value ) { Mapdesc *mapdesc = maplist.locate( type ); - if( mapdesc == 0 ) + if( mapdesc == 0 ) do_nurbserror( 35 ); if( mapdesc->isProperty( tag ) ) { @@ -447,7 +447,7 @@ NurbsTessellator::getnurbsproperty( long type, long tag, INREAL *value ) *-------------------------------------------------------------------------- */ -void +void NurbsTessellator::setnurbsproperty( long type, long purpose, INREAL *mat ) { // XXX - cannot be put in display list @@ -470,8 +470,8 @@ NurbsTessellator::setnurbsproperty( long type, long purpose, INREAL *mat ) *-------------------------------------------------------------------------- */ -void -NurbsTessellator::setnurbsproperty( long type, long purpose, INREAL *mat, +void +NurbsTessellator::setnurbsproperty( long type, long purpose, INREAL *mat, long rstride, long cstride ) { // XXX - cannot be put in display list @@ -493,39 +493,39 @@ NurbsTessellator::setnurbsproperty( long type, long purpose, INREAL *mat, } } -void +void NurbsTessellator::redefineMaps( void ) { maplist.initialize(); } -void +void NurbsTessellator::defineMap( long type, long rational, long ncoords ) { maplist.define( type, (int) rational, (int) ncoords ); } -void +void NurbsTessellator::discardRecording( void *_dl ) { delete (DisplayList *) _dl; } -void * +void * NurbsTessellator::beginRecording( void ) { dl = new DisplayList( this ); return (void *) dl; } -void +void NurbsTessellator::endRecording( void ) { dl->endList(); dl = 0; } -void +void NurbsTessellator::playRecording( void *_dl ) { playBack = 1; diff --git a/src/glu/sgi/libnurbs/internals/nurbstess.cc b/src/glu/sgi/libnurbs/internals/nurbstess.cc index 68dfd95..af40a9c 100644 --- a/src/glu/sgi/libnurbs/internals/nurbstess.cc +++ b/src/glu/sgi/libnurbs/internals/nurbstess.cc @@ -49,13 +49,13 @@ #include "mapdesc.h" #include "maplist.h" -void +void NurbsTessellator::set_domain_distance_u_rate(REAL u_rate) { subdivider.set_domain_distance_u_rate(u_rate); } -void +void NurbsTessellator::set_domain_distance_v_rate(REAL v_rate) { subdivider.set_domain_distance_v_rate(v_rate); @@ -106,7 +106,7 @@ NurbsTessellator::endrender( void ) } /*----------------------------------------------------------------------------- - * do_freebgnsurface - free o_surface structure + * do_freebgnsurface - free o_surface structure * * Client: do_freeall(), bgnsurface() *----------------------------------------------------------------------------- @@ -145,8 +145,8 @@ NurbsTessellator::do_bgnsurface( O_surface *o_surface ) } /*----------------------------------------------------------------------------- - * do_bgncurve - begin the display of a curve - * + * do_bgncurve - begin the display of a curve + * * Client: bgncurve() *----------------------------------------------------------------------------- */ @@ -178,11 +178,11 @@ NurbsTessellator::do_bgncurve( O_curve *o_curve ) /*----------------------------------------------------------------------------- * do_endcurve - - * + * * Client: endcurve() *----------------------------------------------------------------------------- */ - + void NurbsTessellator::do_endcurve( void ) { @@ -200,7 +200,7 @@ NurbsTessellator::do_endcurve( void ) if ( ! inTrim ) { if( ! isDataValid ) { - do_freecurveall( currentCurve ); + do_freecurveall( currentCurve ); return; } @@ -209,10 +209,10 @@ NurbsTessellator::do_endcurve( void ) if( errval == 0 ) { if( currentCurve->curvetype == ct_nurbscurve ) { subdivider.beginQuilts(); - for( O_nurbscurve *n = currentCurve->curve.o_nurbscurve; n != 0; n = n->next ) + for( O_nurbscurve *n = currentCurve->curve.o_nurbscurve; n != 0; n = n->next ) subdivider.addQuilt( n->bezier_curves ); subdivider.endQuilts(); - subdivider.drawCurves(); + subdivider.drawCurves(); if( ! playBack ) endrender(); } else { /* XXX */ @@ -230,7 +230,7 @@ NurbsTessellator::do_endcurve( void ) } /*----------------------------------------------------------------------------- - * do_endsurface - mark end of surface, display surface, free immediate data + * do_endsurface - mark end of surface, display surface, free immediate data * * Client: *----------------------------------------------------------------------------- @@ -252,7 +252,7 @@ NurbsTessellator::do_endsurface( void ) *nextNurbssurface = 0; if( ! isDataValid ) { - do_freeall( ); + do_freeall( ); return; } @@ -270,18 +270,18 @@ NurbsTessellator::do_endsurface( void ) subdivider.beginTrims(); for( O_trim *trim = currentSurface->o_trim; trim; trim = trim->next ) { subdivider.beginLoop(); - for( O_curve *curve = trim->o_curve; curve; curve = curve->next ) { + for( O_curve *curve = trim->o_curve; curve; curve = curve->next ) { curve->used = 0; assert( curve->curvetype != ct_none ); if (curve->curvetype == ct_pwlcurve) { - O_pwlcurve *c = curve->curve.o_pwlcurve; + O_pwlcurve *c = curve->curve.o_pwlcurve; subdivider.addArc( c->npts, c->pts, curve->nuid ); } else { Quilt *quilt = curve->curve.o_nurbscurve->bezier_curves; Quiltspec *qspec = quilt->qspec; REAL *cpts = quilt->cpts + qspec->offset; REAL *cptsend = cpts + (qspec->width * qspec->order * qspec->stride); - for( ; cpts != cptsend; cpts += qspec->order*qspec->stride ) + for( ; cpts != cptsend; cpts += qspec->order*qspec->stride ) subdivider.addArc( cpts, quilt, curve->nuid ); } } @@ -291,10 +291,10 @@ NurbsTessellator::do_endsurface( void ) } subdivider.beginQuilts(); - for( O_nurbssurface *n = currentSurface->o_nurbssurface; n; n = n->next ) + for( O_nurbssurface *n = currentSurface->o_nurbssurface; n; n = n->next ) subdivider.addQuilt( n->bezier_patches ); subdivider.endQuilts(); - subdivider.drawSurfaces( currentSurface->nuid ); + subdivider.drawSurfaces( currentSurface->nuid ); if( ! playBack ) endrender(); } else { if( ! playBack ) endrender(); @@ -374,7 +374,7 @@ NurbsTessellator::do_freecurveall( O_curve *curve ) */ void NurbsTessellator::do_freebgntrim( O_trim *o_trim ) -{ +{ o_trim->deleteMe( o_trimPool ); } @@ -402,7 +402,7 @@ NurbsTessellator::do_bgntrim( O_trim *o_trim ) inTrim = 1; if( *nextTrim != o_trim ) { - isTrimModified = 1; + isTrimModified = 1; *nextTrim = o_trim; } @@ -413,7 +413,7 @@ NurbsTessellator::do_bgntrim( O_trim *o_trim ) /*----------------------------------------------------------------------------- - * do_endtrim - mark the end of the current trim loop + * do_endtrim - mark the end of the current trim loop * * Client: endtrim() *----------------------------------------------------------------------------- @@ -433,16 +433,16 @@ NurbsTessellator::do_endtrim( void ) } numTrims++; - + if( *nextCurve != 0 ) { isTrimModified = 1; - *nextCurve = 0; + *nextCurve = 0; } } /*----------------------------------------------------------------------------- * do_freepwlcurve - - * + * * Client: *----------------------------------------------------------------------------- */ @@ -460,7 +460,7 @@ NurbsTessellator::do_freebgncurve( O_curve *o_curve ) /*----------------------------------------------------------------------------- * do_pwlcurve - link in pwl trim loop to the current surface description - * + * * Client: pwlcurve() *----------------------------------------------------------------------------- */ @@ -493,7 +493,7 @@ NurbsTessellator::do_pwlcurve( O_pwlcurve *o_pwlcurve ) isDataValid = 0; return; } - + if( *nextPwlcurve != o_pwlcurve ) { isCurveModified = 1; *nextPwlcurve = o_pwlcurve; @@ -505,14 +505,14 @@ NurbsTessellator::do_pwlcurve( O_pwlcurve *o_pwlcurve ) o_pwlcurve->owner = currentCurve; } - if( (inCurve == 2) ) + if( (inCurve == 2) ) endcurve(); } /*----------------------------------------------------------------------------- * do_freenurbscurve - - * + * * Client: *----------------------------------------------------------------------------- */ @@ -526,8 +526,8 @@ NurbsTessellator::do_freenurbscurve( O_nurbscurve *o_nurbscurve ) /*----------------------------------------------------------------------------- * do_nurbscurve - - * - * Client: nurbscurve() + * + * Client: nurbscurve() *----------------------------------------------------------------------------- */ void @@ -553,7 +553,7 @@ NurbsTessellator::do_nurbscurve( O_nurbscurve *o_nurbscurve ) isDataValid = 0; return; } - + if( *nextNurbscurve != o_nurbscurve ) { isCurveModified = 1; *nextNurbscurve = o_nurbscurve; @@ -568,7 +568,7 @@ NurbsTessellator::do_nurbscurve( O_nurbscurve *o_nurbscurve ) if( o_nurbscurve->owner == 0 ) isCurveModified = 1; - + if( inCurve == 2 ) endcurve(); } @@ -590,7 +590,7 @@ NurbsTessellator::do_freenurbssurface( O_nurbssurface *o_nurbssurface ) /*----------------------------------------------------------------------------- * do_nurbssurface - - * + * * Client: nurbssurface() *----------------------------------------------------------------------------- */ @@ -628,7 +628,7 @@ NurbsTessellator::do_nurbssurface( O_nurbssurface *o_nurbssurface ) /*----------------------------------------------------------------------------- * do_freenurbsproperty - * + * *----------------------------------------------------------------------------- */ @@ -638,10 +638,10 @@ NurbsTessellator::do_freenurbsproperty( Property *prop ) prop->deleteMe( propertyPool ); } - + /*----------------------------------------------------------------------------- * do_setnurbsproperty - - * + * *----------------------------------------------------------------------------- */ @@ -674,7 +674,7 @@ NurbsTessellator::do_nurbserror( int msg ) errorHandler( msg ); } -int +int NurbsTessellator::do_check_knots( Knotvector *knots, const char *msg ) { int status = knots->validate(); diff --git a/src/glu/sgi/libnurbs/internals/nurbstess.h b/src/glu/sgi/libnurbs/internals/nurbstess.h index a686900..5e017ac 100644 --- a/src/glu/sgi/libnurbs/internals/nurbstess.h +++ b/src/glu/sgi/libnurbs/internals/nurbstess.h @@ -98,7 +98,7 @@ class NurbsTessellator { void set_domain_distance_u_rate(REAL u_rate); void set_domain_distance_v_rate(REAL v_rate); void set_is_domain_distance_sampling(int flag); - + protected: Renderhints renderhints; diff --git a/src/glu/sgi/libnurbs/internals/patch.cc b/src/glu/sgi/libnurbs/internals/patch.cc index 808baa6..12d47a4 100644 --- a/src/glu/sgi/libnurbs/internals/patch.cc +++ b/src/glu/sgi/libnurbs/internals/patch.cc @@ -76,23 +76,23 @@ Patch::Patch( Quilt_ptr geo, REAL *pta, REAL *ptb, Patch *n ) ps += geo->qspec[1].index * geo->qspec[1].order * geo->qspec[1].stride; if( needsSampling ) { - mapdesc->xformSampling( ps, geo->qspec[0].order, geo->qspec[0].stride, + mapdesc->xformSampling( ps, geo->qspec[0].order, geo->qspec[0].stride, geo->qspec[1].order, geo->qspec[1].stride, spts, pspec[0].stride, pspec[1].stride ); } if( cullval == CULL_ACCEPT ) { - mapdesc->xformCulling( ps, geo->qspec[0].order, geo->qspec[0].stride, + mapdesc->xformCulling( ps, geo->qspec[0].order, geo->qspec[0].stride, geo->qspec[1].order, geo->qspec[1].stride, - cpts, pspec[0].stride, pspec[1].stride ); + cpts, pspec[0].stride, pspec[1].stride ); } - + if( notInBbox ) { - mapdesc->xformBounding( ps, geo->qspec[0].order, geo->qspec[0].stride, + mapdesc->xformBounding( ps, geo->qspec[0].order, geo->qspec[0].stride, geo->qspec[1].order, geo->qspec[1].stride, - bpts, pspec[0].stride, pspec[1].stride ); + bpts, pspec[0].stride, pspec[1].stride ); } - + /* set scale range */ pspec[0].range[0] = geo->qspec[0].breakpoints[geo->qspec[0].index]; pspec[0].range[1] = geo->qspec[0].breakpoints[geo->qspec[0].index+1]; @@ -155,14 +155,14 @@ Patch::Patch( Patch& upper, int param, REAL value, Patch *n ) mapdesc->subdivide( upper.spts, lower.spts, d, pspec[1].order, pspec[1].stride, pspec[0].order, pspec[0].stride ); - if( cullval == CULL_ACCEPT ) + if( cullval == CULL_ACCEPT ) mapdesc->subdivide( upper.cpts, lower.cpts, d, pspec[1].order, pspec[1].stride, pspec[0].order, pspec[0].stride ); - if( notInBbox ) + if( notInBbox ) mapdesc->subdivide( upper.bpts, lower.bpts, d, pspec[1].order, pspec[1].stride, pspec[0].order, pspec[0].stride ); - + lower.pspec[0].range[0] = upper.pspec[0].range[0]; lower.pspec[0].range[1] = value; lower.pspec[0].range[2] = value - upper.pspec[0].range[0]; @@ -179,10 +179,10 @@ Patch::Patch( Patch& upper, int param, REAL value, Patch *n ) if( needsSampling ) mapdesc->subdivide( upper.spts, lower.spts, d, pspec[0].order, pspec[0].stride, pspec[1].order, pspec[1].stride ); - if( cullval == CULL_ACCEPT ) + if( cullval == CULL_ACCEPT ) mapdesc->subdivide( upper.cpts, lower.cpts, d, pspec[0].order, pspec[0].stride, pspec[1].order, pspec[1].stride ); - if( notInBbox ) + if( notInBbox ) mapdesc->subdivide( upper.bpts, lower.bpts, d, pspec[0].order, pspec[0].stride, pspec[1].order, pspec[1].stride ); lower.pspec[0].range[0] = upper.pspec[0].range[0]; @@ -201,7 +201,7 @@ Patch::Patch( Patch& upper, int param, REAL value, Patch *n ) // inherit bounding box if( mapdesc->isBboxSubdividing() && ! notInBbox ) memcpy( lower.bb, upper.bb, sizeof( bb ) ); - + lower.checkBboxConstraint(); upper.checkBboxConstraint(); } @@ -220,7 +220,7 @@ Patch::clamp( void ) } } -void +void Patchspec::clamp( REAL clampfactor ) { if( sidestep[0] < minstepsize ) @@ -231,10 +231,10 @@ Patchspec::clamp( REAL clampfactor ) stepsize = clampfactor * minstepsize; } -void +void Patch::checkBboxConstraint( void ) { - if( notInBbox && + if( notInBbox && mapdesc->bboxTooBig( bpts, pspec[0].stride, pspec[1].stride, pspec[0].order, pspec[1].order, bb ) != 1 ) { notInBbox = 0; @@ -280,15 +280,15 @@ Patch::getstepsize( void ) // upper bound on path length between sample points REAL tmp[MAXORDER][MAXORDER][MAXCOORDS]; const int trstride = sizeof(tmp[0]) / sizeof(REAL); - const int tcstride = sizeof(tmp[0][0]) / sizeof(REAL); + const int tcstride = sizeof(tmp[0][0]) / sizeof(REAL); assert( pspec[0].order <= MAXORDER ); - + /* points have been transformed, therefore they are homogeneous */ - int val = mapdesc->project( spts, pspec[0].stride, pspec[1].stride, - &tmp[0][0][0], trstride, tcstride, - pspec[0].order, pspec[1].order ); + int val = mapdesc->project( spts, pspec[0].stride, pspec[1].stride, + &tmp[0][0][0], trstride, tcstride, + pspec[0].order, pspec[1].order ); if( val == 0 ) { // control points cross infinity, therefore partials are undefined pspec[0].getstepsize( mapdesc->maxsrate ); @@ -296,17 +296,17 @@ Patch::getstepsize( void ) } else { REAL t1 = mapdesc->getProperty( N_PIXEL_TOLERANCE ); // REAL t2 = mapdesc->getProperty( N_ERROR_TOLERANCE ); - pspec[0].minstepsize = ( mapdesc->maxsrate > 0.0 ) ? + pspec[0].minstepsize = ( mapdesc->maxsrate > 0.0 ) ? (pspec[0].range[2] / mapdesc->maxsrate) : 0.0; - pspec[1].minstepsize = ( mapdesc->maxtrate > 0.0 ) ? + pspec[1].minstepsize = ( mapdesc->maxtrate > 0.0 ) ? (pspec[1].range[2] / mapdesc->maxtrate) : 0.0; if( mapdesc->isParametricDistanceSampling() || - mapdesc->isObjectSpaceParaSampling() ) { + mapdesc->isObjectSpaceParaSampling() ) { REAL t2; t2 = mapdesc->getProperty( N_ERROR_TOLERANCE ); - - // t2 is upper bound on the distance between surface and tessellant + + // t2 is upper bound on the distance between surface and tessellant REAL ssv[2], ttv[2]; REAL ss = mapdesc->calcPartialVelocity( ssv, &tmp[0][0][0], trstride, tcstride, pspec[0].order, pspec[1].order, 2, 0, pspec[0].range[2], pspec[1].range[2], 0 ); REAL st = mapdesc->calcPartialVelocity( 0, &tmp[0][0][0], trstride, tcstride, pspec[0].order, pspec[1].order, 1, 1, pspec[0].range[2], pspec[1].range[2], -1 ); @@ -317,7 +317,7 @@ Patch::getstepsize( void ) if(tt <0) tt = -tt; if( ss != 0.0 && tt != 0.0 ) { - /* printf( "ssv[0] %g ssv[1] %g ttv[0] %g ttv[1] %g\n", + /* printf( "ssv[0] %g ssv[1] %g ttv[0] %g ttv[1] %g\n", ssv[0], ssv[1], ttv[0], ttv[1] ); */ REAL ttq = sqrtf( (float) ss ); REAL ssq = sqrtf( (float) tt ); @@ -327,7 +327,7 @@ Patch::getstepsize( void ) REAL scutoff = 2.0 * t2 / ( pspec[0].range[2] * pspec[0].range[2]); pspec[0].sidestep[0] = (ssv[0] > scutoff) ? sqrtf( 2.0 * t2 / ssv[0] ) : pspec[0].range[2]; pspec[0].sidestep[1] = (ssv[1] > scutoff) ? sqrtf( 2.0 * t2 / ssv[1] ) : pspec[0].range[2]; - + pspec[1].stepsize = ( dt < pspec[1].range[2] ) ? dt : pspec[1].range[2]; REAL tcutoff = 2.0 * t2 / ( pspec[1].range[2] * pspec[1].range[2]); pspec[1].sidestep[0] = (ttv[0] > tcutoff) ? sqrtf( 2.0 * t2 / ttv[0] ) : pspec[1].range[2]; @@ -359,12 +359,12 @@ Patch::getstepsize( void ) pspec[0].stepsize = ( ds < pspec[0].range[2] ) ? ds : pspec[0].range[2]; pspec[0].sidestep[0] = pspec[0].range[2]; pspec[0].sidestep[1] = pspec[0].range[2]; - + pspec[1].stepsize = ( dt < pspec[1].range[2] ) ? dt : pspec[1].range[2]; pspec[1].sidestep[0] = pspec[1].range[2]; pspec[1].sidestep[1] = pspec[1].range[2]; } - } + } } else if( mapdesc->isPathLengthSampling() || mapdesc->isObjectSpacePathSampling()) { // t1 is upper bound on path length @@ -379,11 +379,11 @@ Patch::getstepsize( void ) /* REAL ds = mt * d;*/ REAL ds = t1 / (2.0*ms); /* REAL dt = ms * d;*/ - REAL dt = t1 / (2.0*mt); + REAL dt = t1 / (2.0*mt); pspec[0].stepsize = ( ds < pspec[0].range[2] ) ? ds : pspec[0].range[2]; pspec[0].sidestep[0] = ( msv[0] * pspec[0].range[2] > t1 ) ? (side_scale* t1 / msv[0]) : pspec[0].range[2]; pspec[0].sidestep[1] = ( msv[1] * pspec[0].range[2] > t1 ) ? (side_scale* t1 / msv[1]) : pspec[0].range[2]; - + pspec[1].stepsize = ( dt < pspec[1].range[2] ) ? dt : pspec[1].range[2]; pspec[1].sidestep[0] = ( mtv[0] * pspec[1].range[2] > t1 ) ? (side_scale*t1 / mtv[0]) : pspec[1].range[2]; pspec[1].sidestep[1] = ( mtv[1] * pspec[1].range[2] > t1 ) ? (side_scale*t1 / mtv[1]) : pspec[1].range[2]; @@ -391,7 +391,7 @@ Patch::getstepsize( void ) pspec[0].stepsize = ( t1 < ms * pspec[0].range[2] ) ? (t1 / ms) : pspec[0].range[2]; pspec[0].sidestep[0] = ( msv[0] * pspec[0].range[2] > t1 ) ? (t1 / msv[0]) : pspec[0].range[2]; pspec[0].sidestep[1] = ( msv[1] * pspec[0].range[2] > t1 ) ? (t1 / msv[1]) : pspec[0].range[2]; - + pspec[1].singleStep(); } } else { @@ -420,7 +420,7 @@ Patch::getstepsize( void ) pspec[0].stepsize = ( ds < pspec[0].range[2] ) ? ds : pspec[0].range[2]; pspec[0].sidestep[0] = ( msv[0] * pspec[0].range[2] > t ) ? (t / msv[0]) : pspec[0].range[2]; pspec[0].sidestep[1] = ( msv[1] * pspec[0].range[2] > t ) ? (t / msv[1]) : pspec[0].range[2]; - + pspec[1].stepsize = ( dt < pspec[1].range[2] ) ? dt : pspec[1].range[2]; pspec[1].sidestep[0] = ( mtv[0] * pspec[1].range[2] > t ) ? (t / mtv[0]) : pspec[1].range[2]; pspec[1].sidestep[1] = ( mtv[1] * pspec[1].range[2] > t ) ? (t / mtv[1]) : pspec[1].range[2]; @@ -445,9 +445,9 @@ Patch::getstepsize( void ) if( mapdesc->minsavings != N_NOSAVINGSSUBDIVISION ) { REAL savings = 1./(pspec[0].stepsize * pspec[1].stepsize) ; - savings-= (2./( pspec[0].sidestep[0] + pspec[0].sidestep[1] )) * + savings-= (2./( pspec[0].sidestep[0] + pspec[0].sidestep[1] )) * (2./( pspec[1].sidestep[0] + pspec[1].sidestep[1] )); - + savings *= pspec[0].range[2] * pspec[1].range[2]; if( savings > mapdesc->minsavings ) { pspec[0].needsSubdivision = pspec[1].needsSubdivision = 1; @@ -465,7 +465,7 @@ Patchspec::singleStep() stepsize = sidestep[0] = sidestep[1] = glu_abs(range[2]); } -void +void Patchspec::getstepsize( REAL max ) // max is number of samples for entire patch { stepsize = ( max >= 1.0 ) ? range[2] / max : range[2]; @@ -496,7 +496,7 @@ Patch::needsSubdivision( int param ) int Patch::cullCheck( void ) { - if( cullval == CULL_ACCEPT ) + if( cullval == CULL_ACCEPT ) cullval = mapdesc->cullCheck( cpts, pspec[0].order, pspec[0].stride, pspec[1].order, pspec[1].stride ); return cullval; diff --git a/src/glu/sgi/libnurbs/internals/patch.h b/src/glu/sgi/libnurbs/internals/patch.h index 324a259..d77b73b 100644 --- a/src/glu/sgi/libnurbs/internals/patch.h +++ b/src/glu/sgi/libnurbs/internals/patch.h @@ -56,7 +56,7 @@ struct Patchspec : public Pspec { int stride; void clamp( REAL ); void getstepsize( REAL ); - void singleStep( void ); + void singleStep( void ); }; class Patch { @@ -84,8 +84,8 @@ friend class Patchlist; int cullval; int notInBbox; int needsSampling; - REAL cpts[MAXORDER*MAXORDER*MAXCOORDS]; //culling pts - REAL spts[MAXORDER*MAXORDER*MAXCOORDS]; //sampling pts + REAL cpts[MAXORDER*MAXORDER*MAXCOORDS]; //culling pts + REAL spts[MAXORDER*MAXORDER*MAXCOORDS]; //sampling pts REAL bpts[MAXORDER*MAXORDER*MAXCOORDS]; //bbox pts Patchspec pspec[2]; void checkBboxConstraint( void ); diff --git a/src/glu/sgi/libnurbs/internals/patchlist.cc b/src/glu/sgi/libnurbs/internals/patchlist.cc index 6a400ab..102e917 100644 --- a/src/glu/sgi/libnurbs/internals/patchlist.cc +++ b/src/glu/sgi/libnurbs/internals/patchlist.cc @@ -48,12 +48,12 @@ Patchlist::Patchlist( Quilt *quilts, REAL *pta, REAL *ptb ) { patch = 0; - for( Quilt *q = quilts; q; q = q->next ) + for( Quilt *q = quilts; q; q = q->next ) patch = new Patch( q, pta, ptb, patch ); pspec[0].range[0] = pta[0]; pspec[0].range[1] = ptb[0]; pspec[0].range[2] = ptb[0] - pta[0]; - + pspec[1].range[0] = pta[1]; pspec[1].range[1] = ptb[1]; pspec[1].range[2] = ptb[1] - pta[1]; diff --git a/src/glu/sgi/libnurbs/internals/patchlist.h b/src/glu/sgi/libnurbs/internals/patchlist.h index 9bfc5b4..7660b1f 100644 --- a/src/glu/sgi/libnurbs/internals/patchlist.h +++ b/src/glu/sgi/libnurbs/internals/patchlist.h @@ -47,7 +47,7 @@ friend class Subdivider; public: Patchlist( Quilt *, REAL *, REAL * ); Patchlist( Patchlist &, int , REAL ); - ~Patchlist(); + ~Patchlist(); void bbox(); int cullCheck( void ); void getstepsize( void ); @@ -74,14 +74,14 @@ Patchlist::getStepsize( int param ) inline int Patchlist::get_uorder() -{ +{ return patch->get_uorder(); } inline int Patchlist::get_vorder() -{ +{ return patch->get_vorder(); } diff --git a/src/glu/sgi/libnurbs/internals/quilt.cc b/src/glu/sgi/libnurbs/internals/quilt.cc index d16f4bf..c05df95 100644 --- a/src/glu/sgi/libnurbs/internals/quilt.cc +++ b/src/glu/sgi/libnurbs/internals/quilt.cc @@ -56,7 +56,7 @@ Quilt::Quilt( Mapdesc *_mapdesc ) { mapdesc = _mapdesc; } - + void Quilt::deleteMe( Pool& p ) { @@ -65,13 +65,13 @@ Quilt::deleteMe( Pool& p ) if( q->breakpoints) delete[] q->breakpoints; q->breakpoints = 0; #else if( q->breakpoints) { - delete[] q->breakpoints; + delete[] q->breakpoints; q->breakpoints = 0; printf("in here\n"); } #endif } - if( cpts ) delete[] cpts; + if( cpts ) delete[] cpts; cpts = 0; PooledObj::deleteMe( p ); } @@ -81,7 +81,7 @@ Quilt::show( void ) { #ifndef NDEBUG int nc = mapdesc->getNcoords(); - REAL *ps = cpts; + REAL *ps = cpts; ps += qspec[0].offset; ps += qspec[1].offset; for( int i=0; i!= qspec[0].order * qspec[0].width; i++ ) { @@ -105,28 +105,28 @@ Quilt::show( void ) void Quilt::select( REAL *pta, REAL *ptb ) { - int dim = eqspec - qspec; + int dim = eqspec - qspec; int i, j; for( i=0; i=0; j-- ) if( (qspec[i].breakpoints[j] <= pta[i] ) && - (ptb[i] <= qspec[i].breakpoints[j+1] ) ) + (ptb[i] <= qspec[i].breakpoints[j+1] ) ) break; - assert( j != -1 ); + assert( j != -1 ); qspec[i].index = j; } } -void +void Quilt::download( Backend &backend ) { if( getDimension() == 2 ) { - REAL *ps = cpts; + REAL *ps = cpts; ps += qspec[0].offset; ps += qspec[1].offset; ps += qspec[0].index * qspec[0].order * qspec[0].stride; ps += qspec[1].index * qspec[1].order * qspec[1].stride; - backend.surfpts( mapdesc->getType(), ps, + backend.surfpts( mapdesc->getType(), ps, qspec[0].stride, qspec[1].stride, qspec[0].order, @@ -136,10 +136,10 @@ Quilt::download( Backend &backend ) qspec[1].breakpoints[qspec[1].index], qspec[1].breakpoints[qspec[1].index+1] ); } else { - REAL *ps = cpts; + REAL *ps = cpts; ps += qspec[0].offset; ps += qspec[0].index * qspec[0].order * qspec[0].stride; - backend.curvpts( mapdesc->getType(), ps, + backend.curvpts( mapdesc->getType(), ps, qspec[0].stride, qspec[0].order, qspec[0].breakpoints[qspec[0].index], @@ -171,7 +171,7 @@ Quilt::isCulled( void ) { if( mapdesc->isCulling() ) return mapdesc->xformAndCullCheck( cpts + qspec[0].offset + qspec[1].offset, - qspec[0].order * qspec[0].width, qspec[0].stride, + qspec[0].order * qspec[0].width, qspec[0].stride, qspec[1].order * qspec[1].width, qspec[1].stride ); else return CULL_ACCEPT; @@ -199,12 +199,12 @@ Quilt::getRange( REAL *from, REAL *to, int i, Flist &list ) from[i] = maps->qspec[i].breakpoints[0]; to[i] = maps->qspec[i].breakpoints[maps->qspec[i].width]; int maxpts = 0; - Quilt_ptr m; + Quilt_ptr m; for( m=maps; m; m=m->next ) { - if( m->qspec[i].breakpoints[0] > from[i] ) - from[i] = m->qspec[i].breakpoints[0]; - if( m->qspec[i].breakpoints[m->qspec[i].width] < to[i] ) - to[i] = m->qspec[i].breakpoints[m->qspec[i].width]; + if( m->qspec[i].breakpoints[0] > from[i] ) + from[i] = m->qspec[i].breakpoints[0]; + if( m->qspec[i].breakpoints[m->qspec[i].width] < to[i] ) + to[i] = m->qspec[i].breakpoints[m->qspec[i].width]; maxpts += m->qspec[i].width + 1; } @@ -234,9 +234,9 @@ Quilt::findRates( Flist& slist, Flist& tlist, REAL rate[2] ) for( Quilt *q = next; q; q = q->next ) { q->findSampleRates( slist, tlist ); - if( q->qspec[0].step_size < rate[0] ) + if( q->qspec[0].step_size < rate[0] ) rate[0] = q->qspec[0].step_size; - if( q->qspec[1].step_size < rate[1] ) + if( q->qspec[1].step_size < rate[1] ) rate[1] = q->qspec[1].step_size; } } @@ -244,11 +244,11 @@ Quilt::findRates( Flist& slist, Flist& tlist, REAL rate[2] ) void Quilt::findSampleRates( Flist& slist, Flist& tlist ) { - qspec[0].step_size = DEF_PATCH_STEPSIZE * - (qspec[0].breakpoints[qspec[0].width] - qspec[0].breakpoints[0]); - qspec[1].step_size = DEF_PATCH_STEPSIZE * - (qspec[1].breakpoints[qspec[1].width] - qspec[1].breakpoints[0]); - + qspec[0].step_size = DEF_PATCH_STEPSIZE * + (qspec[0].breakpoints[qspec[0].width] - qspec[0].breakpoints[0]); + qspec[1].step_size = DEF_PATCH_STEPSIZE * + (qspec[1].breakpoints[qspec[1].width] - qspec[1].breakpoints[0]); + for( int i = slist.start; i < slist.end-1; i++ ) { for( int j = tlist.start; j < tlist.end-1; j++ ) { @@ -259,14 +259,14 @@ Quilt::findSampleRates( Flist& slist, Flist& tlist ) ptb[1] = tlist.pts[j+1]; Patchlist patchlist( this, pta, ptb ); patchlist.getstepsize(); - + { float edge_len_s = min(glu_abs(ptb[0]-pta[0]),1.0); float edge_len_t = min(glu_abs(ptb[1]-pta[1]),1.0); - if( patchlist.getStepsize(0)/edge_len_s < qspec[0].step_size ) + if( patchlist.getStepsize(0)/edge_len_s < qspec[0].step_size ) qspec[0].step_size = patchlist.getStepsize(0)/edge_len_s; - if( patchlist.getStepsize(1)/edge_len_t < qspec[1].step_size ) + if( patchlist.getStepsize(1)/edge_len_t < qspec[1].step_size ) qspec[1].step_size = patchlist.getStepsize(1)/edge_len_t; } } diff --git a/src/glu/sgi/libnurbs/internals/quilt.h b/src/glu/sgi/libnurbs/internals/quilt.h index fe1e330..1433d47 100644 --- a/src/glu/sgi/libnurbs/internals/quilt.h +++ b/src/glu/sgi/libnurbs/internals/quilt.h @@ -45,7 +45,7 @@ class Mapdesc; class Flist; struct Knotvector; -/* constants for memory allocation of NURBS to Bezier conversion */ +/* constants for memory allocation of NURBS to Bezier conversion */ #define MAXDIM 2 struct Quiltspec { /* a specification for a dimension of a quilt */ @@ -60,7 +60,7 @@ struct Quiltspec { /* a specification for a dimension of a quilt */ }; typedef Quiltspec *Quiltspec_ptr; - + class Quilt : public PooledObj { /* an array of bezier patches */ public: Quilt( Mapdesc * ); @@ -69,7 +69,7 @@ class Quilt : public PooledObj { /* an array of bezier patches */ Quiltspec qspec[MAXDIM]; /* the dimensional data */ Quiltspec_ptr eqspec; /* qspec trailer */ Quilt *next; /* next quilt in linked list */ - + public: void deleteMe( Pool& ); void toBezier( Knotvector &, INREAL *, long ); diff --git a/src/glu/sgi/libnurbs/internals/reader.cc b/src/glu/sgi/libnurbs/internals/reader.cc index c59240d..314fe7b 100644 --- a/src/glu/sgi/libnurbs/internals/reader.cc +++ b/src/glu/sgi/libnurbs/internals/reader.cc @@ -44,19 +44,19 @@ #include "trimvertex.h" #include "simplemath.h" -//when read a pwlCurve, if two consecutive points are the same, then +//when read a pwlCurve, if two consecutive points are the same, then //eliminate one of them. This makes the tessellator more robust. The spec -//assumes the application makes sure there are no redundant points. +//assumes the application makes sure there are no redundant points. //but in Inspector, the trim curves seem to have redundant points a lot. //I guess other similar users may have the same problem. -#define ELIMINATE_REDUNDANT_POINTS +#define ELIMINATE_REDUNDANT_POINTS -#ifdef ELIMINATE_REDUNDANT_POINTS +#ifdef ELIMINATE_REDUNDANT_POINTS #define equal(x,y) ( glu_abs(x-y) <= 0.00001) #endif -#ifdef ELIMINATE_REDUNDANT_POINTS +#ifdef ELIMINATE_REDUNDANT_POINTS O_pwlcurve::O_pwlcurve( long _type, long count, INREAL *array, long byte_stride, TrimVertex *trimpts ) { next = 0; @@ -83,7 +83,7 @@ O_pwlcurve::O_pwlcurve( long _type, long count, INREAL *array, long byte_stride, doit = 0; } } - + if(doit) { v->param[0] = (REAL) array[0]; @@ -140,7 +140,7 @@ O_pwlcurve::O_pwlcurve( long _type, long count, INREAL *array, long byte_stride, } } } -#endif +#endif diff --git a/src/glu/sgi/libnurbs/internals/reader.h b/src/glu/sgi/libnurbs/internals/reader.h index cae6cad..c4b0dd2 100644 --- a/src/glu/sgi/libnurbs/internals/reader.h +++ b/src/glu/sgi/libnurbs/internals/reader.h @@ -40,7 +40,7 @@ #include "types.h" enum Curvetype { ct_nurbscurve, ct_pwlcurve, ct_none }; - + struct Property; struct O_surface; struct O_nurbssurface; @@ -63,7 +63,7 @@ struct O_curve : public PooledObj { int used; /* curve called in cur surf */ int save; /* 1 if in display list */ long nuid; - O_curve() { next = 0; used = 0; owner = 0; + O_curve() { next = 0; used = 0; owner = 0; curve.o_pwlcurve = 0; curvetype = ct_none; save = 0; nuid = 0; } }; @@ -76,10 +76,10 @@ struct O_nurbscurve : public PooledObj { int used; /* curve called in cur surf */ int save; /* 1 if in display list */ O_curve * owner; /* owning curve */ - O_nurbscurve( long _type ) + O_nurbscurve( long _type ) { bezier_curves = 0; type = _type; tesselation = 0; method = 0; next = 0; used = 0; save = 0; owner = 0; } }; - + class O_pwlcurve : public PooledObj { public: TrimVertex *pts; /* array of trim vertices */ @@ -105,7 +105,7 @@ struct O_nurbssurface : public PooledObj { O_nurbssurface * next; /* next surface in chain */ int save; /* 1 if in display list */ int used; /* 1 if prev called in block */ - O_nurbssurface( long _type ) + O_nurbssurface( long _type ) { bezier_patches = 0; type = _type; owner = 0; next = 0; save = 0; used = 0; } }; diff --git a/src/glu/sgi/libnurbs/internals/renderhints.cc b/src/glu/sgi/libnurbs/internals/renderhints.cc index 4b347eb..49fd362 100644 --- a/src/glu/sgi/libnurbs/internals/renderhints.cc +++ b/src/glu/sgi/libnurbs/internals/renderhints.cc @@ -95,7 +95,7 @@ Renderhints::isProperty( long property ) } } -REAL +REAL Renderhints::getProperty( long property ) { switch ( property ) { @@ -113,7 +113,7 @@ Renderhints::getProperty( long property ) } } -void +void Renderhints::setProperty( long property, REAL value ) { switch ( property ) { diff --git a/src/glu/sgi/libnurbs/internals/simplemath.h b/src/glu/sgi/libnurbs/internals/simplemath.h index d00062d..4b4d1ce 100644 --- a/src/glu/sgi/libnurbs/internals/simplemath.h +++ b/src/glu/sgi/libnurbs/internals/simplemath.h @@ -40,13 +40,13 @@ #include "types.h" -inline int +inline int max( int x, int y ) { return ( x < y ) ? y : x; } -inline REAL +inline REAL min( REAL x, REAL y ) { return ( x > y ) ? y : x; } -inline REAL +inline REAL glu_abs( REAL x ) { return ( x < 0.0 ) ? -x : x; } #endif /* __glusimplemath_h_ */ diff --git a/src/glu/sgi/libnurbs/internals/slicer.cc b/src/glu/sgi/libnurbs/internals/slicer.cc index 1b18d73..de385fd 100644 --- a/src/glu/sgi/libnurbs/internals/slicer.cc +++ b/src/glu/sgi/libnurbs/internals/slicer.cc @@ -63,7 +63,7 @@ #endif //#define USE_READ_FLAG //whether to use new or old tesselator - //if defined, it reads "flagFile", + //if defined, it reads "flagFile", // if the number is 1, then use new tess // otherwise, use the old tess. //if not defined, then use new tess. @@ -183,7 +183,7 @@ void monoTriangulationLoop(Arc_ptr loop, Backend& backend, primStream* pStream) } //creat increase and decrease chains vertexArray inc_chain(50); //this is a dynamci array - for(i=1; i<=top->pwlArc->npts-2; i++) + for(i=1; i<=top->pwlArc->npts-2; i++) { //the first vertex is the top which doesn't below to inc_chain inc_chain.appendVertex(top->pwlArc->pts[i].param); @@ -194,7 +194,7 @@ void monoTriangulationLoop(Arc_ptr loop, Backend& backend, primStream* pStream) { inc_chain.appendVertex(jarc->pwlArc->pts[i].param); } - + } vertexArray dec_chain(50); for(jarc = top->prev; jarc != bot; jarc = jarc->prev) @@ -207,7 +207,7 @@ void monoTriangulationLoop(Arc_ptr loop, Backend& backend, primStream* pStream) for(i=bot->pwlArc->npts-2; i>=1; i--) { dec_chain.appendVertex(jarc->pwlArc->pts[i].param); - } + } monoTriangulationRec(top->tail(), bot->tail(), &inc_chain, 0, &dec_chain, 0, &backend); @@ -242,14 +242,14 @@ if(loop->next->tail()[1] == loop->next->head()[1]) printf("equal 2\n"); */ - if( (glu_abs(loop->tail()[0] - loop->head()[0])<=ZERO) && + if( (glu_abs(loop->tail()[0] - loop->head()[0])<=ZERO) && (glu_abs(loop->next->tail()[1] - loop->next->head()[1])<=ZERO) && (glu_abs(loop->prev->tail()[1] - loop->prev->head()[1])<=ZERO) && (glu_abs(loop->prev->prev->tail()[0] - loop->prev->prev->head()[0])<=ZERO) ) return 1; else if - ( (glu_abs(loop->tail()[1] - loop->head()[1]) <= ZERO) && + ( (glu_abs(loop->tail()[1] - loop->head()[1]) <= ZERO) && (glu_abs(loop->next->tail()[0] - loop->next->head()[0]) <= ZERO) && (glu_abs(loop->prev->tail()[0] - loop->prev->head()[0]) <= ZERO) && (glu_abs(loop->prev->prev->tail()[1] - loop->prev->prev->head()[1]) <= ZERO) @@ -300,11 +300,11 @@ static void evalLineNOGE(TrimVertex *verts, int n, Backend& backend) } #endif -inline void OPT_OUTVERT(TrimVertex& vv, Backend& backend) +inline void OPT_OUTVERT(TrimVertex& vv, Backend& backend) { #ifdef USE_OPTTT - glNormal3fv(vv.cache_normal); + glNormal3fv(vv.cache_normal); glVertex3fv(vv.cache_point); #else @@ -332,7 +332,7 @@ static void triangulateRect(Arc_ptr loop, Backend& backend, int TB_or_LR, int ul top = loop->prev->prev; } } - else + else { if(loop->tail()[0] > loop->prev->prev->tail()[0]) { @@ -373,14 +373,14 @@ static void triangulateRect(Arc_ptr loop, Backend& backend, int TB_or_LR, int ul if(TB_or_LR == 1) triangulateRectAux(top->pwlArc, bot->pwlArc, left->pwlArc, right->pwlArc, backend); else if(TB_or_LR == -1) - triangulateRectAux(left->pwlArc, right->pwlArc, bot->pwlArc, top->pwlArc, backend); + triangulateRectAux(left->pwlArc, right->pwlArc, bot->pwlArc, top->pwlArc, backend); else { Int maxPointsTB = top->pwlArc->npts + bot->pwlArc->npts; Int maxPointsLR = left->pwlArc->npts + right->pwlArc->npts; - + if(maxPointsTB < maxPointsLR) - triangulateRectAux(left->pwlArc, right->pwlArc, bot->pwlArc, top->pwlArc, backend); + triangulateRectAux(left->pwlArc, right->pwlArc, bot->pwlArc, top->pwlArc, backend); else triangulateRectAux(top->pwlArc, bot->pwlArc, left->pwlArc, right->pwlArc, backend); } @@ -410,7 +410,7 @@ static void triangulateRectAux(PwlArc* top, PwlArc* bot, PwlArc* left, PwlArc* r OPT_OUTVERT(bot->pts[i], backend); } backend.endtfan(); - + backend.bgntfan(); OPT_OUTVERT(bot->pts[bot->npts-2], backend); for(i=0; inpts; i++){ @@ -428,7 +428,7 @@ static void triangulateRectAux(PwlArc* top, PwlArc* bot, PwlArc* left, PwlArc* r OPT_OUTVERT(top->pts[i], backend); } backend.endtfan(); - + backend.bgntfan(); OPT_OUTVERT(top->pts[top->npts-2], backend); for(i=0; inpts; i++){ @@ -437,26 +437,26 @@ static void triangulateRectAux(PwlArc* top, PwlArc* bot, PwlArc* left, PwlArc* r backend.endtfan(); } else { //both top and bot have >=3 points - + backend.bgntfan(); - + OPT_OUTVERT(top->pts[top->npts-2], backend); - + for(i=0; i<=d; i++) { - OPT_OUTVERT(left->pts[i], backend); + OPT_OUTVERT(left->pts[i], backend); } backend.endtfan(); - + backend.bgntfan(); - + OPT_OUTVERT(bot->pts[1], backend); - + OPT_OUTVERT(top->pts[top->npts-2], backend); - + for(i=d; i< left->npts; i++) - { - OPT_OUTVERT(left->pts[i], backend); + { + OPT_OUTVERT(left->pts[i], backend); } backend.endtfan(); @@ -464,20 +464,20 @@ static void triangulateRectAux(PwlArc* top, PwlArc* bot, PwlArc* left, PwlArc* r //output only when dnpts-1 and // if(dnpts-1) - { + { backend.bgntfan(); // backend.tmeshvert(& top->pts[1]); OPT_OUTVERT(top->pts[1], backend); for(i=d; i< right->npts; i++) { // backend.tmeshvert(& right->pts[i]); - + OPT_OUTVERT(right->pts[i], backend); - + } backend.endtfan(); } - + backend.bgntfan(); // backend.tmeshvert(& bot->pts[bot->npts-2]); OPT_OUTVERT( bot->pts[bot->npts-2], backend); @@ -485,12 +485,12 @@ static void triangulateRectAux(PwlArc* top, PwlArc* bot, PwlArc* left, PwlArc* r { // backend.tmeshvert(& right->pts[i]); OPT_OUTVERT(right->pts[i], backend); - + } - + // backend.tmeshvert(& top->pts[1]); - OPT_OUTVERT(top->pts[1], backend); - + OPT_OUTVERT(top->pts[1], backend); + backend.endtfan(); @@ -500,14 +500,14 @@ static void triangulateRectAux(PwlArc* top, PwlArc* bot, PwlArc* left, PwlArc* r botd_left = 1; botd_right = bot->npts-2; //botd_left<= bot_dright - + if(top->npts < bot->npts) { int delta=bot->npts - top->npts; int u = delta/2; botd_left = 1+ u; - botd_right = bot->npts-2-( delta-u); - + botd_right = bot->npts-2-( delta-u); + if(botd_left >1) { backend.bgntfan(); @@ -535,7 +535,7 @@ static void triangulateRectAux(PwlArc* top, PwlArc* bot, PwlArc* left, PwlArc* r int u = delta/2; topd_left = top->npts-2 - u; topd_right = 1+delta-u; - + if(topd_left < top->npts-2) { backend.bgntfan(); @@ -557,8 +557,8 @@ static void triangulateRectAux(PwlArc* top, PwlArc* bot, PwlArc* left, PwlArc* r backend.endtfan(); } } - - if(topd_left <= topd_right) + + if(topd_left <= topd_right) return; backend.bgnqstrip(); @@ -570,13 +570,13 @@ static void triangulateRectAux(PwlArc* top, PwlArc* bot, PwlArc* left, PwlArc* r OPT_OUTVERT(bot->pts[j], backend); } backend.endqstrip(); - + } } } - -static void triangulateRectCenter(int n_ulines, REAL* u_val, + +static void triangulateRectCenter(int n_ulines, REAL* u_val, int n_vlines, REAL* v_val, Backend& backend) { @@ -585,7 +585,7 @@ static void triangulateRectCenter(int n_ulines, REAL* u_val, // to fix a problem in which glMapGrid2f() was called with bad parameters. // This has beens submitted to SGI but not integrated as of May 1, 2001. if(n_ulines>1 && n_vlines>1) { - backend.surfgrid(u_val[0], u_val[n_ulines-1], n_ulines-1, + backend.surfgrid(u_val[0], u_val[n_ulines-1], n_ulines-1, v_val[n_vlines-1], v_val[0], n_vlines-1); backend.surfmesh(0,0,n_ulines-1,n_vlines-1); } @@ -601,10 +601,10 @@ static void triangulateRectCenter(int n_ulines, REAL* u_val, { trimVert.param[0] = u_val[j]; trimVert.param[1] = v_val[i+1]; - backend.tmeshvert(& trimVert); + backend.tmeshvert(& trimVert); trimVert.param[1] = v_val[i]; - backend.tmeshvert(& trimVert); + backend.tmeshvert(& trimVert); } backend.endqstrip(); @@ -626,7 +626,7 @@ static void triangulateRectTopGen(Arc_ptr arc, int n_ulines, REAL* u_val, Real v for(k=0,i=arc->pwlArc->npts-1; i>=0; i--,k++) { upper_val[k] = arc->pwlArc->pts[i].param[0]; - } + } backend.evalUStrip(arc->pwlArc->npts, arc->pwlArc->pts[0].param[1], upper_val, n_ulines, v, u_val); @@ -637,12 +637,12 @@ static void triangulateRectTopGen(Arc_ptr arc, int n_ulines, REAL* u_val, Real v { upper_val[k] = arc->pwlArc->pts[i].param[0]; - } + } backend.evalUStrip( n_ulines, v, u_val, arc->pwlArc->npts, arc->pwlArc->pts[0].param[1], upper_val - ); + ); } free(upper_val); @@ -652,7 +652,7 @@ static void triangulateRectTopGen(Arc_ptr arc, int n_ulines, REAL* u_val, Real v { int i,k; REAL* left_val = (REAL*) malloc(sizeof(REAL) * arc->pwlArc->npts); - assert(left_val); + assert(left_val); if(dir) { for(k=0,i=arc->pwlArc->npts-1; i>=0; i--,k++) @@ -663,7 +663,7 @@ static void triangulateRectTopGen(Arc_ptr arc, int n_ulines, REAL* u_val, Real v left_val, n_ulines, v, u_val); } - else + else { for(k=0,i=0; ipwlArc->npts; i++,k++) { @@ -672,12 +672,12 @@ static void triangulateRectTopGen(Arc_ptr arc, int n_ulines, REAL* u_val, Real v backend.evalVStrip( n_ulines, v, u_val, arc->pwlArc->npts, arc->pwlArc->pts[0].param[0], left_val - ); + ); } free(left_val); return; } - + //the following is a different version of the above code. If you comment //the above code, the following code will still work. The reason to leave //the folliwng code here is purely for testing purpose. @@ -712,7 +712,7 @@ static void triangulateRectTopGen(Arc_ptr arc, int n_ulines, REAL* u_val, Real v trimVert.param[1] = u_val[0]; trimVert.param[0] = v; } - + backend.tmeshvert(& trimVert); for(i=d1; i< parc->npts; i++) backend.tmeshvert(& parc->pts[i]); @@ -762,7 +762,7 @@ static void triangulateRectTopGen(Arc_ptr arc, int n_ulines, REAL* u_val, Real v backend.tmeshvert(&trimVert); - + } backend.endqstrip(); @@ -795,7 +795,7 @@ static void triangulateRectGen(Arc_ptr loop, int n_ulines, int n_vlines, Backend top = loop->prev->prev; } } - else + else { if(loop->tail()[0] > loop->prev->prev->tail()[0]) { @@ -815,16 +815,16 @@ static void triangulateRectGen(Arc_ptr loop, int n_ulines, int n_vlines, Backend right= bot->next; #ifdef COUNT_TRIANGLES - num_triangles += loop->pwlArc->npts + - left->pwlArc->npts + - bot->pwlArc->npts + - right->pwlArc->npts - + 2*n_ulines + 2*n_vlines + num_triangles += loop->pwlArc->npts + + left->pwlArc->npts + + bot->pwlArc->npts + + right->pwlArc->npts + + 2*n_ulines + 2*n_vlines -8; num_quads += (n_ulines-1)*(n_vlines-1); #endif /* - backend.surfgrid(left->tail()[0], right->tail()[0], n_ulines+1, + backend.surfgrid(left->tail()[0], right->tail()[0], n_ulines+1, top->tail()[1], bot->tail()[1], n_vlines+1); // if(n_ulines>1 && n_vlines>1) backend.surfmesh(0,0,n_ulines+1,n_vlines+1); @@ -862,11 +862,11 @@ return; free(u_val); free(v_val); - + } - + /**********for reading newtess_flag from a file**********/ #ifdef USE_READ_FLAG @@ -883,7 +883,7 @@ static Int read_flag(char* name) fclose(fp); return ret; } -#endif +#endif /***********nextgen tess****************/ #include "sampleMonoPoly.h" @@ -902,7 +902,7 @@ directedLine* arcToDLine(Arc_ptr arc) ret = new directedLine(INCREASING, sline); return ret; } - + /*an pwlArc may not be a straight line*/ directedLine* arcToMultDLines(directedLine* original, Arc_ptr arc) { @@ -912,7 +912,7 @@ directedLine* arcToMultDLines(directedLine* original, Arc_ptr arc) is_linear = 1; else if(area(arc->pwlArc->pts[0].param, arc->pwlArc->pts[1].param, arc->pwlArc->pts[arc->pwlArc->npts-1].param) == 0.0) is_linear = 1; - + if(is_linear) { directedLine *dline = arcToDLine(arc); @@ -931,7 +931,7 @@ directedLine* arcToMultDLines(directedLine* original, Arc_ptr arc) vert[0][1] = arc->pwlArc->pts[i].param[1]; vert[1][0] = arc->pwlArc->pts[i+1].param[0]; vert[1][1] = arc->pwlArc->pts[i+1].param[1]; - + sampledLine *sline = new sampledLine(2, vert); directedLine *dline = new directedLine(INCREASING, sline); if(ret == NULL) @@ -942,9 +942,9 @@ directedLine* arcToMultDLines(directedLine* original, Arc_ptr arc) return ret; } } - - - + + + directedLine* arcLoopToDLineLoop(Arc_ptr loop) { directedLine* ret; @@ -993,7 +993,7 @@ void Slicer::evalRBArray(rectBlockArray* rbArray, gridWrap* grid) } } - + free(trimVert); } */ @@ -1001,7 +1001,7 @@ void Slicer::evalRBArray(rectBlockArray* rbArray, gridWrap* grid) void Slicer::evalRBArray(rectBlockArray* rbArray, gridWrap* grid) { Int i,j,k; - + Int n_vlines=grid->get_n_vlines(); //the reason to switch the position of v_max and v_min is because of the //the orientation problem. glEvalMesh generates quad_strip clockwise, but @@ -1042,17 +1042,17 @@ void Slicer::evalStream(primStream* pStream) backend.bgntfan(); for(j=0; jget_length(i); j++) - { + { trimVert->param[0] = vertices[k]; trimVert->param[1] = vertices[k+1]; - backend.tmeshvert(trimVert); - + backend.tmeshvert(trimVert); + // backend.tmeshvert(vertices[k], vertices[k+1]); k += 2; } backend.endtfan(); break; - + default: fprintf(stderr, "evalStream: not implemented yet\n"); exit(1); @@ -1061,9 +1061,9 @@ void Slicer::evalStream(primStream* pStream) } free(trimVert); } - - - + + + void Slicer::slice_new(Arc_ptr loop) { @@ -1118,14 +1118,14 @@ void Slicer::slice_new(Arc_ptr loop) if(vlinear) triangulateRect(loop, backend, 1, ulinear, vlinear); else if(ulinear) - triangulateRect(loop, backend, -1, ulinear, vlinear); + triangulateRect(loop, backend, -1, ulinear, vlinear); else - triangulateRect(loop, backend, 0, ulinear, vlinear); + triangulateRect(loop, backend, 0, ulinear, vlinear); } else if(isRect) { - triangulateRectGen(loop, num_ulines-2, num_vlines-2, backend); + triangulateRectGen(loop, num_ulines-2, num_vlines-2, backend); } else if( (num_ulines<=2 || num_vlines <=2) && ulinear) { @@ -1135,7 +1135,7 @@ void Slicer::slice_new(Arc_ptr loop) { monoTriangulationFunBackend(loop, compV2InY, &backend); } - else + else { directedLine* poly = arcLoopToDLineLoop(loop); @@ -1148,14 +1148,14 @@ void Slicer::slice_new(Arc_ptr loop) evalStream(&pStream); evalRBArray(&rbArray, &grid); - + #ifdef COUNT_TRIANGLES num_triangles += pStream.num_triangles(); num_quads += rbArray.num_quads(); #endif - poly->deleteSinglePolygonWithSline(); + poly->deleteSinglePolygonWithSline(); } - + #ifdef COUNT_TRIANGLES printf("num_triangles=%i\n", num_triangles); printf("num_quads = %i\n", num_quads); @@ -1176,9 +1176,9 @@ void Slicer::slice(Arc_ptr loop) } - -Slicer::Slicer( Backend &b ) + +Slicer::Slicer( Backend &b ) : CoveAndTiler( b ), Mesher( b ), backend( b ) { oneOverDu = 0; @@ -1232,17 +1232,17 @@ Slicer::slice_old( Arc_ptr loop ) getGridExtent( &extrema[0]->pwlArc->pts[0], &extrema[0]->pwlArc->pts[0] ); for( long quad=0; quadtail()[0] > (jarc2)->head()[0] ) ) { + if( ! ( jarc2->tail()[0] > (jarc2)->head()[0] ) ) { #ifndef NDEBUG _glu_dprintf( "s difference %f\n", (jarc2)->tail()[0] - (jarc2)->head()[0] ); #endif @@ -160,7 +160,7 @@ Subdivider::link( Arc_ptr jarc1, Arc_ptr jarc2, Arc_ptr up, Arc_ptr down ) up->prev->next = up; } -inline void +inline void Subdivider::simple_link( Arc_ptr jarc1, Arc_ptr jarc2 ) { Arc_ptr tmp = jarc2->prev; @@ -196,7 +196,7 @@ Subdivider::join_s( Bin& left, Bin& right, Arc_ptr jarc1, Arc_ptr jarc2 ) if( t1 == t2 ) { simple_link( jarc1, jarc2 ); } else { - Arc_ptr newright = new(arcpool) Arc( arc_right, 0 ); + Arc_ptr newright = new(arcpool) Arc( arc_right, 0 ); Arc_ptr newleft = new(arcpool) Arc( arc_left, 0 ); assert( t1 < t2 ); if( isBezierArcType() ) { @@ -235,7 +235,7 @@ Subdivider::check_t( Arc_ptr jarc1, Arc_ptr jarc2 ) ::mylongjmp( jumpbuffer, 28 ); } - if( ! ( jarc2->tail()[1] > (jarc2)->head()[1] ) ) { + if( ! ( jarc2->tail()[1] > (jarc2)->head()[1] ) ) { #ifndef NDEBUG _glu_dprintf( "t difference %f\n", jarc2->tail()[1] - (jarc2)->head()[1] ); #endif diff --git a/src/glu/sgi/libnurbs/internals/subdivider.cc b/src/glu/sgi/libnurbs/internals/subdivider.cc index ccddc27..4479618 100644 --- a/src/glu/sgi/libnurbs/internals/subdivider.cc +++ b/src/glu/sgi/libnurbs/internals/subdivider.cc @@ -71,7 +71,7 @@ Bin* Subdivider::makePatchBoundary( const REAL *from, const REAL *to ) -{ +{ Bin* ret = new Bin(); REAL smin = from[0]; REAL smax = to[0]; @@ -109,9 +109,9 @@ Subdivider::makePatchBoundary( const REAL *from, const REAL *to ) *--------------------------------------------------------------------------- */ -Subdivider::Subdivider( Renderhints& r, Backend& b ) +Subdivider::Subdivider( Renderhints& r, Backend& b ) : slicer( b ), - arctessellator( trimvertexpool, pwlarcpool ), + arctessellator( trimvertexpool, pwlarcpool ), arcpool( sizeof( Arc), 1, "arcpool" ), bezierarcpool( sizeof( BezierArc ), 1, "Bezarcpool" ), pwlarcpool( sizeof( PwlArc ), 1, "Pwlarcpool" ), @@ -131,10 +131,10 @@ Subdivider::setJumpbuffer( JumpBuffer *j ) *--------------------------------------------------------------------------- */ -void +void Subdivider::clear( void ) { - trimvertexpool.clear(); + trimvertexpool.clear(); arcpool.clear(); pwlarcpool.clear(); bezierarcpool.clear(); @@ -174,10 +174,10 @@ Subdivider::addArc( REAL *cpts, Quilt *quilt, long _nuid ) */ void -Subdivider::addArc( int npts, TrimVertex *pts, long _nuid ) +Subdivider::addArc( int npts, TrimVertex *pts, long _nuid ) { Arc *jarc = new(arcpool) Arc( arc_none, _nuid ); - jarc->pwlArc = new(pwlarcpool) PwlArc( npts, pts ); + jarc->pwlArc = new(pwlarcpool) PwlArc( npts, pts ); initialbin.addarc( jarc ); pjarc = jarc->append( pjarc ); } @@ -205,7 +205,7 @@ Subdivider::drawSurfaces( long nuid ) { renderhints.init( ); - if (qlist == NULL) + if (qlist == NULL) { //initialbin could be nonempty due to some errors freejarcs(initialbin); @@ -223,8 +223,8 @@ Subdivider::drawSurfaces( long nuid ) REAL from[2], to[2]; qlist->getRange( from, to, spbrkpts, tpbrkpts ); #ifdef OPTIMIZE_UNTRIMED_CASE - //perform optimization only when the samplng method is - //DOMAIN_DISTANCE and the display methdo is either + //perform optimization only when the samplng method is + //DOMAIN_DISTANCE and the display methdo is either //fill or outline_polygon. int optimize = (is_domain_distance_sampling && (renderhints.display_method != N_OUTLINE_PATCH)); #endif @@ -232,7 +232,7 @@ Subdivider::drawSurfaces( long nuid ) if( ! initialbin.isnonempty() ) { #ifdef OPTIMIZE_UNTRIMED_CASE if(! optimize ) - { + { makeBorderTrim( from, to ); } @@ -243,14 +243,14 @@ Subdivider::drawSurfaces( long nuid ) REAL rate[2]; qlist->findRates( spbrkpts, tpbrkpts, rate ); - if( decompose( initialbin, min(rate[0], rate[1]) ) ) + if( decompose( initialbin, min(rate[0], rate[1]) ) ) mylongjmp( jumpbuffer, 31 ); } backend.bgnsurf( renderhints.wiretris, renderhints.wirequads, nuid ); #ifdef PARTITION_TEST - if( initialbin.isnonempty() && spbrkpts.end-2 == spbrkpts.start && + if( initialbin.isnonempty() && spbrkpts.end-2 == spbrkpts.start && tpbrkpts.end-2 == tpbrkpts.start) { for(int i=spbrkpts.start; ideleteDegenerateLinesAllPolygons(); + + poly=poly->deleteDegenerateLinesAllPolygons(); sampledLine* retSampledLines; -//printf("before MC_partition\n"); +//printf("before MC_partition\n"); poly = MC_partitionY(poly, &retSampledLines); -//printf("after MC_partition\n"); +//printf("after MC_partition\n"); } @@ -326,23 +326,23 @@ Subdivider::drawSurfaces( long nuid ) pta[1] = tpbrkpts.pts[j]; ptb[1] = tpbrkpts.pts[j+1]; qlist->downloadAll(pta, ptb, backend); - + num_u_steps = (int) (domain_distance_u_rate * (ptb[0]-pta[0])); num_v_steps = (int) (domain_distance_v_rate * (ptb[1]-pta[1])); if(num_u_steps <= 0) num_u_steps = 1; if(num_v_steps <= 0) num_v_steps = 1; - backend.surfgrid(pta[0], ptb[0], num_u_steps, + backend.surfgrid(pta[0], ptb[0], num_u_steps, ptb[1], pta[1], num_v_steps); backend.surfmesh(0,0,num_u_steps,num_v_steps); - + continue; /* the following is left for reference purpose, don't delete { - Bin* tempSource; + Bin* tempSource; Patchlist patchlist(qlist, pta, ptb); patchlist.getstepsize(); @@ -410,7 +410,7 @@ Subdivider::splitInS( Bin& source, int start, int end ) splitInT( source, tpbrkpts.start, tpbrkpts.end ); } } - } + } } /*--------------------------------------------------------------------------- @@ -446,7 +446,7 @@ Subdivider::splitInT( Bin& source, int start, int end ) ptb[0] = spbrkpts.pts[s_index]; ptb[1] = tpbrkpts.pts[t_index]; qlist->downloadAll( pta, ptb, backend ); - + Patchlist patchlist( qlist, pta, ptb ); /* printf("-------samplingSplit-----\n"); @@ -457,19 +457,19 @@ source.show("samplingSplit source"); setArcTypeBezier(); } } - } + } } /*-------------------------------------------------------------------------- - * samplingSplit - recursively subdivide patch, cull check each subpatch + * samplingSplit - recursively subdivide patch, cull check each subpatch *-------------------------------------------------------------------------- */ void -Subdivider::samplingSplit( - Bin& source, - Patchlist& patchlist, - int subdivisions, +Subdivider::samplingSplit( + Bin& source, + Patchlist& patchlist, + int subdivisions, int param ) { if( ! source.isnonempty() ) return; @@ -486,7 +486,7 @@ Subdivider::samplingSplit( outline( source ); freejarcs( source ); return; - } + } //patchlist.clamp(); @@ -517,10 +517,10 @@ Subdivider::samplingSplit( } void -Subdivider::nonSamplingSplit( - Bin& source, - Patchlist& patchlist, - int subdivisions, +Subdivider::nonSamplingSplit( + Bin& source, + Patchlist& patchlist, + int subdivisions, int param ) { if( patchlist.needsNonSamplingSubdivision() && (subdivisions > 0) ) { @@ -532,13 +532,13 @@ Subdivider::nonSamplingSplit( split( source, left, right, param, mid ); Patchlist subpatchlist( patchlist, param, mid ); if( left.isnonempty() ) { - if( subpatchlist.cullCheck() == CULL_TRIVIAL_REJECT ) + if( subpatchlist.cullCheck() == CULL_TRIVIAL_REJECT ) freejarcs( left ); else nonSamplingSplit( left, subpatchlist, subdivisions-1, param ); } if( right.isnonempty() ) { - if( patchlist.cullCheck() == CULL_TRIVIAL_REJECT ) + if( patchlist.cullCheck() == CULL_TRIVIAL_REJECT ) freejarcs( right ); else nonSamplingSplit( right, patchlist, subdivisions-1, param ); @@ -549,7 +549,7 @@ Subdivider::nonSamplingSplit( patchlist.bbox(); backend.patch( patchlist.pspec[0].range[0], patchlist.pspec[0].range[1], patchlist.pspec[1].range[0], patchlist.pspec[1].range[1] ); - + if( renderhints.display_method == N_OUTLINE_SUBDIV ) { outline( source ); freejarcs( source ); @@ -614,7 +614,7 @@ Subdivider::monosplitInS( Bin& source, int start, int end ) monosplitInT( source, tmbrkpts.start, tmbrkpts.end ); } } - } + } } /*--------------------------------------------------------------------------- @@ -645,7 +645,7 @@ source.show("source\n"); freejarcs( source ); } } - } + } } @@ -672,7 +672,7 @@ Subdivider::findIrregularS( Bin& bin ) if((b[1]<=a[1] && b[1] <= c[1]) || (b[1]>=a[1] && b[1] >= c[1])) { - //each arc (jarc, jarc->prev, jarc->next) is a + //each arc (jarc, jarc->prev, jarc->next) is a //monotone arc consisting of multiple line segements. //it may happen that jarc->prev and jarc->next are the same, //that is, jarc->prev and jarc form a closed loop. @@ -688,7 +688,7 @@ Subdivider::findIrregularS( Bin& bin ) assert(jarc->prev->pwlArc->npts>2); a = jarc->prev->pwlArc->pts[jarc->prev->pwlArc->npts-2].param; } - + } if(area(a,b,c) < 0) { @@ -697,7 +697,7 @@ Subdivider::findIrregularS( Bin& bin ) } - /* old code, + /* old code, if( b[1] <= a[1] && b[1] <= c[1] ) { if( ! ccwTurn_tr( jarc->prev, jarc ) ) smbrkpts.add( b[0] ); @@ -710,7 +710,7 @@ Subdivider::findIrregularS( Bin& bin ) } smbrkpts.filter(); -} +} /*---------------------------------------------------------------------------- * findIrregularT - determine points of non-monotonicity in t direction @@ -733,11 +733,11 @@ Subdivider::findIrregularT( Bin& bin ) if( b[0] == a[0] && b[0] == c[0] ) continue; if( b[0] <= a[0] && b[0] <= c[0] ) { - if( a[1] != b[1] && b[1] != c[1] ) continue; + if( a[1] != b[1] && b[1] != c[1] ) continue; if( ! ccwTurn_sr( jarc->prev, jarc ) ) tmbrkpts.add( b[1] ); } else if ( b[0] >= a[0] && b[0] >= c[0] ) { - if( a[1] != b[1] && b[1] != c[1] ) continue; + if( a[1] != b[1] && b[1] != c[1] ) continue; if( ! ccwTurn_sl( jarc->prev, jarc ) ) tmbrkpts.add( b[1] ); } @@ -746,16 +746,16 @@ Subdivider::findIrregularT( Bin& bin ) } /*----------------------------------------------------------------------------- - * makeBorderTrim - if no user input trimming data then create + * makeBorderTrim - if no user input trimming data then create * a trimming curve around the boundaries of the Quilt. The curve consists of * four Jordan arcs, one for each side of the Quilt, connected, of course, - * head to tail. + * head to tail. *----------------------------------------------------------------------------- */ void Subdivider::makeBorderTrim( const REAL *from, const REAL *to ) -{ +{ REAL smin = from[0]; REAL smax = to[0]; REAL tmin = from[1]; @@ -816,7 +816,7 @@ Subdivider::render( Bin& bin ) } /*--------------------------------------------------------------------------- - * outline - render the trimmed patch by outlining the boundary + * outline - render the trimmed patch by outlining the boundary *--------------------------------------------------------------------------- */ @@ -857,10 +857,10 @@ Subdivider::freejarcs( Bin& bin ) /*---------------------------------------------------------------------------- * tessellate - tessellate all Bezier arcs in a bin - * 1) only accepts linear Bezier arcs as input + * 1) only accepts linear Bezier arcs as input * 2) the Bezier arcs are stored in the pwlArc structure * 3) only vertical or horizontal lines work - * -- should + * -- should * 1) represent Bezier arcs in BezierArc structure * (this requires a multitude of changes to the code) * 2) accept high degree Bezier arcs (hard) @@ -875,15 +875,15 @@ Subdivider::tessellate( Bin& bin, REAL rrate, REAL trate, REAL lrate, REAL brate { for( Arc_ptr jarc=bin.firstarc(); jarc; jarc=bin.nextarc() ) { if( jarc->isbezier( ) ) { - assert( jarc->pwlArc->npts == 2 ); + assert( jarc->pwlArc->npts == 2 ); TrimVertex *pts = jarc->pwlArc->pts; REAL s1 = pts[0].param[0]; REAL t1 = pts[0].param[1]; REAL s2 = pts[1].param[0]; REAL t2 = pts[1].param[1]; - + jarc->pwlArc->deleteMe( pwlarcpool ); jarc->pwlArc = 0; - + switch( jarc->getside() ) { case arc_left: assert( s1 == s2 ); diff --git a/src/glu/sgi/libnurbs/internals/subdivider.h b/src/glu/sgi/libnurbs/internals/subdivider.h index 4d53951..0de1b06 100644 --- a/src/glu/sgi/libnurbs/internals/subdivider.h +++ b/src/glu/sgi/libnurbs/internals/subdivider.h @@ -181,7 +181,7 @@ class Subdivider { *GLU_U_STEP: number of u-segments per unit u length of domain *GLU_V_STEP: number of v-segments per unit v length of domain *These two numbers are normally stored in mapdesc->maxs(t)rate. - *I (ZL) put these two numbers here so that I can optimize the untrimmed + *I (ZL) put these two numbers here so that I can optimize the untrimmed *case in the case of domain distance sampling. *These two numbers are set by set_domain_distance_u_rate() and ..._v_..(). */ @@ -191,7 +191,7 @@ class Subdivider { }; inline void -Subdivider::beginLoop( void ) +Subdivider::beginLoop( void ) { pjarc = 0; } diff --git a/src/glu/sgi/libnurbs/internals/tobezier.cc b/src/glu/sgi/libnurbs/internals/tobezier.cc index 531f26b..3e2a386 100644 --- a/src/glu/sgi/libnurbs/internals/tobezier.cc +++ b/src/glu/sgi/libnurbs/internals/tobezier.cc @@ -32,7 +32,7 @@ ** compliant with the OpenGL(R) version 1.2.1 Specification. */ -/* +/* * tobezier.c++ * */ @@ -86,7 +86,7 @@ struct Knotspec { /* knotvector format */ void knots( void ); void transform( REAL * ); void showpts( REAL * ); - + void pt_io_copy( REAL *, INREAL * ); void pt_oo_copy( REAL *, REAL * ); void pt_oo_sum( REAL*, REAL*, REAL*, Knot, Knot ); @@ -109,12 +109,12 @@ struct Splinespec { /* a non-uniform tensor element */ }; /*----------------------------------------------------------------------------- - * Quilt::toBezier - convert from NURBS to rational Bezier + * Quilt::toBezier - convert from NURBS to rational Bezier *----------------------------------------------------------------------------- */ void -Quilt::toBezier( +Quilt::toBezier( Knotvector& knotvector, /* a knot vector */ INREAL *ctlpts, /* input contol points */ long ncoords ) /* number of coordinates per control point */ @@ -129,7 +129,7 @@ Quilt::toBezier( } void -Quilt::toBezier( +Quilt::toBezier( Knotvector& sknotvector, /* a knot vector */ Knotvector& tknotvector, /* a knot vector */ INREAL *ctlpts, /* input contol points */ @@ -154,13 +154,13 @@ Splinespec::~Splinespec( void ) * is copied in 'cpts' in this file in function Splinespec::setupquilt(). * This block of memory will eventually be deleted in file quilt.c++ in * function Quilt::deleteMe() through 'cpts' so do NOT delete it here! - */ - Knotspec *ktrav= kspec; //start at beginning of list - while (ktrav != 0) { //any items to delete? - Knotspec *deleteThis= ktrav; //remember to delete this + */ + Knotspec *ktrav= kspec; //start at beginning of list + while (ktrav != 0) { //any items to delete? + Knotspec *deleteThis= ktrav; //remember to delete this ktrav= ktrav->next; //go to next item if any delete deleteThis; //delete it - } + } } /* ~Splinespec() */ /*----------------------------------------------------------------------------- @@ -176,7 +176,7 @@ Splinespec::kspecinit( Knotvector& knotvector ) kspec = new Knotspec; kspec->inkbegin = knotvector.knotlist; kspec->inkend = knotvector.knotlist + knotvector.knotcount; - kspec->prestride = (int) knotvector.stride; + kspec->prestride = (int) knotvector.stride; kspec->order = knotvector.order; kspec->next = NULL; } @@ -189,13 +189,13 @@ Splinespec::kspecinit( Knotvector& sknotvector, Knotvector& tknotvector ) kspec->inkbegin = sknotvector.knotlist; kspec->inkend = sknotvector.knotlist + sknotvector.knotcount; - kspec->prestride = (int) sknotvector.stride; + kspec->prestride = (int) sknotvector.stride; kspec->order = sknotvector.order; kspec->next = tkspec; tkspec->inkbegin = tknotvector.knotlist; tkspec->inkend = tknotvector.knotlist + tknotvector.knotcount; - tkspec->prestride = (int) tknotvector.stride; + tkspec->prestride = (int) tknotvector.stride; tkspec->order = tknotvector.order; tkspec->next = NULL; } @@ -204,7 +204,7 @@ Splinespec::kspecinit( Knotvector& sknotvector, Knotvector& tknotvector ) /*----------------------------------------------------------------------------- * Splinespec::select - select the subsegments to copy * - * Client: gl_quilt_to_bezier + * Client: gl_quilt_to_bezier *----------------------------------------------------------------------------- */ @@ -218,9 +218,9 @@ Splinespec::select( ) } /*----------------------------------------------------------------------------- - * Splinespec::layout - + * Splinespec::layout - * - * Client: gl_quilt_to_bezier + * Client: gl_quilt_to_bezier *----------------------------------------------------------------------------- */ @@ -239,7 +239,7 @@ Splinespec::layout( long ncoords ) knotspec->ncoords = (int) ncoords; } outcpts = new REAL[stride]; - assert( outcpts != 0 ); + assert( outcpts != 0 ); } /*----------------------------------------------------------------------------- @@ -256,7 +256,7 @@ Splinespec::copy( INREAL *incpts ) } /*----------------------------------------------------------------------------- - * Splinespec::setupquilt - assign all quilt variables from knotspec + * Splinespec::setupquilt - assign all quilt variables from knotspec * * Client: gl_quilt_to_bezier *----------------------------------------------------------------------------- @@ -308,7 +308,7 @@ Splinespec::transform( void ) /*----------------------------------------------------------------------------- - * Knotspec::Knotspec - constuct a knot spec + * Knotspec::Knotspec - constuct a knot spec *----------------------------------------------------------------------------- */ @@ -320,7 +320,7 @@ Knotspec::Knotspec( void ) } /*----------------------------------------------------------------------------- - * Knotspec::copy - copy the control points along minor direction + * Knotspec::copy - copy the control points along minor direction * * Client: Splinespec::copy *----------------------------------------------------------------------------- @@ -363,7 +363,7 @@ Knotspec::showpts( REAL *outpt ) } /*----------------------------------------------------------------------------- - * Knotspec::factors - precompute scale factors + * Knotspec::factors - precompute scale factors * - overwrites knot vector, actual new knot vector is NOT produced * * Client: Knotspec::select @@ -385,7 +385,7 @@ Knotspec::factors( void ) Knot *kf = (mid-def) + (order-1); for( Knot *kl = kf + def; kl != kf; kl-- ) { Knot *kh, *kt; - for( kt=kl, kh=mid; kt != kf; kh--, kt-- ) + for( kt=kl, kh=mid; kt != kf; kh--, kt-- ) *(fptr++) = (kv - *kh) / (*kt - *kh); *kl = kv; } @@ -420,9 +420,9 @@ Knotspec::insert( REAL *p ) for( int multi = bpt->multi; multi > 0; multi-- ) { pt_oo_copy( dstpt, srcpt ); dstpt -= poststride; - srcpt -= poststride; + srcpt -= poststride; } - + for( REAL *pend = srcpt - poststride*bpt->def; srcpt != pend; pend +=poststride, dstpt-=poststride ) { pt_oo_copy( dstpt, srcpt ); REAL *p1 = srcpt; @@ -445,10 +445,10 @@ Knotspec::insert( REAL *p ) void Knotspec::preselect( void ) { - Knot kval; + Knot kval; /* position klast after last knot of "last" breakpoint */ - for( klast = inkend - order, kval = *klast; klast != inkend; klast++ ) + for( klast = inkend - order, kval = *klast; klast != inkend; klast++ ) if( ! identical( *klast, kval ) ) break; /* position kfirst after last knot of "first" breakpoint */ @@ -457,8 +457,8 @@ Knotspec::preselect( void ) /* compute multiplicity of first breakpoint */ Knot_ptr k; - for( k = kfirst - 1; k >= inkbegin; k-- ) - if( ! identical( kval, *k ) ) break; + for( k = kfirst - 1; k >= inkbegin; k-- ) + if( ! identical( kval, *k ) ) break; k++; /* allocate space for breakpoints - @@ -487,13 +487,13 @@ Knotspec::select( void ) breakpoints(); knots(); factors(); - + preoffset = kleft - (inkbegin + order); postwidth = (int)((bend - bbegin) * order); prewidth = (int)((outkend - outkbegin) - order); postoffset = (bbegin->def > 1) ? (bbegin->def-1) : 0; } - + /*----------------------------------------------------------------------------- * Knotspec::breakpoints - compute breakpoints for knotspec * @@ -528,7 +528,7 @@ Knotspec::breakpoints( void ) bend = ubpt; - if( nfactors ) { + if( nfactors ) { sbegin = new Knot[nfactors]; } else { sbegin = NULL; @@ -552,7 +552,7 @@ Knotspec::knots( void ) /* allocate space for knots and factors */ outkbegin = new Knot[inkend-inkpt]; Knot_ptr outkpt; - for( outkpt = outkbegin; inkpt != inkend; inkpt++, outkpt++ ) + for( outkpt = outkbegin; inkpt != inkend; inkpt++, outkpt++ ) *outkpt = *inkpt; outkend = outkpt; @@ -560,7 +560,7 @@ Knotspec::knots( void ) /*----------------------------------------------------------------------------- - * Knotspec::transform - convert a spline along a given direction + * Knotspec::transform - convert a spline along a given direction * * Client: Splienspec::transform *----------------------------------------------------------------------------- diff --git a/src/glu/sgi/libnurbs/internals/trimline.cc b/src/glu/sgi/libnurbs/internals/trimline.cc index 61f34cd..13f34dc 100644 --- a/src/glu/sgi/libnurbs/internals/trimline.cc +++ b/src/glu/sgi/libnurbs/internals/trimline.cc @@ -46,15 +46,15 @@ Trimline::Trimline() { size = 0; pts = 0; numverts = 0; - tinterp = &t; binterp = &b; + tinterp = &t; binterp = &b; } Trimline::~Trimline() { - if( pts ) delete[] pts; + if( pts ) delete[] pts; } -void +void Trimline::init( TrimVertex *v ) { reset(); @@ -67,7 +67,7 @@ Trimline::grow( long npts ) { if( size < npts ) { size = 2 * npts; - if( pts ) delete[] pts; + if( pts ) delete[] pts; pts = new TrimVertex_p[size]; } } @@ -75,7 +75,7 @@ Trimline::grow( long npts ) inline void Trimline::append( TrimVertex *v ) { - assert( numverts != size ); + assert( numverts != size ); pts[numverts++] = v; } @@ -89,18 +89,18 @@ Trimline::init( long npts, Arc_ptr jarc, long last ) inline void Trimline::swap() { - TrimVertex *tmp=tinterp; - tinterp=binterp; + TrimVertex *tmp=tinterp; + tinterp=binterp; binterp=tmp; } void Trimline::getNextPt() { - *binterp = *jarcl.getnextpt(); + *binterp = *jarcl.getnextpt(); } -void +void Trimline::getPrevPt() { *binterp = *jarcl.getprevpt(); @@ -119,7 +119,7 @@ Trimline::getNextPts( REAL vval, Backend& backend ) register TrimVertex *p; for( p=jarcl.getnextpt() ; p->param[1] >= vval; p=jarcl.getnextpt() ) { - append( p ); + append( p ); } /* compute and copy pointer to final point on left hull */ @@ -133,7 +133,7 @@ Trimline::getNextPts( REAL vval, Backend& backend ) jarcl.reverse(); } -void +void Trimline::getPrevPts( REAL vval, Backend& backend ) { reset(); swap(); append( tinterp ); @@ -198,12 +198,12 @@ Trimline::interpvert( TrimVertex *a, TrimVertex *b, TrimVertex *c, REAL vval ) if(denom != 0) { if( vval == a->param[1] ) { - c->param[0] = a->param[0]; + c->param[0] = a->param[0]; c->param[1] = a->param[1]; c->nuid = a->nuid; return 0; } else if( vval == b->param[1] ) { - c->param[0] = b->param[0]; + c->param[0] = b->param[0]; c->param[1] = b->param[1]; c->nuid = b->nuid; return 0; @@ -214,7 +214,7 @@ Trimline::interpvert( TrimVertex *a, TrimVertex *b, TrimVertex *c, REAL vval ) return 1; } } else { - c->param[0] = a->param[0]; + c->param[0] = a->param[0]; c->param[1] = a->param[1]; c->nuid = a->nuid; return 0; diff --git a/src/glu/sgi/libnurbs/internals/trimline.h b/src/glu/sgi/libnurbs/internals/trimline.h index ecc8842..4fc769e 100644 --- a/src/glu/sgi/libnurbs/internals/trimline.h +++ b/src/glu/sgi/libnurbs/internals/trimline.h @@ -45,7 +45,7 @@ class Backend; class Trimline { private: - TrimVertex** pts; + TrimVertex** pts; long numverts; long i; long size; @@ -72,32 +72,32 @@ class Trimline { void getNextPts( Arc_ptr ); void getPrevPts( Arc_ptr ); inline TrimVertex * next( void ); - inline TrimVertex * prev( void ); + inline TrimVertex * prev( void ); inline TrimVertex * first( void ); inline TrimVertex * last( void ); }; inline TrimVertex * -Trimline::next( void ) +Trimline::next( void ) { - if( i < numverts) return pts[i++]; else return 0; -} + if( i < numverts) return pts[i++]; else return 0; +} inline TrimVertex * -Trimline::prev( void ) +Trimline::prev( void ) { - if( i >= 0 ) return pts[i--]; else return 0; -} + if( i >= 0 ) return pts[i--]; else return 0; +} inline TrimVertex * -Trimline::first( void ) +Trimline::first( void ) { - i = 0; return pts[i]; + i = 0; return pts[i]; } inline TrimVertex * -Trimline::last( void ) +Trimline::last( void ) { - i = numverts; return pts[--i]; -} + i = numverts; return pts[--i]; +} #endif /* __glutrimline_h_ */ diff --git a/src/glu/sgi/libnurbs/internals/trimregion.cc b/src/glu/sgi/libnurbs/internals/trimregion.cc index 4aeb5ee..60bd89b 100644 --- a/src/glu/sgi/libnurbs/internals/trimregion.cc +++ b/src/glu/sgi/libnurbs/internals/trimregion.cc @@ -55,10 +55,10 @@ TrimRegion::setDu( REAL du ) void TrimRegion::init( long npts, Arc_ptr extrema ) { - left.init( npts, extrema, extrema->pwlArc->npts - 1 ); + left.init( npts, extrema, extrema->pwlArc->npts - 1 ); left.getNextPt(); - right.init( npts, extrema, 0 ); + right.init( npts, extrema, 0 ); right.getPrevPt(); } @@ -76,7 +76,7 @@ TrimRegion::getPts( Backend &backend ) right.getPrevPts( bot.vval, backend ); } -void +void TrimRegion::getGridExtent( void ) { getGridExtent( left.last(), right.last() ); @@ -103,7 +103,7 @@ TrimRegion::canTile( void ) { TrimVertex *lf = left.first(); TrimVertex *ll = left.last(); - TrimVertex *l = ( ll->param[0] > lf->param[0] ) ? ll : lf; + TrimVertex *l = ( ll->param[0] > lf->param[0] ) ? ll : lf; TrimVertex *rf = right.first(); TrimVertex *rl = right.last(); diff --git a/src/glu/sgi/libnurbs/internals/trimregion.h b/src/glu/sgi/libnurbs/internals/trimregion.h index ee15d7b..b0a62bc 100644 --- a/src/glu/sgi/libnurbs/internals/trimregion.h +++ b/src/glu/sgi/libnurbs/internals/trimregion.h @@ -66,7 +66,7 @@ class TrimRegion { }; inline void -TrimRegion::init( REAL vval ) +TrimRegion::init( REAL vval ) { bot.vval = vval; } diff --git a/src/glu/sgi/libnurbs/internals/trimvertex.h b/src/glu/sgi/libnurbs/internals/trimvertex.h index 2780b76..ab546dc 100644 --- a/src/glu/sgi/libnurbs/internals/trimvertex.h +++ b/src/glu/sgi/libnurbs/internals/trimvertex.h @@ -52,11 +52,11 @@ class TrimVertex { /* a vertex on a trim curve */ typedef class TrimVertex *TrimVertex_p; -inline REAL -det3( TrimVertex *a, TrimVertex *b, TrimVertex *c ) -{ - return a->param[0] * (b->param[1]-c->param[1]) + - b->param[0] * (c->param[1]-a->param[1]) + +inline REAL +det3( TrimVertex *a, TrimVertex *b, TrimVertex *c ) +{ + return a->param[0] * (b->param[1]-c->param[1]) + + b->param[0] * (c->param[1]-a->param[1]) + c->param[0] * (a->param[1]-b->param[1]); } diff --git a/src/glu/sgi/libnurbs/internals/trimvertpool.cc b/src/glu/sgi/libnurbs/internals/trimvertpool.cc index 3e5bd70..03a05ae 100644 --- a/src/glu/sgi/libnurbs/internals/trimvertpool.cc +++ b/src/glu/sgi/libnurbs/internals/trimvertpool.cc @@ -46,7 +46,7 @@ #include "bufpool.h" /*---------------------------------------------------------------------------- - * TrimVertexPool::TrimVertexPool + * TrimVertexPool::TrimVertexPool *---------------------------------------------------------------------------- */ TrimVertexPool::TrimVertexPool( void ) @@ -59,7 +59,7 @@ TrimVertexPool::TrimVertexPool( void ) } /*---------------------------------------------------------------------------- - * TrimVertexPool::~TrimVertexPool + * TrimVertexPool::~TrimVertexPool *---------------------------------------------------------------------------- */ TrimVertexPool::~TrimVertexPool( void ) @@ -74,13 +74,13 @@ TrimVertexPool::~TrimVertexPool( void ) } /*---------------------------------------------------------------------------- - * TrimVertexPool::clear + * TrimVertexPool::clear *---------------------------------------------------------------------------- */ void TrimVertexPool::clear( void ) { - // reinitialize pool of 3 vertex arrays + // reinitialize pool of 3 vertex arrays pool.clear(); // free all arrays of TrimVertices vertices diff --git a/src/glu/sgi/libnurbs/internals/uarray.cc b/src/glu/sgi/libnurbs/internals/uarray.cc index 4b3329c..afa42ad 100644 --- a/src/glu/sgi/libnurbs/internals/uarray.cc +++ b/src/glu/sgi/libnurbs/internals/uarray.cc @@ -52,7 +52,7 @@ Uarray::Uarray( void ) Uarray::~Uarray( void ) { - if( uarray ) delete[] uarray; + if( uarray ) delete[] uarray; } long @@ -61,7 +61,7 @@ Uarray::init( REAL delta, Arc_ptr lo, Arc_ptr hi ) ulines = (long) ((hi->tail()[0] - lo->tail()[0])/delta) + 3; if( size < ulines ) { size = ulines * 2; - if( uarray ) delete[] uarray; + if( uarray ) delete[] uarray; uarray = new REAL[size]; assert( uarray != 0); } diff --git a/src/glu/sgi/libnurbs/internals/uarray.h b/src/glu/sgi/libnurbs/internals/uarray.h index cc6fae1..764dd8c 100644 --- a/src/glu/sgi/libnurbs/internals/uarray.h +++ b/src/glu/sgi/libnurbs/internals/uarray.h @@ -39,7 +39,7 @@ #include "types.h" class Arc; -typedef class Arc *Arc_ptr; +typedef class Arc *Arc_ptr; class Uarray { private: diff --git a/src/glu/sgi/libnurbs/internals/varray.cc b/src/glu/sgi/libnurbs/internals/varray.cc index 1cb2354..baca8d2 100644 --- a/src/glu/sgi/libnurbs/internals/varray.cc +++ b/src/glu/sgi/libnurbs/internals/varray.cc @@ -45,7 +45,7 @@ #include "simplemath.h" // glu_abs() #define TINY 0.0001 -inline long sgn( REAL x ) +inline long sgn( REAL x ) { return (x < -TINY) ? -1 : ((x > TINY) ? 1 : 0 ); } @@ -67,7 +67,7 @@ Varray::Varray( void ) Varray::~Varray( void ) { - if( varray ) delete[] varray; + if( varray ) delete[] varray; } inline void @@ -88,7 +88,7 @@ Varray::grow( long guess ) { if( size < guess ) { size = guess * 2; - if( varray ) delete[] varray; + if( varray ) delete[] varray; varray = new REAL[size]; assert( varray != 0 ); } @@ -100,7 +100,7 @@ Varray::init( REAL delta, Arc_ptr toparc, Arc_ptr botarc ) Arc_ptr left = toparc->next; Arc_ptr right = toparc; long ldir[2], rdir[2]; - + ldir[0] = sgn( left->tail()[0] - left->prev->tail()[0] ); ldir[1] = sgn( left->tail()[1] - left->prev->tail()[1] ); rdir[0] = sgn( right->tail()[0] - right->prev->tail()[0] ); @@ -115,7 +115,7 @@ Varray::init( REAL delta, Arc_ptr toparc, Arc_ptr botarc ) left = left->next; update( left, ldir, left->prev->tail()[1] ); break; - case -1: + case -1: right = right->prev; update( right, rdir, right->tail()[1] ); break; @@ -141,8 +141,8 @@ Varray::init( REAL delta, Arc_ptr toparc, Arc_ptr botarc ) if( dist > delta ) { long steps = ((long) (dist/delta)) +1; float deltav = - dist / (REAL) steps; - for( long j=1; jhead()[0] == temp->tail()[0] && temp->head()[1] == temp->tail()[1]) -*/ +*/ if(myequal(temp->head(), temp->tail())) deleteSingleLine(temp); - } + } return first; } @@ -190,7 +190,7 @@ directedLine* directedLine::deleteDegenerateLinesAllPolygons() if(ret == NULL) { ret = retEnd = temp->deleteDegenerateLines(); - + } else { diff --git a/src/glu/sgi/libnurbs/nurbtess/directedLine.h b/src/glu/sgi/libnurbs/nurbtess/directedLine.h index 4ed0128..36b5e5e 100644 --- a/src/glu/sgi/libnurbs/nurbtess/directedLine.h +++ b/src/glu/sgi/libnurbs/nurbtess/directedLine.h @@ -44,10 +44,10 @@ class directedLine { directedLine* next; /*double linked list*/ directedLine* prev; /*double linked list*/ - /*in case we need a list of polygons each + /*in case we need a list of polygons each *consisting of a double linked list */ - directedLine* nextPolygon; + directedLine* nextPolygon; /*optimization make cutoff polygon faster*/ /* directedLine* prevPolygon;*/ @@ -65,7 +65,7 @@ class directedLine { ~directedLine(); void init(short dir, sampledLine* sl); - + Real* head(); /*points[0] if INCREASING, points[n-1] otherwise*/ Real* tail(); /*points[n-1] if INCREASING, points[0] otherwise*/ Real* getVertex(Int i); /*points[i] if INCREASING, points[n-1-i] otherwise*/ @@ -101,13 +101,13 @@ class directedLine { /*check to see if the list forms a closed polygon *return 1 if yes */ - short isPolygon(); - + short isPolygon(); + Int compInY(directedLine* nl); Int compInX(directedLine* nl); /*return an array of pointers. - *the + *the */ directedLine** sortAllPolygons(); @@ -115,7 +115,7 @@ class directedLine { Int numEdgesAllPolygons(); Int numPolygons(); - /*check if the head of this edge is connected to + /*check if the head of this edge is connected to *the tail of the prev */ short isConnected(); @@ -126,7 +126,7 @@ class directedLine { void printList(); void printAllPolygons(); void writeAllPolygons(char* filename); - + /*insert a polygon: using nextPolygon*/ directedLine* insertPolygon(directedLine* newpolygon); @@ -135,15 +135,15 @@ class directedLine { Int toArraySinglePolygon(directedLine** array, Int index); directedLine** toArrayAllPolygons(Int& total_num_edges); - void connectDiagonal(directedLine* v1, directedLine* v2, - directedLine** ret_p1, + void connectDiagonal(directedLine* v1, directedLine* v2, + directedLine** ret_p1, directedLine** ret_p2, sampledLine** generatedLine, directedLine* list); /*generate two slines */ - void connectDiagonal_2slines(directedLine* v1, directedLine* v2, - directedLine** ret_p1, + void connectDiagonal_2slines(directedLine* v1, directedLine* v2, + directedLine** ret_p1, directedLine** ret_p2, directedLine* list); diff --git a/src/glu/sgi/libnurbs/nurbtess/gridWrap.cc b/src/glu/sgi/libnurbs/nurbtess/gridWrap.cc index 3c92039..f3799ba 100644 --- a/src/glu/sgi/libnurbs/nurbtess/gridWrap.cc +++ b/src/glu/sgi/libnurbs/nurbtess/gridWrap.cc @@ -6,21 +6,21 @@ ** this file except in compliance with the License. You may obtain a copy ** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600 ** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at: -** +** ** http://oss.sgi.com/projects/FreeB -** +** ** Note that, as provided in the License, the Software is distributed on an ** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS ** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND ** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A ** PARTICULAR PURPOSE, AND NON-INFRINGEMENT. -** +** ** Original Code. The Original Code is: OpenGL Sample Implementation, ** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, ** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. ** Copyright in any portions created by third parties is as indicated ** elsewhere herein. All Rights Reserved. -** +** ** Additional Notice Provisions: The application programming interfaces ** established by SGI in conjunction with the Original Code are The ** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released @@ -67,15 +67,15 @@ gridWrap::gridWrap(Int nUlines, Real* uvals, u_values = (Real*) malloc(sizeof(Real) * n_ulines); assert(u_values); v_values = (Real*) malloc(sizeof(Real) * n_vlines); - assert(v_values); - + assert(v_values); + Int i; for(i=0; i=2); assert(nVlines>=2); @@ -137,9 +137,9 @@ void gridWrap::draw() void gridWrap::outputFanWithPoint(Int v, Int uleft, Int uright, Real vert[2], primStream* pStream) { Int i; - if(uleft >= uright) + if(uleft >= uright) return; //no triangles to output. - + pStream->begin(); pStream->insert(vert); @@ -154,30 +154,30 @@ void gridWrap::outputFanWithPoint(Int v, Int uleft, Int uright, Real vert[2], pr { for(i=uright; i>= uleft; i--) pStream->insert(u_values[i], v_values[v]); - } - + } + pStream->end(PRIMITIVE_STREAM_FAN); } -/*each chain stores a number of consecutive - *V-lines within a grid. +/*each chain stores a number of consecutive + *V-lines within a grid. *There is one grid vertex on each V-line. * The total number of V-lines is: * nVlines. - * with respect to the grid, the index of the first V-line is + * with respect to the grid, the index of the first V-line is * firstVlineIndex. - * So with respect to the grid, the index of the ith V-line is + * So with respect to the grid, the index of the ith V-line is * firstVlineIndex-i. * the grid-index of the uline at the ith vline (recall that each vline has one grid point) * is ulineIndices[i]. The u_value is cached in ulineValues[i], that is, - * ulineValues[i] = grid->get_u_value(ulineIndices[i]) + * ulineValues[i] = grid->get_u_value(ulineIndices[i]) */ gridBoundaryChain::gridBoundaryChain( - gridWrap* gr, - Int first_vline_index, - Int n_vlines, + gridWrap* gr, + Int first_vline_index, + Int n_vlines, Int* uline_indices, Int* inner_indices ) @@ -191,7 +191,7 @@ gridBoundaryChain::gridBoundaryChain( vertices = (Real2*) malloc(sizeof(Real2) * n_vlines); assert(vertices); - + Int i; @@ -199,13 +199,13 @@ gridBoundaryChain::gridBoundaryChain( ulineIndices[i] = uline_indices[i]; innerIndices[i] = inner_indices[i]; } - + for(i=0; iget_u_value(ulineIndices[i]); vertices[i][1] = gr->get_v_value(first_vline_index-i); } } - + void gridBoundaryChain::draw() { Int i; @@ -228,7 +228,7 @@ void gridBoundaryChain::drawInner() glEnd(); } } - + Int gridBoundaryChain::lookfor(Real v, Int i1, Int i2) { Int mid; @@ -267,7 +267,7 @@ void gridBoundaryChain::rightEndFan(Int i, primStream* pStream) } //otherside, the two are equal, so there is no fan to output } - + /*output the fan of the left end between grid line i-1 and grid line i*/ void gridBoundaryChain::leftEndFan(Int i, primStream* pStream) @@ -289,5 +289,5 @@ void gridBoundaryChain::leftEndFan(Int i, primStream* pStream) pStream->insert(grid->get_u_value(j), get_v_value(i-1)); pStream->end(PRIMITIVE_STREAM_FAN); } - /*otherwisem, the two are equal, so there is no fan to outout*/ + /*otherwisem, the two are equal, so there is no fan to outout*/ } diff --git a/src/glu/sgi/libnurbs/nurbtess/gridWrap.h b/src/glu/sgi/libnurbs/nurbtess/gridWrap.h index b642848..63dba47 100644 --- a/src/glu/sgi/libnurbs/nurbtess/gridWrap.h +++ b/src/glu/sgi/libnurbs/nurbtess/gridWrap.h @@ -45,14 +45,14 @@ class gridWrap{ Real u_min, u_max; Real v_min, v_max; - /*cache the coordinate values for efficiency. - *these are redundant information when + /*cache the coordinate values for efficiency. + *these are redundant information when *the grid is uniform. */ Real* u_values; /*size is n_ulines*/ Real* v_values; /*size is n_vlines*/ - Int is_uniform; + Int is_uniform; public: //uniform grid constructor @@ -66,7 +66,7 @@ class gridWrap{ Int nVlines, Real *vvlas ); ~gridWrap(); - + void print(); Int get_n_ulines() {return n_ulines;} Int get_n_vlines() {return n_vlines;} @@ -75,17 +75,17 @@ class gridWrap{ Real get_v_min() {return v_min;} Real get_v_max() {return v_max;} - Real get_u_value(Int i) + Real get_u_value(Int i) { assert(i=n_ulines){printf("ERROR, n_ulines=%i,i=%i\n",n_ulines,i);exit(0);}*/ + /*if(i>=n_ulines){printf("ERROR, n_ulines=%i,i=%i\n",n_ulines,i);exit(0);}*/ return u_values[i];} Real get_v_value(Int j) {return v_values[j];} Real* get_u_values() {return u_values;} Real* get_v_values() {return v_values;} - void outputFanWithPoint(Int v, Int uleft, Int uright, + void outputFanWithPoint(Int v, Int uleft, Int uright, Real vert[2], primStream* pStream); void draw(); diff --git a/src/glu/sgi/libnurbs/nurbtess/monoChain.cc b/src/glu/sgi/libnurbs/nurbtess/monoChain.cc index cb28129..19c43a4 100644 --- a/src/glu/sgi/libnurbs/nurbtess/monoChain.cc +++ b/src/glu/sgi/libnurbs/nurbtess/monoChain.cc @@ -6,21 +6,21 @@ ** this file except in compliance with the License. You may obtain a copy ** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600 ** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at: -** +** ** http://oss.sgi.com/projects/FreeB -** +** ** Note that, as provided in the License, the Software is distributed on an ** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS ** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND ** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A ** PARTICULAR PURPOSE, AND NON-INFRINGEMENT. -** +** ** Original Code. The Original Code is: OpenGL Sample Implementation, ** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, ** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. ** Copyright in any portions created by third parties is as indicated ** elsewhere herein. All Rights Reserved. -** +** ** Additional Notice Provisions: The application programming interfaces ** established by SGI in conjunction with the Original Code are The ** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released @@ -93,7 +93,7 @@ monoChain::monoChain(directedLine* cHead, directedLine* cTail) chainTail = cTail; next = this; prev = this; - + nextPolygon = NULL; //compute bounding box @@ -119,7 +119,7 @@ monoChain::monoChain(directedLine* cHead, directedLine* cTail) isIncrease = 1; else isIncrease = 0; - + //initilize currrent, this is used for accelerating search if(isIncrease) current = chainHead; @@ -217,7 +217,7 @@ Real monoChain::chainIntersectHoriz(Real y) } current = temp->getPrev(); } - else + else { for(temp = current; temp != chainHead; temp = temp->getPrev()) { @@ -261,7 +261,7 @@ monoChain* directedLineLoopToMonoChainLoop(directedLine* loop) } else ret->insert(new monoChain(prevCusp, temp)); - prevCusp = temp; + prevCusp = temp; } } assert(ret); @@ -276,7 +276,7 @@ monoChain* directedLineLoopListToMonoChainLoopList(directedLine* list) monoChain* mc; monoChain* mcEnd; mc = directedLineLoopToMonoChainLoop(list); - mcEnd = mc; + mcEnd = mc; for(temp = list->getNextPolygon(); temp != NULL; temp = temp->getNextPolygon()) { monoChain *newLoop = directedLineLoopToMonoChainLoop(temp); @@ -329,7 +329,7 @@ static Int compEdges(directedLine *e1, directedLine *e2) e2_Ymin = h21; } */ - + if(head1[1]>tail1[1]) { e1_Ymax= head1[1]; e1_Ymin= tail1[1]; @@ -348,7 +348,7 @@ static Int compEdges(directedLine *e1, directedLine *e2) e2_Ymin = head2[1]; } - + /*Real e1_Ymax = max(head1[1], tail1[1]);*/ /*max(e1->head()[1], e1->tail()[1]);*/ /*Real e1_Ymin = min(head1[1], tail1[1]);*/ /*min(e1->head()[1], e1->tail()[1]);*/ /*Real e2_Ymax = max(head2[1], tail2[1]);*/ /*max(e2->head()[1], e2->tail()[1]);*/ @@ -356,7 +356,7 @@ static Int compEdges(directedLine *e1, directedLine *e2) Real Ymax = min(e1_Ymax, e2_Ymax); Real Ymin = max(e1_Ymin, e2_Ymin); - + Real y = 0.5*(Ymax + Ymin); /* Real x1 = intersectHoriz(e1->head()[0], e1->head()[1], e1->tail()[0], e1->tail()[1], y); @@ -416,7 +416,7 @@ directedLine* monoChain::find(Real y) current = temp->getNext(); ret = temp; } - return ret; + return ret; } void monoChain::printOneChain() @@ -426,7 +426,7 @@ void monoChain::printOneChain() { printf("(%f,%f) ", temp->head()[0], temp->head()[1]); } - printf("(%f,%f) \n", chainTail->head()[0], chainTail->head()[1]); + printf("(%f,%f) \n", chainTail->head()[0], chainTail->head()[1]); } void monoChain::printChainLoop() @@ -515,7 +515,7 @@ Int MC_sweepY(Int nVertices, monoChain** sortedVertices, sweepRange** ret_ranges //insert both edges treeNode* thisNode = TreeNodeMake(vert); treeNode* prevNode = TreeNodeMake(vert->getPrev()); - + vert->isKey = 1; vert->keyY = keyY; searchTree = TreeNodeInsert(searchTree, thisNode, (Int (*) (void *, void *))compChains); @@ -548,11 +548,11 @@ Int MC_sweepY(Int nVertices, monoChain** sortedVertices, sweepRange** ret_ranges } } else - { + { //printf("%i,%i\n", isAbove(dline, dline), isAbove(dline, dlinePrev)); errOccur = 1; goto JUMP_HERE; - + fprintf(stderr, "error in MC_sweepY\n"); exit(1); } @@ -563,9 +563,9 @@ Int MC_sweepY(Int nVertices, monoChain** sortedVertices, sweepRange** ret_ranges TreeNodeDeleteWholeTree(searchTree); return errOccur; } - + void MC_findDiagonals(Int total_num_edges, monoChain** sortedVertices, - sweepRange** ranges, Int& num_diagonals, + sweepRange** ranges, Int& num_diagonals, directedLine** diagonal_vertices) { Int i,j,k; @@ -573,7 +573,7 @@ void MC_findDiagonals(Int total_num_edges, monoChain** sortedVertices, //reset 'current' of all the monoChains for(i=0; iresetCurrent(); - + for(i=0; igetHead(); @@ -586,7 +586,7 @@ void MC_findDiagonals(Int total_num_edges, monoChain** sortedVertices, directedLine* leftEdge = ranges[i]->left; directedLine* rightEdge = ranges[i]->right; - + directedLine* leftVert = leftEdge; directedLine* rightVert = rightEdge->getNext(); assert(leftVert->head()[1] >= vert->head()[1]); @@ -597,7 +597,7 @@ void MC_findDiagonals(Int total_num_edges, monoChain** sortedVertices, { if(sortedVertices[j]->getHead()->head()[1] > minVert->head()[1]) break; - + if(sweepRangeEqual(ranges[i], ranges[j])) { found = 1; @@ -609,7 +609,7 @@ void MC_findDiagonals(Int total_num_edges, monoChain** sortedVertices, diagonal_vertices[k++] = sortedVertices[j]->getHead(); else diagonal_vertices[k++] = minVert; - } + } else if(isAbove(vert, thisEdge) && isAbove(vert, prevEdge) && compEdges(prevEdge, thisEdge)>0) { //downward interior cusp @@ -640,9 +640,9 @@ void MC_findDiagonals(Int total_num_edges, monoChain** sortedVertices, } num_diagonals = k/2; } - - - + + + directedLine* MC_partitionY(directedLine *polygons, sampledLine **retSampledLines) { @@ -654,7 +654,7 @@ directedLine* MC_partitionY(directedLine *polygons, sampledLine **retSampledLine if(total_num_chains<=2) //there is just one single monotone polygon { loopList->deleteLoopList(); - free(array); + free(array); *retSampledLines = NULL; return polygons; } @@ -662,7 +662,7 @@ directedLine* MC_partitionY(directedLine *polygons, sampledLine **retSampledLine //loopList->printAllLoops(); //printf("total_num_chains=%i\n", total_num_chains); quicksort( (void**)array, 0, total_num_chains-1, (Int (*)(void*, void*))compChainHeadInY); -//printf("after quicksort\n"); +//printf("after quicksort\n"); sweepRange** ranges = (sweepRange**)malloc(sizeof(sweepRange*) * (total_num_chains)); assert(ranges); @@ -670,7 +670,7 @@ directedLine* MC_partitionY(directedLine *polygons, sampledLine **retSampledLine if(MC_sweepY(total_num_chains, array, ranges)) { loopList->deleteLoopList(); - free(array); + free(array); *retSampledLines = NULL; return NULL; } @@ -717,14 +717,14 @@ directedLine* MC_partitionY(directedLine *polygons, sampledLine **retSampledLine directedLine* v2=diagonal_vertices[k+1]; directedLine* ret_p1; directedLine* ret_p2; - + /*we ahve to determine whether v1 and v2 belong to the same polygon before *their structure are modified by connectDiagonal(). */ /* directedLine *root1 = v1->findRoot(); directedLine *root2 = v2->findRoot(); - assert(root1); + assert(root1); assert(root2); */ @@ -762,14 +762,14 @@ root2->rootLinkSet(root1); ret_p1->rootLinkSet(root1); ret_p2->rootLinkSet(root1); - /*now that we have connected the diagonal v1 and v2, - *we have to check those unprocessed diagonals which + /*now that we have connected the diagonal v1 and v2, + *we have to check those unprocessed diagonals which *have v1 or v2 as an end point. Notice that the head of v1 *has the same coodinates as the head of v2->prev, and the head of - *v2 has the same coordinate as the head of v1->prev. + *v2 has the same coordinate as the head of v1->prev. *Suppose these is a diagonal (v1, x). If (v1,x) is still a valid - *diagonal, then x should be on the left hand side of the directed line: *v1->prev->head -- v1->head -- v1->tail. Otherwise, (v1,x) should be - *replaced by (v2->prev, x), that is, x is on the left of + *diagonal, then x should be on the left hand side of the directed line: *v1->prev->head -- v1->head -- v1->tail. Otherwise, (v1,x) should be + *replaced by (v2->prev, x), that is, x is on the left of * v2->prev->prev->head, v2->prev->head, v2->prev->tail. */ Int ii, kk; @@ -781,12 +781,12 @@ ret_p2->rootLinkSet(root1); /*check d1, and replace diagonal_vertices[kk] if necessary*/ if(d1 == v1) { /*check if d2 is to left of v1->prev->head:v1->head:v1->tail*/ - if(! pointLeft2Lines(v1->getPrev()->head(), + if(! pointLeft2Lines(v1->getPrev()->head(), v1->head(), v1->tail(), d2->head())) { /* assert(pointLeft2Lines(v2->getPrev()->getPrev()->head(), - v2->getPrev()->head(), + v2->getPrev()->head(), v2->getPrev()->tail(), d2->head())); */ diagonal_vertices[kk] = v2->getPrev(); @@ -808,11 +808,11 @@ ret_p2->rootLinkSet(root1); /*check d2 and replace diagonal_vertices[k+1] if necessary*/ if(d2 == v1) { /*check if d1 is to left of v1->prev->head:v1->head:v1->tail*/ - if(! pointLeft2Lines(v1->getPrev()->head(), + if(! pointLeft2Lines(v1->getPrev()->head(), v1->head(), v1->tail(), d1->head())) { /* assert(pointLeft2Lines(v2->getPrev()->getPrev()->head(), - v2->getPrev()->head(), + v2->getPrev()->head(), v2->getPrev()->tail(), d1->head())); */ diagonal_vertices[kk+1] = v2->getPrev(); @@ -830,7 +830,7 @@ ret_p2->rootLinkSet(root1); diagonal_vertices[kk+1] = v1->getPrev(); } } - } + } }/*end if (root1 not equal to root 2)*/ } @@ -842,7 +842,7 @@ ret_p2->rootLinkSet(root1); for(i=0,k=0; irootLinkSet(root1); - assert(root1); - assert(root2); + assert(root1); + assert(root2); assert(root1 == root2); - */ + */ sampledLine* generatedLine; @@ -882,7 +882,7 @@ ret_p2->rootLinkSet(root1); - for(Int j=i+1; jrootLinkSet(root1); if(temp1==v1 || temp1==v2 || temp2==v1 || temp2==v2) if(! temp1->samePolygon(temp1, temp2)) { - /*if temp1 and temp2 are in different polygons, + /*if temp1 and temp2 are in different polygons, *then one of them must be v1 or v2. */ assert(temp1==v1 || temp1 == v2 || temp2==v1 || temp2 ==v2); - if(temp1==v1) + if(temp1==v1) { diagonal_vertices[2*j] = v2->getPrev(); } @@ -909,7 +909,7 @@ ret_p2->rootLinkSet(root1); } if(temp1==v2) { - diagonal_vertices[2*j] = v1->getPrev(); + diagonal_vertices[2*j] = v1->getPrev(); } if(temp2==v2) { @@ -917,7 +917,7 @@ ret_p2->rootLinkSet(root1); } } } - } + } } @@ -932,5 +932,5 @@ ret_p2->rootLinkSet(root1); *retSampledLines = newSampledLines; return ret_polygons; } - + diff --git a/src/glu/sgi/libnurbs/nurbtess/monoChain.h b/src/glu/sgi/libnurbs/nurbtess/monoChain.h index 999f163..9a42ae7 100644 --- a/src/glu/sgi/libnurbs/nurbtess/monoChain.h +++ b/src/glu/sgi/libnurbs/nurbtess/monoChain.h @@ -44,20 +44,20 @@ class monoChain{ monoChain* next; monoChain* prev; monoChain* nextPolygon; //a list of polygons - + //cached informatin //bounding box Real minX, maxX, minY, maxY; Int isIncrease; - + //for efficiently comparing two chains directedLine* current; - + public: monoChain(directedLine* cHead, directedLine* cTail); ~monoChain() {} - + inline void setNext(monoChain* n) {next = n;} inline void setPrev(monoChain* p) {prev = p;} inline void setNextPolygon(monoChain* np) {nextPolygon = np;} @@ -65,7 +65,7 @@ class monoChain{ inline monoChain* getPrev() {return prev;} inline directedLine* getHead() {return chainHead;} inline directedLine* getTail() {return chainTail;} - + inline void resetCurrent() { current = ((isIncrease==1)? chainHead:chainTail);} void deleteLoop(); @@ -80,14 +80,14 @@ class monoChain{ Int toArraySingleLoop(monoChain** array, Int index); Int isKey; - Real keyY; //the current horizotal line + Real keyY; //the current horizotal line Real chainIntersectHoriz(Real y); //updates current incrementally for efficiency directedLine* find(Real y);//find dline so that y intersects dline. void printOneChain(); void printChainLoop(); void printAllLoops(); - + }; monoChain* directedLineLoopToMonoChainLoop(directedLine* loop); @@ -95,7 +95,7 @@ monoChain* directedLineLoopListToMonoChainLoopList(directedLine* list); Int MC_sweepY(Int nVertices, monoChain** sortedVertices, sweepRange** ret_ranges); void MC_findDiagonals(Int total_num_edges, monoChain** sortedVertices, - sweepRange** ranges, Int& num_diagonals, + sweepRange** ranges, Int& num_diagonals, directedLine** diagonal_vertices); directedLine* MC_partitionY(directedLine *polygons, sampledLine **retSampledLines); diff --git a/src/glu/sgi/libnurbs/nurbtess/monoPolyPart.cc b/src/glu/sgi/libnurbs/nurbtess/monoPolyPart.cc index 8391205..78c8094 100644 --- a/src/glu/sgi/libnurbs/nurbtess/monoPolyPart.cc +++ b/src/glu/sgi/libnurbs/nurbtess/monoPolyPart.cc @@ -6,21 +6,21 @@ ** this file except in compliance with the License. You may obtain a copy ** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600 ** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at: -** +** ** http://oss.sgi.com/projects/FreeB -** +** ** Note that, as provided in the License, the Software is distributed on an ** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS ** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND ** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A ** PARTICULAR PURPOSE, AND NON-INFRINGEMENT. -** +** ** Original Code. The Original Code is: OpenGL Sample Implementation, ** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, ** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. ** Copyright in any portions created by third parties is as indicated ** elsewhere herein. All Rights Reserved. -** +** ** Additional Notice Provisions: The application programming interfaces ** established by SGI in conjunction with the Original Code are The ** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released @@ -50,7 +50,7 @@ #include "directedLine.h" #include "monoPolyPart.h" -/*a vertex is u_maximal if both of its two neightbors are to the left of this +/*a vertex is u_maximal if both of its two neightbors are to the left of this *vertex */ static Int is_u_maximal(directedLine* v) @@ -62,7 +62,7 @@ static Int is_u_maximal(directedLine* v) return 0; } -/*a vertex is u_minimal if both of its two neightbors are to the right of this +/*a vertex is u_minimal if both of its two neightbors are to the right of this *vertex */ static Int is_u_minimal(directedLine* v) @@ -125,7 +125,7 @@ directedLine* monoPolyPart(directedLine* polygon) if(A->head()[0] < C->head()[0]) C = A; } - + //find B: the first u_minimal vertex on the right chain //and D: the right most vertex between top and B B = NULL; @@ -157,13 +157,13 @@ directedLine* monoPolyPart(directedLine* polygon) //find H on the right chain that is right above A for(tempV=topV; compV2InY(tempV->head(), A->head()) == 1; tempV = tempV->getPrev()); H = tempV->getNext(); - + //Main Loop directedLine* ret = NULL; directedLine* currentPolygon = polygon; while(1) { - //if both B and D are equal to botV, then this polygon is already + //if both B and D are equal to botV, then this polygon is already //u-monotone if(A == botV && B == botV) { @@ -253,7 +253,7 @@ directedLine* monoPolyPart(directedLine* polygon) F = G; //connect FB - polygon->connectDiagonal_2slines(F, B, + polygon->connectDiagonal_2slines(F, B, &ret_p1, &ret_p2, NULL); @@ -284,14 +284,14 @@ directedLine* monoPolyPart(directedLine* polygon) } //update G if(B == botV) - G = botV; + G = botV; else { for(tempV = G; compV2InY(tempV->head(), B->head()) == 1; tempV = tempV->getNext()); G = tempV->getPrev(); } } //end of A is below B - } //end not u-monotone + } //end not u-monotone } //end of main loop } diff --git a/src/glu/sgi/libnurbs/nurbtess/monoPolyPart.h b/src/glu/sgi/libnurbs/nurbtess/monoPolyPart.h index 6877a59..c14ddf4 100644 --- a/src/glu/sgi/libnurbs/nurbtess/monoPolyPart.h +++ b/src/glu/sgi/libnurbs/nurbtess/monoPolyPart.h @@ -33,7 +33,7 @@ #ifndef _MONO_POLY_PART_H #define _MONO_POLY_PART_H - + class directedLine; directedLine* monoPolyPart(directedLine* polygon); diff --git a/src/glu/sgi/libnurbs/nurbtess/monoTriangulation.cc b/src/glu/sgi/libnurbs/nurbtess/monoTriangulation.cc index 8e8d49d..d471cfa 100644 --- a/src/glu/sgi/libnurbs/nurbtess/monoTriangulation.cc +++ b/src/glu/sgi/libnurbs/nurbtess/monoTriangulation.cc @@ -6,21 +6,21 @@ ** this file except in compliance with the License. You may obtain a copy ** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600 ** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at: -** +** ** http://oss.sgi.com/projects/FreeB -** +** ** Note that, as provided in the License, the Software is distributed on an ** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS ** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND ** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A ** PARTICULAR PURPOSE, AND NON-INFRINGEMENT. -** +** ** Original Code. The Original Code is: OpenGL Sample Implementation, ** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, ** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. ** Copyright in any portions created by third parties is as indicated ** elsewhere herein. All Rights Reserved. -** +** ** Additional Notice Provisions: The application programming interfaces ** established by SGI in conjunction with the Original Code are The ** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released @@ -78,30 +78,30 @@ void monoTriangulationOpt(directedLine* poly, primStream* pStream) { directedLine* ret_p1; directedLine* ret_p2; - - new_polygon->connectDiagonal_2slines(new_polygon, other, + + new_polygon->connectDiagonal_2slines(new_polygon, other, &ret_p1, &ret_p2, new_polygon); - + monoTriangulationFun(ret_p1, compV2InX, pStream); monoTriangulationFun(ret_p2, compV2InX, pStream); - - ret_p1->deleteSinglePolygonWithSline(); - ret_p2->deleteSinglePolygonWithSline(); + + ret_p1->deleteSinglePolygonWithSline(); + ret_p2->deleteSinglePolygonWithSline(); } } else { //we need a general partitionX funtion (supposed to be in partitionX.C, //not implemented yet. XXX - monoTriangulationFun(poly, compV2InY, pStream); + monoTriangulationFun(poly, compV2InY, pStream); } - + free(cusps); } -void monoTriangulationRecOpt(Real* topVertex, Real* botVertex, +void monoTriangulationRecOpt(Real* topVertex, Real* botVertex, vertexArray* left_chain, Int left_current, vertexArray* right_chain, Int right_current, primStream* pStream) @@ -119,7 +119,7 @@ void monoTriangulationRecOpt(Real* topVertex, Real* botVertex, //now both left and right have at least two vertices each. Real left_v = left_chain->getVertex(left_current)[1]; Real right_v = right_chain->getVertex(right_current)[1]; - + if(left_v <= right_v) //first left vertex is below right { //find the last vertex of right which is above or equal to left @@ -159,19 +159,19 @@ void monoTriangulationRecOpt(Real* topVertex, Real* botVertex, } -void monoTriangulationRecGenTBOpt(Real* topVertex, Real* botVertex, +void monoTriangulationRecGenTBOpt(Real* topVertex, Real* botVertex, vertexArray* inc_chain, Int inc_current, Int inc_end, vertexArray* dec_chain, Int dec_current, Int dec_end, primStream* pStream) { pStream->triangle(topVertex, inc_chain->getVertex(inc_current), dec_chain->getVertex(dec_current)); - + /*printf("**(%f,%f)\n", inc_chain->getArray()[0][0],inc_chain->getArray()[0][1]);*/ triangulateXYMonoTB(inc_end-inc_current+1, inc_chain->getArray()+inc_current, dec_end-dec_current+1, dec_chain->getArray()+dec_current, pStream); pStream->triangle(botVertex, dec_chain->getVertex(dec_end), inc_chain->getVertex(inc_end)); } - + /*n_left>=1 *n_right>=1 @@ -200,7 +200,7 @@ void triangulateXYMonoTB(Int n_left, Real** leftVerts, j=1; topMostV = rightVerts[0]; } - + while(1) { if(i >= n_left) /*case1: no more in left*/ @@ -210,14 +210,14 @@ void triangulateXYMonoTB(Int n_left, Real** leftVerts, { pStream->begin(); pStream->insert(topMostV); - for(k=n_right-1; k>=j; k--) + for(k=n_right-1; k>=j; k--) pStream->insert(rightVerts[j]); pStream->end(PRIMITIVE_STREAM_FAN); - + } - break; + break; } else if(j>= n_right) /*case2: no more in right*/ { @@ -230,7 +230,7 @@ void triangulateXYMonoTB(Int n_left, Real** leftVerts, for(k=i; kinsert(leftVerts[k]); - pStream->end(PRIMITIVE_STREAM_FAN); + pStream->end(PRIMITIVE_STREAM_FAN); } break; @@ -245,7 +245,7 @@ void triangulateXYMonoTB(Int n_left, Real** leftVerts, pStream->insert(topMostV); - /*find the last k>=i such that + /*find the last k>=i such that *leftverts[k][1] >= rightverts[j][1] */ k=i; @@ -290,7 +290,7 @@ void triangulateXYMonoTB(Int n_left, Real** leftVerts, pStream->end(PRIMITIVE_STREAM_FAN); j=k+1; topMostV = rightVerts[j-1]; - } + } } } } @@ -320,13 +320,13 @@ static int chainConcave(vertexArray* dec_chain, Int dec_current, Int dec_end) } return 1; } - + void monoTriangulationRecGenInU(Real* topVertex, Real* botVertex, vertexArray* inc_chain, Int inc_current, Int inc_end, vertexArray* dec_chain, Int dec_current, Int dec_end, primStream* pStream) { - + } void monoTriangulationRecGenOpt(Real* topVertex, Real* botVertex, @@ -341,7 +341,7 @@ void monoTriangulationRecGenOpt(Real* topVertex, Real* botVertex, directedLine* poly; if(inc_current <= inc_end) //at least one vertex in inc_chain - { + { sline = new sampledLine(topVertex, inc_chain->getVertex(inc_current)); poly = new directedLine(INCREASING, sline); for(i=inc_current; i<=inc_end-1; i++) @@ -360,7 +360,7 @@ void monoTriangulationRecGenOpt(Real* topVertex, Real* botVertex, dline = new directedLine(INCREASING, sline); poly = dline; } - + assert(poly != NULL); if(dec_current <= dec_end) //at least on vertex in dec_Chain @@ -376,7 +376,7 @@ void monoTriangulationRecGenOpt(Real* topVertex, Real* botVertex, } sline = new sampledLine(dec_chain->getVertex(dec_current), topVertex); dline = new directedLine(INCREASING, sline); - poly->insert(dline); + poly->insert(dline); } else //dec_chain is empty { @@ -411,34 +411,34 @@ void monoTriangulationRecGenOpt(Real* topVertex, Real* botVertex, { directedLine* ret_p1; directedLine* ret_p2; - - new_polygon->connectDiagonal_2slines(new_polygon, other, + + new_polygon->connectDiagonal_2slines(new_polygon, other, &ret_p1, &ret_p2, new_polygon); - + monoTriangulationFun(ret_p1, compV2InX, pStream); monoTriangulationFun(ret_p2, compV2InX, pStream); - ret_p1->deleteSinglePolygonWithSline(); - ret_p2->deleteSinglePolygonWithSline(); + ret_p1->deleteSinglePolygonWithSline(); + ret_p2->deleteSinglePolygonWithSline(); } } else { //we need a general partitionX funtion (supposed to be in partitionX.C, //not implemented yet. XXX - //monoTriangulationFun(poly, compV2InY, pStream); - + //monoTriangulationFun(poly, compV2InY, pStream); + directedLine* new_polygon = polygonConvert(poly); directedLine* list = monoPolyPart(new_polygon); for(directedLine* temp = list; temp != NULL; temp = temp->getNextPolygon()) - { + { monoTriangulationFun(temp, compV2InX, pStream); } //clean up list->deletePolygonListWithSline(); - + } free(cusps); @@ -446,23 +446,23 @@ void monoTriangulationRecGenOpt(Real* topVertex, Real* botVertex, if(numInteriorCuspsX(poly) == 0) //is u monotone monoTriangulationFun(poly, compV2InX, pStream); else //it is not u motone - monoTriangulationFun(poly, compV2InY, pStream); + monoTriangulationFun(poly, compV2InY, pStream); */ //clean up space poly->deleteSinglePolygonWithSline(); return; } - - //apparently the following code is not reachable, + + //apparently the following code is not reachable, //it is for test purpose if(inc_current > inc_end || dec_current>dec_end) { monoTriangulationRecGen(topVertex, botVertex, inc_chain, inc_current, inc_end, dec_chain, dec_current, dec_end, - pStream); + pStream); return; } - + if( area(dec_chain->getVertex(dec_current), @@ -473,9 +473,9 @@ void monoTriangulationRecGenOpt(Real* topVertex, Real* botVertex, && area(inc_chain->getVertex(inc_end), botVertex, dec_chain->getVertex(dec_end)) >=0 ) { - monoTriangulationRecFunGen(topVertex, botVertex, + monoTriangulationRecFunGen(topVertex, botVertex, inc_chain, inc_current, inc_end, - dec_chain, dec_current, dec_end, + dec_chain, dec_current, dec_end, compV2InX, pStream); } else @@ -489,7 +489,7 @@ void monoTriangulationRecGenOpt(Real* topVertex, Real* botVertex, /*if inc_current>inc_end, then inc_chain has no points to be considered *same for dec_chain */ -void monoTriangulationRecGen(Real* topVertex, Real* botVertex, +void monoTriangulationRecGen(Real* topVertex, Real* botVertex, vertexArray* inc_chain, Int inc_current, Int inc_end, vertexArray* dec_chain, Int dec_current, Int dec_end, primStream* pStream) @@ -532,7 +532,7 @@ void monoTriangulationRecGen(Real* topVertex, Real* botVertex, inc_array = inc_chain -> getArray(); dec_array = dec_chain -> getArray(); - /*if top of inc_chain is 'lower' than top of dec_chain, process all the + /*if top of inc_chain is 'lower' than top of dec_chain, process all the *vertices on the dec_chain which are higher than top of inc_chain */ if(compV2InY(inc_array[inc_current], dec_array[dec_current]) <= 0) @@ -544,11 +544,11 @@ void monoTriangulationRecGen(Real* topVertex, Real* botVertex, { if(compV2InY(inc_array[inc_current], dec_array[i]) <= 0) rChain.processNewVertex(dec_array[i], pStream); - else + else break; } rChain.outputFan(inc_array[inc_current], pStream); - monoTriangulationRecGen(dec_array[i-1], botVertex, + monoTriangulationRecGen(dec_array[i-1], botVertex, inc_chain, inc_current, inc_end, dec_chain, i, dec_end, pStream); @@ -560,13 +560,13 @@ void monoTriangulationRecGen(Real* topVertex, Real* botVertex, rChain.processNewVertex(topVertex, pStream); for(i=inc_current; i<=inc_end; i++) { - if(compV2InY(inc_array[i], dec_array[dec_current]) >0) - rChain.processNewVertex(inc_array[i], pStream); + if(compV2InY(inc_array[i], dec_array[dec_current]) >0) + rChain.processNewVertex(inc_array[i], pStream); else break; } rChain.outputFan(dec_array[dec_current], pStream); - monoTriangulationRecGen(inc_array[i-1], botVertex, + monoTriangulationRecGen(inc_array[i-1], botVertex, inc_chain, i, inc_end, dec_chain, dec_current,dec_end, pStream); @@ -605,7 +605,7 @@ void monoTriangulationFun(directedLine* monoPolygon, Int (*compFun)(Real*, Real* inc_chain.appendVertex(tempV->getVertex(i)); } } - + vertexArray dec_chain(20); for(tempV = topV->getPrev(); tempV != botV; tempV = tempV->getPrev()) { @@ -613,15 +613,15 @@ void monoTriangulationFun(directedLine* monoPolygon, Int (*compFun)(Real*, Real* dec_chain.appendVertex(tempV->getVertex(i)); } } - for(i=botV->get_npoints()-2; i>=1; i--){ + for(i=botV->get_npoints()-2; i>=1; i--){ dec_chain.appendVertex(tempV->getVertex(i)); } - + if (!(0 == inc_chain.getNumElements() && 0 == dec_chain.getNumElements())) { monoTriangulationRecFun(topV->head(), botV->head(), &inc_chain, 0, &dec_chain, 0, compFun, pStream); } -} +} void monoTriangulation(directedLine* monoPolygon, primStream* pStream) { @@ -653,7 +653,7 @@ void monoTriangulation(directedLine* monoPolygon, primStream* pStream) inc_chain.appendVertex(tempV->getVertex(i)); } } - + vertexArray dec_chain(20); for(tempV = topV->getPrev(); tempV != botV; tempV = tempV->getPrev()) { @@ -661,10 +661,10 @@ void monoTriangulation(directedLine* monoPolygon, primStream* pStream) dec_chain.appendVertex(tempV->getVertex(i)); } } - for(i=botV->get_npoints()-2; i>=1; i--){ + for(i=botV->get_npoints()-2; i>=1; i--){ dec_chain.appendVertex(tempV->getVertex(i)); } - + monoTriangulationRec(topV->head(), botV->head(), &inc_chain, 0, &dec_chain, 0, pStream); } @@ -675,7 +675,7 @@ void monoTriangulation(directedLine* monoPolygon, primStream* pStream) *is increasing (left chain in V-monotone case) or decreaing (right chain *in V-monotone case). */ -void monoTriangulation2(Real* topVertex, Real* botVertex, +void monoTriangulation2(Real* topVertex, Real* botVertex, vertexArray* inc_chain, Int inc_smallIndex, Int inc_largeIndex, Int is_increase_chain, @@ -685,13 +685,13 @@ void monoTriangulation2(Real* topVertex, Real* botVertex, Real** inc_array ; if(inc_smallIndex > inc_largeIndex) - return; //no triangles + return; //no triangles if(inc_smallIndex == inc_largeIndex) { if(is_increase_chain) pStream->triangle(inc_chain->getVertex(inc_smallIndex), botVertex, topVertex); else - pStream->triangle(inc_chain->getVertex(inc_smallIndex), topVertex, botVertex); + pStream->triangle(inc_chain->getVertex(inc_smallIndex), topVertex, botVertex); return; } Int i; @@ -713,7 +713,7 @@ void monoTriangulation2(Real* topVertex, Real* botVertex, monoTriangulation2(topVertex, botVertex, inc_chain, inc_smallIndex+1, inc_largeIndex, is_increase_chain, pStream); return ; - } + } inc_array = inc_chain->getArray(); @@ -727,11 +727,11 @@ void monoTriangulation2(Real* topVertex, Real* botVertex, rChain.processNewVertex(botVertex, pStream); } - + /*if compFun == compV2InY, top to bottom: V-monotone *if compFun == compV2InX, right to left: U-monotone */ -void monoTriangulationRecFunGen(Real* topVertex, Real* botVertex, +void monoTriangulationRecFunGen(Real* topVertex, Real* botVertex, vertexArray* inc_chain, Int inc_current, Int inc_end, vertexArray* dec_chain, Int dec_current, Int dec_end, Int (*compFun)(Real*, Real*), @@ -782,7 +782,7 @@ void monoTriangulationRecFunGen(Real* topVertex, Real* botVertex, inc_array = inc_chain -> getArray(); dec_array = dec_chain -> getArray(); - /*if top of inc_chain is 'lower' than top of dec_chain, process all the + /*if top of inc_chain is 'lower' than top of dec_chain, process all the *vertices on the dec_chain which are higher than top of inc_chain */ if(compFun(inc_array[inc_current], dec_array[dec_current]) <= 0) @@ -794,11 +794,11 @@ void monoTriangulationRecFunGen(Real* topVertex, Real* botVertex, { if(compFun(inc_array[inc_current], dec_array[i]) <= 0) rChain.processNewVertex(dec_array[i], pStream); - else + else break; } rChain.outputFan(inc_array[inc_current], pStream); - monoTriangulationRecFunGen(dec_array[i-1], botVertex, + monoTriangulationRecFunGen(dec_array[i-1], botVertex, inc_chain, inc_current, inc_end, dec_chain, i, dec_end, compFun, @@ -811,13 +811,13 @@ void monoTriangulationRecFunGen(Real* topVertex, Real* botVertex, rChain.processNewVertex(topVertex, pStream); for(i=inc_current; i<=inc_end; i++) { - if(compFun(inc_array[i], dec_array[dec_current]) >0) - rChain.processNewVertex(inc_array[i], pStream); + if(compFun(inc_array[i], dec_array[dec_current]) >0) + rChain.processNewVertex(inc_array[i], pStream); else break; } rChain.outputFan(dec_array[dec_current], pStream); - monoTriangulationRecFunGen(inc_array[i-1], botVertex, + monoTriangulationRecFunGen(inc_array[i-1], botVertex, inc_chain, i,inc_end, dec_chain, dec_current,dec_end, compFun, @@ -825,11 +825,11 @@ void monoTriangulationRecFunGen(Real* topVertex, Real* botVertex, } }/*end case neither is empty*/ } - + /*if compFun == compV2InY, top to bottom: V-monotone *if compFun == compV2InX, right to left: U-monotone */ -void monoTriangulationRecFun(Real* topVertex, Real* botVertex, +void monoTriangulationRecFun(Real* topVertex, Real* botVertex, vertexArray* inc_chain, Int inc_current, vertexArray* dec_chain, Int dec_current, Int (*compFun)(Real*, Real*), @@ -849,7 +849,7 @@ void monoTriangulationRecFun(Real* topVertex, Real* botVertex, { dec_array = dec_chain->getArray(); - dec_nVertices = dec_chain->getNumElements(); + dec_nVertices = dec_chain->getNumElements(); reflexChain rChain(20,0); /*put the top vertex into the reflex chain*/ rChain.processNewVertex(topVertex, pStream); @@ -881,7 +881,7 @@ void monoTriangulationRecFun(Real* topVertex, Real* botVertex, dec_array = dec_chain -> getArray(); inc_nVertices= inc_chain->getNumElements(); dec_nVertices= dec_chain->getNumElements(); - /*if top of inc_chain is 'lower' than top of dec_chain, process all the + /*if top of inc_chain is 'lower' than top of dec_chain, process all the *vertices on the dec_chain which are higher than top of inc_chain */ if(compFun(inc_array[inc_current], dec_array[dec_current]) <= 0) @@ -893,11 +893,11 @@ void monoTriangulationRecFun(Real* topVertex, Real* botVertex, { if(compFun(inc_array[inc_current], dec_array[i]) <= 0) rChain.processNewVertex(dec_array[i], pStream); - else + else break; } rChain.outputFan(inc_array[inc_current], pStream); - monoTriangulationRecFun(dec_array[i-1], botVertex, + monoTriangulationRecFun(dec_array[i-1], botVertex, inc_chain, inc_current, dec_chain, i, compFun, @@ -910,13 +910,13 @@ void monoTriangulationRecFun(Real* topVertex, Real* botVertex, rChain.processNewVertex(topVertex, pStream); for(i=inc_current; i0) - rChain.processNewVertex(inc_array[i], pStream); + if(compFun(inc_array[i], dec_array[dec_current]) >0) + rChain.processNewVertex(inc_array[i], pStream); else break; } rChain.outputFan(dec_array[dec_current], pStream); - monoTriangulationRecFun(inc_array[i-1], botVertex, + monoTriangulationRecFun(inc_array[i-1], botVertex, inc_chain, i, dec_chain, dec_current, compFun, @@ -926,7 +926,7 @@ void monoTriangulationRecFun(Real* topVertex, Real* botVertex, } -void monoTriangulationRec(Real* topVertex, Real* botVertex, +void monoTriangulationRec(Real* topVertex, Real* botVertex, vertexArray* inc_chain, Int inc_current, vertexArray* dec_chain, Int dec_current, primStream* pStream) @@ -945,7 +945,7 @@ void monoTriangulationRec(Real* topVertex, Real* botVertex, { dec_array = dec_chain->getArray(); - dec_nVertices = dec_chain->getNumElements(); + dec_nVertices = dec_chain->getNumElements(); reflexChain rChain(20,0); /*put the top vertex into the reflex chain*/ rChain.processNewVertex(topVertex, pStream); @@ -977,7 +977,7 @@ void monoTriangulationRec(Real* topVertex, Real* botVertex, dec_array = dec_chain -> getArray(); inc_nVertices= inc_chain->getNumElements(); dec_nVertices= dec_chain->getNumElements(); - /*if top of inc_chain is 'lower' than top of dec_chain, process all the + /*if top of inc_chain is 'lower' than top of dec_chain, process all the *vertices on the dec_chain which are higher than top of inc_chain */ if(compV2InY(inc_array[inc_current], dec_array[dec_current]) <= 0) @@ -989,11 +989,11 @@ void monoTriangulationRec(Real* topVertex, Real* botVertex, { if(compV2InY(inc_array[inc_current], dec_array[i]) <= 0) rChain.processNewVertex(dec_array[i], pStream); - else + else break; } rChain.outputFan(inc_array[inc_current], pStream); - monoTriangulationRec(dec_array[i-1], botVertex, + monoTriangulationRec(dec_array[i-1], botVertex, inc_chain, inc_current, dec_chain, i, pStream); @@ -1005,23 +1005,23 @@ void monoTriangulationRec(Real* topVertex, Real* botVertex, rChain.processNewVertex(topVertex, pStream); for(i=inc_current; i0) - rChain.processNewVertex(inc_array[i], pStream); + if(compV2InY(inc_array[i], dec_array[dec_current]) >0) + rChain.processNewVertex(inc_array[i], pStream); else break; } rChain.outputFan(dec_array[dec_current], pStream); - monoTriangulationRec(inc_array[i-1], botVertex, + monoTriangulationRec(inc_array[i-1], botVertex, inc_chain, i, dec_chain, dec_current, pStream); } }/*end case neither is empty*/ } - -/* the name here assumes that the polygon is Y-monotone, but + +/* the name here assumes that the polygon is Y-monotone, but *this function also works for X-monotone polygons. * a monotne polygon consists of two extrem verteices: topVertex and botVertex, and *two monotone chains: inc_chain, and dec_chain. The edges of the increasing chain (inc_chain) @@ -1030,8 +1030,8 @@ void monoTriangulationRec(Real* topVertex, Real* botVertex, * inc_index index the vertex which is the toppest of the inc_chain which we are handling currently. * dec_index index the vertex which is the toppest of the dec_chain which we are handling currently. */ -void monoTriangulationRec(directedLine* inc_chain, Int inc_index, - directedLine* dec_chain, Int dec_index, +void monoTriangulationRec(directedLine* inc_chain, Int inc_index, + directedLine* dec_chain, Int dec_index, directedLine* topVertex, Int top_index, directedLine* botVertex, primStream* pStream) @@ -1039,9 +1039,9 @@ void monoTriangulationRec(directedLine* inc_chain, Int inc_index, Int i; directedLine *temp, *oldtemp = NULL; Int tempIndex, oldtempIndex = 0; - + assert(inc_chain != NULL && dec_chain != NULL); - + if(inc_chain == botVertex) { reflexChain rChain(20, 0); rChain.processNewVertex(topVertex->getVertex(top_index), pStream); @@ -1078,7 +1078,7 @@ void monoTriangulationRec(directedLine* inc_chain, Int inc_index, oldtemp = temp; oldtempIndex = tempIndex; rChain.processNewVertex(temp->getVertex(tempIndex), pStream); - + if(tempIndex == temp->get_npoints()-1){ tempIndex = 0; temp = temp->getPrev(); @@ -1099,7 +1099,7 @@ void monoTriangulationRec(directedLine* inc_chain, Int inc_index, oldtemp = temp; oldtempIndex = tempIndex; rChain.processNewVertex(temp->getVertex(tempIndex), pStream); - + if(tempIndex == temp->get_npoints()-1){ tempIndex = 0; temp = temp->getNext(); @@ -1109,7 +1109,7 @@ void monoTriangulationRec(directedLine* inc_chain, Int inc_index, } } rChain.outputFan(dec_chain->getVertex(dec_index), pStream); - monoTriangulationRec(temp, tempIndex, dec_chain, dec_index, oldtemp, oldtempIndex, botVertex, pStream); + monoTriangulationRec(temp, tempIndex, dec_chain, dec_index, oldtemp, oldtempIndex, botVertex, pStream); } } /*end case neither reached the bottom*/ } @@ -1175,7 +1175,7 @@ void vertexArray::print() Int vertexArray::findIndexAbove(Real v) { Int i; - if(index == 0) + if(index == 0) return -1; else if(array[0][1] < v) return -1; @@ -1201,7 +1201,7 @@ Int vertexArray::findIndexAbove(Real v) Int vertexArray::findIndexBelowGen(Real v, Int startIndex, Int endIndex) { Int i; - if(startIndex > endIndex) + if(startIndex > endIndex) return endIndex+1; else if(array[endIndex][1] > v) return endIndex+1; @@ -1227,7 +1227,7 @@ Int vertexArray::findIndexBelowGen(Real v, Int startIndex, Int endIndex) Int vertexArray::findIndexStrictBelowGen(Real v, Int startIndex, Int endIndex) { Int i; - if(startIndex > endIndex) + if(startIndex > endIndex) return endIndex+1; else if(array[endIndex][1] >= v) return endIndex+1; @@ -1254,7 +1254,7 @@ Int vertexArray::findIndexFirstAboveEqualGen(Real v, Int startIndex, Int endInde { Int i; - if(startIndex > endIndex) + if(startIndex > endIndex) return startIndex-1; else if(array[startIndex][1] < v) return startIndex-1; @@ -1288,7 +1288,7 @@ Int vertexArray::findIndexFirstAboveEqualGen(Real v, Int startIndex, Int endInde Int vertexArray::findIndexAboveGen(Real v, Int startIndex, Int endIndex) { Int i; - if(startIndex > endIndex) + if(startIndex > endIndex) return startIndex-1; else if(array[startIndex][1] < v) return startIndex-1; @@ -1327,11 +1327,11 @@ Int vertexArray::skipEqualityFromStart(Real v, Int start, Int end) return start; //now array[start][1] == v for(i=start+1; i<= end; i++) - if(array[i][1] != v) + if(array[i][1] != v) break; return i-1; } - + /***************************vertexArray end****************************************/ @@ -1368,7 +1368,7 @@ void reflexChain::insert(Real u, Real v) temp[i][0] = queue[i][0]; temp[i][1] = queue[i][1]; } - + free(queue); queue = temp; size_queue = 2*size_queue + 1; @@ -1412,7 +1412,7 @@ void reflexChain::outputFan(Real v[2], primStream* pStream) } else { for(i=index_queue-1; i>=0; i--) - pStream->insert(queue[i]); + pStream->insert(queue[i]); } pStream->end(PRIMITIVE_STREAM_FAN); } @@ -1427,16 +1427,16 @@ void reflexChain::processNewVertex(Real v[2], primStream* pStream) insert(v); return; } - + /*there are at least two vertices in the queue*/ j=index_queue-1; - + for(i=j; i>=1; i--) { if(isIncreasing) { isReflex = (area(queue[i-1], queue[i], v) <= 0.0); } else /*decreasing*/{ - isReflex = (area(v, queue[i], queue[i-1]) <= 0.0); + isReflex = (area(v, queue[i], queue[i-1]) <= 0.0); } if(isReflex) { break; @@ -1445,10 +1445,10 @@ void reflexChain::processNewVertex(Real v[2], primStream* pStream) /* *if ibegin(); pStream->insert(v); @@ -1460,7 +1460,7 @@ void reflexChain::processNewVertex(Real v[2], primStream* pStream) for(k=j; k>=i; k--) pStream->insert(queue[k]); } - + pStream->end(PRIMITIVE_STREAM_FAN); } diff --git a/src/glu/sgi/libnurbs/nurbtess/monoTriangulation.h b/src/glu/sgi/libnurbs/nurbtess/monoTriangulation.h index f78b8f4..f9c972a 100644 --- a/src/glu/sgi/libnurbs/nurbtess/monoTriangulation.h +++ b/src/glu/sgi/libnurbs/nurbtess/monoTriangulation.h @@ -41,23 +41,23 @@ class Backend; class reflexChain{ - Real2 *queue; - /*the order of the polygon vertices: either q[0],q[1].., or + Real2 *queue; + /*the order of the polygon vertices: either q[0],q[1].., or * q[n-1], q[n-2], ..., q[0] *this order determines the interior of the polygon, so it *also used to determines whether a chain is reflex or convex */ - Int isIncreasing; + Int isIncreasing; Int index_queue; Int size_queue; /*allocated size*/ - + public: reflexChain(Int size, Int isIncreasing); ~reflexChain(); - + void insert(Real u, Real v); void insert(Real v[2]); - + void processNewVertex(Real v[2], primStream* pStream); void outputFan(Real v[2], primStream* pStream); @@ -70,7 +70,7 @@ class reflexChain{ /*dynamic array of pointers to reals. *Intended to store an array of (u,v). *Notice that it doesn't allocate or dealocate the space - *for the (u,v) themselfs. So it assums that someone else + *for the (u,v) themselfs. So it assums that someone else *is taking care of them, while this class only plays with *the pointers. */ @@ -99,13 +99,13 @@ class vertexArray{ void monoTriangulation(directedLine* monoPolygon, primStream* pStream); -void monoTriangulationRec(Real* topVertex, Real* botVertex, +void monoTriangulationRec(Real* topVertex, Real* botVertex, vertexArray* inc_chain, Int inc_current, vertexArray* dec_chain, Int dec_current, primStream* pStream); -void monoTriangulationRec(directedLine* inc_chain, Int inc_index, - directedLine* dec_chain, Int dec_index, +void monoTriangulationRec(directedLine* inc_chain, Int inc_index, + directedLine* dec_chain, Int dec_index, directedLine* topVertex, Int top_index, directedLine* botVertex, primStream* pStream); @@ -116,60 +116,60 @@ void monoTriangulationRec(directedLine* inc_chain, Int inc_index, *is increasing (left chain in V-monotone case) or decreaing (right chain *in V-monotone case). */ -void monoTriangulation2(Real* topVertex, Real* botVertex, +void monoTriangulation2(Real* topVertex, Real* botVertex, vertexArray* inc_chain, Int inc_smallIndex, Int inc_largeIndex, Int is_increase_chain, primStream* pStream); -void monoTriangulationRecGen(Real* topVertex, Real* botVertex, +void monoTriangulationRecGen(Real* topVertex, Real* botVertex, vertexArray* inc_chain, Int inc_current, Int inc_end, vertexArray* dec_chain, Int dec_current, Int dec_end, - primStream* pStream); + primStream* pStream); -void monoTriangulationRecGenOpt(Real* topVertex, Real* botVertex, +void monoTriangulationRecGenOpt(Real* topVertex, Real* botVertex, vertexArray* inc_chain, Int inc_current, Int inc_end, vertexArray* dec_chain, Int dec_current, Int dec_end, - primStream* pStream); + primStream* pStream); void triangulateXYMonoTB(Int n_left, Real** leftVerts, Int n_right, Real** rightVerts, primStream* pStream); -void monoTriangulationRecGenTBOpt(Real* topVertex, Real* botVertex, +void monoTriangulationRecGenTBOpt(Real* topVertex, Real* botVertex, vertexArray* inc_chain, Int inc_current, Int inc_end, vertexArray* dec_chain, Int dec_current, Int dec_end, primStream* pStream); -void monoTriangulationRecOpt(Real* topVertex, Real* botVertex, +void monoTriangulationRecOpt(Real* topVertex, Real* botVertex, vertexArray* left_chain, Int left_current, vertexArray* right_chain, Int right_current, primStream* pStream); -void monoTriangulationRecFunGen(Real* topVertex, Real* botVertex, +void monoTriangulationRecFunGen(Real* topVertex, Real* botVertex, vertexArray* inc_chain, Int inc_current, Int inc_end, vertexArray* dec_chain, Int dec_current, Int dec_end, Int (*compFun)(Real*, Real*), primStream* pStream); -void monoTriangulationRecFun(Real* topVertex, Real* botVertex, +void monoTriangulationRecFun(Real* topVertex, Real* botVertex, vertexArray* inc_chain, Int inc_current, vertexArray* dec_chain, Int dec_current, Int (*compFun)(Real*, Real*), primStream* pStream); -void monoTriangulationFun(directedLine* monoPolygon, +void monoTriangulationFun(directedLine* monoPolygon, Int (*compFun)(Real*, Real*), primStream* pStream); -void monoTriangulationRec(Real* topVertex, Real* botVertex, +void monoTriangulationRec(Real* topVertex, Real* botVertex, vertexArray* inc_chain, Int inc_current, vertexArray* dec_chain, Int dec_current, Backend* backend); void monoTriangulationFunBackend(Arc_ptr loop, Int (*compFun)(Real*, Real*), Backend* backend); -void monoTriangulationRecFunBackend(Real* topVertex, Real* botVertex, +void monoTriangulationRecFunBackend(Real* topVertex, Real* botVertex, vertexArray* inc_chain, Int inc_current, vertexArray* dec_chain, Int dec_current, Int (*compFun)(Real*, Real*), diff --git a/src/glu/sgi/libnurbs/nurbtess/partitionX.cc b/src/glu/sgi/libnurbs/nurbtess/partitionX.cc index e25e30b..11ffb36 100644 --- a/src/glu/sgi/libnurbs/nurbtess/partitionX.cc +++ b/src/glu/sgi/libnurbs/nurbtess/partitionX.cc @@ -6,21 +6,21 @@ ** this file except in compliance with the License. You may obtain a copy ** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600 ** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at: -** +** ** http://oss.sgi.com/projects/FreeB -** +** ** Note that, as provided in the License, the Software is distributed on an ** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS ** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND ** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A ** PARTICULAR PURPOSE, AND NON-INFRINGEMENT. -** +** ** Original Code. The Original Code is: OpenGL Sample Implementation, ** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, ** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. ** Copyright in any portions created by third parties is as indicated ** elsewhere herein. All Rights Reserved. -** +** ** Additional Notice Provisions: The application programming interfaces ** established by SGI in conjunction with the Original Code are The ** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released @@ -40,9 +40,9 @@ #include "partitionX.h" -#define CONCAVITY_ZERO 1.0e-6 //this number is used to test whether a vertex is concave (refelx) - //or not. The test needs to compute the area of the three adjacent - //vertices to see if the are is positive or negative. +#define CONCAVITY_ZERO 1.0e-6 //this number is used to test whether a vertex is concave (refelx) + //or not. The test needs to compute the area of the three adjacent + //vertices to see if the are is positive or negative. Int isCuspX(directedLine *v) { @@ -52,10 +52,10 @@ Int isCuspX(directedLine *v) Real* P = v->getPrev()->head(); Real* N = v->getNext()->head(); if( - (compV2InX(T,P) != -1 && + (compV2InX(T,P) != -1 && compV2InX(T,N) != -1 ) || - (compV2InX(T,P) != 1 && + (compV2InX(T,P) != 1 && compV2InX(T,N) != 1 ) ) @@ -81,7 +81,7 @@ Int isReflexX(directedLine* v) } -/*return +/*return *0: not-cusp *1: interior cusp *2: exterior cusp @@ -89,10 +89,10 @@ Int isReflexX(directedLine* v) Int cuspTypeX(directedLine *v) { if(! isCuspX(v)) return 0; - else + else { //printf("isCusp,%f,%f\n", v->head()[0], v->head()[1]); - if(isReflexX(v)) + if(isReflexX(v)) { // printf("isReflex\n"); return 1; @@ -116,7 +116,7 @@ Int numInteriorCuspsX(directedLine *polygon) ret++; return ret; } - + void findInteriorCuspsX(directedLine *polygon, Int& ret_n_interior_cusps, directedLine** ret_interior_cusps) @@ -127,10 +127,10 @@ void findInteriorCuspsX(directedLine *polygon, Int& ret_n_interior_cusps, { ret_interior_cusps[ret_n_interior_cusps++] = polygon; } - for(temp = polygon->getNext(); temp != polygon; temp = temp->getNext()) + for(temp = polygon->getNext(); temp != polygon; temp = temp->getNext()) if(cuspTypeX(temp) == 1) { - ret_interior_cusps[ret_n_interior_cusps++] = temp; + ret_interior_cusps[ret_n_interior_cusps++] = temp; } } @@ -143,20 +143,20 @@ directedLine* findDiagonal_singleCuspX(directedLine* cusp) for(temp = cusp->getNext(); temp != cusp; temp = temp->getNext()) { if(compV2InX(cusp->head(), temp->head()) == 1) - { + { return temp; } } - else //is maxmal + else //is maxmal for(temp = cusp->getNext(); temp != cusp; temp = temp->getNext()) { if(compV2InX(cusp->head(), temp->head()) == -1) - { + { return temp; } } return NULL; } - - + + diff --git a/src/glu/sgi/libnurbs/nurbtess/partitionY.cc b/src/glu/sgi/libnurbs/nurbtess/partitionY.cc index e097461..a69d34f 100644 --- a/src/glu/sgi/libnurbs/nurbtess/partitionY.cc +++ b/src/glu/sgi/libnurbs/nurbtess/partitionY.cc @@ -6,21 +6,21 @@ ** this file except in compliance with the License. You may obtain a copy ** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600 ** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at: -** +** ** http://oss.sgi.com/projects/FreeB -** +** ** Note that, as provided in the License, the Software is distributed on an ** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS ** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND ** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A ** PARTICULAR PURPOSE, AND NON-INFRINGEMENT. -** +** ** Original Code. The Original Code is: OpenGL Sample Implementation, ** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, ** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. ** Copyright in any portions created by third parties is as indicated ** elsewhere herein. All Rights Reserved. -** +** ** Additional Notice Provisions: The application programming interfaces ** established by SGI in conjunction with the Original Code are The ** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released @@ -50,14 +50,14 @@ #define min(a,b) ((a>b)? b:a) -/*retrurn +/*retrurn *-1: if A < B (YaB */ static Int compVertInY(Real A[2], Real B[2]) { - if( (A[1] < B[1]) || (A[1]==B[1] && A[0]head(); - if( compVertInY(e->head(), vert) != 1 + if( compVertInY(e->head(), vert) != 1 && compVertInY(e->tail(), vert) != 1 ) return 1; @@ -89,7 +89,7 @@ Int isBelow(directedLine *v, directedLine *e) Int isAbove(directedLine *v, directedLine *e) { Real* vert = v->head(); - if( compVertInY(e->head(), vert) != -1 + if( compVertInY(e->head(), vert) != -1 && compVertInY(e->tail(), vert) != -1 ) return 1; @@ -134,7 +134,7 @@ Int isReflex(directedLine *v) else return 0; } - /*return + /*return *0: not-cusp *1: interior cusp *2: exterior cusp @@ -168,10 +168,10 @@ Int sweepRangeEqual(sweepRange* src1, sweepRange* src2) { Int leftEqual; Int rightEqual; - - + + /*The case when both are vertices should not happen*/ - assert(! (src1->leftType == 0 && src2->leftType == 0)); + assert(! (src1->leftType == 0 && src2->leftType == 0)); if(src1->leftType == 0 && src2->leftType == 1){ if(src1->left == src2->left || src1->left->getPrev() == src2->left @@ -191,13 +191,13 @@ Int sweepRangeEqual(sweepRange* src1, sweepRange* src2) src1->left == src2->left->getPrev() ) leftEqual = 1; - else + else leftEqual = 0; } /*the same thing for right*/ /*The case when both are vertices should not happen*/ - assert(! (src1->rightType == 0 && src2->rightType == 0)); + assert(! (src1->rightType == 0 && src2->rightType == 0)); if(src1->rightType == 0 && src2->rightType == 1){ if(src1->right == src2->right || src1->right->getPrev() == src2->right @@ -217,10 +217,10 @@ Int sweepRangeEqual(sweepRange* src1, sweepRange* src2) src1->right == src2->right->getPrev() ) rightEqual = 1; - else + else rightEqual = 0; } - + return (leftEqual == 1 || rightEqual == 1); } @@ -279,7 +279,7 @@ static Int compEdges(directedLine *e1, directedLine *e2) e2_Ymin = h21; } */ - + if(head1[1]>tail1[1]) { e1_Ymax= head1[1]; e1_Ymin= tail1[1]; @@ -298,7 +298,7 @@ static Int compEdges(directedLine *e1, directedLine *e2) e2_Ymin = head2[1]; } - + /*Real e1_Ymax = max(head1[1], tail1[1]);*/ /*max(e1->head()[1], e1->tail()[1]);*/ /*Real e1_Ymin = min(head1[1], tail1[1]);*/ /*min(e1->head()[1], e1->tail()[1]);*/ /*Real e2_Ymax = max(head2[1], tail2[1]);*/ /*max(e2->head()[1], e2->tail()[1]);*/ @@ -306,7 +306,7 @@ static Int compEdges(directedLine *e1, directedLine *e2) Real Ymax = min(e1_Ymax, e2_Ymax); Real Ymin = max(e1_Ymin, e2_Ymin); - + Real y = Real(0.5)*(Ymax + Ymin); /* Real x1 = intersectHoriz(e1->head()[0], e1->head()[1], e1->tail()[0], e1->tail()[1], y); @@ -322,7 +322,7 @@ static Int compEdges(directedLine *e1, directedLine *e2) if(x1<= x2) return -1; else return 1; } - + /*used by sort precedures */ static Int compInY(directedLine* v1, directedLine* v2) @@ -342,7 +342,7 @@ void findDiagonals(Int total_num_edges, directedLine** sortedVertices, sweepRang directedLine* thisEdge = vert; directedLine* prevEdge = vert->getPrev(); /* -printf("find i=%i\n", i); +printf("find i=%i\n", i); printf("the vertex is\n"); vert->printSingle(); */ @@ -398,12 +398,12 @@ Int deleteRepeatDiagonals(Int num_diagonals, directedLine** diagonal_vertices, d for(j=0,l=0; jfindRoot(); directedLine *root2 = v2->findRoot(); - assert(root1); + assert(root1); assert(root2); */ @@ -548,14 +548,14 @@ root2->rootLinkSet(root1); ret_p1->rootLinkSet(root1); ret_p2->rootLinkSet(root1); - /*now that we have connected the diagonal v1 and v2, - *we have to check those unprocessed diagonals which + /*now that we have connected the diagonal v1 and v2, + *we have to check those unprocessed diagonals which *have v1 or v2 as an end point. Notice that the head of v1 *has the same coodinates as the head of v2->prev, and the head of - *v2 has the same coordinate as the head of v1->prev. + *v2 has the same coordinate as the head of v1->prev. *Suppose these is a diagonal (v1, x). If (v1,x) is still a valid - *diagonal, then x should be on the left hand side of the directed line: *v1->prev->head -- v1->head -- v1->tail. Otherwise, (v1,x) should be - *replaced by (v2->prev, x), that is, x is on the left of + *diagonal, then x should be on the left hand side of the directed line: *v1->prev->head -- v1->head -- v1->tail. Otherwise, (v1,x) should be + *replaced by (v2->prev, x), that is, x is on the left of * v2->prev->prev->head, v2->prev->head, v2->prev->tail. */ Int ii, kk; @@ -567,12 +567,12 @@ ret_p2->rootLinkSet(root1); /*check d1, and replace diagonal_vertices[kk] if necessary*/ if(d1 == v1) { /*check if d2 is to left of v1->prev->head:v1->head:v1->tail*/ - if(! pointLeft2Lines(v1->getPrev()->head(), + if(! pointLeft2Lines(v1->getPrev()->head(), v1->head(), v1->tail(), d2->head())) { /* assert(pointLeft2Lines(v2->getPrev()->getPrev()->head(), - v2->getPrev()->head(), + v2->getPrev()->head(), v2->getPrev()->tail(), d2->head())); */ diagonal_vertices[kk] = v2->getPrev(); @@ -594,11 +594,11 @@ ret_p2->rootLinkSet(root1); /*check d2 and replace diagonal_vertices[k+1] if necessary*/ if(d2 == v1) { /*check if d1 is to left of v1->prev->head:v1->head:v1->tail*/ - if(! pointLeft2Lines(v1->getPrev()->head(), + if(! pointLeft2Lines(v1->getPrev()->head(), v1->head(), v1->tail(), d1->head())) { /* assert(pointLeft2Lines(v2->getPrev()->getPrev()->head(), - v2->getPrev()->head(), + v2->getPrev()->head(), v2->getPrev()->tail(), d1->head())); */ diagonal_vertices[kk+1] = v2->getPrev(); @@ -616,7 +616,7 @@ ret_p2->rootLinkSet(root1); diagonal_vertices[kk+1] = v1->getPrev(); } } - } + } }/*end if (root1 not equal to root 2)*/ } @@ -625,7 +625,7 @@ ret_p2->rootLinkSet(root1); for(i=0,k=0; irootLinkSet(root1); - assert(root1); - assert(root2); + assert(root1); + assert(root2); assert(root1 == root2); - */ + */ sampledLine* generatedLine; @@ -665,7 +665,7 @@ ret_p2->rootLinkSet(root1); - for(Int j=i+1; jrootLinkSet(root1); if(temp1==v1 || temp1==v2 || temp2==v1 || temp2==v2) if(! temp1->samePolygon(temp1, temp2)) { - /*if temp1 and temp2 are in different polygons, + /*if temp1 and temp2 are in different polygons, *then one of them must be v1 or v2. */ assert(temp1==v1 || temp1 == v2 || temp2==v1 || temp2 ==v2); - if(temp1==v1) + if(temp1==v1) { diagonal_vertices[2*j] = v2->getPrev(); } @@ -692,7 +692,7 @@ ret_p2->rootLinkSet(root1); } if(temp1==v2) { - diagonal_vertices[2*j] = v1->getPrev(); + diagonal_vertices[2*j] = v1->getPrev(); } if(temp2==v2) { @@ -700,7 +700,7 @@ ret_p2->rootLinkSet(root1); } } } - } + } } @@ -713,12 +713,12 @@ ret_p2->rootLinkSet(root1); *retSampledLines = newSampledLines; return ret_polygons; } - -/*given a set of simple polygons where the interior + +/*given a set of simple polygons where the interior *is decided by left-hand principle, *return a range (sight) for each vertex. This is called *Trapezoidalization. - */ + */ void sweepY(Int nVertices, directedLine** sortedVertices, sweepRange** ret_ranges) { Int i; @@ -733,12 +733,12 @@ void sweepY(Int nVertices, directedLine** sortedVertices, sweepRange** ret_range directedLine* thisEdge = vert; directedLine* prevEdge = vert->getPrev(); - + if(isBelow(vert, thisEdge) && isAbove(vert, prevEdge)) { /*case 1: this < v < prev - *the polygon is going down at v, the interior is to + *the polygon is going down at v, the interior is to *the right hand side. * find the edge to the right of thisEdge for right range. * delete thisEdge @@ -760,12 +760,12 @@ void sweepY(Int nVertices, directedLine** sortedVertices, sweepRange** ret_range { /*case 2: this > v > prev - *the polygon is going up at v, the interior is to + *the polygon is going up at v, the interior is to *the left hand side. * find the edge to the left of thisEdge for left range. * delete prevEdge * insert thisEdge - */ + */ treeNode* prevNode = TreeNodeFind(searchTree, prevEdge, ( Int (*) (void *, void *))compEdges); assert(prevNode); treeNode* pred = TreeNodePredecessor(prevNode); @@ -778,15 +778,15 @@ void sweepY(Int nVertices, directedLine** sortedVertices, sweepRange** ret_range /*case 3: insert both edges*/ treeNode* thisNode = TreeNodeMake(thisEdge); - treeNode* prevNode = TreeNodeMake(prevEdge); + treeNode* prevNode = TreeNodeMake(prevEdge); searchTree = TreeNodeInsert(searchTree, thisNode, ( Int (*) (void *, void *))compEdges); - searchTree = TreeNodeInsert(searchTree, prevNode, ( Int (*) (void *, void *))compEdges); + searchTree = TreeNodeInsert(searchTree, prevNode, ( Int (*) (void *, void *))compEdges); if(compEdges(thisEdge, prevEdge)<0) /*interior cusp*/ { treeNode* leftEdge = TreeNodePredecessor(thisNode); treeNode* rightEdge = TreeNodeSuccessor(prevNode); - ret_ranges[i] = sweepRangeMake( (directedLine*) leftEdge->key, 1, + ret_ranges[i] = sweepRangeMake( (directedLine*) leftEdge->key, 1, (directedLine*) rightEdge->key, 1 ); } @@ -806,7 +806,7 @@ void sweepY(Int nVertices, directedLine** sortedVertices, sweepRange** ret_range { treeNode* leftEdge = TreeNodePredecessor(prevNode); treeNode* rightEdge = TreeNodeSuccessor(thisNode); - ret_ranges[i] = sweepRangeMake( (directedLine*) leftEdge->key, 1, + ret_ranges[i] = sweepRangeMake( (directedLine*) leftEdge->key, 1, (directedLine*) rightEdge->key, 1 ); } @@ -826,7 +826,7 @@ void sweepY(Int nVertices, directedLine** sortedVertices, sweepRange** ret_range thisEdge->printSingle(); printf("prevEdge is\n"); prevEdge->printSingle(); - + exit(1); } } diff --git a/src/glu/sgi/libnurbs/nurbtess/partitionY.h b/src/glu/sgi/libnurbs/nurbtess/partitionY.h index 5570c18..7aee913 100644 --- a/src/glu/sgi/libnurbs/nurbtess/partitionY.h +++ b/src/glu/sgi/libnurbs/nurbtess/partitionY.h @@ -34,15 +34,15 @@ *A and B such that each chain is Y-monotonic that is the intersection of any *horizontal line intersects each chain has at most one connected componenets * (empty, single point or a single line). - * - * A vertex is a cusp if both its ajacent vertices are either at or above v, + * + * A vertex is a cusp if both its ajacent vertices are either at or above v, *or both at or below v. In addition, at least one of the ajacent verteces is - *strictly below or above v. - * A vertex is a relex vertex if the internals angle is strictly greater than + *strictly below or above v. + * A vertex is a relex vertex if the internals angle is strictly greater than *180. In other words, if the signed area is negative: - *(x1, y1), (x2, y2), (x3, y3) are the three vertices along a polygon, the + *(x1, y1), (x2, y2), (x3, y3) are the three vertices along a polygon, the *order is such that left hand side is inside the polygon. Then (x2,y2) is - *reflex if: + *reflex if: * (x2-x1, y2-y1) cross (x3-x1, y3-y1) <0. *A vertex is an interior cusp if it is a cusp and a reflex. *A vertex is an exterior cusp if it is a cusp but not a reflex. @@ -71,7 +71,7 @@ typedef struct sweepRange{ directedLine *left; Int leftType; /*either a vertex (leftType=0) or an edge (leftType =1) */ directedLine *right; - Int rightType; /*either a vertex (rightType=0) or an edge (rightType =1) */ + Int rightType; /*either a vertex (rightType=0) or an edge (rightType =1) */ } sweepRange; sweepRange* sweepRangeMake(directedLine* left, Int leftType, @@ -80,7 +80,7 @@ sweepRange* sweepRangeMake(directedLine* left, Int leftType, void sweepRangeDelete(sweepRange* range); Int sweepRangeEqual(sweepRange* sr1, sweepRange* sr2); -/*given a set of simple polygons where the interior +/*given a set of simple polygons where the interior *is decided by left-hand principle, *return a range (sight) for each vertex. This is called *Trapezoidalization. diff --git a/src/glu/sgi/libnurbs/nurbtess/polyDBG.h b/src/glu/sgi/libnurbs/nurbtess/polyDBG.h index 74843d8..1a585d9 100644 --- a/src/glu/sgi/libnurbs/nurbtess/polyDBG.h +++ b/src/glu/sgi/libnurbs/nurbtess/polyDBG.h @@ -39,7 +39,7 @@ Int DBG_edgesIntersectGen(Real A[2], Real B[2], Real C[2], Real D[2]); Int DBG_intersectChain(vertexArray* chain, Int start, Int end, Real A[2], Real B[2]); - + Int DBG_edgesIntersect(directedLine* l1, directedLine* l2); Int DBG_polygonSelfIntersect(directedLine* poly); diff --git a/src/glu/sgi/libnurbs/nurbtess/polyUtil.cc b/src/glu/sgi/libnurbs/nurbtess/polyUtil.cc index f9a27f4..39f99d5 100644 --- a/src/glu/sgi/libnurbs/nurbtess/polyUtil.cc +++ b/src/glu/sgi/libnurbs/nurbtess/polyUtil.cc @@ -6,21 +6,21 @@ ** this file except in compliance with the License. You may obtain a copy ** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600 ** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at: -** +** ** http://oss.sgi.com/projects/FreeB -** +** ** Note that, as provided in the License, the Software is distributed on an ** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS ** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND ** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A ** PARTICULAR PURPOSE, AND NON-INFRINGEMENT. -** +** ** Original Code. The Original Code is: OpenGL Sample Implementation, ** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, ** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. ** Copyright in any portions created by third parties is as indicated ** elsewhere herein. All Rights Reserved. -** +** ** Additional Notice Provisions: The application programming interfaces ** established by SGI in conjunction with the Original Code are The ** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released @@ -52,10 +52,10 @@ Real area(Real A[2], Real B[2], Real C[2]) /* return (B[0]-A[0])*(C[1]-A[1]) - (C[0]-A[0])*(B[1]-A[1]);*/ } -/*given a directed line A->B, and a point P, +/*given a directed line A->B, and a point P, *determine whether P is to the left of AB. - *the line A->B (imagine it has beedn extended both - *end to the infinity) divides the plan into two + *the line A->B (imagine it has beedn extended both + *end to the infinity) divides the plan into two *half planes. When we walk from A to B, one *half is to the left and the other half is to the right. *return 1 if P is to the left. @@ -70,10 +70,10 @@ Int pointLeftLine(Real A[2], Real B[2], Real P[2]) /*given two directed line: A -> B -> C, and another point P. *determine whether P is to the left hand side of A->B->C. *Think of BA and BC extended as two rays. So that the plane is - * divided into two parts. One part is to the left we walk from A + * divided into two parts. One part is to the left we walk from A *to B and to C, the other part is to the right. - * In order for P to be the left, P must be either to the left - *of + * In order for P to be the left, P must be either to the left + *of */ Int pointLeft2Lines(Real A[2], Real B[2], Real C[2], Real P[2]) { diff --git a/src/glu/sgi/libnurbs/nurbtess/primitiveStream.cc b/src/glu/sgi/libnurbs/nurbtess/primitiveStream.cc index dfdbd4e..84919ca 100644 --- a/src/glu/sgi/libnurbs/nurbtess/primitiveStream.cc +++ b/src/glu/sgi/libnurbs/nurbtess/primitiveStream.cc @@ -6,21 +6,21 @@ ** this file except in compliance with the License. You may obtain a copy ** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600 ** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at: -** +** ** http://oss.sgi.com/projects/FreeB -** +** ** Note that, as provided in the License, the Software is distributed on an ** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS ** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND ** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A ** PARTICULAR PURPOSE, AND NON-INFRINGEMENT. -** +** ** Original Code. The Original Code is: OpenGL Sample Implementation, ** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, ** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. ** Copyright in any portions created by third parties is as indicated ** elsewhere herein. All Rights Reserved. -** +** ** Additional Notice Provisions: The application programming interfaces ** established by SGI in conjunction with the Original Code are The ** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released @@ -39,7 +39,7 @@ #include #include #include -#include +#include #include "primitiveStream.h" @@ -54,9 +54,9 @@ Int primStream::num_triangles() return ret; } - -/*the begining of inserting a new primitive. + +/*the begining of inserting a new primitive. *reset counter to be 0. */ void primStream::begin() @@ -72,11 +72,11 @@ void primStream::insert(Real u, Real v) if(index_vertices+1 >= size_vertices) { Real* temp = (Real*) malloc (sizeof(Real) * (2*size_vertices + 2)); assert(temp); - + /*copy*/ for(Int i=0; i */ @@ -52,13 +52,13 @@ class primStream { Int index_vertices; Int size_vertices; - /*the vertex is inserted one by one. counter is used to - *count the number of vertices which have been inserted so far in + /*the vertex is inserted one by one. counter is used to + *count the number of vertices which have been inserted so far in *the current primitive */ Int counter; -public: +public: primStream(Int sizeLengths, Int sizeVertices); ~primStream(); @@ -76,16 +76,16 @@ class primStream { } Real* get_vertices() {return vertices;} - /*the begining of inserting a new primitive. + /*the begining of inserting a new primitive. *reset counter to be 0. */ void begin(); void insert(Real u, Real v); void insert(Real v[2]) {insert(v[0], v[1]);} void end(Int type); - + Int num_triangles(); - + void triangle(Real A[2], Real B[2], Real C[2]) { begin(); @@ -103,7 +103,7 @@ class primStream { - + #endif diff --git a/src/glu/sgi/libnurbs/nurbtess/quicksort.cc b/src/glu/sgi/libnurbs/nurbtess/quicksort.cc index 9d0b290..4f2902c 100644 --- a/src/glu/sgi/libnurbs/nurbtess/quicksort.cc +++ b/src/glu/sgi/libnurbs/nurbtess/quicksort.cc @@ -6,21 +6,21 @@ ** this file except in compliance with the License. You may obtain a copy ** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600 ** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at: -** +** ** http://oss.sgi.com/projects/FreeB -** +** ** Note that, as provided in the License, the Software is distributed on an ** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS ** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND ** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A ** PARTICULAR PURPOSE, AND NON-INFRINGEMENT. -** +** ** Original Code. The Original Code is: OpenGL Sample Implementation, ** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, ** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. ** Copyright in any portions created by third parties is as indicated ** elsewhere herein. All Rights Reserved. -** +** ** Additional Notice Provisions: The application programming interfaces ** established by SGI in conjunction with the Original Code are The ** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released @@ -54,7 +54,7 @@ static void swap(void *v[], int i, int j) * if( *i1 < * i2) return -1; * else return 1; *} - *and an array of pointers to integers: + *and an array of pointers to integers: * int *v[100] (allocate space for where each v[i] points to). *then you can call: * quicksort( (void**)v, left, right, (int (*)(void *, void *))comp) @@ -65,7 +65,7 @@ void quicksort(void *v[], int left, int right, int i, last; if(left >= right) /*do nothing if array contains */ return; /*fewer than two elements*/ - + swap(v, left, (left+right)/2); last = left; for(i=left+1; i<=right; i++) diff --git a/src/glu/sgi/libnurbs/nurbtess/rectBlock.cc b/src/glu/sgi/libnurbs/nurbtess/rectBlock.cc index f457b15..8bd5888 100644 --- a/src/glu/sgi/libnurbs/nurbtess/rectBlock.cc +++ b/src/glu/sgi/libnurbs/nurbtess/rectBlock.cc @@ -6,21 +6,21 @@ ** this file except in compliance with the License. You may obtain a copy ** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600 ** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at: -** +** ** http://oss.sgi.com/projects/FreeB -** +** ** Note that, as provided in the License, the Software is distributed on an ** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS ** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND ** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A ** PARTICULAR PURPOSE, AND NON-INFRINGEMENT. -** +** ** Original Code. The Original Code is: OpenGL Sample Implementation, ** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, ** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. ** Copyright in any portions created by third parties is as indicated ** elsewhere herein. All Rights Reserved. -** +** ** Additional Notice Provisions: The application programming interfaces ** established by SGI in conjunction with the Original Code are The ** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released @@ -102,7 +102,7 @@ printf("upGridLineIndex=%i, lowGridLineIndex=%i\n", upGridLineIndex, lowGridLine glVertex2f(u_values[j], v_values[i-1]); } glEnd(); - } + } } @@ -159,15 +159,15 @@ void rectBlockArray::insert(rectBlock* newBlock) //initialization for(i=0; i<2*size+1; i++) temp[i] = NULL; - + for(i=0; ib)? b:a) void sampleConnectedComp(Real* topVertex, Real* botVertex, - vertexArray* leftChain, + vertexArray* leftChain, Int leftStartIndex, Int leftEndIndex, vertexArray* rightChain, Int rightStartIndex, Int rightEndIndex, @@ -97,7 +97,7 @@ void sampleConnectedComp(Real* topVertex, Real* botVertex, down_rightCornerWhere, down_rightCornerIndex, pStream); - + sampleCompTop(topVertex, leftChain, @@ -132,10 +132,10 @@ void sampleConnectedComp(Real* topVertex, Real* botVertex, rbArray->insert(new rectBlock(leftGridChain, rightGridChain, gridIndex1, gridIndex2)); - + } -/*notice that we need rightChain because the +/*notice that we need rightChain because the *corners could be on the rightChain. *here comp means component. */ @@ -178,7 +178,7 @@ void sampleCompLeft(Real* topVertex, Real* botVertex, gridMidIndex1 = leftGridChain->lookfor(leftChain->getVertex(midIndex1)[1], gridIndex1, gridIndex2); gridMidIndex2 = 1+leftGridChain->lookfor(leftChain->getVertex(midIndex2)[1], - gridMidIndex1, gridIndex2); + gridMidIndex1, gridIndex2); } @@ -207,7 +207,7 @@ void sampleCompLeft(Real* topVertex, Real* botVertex, cornerLeftStart = leftStartIndex; cornerRightUpEnd = up_leftCornerIndex; } - + if(down_leftCornerWhere == 0) /*left corner is on left chain*/ { cornerBot = leftChain->getVertex(down_leftCornerIndex); @@ -226,7 +226,7 @@ void sampleCompLeft(Real* topVertex, Real* botVertex, cornerLeftEnd = leftEndIndex; cornerRightDownStart = down_leftCornerIndex; } - + @@ -287,9 +287,9 @@ void sampleCompLeft(Real* topVertex, Real* botVertex, cornerRightDownStart, rightEndIndex, pStream); - } + } } - + void sampleLeftSingleTrimEdgeRegionGen(Real topVert[2], Real botVert[2], vertexArray* leftChain, Int leftStart, @@ -315,11 +315,11 @@ void sampleLeftSingleTrimEdgeRegionGen(Real topVert[2], Real botVert[2], vertexArray vArray(gridEndIndex-gridBeginIndex+1 + max(0,rightUpEnd - rightUpBegin+1)+ max(0,rightDownEnd - rightDownBegin+1)); - + /*append the vertices on the up section of thr right chain*/ for(i=rightUpBegin; i<= rightUpEnd; i++) vArray.appendVertex(rightChain->getVertex(i)); - + /*append the vertices of the left extremal grid points, *and at the same time, perform triangulation for the stair cases */ @@ -333,7 +333,7 @@ void sampleLeftSingleTrimEdgeRegionGen(Real topVert[2], Real botVert[2], */ if(gridChain->getUlineIndex(i) < gridChain->getUlineIndex(i-1)) { - pStream->begin(); + pStream->begin(); pStream->insert(gridChain->get_vertex(i-1)); for(j=gridChain->getUlineIndex(i); j<= gridChain->getUlineIndex(i-1); j++) pStream->insert(gridChain->getGrid()->get_u_value(j), gridChain->get_v_value(i)); @@ -347,18 +347,18 @@ void sampleLeftSingleTrimEdgeRegionGen(Real topVert[2], Real botVert[2], pStream->insert(gridChain->getGrid()->get_u_value(j), gridChain->get_v_value(i-1)); pStream->end(PRIMITIVE_STREAM_FAN); } - /*otherwisem, the two are equal, so there is no fan to outout*/ + /*otherwisem, the two are equal, so there is no fan to outout*/ } /*then append all the vertices on the down section of the right chain*/ for(i=rightDownBegin; i<= rightDownEnd; i++) - vArray.appendVertex(rightChain->getVertex(i)); + vArray.appendVertex(rightChain->getVertex(i)); monoTriangulationRecGen(topVert, botVert, leftChain, leftStart, leftEnd, &vArray, 0, vArray.getNumElements()-1, pStream); - + } diff --git a/src/glu/sgi/libnurbs/nurbtess/sampleComp.h b/src/glu/sgi/libnurbs/nurbtess/sampleComp.h index a3c1790..cd9fa10 100644 --- a/src/glu/sgi/libnurbs/nurbtess/sampleComp.h +++ b/src/glu/sgi/libnurbs/nurbtess/sampleComp.h @@ -37,7 +37,7 @@ #include "rectBlock.h" void sampleConnectedComp(Real* topVertex, Real* botVertex, - vertexArray* leftChain, + vertexArray* leftChain, Int leftStartIndex, Int botLeftIndex, vertexArray* rightChain, Int rightStartIndex, Int botRightIndex, @@ -82,5 +82,5 @@ void sampleLeftSingleTrimEdgeRegionGen(Real topVert[2], Real botVert[2], Int rightDownBegin, Int rightDownEnd, primStream* pStream); - + #endif diff --git a/src/glu/sgi/libnurbs/nurbtess/sampleCompBot.cc b/src/glu/sgi/libnurbs/nurbtess/sampleCompBot.cc index 2e70f83..e1b0bd8 100644 --- a/src/glu/sgi/libnurbs/nurbtess/sampleCompBot.cc +++ b/src/glu/sgi/libnurbs/nurbtess/sampleCompBot.cc @@ -6,21 +6,21 @@ ** this file except in compliance with the License. You may obtain a copy ** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600 ** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at: -** +** ** http://oss.sgi.com/projects/FreeB -** +** ** Note that, as provided in the License, the Software is distributed on an ** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS ** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND ** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A ** PARTICULAR PURPOSE, AND NON-INFRINGEMENT. -** +** ** Original Code. The Original Code is: OpenGL Sample Implementation, ** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, ** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. ** Copyright in any portions created by third parties is as indicated ** elsewhere herein. All Rights Reserved. -** +** ** Additional Notice Provisions: The application programming interfaces ** established by SGI in conjunction with the Original Code are The ** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released @@ -49,7 +49,7 @@ // vertex[pass][0] >= u //if everybost is getVertex(segIndexPass); else //nothing is to the left of u. - tempBot = botVertex; + tempBot = botVertex; Real tempTop[2]; tempTop[0] = grid->get_u_value(rightU); tempTop[1] = grid->get_v_value(gridV); - + monoTriangulation2(tempTop, tempBot, rightChain, rightCorner, @@ -171,7 +171,7 @@ void sampleBotRightWithGridLinePost(Real* botVertex, midU--; grid->outputFanWithPoint(gridV, leftU, midU, botVertex, pStream); - stripOfFanRight(rightChain, segIndexMono, segIndexPass, grid, gridV, midU, rightU, pStream, 1); + stripOfFanRight(rightChain, segIndexMono, segIndexPass, grid, gridV, midU, rightU, pStream, 1); Real tempTop[2]; tempTop[0] = grid->get_u_value(midU); tempTop[1] = grid->get_v_value(gridV); @@ -189,8 +189,8 @@ void sampleBotRightWithGridLinePost(Real* botVertex, else //the botVertex forms a fan witht eh grid points grid->outputFanWithPoint(gridV, leftU, rightU, botVertex, pStream); } - -void sampleBotRightWithGridLine(Real* botVertex, + +void sampleBotRightWithGridLine(Real* botVertex, vertexArray* rightChain, Int rightEnd, Int rightCorner, @@ -215,7 +215,7 @@ void sampleBotRightWithGridLine(Real* botVertex, segIndexMono, segIndexPass); - sampleBotRightWithGridLinePost(botVertex, + sampleBotRightWithGridLinePost(botVertex, rightChain, rightEnd, segIndexMono, @@ -227,8 +227,8 @@ void sampleBotRightWithGridLine(Real* botVertex, rightU, pStream); } - - + + void sampleBotLeftWithGridLinePost(Real* botVertex, vertexArray* leftChain, Int leftEnd, @@ -237,7 +237,7 @@ void sampleBotLeftWithGridLinePost(Real* botVertex, Int leftCorner, gridWrap* grid, Int gridV, - Int leftU, + Int leftU, Int rightU, primStream* pStream) { @@ -245,7 +245,7 @@ void sampleBotLeftWithGridLinePost(Real* botVertex, //the possible section which is to the left of leftU if(segIndexPass > leftCorner) //at least leftCorner is to the left of leftU { - Real *tempBot; + Real *tempBot; if(segIndexPass <= leftEnd) //from corner to pass-1 is getVertex(segIndexPass); else //nothing is to the rigth of u @@ -265,7 +265,7 @@ void sampleBotLeftWithGridLinePost(Real* botVertex, tempTop[0] = grid->get_u_value(rightU); tempTop[1] = grid->get_v_value(gridV); - monoTriangulation2(tempTop, botVertex, leftChain, segIndexMono, leftEnd, + monoTriangulation2(tempTop, botVertex, leftChain, segIndexMono, leftEnd, 1, //increase chain pStream); } @@ -326,7 +326,7 @@ Int findBotSeparator(vertexArray* leftChain, oldLeftI = leftCorner-1; oldRightI = rightCorner; leftMax = leftChain->getVertex(leftCorner)[0] - Real(1.0) ; //initilize to be left of leftCorner - rightMin = rightChain->getVertex(rightCorner)[0]; + rightMin = rightChain->getVertex(rightCorner)[0]; } else //rightlower { @@ -437,8 +437,8 @@ Int findBotSeparator(vertexArray* leftChain, } } }//end of while loop - //now oldLeftI and oldRight I are the desired separator index notice that they are not - //necessarily valid + //now oldLeftI and oldRight I are the desired separator index notice that they are not + //necessarily valid if(oldLeftI < leftCorner || oldRightI < rightCorner) return 0; //no separator else @@ -490,7 +490,7 @@ void sampleCompBot(Real* botVertex, } sampleBotRightWithGridLine(tempBot, - rightChain, + rightChain, tempRightEnd, down_rightCornerIndex, rightGridChain->getGrid(), @@ -511,11 +511,11 @@ void sampleCompBot(Real* botVertex, else //right corner is on left chain { tempLeftEnd = down_rightCornerIndex-1; - tempBot = leftChain->getVertex(down_rightCornerIndex); + tempBot = leftChain->getVertex(down_rightCornerIndex); } - sampleBotLeftWithGridLine(tempBot, leftChain, tempLeftEnd, down_leftCornerIndex, + sampleBotLeftWithGridLine(tempBot, leftChain, tempLeftEnd, down_leftCornerIndex, leftGridChain->getGrid(), leftGridChain->getVlineIndex(gridIndex), leftGridChain->getUlineIndex(gridIndex), @@ -525,7 +525,7 @@ void sampleCompBot(Real* botVertex, } else //down_leftCornereWhere == 0, down_rightCornerwhere == 2 { - sampleCompBotSimple(botVertex, + sampleCompBotSimple(botVertex, leftChain, leftEnd, rightChain, @@ -538,7 +538,7 @@ void sampleCompBot(Real* botVertex, down_rightCornerWhere, down_rightCornerIndex, pStream); - + return; #ifdef NOT_REACHABLE @@ -573,7 +573,7 @@ void sampleCompBot(Real* botVertex, while(leftGridChain->getGrid()->get_u_value(gridSep) > leftChain->getVertex(segLeftMono)[0]) gridSep--; } - else + else { gridSep = leftGridChain->getUlineIndex(gridIndex); while(leftGridChain->getGrid()->get_u_value(gridSep) < rightChain->getVertex(segRightMono)[0]) @@ -611,7 +611,7 @@ void sampleCompBot(Real* botVertex, pStream); }//end if both sides have vertices inside the gridboundary points else if(leftChain->getVertex(sep_left)[0] >= leftGridChain->get_u_value(gridIndex)) //left n right out - + { Int segLeftMono, segLeftPass; findBotLeftSegment(leftChain, @@ -619,7 +619,7 @@ void sampleCompBot(Real* botVertex, down_leftCornerIndex, leftGridChain->get_u_value(gridIndex), segLeftMono, - segLeftPass); + segLeftPass); assert(segLeftPass <= sep_left); //make sure there is a point to the right of u. monoTriangulation2(leftGridChain->get_vertex(gridIndex), leftChain->getVertex(segLeftPass), @@ -628,7 +628,7 @@ void sampleCompBot(Real* botVertex, segLeftPass-1, 1, //a increase chain pStream); - stripOfFanLeft(leftChain, segLeftMono, segLeftPass, + stripOfFanLeft(leftChain, segLeftMono, segLeftPass, leftGridChain->getGrid(), leftGridChain->getVlineIndex(gridIndex), leftGridChain->getUlineIndex(gridIndex), @@ -645,9 +645,9 @@ void sampleCompBot(Real* botVertex, leftGridChain->getVlineIndex(gridIndex), leftGridChain->getUlineIndex(gridIndex), rightGridChain->getUlineIndex(gridIndex), - pStream); + pStream); */ - + monoTriangulationRecGen(rightGridChain->get_vertex(gridIndex), botVertex, leftChain, segLeftMono, leftEnd, @@ -655,7 +655,7 @@ void sampleCompBot(Real* botVertex, pStream); }//end left in right out else if(rightChain->getVertex(sep_right)[0] <= rightGridChain->get_u_value(gridIndex))//left out right in - { + { Int segRightMono, segRightPass; findBotRightSegment(rightChain, sep_right, down_rightCornerIndex, rightGridChain->get_u_value(gridIndex), @@ -671,11 +671,11 @@ void sampleCompBot(Real* botVertex, 0, // a decrease chain pStream); - stripOfFanRight(rightChain, segRightMono, segRightPass, + stripOfFanRight(rightChain, segRightMono, segRightPass, rightGridChain->getGrid(), rightGridChain->getVlineIndex(gridIndex), leftGridChain->getUlineIndex(gridIndex), - rightGridChain->getUlineIndex(gridIndex), + rightGridChain->getUlineIndex(gridIndex), pStream, 1); @@ -683,12 +683,12 @@ void sampleCompBot(Real* botVertex, botVertex, leftChain, down_leftCornerIndex, leftEnd, rightChain, segRightMono, rightEnd, - pStream); + pStream); }//end left out right in else //left out, right out { - sampleCompBotSimple(botVertex, + sampleCompBotSimple(botVertex, leftChain, leftEnd, rightChain, @@ -701,13 +701,13 @@ void sampleCompBot(Real* botVertex, down_rightCornerWhere, down_rightCornerIndex, pStream); - + }//end leftout right out }//end if separator exists else //no separator { - sampleCompBotSimple(botVertex, + sampleCompBotSimple(botVertex, leftChain, leftEnd, rightChain, @@ -725,7 +725,7 @@ void sampleCompBot(Real* botVertex, }//end id 0 2 }//end if the functin - + void sampleCompBotSimple(Real* botVertex, vertexArray* leftChain, Int leftEnd, @@ -738,7 +738,7 @@ void sampleCompBotSimple(Real* botVertex, Int down_leftCornerIndex, Int down_rightCornerWhere, Int down_rightCornerIndex, - primStream* pStream) + primStream* pStream) { //the plan is to use monotriangulation algorithm. Int i,k; @@ -746,7 +746,7 @@ void sampleCompBotSimple(Real* botVertex, Real* ActualBot; Int ActualLeftStart, ActualLeftEnd; Int ActualRightStart, ActualRightEnd; - + //creat an array to store the points on the grid line gridWrap* grid = leftGridChain->getGrid(); Int gridV = leftGridChain->getVlineIndex(gridIndex); @@ -765,39 +765,39 @@ void sampleCompBotSimple(Real* botVertex, ActualLeftEnd = leftEnd; else ActualLeftEnd = down_rightCornerIndex-1; //down_rightCornerIndex will be th actualBot - + if(down_leftCornerWhere != 0) //left corner is not on let chian ActualLeftStart = leftEnd+1; //meaning that there is no actual left section else ActualLeftStart = down_leftCornerIndex; - + vertexArray ActualLeftChain(max(0, ActualLeftEnd - ActualLeftStart +1) + gridRightU - gridLeftU +1); - + for(i=0; igetVertex(i)); - + //determine ActualRightStart if(down_rightCornerWhere != 2) //right is not on right ActualRightStart = rightEnd +1; //meaning no section on right else ActualRightStart = down_rightCornerIndex; - + //determine actualrightEnd if(down_leftCornerWhere != 2) //left is not on right { ActualRightEnd = rightEnd; } - else //left corner is on right + else //left corner is on right { ActualRightEnd = down_leftCornerIndex-1; //down_leftCornerIndex will be the bot } //actual bot - if(down_rightCornerWhere == 2) + if(down_rightCornerWhere == 2) { if(down_leftCornerWhere == 2) ActualBot = rightChain->getVertex(down_leftCornerIndex); @@ -808,7 +808,7 @@ void sampleCompBotSimple(Real* botVertex, ActualBot = botVertex; else //down_rightCornerWhere == 0 ActualBot = leftChain->getVertex(down_rightCornerIndex); - + ActualTop = gridPoints[0]; /* printf("in bot simple, actual leftChain is \n"); @@ -821,14 +821,14 @@ printf("Actual right start = %i, end=%i\n",ActualRightStart, ActualRightEnd); monoTriangulationRecGenOpt(rightChain->getVertex(ActualRightStart), ActualBot, &ActualLeftChain, - 0, + 0, ActualLeftChain.getNumElements()-1, rightChain, ActualRightStart+1, ActualRightEnd, pStream); else - monoTriangulationRecGenOpt(ActualTop, ActualBot, + monoTriangulationRecGenOpt(ActualTop, ActualBot, &ActualLeftChain, 1, //the first one is the top vertex ActualLeftChain.getNumElements()-1, @@ -838,7 +838,7 @@ printf("Actual right start = %i, end=%i\n",ActualRightStart, ActualRightEnd); pStream); free(gridPoints); } - - - + + + diff --git a/src/glu/sgi/libnurbs/nurbtess/sampleCompBot.h b/src/glu/sgi/libnurbs/nurbtess/sampleCompBot.h index 7b98279..8f66da8 100644 --- a/src/glu/sgi/libnurbs/nurbtess/sampleCompBot.h +++ b/src/glu/sgi/libnurbs/nurbtess/sampleCompBot.h @@ -35,14 +35,14 @@ #include "sampleMonoPoly.h" -void findBotLeftSegment(vertexArray* leftChain, +void findBotLeftSegment(vertexArray* leftChain, Int leftEnd, Int leftCorner, Real u, Int& ret_index_mono, Int& ret_index_pass); -void findBotRightSegment(vertexArray* rightChain, +void findBotRightSegment(vertexArray* rightChain, Int rightEnd, Int rightCorner, Real u, @@ -63,7 +63,7 @@ void sampleBotRightWithGridLinePost(Real* botVertex, primStream* pStream); -void sampleBotRightWithGridLine(Real* botVertex, +void sampleBotRightWithGridLine(Real* botVertex, vertexArray* rightChain, Int rightEnd, Int rightCorner, @@ -82,7 +82,7 @@ void sampleBotLeftWithGridLinePost(Real* botVertex, Int leftCorner, gridWrap* grid, Int gridV, - Int leftU, + Int leftU, Int rightU, primStream* pStream); diff --git a/src/glu/sgi/libnurbs/nurbtess/sampleCompRight.cc b/src/glu/sgi/libnurbs/nurbtess/sampleCompRight.cc index d01e500..0e89c9f 100644 --- a/src/glu/sgi/libnurbs/nurbtess/sampleCompRight.cc +++ b/src/glu/sgi/libnurbs/nurbtess/sampleCompRight.cc @@ -6,21 +6,21 @@ ** this file except in compliance with the License. You may obtain a copy ** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600 ** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at: -** +** ** http://oss.sgi.com/projects/FreeB -** +** ** Note that, as provided in the License, the Software is distributed on an ** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS ** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND ** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A ** PARTICULAR PURPOSE, AND NON-INFRINGEMENT. -** +** ** Original Code. The Original Code is: OpenGL Sample Implementation, ** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, ** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. ** Copyright in any portions created by third parties is as indicated ** elsewhere herein. All Rights Reserved. -** +** ** Additional Notice Provisions: The application programming interfaces ** established by SGI in conjunction with the Original Code are The ** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released @@ -49,7 +49,7 @@ #ifdef NOT_TAKEOUT -/*notice that we need leftChain because the +/*notice that we need leftChain because the *corners could be on the leftChain. */ void sampleCompRight(Real* topVertex, Real* botVertex, @@ -84,8 +84,8 @@ void sampleCompRight(Real* topVertex, Real* botVertex, midIndex2 = rightChain->findIndexAboveGen(rightGridChain->get_v_value(gridIndex2), midIndex1, //midIndex1<=midIndex2 rightEndIndex); - //find gridMidIndex1 so that either it=gridIndex1 when the gridline is - // at the same height as trim vertex midIndex1, or it is the last one + //find gridMidIndex1 so that either it=gridIndex1 when the gridline is + // at the same height as trim vertex midIndex1, or it is the last one //which is strictly above midIndex1. { Real temp = rightChain->getVertex(midIndex1)[1]; @@ -99,7 +99,7 @@ void sampleCompRight(Real* topVertex, Real* botVertex, gridMidIndex1--; } }//end of find gridMindIndex1 - //find gridMidIndex2 so that it is the (first one below or equal + //find gridMidIndex2 so that it is the (first one below or equal //midIndex) last one above or equal midIndex2 { Real temp = rightChain->getVertex(midIndex2)[1]; @@ -112,7 +112,7 @@ void sampleCompRight(Real* topVertex, Real* botVertex, } - + //to interprete the corner information Real* cornerTop; Real* cornerBot; @@ -138,7 +138,7 @@ void sampleCompRight(Real* topVertex, Real* botVertex, cornerRightStart = rightStartIndex; cornerLeftUpEnd = up_rightCornerIndex; } - + if(down_rightCornerWhere == 2) //right corner is on right chan { cornerBot = rightChain->getVertex(down_rightCornerIndex); @@ -149,7 +149,7 @@ void sampleCompRight(Real* topVertex, Real* botVertex, { cornerBot = botVertex; cornerRightEnd = rightEndIndex; - cornerLeftDownStart = leftEndIndex+1; //no left + cornerLeftDownStart = leftEndIndex+1; //no left } else //right corner is on the left chain { @@ -245,19 +245,19 @@ void sampleRightSingleTrimEdgeRegionGen(Real topVertex[2], Real botVertex[2], //append the vertices on the up section of the left chain for(i=leftUpBegin; i<= leftUpEnd; i++) vArray.appendVertex(leftChain->getVertex(i)); - + //append the vertices of the right extremal grid points, //and at the same time, perform triangulation for the stair cases vArray.appendVertex(gridChain->get_vertex(gridBeginIndex)); - + for(k=1, i=gridBeginIndex+1; i<= gridEndIndex; i++, k++) { vArray.appendVertex(gridChain->get_vertex(i)); - + //output the fan of the grid points of the (i)th and (i-1)th grid line. gridChain->rightEndFan(i, pStream); } - + //append all the vertices on the down section of the left chain for(i=leftDownBegin; i<= leftDownEnd; i++) vArray.appendVertex(leftChain->getVertex(i)); @@ -266,7 +266,7 @@ void sampleRightSingleTrimEdgeRegionGen(Real topVertex[2], Real botVertex[2], rightChain, rightStart, rightEnd, pStream); } - + void sampleRightSingleTrimEdgeRegion(Real upperVert[2], Real lowerVert[2], gridBoundaryChain* gridChain, Int beginIndex, @@ -282,14 +282,14 @@ void sampleRightSingleTrimEdgeRegion(Real upperVert[2], Real lowerVert[2], //output the fan of the grid points of the (i)_th and i-1th gridLine gridChain->rightEndFan(i, pStream); } - monoTriangulation2(upperVert, lowerVert, &vArray, 0, endIndex-beginIndex, + monoTriangulation2(upperVert, lowerVert, &vArray, 0, endIndex-beginIndex, 1, //increase chain (to the left) pStream); } - -/*the gridlines from rightGridChainStartIndex to - *rightGridChainEndIndex are assumed to form a + +/*the gridlines from rightGridChainStartIndex to + *rightGridChainEndIndex are assumed to form a *connected componenet *the trm vertex of topRightIndex is assumed to be below *or equal the first gridLine, and the trm vertex of @@ -297,9 +297,9 @@ void sampleRightSingleTrimEdgeRegion(Real upperVert[2], Real lowerVert[2], **there could be multipe trm vertices equal to the last gridline, but **only one could be equal to top gridline. shape: ____| (recall that **for left chain recF, we allow shape: |---- - *if botRightIndex= topRightIndex, there is at least one triangles to + *Othewise, botRightIndex>= topRightIndex, there is at least one triangles to *output */ void sampleRightStripRecF(vertexArray* rightChain, @@ -307,7 +307,7 @@ void sampleRightStripRecF(vertexArray* rightChain, Int botRightIndex, gridBoundaryChain* rightGridChain, Int rightGridChainStartIndex, - Int rightGridChainEndIndex, + Int rightGridChainEndIndex, primStream* pStream ) { @@ -315,7 +315,7 @@ void sampleRightStripRecF(vertexArray* rightChain, //sstop conditionL: if topRightIndex > botRightIndex, then stop if(topRightIndex > botRightIndex) return; - + //if there is only one grid line, return if(rightGridChainStartIndex >= rightGridChainEndIndex) return; @@ -325,7 +325,7 @@ void sampleRightStripRecF(vertexArray* rightChain, rightChain->getVertex(botRightIndex)[1] >= rightGridChain->get_v_value(rightGridChainEndIndex)); //firstfind the first trim vertex which is strictly below the second top - //grid line: index1. + //grid line: index1. Real secondGridChainV = rightGridChain->get_v_value(rightGridChainStartIndex+1); Int index1 = topRightIndex; while(rightChain->getVertex(index1)[1] >= secondGridChainV){ @@ -342,12 +342,12 @@ void sampleRightStripRecF(vertexArray* rightChain, //rightChain->getVertex(index1+1)[1] < secondGridChainV sampleRightOneGridStep(rightChain, topRightIndex, index1, rightGridChain, rightGridChainStartIndex, pStream); - //if rightChain->getVertex(index1)[1] ==secondGridChainV then we can + //if rightChain->getVertex(index1)[1] ==secondGridChainV then we can //recurvesively to the rest if(rightChain->getVertex(index1)[1] == secondGridChainV) { - + sampleRightStripRecF(rightChain, index1, botRightIndex, rightGridChain, rightGridChainStartIndex+1, rightGridChainEndIndex, pStream); } else if(index1 < botRightIndex) @@ -368,9 +368,9 @@ void sampleRightStripRecF(vertexArray* rightChain, break; } index2--; - + sampleRightSingleTrimEdgeRegion(uppervert, lowervert, rightGridChain, rightGridChainStartIndex+1, index2, pStream); - + //recursion sampleRightStripRecF(rightChain, index1+1, botRightIndex, rightGridChain, index2, rightGridChainEndIndex, pStream); } @@ -384,7 +384,7 @@ void sampleRightOneGridStepNoMiddle(vertexArray* rightChain, Int rightGridChainStartIndex, primStream* pStream) { - /*since there is no middle, there is at most one point which is on the + /*since there is no middle, there is at most one point which is on the *second grid line, there could be multiple points on the first (top) *grid line. */ @@ -400,7 +400,7 @@ void sampleRightOneGridStepNoMiddle(vertexArray* rightChain, //sampling the right area in between two grid lines //shape: _________| -void sampleRightOneGridStep(vertexArray* rightChain, +void sampleRightOneGridStep(vertexArray* rightChain, Int beginRightIndex, Int endRightIndex, gridBoundaryChain* rightGridChain, @@ -424,13 +424,13 @@ void sampleRightOneGridStep(vertexArray* rightChain, float vert1[2]; float vert2[2]; Int i; - + Int innerInd = rightGridChain->getInnerIndex(rightGridChainStartIndex+1); Int upperInd = rightGridChain->getUlineIndex(rightGridChainStartIndex); Int lowerInd = rightGridChain->getUlineIndex(rightGridChainStartIndex+1); Real upperV = rightGridChain->get_v_value(rightGridChainStartIndex); Real lowerV = rightGridChain->get_v_value(rightGridChainStartIndex+1); - + //the upper gridline vert1[1]=vert2[1]=upperV; for(i=upperInd; @@ -446,7 +446,7 @@ void sampleRightOneGridStep(vertexArray* rightChain, else poly->insert(dline); } - + //the vertical grid line segment vert1[0]=vert2[0] = grid->get_u_value(innerInd); vert1[1]=upperV; @@ -457,7 +457,7 @@ void sampleRightOneGridStep(vertexArray* rightChain, poly = dline; else poly->insert(dline); - + //the lower grid line vert1[1]=vert2[1]=lowerV; for(i=innerInd; iget_u_value(i+1); sline = new sampledLine(vert1, vert2); dline = new directedLine(INCREASING, sline); - poly->insert(dline); + poly->insert(dline); } //the edge connecting lower grid to right chain @@ -474,8 +474,8 @@ void sampleRightOneGridStep(vertexArray* rightChain, sline = new sampledLine(vert1, rightChain->getVertex(endRightIndex)); dline = new directedLine(INCREASING, sline); poly->insert(dline); - - + + //the right Chain for(i=endRightIndex; i>beginRightIndex; i--) { @@ -489,14 +489,14 @@ void sampleRightOneGridStep(vertexArray* rightChain, vert2[0]=grid->get_u_value(upperInd); sline = new sampledLine(rightChain->getVertex(beginRightIndex), vert2); dline = new directedLine(INCREASING, sline); - poly->insert(dline); + poly->insert(dline); monoTriangulationOpt(poly, pStream); //clean up poly->deleteSinglePolygonWithSline(); return; } - + //this following code cannot be reached, but leave it for debuggig purpose. Int i; //find the maximal U-monotone chain of beginRightIndex, beginRightIndex+1,... @@ -510,20 +510,20 @@ void sampleRightOneGridStep(vertexArray* rightChain, break; } //from beginRightIndex to i-1 is strictly U-monotne - //if(i-1==beginRightIndex and the vertex of rightchain is on the first - //gridline, then we should use 2 vertices on the right chain. Of we only + //if(i-1==beginRightIndex and the vertex of rightchain is on the first + //gridline, then we should use 2 vertices on the right chain. Of we only //use one (begin), we would output degenrate triangles. if(i-1 == beginRightIndex && rightChain->getVertex(beginRightIndex)[1] == rightGridChain->get_v_value(rightGridChainStartIndex)) i++; - + Int j = endRightIndex -1; if(rightGridChain->getInnerIndex(rightGridChainStartIndex+1) < rightGridChain->getUlineIndex(rightGridChainStartIndex+1)) { j = rightChain->findDecreaseChainFromEnd(i-1/*beginRightIndex*/, endRightIndex); Int temp = endRightIndex; //now from j+1 to end is strictly U-monotone. - //if j+1 is on the last grid line, then we wat to skip to the vertex - //whcih is strictly above the second grid line. This vertex must exist + //if j+1 is on the last grid line, then we wat to skip to the vertex + //whcih is strictly above the second grid line. This vertex must exist //since there is a middle vertex if(j+1 == endRightIndex) { @@ -567,7 +567,7 @@ void sampleRightOneGridStep(vertexArray* rightChain, vert[0][1] = rightGridChain->get_v_value(rightGridChainStartIndex); vert[1][1] = rightGridChain->get_v_value(rightGridChainStartIndex+1); - monoTriangulation2(&vert[0][0], + monoTriangulation2(&vert[0][0], &vert[1][0], rightChain, i-1, @@ -575,10 +575,10 @@ void sampleRightOneGridStep(vertexArray* rightChain, 0, ///a decreae chain pStream); } - -#endif -void stripOfFanRight(vertexArray* rightChain, +#endif + +void stripOfFanRight(vertexArray* rightChain, Int largeIndex, Int smallIndex, gridWrap* grid, diff --git a/src/glu/sgi/libnurbs/nurbtess/sampleCompRight.h b/src/glu/sgi/libnurbs/nurbtess/sampleCompRight.h index 4670b87..50b6af3 100644 --- a/src/glu/sgi/libnurbs/nurbtess/sampleCompRight.h +++ b/src/glu/sgi/libnurbs/nurbtess/sampleCompRight.h @@ -36,7 +36,7 @@ #define NOT_TAKEOUT #include "sampleMonoPoly.h" -void stripOfFanRight(vertexArray* rightChain, +void stripOfFanRight(vertexArray* rightChain, Int largeIndex, Int smallIndex, gridWrap* grid, @@ -53,7 +53,7 @@ void sampleRightStripRecF(vertexArray* rightChain, Int botRightIndex, gridBoundaryChain* rightGridChain, Int rightGridChainStartIndex, - Int rightGridChainEndIndex, + Int rightGridChainEndIndex, primStream* pStream ); //the degenerate case of sampleRightOneGridStep @@ -65,7 +65,7 @@ void sampleRightOneGridStepNoMiddle(vertexArray* rightChain, primStream* pStream); //sampling the right area in between two grid lines //shape: _________| -void sampleRightOneGridStep(vertexArray* rightChain, +void sampleRightOneGridStep(vertexArray* rightChain, Int beginRightIndex, Int endRightIndex, gridBoundaryChain* rightGridChain, diff --git a/src/glu/sgi/libnurbs/nurbtess/sampleCompTop.cc b/src/glu/sgi/libnurbs/nurbtess/sampleCompTop.cc index 951e937..a975d4a 100644 --- a/src/glu/sgi/libnurbs/nurbtess/sampleCompTop.cc +++ b/src/glu/sgi/libnurbs/nurbtess/sampleCompTop.cc @@ -6,21 +6,21 @@ ** this file except in compliance with the License. You may obtain a copy ** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600 ** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at: -** +** ** http://oss.sgi.com/projects/FreeB -** +** ** Note that, as provided in the License, the Software is distributed on an ** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS ** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND ** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A ** PARTICULAR PURPOSE, AND NON-INFRINGEMENT. -** +** ** Original Code. The Original Code is: OpenGL Sample Implementation, ** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, ** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. ** Copyright in any portions created by third parties is as indicated ** elsewhere herein. All Rights Reserved. -** +** ** Additional Notice Provisions: The application programming interfaces ** established by SGI in conjunction with the Original Code are The ** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released @@ -96,7 +96,7 @@ void findTopRightSegment(vertexArray* rightChain, { for(i=ret_index_large; i>rightStart;i--) { - if(rightChain->getVertex(i-1)[0] >= rightChain->getVertex(i)[0]) + if(rightChain->getVertex(i-1)[0] >= rightChain->getVertex(i)[0]) break; } ret_index_small = i; @@ -141,7 +141,7 @@ monoTriangulationRecGenOpt(tempTop, tempBot, */ } - + //the possible section which is strictly Umonotone if(segIndexLarge >= rightStart) { @@ -266,7 +266,7 @@ void sampleTopLeftWithGridLinePost(Real* topVertex, Real tempBot[2]; tempBot[0] = grid->get_u_value(midU); tempBot[1] = grid->get_v_value(gridV); - monoTriangulation2(topVertex, tempBot, leftChain, leftStart, segIndexSmall, 1, pStream); + monoTriangulation2(topVertex, tempBot, leftChain, leftStart, segIndexSmall, 1, pStream); } else //not optimize { @@ -279,9 +279,9 @@ void sampleTopLeftWithGridLinePost(Real* topVertex, } } else //the topVertex forms a fan with the grid points - grid->outputFanWithPoint(gridV, leftU, rightU, topVertex, pStream); -} - + grid->outputFanWithPoint(gridV, leftU, rightU, topVertex, pStream); +} + void sampleTopLeftWithGridLine(Real* topVertex, vertexArray* leftChain, @@ -295,7 +295,7 @@ void sampleTopLeftWithGridLine(Real* topVertex, ) { Int segIndexSmall = 0, segIndexLarge; - //if left chain is empty, then there is only one top vertex with one grid + //if left chain is empty, then there is only one top vertex with one grid // line if(leftEnd < leftStart) { grid->outputFanWithPoint(gridV, leftU, rightU, topVertex, pStream); @@ -318,10 +318,10 @@ void sampleTopLeftWithGridLine(Real* topVertex, gridV, leftU, rightU, - pStream); + pStream); } - - + + //return 1 if saprator exits, 0 otherwise Int findTopSeparator(vertexArray* leftChain, Int leftStartIndex, @@ -332,7 +332,7 @@ Int findTopSeparator(vertexArray* leftChain, Int& ret_sep_left, Int& ret_sep_right) { - + Int oldLeftI, oldRightI, newLeftI, newRightI; Int i,j,k; Real leftMax /*= leftChain->getVertex(leftEndIndex)[0]*/; @@ -348,15 +348,15 @@ Int findTopSeparator(vertexArray* leftChain, { oldLeftI = leftEndIndex; oldRightI = rightEndIndex+1; - leftMax = leftChain->getVertex(leftEndIndex)[0]; - rightMin = rightChain->getVertex(rightEndIndex)[0] + Real(1.0); + leftMax = leftChain->getVertex(leftEndIndex)[0]; + rightMin = rightChain->getVertex(rightEndIndex)[0] + Real(1.0); } - - //i: the current working leftChain index, + + //i: the current working leftChain index, //j: the current working rightChain index, //if left(i) is higher than right(j), then the two chains beloew right(j) are separated. //else the two chains below left(i) are separeated. - i=leftEndIndex; + i=leftEndIndex; j=rightEndIndex; while(1) { @@ -403,7 +403,7 @@ Int findTopSeparator(vertexArray* leftChain, { if(leftChain->getVertex(i)[0] > leftMax) //update leftMax and newLeftI. { - leftMax = leftChain->getVertex(i)[0]; + leftMax = leftChain->getVertex(i)[0]; newLeftI = i; } for(k=j-1; k>= rightStartIndex; k--) //update rightMin and newRightI. @@ -443,7 +443,7 @@ Int findTopSeparator(vertexArray* leftChain, } } i = k; //next working i, since i will be higher than j next loop - + if(leftMax >= rightMin) //there is a conflict break; else //still no conflict @@ -464,7 +464,7 @@ Int findTopSeparator(vertexArray* leftChain, } } - + void sampleCompTop(Real* topVertex, vertexArray* leftChain, Int leftStartIndex, @@ -543,7 +543,7 @@ void sampleCompTop(Real* topVertex, up_leftCornerIndex, up_rightCornerWhere, up_rightCornerIndex, - pStream); + pStream); } else //up_leftCornerWhere == 0, up_rightCornerWhere == 2. { @@ -559,7 +559,7 @@ void sampleCompTop(Real* topVertex, up_leftCornerIndex, up_rightCornerWhere, up_rightCornerIndex, - pStream); + pStream); return; #ifdef NOT_REACHABLE //code is not reachable, for test purpose only //the following code is trying to do some optimization, but not quite working, also see sampleCompBot.C: @@ -614,8 +614,8 @@ void sampleCompTop(Real* topVertex, { valid = 0; } - } - + } + if(! valid) { sampleCompTopSimple(topVertex, @@ -630,7 +630,7 @@ void sampleCompTop(Real* topVertex, up_leftCornerIndex, up_rightCornerWhere, up_rightCornerIndex, - pStream); + pStream); } else { @@ -674,8 +674,8 @@ void sampleCompTop(Real* topVertex, up_leftCornerIndex, leftGridChain->get_u_value(gridIndex1), segLeftSmall, - segLeftLarge); - assert(segLeftLarge >= sep_left); + segLeftLarge); + assert(segLeftLarge >= sep_left); monoTriangulation2(leftChain->getVertex(segLeftLarge), leftGridChain->get_vertex(gridIndex1), leftChain, @@ -684,7 +684,7 @@ void sampleCompTop(Real* topVertex, 1, //a increase chain, pStream); - stripOfFanLeft(leftChain, segLeftLarge, segLeftSmall, + stripOfFanLeft(leftChain, segLeftLarge, segLeftSmall, leftGridChain->getGrid(), leftGridChain->getVlineIndex(gridIndex1), leftGridChain->getUlineIndex(gridIndex1), @@ -695,7 +695,7 @@ void sampleCompTop(Real* topVertex, monoTriangulationRecGen(topVertex, rightGridChain->get_vertex(gridIndex1), leftChain, leftStartIndex, segLeftSmall, rightChain, rightStartIndex, up_rightCornerIndex, - pStream); + pStream); }//end left in right out else if(rightChain->getVertex(sep_right)[0] <= rightGridChain->get_u_value(gridIndex1)) { @@ -743,7 +743,7 @@ void sampleCompTop(Real* topVertex, up_leftCornerIndex, up_rightCornerWhere, up_rightCornerIndex, - pStream); + pStream); }//end leftout, right out }//end if separator exixts. else //no separator @@ -767,7 +767,7 @@ void sampleCompTop(Real* topVertex, }//end if 0,2 }//end if the function - + static void sampleCompTopSimpleOpt(gridWrap* grid, Int gridV, Real* topVertex, Real* botVertex, @@ -790,15 +790,15 @@ static void sampleCompTopSimpleOpt(gridWrap* grid, dec_chain, dec_current, dec_end, pStream); return; - } + } Int i,j,k; Real currentV = grid->get_v_value(gridV+1); if(inc_chain->getVertex(inc_end)[1] <= currentV && dec_chain->getVertex(dec_end)[1] < currentV) { - //find i bottom up so that inc_chain[i]<= curentV and inc_chain[i-1] > currentV, + //find i bottom up so that inc_chain[i]<= curentV and inc_chain[i-1] > currentV, //find j botom up so that dec_chain[j] < currentV and dec_chain[j-1] >= currentV - for(i=inc_end; i >= inc_current; i--) + for(i=inc_end; i >= inc_current; i--) { if(inc_chain->getVertex(i)[1] > currentV) break; @@ -860,7 +860,7 @@ static void sampleCompTopSimpleOpt(gridWrap* grid, //we know that inc_chain[i] > dec_chain[j] //we know that inc_chain[k-1][1] > dec_chain[j][1] //we know that inc_chain[k][1] <= dec_chain[j][1] - //so we find l between [i,k-1] so that + //so we find l between [i,k-1] so that //inc_chain[l][0] is the closet to dec_chain[j][0] int tempI = i; int l; @@ -872,7 +872,7 @@ static void sampleCompTopSimpleOpt(gridWrap* grid, tempMin = (Real)fabs(inc_chain->getVertex(l)[0] - dec_chain->getVertex(j)[0]); tempI = l; } - } + } //inc_chain[tempI] and dec_chain[j] are connected @@ -888,7 +888,7 @@ static void sampleCompTopSimpleOpt(gridWrap* grid, inc_chain, inc_current, tempI, dec_chain, dec_current, j-1, pStream); - } + } } else //go to the next higher gridV { @@ -900,7 +900,7 @@ static void sampleCompTopSimpleOpt(gridWrap* grid, pStream); } } - + void sampleCompTopSimple(Real* topVertex, vertexArray* leftChain, Int leftStartIndex, @@ -921,7 +921,7 @@ void sampleCompTopSimple(Real* topVertex, Real* ActualBot; Int ActualLeftStart, ActualLeftEnd; Int ActualRightStart, ActualRightEnd; - + //creat an array to store the points on the grid line gridWrap* grid = leftGridChain->getGrid(); Int gridV = leftGridChain->getVlineIndex(gridIndex1); @@ -930,7 +930,7 @@ void sampleCompTopSimple(Real* topVertex, Real2* gridPoints = (Real2*) malloc(sizeof(Real2) * (gridRightU - gridLeftU +1)); assert(gridPoints); - + for(k=0, i=gridRightU; i>= gridLeftU; i--, k++) { gridPoints[k][0] = grid->get_u_value(i); @@ -941,44 +941,44 @@ void sampleCompTopSimple(Real* topVertex, ActualRightStart = rightStartIndex; else ActualRightStart = up_leftCornerIndex+1; //up_leftCornerIndex will be the ActualTop - + if(up_rightCornerWhere != 2) //right corner is not on right chain ActualRightEnd = rightStartIndex-1; //meaning that there is no actual rigth section else ActualRightEnd = up_rightCornerIndex; - + vertexArray ActualRightChain(max(0, ActualRightEnd-ActualRightStart+1) + gridRightU-gridLeftU+1); for(i=ActualRightStart; i<= ActualRightEnd; i++) ActualRightChain.appendVertex(rightChain->getVertex(i)); for(i=0; igetVertex(up_rightCornerIndex); else ActualTop = topVertex; } - else if(up_leftCornerWhere == 1) + else if(up_leftCornerWhere == 1) ActualTop = topVertex; else //up_leftCornerWhere == 2 ActualTop = rightChain->getVertex(up_leftCornerIndex); - + ActualBot = gridPoints[gridRightU - gridLeftU]; - + @@ -993,7 +993,7 @@ void sampleCompTopSimple(Real* topVertex, ActualRightChain.getNumElements()-1, pStream); */ - + sampleCompTopSimpleOpt(grid, gridV, ActualTop, leftChain->getVertex(ActualLeftEnd), leftChain, @@ -1002,7 +1002,7 @@ void sampleCompTopSimple(Real* topVertex, 0, ActualRightChain.getNumElements()-1, pStream); - + } else { @@ -1013,7 +1013,7 @@ void sampleCompTopSimple(Real* topVertex, 0, ActualRightChain.getNumElements()-2, //the last is the bot. pStream); */ - + sampleCompTopSimpleOpt(grid, gridV, ActualTop, ActualBot, leftChain, ActualLeftStart, ActualLeftEnd, @@ -1021,10 +1021,10 @@ void sampleCompTopSimple(Real* topVertex, 0, ActualRightChain.getNumElements()-2, //the last is the bot. pStream); - + } free(gridPoints); - -} - + +} + diff --git a/src/glu/sgi/libnurbs/nurbtess/sampleMonoPoly.cc b/src/glu/sgi/libnurbs/nurbtess/sampleMonoPoly.cc index 051f241..241ee62 100644 --- a/src/glu/sgi/libnurbs/nurbtess/sampleMonoPoly.cc +++ b/src/glu/sgi/libnurbs/nurbtess/sampleMonoPoly.cc @@ -6,21 +6,21 @@ ** this file except in compliance with the License. You may obtain a copy ** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600 ** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at: -** +** ** http://oss.sgi.com/projects/FreeB -** +** ** Note that, as provided in the License, the Software is distributed on an ** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS ** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND ** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A ** PARTICULAR PURPOSE, AND NON-INFRINGEMENT. -** +** ** Original Code. The Original Code is: OpenGL Sample Implementation, ** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, ** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. ** Copyright in any portions created by third parties is as indicated ** elsewhere herein. All Rights Reserved. -** +** ** Additional Notice Provisions: The application programming interfaces ** established by SGI in conjunction with the Original Code are The ** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released @@ -159,7 +159,7 @@ void triangulateConvexPolyVertical(directedLine* topV, directedLine* botV, primS free(rightVerts); free(temp_leftVerts); free(temp_rightVerts); -} +} void triangulateConvexPolyHoriz(directedLine* leftV, directedLine* rightV, primStream *pStream) { @@ -206,7 +206,7 @@ void triangulateConvexPolyHoriz(directedLine* leftV, directedLine* rightV, primS triangulateXYMono(n_upperVerts, upperVerts, n_lowerVerts, lowerVerts, pStream); free(lowerVerts); free(upperVerts); -} +} void triangulateConvexPoly(directedLine* polygon, Int ulinear, Int vlinear, primStream* pStream) { /*find left, right, top , bot @@ -260,11 +260,11 @@ void triangulateConvexPoly(directedLine* polygon, Int ulinear, Int vlinear, prim else triangulateConvexPolyVertical(topV, botV, pStream); } -} +} /*for debug purpose*/ void drawCorners( - Real* topV, Real* botV, + Real* topV, Real* botV, vertexArray* leftChain, vertexArray* rightChain, gridBoundaryChain* leftGridChain, @@ -319,7 +319,7 @@ void drawCorners( Real botGridV = leftGridChain->get_v_value(gridIndex2); Real botGridU1 = leftGridChain->get_u_value(gridIndex2); Real botGridU2 = rightGridChain->get_u_value(gridIndex2); - + glBegin(GL_LINE_STRIP); glVertex2fv(leftCornerV); glVertex2f(topGridU1, topGridV); @@ -342,9 +342,9 @@ void drawCorners( } - + void toVertexArrays(directedLine* topV, directedLine* botV, vertexArray& leftChain, vertexArray& rightChain) -{ +{ Int i; directedLine* tempV; for(i=1; i<=topV->get_npoints()-2; i++) { /*the first vertex is the top vertex which doesn't belong to inc_chain*/ @@ -355,7 +355,7 @@ void toVertexArrays(directedLine* topV, directedLine* botV, vertexArray& leftCha for(i=0; i<=tempV->get_npoints()-2; i++){ leftChain.appendVertex(tempV->getVertex(i)); } - } + } for(tempV = topV->getPrev(); tempV != botV; tempV = tempV->getPrev()) { @@ -363,7 +363,7 @@ void toVertexArrays(directedLine* topV, directedLine* botV, vertexArray& leftCha rightChain.appendVertex(tempV->getVertex(i)); } } - for(i=botV->get_npoints()-2; i>=1; i--){ + for(i=botV->get_npoints()-2; i>=1; i--){ rightChain.appendVertex(tempV->getVertex(i)); } } @@ -384,8 +384,8 @@ void findTopAndBot(directedLine* polygon, directedLine*& topV, directedLine*& bo } } } - -void findGridChains(directedLine* topV, directedLine* botV, + +void findGridChains(directedLine* topV, directedLine* botV, gridWrap* grid, gridBoundaryChain*& leftGridChain, gridBoundaryChain*& rightGridChain) @@ -427,7 +427,7 @@ void findGridChains(directedLine* topV, directedLine* botV, free(rightGridInnerIndices); } -void findDownCorners(Real *botVertex, +void findDownCorners(Real *botVertex, vertexArray *leftChain, Int leftChainStartIndex, Int leftChainEndIndex, vertexArray *rightChain, Int rightChainStartIndex, Int rightChainEndIndex, Real v, @@ -442,7 +442,7 @@ void findDownCorners(Real *botVertex, #ifdef MYDEBUG printf("*************enter find donw corner\n"); printf("finddownCorner: v=%f, uleft=%f, uright=%f\n", v, uleft, uright); -printf("(%i,%i,%i,%i)\n", leftChainStartIndex, leftChainEndIndex,rightChainStartIndex, rightChainEndIndex); +printf("(%i,%i,%i,%i)\n", leftChainStartIndex, leftChainEndIndex,rightChainStartIndex, rightChainEndIndex); printf("left chain is\n"); leftChain->print(); printf("right chain is\n"); @@ -490,7 +490,7 @@ rightChain->print(); } - //we consider whether we can use botVertex as left corner. First check + //we consider whether we can use botVertex as left corner. First check //if (leftGirdPoint, botVertex) interesects right chian or not. if(DBG_intersectChain(rightChain, rightChainStartIndex,rightChainEndIndex, leftGridPoint, botVertex)) @@ -510,7 +510,7 @@ rightChain->print(); { ret_leftCornerWhere = 0; /*left chain*/ ret_leftCornerIndex = index1; - + /*find the vertex on the left chain with the maximum u, *either this vertex or the botvertex can be used as the right corner */ @@ -518,7 +518,7 @@ rightChain->print(); Int tempI; //skip those points which are equal to v. (avoid degeneratcy) for(tempI = index1; tempI <= leftChainEndIndex; tempI++) - if(leftChain->getVertex(tempI)[1] < v) + if(leftChain->getVertex(tempI)[1] < v) break; if(tempI > leftChainEndIndex) ret_rightCornerWhere = 1; @@ -534,7 +534,7 @@ rightChain->print(); - //we consider whether we can use botVertex as a corner. So first we check + //we consider whether we can use botVertex as a corner. So first we check //whether (rightGridPoint, botVertex) interescts the left chain or not. if(DBG_intersectChain(leftChain, leftChainStartIndex,leftChainEndIndex, rightGridPoint, botVertex)) @@ -544,7 +544,7 @@ rightChain->print(); } else if(botVertex[0] > tempMax) { - + ret_rightCornerWhere = 1; } else @@ -553,7 +553,7 @@ rightChain->print(); ret_rightCornerIndex = tempI; } } - + } else /*index1<=leftChainEndIndex and index2 <=rightChainEndIndex*/ { @@ -605,13 +605,13 @@ rightChain->print(); { ret_rightCornerWhere = 2; /*on the right*/ ret_rightCornerIndex = index2; - + Real tempMin; Int tempI; - + tempI = index2; tempMin = rightChain->getVertex(index2)[0]; - + /*find the minimum u for all the points on the right above the left poitn index1*/ for(i=index2+1; i<= rightChainEndIndex; i++) { @@ -624,7 +624,7 @@ rightChain->print(); } } - //we consider if we can use leftchain(index1) as left corner. + //we consider if we can use leftchain(index1) as left corner. //we check if (leftChain(index1) intersects right chian or not if(DBG_intersectChain(rightChain, rightChainStartIndex, rightChainEndIndex, leftGridPoint, leftChain->getVertex(index1))) { @@ -632,7 +632,7 @@ rightChain->print(); ret_leftCornerIndex = index2; //should use tempI??? } else if(tempMin <= leftChain->getVertex(index1)[0] || - tempMin <= uleft) + tempMin <= uleft) { ret_leftCornerWhere = 2; /* on right chain*/ ret_leftCornerIndex = tempI; @@ -648,7 +648,7 @@ rightChain->print(); } -void findUpCorners(Real *topVertex, +void findUpCorners(Real *topVertex, vertexArray *leftChain, Int leftChainStartIndex, Int leftChainEndIndex, vertexArray *rightChain, Int rightChainStartIndex, Int rightChainEndIndex, Real v, @@ -680,7 +680,7 @@ printf("***********enter findUpCorners\n"); index2 = rightChain->findIndexFirstAboveEqualGen(v, rightChainStartIndex, rightChainEndIndex); - if(index2>= leftChainStartIndex) //index2 was found above + if(index2>= leftChainStartIndex) //index2 was found above index2 = rightChain->skipEqualityFromStart(v, index2, rightChainEndIndex); if(index1=leftChainStartIndex*/ { ret_leftCornerWhere = 0; /*left chain*/ ret_leftCornerIndex = index1; - + //find the maximum u on the left top section. either that or topvertex, or left[index1] is the right corner Real tempMax = leftChain->getVertex(index1)[0]; Int tempI = index1; @@ -803,13 +803,13 @@ printf("***********enter findUpCorners\n"); { ret_rightCornerWhere = 2; /*on the right*/ ret_rightCornerIndex = index2; - + Real tempMin; Int tempI; - + tempI = index2; tempMin = rightChain->getVertex(index2)[0]; - + /*find the minimum u for all the points on the right below the left poitn index1*/ for(i=index2-1; i>= rightChainStartIndex; i--) { @@ -821,7 +821,7 @@ printf("***********enter findUpCorners\n"); tempMin = rightChain->getVertex(i)[0]; } } - //check whether (leftGRidPoint,left(index1)) interesect right chain + //check whether (leftGRidPoint,left(index1)) interesect right chain if(DBG_intersectChain(rightChain, rightChainStartIndex, rightChainEndIndex, leftGridPoint, leftChain->getVertex(index1))) { @@ -852,7 +852,7 @@ Int findNeckF(vertexArray *leftChain, Int botLeftIndex, gridBoundaryChain* leftGridChain, gridBoundaryChain* rightGridChain, Int gridStartIndex, - Int& neckLeft, + Int& neckLeft, Int& neckRight) { /* @@ -870,26 +870,26 @@ rightChain->print(); if(botLeftIndex >= leftChain->getNumElements() || botRightIndex >= rightChain->getNumElements()) return 0; //no neck exists - - v=min(leftChain->getVertex(botLeftIndex)[1], rightChain->getVertex(botRightIndex)[1]); - + v=min(leftChain->getVertex(botLeftIndex)[1], rightChain->getVertex(botRightIndex)[1]); + + for(i=gridStartIndex; iget_v_value(i) <= v && + if(leftGridChain->get_v_value(i) <= v && leftGridChain->getUlineIndex(i)<= rightGridChain->getUlineIndex(i)) break; - + lowerGridIndex = i; if(lowerGridIndex == n_vlines) //the two trm vertex are higher than all gridlines return 0; - else + else { Int botLeft2, botRight2; /* -printf("leftGridChain->get_v_)value=%f\n",leftGridChain->get_v_value(lowerGridIndex), botLeftIndex); +printf("leftGridChain->get_v_)value=%f\n",leftGridChain->get_v_value(lowerGridIndex), botLeftIndex); printf("leftChain->get_vertex(0)=(%f,%f)\n", leftChain->getVertex(0)[0],leftChain->getVertex(0)[1]); printf("leftChain->get_vertex(1)=(%f,%f)\n", leftChain->getVertex(1)[0],leftChain->getVertex(1)[1]); printf("leftChain->get_vertex(2)=(%f,%f)\n", leftChain->getVertex(2)[0],leftChain->getVertex(2)[1]); @@ -932,44 +932,44 @@ printf("leftChain->getNumElements=%i\n", leftChain->getNumElements()); return 1; } } - - - + + + /*find i>=botLeftIndex,j>=botRightIndex so that *(leftChain[i], rightChain[j]) is a neck. */ -void findNeck(vertexArray *leftChain, Int botLeftIndex, - vertexArray *rightChain, Int botRightIndex, +void findNeck(vertexArray *leftChain, Int botLeftIndex, + vertexArray *rightChain, Int botRightIndex, Int& leftLastIndex, /*left point of the neck*/ Int& rightLastIndex /*right point of the neck*/ ) { assert(botLeftIndex < leftChain->getNumElements() && botRightIndex < rightChain->getNumElements()); - + /*now the neck exists for sure*/ if(leftChain->getVertex(botLeftIndex)[1] <= rightChain->getVertex(botRightIndex)[1]) //left below right { leftLastIndex = botLeftIndex; - + /*find i so that rightChain[i][1] >= leftchainbotverte[1], and i+1< */ - rightLastIndex=rightChain->findIndexAboveGen(leftChain->getVertex(botLeftIndex)[1], botRightIndex+1, rightChain->getNumElements()-1); + rightLastIndex=rightChain->findIndexAboveGen(leftChain->getVertex(botLeftIndex)[1], botRightIndex+1, rightChain->getNumElements()-1); } else //left above right { rightLastIndex = botRightIndex; - - leftLastIndex = leftChain->findIndexAboveGen(rightChain->getVertex(botRightIndex)[1], + + leftLastIndex = leftChain->findIndexAboveGen(rightChain->getVertex(botRightIndex)[1], botLeftIndex+1, leftChain->getNumElements()-1); } } - - + + void findLeftGridIndices(directedLine* topEdge, Int firstGridIndex, Int lastGridIndex, gridWrap* grid, Int* ret_indices, Int* ret_innerIndices) { @@ -993,7 +993,7 @@ void findLeftGridIndices(directedLine* topEdge, Int firstGridIndex, Int lastGrid /*initialization to make vtail bigger than grid->...*/ directedLine* dLine = topEdge; - Real vtail = grid->get_v_value(firstGridIndex) + 1.0; + Real vtail = grid->get_v_value(firstGridIndex) + 1.0; Real tempMaxU = grid->get_u_min(); @@ -1006,7 +1006,7 @@ void findLeftGridIndices(directedLine* topEdge, Int firstGridIndex, Int lastGrid /*check whether this grid line is below the current trim edge.*/ if(vtail > grid_v_value) { - /*since the grid line is below the trim edge, we + /*since the grid line is below the trim edge, we *find the trim edge which will contain the trim line */ while( (vtail=dLine->tail()[1]) > grid_v_value){ @@ -1032,7 +1032,7 @@ void findLeftGridIndices(directedLine* topEdge, Int firstGridIndex, Int lastGrid { uinterc = slop * (grid_v_value - vtail) + dLine->tail()[0]; } - + tempMaxU = max(tempMaxU, uinterc); if(uinterc < uMin && uinterc >= uMin - ZERO) @@ -1059,7 +1059,7 @@ void findLeftGridIndices(directedLine* topEdge, Int firstGridIndex, Int lastGrid tempMaxU = uinterc; } #ifdef SHORTEN_GRID_LINE - //for each grid line, compare the left grid point with the + //for each grid line, compare the left grid point with the //intersection point. If the two points are too close, then //we should move the grid point one grid to the right //and accordingly we should update the inner index. @@ -1124,7 +1124,7 @@ void findRightGridIndices(directedLine* topEdge, Int firstGridIndex, Int lastGri /*check whether this grid line is below the current trim edge.*/ if(vhead >= grid_v_value) { - /*since the grid line is below the tail of the trim edge, we + /*since the grid line is below the tail of the trim edge, we *find the trim edge which will contain the trim line */ while( (vhead=dLine->head()[1]) > grid_v_value){ @@ -1135,7 +1135,7 @@ void findRightGridIndices(directedLine* topEdge, Int firstGridIndex, Int lastGri /*skip the equality in the case of degenerat case: horizontal */ while(dLine->head()[1] == grid_v_value) dLine = dLine->getPrev(); - + assert( dLine->tail()[1] != dLine->head()[1]); slop = (dLine->tail()[0] - dLine->head()[0]) / (dLine->tail()[1]-dLine->head()[1]); /* @@ -1158,11 +1158,11 @@ void findRightGridIndices(directedLine* topEdge, Int firstGridIndex, Int lastGri #ifdef SHORTEN_GRID_LINE uintercBuf[k] = uinterc; -#endif +#endif tempMinU = min(tempMinU, uinterc); - assert(uinterc >= uMin && uinterc <= uMax); + assert(uinterc >= uMin && uinterc <= uMax); if(uinterc == uMin) ret_indices[k] = 0; @@ -1174,7 +1174,7 @@ if(ret_indices[k] >= grid->get_n_ulines()) printf("ERROR3\n"); exit(0); } -if(ret_indices[k] < 0) +if(ret_indices[k] < 0) { printf("ERROR4\n"); exit(0); @@ -1185,7 +1185,7 @@ if(ret_indices[k] < 0) tempMinU = uinterc; } #ifdef SHORTEN_GRID_LINE - //for each grid line, compare the left grid point with the + //for each grid line, compare the left grid point with the //intersection point. If the two points are too close, then //we should move the grid point one grid to the right //and accordingly we should update the inner index. @@ -1228,10 +1228,10 @@ exit(0); if(grid->get_n_ulines() == 2 || grid->get_n_vlines() == 2) -{ +{ if(ulinear && grid->get_n_ulines() == 2) { - monoTriangulationFun(polygon, compV2InY, pStream); + monoTriangulationFun(polygon, compV2InY, pStream); return; } else if(DBG_isConvex(polygon) && polygon->numEdges() >=4) @@ -1253,7 +1253,7 @@ if(grid->get_n_ulines() == 2 || monoTriangulationFun(polygon, compV2InX, pStream); free(cusps); - return; + return; } else if(n_cusps == 1) //one interior cusp { @@ -1277,7 +1277,7 @@ if(grid->get_n_ulines() == 2 || directedLine* ret_p1; directedLine* ret_p2; - new_polygon->connectDiagonal_2slines(new_polygon, other, + new_polygon->connectDiagonal_2slines(new_polygon, other, &ret_p1, &ret_p2, new_polygon); @@ -1285,8 +1285,8 @@ if(grid->get_n_ulines() == 2 || monoTriangulationFun(ret_p1, compV2InX, pStream); monoTriangulationFun(ret_p2, compV2InX, pStream); - ret_p1->deleteSinglePolygonWithSline(); - ret_p2->deleteSinglePolygonWithSline(); + ret_p1->deleteSinglePolygonWithSline(); + ret_p2->deleteSinglePolygonWithSline(); free(cusps); return; @@ -1315,7 +1315,7 @@ if(grid->get_n_ulines() == 2 || botV = tempV; } } - + /*find the first(top) and the last (bottom) grid line which intersect the *this polygon */ @@ -1366,7 +1366,7 @@ if(grid->get_n_ulines() == 2 || leftChain.appendVertex(tempV->getVertex(i)); } } - + vertexArray rightChain(20); for(tempV = topV->getPrev(); tempV != botV; tempV = tempV->getPrev()) { @@ -1374,7 +1374,7 @@ if(grid->get_n_ulines() == 2 || rightChain.appendVertex(tempV->getVertex(i)); } } - for(i=botV->get_npoints()-2; i>=1; i--){ + for(i=botV->get_npoints()-2; i>=1; i--){ rightChain.appendVertex(tempV->getVertex(i)); } @@ -1401,12 +1401,12 @@ if(grid->get_n_ulines() == 2 || void sampleMonoPolyRec( Real* topVertex, Real* botVertex, - vertexArray* leftChain, + vertexArray* leftChain, Int leftStartIndex, vertexArray* rightChain, Int rightStartIndex, - gridBoundaryChain* leftGridChain, - gridBoundaryChain* rightGridChain, + gridBoundaryChain* leftGridChain, + gridBoundaryChain* rightGridChain, Int gridStartIndex, primStream* pStream, rectBlockArray* rbArray) @@ -1418,7 +1418,7 @@ void sampleMonoPolyRec( if(topVertex[1] <= botVertex[1]) return; - + /*find i so that the grid line is below the top vertex*/ Int i=gridStartIndex; while (i < leftGridChain->get_nVlines()) @@ -1448,7 +1448,7 @@ void sampleMonoPolyRec( { /*stop recursion, ...*/ /*monotone triangulate it...*/ -// printf("no grid line exists\n"); +// printf("no grid line exists\n"); /* monoTriangulationRecOpt(topVertex, botVertex, leftChain, leftStartIndex, rightChain, rightStartIndex, pStream); @@ -1458,7 +1458,7 @@ if(num_skipped_grid_lines <2) { monoTriangulationRecGenOpt(topVertex, botVertex, leftChain, leftStartIndex, leftChain->getNumElements()-1, - rightChain, rightStartIndex, + rightChain, rightStartIndex, rightChain->getNumElements()-1, pStream); } @@ -1475,11 +1475,11 @@ else rightChain, rightStartIndex, pStream); */ -/* monoTriangulationRecGenTBOpt(topVertex, botVertex, +/* monoTriangulationRecGenTBOpt(topVertex, botVertex, leftChain, leftStartIndex, leftChain->getNumElements()-1, - rightChain, rightStartIndex, rightChain->getNumElements()-1, + rightChain, rightStartIndex, rightChain->getNumElements()-1, pStream);*/ - + } @@ -1495,11 +1495,11 @@ else if(index2 >= leftGridChain->get_nVlines()) break; } - + index2--; - - + + /*the neck*/ Int neckLeftIndex; Int neckRightIndex; @@ -1530,7 +1530,7 @@ else rightChain->getNumElements()-1); /*if either botLeftIndex>= numelements, * or botRightIndex >= numelemnet, - *then there is no neck exists. the bottom vertex is botVertex, + *then there is no neck exists. the bottom vertex is botVertex, */ if(! findNeckF(leftChain, botLeftIndex, rightChain, botRightIndex, leftGridChain, rightGridChain, index2, neckLeftIndex, neckRightIndex)) @@ -1581,7 +1581,7 @@ glEnd(); { tempBotVertex = rightChain->getVertex(neckRightIndex); botLeftIndex = neckLeftIndex; - botRightIndex = neckRightIndex-1; + botRightIndex = neckRightIndex-1; nextTopVertex = leftChain->getVertex(neckLeftIndex); nextLeftStartIndex = neckLeftIndex+1; nextRightStartIndex = neckRightIndex; @@ -1612,7 +1612,7 @@ glEnd(); down_leftCornerWhere, down_leftCornerIndex, down_rightCornerWhere, - down_rightCornerIndex); + down_rightCornerIndex); #ifdef MYDEBUG printf("find corners done, down_leftwhere=%i, down_righwhere=%i,\n",down_leftCornerWhere, down_rightCornerWhere ); printf("find corners done, up_leftwhere=%i, up_righwhere=%i,\n",up_leftCornerWhere, up_rightCornerWhere ); @@ -1641,7 +1641,7 @@ glEnd(); sampleConnectedComp(topVertex, tempBotVertex, - leftChain, + leftChain, leftStartIndex, botLeftIndex, rightChain, rightStartIndex, botRightIndex, @@ -1665,15 +1665,15 @@ glEnd(); sampleMonoPolyRec( nextTopVertex, botVertex, - leftChain, + leftChain, nextLeftStartIndex, rightChain, nextRightStartIndex, - leftGridChain, - rightGridChain, + leftGridChain, + rightGridChain, index2+1, pStream, rbArray); - + } @@ -1695,21 +1695,21 @@ void sampleLeftStrip(vertexArray* leftChain, /* *(1)find the last grid line which doesn'; pass below - * this first edge, sample this region: one trim edge and + * this first edge, sample this region: one trim edge and * possily multiple grid lines. */ Real *upperVert, *lowerVert; /*the end points of the first trim edge*/ upperVert = leftChain->getVertex(topLeftIndex); lowerVert = leftChain->getVertex(topLeftIndex+1); - + Int index = leftGridChainStartIndex; while(leftGridChain->get_v_value(index) >= lowerVert[1]){ index++; - if(index > leftGridChainEndIndex) + if(index > leftGridChainEndIndex) break; } index--; - + sampleLeftSingleTrimEdgeRegion(upperVert, lowerVert, leftGridChain, leftGridChainStartIndex, @@ -1734,7 +1734,7 @@ void sampleLeftStripRec(vertexArray* leftChain, */ /*stop condition: if topLeftIndex >= botLeftIndex, then stop. */ - if(topLeftIndex >= botLeftIndex) + if(topLeftIndex >= botLeftIndex) return; /*find the last trim vertex which is above the second top grid line: @@ -1749,15 +1749,15 @@ void sampleLeftStripRec(vertexArray* leftChain, while(leftChain->getVertex(index1)[1] > secondGridChainV) index1++; index1--; - + sampleLeftOneGridStep(leftChain, topLeftIndex, index1, leftGridChain, leftGridChainStartIndex, pStream); - /* - * Let the next trim vertex be nextTrimVertIndex (which should be + /* + * Let the next trim vertex be nextTrimVertIndex (which should be * below the second grid line). * Find the last grid line index2 which is above nextTrimVert. - * sampleLeftSingleTrimEdgeRegion(uppervert[2], lowervert[2], + * sampleLeftSingleTrimEdgeRegion(uppervert[2], lowervert[2], * leftGridChain, leftGridChainStartIndex+1, index2). */ Real *uppervert, *lowervert; @@ -1774,7 +1774,7 @@ void sampleLeftStripRec(vertexArray* leftChain, index2--; sampleLeftSingleTrimEdgeRegion(uppervert, lowervert, leftGridChain, leftGridChainStartIndex+1, index2, pStream); - /* sampleLeftStripRec(leftChain, + /* sampleLeftStripRec(leftChain, nextTrimVertIndex, botLeftIndex, leftGridChain, @@ -1784,12 +1784,12 @@ void sampleLeftStripRec(vertexArray* leftChain, * */ sampleLeftStripRec(leftChain, index1+1, botLeftIndex, leftGridChain, index2, leftGridChainEndIndex, pStream); - + } /***************begin RecF***********************/ -/* the gridlines from leftGridChainStartIndex to +/* the gridlines from leftGridChainStartIndex to * leftGridChainEndIndex are assumed to form a * connected component. * the trim vertex of topLeftIndex is assumed to @@ -1813,7 +1813,7 @@ void sampleLeftStripRecF(vertexArray* leftChain, */ /*stop condition: if topLeftIndex > botLeftIndex, then stop. */ - if(topLeftIndex > botLeftIndex) + if(topLeftIndex > botLeftIndex) return; /*if there is only one grid Line, return.*/ @@ -1844,12 +1844,12 @@ void sampleLeftStripRecF(vertexArray* leftChain, *If equality holds, then we should include the vertex index1, otherwise we include only index1-1, to *perform sampleOneGridStep. */ - if(index1>botLeftIndex) + if(index1>botLeftIndex) index1--; else if(leftChain->getVertex(index1)[1] < secondGridChainV) index1--; - /*now we have leftChain->getVertex(index1)[1] >= secondGridChainV, and + /*now we have leftChain->getVertex(index1)[1] >= secondGridChainV, and * leftChain->getVertex(index1+1)[1] <= secondGridChainV */ @@ -1871,7 +1871,7 @@ void sampleLeftStripRecF(vertexArray* leftChain, * let the next trim vertex be nextTrimVertIndex (which should be strictly * below the second grid line). * Find the last grid line index2 which is above nextTrimVert. - * sampleLeftSingleTrimEdgeRegion(uppervert[2], lowervert[2], + * sampleLeftSingleTrimEdgeRegion(uppervert[2], lowervert[2], * leftGridChain, leftGridChainStartIndex+1, index2). */ Real *uppervert, *lowervert; @@ -1879,7 +1879,7 @@ void sampleLeftStripRecF(vertexArray* leftChain, lowervert = leftChain->getVertex(index1+1); //okay since index1get_v_value(index2) >= lowervert[1]) { index2++; @@ -1888,14 +1888,14 @@ void sampleLeftStripRecF(vertexArray* leftChain, } index2--; - + sampleLeftSingleTrimEdgeRegion(uppervert, lowervert, leftGridChain, leftGridChainStartIndex+1, index2, pStream); - + /*recursion*/ sampleLeftStripRecF(leftChain, index1+1, botLeftIndex, leftGridChain, index2, leftGridChainEndIndex, pStream); } - + } /***************End RecF***********************/ @@ -1912,7 +1912,7 @@ void sampleLeftSingleTrimEdgeRegion(Real upperVert[2], Real lowerVert[2], { Int i,j,k; - vertexArray vArray(endIndex-beginIndex+1); + vertexArray vArray(endIndex-beginIndex+1); vArray.appendVertex(gridChain->get_vertex(beginIndex)); for(k=1, i=beginIndex+1; i<=endIndex; i++, k++) @@ -1923,7 +1923,7 @@ void sampleLeftSingleTrimEdgeRegion(Real upperVert[2], Real lowerVert[2], */ if(gridChain->getUlineIndex(i) < gridChain->getUlineIndex(i-1)) { - pStream->begin(); + pStream->begin(); pStream->insert(gridChain->get_vertex(i-1)); for(j=gridChain->getUlineIndex(i); j<= gridChain->getUlineIndex(i-1); j++) pStream->insert(gridChain->getGrid()->get_u_value(j), gridChain->get_v_value(i)); @@ -1937,16 +1937,16 @@ void sampleLeftSingleTrimEdgeRegion(Real upperVert[2], Real lowerVert[2], pStream->insert(gridChain->getGrid()->get_u_value(j), gridChain->get_v_value(i-1)); pStream->end(PRIMITIVE_STREAM_FAN); } - /*otherwisem, the two are equal, so there is no fan to outout*/ + /*otherwisem, the two are equal, so there is no fan to outout*/ } - - monoTriangulation2(upperVert, lowerVert, &vArray, 0, endIndex-beginIndex, + + monoTriangulation2(upperVert, lowerVert, &vArray, 0, endIndex-beginIndex, 0, /*decreasing chain*/ pStream); } - -/*return i, such that from begin to i-1 the chain is strictly u-monotone. - */ + +/*return i, such that from begin to i-1 the chain is strictly u-monotone. + */ Int findIncreaseChainFromBegin(vertexArray* chain, Int begin ,Int end) { Int i=begin; @@ -1963,12 +1963,12 @@ Int findIncreaseChainFromBegin(vertexArray* chain, Int begin ,Int end) } return i; } - -/*check whether there is a vertex whose v value is strictly + +/*check whether there is a vertex whose v value is strictly *inbetween vup vbelow *if no middle exists return -1, else return the idnex. */ -Int checkMiddle(vertexArray* chain, Int begin, Int end, +Int checkMiddle(vertexArray* chain, Int begin, Int end, Real vup, Real vbelow) { Int i; @@ -1979,7 +1979,7 @@ Int checkMiddle(vertexArray* chain, Int begin, Int end, } return -1; } - + /*the degenerat case of sampleLeftOneGridStep*/ void sampleLeftOneGridStepNoMiddle(vertexArray* leftChain, Int beginLeftIndex, @@ -1988,7 +1988,7 @@ void sampleLeftOneGridStepNoMiddle(vertexArray* leftChain, Int leftGridChainStartIndex, primStream* pStream) { - /*since there is no middle, there is at most one point which is on the + /*since there is no middle, there is at most one point which is on the *second grid line, there could be multiple points on the first (top) *grid line. */ @@ -2016,16 +2016,16 @@ void sampleLeftOneGridStep(vertexArray* leftChain, primStream* pStream ) { - if(checkMiddle(leftChain, beginLeftIndex, endLeftIndex, + if(checkMiddle(leftChain, beginLeftIndex, endLeftIndex, leftGridChain->get_v_value(leftGridChainStartIndex), leftGridChain->get_v_value(leftGridChainStartIndex+1))<0) - + { - + sampleLeftOneGridStepNoMiddle(leftChain, beginLeftIndex, endLeftIndex, leftGridChain, leftGridChainStartIndex, pStream); return; } - + //copy into a polygon { directedLine* poly = NULL; @@ -2035,7 +2035,7 @@ void sampleLeftOneGridStep(vertexArray* leftChain, Real vert1[2]; Real vert2[2]; Int i; - + Int innerInd = leftGridChain->getInnerIndex(leftGridChainStartIndex+1); Int upperInd = leftGridChain->getUlineIndex(leftGridChainStartIndex); Int lowerInd = leftGridChain->getUlineIndex(leftGridChainStartIndex+1); @@ -2064,8 +2064,8 @@ void sampleLeftOneGridStep(vertexArray* leftChain, if(poly == NULL) poly = dline; else - poly->insert(dline); - + poly->insert(dline); + //the left chain for(i=beginLeftIndex; iget_u_value(i+1); sline = new sampledLine(vert1, vert2); dline = new directedLine(INCREASING, sline); - poly->insert(dline); + poly->insert(dline); } //the vertical grid line segement @@ -2104,18 +2104,18 @@ void sampleLeftOneGridStep(vertexArray* leftChain, poly->deleteSinglePolygonWithSline(); return; } - - + + Int i; - if(1/*leftGridChain->getUlineIndex(leftGridChainStartIndex) >= + if(1/*leftGridChain->getUlineIndex(leftGridChainStartIndex) >= leftGridChain->getUlineIndex(leftGridChainStartIndex+1)*/ ) /*the second grid line is beyond the first one to the left*/ { - /*find the maximal U-monotone chain - * of endLeftIndex, endLeftIndex-1, ..., + /*find the maximal U-monotone chain + * of endLeftIndex, endLeftIndex-1, ..., */ i=endLeftIndex; Real prevU = leftChain->getVertex(i)[0]; @@ -2124,7 +2124,7 @@ void sampleLeftOneGridStep(vertexArray* leftChain, if( prevU < thisU){ prevU = thisU; } - else + else break; } /*from endLeftIndex to i+1 is strictly U- monotone */ @@ -2150,7 +2150,7 @@ void sampleLeftOneGridStep(vertexArray* leftChain, if(j-1 == beginLeftIndex) { while(leftChain->getVertex(j-1)[1] == leftGridChain->get_v_value(leftGridChainStartIndex)) - j++; + j++; Real vert[2]; vert[0] = leftGridChain->get_u_value(leftGridChainStartIndex); @@ -2165,10 +2165,10 @@ void sampleLeftOneGridStep(vertexArray* leftChain, 1, pStream //increase chain ); - + temp = j-1; } - + stripOfFanLeft(leftChain, j-1, temp/*beginLeftIndex*/, leftGridChain->getGrid(), leftGridChain->getVlineIndex(leftGridChainStartIndex), leftGridChain->getUlineIndex(leftGridChainStartIndex), @@ -2177,21 +2177,21 @@ void sampleLeftOneGridStep(vertexArray* leftChain, 1 /*the grid line is above the trim line*/ ); } - - stripOfFanLeft(leftChain, endLeftIndex, i+1, leftGridChain->getGrid(), + + stripOfFanLeft(leftChain, endLeftIndex, i+1, leftGridChain->getGrid(), leftGridChain->getVlineIndex(leftGridChainStartIndex+1), leftGridChain->getUlineIndex(leftGridChainStartIndex+1), leftGridChain->getInnerIndex(leftGridChainStartIndex+1), pStream, 0 /*the grid line is below the trim lines*/ ); - + /*monotone triangulate the remaining left chain togther with the *two vertices on the two grid v-lines. */ Real vert[2][2]; vert[0][0]=vert[1][0] = leftGridChain->getInner_u_value(leftGridChainStartIndex+1); - vert[0][1] = leftGridChain->get_v_value(leftGridChainStartIndex); + vert[0][1] = leftGridChain->get_v_value(leftGridChainStartIndex); vert[1][1] = leftGridChain->get_v_value(leftGridChainStartIndex+1); // vertexArray right(vert, 2); @@ -2199,7 +2199,7 @@ void sampleLeftOneGridStep(vertexArray* leftChain, monoTriangulation2( &vert[0][0], /*top vertex */ &vert[1][0], /*bottom vertex*/ - leftChain, + leftChain, /*beginLeftIndex*/j-1, i+1, 1, /*an increasing chain*/ @@ -2230,20 +2230,20 @@ void sampleLeftOneGridStep(vertexArray* leftChain, pStream, 1 /*the grid line is above the trim lines*/ ); - /*monotone triangulate the remaining left chain together with the + /*monotone triangulate the remaining left chain together with the *two vertices on the two grid v-lines. */ Real vert[2][2]; vert[0][0]=vert[1][0] = leftGridChain->get_u_value(leftGridChainStartIndex+1); - vert[0][1] = leftGridChain->get_v_value(leftGridChainStartIndex); + vert[0][1] = leftGridChain->get_v_value(leftGridChainStartIndex); vert[1][1] = leftGridChain->get_v_value(leftGridChainStartIndex+1); vertexArray right(vert, 2); monoTriangulation2( - &vert[0][0], //top vertex + &vert[0][0], //top vertex &vert[1][0], //bottom vertex - leftChain, + leftChain, i-1, endLeftIndex, 1, /*an increase chain*/ @@ -2251,7 +2251,7 @@ void sampleLeftOneGridStep(vertexArray* leftChain, } } - + /*n_upper>=1 *n_lower>=1 */ @@ -2275,7 +2275,7 @@ void triangulateXYMono(Int n_upper, Real upperVerts[][2], j=1; leftMostV = lowerVerts[0]; } - + while(1) { if(i >= n_upper) /*case1: no more in upper*/ @@ -2292,7 +2292,7 @@ void triangulateXYMono(Int n_upper, Real upperVerts[][2], pStream->end(PRIMITIVE_STREAM_FAN); } - break; + break; } else if(j>= n_lower) /*case2: no more in lower*/ { @@ -2318,7 +2318,7 @@ void triangulateXYMono(Int n_upper, Real upperVerts[][2], pStream->begin(); pStream->insert(lowerVerts[j]); /*the origin of this fan*/ - /*find the last k>=i such that + /*find the last k>=i such that *upperverts[k][0] <= lowerverts[j][0] */ k=i; @@ -2359,13 +2359,13 @@ void triangulateXYMono(Int n_upper, Real upperVerts[][2], pStream->end(PRIMITIVE_STREAM_FAN); j=k; leftMostV = lowerVerts[j-1]; - } + } } } } - -void stripOfFanLeft(vertexArray* leftChain, + +void stripOfFanLeft(vertexArray* leftChain, Int largeIndex, Int smallIndex, gridWrap* grid, @@ -2421,7 +2421,7 @@ void stripOfFanLeft(vertexArray* leftChain, free(gridVerts); } - + diff --git a/src/glu/sgi/libnurbs/nurbtess/sampleMonoPoly.h b/src/glu/sgi/libnurbs/nurbtess/sampleMonoPoly.h index 3a5fa6c..7bff604 100644 --- a/src/glu/sgi/libnurbs/nurbtess/sampleMonoPoly.h +++ b/src/glu/sgi/libnurbs/nurbtess/sampleMonoPoly.h @@ -42,7 +42,7 @@ void triangulateXYMono(Int n_upper, Real upperVerts[][2], Int n_lower, Real lowerVerts[][2], primStream* pStream); -void stripOfFanLeft(vertexArray* leftChain, +void stripOfFanLeft(vertexArray* leftChain, Int largeIndex, Int smallIndex, gridWrap* grid, @@ -93,12 +93,12 @@ void sampleMonoPoly(directedLine* polygon, gridWrap* grid, Int ulinear, Int vlin void sampleMonoPolyRec( Real* topVertex, Real* botVertex, - vertexArray* leftChain, + vertexArray* leftChain, Int leftStartIndex, vertexArray* rightChain, Int rightStartIndex, - gridBoundaryChain* leftGridChain, - gridBoundaryChain* rightGridChain, + gridBoundaryChain* leftGridChain, + gridBoundaryChain* rightGridChain, Int gridStartIndex, primStream* pStream, rectBlockArray* rbArray @@ -113,20 +113,20 @@ void sampleLeftStripRecF(vertexArray* leftChain, primStream* pStream ); -void findUpCorners(Real *topVertex, - vertexArray *leftChain, +void findUpCorners(Real *topVertex, + vertexArray *leftChain, Int leftChainStartIndex, Int leftChainEndIndex, - vertexArray *rightChain, + vertexArray *rightChain, Int rightChainStartIndex, Int rightChainEndIndex, Real v, Real uleft, Real uright, - Int& ret_leftCornerWhere, + Int& ret_leftCornerWhere, Int& ret_leftCornerIndex, Int& ret_rightCornerWhere, Int& ret_rightCornerIndex ); -void findDownCorners(Real *botVertex, +void findDownCorners(Real *botVertex, vertexArray *leftChain, Int leftChainStartIndex, Int leftChainEndIndex, vertexArray *rightChain, Int rightChainStartIndex, Int rightChainEndIndex, Real v, @@ -137,8 +137,8 @@ void findDownCorners(Real *botVertex, Int& ret_rightCornerWhere, Int& ret_rightCornerIndex ); -void findNeck(vertexArray *leftChain, Int botLeftIndex, - vertexArray *rightChain, Int botRightIndex, +void findNeck(vertexArray *leftChain, Int botLeftIndex, + vertexArray *rightChain, Int botRightIndex, Int& leftLastIndex, /*left point of the neck*/ Int& rightLastIndex /*right point of the neck*/ ); @@ -148,20 +148,20 @@ Int findNeckF(vertexArray *leftChain, Int botLeftIndex, gridBoundaryChain* leftGridChain, gridBoundaryChain* rightGridChain, Int gridStartIndex, - Int& neckLeft, + Int& neckLeft, Int& neckRight); -void findTopAndBot(directedLine* polygon, - directedLine*& topV, +void findTopAndBot(directedLine* polygon, + directedLine*& topV, directedLine*& botV); -void findGridChains(directedLine* top, directedLine* bot, +void findGridChains(directedLine* top, directedLine* bot, gridWrap* grid, gridBoundaryChain*& leftGridChain, gridBoundaryChain*& rightGridChain); void toVertexArrays(directedLine* topV, directedLine* botV, vertexArray& leftChain, vertexArray& rightChain); void drawCorners( - Real* topV, Real* botV, + Real* topV, Real* botV, vertexArray* leftChain, vertexArray* rightChain, gridBoundaryChain* leftGridChain, @@ -177,7 +177,7 @@ void drawCorners( Int bot_rightCornerWhere, Int bot_rightCornerIndex); -Int checkMiddle(vertexArray* chain, Int begin, Int end, +Int checkMiddle(vertexArray* chain, Int begin, Int end, Real vup, Real vbelow); #endif diff --git a/src/glu/sgi/libnurbs/nurbtess/sampledLine.cc b/src/glu/sgi/libnurbs/nurbtess/sampledLine.cc index 89f6c6e..0b70dfb 100644 --- a/src/glu/sgi/libnurbs/nurbtess/sampledLine.cc +++ b/src/glu/sgi/libnurbs/nurbtess/sampledLine.cc @@ -6,21 +6,21 @@ ** this file except in compliance with the License. You may obtain a copy ** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600 ** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at: -** +** ** http://oss.sgi.com/projects/FreeB -** +** ** Note that, as provided in the License, the Software is distributed on an ** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS ** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND ** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A ** PARTICULAR PURPOSE, AND NON-INFRINGEMENT. -** +** ** Original Code. The Original Code is: OpenGL Sample Implementation, ** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, ** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. ** Copyright in any portions created by third parties is as indicated ** elsewhere herein. All Rights Reserved. -** +** ** Additional Notice Provisions: The application programming interfaces ** established by SGI in conjunction with the Original Code are The ** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released @@ -42,9 +42,9 @@ #include "zlassert.h" #include "sampledLine.h" -void sampledLine::setPoint(Int i, Real p[2]) +void sampledLine::setPoint(Int i, Real p[2]) { - points[i][0]=p[0]; + points[i][0]=p[0]; points[i][1]=p[1]; } @@ -65,7 +65,7 @@ void sampledLine::deleteList() delete temp; } } - + /*space of points[][2] is allocated*/ sampledLine::sampledLine(Int n_points) @@ -76,7 +76,7 @@ sampledLine::sampledLine(Int n_points) next = NULL; } -/*space of points[][2] is allocated and +/*space of points[][2] is allocated and *points are copied */ sampledLine::sampledLine(Int n_points, Real2 pts[]) @@ -146,11 +146,11 @@ void sampledLine::tessellate(Real u_reso, Real v_reso) nv = 1+(Int) (fabs((points[npoints-1][1] - points[0][1])) * v_reso); if(nu > nv) n = nu; - else + else n = nv; if(n<1) n = 1; - //du dv could be negative + //du dv could be negative Real du = (points[npoints-1][0] - points[0][0])/n; Real dv = (points[npoints-1][1] - points[0][1])/n; Real2 *temp = (Real2*) malloc(sizeof(Real2) * (n+1)); diff --git a/src/glu/sgi/libnurbs/nurbtess/sampledLine.h b/src/glu/sgi/libnurbs/nurbtess/sampledLine.h index 2cc7269..aa4fb4e 100644 --- a/src/glu/sgi/libnurbs/nurbtess/sampledLine.h +++ b/src/glu/sgi/libnurbs/nurbtess/sampledLine.h @@ -61,7 +61,7 @@ class sampledLine{ void tessellateAll(Real u_reso, Real v_reso); void print(); - + sampledLine* next; }; diff --git a/src/glu/sgi/libnurbs/nurbtess/searchTree.cc b/src/glu/sgi/libnurbs/nurbtess/searchTree.cc index 1865755..0fe3515 100644 --- a/src/glu/sgi/libnurbs/nurbtess/searchTree.cc +++ b/src/glu/sgi/libnurbs/nurbtess/searchTree.cc @@ -6,21 +6,21 @@ ** this file except in compliance with the License. You may obtain a copy ** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600 ** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at: -** +** ** http://oss.sgi.com/projects/FreeB -** +** ** Note that, as provided in the License, the Software is distributed on an ** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS ** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND ** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A ** PARTICULAR PURPOSE, AND NON-INFRINGEMENT. -** +** ** Original Code. The Original Code is: OpenGL Sample Implementation, ** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, ** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. ** Copyright in any portions created by third parties is as indicated ** elsewhere herein. All Rights Reserved. -** +** ** Additional Notice Provisions: The application programming interfaces ** established by SGI in conjunction with the Original Code are The ** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released @@ -67,13 +67,13 @@ void TreeNodeDeleteWholeTree(treeNode* node) TreeNodeDeleteSingleNode(node); } -void TreeNodePrint(treeNode* node, +void TreeNodePrint(treeNode* node, void (*keyPrint) (void*)) { if(node ==NULL) return; TreeNodePrint(node->left, keyPrint); keyPrint(node->key); - TreeNodePrint(node->right, keyPrint); + TreeNodePrint(node->right, keyPrint); } int TreeNodeDepth(treeNode* root) @@ -81,7 +81,7 @@ int TreeNodeDepth(treeNode* root) if(root == NULL) return 0; else{ int leftdepth = TreeNodeDepth(root->left); - int rightdepth = TreeNodeDepth(root->right); + int rightdepth = TreeNodeDepth(root->right); return 1 + max(leftdepth, rightdepth); } } @@ -90,16 +90,16 @@ int TreeNodeDepth(treeNode* root) *NULL is returned if not found */ treeNode* TreeNodeFind(treeNode* tree, void* key, - int (*compkey) (void*, void*)) + int (*compkey) (void*, void*)) { - if(tree == NULL) + if(tree == NULL) return NULL; if(key == tree->key) return tree; else if(compkey(key, tree->key) < 0) return TreeNodeFind(tree->left, key, compkey); - else - return TreeNodeFind(tree->right, key, compkey); + else + return TreeNodeFind(tree->right, key, compkey); } @@ -115,17 +115,17 @@ treeNode* TreeNodeInsert(treeNode* root, treeNode* newnode, y = x; if(compkey(newnode->key,x->key) < 0) /*if newnode < x*/ x = x->left; - else + else x = x->right; } - /*now y has the property that + /*now y has the property that * if newnode < y, then y->left is NULL * if newnode > y, then y->right is NULL. *So we want to isnert newnode to be the child of y */ newnode->parent = y; - if(y == NULL) + if(y == NULL) return newnode; else if( compkey(newnode->key, y->key) <0) { @@ -138,7 +138,7 @@ treeNode* TreeNodeInsert(treeNode* root, treeNode* newnode, return root; } - + treeNode* TreeNodeDeleteSingleNode(treeNode* tree, treeNode* node) { treeNode* y; @@ -149,7 +149,7 @@ treeNode* TreeNodeDeleteSingleNode(treeNode* tree, treeNode* node) if(node->left == NULL || node->right == NULL) { y = node; - if(y->left != NULL) + if(y->left != NULL) x = y->left; else x = y->right; @@ -161,7 +161,7 @@ treeNode* TreeNodeDeleteSingleNode(treeNode* tree, treeNode* node) ret = x; else /*y is not the root*/ { - if(y == y->parent->left) + if(y == y->parent->left) y->parent->left = x; else y->parent->right = x; @@ -178,7 +178,7 @@ treeNode* TreeNodeDeleteSingleNode(treeNode* tree, treeNode* node) y->parent = node->parent; y->left = node->left; node->left->parent = y; - + } else /*y != node->right*/ { @@ -187,7 +187,7 @@ treeNode* TreeNodeDeleteSingleNode(treeNode* tree, treeNode* node) x->parent = y->parent; assert(y->parent != NULL); - if(y == y->parent->left) + if(y == y->parent->left) y->parent->left = x; else y->parent->right = x; @@ -206,14 +206,14 @@ treeNode* TreeNodeDeleteSingleNode(treeNode* tree, treeNode* node) ret = tree; /*the root if the tree doesn't change*/ } else /*node->parent is NULL: node is the root*/ - ret = y; + ret = y; } /*finally free the node, and return the new root*/ TreeNodeDeleteSingleNode(node); return ret; } - + /*the minimum node in the tree rooted by node */ diff --git a/src/glu/sgi/libnurbs/nurbtess/searchTree.h b/src/glu/sgi/libnurbs/nurbtess/searchTree.h index d5e3331..cdd7fdb 100644 --- a/src/glu/sgi/libnurbs/nurbtess/searchTree.h +++ b/src/glu/sgi/libnurbs/nurbtess/searchTree.h @@ -37,13 +37,13 @@ typedef struct treeNode{ void *key; struct treeNode* parent; struct treeNode* left; /*children*/ - struct treeNode* right; + struct treeNode* right; } treeNode; treeNode* TreeNodeMake(void *key); void TreeNodeDeleteSingleNode(treeNode* node); void TreeNodeDeleteWholeTree(treeNode* node); -void TreeNodePrint(treeNode* node, +void TreeNodePrint(treeNode* node, void (*keyPrint) (void*)); int TreeNodeDepth(treeNode* root); treeNode* TreeNodeMinimum(treeNode* node); diff --git a/src/glu/sgi/libtess/README b/src/glu/sgi/libtess/README index 66a6011..5bc91b5 100644 --- a/src/glu/sgi/libtess/README +++ b/src/glu/sgi/libtess/README @@ -10,20 +10,20 @@ General Polygon Tesselation a summary of the major differences: - input contours can be intersecting, self-intersecting, or degenerate. - + - supports a choice of several winding rules for determining which parts of the polygon are on the "interior". This makes it possible to do CSG operations on polygons. - + - boundary extraction: instead of tesselating the polygon, returns a set of closed contours which separate the interior from the exterior. - + - returns the output as a small number of triangle fans and strips, rather than a list of independent triangles (when possible). - + - output is available as an explicit mesh (a quad-edge structure), in addition to the normal callback interface. - + - the algorithm used is extremely robust. @@ -40,7 +40,7 @@ The interface Inputs ------ - + The input contours are specified with the following routines: void gluTessBeginPolygon( GLUtesselator *tess ); @@ -81,7 +81,7 @@ The interface void gluTessCallback( GLUtesselator *tess, GLenum which, void (*fn)()); If "fn" is NULL, any previously defined callback is discarded. - + The callbacks used to provide output are: /* which == */ void begin( GLenum type ); /* GLU_TESS_BEGIN */ @@ -95,7 +95,7 @@ The interface The "begin" callback indicates the start of a primitive; type is one of GL_TRIANGLE_STRIP, GL_TRIANGLE_FAN, or GL_TRIANGLES (but see the notes on "boundary extraction" below). - + It is followed by any number of "vertex" callbacks, which supply the vertices in the same order as expected by the corresponding glBegin() call. After the last vertex of a given primitive, there is a callback @@ -142,7 +142,7 @@ The interface The first four are obvious. The interface recovers from these errors by inserting the missing call(s). - + GLU_TESS_COORD_TOO_LARGE says that some vertex coordinate exceeded the predefined constant GLU_TESS_MAX_COORD in absolute value, and that the value has been clamped. (Coordinate values must be small @@ -170,12 +170,12 @@ The interface For example, if the polygon lies in an arbitrary plane in 3-space, and we associate a color with each vertex, the combine callback might look like this: - + void myCombine( GLUcoord coords[3], VERTEX *d[4], GLUcoord w[4], VERTEX **dataOut ) { VERTEX *new = new_vertex(); - + new->x = coords[0]; new->y = coords[1]; new->z = coords[2]; @@ -195,7 +195,7 @@ The interface Control over Tesselation ------------------------ - + void gluTessProperty( GLUtesselator *tess, GLenum which, GLUcoord value ); Properties defined: @@ -210,7 +210,7 @@ The interface The input contours parition the plane into regions. A winding rule determines which of these regions are inside the polygon. - + For a single contour C, the winding number of a point x is simply the signed number of revolutions we make around x as we travel once around C (where CCW is positive). When there are several @@ -233,7 +233,7 @@ The interface Exterior contours are oriented CCW with respect to the normal, interior contours are oriented CW. The GLU_TESS_BEGIN callback uses the type GL_LINE_LOOP for each contour. - + - GLU_TESS_TOLERANCE. Value: a real number between 0.0 and 1.0. This specifies a tolerance for merging features to reduce the size @@ -247,7 +247,7 @@ The interface Feature merging is completely optional; the tolerance is only a hint. The implementation is free to merge in some cases and not in others, or to never merge features at all. The default tolerance is zero. - + The current implementation merges vertices only if they are exactly coincident, regardless of the current tolerance. A vertex is spliced into an edge only if the implementation is unable to @@ -265,7 +265,7 @@ The interface reversing the sign of the supplied normal). For example, if you know that all polygons lie in the x-y plane, call "gluTessNormal(tess, 0.0, 0.0, 1.0)" before rendering any polygons. - + - If the supplied normal is (0,0,0) (the default value), the normal is determined as follows. The direction of the normal, up to its sign, is found by fitting a plane to the vertices, @@ -275,7 +275,7 @@ The interface substantially change the geometry. The sign of the normal is chosen so that the sum of the signed areas of all input contours is non-negative (where a CCW contour has positive area). - + - The supplied normal persists until it is changed by another call to gluTessNormal. @@ -291,10 +291,10 @@ The interface void gluBeginPolygon( GLUtesselator *tess ); void gluNextContour( GLUtesselator *tess, GLenum type ); void gluEndPolygon( GLUtesselator *tess ); - + "type" is one of GLU_EXTERIOR, GLU_INTERIOR, GLU_CCW, GLU_CW, or GLU_UNKNOWN. It is ignored by the current GLU tesselator. - + GLU_BEGIN, GLU_VERTEX, GLU_END, GLU_ERROR, and GLU_EDGE_FLAG are defined as synonyms for GLU_TESS_BEGIN, GLU_TESS_VERTEX, GLU_TESS_END, GLU_TESS_ERROR, and GLU_TESS_EDGE_FLAG. @@ -337,18 +337,18 @@ Polygon CSG operations orientations does not change the result.) Difference - + Suppose we want to compute A \ (B union C union D). Draw a single polygon consisting of the unmodified contours from A, followed by the contours of B,C,D with the vertex order reversed (this changes the winding number of the interior regions to -1). To extract the result, use the GLU_TESS_WINDING_POSITIVE rule. - + If B,C,D are the result of a GLU_TESS_BOUNDARY_ONLY call, an alternative to reversing the vertex order is to reverse the sign of the supplied normal. For example in the x-y plane, call gluTessNormal( tess, 0.0, 0.0, -1.0 ). - + Performance ----------- diff --git a/src/glu/sgi/libtess/alg-outline b/src/glu/sgi/libtess/alg-outline index 33fd697..19e72b1 100644 --- a/src/glu/sgi/libtess/alg-outline +++ b/src/glu/sgi/libtess/alg-outline @@ -55,7 +55,7 @@ our purpose the accuracy of the normal is not important. Instead we find three vertices which are widely separated, and compute the normal to the triangle they form. The vertices are chosen so that the triangle has an area at least 1/sqrt(3) times the largest area of any -triangle formed using the input vertices. +triangle formed using the input vertices. The contours do affect the orientation of the normal; after computing the normal, we check that the sum of the signed contour areas is @@ -173,7 +173,7 @@ Invariants for the Edge Dictionary. where "event" is the current sweep line event. - No edge e has zero length. - No two edges have identical left and right endpoints. - + Invariants for the Mesh (the processed portion). - The portion of the mesh left of the sweep line is a planar graph, @@ -204,16 +204,16 @@ dictionary. We achieve this by: 1. Writing the numerical computations for maximum precision rather than maximum speed. - + 2. Making no assumptions at all about the results of the edge intersection calculations -- for sufficiently degenerate inputs, the computed location is not much better than a random number. - + 3. When numerical errors violate the invariants, restore them by making *topological* changes when necessary (ie. relinking the mesh structure). - - + + Triangulation and Grouping -------------------------- diff --git a/src/glu/sgi/libtess/dict-list.h b/src/glu/sgi/libtess/dict-list.h index 11331a7..11656e3 100644 --- a/src/glu/sgi/libtess/dict-list.h +++ b/src/glu/sgi/libtess/dict-list.h @@ -64,7 +64,7 @@ typedef struct DictNode DictNode; Dict *dictNewDict( void *frame, int (*leq)(void *frame, DictKey key1, DictKey key2) ); - + void dictDeleteDict( Dict *dict ); /* Search returns the node with the smallest key greater than or equal diff --git a/src/glu/sgi/libtess/dict.h b/src/glu/sgi/libtess/dict.h index 11331a7..11656e3 100644 --- a/src/glu/sgi/libtess/dict.h +++ b/src/glu/sgi/libtess/dict.h @@ -64,7 +64,7 @@ typedef struct DictNode DictNode; Dict *dictNewDict( void *frame, int (*leq)(void *frame, DictKey key1, DictKey key2) ); - + void dictDeleteDict( Dict *dict ); /* Search returns the node with the smallest key greater than or equal diff --git a/src/glu/sgi/libtess/geom.c b/src/glu/sgi/libtess/geom.c index 35b36a3..ed7f9e0 100644 --- a/src/glu/sgi/libtess/geom.c +++ b/src/glu/sgi/libtess/geom.c @@ -59,7 +59,7 @@ GLdouble __gl_edgeEval( GLUvertex *u, GLUvertex *v, GLUvertex *w ) GLdouble gapL, gapR; assert( VertLeq( u, v ) && VertLeq( v, w )); - + gapL = v->s - u->s; gapR = w->s - v->s; @@ -83,7 +83,7 @@ GLdouble __gl_edgeSign( GLUvertex *u, GLUvertex *v, GLUvertex *w ) GLdouble gapL, gapR; assert( VertLeq( u, v ) && VertLeq( v, w )); - + gapL = v->s - u->s; gapR = w->s - v->s; @@ -114,7 +114,7 @@ GLdouble __gl_transEval( GLUvertex *u, GLUvertex *v, GLUvertex *w ) GLdouble gapL, gapR; assert( TransLeq( u, v ) && TransLeq( v, w )); - + gapL = v->t - u->t; gapR = w->t - v->t; @@ -138,7 +138,7 @@ GLdouble __gl_transSign( GLUvertex *u, GLUvertex *v, GLUvertex *w ) GLdouble gapL, gapR; assert( TransLeq( u, v ) && TransLeq( v, w )); - + gapL = v->t - u->t; gapR = w->t - v->t; diff --git a/src/glu/sgi/libtess/mesh.c b/src/glu/sgi/libtess/mesh.c index 36cb3a7..ed78ef6 100644 --- a/src/glu/sgi/libtess/mesh.c +++ b/src/glu/sgi/libtess/mesh.c @@ -131,7 +131,7 @@ static void Splice( GLUhalfEdge *a, GLUhalfEdge *b ) * the new vertex *before* vNext so that algorithms which walk the vertex * list will not see the newly created vertices. */ -static void MakeVertex( GLUvertex *newVertex, +static void MakeVertex( GLUvertex *newVertex, GLUhalfEdge *eOrig, GLUvertex *vNext ) { GLUhalfEdge *e; @@ -171,7 +171,7 @@ static void MakeFace( GLUface *newFace, GLUhalfEdge *eOrig, GLUface *fNext ) GLUface *fPrev; GLUface *fNew = newFace; - assert(fNew != NULL); + assert(fNew != NULL); /* insert in circular doubly-linked list before fNext */ fPrev = fNext->prev; @@ -283,9 +283,9 @@ GLUhalfEdge *__gl_meshMakeEdge( GLUmesh *mesh ) if (newVertex1 == NULL || newVertex2 == NULL || newFace == NULL) { if (newVertex1 != NULL) memFree(newVertex1); if (newVertex2 != NULL) memFree(newVertex2); - if (newFace != NULL) memFree(newFace); + if (newFace != NULL) memFree(newFace); return NULL; - } + } e = MakeEdge( &mesh->eHead ); if (e == NULL) { @@ -300,7 +300,7 @@ GLUhalfEdge *__gl_meshMakeEdge( GLUmesh *mesh ) MakeFace( newFace, e, &mesh->fHead ); return e; } - + /* __gl_meshSplice( eOrg, eDst ) is the basic operation for changing the * mesh connectivity and topology. It changes the mesh so that @@ -357,7 +357,7 @@ int __gl_meshSplice( GLUhalfEdge *eOrg, GLUhalfEdge *eDst ) eOrg->Org->anEdge = eOrg; } if( ! joiningLoops ) { - GLUface *newFace= allocFace(); + GLUface *newFace= allocFace(); if (newFace == NULL) return 0; /* We split one loop into two -- the new loop is eDst->Lface. @@ -405,7 +405,7 @@ int __gl_meshDelete( GLUhalfEdge *eDel ) Splice( eDel, eDel->Oprev ); if( ! joiningLoops ) { GLUface *newFace= allocFace(); - if (newFace == NULL) return 0; + if (newFace == NULL) return 0; /* We are splitting one loop into two -- create a new loop for eDel. */ MakeFace( newFace, eDel, eDel->Lface ); @@ -508,7 +508,7 @@ GLUhalfEdge *__gl_meshSplitEdge( GLUhalfEdge *eOrg ) GLUhalfEdge *__gl_meshConnect( GLUhalfEdge *eOrg, GLUhalfEdge *eDst ) { GLUhalfEdge *eNewSym; - int joiningLoops = FALSE; + int joiningLoops = FALSE; GLUhalfEdge *eNew = MakeEdge( eOrg ); if (eNew == NULL) return NULL; @@ -610,7 +610,7 @@ GLUmesh *__gl_meshNewMesh( void ) if (mesh == NULL) { return NULL; } - + v = &mesh->vHead; f = &mesh->fHead; e = &mesh->eHead; diff --git a/src/glu/sgi/libtess/mesh.h b/src/glu/sgi/libtess/mesh.h index 690c5f2..a3db984 100644 --- a/src/glu/sgi/libtess/mesh.h +++ b/src/glu/sgi/libtess/mesh.h @@ -37,7 +37,7 @@ #include -typedef struct GLUmesh GLUmesh; +typedef struct GLUmesh GLUmesh; typedef struct GLUvertex GLUvertex; typedef struct GLUface GLUface; diff --git a/src/glu/sgi/libtess/priorityq-heap.c b/src/glu/sgi/libtess/priorityq-heap.c index 52698b5..9662a56 100644 --- a/src/glu/sgi/libtess/priorityq-heap.c +++ b/src/glu/sgi/libtess/priorityq-heap.c @@ -172,8 +172,8 @@ PQhandle pqInsert( PriorityQ *pq, PQkey keyNew ) /* If the heap overflows, double its size. */ pq->max <<= 1; - pq->nodes = (PQnode *)memRealloc( pq->nodes, - (size_t) + pq->nodes = (PQnode *)memRealloc( pq->nodes, + (size_t) ((pq->max + 1) * sizeof( pq->nodes[0] ))); if (pq->nodes == NULL) { pq->nodes = saveNodes; /* restore ptr to free upon return */ @@ -181,7 +181,7 @@ PQhandle pqInsert( PriorityQ *pq, PQkey keyNew ) } pq->handles = (PQhandleElem *)memRealloc( pq->handles, (size_t) - ((pq->max + 1) * + ((pq->max + 1) * sizeof( pq->handles[0] ))); if (pq->handles == NULL) { pq->handles = saveHandles; /* restore ptr to free upon return */ diff --git a/src/glu/sgi/libtess/priorityq-heap.h b/src/glu/sgi/libtess/priorityq-heap.h index dc9aaef..c7aa576 100644 --- a/src/glu/sgi/libtess/priorityq-heap.h +++ b/src/glu/sgi/libtess/priorityq-heap.h @@ -91,7 +91,7 @@ struct PriorityQ { int initialized; int (*leq)(PQkey key1, PQkey key2); }; - + PriorityQ *pqNewPriorityQ( int (*leq)(PQkey key1, PQkey key2) ); void pqDeletePriorityQ( PriorityQ *pq ); diff --git a/src/glu/sgi/libtess/priorityq-sort.h b/src/glu/sgi/libtess/priorityq-sort.h index 746cf5f..28186f4 100644 --- a/src/glu/sgi/libtess/priorityq-sort.h +++ b/src/glu/sgi/libtess/priorityq-sort.h @@ -102,7 +102,7 @@ struct PriorityQ { int initialized; int (*leq)(PQkey key1, PQkey key2); }; - + PriorityQ *pqNewPriorityQ( int (*leq)(PQkey key1, PQkey key2) ); void pqDeletePriorityQ( PriorityQ *pq ); diff --git a/src/glu/sgi/libtess/priorityq.c b/src/glu/sgi/libtess/priorityq.c index c6b99cc..4783ea1 100644 --- a/src/glu/sgi/libtess/priorityq.c +++ b/src/glu/sgi/libtess/priorityq.c @@ -75,7 +75,7 @@ PriorityQ *pqNewPriorityQ( int (*leq)(PQkey key1, PQkey key2) ) /* really __gl_pqSortDeletePriorityQ */ void pqDeletePriorityQ( PriorityQ *pq ) { - assert(pq != NULL); + assert(pq != NULL); if (pq->heap != NULL) __gl_pqHeapDeletePriorityQ( pq->heap ); if (pq->order != NULL) memFree( pq->order ); if (pq->keys != NULL) memFree( pq->keys ); @@ -169,7 +169,7 @@ int pqInit( PriorityQ *pq ) } /* really __gl_pqSortInsert */ -/* returns LONG_MAX iff out of memory */ +/* returns LONG_MAX iff out of memory */ PQhandle pqInsert( PriorityQ *pq, PQkey keyNew ) { long curr; @@ -183,15 +183,15 @@ PQhandle pqInsert( PriorityQ *pq, PQkey keyNew ) /* If the heap overflows, double its size. */ pq->max <<= 1; - pq->keys = (PQHeapKey *)memRealloc( pq->keys, + pq->keys = (PQHeapKey *)memRealloc( pq->keys, (size_t) (pq->max * sizeof( pq->keys[0] ))); - if (pq->keys == NULL) { + if (pq->keys == NULL) { pq->keys = saveKey; /* restore ptr to free upon return */ return LONG_MAX; } } - assert(curr != LONG_MAX); + assert(curr != LONG_MAX); pq->keys[curr] = keyNew; /* Negative handles index the sorted array. */ diff --git a/src/glu/sgi/libtess/priorityq.h b/src/glu/sgi/libtess/priorityq.h index 746cf5f..28186f4 100644 --- a/src/glu/sgi/libtess/priorityq.h +++ b/src/glu/sgi/libtess/priorityq.h @@ -102,7 +102,7 @@ struct PriorityQ { int initialized; int (*leq)(PQkey key1, PQkey key2); }; - + PriorityQ *pqNewPriorityQ( int (*leq)(PQkey key1, PQkey key2) ); void pqDeletePriorityQ( PriorityQ *pq ); diff --git a/src/glu/sgi/libtess/render.c b/src/glu/sgi/libtess/render.c index bca836f..81b667b 100644 --- a/src/glu/sgi/libtess/render.c +++ b/src/glu/sgi/libtess/render.c @@ -286,15 +286,15 @@ static void RenderFan( GLUtesselator *tess, GLUhalfEdge *e, long size ) * edge "e". The fan *should* contain exactly "size" triangles * (otherwise we've goofed up somewhere). */ - CALL_BEGIN_OR_BEGIN_DATA( GL_TRIANGLE_FAN ); - CALL_VERTEX_OR_VERTEX_DATA( e->Org->data ); - CALL_VERTEX_OR_VERTEX_DATA( e->Dst->data ); + CALL_BEGIN_OR_BEGIN_DATA( GL_TRIANGLE_FAN ); + CALL_VERTEX_OR_VERTEX_DATA( e->Org->data ); + CALL_VERTEX_OR_VERTEX_DATA( e->Dst->data ); while( ! Marked( e->Lface )) { e->Lface->marked = TRUE; --size; e = e->Onext; - CALL_VERTEX_OR_VERTEX_DATA( e->Dst->data ); + CALL_VERTEX_OR_VERTEX_DATA( e->Dst->data ); } assert( size == 0 ); @@ -309,20 +309,20 @@ static void RenderStrip( GLUtesselator *tess, GLUhalfEdge *e, long size ) * (otherwise we've goofed up somewhere). */ CALL_BEGIN_OR_BEGIN_DATA( GL_TRIANGLE_STRIP ); - CALL_VERTEX_OR_VERTEX_DATA( e->Org->data ); - CALL_VERTEX_OR_VERTEX_DATA( e->Dst->data ); + CALL_VERTEX_OR_VERTEX_DATA( e->Org->data ); + CALL_VERTEX_OR_VERTEX_DATA( e->Dst->data ); while( ! Marked( e->Lface )) { e->Lface->marked = TRUE; --size; e = e->Dprev; - CALL_VERTEX_OR_VERTEX_DATA( e->Org->data ); + CALL_VERTEX_OR_VERTEX_DATA( e->Org->data ); if( Marked( e->Lface )) break; e->Lface->marked = TRUE; --size; e = e->Onext; - CALL_VERTEX_OR_VERTEX_DATA( e->Dst->data ); + CALL_VERTEX_OR_VERTEX_DATA( e->Dst->data ); } assert( size == 0 ); @@ -346,7 +346,7 @@ void __gl_renderBoundary( GLUtesselator *tess, GLUmesh *mesh ) CALL_BEGIN_OR_BEGIN_DATA( GL_LINE_LOOP ); e = f->anEdge; do { - CALL_VERTEX_OR_VERTEX_DATA( e->Org->data ); + CALL_VERTEX_OR_VERTEX_DATA( e->Org->data ); e = e->Lnext; } while( e != f->anEdge ); CALL_END_OR_END_DATA(); @@ -487,14 +487,14 @@ GLboolean __gl_renderCache( GLUtesselator *tess ) : (tess->cacheCount > 3) ? GL_TRIANGLE_FAN : GL_TRIANGLES ); - CALL_VERTEX_OR_VERTEX_DATA( v0->data ); + CALL_VERTEX_OR_VERTEX_DATA( v0->data ); if( sign > 0 ) { for( vc = v0+1; vc < vn; ++vc ) { - CALL_VERTEX_OR_VERTEX_DATA( vc->data ); + CALL_VERTEX_OR_VERTEX_DATA( vc->data ); } } else { for( vc = vn-1; vc > v0; --vc ) { - CALL_VERTEX_OR_VERTEX_DATA( vc->data ); + CALL_VERTEX_OR_VERTEX_DATA( vc->data ); } } CALL_END_OR_END_DATA(); diff --git a/src/glu/sgi/libtess/tess.c b/src/glu/sgi/libtess/tess.c index 4a0e8de..026d7f8 100644 --- a/src/glu/sgi/libtess/tess.c +++ b/src/glu/sgi/libtess/tess.c @@ -501,7 +501,7 @@ gluTessEndPolygon( GLUtesselator *tess ) { GLUmesh *mesh; - if (setjmp(tess->env) != 0) { + if (setjmp(tess->env) != 0) { /* come back here if out of memory */ CALL_ERROR_OR_ERROR_DATA( GLU_OUT_OF_MEMORY ); return; diff --git a/src/glu/sgi/libtess/tess.h b/src/glu/sgi/libtess/tess.h index 1624960..4c43f96 100644 --- a/src/glu/sgi/libtess/tess.h +++ b/src/glu/sgi/libtess/tess.h @@ -107,9 +107,9 @@ struct GLUtesselator { int cacheCount; /* number of cached vertices */ CachedVertex cache[TESS_MAX_CACHE]; /* the vertex data */ - /*** rendering callbacks that also pass polygon data ***/ + /*** rendering callbacks that also pass polygon data ***/ void (GLAPIENTRY *callBeginData)( GLenum type, void *polygonData ); - void (GLAPIENTRY *callEdgeFlagData)( GLboolean boundaryEdge, + void (GLAPIENTRY *callEdgeFlagData)( GLboolean boundaryEdge, void *polygonData ); void (GLAPIENTRY *callVertexData)( void *data, void *polygonData ); void (GLAPIENTRY *callEndData)( void *polygonData ); diff --git a/src/glu/sgi/libtess/tessmono.c b/src/glu/sgi/libtess/tessmono.c index 4d08440..6d2700a 100644 --- a/src/glu/sgi/libtess/tessmono.c +++ b/src/glu/sgi/libtess/tessmono.c @@ -46,7 +46,7 @@ * (what else would it do??) The region must consist of a single * loop of half-edges (see mesh.h) oriented CCW. "Monotone" in this * case means that any vertical line intersects the interior of the - * region in a single interval. + * region in a single interval. * * Tessellation consists of adding interior edges (actually pairs of * half-edges), to split the region into non-overlapping triangles. diff --git a/src/glu/sgi/libtess/tessmono.h b/src/glu/sgi/libtess/tessmono.h index 8ee1b2f..af1b2f3 100644 --- a/src/glu/sgi/libtess/tessmono.h +++ b/src/glu/sgi/libtess/tessmono.h @@ -39,7 +39,7 @@ * (what else would it do??) The region must consist of a single * loop of half-edges (see mesh.h) oriented CCW. "Monotone" in this * case means that any vertical line intersects the interior of the - * region in a single interval. + * region in a single interval. * * Tessellation consists of adding interior edges (actually pairs of * half-edges), to split the region into non-overlapping triangles. diff --git a/src/glu/sgi/libutil/mipmap.c b/src/glu/sgi/libutil/mipmap.c index 026ab84..6668d37 100644 --- a/src/glu/sgi/libutil/mipmap.c +++ b/src/glu/sgi/libutil/mipmap.c @@ -1690,7 +1690,7 @@ static void scale_internal_byte(GLint components, GLint widthin, totals[k] += (GLbyte)(*(temp_index)) * percent; } - /* calculate the value for pixels in the last row */ + /* calculate the value for pixels in the last row */ y_percent = highy_float; percent = y_percent * (1-lowx_float); temp = (const char *)datain + xindex + highy_int * ysize; @@ -1920,7 +1920,7 @@ static void scale_internal_ushort(GLint components, GLint widthin, } } - /* calculate the value for pixels in the last row */ + /* calculate the value for pixels in the last row */ y_percent = highy_float; percent = y_percent * (1-lowx_float); temp = (const char *)datain + xindex + highy_int * ysize; @@ -3318,7 +3318,7 @@ static GLboolean legalType(GLenum type) case GL_UNSIGNED_INT: case GL_FLOAT: case GL_UNSIGNED_BYTE_3_3_2: - case GL_UNSIGNED_BYTE_2_3_3_REV: + case GL_UNSIGNED_BYTE_2_3_3_REV: case GL_UNSIGNED_SHORT_5_6_5: case GL_UNSIGNED_SHORT_5_6_5_REV: case GL_UNSIGNED_SHORT_4_4_4_4: @@ -3415,7 +3415,7 @@ static void closestFit(GLenum target, GLint width, GLint height, if ( (strtod((const char *)glGetString(GL_VERSION),NULL) >= 1.1) ) { GLint widthPowerOf2= nearestPower(width); - GLint heightPowerOf2= nearestPower(height); + GLint heightPowerOf2= nearestPower(height); GLint proxyWidth; do { @@ -3931,7 +3931,7 @@ static int gluBuild2DMipmapLevelsCore(GLenum target, GLint internalFormat, case GL_UNSIGNED_INT_8_8_8_8_REV: case GL_UNSIGNED_INT_10_10_10_2: case GL_UNSIGNED_INT_2_10_10_10_REV: - dstImage = (GLuint *)malloc(memreq); + dstImage = (GLuint *)malloc(memreq); break; default: return GLU_INVALID_ENUM; @@ -4296,7 +4296,7 @@ static int gluBuild2DMipmapLevelsCore(GLenum target, GLint internalFormat, int nextWidth= newwidth/2; int nextHeight= newheight/2; if (nextWidth < 1) nextWidth= 1; - if (nextHeight < 1) nextHeight= 1; + if (nextHeight < 1) nextHeight= 1; memreq = image_size(nextWidth, nextHeight, format, type); } @@ -4438,13 +4438,13 @@ static int gluBuild2DMipmapLevelsCore(GLenum target, GLint internalFormat, srcImage,dstImage,element_size,rowsize, myswap_bytes); break; - case GL_UNSIGNED_SHORT_5_5_5_1: + case GL_UNSIGNED_SHORT_5_5_5_1: halveImagePackedPixel(4,extract5551,shove5551, newwidth,newheight, srcImage,dstImage,element_size,rowsize, myswap_bytes); break; - case GL_UNSIGNED_SHORT_1_5_5_5_REV: + case GL_UNSIGNED_SHORT_1_5_5_5_REV: halveImagePackedPixel(4,extract1555rev,shove1555rev, newwidth,newheight, srcImage,dstImage,element_size,rowsize, @@ -4825,7 +4825,7 @@ static GLfloat bytes_per_element(GLenum type) case GL_FLOAT: return(sizeof(GLfloat)); case GL_UNSIGNED_BYTE_3_3_2: - case GL_UNSIGNED_BYTE_2_3_3_REV: + case GL_UNSIGNED_BYTE_2_3_3_REV: return(sizeof(GLubyte)); case GL_UNSIGNED_SHORT_5_6_5: case GL_UNSIGNED_SHORT_5_6_5_REV: @@ -4990,31 +4990,31 @@ static void fill_image(const PixelStorageModes *psm, *iter2++ = (*((const GLbyte *) iter)) * 516; } break; - case GL_UNSIGNED_SHORT_5_6_5: + case GL_UNSIGNED_SHORT_5_6_5: extract565(myswap_bytes,iter,extractComponents); for (k = 0; k < 3; k++) { *iter2++ = (GLushort)(extractComponents[k]*65535); } break; - case GL_UNSIGNED_SHORT_5_6_5_REV: + case GL_UNSIGNED_SHORT_5_6_5_REV: extract565rev(myswap_bytes,iter,extractComponents); for (k = 0; k < 3; k++) { *iter2++ = (GLushort)(extractComponents[k]*65535); } break; - case GL_UNSIGNED_SHORT_4_4_4_4: + case GL_UNSIGNED_SHORT_4_4_4_4: extract4444(myswap_bytes,iter,extractComponents); for (k = 0; k < 4; k++) { *iter2++ = (GLushort)(extractComponents[k]*65535); } break; - case GL_UNSIGNED_SHORT_4_4_4_4_REV: + case GL_UNSIGNED_SHORT_4_4_4_4_REV: extract4444rev(myswap_bytes,iter,extractComponents); for (k = 0; k < 4; k++) { *iter2++ = (GLushort)(extractComponents[k]*65535); } break; - case GL_UNSIGNED_SHORT_5_5_5_1: + case GL_UNSIGNED_SHORT_5_5_5_1: extract5551(myswap_bytes,iter,extractComponents); for (k = 0; k < 4; k++) { *iter2++ = (GLushort)(extractComponents[k]*65535); @@ -5046,19 +5046,19 @@ static void fill_image(const PixelStorageModes *psm, *iter2++ = widget.us[0]; } break; - case GL_UNSIGNED_INT_8_8_8_8: + case GL_UNSIGNED_INT_8_8_8_8: extract8888(myswap_bytes,iter,extractComponents); for (k = 0; k < 4; k++) { *iter2++ = (GLushort)(extractComponents[k]*65535); } break; - case GL_UNSIGNED_INT_8_8_8_8_REV: + case GL_UNSIGNED_INT_8_8_8_8_REV: extract8888rev(myswap_bytes,iter,extractComponents); for (k = 0; k < 4; k++) { *iter2++ = (GLushort)(extractComponents[k]*65535); } break; - case GL_UNSIGNED_INT_10_10_10_2: + case GL_UNSIGNED_INT_10_10_10_2: extract1010102(myswap_bytes,iter,extractComponents); for (k = 0; k < 4; k++) { *iter2++ = (GLushort)(extractComponents[k]*65535); @@ -5112,7 +5112,7 @@ static void fill_image(const PixelStorageModes *psm, /* want 'iter' pointing at start, not within, row for assertion * purposes */ - iter= start; + iter= start; #endif } /* for i */ @@ -5262,7 +5262,7 @@ static void empty_image(const PixelStorageModes *psm, *((GLbyte *) iter) = *iter2++ >> 9; } break; - case GL_UNSIGNED_SHORT_5_6_5: + case GL_UNSIGNED_SHORT_5_6_5: for (k = 0; k < 3; k++) { shoveComponents[k]= *iter2++ / 65535.0; } @@ -5275,7 +5275,7 @@ static void empty_image(const PixelStorageModes *psm, *(GLushort *)iter = widget.us[0]; } break; - case GL_UNSIGNED_SHORT_5_6_5_REV: + case GL_UNSIGNED_SHORT_5_6_5_REV: for (k = 0; k < 3; k++) { shoveComponents[k]= *iter2++ / 65535.0; } @@ -5454,7 +5454,7 @@ static void empty_image(const PixelStorageModes *psm, /* want 'iter' pointing at start, not within, row for assertion * purposes */ - iter= start; + iter= start; #endif } /* for i */ @@ -5494,7 +5494,7 @@ static void extract332(int isSwap, } /* extract332() */ static void shove332(const GLfloat shoveComponents[], - int index, void *packedPixel) + int index, void *packedPixel) { /* 11100000 == 0xe0 */ /* 00011100 == 0x1c */ @@ -5530,7 +5530,7 @@ static void extract233rev(int isSwap, } /* extract233rev() */ static void shove233rev(const GLfloat shoveComponents[], - int index, void *packedPixel) + int index, void *packedPixel) { /* 0000,0111 == 0x07 */ /* 0011,1000 == 0x38 */ @@ -6140,7 +6140,7 @@ static void scaleInternalPackedPixel(int components, #endif /* calculate the value for pixels in the last row */ - + y_percent = highy_float; percent = y_percent * (1-lowx_float); temp = (const char *)dataIn + xindex + highy_int * rowSizeInBytes; @@ -6536,7 +6536,7 @@ static void halve1DimagePackedPixel(int components, (*extractPackedPixel)(isSwap,src, &extractTotals[0][0]); (*extractPackedPixel)(isSwap,(src+pixelSizeInBytes), - &extractTotals[1][0]); + &extractTotals[1][0]); for (cc = 0; cc < components; cc++) { int kk; @@ -6582,7 +6582,7 @@ static void halve1DimagePackedPixel(int components, (*extractPackedPixel)(isSwap,src, &extractTotals[0][0]); (*extractPackedPixel)(isSwap,(src+rowSizeInBytes), - &extractTotals[1][0]); + &extractTotals[1][0]); for (cc = 0; cc < components; cc++) { int kk; @@ -6773,31 +6773,31 @@ static void fillImage3D(const PixelStorageModes *psm, *iter2++ = (GLushort)(extractComponents[k]*65535); } break; - case GL_UNSIGNED_SHORT_5_6_5: + case GL_UNSIGNED_SHORT_5_6_5: extract565(myswapBytes,iter,extractComponents); for (k = 0; k < 3; k++) { *iter2++ = (GLushort)(extractComponents[k]*65535); } break; - case GL_UNSIGNED_SHORT_5_6_5_REV: + case GL_UNSIGNED_SHORT_5_6_5_REV: extract565rev(myswapBytes,iter,extractComponents); for (k = 0; k < 3; k++) { *iter2++ = (GLushort)(extractComponents[k]*65535); } break; - case GL_UNSIGNED_SHORT_4_4_4_4: + case GL_UNSIGNED_SHORT_4_4_4_4: extract4444(myswapBytes,iter,extractComponents); for (k = 0; k < 4; k++) { *iter2++ = (GLushort)(extractComponents[k]*65535); } break; - case GL_UNSIGNED_SHORT_4_4_4_4_REV: + case GL_UNSIGNED_SHORT_4_4_4_4_REV: extract4444rev(myswapBytes,iter,extractComponents); for (k = 0; k < 4; k++) { *iter2++ = (GLushort)(extractComponents[k]*65535); } break; - case GL_UNSIGNED_SHORT_5_5_5_1: + case GL_UNSIGNED_SHORT_5_5_5_1: extract5551(myswapBytes,iter,extractComponents); for (k = 0; k < 4; k++) { *iter2++ = (GLushort)(extractComponents[k]*65535); @@ -6829,19 +6829,19 @@ static void fillImage3D(const PixelStorageModes *psm, *iter2++ = widget.us[0]; } break; - case GL_UNSIGNED_INT_8_8_8_8: + case GL_UNSIGNED_INT_8_8_8_8: extract8888(myswapBytes,iter,extractComponents); for (k = 0; k < 4; k++) { *iter2++ = (GLushort)(extractComponents[k]*65535); } break; - case GL_UNSIGNED_INT_8_8_8_8_REV: + case GL_UNSIGNED_INT_8_8_8_8_REV: extract8888rev(myswapBytes,iter,extractComponents); for (k = 0; k < 4; k++) { *iter2++ = (GLushort)(extractComponents[k]*65535); } break; - case GL_UNSIGNED_INT_10_10_10_2: + case GL_UNSIGNED_INT_10_10_10_2: extract1010102(myswapBytes,iter,extractComponents); for (k = 0; k < 4; k++) { *iter2++ = (GLushort)(extractComponents[k]*65535); @@ -7139,7 +7139,7 @@ static void emptyImage3D(const PixelStorageModes *psm, } shove233rev(shoveComponents,0,(void *)iter); break; - case GL_UNSIGNED_SHORT_5_6_5: + case GL_UNSIGNED_SHORT_5_6_5: for (k = 0; k < 3; k++) { shoveComponents[k]= *iter2++ / 65535.0; } @@ -7152,7 +7152,7 @@ static void emptyImage3D(const PixelStorageModes *psm, *(GLushort *)iter = widget.us[0]; } break; - case GL_UNSIGNED_SHORT_5_6_5_REV: + case GL_UNSIGNED_SHORT_5_6_5_REV: for (k = 0; k < 3; k++) { shoveComponents[k]= *iter2++ / 65535.0; } @@ -7412,7 +7412,7 @@ static void closestFit3D(GLenum target, GLint width, GLint height, GLint depth, GLint *newWidth, GLint *newHeight, GLint *newDepth) { GLint widthPowerOf2= nearestPower(width); - GLint heightPowerOf2= nearestPower(height); + GLint heightPowerOf2= nearestPower(height); GLint depthPowerOf2= nearestPower(depth); GLint proxyWidth; @@ -7507,7 +7507,7 @@ static void halveImagePackedPixelSlice(int components, } totals[cc]/= (float)BOX2; } /* for cc */ - + (*shovePackedPixel)(totals,outIndex,dataOut); outIndex++; /* skip over to next group of 2 */ @@ -7827,7 +7827,7 @@ static int gluBuild3DMipmapLevelsCore(GLenum target, GLint internalFormat, /* clamp to 1 */ if (nextWidth < 1) nextWidth= 1; if (nextHeight < 1) nextHeight= 1; - if (nextDepth < 1) nextDepth= 1; + if (nextDepth < 1) nextDepth= 1; memReq = imageSize3D(nextWidth, nextHeight, nextDepth, format, type); } switch(type) { @@ -7868,7 +7868,7 @@ static int gluBuild3DMipmapLevelsCore(GLenum target, GLint internalFormat, case GL_UNSIGNED_INT_8_8_8_8_REV: case GL_UNSIGNED_INT_10_10_10_2: case GL_UNSIGNED_INT_2_10_10_10_REV: - dstImage = (GLuint *)malloc(memReq); + dstImage = (GLuint *)malloc(memReq); break; default: return GLU_INVALID_ENUM; /* assertion */ @@ -8179,8 +8179,8 @@ static int gluBuild3DMipmapLevelsCore(GLenum target, GLint internalFormat, int nextHeight= newHeight/2; int nextDepth= newDepth/2; if (nextWidth < 1) nextWidth= 1; - if (nextHeight < 1) nextHeight= 1; - if (nextDepth < 1) nextDepth= 1; + if (nextHeight < 1) nextHeight= 1; + if (nextDepth < 1) nextDepth= 1; memReq = imageSize3D(nextWidth, nextHeight, nextDepth, format, type); } @@ -8240,7 +8240,7 @@ static int gluBuild3DMipmapLevelsCore(GLenum target, GLint internalFormat, } } /* level userLevel is in srcImage; nothing saved yet */ - level = userLevel; + level = userLevel; } glPixelStorei(GL_UNPACK_SWAP_BYTES, GL_FALSE); @@ -8371,13 +8371,13 @@ static int gluBuild3DMipmapLevelsCore(GLenum target, GLint internalFormat, srcImage,dstImage,elementSize,rowSize, imageSize,myswapBytes); break; - case GL_UNSIGNED_SHORT_5_5_5_1: + case GL_UNSIGNED_SHORT_5_5_5_1: halveImagePackedPixel3D(4,extract5551,shove5551, newWidth,newHeight,newDepth, srcImage,dstImage,elementSize,rowSize, imageSize,myswapBytes); break; - case GL_UNSIGNED_SHORT_1_5_5_5_REV: + case GL_UNSIGNED_SHORT_1_5_5_5_REV: halveImagePackedPixel3D(4,extract1555rev,shove1555rev, newWidth,newHeight,newDepth, srcImage,dstImage,elementSize,rowSize, diff --git a/src/glu/sgi/libutil/project.c b/src/glu/sgi/libutil/project.c index f4bf883..010c2e9 100644 --- a/src/glu/sgi/libutil/project.c +++ b/src/glu/sgi/libutil/project.c @@ -152,7 +152,7 @@ static void __gluMultMatrixVecd(const GLdouble matrix[16], const GLdouble in[4], int i; for (i=0; i<4; i++) { - out[i] = + out[i] = in[0] * matrix[0*4+i] + in[1] * matrix[1*4+i] + in[2] * matrix[2*4+i] + @@ -221,7 +221,7 @@ static void __gluMultMatricesd(const GLdouble a[16], const GLdouble b[16], for (i = 0; i < 4; i++) { for (j = 0; j < 4; j++) { - r[i*4+j] = + r[i*4+j] = a[i*4+0]*b[0*4+j] + a[i*4+1]*b[1*4+j] + a[i*4+2]*b[2*4+j] + @@ -231,8 +231,8 @@ static void __gluMultMatricesd(const GLdouble a[16], const GLdouble b[16], } GLint GLAPIENTRY -gluProject(GLdouble objx, GLdouble objy, GLdouble objz, - const GLdouble modelMatrix[16], +gluProject(GLdouble objx, GLdouble objy, GLdouble objz, + const GLdouble modelMatrix[16], const GLdouble projMatrix[16], const GLint viewport[4], GLdouble *winx, GLdouble *winy, GLdouble *winz) @@ -267,7 +267,7 @@ gluProject(GLdouble objx, GLdouble objy, GLdouble objz, GLint GLAPIENTRY gluUnProject(GLdouble winx, GLdouble winy, GLdouble winz, - const GLdouble modelMatrix[16], + const GLdouble modelMatrix[16], const GLdouble projMatrix[16], const GLint viewport[4], GLdouble *objx, GLdouble *objy, GLdouble *objz) @@ -306,10 +306,10 @@ gluUnProject(GLdouble winx, GLdouble winy, GLdouble winz, GLint GLAPIENTRY gluUnProject4(GLdouble winx, GLdouble winy, GLdouble winz, GLdouble clipw, - const GLdouble modelMatrix[16], + const GLdouble modelMatrix[16], const GLdouble projMatrix[16], const GLint viewport[4], - GLclampd nearVal, GLclampd farVal, + GLclampd nearVal, GLclampd farVal, GLdouble *objx, GLdouble *objy, GLdouble *objz, GLdouble *objw) { @@ -348,7 +348,7 @@ void GLAPIENTRY gluPickMatrix(GLdouble x, GLdouble y, GLdouble deltax, GLdouble deltay, GLint viewport[4]) { - if (deltax <= 0 || deltay <= 0) { + if (deltax <= 0 || deltay <= 0) { return; } diff --git a/src/glu/sgi/libutil/registry.c b/src/glu/sgi/libutil/registry.c index 2e3b574..53f163c 100644 --- a/src/glu/sgi/libutil/registry.c +++ b/src/glu/sgi/libutil/registry.c @@ -53,7 +53,7 @@ gluGetString(GLenum name) } /* extName is an extension name. - * extString is a string of extensions separated by blank(s). There may or + * extString is a string of extensions separated by blank(s). There may or * may not be leading or trailing blank(s) in extString. * This works in cases of extensions being prefixes of another like * GL_EXT_texture and GL_EXT_texture3D. @@ -69,7 +69,7 @@ gluCheckExtension(const GLubyte *extName, const GLubyte *extString) if (extString == NULL) return GL_FALSE; - deleteThis = lookHere = (char *)malloc(strlen((const char *)extString)+1); + deleteThis = lookHere = (char *)malloc(strlen((const char *)extString)+1); if (lookHere == NULL) return GL_FALSE; /* strtok() will modify string, so copy it somewhere */ @@ -79,7 +79,7 @@ gluCheckExtension(const GLubyte *extName, const GLubyte *extString) if (strcmp(word,(const char *)extName) == 0) { flag = GL_TRUE; break; - } + } lookHere = NULL; /* get next token */ } free((void *)deleteThis); diff --git a/src/glu/sgi/mesaglu.opt b/src/glu/sgi/mesaglu.opt index 9bac432..aa83efa 100644 --- a/src/glu/sgi/mesaglu.opt +++ b/src/glu/sgi/mesaglu.opt @@ -1,67 +1,67 @@ -! -! ### UNIVERSAL procedures and global definitions extracted from MESAGL.MAP -! -case_sensitive=YES -symbol_vector = (gluErrorString = PROCEDURE) -symbol_vector = (__gluNURBSErrorString = PROCEDURE) -symbol_vector = (__gluTessErrorString = PROCEDURE) -symbol_vector = (gluBuild3DMipmaps = PROCEDURE) -symbol_vector = (gluBuild3DMipmapLevels = PROCEDURE) -symbol_vector = (gluBuild2DMipmaps = PROCEDURE) -symbol_vector = (gluBuild2DMipmapLevels = PROCEDURE) -symbol_vector = (gluBuild1DMipmaps = PROCEDURE) -symbol_vector = (gluBuild1DMipmapLevels = PROCEDURE) -symbol_vector = (gluScaleImage = PROCEDURE) -symbol_vector = (gluPickMatrix = PROCEDURE) -symbol_vector = (gluUnProject4 = PROCEDURE) -symbol_vector = (gluUnProject = PROCEDURE) -symbol_vector = (gluProject = PROCEDURE) -symbol_vector = (gluLookAt = PROCEDURE) -symbol_vector = (gluPerspective = PROCEDURE) -symbol_vector = (gluOrtho2D = PROCEDURE) -symbol_vector = (gluNewQuadric = PROCEDURE) -symbol_vector = (gluSphere = PROCEDURE) -symbol_vector = (gluPartialDisk = PROCEDURE) -symbol_vector = (gluDisk = PROCEDURE) -symbol_vector = (gluCylinder = PROCEDURE) -symbol_vector = (gluQuadricDrawStyle = PROCEDURE) -symbol_vector = (gluQuadricOrientation = PROCEDURE) -symbol_vector = (gluQuadricTexture = PROCEDURE) -symbol_vector = (gluQuadricNormals = PROCEDURE) -symbol_vector = (gluQuadricCallback = PROCEDURE) -symbol_vector = (gluDeleteQuadric = PROCEDURE) -symbol_vector = (gluGetString = PROCEDURE) -symbol_vector = (gluCheckExtension = PROCEDURE) -symbol_vector = (gluTessEndContour = PROCEDURE) -symbol_vector = (gluTessBeginContour = PROCEDURE) -symbol_vector = (gluTessBeginPolygon = PROCEDURE) -symbol_vector = (gluTessEndPolygon = PROCEDURE) -symbol_vector = (gluEndPolygon = PROCEDURE) -symbol_vector = (gluNextContour = PROCEDURE) -symbol_vector = (gluBeginPolygon = PROCEDURE) -symbol_vector = (gluTessVertex = PROCEDURE) -symbol_vector = (gluTessCallback = PROCEDURE) -symbol_vector = (gluTessNormal = PROCEDURE) -symbol_vector = (gluGetTessProperty = PROCEDURE) -symbol_vector = (gluTessProperty = PROCEDURE) -symbol_vector = (gluDeleteTess = PROCEDURE) -symbol_vector = (gluNewTess = PROCEDURE) -symbol_vector = (gluNurbsCallbackDataEXT = PROCEDURE) -symbol_vector = (gluNurbsCallbackData = PROCEDURE) -symbol_vector = (gluNurbsCallback = PROCEDURE) -symbol_vector = (gluGetNurbsProperty = PROCEDURE) -symbol_vector = (gluNurbsProperty = PROCEDURE) -symbol_vector = (gluLoadSamplingMatrices = PROCEDURE) -symbol_vector = (gluNurbsSurface = PROCEDURE) -symbol_vector = (gluNurbsCurve = PROCEDURE) -symbol_vector = (gluPwlCurve = PROCEDURE) -symbol_vector = (gluEndTrim = PROCEDURE) -symbol_vector = (gluBeginTrim = PROCEDURE) -symbol_vector = (gluEndSurface = PROCEDURE) -symbol_vector = (gluEndCurve = PROCEDURE) -symbol_vector = (gluBeginCurve = PROCEDURE) -symbol_vector = (gluBeginSurface = PROCEDURE) -symbol_vector = (gluDeleteNurbsTessellatorEXT = PROCEDURE) -symbol_vector = (gluDeleteNurbsRenderer = PROCEDURE) -symbol_vector = (gluNewNurbsRenderer = PROCEDURE) -symbol_vector = (glu_LOD_eval_list = PROCEDURE) +! +! ### UNIVERSAL procedures and global definitions extracted from MESAGL.MAP +! +case_sensitive=YES +symbol_vector = (gluErrorString = PROCEDURE) +symbol_vector = (__gluNURBSErrorString = PROCEDURE) +symbol_vector = (__gluTessErrorString = PROCEDURE) +symbol_vector = (gluBuild3DMipmaps = PROCEDURE) +symbol_vector = (gluBuild3DMipmapLevels = PROCEDURE) +symbol_vector = (gluBuild2DMipmaps = PROCEDURE) +symbol_vector = (gluBuild2DMipmapLevels = PROCEDURE) +symbol_vector = (gluBuild1DMipmaps = PROCEDURE) +symbol_vector = (gluBuild1DMipmapLevels = PROCEDURE) +symbol_vector = (gluScaleImage = PROCEDURE) +symbol_vector = (gluPickMatrix = PROCEDURE) +symbol_vector = (gluUnProject4 = PROCEDURE) +symbol_vector = (gluUnProject = PROCEDURE) +symbol_vector = (gluProject = PROCEDURE) +symbol_vector = (gluLookAt = PROCEDURE) +symbol_vector = (gluPerspective = PROCEDURE) +symbol_vector = (gluOrtho2D = PROCEDURE) +symbol_vector = (gluNewQuadric = PROCEDURE) +symbol_vector = (gluSphere = PROCEDURE) +symbol_vector = (gluPartialDisk = PROCEDURE) +symbol_vector = (gluDisk = PROCEDURE) +symbol_vector = (gluCylinder = PROCEDURE) +symbol_vector = (gluQuadricDrawStyle = PROCEDURE) +symbol_vector = (gluQuadricOrientation = PROCEDURE) +symbol_vector = (gluQuadricTexture = PROCEDURE) +symbol_vector = (gluQuadricNormals = PROCEDURE) +symbol_vector = (gluQuadricCallback = PROCEDURE) +symbol_vector = (gluDeleteQuadric = PROCEDURE) +symbol_vector = (gluGetString = PROCEDURE) +symbol_vector = (gluCheckExtension = PROCEDURE) +symbol_vector = (gluTessEndContour = PROCEDURE) +symbol_vector = (gluTessBeginContour = PROCEDURE) +symbol_vector = (gluTessBeginPolygon = PROCEDURE) +symbol_vector = (gluTessEndPolygon = PROCEDURE) +symbol_vector = (gluEndPolygon = PROCEDURE) +symbol_vector = (gluNextContour = PROCEDURE) +symbol_vector = (gluBeginPolygon = PROCEDURE) +symbol_vector = (gluTessVertex = PROCEDURE) +symbol_vector = (gluTessCallback = PROCEDURE) +symbol_vector = (gluTessNormal = PROCEDURE) +symbol_vector = (gluGetTessProperty = PROCEDURE) +symbol_vector = (gluTessProperty = PROCEDURE) +symbol_vector = (gluDeleteTess = PROCEDURE) +symbol_vector = (gluNewTess = PROCEDURE) +symbol_vector = (gluNurbsCallbackDataEXT = PROCEDURE) +symbol_vector = (gluNurbsCallbackData = PROCEDURE) +symbol_vector = (gluNurbsCallback = PROCEDURE) +symbol_vector = (gluGetNurbsProperty = PROCEDURE) +symbol_vector = (gluNurbsProperty = PROCEDURE) +symbol_vector = (gluLoadSamplingMatrices = PROCEDURE) +symbol_vector = (gluNurbsSurface = PROCEDURE) +symbol_vector = (gluNurbsCurve = PROCEDURE) +symbol_vector = (gluPwlCurve = PROCEDURE) +symbol_vector = (gluEndTrim = PROCEDURE) +symbol_vector = (gluBeginTrim = PROCEDURE) +symbol_vector = (gluEndSurface = PROCEDURE) +symbol_vector = (gluEndCurve = PROCEDURE) +symbol_vector = (gluBeginCurve = PROCEDURE) +symbol_vector = (gluBeginSurface = PROCEDURE) +symbol_vector = (gluDeleteNurbsTessellatorEXT = PROCEDURE) +symbol_vector = (gluDeleteNurbsRenderer = PROCEDURE) +symbol_vector = (gluNewNurbsRenderer = PROCEDURE) +symbol_vector = (glu_LOD_eval_list = PROCEDURE) diff --git a/src/glw/GLwDrawA.c b/src/glw/GLwDrawA.c index 30304a4..cb47251 100644 --- a/src/glw/GLwDrawA.c +++ b/src/glw/GLwDrawA.c @@ -1,13 +1,13 @@ /* * (c) Copyright 1993, Silicon Graphics, Inc. - * ALL RIGHTS RESERVED - * Permission to use, copy, modify, and distribute this software for + * ALL RIGHTS RESERVED + * Permission to use, copy, modify, and distribute this software for * any purpose and without fee is hereby granted, provided that the above * copyright notice appear in all copies and that both the copyright notice - * and this permission notice appear in supporting documentation, and that + * and this permission notice appear in supporting documentation, and that * the name of Silicon Graphics, Inc. not be used in advertising * or publicity pertaining to distribution of the software without specific, - * written prior permission. + * written prior permission. * * THE MATERIAL EMBODIED ON THIS SOFTWARE IS PROVIDED TO YOU "AS-IS" * AND WITHOUT WARRANTY OF ANY KIND, EXPRESS, IMPLIED OR OTHERWISE, @@ -21,9 +21,9 @@ * ADVISED OF THE POSSIBILITY OF SUCH LOSS, HOWEVER CAUSED AND ON * ANY THEORY OF LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE * POSSESSION, USE OR PERFORMANCE OF THIS SOFTWARE. - * - * - * US Government Users Restricted Rights + * + * + * US Government Users Restricted Rights * Use, duplication, or disclosure by the Government is subject to * restrictions set forth in FAR 52.227.19(c)(2) or subparagraph * (c)(1)(ii) of the Rights in Technical Data and Computer Software @@ -52,9 +52,9 @@ #ifdef __GLX_MOTIF #include #include "GLwMDrawAP.h" -#else +#else #include "GLwDrawAP.h" -#endif +#endif #include #include @@ -64,7 +64,7 @@ #define glwDrawingAreaClassRec glwMDrawingAreaClassRec #define glwDrawingAreaWidgetClass glwMDrawingAreaWidgetClass #define GLwDrawingAreaRec GLwMDrawingAreaRec -#endif +#endif #define ATTRIBLIST_SIZE 32 @@ -119,52 +119,52 @@ static XtResource resources[] = { {GLwNbufferSize, GLwCBufferSize, XtRInt, sizeof (int), offset(bufferSize), XtRImmediate, (XtPointer) 0}, - + {GLwNlevel, GLwCLevel, XtRInt, sizeof (int), offset(level), XtRImmediate, (XtPointer) 0}, - + {GLwNrgba, GLwCRgba, XtRBoolean, sizeof (Boolean), offset(rgba), XtRImmediate, (XtPointer) FALSE}, - + {GLwNdoublebuffer, GLwCDoublebuffer, XtRBoolean, sizeof (Boolean), offset(doublebuffer), XtRImmediate, (XtPointer) FALSE}, - + {GLwNstereo, GLwCStereo, XtRBoolean, sizeof (Boolean), offset(stereo), XtRImmediate, (XtPointer) FALSE}, - + {GLwNauxBuffers, GLwCAuxBuffers, XtRInt, sizeof (int), offset(auxBuffers), XtRImmediate, (XtPointer) 0}, - + {GLwNredSize, GLwCColorSize, XtRInt, sizeof (int), offset(redSize), XtRImmediate, (XtPointer) 1}, - + {GLwNgreenSize, GLwCColorSize, XtRInt, sizeof (int), offset(greenSize), XtRImmediate, (XtPointer) 1}, - + {GLwNblueSize, GLwCColorSize, XtRInt, sizeof (int), offset(blueSize), XtRImmediate, (XtPointer) 1}, - + {GLwNalphaSize, GLwCAlphaSize, XtRInt, sizeof (int), offset(alphaSize), XtRImmediate, (XtPointer) 0}, - + {GLwNdepthSize, GLwCDepthSize, XtRInt, sizeof (int), offset(depthSize), XtRImmediate, (XtPointer) 0}, - + {GLwNstencilSize, GLwCStencilSize, XtRInt, sizeof (int), offset(stencilSize), XtRImmediate, (XtPointer) 0}, - + {GLwNaccumRedSize, GLwCAccumColorSize, XtRInt, sizeof (int), offset(accumRedSize), XtRImmediate, (XtPointer) 0}, - + {GLwNaccumGreenSize, GLwCAccumColorSize, XtRInt, sizeof (int), offset(accumGreenSize), XtRImmediate, (XtPointer) 0}, - + {GLwNaccumBlueSize, GLwCAccumColorSize, XtRInt, sizeof (int), offset(accumBlueSize), XtRImmediate, (XtPointer) 0}, - + {GLwNaccumAlphaSize, GLwCAccumAlphaSize, XtRInt, sizeof (int), offset(accumAlphaSize), XtRImmediate, (XtPointer) 0}, - + /* the attribute list */ {GLwNattribList, GLwCAttribList, XtRPointer, sizeof(int *), offset(attribList), XtRImmediate, (XtPointer) NULL}, @@ -203,7 +203,7 @@ static XtResource resources[] = { {XmNtraversalOn, XmCTraversalOn, XmRBoolean, sizeof (Boolean), XtOffset (GLwDrawingAreaWidget, primitive.traversal_on), XmRImmediate, (XtPointer)FALSE}, - + /* highlighting is normally disabled, as when Motif tries to disable * highlighting, it tries to reset the color back to the parent's * background (usually Motif blue). Unfortunately, that is in a @@ -212,12 +212,12 @@ static XtResource resources[] = { {XmNhighlightOnEnter, XmCHighlightOnEnter, XmRBoolean, sizeof (Boolean), XtOffset (GLwDrawingAreaWidget, primitive.highlight_on_enter), XmRImmediate, (XtPointer) FALSE}, - + {XmNhighlightThickness, XmCHighlightThickness, XmRHorizontalDimension, sizeof (Dimension), XtOffset (GLwDrawingAreaWidget, primitive.highlight_thickness), XmRImmediate, (XtPointer) 0}, -#endif +#endif }; @@ -236,16 +236,16 @@ static XtResource initializeResources[] = { /* reallocate any colors we need in the new colormap */ - + /* The background is obtained only if the allocateBackground resource is TRUE*/ static XtResource backgroundResources[] = { #ifdef __GLX_MOTIF - {XmNbackground, XmCBackground,XmRPixel, + {XmNbackground, XmCBackground,XmRPixel, sizeof(Pixel),XtOffset(GLwDrawingAreaWidget,core.background_pixel), XmRString,(XtPointer)"lightgrey"}, /*XmRCallProc,(XtPointer)_XmBackgroundColorDefault},*/ - {XmNbackgroundPixmap,XmCPixmap,XmRXmBackgroundPixmap, + {XmNbackgroundPixmap,XmCPixmap,XmRXmBackgroundPixmap, sizeof(Pixmap),XtOffset(GLwDrawingAreaWidget,core.background_pixmap), XmRImmediate,(XtPointer)XmUNSPECIFIED_PIXMAP}, @@ -258,7 +258,7 @@ static XtResource backgroundResources[] = { {XtNbackgroundPixmap, XtCPixmap, XtRPixmap, sizeof(Pixmap), XtOffset(GLwDrawingAreaWidget,core.background_pixmap), XtRImmediate,(XtPointer)XtUnspecifiedPixmap}, -#endif +#endif }; @@ -268,7 +268,7 @@ static XtResource backgroundResources[] = { */ #ifdef __GLX_MOTIF static XtResource otherColorResources[] = { - {XmNforeground,XmCForeground,XmRPixel, + {XmNforeground,XmCForeground,XmRPixel, sizeof(Pixel),XtOffset(GLwDrawingAreaWidget,primitive.foreground), XmRString,(XtPointer)"lighgrey"}, /*XmRCallProc, (XtPointer) _XmForegroundColorDefault},*/ @@ -338,9 +338,9 @@ GLwDrawingAreaClassRec glwDrawingAreaClassRec = { /* arm_and_activate */ NULL, /* get_resources */ NULL, /* num get_resources */ 0, - /* extension */ NULL, + /* extension */ NULL, } -#endif +#endif }; WidgetClass glwDrawingAreaWidgetClass=(WidgetClass)&glwDrawingAreaClassRec; @@ -432,7 +432,7 @@ static void createColormap(GLwDrawingAreaWidget w,int offset,XrmValue *value){ static int cacheEntries=0; static int cacheMalloced=0; register int i; - + assert(w->glwDrawingArea.visualInfo); /* see if we can find it in the cache */ @@ -458,7 +458,7 @@ static void createColormap(GLwDrawingAreaWidget w,int offset,XrmValue *value){ cmapCache=(struct cmapCache*)XtRealloc((char*)cmapCache,sizeof(struct cmapCache)*cacheMalloced); } } - + cmapCache[cacheEntries].cmap=XCreateColormap(XtDisplay(w), RootWindow(XtDisplay(w), w->glwDrawingArea.visualInfo->screen), @@ -510,7 +510,7 @@ static void Initialize(GLwDrawingAreaWidget req,GLwDrawingAreaWidget neww,ArgLis if(req->glwDrawingArea.allocateOtherColors){ XtGetApplicationResources((Widget)neww,neww,otherColorResources,XtNumber(otherColorResources),args,*num_args); } -#endif +#endif } @@ -522,14 +522,14 @@ static void Realize(Widget w,Mask *valueMask,XSetWindowAttributes *attributes){ Status status; Window windows[2],*windowsReturn,*windowList; int countReturn,i; - + /* if we haven't requested that the background be both installed and * allocated, don't install it. */ if(!(glw->glwDrawingArea.installBackground && glw->glwDrawingArea.allocateBackground)){ *valueMask&=~CWBackPixel; } - + XtCreateWindow(w,(unsigned int)InputOutput,glw->glwDrawingArea.visualInfo->visual,*valueMask,attributes); /* if appropriate, call XSetWMColormapWindows to install the colormap */ @@ -542,7 +542,7 @@ static void Realize(Widget w,Mask *valueMask,XSetWindowAttributes *attributes){ /* check to see if there is already a property */ status=XGetWMColormapWindows(XtDisplay(parentShell),XtWindow(parentShell),&windowsReturn,&countReturn); - + /* if no property, just create one */ if(!status){ windows[0]=XtWindow(w); @@ -624,7 +624,7 @@ static void Destroy(GLwDrawingAreaWidget glw){ /* make sure there is a property */ status=XGetWMColormapWindows(XtDisplay(parentShell),XtWindow(parentShell),&windowsReturn,&countReturn); - + /* if no property, just return. If there was a property, continue */ if(status){ @@ -636,7 +636,7 @@ static void Destroy(GLwDrawingAreaWidget glw){ for(i++; ido_destroy = False; /* TODO: darwin: Integrate with above to do indirect */ - if(apple_glx_create_context(&gc->driContext, dpy, screen, fbconfig, + if(apple_glx_create_context(&gc->driContext, dpy, screen, fbconfig, shareList ? shareList->driContext : NULL, &errorcode, &x11error)) { __glXSendError(dpy, errorcode, 0, X_GLXCreateContext, x11error); diff --git a/src/glx/dri2.c b/src/glx/dri2.c index adfd3d1..5e99c73 100644 --- a/src/glx/dri2.c +++ b/src/glx/dri2.c @@ -235,7 +235,7 @@ DRI2QueryVersion(Display * dpy, int *major, int *minor) nevents = 2; break; } - + for (i = 0; i < nevents; i++) { XESetWireToEvent (dpy, info->codes->first_event + i, DRI2WireToEvent); XESetEventToWire (dpy, info->codes->first_event + i, DRI2EventToWire); diff --git a/src/glx/dri2_glx.c b/src/glx/dri2_glx.c index b0559b2..51502ef 100644 --- a/src/glx/dri2_glx.c +++ b/src/glx/dri2_glx.c @@ -832,7 +832,7 @@ dri2CreateScreen(int screen, struct glx_display * priv) goto handle_error; } - + /* If the server does not support the protocol for * DRI2GetBuffersWithFormat, don't supply that interface to the driver. */ @@ -962,7 +962,7 @@ dri2CreateDisplay(Display * dpy) pdp->loader_extensions[i++] = &dri2LoaderExtension_old.base; else pdp->loader_extensions[i++] = &dri2LoaderExtension.base; - + pdp->loader_extensions[i++] = &systemTimeExtension.base; #ifdef __DRI_USE_INVALIDATE diff --git a/src/glx/dri_glx.c b/src/glx/dri_glx.c index 42b263c..6751a6d 100644 --- a/src/glx/dri_glx.c +++ b/src/glx/dri_glx.c @@ -304,7 +304,7 @@ static const __DRIextension *loader_extensions[] = { /** * Perform the required libGL-side initialization and call the client-side * driver's \c __driCreateNewScreen function. - * + * * \param dpy Display pointer. * \param scrn Screen number on the display. * \param psc DRI screen information. @@ -715,7 +715,7 @@ driDrawableGetMSC(struct glx_screen *base, __GLXDRIdrawable *pdraw, if (pdp && psc->sbc && psc->msc) return ( (*psc->msc->getMSC)(psc->driScreen, msc) == 0 && - (*psc->sbc->getSBC)(pdp->driDrawable, sbc) == 0 && + (*psc->sbc->getSBC)(pdp->driDrawable, sbc) == 0 && __glXGetUST(ust) == 0 ); } diff --git a/src/glx/glx_pbuffer.c b/src/glx/glx_pbuffer.c index 5f91bc6..7cf2344 100644 --- a/src/glx/glx_pbuffer.c +++ b/src/glx/glx_pbuffer.c @@ -659,9 +659,9 @@ glXCreatePbuffer(Display * dpy, GLXFBConfig config, const int *attrib_list) if (apple_glx_pbuffer_create(dpy, config, width, height, &errorcode, &result)) { - /* + /* * apple_glx_pbuffer_create only sets the errorcode to core X11 - * errors. + * errors. */ __glXSendError(dpy, errorcode, 0, X_GLXCreatePbuffer, true); @@ -728,7 +728,7 @@ glXQueryDrawable(Display * dpy, GLXDrawable drawable, * use XSetErrorHandler(), which is known to not be thread safe. * If we use a round-trip call to validate the drawable, there could * be a race, so instead we just opt in favor of letting the - * XGetGeometry request fail with a GetGeometry request X error + * XGetGeometry request fail with a GetGeometry request X error * rather than GLXBadDrawable, in what is hoped to be a rare * case of an invalid drawable. In practice most and possibly all * X11 apps using GLX shouldn't notice a difference. @@ -775,7 +775,7 @@ glXSelectEvent(Display * dpy, GLXDrawable drawable, unsigned long mask) if (apple_glx_pbuffer_set_event_mask(drawable, mask)) return; /*done */ - /* + /* * The spec allows a window, but currently there are no valid * events for a window, so do nothing. */ @@ -808,7 +808,7 @@ glXGetSelectedEvent(Display * dpy, GLXDrawable drawable, unsigned long *mask) if (apple_glx_pbuffer_get_event_mask(drawable, mask)) return; /*done */ - /* + /* * The spec allows a window, but currently there are no valid * events for a window, so do nothing, but set the mask to 0. */ diff --git a/src/glx/glxclient.h b/src/glx/glxclient.h index 36a0808..5cffc39 100644 --- a/src/glx/glxclient.h +++ b/src/glx/glxclient.h @@ -223,7 +223,7 @@ struct glx_context_vtable { GLXDrawable drawable, int buffer, const int *attrib_list); void (*release_tex_image)(Display * dpy, GLXDrawable drawable, int buffer); - + }; extern void diff --git a/src/glx/glxcmds.c b/src/glx/glxcmds.c index d9ca3f5..ab7982f 100644 --- a/src/glx/glxcmds.c +++ b/src/glx/glxcmds.c @@ -482,7 +482,7 @@ glXCopyContext(Display * dpy, GLXContext source_user, mask, &errorcode, &x11error)) { __glXSendError(dpy, errorcode, 0, X_GLXCopyContext, x11error); } - + #else xGLXCopyContextReq *req; struct glx_context *gc = __glXGetCurrentContext(); @@ -607,10 +607,10 @@ glXCreateGLXPixmap(Display * dpy, XVisualInfo * vis, Pixmap pixmap) const struct glx_config *config; config = _gl_context_modes_find_visual(psc->visuals, vis->visualid); - + if(apple_glx_pixmap_create(dpy, vis->screen, pixmap, config)) return None; - + return pixmap; #else xGLXCreateGLXPixmapReq *req; @@ -1786,7 +1786,7 @@ __glXWaitVideoSyncSGI(int divisor, int remainder, unsigned int *count) /* ** GLX_SGIX_fbconfig -** Many of these functions are aliased to GLX 1.3 entry points in the +** Many of these functions are aliased to GLX 1.3 entry points in the ** GLX_functions table. */ diff --git a/src/glx/glxconfig.c b/src/glx/glxconfig.c index 1d9678f..4da6759 100644 --- a/src/glx/glxconfig.c +++ b/src/glx/glxconfig.c @@ -42,7 +42,7 @@ /** * Get data from a GLX config - * + * * \param mode GL context mode whose data is to be returned. * \param attribute Attribute of \c mode that is to be returned. * \param value_return Location to store the data member of \c mode. @@ -207,7 +207,7 @@ glx_config_get(struct glx_config * mode, int attribute, int *value_return) * zero or \c GLX_DONT_CARE (which is -1). As support for additional * extensions is added, the new values will be initialized to appropriate * values from the extension specification. - * + * * \param count Number of structures to allocate. * \param minimum_size Minimum size of a structure to allocate. This allows * for differences in the version of the diff --git a/src/glx/glxconfig.h b/src/glx/glxconfig.h index f7ee958..efb5297 100644 --- a/src/glx/glxconfig.h +++ b/src/glx/glxconfig.h @@ -56,7 +56,7 @@ struct glx_config { /* GLX */ GLint visualID; - GLint visualType; /**< One of the GLX X visual types. (i.e., + GLint visualType; /**< One of the GLX X visual types. (i.e., * \c GLX_TRUE_COLOR, etc.) */ diff --git a/src/glx/glxext.c b/src/glx/glxext.c index c75c9bf..fc59fcb 100644 --- a/src/glx/glxext.c +++ b/src/glx/glxext.c @@ -86,7 +86,7 @@ static /* const */ char *error_list[] = { }; #ifdef GLX_USE_APPLEGL -static char *__glXErrorString(Display *dpy, int code, XExtCodes *codes, +static char *__glXErrorString(Display *dpy, int code, XExtCodes *codes, char *buf, int n); #endif @@ -329,8 +329,8 @@ QueryVersion(Display * dpy, int opcode, int *major, int *minor) #endif /* USE_XCB */ } -/* - * We don't want to enable this GLX_OML_swap_method in glxext.h, +/* + * We don't want to enable this GLX_OML_swap_method in glxext.h, * because we can't support it. The X server writes it out though, * so we should handle it somehow, to avoid false warnings. */ @@ -412,7 +412,7 @@ __glXInitializeVisualConfigFromTags(struct glx_config * config, int count, for (i = 0; i < count; i += 2) { long int tag = *bp++; - + switch (tag) { case GLX_RGBA: FETCH_OR_SET(rgbMode); @@ -493,7 +493,7 @@ __glXInitializeVisualConfigFromTags(struct glx_config * config, int count, config->drawableType = *bp++; #ifdef GLX_USE_APPLEGL /* AppleSGLX supports pixmap and pbuffers with all config. */ - config->drawableType |= GLX_WINDOW_BIT | GLX_PIXMAP_BIT | GLX_PBUFFER_BIT; + config->drawableType |= GLX_WINDOW_BIT | GLX_PIXMAP_BIT | GLX_PBUFFER_BIT; #endif break; case GLX_RENDER_TYPE: @@ -617,7 +617,7 @@ createConfigsFromProperties(Display * dpy, int nvisuals, int nprops, /* Older X servers don't send this so we default it here. */ m->drawableType = GLX_WINDOW_BIT; #else - /* + /* * The XQuartz 2.3.2.1 X server doesn't set this properly, so * set the proper bits here. * AppleSGLX supports windows, pixmaps, and pbuffers with all config. diff --git a/src/glx/glxextensions.h b/src/glx/glxextensions.h index 7877661..d625f13 100644 --- a/src/glx/glxextensions.h +++ b/src/glx/glxextensions.h @@ -260,7 +260,7 @@ extern void __glXEnableDirectExtension(struct glx_screen *psc, const char *name); /* Source-level backwards compatibility with old drivers. They won't - * find the respective functions, though. + * find the respective functions, though. */ typedef void (*PFNGLXENABLEEXTENSIONPROC) (const char *name, GLboolean force_client); diff --git a/src/glx/indirect.c b/src/glx/indirect.c index 49938a1..0fd4165 100644 --- a/src/glx/indirect.c +++ b/src/glx/indirect.c @@ -3,18 +3,18 @@ /* * (C) Copyright IBM Corporation 2004, 2005 * All Rights Reserved. - * + * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, 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. IN NO EVENT SHALL diff --git a/src/glx/indirect.h b/src/glx/indirect.h index f322207..6d064c9 100644 --- a/src/glx/indirect.h +++ b/src/glx/indirect.h @@ -4,18 +4,18 @@ * Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas. * (C) Copyright IBM Corporation 2004 * All Rights Reserved. - * + * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, 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. IN NO EVENT SHALL diff --git a/src/glx/indirect_glx.c b/src/glx/indirect_glx.c index 1870ede..f321121 100644 --- a/src/glx/indirect_glx.c +++ b/src/glx/indirect_glx.c @@ -170,7 +170,7 @@ indirect_unbind_context(struct glx_context *gc, struct glx_context *new) if (gc == new) return; - + /* We are either switching to no context, away from a indirect * context to a direct context or from one dpy to another and have * to send a request to the dpy to unbind the previous context. @@ -436,7 +436,7 @@ indirect_create_context(struct glx_screen *psc, bufSize = __GLX_MAX_RENDER_CMD_SIZE; } gc->maxSmallRenderCommandSize = bufSize; - + return gc; } diff --git a/src/glx/indirect_init.c b/src/glx/indirect_init.c index 9f1ee59..aebbba6 100644 --- a/src/glx/indirect_init.c +++ b/src/glx/indirect_init.c @@ -4,18 +4,18 @@ * Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas. * (C) Copyright IBM Corporation 2004 * All Rights Reserved. - * + * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, 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. IN NO EVENT SHALL diff --git a/src/glx/indirect_size.c b/src/glx/indirect_size.c index 411a0e4..ad5c623 100644 --- a/src/glx/indirect_size.c +++ b/src/glx/indirect_size.c @@ -3,18 +3,18 @@ /* * (C) Copyright IBM Corporation 2004 * All Rights Reserved. - * + * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, 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. IN NO EVENT SHALL diff --git a/src/glx/indirect_size.h b/src/glx/indirect_size.h index 79b849b..7b1910c 100644 --- a/src/glx/indirect_size.h +++ b/src/glx/indirect_size.h @@ -3,18 +3,18 @@ /* * (C) Copyright IBM Corporation 2004 * All Rights Reserved. - * + * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, 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. IN NO EVENT SHALL diff --git a/src/glx/indirect_vertex_array.h b/src/glx/indirect_vertex_array.h index 3738032..937ebc3 100644 --- a/src/glx/indirect_vertex_array.h +++ b/src/glx/indirect_vertex_array.h @@ -1,18 +1,18 @@ /* * (C) Copyright IBM Corporation 2004, 2005 * All Rights Reserved. - * + * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, 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. IN NO EVENT SHALL diff --git a/src/glx/indirect_vertex_array_priv.h b/src/glx/indirect_vertex_array_priv.h index 56dac37..ac7764a 100644 --- a/src/glx/indirect_vertex_array_priv.h +++ b/src/glx/indirect_vertex_array_priv.h @@ -1,18 +1,18 @@ /* * (C) Copyright IBM Corporation 2004, 2005 * All Rights Reserved. - * + * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, 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. IN NO EVENT SHALL @@ -196,14 +196,14 @@ struct array_state_vector struct array_state *arrays; /** - * Number of currently enabled client-side arrays. The value of this + * Number of currently enabled client-side arrays. The value of this * field is only valid if \c array_info_cache_valid is true. */ size_t enabled_client_array_count; /** * \name ARRAY_INFO cache. - * + * * These fields track the state of the ARRAY_INFO cache. The * \c array_info_cache_size is the size of the actual data stored in * \c array_info_cache. \c array_info_cache_buffer_size is the size of @@ -238,7 +238,7 @@ struct array_state_vector * of this protocol is disabled with really old servers (i.e., servers * that don't support GL 1.1 or EXT_vertex_arrays) or when an environment * variable is set. - * + * * \todo * GL 1.1 and EXT_vertex_arrays use identical protocol, but have different * opcodes for \c glDrawArrays. For servers that advertise one or the @@ -249,7 +249,7 @@ struct array_state_vector /** * Is it possible to use the new GL X.X / ARB_vertex_buffer_object * protocol? - * + * * \todo * This protocol has not yet been defined by the ARB, but is currently a * work in progress. This field is a place-holder. @@ -258,7 +258,7 @@ struct array_state_vector /** * Active texture unit set by \c glClientActiveTexture. - * + * * \sa __glXGetActiveTextureUnit */ unsigned active_texture_unit; @@ -268,7 +268,7 @@ struct array_state_vector * GL 1.3 are not supported, this will be at least 1. When multitexture * is supported, this will be the value queried by calling * \c glGetIntegerv with \c GL_MAX_TEXTURE_UNITS. - * + * * \todo * Investigate if this should be the value of \c GL_MAX_TEXTURE_COORDS * instead (if GL 2.0 / ARB_fragment_shader / ARB_fragment_program / @@ -286,14 +286,14 @@ struct array_state_vector /** * \n Methods for implementing various GL functions. - * + * * These method pointers are only valid \c array_info_cache_valid is set. * When each function starts, it much check \c array_info_cache_valid. * If it is not set, it must call \c fill_array_info_cache and call * the new method. - * + * * \sa fill_array_info_cache - * + * * \todo * Write code to plug these functions directly into the dispatch table. */ diff --git a/src/glx/indirect_vertex_program.c b/src/glx/indirect_vertex_program.c index d955fdf..0809f2a 100644 --- a/src/glx/indirect_vertex_program.c +++ b/src/glx/indirect_vertex_program.c @@ -1,18 +1,18 @@ /* * (C) Copyright IBM Corporation 2005 * All Rights Reserved. - * + * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, 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. IN NO EVENT SHALL @@ -138,7 +138,7 @@ __indirect_glGetVertexAttribPointervNV(GLuint index, GLenum pname, /** * Get the selected attribute from the vertex array state vector. - * + * * \returns * On success \c GL_TRUE is returned. Otherwise, \c GL_FALSE is returned. */ diff --git a/src/glx/indirect_window_pos.c b/src/glx/indirect_window_pos.c index e97be35..0d2e640 100644 --- a/src/glx/indirect_window_pos.c +++ b/src/glx/indirect_window_pos.c @@ -2,18 +2,18 @@ * Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas. * (C) Copyright IBM Corporation 2004 * All Rights Reserved. - * + * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, 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. IN NO EVENT SHALL diff --git a/src/glx/pixel.c b/src/glx/pixel.c index d508d62..6692e03 100644 --- a/src/glx/pixel.c +++ b/src/glx/pixel.c @@ -157,7 +157,7 @@ FillBitmap(struct glx_context * gc, GLint width, GLint height, /* ** Extract array from user's data applying all pixel store modes. -** The internal packed array format used has LSB_FIRST = FALSE and +** The internal packed array format used has LSB_FIRST = FALSE and ** ALIGNMENT = 1. */ void diff --git a/src/glx/pixelstore.c b/src/glx/pixelstore.c index 1d776b8..33ca00e 100644 --- a/src/glx/pixelstore.c +++ b/src/glx/pixelstore.c @@ -37,7 +37,7 @@ /** * Send glPixelStore command to the server - * + * * \param gc Current GLX context * \param sop Either \c X_GLsop_PixelStoref or \c X_GLsop_PixelStorei * \param pname Selector of which pixel parameter is to be set. diff --git a/src/glx/renderpix.c b/src/glx/renderpix.c index 8234bbe..6ac7e7a 100644 --- a/src/glx/renderpix.c +++ b/src/glx/renderpix.c @@ -31,18 +31,18 @@ /* * (C) Copyright IBM Corporation 2005 * All Rights Reserved. - * + * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, 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. IN NO EVENT SHALL @@ -59,7 +59,7 @@ /** * Send a large image to the server. If necessary, a buffer is allocated * to hold the unpacked data that is copied from the clients memory. - * + * * \param gc Current GLX context * \param compsize Size, in bytes, of the image portion * \param dim Number of dimensions of the image diff --git a/src/mapi/glapi/SConscript b/src/mapi/glapi/SConscript index 4ef855f..3251b8f 100644 --- a/src/mapi/glapi/SConscript +++ b/src/mapi/glapi/SConscript @@ -7,7 +7,7 @@ Import('*') if env['platform'] != 'winddk': env = env.Clone() - + env.Append(CPPDEFINES = [ 'MAPI_GLAPI_CURRENT', ]) @@ -22,7 +22,7 @@ if env['platform'] != 'winddk': '#/src/mapi', '#/src/mesa', ]) - + glapi_sources = [ 'glapi_dispatch.c', 'glapi_entrypoint.c', @@ -30,7 +30,7 @@ if env['platform'] != 'winddk': 'glapi_nop.c', 'glthread.c', ] - + mapi_sources = [ 'u_current.c', 'u_execmem.c', @@ -46,7 +46,7 @@ if env['platform'] != 'winddk': if env['gcc'] and env['platform'] != 'windows': if env['machine'] == 'x86': env.Append(CPPDEFINES = [ - 'USE_X86_ASM', + 'USE_X86_ASM', 'USE_MMX_ASM', 'USE_3DNOW_ASM', 'USE_SSE_ASM', @@ -56,15 +56,15 @@ if env['platform'] != 'winddk': ] elif env['machine'] == 'x86_64': env.Append(CPPDEFINES = [ - 'USE_X86_64_ASM', + 'USE_X86_64_ASM', ]) glapi_sources += [ 'glapi_x86-64.S' ] elif env['machine'] == 'ppc': env.Append(CPPDEFINES = [ - 'USE_PPC_ASM', - 'USE_VMX_ASM', + 'USE_PPC_ASM', + 'USE_VMX_ASM', ]) glapi_sources += [ ] @@ -74,7 +74,7 @@ if env['platform'] != 'winddk': ] else: pass - + glapi = env.ConvenienceLibrary( target = 'glapi', source = glapi_sources, diff --git a/src/mapi/glapi/gen/gl_API.dtd b/src/mapi/glapi/gen/gl_API.dtd index 30c646c..22a8d7f 100644 --- a/src/mapi/glapi/gen/gl_API.dtd +++ b/src/mapi/glapi/gen/gl_API.dtd @@ -124,13 +124,13 @@ glx: reply) commands large - set to "true" of the render command can use RenderLarge protocol. doubles_in_order - older commands always put GLdouble data at the - start of the render packet. Newer commands (e.g., + start of the render packet. Newer commands (e.g., ProgramEnvParameter4dvARB) put the in the order that they appear in the parameter list. always_array - some single commands take reply data as an array or as return value data (e.g., glGetLightfv). Other single commands take reply data only as an array (e.g., glGetClipPlane). - handcode - some functions are just too complicated to generate + handcode - some functions are just too complicated to generate (e.g., glSeperableFilter2D) or operate only on client-side data (e.g., glVertexPointer) and must be handcoded. ignore - some functions have an entry in the dispatch table, but aren't diff --git a/src/mapi/glapi/glapi_entrypoint.c b/src/mapi/glapi/glapi_entrypoint.c index 993ccb9..5abc7d8 100644 --- a/src/mapi/glapi/glapi_entrypoint.c +++ b/src/mapi/glapi/glapi_entrypoint.c @@ -95,7 +95,7 @@ generate_entrypoint(unsigned int functionOffset) * at offset 32 is the first one where the offset in the * "jmp OFFSET*4(%eax)" can't be encoded in a single byte. */ - const GLubyte * const template_func = gl_dispatch_functions_start + const GLubyte * const template_func = gl_dispatch_functions_start + (DISPATCH_FUNCTION_SIZE * 32); GLubyte * const code = (GLubyte *) u_execmem_alloc(DISPATCH_FUNCTION_SIZE); diff --git a/src/mapi/glapi/glapi_getproc.c b/src/mapi/glapi/glapi_getproc.c index 0a6ff77..e3ce450 100644 --- a/src/mapi/glapi/glapi_getproc.c +++ b/src/mapi/glapi/glapi_getproc.c @@ -42,7 +42,7 @@ */ -#if !defined(DISPATCH_FUNCTION_SIZE) +#if !defined(DISPATCH_FUNCTION_SIZE) # define NEED_FUNCTION_POINTER #endif #include "glapi/glprocs.h" @@ -169,7 +169,7 @@ struct _glapi_function { /** * Pointer to the dispatch stub for the named function. - * + * * \todo * The semantic of this field should be changed slightly. Currently, it * is always expected to be non-\c NULL. However, it would be better to @@ -259,9 +259,9 @@ str_dup(const char *str) * calls \c _glapi_add_dispatch we'll put in the proper offset. If that * never happens, and the user calls this function, he'll segfault. That's * what you get when you try calling a GL function that doesn't really exist. - * + * * \param funcName Name of the function to create an entry-point for. - * + * * \sa _glapi_add_entrypoint */ @@ -324,7 +324,7 @@ set_entry_info( struct _glapi_function * entry, const char * signature, unsigned /** * Fill-in the dispatch stub for the named function. - * + * * This function is intended to be called by a hardware driver. When called, * a dispatch stub may be created created for the function. A pointer to this * dispatch function will be returned by glXGetProcAddress. @@ -362,7 +362,7 @@ set_entry_info( struct _glapi_function * entry, const char * signature, unsigned * \todo * Determine if code should be added to reject function names that start with * 'glX'. - * + * * \bug * Add code to compare \c parameter_signature with the parameter signature of * a static function. In order to do that, we need to find a way to \b get diff --git a/src/mapi/glapi/glapi_sparc.S b/src/mapi/glapi/glapi_sparc.S index b919c28..eb40216 100644 --- a/src/mapi/glapi/glapi_sparc.S +++ b/src/mapi/glapi/glapi_sparc.S @@ -4,18 +4,18 @@ * Copyright (C) 1999-2003 Brian Paul All Rights Reserved. * (C) Copyright IBM Corporation 2004 * All Rights Reserved. - * + * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, 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. IN NO EVENT SHALL diff --git a/src/mapi/glapi/glapi_x86-64.S b/src/mapi/glapi/glapi_x86-64.S index 486cf73..e62915f 100644 --- a/src/mapi/glapi/glapi_x86-64.S +++ b/src/mapi/glapi/glapi_x86-64.S @@ -3,18 +3,18 @@ /* * (C) Copyright IBM Corporation 2005 * All Rights Reserved. - * + * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, 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. IN NO EVENT SHALL diff --git a/src/mapi/glapi/glapi_x86.S b/src/mapi/glapi/glapi_x86.S index 605bebc..ab55e14 100644 --- a/src/mapi/glapi/glapi_x86.S +++ b/src/mapi/glapi/glapi_x86.S @@ -4,18 +4,18 @@ * Copyright (C) 1999-2001 Brian Paul All Rights Reserved. * (C) Copyright IBM Corporation 2004, 2005 * All Rights Reserved. - * + * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, 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. IN NO EVENT SHALL diff --git a/src/mapi/glapi/glapitable.h b/src/mapi/glapi/glapitable.h index ff662dc..77d74db 100644 --- a/src/mapi/glapi/glapitable.h +++ b/src/mapi/glapi/glapitable.h @@ -4,18 +4,18 @@ * Copyright (C) 1999-2003 Brian Paul All Rights Reserved. * (C) Copyright IBM Corporation 2004 * All Rights Reserved. - * + * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, 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. IN NO EVENT SHALL diff --git a/src/mapi/glapi/glapitemp.h b/src/mapi/glapi/glapitemp.h index 2ccb299..66b2936 100644 --- a/src/mapi/glapi/glapitemp.h +++ b/src/mapi/glapi/glapitemp.h @@ -4,18 +4,18 @@ * Copyright (C) 1999-2001 Brian Paul All Rights Reserved. * (C) Copyright IBM Corporation 2004 * All Rights Reserved. - * + * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, 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. IN NO EVENT SHALL diff --git a/src/mapi/glapi/glprocs.h b/src/mapi/glapi/glprocs.h index 315847e..4048bc4 100644 --- a/src/mapi/glapi/glprocs.h +++ b/src/mapi/glapi/glprocs.h @@ -4,18 +4,18 @@ * Copyright (C) 1999-2001 Brian Paul All Rights Reserved. * (C) Copyright IBM Corporation 2004, 2006 * All Rights Reserved. - * + * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, 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. IN NO EVENT SHALL diff --git a/src/mapi/mapi/entry.c b/src/mapi/mapi/entry.c index fdf2a89..30886b8 100644 --- a/src/mapi/mapi/entry.c +++ b/src/mapi/mapi/entry.c @@ -31,7 +31,7 @@ #if defined(USE_X86_ASM) && defined(__GNUC__) # ifdef GLX_USE_TLS # include "entry_x86_tls.h" -# else +# else # include "entry_x86_tsd.h" # endif #elif defined(USE_X86_64_ASM) && defined(__GNUC__) && defined(GLX_USE_TLS) diff --git a/src/mapi/mapi/stub.c b/src/mapi/mapi/stub.c index 3594eac..31eb68d 100644 --- a/src/mapi/mapi/stub.c +++ b/src/mapi/mapi/stub.c @@ -125,7 +125,7 @@ stub_find_dynamic(const char *name, int generate) u_mutex_declare_static(dynamic_mutex); struct mapi_stub *stub = NULL; int count, i; - + u_mutex_lock(dynamic_mutex); if (generate) diff --git a/src/mapi/mapi/table.c b/src/mapi/mapi/table.c index 8f4f700..6d8933f 100644 --- a/src/mapi/mapi/table.c +++ b/src/mapi/mapi/table.c @@ -36,7 +36,7 @@ static void noop_warn(const char *name) { static int debug = -1; - + if (debug < 0) debug = (getenv("MESA_DEBUG") || getenv("LIBGL_DEBUG")); diff --git a/src/mapi/mapi/u_current.c b/src/mapi/mapi/u_current.c index 77a593b..ed114f4 100644 --- a/src/mapi/mapi/u_current.c +++ b/src/mapi/mapi/u_current.c @@ -89,7 +89,7 @@ extern void (*__glapi_noop_table[])(void); * thread, perhaps running on a different processor, is clearing it. Because * of that, \c ThreadSafe, which can only ever be changed to \c GL_TRUE, is * used to determine whether or not the application is multithreaded. - * + * * In the TLS case, the variables \c _glapi_Dispatch and \c _glapi_Context are * hardcoded to \c NULL. Instead the TLS variables \c _glapi_tls_Dispatch and * \c _glapi_tls_Context are used. Having \c _glapi_Dispatch and diff --git a/src/mapi/mapi/u_thread.h b/src/mapi/mapi/u_thread.h index 92a0a39..a99fb1b 100644 --- a/src/mapi/mapi/u_thread.h +++ b/src/mapi/mapi/u_thread.h @@ -169,7 +169,7 @@ typedef benaphore u_mutex; #ifndef THREADS struct u_tsd { - int initMagic; + int initMagic; }; typedef unsigned u_mutex; diff --git a/src/mapi/vgapi/vgapi.csv b/src/mapi/vgapi/vgapi.csv index 5b11d06..717f1c8 100644 --- a/src/mapi/vgapi/vgapi.csv +++ b/src/mapi/vgapi/vgapi.csv @@ -33,7 +33,7 @@ VGfloat, GetParameterf, VGHandle object, VGint paramT void, GetParameterfv, VGHandle object, VGint paramType, VGint count, VGfloat *values VGint, GetParameteri, VGHandle object, VGint paramType void, GetParameteriv, VGHandle object, VGint paramType, VGint count, VGint *values -VGImage, GetParent, VGImage image +VGImage, GetParent, VGImage image VGbitfield, GetPathCapabilities, VGPath path void, GetPixels, VGImage dst, VGint dx, VGint dy, VGint sx, VGint sy, VGint width, VGint height const VGubyte *, GetString, VGStringID name diff --git a/src/mesa/Makefile.mgw b/src/mesa/Makefile.mgw index fc0ff28..9abb4ce 100644 --- a/src/mesa/Makefile.mgw +++ b/src/mesa/Makefile.mgw @@ -1,18 +1,18 @@ # Mesa 3-D graphics library # Version: 7.0 -# +# # Copyright (C) 1999-2003 Brian Paul All Rights Reserved. -# +# # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and associated documentation files (the "Software"), # to deal in the Software without restriction, including without limitation # the rights to use, copy, modify, merge, publish, distribute, sublicense, # and/or sell copies of the Software, and to permit persons to whom the # Software is furnished to do so, subject to the following conditions: -# +# # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. -# +# # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL @@ -30,10 +30,10 @@ # # updated : by Heromyth, on 2007-7-21 # Email : zxpmyth@yahoo.com.cn -# Bugs : 1) All the default settings work fine. But the setting X86=1 can't work. +# Bugs : 1) All the default settings work fine. But the setting X86=1 can't work. # The others havn't been tested yet. # 2) The generated DLLs are *not* compatible with the ones built -# with the other compilers like VC8, especially for GLUT. +# with the other compilers like VC8, especially for GLUT. # 3) Although more tests are needed, it can be used individually! @@ -109,7 +109,7 @@ else ifeq ($(ICD),1) CFLAGS += -DUSE_MGL_NAMESPACE GL_DEF = drivers/windows/icd/mesa.def - else + else GL_DEF = $(LIB_NAME).def endif endif @@ -126,7 +126,7 @@ endif include sources.mak -CFLAGS += $(INCLUDE_DIRS) +CFLAGS += $(INCLUDE_DIRS) ifeq ($(X86),1) CFLAGS += -DUSE_X86_ASM diff --git a/src/mesa/drivers/beos/GLView.cpp b/src/mesa/drivers/beos/GLView.cpp index ee3415b..1e5cbbe 100644 --- a/src/mesa/drivers/beos/GLView.cpp +++ b/src/mesa/drivers/beos/GLView.cpp @@ -1,19 +1,19 @@ /* * Mesa 3-D graphics library * Version: 6.1 - * + * * Copyright (C) 1999-2004 Brian Paul All Rights Reserved. - * + * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: - * + * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. - * + * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL @@ -88,7 +88,7 @@ extern "C" { (color[BCOMP] << 24) | 0xFF000000) #endif -#define FLIP(coord) (LIBGGI_MODE(ggi_ctx->ggi_visual)->visible.y-(coord) - 1) +#define FLIP(coord) (LIBGGI_MODE(ggi_ctx->ggi_visual)->visible.y-(coord) - 1) const char * color_space_name(color_space space); @@ -104,7 +104,7 @@ friend class BGLView; public: MesaDriver(); ~MesaDriver(); - + void Init(BGLView * bglview, struct gl_context * c, struct gl_config * v, struct gl_framebuffer * b); void LockGL(); @@ -132,7 +132,7 @@ friend class BGLView; GLint m_bottom; // used for flipping Y coords GLuint m_width; GLuint m_height; - + // Mesa Device Driver callback functions static void UpdateState(struct gl_context *ctx, GLuint new_state); static void ClearIndex(struct gl_context *ctx, GLuint index); @@ -288,7 +288,7 @@ BGLView::BGLView(BRect rect, char *name, m_options = options | BGL_INDIRECT; struct dd_function_table functions; - + if (!rgbFlag) { fprintf(stderr, "Mesa Warning: color index mode not supported\n"); } @@ -531,33 +531,33 @@ status_t BGLView::GetSupportedSuites(BMessage *data) void BGLView::DirectConnected( direct_buffer_info *info ) { #if 0 - if (! m_direct_connected && m_direct_connection_disabled) - return; + if (! m_direct_connected && m_direct_connection_disabled) + return; - direct_info_locker->Lock(); - switch(info->buffer_state & B_DIRECT_MODE_MASK) { - case B_DIRECT_START: + direct_info_locker->Lock(); + switch(info->buffer_state & B_DIRECT_MODE_MASK) { + case B_DIRECT_START: m_direct_connected = true; - case B_DIRECT_MODIFY: - // Get clipping information + case B_DIRECT_MODIFY: + // Get clipping information if (m_clip_list) - free(m_clip_list); - m_clip_list_count = info->clip_list_count; - m_clip_list = (clipping_rect *) malloc(m_clip_list_count*sizeof(clipping_rect)); - if (m_clip_list) { + free(m_clip_list); + m_clip_list_count = info->clip_list_count; + m_clip_list = (clipping_rect *) malloc(m_clip_list_count*sizeof(clipping_rect)); + if (m_clip_list) { memcpy(m_clip_list, info->clip_list, m_clip_list_count*sizeof(clipping_rect)); - fBits = (uint8 *) info->bits; - fRowBytes = info->bytes_per_row; - fFormat = info->pixel_format; - fBounds = info->window_bounds; - fDirty = true; - } - break; - case B_DIRECT_STOP: - fConnected = false; - break; - } - direct_info_locker->Unlock(); + fBits = (uint8 *) info->bits; + fRowBytes = info->bytes_per_row; + fFormat = info->pixel_format; + fBounds = info->window_bounds; + fDirty = true; + } + break; + case B_DIRECT_STOP: + fConnected = false; + break; + } + direct_info_locker->Unlock(); #endif } @@ -663,7 +663,7 @@ MesaDriver::~MesaDriver() _mesa_destroy_visual(m_glvisual); _mesa_destroy_framebuffer(m_glframebuffer); _mesa_destroy_context(m_glcontext); - + delete m_bitmap; } @@ -685,7 +685,7 @@ void MesaDriver::Init(BGLView * bglview, struct gl_context * ctx, struct gl_conf // Use default TCL pipeline tnl->Driver.RunPipeline = _tnl_run_pipeline; - + swdd->SetBuffer = this->SetBuffer; } @@ -746,15 +746,15 @@ status_t MesaDriver::CopyPixelsOut(BPoint location, BBitmap *bitmap) color_space_name(dcs)); return B_BAD_TYPE; } - + // debugger("CopyPixelsOut()"); - + BRect sr = m_bitmap->Bounds(); BRect dr = bitmap->Bounds(); sr = sr & dr.OffsetBySelf(location); - dr = sr.OffsetByCopy(-location.x, -location.y); - + dr = sr.OffsetByCopy(-location.x, -location.y); + uint8 *ps = (uint8 *) m_bitmap->Bits(); uint8 *pd = (uint8 *) bitmap->Bits(); uint32 *s, *d; @@ -762,10 +762,10 @@ status_t MesaDriver::CopyPixelsOut(BPoint location, BBitmap *bitmap) for (y = (uint32) sr.top; y <= (uint32) sr.bottom; y++) { s = (uint32 *) (ps + y * m_bitmap->BytesPerRow()); s += (uint32) sr.left; - + d = (uint32 *) (pd + (y + (uint32) (dr.top - sr.top)) * bitmap->BytesPerRow()); d += (uint32) dr.left; - + memcpy(d, s, dr.IntegerWidth() * 4); } return B_OK; @@ -782,15 +782,15 @@ status_t MesaDriver::CopyPixelsIn(BBitmap *bitmap, BPoint location) color_space_name(dcs)); return B_BAD_TYPE; } - + // debugger("CopyPixelsIn()"); BRect sr = bitmap->Bounds(); BRect dr = m_bitmap->Bounds(); sr = sr & dr.OffsetBySelf(location); - dr = sr.OffsetByCopy(-location.x, -location.y); - + dr = sr.OffsetByCopy(-location.x, -location.y); + uint8 *ps = (uint8 *) bitmap->Bits(); uint8 *pd = (uint8 *) m_bitmap->Bits(); uint32 *s, *d; @@ -798,10 +798,10 @@ status_t MesaDriver::CopyPixelsIn(BBitmap *bitmap, BPoint location) for (y = (uint32) sr.top; y <= (uint32) sr.bottom; y++) { s = (uint32 *) (ps + y * bitmap->BytesPerRow()); s += (uint32) sr.left; - + d = (uint32 *) (pd + (y + (uint32) (dr.top - sr.top)) * m_bitmap->BytesPerRow()); d += (uint32) dr.left; - + memcpy(d, s, dr.IntegerWidth() * 4); } return B_OK; @@ -881,7 +881,7 @@ void MesaDriver::ClearColor(struct gl_context *ctx, const GLfloat color[4]) CLAMPED_FLOAT_TO_CHAN(md->m_clear_color[BE_RCOMP], color[0]); CLAMPED_FLOAT_TO_CHAN(md->m_clear_color[BE_GCOMP], color[1]); CLAMPED_FLOAT_TO_CHAN(md->m_clear_color[BE_BCOMP], color[2]); - CLAMPED_FLOAT_TO_CHAN(md->m_clear_color[BE_ACOMP], color[3]); + CLAMPED_FLOAT_TO_CHAN(md->m_clear_color[BE_ACOMP], color[3]); assert(md->m_bglview); } @@ -1270,7 +1270,7 @@ void MesaDriver::WriteRGBASpanBack(const struct gl_context *ctx, GLuint n, int row = md->m_bottom - y; uint8 * ptr = (uint8 *) bitmap->Bits() + (row * bitmap->BytesPerRow()) + x * 4; uint32 * pixel = (uint32 *) ptr; - + if (mask) { while(n--) { if (*mask++) @@ -1300,7 +1300,7 @@ void MesaDriver::WriteRGBSpanBack(const struct gl_context *ctx, GLuint n, int row = md->m_bottom - y; uint8 * ptr = (uint8 *) bitmap->Bits() + (row * bitmap->BytesPerRow()) + x * 4; uint32 * pixel = (uint32 *) ptr; - + if (mask) { while(n--) { if (*mask++) @@ -1332,7 +1332,7 @@ void MesaDriver::WriteMonoRGBASpanBack(const struct gl_context *ctx, GLuint n, uint8 * ptr = (uint8 *) bitmap->Bits() + (row * bitmap->BytesPerRow()) + x * 4; uint32 * pixel = (uint32 *) ptr; uint32 pixel_color = PACK_B_RGBA32(color); - + if (mask) { while(n--) { if (*mask++) @@ -1405,7 +1405,7 @@ void MesaDriver::WriteMonoRGBAPixelsBack(const struct gl_context *ctx, GLuint n, assert(bitmap); uint32 pixel_color = PACK_B_RGBA32(color); -#if 0 +#if 0 while(n--) { if (*mask++) { int row = md->m_bottom - *y; diff --git a/src/mesa/drivers/beos/Makefile b/src/mesa/drivers/beos/Makefile index c79dd24..70fbd18 100644 --- a/src/mesa/drivers/beos/Makefile +++ b/src/mesa/drivers/beos/Makefile @@ -147,7 +147,7 @@ ifeq ($(CPU), x86) DRIVER_SOURCES += $(addprefix ../../, $(X86_API)) else # No GL API PPC optimization yet -endif +endif DRIVER_OBJECTS = $(DRIVER_SOURCES:.c=.o) DRIVER_OBJECTS := $(DRIVER_OBJECTS:.S=.o) @@ -191,7 +191,7 @@ $(TOP)/$(LIB_DIR)/$(GL_LIB_NAME): $(OBJECTS) $(MESA_MODULES) $(GLU_MODULES) depend: $(DRIVER_SOURCES) $(GLU_SOURCES) touch depend - $(MKDEP) $(MKDEP_OPTIONS) $(INCLUDES) $(DRIVER_SOURCES) $(GLU_SOURCES) > /dev/null + $(MKDEP) $(MKDEP_OPTIONS) $(INCLUDES) $(DRIVER_SOURCES) $(GLU_SOURCES) > /dev/null clean: -rm -f depend depend.bak $(OBJECTS) diff --git a/src/mesa/drivers/common/driverfuncs.c b/src/mesa/drivers/common/driverfuncs.c index fc67bee..4075d44 100644 --- a/src/mesa/drivers/common/driverfuncs.c +++ b/src/mesa/drivers/common/driverfuncs.c @@ -112,7 +112,7 @@ _mesa_init_driver_functions(struct dd_function_table *driver) driver->NewTextureObject = _mesa_new_texture_object; driver->DeleteTexture = _mesa_delete_texture_object; driver->NewTextureImage = _mesa_new_texture_image; - driver->FreeTexImageData = _mesa_free_texture_image_data; + driver->FreeTexImageData = _mesa_free_texture_image_data; driver->MapTexture = NULL; driver->UnmapTexture = NULL; driver->TextureMemCpy = memcpy; diff --git a/src/mesa/drivers/common/meta.c b/src/mesa/drivers/common/meta.c index cdb2500..39c6e1d 100644 --- a/src/mesa/drivers/common/meta.c +++ b/src/mesa/drivers/common/meta.c @@ -676,7 +676,7 @@ _mesa_meta_end(struct gl_context *ctx) if (ctx->Extensions.ARB_vertex_program) { _mesa_set_enable(ctx, GL_VERTEX_PROGRAM_ARB, save->VertexProgramEnabled); - _mesa_reference_vertprog(ctx, &ctx->VertexProgram.Current, + _mesa_reference_vertprog(ctx, &ctx->VertexProgram.Current, save->VertexProgram); _mesa_reference_vertprog(ctx, &save->VertexProgram, NULL); } @@ -1935,7 +1935,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); @@ -2417,7 +2417,7 @@ _mesa_meta_GenerateMipmap(struct gl_context *ctx, GLenum target, verts[2].y = 1.0F; verts[3].x = 0.0F; verts[3].y = 1.0F; - + /* upload new vertex data */ _mesa_BufferSubDataARB(GL_ARRAY_BUFFER_ARB, 0, sizeof(verts), verts); } diff --git a/src/mesa/drivers/dri/Makefile.template b/src/mesa/drivers/dri/Makefile.template index 4ecddbc..b0b5e8a 100644 --- a/src/mesa/drivers/dri/Makefile.template +++ b/src/mesa/drivers/dri/Makefile.template @@ -18,7 +18,7 @@ INCLUDES = $(SHARED_INCLUDES) $(EXPAT_INCLUDES) OBJECTS = $(C_SOURCES:.c=.o) \ $(CXX_SOURCES:.cpp=.o) \ - $(ASM_SOURCES:.S=.o) + $(ASM_SOURCES:.S=.o) ### Include directories @@ -67,7 +67,7 @@ $(LIBNAME): $(OBJECTS) $(MESA_MODULES) $(EXTRA_MODULES) Makefile \ $(TOP)/$(LIB_DIR)/$(LIBNAME): $(LIBNAME) - $(INSTALL) $(LIBNAME) $(TOP)/$(LIB_DIR) + $(INSTALL) $(LIBNAME) $(TOP)/$(LIB_DIR) # If the Makefile defined SUBDIRS, run make in each diff --git a/src/mesa/drivers/dri/common/dri_metaops.h b/src/mesa/drivers/dri/common/dri_metaops.h index aa7d4ba..d847153 100644 --- a/src/mesa/drivers/dri/common/dri_metaops.h +++ b/src/mesa/drivers/dri/common/dri_metaops.h @@ -36,14 +36,14 @@ struct dri_metaops { struct gl_fragment_program *bitmap_fp; struct gl_vertex_program *passthrough_vp; struct gl_buffer_object *texcoord_vbo; - + struct gl_fragment_program *saved_fp; GLboolean saved_fp_enable; struct gl_vertex_program *saved_vp; GLboolean saved_vp_enable; struct gl_fragment_program *tex2d_fp; - + GLboolean saved_texcoord_enable; struct gl_buffer_object *saved_array_vbo, *saved_texcoord_vbo; GLenum saved_texcoord_type; diff --git a/src/mesa/drivers/dri/common/dri_util.c b/src/mesa/drivers/dri/common/dri_util.c index bf8cf6e..bce97fb 100644 --- a/src/mesa/drivers/dri/common/dri_util.c +++ b/src/mesa/drivers/dri/common/dri_util.c @@ -6,7 +6,7 @@ * driver doesn't really \e have to use any of this - it's optional. But, some * useful stuff is done here that otherwise would have to be duplicated in most * drivers. - * + * * Basically, these utility functions take care of some of the dirty details of * screen initialization, context creation, context binding, DRM setup, etc. * @@ -78,19 +78,19 @@ driIntersectArea( drm_clip_rect_t rect1, drm_clip_rect_t rect2 ) /** * Unbind context. - * + * * \param scrn the screen. * \param gc context. * * \return \c GL_TRUE on success, or \c GL_FALSE on failure. - * + * * \internal * This function calls __DriverAPIRec::UnbindContext, and then decrements * __DRIdrawableRec::refcount which must be non-zero for a successful * return. - * + * * While casting the opaque private pointers associated with the parameters - * into their respective real types it also assures they are not \c NULL. + * into their respective real types it also assures they are not \c NULL. */ static int driUnbindContext(__DRIcontext *pcp) { @@ -208,7 +208,7 @@ static int driBindContext(__DRIcontext *pcp, * Update private drawable information. * * \param pdp pointer to the private drawable information to update. - * + * * This function basically updates the __DRIdrawable struct's * cliprect information by calling \c __DRIinterfaceMethods::getDrawableInfo. * This is usually called by the DRI_VALIDATE_DRAWABLE_INFO macro which @@ -221,22 +221,22 @@ __driUtilUpdateDrawableInfo(__DRIdrawable *pdp) { __DRIscreen *psp = pdp->driScreenPriv; __DRIcontext *pcp = pdp->driContextPriv; - - if (!pcp + + if (!pcp || ((pdp != pcp->driDrawablePriv) && (pdp != pcp->driReadablePriv))) { - /* ERROR!!! + /* ERROR!!! * ...but we must ignore it. There can be many contexts bound to a * drawable. */ } if (pdp->pClipRects) { - free(pdp->pClipRects); + free(pdp->pClipRects); pdp->pClipRects = NULL; } if (pdp->pBackClipRects) { - free(pdp->pBackClipRects); + free(pdp->pBackClipRects); pdp->pBackClipRects = NULL; } @@ -296,10 +296,10 @@ static void driReportDamage(__DRIdrawable *pdp, * Swap buffers. * * \param drawablePrivate opaque pointer to the per-drawable private info. - * + * * \internal * This function calls __DRIdrawable::swapBuffers. - * + * * Is called directly from glXSwapBuffers(). */ static void driSwapBuffers(__DRIdrawable *dPriv) @@ -453,7 +453,7 @@ driCreateNewDrawable(__DRIscreen *psp, const __DRIconfig *config, /* This special default value is replaced with the configured * default value when the drawable is first bound to a direct - * rendering context. + * rendering context. */ pdp->swap_interval = (unsigned)-1; @@ -520,7 +520,7 @@ static void dri_get_drawable(__DRIdrawable *pdp) { pdp->refcount++; } - + static void dri_put_drawable(__DRIdrawable *pdp) { __DRIscreen *psp; @@ -560,7 +560,7 @@ driDestroyDrawable(__DRIdrawable *pdp) /** * Destroy the per-context private information. - * + * * \internal * This function calls __DriverAPIRec::DestroyContext on \p contextPrivate, calls * drmDestroyContext(), and finally frees \p contextPrivate. @@ -577,14 +577,14 @@ driDestroyContext(__DRIcontext *pcp) /** * Create the per-drawable private driver information. - * + * * \param render_type Type of rendering target. \c GLX_RGBA is the only * type likely to ever be supported for direct-rendering. * \param shared Context with which to share textures, etc. or NULL * * \returns An opaque pointer to the per-context private information on * success, or \c NULL on failure. - * + * * \internal * This function allocates and fills a __DRIcontextRec structure. It * performs some device independent initialization and passes all the @@ -594,7 +594,7 @@ driDestroyContext(__DRIcontext *pcp) */ static __DRIcontext * driCreateNewContext(__DRIscreen *psp, const __DRIconfig *config, - int render_type, __DRIcontext *shared, + int render_type, __DRIcontext *shared, drm_context_t hwContext, void *data) { __DRIcontext *pcp; @@ -607,7 +607,7 @@ driCreateNewContext(__DRIscreen *psp, const __DRIconfig *config, pcp->driScreenPriv = psp; pcp->driDrawablePriv = NULL; pcp->loaderPrivate = data; - + pcp->dri2.draw_stamp = 0; pcp->dri2.read_stamp = 0; @@ -662,7 +662,7 @@ dri2CreateNewContextForAPI(__DRIscreen *screen, int api, context->driScreenPriv = screen; context->driDrawablePriv = NULL; context->loaderPrivate = data; - + if (!(*screen->DriverAPI.CreateContext)(mesa_api, modes, context, shareCtx) ) { free(context); @@ -697,7 +697,7 @@ driCopyContext(__DRIcontext *dest, __DRIcontext *src, unsigned long mask) /** * Destroy the per-screen private information. - * + * * \internal * This function calls __DriverAPIRec::DestroyScreen on \p screenPrivate, calls * drmClose(), and finally frees \p screenPrivate. @@ -758,7 +758,7 @@ setupLoaderExtensions(__DRIscreen *psp, * pbuffers. * * For legacy DRI. - * + * * \param scrn Index of the screen * \param ddx_version Version of the 2D DDX. This may not be meaningful for * all drivers. @@ -771,7 +771,7 @@ setupLoaderExtensions(__DRIscreen *psp, * \param extensions ?? * \param driver_modes Returns modes suppoted by the driver * \param loaderPrivate ?? - * + * * \note There is no need to check the minimum API version in this * function. Since the name of this function is versioned, it is * impossible for a loader that is too old to even load this driver. @@ -782,7 +782,7 @@ driCreateNewScreen(int scrn, const __DRIversion *dri_version, const __DRIversion *drm_version, const __DRIframebuffer *frame_buffer, - drmAddress pSAREA, int fd, + drmAddress pSAREA, int fd, const __DRIextension **extensions, const __DRIconfig ***driver_modes, void *loaderPrivate) @@ -942,17 +942,17 @@ const __DRI2configQueryExtension dri2ConfigQueryExtension = { /** * Calculate amount of swap interval used between GLX buffer swaps. - * + * * The usage value, on the range [0,max], is the fraction of total swap * interval time used between GLX buffer swaps is calculated. * * \f$p = t_d / (i * t_r)\f$ - * + * * Where \f$t_d\f$ is the time since the last GLX buffer swap, \f$i\f$ is the * swap interval (as set by \c glXSwapIntervalSGI), and \f$t_r\f$ time * required for a single vertical refresh period (as returned by \c * glXGetMscRateOML). - * + * * See the documentation for the GLX_MESA_swap_frame_usage extension for more * details. * @@ -964,7 +964,7 @@ const __DRI2configQueryExtension dri2ConfigQueryExtension = { * a number greater than 1.0 will be returned. * * \sa glXSwapIntervalSGI glXGetMscRateOML - * + * * \todo Instead of caching the \c glXGetMscRateOML function pointer, would it * be possible to cache the sync rate? */ @@ -999,7 +999,7 @@ driCalculateSwapUsage( __DRIdrawable *dPriv, int64_t last_swap_ust, usage /= (interval * d); usage /= 1000000.0; } - + return usage; } diff --git a/src/mesa/drivers/dri/common/dri_util.h b/src/mesa/drivers/dri/common/dri_util.h index ffffb99..cc3a80e 100644 --- a/src/mesa/drivers/dri/common/dri_util.h +++ b/src/mesa/drivers/dri/common/dri_util.h @@ -1,7 +1,7 @@ /* * Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas. * 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 @@ -9,11 +9,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. @@ -31,7 +31,7 @@ * driver doesn't really \e have to use any of this - it's optional. But, some * useful stuff is done here that otherwise would have to be duplicated in most * drivers. - * + * * Basically, these utility functions take care of some of the dirty details of * screen initialization, context creation, context binding, DRM setup, etc. * @@ -39,7 +39,7 @@ * about them. * * \sa dri_util.c. - * + * * \author Kevin E. Martin * \author Brian Paul */ @@ -131,7 +131,7 @@ do { \ * * Each DRI driver must have one of these structures with all the pointers set * to appropriate functions within the driver. - * + * * When glXCreateContext() is called, for example, it'll call a helper function * dri_util.c which in turn will jump through the \a CreateContext pointer in * this structure. @@ -146,7 +146,7 @@ struct __DriverAPIRec { /** * Context creation callback - */ + */ GLboolean (*CreateContext)(gl_api api, const struct gl_config *glVis, __DRIcontext *driContextPriv, @@ -164,14 +164,14 @@ struct __DriverAPIRec { __DRIdrawable *driDrawPriv, const struct gl_config *glVis, GLboolean pixmapBuffer); - + /** * Buffer (drawable) destruction callback */ void (*DestroyBuffer)(__DRIdrawable *driDrawPriv); /** - * Buffer swapping callback + * Buffer swapping callback */ void (*SwapBuffers)(__DRIdrawable *driDrawPriv); @@ -186,7 +186,7 @@ struct __DriverAPIRec { * Context unbinding callback */ GLboolean (*UnbindContext)(__DRIcontext *driContextPriv); - + /** * Retrieves statistics about buffer swap operations. Required if * GLX_OML_sync_control or GLX_MESA_swap_frame_usage is supported. @@ -198,7 +198,7 @@ struct __DriverAPIRec { * These are required if GLX_OML_sync_control is supported. */ /*@{*/ - int (*WaitForMSC)( __DRIdrawable *priv, int64_t target_msc, + int (*WaitForMSC)( __DRIdrawable *priv, int64_t target_msc, int64_t divisor, int64_t remainder, int64_t * msc ); int (*WaitForSBC)( __DRIdrawable *priv, int64_t target_sbc, @@ -229,8 +229,8 @@ extern const struct __DriverAPIRec driDriverAPI; struct __DRIswapInfoRec { - /** - * Number of swapBuffers operations that have been *completed*. + /** + * Number of swapBuffers operations that have been *completed*. */ uint64_t swap_count; @@ -250,7 +250,7 @@ struct __DRIswapInfoRec { /** * Amount of time used by the last swap that missed its deadline. This - * is calculated as (__glXGetUST() - swap_ust) / (swap_interval * + * is calculated as (__glXGetUST() - swap_ust) / (swap_interval * * time_for_single_vrefresh)). If the actual value of swap_interval is * 0, then 1 is used instead. If swap_missed_count is non-zero, this * should be greater-than 1.0. @@ -269,7 +269,7 @@ struct __DRIdrawableRec { drm_drawable_t hHWDrawable; /** - * Driver's private drawable information. + * Driver's private drawable information. * * This structure is opaque. */ @@ -283,7 +283,7 @@ struct __DRIdrawableRec { /** * Reference count for number of context's currently bound to this - * drawable. + * drawable. * * Once it reaches zero, the drawable can be destroyed. * @@ -312,7 +312,7 @@ struct __DRIdrawableRec { unsigned int lastStamp; /** - * \name Drawable + * \name Drawable * * Drawable information used in software fallbacks. */ @@ -466,7 +466,7 @@ struct __DRIscreenRec { /** * File descriptor returned when the kernel device driver is opened. - * + * * Used to: * - authenticate client to kernel * - map the frame buffer, SAREA, etc. @@ -475,7 +475,7 @@ struct __DRIscreenRec { int fd; /** - * SAREA pointer + * SAREA pointer * * Used to access: * - the device lock @@ -484,7 +484,7 @@ struct __DRIscreenRec { drm_sarea_t *pSAREA; /** - * \name Direct frame buffer access information + * \name Direct frame buffer access information * Used for software fallbacks. */ /*@{*/ @@ -509,7 +509,7 @@ struct __DRIscreenRec { /** * Device-dependent private information (not stored in the SAREA). - * + * * This pointer is never touched by the DRI layer. */ #ifdef __cplusplus diff --git a/src/mesa/drivers/dri/common/drirenderbuffer.h b/src/mesa/drivers/dri/common/drirenderbuffer.h index 0cae730..c51d2ad 100644 --- a/src/mesa/drivers/dri/common/drirenderbuffer.h +++ b/src/mesa/drivers/dri/common/drirenderbuffer.h @@ -55,7 +55,7 @@ typedef struct { /** * A handy flag to know if this is the back color buffer. - * + * * \note * This is currently only used by tdfx. */ diff --git a/src/mesa/drivers/dri/common/spantmp.h b/src/mesa/drivers/dri/common/spantmp.h index f0af5b1..df31250 100644 --- a/src/mesa/drivers/dri/common/spantmp.h +++ b/src/mesa/drivers/dri/common/spantmp.h @@ -170,9 +170,9 @@ static void TAG(WriteRGBAPixels)( struct gl_context *ctx, } -static void TAG(WriteMonoRGBASpan)( struct gl_context *ctx, +static void TAG(WriteMonoRGBASpan)( struct gl_context *ctx, struct gl_renderbuffer *rb, - GLuint n, GLint x, GLint y, + GLuint n, GLint x, GLint y, const void *value, const GLubyte mask[] ) { @@ -215,7 +215,7 @@ static void TAG(WriteMonoRGBAPixels)( struct gl_context *ctx, GLuint n, const GLint x[], const GLint y[], const void *value, - const GLubyte mask[] ) + const GLubyte mask[] ) { HW_WRITE_LOCK() { diff --git a/src/mesa/drivers/dri/common/spantmp2.h b/src/mesa/drivers/dri/common/spantmp2.h index f436d13..c903be1 100644 --- a/src/mesa/drivers/dri/common/spantmp2.h +++ b/src/mesa/drivers/dri/common/spantmp2.h @@ -271,7 +271,7 @@ #endif /* GET_VALUE */ # define INIT_MONO_PIXEL(p, color) \ - p = PACK_COLOR_8888(color[3], color[0], color[1], color[2]) + p = PACK_COLOR_8888(color[3], color[0], color[1], color[2]) # define WRITE_RGBA(_x, _y, r, g, b, a) \ PUT_VALUE(_x, _y, ((r << 16) | \ @@ -326,7 +326,7 @@ #endif /* GET_VALUE */ # define INIT_MONO_PIXEL(p, color) \ - p = PACK_COLOR_8888(color[2], color[1], color[0], color[3]) + p = PACK_COLOR_8888(color[2], color[1], color[0], color[3]) # define WRITE_RGBA(_x, _y, r, g, b, a) \ PUT_VALUE(_x, _y, ((r << 8) | \ @@ -709,9 +709,9 @@ static void TAG(WriteRGBAPixels)( struct gl_context *ctx, } -static void TAG(WriteMonoRGBASpan)( struct gl_context *ctx, +static void TAG(WriteMonoRGBASpan)( struct gl_context *ctx, struct gl_renderbuffer *rb, - GLuint n, GLint x, GLint y, + GLuint n, GLint x, GLint y, const void *value, const GLubyte mask[] ) { HW_WRITE_LOCK() @@ -753,7 +753,7 @@ static void TAG(WriteMonoRGBAPixels)( struct gl_context *ctx, GLuint n, const GLint x[], const GLint y[], const void *value, - const GLubyte mask[] ) + const GLubyte mask[] ) { HW_WRITE_LOCK() { diff --git a/src/mesa/drivers/dri/common/stenciltmp.h b/src/mesa/drivers/dri/common/stenciltmp.h index fef0972..55a3f65 100644 --- a/src/mesa/drivers/dri/common/stenciltmp.h +++ b/src/mesa/drivers/dri/common/stenciltmp.h @@ -35,7 +35,7 @@ static void TAG(WriteStencilSpan)( struct gl_context *ctx, WRITE_STENCIL_SPAN(); #else /* HAVE_HW_STENCIL_SPANS */ - HW_CLIPLOOP() + HW_CLIPLOOP() { GLint i = 0; CLIPSPAN(x,y,n,x1,n1,i); @@ -91,7 +91,7 @@ static void TAG(WriteMonoStencilSpan)( struct gl_context *ctx, y = Y_FLIP(y); - HW_CLIPLOOP() + HW_CLIPLOOP() { GLint i = 0; CLIPSPAN(x,y,n,x1,n1,i); @@ -177,7 +177,7 @@ static void TAG(ReadStencilSpan)( struct gl_context *ctx, READ_STENCIL_SPAN(); #else /* HAVE_HW_STENCIL_SPANS */ - HW_CLIPLOOP() + HW_CLIPLOOP() { GLint i = 0; CLIPSPAN(x,y,n,x1,n1,i); @@ -202,7 +202,7 @@ static void TAG(ReadStencilPixels)( struct gl_context *ctx, LOCAL_STENCIL_VARS; if (DBG) fprintf(stderr, "ReadStencilPixels\n"); - + #if HAVE_HW_STENCIL_PIXELS (void) i; diff --git a/src/mesa/drivers/dri/common/texmem.c b/src/mesa/drivers/dri/common/texmem.c index 8eec07d..5dd0d2a 100644 --- a/src/mesa/drivers/dri/common/texmem.c +++ b/src/mesa/drivers/dri/common/texmem.c @@ -31,7 +31,7 @@ /** \file texmem.c * Implements all of the device-independent texture memory management. - * + * * Currently, only a simple LRU texture memory management policy is * implemented. In the (hopefully very near) future, better policies will be * implemented. The idea is that the DRI should be able to run in one of two @@ -56,7 +56,7 @@ static unsigned dummy_swap_counter; * implementation of this function. However, since system performance is in * no way dependent on this function, the slowness of the implementation is * irrelevent. - * + * * \param n Value whose \f$\log_2\f$ is to be calculated */ @@ -80,16 +80,16 @@ driLog2( GLuint n ) * the driver, this may or may not be on-card memory. It could be AGP memory * or anyother type of memory from which the hardware can directly read * texels. - * + * * This function is intended to be used as the \c IsTextureResident function * in the device's \c dd_function_table. - * + * * \param ctx GL context pointer (currently unused) * \param texObj Texture object to be tested */ GLboolean -driIsTextureResident( struct gl_context * ctx, +driIsTextureResident( struct gl_context * ctx, struct gl_texture_object * texObj ) { driTextureObject * t; @@ -108,7 +108,7 @@ driIsTextureResident( struct gl_context * ctx, * at the end of the array allows the other elements of the array * to be addressed rationally when looking up objects at a particular * location in texture memory. - * + * * \param heap Texture heap to be reset */ @@ -144,7 +144,7 @@ static void printLocalLRU( driTexHeap * heap, const char *callername ) driTextureObject *t; unsigned sz = 1U << heap->logGranularity; - fprintf( stderr, "%s in %s:\nLocal LRU, heap %d:\n", + fprintf( stderr, "%s in %s:\nLocal LRU, heap %d:\n", __FUNCTION__, callername, heap->heapId ); foreach ( t, &heap->texture_objects ) { @@ -185,7 +185,7 @@ static void printGlobalLRU( driTexHeap * heap, const char *callername ) drmTextureRegionPtr list = heap->global_regions; unsigned int i, j; - fprintf( stderr, "%s in %s:\nGlobal LRU, heap %d list %p:\n", + fprintf( stderr, "%s in %s:\nGlobal LRU, heap %d list %p:\n", __FUNCTION__, callername, heap->heapId, (void *)list ); for ( i = 0, j = heap->nrRegions ; i < heap->nrRegions ; i++ ) { @@ -209,7 +209,7 @@ static void printGlobalLRU( driTexHeap * heap, const char *callername ) /** * Called by the client whenever it touches a local texture. - * + * * \param t Texture object that the client has accessed */ @@ -234,7 +234,7 @@ void driUpdateTextureLRU( driTextureObject * t ) list = heap->global_regions; - /* Update the context's local LRU + /* Update the context's local LRU */ move_to_head( & heap->texture_objects, t ); @@ -268,7 +268,7 @@ void driUpdateTextureLRU( driTextureObject * t ) /** * Keep track of swapped out texture objects. - * + * * \param t Texture object to be "swapped" out of its texture heap */ @@ -306,7 +306,7 @@ void driSwapOutTextureObject( driTextureObject * t ) * Destroy hardware state associated with texture \a t. Calls the * \a destroy_texture_object method associated with the heap from which * \a t was allocated. - * + * * \param t Texture object to be destroyed */ @@ -364,14 +364,14 @@ void driDestroyTextureObject( driTextureObject * t ) * textures and the textures belonging to other clients. Keep track of other * client's textures by pushing a placeholder texture onto the LRU list -- * these are denoted by \a tObj being \a NULL. - * + * * \param heap Heap whose state is to be updated * \param offset Byte offset in the heap that has been stolen * \param size Size, in bytes, of the stolen block * \param in_use Non-zero if the block is pinned/reserved by the kernel */ -static void driTexturesGone( driTexHeap * heap, int offset, int size, +static void driTexturesGone( driTexHeap * heap, int offset, int size, int in_use ) { driTextureObject * t; @@ -409,8 +409,8 @@ static void driTexturesGone( driTexHeap * heap, int offset, int size, return; } t->heap = heap; - if (in_use) - t->reserved = 1; + if (in_use) + t->reserved = 1; insert_at_head( & heap->texture_objects, t ); } } @@ -423,7 +423,7 @@ static void driTexturesGone( driTexHeap * heap, int offset, int size, * been stolen. If another client has modified a region in which we have * textures, then we need to figure out which of our textures have been * removed and update our global LRU. - * + * * \param heap Texture heap to be updated */ @@ -438,8 +438,8 @@ void driAgeTextures( driTexHeap * heap ) * LRU in the local list... Fix with a cursor pointer. */ - for (i = list[heap->nrRegions].prev ; - i != heap->nrRegions && nr < heap->nrRegions ; + for (i = list[heap->nrRegions].prev ; + i != heap->nrRegions && nr < heap->nrRegions ; i = list[i].prev, nr++) { /* If switching texturing schemes, then the SAREA might not have been * properly cleared, so we need to reset the global texture LRU. @@ -450,8 +450,8 @@ void driAgeTextures( driTexHeap * heap ) break; } - if (list[i].age > heap->local_age) - driTexturesGone( heap, i * sz, sz, list[i].in_use); + if (list[i].age > heap->local_age) + driTexturesGone( heap, i * sz, sz, list[i].in_use); } /* Loop or uninitialized heap detected. Reset. @@ -516,7 +516,7 @@ driAllocateTexture( driTexHeap * const * heap_array, unsigned nr_heaps, for ( id = 0 ; (t->memBlock == NULL) && (id < nr_heaps) ; id++ ) { heap = heap_array[ id ]; if ( heap != NULL ) { - t->memBlock = mmAllocMem( heap->memory_heap, t->totalSize, + t->memBlock = mmAllocMem( heap->memory_heap, t->totalSize, heap->alignmentShift, 0 ); } } @@ -562,9 +562,9 @@ driAllocateTexture( driTexHeap * const * heap_array, unsigned nr_heaps, heap = heap_array[ index[ id ] ]; for ( cursor = heap->texture_objects.prev, temp = cursor->prev; - cursor != &heap->texture_objects ; + cursor != &heap->texture_objects ; cursor = temp, temp = cursor->prev ) { - + /* The the LRU element. If the texture is bound to one of * the texture units, then we cannot kick it out. */ @@ -581,7 +581,7 @@ driAllocateTexture( driTexHeap * const * heap_array, unsigned nr_heaps, else driDestroyTextureObject( cursor ); - t->memBlock = mmAllocMem( heap->memory_heap, t->totalSize, + t->memBlock = mmAllocMem( heap->memory_heap, t->totalSize, heap->alignmentShift, 0 ); if (t->memBlock) @@ -653,7 +653,7 @@ driSetTextureSwapCounterLocation( driTexHeap * heap, unsigned * counter ) /** * Create a new heap for texture data. - * + * * \param heap_id Device-dependent heap identifier. This value * will returned by driAllocateTexture when memory * is allocated from this heap. @@ -661,7 +661,7 @@ driSetTextureSwapCounterLocation( driTexHeap * heap, unsigned * counter ) * supplied as the first parameter to the * \c destroy_tex_obj function. * \param size Size, in bytes, of the texture region - * \param alignmentShift Alignment requirement for textures. If textures + * \param alignmentShift Alignment requirement for textures. If textures * must be allocated on a 4096 byte boundry, this * would be 12. * \param nr_regions Number of regions into which this texture space @@ -683,15 +683,15 @@ driTexHeap * driCreateTextureHeap( unsigned heap_id, void * context, unsigned size, unsigned alignmentShift, unsigned nr_regions, drmTextureRegionPtr global_regions, unsigned * global_age, - driTextureObject * swapped_objects, + driTextureObject * swapped_objects, unsigned texture_object_size, destroy_texture_object_t * destroy_tex_obj ) { driTexHeap * heap; unsigned l; - - + + if ( 0 ) fprintf( stderr, "%s( %u, %p, %u, %u, %u )\n", __FUNCTION__, @@ -750,7 +750,7 @@ driCreateTextureHeap( unsigned heap_id, void * context, unsigned size, /** Destroys a texture heap - * + * * \param heap Texture heap to be destroyed */ @@ -838,7 +838,7 @@ fill_in_maximums( driTexHeap * const * heaps, unsigned nr_heaps, for ( heap = 0 ; heap < nr_heaps ; heap++ ) { if ( heaps[ heap ] == NULL ) { - (void) memset( max_textures[ heap ].c, 0, + (void) memset( max_textures[ heap ].c, 0, sizeof( max_textures[ heap ].c ) ); continue; } @@ -948,7 +948,7 @@ get_max_size( unsigned nr_heaps, * Given the amount of texture memory, the number of texture units, and the * maximum size of a texel, calculate the maximum texture size the driver can * advertise. - * + * * \param heaps Texture heaps for this card * \param nr_heap Number of texture heaps * \param limits OpenGL contants. MaxTextureUnits must be set. @@ -1097,7 +1097,7 @@ void driInitTextureObjects( struct gl_context *ctx, driTextureObject * swapped, /** * Verify that the specified texture is in the specificed heap. - * + * * \param tex Texture to be tested. * \param heap Texture memory heap to be tested. * \return True if the texture is in the heap, false otherwise. @@ -1144,7 +1144,7 @@ driValidateTextureHeaps( driTexHeap * const * texture_heaps, const struct mem_block *p = heap->memory_heap; /* Check each texture object has a MemBlock, and is linked into - * the correct heap. + * the correct heap. * * Check the texobj base address corresponds to the MemBlock * range. Check the texobj size (recalculate?) fits within @@ -1201,13 +1201,13 @@ driValidateTextureHeaps( driTexHeap * const * texture_heaps, if (textures_in_heap != blocks_in_mempool) { fprintf( stderr, "%s: Different number of textures objects (%u) and " - "inuse memory blocks (%u)\n", + "inuse memory blocks (%u)\n", __FUNCTION__, textures_in_heap, blocks_in_mempool ); return GL_FALSE; } #if 0 - fprintf( stderr, "%s: textures_in_heap = %u\n", + fprintf( stderr, "%s: textures_in_heap = %u\n", __FUNCTION__, textures_in_heap ); #endif } diff --git a/src/mesa/drivers/dri/common/texmem.h b/src/mesa/drivers/dri/common/texmem.h index 6dd07b8..1fe2ed1 100644 --- a/src/mesa/drivers/dri/common/texmem.h +++ b/src/mesa/drivers/dri/common/texmem.h @@ -31,7 +31,7 @@ /** \file texmem.h * Public interface to the DRI texture memory management routines. - * + * * \sa texmem.c */ @@ -76,7 +76,7 @@ struct dri_texture_object { */ unsigned totalSize; /**< Total size of the texture, - * including all mipmap levels + * including all mipmap levels */ unsigned dirty_images[6]; /**< Flags for whether or not images @@ -92,7 +92,7 @@ struct dri_texture_object { * synchronize with 3d engine * in hardware where textures * are uploaded directly to - * the framebuffer. + * the framebuffer. */ unsigned firstLevel; /**< Image in \c tObj->Image[0] that @@ -100,7 +100,7 @@ struct dri_texture_object { * this texture object. */ - unsigned lastLevel; /**< Last image in \c tObj->Image[0] + unsigned lastLevel; /**< Last image in \c tObj->Image[0] * used by the * current LOD settings of * this texture object. This @@ -122,11 +122,11 @@ typedef void (destroy_texture_object_t)( void * driverContext, struct dri_tex_heap { - /** Client-supplied heap identifier + /** Client-supplied heap identifier */ - unsigned heapId; + unsigned heapId; - /** Pointer to the client's private context + /** Pointer to the client's private context */ void *driverContext; @@ -146,7 +146,7 @@ struct dri_tex_heap { unsigned logGranularity; /** \brief Required alignment of allocations in this heap - * + * * The alignment shift is supplied to \a mmAllocMem when memory is * allocated from this heap. The value of \a alignmentShift will * typically reflect some require of the hardware. This value has @@ -159,7 +159,7 @@ struct dri_tex_heap { /** Number of elements in global list (the SAREA). */ - unsigned nrRegions; + unsigned nrRegions; /** Pointer to SAREA \a driTexRegion array */ @@ -182,7 +182,7 @@ struct dri_tex_heap { * memory. */ driTextureObject texture_objects; - + /** Pointer to the list of texture objects that are not in * texture memory. */ @@ -195,7 +195,7 @@ struct dri_tex_heap { /** * \brief Function to destroy driver-specific texture object data. - * + * * This function is supplied by the driver so that the texture manager * can release all resources associated with a texture object. This * function should only release driver-specific data. That is, @@ -219,7 +219,7 @@ struct dri_tex_heap { /** * Timestamp used to synchronize with 3d engine in hardware * where textures are uploaded directly to the - * framebuffer. + * framebuffer. */ unsigned timestamp; @@ -249,7 +249,7 @@ struct dri_tex_heap { * been stolen. If another client has modified a region in which we have * textures, then we need to figure out which of our textures have been * removed and update our global LRU. - * + * * \param heap Texture heap to be updated * \hideinitializer */ @@ -277,7 +277,7 @@ void driDestroyTextureObject( driTextureObject * t ); int driAllocateTexture( driTexHeap * const * heap_array, unsigned nr_heaps, driTextureObject * t ); -GLboolean driIsTextureResident( struct gl_context * ctx, +GLboolean driIsTextureResident( struct gl_context * ctx, struct gl_texture_object * texObj ); driTexHeap * driCreateTextureHeap( unsigned heap_id, void * context, diff --git a/src/mesa/drivers/dri/common/utils.c b/src/mesa/drivers/dri/common/utils.c index 42be77f..bfc19ea 100644 --- a/src/mesa/drivers/dri/common/utils.c +++ b/src/mesa/drivers/dri/common/utils.c @@ -39,10 +39,10 @@ /** * Print message to \c stderr if the \c LIBGL_DEBUG environment variable - * is set. - * + * is set. + * * Is called from the drivers. - * + * * \param f \c printf like format string. */ void @@ -61,7 +61,7 @@ __driUtilMessage(const char *f, ...) unsigned -driParseDebugString( const char * debug, +driParseDebugString( const char * debug, const struct dri_debug_control * control ) { unsigned flag; @@ -86,19 +86,19 @@ driParseDebugString( const char * debug, /** * Create the \c GL_RENDERER string for DRI drivers. - * + * * Almost all DRI drivers use a \c GL_RENDERER string of the form: * * "Mesa DRI " * * Using the supplied chip name, driver data, and AGP speed, this function * creates the string. - * + * * \param buffer Buffer to hold the \c GL_RENDERER string. * \param hardware_name Name of the hardware. * \param driver_date Driver date. * \param agp_mode AGP mode (speed). - * + * * \returns * The length of the string stored in \c buffer. This does \b not include * the terminating \c NUL character. @@ -121,7 +121,7 @@ driGetRendererString( char * buffer, const char * hardware_name, case 8: offset += sprintf( & buffer[ offset ], " AGP %ux", agp_mode ); break; - + default: break; } @@ -187,7 +187,7 @@ static const struct dri_extension all_mesa_extensions[] = { /** * Enable and map extensions supported by the driver. - * + * * When ctx is NULL, extensions are not enabled, but their functions * are still mapped. When extensions_to_enable is NULL, all static * functions known to mesa core are mapped. @@ -233,10 +233,10 @@ void driInitExtensions( struct gl_context * ctx, /** * Enable and map functions for a single extension - * + * * \param ctx Context where extension is to be enabled. * \param ext Extension that is to be enabled. - * + * * \sa driInitExtensions, _mesa_enable_extension, _mesa_map_function_array */ void driInitSingleExtension( struct gl_context * ctx, @@ -262,10 +262,10 @@ void driInitSingleExtension( struct gl_context * ctx, * \param ddxExpected Minimum DDX minor and range of DDX major version required by the driver. * \param drmActual Actual DRM version supplied __driCreateNewScreen. * \param drmExpected Minimum DRM version required by the driver. - * + * * \returns \c GL_TRUE if all version requirements are met. Otherwise, * \c GL_FALSE is returned. - * + * * \sa __driCreateNewScreen, driCheckDriDdxDrmVersions2 * * \todo @@ -305,7 +305,7 @@ driCheckDriDdxDrmVersions3(const char * driver_name, ddxActual->major, ddxActual->minor, ddxActual->patch); return GL_FALSE; } - + /* Check that the DRM driver version is compatible */ if ( (drmActual->major != drmExpected->major) || (drmActual->minor < drmExpected->minor) ) { @@ -372,11 +372,11 @@ GLboolean driClipRectToFramebuffer( const struct gl_framebuffer *buffer, /** * Creates a set of \c struct gl_config that a driver will expose. - * + * * A set of \c struct gl_config will be created based on the supplied * parameters. The number of modes processed will be 2 * * \c num_depth_stencil_bits * \c num_db_modes. - * + * * For the most part, data is just copied from \c depth_bits, \c stencil_bits, * \c db_modes, and \c visType into each \c struct gl_config element. * However, the meanings of \c fb_format and \c fb_type require further @@ -388,7 +388,7 @@ GLboolean driClipRectToFramebuffer( const struct gl_framebuffer *buffer, * \c GL_UNSIGNED_SHORT_5_6_5_REV is specified with \c GL_RGB, bits [15:11] * are the blue value, bits [10:5] are the green value, and bits [4:0] are * the red value. - * + * * One sublte issue is the combination of \c GL_RGB or \c GL_BGR and either * of the \c GL_UNSIGNED_INT_8_8_8_8 modes. The resulting mask values in the * \c struct gl_config structure is \b identical to the \c GL_RGBA or @@ -397,7 +397,7 @@ GLboolean driClipRectToFramebuffer( const struct gl_framebuffer *buffer, * still uses 32-bits. * * If in doubt, look at the tables used in the function. - * + * * \param ptr_to_modes Pointer to a pointer to a linked list of * \c struct gl_config. Upon completion, a pointer to * the next element to be process will be stored here. @@ -407,7 +407,7 @@ GLboolean driClipRectToFramebuffer( const struct gl_framebuffer *buffer, * \param fb_format Format of the framebuffer. Currently only \c GL_RGB, * \c GL_RGBA, \c GL_BGR, and \c GL_BGRA are supported. * \param fb_type Type of the pixels in the framebuffer. Currently only - * \c GL_UNSIGNED_SHORT_5_6_5, + * \c GL_UNSIGNED_SHORT_5_6_5, * \c GL_UNSIGNED_SHORT_5_6_5_REV, * \c GL_UNSIGNED_INT_8_8_8_8, and * \c GL_UNSIGNED_INT_8_8_8_8_REV are supported. @@ -427,17 +427,17 @@ GLboolean driClipRectToFramebuffer( const struct gl_framebuffer *buffer, * \param num_msaa_modes Number of entries in \c msaa_samples. * \param visType GLX visual type. Usually either \c GLX_TRUE_COLOR or * \c GLX_DIRECT_COLOR. - * + * * \returns * \c GL_TRUE on success or \c GL_FALSE on failure. Currently the only * cause of failure is a bad parameter (i.e., unsupported \c fb_format or * \c fb_type). - * + * * \todo * There is currently no way to support packed RGB modes (i.e., modes with * exactly 3 bytes per pixel) or floating-point modes. This could probably * be done by creating some new, private enums with clever names likes - * \c GL_UNSIGNED_3BYTE_8_8_8, \c GL_4FLOAT_32_32_32_32, + * \c GL_UNSIGNED_3BYTE_8_8_8, \c GL_4FLOAT_32_32_32_32, * \c GL_4HALF_16_16_16_16, etc. We can cross that bridge when we come to it. */ __DRIconfig ** @@ -669,7 +669,7 @@ __DRIconfig **driConcatConfigs(__DRIconfig **a, j = 0; while (b[j] != NULL) j++; - + all = malloc((i + j + 1) * sizeof *all); index = 0; for (i = 0; a[i] != NULL; i++) @@ -773,7 +773,7 @@ driGetConfigAttribIndex(const __DRIconfig *config, /* any other int-sized field */ *value = *(unsigned int *) ((char *) &config->modes + attribMap[index].offset); - + break; } diff --git a/src/mesa/drivers/dri/common/utils.h b/src/mesa/drivers/dri/common/utils.h index 6349fb4..4a36cee 100644 --- a/src/mesa/drivers/dri/common/utils.h +++ b/src/mesa/drivers/dri/common/utils.h @@ -48,7 +48,7 @@ struct dri_extension { * Name of the extension. */ const char * name; - + /** * Pointer to a list of \c dri_extension_function structures. The list @@ -78,7 +78,7 @@ extern unsigned driParseDebugString( const char * debug, extern unsigned driGetRendererString( char * buffer, const char * hardware_name, const char * driver_date, GLuint agp_mode ); -extern void driInitExtensions( struct gl_context * ctx, +extern void driInitExtensions( struct gl_context * ctx, const struct dri_extension * card_extensions, GLboolean enable_imaging ); extern void driInitSingleExtension( struct gl_context * ctx, diff --git a/src/mesa/drivers/dri/common/vblank.c b/src/mesa/drivers/dri/common/vblank.c index cb98dd0..f709016 100644 --- a/src/mesa/drivers/dri/common/vblank.c +++ b/src/mesa/drivers/dri/common/vblank.c @@ -54,8 +54,8 @@ static int64_t vblank_to_msc(__DRIdrawable * dPriv, unsigned int vblank) * may, it will never decrease for a given drawable. * * \warning This function is called from \c glXGetVideoSyncSGI, which expects - * a \c count of type \c unsigned (32-bit), and \c glXGetSyncValuesOML, which - * expects a \c count of type \c int64_t (signed 64-bit). The kernel ioctl + * a \c count of type \c unsigned (32-bit), and \c glXGetSyncValuesOML, which + * expects a \c count of type \c int64_t (signed 64-bit). The kernel ioctl * currently always returns a \c sequence of type \c unsigned. * * \param priv Pointer to the DRI screen private struct. @@ -95,10 +95,10 @@ int driDrawableGetMSC32( __DRIscreen * priv, * Wait for a specified refresh count. This implements most of the * functionality of \c glXWaitForMscOML from the GLX_OML_sync_control spec. * Waits for the \c target_msc refresh. If that has already passed, it - * waits until \f$(MSC \bmod divisor)\f$ is equal to \c remainder. If + * waits until \f$(MSC \bmod divisor)\f$ is equal to \c remainder. If * \c target_msc is 0, use the behavior of glXWaitVideoSyncSGI(), which * omits the initial check against a target MSC value. - * + * * This function is actually something of a hack. The problem is that, at * the time of this writing, none of the existing DRM modules support an * ioctl that returns a 64-bit count (at least not on 32-bit platforms). @@ -136,7 +136,7 @@ int driWaitForMSC32( __DRIdrawable *priv, do { /* dont_wait means we're using the glXWaitVideoSyncSGI() behavior. - * The first time around, just get the current count and proceed + * The first time around, just get the current count and proceed * to the test for (MSC % divisor) == remainder. */ vbl.request.type = dont_wait ? DRM_VBLANK_RELATIVE : @@ -159,9 +159,9 @@ int driWaitForMSC32( __DRIdrawable *priv, /* Assuming the wait-done test fails, the next refresh to wait for * will be one that satisfies (MSC % divisor) == remainder. The - * value (MSC - (MSC % divisor) + remainder) is the refresh value - * closest to the current value that would satisfy the equation. - * If this refresh has already happened, we add divisor to obtain + * value (MSC - (MSC % divisor) + remainder) is the refresh value + * closest to the current value that would satisfy the equation. + * If this refresh has already happened, we add divisor to obtain * the next refresh after the current one that will satisfy it. */ r = ((uint64_t)*msc % divisor); @@ -257,7 +257,7 @@ static int do_wait( drmVBlank * vbl, GLuint * vbl_seq, int fd ) static GLboolean first_time = GL_TRUE; if ( first_time ) { - fprintf(stderr, + fprintf(stderr, "%s: drmWaitVBlank returned %d, IRQs don't seem to be" " working correctly.\nTry adjusting the vblank_mode" " configuration parameter.\n", __FUNCTION__, ret); @@ -301,7 +301,7 @@ void driDrawableInitVBlank( __DRIdrawable *priv ) !( priv->vblFlags & VBLANK_FLAG_NO_IRQ ) ) { /* Get current vertical blank sequence */ drmVBlank vbl; - + vbl.request.type = DRM_VBLANK_RELATIVE; if ( priv->vblFlags & VBLANK_FLAG_SECONDARY ) vbl.request.type |= DRM_VBLANK_SECONDARY; @@ -329,7 +329,7 @@ driGetVBlankInterval( const __DRIdrawable *priv ) return priv->swap_interval; } - else + else return driGetDefaultVBlankInterval( priv ); } @@ -357,7 +357,7 @@ driGetCurrentVBlank( __DRIdrawable *priv ) /****************************************************************************/ /** * Waits for the vertical blank for use with glXSwapBuffers. - * + * * \param missed_deadline Set to \c GL_TRUE if the MSC after waiting is later * than the "target" based on \c priv->vblFlags. The idea is * that if \c missed_deadline is set, then the application is diff --git a/src/mesa/drivers/dri/common/xmlconfig.c b/src/mesa/drivers/dri/common/xmlconfig.c index 0312c07..6a90d1d 100644 --- a/src/mesa/drivers/dri/common/xmlconfig.c +++ b/src/mesa/drivers/dri/common/xmlconfig.c @@ -15,11 +15,11 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * FELIX KUEHLING, OR ANY OTHER CONTRIBUTORS BE LIABLE FOR ANY CLAIM, - * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR - * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE + * FELIX KUEHLING, OR ANY OTHER CONTRIBUTORS BE LIABLE FOR ANY CLAIM, + * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * + * */ /** * \file xmlconfig.c @@ -172,7 +172,7 @@ static GLint strToI (const XML_Char *string, const XML_Char **tail, int base) { } else if (*string == '+') string++; if (base == 0 && *string == '0') { - numberFound = GL_TRUE; + numberFound = GL_TRUE; if (*(string+1) == 'x' || *(string+1) == 'X') { radix = 16; string += 2; diff --git a/src/mesa/drivers/dri/common/xmlconfig.h b/src/mesa/drivers/dri/common/xmlconfig.h index c363af7..83f678b 100644 --- a/src/mesa/drivers/dri/common/xmlconfig.h +++ b/src/mesa/drivers/dri/common/xmlconfig.h @@ -15,11 +15,11 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * FELIX KUEHLING, OR ANY OTHER CONTRIBUTORS BE LIABLE FOR ANY CLAIM, - * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR - * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE + * FELIX KUEHLING, OR ANY OTHER CONTRIBUTORS BE LIABLE FOR ANY CLAIM, + * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * + * */ /** * \file xmlconfig.h @@ -67,11 +67,11 @@ typedef struct driOptionCache { /**< \brief Array of option infos * * Points to the same array in the screen and all contexts */ - driOptionValue *values; + driOptionValue *values; /**< \brief Array of option values * * \li Default values in screen - * \li Actual values in contexts + * \li Actual values in contexts */ GLuint tableSize; /**< \brief Size of the arrays @@ -83,7 +83,7 @@ typedef struct driOptionCache { /** \brief Parse XML option info from configOptions * - * To be called in CreateScreen + * To be called in CreateScreen * * \param info pointer to a driOptionCache that will store the option info * \param configOptions XML document describing available configuration opts diff --git a/src/mesa/drivers/dri/common/xmlpool.h b/src/mesa/drivers/dri/common/xmlpool.h index 587517e..159878b 100644 --- a/src/mesa/drivers/dri/common/xmlpool.h +++ b/src/mesa/drivers/dri/common/xmlpool.h @@ -15,11 +15,11 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * FELIX KUEHLING, OR ANY OTHER CONTRIBUTORS BE LIABLE FOR ANY CLAIM, - * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR - * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE + * FELIX KUEHLING, OR ANY OTHER CONTRIBUTORS BE LIABLE FOR ANY CLAIM, + * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * + * */ /** * \file xmlpool.h diff --git a/src/mesa/drivers/dri/common/xmlpool/Makefile b/src/mesa/drivers/dri/common/xmlpool/Makefile index b71629e..28ae203 100644 --- a/src/mesa/drivers/dri/common/xmlpool/Makefile +++ b/src/mesa/drivers/dri/common/xmlpool/Makefile @@ -55,7 +55,7 @@ POT=xmlpool.pot all: options.h # Only intermediate files are cleaned up. options.h is not deleted because -# it's in CVS. +# it's in CVS. clean: -rm -f $(POT) *~ -rm -rf $(LANGS) diff --git a/src/mesa/drivers/dri/common/xmlpool/options.h b/src/mesa/drivers/dri/common/xmlpool/options.h index d765955..09129be 100644 --- a/src/mesa/drivers/dri/common/xmlpool/options.h +++ b/src/mesa/drivers/dri/common/xmlpool/options.h @@ -18,11 +18,11 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * FELIX KUEHLING, OR ANY OTHER CONTRIBUTORS BE LIABLE FOR ANY CLAIM, - * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR - * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE + * FELIX KUEHLING, OR ANY OTHER CONTRIBUTORS BE LIABLE FOR ANY CLAIM, + * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * + * */ /** * \file t_options.h diff --git a/src/mesa/drivers/dri/common/xmlpool/t_options.h b/src/mesa/drivers/dri/common/xmlpool/t_options.h index 5fd6ec6..3956e2b 100644 --- a/src/mesa/drivers/dri/common/xmlpool/t_options.h +++ b/src/mesa/drivers/dri/common/xmlpool/t_options.h @@ -15,11 +15,11 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * FELIX KUEHLING, OR ANY OTHER CONTRIBUTORS BE LIABLE FOR ANY CLAIM, - * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR - * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE + * FELIX KUEHLING, OR ANY OTHER CONTRIBUTORS BE LIABLE FOR ANY CLAIM, + * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * + * */ /** * \file t_options.h diff --git a/src/mesa/drivers/dri/i810/Makefile b/src/mesa/drivers/dri/i810/Makefile index 54a837d..e96faf2 100644 --- a/src/mesa/drivers/dri/i810/Makefile +++ b/src/mesa/drivers/dri/i810/Makefile @@ -22,7 +22,7 @@ C_SOURCES = \ $(COMMON_SOURCES) \ $(DRIVER_SOURCES) -ASM_SOURCES = +ASM_SOURCES = include ../Makefile.template diff --git a/src/mesa/drivers/dri/i810/i810context.c b/src/mesa/drivers/dri/i810/i810context.c index dc58e91..3d15799 100644 --- a/src/mesa/drivers/dri/i810/i810context.c +++ b/src/mesa/drivers/dri/i810/i810context.c @@ -79,7 +79,7 @@ static const GLubyte *i810GetString( struct gl_context *ctx, GLenum name ) case GL_RENDERER: { i810ContextPtr imesa = I810_CONTEXT(ctx); const char * chipset; - + switch (imesa->i810Screen->deviceID) { case PCI_CHIP_I810: chipset = "i810"; break; case PCI_CHIP_I810_DC100: chipset = "i810 DC-100"; break; @@ -213,7 +213,7 @@ i810CreateContext( gl_api api, (void) memset( imesa->texture_heaps, 0, sizeof( imesa->texture_heaps ) ); make_empty_list( & imesa->swapped ); - + imesa->nr_heaps = 1; imesa->texture_heaps[0] = driCreateTextureHeap( 0, imesa, i810Screen->textureSize, @@ -485,11 +485,11 @@ i810UpdatePageFlipping( i810ContextPtr imesa ) return; } - if ( imesa->sarea->pf_current_page == 1 ) + if ( imesa->sarea->pf_current_page == 1 ) front ^= 1; driFlipRenderbuffers(ctx->WinSysDrawBuffer, front); - + if (front) { imesa->BufferSetup[I810_DESTREG_DI1] = imesa->i810Screen->fbOffset | imesa->i810Screen->backPitchBits; } else { @@ -534,7 +534,7 @@ void i810GetLock( i810ContextPtr imesa, GLuint flags ) /* Shared texture managment - if another client has played with * texture space, figure out which if any of our textures have been * ejected, and update our global LRU. - */ + */ for ( i = 0 ; i < imesa->nr_heaps ; i++ ) { DRI_AGE_TEXTURES( imesa->texture_heaps[ i ] ); } diff --git a/src/mesa/drivers/dri/i810/i810context.h b/src/mesa/drivers/dri/i810/i810context.h index 93c7eda..fa0bd03 100644 --- a/src/mesa/drivers/dri/i810/i810context.h +++ b/src/mesa/drivers/dri/i810/i810context.h @@ -15,9 +15,9 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * KEITH WHITWELL, OR ANY OTHER CONTRIBUTORS BE LIABLE FOR ANY CLAIM, - * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR - * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE + * KEITH WHITWELL, OR ANY OTHER CONTRIBUTORS BE LIABLE FOR ANY CLAIM, + * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * */ @@ -37,13 +37,13 @@ typedef struct i810_texture_object_t *i810TextureObjectPtr; #include "i810tex.h" -/* Reasons to disable hardware rasterization. +/* Reasons to disable hardware rasterization. */ #define I810_FALLBACK_TEXTURE 0x1 #define I810_FALLBACK_DRAW_BUFFER 0x2 #define I810_FALLBACK_READ_BUFFER 0x4 -#define I810_FALLBACK_COLORMASK 0x8 -#define I810_FALLBACK_SPECULAR 0x20 +#define I810_FALLBACK_COLORMASK 0x8 +#define I810_FALLBACK_SPECULAR 0x20 #define I810_FALLBACK_LOGICOP 0x40 #define I810_FALLBACK_RENDERMODE 0x80 #define I810_FALLBACK_STENCIL 0x100 @@ -51,11 +51,11 @@ typedef struct i810_texture_object_t *i810TextureObjectPtr; #define I810_FALLBACK_BLEND_FUNC 0x400 -#ifndef PCI_CHIP_I810 +#ifndef PCI_CHIP_I810 #define PCI_CHIP_I810 0x7121 #define PCI_CHIP_I810_DC100 0x7123 -#define PCI_CHIP_I810_E 0x7125 -#define PCI_CHIP_I815 0x1132 +#define PCI_CHIP_I810_E 0x7125 +#define PCI_CHIP_I815 0x1132 #endif #define IS_I810(imesa) (imesa->i810Screen->deviceID == PCI_CHIP_I810 || \ @@ -78,7 +78,7 @@ typedef void (*i810_line_func)( i810ContextPtr, i810Vertex *, i810Vertex * ); typedef void (*i810_point_func)( i810ContextPtr, i810Vertex * ); struct i810_context_t { - GLint refcount; + GLint refcount; struct gl_context *glCtx; /* Texture object bookkeeping @@ -111,17 +111,17 @@ struct i810_context_t { GLuint vertex_low; GLuint vertex_high; GLuint vertex_last_prim; - + GLboolean upload_cliprects; - /* Fallback rasterization functions + /* Fallback rasterization functions */ i810_point_func draw_point; i810_line_func draw_line; i810_tri_func draw_tri; - /* Hardware state + /* Hardware state */ GLuint dirty; /* I810_UPLOAD_* */ GLuint Setup[I810_CTX_SETUP_SIZE]; @@ -160,8 +160,8 @@ struct i810_context_t { int texAge; int ctxAge; int dirtyAge; - - + + GLboolean scissor; drm_clip_rect_t draw_rect; drm_clip_rect_t scissor_rect; @@ -172,7 +172,7 @@ struct i810_context_t { __DRIdrawable *driDrawable; __DRIscreen *driScreen; - i810ScreenPrivate *i810Screen; + i810ScreenPrivate *i810Screen; I810SAREAPtr sarea; }; @@ -183,7 +183,7 @@ struct i810_context_t { #define GET_ENQUEUE_AGE( imesa ) imesa->sarea->last_enqueue -/* Lock the hardware and validate our state. +/* Lock the hardware and validate our state. */ #define LOCK_HARDWARE( imesa ) \ do { \ @@ -199,12 +199,12 @@ struct i810_context_t { /* Release the kernel lock. */ #define UNLOCK_HARDWARE(imesa) \ - DRM_UNLOCK(imesa->driFd, imesa->driHwLock, imesa->hHWContext); + DRM_UNLOCK(imesa->driFd, imesa->driHwLock, imesa->hHWContext); /* This is the wrong way to do it, I'm sure. Otherwise the drm * bitches that I've already got the heavyweight lock. At worst, - * this is 3 ioctls. The best solution probably only gets me down + * this is 3 ioctls. The best solution probably only gets me down * to 2 ioctls in the worst case. */ #define LOCK_HARDWARE_QUIESCENT( imesa ) do { \ diff --git a/src/mesa/drivers/dri/i810/i810ioctl.c b/src/mesa/drivers/dri/i810/i810ioctl.c index 4b004d5..41f1914 100644 --- a/src/mesa/drivers/dri/i810/i810ioctl.c +++ b/src/mesa/drivers/dri/i810/i810ioctl.c @@ -20,14 +20,14 @@ static drmBufPtr i810_get_buffer_ioctl( i810ContextPtr imesa ) drmI810DMA dma; drmBufPtr buf; int retcode, i = 0; - + while (1) { retcode = drmCommandWriteRead(imesa->driFd, DRM_I810_GETBUF, &dma, sizeof(drmI810DMA)); - if (dma.granted == 1 && retcode == 0) + if (dma.granted == 1 && retcode == 0) break; - + if (++i > 1000) { drmCommandNone(imesa->driFd, DRM_I810_FLUSH); i = 0; @@ -60,7 +60,7 @@ static void i810Clear( struct gl_context *ctx, GLbitfield mask ) clear.clear_depth = (GLuint) (ctx->Depth.Clear * DEPTH_SCALE); I810_FIREVERTICES( imesa ); - + if ((mask & BUFFER_BIT_FRONT_LEFT) && colorMask == ~0U) { clear.flags |= I810_FRONT; mask &= ~BUFFER_BIT_FRONT_LEFT; @@ -72,7 +72,7 @@ static void i810Clear( struct gl_context *ctx, GLbitfield mask ) } if (mask & BUFFER_BIT_DEPTH) { - if (ctx->Depth.Mask) + if (ctx->Depth.Mask) clear.flags |= I810_DEPTH; mask &= ~BUFFER_BIT_DEPTH; } @@ -93,10 +93,10 @@ static void i810Clear( struct gl_context *ctx, GLbitfield mask ) cx += imesa->drawX; cy += imesa->drawY; - for (i = 0 ; i < imesa->numClipRects ; ) - { + for (i = 0 ; i < imesa->numClipRects ; ) + { unsigned int nr = MIN2(i + I810_NR_SAREA_CLIPRECTS, imesa->numClipRects); - drm_clip_rect_t *box = imesa->pClipRects; + drm_clip_rect_t *box = imesa->pClipRects; drm_clip_rect_t *b = (drm_clip_rect_t *)imesa->sarea->boxes; int n = 0; @@ -108,7 +108,7 @@ static void i810Clear( struct gl_context *ctx, GLbitfield mask ) GLint w = box[i].x2 - x; GLint h = box[i].y2 - y; - if (x < cx) w -= cx - x, x = cx; + if (x < cx) w -= cx - x, x = cx; if (y < cy) h -= cy - y, y = cy; if (x + w > cx + cw) w = cx + cw - x; if (y + h > cy + ch) h = cy + ch - y; @@ -139,7 +139,7 @@ static void i810Clear( struct gl_context *ctx, GLbitfield mask ) imesa->upload_cliprects = GL_TRUE; } - if (mask) + if (mask) _swrast_Clear( ctx, mask ); } @@ -147,9 +147,9 @@ static void i810Clear( struct gl_context *ctx, GLbitfield mask ) /* - * Copy the back buffer to the front buffer. + * Copy the back buffer to the front buffer. */ -void i810CopyBuffer( const __DRIdrawable *dPriv ) +void i810CopyBuffer( const __DRIdrawable *dPriv ) { i810ContextPtr imesa; drm_clip_rect_t *pbox; @@ -163,7 +163,7 @@ void i810CopyBuffer( const __DRIdrawable *dPriv ) I810_FIREVERTICES( imesa ); LOCK_HARDWARE( imesa ); - + pbox = (drm_clip_rect_t *)dPriv->pClipRects; nbox = dPriv->numClipRects; @@ -174,7 +174,7 @@ void i810CopyBuffer( const __DRIdrawable *dPriv ) imesa->sarea->nbox = nr - i; - for ( ; i < nr ; i++) + for ( ; i < nr ; i++) *b++ = pbox[i]; drmCommandNone(imesa->driFd, DRM_I810_SWAP); @@ -197,7 +197,7 @@ void i810CopyBuffer( const __DRIdrawable *dPriv ) /* * XXX implement when full-screen extension is done. */ -void i810PageFlip( const __DRIdrawable *dPriv ) +void i810PageFlip( const __DRIdrawable *dPriv ) { i810ContextPtr imesa; int tmp, ret; @@ -205,12 +205,12 @@ void i810PageFlip( const __DRIdrawable *dPriv ) assert(dPriv); assert(dPriv->driContextPriv); assert(dPriv->driContextPriv->driverPrivate); - + imesa = (i810ContextPtr) dPriv->driContextPriv->driverPrivate; I810_FIREVERTICES( imesa ); LOCK_HARDWARE( imesa ); - + if (dPriv->pClipRects) { memcpy(&(imesa->sarea->boxes[0]), &(dPriv->pClipRects[0]), sizeof(drm_clip_rect_t)); @@ -225,7 +225,7 @@ void i810PageFlip( const __DRIdrawable *dPriv ) tmp = GET_ENQUEUE_AGE(imesa); UNLOCK_HARDWARE( imesa ); - + /* multiarb will suck the life out of the server without this throttle: */ if (GET_DISPATCH_AGE(imesa) < imesa->lastSwap) { @@ -242,7 +242,7 @@ void i810PageFlip( const __DRIdrawable *dPriv ) /* This waits for *everybody* to finish rendering -- overkill. */ -void i810DmaFinish( i810ContextPtr imesa ) +void i810DmaFinish( i810ContextPtr imesa ) { I810_FIREVERTICES( imesa ); @@ -252,13 +252,13 @@ void i810DmaFinish( i810ContextPtr imesa ) } -void i810RegetLockQuiescent( i810ContextPtr imesa ) +void i810RegetLockQuiescent( i810ContextPtr imesa ) { drmUnlock(imesa->driFd, imesa->hHWContext); - i810GetLock( imesa, DRM_LOCK_QUIESCENT ); + i810GetLock( imesa, DRM_LOCK_QUIESCENT ); } -void i810WaitAgeLocked( i810ContextPtr imesa, int age ) +void i810WaitAgeLocked( i810ContextPtr imesa, int age ) { int i = 0, j; @@ -274,7 +274,7 @@ void i810WaitAgeLocked( i810ContextPtr imesa, int age ) } -void i810WaitAge( i810ContextPtr imesa, int age ) +void i810WaitAge( i810ContextPtr imesa, int age ) { int i = 0, j; @@ -320,21 +320,21 @@ static int intersect_rect( drm_clip_rect_t *out, static void emit_state( i810ContextPtr imesa ) { - GLuint dirty = imesa->dirty; + GLuint dirty = imesa->dirty; I810SAREAPtr sarea = imesa->sarea; if (dirty & I810_UPLOAD_BUFFERS) { - memcpy( sarea->BufferState, imesa->BufferSetup, + memcpy( sarea->BufferState, imesa->BufferSetup, sizeof(imesa->BufferSetup) ); - } + } if (dirty & I810_UPLOAD_CTX) { - memcpy( sarea->ContextState, imesa->Setup, + memcpy( sarea->ContextState, imesa->Setup, sizeof(imesa->Setup) ); } if (dirty & I810_UPLOAD_TEX0) { - memcpy(sarea->TexState[0], + memcpy(sarea->TexState[0], imesa->CurrentTexObj[0]->Setup, sizeof(imesa->CurrentTexObj[0]->Setup)); } @@ -347,7 +347,7 @@ static void emit_state( i810ContextPtr imesa ) sizeof(imesa->CurrentTexObj[1]->Setup)); /* Need this for the case where both units are bound to the same - * texobj. + * texobj. */ setup[I810_TEXREG_MI1] ^= (MI1_MAP_0 ^ MI1_MAP_1); setup[I810_TEXREG_MLC] ^= (MLC_MAP_0 ^ MLC_MAP_1); @@ -355,7 +355,7 @@ static void emit_state( i810ContextPtr imesa ) setup[I810_TEXREG_MCS] ^= (MCS_COORD_0 ^ MCS_COORD_1); setup[I810_TEXREG_MF] ^= (MF_MAP_0 ^ MF_MAP_1); } - + sarea->dirty = dirty; imesa->dirty = 0; } @@ -376,10 +376,10 @@ void i810FlushPrimsLocked( i810ContextPtr imesa ) I810SAREAPtr sarea = imesa->sarea; drmI810Vertex vertex; int i; - + if (I810_DEBUG & DEBUG_STATE) i810PrintDirty( __FUNCTION__, imesa->dirty ); - + if (imesa->dirty) emit_state( imesa ); @@ -391,23 +391,23 @@ void i810FlushPrimsLocked( i810ContextPtr imesa ) if (!nbox) { vertex.used = 0; } - else if (nbox > I810_NR_SAREA_CLIPRECTS) { + else if (nbox > I810_NR_SAREA_CLIPRECTS) { imesa->upload_cliprects = GL_TRUE; } - if (!nbox || !imesa->upload_cliprects) + if (!nbox || !imesa->upload_cliprects) { - if (nbox == 1) + if (nbox == 1) sarea->nbox = 0; else sarea->nbox = nbox; - vertex.discard = 1; + vertex.discard = 1; drmCommandWrite(imesa->driFd, DRM_I810_VERTEX, &vertex, sizeof(drmI810Vertex)); age_imesa(imesa, sarea->last_enqueue); - } - else + } + else { for (i = 0 ; i < nbox ; ) { @@ -416,7 +416,7 @@ void i810FlushPrimsLocked( i810ContextPtr imesa ) if (imesa->scissor) { sarea->nbox = 0; - + for ( ; i < nr ; i++) { b->x1 = pbox[i].x1 - imesa->drawX; b->y1 = pbox[i].y1 - imesa->drawY; @@ -444,10 +444,10 @@ void i810FlushPrimsLocked( i810ContextPtr imesa ) b->y2 = pbox[i].y2 - imesa->drawY; } } - + /* Finished with the buffer? */ - if (nr == nbox) + if (nr == nbox) vertex.discard = 1; drmCommandWrite(imesa->driFd, DRM_I810_VERTEX, @@ -471,8 +471,8 @@ void i810FlushPrimsGetBuffer( i810ContextPtr imesa ) { LOCK_HARDWARE(imesa); - if (imesa->vertex_buffer) - i810FlushPrimsLocked( imesa ); + if (imesa->vertex_buffer) + i810FlushPrimsLocked( imesa ); imesa->vertex_buffer = i810_get_buffer_ioctl( imesa ); imesa->vertex_high = imesa->vertex_buffer->total; @@ -483,7 +483,7 @@ void i810FlushPrimsGetBuffer( i810ContextPtr imesa ) } -void i810FlushPrims( i810ContextPtr imesa ) +void i810FlushPrims( i810ContextPtr imesa ) { if (imesa->vertex_buffer) { LOCK_HARDWARE( imesa ); @@ -505,7 +505,7 @@ static void i810Flush( struct gl_context *ctx ) I810_FIREVERTICES( imesa ); } -static void i810Finish( struct gl_context *ctx ) +static void i810Finish( struct gl_context *ctx ) { i810ContextPtr imesa = I810_CONTEXT( ctx ); i810DmaFinish( imesa ); diff --git a/src/mesa/drivers/dri/i810/i810ioctl.h b/src/mesa/drivers/dri/i810/i810ioctl.h index 926e38c..dc37f2a 100644 --- a/src/mesa/drivers/dri/i810/i810ioctl.h +++ b/src/mesa/drivers/dri/i810/i810ioctl.h @@ -5,7 +5,7 @@ #include "i810context.h" void i810EmitPrim( i810ContextPtr imesa ); -void i810FlushPrims( i810ContextPtr mmesa ); +void i810FlushPrims( i810ContextPtr mmesa ); void i810FlushPrimsLocked( i810ContextPtr mmesa ); void i810FlushPrimsGetBuffer( i810ContextPtr imesa ); @@ -35,7 +35,7 @@ do { \ static INLINE GLuint *i810AllocDmaLow( i810ContextPtr imesa, int bytes ) { - if (imesa->vertex_low + bytes > imesa->vertex_high) + if (imesa->vertex_low + bytes > imesa->vertex_high) i810FlushPrimsGetBuffer( imesa ); { diff --git a/src/mesa/drivers/dri/i810/i810render.c b/src/mesa/drivers/dri/i810/i810render.c index 45f0954..6421225 100644 --- a/src/mesa/drivers/dri/i810/i810render.c +++ b/src/mesa/drivers/dri/i810/i810render.c @@ -134,7 +134,7 @@ static GLboolean i810_run_render( struct gl_context *ctx, /* Don't handle clipping or indexed vertices. */ - if (imesa->RenderIndex != 0 || + if (imesa->RenderIndex != 0 || !i810_validate_render( ctx, VB )) { return GL_TRUE; } diff --git a/src/mesa/drivers/dri/i810/i810screen.c b/src/mesa/drivers/dri/i810/i810screen.c index fc56b61..5d83906 100644 --- a/src/mesa/drivers/dri/i810/i810screen.c +++ b/src/mesa/drivers/dri/i810/i810screen.c @@ -111,7 +111,7 @@ i810FillInModes( __DRIscreen *psp, return (const __DRIconfig **) configs; } - + /* static int i810_malloc_proxy_buf(drmBufMapPtr buffers) */ /* { */ /* char *buffer; */ diff --git a/src/mesa/drivers/dri/i810/i810span.c b/src/mesa/drivers/dri/i810/i810span.c index dddab8b..e964ca5 100644 --- a/src/mesa/drivers/dri/i810/i810span.c +++ b/src/mesa/drivers/dri/i810/i810span.c @@ -100,7 +100,7 @@ void i810InitSpanFuncs( struct gl_context *ctx ) { struct swrast_device_driver *swdd = _swrast_GetDeviceDriverReference(ctx); swdd->SpanRenderStart = i810SpanRenderStart; - swdd->SpanRenderFinish = i810SpanRenderFinish; + swdd->SpanRenderFinish = i810SpanRenderFinish; } diff --git a/src/mesa/drivers/dri/i810/i810state.c b/src/mesa/drivers/dri/i810/i810state.c index 7c3fbb1..795ff9a 100644 --- a/src/mesa/drivers/dri/i810/i810state.c +++ b/src/mesa/drivers/dri/i810/i810state.c @@ -76,7 +76,7 @@ static void i810BlendEquationSeparate(struct gl_context *ctx, assert( modeRGB == modeA ); /* Can only do GL_ADD equation in hardware */ - FALLBACK( I810_CONTEXT(ctx), I810_FALLBACK_BLEND_EQ, + FALLBACK( I810_CONTEXT(ctx), I810_FALLBACK_BLEND_EQ, modeRGB != GL_FUNC_ADD); /* BlendEquation sets ColorLogicOpEnabled in an unexpected @@ -287,7 +287,7 @@ void i810DrawBuffer(struct gl_context *ctx, GLenum mode ) { i810ContextPtr imesa = I810_CONTEXT(ctx); int front = 0; - + if (ctx->DrawBuffer->_NumColorDrawBuffers != 1) { /* GL_NONE or GL_FRONT_AND_BACK or stereo left&right, etc */ FALLBACK( imesa, I810_FALLBACK_DRAW_BUFFER, GL_TRUE ); @@ -306,9 +306,9 @@ void i810DrawBuffer(struct gl_context *ctx, GLenum mode ) return; } - if ( imesa->sarea->pf_current_page == 1 ) + if ( imesa->sarea->pf_current_page == 1 ) front ^= 1; - + FALLBACK( imesa, I810_FALLBACK_DRAW_BUFFER, GL_FALSE ); I810_FIREVERTICES(imesa); I810_STATECHANGE(imesa, I810_UPLOAD_BUFFERS); diff --git a/src/mesa/drivers/dri/i810/i810tex.c b/src/mesa/drivers/dri/i810/i810tex.c index 49364ae..1ee64bc 100644 --- a/src/mesa/drivers/dri/i810/i810tex.c +++ b/src/mesa/drivers/dri/i810/i810tex.c @@ -15,9 +15,9 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * KEITH WHITWELL, OR ANY OTHER CONTRIBUTORS BE LIABLE FOR ANY CLAIM, - * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR - * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE + * KEITH WHITWELL, OR ANY OTHER CONTRIBUTORS BE LIABLE FOR ANY CLAIM, + * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * */ @@ -94,8 +94,8 @@ static void i810SetTexWrapping(i810TextureObjectPtr tex, } -static void i810SetTexFilter(i810ContextPtr imesa, - i810TextureObjectPtr t, +static void i810SetTexFilter(i810ContextPtr imesa, + i810TextureObjectPtr t, GLenum minf, GLenum magf, GLfloat bias) { @@ -121,9 +121,9 @@ static void i810SetTexFilter(i810ContextPtr imesa, t->Setup[I810_TEXREG_MF] |= MF_MIN_LINEAR | MF_MIP_NEAREST; break; case GL_NEAREST_MIPMAP_LINEAR: - if (IS_I815(imesa)) + if (IS_I815(imesa)) t->Setup[I810_TEXREG_MF] |= MF_MIN_NEAREST | MF_MIP_LINEAR; - else + else t->Setup[I810_TEXREG_MF] |= MF_MIN_NEAREST | MF_MIP_DITHER; /* if (magf == GL_LINEAR) { @@ -135,7 +135,7 @@ static void i810SetTexFilter(i810ContextPtr imesa, case GL_LINEAR_MIPMAP_LINEAR: if (IS_I815(imesa)) t->Setup[I810_TEXREG_MF] |= MF_MIN_LINEAR | MF_MIP_LINEAR; - else + else t->Setup[I810_TEXREG_MF] |= MF_MIN_LINEAR | MF_MIP_DITHER; break; default: @@ -143,13 +143,13 @@ static void i810SetTexFilter(i810ContextPtr imesa, } switch (magf) { - case GL_NEAREST: - t->Setup[I810_TEXREG_MF] |= MF_MAG_NEAREST; + case GL_NEAREST: + t->Setup[I810_TEXREG_MF] |= MF_MAG_NEAREST; break; - case GL_LINEAR: - t->Setup[I810_TEXREG_MF] |= MF_MAG_LINEAR; + case GL_LINEAR: + t->Setup[I810_TEXREG_MF] |= MF_MAG_LINEAR; break; - default: + default: return; } @@ -179,9 +179,9 @@ i810AllocTexObj( struct gl_context *ctx, struct gl_texture_object *texObj ) */ t->base.tObj = texObj; t->Setup[I810_TEXREG_MI0] = GFX_OP_MAP_INFO; - t->Setup[I810_TEXREG_MI1] = MI1_MAP_0; + t->Setup[I810_TEXREG_MI1] = MI1_MAP_0; t->Setup[I810_TEXREG_MI2] = MI2_DIMENSIONS_ARE_LOG2; - t->Setup[I810_TEXREG_MLC] = (GFX_OP_MAP_LOD_CTL | + t->Setup[I810_TEXREG_MLC] = (GFX_OP_MAP_LOD_CTL | MLC_MAP_0 | /*MLC_DITHER_WEIGHT_FULL |*/ MLC_DITHER_WEIGHT_12 | @@ -201,7 +201,7 @@ i810AllocTexObj( struct gl_context *ctx, struct gl_texture_object *texObj ) MF_UPDATE_MIP_FILTER | MF_UPDATE_MAG_FILTER | MF_UPDATE_MIN_FILTER); - + make_empty_list( & t->base ); i810SetTexWrapping( t, texObj->WrapS, texObj->WrapT ); @@ -231,7 +231,7 @@ static void i810TexParameter( struct gl_context *ctx, GLenum target, * vertices or not. Setting imesa->new_state means that * i810UpdateTextureState() will be called before any triangles are * rendered. If a statechange has occurred, it will be detected at - * that point, and buffered vertices flushed. + * that point, and buffered vertices flushed. */ switch (pname) { case GL_TEXTURE_MIN_FILTER: @@ -246,7 +246,7 @@ static void i810TexParameter( struct gl_context *ctx, GLenum target, case GL_TEXTURE_WRAP_T: i810SetTexWrapping( t, tObj->WrapS, tObj->WrapT ); break; - + case GL_TEXTURE_BORDER_COLOR: i810SetTexBorderColor( t, tObj->BorderColor.f ); break; @@ -280,12 +280,12 @@ static void i810TexParameter( struct gl_context *ctx, GLenum target, /** * Setup hardware bits for new texture environment settings. - * + * * \todo * Determine whether or not \c param can be used instead of * \c texUnit->EnvColor in the \c GL_TEXTURE_ENV_COLOR case. */ -static void i810TexEnv( struct gl_context *ctx, GLenum target, +static void i810TexEnv( struct gl_context *ctx, GLenum target, GLenum pname, const GLfloat *param ) { i810ContextPtr imesa = I810_CONTEXT( ctx ); @@ -293,7 +293,7 @@ static void i810TexEnv( struct gl_context *ctx, GLenum target, const struct gl_texture_unit *texUnit = &ctx->Texture.Unit[unit]; /* Only one env color. Need a fallback if env colors are different - * and texture setup references env color in both units. + * and texture setup references env color in both units. */ switch (pname) { case GL_TEXTURE_ENV_COLOR: { @@ -328,7 +328,7 @@ static void i810TexEnv( struct gl_context *ctx, GLenum target, default: break; } -} +} @@ -336,7 +336,7 @@ static void i810TexEnv( struct gl_context *ctx, GLenum target, static void i810TexImage1D( struct gl_context *ctx, GLenum target, GLint level, GLint internalFormat, GLint width, GLint border, - GLenum format, GLenum type, + GLenum format, GLenum type, const GLvoid *pixels, const struct gl_pixelstore_attrib *pack, struct gl_texture_object *texObj, @@ -348,9 +348,9 @@ static void i810TexImage1D( struct gl_context *ctx, GLenum target, GLint level, } } -static void i810TexSubImage1D( struct gl_context *ctx, +static void i810TexSubImage1D( struct gl_context *ctx, GLenum target, - GLint level, + GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, @@ -388,9 +388,9 @@ static void i810TexImage2D( struct gl_context *ctx, GLenum target, GLint level, pixels, packing, texObj, texImage ); } -static void i810TexSubImage2D( struct gl_context *ctx, +static void i810TexSubImage2D( struct gl_context *ctx, GLenum target, - GLint level, + GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, @@ -404,7 +404,7 @@ static void i810TexSubImage2D( struct gl_context *ctx, I810_FIREVERTICES( I810_CONTEXT(ctx) ); driSwapOutTextureObject( t ); } - _mesa_store_texsubimage2d(ctx, target, level, xoffset, yoffset, width, + _mesa_store_texsubimage2d(ctx, target, level, xoffset, yoffset, width, height, format, type, pixels, packing, texObj, texImage); } @@ -432,7 +432,7 @@ static void i810DeleteTexture( struct gl_context *ctx, struct gl_texture_object /** * Choose a Mesa texture format to match the requested format. - * + * * The i810 only supports 5 texture modes that are useful to Mesa. That * makes this routine pretty simple. */ diff --git a/src/mesa/drivers/dri/i810/i810tex.h b/src/mesa/drivers/dri/i810/i810tex.h index b396848..8a51030 100644 --- a/src/mesa/drivers/dri/i810/i810tex.h +++ b/src/mesa/drivers/dri/i810/i810tex.h @@ -15,9 +15,9 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * KEITH WHITWELL, OR ANY OTHER CONTRIBUTORS BE LIABLE FOR ANY CLAIM, - * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR - * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE + * KEITH WHITWELL, OR ANY OTHER CONTRIBUTORS BE LIABLE FOR ANY CLAIM, + * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * * @@ -44,19 +44,19 @@ * * Non-local texture objects have a valid MemBlock to describe the * region managed by the other client, and can be identified by - * 't->globj == 0' + * 't->globj == 0' */ struct i810_texture_object_t { driTextureObject base; - + int Pitch; int Height; int texelBytes; char *BufAddr; - + GLuint max_level; - struct { + struct { const struct gl_texture_image *image; int offset; /* into BufAddr */ int height; @@ -66,7 +66,7 @@ struct i810_texture_object_t { GLuint Setup[I810_TEX_SETUP_SIZE]; GLuint dirty; -}; +}; void i810UpdateTextureState( struct gl_context *ctx ); void i810InitTextureFuncs( struct dd_function_table *functions ); diff --git a/src/mesa/drivers/dri/i810/i810texmem.c b/src/mesa/drivers/dri/i810/i810texmem.c index 6e6b21c..36cf8d6 100644 --- a/src/mesa/drivers/dri/i810/i810texmem.c +++ b/src/mesa/drivers/dri/i810/i810texmem.c @@ -42,12 +42,12 @@ void i810DestroyTexObj(i810ContextPtr imesa, i810TextureObjectPtr t) { /* See if it was the driver's current object. */ - if ( imesa != NULL ) { + if ( imesa != NULL ) { if (imesa->CurrentTexObj[0] == t) { imesa->CurrentTexObj[0] = 0; imesa->dirty &= ~I810_UPLOAD_TEX0; } - + if (imesa->CurrentTexObj[1] == t) { imesa->CurrentTexObj[1] = 0; imesa->dirty &= ~I810_UPLOAD_TEX1; @@ -100,7 +100,7 @@ static void i810UploadTexLevel( i810ContextPtr imesa, if (image->Width * texelBytes == t->Pitch) { GLubyte *dst = (GLubyte *)(t->BufAddr + t->image[hwlevel].offset); GLubyte *src = (GLubyte *)image->Data; - + memcpy( dst, src, t->Pitch * image->Height ); } else { @@ -147,29 +147,29 @@ int i810UploadTexImagesLocked( i810ContextPtr imesa, i810TextureObjectPtr t ) */ if (!t->base.memBlock) { int heap; - + heap = driAllocateTexture( imesa->texture_heaps, imesa->nr_heaps, (driTextureObject *) t); - + if ( heap == -1 ) { return -1; } - + assert(t->base.memBlock); ofs = t->base.memBlock->ofs; t->BufAddr = imesa->i810Screen->tex.map + ofs; t->Setup[I810_TEXREG_MI3] = imesa->i810Screen->textureOffset + ofs; - + if (t == imesa->CurrentTexObj[0]) I810_STATECHANGE(imesa, I810_UPLOAD_TEX0); - + if (t == imesa->CurrentTexObj[1]) I810_STATECHANGE(imesa, I810_UPLOAD_TEX1); - + /* i810UpdateTexLRU( imesa, t );*/ } driUpdateTextureLRU( (driTextureObject *) t ); - + if (imesa->texture_heaps[0]->timestamp >= GET_DISPATCH_AGE(imesa)) i810WaitAgeLocked( imesa, imesa->texture_heaps[0]->timestamp ); @@ -181,4 +181,4 @@ int i810UploadTexImagesLocked( i810ContextPtr imesa, i810TextureObjectPtr t ) t->base.dirty_images[0] = 0; return 0; -} +} diff --git a/src/mesa/drivers/dri/i810/i810texstate.c b/src/mesa/drivers/dri/i810/i810texstate.c index 5b505e7..377566d 100644 --- a/src/mesa/drivers/dri/i810/i810texstate.c +++ b/src/mesa/drivers/dri/i810/i810texstate.c @@ -15,9 +15,9 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * KEITH WHITWELL, OR ANY OTHER CONTRIBUTORS BE LIABLE FOR ANY CLAIM, - * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR - * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE + * KEITH WHITWELL, OR ANY OTHER CONTRIBUTORS BE LIABLE FOR ANY CLAIM, + * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * */ @@ -40,7 +40,7 @@ -static void i810SetTexImages( i810ContextPtr imesa, +static void i810SetTexImages( i810ContextPtr imesa, struct gl_texture_object *tObj ) { GLuint height, width, pitch, i, textureFormat, log_pitch; @@ -97,7 +97,7 @@ static void i810SetTexImages( i810ContextPtr imesa, width = tObj->Image[0][t->base.firstLevel]->Width * t->texelBytes; for (pitch = 32, log_pitch=2 ; pitch < width ; pitch *= 2 ) log_pitch++; - + /* All images must be loaded at this pitch. Count the number of * lines required: */ @@ -111,11 +111,11 @@ static void i810SetTexImages( i810ContextPtr imesa, t->Pitch = pitch; t->base.totalSize = height*pitch; t->max_level = i-1; - t->dirty = I810_UPLOAD_TEX0 | I810_UPLOAD_TEX1; - t->Setup[I810_TEXREG_MI1] = (MI1_MAP_0 | textureFormat | log_pitch); + t->dirty = I810_UPLOAD_TEX0 | I810_UPLOAD_TEX1; + t->Setup[I810_TEXREG_MI1] = (MI1_MAP_0 | textureFormat | log_pitch); t->Setup[I810_TEXREG_MLL] = (GFX_OP_MAP_LOD_LIMITS | MLL_MAP_0 | - MLL_UPDATE_MAX_MIP | + MLL_UPDATE_MAX_MIP | MLL_UPDATE_MIN_MIP | ((numLevels - 1) << MLL_MIN_MIP_SHIFT)); @@ -191,7 +191,7 @@ static const unsigned operand_modifiers[] = { * a reasonable place to make note of it. */ static GLboolean -i810UpdateTexEnvCombine( struct gl_context *ctx, GLuint unit, +i810UpdateTexEnvCombine( struct gl_context *ctx, GLuint unit, int * color_stage, int * alpha_stage ) { i810ContextPtr imesa = I810_CONTEXT(ctx); @@ -214,7 +214,7 @@ i810UpdateTexEnvCombine( struct gl_context *ctx, GLuint unit, return GL_TRUE; } - + if ((*color_stage >= 3) || (*alpha_stage >= 3)) { return GL_FALSE; } @@ -236,7 +236,7 @@ i810UpdateTexEnvCombine( struct gl_context *ctx, GLuint unit, color_arg[i] = MC_ARG_TEX1_COLOR; break; case GL_TEXTURE: - color_arg[i] = (unit == 0) + color_arg[i] = (unit == 0) ? MC_ARG_TEX0_COLOR : MC_ARG_TEX1_COLOR; break; case GL_CONSTANT: @@ -347,13 +347,13 @@ i810UpdateTexEnvCombine( struct gl_context *ctx, GLuint unit, * done in stage zero and writes to MC_DEST_ACCUMULATOR. The * (arg1*(1-arg2)) portion is done in stage 1, and the final stage is * (MC_ARG1_ACCUMULATOR | MC_ARG2_CURRENT_COLOR | MC_OP_ADD). - * + * * It can also be done without using the accumulator by rearranging * the equation as (arg1 + (arg2 * (arg0 - arg1))). Too bad the i810 * doesn't support the MODULATE_AND_ADD mode that the i830 supports. * If it did, the interpolate could be done in only two stages. */ - + if ( (color_arg[2] & MC_ARG_INVERT) != 0 ) { unsigned temp = color_arg[0]; @@ -412,7 +412,7 @@ i810UpdateTexEnvCombine( struct gl_context *ctx, GLuint unit, return GL_FALSE; } - + switch ( texUnit->_CurrentCombine->ModeA ) { case GL_REPLACE: alpha_combine = MA_OP_ARG1; @@ -514,7 +514,7 @@ i810UpdateTexEnvCombine( struct gl_context *ctx, GLuint unit, (*color_stage)++; } - + if ( Ashift != 0 ) { const unsigned alpha_scale = GFX_OP_MAP_ALPHA_STAGES | (*alpha_stage << MA_STAGE_SHIFT) @@ -553,7 +553,7 @@ static GLboolean enable_tex_common( struct gl_context *ctx, GLuint unit ) return GL_FALSE; } } - + /* Update state if this is a different texture object to last * time. */ @@ -561,11 +561,11 @@ static GLboolean enable_tex_common( struct gl_context *ctx, GLuint unit ) I810_STATECHANGE(imesa, (I810_UPLOAD_TEX0<CurrentTexObj[unit] = t; t->base.bound |= (1U << unit); - + /* XXX: should be locked */ driUpdateTextureLRU( (driTextureObject *) t ); } - + imesa->TexEnvImageFmt[unit] = tObj->Image[0][tObj->BaseLevel]->_BaseFormat; return GL_TRUE; } @@ -583,10 +583,10 @@ static GLboolean enable_tex_rect( struct gl_context *ctx, GLuint unit ) I810_STATECHANGE(imesa, (I810_UPLOAD_TEX0<Setup[I810_TEXREG_MCS] &= ~MCS_NORMALIZED_COORDS; - t->Setup[I810_TEXREG_MCS] |= MCS_UPDATE_NORMALIZED; + t->Setup[I810_TEXREG_MCS] |= MCS_UPDATE_NORMALIZED; t->Setup[I810_TEXREG_MI2] = (MI2_DIMENSIONS_ARE_EXACT | (Height << MI2_HEIGHT_SHIFT) | Width); - + return GL_TRUE; } @@ -603,10 +603,10 @@ static GLboolean enable_tex_2d( struct gl_context *ctx, GLuint unit ) log2Height = tObj->Image[0][t->base.firstLevel]->HeightLog2; I810_STATECHANGE(imesa, (I810_UPLOAD_TEX0<Setup[I810_TEXREG_MCS] |= MCS_NORMALIZED_COORDS | MCS_UPDATE_NORMALIZED; + t->Setup[I810_TEXREG_MCS] |= MCS_NORMALIZED_COORDS | MCS_UPDATE_NORMALIZED; t->Setup[I810_TEXREG_MI2] = (MI2_DIMENSIONS_ARE_LOG2 | (log2Height << MI2_HEIGHT_SHIFT) | log2Width); - + return GL_TRUE; } @@ -615,9 +615,9 @@ static void disable_tex( struct gl_context *ctx, GLuint unit ) i810ContextPtr imesa = I810_CONTEXT(ctx); imesa->CurrentTexObj[unit] = 0; - imesa->TexEnvImageFmt[unit] = 0; - imesa->dirty &= ~(I810_UPLOAD_TEX0<TexEnvImageFmt[unit] = 0; + imesa->dirty &= ~(I810_UPLOAD_TEX0<Texture.Unit[unit]; GLboolean ret; - + switch(texUnit->_ReallyEnabled) { case TEXTURE_2D_BIT: ret = enable_tex_common( ctx, unit); @@ -655,7 +655,7 @@ static void i810UpdateTexUnit( struct gl_context *ctx, GLuint unit, } - if (!i810UpdateTexEnvCombine( ctx, unit, + if (!i810UpdateTexEnvCombine( ctx, unit, next_color_stage, next_alpha_stage )) { FALLBACK( imesa, I810_FALLBACK_TEXTURE, GL_TRUE ); } diff --git a/src/mesa/drivers/dri/i810/i810tris.c b/src/mesa/drivers/dri/i810/i810tris.c index ec22a3d..6890321 100644 --- a/src/mesa/drivers/dri/i810/i810tris.c +++ b/src/mesa/drivers/dri/i810/i810tris.c @@ -491,7 +491,7 @@ static void i810RenderClippedPoly( struct gl_context *ctx, const GLuint *elts, { GLuint *tmp = VB->Elts; VB->Elts = (GLuint *)elts; - tnl->Driver.Render.PrimTabElts[GL_POLYGON]( ctx, 0, n, + tnl->Driver.Render.PrimTabElts[GL_POLYGON]( ctx, 0, n, PRIM_BEGIN|PRIM_END ); VB->Elts = tmp; } @@ -713,23 +713,23 @@ void i810RasterPrimitive( struct gl_context *ctx, if (I810_DEBUG & DEBUG_PRIMS) { /* Prints reduced prim, and hw prim */ char *prim_name = "Unknown"; - + switch(hwprim) { case PR_LINES: prim_name = "Lines"; break; case PR_LINESTRIP: prim_name = "LineStrip"; - break; + break; case PR_TRIANGLES: prim_name = "Triangles"; - break; + break; case PR_TRISTRIP_0: prim_name = "TriStrip_0"; - break; + break; case PR_TRIFAN: prim_name = "TriFan"; - break; + break; case PR_POLYGON: prim_name = "Polygons"; break; @@ -826,7 +826,7 @@ void i810Fallback( i810ContextPtr imesa, GLuint bit, GLboolean mode ) imesa->Fallback |= bit; if (oldfallback == 0) { I810_FIREVERTICES(imesa); - if (I810_DEBUG & DEBUG_FALLBACKS) + if (I810_DEBUG & DEBUG_FALLBACKS) fprintf(stderr, "ENTER FALLBACK %s\n", getFallbackString( bit )); _swsetup_Wakeup( ctx ); imesa->RenderIndex = ~0; @@ -836,7 +836,7 @@ void i810Fallback( i810ContextPtr imesa, GLuint bit, GLboolean mode ) imesa->Fallback &= ~bit; if (oldfallback == bit) { _swrast_flush( ctx ); - if (I810_DEBUG & DEBUG_FALLBACKS) + if (I810_DEBUG & DEBUG_FALLBACKS) fprintf(stderr, "LEAVE FALLBACK %s\n", getFallbackString( bit )); tnl->Driver.Render.Start = i810RenderStart; tnl->Driver.Render.PrimitiveNotify = i810RenderPrimitive; diff --git a/src/mesa/drivers/dri/i810/i810vb.c b/src/mesa/drivers/dri/i810/i810vb.c index 333e07c..c8086c4 100644 --- a/src/mesa/drivers/dri/i810/i810vb.c +++ b/src/mesa/drivers/dri/i810/i810vb.c @@ -22,7 +22,7 @@ * * */ - + #include "main/glheader.h" #include "main/mtypes.h" diff --git a/src/mesa/drivers/dri/i810/server/i810_dri.h b/src/mesa/drivers/dri/i810/server/i810_dri.h index 4a714f0..828f7ca 100644 --- a/src/mesa/drivers/dri/i810/server/i810_dri.h +++ b/src/mesa/drivers/dri/i810/server/i810_dri.h @@ -93,7 +93,7 @@ typedef struct { * kick out your own texture or someone else's - simply eject * them all in LRU order. */ - + drmTextureRegion texList[I810_NR_TEX_REGIONS + 1]; /* Last elt is sentinal */ diff --git a/src/mesa/drivers/dri/i810/server/i810_reg.h b/src/mesa/drivers/dri/i810/server/i810_reg.h index e7e5081..b33595d 100644 --- a/src/mesa/drivers/dri/i810/server/i810_reg.h +++ b/src/mesa/drivers/dri/i810/server/i810_reg.h @@ -30,8 +30,8 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * Keith Whitwell * * based on the i740 driver by - * Kevin E. Martin - * + * Kevin E. Martin + * * */ @@ -62,14 +62,14 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #define EXT_HORIZ_TOTAL 0x35 /* p261 */ #define EXT_HORIZ_BLANK 0x39 /* p261 */ #define EXT_START_ADDR 0x40 /* p262 */ -#define EXT_START_ADDR_ENABLE 0x80 +#define EXT_START_ADDR_ENABLE 0x80 #define EXT_OFFSET 0x41 /* p263 */ #define EXT_START_ADDR_HI 0x42 /* p263 */ #define INTERLACE_CNTL 0x70 /* p264 */ -#define INTERLACE_ENABLE 0x80 -#define INTERLACE_DISABLE 0x00 +#define INTERLACE_ENABLE 0x80 +#define INTERLACE_DISABLE 0x00 -/* Miscellaneous Output Register +/* Miscellaneous Output Register */ #define MSR_R 0x3CC /* p207 */ #define MSR_W 0x3C2 /* p207 */ @@ -103,7 +103,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #define COLEXP_RESERVED 0x30 #define BITBLT_STATUS 0x01 -/* p375. +/* p375. */ #define DISPLAY_CNTL 0x70008 #define VGA_WRAP_MODE 0x02 @@ -272,11 +272,11 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #define VCO_LOOP_DIV_BY_16M 0x04 -/* Instruction Parser Mode Register +/* Instruction Parser Mode Register * - p281 * - 2 new bits. */ -#define INST_PM 0x20c0 +#define INST_PM 0x20c0 #define AGP_SYNC_PACKET_FLUSH_ENABLE 0x20 /* reserved */ #define SYNC_PACKET_FLUSH_ENABLE 0x10 #define TWO_D_INST_DISABLE 0x08 @@ -305,7 +305,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #define ERROR_RESERVED 0xffc6 -/* Interrupt Control Registers +/* Interrupt Control Registers * - new bits for i810 * - new register hwstam (mask) */ @@ -338,7 +338,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. HOST_PORT_EVENT | \ CAPTURE_EVENT ) -/* FIFO Watermark and Burst Length Control Register +/* FIFO Watermark and Burst Length Control Register * * - different offset and contents on i810 (p299) (fewer bits per field) * - some overlay fields added @@ -445,7 +445,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #define I830_RING_START_MASK 0xFFFFF000 #define RING_LEN 0x0C -#define RING_NR_PAGES 0x000FF000 +#define RING_NR_PAGES 0x000FF000 #define I830_RING_NR_PAGES 0x001FF000 #define RING_REPORT_MASK 0x00000006 #define RING_REPORT_64K 0x00000002 @@ -530,7 +530,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. /* Registers in the i810 host-pci bridge pci config space which affect - * the i810 graphics operations. + * the i810 graphics operations. */ #define SMRAM_MISCC 0x70 #define GMS 0x000000c0 @@ -538,11 +538,11 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #define GMS_ENABLE_BARE 0x00000040 #define GMS_ENABLE_512K 0x00000080 #define GMS_ENABLE_1M 0x000000c0 -#define USMM 0x00000030 +#define USMM 0x00000030 #define USMM_DISABLE 0x00000000 #define USMM_TSEG_ZERO 0x00000010 #define USMM_TSEG_512K 0x00000020 -#define USMM_TSEG_1M 0x00000030 +#define USMM_TSEG_1M 0x00000030 #define GFX_MEM_WIN_SIZE 0x00010000 #define GFX_MEM_WIN_32M 0x00010000 #define GFX_MEM_WIN_64M 0x00000000 diff --git a/src/mesa/drivers/dri/i915/Makefile b/src/mesa/drivers/dri/i915/Makefile index 65fd658..8db77c7 100644 --- a/src/mesa/drivers/dri/i915/Makefile +++ b/src/mesa/drivers/dri/i915/Makefile @@ -54,7 +54,7 @@ C_SOURCES = \ $(COMMON_SOURCES) \ $(DRIVER_SOURCES) -ASM_SOURCES = +ASM_SOURCES = DRIVER_DEFINES = -I../intel -DI915 \ $(shell pkg-config libdrm --atleast-version=2.3.1 \ diff --git a/src/mesa/drivers/dri/i915/i830_context.c b/src/mesa/drivers/dri/i915/i830_context.c index abfb32b..01377cc 100644 --- a/src/mesa/drivers/dri/i915/i830_context.c +++ b/src/mesa/drivers/dri/i915/i830_context.c @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2003 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ #include "i830_context.h" diff --git a/src/mesa/drivers/dri/i915/i830_context.h b/src/mesa/drivers/dri/i915/i830_context.h index 4d568fc..90eb9b6 100644 --- a/src/mesa/drivers/dri/i915/i830_context.h +++ b/src/mesa/drivers/dri/i915/i830_context.h @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2003 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ #ifndef I830CONTEXT_INC diff --git a/src/mesa/drivers/dri/i915/i830_reg.h b/src/mesa/drivers/dri/i915/i830_reg.h index ae13170..c1c2658 100644 --- a/src/mesa/drivers/dri/i915/i830_reg.h +++ b/src/mesa/drivers/dri/i915/i830_reg.h @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2003 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ diff --git a/src/mesa/drivers/dri/i915/i830_state.c b/src/mesa/drivers/dri/i915/i830_state.c index 147192a..11f48d6 100644 --- a/src/mesa/drivers/dri/i915/i830_state.c +++ b/src/mesa/drivers/dri/i915/i830_state.c @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2003 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ @@ -77,7 +77,7 @@ i830StencilMaskSeparate(struct gl_context * ctx, GLenum face, GLuint mask) struct i830_context *i830 = i830_context(ctx); DBG("%s : mask 0x%x\n", __FUNCTION__, mask); - + mask = mask & 0xff; I830_STATECHANGE(i830, I830_UPLOAD_CTX); @@ -95,7 +95,7 @@ i830StencilOpSeparate(struct gl_context * ctx, GLenum face, GLenum fail, GLenum DBG("%s: fail : %s, zfail: %s, zpass : %s\n", __FUNCTION__, _mesa_lookup_enum_by_nr(fail), - _mesa_lookup_enum_by_nr(zfail), + _mesa_lookup_enum_by_nr(zfail), _mesa_lookup_enum_by_nr(zpass)); fop = 0; @@ -222,7 +222,7 @@ i830AlphaFunc(struct gl_context * ctx, GLenum func, GLfloat ref) * Blend, and Blending. It needs to be called from numerous places where we * could change the LogicOp or Independant Alpha Blend without subsequent * calls to glEnable. - * + * * \todo * This function is substantially different from the old i830-specific driver. * I'm not sure which is correct. @@ -261,7 +261,7 @@ i830BlendColor(struct gl_context * ctx, const GLfloat color[4]) GLubyte r, g, b, a; DBG("%s\n", __FUNCTION__); - + UNCLAMPED_FLOAT_TO_UBYTE(r, color[RCOMP]); UNCLAMPED_FLOAT_TO_UBYTE(g, color[GCOMP]); UNCLAMPED_FLOAT_TO_UBYTE(b, color[BCOMP]); @@ -423,7 +423,7 @@ i830DepthFunc(struct gl_context * ctx, GLenum func) int test = intel_translate_compare_func(func); DBG("%s\n", __FUNCTION__); - + I830_STATECHANGE(i830, I830_UPLOAD_CTX); i830->state.Ctx[I830_CTXREG_STATE3] &= ~DEPTH_TEST_FUNC_MASK; i830->state.Ctx[I830_CTXREG_STATE3] |= (ENABLE_DEPTH_TEST_FUNC | @@ -436,7 +436,7 @@ i830DepthMask(struct gl_context * ctx, GLboolean flag) struct i830_context *i830 = i830_context(ctx); DBG("%s flag (%d)\n", __FUNCTION__, flag); - + I830_STATECHANGE(i830, I830_UPLOAD_CTX); i830->state.Ctx[I830_CTXREG_ENABLES_2] &= ~ENABLE_DIS_DEPTH_WRITE_MASK; @@ -557,7 +557,7 @@ i830Scissor(struct gl_context * ctx, GLint x, GLint y, GLsizei w, GLsizei h) y1 = CLAMP(y1, 0, ctx->DrawBuffer->Height - 1); x2 = CLAMP(x2, 0, ctx->DrawBuffer->Width - 1); y2 = CLAMP(y2, 0, ctx->DrawBuffer->Height - 1); - + DBG("%s %d..%d,%d..%d (clamped)\n", __FUNCTION__, x1, x2, y1, y2); I830_STATECHANGE(i830, I830_UPLOAD_BUFFERS); @@ -572,7 +572,7 @@ i830LogicOp(struct gl_context * ctx, GLenum opcode) int tmp = intel_translate_logic_op(opcode); DBG("%s\n", __FUNCTION__); - + I830_STATECHANGE(i830, I830_UPLOAD_CTX); i830->state.Ctx[I830_CTXREG_STATE4] &= ~LOGICOP_MASK; i830->state.Ctx[I830_CTXREG_STATE4] |= LOGIC_OP_FUNC(tmp); @@ -587,7 +587,7 @@ i830CullFaceFrontFace(struct gl_context * ctx, GLenum unused) GLuint mode; DBG("%s\n", __FUNCTION__); - + if (!ctx->Polygon.CullFlag) { mode = CULLMODE_NONE; } @@ -616,7 +616,7 @@ i830LineWidth(struct gl_context * ctx, GLfloat widthf) int state5; DBG("%s\n", __FUNCTION__); - + width = (int) (widthf * 2); width = CLAMP(width, 1, 15); @@ -636,7 +636,7 @@ i830PointSize(struct gl_context * ctx, GLfloat size) GLint point_size = (int) size; DBG("%s\n", __FUNCTION__); - + point_size = CLAMP(point_size, 1, 256); I830_STATECHANGE(i830, I830_UPLOAD_CTX); i830->state.Ctx[I830_CTXREG_STATE5] &= ~FIXED_POINT_WIDTH_MASK; @@ -689,7 +689,7 @@ static void i830LightModelfv(struct gl_context * ctx, GLenum pname, const GLfloat * param) { DBG("%s\n", __FUNCTION__); - + if (pname == GL_LIGHT_MODEL_COLOR_CONTROL) { update_specular(ctx); } @@ -732,7 +732,7 @@ i830Fogfv(struct gl_context * ctx, GLenum pname, const GLfloat * param) struct i830_context *i830 = i830_context(ctx); DBG("%s\n", __FUNCTION__); - + if (pname == GL_FOG_COLOR) { GLuint color = (((GLubyte) (ctx->Fog.Color[0] * 255.0F) << 16) | ((GLubyte) (ctx->Fog.Color[1] * 255.0F) << 8) | diff --git a/src/mesa/drivers/dri/i915/i830_texblend.c b/src/mesa/drivers/dri/i915/i830_texblend.c index fec86c5..85ab529 100644 --- a/src/mesa/drivers/dri/i915/i830_texblend.c +++ b/src/mesa/drivers/dri/i915/i830_texblend.c @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2003 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ #include "main/glheader.h" @@ -122,7 +122,7 @@ GetTexelOp(GLint unit) * This function should return \c GLboolean. When \c GL_FALSE is returned, * it means that an environment is selected that the hardware cannot do. This * is the way the Radeon and R200 drivers work. - * + * * \todo * Looking at i830_3d_regs.h, it seems the i830 can do part of * GL_ATI_texture_env_combine3. It can handle using \c GL_ONE and @@ -268,7 +268,7 @@ i830SetTexEnvCombine(struct i830_context * i830, * match the spec. Can't use DOT3 as it won't propogate values * into alpha as required: * - * Note - the global factor is set up with alpha == .5, so + * Note - the global factor is set up with alpha == .5, so * the alpha part of the DOT4 calculation should be zero. */ if (combine->ModeRGB == GL_DOT3_RGBA_EXT || diff --git a/src/mesa/drivers/dri/i915/i830_texstate.c b/src/mesa/drivers/dri/i915/i830_texstate.c index b3bb883..231b579 100644 --- a/src/mesa/drivers/dri/i915/i830_texstate.c +++ b/src/mesa/drivers/dri/i915/i830_texstate.c @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2003 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ #include "main/mtypes.h" @@ -241,8 +241,8 @@ i830_update_tex_unit(struct intel_context *intel, GLuint unit, GLuint ss3) lodbias = -64; if (lodbias > 63) lodbias = 63; - - state[I830_TEXREG_TM0S3] = ((lodbias << TM0S3_LOD_BIAS_SHIFT) & + + state[I830_TEXREG_TM0S3] = ((lodbias << TM0S3_LOD_BIAS_SHIFT) & TM0S3_LOD_BIAS_MASK); #if 0 /* YUV conversion: @@ -323,7 +323,7 @@ i830UpdateTextureState(struct intel_context *intel) break; case 0:{ struct i830_context *i830 = i830_context(&intel->ctx); - if (i830->state.active & I830_UPLOAD_TEX(i)) + if (i830->state.active & I830_UPLOAD_TEX(i)) I830_ACTIVESTATE(i830, I830_UPLOAD_TEX(i), GL_FALSE); if (i830->state.tex_buffer[i] != NULL) { diff --git a/src/mesa/drivers/dri/i915/i830_vtbl.c b/src/mesa/drivers/dri/i915/i830_vtbl.c index 1621c95..6c85450 100644 --- a/src/mesa/drivers/dri/i915/i830_vtbl.c +++ b/src/mesa/drivers/dri/i915/i830_vtbl.c @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2003 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ #include "i830_context.h" @@ -229,7 +229,7 @@ i830_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 GLboolean i830_check_vertex_size(struct intel_context *intel, GLuint expected) @@ -522,7 +522,7 @@ i830_emit_state(struct intel_context *intel) OUT_BATCH(state->Buffer[I830_DESTREG_DRAWRECT5]); ADVANCE_BATCH(); } - + if (dirty & I830_UPLOAD_STIPPLE) { DBG("I830_UPLOAD_STIPPLE:\n"); emit(intel, state->Stipple, sizeof(state->Stipple)); @@ -699,7 +699,7 @@ i830_new_batch(struct intel_context *intel) i830->state.emitted = 0; } -static void +static void i830_assert_not_dirty( struct intel_context *intel ) { struct i830_context *i830 = i830_context(&intel->ctx); diff --git a/src/mesa/drivers/dri/i915/i915_context.c b/src/mesa/drivers/dri/i915/i915_context.c index 7389a1d..314b59d 100644 --- a/src/mesa/drivers/dri/i915/i915_context.c +++ b/src/mesa/drivers/dri/i915/i915_context.c @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2003 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ #include "i915_context.h" diff --git a/src/mesa/drivers/dri/i915/i915_context.h b/src/mesa/drivers/dri/i915/i915_context.h index 2c80ded..3cf8e74 100644 --- a/src/mesa/drivers/dri/i915/i915_context.h +++ b/src/mesa/drivers/dri/i915/i915_context.h @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2003 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ #ifndef I915CONTEXT_INC @@ -227,7 +227,7 @@ struct i915_hw_state GLuint Program[I915_PROGRAM_SIZE]; GLuint ProgramSize; - /* Region pointers for relocation: + /* Region pointers for relocation: */ struct intel_region *draw_region; struct intel_region *depth_region; diff --git a/src/mesa/drivers/dri/i915/i915_debug.c b/src/mesa/drivers/dri/i915/i915_debug.c index 4569fb9..fcf1753 100644 --- a/src/mesa/drivers/dri/i915/i915_debug.c +++ b/src/mesa/drivers/dri/i915/i915_debug.c @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2003 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ #include "main/imports.h" @@ -35,7 +35,7 @@ static GLboolean debug( struct debug_stream *stream, const char *name, GLuint le { GLuint i; GLuint *ptr = (GLuint *)(stream->ptr + stream->offset); - + if (len == 0) { printf("Error - zero length packet (0x%08x)\n", stream->ptr[0]); assert(0); @@ -48,11 +48,11 @@ static GLboolean debug( struct debug_stream *stream, const char *name, GLuint le printf("%s (%d dwords):\n", name, len); for (i = 0; i < len; i++) - printf("\t0x%08x\n", ptr[i]); + printf("\t0x%08x\n", ptr[i]); printf("\n"); stream->offset += len * sizeof(GLuint); - + return GL_TRUE; } @@ -76,33 +76,33 @@ static const char *get_prim_name( GLuint val ) } } -static GLboolean debug_prim( struct debug_stream *stream, const char *name, +static GLboolean debug_prim( struct debug_stream *stream, const char *name, GLboolean dump_floats, GLuint len ) { GLuint *ptr = (GLuint *)(stream->ptr + stream->offset); const char *prim = get_prim_name( ptr[0] ); GLuint i; - + printf("%s %s (%d dwords):\n", name, prim, len); - printf("\t0x%08x\n", ptr[0]); + printf("\t0x%08x\n", ptr[0]); for (i = 1; i < len; i++) { if (dump_floats) - printf("\t0x%08x // %f\n", ptr[i], *(GLfloat *)&ptr[i]); + printf("\t0x%08x // %f\n", ptr[i], *(GLfloat *)&ptr[i]); else - printf("\t0x%08x\n", ptr[i]); + printf("\t0x%08x\n", ptr[i]); } - + printf("\n"); stream->offset += len * sizeof(GLuint); - + return GL_TRUE; } - + @@ -138,12 +138,12 @@ static GLboolean debug_chain( struct debug_stream *stream, const char *name, GLu printf("\t0x%08x\n", ptr[i]); stream->offset = ptr[1] & ~0x3; - + if (stream->offset < old_offset) - printf("\n... skipping backwards from 0x%x --> 0x%x ...\n\n", + printf("\n... skipping backwards from 0x%x --> 0x%x ...\n\n", old_offset, stream->offset ); else - printf("\n... skipping from 0x%x --> 0x%x ...\n\n", + printf("\n... skipping from 0x%x --> 0x%x ...\n\n", old_offset, stream->offset ); @@ -205,7 +205,7 @@ static GLboolean debug_load_immediate( struct debug_stream *stream, GLuint *ptr = (GLuint *)(stream->ptr + stream->offset); GLuint bits = (ptr[0] >> 4) & 0xff; GLuint j = 0; - + printf("%s (%d dwords, flags: %x):\n", name, len, bits); printf("\t0x%08x\n", ptr[j++]); @@ -289,7 +289,7 @@ static GLboolean debug_load_immediate( struct debug_stream *stream, BITS(ptr[j], 7, 4, "blend dst factor"); FLAG(ptr[j], 3, "depth write enable"); FLAG(ptr[j], 2, "color write enable"); - BITS(ptr[j], 1, 0, "provoking vertex"); + BITS(ptr[j], 1, 0, "provoking vertex"); j++; } @@ -299,10 +299,10 @@ static GLboolean debug_load_immediate( struct debug_stream *stream, assert(j == len); stream->offset += len * sizeof(GLuint); - + return GL_TRUE; } - + static GLboolean debug_load_indirect( struct debug_stream *stream, @@ -312,7 +312,7 @@ static GLboolean debug_load_indirect( struct debug_stream *stream, GLuint *ptr = (GLuint *)(stream->ptr + stream->offset); GLuint bits = (ptr[0] >> 8) & 0x3f; GLuint i, j = 0; - + printf("%s (%d dwords):\n", name, len); printf("\t0x%08x\n", ptr[j++]); @@ -359,10 +359,10 @@ static GLboolean debug_load_indirect( struct debug_stream *stream, assert(j == len); stream->offset += len * sizeof(GLuint); - + return GL_TRUE; } - + static void BR13( struct debug_stream *stream, GLuint val ) { @@ -427,7 +427,7 @@ static void BR16( struct debug_stream *stream, { printf("\t0x%08x -- color\n", val); } - + static GLboolean debug_copy_blit( struct debug_stream *stream, const char *name, GLuint len ) @@ -437,7 +437,7 @@ static GLboolean debug_copy_blit( struct debug_stream *stream, printf("%s (%d dwords):\n", name, len); printf("\t0x%08x\n", ptr[j++]); - + BR13(stream, ptr[j++]); BR2223(stream, ptr[j], ptr[j+1]); j += 2; @@ -502,7 +502,7 @@ static GLboolean debug_map_state( struct debug_stream *stream, printf("%s (%d dwords):\n", name, len); printf("\t0x%08x\n", ptr[j++]); - + { printf("\t0x%08x\n", ptr[j]); BITS(ptr[j], 15, 0, "map mask"); @@ -554,7 +554,7 @@ static GLboolean debug_sampler_state( struct debug_stream *stream, printf("%s (%d dwords):\n", name, len); printf("\t0x%08x\n", ptr[j++]); - + { printf("\t0x%08x\n", ptr[j]); BITS(ptr[j], 15, 0, "sampler mask"); @@ -634,7 +634,7 @@ static GLboolean debug_dest_vars( struct debug_stream *stream, FLAG(ptr[j], 1, "vert line stride offset"); j++; } - + stream->offset += len * sizeof(GLuint); assert(j == len); return GL_TRUE; @@ -662,7 +662,7 @@ static GLboolean debug_buf_info( struct debug_stream *stream, MBZ (ptr[j], 2, 0); j++; } - + printf("\t0x%08x -- buffer base address\n", ptr[j++]); stream->offset += len * sizeof(GLuint); @@ -674,7 +674,7 @@ static GLboolean i915_debug_packet( struct debug_stream *stream ) { GLuint *ptr = (GLuint *)(stream->ptr + stream->offset); GLuint cmd = *ptr; - + switch (((cmd >> 29) & 0x7)) { case 0x0: switch ((cmd >> 23) & 0x3f) { @@ -698,7 +698,7 @@ static GLboolean i915_debug_packet( struct debug_stream *stream ) case 0x1: break; case 0x2: - switch ((cmd >> 22) & 0xff) { + switch ((cmd >> 22) & 0xff) { case 0x50: return debug_color_blit(stream, "XY_COLOR_BLT", (cmd & 0xff) + 2); case 0x53: @@ -708,7 +708,7 @@ static GLboolean i915_debug_packet( struct debug_stream *stream ) } break; case 0x3: - switch ((cmd >> 24) & 0x1f) { + switch ((cmd >> 24) & 0x1f) { case 0x6: return debug(stream, "3DSTATE_ANTI_ALIASING", 1); case 0x7: @@ -720,7 +720,7 @@ static GLboolean i915_debug_packet( struct debug_stream *stream ) case 0xb: return debug(stream, "3DSTATE_INDEPENDENT_ALPHA_BLEND", 1); case 0xc: - return debug(stream, "3DSTATE_MODES5", 1); + return debug(stream, "3DSTATE_MODES5", 1); case 0xd: return debug_modes4(stream, "3DSTATE_MODES4", 1); case 0x15: @@ -789,9 +789,9 @@ static GLboolean i915_debug_packet( struct debug_stream *stream ) return debug(stream, "", 1); break; case 0x1f: - if ((cmd & (1 << 23)) == 0) + if ((cmd & (1 << 23)) == 0) return debug_prim(stream, "3DPRIM (inline)", 1, (cmd & 0x1ffff) + 2); - else if (cmd & (1 << 17)) + else if (cmd & (1 << 17)) { if ((cmd & 0xffff) == 0) return debug_variable_length_prim(stream); @@ -799,7 +799,7 @@ static GLboolean i915_debug_packet( struct debug_stream *stream ) return debug_prim(stream, "3DPRIM (indexed)", 0, (((cmd & 0xffff) + 1) / 2) + 1); } else - return debug_prim(stream, "3DPRIM (indirect sequential)", 0, 2); + return debug_prim(stream, "3DPRIM (indirect sequential)", 0, 2); break; default: return debug(stream, "", 0); diff --git a/src/mesa/drivers/dri/i915/i915_debug.h b/src/mesa/drivers/dri/i915/i915_debug.h index 0643a8c..dae087a 100644 --- a/src/mesa/drivers/dri/i915/i915_debug.h +++ b/src/mesa/drivers/dri/i915/i915_debug.h @@ -1,5 +1,5 @@ /************************************************************************** - * + * * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas. * All Rights Reserved. * @@ -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. - * + * **************************************************************************/ /* Authors: Keith Whitwell @@ -33,7 +33,7 @@ struct i915_context; -struct debug_stream +struct debug_stream { unsigned offset; /* current gtt offset */ char *ptr; /* pointer to gtt offset zero */ diff --git a/src/mesa/drivers/dri/i915/i915_debug_fp.c b/src/mesa/drivers/dri/i915/i915_debug_fp.c index adfc9e8..c8f4cc9 100644 --- a/src/mesa/drivers/dri/i915/i915_debug_fp.c +++ b/src/mesa/drivers/dri/i915/i915_debug_fp.c @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2003 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ #include diff --git a/src/mesa/drivers/dri/i915/i915_fragprog.c b/src/mesa/drivers/dri/i915/i915_fragprog.c index 0e5dcdd..3a99125 100644 --- a/src/mesa/drivers/dri/i915/i915_fragprog.c +++ b/src/mesa/drivers/dri/i915/i915_fragprog.c @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2003 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ #include "main/glheader.h" @@ -299,8 +299,8 @@ do { \ #define EMIT_2ARG_ARITH( OP ) EMIT_ARITH( OP, 2 ) #define EMIT_3ARG_ARITH( OP ) EMIT_ARITH( OP, 3 ) -/* - * TODO: consider moving this into core +/* + * TODO: consider moving this into core */ static void calc_live_regs( struct i915_fragment_program *p ) { @@ -308,13 +308,13 @@ static void calc_live_regs( struct i915_fragment_program *p ) GLuint regsUsed = 0xffff0000; uint8_t live_components[16] = { 0, }; GLint i; - + for (i = program->Base.NumInstructions - 1; i >= 0; i--) { struct prog_instruction *inst = &program->Base.Instructions[i]; int opArgs = _mesa_num_inst_src_regs(inst->Opcode); int a; - /* Register is written to: unmark as live for this and preceeding ops */ + /* Register is written to: unmark as live for this and preceeding ops */ if (inst->DstReg.File == PROGRAM_TEMPORARY) { live_components[inst->DstReg.Index] &= ~inst->DstReg.WriteMask; if (live_components[inst->DstReg.Index] == 0) @@ -322,7 +322,7 @@ static void calc_live_regs( struct i915_fragment_program *p ) } for (a = 0; a < opArgs; a++) { - /* Register is read from: mark as live for this and preceeding ops */ + /* Register is read from: mark as live for this and preceeding ops */ if (inst->SrcReg[a].File == PROGRAM_TEMPORARY) { unsigned c; @@ -341,7 +341,7 @@ static void calc_live_regs( struct i915_fragment_program *p ) } } -static GLuint get_live_regs( struct i915_fragment_program *p, +static GLuint get_live_regs( struct i915_fragment_program *p, const struct prog_instruction *inst ) { const struct gl_fragment_program *program = p->ctx->FragmentProgram._Current; @@ -349,14 +349,14 @@ static GLuint get_live_regs( struct i915_fragment_program *p, return p->usedRegs[nr]; } - + /* Possible concerns: * * SIN, COS -- could use another taylor step? * LIT -- results seem a little different to sw mesa * LOG -- different to mesa on negative numbers, but this is conformant. - * + * * Parse failures -- Mesa doesn't currently give a good indication * internally whether a particular program string parsed or not. This * can lead to confusion -- hopefully we cope with it ok now. @@ -651,10 +651,10 @@ upload_program(struct i915_fragment_program *p) /* b*a + c*(1-a) * - * b*a + c - ca + * b*a + c - ca * - * tmp = b*a + c, - * result = (-c)*a + tmp + * tmp = b*a + c, + * result = (-c)*a + tmp */ i915_emit_arith(p, A0_MAD, tmp, flags & A0_DEST_CHANNEL_ALL, 0, src1, src0, src2); @@ -746,7 +746,7 @@ upload_program(struct i915_fragment_program *p) src0 = src_vector(p, &inst->SrcReg[0], program); tmp = i915_get_utemp(p); - /* + /* * t0.xy = MUL x.xx11, x.x1111 ; x^2, x, 1, 1 * t0 = MUL t0.xyxy t0.xx11 ; x^4, x^3, x^2, x * t1 = MUL t0.xyyw t0.yz11 ; x^7 x^5 x^3 x diff --git a/src/mesa/drivers/dri/i915/i915_program.c b/src/mesa/drivers/dri/i915/i915_program.c index ca1949b..750cb62 100644 --- a/src/mesa/drivers/dri/i915/i915_program.c +++ b/src/mesa/drivers/dri/i915/i915_program.c @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2003 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ #include @@ -203,7 +203,7 @@ i915_emit_arith(struct i915_fragment_program * p, return dest; } -static GLuint get_free_rreg (struct i915_fragment_program *p, +static GLuint get_free_rreg (struct i915_fragment_program *p, GLuint live_regs) { int bit = ffs(~live_regs); @@ -215,7 +215,7 @@ static GLuint get_free_rreg (struct i915_fragment_program *p, } GLuint i915_emit_texld( struct i915_fragment_program *p, - GLuint live_regs, + GLuint live_regs, GLuint dest, GLuint destmask, GLuint sampler, @@ -227,7 +227,7 @@ GLuint i915_emit_texld( struct i915_fragment_program *p, * a register we can MOV the swizzled TC to (since TEX doesn't support * swizzled sources) */ GLuint swizCoord = get_free_rreg(p, live_regs); - if (swizCoord == UREG_BAD) + if (swizCoord == UREG_BAD) return 0; i915_emit_arith( p, A0_MOV, swizCoord, A0_DEST_CHANNEL_ALL, 0, coord, 0, 0 ); @@ -256,8 +256,8 @@ GLuint i915_emit_texld( struct i915_fragment_program *p, (GET_UREG_TYPE(coord) != REG_TYPE_OD) && (GET_UREG_TYPE(coord) != REG_TYPE_T)) { GLuint tmpCoord = get_free_rreg(p, live_regs); - - if (tmpCoord == UREG_BAD) + + if (tmpCoord == UREG_BAD) return 0; i915_emit_arith(p, A0_MOV, tmpCoord, A0_DEST_CHANNEL_ALL, 0, coord, 0, 0); @@ -281,7 +281,7 @@ GLuint i915_emit_texld( struct i915_fragment_program *p, return UREG_BAD; } - *(p->csr++) = (op | + *(p->csr++) = (op | T0_DEST( dest ) | T0_SAMPLER( sampler )); diff --git a/src/mesa/drivers/dri/i915/i915_program.h b/src/mesa/drivers/dri/i915/i915_program.h index 20a1354..8a73526 100644 --- a/src/mesa/drivers/dri/i915/i915_program.h +++ b/src/mesa/drivers/dri/i915/i915_program.h @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2003 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ @@ -82,7 +82,7 @@ #define UREG_XYZW_CHANNEL_MASK 0x00ffff00 -/* One neat thing about the UREG representation: +/* One neat thing about the UREG representation: */ static INLINE int swizzle(int reg, int x, int y, int z, int w) @@ -94,7 +94,7 @@ swizzle(int reg, int x, int y, int z, int w) CHANNEL_SRC(GET_CHANNEL_SRC(reg, w), 3)); } -/* Another neat thing about the UREG representation: +/* Another neat thing about the UREG representation: */ static INLINE int negate(int reg, int x, int y, int z, int w) diff --git a/src/mesa/drivers/dri/i915/i915_reg.h b/src/mesa/drivers/dri/i915/i915_reg.h index 7f31ff6..ca56397 100644 --- a/src/mesa/drivers/dri/i915/i915_reg.h +++ b/src/mesa/drivers/dri/i915/i915_reg.h @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2003 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ @@ -98,7 +98,7 @@ /* 3DSTATE_CHROMA_KEY */ /* 3DSTATE_CLEAR_PARAMETERS, p150 */ -/* +/* * Sets the color, depth and stencil clear values used by the * CLEAR_RECT and ZONE_INIT primitive types, respectively. These * primitives set override most 3d state and only take a minimal x/y @@ -377,7 +377,7 @@ #define REG_TYPE_R 0 /* temporary regs, no need to * dcl, must be written before * read -- Preserved between - * phases. + * phases. */ #define REG_TYPE_T 1 /* Interpolated values, must be * dcl'ed before use. @@ -422,7 +422,7 @@ /* Arithmetic instructions */ /* .replicate_swizzle == selection and replication of a particular - * scalar channel, ie., .xxxx, .yyyy, .zzzz or .wwww + * scalar channel, ie., .xxxx, .yyyy, .zzzz or .wwww */ #define A0_NOP (0x0<<24) /* no operation */ #define A0_ADD (0x1<<24) /* dst = src0 + src1 */ @@ -523,11 +523,11 @@ #define T0_DEST_TYPE_SHIFT 19 /* Allow: R, OC, OD, U */ /* Note: U (unpreserved) regs do not retain their values between - * phases (cannot be used for feedback) + * phases (cannot be used for feedback) * * Note: oC and OD registers can only be used as the destination of a * texture instruction once per phase (this is an implementation - * restriction). + * restriction). */ #define T0_DEST_NR_SHIFT 14 /* Allow R: 0..15, OC,OD: 0..0, U: 0..2 */ @@ -564,9 +564,9 @@ #define D0_CHANNEL_XYZ (D0_CHANNEL_XY|D0_CHANNEL_Z) /* I915 Errata: Do not allow (xz), (xw), (xzw) combinations for diffuse - * or specular declarations. + * or specular declarations. * - * For T dcls, only allow: (x), (xy), (xyz), (w), (xyzw) + * For T dcls, only allow: (x), (xy), (xyz), (w), (xyzw) * * Must be zero for S (sampler) dcls */ diff --git a/src/mesa/drivers/dri/i915/i915_state.c b/src/mesa/drivers/dri/i915/i915_state.c index 9508fba..cceecac 100644 --- a/src/mesa/drivers/dri/i915/i915_state.c +++ b/src/mesa/drivers/dri/i915/i915_state.c @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2003 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ @@ -216,7 +216,7 @@ i915BlendColor(struct gl_context * ctx, const GLfloat color[4]) GLubyte r, g, b, a; DBG("%s\n", __FUNCTION__); - + UNCLAMPED_FLOAT_TO_UBYTE(r, color[RCOMP]); UNCLAMPED_FLOAT_TO_UBYTE(g, color[GCOMP]); UNCLAMPED_FLOAT_TO_UBYTE(b, color[BCOMP]); @@ -327,7 +327,7 @@ i915DepthFunc(struct gl_context * ctx, GLenum func) int test = intel_translate_compare_func(func); DBG("%s\n", __FUNCTION__); - + I915_STATECHANGE(i915, I915_UPLOAD_CTX); i915->state.Ctx[I915_CTXREG_LIS6] &= ~S6_DEPTH_TEST_FUNC_MASK; i915->state.Ctx[I915_CTXREG_LIS6] |= test << S6_DEPTH_TEST_FUNC_SHIFT; @@ -339,7 +339,7 @@ i915DepthMask(struct gl_context * ctx, GLboolean flag) struct i915_context *i915 = I915_CONTEXT(ctx); DBG("%s flag (%d)\n", __FUNCTION__, flag); - + I915_STATECHANGE(i915, I915_UPLOAD_CTX); if (flag && ctx->Depth.Test) @@ -500,12 +500,12 @@ i915Scissor(struct gl_context * ctx, GLint x, GLint y, GLsizei w, GLsizei h) y2 = y + h - 1; DBG("%s %d..%d,%d..%d (not inverted)\n", __FUNCTION__, x1, x2, y1, y2); } - + x1 = CLAMP(x1, 0, ctx->DrawBuffer->Width - 1); y1 = CLAMP(y1, 0, ctx->DrawBuffer->Height - 1); x2 = CLAMP(x2, 0, ctx->DrawBuffer->Width - 1); y2 = CLAMP(y2, 0, ctx->DrawBuffer->Height - 1); - + DBG("%s %d..%d,%d..%d (clamped)\n", __FUNCTION__, x1, x2, y1, y2); I915_STATECHANGE(i915, I915_UPLOAD_BUFFERS); @@ -520,7 +520,7 @@ i915LogicOp(struct gl_context * ctx, GLenum opcode) int tmp = intel_translate_logic_op(opcode); DBG("%s\n", __FUNCTION__); - + I915_STATECHANGE(i915, I915_UPLOAD_CTX); i915->state.Ctx[I915_CTXREG_STATE4] &= ~LOGICOP_MASK; i915->state.Ctx[I915_CTXREG_STATE4] |= LOGIC_OP_FUNC(tmp); @@ -567,7 +567,7 @@ i915LineWidth(struct gl_context * ctx, GLfloat widthf) int width; DBG("%s\n", __FUNCTION__); - + width = (int) (widthf * 2); width = CLAMP(width, 1, 0xf); lis4 |= width << S4_LINE_WIDTH_SHIFT; @@ -586,7 +586,7 @@ i915PointSize(struct gl_context * ctx, GLfloat size) GLint point_size = (int) round(size); DBG("%s\n", __FUNCTION__); - + point_size = CLAMP(point_size, 1, 255); lis4 |= point_size << S4_POINT_WIDTH_SHIFT; @@ -656,7 +656,7 @@ static void i915LightModelfv(struct gl_context * ctx, GLenum pname, const GLfloat * param) { DBG("%s\n", __FUNCTION__); - + if (pname == GL_LIGHT_MODEL_COLOR_CONTROL) { update_specular(ctx); } @@ -984,7 +984,7 @@ i915_init_packets(struct i915_context *i915) { I915_STATECHANGE(i915, I915_UPLOAD_CTX); - /* Probably don't want to upload all this stuff every time one + /* Probably don't want to upload all this stuff every time one * piece changes. */ i915->state.Ctx[I915_CTXREG_LI] = (_3DSTATE_LOAD_STATE_IMMEDIATE_1 | diff --git a/src/mesa/drivers/dri/i915/i915_tex_layout.c b/src/mesa/drivers/dri/i915/i915_tex_layout.c index 6e45121..1aa5da2 100644 --- a/src/mesa/drivers/dri/i915/i915_tex_layout.c +++ b/src/mesa/drivers/dri/i915/i915_tex_layout.c @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2006 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ /** @file i915_tex_layout.c diff --git a/src/mesa/drivers/dri/i915/i915_texstate.c b/src/mesa/drivers/dri/i915/i915_texstate.c index c724a21..c27eff3 100644 --- a/src/mesa/drivers/dri/i915/i915_texstate.c +++ b/src/mesa/drivers/dri/i915/i915_texstate.c @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2003 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ #include "main/mtypes.h" @@ -247,7 +247,7 @@ i915_update_tex_unit(struct intel_context *intel, GLuint unit, GLuint ss3) lodbias = -256; if (lodbias > 255) lodbias = 255; - state[I915_TEXREG_SS2] = ((lodbias << SS2_LOD_BIAS_SHIFT) & + state[I915_TEXREG_SS2] = ((lodbias << SS2_LOD_BIAS_SHIFT) & SS2_LOD_BIAS_MASK); /* YUV conversion: @@ -260,7 +260,7 @@ i915_update_tex_unit(struct intel_context *intel, GLuint unit, GLuint ss3) */ if (tObj->CompareMode == GL_COMPARE_R_TO_TEXTURE_ARB && tObj->Target != GL_TEXTURE_3D) { - if (tObj->Target == GL_TEXTURE_1D) + if (tObj->Target == GL_TEXTURE_1D) return GL_FALSE; state[I915_TEXREG_SS2] |= @@ -292,8 +292,8 @@ i915_update_tex_unit(struct intel_context *intel, GLuint unit, GLuint ss3) /* 3D textures don't seem to respect the border color. * Fallback if there's ever a danger that they might refer to - * it. - * + * it. + * * Effectively this means fallback on 3D clamp or * clamp_to_border. */ @@ -307,7 +307,7 @@ i915_update_tex_unit(struct intel_context *intel, GLuint unit, GLuint ss3) wt == GL_CLAMP_TO_BORDER || wr == GL_CLAMP_TO_BORDER)) return GL_FALSE; - /* Only support TEXCOORDMODE_CLAMP_EDGE and TEXCOORDMODE_CUBE (not + /* Only support TEXCOORDMODE_CLAMP_EDGE and TEXCOORDMODE_CUBE (not * used) when using cube map texture coordinates */ if (tObj->Target == GL_TEXTURE_CUBE_MAP_ARB && diff --git a/src/mesa/drivers/dri/i915/i915_vtbl.c b/src/mesa/drivers/dri/i915/i915_vtbl.c index 8d9020f..4dc41db 100644 --- a/src/mesa/drivers/dri/i915/i915_vtbl.c +++ b/src/mesa/drivers/dri/i915/i915_vtbl.c @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2003 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ @@ -91,7 +91,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 GLboolean i915_check_vertex_size(struct intel_context *intel, GLuint expected) @@ -336,7 +336,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! */ @@ -422,7 +422,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; @@ -664,7 +664,7 @@ i915_new_batch(struct intel_context *intel) i915->last_draw_offset = 0; } -static void +static void i915_assert_not_dirty( struct intel_context *intel ) { struct i915_context *i915 = i915_context(&intel->ctx); diff --git a/src/mesa/drivers/dri/i915/intel_render.c b/src/mesa/drivers/dri/i915/intel_render.c index 0d8ab4b..f070f83 100644 --- a/src/mesa/drivers/dri/i915/intel_render.c +++ b/src/mesa/drivers/dri/i915/intel_render.c @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2003 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ /* @@ -164,7 +164,7 @@ do { \ /* Render pipeline stage */ /**********************************************************************/ -/* Heuristic to choose between the two render paths: +/* Heuristic to choose between the two render paths: */ static GLboolean choose_render(struct intel_context *intel, struct vertex_buffer *VB) diff --git a/src/mesa/drivers/dri/i915/intel_tris.c b/src/mesa/drivers/dri/i915/intel_tris.c index b9a8aeb..30c2ea8 100644 --- a/src/mesa/drivers/dri/i915/intel_tris.c +++ b/src/mesa/drivers/dri/i915/intel_tris.c @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2003 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ /** @file intel_tris.c @@ -1054,7 +1054,7 @@ intelRunPipeline(struct gl_context * ctx) struct intel_context *intel = intel_context(ctx); _mesa_lock_context_textures(ctx); - + if (ctx->NewState) _mesa_update_state_locked(ctx); @@ -1126,7 +1126,7 @@ intelRasterPrimitive(struct gl_context * ctx, GLenum rprim, GLuint hwprim) } - /* + /* */ static void intelRenderPrimitive(struct gl_context * ctx, GLenum prim) diff --git a/src/mesa/drivers/dri/i915/intel_tris.h b/src/mesa/drivers/dri/i915/intel_tris.h index ad84de8..d0922f4 100644 --- a/src/mesa/drivers/dri/i915/intel_tris.h +++ b/src/mesa/drivers/dri/i915/intel_tris.h @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2003 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ #ifndef INTELTRIS_INC diff --git a/src/mesa/drivers/dri/i965/Makefile b/src/mesa/drivers/dri/i965/Makefile index 7c3ac0c..805c209 100644 --- a/src/mesa/drivers/dri/i965/Makefile +++ b/src/mesa/drivers/dri/i965/Makefile @@ -110,7 +110,7 @@ CXX_SOURCES = \ brw_fs_reg_allocate.cpp \ brw_fs_vector_splitting.cpp -ASM_SOURCES = +ASM_SOURCES = DRIVER_DEFINES = -I../intel diff --git a/src/mesa/drivers/dri/i965/brw_cc.c b/src/mesa/drivers/dri/i965/brw_cc.c index d3a1233..9f36649 100644 --- a/src/mesa/drivers/dri/i965/brw_cc.c +++ b/src/mesa/drivers/dri/i965/brw_cc.c @@ -2,7 +2,7 @@ Copyright (C) Intel Corp. 2006. All Rights Reserved. Intel funded Tungsten Graphics (http://www.tungstengraphics.com) to develop this 3D driver. - + 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, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - + The above copyright notice and this permission notice (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 NONINFRINGEMENT. @@ -22,7 +22,7 @@ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - + **********************************************************************/ /* * Authors: diff --git a/src/mesa/drivers/dri/i965/brw_clip.c b/src/mesa/drivers/dri/i965/brw_clip.c index 1be165c..ad0ef34 100644 --- a/src/mesa/drivers/dri/i965/brw_clip.c +++ b/src/mesa/drivers/dri/i965/brw_clip.c @@ -2,7 +2,7 @@ Copyright (C) Intel Corp. 2006. All Rights Reserved. Intel funded Tungsten Graphics (http://www.tungstengraphics.com) to develop this 3D driver. - + 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, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - + The above copyright notice and this permission notice (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 NONINFRINGEMENT. @@ -22,7 +22,7 @@ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - + **********************************************************************/ /* * Authors: @@ -58,7 +58,7 @@ static void compile_clip_prog( struct brw_context *brw, GLuint header_regs; memset(&c, 0, sizeof(c)); - + /* Begin the compilation: */ brw_init_compile(brw, &c.func); @@ -101,7 +101,7 @@ static void compile_clip_prog( struct brw_context *brw, c.prog_data.clip_mode = c.key.clip_mode; /* XXX */ /* For some reason the thread is spawned with only 4 channels - * unmasked. + * unmasked. */ brw_set_mask_control(&c.func, BRW_MASK_DISABLE); @@ -110,7 +110,7 @@ static void compile_clip_prog( struct brw_context *brw, * do all three: */ switch (key->primitive) { - case GL_TRIANGLES: + case GL_TRIANGLES: if (key->do_unfilled) brw_emit_unfilled_clip( &c ); else @@ -127,7 +127,7 @@ static void compile_clip_prog( struct brw_context *brw, return; } - + /* get the program */ @@ -195,8 +195,8 @@ static void upload_clip_prog(struct brw_context *brw) if (!ctx->Polygon.CullFlag || ctx->Polygon.CullFaceMode != GL_FRONT) { switch (ctx->Polygon.FrontMode) { - case GL_FILL: - fill_front = CLIP_FILL; + case GL_FILL: + fill_front = CLIP_FILL; offset_front = 0; break; case GL_LINE: @@ -213,8 +213,8 @@ static void upload_clip_prog(struct brw_context *brw) if (!ctx->Polygon.CullFlag || ctx->Polygon.CullFaceMode != GL_BACK) { switch (ctx->Polygon.BackMode) { - case GL_FILL: - fill_back = CLIP_FILL; + case GL_FILL: + fill_back = CLIP_FILL; offset_back = 0; break; case GL_LINE: @@ -250,7 +250,7 @@ static void upload_clip_prog(struct brw_context *brw) key.offset_ccw = offset_front; key.offset_cw = offset_back; if (ctx->Light.Model.TwoSide && - key.fill_cw != CLIP_CULL) + key.fill_cw != CLIP_CULL) key.copy_bfc_cw = 1; break; case GL_CW: @@ -259,7 +259,7 @@ static void upload_clip_prog(struct brw_context *brw) key.offset_cw = offset_front; key.offset_ccw = offset_back; if (ctx->Light.Model.TwoSide && - key.fill_ccw != CLIP_CULL) + key.fill_ccw != CLIP_CULL) key.copy_bfc_ccw = 1; break; } @@ -279,9 +279,9 @@ static void upload_clip_prog(struct brw_context *brw) const struct brw_tracked_state brw_clip_prog = { .dirty = { - .mesa = (_NEW_LIGHT | + .mesa = (_NEW_LIGHT | _NEW_TRANSFORM | - _NEW_POLYGON | + _NEW_POLYGON | _NEW_BUFFERS), .brw = (BRW_NEW_REDUCED_PRIMITIVE), .cache = CACHE_NEW_VS_PROG diff --git a/src/mesa/drivers/dri/i965/brw_clip.h b/src/mesa/drivers/dri/i965/brw_clip.h index 3a8cd7b..fed5ff3 100644 --- a/src/mesa/drivers/dri/i965/brw_clip.h +++ b/src/mesa/drivers/dri/i965/brw_clip.h @@ -2,7 +2,7 @@ Copyright (C) Intel Corp. 2006. All Rights Reserved. Intel funded Tungsten Graphics (http://www.tungstengraphics.com) to develop this 3D driver. - + 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, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - + The above copyright notice and this permission notice (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 NONINFRINGEMENT. @@ -22,7 +22,7 @@ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - + **********************************************************************/ /* * Authors: @@ -36,7 +36,7 @@ #include "brw_context.h" #include "brw_eu.h" -#define MAX_VERTS (3+6+6) +#define MAX_VERTS (3+6+6) /* Note that if unfilled primitives are being emitted, we have to fix * up polygon offset and flatshading at this point: @@ -74,7 +74,7 @@ struct brw_clip_compile { struct brw_compile func; struct brw_clip_prog_key key; struct brw_clip_prog_data prog_data; - + struct { struct brw_reg R0; struct brw_reg vertex[MAX_VERTS]; @@ -96,10 +96,10 @@ struct brw_clip_compile { struct brw_reg dir; struct brw_reg tmp0, tmp1; struct brw_reg offset; - + struct brw_reg fixed_planes; struct brw_reg plane_equation; - + struct brw_reg ff_sync; } reg; @@ -137,7 +137,7 @@ void brw_clip_tri_init_vertices( struct brw_clip_compile *c ); void brw_clip_tri_flat_shade( struct brw_clip_compile *c ); void brw_clip_tri( struct brw_clip_compile *c ); void brw_clip_tri_emit_polygon( struct brw_clip_compile *c ); -void brw_clip_tri_alloc_regs( struct brw_clip_compile *c, +void brw_clip_tri_alloc_regs( struct brw_clip_compile *c, GLuint nr_verts ); @@ -153,7 +153,7 @@ void brw_clip_interp_vertex( struct brw_clip_compile *c, void brw_clip_init_planes( struct brw_clip_compile *c ); -void brw_clip_emit_vue(struct brw_clip_compile *c, +void brw_clip_emit_vue(struct brw_clip_compile *c, struct brw_indirect vert, GLboolean allocate, GLboolean eot, diff --git a/src/mesa/drivers/dri/i965/brw_clip_line.c b/src/mesa/drivers/dri/i965/brw_clip_line.c index 4b9117b..380d9d2 100644 --- a/src/mesa/drivers/dri/i965/brw_clip_line.c +++ b/src/mesa/drivers/dri/i965/brw_clip_line.c @@ -2,7 +2,7 @@ Copyright (C) Intel Corp. 2006. All Rights Reserved. Intel funded Tungsten Graphics (http://www.tungstengraphics.com) to develop this 3D driver. - + 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, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - + The above copyright notice and this permission notice (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 NONINFRINGEMENT. @@ -22,7 +22,7 @@ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - + **********************************************************************/ /* * Authors: @@ -81,7 +81,7 @@ static void brw_clip_line_alloc_regs( struct brw_clip_compile *c ) i++; if (!c->key.nr_userclip) { - c->reg.fixed_planes = brw_vec8_grf(i, 0); + c->reg.fixed_planes = brw_vec8_grf(i, 0); i++; } @@ -113,7 +113,7 @@ static void brw_clip_line_alloc_regs( struct brw_clip_compile *c ) * GLfloat t = dp0 / (dp0 - dp1); * if (t > t0) t0 = t; * } - * + * * if (t0 + t1 >= 1.0) * return; * } @@ -145,7 +145,7 @@ static void clip_and_emit_line( struct brw_clip_compile *c ) brw_MOV(p, get_addr_reg(newvtx1), brw_address(c->reg.vertex[3])); brw_MOV(p, get_addr_reg(plane_ptr), brw_clip_plane0_address(c)); - /* Note: init t0, t1 together: + /* Note: init t0, t1 together: */ brw_MOV(p, vec2(c->reg.t0), brw_imm_f(0)); @@ -168,7 +168,7 @@ static void clip_and_emit_line( struct brw_clip_compile *c ) */ brw_set_conditionalmod(p, BRW_CONDITIONAL_NZ); brw_AND(p, v1_null_ud, c->reg.planemask, brw_imm_ud(1)); - + plane_active = brw_IF(p, BRW_EXECUTE_1); { if (c->key.nr_userclip) @@ -176,11 +176,11 @@ static void clip_and_emit_line( struct brw_clip_compile *c ) else brw_MOV(p, c->reg.plane_equation, deref_4b(plane_ptr, 0)); - /* dp = DP4(vtx->position, plane) + /* dp = DP4(vtx->position, plane) */ brw_DP4(p, vec4(c->reg.dp0), deref_4f(vtx0, c->offset[VERT_RESULT_HPOS]), c->reg.plane_equation); - /* if (IS_NEGATIVE(dp1)) + /* if (IS_NEGATIVE(dp1)) */ brw_set_conditionalmod(p, BRW_CONDITIONAL_L); brw_DP4(p, vec4(c->reg.dp1), deref_4f(vtx1, c->offset[VERT_RESULT_HPOS]), c->reg.plane_equation); @@ -206,7 +206,7 @@ static void clip_and_emit_line( struct brw_clip_compile *c ) brw_CMP(p, vec1(brw_null_reg()), BRW_CONDITIONAL_G, c->reg.t, c->reg.t1 ); brw_MOV(p, c->reg.t1, c->reg.t); brw_set_predicate_control(p, BRW_PREDICATE_NONE); - } + } is_negative = brw_ELSE(p, is_negative); { /* Coming back in. We know that both cannot be negative @@ -234,10 +234,10 @@ static void clip_and_emit_line( struct brw_clip_compile *c ) brw_ENDIF(p, is_neg2); } } - brw_ENDIF(p, is_negative); + brw_ENDIF(p, is_negative); } brw_ENDIF(p, plane_active); - + /* plane_ptr++; */ brw_ADD(p, get_addr_reg(plane_ptr), get_addr_reg(plane_ptr), brw_clip_plane_stride(c)); @@ -257,7 +257,7 @@ static void clip_and_emit_line( struct brw_clip_compile *c ) brw_clip_interp_vertex(c, newvtx1, vtx1, vtx0, c->reg.t1, GL_FALSE); brw_clip_emit_vue(c, newvtx0, 1, 0, (_3DPRIM_LINESTRIP << 2) | R02_PRIM_START); - brw_clip_emit_vue(c, newvtx1, 0, 1, (_3DPRIM_LINESTRIP << 2) | R02_PRIM_END); + brw_clip_emit_vue(c, newvtx1, 0, 1, (_3DPRIM_LINESTRIP << 2) | R02_PRIM_END); } brw_ENDIF(p, not_culled); brw_clip_kill_thread(c); @@ -276,6 +276,6 @@ void brw_emit_line_clip( struct brw_clip_compile *c ) else brw_clip_copy_colors(c, 0, 1); } - + clip_and_emit_line(c); } diff --git a/src/mesa/drivers/dri/i965/brw_clip_point.c b/src/mesa/drivers/dri/i965/brw_clip_point.c index b994a32..9b91887 100644 --- a/src/mesa/drivers/dri/i965/brw_clip_point.c +++ b/src/mesa/drivers/dri/i965/brw_clip_point.c @@ -2,7 +2,7 @@ Copyright (C) Intel Corp. 2006. All Rights Reserved. Intel funded Tungsten Graphics (http://www.tungstengraphics.com) to develop this 3D driver. - + 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, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - + The above copyright notice and this permission notice (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 NONINFRINGEMENT. @@ -22,7 +22,7 @@ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - + **********************************************************************/ /* * Authors: diff --git a/src/mesa/drivers/dri/i965/brw_clip_state.c b/src/mesa/drivers/dri/i965/brw_clip_state.c index 60fd5fa..50eabec 100644 --- a/src/mesa/drivers/dri/i965/brw_clip_state.c +++ b/src/mesa/drivers/dri/i965/brw_clip_state.c @@ -2,7 +2,7 @@ Copyright (C) Intel Corp. 2006. All Rights Reserved. Intel funded Tungsten Graphics (http://www.tungstengraphics.com) to develop this 3D driver. - + 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, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - + The above copyright notice and this permission notice (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 NONINFRINGEMENT. @@ -22,7 +22,7 @@ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - + **********************************************************************/ /* * Authors: @@ -101,12 +101,12 @@ clip_unit_create_from_key(struct brw_context *brw, * even number. */ assert(key->nr_urb_entries % 2 == 0); - + /* Although up to 16 concurrent Clip threads are allowed on Ironlake, * only 2 threads can output VUEs at a time. */ if (intel->gen == 5) - clip.thread4.max_threads = 16 - 1; + clip.thread4.max_threads = 16 - 1; else clip.thread4.max_threads = 2 - 1; } else { diff --git a/src/mesa/drivers/dri/i965/brw_clip_tri.c b/src/mesa/drivers/dri/i965/brw_clip_tri.c index cb58d1d..c9b1914 100644 --- a/src/mesa/drivers/dri/i965/brw_clip_tri.c +++ b/src/mesa/drivers/dri/i965/brw_clip_tri.c @@ -2,7 +2,7 @@ Copyright (C) Intel Corp. 2006. All Rights Reserved. Intel funded Tungsten Graphics (http://www.tungstengraphics.com) to develop this 3D driver. - + 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, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - + The above copyright notice and this permission notice (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 NONINFRINGEMENT. @@ -22,7 +22,7 @@ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - + **********************************************************************/ /* * Authors: @@ -47,7 +47,7 @@ static void release_tmps( struct brw_clip_compile *c ) } -void brw_clip_tri_alloc_regs( struct brw_clip_compile *c, +void brw_clip_tri_alloc_regs( struct brw_clip_compile *c, GLuint nr_verts ) { struct intel_context *intel = &c->func.brw->intel; @@ -103,7 +103,7 @@ void brw_clip_tri_alloc_regs( struct brw_clip_compile *c, i++; if (!c->key.nr_userclip) { - c->reg.fixed_planes = brw_vec8_grf(i, 0); + c->reg.fixed_planes = brw_vec8_grf(i, 0); i++; } @@ -138,10 +138,10 @@ void brw_clip_tri_init_vertices( struct brw_clip_compile *c ) /* Initial list of indices for incoming vertexes: */ - brw_AND(p, tmp0, get_element_ud(c->reg.R0, 2), brw_imm_ud(PRIM_MASK)); - brw_CMP(p, - vec1(brw_null_reg()), - BRW_CONDITIONAL_EQ, + brw_AND(p, tmp0, get_element_ud(c->reg.R0, 2), brw_imm_ud(PRIM_MASK)); + brw_CMP(p, + vec1(brw_null_reg()), + BRW_CONDITIONAL_EQ, tmp0, brw_imm_ud(_3DPRIM_TRISTRIP_REVERSE)); @@ -149,7 +149,7 @@ void brw_clip_tri_init_vertices( struct brw_clip_compile *c ) * second tristrip element: Can ignore sometimes? */ is_rev = brw_IF(p, BRW_EXECUTE_1); - { + { brw_MOV(p, get_element(c->reg.inlist, 0), brw_address(c->reg.vertex[1]) ); brw_MOV(p, get_element(c->reg.inlist, 1), brw_address(c->reg.vertex[0]) ); if (c->need_direction) @@ -177,10 +177,10 @@ void brw_clip_tri_flat_shade( struct brw_clip_compile *c ) struct brw_instruction *is_poly, *is_trifan; struct brw_reg tmp0 = c->reg.loopcount; /* handy temporary */ - brw_AND(p, tmp0, get_element_ud(c->reg.R0, 2), brw_imm_ud(PRIM_MASK)); - brw_CMP(p, - vec1(brw_null_reg()), - BRW_CONDITIONAL_EQ, + brw_AND(p, tmp0, get_element_ud(c->reg.R0, 2), brw_imm_ud(PRIM_MASK)); + brw_CMP(p, + vec1(brw_null_reg()), + BRW_CONDITIONAL_EQ, tmp0, brw_imm_ud(_3DPRIM_POLYGON)); @@ -236,7 +236,7 @@ void brw_clip_tri( struct brw_clip_compile *c ) struct brw_instruction *vertex_loop; struct brw_instruction *next_test; struct brw_instruction *prev_test; - + brw_MOV(p, get_addr_reg(vtxPrev), brw_address(c->reg.vertex[2]) ); brw_MOV(p, get_addr_reg(plane_ptr), brw_clip_plane0_address(c)); brw_MOV(p, get_addr_reg(inlist_ptr), brw_address(c->reg.inlist)); @@ -250,10 +250,10 @@ void brw_clip_tri( struct brw_clip_compile *c ) */ brw_set_conditionalmod(p, BRW_CONDITIONAL_NZ); brw_AND(p, vec1(brw_null_reg()), c->reg.planemask, brw_imm_ud(1)); - + plane_active = brw_IF(p, BRW_EXECUTE_1); { - /* vtxOut = freelist_ptr++ + /* vtxOut = freelist_ptr++ */ brw_MOV(p, get_addr_reg(vtxOut), get_addr_reg(freelist_ptr) ); brw_ADD(p, get_addr_reg(freelist_ptr), get_addr_reg(freelist_ptr), brw_imm_uw(c->nr_regs * REG_SIZE)); @@ -262,7 +262,7 @@ void brw_clip_tri( struct brw_clip_compile *c ) brw_MOV(p, c->reg.plane_equation, deref_4f(plane_ptr, 0)); else brw_MOV(p, c->reg.plane_equation, deref_4b(plane_ptr, 0)); - + brw_MOV(p, c->reg.loopcount, c->reg.nr_verts); brw_MOV(p, c->reg.nr_verts, brw_imm_ud(0)); @@ -299,7 +299,7 @@ void brw_clip_tri( struct brw_clip_compile *c ) brw_clip_interp_vertex(c, vtxOut, vtxPrev, vtx, c->reg.t, GL_FALSE); /* *outlist_ptr++ = vtxOut; - * nr_verts++; + * nr_verts++; * vtxOut = 0; */ brw_MOV(p, deref_1uw(outlist_ptr, 0), get_addr_reg(vtxOut)); @@ -308,7 +308,7 @@ void brw_clip_tri( struct brw_clip_compile *c ) brw_MOV(p, get_addr_reg(vtxOut), brw_imm_uw(0) ); } brw_ENDIF(p, next_test); - + } prev_test = brw_ELSE(p, prev_test); { @@ -338,21 +338,21 @@ void brw_clip_tri( struct brw_clip_compile *c ) brw_MOV(p, get_addr_reg(vtxOut), get_addr_reg(vtx) ); brw_set_predicate_control(p, BRW_PREDICATE_NONE); - brw_clip_interp_vertex(c, vtxOut, vtx, vtxPrev, c->reg.t, GL_TRUE); + brw_clip_interp_vertex(c, vtxOut, vtx, vtxPrev, c->reg.t, GL_TRUE); /* *outlist_ptr++ = vtxOut; - * nr_verts++; + * nr_verts++; * vtxOut = 0; */ brw_MOV(p, deref_1uw(outlist_ptr, 0), get_addr_reg(vtxOut)); brw_ADD(p, get_addr_reg(outlist_ptr), get_addr_reg(outlist_ptr), brw_imm_uw(sizeof(short))); brw_ADD(p, c->reg.nr_verts, c->reg.nr_verts, brw_imm_ud(1)); brw_MOV(p, get_addr_reg(vtxOut), brw_imm_uw(0) ); - } + } brw_ENDIF(p, next_test); } brw_ENDIF(p, prev_test); - + /* vtxPrev = vtx; * inlist_ptr++; */ @@ -363,7 +363,7 @@ void brw_clip_tri( struct brw_clip_compile *c ) */ brw_set_conditionalmod(p, BRW_CONDITIONAL_NZ); brw_ADD(p, c->reg.loopcount, c->reg.loopcount, brw_imm_d(-1)); - } + } brw_WHILE(p, vertex_loop); /* vtxPrev = *(outlist_ptr-1) OR: outlist[nr_verts-1] @@ -378,19 +378,19 @@ void brw_clip_tri( struct brw_clip_compile *c ) brw_MOV(p, get_addr_reg(outlist_ptr), brw_address(c->reg.outlist)); } brw_ENDIF(p, plane_active); - + /* plane_ptr++; */ brw_ADD(p, get_addr_reg(plane_ptr), get_addr_reg(plane_ptr), brw_clip_plane_stride(c)); - /* nr_verts >= 3 + /* nr_verts >= 3 */ brw_CMP(p, vec1(brw_null_reg()), BRW_CONDITIONAL_GE, c->reg.nr_verts, brw_imm_ud(3)); - + /* && (planemask>>=1) != 0 */ brw_set_conditionalmod(p, BRW_CONDITIONAL_NZ); @@ -423,14 +423,14 @@ void brw_clip_tri_emit_polygon(struct brw_clip_compile *c) brw_MOV(p, get_addr_reg(v0), deref_1uw(vptr, 0)); brw_clip_emit_vue(c, v0, 1, 0, ((_3DPRIM_TRIFAN << 2) | R02_PRIM_START)); - + brw_ADD(p, get_addr_reg(vptr), get_addr_reg(vptr), brw_imm_uw(2)); brw_MOV(p, get_addr_reg(v0), deref_1uw(vptr, 0)); loop = brw_DO(p, BRW_EXECUTE_1); { brw_clip_emit_vue(c, v0, 1, 0, (_3DPRIM_TRIFAN << 2)); - + brw_ADD(p, get_addr_reg(vptr), get_addr_reg(vptr), brw_imm_uw(2)); brw_MOV(p, get_addr_reg(v0), deref_1uw(vptr, 0)); @@ -494,11 +494,11 @@ static void brw_clip_test( struct brw_clip_compile *c ) /* test nearz, xmin, ymin plane */ /* clip.xyz < -clip.w */ - brw_CMP(p, t1, BRW_CONDITIONAL_L, v0, negate(get_element(v0, 3))); + brw_CMP(p, t1, BRW_CONDITIONAL_L, v0, negate(get_element(v0, 3))); brw_set_predicate_control(p, BRW_PREDICATE_NONE); - brw_CMP(p, t2, BRW_CONDITIONAL_L, v1, negate(get_element(v1, 3))); + brw_CMP(p, t2, BRW_CONDITIONAL_L, v1, negate(get_element(v1, 3))); brw_set_predicate_control(p, BRW_PREDICATE_NONE); - brw_CMP(p, t3, BRW_CONDITIONAL_L, v2, negate(get_element(v2, 3))); + brw_CMP(p, t3, BRW_CONDITIONAL_L, v2, negate(get_element(v2, 3))); brw_set_predicate_control(p, BRW_PREDICATE_NONE); /* All vertices are outside of a plane, rejected */ @@ -535,11 +535,11 @@ static void brw_clip_test( struct brw_clip_compile *c ) /* test farz, xmax, ymax plane */ /* clip.xyz > clip.w */ - brw_CMP(p, t1, BRW_CONDITIONAL_G, v0, get_element(v0, 3)); + brw_CMP(p, t1, BRW_CONDITIONAL_G, v0, get_element(v0, 3)); brw_set_predicate_control(p, BRW_PREDICATE_NONE); - brw_CMP(p, t2, BRW_CONDITIONAL_G, v1, get_element(v1, 3)); + brw_CMP(p, t2, BRW_CONDITIONAL_G, v1, get_element(v1, 3)); brw_set_predicate_control(p, BRW_PREDICATE_NONE); - brw_CMP(p, t3, BRW_CONDITIONAL_G, v2, get_element(v2, 3)); + brw_CMP(p, t3, BRW_CONDITIONAL_G, v2, get_element(v2, 3)); brw_set_predicate_control(p, BRW_PREDICATE_NONE); /* All vertices are outside of a plane, rejected */ @@ -588,13 +588,13 @@ void brw_emit_tri_clip( struct brw_clip_compile *c ) brw_clip_init_clipmask(c); brw_clip_init_ff_sync(c); - /* if -ve rhw workaround bit is set, + /* if -ve rhw workaround bit is set, do cliptest */ if (brw->has_negative_rhw_bug) { brw_set_conditionalmod(p, BRW_CONDITIONAL_NZ); - brw_AND(p, brw_null_reg(), get_element_ud(c->reg.R0, 2), + brw_AND(p, brw_null_reg(), get_element_ud(c->reg.R0, 2), brw_imm_ud(1<<20)); - neg_rhw = brw_IF(p, BRW_EXECUTE_1); + neg_rhw = brw_IF(p, BRW_EXECUTE_1); { brw_clip_test(c); } @@ -604,13 +604,13 @@ void brw_emit_tri_clip( struct brw_clip_compile *c ) * flatshading, need to apply the flatshade here because we don't * respect the PV when converting to trifan for emit: */ - if (c->key.do_flat_shading) - brw_clip_tri_flat_shade(c); - + if (c->key.do_flat_shading) + brw_clip_tri_flat_shade(c); + if ((c->key.clip_mode == BRW_CLIPMODE_NORMAL) || (c->key.clip_mode == BRW_CLIPMODE_KERNEL_CLIP)) do_clip_tri(c); - else + else maybe_do_clip_tri(c); brw_clip_tri_emit_polygon(c); diff --git a/src/mesa/drivers/dri/i965/brw_clip_unfilled.c b/src/mesa/drivers/dri/i965/brw_clip_unfilled.c index afd93f8..3b7edeb 100644 --- a/src/mesa/drivers/dri/i965/brw_clip_unfilled.c +++ b/src/mesa/drivers/dri/i965/brw_clip_unfilled.c @@ -2,7 +2,7 @@ Copyright (C) Intel Corp. 2006. All Rights Reserved. Intel funded Tungsten Graphics (http://www.tungstengraphics.com) to develop this 3D driver. - + 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, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - + The above copyright notice and this permission notice (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 NONINFRINGEMENT. @@ -22,7 +22,7 @@ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - + **********************************************************************/ /* * Authors: @@ -52,9 +52,9 @@ static void compute_tri_direction( struct brw_clip_compile *c ) struct brw_compile *p = &c->func; struct brw_reg e = c->reg.tmp0; struct brw_reg f = c->reg.tmp1; - struct brw_reg v0 = byte_offset(c->reg.vertex[0], c->offset[VERT_RESULT_HPOS]); - struct brw_reg v1 = byte_offset(c->reg.vertex[1], c->offset[VERT_RESULT_HPOS]); - struct brw_reg v2 = byte_offset(c->reg.vertex[2], c->offset[VERT_RESULT_HPOS]); + struct brw_reg v0 = byte_offset(c->reg.vertex[0], c->offset[VERT_RESULT_HPOS]); + struct brw_reg v1 = byte_offset(c->reg.vertex[1], c->offset[VERT_RESULT_HPOS]); + struct brw_reg v2 = byte_offset(c->reg.vertex[2], c->offset[VERT_RESULT_HPOS]); struct brw_reg v0n = get_tmp(c); @@ -79,8 +79,8 @@ static void compute_tri_direction( struct brw_clip_compile *c ) /* Calculate the vectors of two edges of the triangle: */ - brw_ADD(p, e, v0n, negate(v2n)); - brw_ADD(p, f, v1n, negate(v2n)); + brw_ADD(p, e, v0n, negate(v2n)); + brw_ADD(p, f, v1n, negate(v2n)); /* Take their crossproduct: */ @@ -112,7 +112,7 @@ static void cull_direction( struct brw_clip_compile *c ) conditional, get_element(c->reg.dir, 2), brw_imm_f(0)); - + ccw = brw_IF(p, BRW_EXECUTE_1); { brw_clip_kill_thread(c); @@ -128,7 +128,7 @@ static void copy_bfc( struct brw_clip_compile *c ) struct brw_instruction *ccw; GLuint conditional; - /* Do we have any colors to copy? + /* Do we have any colors to copy? */ if (!(c->offset[VERT_RESULT_COL0] && c->offset[VERT_RESULT_BFC0]) && !(c->offset[VERT_RESULT_COL1] && c->offset[VERT_RESULT_BFC1])) @@ -148,19 +148,19 @@ static void copy_bfc( struct brw_clip_compile *c ) conditional, get_element(c->reg.dir, 2), brw_imm_f(0)); - + ccw = brw_IF(p, BRW_EXECUTE_1); { GLuint i; for (i = 0; i < 3; i++) { if (c->offset[VERT_RESULT_COL0] && c->offset[VERT_RESULT_BFC0]) - brw_MOV(p, + brw_MOV(p, byte_offset(c->reg.vertex[i], c->offset[VERT_RESULT_COL0]), byte_offset(c->reg.vertex[i], c->offset[VERT_RESULT_BFC0])); if (c->offset[VERT_RESULT_COL1] && c->offset[VERT_RESULT_BFC1]) - brw_MOV(p, + brw_MOV(p, byte_offset(c->reg.vertex[i], c->offset[VERT_RESULT_COL1]), byte_offset(c->reg.vertex[i], c->offset[VERT_RESULT_BFC1])); } @@ -184,14 +184,14 @@ static void compute_offset( struct brw_clip_compile *c ) struct brw_compile *p = &c->func; struct brw_reg off = c->reg.offset; struct brw_reg dir = c->reg.dir; - + brw_math_invert(p, get_element(off, 2), get_element(dir, 2)); brw_MUL(p, vec2(off), dir, get_element(off, 2)); - brw_CMP(p, - vec1(brw_null_reg()), + brw_CMP(p, + vec1(brw_null_reg()), BRW_CONDITIONAL_GE, - brw_abs(get_element(off, 0)), + brw_abs(get_element(off, 0)), brw_abs(get_element(off, 1))); brw_SEL(p, vec1(off), brw_abs(get_element(off, 0)), brw_abs(get_element(off, 1))); @@ -208,10 +208,10 @@ static void merge_edgeflags( struct brw_clip_compile *c ) struct brw_instruction *is_poly; struct brw_reg tmp0 = get_element_ud(c->reg.tmp0, 0); - brw_AND(p, tmp0, get_element_ud(c->reg.R0, 2), brw_imm_ud(PRIM_MASK)); - brw_CMP(p, - vec1(brw_null_reg()), - BRW_CONDITIONAL_EQ, + brw_AND(p, tmp0, get_element_ud(c->reg.R0, 2), brw_imm_ud(PRIM_MASK)); + brw_CMP(p, + vec1(brw_null_reg()), + BRW_CONDITIONAL_EQ, tmp0, brw_imm_ud(_3DPRIM_POLYGON)); @@ -219,7 +219,7 @@ static void merge_edgeflags( struct brw_clip_compile *c ) * a _3DPRIM_TRISTRIP_REVERSE: */ is_poly = brw_IF(p, BRW_EXECUTE_1); - { + { brw_set_conditionalmod(p, BRW_CONDITIONAL_EQ); brw_AND(p, vec1(brw_null_reg()), get_element_ud(c->reg.R0, 2), brw_imm_ud(1<<8)); brw_MOV(p, byte_offset(c->reg.vertex[0], c->offset[VERT_RESULT_EDGE]), brw_imm_f(0)); @@ -271,9 +271,9 @@ static void emit_lines(struct brw_clip_compile *c, { brw_MOV(p, get_addr_reg(v0), deref_1uw(v0ptr, 0)); brw_ADD(p, get_addr_reg(v0ptr), get_addr_reg(v0ptr), brw_imm_uw(2)); - + apply_one_offset(c, v0); - + brw_set_conditionalmod(p, BRW_CONDITIONAL_G); brw_ADD(p, c->reg.loopcount, c->reg.loopcount, brw_imm_d(-1)); } @@ -296,8 +296,8 @@ static void emit_lines(struct brw_clip_compile *c, brw_ADD(p, get_addr_reg(v0ptr), get_addr_reg(v0ptr), brw_imm_uw(2)); /* draw edge if edgeflag != 0 */ - brw_CMP(p, - vec1(brw_null_reg()), BRW_CONDITIONAL_NZ, + brw_CMP(p, + vec1(brw_null_reg()), BRW_CONDITIONAL_NZ, deref_1f(v0, c->offset[VERT_RESULT_EDGE]), brw_imm_f(0)); draw_edge = brw_IF(p, BRW_EXECUTE_1); @@ -333,10 +333,10 @@ static void emit_points(struct brw_clip_compile *c, brw_MOV(p, get_addr_reg(v0), deref_1uw(v0ptr, 0)); brw_ADD(p, get_addr_reg(v0ptr), get_addr_reg(v0ptr), brw_imm_uw(2)); - /* draw if edgeflag != 0 + /* draw if edgeflag != 0 */ - brw_CMP(p, - vec1(brw_null_reg()), BRW_CONDITIONAL_NZ, + brw_CMP(p, + vec1(brw_null_reg()), BRW_CONDITIONAL_NZ, deref_1f(v0, c->offset[VERT_RESULT_EDGE]), brw_imm_f(0)); draw_point = brw_IF(p, BRW_EXECUTE_1); @@ -361,7 +361,7 @@ static void emit_points(struct brw_clip_compile *c, static void emit_primitives( struct brw_clip_compile *c, - GLuint mode, + GLuint mode, GLboolean do_offset ) { switch (mode) { @@ -381,7 +381,7 @@ static void emit_primitives( struct brw_clip_compile *c, assert(0); break; } -} +} @@ -401,7 +401,7 @@ static void emit_unfilled_primitives( struct brw_clip_compile *c ) BRW_CONDITIONAL_GE, get_element(c->reg.dir, 2), brw_imm_f(0)); - + ccw = brw_IF(p, BRW_EXECUTE_1); { emit_primitives(c, c->key.fill_ccw, c->key.offset_ccw); @@ -415,7 +415,7 @@ static void emit_unfilled_primitives( struct brw_clip_compile *c ) else if (c->key.fill_cw != CLIP_CULL) { emit_primitives(c, c->key.fill_cw, c->key.offset_cw); } - else if (c->key.fill_ccw != CLIP_CULL) { + else if (c->key.fill_ccw != CLIP_CULL) { emit_primitives(c, c->key.fill_ccw, c->key.offset_ccw); } } @@ -428,7 +428,7 @@ static void check_nr_verts( struct brw_clip_compile *c ) struct brw_compile *p = &c->func; struct brw_instruction *if_insn; - brw_CMP(p, vec1(brw_null_reg()), BRW_CONDITIONAL_L, c->reg.nr_verts, brw_imm_d(3)); + brw_CMP(p, vec1(brw_null_reg()), BRW_CONDITIONAL_L, c->reg.nr_verts, brw_imm_d(3)); if_insn = brw_IF(p, BRW_EXECUTE_1); { brw_clip_kill_thread(c); @@ -441,7 +441,7 @@ void brw_emit_unfilled_clip( struct brw_clip_compile *c ) { struct brw_compile *p = &c->func; struct brw_instruction *do_clip; - + c->need_direction = ((c->key.offset_ccw || c->key.offset_cw) || (c->key.fill_ccw != c->key.fill_cw) || @@ -464,11 +464,11 @@ void brw_emit_unfilled_clip( struct brw_clip_compile *c ) merge_edgeflags(c); - /* Need to use the inlist indirection here: + /* Need to use the inlist indirection here: */ - if (c->need_direction) + if (c->need_direction) compute_tri_direction(c); - + if (c->key.fill_ccw == CLIP_CULL || c->key.fill_cw == CLIP_CULL) cull_direction(c); @@ -485,7 +485,7 @@ void brw_emit_unfilled_clip( struct brw_clip_compile *c ) */ if (c->key.do_flat_shading) brw_clip_tri_flat_shade(c); - + brw_clip_init_clipmask(c); brw_CMP(p, vec1(brw_null_reg()), BRW_CONDITIONAL_NZ, c->reg.planemask, brw_imm_ud(0)); do_clip = brw_IF(p, BRW_EXECUTE_1); @@ -495,7 +495,7 @@ void brw_emit_unfilled_clip( struct brw_clip_compile *c ) check_nr_verts(c); } brw_ENDIF(p, do_clip); - + emit_unfilled_primitives(c); brw_clip_kill_thread(c); } diff --git a/src/mesa/drivers/dri/i965/brw_clip_util.c b/src/mesa/drivers/dri/i965/brw_clip_util.c index d2ac123..b7a2325 100644 --- a/src/mesa/drivers/dri/i965/brw_clip_util.c +++ b/src/mesa/drivers/dri/i965/brw_clip_util.c @@ -2,7 +2,7 @@ Copyright (C) Intel Corp. 2006. All Rights Reserved. Intel funded Tungsten Graphics (http://www.tungstengraphics.com) to develop this 3D driver. - + 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, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - + The above copyright notice and this permission notice (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 NONINFRINGEMENT. @@ -22,7 +22,7 @@ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - + **********************************************************************/ /* * Authors: @@ -92,7 +92,7 @@ void brw_clip_project_position(struct brw_clip_compile *c, struct brw_reg pos ) { struct brw_compile *p = &c->func; - /* calc rhw + /* calc rhw */ brw_math_invert(p, get_element(pos, W), get_element(pos, W)); @@ -104,7 +104,7 @@ void brw_clip_project_position(struct brw_clip_compile *c, struct brw_reg pos ) } -static void brw_clip_project_vertex( struct brw_clip_compile *c, +static void brw_clip_project_vertex( struct brw_clip_compile *c, struct brw_indirect vert_addr ) { struct brw_compile *p = &c->func; @@ -116,14 +116,14 @@ static void brw_clip_project_vertex( struct brw_clip_compile *c, brw_MOV(p, tmp, deref_4f(vert_addr, c->offset[VERT_RESULT_HPOS])); brw_clip_project_position(c, tmp); brw_MOV(p, deref_4f(vert_addr, c->header_position_offset), tmp); - + release_tmp(c, tmp); } -/* Interpolate between two vertices and put the result into a0.0. +/* Interpolate between two vertices and put the result into a0.0. * Increment a0.0 accordingly. */ void brw_clip_interp_vertex( struct brw_clip_compile *c, @@ -144,35 +144,35 @@ void brw_clip_interp_vertex( struct brw_clip_compile *c, * back on Ironlake, so needn't change it */ brw_copy_indirect_to_indirect(p, dest_ptr, v0_ptr, 1); - + /* Iterate over each attribute (could be done in pairs?) */ for (i = 0; i < c->nr_attrs; i++) { GLuint delta = c->offset[c->idx_to_attr[i]]; if (c->idx_to_attr[i] == VERT_RESULT_EDGE) { - if (force_edgeflag) + if (force_edgeflag) brw_MOV(p, deref_4f(dest_ptr, delta), brw_imm_f(1)); else brw_MOV(p, deref_4f(dest_ptr, delta), deref_4f(v0_ptr, delta)); } else { - /* Interpolate: + /* Interpolate: * * New = attr0 + t*attr1 - t*attr0 */ - brw_MUL(p, + brw_MUL(p, vec4(brw_null_reg()), deref_4f(v1_ptr, delta), t0); - brw_MAC(p, - tmp, + brw_MAC(p, + tmp, negate(deref_4f(v0_ptr, delta)), - t0); - + t0); + brw_ADD(p, - deref_4f(dest_ptr, delta), + deref_4f(dest_ptr, delta), deref_4f(v0_ptr, delta), tmp); } @@ -192,7 +192,7 @@ void brw_clip_interp_vertex( struct brw_clip_compile *c, brw_clip_project_vertex(c, dest_ptr ); } -void brw_clip_emit_vue(struct brw_clip_compile *c, +void brw_clip_emit_vue(struct brw_clip_compile *c, struct brw_indirect vert, GLboolean allocate, GLboolean eot, @@ -220,14 +220,14 @@ void brw_clip_emit_vue(struct brw_clip_compile *c, * entry. Each of these writes instantiates a seperate * urb entry - (I think... what about 'allocate'?) */ - brw_urb_WRITE(p, + brw_urb_WRITE(p, allocate ? c->reg.R0 : retype(brw_null_reg(), BRW_REGISTER_TYPE_UD), 0, c->reg.R0, allocate, 1, /* used */ c->nr_regs + 1, /* msg length */ - allocate ? 1 : 0, /* response_length */ + allocate ? 1 : 0, /* response_length */ eot, /* eot */ 1, /* writes_complete */ 0, /* urb offset */ @@ -244,7 +244,7 @@ void brw_clip_kill_thread(struct brw_clip_compile *c) /* Send an empty message to kill the thread and release any * allocated urb entry: */ - brw_urb_WRITE(p, + brw_urb_WRITE(p, retype(brw_null_reg(), BRW_REGISTER_TYPE_UD), 0, c->reg.R0, @@ -287,22 +287,22 @@ void brw_clip_copy_colors( struct brw_clip_compile *c, struct brw_compile *p = &c->func; if (c->offset[VERT_RESULT_COL0]) - brw_MOV(p, + brw_MOV(p, byte_offset(c->reg.vertex[to], c->offset[VERT_RESULT_COL0]), byte_offset(c->reg.vertex[from], c->offset[VERT_RESULT_COL0])); if (c->offset[VERT_RESULT_COL1]) - brw_MOV(p, + brw_MOV(p, byte_offset(c->reg.vertex[to], c->offset[VERT_RESULT_COL1]), byte_offset(c->reg.vertex[from], c->offset[VERT_RESULT_COL1])); if (c->offset[VERT_RESULT_BFC0]) - brw_MOV(p, + brw_MOV(p, byte_offset(c->reg.vertex[to], c->offset[VERT_RESULT_BFC0]), byte_offset(c->reg.vertex[from], c->offset[VERT_RESULT_BFC0])); if (c->offset[VERT_RESULT_BFC1]) - brw_MOV(p, + brw_MOV(p, byte_offset(c->reg.vertex[to], c->offset[VERT_RESULT_BFC1]), byte_offset(c->reg.vertex[from], c->offset[VERT_RESULT_BFC1])); } @@ -313,8 +313,8 @@ void brw_clip_init_clipmask( struct brw_clip_compile *c ) { struct brw_compile *p = &c->func; struct brw_reg incoming = get_element_ud(c->reg.R0, 2); - - /* Shift so that lowest outcode bit is rightmost: + + /* Shift so that lowest outcode bit is rightmost: */ brw_SHR(p, c->reg.planemask, incoming, brw_imm_ud(26)); @@ -327,7 +327,7 @@ void brw_clip_init_clipmask( struct brw_clip_compile *c ) brw_AND(p, tmp, incoming, brw_imm_ud(0x3f<<14)); brw_SHR(p, tmp, tmp, brw_imm_ud(8)); brw_OR(p, c->reg.planemask, c->reg.planemask, tmp); - + release_tmp(c, tmp); } } @@ -364,7 +364,7 @@ void brw_clip_init_ff_sync(struct brw_clip_compile *c) if (intel->needs_ff_sync) { struct brw_compile *p = &c->func; - + brw_MOV(p, c->reg.ff_sync, brw_imm_ud(0)); } } diff --git a/src/mesa/drivers/dri/i965/brw_context.c b/src/mesa/drivers/dri/i965/brw_context.c index 9483ec6..8c3319f 100644 --- a/src/mesa/drivers/dri/i965/brw_context.c +++ b/src/mesa/drivers/dri/i965/brw_context.c @@ -2,7 +2,7 @@ Copyright (C) Intel Corp. 2006. All Rights Reserved. Intel funded Tungsten Graphics (http://www.tungstengraphics.com) to develop this 3D driver. - + 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, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - + The above copyright notice and this permission notice (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 NONINFRINGEMENT. @@ -22,7 +22,7 @@ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - + **********************************************************************/ /* * Authors: @@ -103,7 +103,7 @@ GLboolean brwCreateContext( int api, ctx->Const.Max3DTextureLevels = 9; ctx->Const.MaxCubeTextureLevels = 12; ctx->Const.MaxTextureRectSize = (1<<12); - + ctx->Const.MaxTextureMaxAnisotropy = 16.0; /* if conformance mode is set, swrast can handle any size AA point */ diff --git a/src/mesa/drivers/dri/i965/brw_context.h b/src/mesa/drivers/dri/i965/brw_context.h index 7069724..705ac59 100644 --- a/src/mesa/drivers/dri/i965/brw_context.h +++ b/src/mesa/drivers/dri/i965/brw_context.h @@ -2,7 +2,7 @@ Copyright (C) Intel Corp. 2006. All Rights Reserved. Intel funded Tungsten Graphics (http://www.tungstengraphics.com) to develop this 3D driver. - + 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, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - + The above copyright notice and this permission notice (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 NONINFRINGEMENT. @@ -22,7 +22,7 @@ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - + **********************************************************************/ /* * Authors: @@ -50,7 +50,7 @@ * * VUE - vertex URB entry. An urb entry holding a vertex and usually * a vertex header. The header contains control information and - * things like primitive type, Begin/end flags and clip codes. + * things like primitive type, Begin/end flags and clip codes. * * PUE - primitive URB entry. An urb entry produced by the setup (SF) * unit holding rasterization and interpolation parameters. @@ -286,7 +286,7 @@ struct brw_vs_ouput_sizes { * to surface binding table indexes, for WM. */ #define SURF_INDEX_DRAW(d) (d) -#define SURF_INDEX_FRAG_CONST_BUFFER (BRW_MAX_DRAW_BUFFERS) +#define SURF_INDEX_FRAG_CONST_BUFFER (BRW_MAX_DRAW_BUFFERS) #define SURF_INDEX_TEXTURE(t) (BRW_MAX_DRAW_BUFFERS + 1 + (t)) /** @@ -342,7 +342,7 @@ struct brw_cache_item { drm_intel_bo *bo; struct brw_cache_item *next; -}; +}; @@ -400,7 +400,7 @@ struct brw_cached_batch_item { GLuint sz; struct brw_cached_batch_item *next; }; - + /* Protect against a future where VERT_ATTRIB_MAX > 32. Wouldn't life @@ -446,7 +446,7 @@ struct brw_query_object { /** * brw_context is derived from intel_context. */ -struct brw_context +struct brw_context { struct intel_context intel; /**< base class, must be first field */ GLuint primitive; @@ -523,7 +523,7 @@ struct brw_context unsigned int start_vertex_offset; } ib; - /* Active vertex program: + /* Active vertex program: */ const struct gl_vertex_program *vertex_program; const struct gl_fragment_program *fragment_program; @@ -570,8 +570,8 @@ struct brw_context GLuint size; /* Hardware URB size, in KB. */ } urb; - - /* BRW_NEW_CURBE_OFFSETS: + + /* BRW_NEW_CURBE_OFFSETS: */ struct { GLuint wm_start; /**< pos of first wm const in CURBE buffer */ @@ -616,7 +616,7 @@ struct brw_context uint32_t bind_bo_offset; drm_intel_bo *surf_bo[BRW_VS_MAX_SURF]; uint32_t surf_offset[BRW_VS_MAX_SURF]; - GLuint nr_surfaces; + GLuint nr_surfaces; } vs; struct { @@ -657,7 +657,7 @@ struct brw_context drm_intel_bo *sdc_bo[BRW_MAX_TEX_UNIT]; GLuint render_surf; - GLuint nr_surfaces; + GLuint nr_surfaces; GLuint max_threads; drm_intel_bo *scratch_bo; diff --git a/src/mesa/drivers/dri/i965/brw_curbe.c b/src/mesa/drivers/dri/i965/brw_curbe.c index 877b22f..0e866a2 100644 --- a/src/mesa/drivers/dri/i965/brw_curbe.c +++ b/src/mesa/drivers/dri/i965/brw_curbe.c @@ -2,7 +2,7 @@ Copyright (C) Intel Corp. 2006. All Rights Reserved. Intel funded Tungsten Graphics (http://www.tungstengraphics.com) to develop this 3D driver. - + 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, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - + The above copyright notice and this permission notice (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 NONINFRINGEMENT. @@ -22,7 +22,7 @@ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - + **********************************************************************/ /* * Authors: @@ -58,7 +58,7 @@ static void calculate_curbe_offsets( struct brw_context *brw ) struct gl_context *ctx = &brw->intel.ctx; /* CACHE_NEW_WM_PROG */ const GLuint nr_fp_regs = (brw->wm.prog_data->nr_params + 15) / 16; - + /* BRW_NEW_VERTEX_PROGRAM */ const GLuint nr_vp_regs = (brw->vs.prog_data->nr_params + 15) / 16; GLuint nr_clip_regs = 0; @@ -88,7 +88,7 @@ static void calculate_curbe_offsets( struct brw_context *brw ) * the fragment and vertex program * api's. It's not clear what happens * when both VP and FP want to use 128 - * parameters, though. + * parameters, though. */ assert(total_regs <= 32); @@ -102,7 +102,7 @@ static void calculate_curbe_offsets( struct brw_context *brw ) GLuint reg = 0; - /* Calculate a new layout: + /* Calculate a new layout: */ reg = 0; brw->curbe.wm_start = reg; @@ -256,7 +256,7 @@ static void prepare_constant_buffer(struct brw_context *brw) } if (0) { - for (i = 0; i < sz*16; i+=4) + for (i = 0; i < sz*16; i+=4) printf("curbe %d.%d: %f %f %f %f\n", i/8, i&4, buf[i+0], buf[i+1], buf[i+2], buf[i+3]); @@ -358,7 +358,7 @@ const struct brw_tracked_state brw_constant_buffer = { BRW_NEW_PSP | /* Implicit - hardware requires this, not used above */ BRW_NEW_CURBE_OFFSETS | BRW_NEW_BATCH), - .cache = (CACHE_NEW_WM_PROG) + .cache = (CACHE_NEW_WM_PROG) }, .prepare = prepare_constant_buffer, .emit = emit_constant_buffer, diff --git a/src/mesa/drivers/dri/i965/brw_defines.h b/src/mesa/drivers/dri/i965/brw_defines.h index b48a30d..579166d 100644 --- a/src/mesa/drivers/dri/i965/brw_defines.h +++ b/src/mesa/drivers/dri/i965/brw_defines.h @@ -2,7 +2,7 @@ Copyright (C) Intel Corp. 2006. All Rights Reserved. Intel funded Tungsten Graphics (http://www.tungstengraphics.com) to develop this 3D driver. - + 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, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - + The above copyright notice and this permission notice (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 NONINFRINGEMENT. @@ -22,13 +22,13 @@ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - + **********************************************************************/ /* * Authors: * Keith Whitwell */ - + #ifndef BRW_DEFINES_H #define BRW_DEFINES_H @@ -90,13 +90,13 @@ #define _3DPRIM_VERTEXBUFFER_ACCESS_SEQUENTIAL 0 #define _3DPRIM_VERTEXBUFFER_ACCESS_RANDOM 1 -#define BRW_ANISORATIO_2 0 -#define BRW_ANISORATIO_4 1 -#define BRW_ANISORATIO_6 2 -#define BRW_ANISORATIO_8 3 -#define BRW_ANISORATIO_10 4 -#define BRW_ANISORATIO_12 5 -#define BRW_ANISORATIO_14 6 +#define BRW_ANISORATIO_2 0 +#define BRW_ANISORATIO_4 1 +#define BRW_ANISORATIO_6 2 +#define BRW_ANISORATIO_8 3 +#define BRW_ANISORATIO_10 4 +#define BRW_ANISORATIO_12 5 +#define BRW_ANISORATIO_14 6 #define BRW_ANISORATIO_16 7 #define BRW_BLENDFACTOR_ONE 0x1 @@ -198,20 +198,20 @@ #define BRW_LOGICOPFUNCTION_COPY 12 #define BRW_LOGICOPFUNCTION_OR_REVERSE 13 #define BRW_LOGICOPFUNCTION_OR 14 -#define BRW_LOGICOPFUNCTION_SET 15 +#define BRW_LOGICOPFUNCTION_SET 15 -#define BRW_MAPFILTER_NEAREST 0x0 -#define BRW_MAPFILTER_LINEAR 0x1 +#define BRW_MAPFILTER_NEAREST 0x0 +#define BRW_MAPFILTER_LINEAR 0x1 #define BRW_MAPFILTER_ANISOTROPIC 0x2 -#define BRW_MIPFILTER_NONE 0 -#define BRW_MIPFILTER_NEAREST 1 +#define BRW_MIPFILTER_NONE 0 +#define BRW_MIPFILTER_NEAREST 1 #define BRW_MIPFILTER_LINEAR 3 #define BRW_POLYGON_FRONT_FACING 0 #define BRW_POLYGON_BACK_FACING 1 -#define BRW_PREFILTER_ALWAYS 0x0 +#define BRW_PREFILTER_ALWAYS 0x0 #define BRW_PREFILTER_NEVER 0x1 #define BRW_PREFILTER_LESS 0x2 #define BRW_PREFILTER_EQUAL 0x3 @@ -221,10 +221,10 @@ #define BRW_PREFILTER_GEQUAL 0x7 #define BRW_PROVOKING_VERTEX_0 0 -#define BRW_PROVOKING_VERTEX_1 1 +#define BRW_PROVOKING_VERTEX_1 1 #define BRW_PROVOKING_VERTEX_2 2 -#define BRW_RASTRULE_UPPER_LEFT 0 +#define BRW_RASTRULE_UPPER_LEFT 0 #define BRW_RASTRULE_UPPER_RIGHT 1 /* These are listed as "Reserved, but not seen as useful" * in Intel documentation (page 212, "Point Rasterization Rule", @@ -232,7 +232,7 @@ * "Intel® 965 Express Chipset Family and Intel® G35 Express * Chipset Graphics Controller Programmer's Reference Manual, * Volume 2: 3D/Media", Revision 1.0b as of January 2008, - * available at + * available at * http://intellinuxgraphics.org/documentation.html * at the time of this writing). * @@ -261,85 +261,85 @@ #define BRW_SURFACE_MIPMAPLAYOUT_BELOW 0 #define BRW_SURFACE_MIPMAPLAYOUT_RIGHT 1 -#define BRW_SURFACEFORMAT_R32G32B32A32_FLOAT 0x000 -#define BRW_SURFACEFORMAT_R32G32B32A32_SINT 0x001 -#define BRW_SURFACEFORMAT_R32G32B32A32_UINT 0x002 -#define BRW_SURFACEFORMAT_R32G32B32A32_UNORM 0x003 -#define BRW_SURFACEFORMAT_R32G32B32A32_SNORM 0x004 -#define BRW_SURFACEFORMAT_R64G64_FLOAT 0x005 -#define BRW_SURFACEFORMAT_R32G32B32X32_FLOAT 0x006 +#define BRW_SURFACEFORMAT_R32G32B32A32_FLOAT 0x000 +#define BRW_SURFACEFORMAT_R32G32B32A32_SINT 0x001 +#define BRW_SURFACEFORMAT_R32G32B32A32_UINT 0x002 +#define BRW_SURFACEFORMAT_R32G32B32A32_UNORM 0x003 +#define BRW_SURFACEFORMAT_R32G32B32A32_SNORM 0x004 +#define BRW_SURFACEFORMAT_R64G64_FLOAT 0x005 +#define BRW_SURFACEFORMAT_R32G32B32X32_FLOAT 0x006 #define BRW_SURFACEFORMAT_R32G32B32A32_SSCALED 0x007 #define BRW_SURFACEFORMAT_R32G32B32A32_USCALED 0x008 -#define BRW_SURFACEFORMAT_R32G32B32_FLOAT 0x040 -#define BRW_SURFACEFORMAT_R32G32B32_SINT 0x041 -#define BRW_SURFACEFORMAT_R32G32B32_UINT 0x042 -#define BRW_SURFACEFORMAT_R32G32B32_UNORM 0x043 -#define BRW_SURFACEFORMAT_R32G32B32_SNORM 0x044 -#define BRW_SURFACEFORMAT_R32G32B32_SSCALED 0x045 -#define BRW_SURFACEFORMAT_R32G32B32_USCALED 0x046 -#define BRW_SURFACEFORMAT_R16G16B16A16_UNORM 0x080 -#define BRW_SURFACEFORMAT_R16G16B16A16_SNORM 0x081 -#define BRW_SURFACEFORMAT_R16G16B16A16_SINT 0x082 -#define BRW_SURFACEFORMAT_R16G16B16A16_UINT 0x083 -#define BRW_SURFACEFORMAT_R16G16B16A16_FLOAT 0x084 -#define BRW_SURFACEFORMAT_R32G32_FLOAT 0x085 -#define BRW_SURFACEFORMAT_R32G32_SINT 0x086 -#define BRW_SURFACEFORMAT_R32G32_UINT 0x087 -#define BRW_SURFACEFORMAT_R32_FLOAT_X8X24_TYPELESS 0x088 -#define BRW_SURFACEFORMAT_X32_TYPELESS_G8X24_UINT 0x089 -#define BRW_SURFACEFORMAT_L32A32_FLOAT 0x08A -#define BRW_SURFACEFORMAT_R32G32_UNORM 0x08B -#define BRW_SURFACEFORMAT_R32G32_SNORM 0x08C -#define BRW_SURFACEFORMAT_R64_FLOAT 0x08D -#define BRW_SURFACEFORMAT_R16G16B16X16_UNORM 0x08E -#define BRW_SURFACEFORMAT_R16G16B16X16_FLOAT 0x08F -#define BRW_SURFACEFORMAT_A32X32_FLOAT 0x090 -#define BRW_SURFACEFORMAT_L32X32_FLOAT 0x091 -#define BRW_SURFACEFORMAT_I32X32_FLOAT 0x092 +#define BRW_SURFACEFORMAT_R32G32B32_FLOAT 0x040 +#define BRW_SURFACEFORMAT_R32G32B32_SINT 0x041 +#define BRW_SURFACEFORMAT_R32G32B32_UINT 0x042 +#define BRW_SURFACEFORMAT_R32G32B32_UNORM 0x043 +#define BRW_SURFACEFORMAT_R32G32B32_SNORM 0x044 +#define BRW_SURFACEFORMAT_R32G32B32_SSCALED 0x045 +#define BRW_SURFACEFORMAT_R32G32B32_USCALED 0x046 +#define BRW_SURFACEFORMAT_R16G16B16A16_UNORM 0x080 +#define BRW_SURFACEFORMAT_R16G16B16A16_SNORM 0x081 +#define BRW_SURFACEFORMAT_R16G16B16A16_SINT 0x082 +#define BRW_SURFACEFORMAT_R16G16B16A16_UINT 0x083 +#define BRW_SURFACEFORMAT_R16G16B16A16_FLOAT 0x084 +#define BRW_SURFACEFORMAT_R32G32_FLOAT 0x085 +#define BRW_SURFACEFORMAT_R32G32_SINT 0x086 +#define BRW_SURFACEFORMAT_R32G32_UINT 0x087 +#define BRW_SURFACEFORMAT_R32_FLOAT_X8X24_TYPELESS 0x088 +#define BRW_SURFACEFORMAT_X32_TYPELESS_G8X24_UINT 0x089 +#define BRW_SURFACEFORMAT_L32A32_FLOAT 0x08A +#define BRW_SURFACEFORMAT_R32G32_UNORM 0x08B +#define BRW_SURFACEFORMAT_R32G32_SNORM 0x08C +#define BRW_SURFACEFORMAT_R64_FLOAT 0x08D +#define BRW_SURFACEFORMAT_R16G16B16X16_UNORM 0x08E +#define BRW_SURFACEFORMAT_R16G16B16X16_FLOAT 0x08F +#define BRW_SURFACEFORMAT_A32X32_FLOAT 0x090 +#define BRW_SURFACEFORMAT_L32X32_FLOAT 0x091 +#define BRW_SURFACEFORMAT_I32X32_FLOAT 0x092 #define BRW_SURFACEFORMAT_R16G16B16A16_SSCALED 0x093 #define BRW_SURFACEFORMAT_R16G16B16A16_USCALED 0x094 #define BRW_SURFACEFORMAT_R32G32_SSCALED 0x095 #define BRW_SURFACEFORMAT_R32G32_USCALED 0x096 -#define BRW_SURFACEFORMAT_B8G8R8A8_UNORM 0x0C0 -#define BRW_SURFACEFORMAT_B8G8R8A8_UNORM_SRGB 0x0C1 -#define BRW_SURFACEFORMAT_R10G10B10A2_UNORM 0x0C2 -#define BRW_SURFACEFORMAT_R10G10B10A2_UNORM_SRGB 0x0C3 -#define BRW_SURFACEFORMAT_R10G10B10A2_UINT 0x0C4 -#define BRW_SURFACEFORMAT_R10G10B10_SNORM_A2_UNORM 0x0C5 -#define BRW_SURFACEFORMAT_R8G8B8A8_UNORM 0x0C7 -#define BRW_SURFACEFORMAT_R8G8B8A8_UNORM_SRGB 0x0C8 -#define BRW_SURFACEFORMAT_R8G8B8A8_SNORM 0x0C9 -#define BRW_SURFACEFORMAT_R8G8B8A8_SINT 0x0CA -#define BRW_SURFACEFORMAT_R8G8B8A8_UINT 0x0CB -#define BRW_SURFACEFORMAT_R16G16_UNORM 0x0CC -#define BRW_SURFACEFORMAT_R16G16_SNORM 0x0CD -#define BRW_SURFACEFORMAT_R16G16_SINT 0x0CE -#define BRW_SURFACEFORMAT_R16G16_UINT 0x0CF -#define BRW_SURFACEFORMAT_R16G16_FLOAT 0x0D0 -#define BRW_SURFACEFORMAT_B10G10R10A2_UNORM 0x0D1 -#define BRW_SURFACEFORMAT_B10G10R10A2_UNORM_SRGB 0x0D2 -#define BRW_SURFACEFORMAT_R11G11B10_FLOAT 0x0D3 -#define BRW_SURFACEFORMAT_R32_SINT 0x0D6 -#define BRW_SURFACEFORMAT_R32_UINT 0x0D7 -#define BRW_SURFACEFORMAT_R32_FLOAT 0x0D8 -#define BRW_SURFACEFORMAT_R24_UNORM_X8_TYPELESS 0x0D9 -#define BRW_SURFACEFORMAT_X24_TYPELESS_G8_UINT 0x0DA -#define BRW_SURFACEFORMAT_L16A16_UNORM 0x0DF -#define BRW_SURFACEFORMAT_I24X8_UNORM 0x0E0 -#define BRW_SURFACEFORMAT_L24X8_UNORM 0x0E1 -#define BRW_SURFACEFORMAT_A24X8_UNORM 0x0E2 -#define BRW_SURFACEFORMAT_I32_FLOAT 0x0E3 -#define BRW_SURFACEFORMAT_L32_FLOAT 0x0E4 -#define BRW_SURFACEFORMAT_A32_FLOAT 0x0E5 -#define BRW_SURFACEFORMAT_B8G8R8X8_UNORM 0x0E9 -#define BRW_SURFACEFORMAT_B8G8R8X8_UNORM_SRGB 0x0EA -#define BRW_SURFACEFORMAT_R8G8B8X8_UNORM 0x0EB -#define BRW_SURFACEFORMAT_R8G8B8X8_UNORM_SRGB 0x0EC -#define BRW_SURFACEFORMAT_R9G9B9E5_SHAREDEXP 0x0ED -#define BRW_SURFACEFORMAT_B10G10R10X2_UNORM 0x0EE -#define BRW_SURFACEFORMAT_L16A16_FLOAT 0x0F0 -#define BRW_SURFACEFORMAT_R32_UNORM 0x0F1 -#define BRW_SURFACEFORMAT_R32_SNORM 0x0F2 +#define BRW_SURFACEFORMAT_B8G8R8A8_UNORM 0x0C0 +#define BRW_SURFACEFORMAT_B8G8R8A8_UNORM_SRGB 0x0C1 +#define BRW_SURFACEFORMAT_R10G10B10A2_UNORM 0x0C2 +#define BRW_SURFACEFORMAT_R10G10B10A2_UNORM_SRGB 0x0C3 +#define BRW_SURFACEFORMAT_R10G10B10A2_UINT 0x0C4 +#define BRW_SURFACEFORMAT_R10G10B10_SNORM_A2_UNORM 0x0C5 +#define BRW_SURFACEFORMAT_R8G8B8A8_UNORM 0x0C7 +#define BRW_SURFACEFORMAT_R8G8B8A8_UNORM_SRGB 0x0C8 +#define BRW_SURFACEFORMAT_R8G8B8A8_SNORM 0x0C9 +#define BRW_SURFACEFORMAT_R8G8B8A8_SINT 0x0CA +#define BRW_SURFACEFORMAT_R8G8B8A8_UINT 0x0CB +#define BRW_SURFACEFORMAT_R16G16_UNORM 0x0CC +#define BRW_SURFACEFORMAT_R16G16_SNORM 0x0CD +#define BRW_SURFACEFORMAT_R16G16_SINT 0x0CE +#define BRW_SURFACEFORMAT_R16G16_UINT 0x0CF +#define BRW_SURFACEFORMAT_R16G16_FLOAT 0x0D0 +#define BRW_SURFACEFORMAT_B10G10R10A2_UNORM 0x0D1 +#define BRW_SURFACEFORMAT_B10G10R10A2_UNORM_SRGB 0x0D2 +#define BRW_SURFACEFORMAT_R11G11B10_FLOAT 0x0D3 +#define BRW_SURFACEFORMAT_R32_SINT 0x0D6 +#define BRW_SURFACEFORMAT_R32_UINT 0x0D7 +#define BRW_SURFACEFORMAT_R32_FLOAT 0x0D8 +#define BRW_SURFACEFORMAT_R24_UNORM_X8_TYPELESS 0x0D9 +#define BRW_SURFACEFORMAT_X24_TYPELESS_G8_UINT 0x0DA +#define BRW_SURFACEFORMAT_L16A16_UNORM 0x0DF +#define BRW_SURFACEFORMAT_I24X8_UNORM 0x0E0 +#define BRW_SURFACEFORMAT_L24X8_UNORM 0x0E1 +#define BRW_SURFACEFORMAT_A24X8_UNORM 0x0E2 +#define BRW_SURFACEFORMAT_I32_FLOAT 0x0E3 +#define BRW_SURFACEFORMAT_L32_FLOAT 0x0E4 +#define BRW_SURFACEFORMAT_A32_FLOAT 0x0E5 +#define BRW_SURFACEFORMAT_B8G8R8X8_UNORM 0x0E9 +#define BRW_SURFACEFORMAT_B8G8R8X8_UNORM_SRGB 0x0EA +#define BRW_SURFACEFORMAT_R8G8B8X8_UNORM 0x0EB +#define BRW_SURFACEFORMAT_R8G8B8X8_UNORM_SRGB 0x0EC +#define BRW_SURFACEFORMAT_R9G9B9E5_SHAREDEXP 0x0ED +#define BRW_SURFACEFORMAT_B10G10R10X2_UNORM 0x0EE +#define BRW_SURFACEFORMAT_L16A16_FLOAT 0x0F0 +#define BRW_SURFACEFORMAT_R32_UNORM 0x0F1 +#define BRW_SURFACEFORMAT_R32_SNORM 0x0F2 #define BRW_SURFACEFORMAT_R10G10B10X2_USCALED 0x0F3 #define BRW_SURFACEFORMAT_R8G8B8A8_SSCALED 0x0F4 #define BRW_SURFACEFORMAT_R8G8B8A8_USCALED 0x0F5 @@ -347,25 +347,25 @@ #define BRW_SURFACEFORMAT_R16G16_USCALED 0x0F7 #define BRW_SURFACEFORMAT_R32_SSCALED 0x0F8 #define BRW_SURFACEFORMAT_R32_USCALED 0x0F9 -#define BRW_SURFACEFORMAT_B5G6R5_UNORM 0x100 -#define BRW_SURFACEFORMAT_B5G6R5_UNORM_SRGB 0x101 -#define BRW_SURFACEFORMAT_B5G5R5A1_UNORM 0x102 -#define BRW_SURFACEFORMAT_B5G5R5A1_UNORM_SRGB 0x103 -#define BRW_SURFACEFORMAT_B4G4R4A4_UNORM 0x104 -#define BRW_SURFACEFORMAT_B4G4R4A4_UNORM_SRGB 0x105 -#define BRW_SURFACEFORMAT_R8G8_UNORM 0x106 -#define BRW_SURFACEFORMAT_R8G8_SNORM 0x107 -#define BRW_SURFACEFORMAT_R8G8_SINT 0x108 -#define BRW_SURFACEFORMAT_R8G8_UINT 0x109 -#define BRW_SURFACEFORMAT_R16_UNORM 0x10A -#define BRW_SURFACEFORMAT_R16_SNORM 0x10B -#define BRW_SURFACEFORMAT_R16_SINT 0x10C -#define BRW_SURFACEFORMAT_R16_UINT 0x10D -#define BRW_SURFACEFORMAT_R16_FLOAT 0x10E -#define BRW_SURFACEFORMAT_I16_UNORM 0x111 -#define BRW_SURFACEFORMAT_L16_UNORM 0x112 -#define BRW_SURFACEFORMAT_A16_UNORM 0x113 -#define BRW_SURFACEFORMAT_L8A8_UNORM 0x114 +#define BRW_SURFACEFORMAT_B5G6R5_UNORM 0x100 +#define BRW_SURFACEFORMAT_B5G6R5_UNORM_SRGB 0x101 +#define BRW_SURFACEFORMAT_B5G5R5A1_UNORM 0x102 +#define BRW_SURFACEFORMAT_B5G5R5A1_UNORM_SRGB 0x103 +#define BRW_SURFACEFORMAT_B4G4R4A4_UNORM 0x104 +#define BRW_SURFACEFORMAT_B4G4R4A4_UNORM_SRGB 0x105 +#define BRW_SURFACEFORMAT_R8G8_UNORM 0x106 +#define BRW_SURFACEFORMAT_R8G8_SNORM 0x107 +#define BRW_SURFACEFORMAT_R8G8_SINT 0x108 +#define BRW_SURFACEFORMAT_R8G8_UINT 0x109 +#define BRW_SURFACEFORMAT_R16_UNORM 0x10A +#define BRW_SURFACEFORMAT_R16_SNORM 0x10B +#define BRW_SURFACEFORMAT_R16_SINT 0x10C +#define BRW_SURFACEFORMAT_R16_UINT 0x10D +#define BRW_SURFACEFORMAT_R16_FLOAT 0x10E +#define BRW_SURFACEFORMAT_I16_UNORM 0x111 +#define BRW_SURFACEFORMAT_L16_UNORM 0x112 +#define BRW_SURFACEFORMAT_A16_UNORM 0x113 +#define BRW_SURFACEFORMAT_L8A8_UNORM 0x114 #define BRW_SURFACEFORMAT_I16_FLOAT 0x115 #define BRW_SURFACEFORMAT_L16_FLOAT 0x116 #define BRW_SURFACEFORMAT_A16_FLOAT 0x117 @@ -377,45 +377,45 @@ #define BRW_SURFACEFORMAT_R8G8_USCALED 0x11D #define BRW_SURFACEFORMAT_R16_SSCALED 0x11E #define BRW_SURFACEFORMAT_R16_USCALED 0x11F -#define BRW_SURFACEFORMAT_R8_UNORM 0x140 -#define BRW_SURFACEFORMAT_R8_SNORM 0x141 -#define BRW_SURFACEFORMAT_R8_SINT 0x142 -#define BRW_SURFACEFORMAT_R8_UINT 0x143 -#define BRW_SURFACEFORMAT_A8_UNORM 0x144 -#define BRW_SURFACEFORMAT_I8_UNORM 0x145 -#define BRW_SURFACEFORMAT_L8_UNORM 0x146 -#define BRW_SURFACEFORMAT_P4A4_UNORM 0x147 +#define BRW_SURFACEFORMAT_R8_UNORM 0x140 +#define BRW_SURFACEFORMAT_R8_SNORM 0x141 +#define BRW_SURFACEFORMAT_R8_SINT 0x142 +#define BRW_SURFACEFORMAT_R8_UINT 0x143 +#define BRW_SURFACEFORMAT_A8_UNORM 0x144 +#define BRW_SURFACEFORMAT_I8_UNORM 0x145 +#define BRW_SURFACEFORMAT_L8_UNORM 0x146 +#define BRW_SURFACEFORMAT_P4A4_UNORM 0x147 #define BRW_SURFACEFORMAT_A4P4_UNORM 0x148 #define BRW_SURFACEFORMAT_R8_SSCALED 0x149 #define BRW_SURFACEFORMAT_R8_USCALED 0x14A #define BRW_SURFACEFORMAT_L8_UNORM_SRGB 0x14C -#define BRW_SURFACEFORMAT_R1_UINT 0x181 -#define BRW_SURFACEFORMAT_YCRCB_NORMAL 0x182 -#define BRW_SURFACEFORMAT_YCRCB_SWAPUVY 0x183 -#define BRW_SURFACEFORMAT_BC1_UNORM 0x186 -#define BRW_SURFACEFORMAT_BC2_UNORM 0x187 -#define BRW_SURFACEFORMAT_BC3_UNORM 0x188 -#define BRW_SURFACEFORMAT_BC4_UNORM 0x189 -#define BRW_SURFACEFORMAT_BC5_UNORM 0x18A -#define BRW_SURFACEFORMAT_BC1_UNORM_SRGB 0x18B -#define BRW_SURFACEFORMAT_BC2_UNORM_SRGB 0x18C -#define BRW_SURFACEFORMAT_BC3_UNORM_SRGB 0x18D -#define BRW_SURFACEFORMAT_MONO8 0x18E -#define BRW_SURFACEFORMAT_YCRCB_SWAPUV 0x18F -#define BRW_SURFACEFORMAT_YCRCB_SWAPY 0x190 -#define BRW_SURFACEFORMAT_DXT1_RGB 0x191 -#define BRW_SURFACEFORMAT_FXT1 0x192 -#define BRW_SURFACEFORMAT_R8G8B8_UNORM 0x193 -#define BRW_SURFACEFORMAT_R8G8B8_SNORM 0x194 -#define BRW_SURFACEFORMAT_R8G8B8_SSCALED 0x195 -#define BRW_SURFACEFORMAT_R8G8B8_USCALED 0x196 -#define BRW_SURFACEFORMAT_R64G64B64A64_FLOAT 0x197 -#define BRW_SURFACEFORMAT_R64G64B64_FLOAT 0x198 -#define BRW_SURFACEFORMAT_BC4_SNORM 0x199 -#define BRW_SURFACEFORMAT_BC5_SNORM 0x19A -#define BRW_SURFACEFORMAT_R16G16B16_UNORM 0x19C -#define BRW_SURFACEFORMAT_R16G16B16_SNORM 0x19D -#define BRW_SURFACEFORMAT_R16G16B16_SSCALED 0x19E +#define BRW_SURFACEFORMAT_R1_UINT 0x181 +#define BRW_SURFACEFORMAT_YCRCB_NORMAL 0x182 +#define BRW_SURFACEFORMAT_YCRCB_SWAPUVY 0x183 +#define BRW_SURFACEFORMAT_BC1_UNORM 0x186 +#define BRW_SURFACEFORMAT_BC2_UNORM 0x187 +#define BRW_SURFACEFORMAT_BC3_UNORM 0x188 +#define BRW_SURFACEFORMAT_BC4_UNORM 0x189 +#define BRW_SURFACEFORMAT_BC5_UNORM 0x18A +#define BRW_SURFACEFORMAT_BC1_UNORM_SRGB 0x18B +#define BRW_SURFACEFORMAT_BC2_UNORM_SRGB 0x18C +#define BRW_SURFACEFORMAT_BC3_UNORM_SRGB 0x18D +#define BRW_SURFACEFORMAT_MONO8 0x18E +#define BRW_SURFACEFORMAT_YCRCB_SWAPUV 0x18F +#define BRW_SURFACEFORMAT_YCRCB_SWAPY 0x190 +#define BRW_SURFACEFORMAT_DXT1_RGB 0x191 +#define BRW_SURFACEFORMAT_FXT1 0x192 +#define BRW_SURFACEFORMAT_R8G8B8_UNORM 0x193 +#define BRW_SURFACEFORMAT_R8G8B8_SNORM 0x194 +#define BRW_SURFACEFORMAT_R8G8B8_SSCALED 0x195 +#define BRW_SURFACEFORMAT_R8G8B8_USCALED 0x196 +#define BRW_SURFACEFORMAT_R64G64B64A64_FLOAT 0x197 +#define BRW_SURFACEFORMAT_R64G64B64_FLOAT 0x198 +#define BRW_SURFACEFORMAT_BC4_SNORM 0x199 +#define BRW_SURFACEFORMAT_BC5_SNORM 0x19A +#define BRW_SURFACEFORMAT_R16G16B16_UNORM 0x19C +#define BRW_SURFACEFORMAT_R16G16B16_SNORM 0x19D +#define BRW_SURFACEFORMAT_R16G16B16_SSCALED 0x19E #define BRW_SURFACEFORMAT_R16G16B16_USCALED 0x19F #define BRW_SURFACERETURNFORMAT_FLOAT32 0 @@ -619,7 +619,7 @@ #define BRW_ARF_NULL 0x00 #define BRW_ARF_ADDRESS 0x10 -#define BRW_ARF_ACCUMULATOR 0x20 +#define BRW_ARF_ACCUMULATOR 0x20 #define BRW_ARF_FLAG 0x30 #define BRW_ARF_MASK 0x40 #define BRW_ARF_MASK_STACK 0x50 diff --git a/src/mesa/drivers/dri/i965/brw_draw.c b/src/mesa/drivers/dri/i965/brw_draw.c index 7eb16b7..e949ad0 100644 --- a/src/mesa/drivers/dri/i965/brw_draw.c +++ b/src/mesa/drivers/dri/i965/brw_draw.c @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2003 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ @@ -58,7 +58,7 @@ static GLuint prim_to_hw_prim[GL_POLYGON+1] = { }; -static const GLenum reduced_prim[GL_POLYGON+1] = { +static const GLenum reduced_prim[GL_POLYGON+1] = { GL_POINTS, GL_LINES, GL_LINES, @@ -120,7 +120,7 @@ static GLuint trim(GLenum prim, GLuint length) return length > 3 ? (length - length % 2) : 0; else if (prim == GL_QUADS) return length - length % 4; - else + else return length; } @@ -202,7 +202,7 @@ static GLboolean check_fallbacks( struct brw_context *brw, struct gl_context *ctx = &brw->intel.ctx; GLuint i; - /* If we don't require strict OpenGL conformance, never + /* If we don't require strict OpenGL conformance, never * use fallbacks. If we're forcing fallbacks, always * use fallfacks. */ @@ -214,7 +214,7 @@ static GLboolean check_fallbacks( struct brw_context *brw, if (ctx->Polygon.SmoothFlag) { for (i = 0; i < nr_prims; i++) - if (reduced_prim[prim[i].mode] == GL_TRIANGLES) + if (reduced_prim[prim[i].mode] == GL_TRIANGLES) return GL_TRUE; } @@ -223,7 +223,7 @@ static GLboolean check_fallbacks( struct brw_context *brw, */ if (ctx->Line.SmoothFlag) { for (i = 0; i < nr_prims; i++) - if (reduced_prim[prim[i].mode] == GL_LINES) + if (reduced_prim[prim[i].mode] == GL_LINES) return GL_TRUE; } @@ -235,9 +235,9 @@ static GLboolean check_fallbacks( struct brw_context *brw, /* GS doesn't get enough information to know when to reset * the stipple counter?!? */ - if (prim[i].mode == GL_LINE_LOOP || prim[i].mode == GL_LINE_STRIP) + if (prim[i].mode == GL_LINE_LOOP || prim[i].mode == GL_LINE_STRIP) return GL_TRUE; - + if (prim[i].mode == GL_POLYGON && (ctx->Polygon.FrontMode == GL_LINE || ctx->Polygon.BackMode == GL_LINE)) @@ -247,7 +247,7 @@ static GLboolean check_fallbacks( struct brw_context *brw, if (ctx->Point.SmoothFlag) { for (i = 0; i < nr_prims; i++) - if (prim[i].mode == GL_POINTS) + if (prim[i].mode == GL_POINTS) return GL_TRUE; } @@ -283,7 +283,7 @@ static GLboolean check_fallbacks( struct brw_context *brw, } } } - + /* Nothing stopping us from the fast path now */ return GL_FALSE; } @@ -312,7 +312,7 @@ static GLboolean brw_try_draw_prims( struct gl_context *ctx, /* We have to validate the textures *before* checking for fallbacks; * otherwise, the software fallback won't be able to rely on the * texture state, the firstLevel and lastLevel fields won't be - * set in the intel texture object (they'll both be 0), and the + * set in the intel texture object (they'll both be 0), and the * software fallback will segfault if it attempts to access any * texture level other than level 0. */ @@ -333,8 +333,8 @@ static GLboolean brw_try_draw_prims( struct gl_context *ctx, brw->state.dirty.brw |= BRW_NEW_VERTICES; /* Have to validate state quite late. Will rebuild tnl_program, - * which depends on varying information. - * + * which depends on varying information. + * * Note this is where brw->vs->prog_data.inputs_read is calculated, * so can't access it earlier. */ @@ -462,7 +462,7 @@ void brw_draw_init( struct brw_context *brw ) struct gl_context *ctx = &brw->intel.ctx; struct vbo_context *vbo = vbo_context(ctx); - /* Register our drawing function: + /* Register our drawing function: */ vbo->draw_prims = brw_draw_prims; } diff --git a/src/mesa/drivers/dri/i965/brw_draw.h b/src/mesa/drivers/dri/i965/brw_draw.h index 1fe4172..1d6a3e6 100644 --- a/src/mesa/drivers/dri/i965/brw_draw.h +++ b/src/mesa/drivers/dri/i965/brw_draw.h @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2005 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ #ifndef BRW_DRAW_H diff --git a/src/mesa/drivers/dri/i965/brw_draw_upload.c b/src/mesa/drivers/dri/i965/brw_draw_upload.c index 2cefe61..a64e6b0 100644 --- a/src/mesa/drivers/dri/i965/brw_draw_upload.c +++ b/src/mesa/drivers/dri/i965/brw_draw_upload.c @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2003 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ @@ -169,7 +169,7 @@ static GLuint get_surface_type( GLenum type, GLuint size, GLenum format, GLboolean normalized ) { if (unlikely(INTEL_DEBUG & DEBUG_VERTS)) - printf("type %s size %d normalized %d\n", + printf("type %s size %d normalized %d\n", _mesa_lookup_enum_by_nr(type), size, normalized); if (normalized) { @@ -192,7 +192,7 @@ static GLuint get_surface_type( GLenum type, GLuint size, return ubyte_types_norm[size]; } default: assert(0); return 0; - } + } } else { assert(format == GL_RGBA); /* sanity check */ @@ -207,7 +207,7 @@ static GLuint get_surface_type( GLenum type, GLuint size, case GL_UNSIGNED_SHORT: return ushort_types_scale[size]; case GL_UNSIGNED_BYTE: return ubyte_types_scale[size]; default: assert(0); return 0; - } + } } } @@ -225,10 +225,10 @@ static GLuint get_size( GLenum type ) case GL_UNSIGNED_SHORT: return sizeof(GLushort); case GL_UNSIGNED_BYTE: return sizeof(GLubyte); default: return 0; - } + } } -static GLuint get_index_type(GLenum type) +static GLuint get_index_type(GLenum type) { switch (type) { case GL_UNSIGNED_BYTE: return BRW_INDEX_BYTE; @@ -315,7 +315,7 @@ static void brw_prepare_vertices(struct brw_context *brw) { struct gl_context *ctx = &brw->intel.ctx; struct intel_context *intel = intel_context(ctx); - GLbitfield vs_inputs = brw->vs.prog_data->inputs_read; + GLbitfield vs_inputs = brw->vs.prog_data->inputs_read; GLuint i; const unsigned char *ptr = NULL; GLuint interleave = 0; diff --git a/src/mesa/drivers/dri/i965/brw_eu.c b/src/mesa/drivers/dri/i965/brw_eu.c index 3b5c4c0..aae1211 100644 --- a/src/mesa/drivers/dri/i965/brw_eu.c +++ b/src/mesa/drivers/dri/i965/brw_eu.c @@ -2,7 +2,7 @@ Copyright (C) Intel Corp. 2006. All Rights Reserved. Intel funded Tungsten Graphics (http://www.tungstengraphics.com) to develop this 3D driver. - + 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, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - + The above copyright notice and this permission notice (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 NONINFRINGEMENT. @@ -22,13 +22,13 @@ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - + **********************************************************************/ /* * Authors: * Keith Whitwell */ - + #include "brw_context.h" #include "brw_defines.h" @@ -52,7 +52,7 @@ void brw_set_predicate_control_flag_value( struct brw_compile *p, GLuint value ) } p->current->header.predicate_control = BRW_PREDICATE_NORMAL; - } + } } void brw_set_predicate_control( struct brw_compile *p, GLuint pc ) @@ -126,7 +126,7 @@ void brw_push_insn_state( struct brw_compile *p ) assert(p->current != &p->stack[BRW_EU_MAX_INSN_STACK-1]); memcpy(p->current+1, p->current, sizeof(struct brw_instruction)); p->compressed_stack[p->current - p->stack] = p->compressed; - p->current++; + p->current++; } void brw_pop_insn_state( struct brw_compile *p ) @@ -152,7 +152,7 @@ void brw_init_compile( struct brw_context *brw, struct brw_compile *p ) brw_set_mask_control(p, BRW_MASK_ENABLE); /* what does this do? */ brw_set_saturate(p, 0); brw_set_compression_control(p, BRW_COMPRESSION_NONE); - brw_set_predicate_control_flag_value(p, 0xff); + brw_set_predicate_control_flag_value(p, 0xff); } diff --git a/src/mesa/drivers/dri/i965/brw_eu.h b/src/mesa/drivers/dri/i965/brw_eu.h index 119ffc7..5fe36d6 100644 --- a/src/mesa/drivers/dri/i965/brw_eu.h +++ b/src/mesa/drivers/dri/i965/brw_eu.h @@ -2,7 +2,7 @@ Copyright (C) Intel Corp. 2006. All Rights Reserved. Intel funded Tungsten Graphics (http://www.tungstengraphics.com) to develop this 3D driver. - + 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, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - + The above copyright notice and this permission notice (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 NONINFRINGEMENT. @@ -22,13 +22,13 @@ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - + **********************************************************************/ /* * Authors: * Keith Whitwell */ - + #ifndef BRW_EU_H #define BRW_EU_H @@ -70,7 +70,7 @@ struct brw_reg GLuint address_mode:1; /* relative addressing, hopefully! */ GLuint pad0:1; - union { + union { struct { GLuint swizzle:8; /* src only, align16 only */ GLuint writemask:4; /* dest only, align16 only */ @@ -81,7 +81,7 @@ struct brw_reg GLfloat f; GLint d; GLuint ud; - } dw1; + } dw1; }; @@ -295,7 +295,7 @@ static INLINE struct brw_reg retype( struct brw_reg reg, static INLINE struct brw_reg suboffset( struct brw_reg reg, GLuint delta ) -{ +{ reg.subnr += delta * type_sz(reg.type); return reg; } @@ -317,7 +317,7 @@ static INLINE struct brw_reg byte_offset( struct brw_reg reg, reg.subnr = newoffset % REG_SIZE; return reg; } - + /** Construct unsigned word[16] register */ static INLINE struct brw_reg brw_uw16_reg( GLuint file, @@ -353,7 +353,7 @@ static INLINE struct brw_reg brw_imm_reg( GLuint type ) BRW_WIDTH_1, BRW_HORIZONTAL_STRIDE_0, 0, - 0); + 0); } /** Construct float immediate register */ @@ -426,8 +426,8 @@ static INLINE struct brw_reg brw_imm_vf( GLuint v ) #define VF_ONE 0x30 #define VF_NEG (1<<7) -static INLINE struct brw_reg brw_imm_vf4( GLuint v0, - GLuint v1, +static INLINE struct brw_reg brw_imm_vf4( GLuint v0, + GLuint v1, GLuint v2, GLuint v3) { @@ -487,15 +487,15 @@ static INLINE struct brw_reg brw_uw16_grf( GLuint nr, GLuint subnr ) /** Construct null register (usually used for setting condition codes) */ static INLINE struct brw_reg brw_null_reg( void ) { - return brw_vec8_reg(BRW_ARCHITECTURE_REGISTER_FILE, - BRW_ARF_NULL, + return brw_vec8_reg(BRW_ARCHITECTURE_REGISTER_FILE, + BRW_ARF_NULL, 0); } static INLINE struct brw_reg brw_address_reg( GLuint subnr ) { - return brw_uw1_reg(BRW_ARCHITECTURE_REGISTER_FILE, - BRW_ARF_ADDRESS, + return brw_uw1_reg(BRW_ARCHITECTURE_REGISTER_FILE, + BRW_ARF_ADDRESS, subnr); } @@ -505,8 +505,8 @@ static INLINE struct brw_reg brw_address_reg( GLuint subnr ) */ static INLINE struct brw_reg brw_ip_reg( void ) { - return brw_reg(BRW_ARCHITECTURE_REGISTER_FILE, - BRW_ARF_IP, + return brw_reg(BRW_ARCHITECTURE_REGISTER_FILE, + BRW_ARF_IP, 0, BRW_REGISTER_TYPE_UD, BRW_VERTICAL_STRIDE_4, /* ? */ @@ -518,8 +518,8 @@ static INLINE struct brw_reg brw_ip_reg( void ) static INLINE struct brw_reg brw_acc_reg( void ) { - return brw_vec8_reg(BRW_ARCHITECTURE_REGISTER_FILE, - BRW_ARF_ACCUMULATOR, + return brw_vec8_reg(BRW_ARCHITECTURE_REGISTER_FILE, + BRW_ARF_ACCUMULATOR, 0); } @@ -632,7 +632,7 @@ static INLINE struct brw_reg get_element_ud( struct brw_reg reg, GLuint elt ) static INLINE struct brw_reg brw_swizzle( struct brw_reg reg, GLuint x, - GLuint y, + GLuint y, GLuint z, GLuint w) { @@ -937,15 +937,15 @@ void brw_dp_READ_4_vs_relative(struct brw_compile *p, /* If/else/endif. Works by manipulating the execution flags on each * channel. */ -struct brw_instruction *brw_IF(struct brw_compile *p, +struct brw_instruction *brw_IF(struct brw_compile *p, GLuint execute_size); struct brw_instruction *brw_IF_gen6(struct brw_compile *p, uint32_t conditional, struct brw_reg src0, struct brw_reg src1); -struct brw_instruction *brw_ELSE(struct brw_compile *p, +struct brw_instruction *brw_ELSE(struct brw_compile *p, struct brw_instruction *if_insn); -void brw_ENDIF(struct brw_compile *p, +void brw_ENDIF(struct brw_compile *p, struct brw_instruction *if_or_else_insn); @@ -954,7 +954,7 @@ void brw_ENDIF(struct brw_compile *p, struct brw_instruction *brw_DO(struct brw_compile *p, GLuint execute_size); -struct brw_instruction *brw_WHILE(struct brw_compile *p, +struct brw_instruction *brw_WHILE(struct brw_compile *p, struct brw_instruction *patch_insn); struct brw_instruction *brw_BREAK(struct brw_compile *p, int pop_count); @@ -963,7 +963,7 @@ struct brw_instruction *brw_CONT_gen6(struct brw_compile *p, struct brw_instruction *brw_CONT(struct brw_compile *p, int pop_count); /* Forward jumps: */ -void brw_land_fwd_jump(struct brw_compile *p, +void brw_land_fwd_jump(struct brw_compile *p, struct brw_instruction *jmp_insn); @@ -984,7 +984,7 @@ void brw_CMP(struct brw_compile *p, void brw_print_reg( struct brw_reg reg ); -/*********************************************************************** +/*********************************************************************** * brw_eu_util.c: */ @@ -1008,7 +1008,7 @@ void brw_copy8(struct brw_compile *p, struct brw_reg src, GLuint count); -void brw_math_invert( struct brw_compile *p, +void brw_math_invert( struct brw_compile *p, struct brw_reg dst, struct brw_reg src); diff --git a/src/mesa/drivers/dri/i965/brw_eu_debug.c b/src/mesa/drivers/dri/i965/brw_eu_debug.c index 99453af..e56e2a0 100644 --- a/src/mesa/drivers/dri/i965/brw_eu_debug.c +++ b/src/mesa/drivers/dri/i965/brw_eu_debug.c @@ -2,7 +2,7 @@ Copyright (C) Intel Corp. 2006. All Rights Reserved. Intel funded Tungsten Graphics (http://www.tungstengraphics.com) to develop this 3D driver. - + 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, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - + The above copyright notice and this permission notice (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 NONINFRINGEMENT. @@ -22,13 +22,13 @@ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - + **********************************************************************/ /* * Authors: * Keith Whitwell */ - + #include "main/mtypes.h" #include "main/imports.h" @@ -54,10 +54,10 @@ void brw_print_reg( struct brw_reg hwreg ) "f" }; - printf("%s%s", + printf("%s%s", hwreg.abs ? "abs/" : "", hwreg.negate ? "-" : ""); - + if (hwreg.file == BRW_GENERAL_REGISTER_FILE && hwreg.nr % 2 == 0 && hwreg.subnr == 0 && @@ -72,7 +72,7 @@ void brw_print_reg( struct brw_reg hwreg ) hwreg.vstride == BRW_VERTICAL_STRIDE_0 && hwreg.width == BRW_WIDTH_1 && hwreg.hstride == BRW_HORIZONTAL_STRIDE_0 && - hwreg.type == BRW_REGISTER_TYPE_F) { + hwreg.type == BRW_REGISTER_TYPE_F) { /* "scalar" register */ printf("scl%d.%d", hwreg.nr, hwreg.subnr / 4); } @@ -80,13 +80,13 @@ void brw_print_reg( struct brw_reg hwreg ) printf("imm %f", hwreg.dw1.f); } else { - printf("%s%d.%d<%d;%d,%d>:%s", + printf("%s%d.%d<%d;%d,%d>:%s", file[hwreg.file], hwreg.nr, hwreg.subnr / type_sz(hwreg.type), hwreg.vstride ? (1<<(hwreg.vstride-1)) : 0, 1< */ - + #include "brw_context.h" #include "brw_defines.h" @@ -64,7 +64,7 @@ static void brw_set_dest(struct brw_compile *p, insn->bits1.da1.dest_reg_type = dest.type; insn->bits1.da1.dest_address_mode = dest.address_mode; - if (dest.address_mode == BRW_ADDRESS_DIRECT) { + if (dest.address_mode == BRW_ADDRESS_DIRECT) { insn->bits1.da1.dest_reg_nr = dest.nr; if (insn->header.access_mode == BRW_ALIGN_1) { @@ -198,13 +198,13 @@ static void brw_set_src0( struct brw_instruction *insn, if (reg.file == BRW_IMMEDIATE_VALUE) { insn->bits3.ud = reg.dw1.ud; - + /* Required to set some fields in src1 as well: */ insn->bits1.da1.src1_reg_file = 0; /* arf */ insn->bits1.da1.src1_reg_type = reg.type; } - else + else { if (reg.address_mode == BRW_ADDRESS_DIRECT) { if (insn->header.access_mode == BRW_ALIGN_1) { @@ -220,7 +220,7 @@ static void brw_set_src0( struct brw_instruction *insn, insn->bits2.ia1.src0_subreg_nr = reg.subnr; if (insn->header.access_mode == BRW_ALIGN_1) { - insn->bits2.ia1.src0_indirect_offset = reg.dw1.bits.indirect_offset; + insn->bits2.ia1.src0_indirect_offset = reg.dw1.bits.indirect_offset; } else { insn->bits2.ia16.src0_subreg_nr = reg.dw1.bits.indirect_offset; @@ -228,7 +228,7 @@ static void brw_set_src0( struct brw_instruction *insn, } if (insn->header.access_mode == BRW_ALIGN_1) { - if (reg.width == BRW_WIDTH_1 && + if (reg.width == BRW_WIDTH_1 && insn->header.execution_size == BRW_EXECUTE_1) { insn->bits2.da1.src0_horiz_stride = BRW_HORIZONTAL_STRIDE_0; insn->bits2.da1.src0_width = BRW_WIDTH_1; @@ -296,7 +296,7 @@ void brw_set_src1( struct brw_instruction *insn, } if (insn->header.access_mode == BRW_ALIGN_1) { - if (reg.width == BRW_WIDTH_1 && + if (reg.width == BRW_WIDTH_1 && insn->header.execution_size == BRW_EXECUTE_1) { insn->bits3.da1.src1_horiz_stride = BRW_HORIZONTAL_STRIDE_0; insn->bits3.da1.src1_width = BRW_WIDTH_1; @@ -611,7 +611,7 @@ static void brw_set_sampler_message(struct brw_context *brw, -static struct brw_instruction *next_insn( struct brw_compile *p, +static struct brw_instruction *next_insn( struct brw_compile *p, GLuint opcode ) { struct brw_instruction *insn; @@ -621,7 +621,7 @@ static struct brw_instruction *next_insn( struct brw_compile *p, insn = &p->store[p->nr_insn++]; memcpy(insn, p->current, sizeof(*insn)); - /* Reset this one-shot flag: + /* Reset this one-shot flag: */ if (p->current->header.destreg__conditionalmod) { @@ -641,7 +641,7 @@ static struct brw_instruction *brw_alu1( struct brw_compile *p, { struct brw_instruction *insn = next_insn(p, opcode); brw_set_dest(p, insn, dest); - brw_set_src0(insn, src); + brw_set_src0(insn, src); return insn; } @@ -651,7 +651,7 @@ static struct brw_instruction *brw_alu2(struct brw_compile *p, struct brw_reg src0, struct brw_reg src1 ) { - struct brw_instruction *insn = next_insn(p, opcode); + struct brw_instruction *insn = next_insn(p, opcode); brw_set_dest(p, insn, dest); brw_set_src0(insn, src0); brw_set_src1(insn, src1); @@ -789,7 +789,7 @@ struct brw_instruction *brw_MUL(struct brw_compile *p, void brw_NOP(struct brw_compile *p) { - struct brw_instruction *insn = next_insn(p, BRW_OPCODE_NOP); + struct brw_instruction *insn = next_insn(p, BRW_OPCODE_NOP); brw_set_dest(p, insn, retype(brw_vec4_grf(0,0), BRW_REGISTER_TYPE_UD)); brw_set_src0(insn, retype(brw_vec4_grf(0,0), BRW_REGISTER_TYPE_UD)); brw_set_src1(insn, brw_imm_ud(0x0)); @@ -803,7 +803,7 @@ void brw_NOP(struct brw_compile *p) * Comparisons, if/else/endif */ -struct brw_instruction *brw_JMPI(struct brw_compile *p, +struct brw_instruction *brw_JMPI(struct brw_compile *p, struct brw_reg dest, struct brw_reg src0, struct brw_reg src1) @@ -897,7 +897,7 @@ brw_IF_gen6(struct brw_compile *p, uint32_t conditional, return insn; } -struct brw_instruction *brw_ELSE(struct brw_compile *p, +struct brw_instruction *brw_ELSE(struct brw_compile *p, struct brw_instruction *if_insn) { struct intel_context *intel = &p->brw->intel; @@ -953,15 +953,15 @@ struct brw_instruction *brw_ELSE(struct brw_compile *p, return insn; } -void brw_ENDIF(struct brw_compile *p, +void brw_ENDIF(struct brw_compile *p, struct brw_instruction *patch_insn) { struct intel_context *intel = &p->brw->intel; GLuint br = 1; if (intel->gen >= 5) - br = 2; - + br = 2; + if (p->single_program_flow) { /* In single program flow mode, there's no need to execute an ENDIF, * since we don't need to do any stack operations, and if we're executing @@ -1139,7 +1139,7 @@ struct brw_instruction *brw_DO(struct brw_compile *p, GLuint execute_size) -struct brw_instruction *brw_WHILE(struct brw_compile *p, +struct brw_instruction *brw_WHILE(struct brw_compile *p, struct brw_instruction *do_insn) { struct intel_context *intel = &p->brw->intel; @@ -1191,7 +1191,7 @@ struct brw_instruction *brw_WHILE(struct brw_compile *p, /* FORWARD JUMPS: */ -void brw_land_fwd_jump(struct brw_compile *p, +void brw_land_fwd_jump(struct brw_compile *p, struct brw_instruction *jmp_insn) { struct intel_context *intel = &p->brw->intel; @@ -1231,7 +1231,7 @@ void brw_CMP(struct brw_compile *p, /* Make it so that future instructions will use the computed flag * value until brw_set_predicate_control_flag_value() is called - * again. + * again. */ if (dest.file == BRW_ARCHITECTURE_REGISTER_FILE && dest.nr == 0) { @@ -1382,8 +1382,8 @@ void brw_math_16( struct brw_compile *p, { struct intel_context *intel = &p->brw->intel; struct brw_instruction *insn; - GLuint msg_length = (function == BRW_MATH_FUNCTION_POW) ? 2 : 1; - GLuint response_length = (function == BRW_MATH_FUNCTION_SINCOS) ? 2 : 1; + GLuint msg_length = (function == BRW_MATH_FUNCTION_POW) ? 2 : 1; + GLuint response_length = (function == BRW_MATH_FUNCTION_SINCOS) ? 2 : 1; if (intel->gen >= 6) { insn = next_insn(p, BRW_OPCODE_MATH); @@ -1416,8 +1416,8 @@ void brw_math_16( struct brw_compile *p, brw_set_dest(p, insn, dest); brw_set_src0(insn, src); brw_set_math_message(p->brw, - insn, - msg_length, response_length, + insn, + msg_length, response_length, function, BRW_MATH_INTEGER_UNSIGNED, precision, @@ -1432,9 +1432,9 @@ void brw_math_16( struct brw_compile *p, brw_set_dest(p, insn, offset(dest,1)); brw_set_src0(insn, src); - brw_set_math_message(p->brw, - insn, - msg_length, response_length, + brw_set_math_message(p->brw, + insn, + msg_length, response_length, function, BRW_MATH_INTEGER_UNSIGNED, precision, @@ -1898,7 +1898,7 @@ void brw_SAMPLE(struct brw_compile *p, /*printf("%s: zero writemask??\n", __FUNCTION__); */ return; } - + /* Hardware doesn't do destination dependency checking on send * instructions properly. Add a workaround which generates the * dependency by other means. In practice it seems like this bug @@ -1947,11 +1947,11 @@ void brw_SAMPLE(struct brw_compile *p, brw_MOV(p, retype(m1, BRW_REGISTER_TYPE_UD), retype(brw_vec8_grf(0,0), BRW_REGISTER_TYPE_UD)); - brw_MOV(p, get_element_ud(m1, 2), brw_imm_ud(newmask << 12)); + brw_MOV(p, get_element_ud(m1, 2), brw_imm_ud(newmask << 12)); brw_pop_insn_state(p); - src0 = retype(brw_null_reg(), BRW_REGISTER_TYPE_UW); + src0 = retype(brw_null_reg(), BRW_REGISTER_TYPE_UW); dest = offset(dest, dst_offset); /* For 16-wide dispatch, masked channels are skipped in the @@ -1965,7 +1965,7 @@ void brw_SAMPLE(struct brw_compile *p, { struct brw_instruction *insn; - + /* Sandybridge doesn't have the implied move for SENDs, * and the first message register index comes from src0. */ @@ -1993,7 +1993,7 @@ void brw_SAMPLE(struct brw_compile *p, binding_table_index, sampler, msg_type, - response_length, + response_length, msg_length, eot, header_present, @@ -2062,9 +2062,9 @@ void brw_urb_WRITE(struct brw_compile *p, allocate, used, msg_length, - response_length, - eot, - writes_complete, + response_length, + eot, + writes_complete, offset, swizzle); } diff --git a/src/mesa/drivers/dri/i965/brw_eu_util.c b/src/mesa/drivers/dri/i965/brw_eu_util.c index 5405cf1..0067ac9 100644 --- a/src/mesa/drivers/dri/i965/brw_eu_util.c +++ b/src/mesa/drivers/dri/i965/brw_eu_util.c @@ -2,7 +2,7 @@ Copyright (C) Intel Corp. 2006. All Rights Reserved. Intel funded Tungsten Graphics (http://www.tungstengraphics.com) to develop this 3D driver. - + 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, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - + The above copyright notice and this permission notice (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 NONINFRINGEMENT. @@ -22,30 +22,30 @@ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - + **********************************************************************/ /* * Authors: * Keith Whitwell */ - + #include "brw_context.h" #include "brw_defines.h" #include "brw_eu.h" -void brw_math_invert( struct brw_compile *p, +void brw_math_invert( struct brw_compile *p, struct brw_reg dst, struct brw_reg src) { - brw_math( p, + brw_math( p, dst, - BRW_MATH_FUNCTION_INV, + BRW_MATH_FUNCTION_INV, BRW_MATH_SATURATE_NONE, 0, src, - BRW_MATH_PRECISION_FULL, + BRW_MATH_PRECISION_FULL, BRW_MATH_DATA_VECTOR ); } diff --git a/src/mesa/drivers/dri/i965/brw_fallback.c b/src/mesa/drivers/dri/i965/brw_fallback.c index 6796fb2..b938a20 100644 --- a/src/mesa/drivers/dri/i965/brw_fallback.c +++ b/src/mesa/drivers/dri/i965/brw_fallback.c @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2005 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ #include "main/glheader.h" @@ -71,8 +71,8 @@ static GLboolean do_check_fallback(struct brw_context *brw) } } } - - /* _NEW_STENCIL + + /* _NEW_STENCIL */ if (ctx->Stencil._Enabled && (ctx->DrawBuffer->Name == 0 && !brw->intel.hw_stencil)) { diff --git a/src/mesa/drivers/dri/i965/brw_fallback.h b/src/mesa/drivers/dri/i965/brw_fallback.h index 13b18b5..d7181ee 100644 --- a/src/mesa/drivers/dri/i965/brw_fallback.h +++ b/src/mesa/drivers/dri/i965/brw_fallback.h @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2005 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ #ifndef BRW_FALLBACK_H diff --git a/src/mesa/drivers/dri/i965/brw_gs.c b/src/mesa/drivers/dri/i965/brw_gs.c index 70c451d..3388f18 100644 --- a/src/mesa/drivers/dri/i965/brw_gs.c +++ b/src/mesa/drivers/dri/i965/brw_gs.c @@ -2,7 +2,7 @@ Copyright (C) Intel Corp. 2006. All Rights Reserved. Intel funded Tungsten Graphics (http://www.tungstengraphics.com) to develop this 3D driver. - + 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, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - + The above copyright notice and this permission notice (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 NONINFRINGEMENT. @@ -22,13 +22,13 @@ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - + **********************************************************************/ /* * Authors: * Keith Whitwell */ - + #include "main/glheader.h" #include "main/macros.h" #include "main/enums.h" @@ -53,7 +53,7 @@ static void compile_gs_prog( struct brw_context *brw, GLuint program_size; memset(&c, 0, sizeof(c)); - + c.key = *key; /* Need to locate the two positions present in vertex + header. * These are currently hardcoded: @@ -67,7 +67,7 @@ static void compile_gs_prog( struct brw_context *brw, c.nr_bytes = c.nr_regs * REG_SIZE; - + /* Begin the compilation: */ brw_init_compile(brw, &c.func); @@ -75,7 +75,7 @@ static void compile_gs_prog( struct brw_context *brw, c.func.single_program_flow = 1; /* For some reason the thread is spawned with only 4 channels - * unmasked. + * unmasked. */ brw_set_mask_control(&c.func, BRW_MASK_DISABLE); @@ -121,7 +121,7 @@ static void compile_gs_prog( struct brw_context *brw, else { return; } - break; + break; default: return; } @@ -152,7 +152,7 @@ static void compile_gs_prog( struct brw_context *brw, &brw->gs.prog_data); } -static const GLenum gs_prim[GL_POLYGON+1] = { +static const GLenum gs_prim[GL_POLYGON+1] = { GL_POINTS, GL_LINES, GL_LINE_LOOP, @@ -181,7 +181,7 @@ static void populate_key( struct brw_context *brw, key->primitive = gs_prim[brw->primitive]; key->hint_gs_always = 0; /* debug code? */ - + /* _NEW_LIGHT */ key->pv_first = (ctx->Light.ProvokingVertex == GL_FIRST_VERTEX_CONVENTION); if (key->primitive == GL_QUADS && ctx->Light.ShadeModel != GL_FLAT) { diff --git a/src/mesa/drivers/dri/i965/brw_gs.h b/src/mesa/drivers/dri/i965/brw_gs.h index 7e35310..462f895 100644 --- a/src/mesa/drivers/dri/i965/brw_gs.h +++ b/src/mesa/drivers/dri/i965/brw_gs.h @@ -2,7 +2,7 @@ Copyright (C) Intel Corp. 2006. All Rights Reserved. Intel funded Tungsten Graphics (http://www.tungstengraphics.com) to develop this 3D driver. - + 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, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - + The above copyright notice and this permission notice (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 NONINFRINGEMENT. @@ -22,13 +22,13 @@ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - + **********************************************************************/ /* * Authors: * Keith Whitwell */ - + #ifndef BRW_GS_H #define BRW_GS_H @@ -37,7 +37,7 @@ #include "brw_context.h" #include "brw_eu.h" -#define MAX_GS_VERTS (4) +#define MAX_GS_VERTS (4) struct brw_gs_prog_key { GLbitfield64 attrs; @@ -52,7 +52,7 @@ struct brw_gs_compile { struct brw_compile func; struct brw_gs_prog_key key; struct brw_gs_prog_data prog_data; - + struct { struct brw_reg R0; struct brw_reg vertex[MAX_GS_VERTS]; diff --git a/src/mesa/drivers/dri/i965/brw_gs_emit.c b/src/mesa/drivers/dri/i965/brw_gs_emit.c index e1f751f..ce2b6d0 100644 --- a/src/mesa/drivers/dri/i965/brw_gs_emit.c +++ b/src/mesa/drivers/dri/i965/brw_gs_emit.c @@ -2,7 +2,7 @@ Copyright (C) Intel Corp. 2006. All Rights Reserved. Intel funded Tungsten Graphics (http://www.tungstengraphics.com) to develop this 3D driver. - + 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, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - + The above copyright notice and this permission notice (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 NONINFRINGEMENT. @@ -22,13 +22,13 @@ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - + **********************************************************************/ /* * Authors: * Keith Whitwell */ - + #include "main/glheader.h" #include "main/macros.h" @@ -60,12 +60,12 @@ static void brw_gs_alloc_regs( struct brw_gs_compile *c, c->reg.temp = brw_vec8_grf(i, 0); - c->prog_data.urb_read_length = c->nr_regs; + c->prog_data.urb_read_length = c->nr_regs; c->prog_data.total_grf = i; } -static void brw_gs_emit_vue(struct brw_gs_compile *c, +static void brw_gs_emit_vue(struct brw_gs_compile *c, struct brw_reg vert, GLboolean last, GLuint header) @@ -98,7 +98,7 @@ static void brw_gs_emit_vue(struct brw_gs_compile *c, * writes instantiates a seperate urb entry, and a new one must be * allocated each time. */ - brw_urb_WRITE(p, + brw_urb_WRITE(p, allocate ? temp : retype(brw_null_reg(), BRW_REGISTER_TYPE_UD), 0, temp, @@ -151,7 +151,7 @@ void brw_gs_quads( struct brw_gs_compile *c, struct brw_gs_prog_key *key ) struct intel_context *intel = &c->func.brw->intel; brw_gs_alloc_regs(c, 4); - + /* Use polygons for correct edgeflag behaviour. Note that vertex 3 * is the PV for quads, but vertex 0 for polygons: */ @@ -176,9 +176,9 @@ void brw_gs_quad_strip( struct brw_gs_compile *c, struct brw_gs_prog_key *key ) struct intel_context *intel = &c->func.brw->intel; brw_gs_alloc_regs(c, 4); - + if (intel->needs_ff_sync) - brw_gs_ff_sync(c, 1); + brw_gs_ff_sync(c, 1); if (key->pv_first) { brw_gs_emit_vue(c, c->reg.vertex[0], 0, ((_3DPRIM_POLYGON << 2) | R02_PRIM_START)); brw_gs_emit_vue(c, c->reg.vertex[1], 0, (_3DPRIM_POLYGON << 2)); @@ -200,7 +200,7 @@ void brw_gs_tris( struct brw_gs_compile *c ) brw_gs_alloc_regs(c, 3); if (intel->needs_ff_sync) - brw_gs_ff_sync(c, 1); + brw_gs_ff_sync(c, 1); brw_gs_emit_vue(c, c->reg.vertex[0], 0, ((_3DPRIM_TRILIST << 2) | R02_PRIM_START)); brw_gs_emit_vue(c, c->reg.vertex[1], 0, (_3DPRIM_TRILIST << 2)); brw_gs_emit_vue(c, c->reg.vertex[2], 1, ((_3DPRIM_TRILIST << 2) | R02_PRIM_END)); @@ -213,7 +213,7 @@ void brw_gs_lines( struct brw_gs_compile *c ) brw_gs_alloc_regs(c, 2); if (intel->needs_ff_sync) - brw_gs_ff_sync(c, 1); + brw_gs_ff_sync(c, 1); brw_gs_emit_vue(c, c->reg.vertex[0], 0, ((_3DPRIM_LINESTRIP << 2) | R02_PRIM_START)); brw_gs_emit_vue(c, c->reg.vertex[1], 1, ((_3DPRIM_LINESTRIP << 2) | R02_PRIM_END)); } @@ -225,7 +225,7 @@ void brw_gs_points( struct brw_gs_compile *c ) brw_gs_alloc_regs(c, 1); if (intel->needs_ff_sync) - brw_gs_ff_sync(c, 1); + brw_gs_ff_sync(c, 1); brw_gs_emit_vue(c, c->reg.vertex[0], 1, ((_3DPRIM_POINTLIST << 2) | R02_PRIM_START | R02_PRIM_END)); } diff --git a/src/mesa/drivers/dri/i965/brw_gs_state.c b/src/mesa/drivers/dri/i965/brw_gs_state.c index 69a5f7a..456cbe8 100644 --- a/src/mesa/drivers/dri/i965/brw_gs_state.c +++ b/src/mesa/drivers/dri/i965/brw_gs_state.c @@ -2,7 +2,7 @@ Copyright (C) Intel Corp. 2006. All Rights Reserved. Intel funded Tungsten Graphics (http://www.tungstengraphics.com) to develop this 3D driver. - + 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, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - + The above copyright notice and this permission notice (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 NONINFRINGEMENT. @@ -22,13 +22,13 @@ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - + **********************************************************************/ /* * Authors: * Keith Whitwell */ - + #include "brw_context.h" diff --git a/src/mesa/drivers/dri/i965/brw_misc_state.c b/src/mesa/drivers/dri/i965/brw_misc_state.c index a91b052..2d2d975 100644 --- a/src/mesa/drivers/dri/i965/brw_misc_state.c +++ b/src/mesa/drivers/dri/i965/brw_misc_state.c @@ -2,7 +2,7 @@ Copyright (C) Intel Corp. 2006. All Rights Reserved. Intel funded Tungsten Graphics (http://www.tungstengraphics.com) to develop this 3D driver. - + 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, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - + The above copyright notice and this permission notice (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 NONINFRINGEMENT. @@ -22,13 +22,13 @@ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - + **********************************************************************/ /* * Authors: * Keith Whitwell */ - + #include "intel_batchbuffer.h" @@ -179,12 +179,12 @@ const struct brw_tracked_state brw_psp_urb_cbs = { .dirty = { .mesa = 0, .brw = BRW_NEW_URB_FENCE | BRW_NEW_BATCH, - .cache = (CACHE_NEW_VS_UNIT | - CACHE_NEW_GS_UNIT | - CACHE_NEW_GS_PROG | - CACHE_NEW_CLIP_UNIT | - CACHE_NEW_SF_UNIT | - CACHE_NEW_WM_UNIT | + .cache = (CACHE_NEW_VS_UNIT | + CACHE_NEW_GS_UNIT | + CACHE_NEW_GS_PROG | + CACHE_NEW_CLIP_UNIT | + CACHE_NEW_SF_UNIT | + CACHE_NEW_WM_UNIT | CACHE_NEW_CC_UNIT) }, .prepare = prepare_psp_urb_cbs, @@ -403,7 +403,7 @@ static void upload_aa_line_parameters(struct brw_context *brw) memset(&balp, 0, sizeof(balp)); balp.header.opcode = CMD_AA_LINE_PARAMETERS; balp.header.length = sizeof(balp) / 4 - 2; - + BRW_CACHED_BATCH_STRUCT(brw, &balp); } @@ -479,7 +479,7 @@ static void upload_invarient_state( struct brw_context *brw ) struct brw_global_depth_offset_clamp gdo; memset(&gdo, 0, sizeof(gdo)); - /* Disable depth offset clamping. + /* Disable depth offset clamping. */ gdo.header.opcode = CMD_GLOBAL_DEPTH_OFFSET_CLAMP; gdo.header.length = sizeof(gdo)/4 - 2; @@ -532,7 +532,7 @@ static void upload_invarient_state( struct brw_context *brw ) vfs.opcode = brw->CMD_VF_STATISTICS; if (unlikely(INTEL_DEBUG & DEBUG_STATS)) - vfs.statistics_enable = 1; + vfs.statistics_enable = 1; BRW_BATCH_STRUCT(brw, &vfs); } diff --git a/src/mesa/drivers/dri/i965/brw_optimize.c b/src/mesa/drivers/dri/i965/brw_optimize.c index cbed2bd..b779522 100644 --- a/src/mesa/drivers/dri/i965/brw_optimize.c +++ b/src/mesa/drivers/dri/i965/brw_optimize.c @@ -139,7 +139,7 @@ brw_is_grf_written(const struct brw_instruction *inst, if (inst->header.opcode == BRW_OPCODE_SEND) { if (gen >= 5) length = inst->bits3.generic_gen5.response_length*REG_SIZE; - else + else length = inst->bits3.generic.response_length*REG_SIZE; } else { @@ -268,7 +268,7 @@ brw_is_mrf_read(const struct brw_instruction *inst, int length, read_start, read_end; if (gen >= 5) length = inst->bits3.generic_gen5.msg_length*REG_SIZE; - else + else length = inst->bits3.generic.msg_length*REG_SIZE; /* Look if SEND uses an implicit mov. In that case, we read one less register diff --git a/src/mesa/drivers/dri/i965/brw_program.c b/src/mesa/drivers/dri/i965/brw_program.c index 7d65332..825582a 100644 --- a/src/mesa/drivers/dri/i965/brw_program.c +++ b/src/mesa/drivers/dri/i965/brw_program.c @@ -2,7 +2,7 @@ Copyright (C) Intel Corp. 2006. All Rights Reserved. Intel funded Tungsten Graphics (http://www.tungstengraphics.com) to develop this 3D driver. - + 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, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - + The above copyright notice and this permission notice (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 NONINFRINGEMENT. @@ -22,13 +22,13 @@ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - + **********************************************************************/ /* * Authors: * Keith Whitwell */ - + #include "main/imports.h" #include "main/enums.h" #include "main/shaderobj.h" @@ -42,13 +42,13 @@ #include "brw_wm.h" static void brwBindProgram( struct gl_context *ctx, - GLenum target, + GLenum target, struct gl_program *prog ) { struct brw_context *brw = brw_context(ctx); switch (target) { - case GL_VERTEX_PROGRAM_ARB: + case GL_VERTEX_PROGRAM_ARB: brw->state.dirty.brw |= BRW_NEW_VERTEX_PROGRAM; break; case GL_FRAGMENT_PROGRAM_ARB: @@ -58,7 +58,7 @@ static void brwBindProgram( struct gl_context *ctx, } static struct gl_program *brwNewProgram( struct gl_context *ctx, - GLenum target, + GLenum target, GLuint id ) { struct brw_context *brw = brw_context(ctx); @@ -101,7 +101,7 @@ static void brwDeleteProgram( struct gl_context *ctx, static GLboolean brwIsProgramNative( struct gl_context *ctx, - GLenum target, + GLenum target, struct gl_program *prog ) { return GL_TRUE; @@ -141,7 +141,7 @@ static GLboolean brwProgramStringNotify( struct gl_context *ctx, if (newFP == curFP) brw->state.dirty.brw |= BRW_NEW_FRAGMENT_PROGRAM; - newFP->id = brw->program_id++; + newFP->id = brw->program_id++; /* Don't reject fragment shaders for their Mesa IR state when we're * using the new FS backend. @@ -163,7 +163,7 @@ static GLboolean brwProgramStringNotify( struct gl_context *ctx, if (newVP->program.IsPositionInvariant) { _mesa_insert_mvp_code(ctx, &newVP->program); } - newVP->id = brw->program_id++; + newVP->id = brw->program_id++; /* Also tell tnl about it: */ @@ -233,7 +233,7 @@ static GLboolean brwProgramStringNotify( struct gl_context *ctx, void brwInitFragProgFuncs( struct dd_function_table *functions ) { - assert(functions->ProgramStringNotify == _tnl_program_string); + assert(functions->ProgramStringNotify == _tnl_program_string); functions->BindProgram = brwBindProgram; functions->NewProgram = brwNewProgram; diff --git a/src/mesa/drivers/dri/i965/brw_queryobj.c b/src/mesa/drivers/dri/i965/brw_queryobj.c index 656aad6..937a68d 100644 --- a/src/mesa/drivers/dri/i965/brw_queryobj.c +++ b/src/mesa/drivers/dri/i965/brw_queryobj.c @@ -117,7 +117,7 @@ brw_begin_query(struct gl_context *ctx, struct gl_query_object *q) 0); OUT_BATCH(0); ADVANCE_BATCH(); - + } else { BEGIN_BATCH(4); OUT_BATCH(_3DSTATE_PIPE_CONTROL | @@ -163,7 +163,7 @@ brw_end_query(struct gl_context *ctx, struct gl_query_object *q) 8); OUT_BATCH(0); ADVANCE_BATCH(); - + } else { BEGIN_BATCH(4); OUT_BATCH(_3DSTATE_PIPE_CONTROL | @@ -273,7 +273,7 @@ brw_emit_query_begin(struct brw_context *brw) ((brw->query.index * 2) * sizeof(uint64_t))); OUT_BATCH(0); ADVANCE_BATCH(); - + } else { BEGIN_BATCH(4); OUT_BATCH(_3DSTATE_PIPE_CONTROL | @@ -330,7 +330,7 @@ brw_emit_query_end(struct brw_context *brw) ((brw->query.index * 2 + 1) * sizeof(uint64_t))); OUT_BATCH(0); ADVANCE_BATCH(); - + } else { BEGIN_BATCH(4); OUT_BATCH(_3DSTATE_PIPE_CONTROL | diff --git a/src/mesa/drivers/dri/i965/brw_sf.c b/src/mesa/drivers/dri/i965/brw_sf.c index 6da155b..6f6b6ec 100644 --- a/src/mesa/drivers/dri/i965/brw_sf.c +++ b/src/mesa/drivers/dri/i965/brw_sf.c @@ -2,7 +2,7 @@ Copyright (C) Intel Corp. 2006. All Rights Reserved. Intel funded Tungsten Graphics (http://www.tungstengraphics.com) to develop this 3D driver. - + 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, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - + The above copyright notice and this permission notice (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 NONINFRINGEMENT. @@ -22,13 +22,13 @@ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - + **********************************************************************/ /* * Authors: * Keith Whitwell */ - + #include "main/glheader.h" #include "main/macros.h" @@ -77,7 +77,7 @@ static void compile_sf_prog( struct brw_context *brw, } } - /* Which primitive? Or all three? + /* Which primitive? Or all three? */ switch (key->primitive) { case SF_TRIANGLES: @@ -140,11 +140,11 @@ static void upload_sf_prog(struct brw_context *brw) /* Populate the key, noting state dependencies: */ /* CACHE_NEW_VS_PROG */ - key.attrs = brw->vs.prog_data->outputs_written; + key.attrs = brw->vs.prog_data->outputs_written; /* BRW_NEW_REDUCED_PRIMITIVE */ switch (brw->intel.reduced_primitive) { - case GL_TRIANGLES: + case GL_TRIANGLES: /* NOTE: We just use the edgeflag attribute as an indicator that * unfilled triangles are active. We don't actually do the * edgeflag testing here, it is already done in the clip @@ -155,11 +155,11 @@ static void upload_sf_prog(struct brw_context *brw) else key.primitive = SF_TRIANGLES; break; - case GL_LINES: - key.primitive = SF_LINES; + case GL_LINES: + key.primitive = SF_LINES; break; - case GL_POINTS: - key.primitive = SF_POINTS; + case GL_POINTS: + key.primitive = SF_POINTS; break; } diff --git a/src/mesa/drivers/dri/i965/brw_sf.h b/src/mesa/drivers/dri/i965/brw_sf.h index e525c73..224e6ac 100644 --- a/src/mesa/drivers/dri/i965/brw_sf.h +++ b/src/mesa/drivers/dri/i965/brw_sf.h @@ -2,7 +2,7 @@ Copyright (C) Intel Corp. 2006. All Rights Reserved. Intel funded Tungsten Graphics (http://www.tungstengraphics.com) to develop this 3D driver. - + 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, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - + The above copyright notice and this permission notice (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 NONINFRINGEMENT. @@ -22,13 +22,13 @@ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - + **********************************************************************/ /* * Authors: * Keith Whitwell */ - + #ifndef BRW_SF_H #define BRW_SF_H @@ -61,7 +61,7 @@ struct brw_sf_compile { struct brw_compile func; struct brw_sf_prog_key key; struct brw_sf_prog_data prog_data; - + struct brw_reg pv; struct brw_reg det; struct brw_reg dx0; @@ -73,7 +73,7 @@ struct brw_sf_compile { */ struct brw_reg z[3]; struct brw_reg inv_w[3]; - + /* The vertices: */ struct brw_reg vert[3]; @@ -95,11 +95,11 @@ struct brw_sf_compile { GLuint nr_setup_attrs; GLuint nr_setup_regs; - GLubyte attr_to_idx[VERT_RESULT_MAX]; - GLubyte idx_to_attr[VERT_RESULT_MAX]; + GLubyte attr_to_idx[VERT_RESULT_MAX]; + GLubyte idx_to_attr[VERT_RESULT_MAX]; }; - + void brw_emit_tri_setup( struct brw_sf_compile *c, GLboolean allocate ); void brw_emit_line_setup( struct brw_sf_compile *c, GLboolean allocate ); void brw_emit_point_setup( struct brw_sf_compile *c, GLboolean allocate ); diff --git a/src/mesa/drivers/dri/i965/brw_sf_emit.c b/src/mesa/drivers/dri/i965/brw_sf_emit.c index d3c9756..67db5d1 100644 --- a/src/mesa/drivers/dri/i965/brw_sf_emit.c +++ b/src/mesa/drivers/dri/i965/brw_sf_emit.c @@ -2,7 +2,7 @@ Copyright (C) Intel Corp. 2006. All Rights Reserved. Intel funded Tungsten Graphics (http://www.tungstengraphics.com) to develop this 3D driver. - + 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, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - + The above copyright notice and this permission notice (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 NONINFRINGEMENT. @@ -22,13 +22,13 @@ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - + **********************************************************************/ /* * Authors: * Keith Whitwell */ - + #include "main/glheader.h" #include "main/macros.h" @@ -59,7 +59,7 @@ static GLboolean have_attr(struct brw_sf_compile *c, return (c->key.attrs & BITFIELD64_BIT(attr)) ? 1 : 0; } -/*********************************************************************** +/*********************************************************************** * Twoside lighting */ static void copy_bfc( struct brw_sf_compile *c, @@ -71,8 +71,8 @@ static void copy_bfc( struct brw_sf_compile *c, for (i = 0; i < 2; i++) { if (have_attr(c, VERT_RESULT_COL0+i) && have_attr(c, VERT_RESULT_BFC0+i)) - brw_MOV(p, - get_vert_attr(c, vert, VERT_RESULT_COL0+i), + brw_MOV(p, + get_vert_attr(c, vert, VERT_RESULT_COL0+i), get_vert_attr(c, vert, VERT_RESULT_BFC0+i)); } } @@ -96,7 +96,7 @@ static void do_twoside_color( struct brw_sf_compile *c ) if (!(have_attr(c, VERT_RESULT_COL0) && have_attr(c, VERT_RESULT_BFC0)) && !(have_attr(c, VERT_RESULT_COL1) && have_attr(c, VERT_RESULT_BFC1))) return; - + /* Need to use BRW_EXECUTE_4 and also do an 4-wide compare in order * to get all channels active inside the IF. In the clipping code * we run with NoMask, so it's not an option and we can use @@ -104,7 +104,7 @@ static void do_twoside_color( struct brw_sf_compile *c ) */ brw_push_insn_state(p); brw_CMP(p, vec4(brw_null_reg()), backface_conditional, c->det, brw_imm_f(0)); - if_insn = brw_IF(p, BRW_EXECUTE_4); + if_insn = brw_IF(p, BRW_EXECUTE_4); { switch (c->nr_verts) { case 3: copy_bfc(c, c->vert[2]); @@ -134,8 +134,8 @@ static void copy_colors( struct brw_sf_compile *c, for (i = VERT_RESULT_COL0; i <= VERT_RESULT_COL1; i++) { if (have_attr(c,i)) - brw_MOV(p, - get_vert_attr(c, dst, i), + brw_MOV(p, + get_vert_attr(c, dst, i), get_vert_attr(c, src, i)); } } @@ -166,7 +166,7 @@ static void do_flatshade_triangle( struct brw_sf_compile *c ) jmpi = 2; brw_push_insn_state(p); - + brw_MUL(p, c->pv, c->pv, brw_imm_d(jmpi*(nr*2+1))); brw_JMPI(p, ip, ip, c->pv); @@ -183,7 +183,7 @@ static void do_flatshade_triangle( struct brw_sf_compile *c ) brw_pop_insn_state(p); } - + static void do_flatshade_line( struct brw_sf_compile *c ) { @@ -196,7 +196,7 @@ static void do_flatshade_line( struct brw_sf_compile *c ) if (!nr) return; - /* Already done in clip program: + /* Already done in clip program: */ if (c->key.primitive == SF_UNFILLED_TRIS) return; @@ -205,7 +205,7 @@ static void do_flatshade_line( struct brw_sf_compile *c ) jmpi = 2; brw_push_insn_state(p); - + brw_MUL(p, c->pv, c->pv, brw_imm_d(jmpi*(nr+1))); brw_JMPI(p, ip, ip, c->pv); copy_colors(c, c->vert[1], c->vert[0]); @@ -216,7 +216,7 @@ static void do_flatshade_line( struct brw_sf_compile *c ) brw_pop_insn_state(p); } - + /*********************************************************************** * Triangle setup. @@ -244,7 +244,7 @@ static void alloc_regs( struct brw_sf_compile *c ) c->inv_w[1] = brw_vec1_grf(2, 3); c->z[2] = brw_vec1_grf(2, 4); c->inv_w[2] = brw_vec1_grf(2, 5); - + /* The vertices: */ reg = 3; @@ -263,7 +263,7 @@ static void alloc_regs( struct brw_sf_compile *c ) /* Note grf allocation: */ c->prog_data.total_grf = reg; - + /* Outputs of this program - interpolation coefficients for * rasterization: @@ -280,12 +280,12 @@ static void copy_z_inv_w( struct brw_sf_compile *c ) GLuint i; brw_push_insn_state(p); - + /* Copy both scalars with a single MOV: */ for (i = 0; i < c->nr_verts; i++) brw_MOV(p, vec2(suboffset(c->vert[i], 2)), vec2(c->z[i])); - + brw_pop_insn_state(p); } @@ -295,11 +295,11 @@ static void invert_det( struct brw_sf_compile *c) /* Looks like we invert all 8 elements just to get 1/det in * position 2 !?! */ - brw_math(&c->func, - c->inv_det, + brw_math(&c->func, + c->inv_det, BRW_MATH_FUNCTION_INV, BRW_MATH_SATURATE_NONE, - 0, + 0, c->det, BRW_MATH_DATA_SCALAR, BRW_MATH_PRECISION_FULL); @@ -332,7 +332,7 @@ static GLboolean calculate_masks( struct brw_sf_compile *c, *pc_persp = 0; *pc_linear = 0; *pc = 0xf; - + if (persp_mask & BITFIELD64_BIT(c->idx_to_attr[reg*2])) *pc_persp = 0xf; @@ -396,13 +396,13 @@ void brw_emit_tri_setup( struct brw_sf_compile *c, GLboolean allocate) invert_det(c); copy_z_inv_w(c); - if (c->key.do_twoside_color) + if (c->key.do_twoside_color) do_twoside_color(c); if (c->key.do_flat_shading) do_flatshade_triangle(c); - - + + for (i = 0; i < c->nr_setup_regs; i++) { /* Pair of incoming attributes: @@ -420,10 +420,10 @@ void brw_emit_tri_setup( struct brw_sf_compile *c, GLboolean allocate) brw_MUL(p, a1, a1, c->inv_w[1]); brw_MUL(p, a2, a2, c->inv_w[2]); } - - + + /* Calculate coefficients for interpolated values: - */ + */ if (pc_linear) { brw_set_predicate_control_flag_value(p, pc_linear); @@ -436,7 +436,7 @@ void brw_emit_tri_setup( struct brw_sf_compile *c, GLboolean allocate) brw_MUL(p, brw_null_reg(), c->a1_sub_a0, c->dy2); brw_MAC(p, c->tmp, c->a2_sub_a0, negate(c->dy0)); brw_MUL(p, c->m1Cx, c->tmp, c->inv_det); - + /* calculate dA/dy */ brw_MUL(p, brw_null_reg(), c->a2_sub_a0, c->dx0); @@ -445,15 +445,15 @@ void brw_emit_tri_setup( struct brw_sf_compile *c, GLboolean allocate) } { - brw_set_predicate_control_flag_value(p, pc); + brw_set_predicate_control_flag_value(p, pc); /* start point for interpolation */ brw_MOV(p, c->m3C0, a0); - + /* Copy m0..m3 to URB. m0 is implicitly copied from r0 in * the send instruction: - */ - brw_urb_WRITE(p, + */ + brw_urb_WRITE(p, brw_null_reg(), 0, brw_vec8_grf(0, 0), /* r0, will be copied to m0 */ @@ -507,27 +507,27 @@ void brw_emit_line_setup( struct brw_sf_compile *c, GLboolean allocate) /* Calculate coefficients for position, color: */ if (pc_linear) { - brw_set_predicate_control_flag_value(p, pc_linear); + brw_set_predicate_control_flag_value(p, pc_linear); brw_ADD(p, c->a1_sub_a0, a1, negate(a0)); - brw_MUL(p, c->tmp, c->a1_sub_a0, c->dx0); + brw_MUL(p, c->tmp, c->a1_sub_a0, c->dx0); brw_MUL(p, c->m1Cx, c->tmp, c->inv_det); - + brw_MUL(p, c->tmp, c->a1_sub_a0, c->dy0); brw_MUL(p, c->m2Cy, c->tmp, c->inv_det); } { - brw_set_predicate_control_flag_value(p, pc); + brw_set_predicate_control_flag_value(p, pc); /* start point for interpolation */ brw_MOV(p, c->m3C0, a0); - /* Copy m0..m3 to URB. + /* Copy m0..m3 to URB. */ - brw_urb_WRITE(p, + brw_urb_WRITE(p, brw_null_reg(), 0, brw_vec8_grf(0, 0), @@ -538,9 +538,9 @@ void brw_emit_line_setup( struct brw_sf_compile *c, GLboolean allocate) last, /* eot */ last, /* writes complete */ i*4, /* urb destination offset */ - BRW_URB_SWIZZLE_TRANSPOSE); + BRW_URB_SWIZZLE_TRANSPOSE); } - } + } } void brw_emit_point_sprite_setup( struct brw_sf_compile *c, GLboolean allocate) @@ -642,7 +642,7 @@ void brw_emit_point_setup( struct brw_sf_compile *c, GLboolean allocate) GLuint i; c->nr_verts = 1; - + if (allocate) alloc_regs(c); @@ -656,9 +656,9 @@ void brw_emit_point_setup( struct brw_sf_compile *c, GLboolean allocate) struct brw_reg a0 = offset(c->vert[0], i); GLushort pc, pc_persp, pc_linear; GLboolean last = calculate_masks(c, i, &pc, &pc_persp, &pc_linear); - + if (pc_persp) - { + { /* This seems odd as the values are all constant, but the * fragment shader will be expecting it: */ @@ -672,13 +672,13 @@ void brw_emit_point_setup( struct brw_sf_compile *c, GLboolean allocate) * code in the fragment shader. */ { - brw_set_predicate_control_flag_value(p, pc); + brw_set_predicate_control_flag_value(p, pc); brw_MOV(p, c->m3C0, a0); /* constant value */ - /* Copy m0..m3 to URB. + /* Copy m0..m3 to URB. */ - brw_urb_WRITE(p, + brw_urb_WRITE(p, brw_null_reg(), 0, brw_vec8_grf(0, 0), @@ -699,11 +699,11 @@ void brw_emit_anyprim_setup( struct brw_sf_compile *c ) struct brw_compile *p = &c->func; struct brw_reg ip = brw_ip_reg(); struct brw_reg payload_prim = brw_uw1_reg(BRW_GENERAL_REGISTER_FILE, 1, 0); - struct brw_reg payload_attr = get_element_ud(brw_vec1_reg(BRW_GENERAL_REGISTER_FILE, 1, 0), 0); + struct brw_reg payload_attr = get_element_ud(brw_vec1_reg(BRW_GENERAL_REGISTER_FILE, 1, 0), 0); struct brw_reg primmask; struct brw_instruction *jmp; struct brw_reg v1_null_ud = vec1(retype(brw_null_reg(), BRW_REGISTER_TYPE_UD)); - + GLuint saveflag; c->nr_verts = 3; @@ -725,7 +725,7 @@ void brw_emit_anyprim_setup( struct brw_sf_compile *c ) jmp = brw_JMPI(p, ip, ip, brw_imm_d(0)); { saveflag = p->flag_value; - brw_push_insn_state(p); + brw_push_insn_state(p); brw_emit_tri_setup( c, GL_FALSE ); brw_pop_insn_state(p); p->flag_value = saveflag; @@ -746,25 +746,25 @@ void brw_emit_anyprim_setup( struct brw_sf_compile *c ) jmp = brw_JMPI(p, ip, ip, brw_imm_d(0)); { saveflag = p->flag_value; - brw_push_insn_state(p); + brw_push_insn_state(p); brw_emit_line_setup( c, GL_FALSE ); brw_pop_insn_state(p); p->flag_value = saveflag; /* note - thread killed in subroutine */ } - brw_land_fwd_jump(p, jmp); + brw_land_fwd_jump(p, jmp); brw_set_conditionalmod(p, BRW_CONDITIONAL_Z); brw_AND(p, v1_null_ud, payload_attr, brw_imm_ud(1<flag_value; - brw_push_insn_state(p); + brw_push_insn_state(p); brw_emit_point_sprite_setup( c, GL_FALSE ); brw_pop_insn_state(p); p->flag_value = saveflag; } - brw_land_fwd_jump(p, jmp); + brw_land_fwd_jump(p, jmp); brw_emit_point_setup( c, GL_FALSE ); } diff --git a/src/mesa/drivers/dri/i965/brw_sf_state.c b/src/mesa/drivers/dri/i965/brw_sf_state.c index bd3a21e..fd0cacb 100644 --- a/src/mesa/drivers/dri/i965/brw_sf_state.c +++ b/src/mesa/drivers/dri/i965/brw_sf_state.c @@ -2,7 +2,7 @@ Copyright (C) Intel Corp. 2006. All Rights Reserved. Intel funded Tungsten Graphics (http://www.tungstengraphics.com) to develop this 3D driver. - + 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, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - + The above copyright notice and this permission notice (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 NONINFRINGEMENT. @@ -22,13 +22,13 @@ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - + **********************************************************************/ /* * Authors: * Keith Whitwell */ - + #include "brw_context.h" @@ -110,7 +110,7 @@ static void upload_sf_vp(struct brw_context *brw) const struct brw_tracked_state brw_sf_vp = { .dirty = { - .mesa = (_NEW_VIEWPORT | + .mesa = (_NEW_VIEWPORT | _NEW_SCISSOR | _NEW_BUFFERS), .brw = 0, @@ -280,7 +280,7 @@ sf_unit_create_from_key(struct brw_context *brw, struct brw_sf_unit_key *key, * "Intel® 965 Express Chipset Family and Intel® G35 Express * Chipset Graphics Controller Programmer's Reference Manual, * Volume 2: 3D/Media", Revision 1.0b as of January 2008, - * available at + * available at * http://intellinuxgraphics.org/documentation.html * at the time of this writing). * @@ -362,10 +362,10 @@ static void upload_sf_unit( struct brw_context *brw ) const struct brw_tracked_state brw_sf_unit = { .dirty = { - .mesa = (_NEW_POLYGON | + .mesa = (_NEW_POLYGON | _NEW_LIGHT | - _NEW_LINE | - _NEW_POINT | + _NEW_LINE | + _NEW_POINT | _NEW_SCISSOR | _NEW_BUFFERS), .brw = BRW_NEW_URB_FENCE, diff --git a/src/mesa/drivers/dri/i965/brw_state.h b/src/mesa/drivers/dri/i965/brw_state.h index 4bb93e7..3c5e89d 100644 --- a/src/mesa/drivers/dri/i965/brw_state.h +++ b/src/mesa/drivers/dri/i965/brw_state.h @@ -2,7 +2,7 @@ Copyright (C) Intel Corp. 2006. All Rights Reserved. Intel funded Tungsten Graphics (http://www.tungstengraphics.com) to develop this 3D driver. - + 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, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - + The above copyright notice and this permission notice (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 NONINFRINGEMENT. @@ -22,13 +22,13 @@ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - + **********************************************************************/ /* * Authors: * Keith Whitwell */ - + #ifndef BRW_STATE_H #define BRW_STATE_H diff --git a/src/mesa/drivers/dri/i965/brw_state_batch.c b/src/mesa/drivers/dri/i965/brw_state_batch.c index a21af13..0f59196 100644 --- a/src/mesa/drivers/dri/i965/brw_state_batch.c +++ b/src/mesa/drivers/dri/i965/brw_state_batch.c @@ -2,7 +2,7 @@ Copyright (C) Intel Corp. 2006. All Rights Reserved. Intel funded Tungsten Graphics (http://www.tungstengraphics.com) to develop this 3D driver. - + 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, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - + The above copyright notice and this permission notice (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 NONINFRINGEMENT. @@ -22,13 +22,13 @@ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - + **********************************************************************/ /* * Authors: * Keith Whitwell */ - + #include "brw_state.h" diff --git a/src/mesa/drivers/dri/i965/brw_state_cache.c b/src/mesa/drivers/dri/i965/brw_state_cache.c index 58ff528..f1c6a7d 100644 --- a/src/mesa/drivers/dri/i965/brw_state_cache.c +++ b/src/mesa/drivers/dri/i965/brw_state_cache.c @@ -2,7 +2,7 @@ Copyright (C) Intel Corp. 2006. All Rights Reserved. Intel funded Tungsten Graphics (http://www.tungstengraphics.com) to develop this 3D driver. - + 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, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - + The above copyright notice and this permission notice (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 NONINFRINGEMENT. @@ -22,7 +22,7 @@ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - + **********************************************************************/ /* * Authors: diff --git a/src/mesa/drivers/dri/i965/brw_state_dump.c b/src/mesa/drivers/dri/i965/brw_state_dump.c index e262887..a664aa5 100644 --- a/src/mesa/drivers/dri/i965/brw_state_dump.c +++ b/src/mesa/drivers/dri/i965/brw_state_dump.c @@ -272,7 +272,7 @@ static void dump_depth_stencil_state(struct brw_context *brw) ds->ds2.depth_test_enable ? "en" : "dis", ds->ds2.depth_test_func, ds->ds2.depth_write_enable ? "en" : "dis"); - drm_intel_bo_unmap(brw->cc.depth_stencil_state_bo); + drm_intel_bo_unmap(brw->cc.depth_stencil_state_bo); } static void dump_cc_state(struct brw_context *brw) @@ -299,7 +299,7 @@ static void dump_cc_state(struct brw_context *brw) state_out(name, cc, cc_off, 3, "constant green %f\n", cc->constant_g); state_out(name, cc, cc_off, 4, "constant blue %f\n", cc->constant_b); state_out(name, cc, cc_off, 5, "constant alpha %f\n", cc->constant_a); - + drm_intel_bo_unmap(brw->cc.state_bo); } diff --git a/src/mesa/drivers/dri/i965/brw_state_upload.c b/src/mesa/drivers/dri/i965/brw_state_upload.c index eba4411..a74a069 100644 --- a/src/mesa/drivers/dri/i965/brw_state_upload.c +++ b/src/mesa/drivers/dri/i965/brw_state_upload.c @@ -2,7 +2,7 @@ Copyright (C) Intel Corp. 2006. All Rights Reserved. Intel funded Tungsten Graphics (http://www.tungstengraphics.com) to develop this 3D driver. - + 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, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - + The above copyright notice and this permission notice (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 NONINFRINGEMENT. @@ -22,13 +22,13 @@ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - + **********************************************************************/ /* * Authors: * Keith Whitwell */ - + #include "brw_context.h" @@ -48,8 +48,8 @@ static const struct brw_tracked_state *gen4_atoms[] = &brw_wm_input_sizes, &brw_vs_prog, - &brw_gs_prog, - &brw_clip_prog, + &brw_gs_prog, + &brw_clip_prog, &brw_sf_prog, &brw_wm_prog, @@ -76,7 +76,7 @@ static const struct brw_tracked_state *gen4_atoms[] = &brw_sf_unit, &brw_vs_unit, /* always required, enabled or not */ &brw_clip_unit, - &brw_gs_unit, + &brw_gs_unit, /* Command packets: */ @@ -440,7 +440,7 @@ void brw_upload_state(struct brw_context *brw) * state flags which are generated and checked to help ensure * state atoms are ordered correctly in the list. */ - struct brw_state_flags examined, prev; + struct brw_state_flags examined, prev; memset(&examined, 0, sizeof(examined)); prev = *state; diff --git a/src/mesa/drivers/dri/i965/brw_structs.h b/src/mesa/drivers/dri/i965/brw_structs.h index 8b6646c..2c13a65 100644 --- a/src/mesa/drivers/dri/i965/brw_structs.h +++ b/src/mesa/drivers/dri/i965/brw_structs.h @@ -2,7 +2,7 @@ Copyright (C) Intel Corp. 2006. All Rights Reserved. Intel funded Tungsten Graphics (http://www.tungstengraphics.com) to develop this 3D driver. - + 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, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - + The above copyright notice and this permission notice (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 NONINFRINGEMENT. @@ -22,13 +22,13 @@ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - + **********************************************************************/ /* * Authors: * Keith Whitwell */ - + #ifndef BRW_STRUCTS_H #define BRW_STRUCTS_H @@ -43,10 +43,10 @@ /* Command packets: */ -struct header +struct header { - GLuint length:16; - GLuint opcode:16; + GLuint length:16; + GLuint opcode:16; }; @@ -57,27 +57,27 @@ union header_union }; struct brw_3d_control -{ - struct +{ + struct { GLuint length:8; GLuint notify_enable:1; GLuint pad:3; - GLuint wc_flush_enable:1; - GLuint depth_stall_enable:1; - GLuint operation:2; - GLuint opcode:16; + GLuint wc_flush_enable:1; + GLuint depth_stall_enable:1; + GLuint operation:2; + GLuint opcode:16; } header; - + struct { GLuint pad:2; - GLuint dest_addr_type:1; - GLuint dest_addr:29; + GLuint dest_addr_type:1; + GLuint dest_addr:29; } dest; - - GLuint dword2; - GLuint dword3; + + GLuint dword2; + GLuint dword3; }; @@ -85,18 +85,18 @@ struct brw_3d_primitive { struct { - GLuint length:8; + GLuint length:8; GLuint pad:2; - GLuint topology:5; - GLuint indexed:1; - GLuint opcode:16; + GLuint topology:5; + GLuint indexed:1; + GLuint opcode:16; } header; - GLuint verts_per_instance; - GLuint start_vert_location; - GLuint instance_count; - GLuint start_instance_location; - GLuint base_vert_location; + GLuint verts_per_instance; + GLuint start_vert_location; + GLuint instance_count; + GLuint start_instance_location; + GLuint base_vert_location; }; /* These seem to be passed around as function args, so it works out @@ -126,49 +126,49 @@ struct brw_vf_statistics struct brw_binding_table_pointers { struct header header; - GLuint vs; - GLuint gs; - GLuint clp; - GLuint sf; - GLuint wm; + GLuint vs; + GLuint gs; + GLuint clp; + GLuint sf; + GLuint wm; }; struct brw_blend_constant_color { struct header header; - GLfloat blend_constant_color[4]; + GLfloat blend_constant_color[4]; }; struct brw_depthbuffer { union header_union header; - + union { struct { - GLuint pitch:18; - GLuint format:3; + GLuint pitch:18; + GLuint format:3; GLuint pad:2; GLuint software_tiled_rendering_mode:2; - GLuint depth_offset_disable:1; - GLuint tile_walk:1; - GLuint tiled_surface:1; + GLuint depth_offset_disable:1; + GLuint tile_walk:1; + GLuint tiled_surface:1; GLuint pad2:1; - GLuint surface_type:3; + GLuint surface_type:3; } bits; GLuint dword; } dword1; - - GLuint dword2_base_addr; - + + GLuint dword2_base_addr; + union { struct { GLuint pad:1; - GLuint mipmap_layout:1; - GLuint lod:4; - GLuint width:13; - GLuint height:13; + GLuint mipmap_layout:1; + GLuint lod:4; + GLuint width:13; + GLuint height:13; } bits; GLuint dword; } dword3; @@ -176,8 +176,8 @@ struct brw_depthbuffer union { struct { GLuint pad:10; - GLuint min_array_element:11; - GLuint depth:11; + GLuint min_array_element:11; + GLuint depth:11; } bits; GLuint dword; } dword4; @@ -186,31 +186,31 @@ struct brw_depthbuffer struct brw_depthbuffer_g4x { union header_union header; - + union { struct { - GLuint pitch:18; - GLuint format:3; + GLuint pitch:18; + GLuint format:3; GLuint pad:2; GLuint software_tiled_rendering_mode:2; - GLuint depth_offset_disable:1; - GLuint tile_walk:1; - GLuint tiled_surface:1; + GLuint depth_offset_disable:1; + GLuint tile_walk:1; + GLuint tiled_surface:1; GLuint pad2:1; - GLuint surface_type:3; + GLuint surface_type:3; } bits; GLuint dword; } dword1; - - GLuint dword2_base_addr; - + + GLuint dword2_base_addr; + union { struct { GLuint pad:1; - GLuint mipmap_layout:1; - GLuint lod:4; - GLuint width:13; - GLuint height:13; + GLuint mipmap_layout:1; + GLuint lod:4; + GLuint width:13; + GLuint height:13; } bits; GLuint dword; } dword3; @@ -218,8 +218,8 @@ struct brw_depthbuffer_g4x union { struct { GLuint pad:10; - GLuint min_array_element:11; - GLuint depth:11; + GLuint min_array_element:11; + GLuint depth:11; } bits; GLuint dword; } dword4; @@ -236,12 +236,12 @@ struct brw_depthbuffer_g4x struct brw_drawrect { struct header header; - GLuint xmin:16; - GLuint ymin:16; - GLuint xmax:16; - GLuint ymax:16; - GLuint xorg:16; - GLuint yorg:16; + GLuint xmin:16; + GLuint ymin:16; + GLuint xmax:16; + GLuint ymax:16; + GLuint xorg:16; + GLuint yorg:16; }; @@ -250,26 +250,26 @@ struct brw_drawrect struct brw_global_depth_offset_clamp { struct header header; - GLfloat depth_offset_clamp; + GLfloat depth_offset_clamp; }; struct brw_indexbuffer -{ +{ union { struct { - GLuint length:8; - GLuint index_format:2; - GLuint cut_index_enable:1; - GLuint pad:5; - GLuint opcode:16; + GLuint length:8; + GLuint index_format:2; + GLuint cut_index_enable:1; + GLuint pad:5; + GLuint opcode:16; } bits; GLuint dword; } header; - GLuint buffer_start; - GLuint buffer_end; + GLuint buffer_start; + GLuint buffer_end; }; /* NEW in Integrated Graphics Device */ @@ -293,20 +293,20 @@ struct brw_aa_line_parameters }; struct brw_line_stipple -{ +{ struct header header; - + struct { - GLuint pattern:16; + GLuint pattern:16; GLuint pad:16; } bits0; - + struct { - GLuint repeat_count:9; + GLuint repeat_count:9; GLuint pad:7; - GLuint inverse_repeat_count:16; + GLuint inverse_repeat_count:16; } bits1; }; @@ -314,26 +314,26 @@ struct brw_line_stipple struct brw_pipelined_state_pointers { struct header header; - + struct { GLuint pad:5; GLuint offset:27; /* Offset from GENERAL_STATE_BASE */ } vs; - + struct { GLuint enable:1; GLuint pad:4; GLuint offset:27; /* Offset from GENERAL_STATE_BASE */ } gs; - + struct { GLuint enable:1; GLuint pad:4; GLuint offset:27; /* Offset from GENERAL_STATE_BASE */ } clp; - + struct { GLuint pad:5; @@ -345,7 +345,7 @@ struct brw_pipelined_state_pointers GLuint pad:5; GLuint offset:27; /* Offset from GENERAL_STATE_BASE */ } wm; - + struct { GLuint pad:5; @@ -359,9 +359,9 @@ struct brw_polygon_stipple_offset struct header header; struct { - GLuint y_offset:5; + GLuint y_offset:5; GLuint pad:3; - GLuint x_offset:5; + GLuint x_offset:5; GLuint pad0:19; } bits0; }; @@ -380,9 +380,9 @@ struct brw_pipeline_select { struct { - GLuint pipeline_select:1; + GLuint pipeline_select:1; GLuint pad:15; - GLuint opcode:16; + GLuint opcode:16; } header; }; @@ -419,30 +419,30 @@ struct brw_urb_fence { struct { - GLuint length:8; - GLuint vs_realloc:1; - GLuint gs_realloc:1; - GLuint clp_realloc:1; - GLuint sf_realloc:1; - GLuint vfe_realloc:1; - GLuint cs_realloc:1; + GLuint length:8; + GLuint vs_realloc:1; + GLuint gs_realloc:1; + GLuint clp_realloc:1; + GLuint sf_realloc:1; + GLuint vfe_realloc:1; + GLuint cs_realloc:1; GLuint pad:2; - GLuint opcode:16; + GLuint opcode:16; } header; struct { - GLuint vs_fence:10; - GLuint gs_fence:10; - GLuint clp_fence:10; + GLuint vs_fence:10; + GLuint gs_fence:10; + GLuint clp_fence:10; GLuint pad:2; } bits0; struct { - GLuint sf_fence:10; - GLuint vf_fence:10; - GLuint cs_fence:11; + GLuint sf_fence:10; + GLuint vf_fence:10; + GLuint cs_fence:11; GLuint pad:1; } bits1; }; @@ -453,9 +453,9 @@ struct brw_cs_urb_state struct { - GLuint nr_urb_entries:3; + GLuint nr_urb_entries:3; GLuint pad:1; - GLuint urb_entry_size:5; + GLuint urb_entry_size:5; GLuint pad0:23; } bits0; }; @@ -464,16 +464,16 @@ struct brw_constant_buffer { struct { - GLuint length:8; - GLuint valid:1; + GLuint length:8; + GLuint valid:1; GLuint pad:7; - GLuint opcode:16; + GLuint opcode:16; } header; struct { - GLuint buffer_length:6; - GLuint buffer_address:26; + GLuint buffer_length:6; + GLuint buffer_address:26; } bits0; }; @@ -485,35 +485,35 @@ struct brw_state_base_address { GLuint modify_enable:1; GLuint pad:4; - GLuint general_state_address:27; + GLuint general_state_address:27; } bits0; struct { GLuint modify_enable:1; GLuint pad:4; - GLuint surface_state_address:27; + GLuint surface_state_address:27; } bits1; struct { GLuint modify_enable:1; GLuint pad:4; - GLuint indirect_object_state_address:27; + GLuint indirect_object_state_address:27; } bits2; struct { GLuint modify_enable:1; GLuint pad:11; - GLuint general_state_upper_bound:20; + GLuint general_state_upper_bound:20; } bits3; struct { GLuint modify_enable:1; GLuint pad:11; - GLuint indirect_object_state_upper_bound:20; + GLuint indirect_object_state_upper_bound:20; } bits4; }; @@ -523,9 +523,9 @@ struct brw_state_prefetch struct { - GLuint prefetch_count:3; + GLuint prefetch_count:3; GLuint pad:3; - GLuint prefetch_pointer:26; + GLuint prefetch_pointer:26; } bits0; }; @@ -536,7 +536,7 @@ struct brw_system_instruction_pointer struct { GLuint pad:4; - GLuint system_instruction_pointer:28; + GLuint system_instruction_pointer:28; } bits0; }; @@ -550,46 +550,46 @@ struct brw_system_instruction_pointer struct thread0 { GLuint pad0:1; - GLuint grf_reg_count:3; + GLuint grf_reg_count:3; GLuint pad1:2; GLuint kernel_start_pointer:26; /* Offset from GENERAL_STATE_BASE */ }; struct thread1 { - GLuint ext_halt_exception_enable:1; - GLuint sw_exception_enable:1; - GLuint mask_stack_exception_enable:1; - GLuint timeout_exception_enable:1; - GLuint illegal_op_exception_enable:1; + GLuint ext_halt_exception_enable:1; + GLuint sw_exception_enable:1; + GLuint mask_stack_exception_enable:1; + GLuint timeout_exception_enable:1; + GLuint illegal_op_exception_enable:1; GLuint pad0:3; GLuint depth_coef_urb_read_offset:6; /* WM only */ GLuint pad1:2; - GLuint floating_point_mode:1; - GLuint thread_priority:1; - GLuint binding_table_entry_count:8; + GLuint floating_point_mode:1; + GLuint thread_priority:1; + GLuint binding_table_entry_count:8; GLuint pad3:5; - GLuint single_program_flow:1; + GLuint single_program_flow:1; }; struct thread2 { - GLuint per_thread_scratch_space:4; + GLuint per_thread_scratch_space:4; GLuint pad0:6; - GLuint scratch_space_base_pointer:22; + GLuint scratch_space_base_pointer:22; }; - + struct thread3 { - GLuint dispatch_grf_start_reg:4; - GLuint urb_entry_read_offset:6; + GLuint dispatch_grf_start_reg:4; + GLuint urb_entry_read_offset:6; GLuint pad0:1; - GLuint urb_entry_read_length:6; + GLuint urb_entry_read_length:6; GLuint pad1:1; - GLuint const_urb_entry_read_offset:6; + GLuint const_urb_entry_read_offset:6; GLuint pad2:1; - GLuint const_urb_entry_read_length:6; + GLuint const_urb_entry_read_length:6; GLuint pad3:1; }; @@ -621,41 +621,41 @@ struct brw_clip_unit_state { GLuint pad0:9; GLuint gs_output_stats:1; /* not always */ - GLuint stats_enable:1; - GLuint nr_urb_entries:7; + GLuint stats_enable:1; + GLuint nr_urb_entries:7; GLuint pad1:1; - GLuint urb_entry_allocation_size:5; + GLuint urb_entry_allocation_size:5; GLuint pad2:1; GLuint max_threads:5; /* may be less */ GLuint pad3:2; - } thread4; - + } thread4; + struct { GLuint pad0:13; - GLuint clip_mode:3; - GLuint userclip_enable_flags:8; - GLuint userclip_must_clip:1; + GLuint clip_mode:3; + GLuint userclip_enable_flags:8; + GLuint userclip_must_clip:1; GLuint negative_w_clip_test:1; - GLuint guard_band_enable:1; - GLuint viewport_z_clip_enable:1; - GLuint viewport_xy_clip_enable:1; - GLuint vertex_position_space:1; - GLuint api_mode:1; + GLuint guard_band_enable:1; + GLuint viewport_z_clip_enable:1; + GLuint viewport_xy_clip_enable:1; + GLuint vertex_position_space:1; + GLuint api_mode:1; GLuint pad2:1; } clip5; - + struct { GLuint pad0:5; - GLuint clipper_viewport_state_ptr:27; + GLuint clipper_viewport_state_ptr:27; } clip6; - - GLfloat viewport_xmin; - GLfloat viewport_xmax; - GLfloat viewport_ymin; - GLfloat viewport_ymax; + + GLfloat viewport_xmin; + GLfloat viewport_xmax; + GLfloat viewport_ymin; + GLfloat viewport_ymax; }; struct gen6_blend_state @@ -763,88 +763,88 @@ struct brw_cc_unit_state struct { GLuint pad0:3; - GLuint bf_stencil_pass_depth_pass_op:3; - GLuint bf_stencil_pass_depth_fail_op:3; - GLuint bf_stencil_fail_op:3; - GLuint bf_stencil_func:3; - GLuint bf_stencil_enable:1; + GLuint bf_stencil_pass_depth_pass_op:3; + GLuint bf_stencil_pass_depth_fail_op:3; + GLuint bf_stencil_fail_op:3; + GLuint bf_stencil_func:3; + GLuint bf_stencil_enable:1; GLuint pad1:2; - GLuint stencil_write_enable:1; - GLuint stencil_pass_depth_pass_op:3; - GLuint stencil_pass_depth_fail_op:3; - GLuint stencil_fail_op:3; - GLuint stencil_func:3; - GLuint stencil_enable:1; + GLuint stencil_write_enable:1; + GLuint stencil_pass_depth_pass_op:3; + GLuint stencil_pass_depth_fail_op:3; + GLuint stencil_fail_op:3; + GLuint stencil_func:3; + GLuint stencil_enable:1; } cc0; - + struct { - GLuint bf_stencil_ref:8; - GLuint stencil_write_mask:8; - GLuint stencil_test_mask:8; - GLuint stencil_ref:8; + GLuint bf_stencil_ref:8; + GLuint stencil_write_mask:8; + GLuint stencil_test_mask:8; + GLuint stencil_ref:8; } cc1; - + struct { - GLuint logicop_enable:1; + GLuint logicop_enable:1; GLuint pad0:10; - GLuint depth_write_enable:1; - GLuint depth_test_function:3; - GLuint depth_test:1; - GLuint bf_stencil_write_mask:8; - GLuint bf_stencil_test_mask:8; + GLuint depth_write_enable:1; + GLuint depth_test_function:3; + GLuint depth_test:1; + GLuint bf_stencil_write_mask:8; + GLuint bf_stencil_test_mask:8; } cc2; - + struct { GLuint pad0:8; - GLuint alpha_test_func:3; - GLuint alpha_test:1; - GLuint blend_enable:1; - GLuint ia_blend_enable:1; + GLuint alpha_test_func:3; + GLuint alpha_test:1; + GLuint blend_enable:1; + GLuint ia_blend_enable:1; GLuint pad1:1; GLuint alpha_test_format:1; GLuint pad2:16; } cc3; - + struct { - GLuint pad0:5; + GLuint pad0:5; GLuint cc_viewport_state_offset:27; /* Offset from GENERAL_STATE_BASE */ } cc4; - + struct { GLuint pad0:2; - GLuint ia_dest_blend_factor:5; - GLuint ia_src_blend_factor:5; - GLuint ia_blend_function:3; - GLuint statistics_enable:1; - GLuint logicop_func:4; + GLuint ia_dest_blend_factor:5; + GLuint ia_src_blend_factor:5; + GLuint ia_blend_function:3; + GLuint statistics_enable:1; + GLuint logicop_func:4; GLuint pad1:11; - GLuint dither_enable:1; + GLuint dither_enable:1; } cc5; struct { - GLuint clamp_post_alpha_blend:1; - GLuint clamp_pre_alpha_blend:1; - GLuint clamp_range:2; + GLuint clamp_post_alpha_blend:1; + GLuint clamp_pre_alpha_blend:1; + GLuint clamp_range:2; GLuint pad0:11; - GLuint y_dither_offset:2; - GLuint x_dither_offset:2; - GLuint dest_blend_factor:5; - GLuint src_blend_factor:5; - GLuint blend_function:3; + GLuint y_dither_offset:2; + GLuint x_dither_offset:2; + GLuint dest_blend_factor:5; + GLuint src_blend_factor:5; + GLuint blend_function:3; } cc6; struct { union { - GLfloat f; + GLfloat f; GLubyte ub[4]; } alpha_ref; } cc7; @@ -860,51 +860,51 @@ struct brw_sf_unit_state struct { GLuint pad0:10; - GLuint stats_enable:1; - GLuint nr_urb_entries:7; + GLuint stats_enable:1; + GLuint nr_urb_entries:7; GLuint pad1:1; - GLuint urb_entry_allocation_size:5; + GLuint urb_entry_allocation_size:5; GLuint pad2:1; - GLuint max_threads:6; + GLuint max_threads:6; GLuint pad3:1; - } thread4; + } thread4; struct { - GLuint front_winding:1; - GLuint viewport_transform:1; + GLuint front_winding:1; + GLuint viewport_transform:1; GLuint pad0:3; GLuint sf_viewport_state_offset:27; /* Offset from GENERAL_STATE_BASE */ } sf5; - + struct { GLuint pad0:9; - GLuint dest_org_vbias:4; - GLuint dest_org_hbias:4; - GLuint scissor:1; - GLuint disable_2x2_trifilter:1; - GLuint disable_zero_pix_trifilter:1; - GLuint point_rast_rule:2; - GLuint line_endcap_aa_region_width:2; - GLuint line_width:4; - GLuint fast_scissor_disable:1; - GLuint cull_mode:2; - GLuint aa_enable:1; + GLuint dest_org_vbias:4; + GLuint dest_org_hbias:4; + GLuint scissor:1; + GLuint disable_2x2_trifilter:1; + GLuint disable_zero_pix_trifilter:1; + GLuint point_rast_rule:2; + GLuint line_endcap_aa_region_width:2; + GLuint line_width:4; + GLuint fast_scissor_disable:1; + GLuint cull_mode:2; + GLuint aa_enable:1; } sf6; struct { - GLuint point_size:11; - GLuint use_point_size_state:1; - GLuint subpixel_precision:1; - GLuint sprite_point:1; + GLuint point_size:11; + GLuint use_point_size_state:1; + GLuint subpixel_precision:1; + GLuint sprite_point:1; GLuint pad0:10; GLuint aa_line_distance_mode:1; - GLuint trifan_pv:2; - GLuint linestrip_pv:2; - GLuint tristrip_pv:2; - GLuint line_last_pixel_enable:1; + GLuint trifan_pv:2; + GLuint linestrip_pv:2; + GLuint tristrip_pv:2; + GLuint line_last_pixel_enable:1; } sf7; }; @@ -929,33 +929,33 @@ struct brw_gs_unit_state GLuint pad0:8; GLuint rendering_enable:1; /* for Ironlake */ GLuint pad4:1; - GLuint stats_enable:1; - GLuint nr_urb_entries:7; + GLuint stats_enable:1; + GLuint nr_urb_entries:7; GLuint pad1:1; - GLuint urb_entry_allocation_size:5; + GLuint urb_entry_allocation_size:5; GLuint pad2:1; - GLuint max_threads:5; + GLuint max_threads:5; GLuint pad3:2; - } thread4; - + } thread4; + struct { - GLuint sampler_count:3; + GLuint sampler_count:3; GLuint pad0:2; - GLuint sampler_state_pointer:27; + GLuint sampler_state_pointer:27; } gs5; - + struct { - GLuint max_vp_index:4; + GLuint max_vp_index:4; GLuint pad0:12; GLuint svbi_post_inc_value:10; GLuint pad1:1; GLuint svbi_post_inc_enable:1; GLuint svbi_payload:1; GLuint discard_adjaceny:1; - GLuint reorder_enable:1; + GLuint reorder_enable:1; GLuint pad2:1; } gs6; }; @@ -967,30 +967,30 @@ struct brw_vs_unit_state struct thread1 thread1; struct thread2 thread2; struct thread3 thread3; - + struct { GLuint pad0:10; - GLuint stats_enable:1; - GLuint nr_urb_entries:7; + GLuint stats_enable:1; + GLuint nr_urb_entries:7; GLuint pad1:1; - GLuint urb_entry_allocation_size:5; + GLuint urb_entry_allocation_size:5; GLuint pad2:1; - GLuint max_threads:6; + GLuint max_threads:6; GLuint pad3:1; - } thread4; + } thread4; struct { - GLuint sampler_count:3; + GLuint sampler_count:3; GLuint pad0:2; - GLuint sampler_state_pointer:27; + GLuint sampler_state_pointer:27; } vs5; struct { - GLuint vs_enable:1; - GLuint vert_cache_disable:1; + GLuint vs_enable:1; + GLuint vert_cache_disable:1; GLuint pad0:30; } vs6; }; @@ -1002,62 +1002,62 @@ struct brw_wm_unit_state struct thread1 thread1; struct thread2 thread2; struct thread3 thread3; - + struct { - GLuint stats_enable:1; + GLuint stats_enable:1; GLuint depth_buffer_clear:1; - GLuint sampler_count:3; - GLuint sampler_state_pointer:27; + GLuint sampler_count:3; + GLuint sampler_state_pointer:27; } wm4; - + struct { - GLuint enable_8_pix:1; - GLuint enable_16_pix:1; - GLuint enable_32_pix:1; + GLuint enable_8_pix:1; + GLuint enable_16_pix:1; + GLuint enable_32_pix:1; GLuint enable_con_32_pix:1; GLuint enable_con_64_pix:1; GLuint pad0:5; - GLuint legacy_global_depth_bias:1; - GLuint line_stipple:1; - GLuint depth_offset:1; - GLuint polygon_stipple:1; - GLuint line_aa_region_width:2; - GLuint line_endcap_aa_region_width:2; - GLuint early_depth_test:1; - GLuint thread_dispatch_enable:1; - GLuint program_uses_depth:1; - GLuint program_computes_depth:1; - GLuint program_uses_killpixel:1; - GLuint legacy_line_rast: 1; - GLuint transposed_urb_read_enable:1; - GLuint max_threads:7; + GLuint legacy_global_depth_bias:1; + GLuint line_stipple:1; + GLuint depth_offset:1; + GLuint polygon_stipple:1; + GLuint line_aa_region_width:2; + GLuint line_endcap_aa_region_width:2; + GLuint early_depth_test:1; + GLuint thread_dispatch_enable:1; + GLuint program_uses_depth:1; + GLuint program_computes_depth:1; + GLuint program_uses_killpixel:1; + GLuint legacy_line_rast: 1; + GLuint transposed_urb_read_enable:1; + GLuint max_threads:7; } wm5; - - GLfloat global_depth_offset_constant; - GLfloat global_depth_offset_scale; - + + GLfloat global_depth_offset_constant; + GLfloat global_depth_offset_scale; + /* for Ironlake only */ struct { GLuint pad0:1; - GLuint grf_reg_count_1:3; + GLuint grf_reg_count_1:3; GLuint pad1:2; GLuint kernel_start_pointer_1:26; - } wm8; + } wm8; struct { GLuint pad0:1; - GLuint grf_reg_count_2:3; + GLuint grf_reg_count_2:3; GLuint pad1:2; GLuint kernel_start_pointer_2:26; - } wm9; + } wm9; struct { GLuint pad0:1; - GLuint grf_reg_count_3:3; + GLuint grf_reg_count_3:3; GLuint pad1:2; GLuint kernel_start_pointer_3:26; - } wm10; + } wm10; }; struct brw_sampler_default_color { @@ -1075,78 +1075,78 @@ struct gen5_sampler_default_color { struct brw_sampler_state { - + struct { - GLuint shadow_function:3; - GLuint lod_bias:11; - GLuint min_filter:3; - GLuint mag_filter:3; - GLuint mip_filter:2; - GLuint base_level:5; + GLuint shadow_function:3; + GLuint lod_bias:11; + GLuint min_filter:3; + GLuint mag_filter:3; + GLuint mip_filter:2; + GLuint base_level:5; GLuint min_mag_neq:1; - GLuint lod_preclamp:1; - GLuint default_color_mode:1; + GLuint lod_preclamp:1; + GLuint default_color_mode:1; GLuint pad0:1; - GLuint disable:1; + GLuint disable:1; } ss0; struct { - GLuint r_wrap_mode:3; - GLuint t_wrap_mode:3; - GLuint s_wrap_mode:3; + GLuint r_wrap_mode:3; + GLuint t_wrap_mode:3; + GLuint s_wrap_mode:3; GLuint cube_control_mode:1; GLuint pad:2; - GLuint max_lod:10; - GLuint min_lod:10; + GLuint max_lod:10; + GLuint min_lod:10; } ss1; - + struct { GLuint pad:5; - GLuint default_color_pointer:27; + GLuint default_color_pointer:27; } ss2; - + struct { GLuint non_normalized_coord:1; GLuint pad:12; GLuint address_round:6; - GLuint max_aniso:3; - GLuint chroma_key_mode:1; - GLuint chroma_key_index:2; - GLuint chroma_key_enable:1; - GLuint monochrome_filter_width:3; - GLuint monochrome_filter_height:3; + GLuint max_aniso:3; + GLuint chroma_key_mode:1; + GLuint chroma_key_index:2; + GLuint chroma_key_enable:1; + GLuint monochrome_filter_width:3; + GLuint monochrome_filter_height:3; } ss3; }; struct brw_clipper_viewport { - GLfloat xmin; - GLfloat xmax; - GLfloat ymin; - GLfloat ymax; + GLfloat xmin; + GLfloat xmax; + GLfloat ymin; + GLfloat ymax; }; struct brw_cc_viewport { - GLfloat min_depth; - GLfloat max_depth; + GLfloat min_depth; + GLfloat max_depth; }; struct brw_sf_viewport { struct { - GLfloat m00; - GLfloat m11; - GLfloat m22; - GLfloat m30; - GLfloat m31; - GLfloat m32; + GLfloat m00; + GLfloat m11; + GLfloat m22; + GLfloat m30; + GLfloat m31; + GLfloat m32; } viewport; /* scissor coordinates are inclusive */ @@ -1172,51 +1172,51 @@ struct gen6_sf_viewport { struct brw_surface_state { struct { - GLuint cube_pos_z:1; - GLuint cube_neg_z:1; - GLuint cube_pos_y:1; - GLuint cube_neg_y:1; - GLuint cube_pos_x:1; - GLuint cube_neg_x:1; + GLuint cube_pos_z:1; + GLuint cube_neg_z:1; + GLuint cube_pos_y:1; + GLuint cube_neg_y:1; + GLuint cube_pos_x:1; + GLuint cube_neg_x:1; GLuint pad:2; /* Required on gen6 for surfaces accessed through render cache messages. */ GLuint render_cache_read_write:1; /* Ironlake and newer: instead of replicating one of the texels */ GLuint cube_corner_average:1; - GLuint mipmap_layout_mode:1; - GLuint vert_line_stride_ofs:1; - GLuint vert_line_stride:1; - GLuint color_blend:1; - GLuint writedisable_blue:1; - GLuint writedisable_green:1; - GLuint writedisable_red:1; - GLuint writedisable_alpha:1; + GLuint mipmap_layout_mode:1; + GLuint vert_line_stride_ofs:1; + GLuint vert_line_stride:1; + GLuint color_blend:1; + GLuint writedisable_blue:1; + GLuint writedisable_green:1; + GLuint writedisable_red:1; + GLuint writedisable_alpha:1; GLuint surface_format:9; /**< BRW_SURFACEFORMAT_x */ - GLuint data_return_format:1; + GLuint data_return_format:1; GLuint pad0:1; GLuint surface_type:3; /**< BRW_SURFACE_1D/2D/3D/CUBE */ } ss0; - + struct { - GLuint base_addr; + GLuint base_addr; } ss1; - + struct { GLuint pad:2; - GLuint mip_count:4; - GLuint width:13; - GLuint height:13; + GLuint mip_count:4; + GLuint width:13; + GLuint height:13; } ss2; struct { - GLuint tile_walk:1; - GLuint tiled_surface:1; - GLuint pad:1; - GLuint pitch:18; - GLuint depth:11; + GLuint tile_walk:1; + GLuint tiled_surface:1; + GLuint pad:1; + GLuint pitch:18; + GLuint depth:11; } ss3; - + struct { GLuint multisample_position_palette_index:3; GLuint pad1:1; @@ -1224,7 +1224,7 @@ struct brw_surface_state GLuint pad0:1; GLuint render_target_view_extent:9; GLuint min_array_elt:11; - GLuint min_lod:4; + GLuint min_lod:4; } ss4; struct { @@ -1244,14 +1244,14 @@ struct brw_surface_state struct brw_vertex_buffer_state { struct { - GLuint pitch:11; + GLuint pitch:11; GLuint pad:15; - GLuint access_type:1; - GLuint vb_index:5; + GLuint access_type:1; + GLuint vb_index:5; } vb0; - - GLuint start_addr; - GLuint max_index; + + GLuint start_addr; + GLuint max_index; #if 1 GLuint instance_data_step_rate; /* not included for sequential/random vertices? */ #endif @@ -1269,22 +1269,22 @@ struct brw_vertex_element_state { struct { - GLuint src_offset:11; + GLuint src_offset:11; GLuint pad:5; - GLuint src_format:9; + GLuint src_format:9; GLuint pad0:1; - GLuint valid:1; - GLuint vertex_buffer_index:5; + GLuint valid:1; + GLuint vertex_buffer_index:5; } ve0; - + struct { - GLuint dst_offset:8; + GLuint dst_offset:8; GLuint pad:8; - GLuint vfcomponent3:4; - GLuint vfcomponent2:4; - GLuint vfcomponent1:4; - GLuint vfcomponent0:4; + GLuint vfcomponent3:4; + GLuint vfcomponent2:4; + GLuint vfcomponent1:4; + GLuint vfcomponent0:4; } ve1; }; @@ -1299,7 +1299,7 @@ struct brw_vertex_element_packet { struct brw_urb_immediate { GLuint opcode:4; GLuint offset:6; - GLuint swizzle_control:2; + GLuint swizzle_control:2; GLuint pad:1; GLuint allocate:1; GLuint used:1; @@ -1313,10 +1313,10 @@ struct brw_urb_immediate { /* Instruction format for the execution units: */ - + struct brw_instruction { - struct + struct { GLuint opcode:7; GLuint pad:1; @@ -1436,7 +1436,7 @@ struct brw_instruction GLuint src0_width:3; GLuint src0_vert_stride:4; GLuint flag_reg_nr:1; - GLuint pad:6; + GLuint pad:6; } ia1; struct @@ -1473,7 +1473,7 @@ struct brw_instruction GLuint pad1:6; } ia16; - struct + struct { GLuint pad:26; GLuint end_of_thread:1; @@ -1525,7 +1525,7 @@ struct brw_instruction GLuint src1_width:3; GLuint src1_vert_stride:4; GLuint flag_reg_nr:1; - GLuint pad1:6; + GLuint pad1:6; } ia1; struct @@ -1600,8 +1600,8 @@ struct brw_instruction struct { GLuint binding_table_index:8; GLuint sampler:4; - GLuint return_format:2; - GLuint msg_type:2; + GLuint return_format:2; + GLuint msg_type:2; GLuint response_length:4; GLuint msg_length:4; GLuint msg_target:4; @@ -1638,7 +1638,7 @@ struct brw_instruction struct { GLuint opcode:4; GLuint offset:6; - GLuint swizzle_control:2; + GLuint swizzle_control:2; GLuint pad:1; GLuint allocate:1; GLuint used:1; @@ -1653,9 +1653,9 @@ struct brw_instruction struct { GLuint binding_table_index:8; - GLuint msg_control:4; - GLuint msg_type:2; - GLuint target_cache:2; + GLuint msg_control:4; + GLuint msg_type:2; + GLuint target_cache:2; GLuint response_length:4; GLuint msg_length:4; GLuint msg_target:4; @@ -1677,9 +1677,9 @@ struct brw_instruction struct { GLuint binding_table_index:8; - GLuint msg_control:3; - GLuint msg_type:3; - GLuint target_cache:2; + GLuint msg_control:3; + GLuint msg_type:3; + GLuint target_cache:2; GLuint pad0:3; GLuint header_present:1; GLuint response_length:5; @@ -1692,7 +1692,7 @@ struct brw_instruction GLuint binding_table_index:8; GLuint msg_control:3; GLuint pixel_scoreboard_clear:1; - GLuint msg_type:3; + GLuint msg_type:3; GLuint send_commit_msg:1; GLuint response_length:4; GLuint msg_length:4; @@ -1705,7 +1705,7 @@ struct brw_instruction GLuint binding_table_index:8; GLuint msg_control:3; GLuint pixel_scoreboard_clear:1; - GLuint msg_type:3; + GLuint msg_type:3; GLuint send_commit_msg:1; GLuint pad0:3; GLuint header_present:1; diff --git a/src/mesa/drivers/dri/i965/brw_tex.c b/src/mesa/drivers/dri/i965/brw_tex.c index 39dfd34..1672fce 100644 --- a/src/mesa/drivers/dri/i965/brw_tex.c +++ b/src/mesa/drivers/dri/i965/brw_tex.c @@ -2,7 +2,7 @@ Copyright (C) Intel Corp. 2006. All Rights Reserved. Intel funded Tungsten Graphics (http://www.tungstengraphics.com) to develop this 3D driver. - + 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, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - + The above copyright notice and this permission notice (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 NONINFRINGEMENT. @@ -22,13 +22,13 @@ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - + **********************************************************************/ /* * Authors: * Keith Whitwell */ - + #include "main/glheader.h" #include "main/mtypes.h" diff --git a/src/mesa/drivers/dri/i965/brw_tex_layout.c b/src/mesa/drivers/dri/i965/brw_tex_layout.c index 9ac0713..61fb124 100644 --- a/src/mesa/drivers/dri/i965/brw_tex_layout.c +++ b/src/mesa/drivers/dri/i965/brw_tex_layout.c @@ -2,7 +2,7 @@ Copyright (C) Intel Corp. 2006. All Rights Reserved. Intel funded Tungsten Graphics (http://www.tungstengraphics.com) to develop this 3D driver. - + 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, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - + The above copyright notice and this permission notice (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 NONINFRINGEMENT. @@ -22,7 +22,7 @@ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - + **********************************************************************/ /* * Authors: diff --git a/src/mesa/drivers/dri/i965/brw_urb.c b/src/mesa/drivers/dri/i965/brw_urb.c index dfc1551..a9adda1 100644 --- a/src/mesa/drivers/dri/i965/brw_urb.c +++ b/src/mesa/drivers/dri/i965/brw_urb.c @@ -2,7 +2,7 @@ Copyright (C) Intel Corp. 2006. All Rights Reserved. Intel funded Tungsten Graphics (http://www.tungstengraphics.com) to develop this 3D driver. - + 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, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - + The above copyright notice and this permission notice (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 NONINFRINGEMENT. @@ -22,13 +22,13 @@ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - + **********************************************************************/ /* * Authors: * Keith Whitwell */ - + #include "intel_batchbuffer.h" @@ -134,17 +134,17 @@ static void recalculate_urb_fence( struct brw_context *brw ) (brw->urb.constrained && (brw->urb.vsize > vsize || brw->urb.sfsize > sfsize || brw->urb.csize > csize))) { - + brw->urb.csize = csize; brw->urb.sfsize = sfsize; brw->urb.vsize = vsize; - brw->urb.nr_vs_entries = limits[VS].preferred_nr_entries; - brw->urb.nr_gs_entries = limits[GS].preferred_nr_entries; + brw->urb.nr_vs_entries = limits[VS].preferred_nr_entries; + brw->urb.nr_gs_entries = limits[GS].preferred_nr_entries; brw->urb.nr_clip_entries = limits[CLP].preferred_nr_entries; - brw->urb.nr_sf_entries = limits[SF].preferred_nr_entries; - brw->urb.nr_cs_entries = limits[CS].preferred_nr_entries; + brw->urb.nr_sf_entries = limits[SF].preferred_nr_entries; + brw->urb.nr_cs_entries = limits[CS].preferred_nr_entries; brw->urb.constrained = 0; @@ -169,18 +169,18 @@ static void recalculate_urb_fence( struct brw_context *brw ) } if (!check_urb_layout(brw)) { - brw->urb.nr_vs_entries = limits[VS].min_nr_entries; - brw->urb.nr_gs_entries = limits[GS].min_nr_entries; + brw->urb.nr_vs_entries = limits[VS].min_nr_entries; + brw->urb.nr_gs_entries = limits[GS].min_nr_entries; brw->urb.nr_clip_entries = limits[CLP].min_nr_entries; - brw->urb.nr_sf_entries = limits[SF].min_nr_entries; - brw->urb.nr_cs_entries = limits[CS].min_nr_entries; + brw->urb.nr_sf_entries = limits[SF].min_nr_entries; + brw->urb.nr_cs_entries = limits[CS].min_nr_entries; /* Mark us as operating with constrained nr_entries, so that next * time we recalculate we'll resize the fences in the hope of * escaping constrained mode and getting back to normal performance. */ brw->urb.constrained = 1; - + if (!check_urb_layout(brw)) { /* This is impossible, given the maximal sizes of urb * entries and the values for minimum nr of entries @@ -189,7 +189,7 @@ static void recalculate_urb_fence( struct brw_context *brw ) printf("couldn't calculate URB layout!\n"); exit(1); } - + if (unlikely(INTEL_DEBUG & (DEBUG_URB|DEBUG_FALLBACKS))) printf("URB CONSTRAINED\n"); } @@ -201,9 +201,9 @@ static void recalculate_urb_fence( struct brw_context *brw ) brw->urb.gs_start, brw->urb.clip_start, brw->urb.sf_start, - brw->urb.cs_start, + brw->urb.cs_start, brw->urb.size); - + brw->state.dirty.brw |= BRW_NEW_URB_FENCE; } } @@ -243,9 +243,9 @@ void brw_upload_urb_fence(struct brw_context *brw) * There are 256/384 urb reg pairs in total. */ uf.bits0.vs_fence = brw->urb.gs_start; - uf.bits0.gs_fence = brw->urb.clip_start; - uf.bits0.clp_fence = brw->urb.sf_start; - uf.bits1.sf_fence = brw->urb.cs_start; + uf.bits0.gs_fence = brw->urb.clip_start; + uf.bits0.clp_fence = brw->urb.sf_start; + uf.bits1.sf_fence = brw->urb.cs_start; uf.bits1.cs_fence = brw->urb.size; BRW_BATCH_STRUCT(brw, &uf); diff --git a/src/mesa/drivers/dri/i965/brw_util.c b/src/mesa/drivers/dri/i965/brw_util.c index e878da3..80bc7b1 100644 --- a/src/mesa/drivers/dri/i965/brw_util.c +++ b/src/mesa/drivers/dri/i965/brw_util.c @@ -2,7 +2,7 @@ Copyright (C) Intel Corp. 2006. All Rights Reserved. Intel funded Tungsten Graphics (http://www.tungstengraphics.com) to develop this 3D driver. - + 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, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - + The above copyright notice and this permission notice (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 NONINFRINGEMENT. @@ -22,13 +22,13 @@ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - + **********************************************************************/ /* * Authors: * Keith Whitwell */ - + #include @@ -50,17 +50,17 @@ GLuint brw_count_bits(uint64_t val) GLuint brw_translate_blend_equation( GLenum mode ) { switch (mode) { - case GL_FUNC_ADD: - return BRW_BLENDFUNCTION_ADD; - case GL_MIN: - return BRW_BLENDFUNCTION_MIN; - case GL_MAX: - return BRW_BLENDFUNCTION_MAX; - case GL_FUNC_SUBTRACT: - return BRW_BLENDFUNCTION_SUBTRACT; - case GL_FUNC_REVERSE_SUBTRACT: - return BRW_BLENDFUNCTION_REVERSE_SUBTRACT; - default: + case GL_FUNC_ADD: + return BRW_BLENDFUNCTION_ADD; + case GL_MIN: + return BRW_BLENDFUNCTION_MIN; + case GL_MAX: + return BRW_BLENDFUNCTION_MAX; + case GL_FUNC_SUBTRACT: + return BRW_BLENDFUNCTION_SUBTRACT; + case GL_FUNC_REVERSE_SUBTRACT: + return BRW_BLENDFUNCTION_REVERSE_SUBTRACT; + default: assert(0); return BRW_BLENDFUNCTION_ADD; } @@ -69,38 +69,38 @@ GLuint brw_translate_blend_equation( GLenum mode ) GLuint brw_translate_blend_factor( GLenum factor ) { switch(factor) { - case GL_ZERO: - return BRW_BLENDFACTOR_ZERO; - case GL_SRC_ALPHA: - return BRW_BLENDFACTOR_SRC_ALPHA; - case GL_ONE: - return BRW_BLENDFACTOR_ONE; - case GL_SRC_COLOR: - return BRW_BLENDFACTOR_SRC_COLOR; - case GL_ONE_MINUS_SRC_COLOR: - return BRW_BLENDFACTOR_INV_SRC_COLOR; - case GL_DST_COLOR: - return BRW_BLENDFACTOR_DST_COLOR; - case GL_ONE_MINUS_DST_COLOR: - return BRW_BLENDFACTOR_INV_DST_COLOR; + case GL_ZERO: + return BRW_BLENDFACTOR_ZERO; + case GL_SRC_ALPHA: + return BRW_BLENDFACTOR_SRC_ALPHA; + case GL_ONE: + return BRW_BLENDFACTOR_ONE; + case GL_SRC_COLOR: + return BRW_BLENDFACTOR_SRC_COLOR; + case GL_ONE_MINUS_SRC_COLOR: + return BRW_BLENDFACTOR_INV_SRC_COLOR; + case GL_DST_COLOR: + return BRW_BLENDFACTOR_DST_COLOR; + case GL_ONE_MINUS_DST_COLOR: + return BRW_BLENDFACTOR_INV_DST_COLOR; case GL_ONE_MINUS_SRC_ALPHA: - return BRW_BLENDFACTOR_INV_SRC_ALPHA; - case GL_DST_ALPHA: - return BRW_BLENDFACTOR_DST_ALPHA; + return BRW_BLENDFACTOR_INV_SRC_ALPHA; + case GL_DST_ALPHA: + return BRW_BLENDFACTOR_DST_ALPHA; case GL_ONE_MINUS_DST_ALPHA: - return BRW_BLENDFACTOR_INV_DST_ALPHA; - case GL_SRC_ALPHA_SATURATE: + return BRW_BLENDFACTOR_INV_DST_ALPHA; + case GL_SRC_ALPHA_SATURATE: return BRW_BLENDFACTOR_SRC_ALPHA_SATURATE; case GL_CONSTANT_COLOR: - return BRW_BLENDFACTOR_CONST_COLOR; + return BRW_BLENDFACTOR_CONST_COLOR; case GL_ONE_MINUS_CONSTANT_COLOR: return BRW_BLENDFACTOR_INV_CONST_COLOR; case GL_CONSTANT_ALPHA: - return BRW_BLENDFACTOR_CONST_ALPHA; + return BRW_BLENDFACTOR_CONST_ALPHA; case GL_ONE_MINUS_CONSTANT_ALPHA: return BRW_BLENDFACTOR_INV_CONST_ALPHA; default: assert(0); return BRW_BLENDFACTOR_ZERO; - } + } } diff --git a/src/mesa/drivers/dri/i965/brw_util.h b/src/mesa/drivers/dri/i965/brw_util.h index 04f3175..d21a05b 100644 --- a/src/mesa/drivers/dri/i965/brw_util.h +++ b/src/mesa/drivers/dri/i965/brw_util.h @@ -2,7 +2,7 @@ Copyright (C) Intel Corp. 2006. All Rights Reserved. Intel funded Tungsten Graphics (http://www.tungstengraphics.com) to develop this 3D driver. - + 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, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - + The above copyright notice and this permission notice (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 NONINFRINGEMENT. @@ -22,13 +22,13 @@ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - + **********************************************************************/ /* * Authors: * Keith Whitwell */ - + #ifndef BRW_UTIL_H #define BRW_UTIL_H diff --git a/src/mesa/drivers/dri/i965/brw_vs.c b/src/mesa/drivers/dri/i965/brw_vs.c index 6ae75d2..433dfe6 100644 --- a/src/mesa/drivers/dri/i965/brw_vs.c +++ b/src/mesa/drivers/dri/i965/brw_vs.c @@ -2,7 +2,7 @@ Copyright (C) Intel Corp. 2006. All Rights Reserved. Intel funded Tungsten Graphics (http://www.tungstengraphics.com) to develop this 3D driver. - + 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, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - + The above copyright notice and this permission notice (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 NONINFRINGEMENT. @@ -22,13 +22,13 @@ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - + **********************************************************************/ /* * Authors: * Keith Whitwell */ - + #include "brw_context.h" #include "brw_vs.h" @@ -39,7 +39,7 @@ -static void do_vs_prog( struct brw_context *brw, +static void do_vs_prog( struct brw_context *brw, struct brw_vertex_program *vp, struct brw_vs_prog_key *key ) { @@ -117,7 +117,7 @@ static void brw_upload_vs_prog(struct brw_context *brw) { struct gl_context *ctx = &brw->intel.ctx; struct brw_vs_prog_key key; - struct brw_vertex_program *vp = + struct brw_vertex_program *vp = (struct brw_vertex_program *)brw->vertex_program; int i; diff --git a/src/mesa/drivers/dri/i965/brw_vs.h b/src/mesa/drivers/dri/i965/brw_vs.h index 0b88cc1..4869477 100644 --- a/src/mesa/drivers/dri/i965/brw_vs.h +++ b/src/mesa/drivers/dri/i965/brw_vs.h @@ -2,7 +2,7 @@ Copyright (C) Intel Corp. 2006. All Rights Reserved. Intel funded Tungsten Graphics (http://www.tungstengraphics.com) to develop this 3D driver. - + 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, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - + The above copyright notice and this permission notice (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 NONINFRINGEMENT. @@ -22,13 +22,13 @@ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - + **********************************************************************/ /* * Authors: * Keith Whitwell */ - + #ifndef BRW_VS_H #define BRW_VS_H @@ -71,7 +71,7 @@ struct brw_vs_compile { struct brw_reg tmp; struct brw_reg stack; - struct { + struct { GLboolean used_in_src; struct brw_reg reg; } output_regs[128]; diff --git a/src/mesa/drivers/dri/i965/brw_vs_constval.c b/src/mesa/drivers/dri/i965/brw_vs_constval.c index 47cc0a7..d3f705c 100644 --- a/src/mesa/drivers/dri/i965/brw_vs_constval.c +++ b/src/mesa/drivers/dri/i965/brw_vs_constval.c @@ -2,7 +2,7 @@ Copyright (C) Intel Corp. 2006. All Rights Reserved. Intel funded Tungsten Graphics (http://www.tungstengraphics.com) to develop this 3D driver. - + 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, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - + The above copyright notice and this permission notice (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 NONINFRINGEMENT. @@ -22,13 +22,13 @@ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - + **********************************************************************/ /* * Authors: * Keith Whitwell */ - + #include "main/macros.h" #include "brw_context.h" @@ -103,7 +103,7 @@ static GLubyte get_active( struct tracker *t, if (src.RelAddr) return 0xf; - for (i = 0; i < 4; i++) + for (i = 0; i < 4; i++) active |= get_active_component(t, src.File, src.Index, i, GET_SWZ(src.Swizzle, i)); @@ -133,10 +133,10 @@ static void calc_sizes( struct tracker *t ) GLint vertRes; if (t->twoside) { - t->active[PROGRAM_OUTPUT][VERT_RESULT_COL0] |= + t->active[PROGRAM_OUTPUT][VERT_RESULT_COL0] |= t->active[PROGRAM_OUTPUT][VERT_RESULT_BFC0]; - t->active[PROGRAM_OUTPUT][VERT_RESULT_COL1] |= + t->active[PROGRAM_OUTPUT][VERT_RESULT_COL1] |= t->active[PROGRAM_OUTPUT][VERT_RESULT_BFC1]; } @@ -205,14 +205,14 @@ static void calc_wm_input_sizes( struct brw_context *brw ) if (ctx->Light.Model.TwoSide) t.twoside = 1; - for (i = 0; i < VERT_ATTRIB_MAX; i++) + for (i = 0; i < VERT_ATTRIB_MAX; i++) if (vp->program.Base.InputsRead & (1<program.Base.NumInstructions; insn++) { struct prog_instruction *inst = &vp->program.Base.Instructions[insn]; - + switch (inst->Opcode) { case OPCODE_ARL: break; diff --git a/src/mesa/drivers/dri/i965/brw_vs_emit.c b/src/mesa/drivers/dri/i965/brw_vs_emit.c index 0411ce0..9bc522e 100644 --- a/src/mesa/drivers/dri/i965/brw_vs_emit.c +++ b/src/mesa/drivers/dri/i965/brw_vs_emit.c @@ -2,7 +2,7 @@ Copyright (C) Intel Corp. 2006. All Rights Reserved. Intel funded Tungsten Graphics (http://www.tungstengraphics.com) to develop this 3D driver. - + 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, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - + The above copyright notice and this permission notice (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 NONINFRINGEMENT. @@ -22,13 +22,13 @@ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - + **********************************************************************/ /* * Authors: * Keith Whitwell */ - + #include "main/macros.h" #include "program/program.h" @@ -92,7 +92,7 @@ static void release_tmp( struct brw_vs_compile *c, struct brw_reg tmp ) if (tmp.nr == c->last_tmp-1) c->last_tmp--; } - + static void release_tmps( struct brw_vs_compile *c ) { c->last_tmp = c->first_tmp; @@ -166,7 +166,7 @@ static void brw_vs_alloc_regs( struct brw_vs_compile *c ) c->r0 = brw_vec8_grf(reg, 0); reg++; - /* User clip planes from curbe: + /* User clip planes from curbe: */ if (c->key.nr_userclip) { if (intel->gen >= 6) { @@ -261,7 +261,7 @@ static void brw_vs_alloc_regs( struct brw_vs_compile *c ) if (intel->gen < 6 && c->prog_data.nr_params == 0) c->prog_data.nr_params = 4; - /* Allocate input regs: + /* Allocate input regs: */ c->nr_inputs = 0; for (i = 0; i < VERT_ATTRIB_MAX; i++) { @@ -362,7 +362,7 @@ static void brw_vs_alloc_regs( struct brw_vs_compile *c ) } } } - } + } /* Allocate program temporaries: */ @@ -534,7 +534,7 @@ static void unalias3( struct brw_vs_compile *c, static void emit_sop( struct brw_vs_compile *c, struct brw_reg dst, struct brw_reg arg0, - struct brw_reg arg1, + struct brw_reg arg1, GLuint cond) { struct brw_compile *p = &c->func; @@ -620,7 +620,7 @@ static void emit_sign(struct brw_vs_compile *c, brw_set_predicate_control(p, BRW_PREDICATE_NONE); } -static void emit_max( struct brw_compile *p, +static void emit_max( struct brw_compile *p, struct brw_reg dst, struct brw_reg arg0, struct brw_reg arg1 ) @@ -639,7 +639,7 @@ static void emit_max( struct brw_compile *p, } } -static void emit_min( struct brw_compile *p, +static void emit_min( struct brw_compile *p, struct brw_reg dst, struct brw_reg arg0, struct brw_reg arg1 ) @@ -698,7 +698,7 @@ static void emit_math1_gen4(struct brw_vs_compile *c, if (need_tmp) tmp = get_tmp(c); - brw_math(p, + brw_math(p, tmp, function, BRW_MATH_SATURATE_NONE, @@ -765,7 +765,7 @@ emit_math1(struct brw_vs_compile *c, emit_math1_gen4(c, function, dst, arg0, precision); } -static void emit_math2_gen4( struct brw_vs_compile *c, +static void emit_math2_gen4( struct brw_vs_compile *c, GLuint function, struct brw_reg dst, struct brw_reg arg0, @@ -780,12 +780,12 @@ static void emit_math2_gen4( struct brw_vs_compile *c, dst.dw1.bits.writemask != 0xf) need_tmp = GL_TRUE; - if (need_tmp) + if (need_tmp) tmp = get_tmp(c); brw_MOV(p, brw_message_reg(3), arg1); - - brw_math(p, + + brw_math(p, tmp, function, BRW_MATH_SATURATE_NONE, @@ -800,7 +800,7 @@ static void emit_math2_gen4( struct brw_vs_compile *c, } } -static void emit_math2_gen6( struct brw_vs_compile *c, +static void emit_math2_gen6( struct brw_vs_compile *c, GLuint function, struct brw_reg dst, struct brw_reg arg0, @@ -816,7 +816,7 @@ static void emit_math2_gen6( struct brw_vs_compile *c, brw_MOV(p, tmp_src0, arg0); brw_MOV(p, tmp_src1, arg1); - + brw_set_access_mode(p, BRW_ALIGN_1); brw_math2(p, tmp_dst, @@ -832,7 +832,7 @@ static void emit_math2_gen6( struct brw_vs_compile *c, release_tmp(c, tmp_dst); } -static void emit_math2( struct brw_vs_compile *c, +static void emit_math2( struct brw_vs_compile *c, GLuint function, struct brw_reg dst, struct brw_reg arg0, @@ -853,7 +853,7 @@ static void emit_exp_noalias( struct brw_vs_compile *c, struct brw_reg arg0 ) { struct brw_compile *p = &c->func; - + if (dst.dw1.bits.writemask & WRITEMASK_X) { struct brw_reg tmp = get_tmp(c); @@ -864,15 +864,15 @@ static void emit_exp_noalias( struct brw_vs_compile *c, /* result[0] = 2.0 ^ tmp */ - /* Adjust exponent for floating point: - * exp += 127 + /* Adjust exponent for floating point: + * exp += 127 */ brw_ADD(p, brw_writemask(tmp_d, WRITEMASK_X), tmp_d, brw_imm_d(127)); - /* Install exponent and sign. - * Excess drops off the edge: + /* Install exponent and sign. + * Excess drops off the edge: */ - brw_SHL(p, brw_writemask(retype(dst, BRW_REGISTER_TYPE_D), WRITEMASK_X), + brw_SHL(p, brw_writemask(retype(dst, BRW_REGISTER_TYPE_D), WRITEMASK_X), tmp_d, brw_imm_d(23)); release_tmp(c, tmp); @@ -882,7 +882,7 @@ static void emit_exp_noalias( struct brw_vs_compile *c, /* result[1] = arg0.x - floor(arg0.x) */ brw_FRC(p, brw_writemask(dst, WRITEMASK_Y), brw_swizzle1(arg0, 0)); } - + if (dst.dw1.bits.writemask & WRITEMASK_Z) { /* As with the LOG instruction, we might be better off just * doing a taylor expansion here, seeing as we have to do all @@ -891,12 +891,12 @@ static void emit_exp_noalias( struct brw_vs_compile *c, * If mathbox partial precision is too low, consider also: * result[3] = result[0] * EXP(result[1]) */ - emit_math1(c, - BRW_MATH_FUNCTION_EXP, + emit_math1(c, + BRW_MATH_FUNCTION_EXP, brw_writemask(dst, WRITEMASK_Z), - brw_swizzle1(arg0, 0), + brw_swizzle1(arg0, 0), BRW_MATH_PRECISION_FULL); - } + } if (dst.dw1.bits.writemask & WRITEMASK_W) { /* result[3] = 1.0; */ @@ -920,7 +920,7 @@ static void emit_log_noalias( struct brw_vs_compile *c, tmp = get_tmp(c); tmp_ud = retype(tmp, BRW_REGISTER_TYPE_UD); } - + /* Perform mant = frexpf(fabsf(x), &exp), adjust exp and mnt * according to spec: * @@ -931,34 +931,34 @@ static void emit_log_noalias( struct brw_vs_compile *c, * result[1].i = (x.i & ((1<<23)-1) + (127<<23) */ if (dst.dw1.bits.writemask & WRITEMASK_XZ) { - brw_AND(p, + brw_AND(p, brw_writemask(tmp_ud, WRITEMASK_X), brw_swizzle1(arg0_ud, 0), brw_imm_ud((1U<<31)-1)); - brw_SHR(p, - brw_writemask(tmp_ud, WRITEMASK_X), + brw_SHR(p, + brw_writemask(tmp_ud, WRITEMASK_X), tmp_ud, brw_imm_ud(23)); - brw_ADD(p, - brw_writemask(tmp, WRITEMASK_X), + brw_ADD(p, + brw_writemask(tmp, WRITEMASK_X), retype(tmp_ud, BRW_REGISTER_TYPE_D), /* does it matter? */ brw_imm_d(-127)); } if (dst.dw1.bits.writemask & WRITEMASK_YZ) { - brw_AND(p, + brw_AND(p, brw_writemask(tmp_ud, WRITEMASK_Y), brw_swizzle1(arg0_ud, 0), brw_imm_ud((1<<23)-1)); - brw_OR(p, - brw_writemask(tmp_ud, WRITEMASK_Y), + brw_OR(p, + brw_writemask(tmp_ud, WRITEMASK_Y), tmp_ud, brw_imm_ud(127<<23)); } - + if (dst.dw1.bits.writemask & WRITEMASK_Z) { /* result[2] = result[0] + LOG2(result[1]); */ @@ -966,23 +966,23 @@ static void emit_log_noalias( struct brw_vs_compile *c, * taylor series. Maybe we *should* use a taylor series as by * the time all the above has been done it's almost certainly * quicker than calling the mathbox, even with low precision. - * + * * Options are: * - result[0] + mathbox.LOG2(result[1]) * - mathbox.LOG2(arg0.x) * - result[0] + inline_taylor_approx(result[1]) */ - emit_math1(c, - BRW_MATH_FUNCTION_LOG, - brw_writemask(tmp, WRITEMASK_Z), - brw_swizzle1(tmp, 1), + emit_math1(c, + BRW_MATH_FUNCTION_LOG, + brw_writemask(tmp, WRITEMASK_Z), + brw_swizzle1(tmp, 1), BRW_MATH_PRECISION_FULL); - - brw_ADD(p, - brw_writemask(tmp, WRITEMASK_Z), - brw_swizzle1(tmp, 2), + + brw_ADD(p, + brw_writemask(tmp, WRITEMASK_Z), + brw_swizzle1(tmp, 2), brw_swizzle1(tmp, 0)); - } + } if (dst.dw1.bits.writemask & WRITEMASK_W) { /* result[3] = 1.0; */ @@ -998,14 +998,14 @@ static void emit_log_noalias( struct brw_vs_compile *c, /* Need to unalias - consider swizzles: r0 = DST r0.xxxx r1 */ -static void emit_dst_noalias( struct brw_vs_compile *c, +static void emit_dst_noalias( struct brw_vs_compile *c, struct brw_reg dst, struct brw_reg arg0, struct brw_reg arg1) { struct brw_compile *p = &c->func; - /* There must be a better way to do this: + /* There must be a better way to do this: */ if (dst.dw1.bits.writemask & WRITEMASK_X) brw_MOV(p, brw_writemask(dst, WRITEMASK_X), brw_imm_f(1.0)); @@ -1028,7 +1028,7 @@ static void emit_xpd( struct brw_compile *p, } -static void emit_lit_noalias( struct brw_vs_compile *c, +static void emit_lit_noalias( struct brw_vs_compile *c, struct brw_reg dst, struct brw_reg arg0 ) { @@ -1037,11 +1037,11 @@ static void emit_lit_noalias( struct brw_vs_compile *c, struct brw_reg tmp = dst; GLboolean need_tmp = (dst.file != BRW_GENERAL_REGISTER_FILE); - if (need_tmp) + if (need_tmp) tmp = get_tmp(c); - - brw_MOV(p, brw_writemask(dst, WRITEMASK_YZ), brw_imm_f(0)); - brw_MOV(p, brw_writemask(dst, WRITEMASK_XW), brw_imm_f(1)); + + brw_MOV(p, brw_writemask(dst, WRITEMASK_YZ), brw_imm_f(0)); + brw_MOV(p, brw_writemask(dst, WRITEMASK_XW), brw_imm_f(1)); /* Need to use BRW_EXECUTE_8 and also do an 8-wide compare in order * to get all channels active inside the IF. In the clipping code @@ -1057,12 +1057,12 @@ static void emit_lit_noalias( struct brw_vs_compile *c, brw_MOV(p, brw_writemask(tmp, WRITEMASK_Z), brw_swizzle1(arg0,1)); brw_set_predicate_control(p, BRW_PREDICATE_NONE); - emit_math2(c, - BRW_MATH_FUNCTION_POW, + emit_math2(c, + BRW_MATH_FUNCTION_POW, brw_writemask(dst, WRITEMASK_Z), brw_swizzle1(tmp, 2), brw_swizzle1(arg0, 3), - BRW_MATH_PRECISION_PARTIAL); + BRW_MATH_PRECISION_PARTIAL); } brw_ENDIF(p, if_insn); @@ -1084,7 +1084,7 @@ static void emit_lrp_noalias(struct brw_vs_compile *c, } /** 3 or 4-component vector normalization */ -static void emit_nrm( struct brw_vs_compile *c, +static void emit_nrm( struct brw_vs_compile *c, struct brw_reg dst, struct brw_reg arg0, int num_comps) @@ -1210,8 +1210,8 @@ static struct brw_reg get_reg( struct brw_vs_compile *c, case PROGRAM_UNDEFINED: /* undef values */ return brw_null_reg(); - case PROGRAM_LOCAL_PARAM: - case PROGRAM_ENV_PARAM: + case PROGRAM_LOCAL_PARAM: + case PROGRAM_ENV_PARAM: case PROGRAM_WRITE_ONLY: default: assert(0); @@ -1419,7 +1419,7 @@ static struct brw_reg get_arg( struct brw_vs_compile *c, reg = get_src_reg(c, inst, argIndex); - /* Convert 3-bit swizzle to 2-bit. + /* Convert 3-bit swizzle to 2-bit. */ if (reg.file != BRW_IMMEDIATE_VALUE) { reg.dw1.bits.swizzle = BRW_SWIZZLE4(GET_SWZ(src->Swizzle, 0), @@ -1478,7 +1478,7 @@ static struct brw_reg get_dst( struct brw_vs_compile *c, } -static void emit_swz( struct brw_vs_compile *c, +static void emit_swz( struct brw_vs_compile *c, struct brw_reg dst, const struct prog_instruction *inst) { @@ -1517,7 +1517,7 @@ static void emit_swz( struct brw_vs_compile *c, } } } - + /* Do src first, in case dst aliases src: */ if (src_mask) { @@ -1525,22 +1525,22 @@ static void emit_swz( struct brw_vs_compile *c, arg0 = get_src_reg(c, inst, argIndex); - arg0 = brw_swizzle(arg0, - src_swz[0], src_swz[1], + arg0 = brw_swizzle(arg0, + src_swz[0], src_swz[1], src_swz[2], src_swz[3]); brw_MOV(p, brw_writemask(tmp, src_mask), arg0); - } - - if (zeros_mask) + } + + if (zeros_mask) brw_MOV(p, brw_writemask(tmp, zeros_mask), brw_imm_f(0)); - if (ones_mask) + if (ones_mask) brw_MOV(p, brw_writemask(tmp, ones_mask), brw_imm_f(1)); if (src.Negate) brw_MOV(p, brw_writemask(tmp, src.Negate), negate(tmp)); - + if (need_tmp) { brw_MOV(p, dst, tmp); release_tmp(c, tmp); @@ -1563,7 +1563,7 @@ static void emit_vertex_write( struct brw_vs_compile *c) int next_mrf, i; if (c->key.copy_edgeflag) { - brw_MOV(p, + brw_MOV(p, get_reg(c, PROGRAM_OUTPUT, VERT_RESULT_EDGE), get_reg(c, PROGRAM_INPUT, VERT_ATTRIB_EDGEFLAG)); } @@ -1612,7 +1612,7 @@ static void emit_vertex_write( struct brw_vs_compile *c) brw_MOV(p, header1, brw_imm_ud(0)); - brw_set_access_mode(p, BRW_ALIGN_16); + brw_set_access_mode(p, BRW_ALIGN_16); if (c->prog_data.outputs_written & BITFIELD64_BIT(VERT_RESULT_PSIZ)) { struct brw_reg psiz = c->regs[PROGRAM_OUTPUT][VERT_RESULT_PSIZ]; @@ -1629,9 +1629,9 @@ static void emit_vertex_write( struct brw_vs_compile *c) brw_set_predicate_control(p, BRW_PREDICATE_NONE); } - /* i965 clipping workaround: + /* i965 clipping workaround: * 1) Test for -ve rhw - * 2) If set, + * 2) If set, * set ndc = (0,0,0,0) * set ucp[6] = 1 * @@ -1644,7 +1644,7 @@ static void emit_vertex_write( struct brw_vs_compile *c) BRW_CONDITIONAL_L, brw_swizzle1(ndc, 3), brw_imm_f(0)); - + brw_OR(p, brw_writemask(header1, WRITEMASK_W), header1, brw_imm_ud(1<<6)); brw_MOV(p, ndc, brw_imm_f(0)); brw_set_predicate_control(p, BRW_PREDICATE_NONE); @@ -1727,7 +1727,7 @@ static void emit_vertex_write( struct brw_vs_compile *c) eot = (c->first_overflow_output == 0); - brw_urb_WRITE(p, + brw_urb_WRITE(p, brw_null_reg(), /* dest */ 0, /* starting mrf reg nr */ c->r0, /* src */ @@ -1851,7 +1851,7 @@ void brw_vs_emit(struct brw_vs_compile *c ) GLuint insn, if_depth = 0, loop_depth = 0; struct brw_instruction *if_inst[MAX_IF_DEPTH], *loop_inst[MAX_LOOP_DEPTH] = { 0 }; int if_depth_in_loop[MAX_LOOP_DEPTH]; - const struct brw_indirect stack_index = brw_indirect(0, 0); + const struct brw_indirect stack_index = brw_indirect(0, 0); GLuint index; GLuint file; @@ -1878,7 +1878,7 @@ void brw_vs_emit(struct brw_vs_compile *c ) for (i = 0; i < 3; i++) { struct prog_src_register *src = &inst->SrcReg[i]; GLuint index = src->Index; - GLuint file = src->File; + GLuint file = src->File; if (file == PROGRAM_OUTPUT && index != VERT_RESULT_HPOS) c->output_regs[index].used_in_src = GL_TRUE; } @@ -1917,7 +1917,7 @@ void brw_vs_emit(struct brw_vs_compile *c ) for (i = 0; i < 3; i++) { const struct prog_src_register *src = &inst->SrcReg[i]; index = src->Index; - file = src->File; + file = src->File; if (file == PROGRAM_OUTPUT && c->output_regs[index].used_in_src) args[i] = c->output_regs[index].reg; else @@ -1927,7 +1927,7 @@ void brw_vs_emit(struct brw_vs_compile *c ) /* Get dest regs. Note that it is possible for a reg to be both * dst and arg, given the static allocation of registers. So * care needs to be taken emitting multi-operation instructions. - */ + */ index = inst->DstReg.Index; file = inst->DstReg.File; if (file == PROGRAM_OUTPUT && c->output_regs[index].used_in_src) @@ -1970,7 +1970,7 @@ void brw_vs_emit(struct brw_vs_compile *c ) emit_nrm(c, dst, args[0], 4); break; case OPCODE_DST: - unalias2(c, dst, args[0], args[1], emit_dst_noalias); + unalias2(c, dst, args[0], args[1], emit_dst_noalias); break; case OPCODE_EXP: unalias1(c, dst, args[0], emit_exp_noalias); @@ -2020,7 +2020,7 @@ void brw_vs_emit(struct brw_vs_compile *c ) brw_MUL(p, dst, args[0], args[1]); break; case OPCODE_POW: - emit_math2(c, BRW_MATH_FUNCTION_POW, dst, args[0], args[1], BRW_MATH_PRECISION_FULL); + emit_math2(c, BRW_MATH_FUNCTION_POW, dst, args[0], args[1], BRW_MATH_PRECISION_FULL); break; case OPCODE_RCP: emit_math1(c, BRW_MATH_FUNCTION_INV, dst, args[0], BRW_MATH_PRECISION_FULL); @@ -2087,7 +2087,7 @@ void brw_vs_emit(struct brw_vs_compile *c ) assert(if_depth > 0); brw_ENDIF(p, if_inst[--if_depth]); if_depth_in_loop[loop_depth]--; - break; + break; case OPCODE_BGNLOOP: clear_current_const(c); loop_inst[loop_depth++] = brw_DO(p, BRW_EXECUTE_8); diff --git a/src/mesa/drivers/dri/i965/brw_vs_state.c b/src/mesa/drivers/dri/i965/brw_vs_state.c index c3a7cc2..41e4d01 100644 --- a/src/mesa/drivers/dri/i965/brw_vs_state.c +++ b/src/mesa/drivers/dri/i965/brw_vs_state.c @@ -2,7 +2,7 @@ Copyright (C) Intel Corp. 2006. All Rights Reserved. Intel funded Tungsten Graphics (http://www.tungstengraphics.com) to develop this 3D driver. - + 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, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - + The above copyright notice and this permission notice (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 NONINFRINGEMENT. @@ -22,13 +22,13 @@ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - + **********************************************************************/ /* * Authors: * Keith Whitwell */ - + #include "brw_context.h" diff --git a/src/mesa/drivers/dri/i965/brw_vtbl.c b/src/mesa/drivers/dri/i965/brw_vtbl.c index 3d7a98c..432883b 100644 --- a/src/mesa/drivers/dri/i965/brw_vtbl.c +++ b/src/mesa/drivers/dri/i965/brw_vtbl.c @@ -2,7 +2,7 @@ Copyright (C) Intel Corp. 2006. All Rights Reserved. Intel funded Tungsten Graphics (http://www.tungstengraphics.com) to develop this 3D driver. - + 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, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - + The above copyright notice and this permission notice (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 NONINFRINGEMENT. @@ -22,7 +22,7 @@ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - + **********************************************************************/ /* @@ -36,8 +36,8 @@ #include "main/macros.h" #include "main/colormac.h" -#include "intel_batchbuffer.h" -#include "intel_regions.h" +#include "intel_batchbuffer.h" +#include "intel_regions.h" #include "brw_context.h" #include "brw_defines.h" @@ -116,7 +116,7 @@ static void brw_destroy_context( struct intel_context *intel ) /** * called from intelDrawBuffer() */ -static void brw_set_draw_region( struct intel_context *intel, +static void brw_set_draw_region( struct intel_context *intel, struct intel_region *color_regions[], struct intel_region *depth_region, GLuint num_color_regions) diff --git a/src/mesa/drivers/dri/i965/brw_wm.c b/src/mesa/drivers/dri/i965/brw_wm.c index de8e3af..03eb3cd 100644 --- a/src/mesa/drivers/dri/i965/brw_wm.c +++ b/src/mesa/drivers/dri/i965/brw_wm.c @@ -2,7 +2,7 @@ Copyright (C) Intel Corp. 2006. All Rights Reserved. Intel funded Tungsten Graphics (http://www.tungstengraphics.com) to develop this 3D driver. - + 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, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - + The above copyright notice and this permission notice (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 NONINFRINGEMENT. @@ -22,13 +22,13 @@ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - + **********************************************************************/ /* * Authors: * Keith Whitwell */ - + #include "brw_context.h" #include "brw_wm.h" #include "brw_state.h" @@ -74,7 +74,7 @@ GLuint brw_wm_is_scalar_result( GLuint opcode ) case OPCODE_DPH: case OPCODE_DST: return 1; - + default: return 0; } @@ -182,7 +182,7 @@ brw_wm_payload_setup(struct brw_context *brw, * we'll use one of two code generators. */ static void do_wm_prog( struct brw_context *brw, - struct brw_fragment_program *fp, + struct brw_fragment_program *fp, struct brw_wm_prog_key *key) { struct brw_wm_compile *c; @@ -273,7 +273,7 @@ static void brw_wm_populate_key( struct brw_context *brw, { struct gl_context *ctx = &brw->intel.ctx; /* BRW_NEW_FRAGMENT_PROGRAM */ - const struct brw_fragment_program *fp = + const struct brw_fragment_program *fp = (struct brw_fragment_program *)brw->fragment_program; GLuint lookup = 0; GLuint line_aa; @@ -296,7 +296,7 @@ static void brw_wm_populate_key( struct brw_context *brw, if (ctx->Depth.Test) lookup |= IZ_DEPTH_TEST_ENABLE_BIT; - if (ctx->Depth.Test && + if (ctx->Depth.Test && ctx->Depth.Mask) /* ?? */ lookup |= IZ_DEPTH_WRITE_ENABLE_BIT; @@ -448,7 +448,7 @@ static void brw_prepare_wm_prog(struct brw_context *brw) struct brw_wm_prog_key key; struct brw_fragment_program *fp = (struct brw_fragment_program *) brw->fragment_program; - + brw_wm_populate_key(brw, &key); /* Make an early check for the key. diff --git a/src/mesa/drivers/dri/i965/brw_wm.h b/src/mesa/drivers/dri/i965/brw_wm.h index 85bb7fb..6321d3b 100644 --- a/src/mesa/drivers/dri/i965/brw_wm.h +++ b/src/mesa/drivers/dri/i965/brw_wm.h @@ -2,7 +2,7 @@ Copyright (C) Intel Corp. 2006. All Rights Reserved. Intel funded Tungsten Graphics (http://www.tungstengraphics.com) to develop this 3D driver. - + 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, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - + The above copyright notice and this permission notice (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 NONINFRINGEMENT. @@ -22,13 +22,13 @@ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - + **********************************************************************/ /* * Authors: * Keith Whitwell */ - + #ifndef BRW_WM_H #define BRW_WM_H @@ -103,7 +103,7 @@ struct brw_wm_prog_key { * are hard to reason about and which we translate away in pass0. A * single fragment program register element (eg. temp[0].x) will be * translated to one or more brw_wm_value structs, one for each time - * that temp[0].x is written to during the program. + * that temp[0].x is written to during the program. */ @@ -118,7 +118,7 @@ struct brw_wm_grf { struct brw_wm_value { struct brw_reg hw_reg; /* emitted to this reg, may not always be there */ struct brw_wm_ref *lastuse; - struct brw_wm_grf *resident; + struct brw_wm_grf *resident; GLuint contributes_to_output:1; GLuint spill_slot:16; /* if non-zero, spill immediately after calculation */ }; diff --git a/src/mesa/drivers/dri/i965/brw_wm_debug.c b/src/mesa/drivers/dri/i965/brw_wm_debug.c index 6a91251..c4f143e 100644 --- a/src/mesa/drivers/dri/i965/brw_wm_debug.c +++ b/src/mesa/drivers/dri/i965/brw_wm_debug.c @@ -2,7 +2,7 @@ Copyright (C) Intel Corp. 2006. All Rights Reserved. Intel funded Tungsten Graphics (http://www.tungstengraphics.com) to develop this 3D driver. - + 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, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - + The above copyright notice and this permission notice (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 NONINFRINGEMENT. @@ -22,13 +22,13 @@ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - + **********************************************************************/ /* * Authors: * Keith Whitwell */ - + #include "brw_context.h" #include "brw_wm.h" @@ -38,7 +38,7 @@ void brw_wm_print_value( struct brw_wm_compile *c, struct brw_wm_value *value ) { assert(value); - if (c->state >= PASS2_DONE) + if (c->state >= PASS2_DONE) brw_print_reg(value->hw_reg); else if( value == &c->undef_value ) printf("undef"); @@ -54,7 +54,7 @@ void brw_wm_print_value( struct brw_wm_compile *c, else if (value - c->payload.depth >= 0 && value - c->payload.depth < FRAG_ATTRIB_MAX) printf("d%ld", (long) (value - c->payload.depth)); - else + else printf("?"); } @@ -93,13 +93,13 @@ void brw_wm_print_insn( struct brw_wm_compile *c, } else printf("#"); - if (i < 3) + if (i < 3) printf(","); } printf("]"); if (inst->writemask != WRITEMASK_XYZW) - printf(".%s%s%s%s", + printf(".%s%s%s%s", GET_BIT(inst->writemask, 0) ? "x" : "", GET_BIT(inst->writemask, 1) ? "y" : "", GET_BIT(inst->writemask, 2) ? "z" : "", @@ -152,7 +152,7 @@ void brw_wm_print_insn( struct brw_wm_compile *c, else printf("%%"); - if (i < 3) + if (i < 3) printf(","); else printf("]"); diff --git a/src/mesa/drivers/dri/i965/brw_wm_emit.c b/src/mesa/drivers/dri/i965/brw_wm_emit.c index 56725c0..96f3b4d 100644 --- a/src/mesa/drivers/dri/i965/brw_wm_emit.c +++ b/src/mesa/drivers/dri/i965/brw_wm_emit.c @@ -2,7 +2,7 @@ Copyright (C) Intel Corp. 2006. All Rights Reserved. Intel funded Tungsten Graphics (http://www.tungstengraphics.com) to develop this 3D driver. - + 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, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - + The above copyright notice and this permission notice (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 NONINFRINGEMENT. @@ -22,13 +22,13 @@ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - + **********************************************************************/ /* * Authors: * Keith Whitwell */ - + #include "main/macros.h" #include "brw_context.h" @@ -285,7 +285,7 @@ void emit_pixel_w(struct brw_wm_compile *c, /* Don't need this if all you are doing is interpolating color, for * instance. */ - if (mask & WRITEMASK_W) { + if (mask & WRITEMASK_W) { struct brw_reg interp3 = brw_vec1_grf(arg0[0].nr+1, 4); /* Calc 1/w - just linterp wpos[3] optimized by putting the @@ -597,8 +597,8 @@ void emit_lrp(struct brw_compile *p, /* Uses dst as a temporary: */ for (i = 0; i < 4; i++) { - if (mask & (1<computes_depth) brw_MOV(p, brw_message_reg(nr), arg2[2]); - else + else brw_MOV(p, brw_message_reg(nr), arg1[1]); /* ? */ nr += 2; @@ -1524,13 +1524,13 @@ void emit_fb_write(struct brw_wm_compile *c, struct brw_reg v1_null_ud = vec1(retype(brw_null_reg(), BRW_REGISTER_TYPE_UD)); struct brw_reg ip = brw_ip_reg(); struct brw_instruction *jmp; - + brw_set_compression_control(p, BRW_COMPRESSION_NONE); brw_set_conditionalmod(p, BRW_CONDITIONAL_Z); - brw_AND(p, - v1_null_ud, - get_element_ud(brw_vec8_grf(1,0), 6), - brw_imm_ud(1<<26)); + brw_AND(p, + v1_null_ud, + get_element_ud(brw_vec8_grf(1,0), 6), + brw_imm_ud(1<<26)); jmp = brw_JMPI(p, ip, ip, brw_imm_w(0)); { @@ -1547,7 +1547,7 @@ void emit_fb_write(struct brw_wm_compile *c, } /** - * Move a GPR to scratch memory. + * Move a GPR to scratch memory. */ static void emit_spill( struct brw_wm_compile *c, struct brw_reg reg, @@ -1569,7 +1569,7 @@ static void emit_spill( struct brw_wm_compile *c, /** - * Load a GPR from scratch memory. + * Load a GPR from scratch memory. */ static void emit_unspill( struct brw_wm_compile *c, struct brw_reg reg, @@ -1629,7 +1629,7 @@ static void spill_values( struct brw_wm_compile *c, GLuint i; for (i = 0; i < nr; i++) - if (values[i].spill_slot) + if (values[i].spill_slot) emit_spill(c, values[i].hw_reg, values[i].spill_slot); } @@ -1651,17 +1651,17 @@ void brw_wm_emit( struct brw_wm_compile *c ) spill_values(c, c->payload.depth, 4); spill_values(c, c->creg, c->nr_creg); spill_values(c, c->payload.input_interp, FRAG_ATTRIB_MAX); - + for (insn = 0; insn < c->nr_insns; insn++) { struct brw_wm_instruction *inst = &c->instruction[insn]; struct brw_reg args[3][4], dst[4]; GLuint i, dst_flags; - + /* Get argument regs: */ - for (i = 0; i < 3; i++) + for (i = 0; i < 3; i++) get_argument_regs(c, inst->src[i], args[i]); /* Get dest regs: @@ -1671,11 +1671,11 @@ void brw_wm_emit( struct brw_wm_compile *c ) dst[i] = inst->dst[i]->hw_reg; else dst[i] = brw_null_reg(); - + /* Flags */ dst_flags = inst->writemask; - if (inst->saturate) + if (inst->saturate) dst_flags |= SATURATE; switch (inst->opcode) { @@ -1767,7 +1767,7 @@ void brw_wm_emit( struct brw_wm_compile *c ) emit_lrp(p, dst, dst_flags, args[0], args[1], args[2]); break; - case OPCODE_MAD: + case OPCODE_MAD: emit_mad(p, dst, dst_flags, args[0], args[1], args[2]); break; @@ -1889,11 +1889,11 @@ void brw_wm_emit( struct brw_wm_compile *c ) _mesa_opcode_string(inst->opcode) : "unknown"); } - + for (i = 0; i < 4; i++) - if (inst->dst[i] && inst->dst[i]->spill_slot) - emit_spill(c, - inst->dst[i]->hw_reg, + if (inst->dst[i] && inst->dst[i]->spill_slot) + emit_spill(c, + inst->dst[i]->hw_reg, inst->dst[i]->spill_slot); } diff --git a/src/mesa/drivers/dri/i965/brw_wm_fp.c b/src/mesa/drivers/dri/i965/brw_wm_fp.c index 4759b28..c528c9c 100644 --- a/src/mesa/drivers/dri/i965/brw_wm_fp.c +++ b/src/mesa/drivers/dri/i965/brw_wm_fp.c @@ -2,7 +2,7 @@ Copyright (C) Intel Corp. 2006. All Rights Reserved. Intel funded Tungsten Graphics (http://www.tungstengraphics.com) to develop this 3D driver. - + 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, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - + The above copyright notice and this permission notice (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 NONINFRINGEMENT. @@ -22,13 +22,13 @@ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - + **********************************************************************/ /* * Authors: * Keith Whitwell */ - + #include "main/glheader.h" #include "main/macros.h" @@ -56,7 +56,7 @@ #define W 3 -static const char *wm_opcode_strings[] = { +static const char *wm_opcode_strings[] = { "PIXELXY", "DELTAXY", "PIXELW", @@ -69,7 +69,7 @@ static const char *wm_opcode_strings[] = { }; #if 0 -static const char *wm_file_strings[] = { +static const char *wm_file_strings[] = { "PAYLOAD" }; #endif @@ -178,7 +178,7 @@ static void release_temp( struct brw_wm_compile *c, struct prog_dst_register tem /*********************************************************************** - * Instructions + * Instructions */ static struct prog_instruction *get_fp_inst(struct brw_wm_compile *c) @@ -209,7 +209,7 @@ static struct prog_instruction * emit_tex_op(struct brw_wm_compile *c, struct prog_src_register src2 ) { struct prog_instruction *inst = get_fp_inst(c); - + assert(tex_src_unit < BRW_MAX_TEX_UNIT || tex_src_unit == TEX_UNIT_NONE); assert(tex_src_target < NUM_TEXTURE_TARGETS || @@ -223,7 +223,7 @@ static struct prog_instruction * emit_tex_op(struct brw_wm_compile *c, inst->Opcode = op; inst->DstReg = dest; - inst->SaturateMode = saturate; + inst->SaturateMode = saturate; inst->TexSrcUnit = tex_src_unit; inst->TexSrcTarget = tex_src_target; inst->TexShadow = tex_shadow; @@ -232,7 +232,7 @@ static struct prog_instruction * emit_tex_op(struct brw_wm_compile *c, inst->SrcReg[2] = src2; return inst; } - + static struct prog_instruction * emit_op(struct brw_wm_compile *c, GLuint op, @@ -292,11 +292,11 @@ static struct prog_src_register get_pixel_xy( struct brw_wm_compile *c ) if (src_is_undef(c->pixel_xy)) { struct prog_dst_register pixel_xy = get_temp(c); struct prog_src_register payload_r0_depth = src_reg(PROGRAM_PAYLOAD, PAYLOAD_DEPTH); - - + + /* Emit the out calculations, and hold onto the results. Use * two instructions as a temporary is required. - */ + */ /* pixel_xy.xy = PIXELXY payload[0]; */ emit_op(c, @@ -319,17 +319,17 @@ static struct prog_src_register get_delta_xy( struct brw_wm_compile *c ) struct prog_dst_register delta_xy = get_temp(c); struct prog_src_register pixel_xy = get_pixel_xy(c); struct prog_src_register payload_r0_depth = src_reg(PROGRAM_PAYLOAD, PAYLOAD_DEPTH); - + /* deltas.xy = DELTAXY pixel_xy, payload[0] */ emit_op(c, WM_DELTAXY, dst_mask(delta_xy, WRITEMASK_XY), 0, - pixel_xy, + pixel_xy, payload_r0_depth, src_undef()); - + c->delta_xy = src_reg_from_dst(delta_xy); } @@ -358,9 +358,9 @@ static struct prog_src_register get_pixel_w( struct brw_wm_compile *c ) dst_mask(pixel_w, WRITEMASK_W), 0, interp_wpos, - deltas, + deltas, src_undef()); - + c->pixel_w = src_reg_from_dst(pixel_w); } @@ -392,7 +392,7 @@ static void emit_interp( struct brw_wm_compile *c, get_pixel_xy(c), src_undef(), src_undef()); - + dst = dst_mask(dst, WRITEMASK_ZW); /* PROGRAM_INPUT.attr.xyzw = INTERP payload.interp[attr].x, deltas.xyw @@ -517,7 +517,7 @@ static void emit_interp( struct brw_wm_compile *c, * harm and it's not as if the parameter handling isn't a big hack * anyway. */ -static struct prog_src_register search_or_add_param5(struct brw_wm_compile *c, +static struct prog_src_register search_or_add_param5(struct brw_wm_compile *c, GLint s0, GLint s1, GLint s2, @@ -539,7 +539,7 @@ static struct prog_src_register search_or_add_param5(struct brw_wm_compile *c, } -static struct prog_src_register search_or_add_const4f( struct brw_wm_compile *c, +static struct prog_src_register search_or_add_const4f( struct brw_wm_compile *c, GLfloat s0, GLfloat s1, GLfloat s2, @@ -566,7 +566,7 @@ static struct prog_src_register search_or_add_const4f( struct brw_wm_compile *c, /*********************************************************************** - * Expand various instructions here to simpler forms. + * Expand various instructions here to simpler forms. */ static void precalc_dst( struct brw_wm_compile *c, const struct prog_instruction *inst ) @@ -574,8 +574,8 @@ static void precalc_dst( struct brw_wm_compile *c, struct prog_src_register src0 = inst->SrcReg[0]; struct prog_src_register src1 = inst->SrcReg[1]; struct prog_dst_register dst = inst->DstReg; - - if (dst.WriteMask & WRITEMASK_Y) { + + if (dst.WriteMask & WRITEMASK_Y) { /* dst.y = mul src0.y, src1.y */ emit_op(c, @@ -622,7 +622,7 @@ static void precalc_lit( struct brw_wm_compile *c, { struct prog_src_register src0 = inst->SrcReg[0]; struct prog_dst_register dst = inst->DstReg; - + if (dst.WriteMask & WRITEMASK_XW) { struct prog_instruction *swz; @@ -724,9 +724,9 @@ static void precalc_tex( struct brw_wm_compile *c, release_temp(c, tmp1); } else if (inst->TexSrcTarget == TEXTURE_RECT_INDEX) { - struct prog_src_register scale = - search_or_add_param5( c, - STATE_INTERNAL, + struct prog_src_register scale = + search_or_add_param5( c, + STATE_INTERNAL, STATE_TEXRECT_SCALE, unit, 0,0 ); @@ -762,7 +762,7 @@ static void precalc_tex( struct brw_wm_compile *c, /* convert ycbcr to RGBA */ GLboolean swap_uv = c->key.yuvtex_swap_mask & (1<DstReg; @@ -779,10 +779,10 @@ static void precalc_tex( struct brw_wm_compile *c, struct prog_src_register tmpsrc = src_reg_from_dst(tmp); struct prog_src_register C0 = search_or_add_const4f( c, -.5, -.0625, -.5, 1.164 ); struct prog_src_register C1 = search_or_add_const4f( c, 1.596, -0.813, 2.018, -.391 ); - + /* tmp = TEX ... */ - emit_tex_op(c, + emit_tex_op(c, OPCODE_TEX, tmp, inst->SaturateMode, @@ -814,7 +814,7 @@ static void precalc_tex( struct brw_wm_compile *c, src_swizzle1(C0, W), src_undef()); - /* + /* * if (UV swaped) * RGB.xyz = MAD YUV.zzx, C1, YUV.y * else @@ -843,7 +843,7 @@ static void precalc_tex( struct brw_wm_compile *c, } else { /* ordinary RGBA tex instruction */ - emit_tex_op(c, + emit_tex_op(c, OPCODE_TEX, inst->DstReg, inst->SaturateMode, @@ -893,7 +893,7 @@ static GLboolean projtex( struct brw_wm_compile *c, */ if (inst->TexSrcTarget == TEXTURE_CUBE_INDEX) retVal = GL_FALSE; /* ut2004 gun rendering !?! */ - else if (src.File == PROGRAM_INPUT && + else if (src.File == PROGRAM_INPUT && GET_SWZ(src.Swizzle, W) == W && (c->key.proj_attrib_mask & (1 << src.Index)) == 0) retVal = GL_FALSE; @@ -984,7 +984,7 @@ static void emit_render_target_writes( struct brw_wm_compile *c ) /* if gl_FragData[0] is written, use it, else use gl_FragColor */ if (c->fp->program.Base.OutputsWritten & BITFIELD64_BIT(FRAG_RESULT_DATA0)) outcolor = src_reg(PROGRAM_OUTPUT, FRAG_RESULT_DATA0); - else + else outcolor = src_reg(PROGRAM_OUTPUT, FRAG_RESULT_COLOR); inst = emit_op(c, WM_FB_WRITE, dst_mask(dst_undef(),0), @@ -1015,7 +1015,7 @@ static void validate_src_regs( struct brw_wm_compile *c, } } } - + static void validate_dst_regs( struct brw_wm_compile *c, const struct prog_instruction *inst ) { @@ -1040,7 +1040,7 @@ static void print_insns( const struct prog_instruction *insn, _mesa_fprint_alu_instruction(stdout, insn, wm_opcode_strings[idx], 3, PROG_PRINT_DEBUG, NULL); } - else + else printf("965 Opcode %d\n", insn->Opcode); } } @@ -1098,11 +1098,11 @@ void brw_wm_pass_fp( struct brw_wm_compile *c ) */ switch (inst->Opcode) { - case OPCODE_SWZ: + case OPCODE_SWZ: out = emit_insn(c, inst); out->Opcode = OPCODE_MOV; break; - + case OPCODE_ABS: out = emit_insn(c, inst); out->Opcode = OPCODE_MOV; @@ -1110,19 +1110,19 @@ void brw_wm_pass_fp( struct brw_wm_compile *c ) out->SrcReg[0].Abs = 1; break; - case OPCODE_SUB: + case OPCODE_SUB: out = emit_insn(c, inst); out->Opcode = OPCODE_ADD; out->SrcReg[1].Negate ^= NEGATE_XYZW; break; - case OPCODE_SCS: + case OPCODE_SCS: out = emit_insn(c, inst); - /* This should probably be done in the parser. + /* This should probably be done in the parser. */ out->DstReg.WriteMask &= WRITEMASK_XY; break; - + case OPCODE_DST: precalc_dst(c, inst); break; @@ -1150,16 +1150,16 @@ void brw_wm_pass_fp( struct brw_wm_compile *c ) assert(out->TexSrcUnit < BRW_MAX_TEX_UNIT); break; - case OPCODE_XPD: + case OPCODE_XPD: out = emit_insn(c, inst); - /* This should probably be done in the parser. + /* This should probably be done in the parser. */ out->DstReg.WriteMask &= WRITEMASK_XYZ; break; - case OPCODE_KIL: + case OPCODE_KIL: out = emit_insn(c, inst); - /* This should probably be done in the parser. + /* This should probably be done in the parser. */ out->DstReg.WriteMask = 0; break; diff --git a/src/mesa/drivers/dri/i965/brw_wm_iz.c b/src/mesa/drivers/dri/i965/brw_wm_iz.c index 471ea1c..f7347c7 100644 --- a/src/mesa/drivers/dri/i965/brw_wm_iz.c +++ b/src/mesa/drivers/dri/i965/brw_wm_iz.c @@ -2,7 +2,7 @@ Copyright (C) Intel Corp. 2006. All Rights Reserved. Intel funded Tungsten Graphics (http://www.tungstengraphics.com) to develop this 3D driver. - + 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, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - + The above copyright notice and this permission notice (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 NONINFRINGEMENT. @@ -22,13 +22,13 @@ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - + **********************************************************************/ /* * Authors: * Keith Whitwell */ - + #include "main/mtypes.h" #include "brw_wm.h" @@ -50,70 +50,70 @@ const struct { GLuint ds_present:1; } wm_iz_table[IZ_BIT_MAX] = { - { P, 0, 0, 0, 0 }, - { P, 0, 0, 0, 0 }, - { P, 0, 0, 0, 0 }, - { P, 0, 0, 0, 0 }, - { P, 0, 0, 0, 0 }, - { N, 1, 1, 0, 0 }, - { N, 0, 1, 0, 0 }, - { N, 0, 1, 0, 0 }, - { P, 0, 0, 0, 0 }, - { P, 0, 0, 0, 0 }, - { C, 0, 1, 1, 0 }, - { C, 0, 1, 1, 0 }, - { P, 0, 0, 0, 0 }, - { N, 1, 1, 0, 0 }, - { C, 0, 1, 1, 0 }, - { C, 0, 1, 1, 0 }, - { P, 0, 0, 0, 0 }, - { P, 0, 0, 0, 0 }, - { P, 0, 0, 0, 0 }, - { P, 0, 0, 0, 0 }, - { P, 0, 0, 0, 0 }, - { N, 1, 1, 0, 0 }, - { N, 0, 1, 0, 0 }, - { N, 0, 1, 0, 0 }, - { P, 0, 0, 0, 0 }, - { P, 0, 0, 0, 0 }, - { C, 0, 1, 1, 0 }, - { C, 0, 1, 1, 0 }, - { P, 0, 0, 0, 0 }, - { N, 1, 1, 0, 0 }, - { C, 0, 1, 1, 0 }, - { C, 0, 1, 1, 0 }, - { P, 0, 0, 0, 0 }, - { P, 0, 0, 0, 0 }, - { P, 0, 0, 0, 0 }, - { P, 0, 0, 0, 0 }, - { P, 0, 0, 0, 0 }, - { N, 1, 1, 0, 1 }, - { N, 0, 1, 0, 1 }, - { N, 0, 1, 0, 1 }, - { P, 0, 0, 0, 0 }, - { P, 0, 0, 0, 0 }, - { C, 0, 1, 1, 1 }, - { C, 0, 1, 1, 1 }, - { P, 0, 0, 0, 0 }, - { N, 1, 1, 0, 1 }, - { C, 0, 1, 1, 1 }, - { C, 0, 1, 1, 1 }, - { P, 0, 0, 0, 0 }, - { C, 0, 0, 0, 1 }, - { P, 0, 0, 0, 0 }, - { C, 0, 1, 0, 1 }, - { P, 0, 0, 0, 0 }, - { C, 1, 1, 0, 1 }, - { C, 0, 1, 0, 1 }, - { C, 0, 1, 0, 1 }, - { P, 0, 0, 0, 0 }, - { C, 1, 1, 1, 1 }, - { C, 0, 1, 1, 1 }, - { C, 0, 1, 1, 1 }, - { P, 0, 0, 0, 0 }, - { C, 1, 1, 1, 1 }, - { C, 0, 1, 1, 1 }, - { C, 0, 1, 1, 1 } + { P, 0, 0, 0, 0 }, + { P, 0, 0, 0, 0 }, + { P, 0, 0, 0, 0 }, + { P, 0, 0, 0, 0 }, + { P, 0, 0, 0, 0 }, + { N, 1, 1, 0, 0 }, + { N, 0, 1, 0, 0 }, + { N, 0, 1, 0, 0 }, + { P, 0, 0, 0, 0 }, + { P, 0, 0, 0, 0 }, + { C, 0, 1, 1, 0 }, + { C, 0, 1, 1, 0 }, + { P, 0, 0, 0, 0 }, + { N, 1, 1, 0, 0 }, + { C, 0, 1, 1, 0 }, + { C, 0, 1, 1, 0 }, + { P, 0, 0, 0, 0 }, + { P, 0, 0, 0, 0 }, + { P, 0, 0, 0, 0 }, + { P, 0, 0, 0, 0 }, + { P, 0, 0, 0, 0 }, + { N, 1, 1, 0, 0 }, + { N, 0, 1, 0, 0 }, + { N, 0, 1, 0, 0 }, + { P, 0, 0, 0, 0 }, + { P, 0, 0, 0, 0 }, + { C, 0, 1, 1, 0 }, + { C, 0, 1, 1, 0 }, + { P, 0, 0, 0, 0 }, + { N, 1, 1, 0, 0 }, + { C, 0, 1, 1, 0 }, + { C, 0, 1, 1, 0 }, + { P, 0, 0, 0, 0 }, + { P, 0, 0, 0, 0 }, + { P, 0, 0, 0, 0 }, + { P, 0, 0, 0, 0 }, + { P, 0, 0, 0, 0 }, + { N, 1, 1, 0, 1 }, + { N, 0, 1, 0, 1 }, + { N, 0, 1, 0, 1 }, + { P, 0, 0, 0, 0 }, + { P, 0, 0, 0, 0 }, + { C, 0, 1, 1, 1 }, + { C, 0, 1, 1, 1 }, + { P, 0, 0, 0, 0 }, + { N, 1, 1, 0, 1 }, + { C, 0, 1, 1, 1 }, + { C, 0, 1, 1, 1 }, + { P, 0, 0, 0, 0 }, + { C, 0, 0, 0, 1 }, + { P, 0, 0, 0, 0 }, + { C, 0, 1, 0, 1 }, + { P, 0, 0, 0, 0 }, + { C, 1, 1, 0, 1 }, + { C, 0, 1, 0, 1 }, + { C, 0, 1, 0, 1 }, + { P, 0, 0, 0, 0 }, + { C, 1, 1, 1, 1 }, + { C, 0, 1, 1, 1 }, + { C, 0, 1, 1, 1 }, + { P, 0, 0, 0, 0 }, + { C, 1, 1, 1, 1 }, + { C, 0, 1, 1, 1 }, + { C, 0, 1, 1, 1 } }; /** diff --git a/src/mesa/drivers/dri/i965/brw_wm_pass0.c b/src/mesa/drivers/dri/i965/brw_wm_pass0.c index f78bdc3..bc48d50 100644 --- a/src/mesa/drivers/dri/i965/brw_wm_pass0.c +++ b/src/mesa/drivers/dri/i965/brw_wm_pass0.c @@ -2,7 +2,7 @@ Copyright (C) Intel Corp. 2006. All Rights Reserved. Intel funded Tungsten Graphics (http://www.tungstengraphics.com) to develop this 3D driver. - + 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, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - + The above copyright notice and this permission notice (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 NONINFRINGEMENT. @@ -22,13 +22,13 @@ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - + **********************************************************************/ /* * Authors: * Keith Whitwell */ - + #include "brw_context.h" #include "brw_wm.h" @@ -99,11 +99,11 @@ static void pass0_set_fpreg_ref( struct brw_wm_compile *c, c->pass0_fp_reg[file][idx][component] = src_ref; } -static const struct brw_wm_ref *get_param_ref( struct brw_wm_compile *c, +static const struct brw_wm_ref *get_param_ref( struct brw_wm_compile *c, const GLfloat *param_ptr ) { GLuint i = c->prog_data.nr_params++; - + if (i >= BRW_WM_MAX_PARAM) { printf("%s: out of params\n", __FUNCTION__); c->prog_data.error = 1; @@ -138,7 +138,7 @@ static const struct brw_wm_ref *get_const_ref( struct brw_wm_compile *c, /* Search for an existing const value matching the request: */ for (i = 0; i < c->nr_constrefs; i++) { - if (c->constref[i].constval == *constval) + if (c->constref[i].constval == *constval) return c->constref[i].ref; } @@ -193,13 +193,13 @@ static const struct brw_wm_ref *pass0_get_reg( struct brw_wm_compile *c, case PROGRAM_CONSTANT: case PROGRAM_NAMED_PARAM: { struct gl_program_parameter_list *plist = c->fp->program.Base.Parameters; - + /* There's something really hokey about parameters parsed in * arb programs - they all end up in here, whether they be * state values, parameters or constants. This duplicates the * structure above & also seems to subvert the limits set for * each type of constant/param. - */ + */ switch (plist->Parameters[idx].Type) { case PROGRAM_NAMED_PARAM: case PROGRAM_CONSTANT: @@ -270,11 +270,11 @@ static const struct brw_wm_ref *get_fp_src_reg_ref( struct brw_wm_compile *c, static const GLfloat const_zero = 0.0; static const GLfloat const_one = 1.0; - if (component == SWIZZLE_ZERO) + if (component == SWIZZLE_ZERO) src_ref = get_const_ref(c, &const_zero); - else if (component == SWIZZLE_ONE) + else if (component == SWIZZLE_ONE) src_ref = get_const_ref(c, &const_one); - else + else src_ref = pass0_get_reg(c, src.File, src.Index, component); return src_ref; @@ -346,7 +346,7 @@ translate_insn(struct brw_wm_compile *c, /*********************************************************************** * Optimize moves and swizzles away: - */ + */ static void pass0_precalc_mov( struct brw_wm_compile *c, const struct prog_instruction *inst ) { @@ -366,7 +366,7 @@ static void pass0_precalc_mov( struct brw_wm_compile *c, refs[i] = get_new_ref(c, inst->SrcReg[0], i, NULL); } for (i = 0; i < 4; i++) { - if (writemask & (1 << i)) { + if (writemask & (1 << i)) { pass0_set_fpreg_ref( c, dst->File, dst->Index, i, refs[i]); } } @@ -381,7 +381,7 @@ static void pass0_init_payload( struct brw_wm_compile *c ) for (i = 0; i < 4; i++) { GLuint j = i >= (c->nr_payload_regs + 1) / 2 ? 0 : i; - pass0_set_fpreg_value( c, PROGRAM_PAYLOAD, PAYLOAD_DEPTH, i, + pass0_set_fpreg_value( c, PROGRAM_PAYLOAD, PAYLOAD_DEPTH, i, &c->payload.depth[j] ); } @@ -393,10 +393,10 @@ static void pass0_init_payload( struct brw_wm_compile *c ) pass0_set_fpreg_value(c, PROGRAM_INPUT, FRAG_ATTRIB_WPOS, 2, &c->payload.depth[c->key.source_depth_reg/2]); #endif - + for (i = 0; i < FRAG_ATTRIB_MAX; i++) - pass0_set_fpreg_value( c, PROGRAM_PAYLOAD, i, 0, - &c->payload.input_interp[i] ); + pass0_set_fpreg_value( c, PROGRAM_PAYLOAD, i, 0, + &c->payload.input_interp[i] ); } @@ -423,10 +423,10 @@ void brw_wm_pass0( struct brw_wm_compile *c ) const struct prog_instruction *inst = &c->prog_instructions[insn]; /* Optimize away moves, otherwise emit translated instruction: - */ + */ switch (inst->Opcode) { - case OPCODE_MOV: - case OPCODE_SWZ: + case OPCODE_MOV: + case OPCODE_SWZ: if (!inst->SaturateMode) { pass0_precalc_mov(c, inst); } @@ -439,7 +439,7 @@ void brw_wm_pass0( struct brw_wm_compile *c ) break; } } - + if (unlikely(INTEL_DEBUG & DEBUG_WM)) { brw_wm_print_program(c, "pass0"); } diff --git a/src/mesa/drivers/dri/i965/brw_wm_pass1.c b/src/mesa/drivers/dri/i965/brw_wm_pass1.c index 7d6a3fa..848234d 100644 --- a/src/mesa/drivers/dri/i965/brw_wm_pass1.c +++ b/src/mesa/drivers/dri/i965/brw_wm_pass1.c @@ -2,7 +2,7 @@ Copyright (C) Intel Corp. 2006. All Rights Reserved. Intel funded Tungsten Graphics (http://www.tungstengraphics.com) to develop this 3D driver. - + 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, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - + The above copyright notice and this permission notice (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 NONINFRINGEMENT. @@ -22,13 +22,13 @@ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - + **********************************************************************/ /* * Authors: * Keith Whitwell */ - + #include "brw_context.h" #include "brw_wm.h" @@ -105,7 +105,7 @@ static GLuint get_texcoord_mask( GLuint tex_idx ) } -/* Step two: Basically this is dead code elimination. +/* Step two: Basically this is dead code elimination. * * Iterate backwards over instructions, noting which values * contribute to the final result. Adjust writemasks to only @@ -126,12 +126,12 @@ void brw_wm_pass1( struct brw_wm_compile *c ) } if (inst->opcode == WM_FB_WRITE) { - track_arg(c, inst, 0, WRITEMASK_XYZW); - track_arg(c, inst, 1, WRITEMASK_XYZW); + track_arg(c, inst, 0, WRITEMASK_XYZW); + track_arg(c, inst, 1, WRITEMASK_XYZW); if (c->source_depth_to_render_target && c->computes_depth) - track_arg(c, inst, 2, WRITEMASK_Z); + track_arg(c, inst, 2, WRITEMASK_Z); else - track_arg(c, inst, 2, 0); + track_arg(c, inst, 2, 0); continue; } @@ -183,17 +183,17 @@ void brw_wm_pass1( struct brw_wm_compile *c ) read0 = writemask; break; - case OPCODE_MAD: + case OPCODE_MAD: case OPCODE_CMP: case OPCODE_LRP: read0 = writemask; - read1 = writemask; - read2 = writemask; + read1 = writemask; + read2 = writemask; break; - case OPCODE_XPD: - if (writemask & WRITEMASK_X) read0 |= WRITEMASK_YZ; - if (writemask & WRITEMASK_Y) read0 |= WRITEMASK_XZ; + case OPCODE_XPD: + if (writemask & WRITEMASK_X) read0 |= WRITEMASK_YZ; + if (writemask & WRITEMASK_Y) read0 |= WRITEMASK_XZ; if (writemask & WRITEMASK_Z) read0 |= WRITEMASK_XY; read1 = read0; break; @@ -259,7 +259,7 @@ void brw_wm_pass1( struct brw_wm_compile *c ) read1 = WRITEMASK_XY; break; - case OPCODE_DP3: + case OPCODE_DP3: read0 = WRITEMASK_XYZ; read1 = WRITEMASK_XYZ; break; @@ -274,7 +274,7 @@ void brw_wm_pass1( struct brw_wm_compile *c ) read1 = WRITEMASK_XYZW; break; - case OPCODE_LIT: + case OPCODE_LIT: read0 = WRITEMASK_XYW; break; diff --git a/src/mesa/drivers/dri/i965/brw_wm_pass2.c b/src/mesa/drivers/dri/i965/brw_wm_pass2.c index 8c2b9e7..eb8c430 100644 --- a/src/mesa/drivers/dri/i965/brw_wm_pass2.c +++ b/src/mesa/drivers/dri/i965/brw_wm_pass2.c @@ -2,7 +2,7 @@ Copyright (C) Intel Corp. 2006. All Rights Reserved. Intel funded Tungsten Graphics (http://www.tungstengraphics.com) to develop this 3D driver. - + 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, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - + The above copyright notice and this permission notice (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 NONINFRINGEMENT. @@ -22,13 +22,13 @@ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - + **********************************************************************/ /* * Authors: * Keith Whitwell */ - + #include "brw_context.h" #include "brw_wm.h" @@ -75,13 +75,13 @@ static void init_registers( struct brw_wm_compile *c ) GLuint i = 0; GLuint j; - for (j = 0; j < c->grf_limit; j++) + for (j = 0; j < c->grf_limit; j++) c->pass2_grf[j].nextuse = BRW_WM_MAX_INSN; for (j = 0; j < (c->nr_payload_regs + 1) / 2; j++) prealloc_reg(c, &c->payload.depth[j], i++); - for (j = 0; j < c->nr_creg; j++) + for (j = 0; j < c->nr_creg; j++) prealloc_reg(c, &c->creg[j], i++); if (intel->gen >= 6) { @@ -157,12 +157,12 @@ static void update_register_usage(struct brw_wm_compile *c, static void spill_value(struct brw_wm_compile *c, struct brw_wm_value *value) -{ +{ /* Allocate a spill slot. Note that allocations start from 0x40 - * the first slot is reserved to mean "undef" in brw_wm_emit.c */ if (!value->spill_slot) { - c->last_scratch += 0x40; + c->last_scratch += 0x40; value->spill_slot = c->last_scratch; } @@ -213,7 +213,7 @@ static GLuint search_contiguous_regs(struct brw_wm_compile *c, /* Any non-empty regs will need to be spilled: */ - for (j = 0; j < nr; j++) + for (j = 0; j < nr; j++) if (grf[reg+j].value) spill_value(c, grf[reg+j].value); @@ -221,7 +221,7 @@ static GLuint search_contiguous_regs(struct brw_wm_compile *c, } -static void alloc_contiguous_dest(struct brw_wm_compile *c, +static void alloc_contiguous_dest(struct brw_wm_compile *c, struct brw_wm_value *dst[], GLuint nr, GLuint thisinsn) @@ -254,7 +254,7 @@ static void alloc_contiguous_dest(struct brw_wm_compile *c, } -static void load_args(struct brw_wm_compile *c, +static void load_args(struct brw_wm_compile *c, struct brw_wm_instruction *inst) { GLuint thisinsn = inst - c->instruction; @@ -336,7 +336,7 @@ void brw_wm_pass2( struct brw_wm_compile *c ) } if (TEST_DST_SPILLS && inst->opcode != WM_PIXELXY) { - for (i = 0; i < 4; i++) + for (i = 0; i < 4; i++) if (inst->dst[i]) spill_value(c, inst->dst[i]); } diff --git a/src/mesa/drivers/dri/i965/brw_wm_sampler_state.c b/src/mesa/drivers/dri/i965/brw_wm_sampler_state.c index e7c97a1..29b4c49 100644 --- a/src/mesa/drivers/dri/i965/brw_wm_sampler_state.c +++ b/src/mesa/drivers/dri/i965/brw_wm_sampler_state.c @@ -2,7 +2,7 @@ Copyright (C) Intel Corp. 2006. All Rights Reserved. Intel funded Tungsten Graphics (http://www.tungstengraphics.com) to develop this 3D driver. - + 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, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - + The above copyright notice and this permission notice (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 NONINFRINGEMENT. @@ -22,13 +22,13 @@ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - + **********************************************************************/ /* * Authors: * Keith Whitwell */ - + #include "brw_context.h" #include "brw_state.h" @@ -51,17 +51,17 @@ static GLuint translate_wrap_mode( GLenum wrap ) { switch( wrap ) { - case GL_REPEAT: + case GL_REPEAT: return BRW_TEXCOORDMODE_WRAP; - case GL_CLAMP: + case GL_CLAMP: return BRW_TEXCOORDMODE_CLAMP; - case GL_CLAMP_TO_EDGE: + case GL_CLAMP_TO_EDGE: return BRW_TEXCOORDMODE_CLAMP; /* conform likes it this way */ - case GL_CLAMP_TO_BORDER: + case GL_CLAMP_TO_BORDER: return BRW_TEXCOORDMODE_CLAMP_BORDER; - case GL_MIRRORED_REPEAT: + case GL_MIRRORED_REPEAT: return BRW_TEXCOORDMODE_MIRROR; - default: + default: return BRW_TEXCOORDMODE_WRAP; } } @@ -169,10 +169,10 @@ static void brw_update_sampler_state(struct brw_context *brw, break; } - /* Set Anisotropy: + /* Set Anisotropy: */ if (key->max_aniso > 1.0) { - sampler->ss0.min_filter = BRW_MAPFILTER_ANISOTROPIC; + sampler->ss0.min_filter = BRW_MAPFILTER_ANISOTROPIC; sampler->ss0.mag_filter = BRW_MAPFILTER_ANISOTROPIC; if (key->max_aniso > 2.0) { @@ -190,7 +190,7 @@ static void brw_update_sampler_state(struct brw_context *brw, break; default: break; - } + } } sampler->ss1.r_wrap_mode = translate_wrap_mode(key->wrap_r); @@ -225,7 +225,7 @@ static void brw_update_sampler_state(struct brw_context *brw, } - /* Set shadow function: + /* Set shadow function: */ if (key->comparemode == GL_COMPARE_R_TO_TEXTURE_ARB) { /* Shadowing is "enabled" by emitting a particular sampler @@ -236,14 +236,14 @@ static void brw_update_sampler_state(struct brw_context *brw, intel_translate_shadow_compare_func(key->comparefunc); } - /* Set LOD bias: + /* Set LOD bias: */ sampler->ss0.lod_bias = S_FIXED(CLAMP(key->lod_bias, -16, 15), 6); sampler->ss0.lod_preclamp = 1; /* OpenGL mode */ sampler->ss0.default_color_mode = 0; /* OpenGL/DX10 mode */ - /* Set BaseMipLevel, MaxLOD, MinLOD: + /* Set BaseMipLevel, MaxLOD, MinLOD: * * XXX: I don't think that using firstLevel, lastLevel works, * because we always setup the surface state as if firstLevel == @@ -254,7 +254,7 @@ static void brw_update_sampler_state(struct brw_context *brw, sampler->ss1.max_lod = U_FIXED(CLAMP(key->maxlod, 0, 13), 6); sampler->ss1.min_lod = U_FIXED(CLAMP(key->minlod, 0, 13), 6); - + sampler->ss2.default_color_pointer = sdc_bo->offset >> 5; /* reloc */ } @@ -266,7 +266,7 @@ brw_wm_sampler_populate_key(struct brw_context *brw, { struct gl_context *ctx = &brw->intel.ctx; int unit; - char *last_entry_end = ((char*)&key->sampler_count) + + char *last_entry_end = ((char*)&key->sampler_count) + sizeof(key->sampler_count); key->sampler_count = 0; @@ -280,7 +280,7 @@ brw_wm_sampler_populate_key(struct brw_context *brw, struct gl_texture_image *firstImage = texObj->Image[0][intelObj->firstLevel]; - memset(last_entry_end, 0, + memset(last_entry_end, 0, (char*)entry - last_entry_end + sizeof(*entry)); last_entry_end = ((char*)entry) + sizeof(*entry); diff --git a/src/mesa/drivers/dri/i965/brw_wm_state.c b/src/mesa/drivers/dri/i965/brw_wm_state.c index e9ef635..29d5011 100644 --- a/src/mesa/drivers/dri/i965/brw_wm_state.c +++ b/src/mesa/drivers/dri/i965/brw_wm_state.c @@ -2,7 +2,7 @@ Copyright (C) Intel Corp. 2006. All Rights Reserved. Intel funded Tungsten Graphics (http://www.tungstengraphics.com) to develop this 3D driver. - + 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, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - + The above copyright notice and this permission notice (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 NONINFRINGEMENT. @@ -22,13 +22,13 @@ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - + **********************************************************************/ /* * Authors: * Keith Whitwell */ - + #include "brw_context.h" @@ -322,14 +322,14 @@ static void upload_wm_unit( struct brw_context *brw ) const struct brw_tracked_state brw_wm_unit = { .dirty = { - .mesa = (_NEW_POLYGON | - _NEW_POLYGONSTIPPLE | - _NEW_LINE | + .mesa = (_NEW_POLYGON | + _NEW_POLYGONSTIPPLE | + _NEW_LINE | _NEW_COLOR | _NEW_DEPTH | _NEW_BUFFERS), - .brw = (BRW_NEW_FRAGMENT_PROGRAM | + .brw = (BRW_NEW_FRAGMENT_PROGRAM | BRW_NEW_CURBE_OFFSETS | BRW_NEW_DEPTH_BUFFER | BRW_NEW_NR_WM_SURFACES), diff --git a/src/mesa/drivers/dri/i965/brw_wm_surface_state.c b/src/mesa/drivers/dri/i965/brw_wm_surface_state.c index ad74404..901ec3c 100644 --- a/src/mesa/drivers/dri/i965/brw_wm_surface_state.c +++ b/src/mesa/drivers/dri/i965/brw_wm_surface_state.c @@ -2,7 +2,7 @@ Copyright (C) Intel Corp. 2006. All Rights Reserved. Intel funded Tungsten Graphics (http://www.tungstengraphics.com) to develop this 3D driver. - + 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, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - + The above copyright notice and this permission notice (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 NONINFRINGEMENT. @@ -22,13 +22,13 @@ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - + **********************************************************************/ /* * Authors: * Keith Whitwell */ - + #include "main/mtypes.h" #include "main/texstore.h" @@ -47,23 +47,23 @@ static GLuint translate_tex_target( GLenum target ) { switch (target) { - case GL_TEXTURE_1D: + case GL_TEXTURE_1D: return BRW_SURFACE_1D; - case GL_TEXTURE_RECTANGLE_NV: + case GL_TEXTURE_RECTANGLE_NV: return BRW_SURFACE_2D; - case GL_TEXTURE_2D: + case GL_TEXTURE_2D: return BRW_SURFACE_2D; - case GL_TEXTURE_3D: + case GL_TEXTURE_3D: return BRW_SURFACE_3D; - case GL_TEXTURE_CUBE_MAP: + case GL_TEXTURE_CUBE_MAP: return BRW_SURFACE_CUBE; - default: - assert(0); + default: + assert(0); return 0; } } @@ -81,7 +81,7 @@ static GLuint translate_tex_format( gl_format mesa_format, return BRW_SURFACEFORMAT_I8_UNORM; case MESA_FORMAT_A8: - return BRW_SURFACEFORMAT_A8_UNORM; + return BRW_SURFACEFORMAT_A8_UNORM; case MESA_FORMAT_AL88: return BRW_SURFACEFORMAT_L8A8_UNORM; @@ -103,7 +103,7 @@ static GLuint translate_tex_format( gl_format mesa_format, case MESA_FORMAT_RGB888: assert(0); /* not supported for sampling */ - return BRW_SURFACEFORMAT_R8G8B8_UNORM; + return BRW_SURFACEFORMAT_R8G8B8_UNORM; case MESA_FORMAT_ARGB8888: return BRW_SURFACEFORMAT_B8G8R8A8_UNORM; @@ -135,7 +135,7 @@ static GLuint translate_tex_format( gl_format mesa_format, return BRW_SURFACEFORMAT_FXT1; case MESA_FORMAT_Z16: - if (depth_mode == GL_INTENSITY) + if (depth_mode == GL_INTENSITY) return BRW_SURFACEFORMAT_I16_UNORM; else if (depth_mode == GL_ALPHA) return BRW_SURFACEFORMAT_A16_UNORM; @@ -149,10 +149,10 @@ static GLuint translate_tex_format( gl_format mesa_format, case MESA_FORMAT_RGBA_DXT1: return BRW_SURFACEFORMAT_BC1_UNORM; - + case MESA_FORMAT_RGBA_DXT3: return BRW_SURFACEFORMAT_BC2_UNORM; - + case MESA_FORMAT_RGBA_DXT5: return BRW_SURFACEFORMAT_BC3_UNORM; @@ -172,7 +172,7 @@ static GLuint translate_tex_format( gl_format mesa_format, /* XXX: these different surface formats don't seem to * make any difference for shadow sampler/compares. */ - if (depth_mode == GL_INTENSITY) + if (depth_mode == GL_INTENSITY) return BRW_SURFACEFORMAT_I24X8_UNORM; else if (depth_mode == GL_ALPHA) return BRW_SURFACEFORMAT_A24X8_UNORM; @@ -244,7 +244,7 @@ brw_update_texture_surface( struct gl_context *ctx, GLuint unit ) surf.ss3.depth = firstImage->Depth - 1; surf.ss4.min_lod = 0; - + if (tObj->Target == GL_TEXTURE_CUBE_MAP) { surf.ss0.cube_pos_x = 1; surf.ss0.cube_pos_y = 1; diff --git a/src/mesa/drivers/dri/i965/gen6_sf_state.c b/src/mesa/drivers/dri/i965/gen6_sf_state.c index 4feb490..a4a22a9 100644 --- a/src/mesa/drivers/dri/i965/gen6_sf_state.c +++ b/src/mesa/drivers/dri/i965/gen6_sf_state.c @@ -226,7 +226,7 @@ upload_sf_state(struct brw_context *brw) } if (ctx->Point.PointSprite) { - for (i = 0; i < 8; i++) { + for (i = 0; i < 8; i++) { if (ctx->Point.CoordReplace[i]) dw16 |= (1 << i); } diff --git a/src/mesa/drivers/dri/intel/intel_batchbuffer.c b/src/mesa/drivers/dri/intel/intel_batchbuffer.c index 67ce8a4..bdec5d2 100644 --- a/src/mesa/drivers/dri/intel/intel_batchbuffer.c +++ b/src/mesa/drivers/dri/intel/intel_batchbuffer.c @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2006 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ #include "intel_context.h" diff --git a/src/mesa/drivers/dri/intel/intel_blit.c b/src/mesa/drivers/dri/intel/intel_blit.c index c405e94..c47eb82 100644 --- a/src/mesa/drivers/dri/intel/intel_blit.c +++ b/src/mesa/drivers/dri/intel/intel_blit.c @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2003 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ diff --git a/src/mesa/drivers/dri/intel/intel_blit.h b/src/mesa/drivers/dri/intel/intel_blit.h index 88322c7..69521d6 100644 --- a/src/mesa/drivers/dri/intel/intel_blit.h +++ b/src/mesa/drivers/dri/intel/intel_blit.h @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2003 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ #ifndef INTEL_BLIT_H diff --git a/src/mesa/drivers/dri/intel/intel_buffer_objects.c b/src/mesa/drivers/dri/intel/intel_buffer_objects.c index 87da60a..94c3681 100644 --- a/src/mesa/drivers/dri/intel/intel_buffer_objects.c +++ b/src/mesa/drivers/dri/intel/intel_buffer_objects.c @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2003 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ diff --git a/src/mesa/drivers/dri/intel/intel_buffer_objects.h b/src/mesa/drivers/dri/intel/intel_buffer_objects.h index b15c192..0ac7fc4 100644 --- a/src/mesa/drivers/dri/intel/intel_buffer_objects.h +++ b/src/mesa/drivers/dri/intel/intel_buffer_objects.h @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2005 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ #ifndef INTEL_BUFFEROBJ_H @@ -64,7 +64,7 @@ drm_intel_bo *intel_bufferobj_buffer(struct intel_context *intel, struct intel_buffer_object *obj, GLuint flag); -/* Hook the bufferobject implementation into mesa: +/* Hook the bufferobject implementation into mesa: */ void intelInitBufferObjectFuncs(struct dd_function_table *functions); diff --git a/src/mesa/drivers/dri/intel/intel_buffers.c b/src/mesa/drivers/dri/intel/intel_buffers.c index ee551ef..1b0b861 100644 --- a/src/mesa/drivers/dri/intel/intel_buffers.c +++ b/src/mesa/drivers/dri/intel/intel_buffers.c @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2003 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ #include "intel_context.h" @@ -229,7 +229,7 @@ intel_draw_buffer(struct gl_context * ctx, struct gl_framebuffer *fb) intel->NewGLState |= (_NEW_DEPTH | _NEW_STENCIL); } - intel->vtbl.set_draw_region(intel, colorRegions, depthRegion, + intel->vtbl.set_draw_region(intel, colorRegions, depthRegion, fb->_NumColorDrawBuffers); intel->NewGLState |= _NEW_BUFFERS; diff --git a/src/mesa/drivers/dri/intel/intel_buffers.h b/src/mesa/drivers/dri/intel/intel_buffers.h index 2d4613b..6a3a6ba 100644 --- a/src/mesa/drivers/dri/intel/intel_buffers.h +++ b/src/mesa/drivers/dri/intel/intel_buffers.h @@ -1,9 +1,9 @@ /************************************************************************** - * + * * Copyright 2006 Tungsten Graphics, Inc., Cedar Park, Texas. * 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 @@ -11,11 +11,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. @@ -23,7 +23,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. - * + * **************************************************************************/ #ifndef INTEL_BUFFERS_H diff --git a/src/mesa/drivers/dri/intel/intel_clear.c b/src/mesa/drivers/dri/intel/intel_clear.c index 82d29e7..e24ca8c 100644 --- a/src/mesa/drivers/dri/intel/intel_clear.c +++ b/src/mesa/drivers/dri/intel/intel_clear.c @@ -1,9 +1,9 @@ /************************************************************************** - * + * * Copyright 2003 Tungsten Graphics, Inc., Cedar Park, Texas. * Copyright 2009 Intel Corporation. * 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 @@ -11,11 +11,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. @@ -23,7 +23,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. - * + * **************************************************************************/ #include "main/glheader.h" diff --git a/src/mesa/drivers/dri/intel/intel_clear.h b/src/mesa/drivers/dri/intel/intel_clear.h index 7fd6b31..4c19367 100644 --- a/src/mesa/drivers/dri/intel/intel_clear.h +++ b/src/mesa/drivers/dri/intel/intel_clear.h @@ -1,9 +1,9 @@ /************************************************************************** - * + * * Copyright 2006 Tungsten Graphics, Inc., Cedar Park, Texas. * 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 @@ -11,11 +11,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. @@ -23,7 +23,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. - * + * **************************************************************************/ #ifndef INTEL_CLEAR_H diff --git a/src/mesa/drivers/dri/intel/intel_context.c b/src/mesa/drivers/dri/intel/intel_context.c index f6f0b03..d251342 100644 --- a/src/mesa/drivers/dri/intel/intel_context.c +++ b/src/mesa/drivers/dri/intel/intel_context.c @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2003 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ @@ -137,7 +137,7 @@ intelGetString(struct gl_context * ctx, GLenum name) break; case PCI_CHIP_GM45_GM: chipset = "Mobile Intel® GM45 Express Chipset"; - break; + break; case PCI_CHIP_IGD_E_G: chipset = "Intel(R) Integrated Graphics Device"; break; @@ -380,7 +380,7 @@ intel_update_renderbuffers(__DRIcontext *context, __DRIdrawable *drawable) "attaching buffer %d, at %d, cpp %d, pitch %d\n", buffers[i].name, buffers[i].attachment, buffers[i].cpp, buffers[i].pitch); - + if (buffers[i].attachment == __DRI_BUFFER_STENCIL && depth_region) { if (unlikely(INTEL_DEBUG & DEBUG_DRI)) fprintf(stderr, "(reusing depth buffer as stencil)\n"); @@ -752,7 +752,7 @@ intelInitContext(struct intel_context *intel, _vbo_CreateContext(ctx); _tnl_CreateContext(ctx); _swsetup_CreateContext(ctx); - + /* Configure swrast to match hardware characteristics: */ _swrast_allow_pixel_fog(ctx, GL_FALSE); _swrast_allow_vertex_fog(ctx, GL_TRUE); @@ -907,7 +907,7 @@ intelMakeCurrent(__DRIcontext * driContextPriv, if (driContextPriv) { struct gl_framebuffer *fb, *readFb; - + if (driDrawPriv == NULL && driReadPriv == NULL) { fb = _mesa_get_incomplete_framebuffer(); readFb = _mesa_get_incomplete_framebuffer(); @@ -920,7 +920,7 @@ intelMakeCurrent(__DRIcontext * driContextPriv, intel_prepare_render(intel); _mesa_make_current(&intel->ctx, fb, readFb); - + /* We do this in intel_prepare_render() too, but intel->ctx.DrawBuffer * is NULL at that point. We can't call _mesa_makecurrent() * first, since we need the buffer size for the initial diff --git a/src/mesa/drivers/dri/intel/intel_context.h b/src/mesa/drivers/dri/intel/intel_context.h index 53a11ba..eab9277 100644 --- a/src/mesa/drivers/dri/intel/intel_context.h +++ b/src/mesa/drivers/dri/intel/intel_context.h @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2003 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ #ifndef INTELCONTEXT_INC @@ -225,7 +225,7 @@ struct intel_context GLuint vertex_size; GLubyte *verts; /* points to tnl->clipspace.vertex_buf */ - /* Fallback rasterization functions + /* Fallback rasterization functions */ intel_point_func draw_point; intel_line_func draw_line; @@ -482,7 +482,7 @@ void i915_set_buf_info_for_region(uint32_t *state, struct intel_region *region, uint32_t buffer_id); /*====================================================================== - * Inline conversion functions. + * Inline conversion functions. * These are better-typed than the macros used previously: */ static INLINE struct intel_context * diff --git a/src/mesa/drivers/dri/intel/intel_extensions.c b/src/mesa/drivers/dri/intel/intel_extensions.c index 556a419..a9b81b0 100644 --- a/src/mesa/drivers/dri/intel/intel_extensions.c +++ b/src/mesa/drivers/dri/intel/intel_extensions.c @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2003 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ #include "intel_chipset.h" diff --git a/src/mesa/drivers/dri/intel/intel_extensions.h b/src/mesa/drivers/dri/intel/intel_extensions.h index fb2a846..b9b54f7 100644 --- a/src/mesa/drivers/dri/intel/intel_extensions.h +++ b/src/mesa/drivers/dri/intel/intel_extensions.h @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2003 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ #ifndef INTEL_EXTENSIONS_H diff --git a/src/mesa/drivers/dri/intel/intel_extensions_es2.c b/src/mesa/drivers/dri/intel/intel_extensions_es2.c index 973e6ec..5061645 100644 --- a/src/mesa/drivers/dri/intel/intel_extensions_es2.c +++ b/src/mesa/drivers/dri/intel/intel_extensions_es2.c @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2003 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ #include "main/extensions.h" diff --git a/src/mesa/drivers/dri/intel/intel_fbo.c b/src/mesa/drivers/dri/intel/intel_fbo.c index 4d7d8a4..b735dcd 100644 --- a/src/mesa/drivers/dri/intel/intel_fbo.c +++ b/src/mesa/drivers/dri/intel/intel_fbo.c @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2006 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ @@ -444,7 +444,7 @@ intel_framebuffer_renderbuffer(struct gl_context * ctx, static GLboolean -intel_update_wrapper(struct gl_context *ctx, struct intel_renderbuffer *irb, +intel_update_wrapper(struct gl_context *ctx, struct intel_renderbuffer *irb, struct gl_texture_image *texImage) { if (!intel_span_supports_format(texImage->TexFormat)) { @@ -689,5 +689,5 @@ intel_fbo_init(struct intel_context *intel) #if FEATURE_OES_EGL_image intel->ctx.Driver.EGLImageTargetRenderbufferStorage = intel_image_target_renderbuffer_storage; -#endif +#endif } diff --git a/src/mesa/drivers/dri/intel/intel_fbo.h b/src/mesa/drivers/dri/intel/intel_fbo.h index 028f657..fb3fc51 100644 --- a/src/mesa/drivers/dri/intel/intel_fbo.h +++ b/src/mesa/drivers/dri/intel/intel_fbo.h @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2006 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ #ifndef INTEL_FBO_H diff --git a/src/mesa/drivers/dri/intel/intel_mipmap_tree.c b/src/mesa/drivers/dri/intel/intel_mipmap_tree.c index 9c4e5c5..7e5ba20 100644 --- a/src/mesa/drivers/dri/intel/intel_mipmap_tree.c +++ b/src/mesa/drivers/dri/intel/intel_mipmap_tree.c @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2006 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ #include "intel_context.h" @@ -68,7 +68,7 @@ intel_miptree_create_internal(struct intel_context *intel, DBG("%s target %s format %s level %d..%d <-- %p\n", __FUNCTION__, _mesa_lookup_enum_by_nr(target), - _mesa_lookup_enum_by_nr(internal_format), + _mesa_lookup_enum_by_nr(internal_format), first_level, last_level, mt); mt->target = target_to_target(target); @@ -80,7 +80,7 @@ intel_miptree_create_internal(struct intel_context *intel, mt->depth0 = depth0; mt->cpp = compress_byte ? compress_byte : cpp; mt->compressed = compress_byte ? 1 : 0; - mt->refcount = 1; + mt->refcount = 1; #ifdef I915 if (intel->is_945) diff --git a/src/mesa/drivers/dri/intel/intel_mipmap_tree.h b/src/mesa/drivers/dri/intel/intel_mipmap_tree.h index 21db2f4..ac33204 100644 --- a/src/mesa/drivers/dri/intel/intel_mipmap_tree.h +++ b/src/mesa/drivers/dri/intel/intel_mipmap_tree.h @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2006 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ #ifndef INTEL_MIPMAP_TREE_H @@ -34,7 +34,7 @@ * * - Code to size and layout a region to hold a set of mipmaps. * - Query to determine if a new image fits in an existing tree. - * - More refcounting + * - More refcounting * - maybe able to remove refcounting from intel_region? * - ? * @@ -49,8 +49,8 @@ * the texture object would slot into the tree as they arrive. The * reality can be a little messier, as images can arrive from the user * with sizes that don't fit in the existing tree, or in an order - * where the tree layout cannot be guessed immediately. - * + * where the tree layout cannot be guessed immediately. + * * This structure encodes an idealized mipmap tree. The GL image * commands build these where possible, otherwise store the images in * temporary system buffers. diff --git a/src/mesa/drivers/dri/intel/intel_pixel.c b/src/mesa/drivers/dri/intel/intel_pixel.c index d5c3577..28be878 100644 --- a/src/mesa/drivers/dri/intel/intel_pixel.c +++ b/src/mesa/drivers/dri/intel/intel_pixel.c @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2006 Tungsten Graphics, Inc., Cedar Park, Texas. * 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 portionsalloc * 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. - * + * **************************************************************************/ #include "main/enums.h" diff --git a/src/mesa/drivers/dri/intel/intel_pixel.h b/src/mesa/drivers/dri/intel/intel_pixel.h index aef0e60..551e46a 100644 --- a/src/mesa/drivers/dri/intel/intel_pixel.h +++ b/src/mesa/drivers/dri/intel/intel_pixel.h @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2006 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ #ifndef INTEL_PIXEL_H diff --git a/src/mesa/drivers/dri/intel/intel_pixel_bitmap.c b/src/mesa/drivers/dri/intel/intel_pixel_bitmap.c index e7356a6..d3feb58 100644 --- a/src/mesa/drivers/dri/intel/intel_pixel_bitmap.c +++ b/src/mesa/drivers/dri/intel/intel_pixel_bitmap.c @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2006 Tungsten Graphics, Inc., Cedar Park, Texas. * 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 portionsalloc * 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. - * + * **************************************************************************/ #include "main/glheader.h" @@ -99,7 +99,7 @@ static void set_bit( GLubyte *dest, GLuint bit ) static GLuint get_bitmap_rect(GLsizei width, GLsizei height, const struct gl_pixelstore_attrib *unpack, const GLubyte *bitmap, - GLuint x, GLuint y, + GLuint x, GLuint y, GLuint w, GLuint h, GLubyte *dest, GLuint row_align, @@ -130,9 +130,9 @@ static GLuint get_bitmap_rect(GLsizei width, GLsizei height, /* Require that dest be pre-zero'd. */ for (row = first; row != (last+incr); row += incr) { - const GLubyte *rowsrc = _mesa_image_address2d(unpack, bitmap, - width, height, - GL_COLOR_INDEX, GL_BITMAP, + const GLubyte *rowsrc = _mesa_image_address2d(unpack, bitmap, + width, height, + GL_COLOR_INDEX, GL_BITMAP, y + row, x); for (col = 0; col < w; col++, bit++) { @@ -166,7 +166,7 @@ y_flip(struct gl_framebuffer *fb, int y, int height) * Render a bitmap. */ static GLboolean -do_blit_bitmap( struct gl_context *ctx, +do_blit_bitmap( struct gl_context *ctx, GLint dstx, GLint dsty, GLsizei width, GLsizei height, const struct gl_pixelstore_attrib *unpack, @@ -302,14 +302,14 @@ do_blit_bitmap( struct gl_context *ctx, /* There are a large number of possible ways to implement bitmap on * this hardware, most of them have some sort of drawback. Here are a * few that spring to mind: - * + * * Blit: * - XY_MONO_SRC_BLT_CMD * - use XY_SETUP_CLIP_BLT for cliprect clipping. * - XY_TEXT_BLT * - XY_TEXT_IMMEDIATE_BLT * - blit per cliprect, subject to maximum immediate data size. - * - XY_COLOR_BLT + * - XY_COLOR_BLT * - per pixel or run of pixels * - XY_PIXEL_BLT * - good for sparse bitmaps diff --git a/src/mesa/drivers/dri/intel/intel_pixel_copy.c b/src/mesa/drivers/dri/intel/intel_pixel_copy.c index a7ca780..27248c0 100644 --- a/src/mesa/drivers/dri/intel/intel_pixel_copy.c +++ b/src/mesa/drivers/dri/intel/intel_pixel_copy.c @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2003 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ #include "main/glheader.h" @@ -81,7 +81,7 @@ intel_check_copypixel_blit_fragment_ops(struct gl_context * ctx) if (ctx->NewState) _mesa_update_state(ctx); - /* Could do logicop with the blitter: + /* Could do logicop with the blitter: */ return !(ctx->_ImageTransferState || ctx->Color.AlphaEnabled || diff --git a/src/mesa/drivers/dri/intel/intel_pixel_draw.c b/src/mesa/drivers/dri/intel/intel_pixel_draw.c index 2ec7ed8..3bd1901 100644 --- a/src/mesa/drivers/dri/intel/intel_pixel_draw.c +++ b/src/mesa/drivers/dri/intel/intel_pixel_draw.c @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2006 Tungsten Graphics, Inc., Cedar Park, Texas. * 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 portionsalloc * 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. - * + * **************************************************************************/ #include "main/glheader.h" diff --git a/src/mesa/drivers/dri/intel/intel_reg.h b/src/mesa/drivers/dri/intel/intel_reg.h index 5258699..a4b820f 100644 --- a/src/mesa/drivers/dri/intel/intel_reg.h +++ b/src/mesa/drivers/dri/intel/intel_reg.h @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2003 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ #define CMD_MI (0x0 << 29) diff --git a/src/mesa/drivers/dri/intel/intel_regions.c b/src/mesa/drivers/dri/intel/intel_regions.c index e87e294..f1a7966 100644 --- a/src/mesa/drivers/dri/intel/intel_regions.c +++ b/src/mesa/drivers/dri/intel/intel_regions.c @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2006 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ /* Provide additional functionality on top of bufmgr buffers: @@ -198,7 +198,7 @@ intel_region_flink(struct intel_region *region, uint32_t *name) if (region->name == 0) { if (drm_intel_bo_flink(region->buffer, ®ion->name)) return GL_FALSE; - + _mesa_HashInsert(region->screen->named_regions, region->name, region); } @@ -493,7 +493,7 @@ intel_region_cow(struct intel_context *intel, struct intel_region *region) _DBG("%s %p (%d bytes)\n", __FUNCTION__, region, pbo->Base.Size); - /* Now blit from the texture buffer to the new buffer: + /* Now blit from the texture buffer to the new buffer: */ intel_prepare_render(intel); diff --git a/src/mesa/drivers/dri/intel/intel_regions.h b/src/mesa/drivers/dri/intel/intel_regions.h index 8464a5e..6e190e6 100644 --- a/src/mesa/drivers/dri/intel/intel_regions.h +++ b/src/mesa/drivers/dri/intel/intel_regions.h @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2006 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ #ifndef INTEL_REGIONS_H @@ -98,7 +98,7 @@ void intel_region_release(struct intel_region **ib); void intel_recreate_static_regions(struct intel_context *intel); -/* Map/unmap regions. This is refcounted also: +/* Map/unmap regions. This is refcounted also: */ GLubyte *intel_region_map(struct intel_context *intel, struct intel_region *ib); diff --git a/src/mesa/drivers/dri/intel/intel_screen.c b/src/mesa/drivers/dri/intel/intel_screen.c index d683e67..9f82466 100644 --- a/src/mesa/drivers/dri/intel/intel_screen.c +++ b/src/mesa/drivers/dri/intel/intel_screen.c @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2003 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ #include "main/glheader.h" @@ -165,7 +165,7 @@ intel_create_image_from_name(__DRIscreen *screen, return NULL; } - return image; + return image; } static __DRIimage * @@ -250,7 +250,7 @@ intel_create_image(__DRIscreen *screen, FREE(image); return NULL; } - + return image; } @@ -405,7 +405,7 @@ static void intelDestroyBuffer(__DRIdrawable * driDrawPriv) { struct gl_framebuffer *fb = driDrawPriv->driverPrivate; - + _mesa_reference_framebuffer(&fb, NULL); } diff --git a/src/mesa/drivers/dri/intel/intel_screen.h b/src/mesa/drivers/dri/intel/intel_screen.h index 5863093..2ac800a 100644 --- a/src/mesa/drivers/dri/intel/intel_screen.h +++ b/src/mesa/drivers/dri/intel/intel_screen.h @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2003 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ #ifndef _INTEL_INIT_H_ diff --git a/src/mesa/drivers/dri/intel/intel_span.c b/src/mesa/drivers/dri/intel/intel_span.c index 1f41518..ff6db01 100644 --- a/src/mesa/drivers/dri/intel/intel_span.c +++ b/src/mesa/drivers/dri/intel/intel_span.c @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2003 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ #include diff --git a/src/mesa/drivers/dri/intel/intel_span.h b/src/mesa/drivers/dri/intel/intel_span.h index 5a4c4e8..7e9b52a 100644 --- a/src/mesa/drivers/dri/intel/intel_span.h +++ b/src/mesa/drivers/dri/intel/intel_span.h @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2003 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ #ifndef _INTEL_SPAN_H diff --git a/src/mesa/drivers/dri/intel/intel_state.c b/src/mesa/drivers/dri/intel/intel_state.c index 80598b7..542d113 100644 --- a/src/mesa/drivers/dri/intel/intel_state.c +++ b/src/mesa/drivers/dri/intel/intel_state.c @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2003 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ @@ -40,21 +40,21 @@ int intel_translate_shadow_compare_func(GLenum func) { switch (func) { - case GL_NEVER: + case GL_NEVER: return COMPAREFUNC_ALWAYS; - case GL_LESS: + case GL_LESS: return COMPAREFUNC_LEQUAL; - case GL_LEQUAL: + case GL_LEQUAL: return COMPAREFUNC_LESS; - case GL_GREATER: + case GL_GREATER: return COMPAREFUNC_GEQUAL; - case GL_GEQUAL: + case GL_GEQUAL: return COMPAREFUNC_GREATER; - case GL_NOTEQUAL: + case GL_NOTEQUAL: return COMPAREFUNC_EQUAL; - case GL_EQUAL: + case GL_EQUAL: return COMPAREFUNC_NOTEQUAL; - case GL_ALWAYS: + case GL_ALWAYS: return COMPAREFUNC_NEVER; } diff --git a/src/mesa/drivers/dri/intel/intel_tex.c b/src/mesa/drivers/dri/intel/intel_tex.c index 2c21ea0..df4cab8 100644 --- a/src/mesa/drivers/dri/intel/intel_tex.c +++ b/src/mesa/drivers/dri/intel/intel_tex.c @@ -29,7 +29,7 @@ intelNewTextureObject(struct gl_context * ctx, GLuint name, GLenum target) return &obj->base; } -static void +static void intelDeleteTextureObject(struct gl_context *ctx, struct gl_texture_object *texObj) { diff --git a/src/mesa/drivers/dri/intel/intel_tex.h b/src/mesa/drivers/dri/intel/intel_tex.h index b638628..655dd4e 100644 --- a/src/mesa/drivers/dri/intel/intel_tex.h +++ b/src/mesa/drivers/dri/intel/intel_tex.h @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2003 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ #ifndef INTELTEX_INC diff --git a/src/mesa/drivers/dri/intel/intel_tex_copy.c b/src/mesa/drivers/dri/intel/intel_tex_copy.c index c6bc3d9..772a55d 100644 --- a/src/mesa/drivers/dri/intel/intel_tex_copy.c +++ b/src/mesa/drivers/dri/intel/intel_tex_copy.c @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2003 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ #include "main/mtypes.h" @@ -175,7 +175,7 @@ intelCopyTexImage1D(struct gl_context * ctx, GLenum target, GLint level, goto fail; /* Setup or redefine the texture object, mipmap tree and texture - * image. Don't populate yet. + * image. Don't populate yet. */ ctx->Driver.TexImage1D(ctx, target, level, internalFormat, width, border, @@ -267,7 +267,7 @@ intelCopyTexSubImage1D(struct gl_context * ctx, GLenum target, GLint level, /* XXX need to check as in above function? */ - /* Need to check texture is compatible with source format. + /* Need to check texture is compatible with source format. */ if (!do_copy_texsubimage(intel_context(ctx), target, @@ -291,7 +291,7 @@ intelCopyTexSubImage2D(struct gl_context * ctx, GLenum target, GLint level, _mesa_select_tex_image(ctx, texObj, target, level); GLenum internalFormat = texImage->InternalFormat; - /* Need to check texture is compatible with source format. + /* Need to check texture is compatible with source format. */ if (!do_copy_texsubimage(intel_context(ctx), target, diff --git a/src/mesa/drivers/dri/intel/intel_tex_image.c b/src/mesa/drivers/dri/intel/intel_tex_image.c index 41cdbfd..9fc3d9d 100644 --- a/src/mesa/drivers/dri/intel/intel_tex_image.c +++ b/src/mesa/drivers/dri/intel/intel_tex_image.c @@ -47,7 +47,7 @@ logbase2(int n) /* Otherwise, store it in memory if (Border != 0) or (any dimension == * 1). - * + * * Otherwise, if max_level >= level >= min_level, create tree with * space for textures from min_level down to max_level. * @@ -91,7 +91,7 @@ guess_and_alloc_mipmap_tree(struct intel_context *intel, firstLevel = intelObj->base.BaseLevel; - /* Figure out image dimensions at start level. + /* Figure out image dimensions at start level. */ for (i = intelImage->level; i > firstLevel; i--) { width <<= 1; @@ -326,12 +326,12 @@ intelTexImage(struct gl_context * ctx, else { texelBytes = _mesa_get_format_bytes(texImage->TexFormat); - if (!intelImage->mt) { + if (!intelImage->mt) { assert(texImage->RowStride == width); } } - /* Release the reference to a potentially orphaned buffer. + /* Release the reference to a potentially orphaned buffer. * Release any old malloced memory. */ if (intelImage->mt) { @@ -497,9 +497,9 @@ intelTexImage(struct gl_context * ctx, memcpy(texImage->Data, pixels, imageSize); } } - else if (!_mesa_texstore(ctx, dims, - texImage->_BaseFormat, - texImage->TexFormat, + else if (!_mesa_texstore(ctx, dims, + texImage->_BaseFormat, + texImage->TexFormat, texImage->Data, 0, 0, 0, /* dstX/Y/Zoffset */ dstRowStride, texImage->ImageOffsets, @@ -636,7 +636,7 @@ intel_get_tex_image(struct gl_context * ctx, GLenum target, GLint level, _mesa_get_teximage(ctx, target, level, format, type, pixels, texObj, texImage); } - + /* Unmap */ if (intelImage->mt) { diff --git a/src/mesa/drivers/dri/intel/intel_tex_layout.c b/src/mesa/drivers/dri/intel/intel_tex_layout.c index d39733b..b6b2873 100644 --- a/src/mesa/drivers/dri/intel/intel_tex_layout.c +++ b/src/mesa/drivers/dri/intel/intel_tex_layout.c @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2006 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ /* * Authors: diff --git a/src/mesa/drivers/dri/intel/intel_tex_layout.h b/src/mesa/drivers/dri/intel/intel_tex_layout.h index 1c8c53e..5c01dc8 100644 --- a/src/mesa/drivers/dri/intel/intel_tex_layout.h +++ b/src/mesa/drivers/dri/intel/intel_tex_layout.h @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2006 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ /* * Authors: diff --git a/src/mesa/drivers/dri/intel/intel_tex_obj.h b/src/mesa/drivers/dri/intel/intel_tex_obj.h index 5f60e0e..35419fd 100644 --- a/src/mesa/drivers/dri/intel/intel_tex_obj.h +++ b/src/mesa/drivers/dri/intel/intel_tex_obj.h @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2003 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ #ifndef _INTEL_TEX_OBJ_H @@ -52,7 +52,7 @@ struct intel_texture_image { struct gl_texture_image base; - /* These aren't stored in gl_texture_image + /* These aren't stored in gl_texture_image */ GLuint level; GLuint face; diff --git a/src/mesa/drivers/dri/intel/intel_tex_subimage.c b/src/mesa/drivers/dri/intel/intel_tex_subimage.c index c9b992a..6e576cd 100644 --- a/src/mesa/drivers/dri/intel/intel_tex_subimage.c +++ b/src/mesa/drivers/dri/intel/intel_tex_subimage.c @@ -1,9 +1,9 @@ /************************************************************************** - * + * * Copyright 2003 Tungsten Graphics, Inc., Cedar Park, Texas. * 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 @@ -11,11 +11,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. @@ -23,7 +23,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. - * + * **************************************************************************/ #include "main/mtypes.h" @@ -134,7 +134,7 @@ intelTexSubimage(struct gl_context * ctx, if (compressed) { if (intelImage->mt) { struct intel_region *dst = intelImage->mt->region; - + _mesa_copy_rect(texImage->Data, dst->cpp, dst->pitch, xoffset, yoffset / 4, (width + 3) & ~3, (height + 3) / 4, diff --git a/src/mesa/drivers/dri/intel/intel_tex_validate.c b/src/mesa/drivers/dri/intel/intel_tex_validate.c index df4802d..7afe96a 100644 --- a/src/mesa/drivers/dri/intel/intel_tex_validate.c +++ b/src/mesa/drivers/dri/intel/intel_tex_validate.c @@ -98,7 +98,7 @@ copy_image_data_to_tree(struct intel_context *intel, else { assert(intelImage->base.Data != NULL); - /* More straightforward upload. + /* More straightforward upload. */ intel_miptree_image_data(intel, intelObj->mt, @@ -116,7 +116,7 @@ copy_image_data_to_tree(struct intel_context *intel, } -/* +/* */ GLuint intel_finalize_mipmap_tree(struct intel_context *intel, GLuint unit) @@ -129,7 +129,7 @@ intel_finalize_mipmap_tree(struct intel_context *intel, GLuint unit) GLuint nr_faces = 0; struct intel_texture_image *firstImage; - /* We know/require this is true by now: + /* We know/require this is true by now: */ assert(intelObj->base._Complete); @@ -173,7 +173,7 @@ intel_finalize_mipmap_tree(struct intel_context *intel, GLuint unit) /* Check tree can hold all active levels. Check tree matches * target, imageFormat, etc. - * + * * XXX: For some layouts (eg i945?), the test might have to be * first_level == firstLevel, as the tree isn't valid except at the * original start level. Hope to get around this by diff --git a/src/mesa/drivers/dri/mach64/Makefile b/src/mesa/drivers/dri/mach64/Makefile index c20fdec..69d9458 100644 --- a/src/mesa/drivers/dri/mach64/Makefile +++ b/src/mesa/drivers/dri/mach64/Makefile @@ -23,7 +23,7 @@ C_SOURCES = \ $(COMMON_SOURCES) \ $(DRIVER_SOURCES) -ASM_SOURCES = +ASM_SOURCES = include ../Makefile.template diff --git a/src/mesa/drivers/dri/mach64/mach64_context.c b/src/mesa/drivers/dri/mach64/mach64_context.c index 7c989df..2816e2c 100644 --- a/src/mesa/drivers/dri/mach64/mach64_context.c +++ b/src/mesa/drivers/dri/mach64/mach64_context.c @@ -104,7 +104,7 @@ GLboolean mach64CreateContext( gl_api api, /* Allocate the mach64 context */ mmesa = (mach64ContextPtr) CALLOC( sizeof(*mmesa) ); - if ( !mmesa ) + if ( !mmesa ) return GL_FALSE; /* Init default driver functions then plug in our Mach64-specific functions @@ -118,9 +118,9 @@ GLboolean mach64CreateContext( gl_api api, /* Allocate the Mesa context */ if (sharedContextPrivate) shareCtx = ((mach64ContextPtr) sharedContextPrivate)->glCtx; - else + else shareCtx = NULL; - mmesa->glCtx = _mesa_create_context(glVisual, shareCtx, + mmesa->glCtx = _mesa_create_context(glVisual, shareCtx, &functions, (void *)mmesa); if (!mmesa->glCtx) { FREE(mmesa); @@ -216,7 +216,7 @@ GLboolean mach64CreateContext( gl_api api, return GL_FALSE; mmesa->vert_used = 0; mmesa->vert_total = MACH64_BUFFER_SIZE; - + /* Initialize the software rasterizer and helper modules. */ _swrast_CreateContext( ctx ); @@ -292,7 +292,7 @@ void mach64DestroyContext( __DRIcontext *driContextPriv ) /* Free the vertex buffer */ if ( mmesa->vert_buf ) _mesa_align_free( mmesa->vert_buf ); - + /* free the Mesa context */ mmesa->glCtx->DriverCtx = NULL; _mesa_destroy_context(mmesa->glCtx); @@ -319,7 +319,7 @@ mach64MakeCurrent( __DRIcontext *driContextPriv, newMach64Ctx->dirty = MACH64_UPLOAD_ALL; } - + if ( newMach64Ctx->driDrawable != driDrawPriv ) { if (driDrawPriv->swap_interval == (unsigned)-1) { driDrawPriv->vblFlags = (newMach64Ctx->do_irqs) diff --git a/src/mesa/drivers/dri/mach64/mach64_context.h b/src/mesa/drivers/dri/mach64/mach64_context.h index 11e8f53..8adbea6 100644 --- a/src/mesa/drivers/dri/mach64/mach64_context.h +++ b/src/mesa/drivers/dri/mach64/mach64_context.h @@ -180,7 +180,7 @@ struct mach64_context { GLuint vertex_stride_shift; GLuint vertex_format; GLuint num_verts; - GLubyte *verts; + GLubyte *verts; CARD32 Color; /* Current draw color */ CARD32 ClearColor; /* Color used to clear color buffer */ diff --git a/src/mesa/drivers/dri/mach64/mach64_dd.c b/src/mesa/drivers/dri/mach64/mach64_dd.c index 9cb2c10..5324ee1 100644 --- a/src/mesa/drivers/dri/mach64/mach64_dd.c +++ b/src/mesa/drivers/dri/mach64/mach64_dd.c @@ -69,7 +69,7 @@ static const GLubyte *mach64DDGetString( struct gl_context *ctx, GLenum name ) return (GLubyte*)"Gareth Hughes, Leif Delgass, Jos� Fonseca"; case GL_RENDERER: - + offset = driGetRendererString( buffer, card_name, DRIVER_DATE, agp_mode ); return (GLubyte *)buffer; diff --git a/src/mesa/drivers/dri/mach64/mach64_ioctl.c b/src/mesa/drivers/dri/mach64/mach64_ioctl.c index 0146e0d..7675ad3 100644 --- a/src/mesa/drivers/dri/mach64/mach64_ioctl.c +++ b/src/mesa/drivers/dri/mach64/mach64_ioctl.c @@ -167,7 +167,7 @@ void mach64FlushVerticesLocked( mach64ContextPtr mmesa ) } mmesa->sarea->dirty |= MACH64_UPLOAD_CLIPRECTS; - + vertex.prim = prim; vertex.buf = buffer; vertex.used = count; @@ -209,7 +209,7 @@ void mach64FireBlitLocked( mach64ContextPtr mmesa, void *buffer, blit.height = height; do { - ret = drmCommandWrite( mmesa->driFd, DRM_MACH64_BLIT, + ret = drmCommandWrite( mmesa->driFd, DRM_MACH64_BLIT, &blit, sizeof(drm_mach64_blit_t) ); } while ( ( ret == -EAGAIN ) && ( to++ < MACH64_TIMEOUT ) ); @@ -415,7 +415,7 @@ void mach64PerformanceBoxesLocked( mach64ContextPtr mmesa ) y1 = b[0].y1; x2 = b[0].x2; y2 = b[0].y2; - + /* setup a single cliprect and call the clear ioctl for each box */ mmesa->sarea->nbox = 1; @@ -433,7 +433,7 @@ void mach64PerformanceBoxesLocked( mach64ContextPtr mmesa ) /* Red box if DDFinish was called to wait for rendering to complete */ if ( mmesa->c_drawWaits ) { color = mach64PackColor( mmesa->mach64Screen->cpp, 255, 0, 0, 0 ); - + clear.x = x; clear.y = y; clear.w = w; @@ -458,7 +458,7 @@ void mach64PerformanceBoxesLocked( mach64ContextPtr mmesa ) /* draw a green box if we had to wait for previous frame(s) to complete */ if ( !mmesa->hardwareWentIdle ) { color = mach64PackColor( mmesa->mach64Screen->cpp, 0, 255, 0, 0 ); - + clear.x = x; clear.y = y; clear.w = w; @@ -528,7 +528,7 @@ void mach64PerformanceBoxesLocked( mach64ContextPtr mmesa ) exit( -1 ); } } - } + } x += w; w = 8; @@ -553,7 +553,7 @@ void mach64PerformanceBoxesLocked( mach64ContextPtr mmesa ) fprintf( stderr, "DRM_MACH64_CLEAR: return = %d\n", ret ); exit( -1 ); } - + } h = 4; @@ -565,8 +565,8 @@ void mach64PerformanceBoxesLocked( mach64ContextPtr mmesa ) if ( mmesa->c_textureBytes ) { color = mach64PackColor( mmesa->mach64Screen->cpp, 255, 0, 255, 0 ); w = mmesa->c_textureBytes / 16384; - if ( w <= 0 ) - w = 1; + if ( w <= 0 ) + w = 1; if (w > (mmesa->driDrawable->w - 44)) w = mmesa->driDrawable->w - 44; @@ -592,8 +592,8 @@ void mach64PerformanceBoxesLocked( mach64ContextPtr mmesa ) if ( mmesa->c_agpTextureBytes ) { color = mach64PackColor( mmesa->mach64Screen->cpp, 0, 0, 255, 0 ); w = mmesa->c_agpTextureBytes / 16384; - if ( w <= 0 ) - w = 1; + if ( w <= 0 ) + w = 1; if (w > (mmesa->driDrawable->w - 44)) w = mmesa->driDrawable->w - 44; @@ -852,7 +852,7 @@ void mach64FlushDMALocked( mach64ContextPtr mmesa ) void mach64UploadHwStateLocked( mach64ContextPtr mmesa ) { drm_mach64_sarea_t *sarea = mmesa->sarea; - + drm_mach64_context_regs_t *regs = &sarea->context_state; unsigned int dirty = sarea->dirty; CARD32 offset = ((regs->tex_size_pitch & 0xf0) >> 2); diff --git a/src/mesa/drivers/dri/mach64/mach64_lock.c b/src/mesa/drivers/dri/mach64/mach64_lock.c index 1a95a8f..ae69015 100644 --- a/src/mesa/drivers/dri/mach64/mach64_lock.c +++ b/src/mesa/drivers/dri/mach64/mach64_lock.c @@ -65,7 +65,7 @@ void mach64GetLock( mach64ContextPtr mmesa, GLuint flags ) * Since the hardware state depends on having the latest drawable * clip rects, all state checking must be done _after_ this call. */ - DRI_VALIDATE_DRAWABLE_INFO( sPriv, dPriv ); + DRI_VALIDATE_DRAWABLE_INFO( sPriv, dPriv ); if ( mmesa->lastStamp != dPriv->lastStamp ) { mmesa->lastStamp = dPriv->lastStamp; diff --git a/src/mesa/drivers/dri/mach64/mach64_native_vb.c b/src/mesa/drivers/dri/mach64/mach64_native_vb.c index d8426dd..a9a78d7 100644 --- a/src/mesa/drivers/dri/mach64/mach64_native_vb.c +++ b/src/mesa/drivers/dri/mach64/mach64_native_vb.c @@ -45,13 +45,13 @@ void TAG(translate_vertex)(struct gl_context *ctx, CARD32 *p = (CARD32 *)src + 10 - mmesa->vertex_size; dst->attrib[FRAG_ATTRIB_WPOS][3] = 1.0; - + switch ( format ) { case TEX1_VERTEX_FORMAT: #ifdef MACH64_PREMULT_TEXCOORDS { float rhw = 1.0 / LE32_IN_FLOAT( p + 2 ); - + dst->attrib[FRAG_ATTRIB_TEX1][0] = rhw*LE32_IN_FLOAT( p++ ); dst->attrib[FRAG_ATTRIB_TEX1][1] = rhw*LE32_IN_FLOAT( p++ ); } @@ -66,7 +66,7 @@ void TAG(translate_vertex)(struct gl_context *ctx, #ifdef MACH64_PREMULT_TEXCOORDS { float rhw = 1.0 / LE32_IN_FLOAT( p + 2 ); - + dst->attrib[FRAG_ATTRIB_TEX0][0] = rhw*LE32_IN_FLOAT( p++ ); dst->attrib[FRAG_ATTRIB_TEX0][1] = rhw*LE32_IN_FLOAT( p++ ); } @@ -76,7 +76,7 @@ void TAG(translate_vertex)(struct gl_context *ctx, #endif dst->attrib[FRAG_ATTRIB_TEX0][3] = 1.0; dst->attrib[FRAG_ATTRIB_WPOS][3] = LE32_IN_FLOAT( p++ ); - + case NOTEX_VERTEX_FORMAT: dst->attrib[FRAG_ATTRIB_COL1][2] = UBYTE_TO_FLOAT(((GLubyte *)p)[0]); dst->attrib[FRAG_ATTRIB_COL1][1] = UBYTE_TO_FLOAT(((GLubyte *)p)[1]); @@ -92,17 +92,17 @@ void TAG(translate_vertex)(struct gl_context *ctx, dst->color[0] = ((GLubyte *)p)[2]; dst->color[3] = ((GLubyte *)p)[3]; p++; - + { GLuint xy = LE32_IN( p ); - + dst->attrib[FRAG_ATTRIB_WPOS][0] = UNVIEWPORT_X( (GLfloat)(GLshort)( xy >> 16 ) ); dst->attrib[FRAG_ATTRIB_WPOS][1] = UNVIEWPORT_Y( (GLfloat)(GLshort)( xy & 0xffff ) ); } } assert( p + 1 - (CARD32 *)src == 10 ); - + dst->pointSize = ctx->Point.Size; } @@ -113,14 +113,14 @@ void TAG(print_vertex)( struct gl_context *ctx, const VERTEX *v ) LOCALVARS GLuint format = GET_VERTEX_FORMAT(); CARD32 *p = (CARD32 *)v + 10 - mmesa->vertex_size; - + switch ( format ) { case TEX1_VERTEX_FORMAT: { GLfloat u, v, w; #ifdef MACH64_PREMULT_TEXCOORDS float rhw = 1.0 / LE32_IN_FLOAT( p + 2 ); - + u = rhw*LE32_IN_FLOAT( p++ ); v = rhw*LE32_IN_FLOAT( p++ ); #else @@ -136,7 +136,7 @@ void TAG(print_vertex)( struct gl_context *ctx, const VERTEX *v ) GLfloat u, v, w; #ifdef MACH64_PREMULT_TEXCOORDS float rhw = 1.0 / LE32_IN_FLOAT( p + 2 ); - + u = rhw*LE32_IN_FLOAT( p++ ); v = rhw*LE32_IN_FLOAT( p++ ); #else @@ -146,11 +146,11 @@ void TAG(print_vertex)( struct gl_context *ctx, const VERTEX *v ) w = LE32_IN_FLOAT( p++ ); fprintf( stderr, "u0 %f v0 %f w0 %f\n", u, v, w ); } - + case NOTEX_VERTEX_FORMAT: { GLubyte r, g, b, a; - + b = ((GLubyte *)p)[0]; g = ((GLubyte *)p)[1]; r = ((GLubyte *)p)[2]; @@ -164,7 +164,7 @@ void TAG(print_vertex)( struct gl_context *ctx, const VERTEX *v ) GLuint xy; GLfloat x, y, z; GLubyte r, g, b, a; - + z = LE32_IN( p++ ) / 65536.0; b = ((GLubyte *)p)[0]; @@ -175,24 +175,24 @@ void TAG(print_vertex)( struct gl_context *ctx, const VERTEX *v ) xy = LE32_IN( p ); x = (GLfloat)(GLshort)( xy >> 16 ) / 4.0; y = (GLfloat)(GLshort)( xy & 0xffff ) / 4.0; - + fprintf(stderr, "x %f y %f z %f\n", x, y, z); fprintf(stderr, "r %d g %d b %d a %d\n", r, g, b, a); } } - - assert( p + 1 - (CARD32 *)v == 10 ); + + assert( p + 1 - (CARD32 *)v == 10 ); fprintf(stderr, "\n"); } /* Interpolate the elements of the VB not included in typical hardware - * vertices. + * vertices. * * NOTE: All these arrays are guarenteed by tnl to be writeable and * have good stride. */ -#ifndef INTERP_QUALIFIER +#ifndef INTERP_QUALIFIER #define INTERP_QUALIFIER static #endif @@ -209,7 +209,7 @@ INTERP_QUALIFIER void TAG(interp_extras)( struct gl_context *ctx, if (VB->BackfaceColorPtr) { assert(VB->BackfaceColorPtr->stride == 4 * sizeof(GLfloat)); - + INTERP_4F( t, GET_COLOR(VB->BackfaceColorPtr, dst), GET_COLOR(VB->BackfaceColorPtr, out), @@ -230,7 +230,7 @@ INTERP_QUALIFIER void TAG(interp_extras)( struct gl_context *ctx, INTERP_VERTEX(ctx, t, dst, out, in, force_boundary); } -INTERP_QUALIFIER void TAG(copy_pv_extras)( struct gl_context *ctx, +INTERP_QUALIFIER void TAG(copy_pv_extras)( struct gl_context *ctx, GLuint dst, GLuint src ) { LOCALVARS diff --git a/src/mesa/drivers/dri/mach64/mach64_native_vbtmp.h b/src/mesa/drivers/dri/mach64/mach64_native_vbtmp.h index 8345f5c..897a42e 100644 --- a/src/mesa/drivers/dri/mach64/mach64_native_vbtmp.h +++ b/src/mesa/drivers/dri/mach64/mach64_native_vbtmp.h @@ -183,7 +183,7 @@ static void TAG(emit)( struct gl_context *ctx, w = 1.0; } #endif - + #if DO_TEX1 #if DO_PTEX if (tc1_size == 4) { @@ -195,7 +195,7 @@ static void TAG(emit)( struct gl_context *ctx, float rhw = 1.0 / tc1[0][3]; LE32_OUT_FLOAT( p++, rhw*tc1[0][0] ); /* VERTEX_?_SECONDARY_S */ LE32_OUT_FLOAT( p++, rhw*tc1[0][1] ); /* VERTEX_?_SECONDARY_T */ - LE32_OUT_FLOAT( p++, w*tc1[0][3] ); /* VERTEX_?_SECONDARY_W */ + LE32_OUT_FLOAT( p++, w*tc1[0][3] ); /* VERTEX_?_SECONDARY_W */ #endif /* !MACH64_PREMULT_TEXCOORDS */ } else { #endif /* DO_PTEX */ @@ -215,7 +215,7 @@ static void TAG(emit)( struct gl_context *ctx, #else /* !DO_TEX1 */ p += 3; #endif /* !DO_TEX1 */ - + #if DO_TEX0 #if DO_PTEX if (tc0_size == 4) { @@ -227,7 +227,7 @@ static void TAG(emit)( struct gl_context *ctx, float rhw = 1.0 / tc0[0][3]; LE32_OUT_FLOAT( p++, rhw*tc0[0][0] ); /* VERTEX_?_S */ LE32_OUT_FLOAT( p++, rhw*tc0[0][1] ); /* VERTEX_?_T */ - LE32_OUT_FLOAT( p++, w*tc0[0][3] ); /* VERTEX_?_W */ + LE32_OUT_FLOAT( p++, w*tc0[0][3] ); /* VERTEX_?_W */ #endif /* !MACH64_PREMULT_TEXCOORDS */ } else { #endif /* DO_PTEX */ @@ -261,7 +261,7 @@ static void TAG(emit)( struct gl_context *ctx, STRIDE_4F(fog, fog_stride); #endif p++; - + #if DO_XYZW if (mask[i] == 0) { /* unclipped */ @@ -290,7 +290,7 @@ static void TAG(emit)( struct gl_context *ctx, LE32_OUT( p, (VIEWPORT_X( coord[0][0] ) << 16) | /* VERTEX_?_X */ (VIEWPORT_Y( coord[0][1] ) & 0xffff) ); /* VERTEX_?_Y */ - + if (MACH64_DEBUG & DEBUG_VERBOSE_PRIMS) { fprintf( stderr, "%s: vert %d: %.2f %.2f %.2f %x\n", __FUNCTION__, @@ -305,7 +305,7 @@ static void TAG(emit)( struct gl_context *ctx, #if DO_TEX1 || DO_TEX0 || DO_XYZW STRIDE_4F(coord, coord_stride); #endif - + assert( p + 1 - (CARD32 *)v == 10 ); } } @@ -377,26 +377,26 @@ static void TAG(interp)( struct gl_context *ctx, INTERP_F( t, qdst, qout, qin ); rqdst = 1.0 / qdst; - + INTERP_F( t, temp, LE32_IN_FLOAT( out ) * qout, LE32_IN_FLOAT( in ) * qin ); LE32_OUT_FLOAT( dst, temp*rqdst ); /* VERTEX_?_SECONDARY_S */ dst++; out++; in++; - + INTERP_F( t, temp, LE32_IN_FLOAT( out ) * qout, LE32_IN_FLOAT( in ) * qin ); LE32_OUT_FLOAT( dst, temp*rqdst ); /* VERTEX_?_SECONDARY_T */ dst++; out++; in++; - + LE32_OUT_FLOAT( dst, w*rqdst ); /* VERTEX_?_SECONDARY_W */ dst++; out++; in++; #else /* !DO_PTEX */ #ifdef MACH64_PREMULT_TEXCOORDS GLfloat qout = w / LE32_IN_FLOAT( out + 2 ); GLfloat qin = w / LE32_IN_FLOAT( in + 2 ); - + INTERP_F( t, temp, LE32_IN_FLOAT( out ) * qout, LE32_IN_FLOAT( in ) * qin ); LE32_OUT_FLOAT( dst, temp ); /* VERTEX_?_SECONDARY_S */ dst++; out++; in++; - + INTERP_F( t, temp, LE32_IN_FLOAT( out ) * qout, LE32_IN_FLOAT( in ) * qin ); LE32_OUT_FLOAT( dst, temp ); /* VERTEX_?_SECONDARY_T */ dst++; out++; in++; @@ -404,7 +404,7 @@ static void TAG(interp)( struct gl_context *ctx, INTERP_F( t, temp, LE32_IN_FLOAT( out ), LE32_IN_FLOAT( in ) ); LE32_OUT_FLOAT( dst, temp ); /* VERTEX_?_SECONDARY_S */ dst++; out++; in++; - + INTERP_F( t, temp, LE32_IN_FLOAT( out ), LE32_IN_FLOAT( in ) ); LE32_OUT_FLOAT( dst, temp ); /* VERTEX_?_SECONDARY_T */ dst++; out++; in++; @@ -429,26 +429,26 @@ static void TAG(interp)( struct gl_context *ctx, INTERP_F( t, qdst, qout, qin ); rqdst = 1.0 / qdst; - + INTERP_F( t, temp, LE32_IN_FLOAT( out ) * qout, LE32_IN_FLOAT( in ) * qin ); LE32_OUT_FLOAT( dst, temp*rqdst ); /* VERTEX_?_S */ dst++; out++; in++; - + INTERP_F( t, temp, LE32_IN_FLOAT( out ) * qout, LE32_IN_FLOAT( in ) * qin ); LE32_OUT_FLOAT( dst, temp*rqdst ); /* VERTEX_?_T */ dst++; out++; in++; - + LE32_OUT_FLOAT( dst, w*rqdst ); /* VERTEX_?_W */ dst++; out++; in++; #else /* !DO_PTEX */ #ifdef MACH64_PREMULT_TEXCOORDS GLfloat qout = w / LE32_IN_FLOAT( out + 2 ); GLfloat qin = w / LE32_IN_FLOAT( in + 2 ); - + INTERP_F( t, temp, LE32_IN_FLOAT( out ) * qout, LE32_IN_FLOAT( in ) * qin ); LE32_OUT_FLOAT( dst, temp ); /* VERTEX_?_S */ dst++; out++; in++; - + INTERP_F( t, temp, LE32_IN_FLOAT( out ) * qout, LE32_IN_FLOAT( in ) * qin ); LE32_OUT_FLOAT( dst, temp ); /* VERTEX_?_T */ dst++; out++; in++; @@ -456,7 +456,7 @@ static void TAG(interp)( struct gl_context *ctx, INTERP_F( t, temp, LE32_IN_FLOAT( out ), LE32_IN_FLOAT( in ) ); LE32_OUT_FLOAT( dst, temp ); /* VERTEX_?_S */ dst++; out++; in++; - + INTERP_F( t, temp, LE32_IN_FLOAT( out ), LE32_IN_FLOAT( in ) ); LE32_OUT_FLOAT( dst, temp ); /* VERTEX_?_T */ dst++; out++; in++; @@ -468,13 +468,13 @@ static void TAG(interp)( struct gl_context *ctx, #else /* !DO_TEX0 */ dst += 3; out += 3; in += 3; #endif /* !DO_TEX0 */ - + #if DO_SPEC INTERP_UB( t, ((GLubyte *)dst)[0], ((GLubyte *)out)[0], ((GLubyte *)in)[0] ); /* VERTEX_?_SPEC_B */ INTERP_UB( t, ((GLubyte *)dst)[1], ((GLubyte *)out)[1], ((GLubyte *)in)[1] ); /* VERTEX_?_SPEC_G */ INTERP_UB( t, ((GLubyte *)dst)[2], ((GLubyte *)out)[2], ((GLubyte *)in)[2] ); /* VERTEX_?_SPEC_R */ #endif - + #if DO_FOG INTERP_UB( t, ((GLubyte *)dst)[3], ((GLubyte *)out)[3], ((GLubyte *)in)[3] ); /* VERTEX_?_SPEC_A */ #endif /* DO_FOG */ @@ -483,7 +483,7 @@ static void TAG(interp)( struct gl_context *ctx, LE32_OUT( dst, VIEWPORT_Z( dstclip[2] * w ) ); /* VERTEX_?_Z */ dst++; out++; in++; - + INTERP_UB( t, ((GLubyte *)dst)[0], ((GLubyte *)out)[0], ((GLubyte *)in)[0] ); /* VERTEX_?_B */ INTERP_UB( t, ((GLubyte *)dst)[1], ((GLubyte *)out)[1], ((GLubyte *)in)[1] ); /* VERTEX_?_G */ INTERP_UB( t, ((GLubyte *)dst)[2], ((GLubyte *)out)[2], ((GLubyte *)in)[2] ); /* VERTEX_?_R */ @@ -514,7 +514,7 @@ static void TAG(interp)( struct gl_context *ctx, static void TAG(copy_pv)( struct gl_context *ctx, GLuint edst, GLuint esrc ) { #if DO_SPEC || DO_FOG || DO_RGBA - LOCALVARS + LOCALVARS GLubyte *verts = GET_VERTEX_STORE(); GLuint size = GET_VERTEX_SIZE(); GLuint *dst = (GLuint *)(verts + (edst * size)); diff --git a/src/mesa/drivers/dri/mach64/mach64_screen.c b/src/mesa/drivers/dri/mach64/mach64_screen.c index 956bccb..0e0d6b9 100644 --- a/src/mesa/drivers/dri/mach64/mach64_screen.c +++ b/src/mesa/drivers/dri/mach64/mach64_screen.c @@ -93,7 +93,7 @@ mach64FillInModes( __DRIscreen *psp, depth_bits_array[0] = depth_bits; depth_bits_array[1] = depth_bits; - + /* Just like with the accumulation buffer, always provide some modes * with a stencil buffer. It will be a sw fallback, but some apps won't * care about that. @@ -153,7 +153,7 @@ mach64CreateScreen( __DRIscreen *sPriv ) return GL_FALSE; } - if ( MACH64_DEBUG & DEBUG_VERBOSE_DRI ) + if ( MACH64_DEBUG & DEBUG_VERBOSE_DRI ) fprintf( stderr, "%s\n", __FUNCTION__ ); /* Allocate the private area */ @@ -276,7 +276,7 @@ mach64DestroyScreen( __DRIscreen *driScreen ) if ( !mach64Screen ) return; - if ( MACH64_DEBUG & DEBUG_VERBOSE_DRI ) + if ( MACH64_DEBUG & DEBUG_VERBOSE_DRI ) fprintf( stderr, "%s\n", __FUNCTION__ ); if ( !mach64Screen->IsPCI ) { @@ -411,7 +411,7 @@ mach64InitDriver( __DRIscreen *driScreen ) /** * This is the driver specific part of the createNewScreen entry point. - * + * * \todo maybe fold this into intelInitDriver * * \return the struct gl_config supported by this driver @@ -430,7 +430,7 @@ mach64InitScreen(__DRIscreen *psp) &psp->drm_version, & drm_expected ) ) { return NULL; } - + if (!mach64InitDriver(psp)) return NULL; diff --git a/src/mesa/drivers/dri/mach64/mach64_state.c b/src/mesa/drivers/dri/mach64/mach64_state.c index 8e79595..e472ddc 100644 --- a/src/mesa/drivers/dri/mach64/mach64_state.c +++ b/src/mesa/drivers/dri/mach64/mach64_state.c @@ -193,7 +193,7 @@ static void mach64DDAlphaFunc( struct gl_context *ctx, GLenum func, GLfloat ref mmesa->new_state |= MACH64_NEW_ALPHA; } -static void mach64DDBlendEquationSeparate( struct gl_context *ctx, +static void mach64DDBlendEquationSeparate( struct gl_context *ctx, GLenum modeRGB, GLenum modeA ) { mach64ContextPtr mmesa = MACH64_CONTEXT(ctx); @@ -335,7 +335,7 @@ static void mach64UpdateFogAttrib( struct gl_context *ctx ) /* From Utah-glx: "fog color is now dest and fog factor is alpha, so * use GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA" */ - s |= (MACH64_ALPHA_BLEND_SRC_SRCALPHA | + s |= (MACH64_ALPHA_BLEND_SRC_SRCALPHA | MACH64_ALPHA_BLEND_DST_INVSRCALPHA); /* From Utah-glx: "can't use texture alpha when fogging" */ s &= ~MACH64_TEX_MAP_AEN; @@ -343,7 +343,7 @@ static void mach64UpdateFogAttrib( struct gl_context *ctx ) s &= ~(MACH64_ALPHA_BLEND_SRC_MASK | MACH64_ALPHA_BLEND_DST_MASK | MACH64_ALPHA_BLEND_SAT); - s |= (MACH64_ALPHA_BLEND_SRC_ONE | + s |= (MACH64_ALPHA_BLEND_SRC_ONE | MACH64_ALPHA_BLEND_DST_ZERO); s &= ~MACH64_ALPHA_FOG_EN_FOG; } @@ -662,7 +662,7 @@ static void mach64DDClearColor( struct gl_context *ctx, { mach64ContextPtr mmesa = MACH64_CONTEXT(ctx); GLubyte c[4]; - + CLAMPED_FLOAT_TO_UBYTE(c[0], color[0]); CLAMPED_FLOAT_TO_UBYTE(c[1], color[1]); CLAMPED_FLOAT_TO_UBYTE(c[2], color[2]); @@ -675,7 +675,7 @@ static void mach64DDClearColor( struct gl_context *ctx, static void mach64DDLogicOpCode( struct gl_context *ctx, GLenum opcode ) { mach64ContextPtr mmesa = MACH64_CONTEXT(ctx); - + if ( ctx->Color.ColorLogicOpEnabled ) { FLUSH_BATCH( mmesa ); @@ -920,7 +920,7 @@ void mach64EmitHwStateLocked( mach64ContextPtr mmesa ) } if ( t0 && t1 && mmesa->mach64Screen->numTexHeaps > 1 ) { - if (t0->heap != t1->heap || + if (t0->heap != t1->heap || (mmesa->dirty & MACH64_UPLOAD_TEX0IMAGE) || (mmesa->dirty & MACH64_UPLOAD_TEX1IMAGE)) mach64UploadMultiTexImages( mmesa, t0, t1 ); @@ -1137,7 +1137,7 @@ void mach64DDInitState( mach64ContextPtr mmesa ) MACH64_COMP_FILTER_NEAREST | /* MACH64_TEXTURE_TILING | */ #ifdef MACH64_PREMULT_TEXCOORDS - MACH64_TEX_ST_DIRECT | + MACH64_TEX_ST_DIRECT | #endif MACH64_TEX_SRC_LOCAL | MACH64_TEX_UNCOMPRESSED | @@ -1180,7 +1180,7 @@ void mach64DDInitStateFuncs( struct gl_context *ctx ) ctx->Driver.RenderMode = mach64DDRenderMode; ctx->Driver.Scissor = mach64DDScissor; ctx->Driver.ShadeModel = mach64DDShadeModel; - + ctx->Driver.DepthRange = mach64DepthRange; ctx->Driver.Viewport = mach64Viewport; } diff --git a/src/mesa/drivers/dri/mach64/mach64_tex.c b/src/mesa/drivers/dri/mach64/mach64_tex.c index 68d273a..8c75529 100644 --- a/src/mesa/drivers/dri/mach64/mach64_tex.c +++ b/src/mesa/drivers/dri/mach64/mach64_tex.c @@ -413,7 +413,7 @@ static void mach64DDTexEnv( struct gl_context *ctx, GLenum target, if ( mmesa->env_color != 0x00000000 && mmesa->env_color != 0xff000000 && mmesa->env_color != 0x00ffffff && - mmesa->env_color != 0xffffffff )) { + mmesa->env_color != 0xffffffff )) { mmesa->blend_flags |= MACH64_BLEND_ENV_COLOR; } } @@ -473,7 +473,7 @@ static void mach64DDTexParameter( struct gl_context *ctx, GLenum target, * This isn't the most efficient solution but there doesn't appear to * be a nice alternative. Since there's no LOD clamping, * we just have to rely on loading the right subset of mipmap levels - * to simulate a clamped LOD. + * to simulate a clamped LOD. * * For mach64 we're only concerned with the base level * since that's the only texture we upload. diff --git a/src/mesa/drivers/dri/mach64/mach64_texmem.c b/src/mesa/drivers/dri/mach64/mach64_texmem.c index b09954c..86a9dc5 100644 --- a/src/mesa/drivers/dri/mach64/mach64_texmem.c +++ b/src/mesa/drivers/dri/mach64/mach64_texmem.c @@ -391,7 +391,7 @@ static int mach64AllocateMultiTex( mach64ContextPtr mmesa, * local or AGP memory, so we need a "buddy system" to make sure that allocation * succeeds or fails for both textures. */ -void mach64UploadMultiTexImages( mach64ContextPtr mmesa, +void mach64UploadMultiTexImages( mach64ContextPtr mmesa, mach64TexObjPtr t0, mach64TexObjPtr t1 ) { @@ -502,7 +502,7 @@ void mach64UploadMultiTexImages( mach64ContextPtr mmesa, t1->base.tObj->Image[0][j1]->Width, t1->base.tObj->Image[0][j1]->Height ); } - + mmesa->setup.tex_cntl |= MACH64_TEX_CACHE_FLUSH; t1->base.dirty_images[0] = 0; } diff --git a/src/mesa/drivers/dri/mach64/mach64_texstate.c b/src/mesa/drivers/dri/mach64/mach64_texstate.c index 70365c8..7d86987 100644 --- a/src/mesa/drivers/dri/mach64/mach64_texstate.c +++ b/src/mesa/drivers/dri/mach64/mach64_texstate.c @@ -127,7 +127,7 @@ static void mach64UpdateTextureEnv( struct gl_context *ctx, int unit ) * ALPHA C = Cf C = Cf undef C = Cf * A = At A = AfAt A = AfAt * - * LUMINANCE C = Ct C = CfCt undef C = Cf(1-Ct)+CcCt + * LUMINANCE C = Ct C = CfCt undef C = Cf(1-Ct)+CcCt * A = Af A = Af A = Af * * LUMINANCE_ALPHA C = Ct C = CfCt undef C = Cf(1-Ct)+CcCt @@ -140,14 +140,14 @@ static void mach64UpdateTextureEnv( struct gl_context *ctx, int unit ) * A = Af A = Af A = Af A = Af * * RGBA C = Ct C = CfCt C = Cf(1-At)+CtAt C = Cf(1-Ct)+CcCt - * A = At A = AfAt A = Af A = AfAt + * A = At A = AfAt A = Af A = AfAt */ if ( unit == 0 ) { s &= ~MACH64_TEX_LIGHT_FCN_MASK; - /* Set the texture environment state + /* Set the texture environment state * Need to verify these are working correctly, but the * texenv Mesa demo seems to work. */ @@ -191,7 +191,7 @@ static void mach64UpdateTextureEnv( struct gl_context *ctx, int unit ) break; case GL_DECAL: switch ( format ) { - case GL_RGBA: + case GL_RGBA: s |= MACH64_TEX_LIGHT_FCN_ALPHA_DECAL; break; case GL_RGB: @@ -329,12 +329,12 @@ static void mach64UpdateTextureUnit( struct gl_context *ctx, int unit ) if ( unit == 0 ) { d &= ~MACH64_SCALE_PIX_WIDTH_MASK; d |= (t->textureFormat << 28); - + s &= ~(MACH64_TEXTURE_DISABLE | MACH64_TEX_CACHE_SPLIT | MACH64_TEX_BLEND_FCN_MASK | MACH64_TEX_MAP_AEN); - + if ( mmesa->multitex ) { s |= MACH64_TEX_BLEND_FCN_TRILINEAR | MACH64_TEX_CACHE_SPLIT; } else if ( t->BilinearMin ) { @@ -347,39 +347,39 @@ static void mach64UpdateTextureUnit( struct gl_context *ctx, int unit ) } else { s &= ~MACH64_BILINEAR_TEX_EN; } - + if ( t->hasAlpha ) { s |= MACH64_TEX_MAP_AEN; } - + mmesa->setup.tex_cntl &= ~(MACH64_TEXTURE_CLAMP_S | MACH64_TEXTURE_CLAMP_T | MACH64_SECONDARY_STW); - + if ( t->ClampS ) { mmesa->setup.tex_cntl |= MACH64_TEXTURE_CLAMP_S; } if ( t->ClampT ) { mmesa->setup.tex_cntl |= MACH64_TEXTURE_CLAMP_T; } - + mmesa->setup.tex_size_pitch |= ((t->widthLog2 << 0) | (t->maxLog2 << 4) | (t->heightLog2 << 8)); } else { - + /* Enable texture mapping mode */ s &= ~MACH64_TEXTURE_DISABLE; - + d &= ~MACH64_COMPOSITE_PIX_WIDTH_MASK; d |= (t->textureFormat << 4); - + mmesa->setup.tex_cntl &= ~(MACH64_COMP_ALPHA | MACH64_SEC_TEX_CLAMP_S | MACH64_SEC_TEX_CLAMP_T); mmesa->setup.tex_cntl |= (MACH64_TEXTURE_COMPOSITE | MACH64_SECONDARY_STW); - + if ( t->BilinearMin ) { mmesa->setup.tex_cntl |= MACH64_COMP_BLEND_BILINEAR; } else { @@ -390,7 +390,7 @@ static void mach64UpdateTextureUnit( struct gl_context *ctx, int unit ) } else { mmesa->setup.tex_cntl &= ~MACH64_COMP_FILTER_BILINEAR; } - + if ( t->hasAlpha ) { mmesa->setup.tex_cntl |= MACH64_COMP_ALPHA; } @@ -400,21 +400,21 @@ static void mach64UpdateTextureUnit( struct gl_context *ctx, int unit ) if ( t->ClampT ) { mmesa->setup.tex_cntl |= MACH64_SEC_TEX_CLAMP_T; } - + mmesa->setup.tex_size_pitch |= ((t->widthLog2 << 16) | (t->maxLog2 << 20) | (t->heightLog2 << 24)); } - + if ( mmesa->setup.scale_3d_cntl != s ) { mmesa->setup.scale_3d_cntl = s; mmesa->dirty |= MACH64_UPLOAD_SCALE_3D_CNTL; } - + if ( mmesa->setup.dp_pix_width != d ) { mmesa->setup.dp_pix_width = d; mmesa->dirty |= MACH64_UPLOAD_DP_PIX_WIDTH; - } + } } else if (texUnit->_ReallyEnabled) { /* 3D or cube map texture enabled - fallback */ @@ -473,7 +473,7 @@ void mach64UpdateTextureState( struct gl_context *ctx ) mach64UpdateTextureEnv( ctx, 0 ); } } else if (ctx->Texture._EnabledUnits & 0x1) { - /* only unit 0 enabled */ + /* only unit 0 enabled */ mach64UpdateTextureUnit( ctx, 0 ); mach64UpdateTextureEnv( ctx, 0 ); } diff --git a/src/mesa/drivers/dri/mach64/mach64_tris.c b/src/mesa/drivers/dri/mach64/mach64_tris.c index 024ee2f..c78d64c 100644 --- a/src/mesa/drivers/dri/mach64/mach64_tris.c +++ b/src/mesa/drivers/dri/mach64/mach64_tris.c @@ -141,33 +141,33 @@ static INLINE void mach64_draw_quad( mach64ContextPtr mmesa, fprintf(stderr,"Vertex 4:\n"); mach64_print_vertex( ctx, v3 ); } - + xy = LE32_IN( &v0->ui[xyoffset] ); xx[0] = (GLshort)( xy >> 16 ); yy[0] = (GLshort)( xy & 0xffff ); - + xy = LE32_IN( &v1->ui[xyoffset] ); xx[1] = (GLshort)( xy >> 16 ); yy[1] = (GLshort)( xy & 0xffff ); - + xy = LE32_IN( &v3->ui[xyoffset] ); xx[2] = (GLshort)( xy >> 16 ); yy[2] = (GLshort)( xy & 0xffff ); - + a = (xx[0] - xx[2]) * (yy[1] - yy[2]) - (yy[0] - yy[2]) * (xx[1] - xx[2]); if ( (mmesa->backface_sign && - ((a < 0 && !signbit( mmesa->backface_sign )) || + ((a < 0 && !signbit( mmesa->backface_sign )) || (a > 0 && signbit( mmesa->backface_sign )))) ) { /* cull quad */ if ( MACH64_DEBUG & DEBUG_VERBOSE_PRIMS ) fprintf(stderr,"Quad culled\n"); return; } - + ooa = 16.0 / a; - + vb = (CARD32 *)mach64AllocDmaLow( mmesa, vbsiz * sizeof(CARD32) ); vbchk = vb + vbsiz; @@ -179,17 +179,17 @@ static INLINE void mach64_draw_quad( mach64ContextPtr mmesa, xy = LE32_IN( &v2->ui[xyoffset] ); xx[0] = (GLshort)( xy >> 16 ); yy[0] = (GLshort)( xy & 0xffff ); - + a = (xx[0] - xx[2]) * (yy[1] - yy[2]) - (yy[0] - yy[2]) * (xx[1] - xx[2]); - + ooa = 16.0 / a; - + COPY_VERTEX_OOA( vb, vertsize, v2, 1 ); LE32_OUT( vb++, *(CARD32 *)&ooa ); assert( vb == vbchk ); - + #if MACH64_PRINT_BUFFER { int i; @@ -204,7 +204,7 @@ static INLINE void mach64_draw_quad( mach64ContextPtr mmesa, GLint coloridx; GLfloat ooa; GLint xx[3], yy[3]; /* 2 fractional bits for hardware */ - unsigned vbsiz = + unsigned vbsiz = (( 1 + (vertsize > 6 ? 2 : 0) + @@ -217,13 +217,13 @@ static INLINE void mach64_draw_quad( mach64ContextPtr mmesa, if ( MACH64_DEBUG & DEBUG_VERBOSE_PRIMS ) { fprintf(stderr, "%s:\n", __FUNCTION__); - fprintf(stderr,"Vertex 1: x: %.2f, y: %.2f, z: %.2f, w: %f\n\ts0: %f, t0: %f\n\ts1: %f, t1: %f\n", + fprintf(stderr,"Vertex 1: x: %.2f, y: %.2f, z: %.2f, w: %f\n\ts0: %f, t0: %f\n\ts1: %f, t1: %f\n", v0->v.x, v0->v.y, v0->v.z, v0->v.w, v0->v.u0, v0->v.v0, v0->v.u1, v0->v.v1); - fprintf(stderr,"Vertex 2: x: %.2f, y: %.2f, z: %.2f, w: %f\n\ts0: %f, t0: %f\n\ts1: %f, t1: %f\n", + fprintf(stderr,"Vertex 2: x: %.2f, y: %.2f, z: %.2f, w: %f\n\ts0: %f, t0: %f\n\ts1: %f, t1: %f\n", v1->v.x, v1->v.y, v1->v.z, v1->v.w, v1->v.u0, v1->v.v0, v1->v.u1, v1->v.v1); - fprintf(stderr,"Vertex 3: x: %.2f, y: %.2f, z: %.2f, w: %f\n\ts0: %f, t0: %f\n\ts1: %f, t1: %f\n", + fprintf(stderr,"Vertex 3: x: %.2f, y: %.2f, z: %.2f, w: %f\n\ts0: %f, t0: %f\n\ts1: %f, t1: %f\n", v2->v.x, v2->v.y, v2->v.z, v2->v.w, v2->v.u0, v2->v.v0, v2->v.u1, v2->v.v1); - fprintf(stderr,"Vertex 4: x: %.2f, y: %.2f, z: %.2f, w: %f\n\ts0: %f, t0: %f\n\ts1: %f, t1: %f\n", + fprintf(stderr,"Vertex 4: x: %.2f, y: %.2f, z: %.2f, w: %f\n\ts0: %f, t0: %f\n\ts1: %f, t1: %f\n", v3->v.x, v3->v.y, v3->v.z, v3->v.w, v3->v.u0, v3->v.v0, v3->v.u1, v3->v.v1); } @@ -250,16 +250,16 @@ static INLINE void mach64_draw_quad( mach64ContextPtr mmesa, ooa = 0.25 * 0.25 * ((xx[0] - xx[2]) * (yy[1] - yy[2]) - (yy[0] - yy[2]) * (xx[1] - xx[2])); - + if ( ooa * mmesa->backface_sign < 0 ) { /* cull quad */ if ( MACH64_DEBUG & DEBUG_VERBOSE_PRIMS ) fprintf(stderr,"Quad culled\n"); return; } - + vb = (CARD32 *)mach64AllocDmaLow( mmesa, vbsiz * 4 ); - + ooa = 1.0 / ooa; coloridx = (vertsize > 4) ? 4: 3; @@ -444,33 +444,33 @@ static INLINE void mach64_draw_triangle( mach64ContextPtr mmesa, fprintf(stderr,"Vertex 3:\n"); mach64_print_vertex( ctx, v2 ); } - + xy = LE32_IN( &v0->ui[xyoffset] ); xx[0] = (GLshort)( xy >> 16 ); yy[0] = (GLshort)( xy & 0xffff ); - + xy = LE32_IN( &v1->ui[xyoffset] ); xx[1] = (GLshort)( xy >> 16 ); yy[1] = (GLshort)( xy & 0xffff ); - + xy = LE32_IN( &v2->ui[xyoffset] ); xx[2] = (GLshort)( xy >> 16 ); yy[2] = (GLshort)( xy & 0xffff ); - + a = (xx[0] - xx[2]) * (yy[1] - yy[2]) - (yy[0] - yy[2]) * (xx[1] - xx[2]); - + if ( mmesa->backface_sign && - ((a < 0 && !signbit( mmesa->backface_sign )) || + ((a < 0 && !signbit( mmesa->backface_sign )) || (a > 0 && signbit( mmesa->backface_sign ))) ) { /* cull triangle */ if ( MACH64_DEBUG & DEBUG_VERBOSE_PRIMS ) fprintf(stderr,"Triangle culled\n"); return; } - + ooa = 16.0 / a; - + vb = (CARD32 *)mach64AllocDmaLow( mmesa, vbsiz * sizeof(CARD32) ); vbchk = vb + vbsiz; @@ -495,7 +495,7 @@ static INLINE void mach64_draw_triangle( mach64ContextPtr mmesa, GLint coloridx; GLfloat ooa; GLint xx[3], yy[3]; /* 2 fractional bits for hardware */ - unsigned vbsiz = + unsigned vbsiz = (( 1 + (vertsize > 6 ? 2 : 0) + @@ -508,11 +508,11 @@ static INLINE void mach64_draw_triangle( mach64ContextPtr mmesa, if ( MACH64_DEBUG & DEBUG_VERBOSE_PRIMS ) { fprintf(stderr, "%s:\n", __FUNCTION__); - fprintf(stderr,"Vertex 1: x: %.2f, y: %.2f, z: %.2f, w: %f\n\ts0: %f, t0: %f\n\ts1: %f, t1: %f\n", + fprintf(stderr,"Vertex 1: x: %.2f, y: %.2f, z: %.2f, w: %f\n\ts0: %f, t0: %f\n\ts1: %f, t1: %f\n", v0->v.x, v0->v.y, v0->v.z, v0->v.w, v0->v.u0, v0->v.v0, v0->v.u1, v0->v.v1); - fprintf(stderr,"Vertex 2: x: %.2f, y: %.2f, z: %.2f, w: %f\n\ts0: %f, t0: %f\n\ts1: %f, t1: %f\n", + fprintf(stderr,"Vertex 2: x: %.2f, y: %.2f, z: %.2f, w: %f\n\ts0: %f, t0: %f\n\ts1: %f, t1: %f\n", v1->v.x, v1->v.y, v1->v.z, v1->v.w, v1->v.u0, v1->v.v0, v1->v.u1, v1->v.v1); - fprintf(stderr,"Vertex 3: x: %.2f, y: %.2f, z: %.2f, w: %f\n\ts0: %f, t0: %f\n\ts1: %f, t1: %f\n", + fprintf(stderr,"Vertex 3: x: %.2f, y: %.2f, z: %.2f, w: %f\n\ts0: %f, t0: %f\n\ts1: %f, t1: %f\n", v2->v.x, v2->v.y, v2->v.z, v2->v.w, v2->v.u0, v2->v.v0, v2->v.u1, v2->v.v1); } @@ -548,7 +548,7 @@ static INLINE void mach64_draw_triangle( mach64ContextPtr mmesa, } vb = (CARD32 *)mach64AllocDmaLow( mmesa, vbsiz * 4 ); - + ooa = 1.0 / ooa; coloridx = (vertsize > 4) ? 4: 3; @@ -693,26 +693,26 @@ static INLINE void mach64_draw_line( mach64ContextPtr mmesa, fprintf(stderr,"Vertex 2:\n"); mach64_print_vertex( ctx, v1 ); } - + pxy0 = &v0->ui[xyoffset]; xy0old = *pxy0; xy0 = LE32_IN( &xy0old ); x0 = (GLshort)( xy0 >> 16 ); y0 = (GLshort)( xy0 & 0xffff ); - + pxy1 = &v1->ui[xyoffset]; xy1old = *pxy1; xy1 = LE32_IN( &xy1old ); x1 = (GLshort)( xy1 >> 16 ); y1 = (GLshort)( xy1 & 0xffff ); - + if ( (dx = x1 - x0) < 0 ) { dx = -dx; } if ( (dy = y1 - y0) < 0 ) { dy = -dy; } - + /* adjust vertices depending on line direction */ if ( dx > dy ) { ix = 0; @@ -736,7 +736,7 @@ static INLINE void mach64_draw_line( mach64ContextPtr mmesa, LE32_OUT( vb++, *(CARD32 *)&ooa ); ooa = -ooa; - + LE32_OUT( pxy1, (( x1 + ix ) << 16) | (( y1 + iy ) & 0xffff) ); COPY_VERTEX_OOA( vb, vertsize, v1, 1 ); LE32_OUT( vb++, *(CARD32 *)&ooa ); @@ -749,7 +749,7 @@ static INLINE void mach64_draw_line( mach64ContextPtr mmesa, float width = 1.0; /* Only support 1 pix lines now */ GLfloat ooa; GLint xx[3], yy[3]; /* 2 fractional bits for hardware */ - unsigned vbsiz = + unsigned vbsiz = (( 1 + (vertsize > 6 ? 2 : 0) + @@ -759,7 +759,7 @@ static INLINE void mach64_draw_line( mach64ContextPtr mmesa, ) * 4 + 4); CARD32 *vb; unsigned vbidx = 0; - + GLfloat hw, dx, dy, ix, iy; GLfloat x0 = v0->v.x; GLfloat y0 = v0->v.y; @@ -780,9 +780,9 @@ static INLINE void mach64_draw_line( mach64ContextPtr mmesa, if ( MACH64_DEBUG & DEBUG_VERBOSE_PRIMS ) { fprintf(stderr, "%s:\n", __FUNCTION__); - fprintf(stderr,"Vertex 1: x: %.2f, y: %.2f, z: %.2f, w: %f\n", + fprintf(stderr,"Vertex 1: x: %.2f, y: %.2f, z: %.2f, w: %f\n", v0->v.x, v0->v.y, v0->v.z, v0->v.w); - fprintf(stderr,"Vertex 2: x: %.2f, y: %.2f, z: %.2f, w: %f\n", + fprintf(stderr,"Vertex 2: x: %.2f, y: %.2f, z: %.2f, w: %f\n", v1->v.x, v1->v.y, v1->v.z, v1->v.w); } @@ -837,7 +837,7 @@ static INLINE void mach64_draw_line( mach64ContextPtr mmesa, } vb = (CARD32 *)mach64AllocDmaLow( mmesa, vbsiz * 4 ); - + ooa = 1.0 / ooa; coloridx = (vertsize > 4) ? 4: 3; @@ -978,18 +978,18 @@ static INLINE void mach64_draw_point( mach64ContextPtr mmesa, fprintf(stderr,"Vertex 1:\n"); mach64_print_vertex( ctx, v0 ); } - + if( !sz ) sz = 1; /* round to the nearest supported size */ - + pxy = &v0->ui[xyoffset]; xyold = *pxy; xy = LE32_IN( &xyold ); x = (GLshort)( xy >> 16 ); y = (GLshort)( xy & 0xffff ); - + ooa = 4.0 / (sz * sz); - + vb = (CARD32 *)mach64AllocDmaLow( mmesa, vbsiz * sizeof(CARD32) ); vbchk = vb + vbsiz; @@ -1002,19 +1002,19 @@ static INLINE void mach64_draw_point( mach64ContextPtr mmesa, LE32_OUT( vb++, *(CARD32 *)&ooa ); ooa = -ooa; - + LE32_OUT( pxy, (( x + sz ) << 16) | (( y + sz ) & 0xffff) ); COPY_VERTEX_OOA( vb, vertsize, v0, 1 ); LE32_OUT( vb++, *(CARD32 *)&ooa ); *pxy = xyold; #else /* !MACH64_NATIVE_VTXFMT */ - GLuint vertsize = mmesa->vertex_size; + GLuint vertsize = mmesa->vertex_size; GLint coloridx; float sz = 1.0; /* Only support 1 pix points now */ GLfloat ooa; GLint xx[3], yy[3]; /* 2 fractional bits for hardware */ - unsigned vbsiz = + unsigned vbsiz = (( 1 + (vertsize > 6 ? 2 : 0) + @@ -1024,10 +1024,10 @@ static INLINE void mach64_draw_point( mach64ContextPtr mmesa, ) * 4 + 4); CARD32 *vb; unsigned vbidx = 0; - + if ( MACH64_DEBUG & DEBUG_VERBOSE_PRIMS ) { fprintf(stderr, "%s:\n", __FUNCTION__); - fprintf(stderr,"Vertex 1: x: %.2f, y: %.2f, z: %.2f, w: %f\n", + fprintf(stderr,"Vertex 1: x: %.2f, y: %.2f, z: %.2f, w: %f\n", v0->v.x, v0->v.y, v0->v.z, v0->v.w); } @@ -1063,7 +1063,7 @@ static INLINE void mach64_draw_point( mach64ContextPtr mmesa, } vb = (CARD32 *)mach64AllocDmaLow( mmesa, vbsiz * 4 ); - + ooa = 1.0 / ooa; coloridx = (vertsize > 4) ? 4: 3; @@ -1598,37 +1598,37 @@ static void mach64FastRenderClippedPoly( struct gl_context *ctx, const GLuint *e GLubyte *mach64verts = (GLubyte *)mmesa->verts; mach64VertexPtr v0, v1, v2; int i; - + v0 = (mach64VertexPtr)VERT(elts[1]); v1 = (mach64VertexPtr)VERT(elts[2]); v2 = (mach64VertexPtr)VERT(elts[0]); - + xy = LE32_IN( &v0->ui[xyoffset] ); xx[0] = (GLshort)( xy >> 16 ); yy[0] = (GLshort)( xy & 0xffff ); - + xy = LE32_IN( &v1->ui[xyoffset] ); xx[1] = (GLshort)( xy >> 16 ); yy[1] = (GLshort)( xy & 0xffff ); - + xy = LE32_IN( &v2->ui[xyoffset] ); xx[2] = (GLshort)( xy >> 16 ); yy[2] = (GLshort)( xy & 0xffff ); - + a = (xx[0] - xx[2]) * (yy[1] - yy[2]) - (yy[0] - yy[2]) * (xx[1] - xx[2]); if ( (mmesa->backface_sign && - ((a < 0 && !signbit( mmesa->backface_sign )) || + ((a < 0 && !signbit( mmesa->backface_sign )) || (a > 0 && signbit( mmesa->backface_sign )))) ) { /* cull polygon */ if ( MACH64_DEBUG & DEBUG_VERBOSE_PRIMS ) fprintf(stderr,"Polygon culled\n"); return; } - + ooa.f = 16.0 / a; - + vb = (CARD32 *)mach64AllocDmaLow( mmesa, vbsiz * sizeof(CARD32) ); vbchk = vb + vbsiz; @@ -1647,14 +1647,14 @@ static void mach64FastRenderClippedPoly( struct gl_context *ctx, const GLuint *e xy = LE32_IN( &v0->ui[xyoffset] ); xx[0] = (GLshort)( xy >> 16 ); yy[0] = (GLshort)( xy & 0xffff ); - + a = (xx[0] - xx[2]) * (yy[1] - yy[2]) - (yy[0] - yy[2]) * (xx[1] - xx[2]); ooa.f = 16.0 / a; - + COPY_VERTEX_OOA( vb, vertsize, v0, 1 ); LE32_OUT( vb++, ooa.u ); - + if (i >= n) break; v1 = (mach64VertexPtr)VERT(elts[i]); @@ -1663,11 +1663,11 @@ static void mach64FastRenderClippedPoly( struct gl_context *ctx, const GLuint *e xy = LE32_IN( &v1->ui[xyoffset] ); xx[1] = (GLshort)( xy >> 16 ); yy[1] = (GLshort)( xy & 0xffff ); - + a = (xx[0] - xx[2]) * (yy[1] - yy[2]) - (yy[0] - yy[2]) * (xx[1] - xx[2]); ooa.f = 16.0 / a; - + COPY_VERTEX_OOA( vb, vertsize, v1, 2 ); LE32_OUT( vb++, ooa.u ); } @@ -1685,9 +1685,9 @@ static void mach64FastRenderClippedPoly( struct gl_context *ctx, const GLuint *e int i; for (i = 2 ; i < n ; i++) { - mach64_draw_triangle( mmesa, - VERT(elts[i-1]), - VERT(elts[i]), + mach64_draw_triangle( mmesa, + VERT(elts[i-1]), + VERT(elts[i]), (mach64VertexPtr) start ); } diff --git a/src/mesa/drivers/dri/mach64/mach64_vb.c b/src/mesa/drivers/dri/mach64/mach64_vb.c index d0c04d3..ed30d47 100644 --- a/src/mesa/drivers/dri/mach64/mach64_vb.c +++ b/src/mesa/drivers/dri/mach64/mach64_vb.c @@ -107,7 +107,7 @@ static struct { const GLfloat sz = 1.0 / mmesa->depth_scale #if MACH64_NATIVE_VTXFMT - + #define UNVIEWPORT_X(x) ((GLfloat)(x) / 4.0) + dx #define UNVIEWPORT_Y(y) - ((GLfloat)(y) / 4.0) + dy #define UNVIEWPORT_Z(z) (GLfloat)((z) >> 15) * sz @@ -562,7 +562,7 @@ void mach64ChooseVertexState( struct gl_context *ctx ) TNLcontext *tnl = TNL_CONTEXT(ctx); mach64ContextPtr mmesa = MACH64_CONTEXT( ctx ); GLuint ind = MACH64_XYZW_BIT|MACH64_RGBA_BIT; - + if (ctx->_TriangleCaps & DD_SEPARATE_SPECULAR) ind |= MACH64_SPEC_BIT; diff --git a/src/mesa/drivers/dri/mach64/mach64_vbtmp.h b/src/mesa/drivers/dri/mach64/mach64_vbtmp.h index a126dca..96246a1 100644 --- a/src/mesa/drivers/dri/mach64/mach64_vbtmp.h +++ b/src/mesa/drivers/dri/mach64/mach64_vbtmp.h @@ -105,8 +105,8 @@ #endif #if (HAVE_HW_DIVIDE && !HAVE_PTEX_VERTICES) -#error "can't cope with this combination" -#endif +#error "can't cope with this combination" +#endif #ifndef LOCALVARS #define LOCALVARS @@ -182,7 +182,7 @@ static void TAG(emit)( struct gl_context *ctx, const GLuint t0 = GET_TEXSOURCE(0); tc0_stride = VB->AttribPtr[_TNL_ATTRIB_TEX0 + t0]->stride; tc0 = VB->AttribPtr[_TNL_ATTRIB_TEX0 + t0]->data; - if (DO_PTEX) + if (DO_PTEX) tc0_size = VB->AttribPtr[_TNL_ATTRIB_TEX0 + t0]->size; } @@ -216,13 +216,13 @@ static void TAG(emit)( struct gl_context *ctx, coord = (GLfloat (*)[4])((GLubyte *)coord + start * coord_stride); if (DO_TEX0) tc0 = (GLfloat (*)[4])((GLubyte *)tc0 + start * tc0_stride); - if (DO_TEX1) + if (DO_TEX1) tc1 = (GLfloat (*)[4])((GLubyte *)tc1 + start * tc1_stride); - if (DO_TEX2) + if (DO_TEX2) tc2 = (GLfloat (*)[4])((GLubyte *)tc2 + start * tc2_stride); - if (DO_TEX3) + if (DO_TEX3) tc3 = (GLfloat (*)[4])((GLubyte *)tc3 + start * tc3_stride); - if (DO_RGBA) + if (DO_RGBA) STRIDE_4F(col, start * col_stride); if (DO_SPEC) STRIDE_4F(spec, start * spec_stride); @@ -231,7 +231,7 @@ static void TAG(emit)( struct gl_context *ctx, // fog = (GLfloat (*)[4])((GLubyte *)fog + start * fog_stride); /* STRIDE_F(fog, start * fog_stride); */ } - + for (i=start; i < end; i++, v = (VERTEX *)((GLubyte *)v + stride)) { if (DO_XYZW) { if (HAVE_HW_VIEWPORT || mask[i] == 0) { @@ -245,7 +245,7 @@ static void TAG(emit)( struct gl_context *ctx, v->v.w = 1.0; } if (MACH64_DEBUG & DEBUG_VERBOSE_PRIMS) { - fprintf(stderr, "%s: vert (importable) %d: %.2f %.2f %.2f %f\n", + fprintf(stderr, "%s: vert (importable) %d: %.2f %.2f %.2f %f\n", __FUNCTION__, i, v->v.x, v->v.y, v->v.z, v->v.w); } coord = (GLfloat (*)[4])((GLubyte *)coord + coord_stride); @@ -277,7 +277,7 @@ static void TAG(emit)( struct gl_context *ctx, v->v.u0 = tc0[0][0]; v->v.v0 = tc0[0][1]; if (MACH64_DEBUG & DEBUG_VERBOSE_PRIMS) { - fprintf(stderr, "%s: vert (importable) %d: u0: %.2f, v0: %.2f, w: %f\n", + fprintf(stderr, "%s: vert (importable) %d: u0: %.2f, v0: %.2f, w: %f\n", __FUNCTION__, i, v->v.u0, v->v.v0, v->v.w); } #ifdef MACH64_PREMULT_TEXCOORDS @@ -286,11 +286,11 @@ static void TAG(emit)( struct gl_context *ctx, #endif if (DO_PTEX) { if (HAVE_PTEX_VERTICES) { - if (tc0_size == 4) + if (tc0_size == 4) v->pv.q0 = tc0[0][3]; else v->pv.q0 = 1.0; - } + } else if (tc0_size == 4) { #ifdef MACH64_PREMULT_TEXCOORDS v->v.w *= tc0[0][3]; @@ -300,19 +300,19 @@ static void TAG(emit)( struct gl_context *ctx, v->v.u0 *= rhw; v->v.v0 *= rhw; #endif - } - } + } + } tc0 = (GLfloat (*)[4])((GLubyte *)tc0 + tc0_stride); } if (DO_TEX1) { if (DO_PTEX) { v->pv.u1 = tc1[0][0]; v->pv.v1 = tc1[0][1]; - if (tc1_size == 4) + if (tc1_size == 4) v->pv.q1 = tc1[0][3]; else v->pv.q1 = 1.0; - } + } else { v->v.u1 = tc1[0][0]; v->v.v1 = tc1[0][1]; @@ -322,7 +322,7 @@ static void TAG(emit)( struct gl_context *ctx, v->v.v1 *= v->v.w; #endif tc1 = (GLfloat (*)[4])((GLubyte *)tc1 + tc1_stride); - } + } else if (DO_PTEX) { *(GLuint *)&v->pv.q1 = 0; /* avoid culling on radeon */ } @@ -330,32 +330,32 @@ static void TAG(emit)( struct gl_context *ctx, if (DO_PTEX) { v->pv.u2 = tc2[0][0]; v->pv.v2 = tc2[0][1]; - if (tc2_size == 4) + if (tc2_size == 4) v->pv.q2 = tc2[0][3]; else v->pv.q2 = 1.0; - } + } else { v->v.u2 = tc2[0][0]; v->v.v2 = tc2[0][1]; } tc2 = (GLfloat (*)[4])((GLubyte *)tc2 + tc2_stride); - } + } if (DO_TEX3) { if (DO_PTEX) { v->pv.u3 = tc3[0][0]; v->pv.v3 = tc3[0][1]; - if (tc3_size == 4) + if (tc3_size == 4) v->pv.q3 = tc3[0][3]; else v->pv.q3 = 1.0; - } + } else { v->v.u3 = tc3[0][0]; v->v.v3 = tc3[0][1]; } tc3 = (GLfloat (*)[4])((GLubyte *)tc3 + tc3_stride); - } + } } } @@ -394,7 +394,7 @@ static void TAG(emit)( struct gl_context *ctx, GLuint start, GLuint end, coord = (GLfloat (*)[4])((GLubyte *)coord + start * coord_stride); STRIDE_4F(col, start * col_stride); } - + for (i=start; i < end; i++, v+=4) { if (HAVE_HW_VIEWPORT || mask[i] == 0) { VIEWPORT_X(v[0], coord[0][0]); @@ -484,7 +484,7 @@ static GLboolean TAG(check_tex_sizes)( struct gl_context *ctx ) if (DO_PTEX) return GL_TRUE; - + if ((DO_TEX3 && VB->AttribPtr[_TNL_ATTRIB_TEX0 + GET_TEXSOURCE(3)]->size == 4) || (DO_TEX2 && VB->AttribPtr[_TNL_ATTRIB_TEX0 + GET_TEXSOURCE(2)]->size == 4) || (DO_TEX1 && VB->AttribPtr[_TNL_ATTRIB_TEX0 + GET_TEXSOURCE(1)]->size == 4) || @@ -576,7 +576,7 @@ static void TAG(interp)( struct gl_context *ctx, w ); } - if ((HAVE_HW_DIVIDE && CHECK_HW_DIVIDE) || + if ((HAVE_HW_DIVIDE && CHECK_HW_DIVIDE) || DO_FOG || DO_SPEC || DO_TEX0 || DO_TEX1 || DO_TEX2 || DO_TEX3 || !HAVE_TINY_VERTICES) { @@ -624,7 +624,7 @@ static void TAG(interp)( struct gl_context *ctx, #ifdef MACH64_PREMULT_TEXCOORDS GLfloat qout = 1 / out->v.w; GLfloat qin = 1 / in->v.w; - + INTERP_F( t, dst->v.u0, out->v.u0 * qout, in->v.u0 * qin); INTERP_F( t, dst->v.v0, out->v.v0 * qout, in->v.v0 * qin); @@ -645,7 +645,7 @@ static void TAG(interp)( struct gl_context *ctx, #ifdef MACH64_PREMULT_TEXCOORDS GLfloat qout = 1 / out->v.w; GLfloat qin = 1 / in->v.w; - + INTERP_F( t, dst->v.u1, out->v.u1 * qout, in->v.u1 * qin ); INTERP_F( t, dst->v.v1, out->v.v1 * qout, in->v.v1 * qin ); diff --git a/src/mesa/drivers/dri/mga/Doxyfile b/src/mesa/drivers/dri/mga/Doxyfile index 0d0c134..02d6887 100644 --- a/src/mesa/drivers/dri/mga/Doxyfile +++ b/src/mesa/drivers/dri/mga/Doxyfile @@ -5,7 +5,7 @@ #--------------------------------------------------------------------------- PROJECT_NAME = mga PROJECT_NUMBER = $VERSION$ -OUTPUT_DIRECTORY = +OUTPUT_DIRECTORY = OUTPUT_LANGUAGE = English USE_WINDOWS_ENCODING = NO EXTRACT_ALL = NO @@ -21,7 +21,7 @@ REPEAT_BRIEF = YES ALWAYS_DETAILED_SEC = NO INLINE_INHERITED_MEMB = NO FULL_PATH_NAMES = NO -STRIP_FROM_PATH = +STRIP_FROM_PATH = INTERNAL_DOCS = NO CASE_SENSE_NAMES = YES SHORT_NAMES = NO @@ -39,8 +39,8 @@ GENERATE_TODOLIST = YES GENERATE_TESTLIST = YES GENERATE_BUGLIST = YES GENERATE_DEPRECATEDLIST= YES -ALIASES = -ENABLED_SECTIONS = +ALIASES = +ENABLED_SECTIONS = MAX_INITIALIZER_LINES = 30 OPTIMIZE_OUTPUT_FOR_C = NO OPTIMIZE_OUTPUT_JAVA = NO @@ -54,7 +54,7 @@ WARNINGS = YES WARN_IF_UNDOCUMENTED = YES WARN_IF_DOC_ERROR = YES WARN_FORMAT = "$file:$line: $text" -WARN_LOGFILE = +WARN_LOGFILE = #--------------------------------------------------------------------------- # configuration options related to the input files #--------------------------------------------------------------------------- @@ -87,14 +87,14 @@ FILE_PATTERNS = *.c \ *.xpm \ *.dox RECURSIVE = yes -EXCLUDE = +EXCLUDE = EXCLUDE_SYMLINKS = NO -EXCLUDE_PATTERNS = -EXAMPLE_PATH = +EXCLUDE_PATTERNS = +EXAMPLE_PATH = EXAMPLE_PATTERNS = * EXAMPLE_RECURSIVE = NO -IMAGE_PATH = -INPUT_FILTER = +IMAGE_PATH = +INPUT_FILTER = FILTER_SOURCE_FILES = NO #--------------------------------------------------------------------------- # configuration options related to source browsing @@ -110,20 +110,20 @@ VERBATIM_HEADERS = YES #--------------------------------------------------------------------------- ALPHABETICAL_INDEX = NO COLS_IN_ALPHA_INDEX = 5 -IGNORE_PREFIX = +IGNORE_PREFIX = #--------------------------------------------------------------------------- # configuration options related to the HTML output #--------------------------------------------------------------------------- GENERATE_HTML = YES HTML_OUTPUT = html HTML_FILE_EXTENSION = .html -HTML_HEADER = -HTML_FOOTER = -HTML_STYLESHEET = +HTML_HEADER = +HTML_FOOTER = +HTML_STYLESHEET = HTML_ALIGN_MEMBERS = YES GENERATE_HTMLHELP = NO -CHM_FILE = -HHC_LOCATION = +CHM_FILE = +HHC_LOCATION = GENERATE_CHI = NO BINARY_TOC = NO TOC_EXPAND = NO @@ -140,8 +140,8 @@ LATEX_CMD_NAME = latex MAKEINDEX_CMD_NAME = makeindex COMPACT_LATEX = NO PAPER_TYPE = a4wide -EXTRA_PACKAGES = -LATEX_HEADER = +EXTRA_PACKAGES = +LATEX_HEADER = PDF_HYPERLINKS = NO USE_PDFLATEX = NO LATEX_BATCHMODE = NO @@ -153,8 +153,8 @@ GENERATE_RTF = NO RTF_OUTPUT = rtf COMPACT_RTF = NO RTF_HYPERLINKS = NO -RTF_STYLESHEET_FILE = -RTF_EXTENSIONS_FILE = +RTF_STYLESHEET_FILE = +RTF_EXTENSIONS_FILE = #--------------------------------------------------------------------------- # configuration options related to the man page output #--------------------------------------------------------------------------- @@ -167,8 +167,8 @@ MAN_LINKS = NO #--------------------------------------------------------------------------- GENERATE_XML = yes XML_OUTPUT = xml -XML_SCHEMA = -XML_DTD = +XML_SCHEMA = +XML_DTD = #--------------------------------------------------------------------------- # configuration options for the AutoGen Definitions output #--------------------------------------------------------------------------- @@ -179,29 +179,29 @@ GENERATE_AUTOGEN_DEF = NO GENERATE_PERLMOD = NO PERLMOD_LATEX = NO PERLMOD_PRETTY = YES -PERLMOD_MAKEVAR_PREFIX = +PERLMOD_MAKEVAR_PREFIX = #--------------------------------------------------------------------------- -# Configuration options related to the preprocessor +# Configuration options related to the preprocessor #--------------------------------------------------------------------------- ENABLE_PREPROCESSING = YES MACRO_EXPANSION = NO EXPAND_ONLY_PREDEF = NO SEARCH_INCLUDES = YES -INCLUDE_PATH = -INCLUDE_FILE_PATTERNS = -PREDEFINED = -EXPAND_AS_DEFINED = +INCLUDE_PATH = +INCLUDE_FILE_PATTERNS = +PREDEFINED = +EXPAND_AS_DEFINED = SKIP_FUNCTION_MACROS = YES #--------------------------------------------------------------------------- -# Configuration::addtions related to external references +# Configuration::addtions related to external references #--------------------------------------------------------------------------- -TAGFILES = -GENERATE_TAGFILE = +TAGFILES = +GENERATE_TAGFILE = ALLEXTERNALS = NO EXTERNAL_GROUPS = YES PERL_PATH = /usr/bin/perl #--------------------------------------------------------------------------- -# Configuration options related to the dot tool +# Configuration options related to the dot tool #--------------------------------------------------------------------------- CLASS_DIAGRAMS = YES HIDE_UNDOC_RELATIONS = YES @@ -215,20 +215,20 @@ INCLUDED_BY_GRAPH = YES CALL_GRAPH = NO GRAPHICAL_HIERARCHY = YES DOT_IMAGE_FORMAT = png -DOT_PATH = -DOTFILE_DIRS = +DOT_PATH = +DOTFILE_DIRS = MAX_DOT_GRAPH_WIDTH = 1024 MAX_DOT_GRAPH_HEIGHT = 1024 MAX_DOT_GRAPH_DEPTH = 1000 GENERATE_LEGEND = YES DOT_CLEANUP = YES #--------------------------------------------------------------------------- -# Configuration::addtions related to the search engine +# Configuration::addtions related to the search engine #--------------------------------------------------------------------------- SEARCHENGINE = NO CGI_NAME = search.cgi -CGI_URL = -DOC_URL = -DOC_ABSPATH = +CGI_URL = +DOC_URL = +DOC_ABSPATH = BIN_ABSPATH = /usr/local/bin/ -EXT_DOC_PATHS = +EXT_DOC_PATHS = diff --git a/src/mesa/drivers/dri/mga/Makefile b/src/mesa/drivers/dri/mga/Makefile index 92533bc..4b5100b 100644 --- a/src/mesa/drivers/dri/mga/Makefile +++ b/src/mesa/drivers/dri/mga/Makefile @@ -22,10 +22,10 @@ DRIVER_SOURCES = \ C_SOURCES = \ $(COMMON_SOURCES) \ - $(DRIVER_SOURCES) + $(DRIVER_SOURCES) -ASM_SOURCES = +ASM_SOURCES = include ../Makefile.template diff --git a/src/mesa/drivers/dri/mga/mga_texcombine.c b/src/mesa/drivers/dri/mga/mga_texcombine.c index 1488a89..e33ae85 100644 --- a/src/mesa/drivers/dri/mga/mga_texcombine.c +++ b/src/mesa/drivers/dri/mga/mga_texcombine.c @@ -286,7 +286,7 @@ GLboolean mgaUpdateTextureEnvCombine( struct gl_context *ctx, int unit ) * no way to get alpha out by itself (GL_REPLACE). * * Keep the Arg2 == alpha cases first because only alpha has the - * capabilities to function as Arg2 (GL_INTERPOLATE). Also good for + * capabilities to function as Arg2 (GL_INTERPOLATE). Also good for * GL_ADD, GL_ADD_SIGNED, GL_SUBTRACT since we can't get alpha to the * adder. * @@ -668,5 +668,5 @@ GLboolean mgaUpdateTextureEnvCombine( struct gl_context *ctx, int unit ) return GL_TRUE; } - - + + diff --git a/src/mesa/drivers/dri/mga/mga_texstate.c b/src/mesa/drivers/dri/mga/mga_texstate.c index 33ad8b4..612fb79 100644 --- a/src/mesa/drivers/dri/mga/mga_texstate.c +++ b/src/mesa/drivers/dri/mga/mga_texstate.c @@ -120,7 +120,7 @@ mgaSetTexImages( mgaContextPtr mmesa, totalSize = 0; for ( i = 0 ; i < numLevels ; i++ ) { - const struct gl_texture_image * const texImage = + const struct gl_texture_image * const texImage = tObj->Image[0][ i + t->base.firstLevel ]; int size; @@ -154,7 +154,7 @@ mgaSetTexImages( mgaContextPtr mmesa, t->base.totalSize = totalSize; /* setup hardware register values */ - t->setup.texctl &= (TMC_tformat_MASK & TMC_tpitch_MASK + t->setup.texctl &= (TMC_tformat_MASK & TMC_tpitch_MASK & TMC_tpitchext_MASK); t->setup.texctl |= txformat; @@ -279,7 +279,7 @@ static const GLuint g400_color_combine[][MGA_MAX_COMBFUNC] = (TD0_color_sel_arg1 | TD0_alpha_arg2_diffuse | TD0_alpha_sel_arg2), - + /* GL_MODULATE * Cv = Cf Cs * Av = Af @@ -288,7 +288,7 @@ static const GLuint g400_color_combine[][MGA_MAX_COMBFUNC] = TD0_color_sel_mul | TD0_alpha_arg2_diffuse | TD0_alpha_sel_arg2), - + /* GL_DECAL * Cv = Cs * Av = Af @@ -296,7 +296,7 @@ static const GLuint g400_color_combine[][MGA_MAX_COMBFUNC] = (TD0_color_sel_arg1 | TD0_alpha_arg2_diffuse | TD0_alpha_sel_arg2), - + /* GL_ADD * Cv = Cf + Cs * Av = Af @@ -307,7 +307,7 @@ static const GLuint g400_color_combine[][MGA_MAX_COMBFUNC] = TD0_alpha_arg2_diffuse | TD0_alpha_sel_arg2), }, - + /* Unit 1: */ { @@ -318,7 +318,7 @@ static const GLuint g400_color_combine[][MGA_MAX_COMBFUNC] = (TD0_color_sel_arg1 | TD0_alpha_arg2_prevstage | TD0_alpha_sel_arg2), - + /* GL_MODULATE * Cv = Cp Cs * Av = Ap @@ -335,7 +335,7 @@ static const GLuint g400_color_combine[][MGA_MAX_COMBFUNC] = (TD0_color_sel_arg1 | TD0_alpha_arg2_prevstage | TD0_alpha_sel_arg2), - + /* GL_ADD * Cv = Cp + Cs * Av = Ap @@ -359,7 +359,7 @@ static const GLuint g400_color_alpha_combine[][MGA_MAX_COMBFUNC] = */ (TD0_color_sel_arg1 | TD0_alpha_sel_arg1), - + /* GL_MODULATE * Cv = Cf Cs * Av = Af As @@ -368,7 +368,7 @@ static const GLuint g400_color_alpha_combine[][MGA_MAX_COMBFUNC] = TD0_color_sel_mul | TD0_alpha_arg2_diffuse | TD0_alpha_sel_mul), - + /* GL_DECAL * tmp = Cf ( 1 - As ) * Cv = tmp + Cs As @@ -396,7 +396,7 @@ static const GLuint g400_color_alpha_combine[][MGA_MAX_COMBFUNC] = TD0_alpha_arg2_diffuse | TD0_alpha_sel_mul), }, - + /* Unit 1: */ { @@ -406,7 +406,7 @@ static const GLuint g400_color_alpha_combine[][MGA_MAX_COMBFUNC] = */ (TD0_color_sel_arg1 | TD0_alpha_sel_arg1), - + /* GL_MODULATE * Cv = Cp Cs * Av = Ap As @@ -432,7 +432,7 @@ static const GLuint g400_color_alpha_combine[][MGA_MAX_COMBFUNC] = TD0_color_sel_add | TD0_alpha_arg2_prevstage | TD0_alpha_sel_arg2), - + /* GL_ADD * Cv = Cp + Cs * Av = Ap As @@ -457,7 +457,7 @@ static const GLuint g400_alpha_combine[][MGA_MAX_COMBFUNC] = (TD0_color_arg2_diffuse | TD0_color_sel_arg2 | TD0_alpha_sel_arg1), - + /* GL_MODULATE * Cv = Cf * Av = Af As @@ -496,7 +496,7 @@ static const GLuint g400_alpha_combine[][MGA_MAX_COMBFUNC] = (TD0_color_arg2_prevstage | TD0_color_sel_arg2 | TD0_alpha_sel_arg1), - + /* GL_MODULATE * Cv = Cp * Av = Ap As @@ -568,7 +568,7 @@ static GLboolean mgaUpdateTextureEnvBlend( struct gl_context *ctx, int unit ) TD0_alpha_arg2_diffuse | TD0_alpha_sel_mul); } - + if (RGB_ZERO(mmesa->envcolor[source]) && (format != GL_INTENSITY || ALPHA_ZERO(mmesa->envcolor[source]))) return GL_TRUE; /* all done */ @@ -874,7 +874,7 @@ void mgaUpdateTextureState( struct gl_context *ctx ) mmesa->force_dualtex = GL_FALSE; mmesa->fcol_used = GL_FALSE; - /* This works around a quirk with the MGA hardware. If only OpenGL + /* This works around a quirk with the MGA hardware. If only OpenGL * TEXTURE1 is enabled, then the hardware TEXTURE0 must be used. The * hardware TEXTURE1 can ONLY be used when hardware TEXTURE0 is also used. */ @@ -888,7 +888,7 @@ void mgaUpdateTextureState( struct gl_context *ctx ) mmesa->tmu_source[1] = 0; } - for ( i = 0, ok = GL_TRUE + for ( i = 0, ok = GL_TRUE ; (i < ctx->Const.MaxTextureUnits) && ok ; i++ ) { ok = updateTextureUnit( ctx, i ); diff --git a/src/mesa/drivers/dri/mga/mga_xmesa.c b/src/mesa/drivers/dri/mga/mga_xmesa.c index d1b281a..2ae05c4 100644 --- a/src/mesa/drivers/dri/mga/mga_xmesa.c +++ b/src/mesa/drivers/dri/mga/mga_xmesa.c @@ -132,7 +132,7 @@ mgaFillInModes( __DRIscreen *psp, depth_bits_array[0] = 0; depth_bits_array[1] = depth_bits; depth_bits_array[2] = depth_bits; - + /* Just like with the accumulation buffer, always provide some modes * with a stencil buffer. It will be a sw fallback, but some apps won't * care about that. @@ -284,12 +284,12 @@ mgaInitDriver(__DRIscreen *sPriv) mgaScreen->textureSize[MGA_CARD_HEAP] = serverInfo->textureSize; mgaScreen->textureSize[MGA_AGP_HEAP] = serverInfo->agpTextureSize; - + /* The texVirtual array stores the base addresses in the CPU's address * space of the texture memory pools. The base address of the on-card * memory pool is calculated as an offset of the base of video memory. The * AGP texture pool has to be mapped into the processes address space by - * the DRM. + * the DRM. */ mgaScreen->texVirtual[MGA_CARD_HEAP] = (char *)(mgaScreen->sPriv->pFB + @@ -349,12 +349,12 @@ mgaDestroyScreen(__DRIscreen *sPriv) extern const struct tnl_pipeline_stage _mga_render_stage; static const struct tnl_pipeline_stage *mga_pipeline[] = { - &_tnl_vertex_transform_stage, - &_tnl_normal_transform_stage, - &_tnl_lighting_stage, + &_tnl_vertex_transform_stage, + &_tnl_normal_transform_stage, + &_tnl_lighting_stage, &_tnl_fog_coordinate_stage, - &_tnl_texgen_stage, - &_tnl_texture_transform_stage, + &_tnl_texgen_stage, + &_tnl_texture_transform_stage, &_tnl_vertex_program_stage, /* REMOVE: point attenuation stage */ @@ -362,7 +362,7 @@ static const struct tnl_pipeline_stage *mga_pipeline[] = { &_mga_render_stage, /* ADD: unclipped rastersetup-to-dma */ /* Need new ioctl for wacceptseq */ #endif - &_tnl_render_stage, + &_tnl_render_stage, 0, }; @@ -455,7 +455,7 @@ mgaCreateContext( gl_api api, /* Allocate the Mesa context */ if (sharedContextPrivate) shareCtx = ((mgaContextPtr) sharedContextPrivate)->glCtx; - else + else shareCtx = NULL; mmesa->glCtx = _mesa_create_context(mesaVis, shareCtx, &functions, (void *) mmesa); @@ -541,8 +541,8 @@ mgaCreateContext( gl_api api, mmesa->hw_stencil = mesaVis->stencilBits && mesaVis->depthBits == 24; switch (mesaVis->depthBits) { - case 16: - mmesa->depth_scale = 1.0/(GLdouble)0xffff; + case 16: + mmesa->depth_scale = 1.0/(GLdouble)0xffff; mmesa->depth_clear_mask = ~0; mmesa->ClearDepth = 0xffff; break; @@ -565,7 +565,7 @@ mgaCreateContext( gl_api api, mmesa->haveHwStipple = GL_FALSE; mmesa->RenderIndex = -1; /* impossible value */ mmesa->dirty = ~0; - mmesa->vertex_format = 0; + mmesa->vertex_format = 0; mmesa->CurrentTexObj[0] = 0; mmesa->CurrentTexObj[1] = 0; mmesa->tmu_source[0] = 0; @@ -573,13 +573,13 @@ mgaCreateContext( gl_api api, mmesa->texAge[0] = 0; mmesa->texAge[1] = 0; - + /* Initialize the software rasterizer and helper modules. */ _swrast_CreateContext( ctx ); _vbo_CreateContext( ctx ); _tnl_CreateContext( ctx ); - + _swsetup_CreateContext( ctx ); /* Install the customized pipeline: @@ -608,12 +608,12 @@ mgaCreateContext( gl_api api, if ( driQueryOptionb( &mmesa->optionCache, "arb_vertex_program" ) ) { driInitExtensions(ctx, ARB_vp_extensions, GL_FALSE); } - + if ( driQueryOptionb( &mmesa->optionCache, "nv_vertex_program" ) ) { driInitExtensions( ctx, NV_vp_extensions, GL_FALSE ); } - + /* XXX these should really go right after _mesa_init_driver_functions() */ mgaDDInitStateFuncs( ctx ); mgaDDInitSpanFuncs( ctx ); @@ -665,7 +665,7 @@ mgaDestroyContext(__DRIcontext *driContextPriv) /* free the Mesa context */ mmesa->glCtx->DriverCtx = NULL; _mesa_destroy_context(mmesa->glCtx); - + if ( release_texture_heaps ) { /* This share group is about to go away, free our private * texture object data. @@ -704,11 +704,11 @@ mgaCreateBuffer( __DRIscreen *driScrnPriv, return GL_FALSE; /* not implemented */ } else { - GLboolean swStencil = (mesaVis->stencilBits > 0 && + GLboolean swStencil = (mesaVis->stencilBits > 0 && mesaVis->depthBits != 24); #if 0 - driDrawPriv->driverPrivate = (void *) + driDrawPriv->driverPrivate = (void *) _mesa_create_framebuffer(mesaVis, GL_FALSE, /* software depth buffer? */ swStencil, @@ -868,8 +868,8 @@ mgaMakeCurrent(__DRIcontext *driContextPriv, } mmesa->driDrawable = driDrawPriv; - mmesa->dirty = ~0; - mmesa->dirty_cliprects = (MGA_FRONT|MGA_BACK); + mmesa->dirty = ~0; + mmesa->dirty_cliprects = (MGA_FRONT|MGA_BACK); } mmesa->driReadable = driReadPriv; @@ -922,7 +922,7 @@ void mgaGetLock( mgaContextPtr mmesa, GLuint flags ) /** * This is the driver specific part of the createNewScreen entry point. - * + * * \todo maybe fold this into intelInitDriver * * \return the struct gl_config supported by this driver diff --git a/src/mesa/drivers/dri/mga/mga_xmesa.h b/src/mesa/drivers/dri/mga/mga_xmesa.h index aee1460..2be2a9b 100644 --- a/src/mesa/drivers/dri/mga/mga_xmesa.h +++ b/src/mesa/drivers/dri/mga/mga_xmesa.h @@ -45,7 +45,7 @@ typedef struct mga_screen_private_s { /** * Characters (bytes) per-pixel for both the front and back buffers. - * + * * \note * This is also implicitly the bytes per-pixel for the depth-buffer. */ diff --git a/src/mesa/drivers/dri/mga/mgacontext.h b/src/mesa/drivers/dri/mga/mgacontext.h index b1fbb3c..85d9662 100644 --- a/src/mesa/drivers/dri/mga/mgacontext.h +++ b/src/mesa/drivers/dri/mga/mgacontext.h @@ -106,18 +106,18 @@ typedef struct mga_texture_object_s * upto the first 4 offset pointers point to mipmap levels. The last * offset pointer tells how large the preceeding mipmap is. This value is * then used to determine where the remaining mipmaps are. - * + * * For example, if the first offsets[0] through offsets[2] are used as * pointers, then offset[3] will be the size of the mipmap pointed to by * offsets[2]. So mipmap level 3 will be at (offsets[2]+offsets[3]). For * each successive mipmap level, offsets[3] is divided by 4 and added to - * the previous address. So mipmap level 4 will be at + * the previous address. So mipmap level 4 will be at * (offsets[2]+offsets[3]+(offsets[3] / 4)). - * + * * The last pointer is selected by setting TO_texorgoffsetsel in its * pointer. In the previous example, offset[2] would have * TO_texorgoffsetsel or'ed in before writing it to the hardware. - * + * * In the current driver all of the mipmaps are packed together linearly * with mipmap level 0. Therefore offsets[0] points to the base of the * texture (and has TO_texorgoffsetsel or'ed in), and offsets[1] is the @@ -138,7 +138,7 @@ typedef struct mga_texture_object_s * ejected from texture memory by other textures and preventing the * 4th allocation (for all the smallest mipmap levels) from kicking out * any of the first three. - * + * * This array holds G400_TEX_MAXLEVELS pointers to remove an if-statement * in a loop in mgaSetTexImages. Values past G200_TEX_MAXLEVELS are not * used. @@ -199,12 +199,12 @@ struct mga_context_t { /* Map GL texture units onto hardware. */ GLuint tmu_source[2]; - + int texture_depth; /* Manage fallbacks */ - GLuint Fallback; + GLuint Fallback; /* Texture environment color. */ @@ -212,22 +212,22 @@ struct mga_context_t { GLboolean fcol_used; GLboolean force_dualtex; - /* Rasterization state + /* Rasterization state */ GLuint SetupNewInputs; GLuint SetupIndex; GLuint RenderIndex; - + GLuint hw_primitive; GLenum raster_primitive; GLenum render_primitive; GLubyte *verts; GLint vertex_stride_shift; - GLuint vertex_format; + GLuint vertex_format; GLuint vertex_size; - /* Fallback rasterization functions + /* Fallback rasterization functions */ mga_point_func draw_point; mga_line_func draw_line; @@ -236,7 +236,7 @@ struct mga_context_t { /* Manage driver and hardware state */ - GLuint NewGLState; + GLuint NewGLState; GLuint dirty; drm_mga_context_regs_t setup; diff --git a/src/mesa/drivers/dri/mga/mgadd.c b/src/mesa/drivers/dri/mga/mgadd.c index 1b39813..82a6563 100644 --- a/src/mesa/drivers/dri/mga/mgadd.c +++ b/src/mesa/drivers/dri/mga/mgadd.c @@ -54,7 +54,7 @@ static const GLubyte *mgaGetString( struct gl_context *ctx, GLenum name ) return (GLubyte *) "VA Linux Systems Inc."; case GL_RENDERER: - offset = driGetRendererString( buffer, + offset = driGetRendererString( buffer, MGA_IS_G400(mmesa) ? "G400" : MGA_IS_G200(mmesa) ? "G200" : "MGA", DRIVER_DATE, diff --git a/src/mesa/drivers/dri/mga/mgaioctl.c b/src/mesa/drivers/dri/mga/mgaioctl.c index a54d86a..7710af4 100644 --- a/src/mesa/drivers/dri/mga/mgaioctl.c +++ b/src/mesa/drivers/dri/mga/mgaioctl.c @@ -72,7 +72,7 @@ mgaWaitFence( mgaContextPtr mmesa, uint32_t fence, uint32_t * curr_fence ) if ( mmesa->driScreen->drm_version.minor >= 2 ) { uint32_t temp = fence; - + ret = drmCommandWriteRead( mmesa->driScreen->fd, DRM_MGA_WAIT_FENCE, & temp, sizeof( uint32_t )); @@ -115,7 +115,7 @@ static void mga_iload_dma_ioctl(mgaContextPtr mmesa, i = 0; do { - ret = drmCommandWrite( mmesa->driFd, DRM_MGA_ILOAD, + ret = drmCommandWrite( mmesa->driFd, DRM_MGA_ILOAD, &iload, sizeof(iload) ); } while ( ret == -EBUSY && i++ < DRM_MGA_IDLE_RETRY ); @@ -329,14 +329,14 @@ mgaClear( struct gl_context *ctx, GLbitfield mask ) mmesa->dirty |= MGA_UPLOAD_CLIPRECTS|MGA_UPLOAD_CONTEXT; } - if (mask) + if (mask) _swrast_Clear( ctx, mask ); } /** * Wait for the previous frame of rendering has completed. - * + * * \param mmesa Hardware context pointer. * * \bug @@ -364,12 +364,12 @@ static void mgaWaitForFrameCompletion( mgaContextPtr mmesa ) * has "wrapped" around is tracked in last_wrap. In addition, the * wrap count and the buffer position at the end of the last frame are * stored in last_frame.wrap and last_frame.head. - * + * * By comparing the wrap counts and the current DMA pointer value * (read directly from the hardware) to last_frame.head, we can * determine when the graphics processor has processed all of the * commands for the last frame. - * + * * In this case "last frame" means the frame of the *previous* swap- * buffers call. This is done to prevent queuing a second buffer swap * before the previous swap is executed. @@ -474,7 +474,7 @@ void mgaCopyBuffer( __DRIdrawable *dPriv ) * Implement the hardware-specific portion of \c glFinish. * * Flushes all pending commands to the hardware and wait for them to finish. - * + * * \param ctx Context where the \c glFinish command was issued. * * \sa glFinish, mgaFlush, mgaFlushDMA @@ -591,7 +591,7 @@ void mgaFlushVerticesLocked( mgaContextPtr mmesa ) vertex.idx = buffer->idx; vertex.used = buffer->used; vertex.discard = 1; - drmCommandWrite( mmesa->driFd, DRM_MGA_VERTEX, + drmCommandWrite( mmesa->driFd, DRM_MGA_VERTEX, &vertex, sizeof(drmMGAVertex) ); age_mmesa(mmesa, mmesa->sarea->last_enqueue); @@ -710,7 +710,7 @@ int mgaFlushDMA( int fd, drmLockFlags flags ) memset( &lock, 0, sizeof(lock) ); - lock.flags = flags & (DRM_LOCK_QUIESCENT | DRM_LOCK_FLUSH + lock.flags = flags & (DRM_LOCK_QUIESCENT | DRM_LOCK_FLUSH | DRM_LOCK_FLUSH_ALL); do { diff --git a/src/mesa/drivers/dri/mga/mgaioctl.h b/src/mesa/drivers/dri/mga/mgaioctl.h index 7a8660d..8e9220b 100644 --- a/src/mesa/drivers/dri/mga/mgaioctl.h +++ b/src/mesa/drivers/dri/mga/mgaioctl.h @@ -71,7 +71,7 @@ GLuint *mgaAllocDmaLow( mgaContextPtr mmesa, int bytes ) * a new buffer will need to be allocated. */ if ( (mmesa->vertex_dma_buffer == NULL) - || ((mmesa->vertex_dma_buffer->used + bytes) + || ((mmesa->vertex_dma_buffer->used + bytes) > mmesa->vertex_dma_buffer->total) ) { LOCK_HARDWARE( mmesa ); @@ -81,7 +81,7 @@ GLuint *mgaAllocDmaLow( mgaContextPtr mmesa, int bytes ) if ( mmesa->vertex_dma_buffer != NULL ) { mgaFlushVerticesLocked( mmesa ); } - + mmesa->vertex_dma_buffer = mga_get_buffer_ioctl( mmesa ); UNLOCK_HARDWARE( mmesa ); } diff --git a/src/mesa/drivers/dri/mga/mgaregs.h b/src/mesa/drivers/dri/mga/mgaregs.h index 1ef1e6d..421f5a6 100644 --- a/src/mesa/drivers/dri/mga/mgaregs.h +++ b/src/mesa/drivers/dri/mga/mgaregs.h @@ -14,9 +14,9 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * STEPHEN CROWLEY, OR ANY OTHER CONTRIBUTORS BE LIABLE FOR ANY CLAIM, - * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR - * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE + * STEPHEN CROWLEY, OR ANY OTHER CONTRIBUTORS BE LIABLE FOR ANY CLAIM, + * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ @@ -38,39 +38,39 @@ #define MGAREG_AGP_PLL 0x1e4c # define AGP_PLL_agp2xpllen_MASK 0xfffffffe /* bit 0 */ -# define AGP_PLL_agp2xpllen_disable 0x0 -# define AGP_PLL_agp2xpllen_enable 0x1 +# define AGP_PLL_agp2xpllen_disable 0x0 +# define AGP_PLL_agp2xpllen_enable 0x1 #define MGAREG_CFG_OR 0x1e4c # define CFG_OR_comp_or_MASK 0xfffffff7 /* bit 3 */ -# define CFG_OR_comp_or_disable 0x0 -# define CFG_OR_comp_or_enable 0x8 +# define CFG_OR_comp_or_disable 0x0 +# define CFG_OR_comp_or_enable 0x8 # define CFG_OR_compfreq_MASK 0xffffff0f /* bits 4-7 */ -# define CFG_OR_compfreq_SHIFT 4 +# define CFG_OR_compfreq_SHIFT 4 # define CFG_OR_comporup_MASK 0xfffff0ff /* bits 8-11 */ -# define CFG_OR_comporup_SHIFT 8 +# define CFG_OR_comporup_SHIFT 8 # define CFG_OR_compordn_MASK 0xffff0fff /* bits 12-15 */ -# define CFG_OR_compordn_SHIFT 12 +# define CFG_OR_compordn_SHIFT 12 # define CFG_OR_e2pq_MASK 0xfffeffff /* bit 16 */ -# define CFG_OR_e2pq_disable 0x0 -# define CFG_OR_e2pq_enable 0x10000 +# define CFG_OR_e2pq_disable 0x0 +# define CFG_OR_e2pq_enable 0x10000 # define CFG_OR_e2pqbypcsn_MASK 0xfffdffff /* bit 17 */ -# define CFG_OR_e2pqbypcsn_disable 0x0 -# define CFG_OR_e2pqbypcsn_enable 0x20000 +# define CFG_OR_e2pqbypcsn_disable 0x0 +# define CFG_OR_e2pqbypcsn_enable 0x20000 # define CFG_OR_e2pqbypd_MASK 0xfffbffff /* bit 18 */ -# define CFG_OR_e2pqbypd_disable 0x0 -# define CFG_OR_e2pqbypd_enable 0x40000 +# define CFG_OR_e2pqbypd_disable 0x0 +# define CFG_OR_e2pqbypd_enable 0x40000 # define CFG_OR_e2pbypclk_MASK 0xfff7ffff /* bit 19 */ -# define CFG_OR_e2pbypclk_disable 0x0 -# define CFG_OR_e2pbypclk_enable 0x80000 +# define CFG_OR_e2pbypclk_disable 0x0 +# define CFG_OR_e2pbypclk_enable 0x80000 # define CFG_OR_e2pbyp_MASK 0xffefffff /* bit 20 */ -# define CFG_OR_e2pbyp_disable 0x0 -# define CFG_OR_e2pbyp_enable 0x100000 +# define CFG_OR_e2pbyp_disable 0x0 +# define CFG_OR_e2pbyp_enable 0x100000 # define CFG_OR_rate_cap_or_MASK 0xff1fffff /* bits 21-23 */ -# define CFG_OR_rate_cap_or_SHIFT 21 +# define CFG_OR_rate_cap_or_SHIFT 21 # define CFG_OR_rq_or_MASK 0xe0ffffff /* bits 24-28 */ -# define CFG_OR_rq_or_SHIFT 24 +# define CFG_OR_rq_or_SHIFT 24 #define MGAREG_ALPHACTRL 0x2c7c @@ -99,11 +99,11 @@ # define AC_amode_video_alpha 0x200 /* val 2, shift 8 */ # define AC_amode_RSVD 0x300 /* val 3, shift 8 */ # define AC_astipple_MASK 0xfffff7ff /* bit 11 */ -# define AC_astipple_disable 0x0 -# define AC_astipple_enable 0x800 +# define AC_astipple_disable 0x0 +# define AC_astipple_enable 0x800 # define AC_aten_MASK 0xffffefff /* bit 12 */ -# define AC_aten_disable 0x0 -# define AC_aten_enable 0x1000 +# define AC_aten_disable 0x0 +# define AC_aten_enable 0x1000 # define AC_atmode_MASK 0xffff1fff /* bits 13-15 */ # define AC_atmode_noacmp 0x0 /* val 0, shift 13 */ # define AC_atmode_ae 0x4000 /* val 2, shift 13 */ @@ -113,7 +113,7 @@ # define AC_atmode_agt 0xc000 /* val 6, shift 13 */ # define AC_atmode_agte 0xe000 /* val 7, shift 13 */ # define AC_atref_MASK 0xff00ffff /* bits 16-23 */ -# define AC_atref_SHIFT 16 +# define AC_atref_SHIFT 16 # define AC_alphasel_MASK 0xfcffffff /* bits 24-25 */ # define AC_alphasel_fromtex 0x0 /* val 0, shift 24 */ # define AC_alphasel_diffused 0x1000000 /* val 1, shift 24 */ @@ -126,39 +126,39 @@ #define MGAREG_AR0 0x1c60 # define AR0_ar0_MASK 0xfffc0000 /* bits 0-17 */ -# define AR0_ar0_SHIFT 0 +# define AR0_ar0_SHIFT 0 #define MGAREG_AR1 0x1c64 # define AR1_ar1_MASK 0xff000000 /* bits 0-23 */ -# define AR1_ar1_SHIFT 0 +# define AR1_ar1_SHIFT 0 #define MGAREG_AR2 0x1c68 # define AR2_ar2_MASK 0xfffc0000 /* bits 0-17 */ -# define AR2_ar2_SHIFT 0 +# define AR2_ar2_SHIFT 0 #define MGAREG_AR3 0x1c6c # define AR3_ar3_MASK 0xff000000 /* bits 0-23 */ -# define AR3_ar3_SHIFT 0 +# define AR3_ar3_SHIFT 0 # define AR3_spage_MASK 0xf8ffffff /* bits 24-26 */ -# define AR3_spage_SHIFT 24 +# define AR3_spage_SHIFT 24 #define MGAREG_AR4 0x1c70 # define AR4_ar4_MASK 0xfffc0000 /* bits 0-17 */ -# define AR4_ar4_SHIFT 0 +# define AR4_ar4_SHIFT 0 #define MGAREG_AR5 0x1c74 # define AR5_ar5_MASK 0xfffc0000 /* bits 0-17 */ -# define AR5_ar5_SHIFT 0 +# define AR5_ar5_SHIFT 0 #define MGAREG_AR6 0x1c78 # define AR6_ar6_MASK 0xfffc0000 /* bits 0-17 */ -# define AR6_ar6_SHIFT 0 +# define AR6_ar6_SHIFT 0 #define MGAREG_BCOL 0x1c20 #define MGAREG_BESA1CORG 0x3d10 @@ -172,44 +172,44 @@ #define MGAREG_BESCTL 0x3d20 # define BC_besen_MASK 0xfffffffe /* bit 0 */ -# define BC_besen_disable 0x0 -# define BC_besen_enable 0x1 +# define BC_besen_disable 0x0 +# define BC_besen_enable 0x1 # define BC_besv1srcstp_MASK 0xffffffbf /* bit 6 */ -# define BC_besv1srcstp_even 0x0 -# define BC_besv1srcstp_odd 0x40 +# define BC_besv1srcstp_even 0x0 +# define BC_besv1srcstp_odd 0x40 # define BC_besv2srcstp_MASK 0xfffffeff /* bit 8 */ -# define BC_besv2srcstp_disable 0x0 -# define BC_besv2srcstp_enable 0x100 +# define BC_besv2srcstp_disable 0x0 +# define BC_besv2srcstp_enable 0x100 # define BC_beshfen_MASK 0xfffffbff /* bit 10 */ -# define BC_beshfen_disable 0x0 -# define BC_beshfen_enable 0x400 +# define BC_beshfen_disable 0x0 +# define BC_beshfen_enable 0x400 # define BC_besvfen_MASK 0xfffff7ff /* bit 11 */ -# define BC_besvfen_disable 0x0 -# define BC_besvfen_enable 0x800 +# define BC_besvfen_disable 0x0 +# define BC_besvfen_enable 0x800 # define BC_beshfixc_MASK 0xffffefff /* bit 12 */ -# define BC_beshfixc_weight 0x0 -# define BC_beshfixc_coeff 0x1000 +# define BC_beshfixc_weight 0x0 +# define BC_beshfixc_coeff 0x1000 # define BC_bescups_MASK 0xfffeffff /* bit 16 */ -# define BC_bescups_disable 0x0 -# define BC_bescups_enable 0x10000 +# define BC_bescups_disable 0x0 +# define BC_bescups_enable 0x10000 # define BC_bes420pl_MASK 0xfffdffff /* bit 17 */ -# define BC_bes420pl_422 0x0 -# define BC_bes420pl_420 0x20000 +# define BC_bes420pl_422 0x0 +# define BC_bes420pl_420 0x20000 # define BC_besdith_MASK 0xfffbffff /* bit 18 */ -# define BC_besdith_disable 0x0 -# define BC_besdith_enable 0x40000 +# define BC_besdith_disable 0x0 +# define BC_besdith_enable 0x40000 # define BC_beshmir_MASK 0xfff7ffff /* bit 19 */ -# define BC_beshmir_disable 0x0 -# define BC_beshmir_enable 0x80000 +# define BC_beshmir_disable 0x0 +# define BC_beshmir_enable 0x80000 # define BC_besbwen_MASK 0xffefffff /* bit 20 */ -# define BC_besbwen_color 0x0 -# define BC_besbwen_bw 0x100000 +# define BC_besbwen_color 0x0 +# define BC_besbwen_bw 0x100000 # define BC_besblank_MASK 0xffdfffff /* bit 21 */ -# define BC_besblank_disable 0x0 -# define BC_besblank_enable 0x200000 +# define BC_besblank_disable 0x0 +# define BC_besblank_enable 0x200000 # define BC_besfselm_MASK 0xfeffffff /* bit 24 */ -# define BC_besfselm_soft 0x0 -# define BC_besfselm_hard 0x1000000 +# define BC_besfselm_soft 0x0 +# define BC_besfselm_hard 0x1000000 # define BC_besfsel_MASK 0xf9ffffff /* bits 25-26 */ # define BC_besfsel_a1 0x0 /* val 0, shift 25 */ # define BC_besfsel_a2 0x2000000 /* val 1, shift 25 */ @@ -219,51 +219,51 @@ #define MGAREG_BESGLOBCTL 0x3dc0 # define BGC_beshzoom_MASK 0xfffffffe /* bit 0 */ -# define BGC_beshzoom_disable 0x0 -# define BGC_beshzoom_enable 0x1 +# define BGC_beshzoom_disable 0x0 +# define BGC_beshzoom_enable 0x1 # define BGC_beshzoomf_MASK 0xfffffffd /* bit 1 */ -# define BGC_beshzoomf_disable 0x0 -# define BGC_beshzoomf_enable 0x2 +# define BGC_beshzoomf_disable 0x0 +# define BGC_beshzoomf_enable 0x2 # define BGC_bescorder_MASK 0xfffffff7 /* bit 3 */ -# define BGC_bescorder_even 0x0 -# define BGC_bescorder_odd 0x8 +# define BGC_bescorder_even 0x0 +# define BGC_bescorder_odd 0x8 # define BGC_besreghup_MASK 0xffffffef /* bit 4 */ -# define BGC_besreghup_disable 0x0 -# define BGC_besreghup_enable 0x10 +# define BGC_besreghup_disable 0x0 +# define BGC_besreghup_enable 0x10 # define BGC_besvcnt_MASK 0xf000ffff /* bits 16-27 */ -# define BGC_besvcnt_SHIFT 16 +# define BGC_besvcnt_SHIFT 16 #define MGAREG_BESHCOORD 0x3d28 # define BHC_besright_MASK 0xfffff800 /* bits 0-10 */ -# define BHC_besright_SHIFT 0 +# define BHC_besright_SHIFT 0 # define BHC_besleft_MASK 0xf800ffff /* bits 16-26 */ -# define BHC_besleft_SHIFT 16 +# define BHC_besleft_SHIFT 16 #define MGAREG_BESHISCAL 0x3d30 # define BHISF_beshiscal_MASK 0xffe00003 /* bits 2-20 */ -# define BHISF_beshiscal_SHIFT 2 +# define BHISF_beshiscal_SHIFT 2 #define MGAREG_BESHSRCEND 0x3d3c # define BHSE_beshsrcend_MASK 0xfc000003 /* bits 2-25 */ -# define BHSE_beshsrcend_SHIFT 2 +# define BHSE_beshsrcend_SHIFT 2 #define MGAREG_BESHSRCLST 0x3d50 # define BHSL_beshsrclst_MASK 0xfc00ffff /* bits 16-25 */ -# define BHSL_beshsrclst_SHIFT 16 +# define BHSL_beshsrclst_SHIFT 16 #define MGAREG_BESHSRCST 0x3d38 # define BHSS_beshsrcst_MASK 0xfc000003 /* bits 2-25 */ -# define BHSS_beshsrcst_SHIFT 2 +# define BHSS_beshsrcst_SHIFT 2 #define MGAREG_BESPITCH 0x3d24 # define BP_bespitch_MASK 0xfffff000 /* bits 0-11 */ -# define BP_bespitch_SHIFT 0 +# define BP_bespitch_SHIFT 0 #define MGAREG_BESSTATUS 0x3dc4 @@ -276,40 +276,40 @@ #define MGAREG_BESV1SRCLST 0x3d54 # define BSF_besv1srclast_MASK 0xfffffc00 /* bits 0-9 */ -# define BSF_besv1srclast_SHIFT 0 +# define BSF_besv1srclast_SHIFT 0 #define MGAREG_BESV2SRCLST 0x3d58 # define BSF_besv2srclst_MASK 0xfffffc00 /* bits 0-9 */ -# define BSF_besv2srclst_SHIFT 0 +# define BSF_besv2srclst_SHIFT 0 #define MGAREG_BESV1WGHT 0x3d48 # define BSF_besv1wght_MASK 0xffff0003 /* bits 2-15 */ -# define BSF_besv1wght_SHIFT 2 +# define BSF_besv1wght_SHIFT 2 # define BSF_besv1wghts_MASK 0xfffeffff /* bit 16 */ -# define BSF_besv1wghts_disable 0x0 -# define BSF_besv1wghts_enable 0x10000 +# define BSF_besv1wghts_disable 0x0 +# define BSF_besv1wghts_enable 0x10000 #define MGAREG_BESV2WGHT 0x3d4c # define BSF_besv2wght_MASK 0xffff0003 /* bits 2-15 */ -# define BSF_besv2wght_SHIFT 2 +# define BSF_besv2wght_SHIFT 2 # define BSF_besv2wghts_MASK 0xfffeffff /* bit 16 */ -# define BSF_besv2wghts_disable 0x0 -# define BSF_besv2wghts_enable 0x10000 +# define BSF_besv2wghts_disable 0x0 +# define BSF_besv2wghts_enable 0x10000 #define MGAREG_BESVCOORD 0x3d2c # define BVC_besbot_MASK 0xfffff800 /* bits 0-10 */ -# define BVC_besbot_SHIFT 0 +# define BVC_besbot_SHIFT 0 # define BVC_bestop_MASK 0xf800ffff /* bits 16-26 */ -# define BVC_bestop_SHIFT 16 +# define BVC_bestop_SHIFT 16 #define MGAREG_BESVISCAL 0x3d34 # define BVISF_besviscal_MASK 0xffe00003 /* bits 2-20 */ -# define BVISF_besviscal_SHIFT 2 +# define BVISF_besviscal_SHIFT 2 #define MGAREG_CODECADDR 0x3e44 #define MGAREG_CODECCTL 0x3e40 @@ -319,9 +319,9 @@ #define MGAREG_CXBNDRY 0x1c80 # define CXB_cxleft_MASK 0xfffff000 /* bits 0-11 */ -# define CXB_cxleft_SHIFT 0 +# define CXB_cxleft_SHIFT 0 # define CXB_cxright_MASK 0xf000ffff /* bits 16-27 */ -# define CXB_cxright_SHIFT 16 +# define CXB_cxright_SHIFT 16 #define MGAREG_CXLEFT 0x1ca0 #define MGAREG_CXRIGHT 0x1ca4 @@ -351,13 +351,13 @@ #define MGAREG_DSTORG 0x2cb8 # define DO_dstmap_MASK 0xfffffffe /* bit 0 */ -# define DO_dstmap_fb 0x0 -# define DO_dstmap_sys 0x1 +# define DO_dstmap_fb 0x0 +# define DO_dstmap_sys 0x1 # define DO_dstacc_MASK 0xfffffffd /* bit 1 */ -# define DO_dstacc_pci 0x0 -# define DO_dstacc_agp 0x2 +# define DO_dstacc_pci 0x0 +# define DO_dstacc_agp 0x2 # define DO_dstorg_MASK 0x7 /* bits 3-31 */ -# define DO_dstorg_SHIFT 3 +# define DO_dstorg_SHIFT 3 #define MGAREG_DWG_INDIR_WT 0x1e80 #define MGAREG_DWGCTL 0x1c00 @@ -378,8 +378,8 @@ # define DC_atype_blk 0x40 /* val 4, shift 4 */ # define DC_atype_i 0x70 /* val 7, shift 4 */ # define DC_linear_MASK 0xffffff7f /* bit 7 */ -# define DC_linear_xy 0x0 -# define DC_linear_linear 0x80 +# define DC_linear_xy 0x0 +# define DC_linear_linear 0x80 # define DC_zmode_MASK 0xfffff8ff /* bits 8-10 */ # define DC_zmode_nozcmp 0x0 /* val 0, shift 8 */ # define DC_zmode_ze 0x200 /* val 2, shift 8 */ @@ -389,21 +389,21 @@ # define DC_zmode_zgt 0x600 /* val 6, shift 8 */ # define DC_zmode_zgte 0x700 /* val 7, shift 8 */ # define DC_solid_MASK 0xfffff7ff /* bit 11 */ -# define DC_solid_disable 0x0 -# define DC_solid_enable 0x800 +# define DC_solid_disable 0x0 +# define DC_solid_enable 0x800 # define DC_arzero_MASK 0xffffefff /* bit 12 */ -# define DC_arzero_disable 0x0 -# define DC_arzero_enable 0x1000 +# define DC_arzero_disable 0x0 +# define DC_arzero_enable 0x1000 # define DC_sgnzero_MASK 0xffffdfff /* bit 13 */ -# define DC_sgnzero_disable 0x0 -# define DC_sgnzero_enable 0x2000 +# define DC_sgnzero_disable 0x0 +# define DC_sgnzero_enable 0x2000 # define DC_shftzero_MASK 0xffffbfff /* bit 14 */ -# define DC_shftzero_disable 0x0 -# define DC_shftzero_enable 0x4000 +# define DC_shftzero_disable 0x0 +# define DC_shftzero_enable 0x4000 # define DC_bop_MASK 0xfff0ffff /* bits 16-19 */ -# define DC_bop_SHIFT 16 +# define DC_bop_SHIFT 16 # define DC_trans_MASK 0xff0fffff /* bits 20-23 */ -# define DC_trans_SHIFT 20 +# define DC_trans_SHIFT 20 # define DC_bltmod_MASK 0xe1ffffff /* bits 25-28 */ # define DC_bltmod_bmonolef 0x0 /* val 0, shift 25 */ # define DC_bltmod_bmonowf 0x8000000 /* val 4, shift 25 */ @@ -414,31 +414,31 @@ # define DC_bltmod_bu24bgr 0x16000000 /* val 11, shift 25 */ # define DC_bltmod_bu24rgb 0x1e000000 /* val 15, shift 25 */ # define DC_pattern_MASK 0xdfffffff /* bit 29 */ -# define DC_pattern_disable 0x0 -# define DC_pattern_enable 0x20000000 +# define DC_pattern_disable 0x0 +# define DC_pattern_enable 0x20000000 # define DC_transc_MASK 0xbfffffff /* bit 30 */ -# define DC_transc_disable 0x0 -# define DC_transc_enable 0x40000000 +# define DC_transc_disable 0x0 +# define DC_transc_enable 0x40000000 # define DC_clipdis_MASK 0x7fffffff /* bit 31 */ -# define DC_clipdis_disable 0x0 -# define DC_clipdis_enable 0x80000000 +# define DC_clipdis_disable 0x0 +# define DC_clipdis_enable 0x80000000 #define MGAREG_DWGSYNC 0x2c4c # define DS_dwgsyncaddr_MASK 0x3 /* bits 2-31 */ -# define DS_dwgsyncaddr_SHIFT 2 +# define DS_dwgsyncaddr_SHIFT 2 #define MGAREG_FCOL 0x1c24 #define MGAREG_FIFOSTATUS 0x1e10 # define FS_fifocount_MASK 0xffffff80 /* bits 0-6 */ -# define FS_fifocount_SHIFT 0 +# define FS_fifocount_SHIFT 0 # define FS_bfull_MASK 0xfffffeff /* bit 8 */ -# define FS_bfull_disable 0x0 -# define FS_bfull_enable 0x100 +# define FS_bfull_disable 0x0 +# define FS_bfull_enable 0x100 # define FS_bempty_MASK 0xfffffdff /* bit 9 */ -# define FS_bempty_disable 0x0 -# define FS_bempty_enable 0x200 +# define FS_bempty_disable 0x0 +# define FS_bempty_enable 0x200 #define MGAREG_FOGCOL 0x1cf4 #define MGAREG_FOGSTART 0x1cc4 @@ -447,50 +447,50 @@ #define MGAREG_FXBNDRY 0x1c84 # define XA_fxleft_MASK 0xffff0000 /* bits 0-15 */ -# define XA_fxleft_SHIFT 0 +# define XA_fxleft_SHIFT 0 # define XA_fxright_MASK 0xffff /* bits 16-31 */ -# define XA_fxright_SHIFT 16 +# define XA_fxright_SHIFT 16 #define MGAREG_FXLEFT 0x1ca8 #define MGAREG_FXRIGHT 0x1cac #define MGAREG_ICLEAR 0x1e18 # define IC_softrapiclr_MASK 0xfffffffe /* bit 0 */ -# define IC_softrapiclr_disable 0x0 -# define IC_softrapiclr_enable 0x1 +# define IC_softrapiclr_disable 0x0 +# define IC_softrapiclr_enable 0x1 # define IC_pickiclr_MASK 0xfffffffb /* bit 2 */ -# define IC_pickiclr_disable 0x0 -# define IC_pickiclr_enable 0x4 +# define IC_pickiclr_disable 0x0 +# define IC_pickiclr_enable 0x4 # define IC_vlineiclr_MASK 0xffffffdf /* bit 5 */ -# define IC_vlineiclr_disable 0x0 -# define IC_vlineiclr_enable 0x20 +# define IC_vlineiclr_disable 0x0 +# define IC_vlineiclr_enable 0x20 # define IC_wiclr_MASK 0xffffff7f /* bit 7 */ -# define IC_wiclr_disable 0x0 -# define IC_wiclr_enable 0x80 +# define IC_wiclr_disable 0x0 +# define IC_wiclr_enable 0x80 # define IC_wciclr_MASK 0xfffffeff /* bit 8 */ -# define IC_wciclr_disable 0x0 -# define IC_wciclr_enable 0x100 +# define IC_wciclr_disable 0x0 +# define IC_wciclr_enable 0x100 #define MGAREG_IEN 0x1e1c # define IE_softrapien_MASK 0xfffffffe /* bit 0 */ -# define IE_softrapien_disable 0x0 -# define IE_softrapien_enable 0x1 +# define IE_softrapien_disable 0x0 +# define IE_softrapien_enable 0x1 # define IE_pickien_MASK 0xfffffffb /* bit 2 */ -# define IE_pickien_disable 0x0 -# define IE_pickien_enable 0x4 +# define IE_pickien_disable 0x0 +# define IE_pickien_enable 0x4 # define IE_vlineien_MASK 0xffffffdf /* bit 5 */ -# define IE_vlineien_disable 0x0 -# define IE_vlineien_enable 0x20 +# define IE_vlineien_disable 0x0 +# define IE_vlineien_enable 0x20 # define IE_extien_MASK 0xffffffbf /* bit 6 */ -# define IE_extien_disable 0x0 -# define IE_extien_enable 0x40 +# define IE_extien_disable 0x0 +# define IE_extien_enable 0x40 # define IE_wien_MASK 0xffffff7f /* bit 7 */ -# define IE_wien_disable 0x0 -# define IE_wien_enable 0x80 +# define IE_wien_disable 0x0 +# define IE_wien_enable 0x80 # define IE_wcien_MASK 0xfffffeff /* bit 8 */ -# define IE_wcien_disable 0x0 -# define IE_wcien_enable 0x100 +# define IE_wcien_disable 0x0 +# define IE_wcien_enable 0x100 #define MGAREG_LEN 0x1c5c #define MGAREG_MACCESS 0x1c04 @@ -506,48 +506,48 @@ # define MA_zwidth_15 0x10 /* val 2, shift 3 */ # define MA_zwidth_24 0x18 /* val 3, shift 3 */ # define MA_memreset_MASK 0xffff7fff /* bit 15 */ -# define MA_memreset_disable 0x0 -# define MA_memreset_enable 0x8000 +# define MA_memreset_disable 0x0 +# define MA_memreset_enable 0x8000 # define MA_fogen_MASK 0xfbffffff /* bit 26 */ -# define MA_fogen_disable 0x0 -# define MA_fogen_enable 0x4000000 +# define MA_fogen_disable 0x0 +# define MA_fogen_enable 0x4000000 # define MA_tlutload_MASK 0xdfffffff /* bit 29 */ -# define MA_tlutload_disable 0x0 -# define MA_tlutload_enable 0x20000000 +# define MA_tlutload_disable 0x0 +# define MA_tlutload_enable 0x20000000 # define MA_nodither_MASK 0xbfffffff /* bit 30 */ -# define MA_nodither_disable 0x0 -# define MA_nodither_enable 0x40000000 +# define MA_nodither_disable 0x0 +# define MA_nodither_enable 0x40000000 # define MA_dit555_MASK 0x7fffffff /* bit 31 */ -# define MA_dit555_disable 0x0 -# define MA_dit555_enable 0x80000000 +# define MA_dit555_disable 0x0 +# define MA_dit555_enable 0x80000000 #define MGAREG_MCTLWTST 0x1c08 # define MCWS_casltncy_MASK 0xfffffff8 /* bits 0-2 */ -# define MCWS_casltncy_SHIFT 0 +# define MCWS_casltncy_SHIFT 0 # define MCWS_rrddelay_MASK 0xffffffcf /* bits 4-5 */ # define MCWS_rcddelay_MASK 0xfffffe7f /* bits 7-8 */ # define MCWS_rasmin_MASK 0xffffe3ff /* bits 10-12 */ -# define MCWS_rasmin_SHIFT 10 +# define MCWS_rasmin_SHIFT 10 # define MCWS_rpdelay_MASK 0xffff3fff /* bits 14-15 */ # define MCWS_wrdelay_MASK 0xfff3ffff /* bits 18-19 */ # define MCWS_rddelay_MASK 0xffdfffff /* bit 21 */ -# define MCWS_rddelay_disable 0x0 -# define MCWS_rddelay_enable 0x200000 +# define MCWS_rddelay_disable 0x0 +# define MCWS_rddelay_enable 0x200000 # define MCWS_smrdelay_MASK 0xfe7fffff /* bits 23-24 */ # define MCWS_bwcdelay_MASK 0xf3ffffff /* bits 26-27 */ # define MCWS_bpldelay_MASK 0x1fffffff /* bits 29-31 */ -# define MCWS_bpldelay_SHIFT 29 +# define MCWS_bpldelay_SHIFT 29 #define MGAREG_MEMRDBK 0x1e44 # define MRB_mclkbrd0_MASK 0xfffffff0 /* bits 0-3 */ -# define MRB_mclkbrd0_SHIFT 0 +# define MRB_mclkbrd0_SHIFT 0 # define MRB_mclkbrd1_MASK 0xfffffe1f /* bits 5-8 */ -# define MRB_mclkbrd1_SHIFT 5 +# define MRB_mclkbrd1_SHIFT 5 # define MRB_strmfctl_MASK 0xff3fffff /* bits 22-23 */ # define MRB_mrsopcod_MASK 0xe1ffffff /* bits 25-28 */ -# define MRB_mrsopcod_SHIFT 25 +# define MRB_mrsopcod_SHIFT 25 #define MGAREG_OPMODE 0x1e54 @@ -570,10 +570,10 @@ #define MGAREG_PITCH 0x1c8c # define P_iy_MASK 0xffffe000 /* bits 0-12 */ -# define P_iy_SHIFT 0 +# define P_iy_SHIFT 0 # define P_ylin_MASK 0xffff7fff /* bit 15 */ -# define P_ylin_disable 0x0 -# define P_ylin_enable 0x8000 +# define P_ylin_disable 0x0 +# define P_ylin_enable 0x8000 #define MGAREG_PLNWT 0x1c1c #define MGAREG_PRIMADDRESS 0x1e58 @@ -584,38 +584,38 @@ # define PDCA_primod_vector 0x2 /* val 2, shift 0 */ # define PDCA_primod_vertex 0x3 /* val 3, shift 0 */ # define PDCA_primaddress_MASK 0x3 /* bits 2-31 */ -# define PDCA_primaddress_SHIFT 2 +# define PDCA_primaddress_SHIFT 2 #define MGAREG_PRIMEND 0x1e5c # define PDEA_primnostart_MASK 0xfffffffe /* bit 0 */ -# define PDEA_primnostart_disable 0x0 -# define PDEA_primnostart_enable 0x1 +# define PDEA_primnostart_disable 0x0 +# define PDEA_primnostart_enable 0x1 # define PDEA_pagpxfer_MASK 0xfffffffd /* bit 1 */ -# define PDEA_pagpxfer_disable 0x0 -# define PDEA_pagpxfer_enable 0x2 +# define PDEA_pagpxfer_disable 0x0 +# define PDEA_pagpxfer_enable 0x2 # define PDEA_primend_MASK 0x3 /* bits 2-31 */ -# define PDEA_primend_SHIFT 2 +# define PDEA_primend_SHIFT 2 #define MGAREG_PRIMPTR 0x1e50 # define PLS_primptren0_MASK 0xfffffffe /* bit 0 */ -# define PLS_primptren0_disable 0x0 -# define PLS_primptren0_enable 0x1 +# define PLS_primptren0_disable 0x0 +# define PLS_primptren0_enable 0x1 # define PLS_primptren1_MASK 0xfffffffd /* bit 1 */ -# define PLS_primptren1_disable 0x0 -# define PLS_primptren1_enable 0x2 +# define PLS_primptren1_disable 0x0 +# define PLS_primptren1_enable 0x2 # define PLS_primptr_MASK 0x7 /* bits 3-31 */ -# define PLS_primptr_SHIFT 3 +# define PLS_primptr_SHIFT 3 #define MGAREG_RST 0x1e40 # define R_softreset_MASK 0xfffffffe /* bit 0 */ -# define R_softreset_disable 0x0 -# define R_softreset_enable 0x1 +# define R_softreset_disable 0x0 +# define R_softreset_enable 0x1 # define R_softextrst_MASK 0xfffffffd /* bit 1 */ -# define R_softextrst_disable 0x0 -# define R_softextrst_enable 0x2 +# define R_softextrst_disable 0x0 +# define R_softextrst_enable 0x2 #define MGAREG_SECADDRESS 0x2c40 @@ -625,72 +625,72 @@ # define SDCA_secmod_vector 0x2 /* val 2, shift 0 */ # define SDCA_secmod_vertex 0x3 /* val 3, shift 0 */ # define SDCA_secaddress_MASK 0x3 /* bits 2-31 */ -# define SDCA_secaddress_SHIFT 2 +# define SDCA_secaddress_SHIFT 2 #define MGAREG_SECEND 0x2c44 # define SDEA_sagpxfer_MASK 0xfffffffd /* bit 1 */ -# define SDEA_sagpxfer_disable 0x0 -# define SDEA_sagpxfer_enable 0x2 +# define SDEA_sagpxfer_disable 0x0 +# define SDEA_sagpxfer_enable 0x2 # define SDEA_secend_MASK 0x3 /* bits 2-31 */ -# define SDEA_secend_SHIFT 2 +# define SDEA_secend_SHIFT 2 #define MGAREG_SETUPADDRESS 0x2cd0 # define SETADD_mode_MASK 0xfffffffc /* bits 0-1 */ # define SETADD_mode_vertlist 0x0 /* val 0, shift 0 */ # define SETADD_address_MASK 0x3 /* bits 2-31 */ -# define SETADD_address_SHIFT 2 +# define SETADD_address_SHIFT 2 #define MGAREG_SETUPEND 0x2cd4 # define SETEND_agpxfer_MASK 0xfffffffd /* bit 1 */ -# define SETEND_agpxfer_disable 0x0 -# define SETEND_agpxfer_enable 0x2 +# define SETEND_agpxfer_disable 0x0 +# define SETEND_agpxfer_enable 0x2 # define SETEND_address_MASK 0x3 /* bits 2-31 */ -# define SETEND_address_SHIFT 2 +# define SETEND_address_SHIFT 2 #define MGAREG_SGN 0x1c58 # define S_sdydxl_MASK 0xfffffffe /* bit 0 */ -# define S_sdydxl_y 0x0 -# define S_sdydxl_x 0x1 +# define S_sdydxl_y 0x0 +# define S_sdydxl_x 0x1 # define S_scanleft_MASK 0xfffffffe /* bit 0 */ -# define S_scanleft_disable 0x0 -# define S_scanleft_enable 0x1 +# define S_scanleft_disable 0x0 +# define S_scanleft_enable 0x1 # define S_sdxl_MASK 0xfffffffd /* bit 1 */ -# define S_sdxl_pos 0x0 -# define S_sdxl_neg 0x2 +# define S_sdxl_pos 0x0 +# define S_sdxl_neg 0x2 # define S_sdy_MASK 0xfffffffb /* bit 2 */ -# define S_sdy_pos 0x0 -# define S_sdy_neg 0x4 +# define S_sdy_pos 0x0 +# define S_sdy_neg 0x4 # define S_sdxr_MASK 0xffffffdf /* bit 5 */ -# define S_sdxr_pos 0x0 -# define S_sdxr_neg 0x20 +# define S_sdxr_pos 0x0 +# define S_sdxr_neg 0x20 # define S_brkleft_MASK 0xfffffeff /* bit 8 */ -# define S_brkleft_disable 0x0 -# define S_brkleft_enable 0x100 +# define S_brkleft_disable 0x0 +# define S_brkleft_enable 0x100 # define S_errorinit_MASK 0x7fffffff /* bit 31 */ -# define S_errorinit_disable 0x0 -# define S_errorinit_enable 0x80000000 +# define S_errorinit_disable 0x0 +# define S_errorinit_enable 0x80000000 #define MGAREG_SHIFT 0x1c50 # define FSC_x_off_MASK 0xfffffff0 /* bits 0-3 */ -# define FSC_x_off_SHIFT 0 +# define FSC_x_off_SHIFT 0 # define FSC_funcnt_MASK 0xffffff80 /* bits 0-6 */ -# define FSC_funcnt_SHIFT 0 +# define FSC_funcnt_SHIFT 0 # define FSC_y_off_MASK 0xffffff8f /* bits 4-6 */ -# define FSC_y_off_SHIFT 4 +# define FSC_y_off_SHIFT 4 # define FSC_funoff_MASK 0xffc0ffff /* bits 16-21 */ -# define FSC_funoff_SHIFT 16 +# define FSC_funoff_SHIFT 16 # define FSC_stylelen_MASK 0xffc0ffff /* bits 16-21 */ -# define FSC_stylelen_SHIFT 16 +# define FSC_stylelen_SHIFT 16 #define MGAREG_SOFTRAP 0x2c48 # define STH_softraphand_MASK 0x3 /* bits 2-31 */ -# define STH_softraphand_SHIFT 2 +# define STH_softraphand_SHIFT 2 #define MGAREG_SPECBSTART 0x2c98 #define MGAREG_SPECBXINC 0x2c9c @@ -708,60 +708,60 @@ #define MGAREG_SRCORG 0x2cb4 # define SO_srcmap_MASK 0xfffffffe /* bit 0 */ -# define SO_srcmap_fb 0x0 -# define SO_srcmap_sys 0x1 +# define SO_srcmap_fb 0x0 +# define SO_srcmap_sys 0x1 # define SO_srcacc_MASK 0xfffffffd /* bit 1 */ -# define SO_srcacc_pci 0x0 -# define SO_srcacc_agp 0x2 +# define SO_srcacc_pci 0x0 +# define SO_srcacc_agp 0x2 # define SO_srcorg_MASK 0x7 /* bits 3-31 */ -# define SO_srcorg_SHIFT 3 +# define SO_srcorg_SHIFT 3 #define MGAREG_STATUS 0x1e14 # define STAT_softrapen_MASK 0xfffffffe /* bit 0 */ -# define STAT_softrapen_disable 0x0 -# define STAT_softrapen_enable 0x1 +# define STAT_softrapen_disable 0x0 +# define STAT_softrapen_enable 0x1 # define STAT_pickpen_MASK 0xfffffffb /* bit 2 */ -# define STAT_pickpen_disable 0x0 -# define STAT_pickpen_enable 0x4 +# define STAT_pickpen_disable 0x0 +# define STAT_pickpen_enable 0x4 # define STAT_vsyncsts_MASK 0xfffffff7 /* bit 3 */ -# define STAT_vsyncsts_disable 0x0 -# define STAT_vsyncsts_enable 0x8 +# define STAT_vsyncsts_disable 0x0 +# define STAT_vsyncsts_enable 0x8 # define STAT_vsyncpen_MASK 0xffffffef /* bit 4 */ -# define STAT_vsyncpen_disable 0x0 -# define STAT_vsyncpen_enable 0x10 +# define STAT_vsyncpen_disable 0x0 +# define STAT_vsyncpen_enable 0x10 # define STAT_vlinepen_MASK 0xffffffdf /* bit 5 */ -# define STAT_vlinepen_disable 0x0 -# define STAT_vlinepen_enable 0x20 +# define STAT_vlinepen_disable 0x0 +# define STAT_vlinepen_enable 0x20 # define STAT_extpen_MASK 0xffffffbf /* bit 6 */ -# define STAT_extpen_disable 0x0 -# define STAT_extpen_enable 0x40 +# define STAT_extpen_disable 0x0 +# define STAT_extpen_enable 0x40 # define STAT_wpen_MASK 0xffffff7f /* bit 7 */ -# define STAT_wpen_disable 0x0 -# define STAT_wpen_enable 0x80 +# define STAT_wpen_disable 0x0 +# define STAT_wpen_enable 0x80 # define STAT_wcpen_MASK 0xfffffeff /* bit 8 */ -# define STAT_wcpen_disable 0x0 -# define STAT_wcpen_enable 0x100 +# define STAT_wcpen_disable 0x0 +# define STAT_wcpen_enable 0x100 # define STAT_dwgengsts_MASK 0xfffeffff /* bit 16 */ -# define STAT_dwgengsts_disable 0x0 -# define STAT_dwgengsts_enable 0x10000 +# define STAT_dwgengsts_disable 0x0 +# define STAT_dwgengsts_enable 0x10000 # define STAT_endprdmasts_MASK 0xfffdffff /* bit 17 */ -# define STAT_endprdmasts_disable 0x0 -# define STAT_endprdmasts_enable 0x20000 +# define STAT_endprdmasts_disable 0x0 +# define STAT_endprdmasts_enable 0x20000 # define STAT_wbusy_MASK 0xfffbffff /* bit 18 */ -# define STAT_wbusy_disable 0x0 -# define STAT_wbusy_enable 0x40000 +# define STAT_wbusy_disable 0x0 +# define STAT_wbusy_enable 0x40000 # define STAT_swflag_MASK 0xfffffff /* bits 28-31 */ -# define STAT_swflag_SHIFT 28 +# define STAT_swflag_SHIFT 28 #define MGAREG_STENCIL 0x2cc8 # define S_sref_MASK 0xffffff00 /* bits 0-7 */ -# define S_sref_SHIFT 0 +# define S_sref_SHIFT 0 # define S_smsk_MASK 0xffff00ff /* bits 8-15 */ -# define S_smsk_SHIFT 8 +# define S_smsk_SHIFT 8 # define S_swtmsk_MASK 0xff00ffff /* bits 16-23 */ -# define S_swtmsk_SHIFT 16 +# define S_swtmsk_SHIFT 16 #define MGAREG_STENCILCTL 0x2ccc @@ -816,23 +816,23 @@ # define TD0_color_alpha_prevtex 0xc /* val 3, shift 2 */ # define TD0_color_alpha_prevstage 0x10 /* val 4, shift 2 */ # define TD0_color_arg1_replicatealpha_MASK 0xffffffdf /* bit 5 */ -# define TD0_color_arg1_replicatealpha_disable 0x0 -# define TD0_color_arg1_replicatealpha_enable 0x20 +# define TD0_color_arg1_replicatealpha_disable 0x0 +# define TD0_color_arg1_replicatealpha_enable 0x20 # define TD0_color_arg1_inv_MASK 0xffffffbf /* bit 6 */ -# define TD0_color_arg1_inv_disable 0x0 -# define TD0_color_arg1_inv_enable 0x40 +# define TD0_color_arg1_inv_disable 0x0 +# define TD0_color_arg1_inv_enable 0x40 # define TD0_color_arg2_replicatealpha_MASK 0xffffff7f /* bit 7 */ -# define TD0_color_arg2_replicatealpha_disable 0x0 -# define TD0_color_arg2_replicatealpha_enable 0x80 +# define TD0_color_arg2_replicatealpha_disable 0x0 +# define TD0_color_arg2_replicatealpha_enable 0x80 # define TD0_color_arg2_inv_MASK 0xfffffeff /* bit 8 */ -# define TD0_color_arg2_inv_disable 0x0 -# define TD0_color_arg2_inv_enable 0x100 +# define TD0_color_arg2_inv_disable 0x0 +# define TD0_color_arg2_inv_enable 0x100 # define TD0_color_alpha1inv_MASK 0xfffffdff /* bit 9 */ -# define TD0_color_alpha1inv_disable 0x0 -# define TD0_color_alpha1inv_enable 0x200 +# define TD0_color_alpha1inv_disable 0x0 +# define TD0_color_alpha1inv_enable 0x200 # define TD0_color_alpha2inv_MASK 0xfffffbff /* bit 10 */ -# define TD0_color_alpha2inv_disable 0x0 -# define TD0_color_alpha2inv_enable 0x400 +# define TD0_color_alpha2inv_disable 0x0 +# define TD0_color_alpha2inv_enable 0x400 # define TD0_color_arg1mul_MASK 0xfffff7ff /* bit 11 */ # define TD0_color_arg1mul_disable 0x0 /* val 0, shift 11 */ # define TD0_color_arg1mul_alpha1 0x800 /* val 1, shift 11 */ @@ -853,39 +853,39 @@ # define TD0_color_add_sub 0x0 /* val 0, shift 17 */ # define TD0_color_add_add 0x20000 /* val 1, shift 17 */ # define TD0_color_add2x_MASK 0xfffbffff /* bit 18 */ -# define TD0_color_add2x_disable 0x0 -# define TD0_color_add2x_enable 0x40000 +# define TD0_color_add2x_disable 0x0 +# define TD0_color_add2x_enable 0x40000 # define TD0_color_addbias_MASK 0xfff7ffff /* bit 19 */ -# define TD0_color_addbias_disable 0x0 -# define TD0_color_addbias_enable 0x80000 +# define TD0_color_addbias_disable 0x0 +# define TD0_color_addbias_enable 0x80000 # define TD0_color_blend_MASK 0xffefffff /* bit 20 */ -# define TD0_color_blend_disable 0x0 -# define TD0_color_blend_enable 0x100000 +# define TD0_color_blend_disable 0x0 +# define TD0_color_blend_enable 0x100000 # define TD0_color_sel_MASK 0xff9fffff /* bits 21-22 */ # define TD0_color_sel_arg1 0x0 /* val 0, shift 21 */ # define TD0_color_sel_arg2 0x200000 /* val 1, shift 21 */ # define TD0_color_sel_add 0x400000 /* val 2, shift 21 */ # define TD0_color_sel_mul 0x600000 /* val 3, shift 21 */ # define TD0_alpha_arg1_inv_MASK 0xff7fffff /* bit 23 */ -# define TD0_alpha_arg1_inv_disable 0x0 -# define TD0_alpha_arg1_inv_enable 0x800000 +# define TD0_alpha_arg1_inv_disable 0x0 +# define TD0_alpha_arg1_inv_enable 0x800000 # define TD0_alpha_arg2_MASK 0xfcffffff /* bits 24-25 */ # define TD0_alpha_arg2_diffuse 0x0 /* val 0, shift 24 */ # define TD0_alpha_arg2_fcol 0x1000000 /* val 1, shift 24 */ # define TD0_alpha_arg2_prevtex 0x2000000 /* val 2, shift 24 */ # define TD0_alpha_arg2_prevstage 0x3000000 /* val 3, shift 24 */ # define TD0_alpha_arg2_inv_MASK 0xfbffffff /* bit 26 */ -# define TD0_alpha_arg2_inv_disable 0x0 -# define TD0_alpha_arg2_inv_enable 0x4000000 +# define TD0_alpha_arg2_inv_disable 0x0 +# define TD0_alpha_arg2_inv_enable 0x4000000 # define TD0_alpha_add_MASK 0xf7ffffff /* bit 27 */ -# define TD0_alpha_add_disable 0x0 -# define TD0_alpha_add_enable 0x8000000 +# define TD0_alpha_add_disable 0x0 +# define TD0_alpha_add_enable 0x8000000 # define TD0_alpha_addbias_MASK 0xefffffff /* bit 28 */ -# define TD0_alpha_addbias_disable 0x0 -# define TD0_alpha_addbias_enable 0x10000000 +# define TD0_alpha_addbias_disable 0x0 +# define TD0_alpha_addbias_enable 0x10000000 # define TD0_alpha_add2x_MASK 0xdfffffff /* bit 29 */ -# define TD0_alpha_add2x_disable 0x0 -# define TD0_alpha_add2x_enable 0x20000000 +# define TD0_alpha_add2x_disable 0x0 +# define TD0_alpha_add2x_enable 0x20000000 # define TD0_alpha_modbright_MASK 0xcfffffff /* bits 28-29 */ # define TD0_alpha_modbright_disable 0x0 /* val 0, shift 28 */ # define TD0_alpha_modbright_2x 0x10000000 /* val 1, shift 28 */ @@ -910,23 +910,23 @@ # define TD1_color_alpha_prevtex 0xc /* val 3, shift 2 */ # define TD1_color_alpha_prevstage 0x10 /* val 4, shift 2 */ # define TD1_color_arg1_replicatealpha_MASK 0xffffffdf /* bit 5 */ -# define TD1_color_arg1_replicatealpha_disable 0x0 -# define TD1_color_arg1_replicatealpha_enable 0x20 +# define TD1_color_arg1_replicatealpha_disable 0x0 +# define TD1_color_arg1_replicatealpha_enable 0x20 # define TD1_color_arg1_inv_MASK 0xffffffbf /* bit 6 */ -# define TD1_color_arg1_inv_disable 0x0 -# define TD1_color_arg1_inv_enable 0x40 +# define TD1_color_arg1_inv_disable 0x0 +# define TD1_color_arg1_inv_enable 0x40 # define TD1_color_arg2_replicatealpha_MASK 0xffffff7f /* bit 7 */ -# define TD1_color_arg2_replicatealpha_disable 0x0 -# define TD1_color_arg2_replicatealpha_enable 0x80 +# define TD1_color_arg2_replicatealpha_disable 0x0 +# define TD1_color_arg2_replicatealpha_enable 0x80 # define TD1_color_arg2_inv_MASK 0xfffffeff /* bit 8 */ -# define TD1_color_arg2_inv_disable 0x0 -# define TD1_color_arg2_inv_enable 0x100 +# define TD1_color_arg2_inv_disable 0x0 +# define TD1_color_arg2_inv_enable 0x100 # define TD1_color_alpha1inv_MASK 0xfffffdff /* bit 9 */ -# define TD1_color_alpha1inv_disable 0x0 -# define TD1_color_alpha1inv_enable 0x200 +# define TD1_color_alpha1inv_disable 0x0 +# define TD1_color_alpha1inv_enable 0x200 # define TD1_color_alpha2inv_MASK 0xfffffbff /* bit 10 */ -# define TD1_color_alpha2inv_disable 0x0 -# define TD1_color_alpha2inv_enable 0x400 +# define TD1_color_alpha2inv_disable 0x0 +# define TD1_color_alpha2inv_enable 0x400 # define TD1_color_arg1mul_MASK 0xfffff7ff /* bit 11 */ # define TD1_color_arg1mul_disable 0x0 /* val 0, shift 11 */ # define TD1_color_arg1mul_alpha1 0x800 /* val 1, shift 11 */ @@ -947,39 +947,39 @@ # define TD1_color_add_sub 0x0 /* val 0, shift 17 */ # define TD1_color_add_add 0x20000 /* val 1, shift 17 */ # define TD1_color_add2x_MASK 0xfffbffff /* bit 18 */ -# define TD1_color_add2x_disable 0x0 -# define TD1_color_add2x_enable 0x40000 +# define TD1_color_add2x_disable 0x0 +# define TD1_color_add2x_enable 0x40000 # define TD1_color_addbias_MASK 0xfff7ffff /* bit 19 */ -# define TD1_color_addbias_disable 0x0 -# define TD1_color_addbias_enable 0x80000 +# define TD1_color_addbias_disable 0x0 +# define TD1_color_addbias_enable 0x80000 # define TD1_color_blend_MASK 0xffefffff /* bit 20 */ -# define TD1_color_blend_disable 0x0 -# define TD1_color_blend_enable 0x100000 +# define TD1_color_blend_disable 0x0 +# define TD1_color_blend_enable 0x100000 # define TD1_color_sel_MASK 0xff9fffff /* bits 21-22 */ # define TD1_color_sel_arg1 0x0 /* val 0, shift 21 */ # define TD1_color_sel_arg2 0x200000 /* val 1, shift 21 */ # define TD1_color_sel_add 0x400000 /* val 2, shift 21 */ # define TD1_color_sel_mul 0x600000 /* val 3, shift 21 */ # define TD1_alpha_arg1_inv_MASK 0xff7fffff /* bit 23 */ -# define TD1_alpha_arg1_inv_disable 0x0 -# define TD1_alpha_arg1_inv_enable 0x800000 +# define TD1_alpha_arg1_inv_disable 0x0 +# define TD1_alpha_arg1_inv_enable 0x800000 # define TD1_alpha_arg2_MASK 0xfcffffff /* bits 24-25 */ # define TD1_alpha_arg2_diffuse 0x0 /* val 0, shift 24 */ # define TD1_alpha_arg2_fcol 0x1000000 /* val 1, shift 24 */ # define TD1_alpha_arg2_prevtex 0x2000000 /* val 2, shift 24 */ # define TD1_alpha_arg2_prevstage 0x3000000 /* val 3, shift 24 */ # define TD1_alpha_arg2_inv_MASK 0xfbffffff /* bit 26 */ -# define TD1_alpha_arg2_inv_disable 0x0 -# define TD1_alpha_arg2_inv_enable 0x4000000 +# define TD1_alpha_arg2_inv_disable 0x0 +# define TD1_alpha_arg2_inv_enable 0x4000000 # define TD1_alpha_add_MASK 0xf7ffffff /* bit 27 */ -# define TD1_alpha_add_disable 0x0 -# define TD1_alpha_add_enable 0x8000000 +# define TD1_alpha_add_disable 0x0 +# define TD1_alpha_add_enable 0x8000000 # define TD1_alpha_addbias_MASK 0xefffffff /* bit 28 */ -# define TD1_alpha_addbias_disable 0x0 -# define TD1_alpha_addbias_enable 0x10000000 +# define TD1_alpha_addbias_disable 0x0 +# define TD1_alpha_addbias_enable 0x10000000 # define TD1_alpha_add2x_MASK 0xdfffffff /* bit 29 */ -# define TD1_alpha_add2x_disable 0x0 -# define TD1_alpha_add2x_enable 0x20000000 +# define TD1_alpha_add2x_disable 0x0 +# define TD1_alpha_add2x_enable 0x20000000 # define TD1_alpha_modbright_MASK 0xcfffffff /* bits 28-29 */ # define TD1_alpha_modbright_disable 0x0 /* val 0, shift 28 */ # define TD1_alpha_modbright_2x 0x10000000 /* val 1, shift 28 */ @@ -993,50 +993,50 @@ #define MGAREG_TEST0 0x1e48 # define TST_ramtsten_MASK 0xfffffffe /* bit 0 */ -# define TST_ramtsten_disable 0x0 -# define TST_ramtsten_enable 0x1 +# define TST_ramtsten_disable 0x0 +# define TST_ramtsten_enable 0x1 # define TST_ramtstdone_MASK 0xfffffffd /* bit 1 */ -# define TST_ramtstdone_disable 0x0 -# define TST_ramtstdone_enable 0x2 +# define TST_ramtstdone_disable 0x0 +# define TST_ramtstdone_enable 0x2 # define TST_wramtstpass_MASK 0xfffffffb /* bit 2 */ -# define TST_wramtstpass_disable 0x0 -# define TST_wramtstpass_enable 0x4 +# define TST_wramtstpass_disable 0x0 +# define TST_wramtstpass_enable 0x4 # define TST_tcachetstpass_MASK 0xfffffff7 /* bit 3 */ -# define TST_tcachetstpass_disable 0x0 -# define TST_tcachetstpass_enable 0x8 +# define TST_tcachetstpass_disable 0x0 +# define TST_tcachetstpass_enable 0x8 # define TST_tluttstpass_MASK 0xffffffef /* bit 4 */ -# define TST_tluttstpass_disable 0x0 -# define TST_tluttstpass_enable 0x10 +# define TST_tluttstpass_disable 0x0 +# define TST_tluttstpass_enable 0x10 # define TST_luttstpass_MASK 0xffffffdf /* bit 5 */ -# define TST_luttstpass_disable 0x0 -# define TST_luttstpass_enable 0x20 +# define TST_luttstpass_disable 0x0 +# define TST_luttstpass_enable 0x20 # define TST_besramtstpass_MASK 0xffffffbf /* bit 6 */ -# define TST_besramtstpass_disable 0x0 -# define TST_besramtstpass_enable 0x40 +# define TST_besramtstpass_disable 0x0 +# define TST_besramtstpass_enable 0x40 # define TST_ringen_MASK 0xfffffeff /* bit 8 */ -# define TST_ringen_disable 0x0 -# define TST_ringen_enable 0x100 +# define TST_ringen_disable 0x0 +# define TST_ringen_enable 0x100 # define TST_apllbyp_MASK 0xfffffdff /* bit 9 */ -# define TST_apllbyp_disable 0x0 -# define TST_apllbyp_enable 0x200 +# define TST_apllbyp_disable 0x0 +# define TST_apllbyp_enable 0x200 # define TST_hiten_MASK 0xfffffbff /* bit 10 */ -# define TST_hiten_disable 0x0 -# define TST_hiten_enable 0x400 +# define TST_hiten_disable 0x0 +# define TST_hiten_enable 0x400 # define TST_tmode_MASK 0xffffc7ff /* bits 11-13 */ -# define TST_tmode_SHIFT 11 +# define TST_tmode_SHIFT 11 # define TST_tclksel_MASK 0xfffe3fff /* bits 14-16 */ -# define TST_tclksel_SHIFT 14 +# define TST_tclksel_SHIFT 14 # define TST_ringcnten_MASK 0xfffdffff /* bit 17 */ -# define TST_ringcnten_disable 0x0 -# define TST_ringcnten_enable 0x20000 +# define TST_ringcnten_disable 0x0 +# define TST_ringcnten_enable 0x20000 # define TST_ringcnt_MASK 0xc003ffff /* bits 18-29 */ -# define TST_ringcnt_SHIFT 18 +# define TST_ringcnt_SHIFT 18 # define TST_ringcntclksl_MASK 0xbfffffff /* bit 30 */ -# define TST_ringcntclksl_disable 0x0 -# define TST_ringcntclksl_enable 0x40000000 +# define TST_ringcntclksl_disable 0x0 +# define TST_ringcntclksl_enable 0x40000000 # define TST_biosboot_MASK 0x7fffffff /* bit 31 */ -# define TST_biosboot_disable 0x0 -# define TST_biosboot_enable 0x80000000 +# define TST_biosboot_disable 0x0 +# define TST_biosboot_enable 0x80000000 #define MGAREG_TEXBORDERCOL 0x2c5c #define MGAREG_TEXCTL 0x2c30 @@ -1053,75 +1053,75 @@ # define TMC_tformat_tw422 0xa /* val 10, shift 0 */ # define TMC_tformat_tw422uyvy 0xb /* val 11, shift 0 */ # define TMC_tpitchlin_MASK 0xfffffeff /* bit 8 */ -# define TMC_tpitchlin_disable 0x0 -# define TMC_tpitchlin_enable 0x100 +# define TMC_tpitchlin_disable 0x0 +# define TMC_tpitchlin_enable 0x100 # define TMC_tpitchext_MASK 0xfff001ff /* bits 9-19 */ -# define TMC_tpitchext_SHIFT 9 +# define TMC_tpitchext_SHIFT 9 # define TMC_tpitch_MASK 0xfff8ffff /* bits 16-18 */ -# define TMC_tpitch_SHIFT 16 +# define TMC_tpitch_SHIFT 16 # define TMC_owalpha_MASK 0xffbfffff /* bit 22 */ -# define TMC_owalpha_disable 0x0 -# define TMC_owalpha_enable 0x400000 +# define TMC_owalpha_disable 0x0 +# define TMC_owalpha_enable 0x400000 # define TMC_azeroextend_MASK 0xff7fffff /* bit 23 */ -# define TMC_azeroextend_disable 0x0 -# define TMC_azeroextend_enable 0x800000 +# define TMC_azeroextend_disable 0x0 +# define TMC_azeroextend_enable 0x800000 # define TMC_decalckey_MASK 0xfeffffff /* bit 24 */ -# define TMC_decalckey_disable 0x0 -# define TMC_decalckey_enable 0x1000000 +# define TMC_decalckey_disable 0x0 +# define TMC_decalckey_enable 0x1000000 # define TMC_takey_MASK 0xfdffffff /* bit 25 */ -# define TMC_takey_0 0x0 -# define TMC_takey_1 0x2000000 +# define TMC_takey_0 0x0 +# define TMC_takey_1 0x2000000 # define TMC_tamask_MASK 0xfbffffff /* bit 26 */ -# define TMC_tamask_0 0x0 -# define TMC_tamask_1 0x4000000 +# define TMC_tamask_0 0x0 +# define TMC_tamask_1 0x4000000 # define TMC_clampv_MASK 0xf7ffffff /* bit 27 */ -# define TMC_clampv_disable 0x0 -# define TMC_clampv_enable 0x8000000 +# define TMC_clampv_disable 0x0 +# define TMC_clampv_enable 0x8000000 # define TMC_clampu_MASK 0xefffffff /* bit 28 */ -# define TMC_clampu_disable 0x0 -# define TMC_clampu_enable 0x10000000 +# define TMC_clampu_disable 0x0 +# define TMC_clampu_enable 0x10000000 # define TMC_tmodulate_MASK 0xdfffffff /* bit 29 */ -# define TMC_tmodulate_disable 0x0 -# define TMC_tmodulate_enable 0x20000000 +# define TMC_tmodulate_disable 0x0 +# define TMC_tmodulate_enable 0x20000000 # define TMC_strans_MASK 0xbfffffff /* bit 30 */ -# define TMC_strans_disable 0x0 -# define TMC_strans_enable 0x40000000 +# define TMC_strans_disable 0x0 +# define TMC_strans_enable 0x40000000 # define TMC_itrans_MASK 0x7fffffff /* bit 31 */ -# define TMC_itrans_disable 0x0 -# define TMC_itrans_enable 0x80000000 +# define TMC_itrans_disable 0x0 +# define TMC_itrans_enable 0x80000000 #define MGAREG_TEXCTL2 0x2c3c # define TMC_decalblend_MASK 0xfffffffe /* bit 0 */ -# define TMC_decalblend_disable 0x0 -# define TMC_decalblend_enable 0x1 +# define TMC_decalblend_disable 0x0 +# define TMC_decalblend_enable 0x1 # define TMC_idecal_MASK 0xfffffffd /* bit 1 */ -# define TMC_idecal_disable 0x0 -# define TMC_idecal_enable 0x2 +# define TMC_idecal_disable 0x0 +# define TMC_idecal_enable 0x2 # define TMC_decaldis_MASK 0xfffffffb /* bit 2 */ -# define TMC_decaldis_disable 0x0 -# define TMC_decaldis_enable 0x4 +# define TMC_decaldis_disable 0x0 +# define TMC_decaldis_enable 0x4 # define TMC_ckstransdis_MASK 0xffffffef /* bit 4 */ -# define TMC_ckstransdis_disable 0x0 -# define TMC_ckstransdis_enable 0x10 +# define TMC_ckstransdis_disable 0x0 +# define TMC_ckstransdis_enable 0x10 # define TMC_borderen_MASK 0xffffffdf /* bit 5 */ -# define TMC_borderen_disable 0x0 -# define TMC_borderen_enable 0x20 +# define TMC_borderen_disable 0x0 +# define TMC_borderen_enable 0x20 # define TMC_specen_MASK 0xffffffbf /* bit 6 */ -# define TMC_specen_disable 0x0 -# define TMC_specen_enable 0x40 +# define TMC_specen_disable 0x0 +# define TMC_specen_enable 0x40 # define TMC_dualtex_MASK 0xffffff7f /* bit 7 */ -# define TMC_dualtex_disable 0x0 -# define TMC_dualtex_enable 0x80 +# define TMC_dualtex_disable 0x0 +# define TMC_dualtex_enable 0x80 # define TMC_tablefog_MASK 0xfffffeff /* bit 8 */ -# define TMC_tablefog_disable 0x0 -# define TMC_tablefog_enable 0x100 +# define TMC_tablefog_disable 0x0 +# define TMC_tablefog_enable 0x100 # define TMC_bumpmap_MASK 0xfffffdff /* bit 9 */ -# define TMC_bumpmap_disable 0x0 -# define TMC_bumpmap_enable 0x200 +# define TMC_bumpmap_disable 0x0 +# define TMC_bumpmap_enable 0x200 # define TMC_map1_MASK 0x7fffffff /* bit 31 */ -# define TMC_map1_disable 0x0 -# define TMC_map1_enable 0x80000000 +# define TMC_map1_disable 0x0 +# define TMC_map1_enable 0x80000000 #define MGAREG_TEXFILTER 0x2c58 @@ -1145,36 +1145,36 @@ # define TF_mapnbhigh_SHIFT 18 # define TF_mapnbhigh_MASK (~(1U << TF_mapnbhigh_SHIFT)) # define TF_avgstride_MASK 0xfff7ffff /* bit 19 */ -# define TF_avgstride_disable 0x0 -# define TF_avgstride_enable 0x80000 +# define TF_avgstride_disable 0x0 +# define TF_avgstride_enable 0x80000 # define TF_filteralpha_MASK 0xffefffff /* bit 20 */ -# define TF_filteralpha_disable 0x0 -# define TF_filteralpha_enable 0x100000 +# define TF_filteralpha_disable 0x0 +# define TF_filteralpha_enable 0x100000 # define TF_fthres_MASK 0xe01fffff /* bits 21-28 */ -# define TF_fthres_SHIFT 21 +# define TF_fthres_SHIFT 21 # define TF_mapnb_MASK 0x1fffffff /* bits 29-31 */ -# define TF_mapnb_SHIFT 29 +# define TF_mapnb_SHIFT 29 #define MGAREG_TEXHEIGHT 0x2c2c # define TH_th_MASK 0xffffffc0 /* bits 0-5 */ -# define TH_th_SHIFT 0 +# define TH_th_SHIFT 0 # define TH_rfh_MASK 0xffff81ff /* bits 9-14 */ -# define TH_rfh_SHIFT 9 +# define TH_rfh_SHIFT 9 # define TH_thmask_MASK 0xe003ffff /* bits 18-28 */ -# define TH_thmask_SHIFT 18 +# define TH_thmask_SHIFT 18 #define MGAREG_TEXORG 0x2c24 # define TO_texorgmap_MASK 0xfffffffe /* bit 0 */ -# define TO_texorgmap_fb 0x0 -# define TO_texorgmap_sys 0x1 +# define TO_texorgmap_fb 0x0 +# define TO_texorgmap_sys 0x1 # define TO_texorgacc_MASK 0xfffffffd /* bit 1 */ -# define TO_texorgacc_pci 0x0 -# define TO_texorgacc_agp 0x2 -# define TO_texorgoffsetsel 0x4 +# define TO_texorgacc_pci 0x0 +# define TO_texorgacc_agp 0x2 +# define TO_texorgoffsetsel 0x4 # define TO_texorg_MASK 0x1f /* bits 5-31 */ -# define TO_texorg_SHIFT 5 +# define TO_texorg_SHIFT 5 #define MGAREG_TEXORG1 0x2ca4 #define MGAREG_TEXORG2 0x2ca8 @@ -1183,25 +1183,25 @@ #define MGAREG_TEXTRANS 0x2c34 # define TT_tckey_MASK 0xffff0000 /* bits 0-15 */ -# define TT_tckey_SHIFT 0 +# define TT_tckey_SHIFT 0 # define TT_tkmask_MASK 0xffff /* bits 16-31 */ -# define TT_tkmask_SHIFT 16 +# define TT_tkmask_SHIFT 16 #define MGAREG_TEXTRANSHIGH 0x2c38 # define TT_tckeyh_MASK 0xffff0000 /* bits 0-15 */ -# define TT_tckeyh_SHIFT 0 +# define TT_tckeyh_SHIFT 0 # define TT_tkmaskh_MASK 0xffff /* bits 16-31 */ -# define TT_tkmaskh_SHIFT 16 +# define TT_tkmaskh_SHIFT 16 #define MGAREG_TEXWIDTH 0x2c28 # define TW_tw_MASK 0xffffffc0 /* bits 0-5 */ -# define TW_tw_SHIFT 0 +# define TW_tw_SHIFT 0 # define TW_rfw_MASK 0xffff81ff /* bits 9-14 */ -# define TW_rfw_SHIFT 9 +# define TW_rfw_SHIFT 9 # define TW_twmask_MASK 0xe003ffff /* bits 18-28 */ -# define TW_twmask_SHIFT 18 +# define TW_twmask_SHIFT 18 #define MGAREG_TMR0 0x2c00 #define MGAREG_TMR1 0x2c04 @@ -1218,67 +1218,67 @@ #define MGAREG_WACCEPTSEQ 0x1dd4 # define WAS_seqdst0_MASK 0xffffffc0 /* bits 0-5 */ -# define WAS_seqdst0_SHIFT 0 +# define WAS_seqdst0_SHIFT 0 # define WAS_seqdst1_MASK 0xfffff03f /* bits 6-11 */ -# define WAS_seqdst1_SHIFT 6 +# define WAS_seqdst1_SHIFT 6 # define WAS_seqdst2_MASK 0xfffc0fff /* bits 12-17 */ -# define WAS_seqdst2_SHIFT 12 +# define WAS_seqdst2_SHIFT 12 # define WAS_seqdst3_MASK 0xff03ffff /* bits 18-23 */ -# define WAS_seqdst3_SHIFT 18 +# define WAS_seqdst3_SHIFT 18 # define WAS_seqlen_MASK 0xfcffffff /* bits 24-25 */ # define WAS_wfirsttag_MASK 0xfbffffff /* bit 26 */ -# define WAS_wfirsttag_disable 0x0 -# define WAS_wfirsttag_enable 0x4000000 +# define WAS_wfirsttag_disable 0x0 +# define WAS_wfirsttag_enable 0x4000000 # define WAS_wsametag_MASK 0xf7ffffff /* bit 27 */ -# define WAS_wsametag_disable 0x0 -# define WAS_wsametag_enable 0x8000000 +# define WAS_wsametag_disable 0x0 +# define WAS_wsametag_enable 0x8000000 # define WAS_seqoff_MASK 0xefffffff /* bit 28 */ -# define WAS_seqoff_disable 0x0 -# define WAS_seqoff_enable 0x10000000 +# define WAS_seqoff_disable 0x0 +# define WAS_seqoff_enable 0x10000000 #define MGAREG_WCODEADDR 0x1e6c # define WMA_wcodeaddr_MASK 0xff /* bits 8-31 */ -# define WMA_wcodeaddr_SHIFT 8 +# define WMA_wcodeaddr_SHIFT 8 #define MGAREG_WFLAG 0x1dc4 # define WF_walustsflag_MASK 0xffffff00 /* bits 0-7 */ -# define WF_walustsflag_SHIFT 0 +# define WF_walustsflag_SHIFT 0 # define WF_walucfgflag_MASK 0xffff00ff /* bits 8-15 */ -# define WF_walucfgflag_SHIFT 8 +# define WF_walucfgflag_SHIFT 8 # define WF_wprgflag_MASK 0xffff /* bits 16-31 */ -# define WF_wprgflag_SHIFT 16 +# define WF_wprgflag_SHIFT 16 #define MGAREG_WFLAG1 0x1de0 # define WF1_walustsflag1_MASK 0xffffff00 /* bits 0-7 */ -# define WF1_walustsflag1_SHIFT 0 +# define WF1_walustsflag1_SHIFT 0 # define WF1_walucfgflag1_MASK 0xffff00ff /* bits 8-15 */ -# define WF1_walucfgflag1_SHIFT 8 +# define WF1_walucfgflag1_SHIFT 8 # define WF1_wprgflag1_MASK 0xffff /* bits 16-31 */ -# define WF1_wprgflag1_SHIFT 16 +# define WF1_wprgflag1_SHIFT 16 #define MGAREG_WFLAGNB 0x1e64 #define MGAREG_WFLAGNB1 0x1e08 #define MGAREG_WGETMSB 0x1dc8 # define WGV_wgetmsbmin_MASK 0xffffffe0 /* bits 0-4 */ -# define WGV_wgetmsbmin_SHIFT 0 +# define WGV_wgetmsbmin_SHIFT 0 # define WGV_wgetmsbmax_MASK 0xffffe0ff /* bits 8-12 */ -# define WGV_wgetmsbmax_SHIFT 8 +# define WGV_wgetmsbmax_SHIFT 8 # define WGV_wbrklefttop_MASK 0xfffeffff /* bit 16 */ -# define WGV_wbrklefttop_disable 0x0 -# define WGV_wbrklefttop_enable 0x10000 +# define WGV_wbrklefttop_disable 0x0 +# define WGV_wbrklefttop_enable 0x10000 # define WGV_wfastcrop_MASK 0xfffdffff /* bit 17 */ -# define WGV_wfastcrop_disable 0x0 -# define WGV_wfastcrop_enable 0x20000 +# define WGV_wfastcrop_disable 0x0 +# define WGV_wfastcrop_enable 0x20000 # define WGV_wcentersnap_MASK 0xfffbffff /* bit 18 */ -# define WGV_wcentersnap_disable 0x0 -# define WGV_wcentersnap_enable 0x40000 +# define WGV_wcentersnap_disable 0x0 +# define WGV_wcentersnap_enable 0x40000 # define WGV_wbrkrighttop_MASK 0xfff7ffff /* bit 19 */ -# define WGV_wbrkrighttop_disable 0x0 -# define WGV_wbrkrighttop_enable 0x80000 +# define WGV_wbrkrighttop_disable 0x0 +# define WGV_wbrkrighttop_enable 0x80000 #define MGAREG_WIADDR 0x1dc0 @@ -1288,10 +1288,10 @@ # define WIA_wmode_jump 0x2 /* val 2, shift 0 */ # define WIA_wmode_start 0x3 /* val 3, shift 0 */ # define WIA_wagp_MASK 0xfffffffb /* bit 2 */ -# define WIA_wagp_pci 0x0 -# define WIA_wagp_agp 0x4 +# define WIA_wagp_pci 0x0 +# define WIA_wagp_agp 0x4 # define WIA_wiaddr_MASK 0x7 /* bits 3-31 */ -# define WIA_wiaddr_SHIFT 3 +# define WIA_wiaddr_SHIFT 3 #define MGAREG_WIADDR2 0x1dd8 @@ -1301,10 +1301,10 @@ # define WIA2_wmode_jump 0x2 /* val 2, shift 0 */ # define WIA2_wmode_start 0x3 /* val 3, shift 0 */ # define WIA2_wagp_MASK 0xfffffffb /* bit 2 */ -# define WIA2_wagp_pci 0x0 -# define WIA2_wagp_agp 0x4 +# define WIA2_wagp_pci 0x0 +# define WIA2_wagp_agp 0x4 # define WIA2_wiaddr_MASK 0x7 /* bits 3-31 */ -# define WIA2_wiaddr_SHIFT 3 +# define WIA2_wiaddr_SHIFT 3 #define MGAREG_WIADDRNB 0x1e60 #define MGAREG_WIADDRNB1 0x1e04 @@ -1312,72 +1312,72 @@ #define MGAREG_WIMEMADDR 0x1e68 # define WIMA_wimemaddr_MASK 0xffffff00 /* bits 0-7 */ -# define WIMA_wimemaddr_SHIFT 0 +# define WIMA_wimemaddr_SHIFT 0 #define MGAREG_WIMEMDATA 0x2000 #define MGAREG_WIMEMDATA1 0x2100 #define MGAREG_WMISC 0x1e70 # define WM_wucodecache_MASK 0xfffffffe /* bit 0 */ -# define WM_wucodecache_disable 0x0 -# define WM_wucodecache_enable 0x1 +# define WM_wucodecache_disable 0x0 +# define WM_wucodecache_enable 0x1 # define WM_wmaster_MASK 0xfffffffd /* bit 1 */ -# define WM_wmaster_disable 0x0 -# define WM_wmaster_enable 0x2 +# define WM_wmaster_disable 0x0 +# define WM_wmaster_enable 0x2 # define WM_wcacheflush_MASK 0xfffffff7 /* bit 3 */ -# define WM_wcacheflush_disable 0x0 -# define WM_wcacheflush_enable 0x8 +# define WM_wcacheflush_disable 0x0 +# define WM_wcacheflush_enable 0x8 #define MGAREG_WR 0x2d00 #define MGAREG_WVRTXSZ 0x1dcc # define WVS_wvrtxsz_MASK 0xffffffc0 /* bits 0-5 */ -# define WVS_wvrtxsz_SHIFT 0 +# define WVS_wvrtxsz_SHIFT 0 # define WVS_primsz_MASK 0xffffc0ff /* bits 8-13 */ -# define WVS_primsz_SHIFT 8 +# define WVS_primsz_SHIFT 8 #define MGAREG_XDST 0x1cb0 #define MGAREG_XYEND 0x1c44 # define XYEA_x_end_MASK 0xffff0000 /* bits 0-15 */ -# define XYEA_x_end_SHIFT 0 +# define XYEA_x_end_SHIFT 0 # define XYEA_y_end_MASK 0xffff /* bits 16-31 */ -# define XYEA_y_end_SHIFT 16 +# define XYEA_y_end_SHIFT 16 #define MGAREG_XYSTRT 0x1c40 # define XYSA_x_start_MASK 0xffff0000 /* bits 0-15 */ -# define XYSA_x_start_SHIFT 0 +# define XYSA_x_start_SHIFT 0 # define XYSA_y_start_MASK 0xffff /* bits 16-31 */ -# define XYSA_y_start_SHIFT 16 +# define XYSA_y_start_SHIFT 16 #define MGAREG_YBOT 0x1c9c #define MGAREG_YDST 0x1c90 # define YA_ydst_MASK 0xff800000 /* bits 0-22 */ -# define YA_ydst_SHIFT 0 +# define YA_ydst_SHIFT 0 # define YA_sellin_MASK 0x1fffffff /* bits 29-31 */ -# define YA_sellin_SHIFT 29 +# define YA_sellin_SHIFT 29 #define MGAREG_YDSTLEN 0x1c88 # define YDL_length_MASK 0xffff0000 /* bits 0-15 */ -# define YDL_length_SHIFT 0 +# define YDL_length_SHIFT 0 # define YDL_yval_MASK 0xffff /* bits 16-31 */ -# define YDL_yval_SHIFT 16 +# define YDL_yval_SHIFT 16 #define MGAREG_YDSTORG 0x1c94 #define MGAREG_YTOP 0x1c98 #define MGAREG_ZORG 0x1c0c # define ZO_zorgmap_MASK 0xfffffffe /* bit 0 */ -# define ZO_zorgmap_fb 0x0 -# define ZO_zorgmap_sys 0x1 +# define ZO_zorgmap_fb 0x0 +# define ZO_zorgmap_sys 0x1 # define ZO_zorgacc_MASK 0xfffffffd /* bit 1 */ -# define ZO_zorgacc_pci 0x0 -# define ZO_zorgacc_agp 0x2 +# define ZO_zorgacc_pci 0x0 +# define ZO_zorgacc_agp 0x2 # define ZO_zorg_MASK 0x3 /* bits 2-31 */ -# define ZO_zorg_SHIFT 2 +# define ZO_zorg_SHIFT 2 diff --git a/src/mesa/drivers/dri/mga/mgarender.c b/src/mesa/drivers/dri/mga/mgarender.c index f10a91a..de53b14 100644 --- a/src/mesa/drivers/dri/mga/mgarender.c +++ b/src/mesa/drivers/dri/mga/mgarender.c @@ -95,7 +95,7 @@ static void mgaDmaPrimitive( struct gl_context *ctx, GLenum prim ) } -#define LOCAL_VARS mgaContextPtr mmesa = MGA_CONTEXT(ctx) +#define LOCAL_VARS mgaContextPtr mmesa = MGA_CONTEXT(ctx) #define INIT( prim ) do { \ if (0) fprintf(stderr, "%s\n", __FUNCTION__); \ FLUSH_BATCH(mmesa); \ @@ -113,7 +113,7 @@ static void mgaDmaPrimitive( struct gl_context *ctx, GLenum prim ) #define EMIT_VERTS( ctx, j, nr, buf ) \ mga_emit_contiguous_verts(ctx, j, (j)+(nr), buf) - + #define TAG(x) mga_##x #include "tnl_dd/t_dd_dmatmp.h" @@ -129,18 +129,18 @@ static GLboolean mga_run_render( struct gl_context *ctx, { mgaContextPtr mmesa = MGA_CONTEXT(ctx); TNLcontext *tnl = TNL_CONTEXT(ctx); - struct vertex_buffer *VB = &tnl->vb; + struct vertex_buffer *VB = &tnl->vb; GLuint i; /* Don't handle clipping or indexed vertices or vertex manipulations. */ - if (mmesa->RenderIndex != 0 || + if (mmesa->RenderIndex != 0 || !mga_validate_render( ctx, VB )) { return GL_TRUE; } - + tnl->Driver.Render.Start( ctx ); - mmesa->SetupNewInputs = ~0; + mmesa->SetupNewInputs = ~0; for (i = 0 ; i < VB->PrimitiveCount ; i++) { @@ -151,9 +151,9 @@ static GLboolean mga_run_render( struct gl_context *ctx, if (!length) continue; - mga_render_tab_verts[prim & PRIM_MODE_MASK]( ctx, start, start + length, + mga_render_tab_verts[prim & PRIM_MODE_MASK]( ctx, start, start + length, prim); - } + } tnl->Driver.Render.Finish( ctx ); @@ -161,10 +161,10 @@ static GLboolean mga_run_render( struct gl_context *ctx, } -const struct tnl_pipeline_stage _mga_render_stage = -{ +const struct tnl_pipeline_stage _mga_render_stage = +{ "mga render", - NULL, + NULL, NULL, NULL, NULL, diff --git a/src/mesa/drivers/dri/mga/mgaspan.c b/src/mesa/drivers/dri/mga/mgaspan.c index dd9a8d7..71b3393 100644 --- a/src/mesa/drivers/dri/mga/mgaspan.c +++ b/src/mesa/drivers/dri/mga/mgaspan.c @@ -62,7 +62,7 @@ dPriv->x * drb->cpp + \ dPriv->y * pitch) -#define LOCAL_STENCIL_VARS LOCAL_DEPTH_VARS +#define LOCAL_STENCIL_VARS LOCAL_DEPTH_VARS #define HW_LOCK() diff --git a/src/mesa/drivers/dri/mga/mgastate.c b/src/mesa/drivers/dri/mga/mgastate.c index 25d7de2..002687b 100644 --- a/src/mesa/drivers/dri/mga/mgastate.c +++ b/src/mesa/drivers/dri/mga/mgastate.c @@ -126,7 +126,7 @@ static void updateBlendLogicOp(struct gl_context *ctx) mmesa->hw.blend_func == (AC_src_src_alpha_sat | AC_dst_zero) ); } -static void mgaDDBlendEquationSeparate(struct gl_context *ctx, +static void mgaDDBlendEquationSeparate(struct gl_context *ctx, GLenum modeRGB, GLenum modeA) { assert( modeRGB == modeA ); @@ -277,11 +277,11 @@ static void mgaDDFogfv(struct gl_context *ctx, GLenum pname, const GLfloat *para mgaContextPtr mmesa = MGA_CONTEXT(ctx); if (pname == GL_FOG_COLOR) { - GLuint color = PACK_COLOR_888((GLubyte)(ctx->Fog.Color[0]*255.0F), - (GLubyte)(ctx->Fog.Color[1]*255.0F), + GLuint color = PACK_COLOR_888((GLubyte)(ctx->Fog.Color[0]*255.0F), + (GLubyte)(ctx->Fog.Color[1]*255.0F), (GLubyte)(ctx->Fog.Color[2]*255.0F)); - MGA_STATECHANGE(mmesa, MGA_UPLOAD_CONTEXT); + MGA_STATECHANGE(mmesa, MGA_UPLOAD_CONTEXT); mmesa->setup.fogcolor = color; } } @@ -343,8 +343,8 @@ static void mgaDDCullFaceFrontFace(struct gl_context *ctx, GLenum unused) mgaContextPtr mmesa = MGA_CONTEXT(ctx); MGA_STATECHANGE( mmesa, MGA_UPLOAD_CONTEXT ); - if (ctx->Polygon.CullFlag && - ctx->Polygon.CullFaceMode != GL_FRONT_AND_BACK) + if (ctx->Polygon.CullFlag && + ctx->Polygon.CullFaceMode != GL_FRONT_AND_BACK) { mmesa->hw.cull = _CULL_NEGATIVE; @@ -368,8 +368,8 @@ static void mgaDDCullFaceFrontFace(struct gl_context *ctx, GLenum unused) * Masks */ -static void mgaDDColorMask(struct gl_context *ctx, - GLboolean r, GLboolean g, +static void mgaDDColorMask(struct gl_context *ctx, + GLboolean r, GLboolean g, GLboolean b, GLboolean a ) { mgaContextPtr mmesa = MGA_CONTEXT( ctx ); @@ -385,7 +385,7 @@ static void mgaDDColorMask(struct gl_context *ctx, if (mmesa->setup.plnwt != mask) { MGA_STATECHANGE( mmesa, MGA_UPLOAD_CONTEXT ); - mmesa->setup.plnwt = mask; + mmesa->setup.plnwt = mask; } } @@ -427,7 +427,7 @@ static void mgaDDPolygonStipple( struct gl_context *ctx, const GLubyte *mask ) const GLubyte *m = mask; GLubyte p[4]; int i,j,k; - int active = (ctx->Polygon.StippleFlag && + int active = (ctx->Polygon.StippleFlag && mmesa->raster_primitive == GL_TRIANGLES); GLuint stipple; @@ -462,7 +462,7 @@ static void mgaDDPolygonStipple( struct gl_context *ctx, const GLubyte *mask ) mmesa->haveHwStipple = 1; break; } - + if (active) { mmesa->setup.dwgctl &= ~(0xf<<20); mmesa->setup.dwgctl |= mmesa->poly_stipple; @@ -666,7 +666,7 @@ mgaDDStencilOpSeparate(struct gl_context *ctx, GLenum face, GLenum fail, GLenum } MGA_STATECHANGE( mmesa, MGA_UPLOAD_CONTEXT ); - mmesa->hw.stencilctl &= (SC_sfailop_MASK & SC_szfailop_MASK + mmesa->hw.stencilctl &= (SC_sfailop_MASK & SC_szfailop_MASK & SC_szpassop_MASK); mmesa->hw.stencilctl |= stencilctl; } @@ -694,14 +694,14 @@ void mgaCalcViewport( struct gl_context *ctx ) mmesa->SetupNewInputs = ~0; } -static void mgaViewport( struct gl_context *ctx, - GLint x, GLint y, +static void mgaViewport( struct gl_context *ctx, + GLint x, GLint y, GLsizei width, GLsizei height ) { mgaCalcViewport( ctx ); } -static void mgaDepthRange( struct gl_context *ctx, +static void mgaDepthRange( struct gl_context *ctx, GLclampd nearval, GLclampd farval ) { mgaCalcViewport( ctx ); @@ -712,7 +712,7 @@ static void mgaDepthRange( struct gl_context *ctx, * Miscellaneous */ -static void mgaDDClearColor(struct gl_context *ctx, +static void mgaDDClearColor(struct gl_context *ctx, const GLfloat color[4] ) { mgaContextPtr mmesa = MGA_CONTEXT(ctx); @@ -777,7 +777,7 @@ void mgaUpdateRects( mgaContextPtr mmesa, GLuint buffers ) __DRIdrawable *const driDrawable = mmesa->driDrawable; __DRIdrawable *const driReadable = mmesa->driReadable; - mmesa->dirty_cliprects = 0; + mmesa->dirty_cliprects = 0; driUpdateFramebufferSize(mmesa->glCtx, driDrawable); if (driDrawable != driReadable) { @@ -869,7 +869,7 @@ static void mgaDDEnable(struct gl_context *ctx, GLenum cap, GLboolean state) case GL_FOG: MGA_STATECHANGE( mmesa, MGA_UPLOAD_CONTEXT ); - if (ctx->Fog.Enabled) + if (ctx->Fog.Enabled) mmesa->setup.maccess |= MA_fogen_enable; else mmesa->setup.maccess &= ~MA_fogen_enable; @@ -949,7 +949,7 @@ void mgaEmitHwStateLocked( mgaContextPtr mmesa ) } } - mmesa->setup.stencil = mmesa->hw.stencil + mmesa->setup.stencil = mmesa->hw.stencil & mmesa->hw.stencil_enable; mmesa->setup.stencilctl = mmesa->hw.stencilctl & mmesa->hw.stencil_enable; @@ -967,7 +967,7 @@ void mgaEmitHwStateLocked( mgaContextPtr mmesa ) mmesa->setup.alphactrl &= AC_src_MASK & AC_dst_MASK & AC_atmode_MASK & AC_atref_MASK & AC_alphasel_MASK; - mmesa->setup.alphactrl |= + mmesa->setup.alphactrl |= (mmesa->hw.alpha_func & mmesa->hw.alpha_func_enable) | (mmesa->hw.blend_func & mmesa->hw.blend_func_enable) | ((AC_src_one | AC_dst_zero) & ~mmesa->hw.blend_func_enable) | @@ -1120,7 +1120,7 @@ void mgaInitState( mgaContextPtr mmesa ) mmesa->hw.zmode = DC_zmode_zlt | DC_atype_zi; mmesa->hw.stencil = MGA_FIELD( S_sref, 0x00) | MGA_FIELD( S_smsk, 0xff ) | MGA_FIELD( S_swtmsk, 0xff ); - mmesa->hw.stencilctl = SC_smode_salways | SC_sfailop_keep + mmesa->hw.stencilctl = SC_smode_salways | SC_sfailop_keep | SC_szfailop_keep | SC_szpassop_keep; mmesa->hw.stencil_enable = 0; mmesa->hw.cull = _CULL_DISABLE; diff --git a/src/mesa/drivers/dri/mga/mgatex.c b/src/mesa/drivers/dri/mga/mgatex.c index 11ab9b6..12658e7 100644 --- a/src/mesa/drivers/dri/mga/mgatex.c +++ b/src/mesa/drivers/dri/mga/mgatex.c @@ -47,13 +47,13 @@ /** * Set the texture wrap modes. * Currently \c GL_REPEAT, \c GL_CLAMP and \c GL_CLAMP_TO_EDGE are supported. - * + * * \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 */ -static void +static void mgaSetTexWrapping( mgaTextureObjectPtr t, GLenum swrap, GLenum twrap ) { GLboolean is_clamp = GL_FALSE; @@ -102,7 +102,7 @@ mgaSetTexWrapping( mgaTextureObjectPtr t, GLenum swrap, GLenum twrap ) /** * 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 @@ -367,7 +367,7 @@ static void mgaTexImage2D( struct gl_context *ctx, GLenum target, GLint level, if ( t != NULL ) { driSwapOutTextureObject( t ); - } + } else { t = (driTextureObject *) mgaAllocTexObj( texObj ); if ( t == NULL ) { @@ -384,9 +384,9 @@ static void mgaTexImage2D( struct gl_context *ctx, GLenum target, GLint level, t->dirty_images[0] |= (1UL << level); } -static void mgaTexSubImage2D( struct gl_context *ctx, +static void mgaTexSubImage2D( struct gl_context *ctx, GLenum target, - GLint level, + GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, @@ -400,7 +400,7 @@ static void mgaTexSubImage2D( struct gl_context *ctx, assert( t ); /* this _should_ be true */ if ( t != NULL ) { driSwapOutTextureObject( t ); - } + } else { t = (driTextureObject *) mgaAllocTexObj( texObj ); if ( t == NULL ) { @@ -409,7 +409,7 @@ static void mgaTexSubImage2D( struct gl_context *ctx, } } - _mesa_store_texsubimage2d(ctx, target, level, xoffset, yoffset, width, + _mesa_store_texsubimage2d(ctx, target, level, xoffset, yoffset, width, height, format, type, pixels, packing, texObj, texImage); level -= t->firstLevel; @@ -433,7 +433,7 @@ mgaTexParameter( struct gl_context *ctx, GLenum target, /* If we don't have a hardware texture, it will be automatically * created with current state before it is used, so we don't have - * to do anything now + * to do anything now */ if ( (t == NULL) || (target != GL_TEXTURE_2D && diff --git a/src/mesa/drivers/dri/mga/mgatexmem.c b/src/mesa/drivers/dri/mga/mgatexmem.c index 58afbbb..c9b1f35 100644 --- a/src/mesa/drivers/dri/mga/mgatexmem.c +++ b/src/mesa/drivers/dri/mga/mgatexmem.c @@ -51,7 +51,7 @@ mgaDestroyTexObj( mgaContextPtr mmesa, mgaTextureObjectPtr t ) */ if ( mmesa != NULL ) - { + { if ( t->age > mmesa->dirtyAge ) mmesa->dirtyAge = t->age; @@ -72,14 +72,14 @@ mgaDestroyTexObj( mgaContextPtr mmesa, mgaTextureObjectPtr t ) * updates. * * Performed with the hardware lock held. - * + * * Even though this function is named "upload subimage," the entire image * is uploaded. - * + * * \param mmesa Driver context. * \param t Texture to be uploaded. * \param hwlevel Mipmap level of the texture to be uploaded. - * + * * \bug As mentioned above, this fuction actually copies the entier mipmap * level. There should be a version of this function that performs * sub-rectangle uploads. This will perform quite a bit better if only @@ -97,8 +97,8 @@ static void mgaUploadSubImage( mgaContextPtr mmesa, const int level = hwlevel + t->base.firstLevel; - if ( (hwlevel < 0) - || (hwlevel >= (MGA_IS_G200(mmesa) + if ( (hwlevel < 0) + || (hwlevel >= (MGA_IS_G200(mmesa) ? G200_TEX_MAXLEVELS : G400_TEX_MAXLEVELS)) ) { fprintf( stderr, "[%s:%d] level = %d\n", __FILE__, __LINE__, level ); return; @@ -177,7 +177,7 @@ static void mgaUploadSubImage( mgaContextPtr mmesa, /* This works, is slower for uploads to card space and needs * additional synchronization with the dma stream. */ - + UPDATE_LOCK(mmesa, DRM_LOCK_FLUSH | DRM_LOCK_QUIESCENT); memcpy( mmesa->mgaScreen->texVirtual[t->base.heap->heapId] + offset, @@ -186,7 +186,7 @@ static void mgaUploadSubImage( mgaContextPtr mmesa, if ( MGA_DEBUG & DEBUG_VERBOSE_TEXTURE ) fprintf(stderr, "[%s:%d] address/size = 0x%08lx/%d\n", __FILE__, __LINE__, - (long) (mmesa->mgaScreen->texVirtual[t->base.heap->heapId] + (long) (mmesa->mgaScreen->texVirtual[t->base.heap->heapId] + offset), length); } @@ -196,7 +196,7 @@ static void mgaUploadSubImage( mgaContextPtr mmesa, /** * Upload the texture images associated with texture \a t. This might * require the allocation of texture memory. - * + * * \param mmesa Context pointer * \param t Texture to be uploaded */ diff --git a/src/mesa/drivers/dri/mga/mgatris.c b/src/mesa/drivers/dri/mga/mgatris.c index 7b06774..22857c3 100644 --- a/src/mesa/drivers/dri/mga/mgatris.c +++ b/src/mesa/drivers/dri/mga/mgatris.c @@ -108,7 +108,7 @@ static INLINE void mga_draw_point( mgaContextPtr mmesa, const int vertex_size = mmesa->vertex_size; GLuint *vb = mgaAllocDmaLow( mmesa, 6 * 4 * vertex_size ); int j; - + #if 0 v0->v.x += PNT_X_OFFSET - TRI_X_OFFSET; v0->v.y += PNT_Y_OFFSET - TRI_Y_OFFSET; @@ -118,37 +118,37 @@ static INLINE void mga_draw_point( mgaContextPtr mmesa, */ *(float *)&vb[0] = tmp->v.x - sz; *(float *)&vb[1] = tmp->v.y - sz; - for (j = 2 ; j < vertex_size ; j++) + for (j = 2 ; j < vertex_size ; j++) vb[j] = tmp->ui[j]; vb += vertex_size; *(float *)&vb[0] = tmp->v.x + sz; *(float *)&vb[1] = tmp->v.y - sz; - for (j = 2 ; j < vertex_size ; j++) + for (j = 2 ; j < vertex_size ; j++) vb[j] = tmp->ui[j]; vb += vertex_size; *(float *)&vb[0] = tmp->v.x + sz; *(float *)&vb[1] = tmp->v.y + sz; - for (j = 2 ; j < vertex_size ; j++) + for (j = 2 ; j < vertex_size ; j++) vb[j] = tmp->ui[j]; vb += vertex_size; *(float *)&vb[0] = tmp->v.x + sz; *(float *)&vb[1] = tmp->v.y + sz; - for (j = 2 ; j < vertex_size ; j++) + for (j = 2 ; j < vertex_size ; j++) vb[j] = tmp->ui[j]; vb += vertex_size; *(float *)&vb[0] = tmp->v.x - sz; *(float *)&vb[1] = tmp->v.y + sz; - for (j = 2 ; j < vertex_size ; j++) + for (j = 2 ; j < vertex_size ; j++) vb[j] = tmp->ui[j]; vb += vertex_size; *(float *)&vb[0] = tmp->v.x - sz; *(float *)&vb[1] = tmp->v.y - sz; - for (j = 2 ; j < vertex_size ; j++) + for (j = 2 ; j < vertex_size ; j++) vb[j] = tmp->ui[j]; #if 0 @@ -179,7 +179,7 @@ static INLINE void mga_draw_line( mgaContextPtr mmesa, dx = v0->v.x - v1->v.x; dy = v0->v.y - v1->v.y; - + ix = width * .5; iy = 0; if (dx * dx > dy * dy) { iy = ix; ix = 0; @@ -187,37 +187,37 @@ static INLINE void mga_draw_line( mgaContextPtr mmesa, *(float *)&vb[0] = v0->v.x - ix; *(float *)&vb[1] = v0->v.y - iy; - for (j = 2 ; j < vertex_size ; j++) + for (j = 2 ; j < vertex_size ; j++) vb[j] = v0->ui[j]; vb += vertex_size; *(float *)&vb[0] = v1->v.x + ix; *(float *)&vb[1] = v1->v.y + iy; - for (j = 2 ; j < vertex_size ; j++) + for (j = 2 ; j < vertex_size ; j++) vb[j] = v1->ui[j]; vb += vertex_size; *(float *)&vb[0] = v0->v.x + ix; *(float *)&vb[1] = v0->v.y + iy; - for (j = 2 ; j < vertex_size ; j++) + for (j = 2 ; j < vertex_size ; j++) vb[j] = v0->ui[j]; vb += vertex_size; - + *(float *)&vb[0] = v0->v.x - ix; *(float *)&vb[1] = v0->v.y - iy; - for (j = 2 ; j < vertex_size ; j++) + for (j = 2 ; j < vertex_size ; j++) vb[j] = v0->ui[j]; vb += vertex_size; *(float *)&vb[0] = v1->v.x - ix; *(float *)&vb[1] = v1->v.y - iy; - for (j = 2 ; j < vertex_size ; j++) + for (j = 2 ; j < vertex_size ; j++) vb[j] = v1->ui[j]; vb += vertex_size; *(float *)&vb[0] = v1->v.x + ix; *(float *)&vb[1] = v1->v.y + iy; - for (j = 2 ; j < vertex_size ; j++) + for (j = 2 ; j < vertex_size ; j++) vb[j] = v1->ui[j]; vb += vertex_size; @@ -276,13 +276,13 @@ do { \ /* This code is hit only when a mix of accelerated and unaccelerated * primitives are being drawn, and only for the unaccelerated - * primitives. + * primitives. */ -static void -mga_fallback_tri( mgaContextPtr mmesa, - mgaVertex *v0, - mgaVertex *v1, +static void +mga_fallback_tri( mgaContextPtr mmesa, + mgaVertex *v0, + mgaVertex *v1, mgaVertex *v2 ) { struct gl_context *ctx = mmesa->glCtx; @@ -294,7 +294,7 @@ mga_fallback_tri( mgaContextPtr mmesa, } -static void +static void mga_fallback_line( mgaContextPtr mmesa, mgaVertex *v0, mgaVertex *v1 ) @@ -307,8 +307,8 @@ mga_fallback_line( mgaContextPtr mmesa, } -static void -mga_fallback_point( mgaContextPtr mmesa, +static void +mga_fallback_point( mgaContextPtr mmesa, mgaVertex *v0 ) { struct gl_context *ctx = mmesa->glCtx; @@ -611,8 +611,8 @@ static void init_rast_tab( void ) const GLuint vertex_size = mmesa->vertex_size; \ const GLuint * const elt = TNL_CONTEXT(ctx)->vb.Elts; \ (void) elt; -#define RESET_STIPPLE -#define RESET_OCCLUSION +#define RESET_STIPPLE +#define RESET_OCCLUSION #define PRESERVE_VB_DEFS #define ELT(x) x #define TAG(x) mga_##x##_verts @@ -637,7 +637,7 @@ static void mgaRenderClippedPoly( struct gl_context *ctx, const GLuint *elts, GL struct vertex_buffer *VB = &tnl->vb; GLuint prim = mmesa->render_primitive; - /* Render the new vertices as an unclipped polygon. + /* Render the new vertices as an unclipped polygon. */ { GLuint *tmp = VB->Elts; @@ -658,13 +658,13 @@ static void mgaRenderClippedLine( struct gl_context *ctx, GLuint ii, GLuint jj ) tnl->Driver.Render.Line( ctx, ii, jj ); } -static void mgaFastRenderClippedPoly( struct gl_context *ctx, const GLuint *elts, +static void mgaFastRenderClippedPoly( struct gl_context *ctx, const GLuint *elts, GLuint n ) { mgaContextPtr mmesa = MGA_CONTEXT( ctx ); GLuint vertex_size = mmesa->vertex_size; GLuint *vb = mgaAllocDmaLow( mmesa, (n-2) * 3 * 4 * vertex_size ); - GLubyte *vertptr = (GLubyte *)mmesa->verts; + GLubyte *vertptr = (GLubyte *)mmesa->verts; const GLuint *start = (const GLuint *)VERT(elts[0]); int i,j; @@ -710,15 +710,15 @@ void mgaChooseRenderState(struct gl_context *ctx) */ if (flags & ANY_FALLBACK_FLAGS) { - if (flags & POINT_FALLBACK) + if (flags & POINT_FALLBACK) mmesa->draw_point = mga_fallback_point; - - if (flags & LINE_FALLBACK) + + if (flags & LINE_FALLBACK) mmesa->draw_line = mga_fallback_line; - - if (flags & TRI_FALLBACK) + + if (flags & TRI_FALLBACK) mmesa->draw_tri = mga_fallback_tri; - + index |= MGA_FALLBACK_BIT; } @@ -735,7 +735,7 @@ void mgaChooseRenderState(struct gl_context *ctx) tnl->Driver.Render.Line = rast_tab[index].line; tnl->Driver.Render.Triangle = rast_tab[index].triangle; tnl->Driver.Render.Quad = rast_tab[index].quad; - + if (index == 0) { tnl->Driver.Render.PrimTabVerts = mga_render_tab_verts; tnl->Driver.Render.PrimTabElts = mga_render_tab_elts; @@ -798,7 +798,7 @@ void mgaRasterPrimitive( struct gl_context *ctx, GLenum prim, GLuint hwprim ) -/* Determine the rasterized primitive when not drawing unfilled +/* Determine the rasterized primitive when not drawing unfilled * polygons. * * Used only for the default render stage which always decomposes @@ -815,7 +815,7 @@ static void mgaRenderPrimitive( struct gl_context *ctx, GLenum prim ) if (rprim == GL_TRIANGLES && (ctx->_TriangleCaps & DD_TRI_UNFILLED)) return; - + if (mmesa->raster_primitive != rprim) { mgaRasterPrimitive( ctx, rprim, MGA_WA_TRIANGLES ); } @@ -904,9 +904,9 @@ void mgaDDInitTriFuncs( struct gl_context *ctx ) } mmesa->RenderIndex = ~0; - + tnl->Driver.Render.Start = mgaCheckTexSizes; - tnl->Driver.Render.Finish = mgaRenderFinish; + tnl->Driver.Render.Finish = mgaRenderFinish; tnl->Driver.Render.PrimitiveNotify = mgaRenderPrimitive; tnl->Driver.Render.ResetLineStipple = _swrast_ResetLineStipple; tnl->Driver.Render.BuildVertices = mgaBuildVertices; diff --git a/src/mesa/drivers/dri/mga/mgavb.c b/src/mesa/drivers/dri/mga/mgavb.c index f098aa5..def6faf 100644 --- a/src/mesa/drivers/dri/mga/mgavb.c +++ b/src/mesa/drivers/dri/mga/mgavb.c @@ -43,7 +43,7 @@ #define MGA_TEX1_BIT 0x1 -#define MGA_TEX0_BIT 0x2 +#define MGA_TEX0_BIT 0x2 #define MGA_RGBA_BIT 0x4 #define MGA_SPEC_BIT 0x8 #define MGA_FOG_BIT 0x10 @@ -80,7 +80,7 @@ static struct { #define DO_TEX3 0 #define DO_PTEX (IND & MGA_PTEX_BIT) - + #define VERTEX mgaVertex #define VERTEX_COLOR mga_color_t #define LOCALVARS mgaContextPtr mmesa = MGA_CONTEXT(ctx); @@ -307,7 +307,7 @@ void mgaPrintSetupFlags(char *msg, GLuint flags ) fprintf(stderr, "%s: %d %s%s%s%s%s%s\n", msg, (int)flags, - (flags & MGA_XYZW_BIT) ? " xyzw," : "", + (flags & MGA_XYZW_BIT) ? " xyzw," : "", (flags & MGA_RGBA_BIT) ? " rgba," : "", (flags & MGA_SPEC_BIT) ? " spec," : "", (flags & MGA_FOG_BIT) ? " fog," : "", @@ -339,8 +339,8 @@ void mgaCheckTexSizes( struct gl_context *ctx ) } -void mgaBuildVertices( struct gl_context *ctx, - GLuint start, +void mgaBuildVertices( struct gl_context *ctx, + GLuint start, GLuint count, GLuint newinputs ) { @@ -355,17 +355,17 @@ void mgaBuildVertices( struct gl_context *ctx, return; if (newinputs & VERT_BIT_POS) { - setup_tab[mmesa->SetupIndex].emit( ctx, start, count, v, stride ); + setup_tab[mmesa->SetupIndex].emit( ctx, start, count, v, stride ); } else { GLuint ind = 0; if (newinputs & VERT_BIT_COLOR0) ind |= MGA_RGBA_BIT; - + if (newinputs & VERT_BIT_COLOR1) ind |= MGA_SPEC_BIT; - if (newinputs & VERT_BIT_TEX0) + if (newinputs & VERT_BIT_TEX0) ind |= MGA_TEX0_BIT; if (newinputs & VERT_BIT_TEX1) @@ -380,7 +380,7 @@ void mgaBuildVertices( struct gl_context *ctx, ind &= mmesa->SetupIndex; if (ind) { - setup_tab[ind].emit( ctx, start, count, v, stride ); + setup_tab[ind].emit( ctx, start, count, v, stride ); } } } @@ -392,12 +392,12 @@ void mgaChooseVertexState( struct gl_context *ctx ) TNLcontext *tnl = TNL_CONTEXT(ctx); GLuint ind = MGA_XYZW_BIT|MGA_RGBA_BIT; - if (ctx->_TriangleCaps & DD_SEPARATE_SPECULAR) + if (ctx->_TriangleCaps & DD_SEPARATE_SPECULAR) ind |= MGA_SPEC_BIT; - if (ctx->Fog.Enabled) + if (ctx->Fog.Enabled) ind |= MGA_FOG_BIT; - + if (ctx->Texture._EnabledUnits & 0x2) { /* unit 1 enabled */ if (ctx->Texture._EnabledUnits & 0x1) { @@ -412,7 +412,7 @@ void mgaChooseVertexState( struct gl_context *ctx ) /* unit 0 enabled */ ind |= MGA_TEX0_BIT; } - + mmesa->SetupIndex = ind; if (ctx->_TriangleCaps & (DD_TRI_LIGHT_TWOSIDE|DD_TRI_UNFILLED)) { @@ -424,7 +424,7 @@ void mgaChooseVertexState( struct gl_context *ctx ) } if (setup_tab[ind].vertex_format != mmesa->vertex_format) { - FLUSH_BATCH(mmesa); + FLUSH_BATCH(mmesa); mmesa->dirty |= MGA_UPLOAD_PIPE; mmesa->vertex_format = setup_tab[ind].vertex_format; mmesa->vertex_size = setup_tab[ind].vertex_size; @@ -443,7 +443,7 @@ void *mga_emit_contiguous_verts( struct gl_context *ctx, setup_tab[mmesa->SetupIndex].emit( ctx, start, count, dest, stride ); return (void *)((char *)dest + stride * (count - start)); } - + void mgaInitVB( struct gl_context *ctx ) diff --git a/src/mesa/drivers/dri/mga/mgavb.h b/src/mesa/drivers/dri/mga/mgavb.h index 20e5d8b..28d57c0 100644 --- a/src/mesa/drivers/dri/mga/mgavb.h +++ b/src/mesa/drivers/dri/mga/mgavb.h @@ -41,8 +41,8 @@ extern void mgaChooseVertexState( struct gl_context *ctx ); extern void mgaCheckTexSizes( struct gl_context *ctx ); -extern void mgaBuildVertices( struct gl_context *ctx, - GLuint start, +extern void mgaBuildVertices( struct gl_context *ctx, + GLuint start, GLuint count, GLuint newinputs ); @@ -56,8 +56,8 @@ extern void *mga_emit_contiguous_verts( struct gl_context *ctx, GLuint count, void *dest ); -extern void mga_translate_vertex(struct gl_context *ctx, - const mgaVertex *src, +extern void mga_translate_vertex(struct gl_context *ctx, + const mgaVertex *src, SWvertex *dst); extern void mga_print_vertex( struct gl_context *ctx, const mgaVertex *v ); diff --git a/src/mesa/drivers/dri/mga/server/mga_macros.h b/src/mesa/drivers/dri/mga/server/mga_macros.h index 189e141..281b5b9 100644 --- a/src/mesa/drivers/dri/mga/server/mga_macros.h +++ b/src/mesa/drivers/dri/mga/server/mga_macros.h @@ -95,7 +95,7 @@ while(INREG(MGAREG_DWGSYNC) != MGA_SYNC_XTAG) ; \ (pMga->Chipset == PCI_CHIP_MGAG200) || \ (pMga->Chipset == PCI_CHIP_MGAG400) || \ (pMga->Chipset == PCI_CHIP_MGAG550)) - + #define MGA_HAL(x) { \ MGAPtr pMga = MGAPTR(pScrn); \ if (pMga->HALLoaded && HAL_CHIPSETS) { x; } \ diff --git a/src/mesa/drivers/dri/r128/Makefile b/src/mesa/drivers/dri/r128/Makefile index 8144c9b..080ab4b 100644 --- a/src/mesa/drivers/dri/r128/Makefile +++ b/src/mesa/drivers/dri/r128/Makefile @@ -20,9 +20,9 @@ DRIVER_SOURCES = \ C_SOURCES = \ $(COMMON_SOURCES) \ - $(DRIVER_SOURCES) + $(DRIVER_SOURCES) -ASM_SOURCES = +ASM_SOURCES = include ../Makefile.template diff --git a/src/mesa/drivers/dri/r128/r128_context.c b/src/mesa/drivers/dri/r128/r128_context.c index 2741080..e60dc39 100644 --- a/src/mesa/drivers/dri/r128/r128_context.c +++ b/src/mesa/drivers/dri/r128/r128_context.c @@ -126,7 +126,7 @@ GLboolean r128CreateContext( gl_api api, /* Allocate the Mesa context */ if (sharedContextPrivate) shareCtx = ((r128ContextPtr) sharedContextPrivate)->glCtx; - else + else shareCtx = NULL; rmesa->glCtx = _mesa_create_context(glVisual, shareCtx, &functions, (void *) rmesa); diff --git a/src/mesa/drivers/dri/r128/r128_context.h b/src/mesa/drivers/dri/r128/r128_context.h index 0a06c43..de090ea 100644 --- a/src/mesa/drivers/dri/r128/r128_context.h +++ b/src/mesa/drivers/dri/r128/r128_context.h @@ -99,12 +99,12 @@ typedef struct r128_context *r128ContextPtr; #define SUBPIXEL_Y (0.125F) -typedef void (*r128_tri_func)( r128ContextPtr, +typedef void (*r128_tri_func)( r128ContextPtr, r128Vertex *, r128Vertex *, r128Vertex * ); -typedef void (*r128_line_func)( r128ContextPtr, +typedef void (*r128_line_func)( r128ContextPtr, r128Vertex *, r128Vertex * ); @@ -158,8 +158,8 @@ struct r128_context { r128TexObjPtr CurrentTexObj[2]; int texture_depth; - - /* Fallback rasterization functions + + /* Fallback rasterization functions */ r128_point_func draw_point; r128_line_func draw_line; diff --git a/src/mesa/drivers/dri/r128/r128_ioctl.c b/src/mesa/drivers/dri/r128/r128_ioctl.c index 950e1d4..37b98e7 100644 --- a/src/mesa/drivers/dri/r128/r128_ioctl.c +++ b/src/mesa/drivers/dri/r128/r128_ioctl.c @@ -195,7 +195,7 @@ void r128FireBlitLocked( r128ContextPtr rmesa, drmBufPtr buffer, blit.width = width; blit.height = height; - ret = drmCommandWrite( rmesa->driFd, DRM_R128_BLIT, + ret = drmCommandWrite( rmesa->driFd, DRM_R128_BLIT, &blit, sizeof(blit) ); if ( ret ) { diff --git a/src/mesa/drivers/dri/r128/r128_ioctl.h b/src/mesa/drivers/dri/r128/r128_ioctl.h index 84ace90..9787598 100644 --- a/src/mesa/drivers/dri/r128/r128_ioctl.h +++ b/src/mesa/drivers/dri/r128/r128_ioctl.h @@ -64,7 +64,7 @@ static INLINE void *r128AllocDmaLow( r128ContextPtr rmesa, int count, head = (uint32_t *)((char *)rmesa->vert_buf->address + rmesa->vert_buf->used); rmesa->vert_buf->used += bytes; rmesa->num_verts += count; - + return head; } diff --git a/src/mesa/drivers/dri/r128/r128_screen.c b/src/mesa/drivers/dri/r128/r128_screen.c index bbcb6ee..64778cf 100644 --- a/src/mesa/drivers/dri/r128/r128_screen.c +++ b/src/mesa/drivers/dri/r128/r128_screen.c @@ -114,7 +114,7 @@ r128CreateScreen( __DRIscreen *sPriv ) */ r128Screen->IsPCI = r128DRIPriv->IsPCI; r128Screen->sarea_priv_offset = r128DRIPriv->sarea_priv_offset; - + if (sPriv->drm_version.minor >= 3) { drm_r128_getparam_t gp; int ret; @@ -422,7 +422,7 @@ r128FillInModes( __DRIscreen *psp, depth_bits_array[0] = depth_bits; depth_bits_array[1] = depth_bits; - + /* Just like with the accumulation buffer, always provide some modes * with a stencil buffer. It will be a sw fallback, but some apps won't * care about that. @@ -470,7 +470,7 @@ r128FillInModes( __DRIscreen *psp, /** * This is the driver specific part of the createNewScreen entry point. - * + * * \todo maybe fold this into intelInitDriver * * \return the struct gl_config supported by this driver diff --git a/src/mesa/drivers/dri/r128/r128_state.c b/src/mesa/drivers/dri/r128/r128_state.c index 4a49e8f..6be6ee3 100644 --- a/src/mesa/drivers/dri/r128/r128_state.c +++ b/src/mesa/drivers/dri/r128/r128_state.c @@ -58,7 +58,7 @@ USE OR OTHER DEALINGS IN THE SOFTWARE. /** * Calculate the hardware blend factor setting. This same function is used - * for source and destination of both alpha and RGB. + * for source and destination of both alpha and RGB. * * \returns * The hardware register value for the specified blend factor. This value @@ -120,7 +120,7 @@ static int blend_factor( r128ContextPtr rmesa, GLenum factor, GLboolean is_src ) func = (is_src) ? R128_ALPHA_BLEND_ONE : R128_ALPHA_BLEND_ZERO; break; } - + return func; } @@ -178,9 +178,9 @@ static void r128UpdateAlphaMode( struct gl_context *ctx ) (R128_ALPHA_BLEND_MASK << R128_ALPHA_BLEND_DST_SHIFT) | R128_ALPHA_COMB_FCN_MASK); - a |= blend_factor( rmesa, ctx->Color.BlendSrcRGB, GL_TRUE ) + a |= blend_factor( rmesa, ctx->Color.BlendSrcRGB, GL_TRUE ) << R128_ALPHA_BLEND_SRC_SHIFT; - a |= blend_factor( rmesa, ctx->Color.BlendDstRGB, GL_FALSE ) + a |= blend_factor( rmesa, ctx->Color.BlendDstRGB, GL_FALSE ) << R128_ALPHA_BLEND_DST_SHIFT; switch (ctx->Color.BlendEquationRGB) { @@ -217,7 +217,7 @@ static void r128DDAlphaFunc( struct gl_context *ctx, GLenum func, GLfloat ref ) rmesa->new_state |= R128_NEW_ALPHA; } -static void r128DDBlendEquationSeparate( struct gl_context *ctx, +static void r128DDBlendEquationSeparate( struct gl_context *ctx, GLenum modeRGB, GLenum modeA ) { r128ContextPtr rmesa = R128_CONTEXT(ctx); @@ -260,7 +260,7 @@ r128DDStencilFuncSeparate( struct gl_context *ctx, GLenum face, GLenum func, r128ContextPtr rmesa = R128_CONTEXT(ctx); GLuint refmask = (((ctx->Stencil.Ref[0] & 0xff) << 0) | ((ctx->Stencil.ValueMask[0] & 0xff) << 16) | - ((ctx->Stencil.WriteMask[0] & 0xff) << 24)); + ((ctx->Stencil.WriteMask[0] & 0xff) << 24)); GLuint z = rmesa->setup.z_sten_cntl_c; z &= ~R128_STENCIL_TEST_MASK; @@ -307,7 +307,7 @@ r128DDStencilMaskSeparate( struct gl_context *ctx, GLenum face, GLuint mask ) r128ContextPtr rmesa = R128_CONTEXT(ctx); GLuint refmask = (((ctx->Stencil.Ref[0] & 0xff) << 0) | ((ctx->Stencil.ValueMask[0] & 0xff) << 16) | - ((ctx->Stencil.WriteMask[0] & 0xff) << 24)); + ((ctx->Stencil.WriteMask[0] & 0xff) << 24)); if ( rmesa->setup.sten_ref_mask_c != refmask ) { rmesa->setup.sten_ref_mask_c = refmask; @@ -948,7 +948,7 @@ static void r128DDPolygonStipple( struct gl_context *ctx, const GLubyte *mask ) LOCK_HARDWARE( rmesa ); stippleRec.mask = stipple; - drmCommandWrite( rmesa->driFd, DRM_R128_STIPPLE, + drmCommandWrite( rmesa->driFd, DRM_R128_STIPPLE, &stippleRec, sizeof(stippleRec) ); UNLOCK_HARDWARE( rmesa ); @@ -1147,7 +1147,7 @@ void r128EmitHwStateLocked( r128ContextPtr rmesa ) R128_UPLOAD_WINDOW | R128_UPLOAD_CORE) ) { memcpy( &sarea->context_state, regs, sizeof(sarea->context_state) ); - + if( rmesa->dirty & R128_UPLOAD_CONTEXT ) { /* One possible side-effect of uploading a new context is the diff --git a/src/mesa/drivers/dri/r128/r128_tex.c b/src/mesa/drivers/dri/r128/r128_tex.c index ba3305e..c45b158 100644 --- a/src/mesa/drivers/dri/r128/r128_tex.c +++ b/src/mesa/drivers/dri/r128/r128_tex.c @@ -54,7 +54,7 @@ USE OR OTHER DEALINGS IN THE SOFTWARE. /** * Set the texture wrap modes. Currently \c GL_REPEAT, \c GL_CLAMP, * \c GL_CLAMP_TO_EDGE, and \c GL_MIRRORED_REPEAT are supported. - * + * * \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 @@ -159,7 +159,7 @@ static r128TexObjPtr r128AllocTexObj( struct gl_texture_object *texObj ) /* FIXME Something here to set initial values for other parts of * FIXME t->setup? */ - + make_empty_list( (driTextureObject *) t ); r128SetTexWrap( t, texObj->WrapS, texObj->WrapT ); diff --git a/src/mesa/drivers/dri/r128/r128_texmem.c b/src/mesa/drivers/dri/r128/r128_texmem.c index 412f6d4..1be87db 100644 --- a/src/mesa/drivers/dri/r128/r128_texmem.c +++ b/src/mesa/drivers/dri/r128/r128_texmem.c @@ -55,7 +55,7 @@ void r128DestroyTexObj( r128ContextPtr rmesa, r128TexObjPtr t ) */ if ( rmesa != NULL ) - { + { for ( i = 0 ; i < rmesa->glCtx->Const.MaxTextureUnits ; i++ ) { if ( t == rmesa->CurrentTexObj[ i ] ) { @@ -214,7 +214,7 @@ static void uploadSubImage( r128ContextPtr rmesa, r128TexObjPtr t, const GLuint texelBytes = _mesa_get_format_bytes(image->TexFormat); const GLubyte *src = (const GLubyte *) image->Data + - (y * image->Width + x) * texelBytes; + (y * image->Width + x) * texelBytes; const GLuint bytes = width * height * texelBytes; memcpy(dst, src, bytes); } @@ -261,7 +261,7 @@ void r128UploadTexImages( r128ContextPtr rmesa, r128TexObjPtr t ) /* Set the base offset of the texture image */ assert(t->base.memBlock); - t->bufAddr = rmesa->r128Screen->texOffset[heap] + t->bufAddr = rmesa->r128Screen->texOffset[heap] + t->base.memBlock->ofs; /* Set texture offsets for each mipmap level */ diff --git a/src/mesa/drivers/dri/r128/r128_texstate.c b/src/mesa/drivers/dri/r128/r128_texstate.c index 1144163..3727f6e 100644 --- a/src/mesa/drivers/dri/r128/r128_texstate.c +++ b/src/mesa/drivers/dri/r128/r128_texstate.c @@ -488,7 +488,7 @@ static void disable_tex( struct gl_context *ctx, int unit ) } rmesa->setup.tex_cntl_c &= ~(R128_TEXMAP_ENABLE << unit); - rmesa->setup.tex_size_pitch_c &= ~(R128_TEX_SIZE_PITCH_MASK << + rmesa->setup.tex_size_pitch_c &= ~(R128_TEX_SIZE_PITCH_MASK << (R128_SEC_TEX_SIZE_PITCH_SHIFT * unit)); rmesa->dirty |= R128_UPLOAD_CONTEXT; @@ -517,7 +517,7 @@ static GLboolean enable_tex_2d( struct gl_context *ctx, int unit ) r128SetTexImages( rmesa, tObj ); r128UploadTexImages( rmesa, t ); - if ( !t->base.memBlock ) + if ( !t->base.memBlock ) return GL_FALSE; } @@ -548,7 +548,7 @@ static GLboolean update_tex_common( struct gl_context *ctx, int unit ) * Mark it as such. */ - rmesa->CurrentTexObj[unit]->base.bound &= + rmesa->CurrentTexObj[unit]->base.bound &= ~(1UL << unit); } @@ -567,7 +567,7 @@ static GLboolean update_tex_common( struct gl_context *ctx, int unit ) rmesa->dirty |= R128_UPLOAD_TEX0 << unit; /* register setup */ - rmesa->setup.tex_size_pitch_c &= ~(R128_TEX_SIZE_PITCH_MASK << + rmesa->setup.tex_size_pitch_c &= ~(R128_TEX_SIZE_PITCH_MASK << (R128_SEC_TEX_SIZE_PITCH_SHIFT * unit)); if ( unit == 0 ) { @@ -624,7 +624,7 @@ void r128UpdateTextureState( struct gl_context *ctx ) GLboolean ok; - /* This works around a quirk with the R128 hardware. If only OpenGL + /* This works around a quirk with the R128 hardware. If only OpenGL * TEXTURE1 is enabled, then the hardware TEXTURE0 must be used. The * hardware TEXTURE1 can ONLY be used when hardware TEXTURE0 is also used. */ diff --git a/src/mesa/drivers/dri/r128/r128_tris.c b/src/mesa/drivers/dri/r128/r128_tris.c index 92c8a4e..52b86c5 100644 --- a/src/mesa/drivers/dri/r128/r128_tris.c +++ b/src/mesa/drivers/dri/r128/r128_tris.c @@ -69,7 +69,7 @@ static void r128RenderPrimitive( struct gl_context *ctx, GLenum prim ); /*********************************************************************** * Emit primitives as inline vertices * ***********************************************************************/ - + #define HAVE_QUADS 0 #define HAVE_LINES 1 #define HAVE_POINTS 1 @@ -536,7 +536,7 @@ static void r128SetupAntialias( struct gl_context *ctx, GLenum prim ) r128ContextPtr rmesa = R128_CONTEXT(ctx); GLuint currAA, wantAA; - + currAA = (rmesa->setup.pm4_vc_fpu_setup & R128_EDGE_ANTIALIAS) != 0; if( prim >= GL_TRIANGLES ) wantAA = ctx->Polygon.SmoothFlag; @@ -544,7 +544,7 @@ static void r128SetupAntialias( struct gl_context *ctx, GLenum prim ) wantAA = ctx->Line.SmoothFlag; else wantAA = 0; - + if( wantAA != currAA ) { FLUSH_BATCH( rmesa ); @@ -560,7 +560,7 @@ static void r128RenderPrimitive( struct gl_context *ctx, GLenum prim ) rmesa->render_primitive = prim; r128SetupAntialias( ctx, prim ); - + if (prim >= GL_TRIANGLES && (ctx->_TriangleCaps & DD_TRI_UNFILLED)) return; r128RasterPrimitive( ctx, hw ); @@ -610,7 +610,7 @@ static void r128RenderStart( struct gl_context *ctx ) EMIT_ATTR( _TNL_ATTRIB_POS, EMIT_3F_VIEWPORT, 0, 3 ); rmesa->coloroffset = offset; -#if MESA_LITTLE_ENDIAN +#if MESA_LITTLE_ENDIAN EMIT_ATTR( _TNL_ATTRIB_COLOR0, EMIT_4UB_4F_BGRA, R128_CCE_VC_FRMT_DIFFUSE_ARGB, 4 ); #else @@ -625,7 +625,7 @@ static void r128RenderStart( struct gl_context *ctx ) rmesa->specoffset = offset; EMIT_ATTR( _TNL_ATTRIB_COLOR1, EMIT_3UB_3F_BGR, R128_CCE_VC_FRMT_SPEC_FRGB, 3 ); - } else + } else EMIT_PAD( 3 ); if (RENDERINPUTS_TEST( index_bitset, _TNL_ATTRIB_FOG )) @@ -644,7 +644,7 @@ static void r128RenderStart( struct gl_context *ctx ) rmesa->specoffset = offset; EMIT_ATTR( _TNL_ATTRIB_COLOR1, EMIT_3UB_3F_RGB, R128_CCE_VC_FRMT_SPEC_FRGB, 3 ); - } else + } else EMIT_PAD( 3 ); #endif } @@ -670,9 +670,9 @@ static void r128RenderStart( struct gl_context *ctx ) FLUSH_BATCH( rmesa ); rmesa->dirty |= R128_UPLOAD_CONTEXT; - rmesa->vertex_size = - _tnl_install_attrs( ctx, - rmesa->vertex_attrs, + rmesa->vertex_size = + _tnl_install_attrs( ctx, + rmesa->vertex_attrs, rmesa->vertex_attr_count, rmesa->hw_viewport, 0 ); rmesa->vertex_size >>= 2; @@ -749,10 +749,10 @@ void r128Fallback( struct gl_context *ctx, GLuint bit, GLboolean mode ) _tnl_invalidate_vertex_state( ctx, ~0 ); _tnl_invalidate_vertices( ctx, ~0 ); - _tnl_install_attrs( ctx, - rmesa->vertex_attrs, + _tnl_install_attrs( ctx, + rmesa->vertex_attrs, rmesa->vertex_attr_count, - rmesa->hw_viewport, 0 ); + rmesa->hw_viewport, 0 ); rmesa->NewGLState |= _R128_NEW_RENDER_STATE; if ( R128_DEBUG & DEBUG_VERBOSE_FALL ) { @@ -788,7 +788,7 @@ void r128InitTriFuncs( 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, (6 + 2 * ctx->Const.MaxTextureUnits) * sizeof(GLfloat) ); rmesa->verts = (char *)tnl->clipspace.vertex_buf; RENDERINPUTS_ONES( rmesa->tnl_state_bitset ); diff --git a/src/mesa/drivers/dri/r128/server/r128.h b/src/mesa/drivers/dri/r128/server/r128.h index 413c7c6..b36f8f0 100644 --- a/src/mesa/drivers/dri/r128/server/r128.h +++ b/src/mesa/drivers/dri/r128/server/r128.h @@ -61,7 +61,7 @@ #define R128_ARRAY_SIZE(x) (sizeof(x)/sizeof(x[0])) #define R128_ALIGN(x,bytes) (((x) + ((bytes) - 1)) & ~((bytes) - 1)) #define R128PTR(pScrn) ((R128InfoPtr)(pScrn)->driverPrivate) - + /** * \brief Chip families. */ @@ -183,7 +183,7 @@ typedef struct { int VSyncWidth; int VBlank; int PanelPwrDly; - + unsigned long cursor_start; unsigned long cursor_end; @@ -374,7 +374,7 @@ do { \ } \ } while (0) - + #define CCE_PACKET0( reg, n ) \ (R128_CCE_PACKET0 | ((n) << 16) | ((reg) >> 2)) #define CCE_PACKET1( reg0, reg1 ) \ @@ -460,5 +460,5 @@ do { \ } \ } while (0) - + #endif diff --git a/src/mesa/drivers/dri/r200/Doxyfile b/src/mesa/drivers/dri/r200/Doxyfile index 27b3d03..003b00a 100644 --- a/src/mesa/drivers/dri/r200/Doxyfile +++ b/src/mesa/drivers/dri/r200/Doxyfile @@ -5,7 +5,7 @@ #--------------------------------------------------------------------------- PROJECT_NAME = r200 PROJECT_NUMBER = $VERSION$ -OUTPUT_DIRECTORY = +OUTPUT_DIRECTORY = OUTPUT_LANGUAGE = English USE_WINDOWS_ENCODING = NO EXTRACT_ALL = NO @@ -21,7 +21,7 @@ REPEAT_BRIEF = YES ALWAYS_DETAILED_SEC = NO INLINE_INHERITED_MEMB = NO FULL_PATH_NAMES = NO -STRIP_FROM_PATH = +STRIP_FROM_PATH = INTERNAL_DOCS = NO CASE_SENSE_NAMES = YES SHORT_NAMES = NO @@ -39,8 +39,8 @@ GENERATE_TODOLIST = YES GENERATE_TESTLIST = YES GENERATE_BUGLIST = YES GENERATE_DEPRECATEDLIST= YES -ALIASES = -ENABLED_SECTIONS = +ALIASES = +ENABLED_SECTIONS = MAX_INITIALIZER_LINES = 30 OPTIMIZE_OUTPUT_FOR_C = NO OPTIMIZE_OUTPUT_JAVA = NO @@ -53,7 +53,7 @@ WARNINGS = YES WARN_IF_UNDOCUMENTED = YES WARN_IF_DOC_ERROR = YES WARN_FORMAT = "$file:$line: $text" -WARN_LOGFILE = +WARN_LOGFILE = #--------------------------------------------------------------------------- # configuration options related to the input files #--------------------------------------------------------------------------- @@ -85,14 +85,14 @@ FILE_PATTERNS = *.c \ *.moc \ *.xpm RECURSIVE = yes -EXCLUDE = +EXCLUDE = EXCLUDE_SYMLINKS = NO -EXCLUDE_PATTERNS = -EXAMPLE_PATH = +EXCLUDE_PATTERNS = +EXAMPLE_PATH = EXAMPLE_PATTERNS = * EXAMPLE_RECURSIVE = NO -IMAGE_PATH = -INPUT_FILTER = +IMAGE_PATH = +INPUT_FILTER = FILTER_SOURCE_FILES = NO #--------------------------------------------------------------------------- # configuration options related to source browsing @@ -108,20 +108,20 @@ VERBATIM_HEADERS = YES #--------------------------------------------------------------------------- ALPHABETICAL_INDEX = NO COLS_IN_ALPHA_INDEX = 5 -IGNORE_PREFIX = +IGNORE_PREFIX = #--------------------------------------------------------------------------- # configuration options related to the HTML output #--------------------------------------------------------------------------- GENERATE_HTML = YES HTML_OUTPUT = html HTML_FILE_EXTENSION = .html -HTML_HEADER = -HTML_FOOTER = -HTML_STYLESHEET = +HTML_HEADER = +HTML_FOOTER = +HTML_STYLESHEET = HTML_ALIGN_MEMBERS = YES GENERATE_HTMLHELP = NO -CHM_FILE = -HHC_LOCATION = +CHM_FILE = +HHC_LOCATION = GENERATE_CHI = NO BINARY_TOC = NO TOC_EXPAND = NO @@ -138,8 +138,8 @@ LATEX_CMD_NAME = latex MAKEINDEX_CMD_NAME = makeindex COMPACT_LATEX = NO PAPER_TYPE = a4wide -EXTRA_PACKAGES = -LATEX_HEADER = +EXTRA_PACKAGES = +LATEX_HEADER = PDF_HYPERLINKS = NO USE_PDFLATEX = NO LATEX_BATCHMODE = NO @@ -151,8 +151,8 @@ GENERATE_RTF = NO RTF_OUTPUT = rtf COMPACT_RTF = NO RTF_HYPERLINKS = NO -RTF_STYLESHEET_FILE = -RTF_EXTENSIONS_FILE = +RTF_STYLESHEET_FILE = +RTF_EXTENSIONS_FILE = #--------------------------------------------------------------------------- # configuration options related to the man page output #--------------------------------------------------------------------------- @@ -165,8 +165,8 @@ MAN_LINKS = NO #--------------------------------------------------------------------------- GENERATE_XML = yes XML_OUTPUT = xml -XML_SCHEMA = -XML_DTD = +XML_SCHEMA = +XML_DTD = #--------------------------------------------------------------------------- # configuration options for the AutoGen Definitions output #--------------------------------------------------------------------------- @@ -177,29 +177,29 @@ GENERATE_AUTOGEN_DEF = NO GENERATE_PERLMOD = NO PERLMOD_LATEX = NO PERLMOD_PRETTY = YES -PERLMOD_MAKEVAR_PREFIX = +PERLMOD_MAKEVAR_PREFIX = #--------------------------------------------------------------------------- -# Configuration options related to the preprocessor +# Configuration options related to the preprocessor #--------------------------------------------------------------------------- ENABLE_PREPROCESSING = YES MACRO_EXPANSION = NO EXPAND_ONLY_PREDEF = NO SEARCH_INCLUDES = YES -INCLUDE_PATH = -INCLUDE_FILE_PATTERNS = -PREDEFINED = -EXPAND_AS_DEFINED = +INCLUDE_PATH = +INCLUDE_FILE_PATTERNS = +PREDEFINED = +EXPAND_AS_DEFINED = SKIP_FUNCTION_MACROS = YES #--------------------------------------------------------------------------- -# Configuration::addtions related to external references +# Configuration::addtions related to external references #--------------------------------------------------------------------------- -TAGFILES = -GENERATE_TAGFILE = +TAGFILES = +GENERATE_TAGFILE = ALLEXTERNALS = NO EXTERNAL_GROUPS = YES PERL_PATH = /usr/bin/perl #--------------------------------------------------------------------------- -# Configuration options related to the dot tool +# Configuration options related to the dot tool #--------------------------------------------------------------------------- CLASS_DIAGRAMS = YES HIDE_UNDOC_RELATIONS = YES @@ -213,20 +213,20 @@ INCLUDED_BY_GRAPH = YES CALL_GRAPH = NO GRAPHICAL_HIERARCHY = YES DOT_IMAGE_FORMAT = png -DOT_PATH = -DOTFILE_DIRS = +DOT_PATH = +DOTFILE_DIRS = MAX_DOT_GRAPH_WIDTH = 1024 MAX_DOT_GRAPH_HEIGHT = 1024 MAX_DOT_GRAPH_DEPTH = 1000 GENERATE_LEGEND = YES DOT_CLEANUP = YES #--------------------------------------------------------------------------- -# Configuration::addtions related to the search engine +# Configuration::addtions related to the search engine #--------------------------------------------------------------------------- SEARCHENGINE = NO CGI_NAME = search.cgi -CGI_URL = -DOC_URL = -DOC_ABSPATH = +CGI_URL = +DOC_URL = +DOC_ABSPATH = BIN_ABSPATH = /usr/local/bin/ -EXT_DOC_PATHS = +EXT_DOC_PATHS = diff --git a/src/mesa/drivers/dri/r200/Makefile b/src/mesa/drivers/dri/r200/Makefile index 8013768..e5e7f1f 100644 --- a/src/mesa/drivers/dri/r200/Makefile +++ b/src/mesa/drivers/dri/r200/Makefile @@ -51,7 +51,7 @@ DRIVER_SOURCES = r200_context.c \ C_SOURCES = $(COMMON_SOURCES) $(DRIVER_SOURCES) -X86_SOURCES = +X86_SOURCES = DRIVER_DEFINES = -DRADEON_R200 diff --git a/src/mesa/drivers/dri/r200/r200_cmdbuf.c b/src/mesa/drivers/dri/r200/r200_cmdbuf.c index 931a9ec..29b1e2b 100644 --- a/src/mesa/drivers/dri/r200/r200_cmdbuf.c +++ b/src/mesa/drivers/dri/r200/r200_cmdbuf.c @@ -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", __FUNCTION__, 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,10 +142,10 @@ 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); - + if (!rmesa->radeon.radeonScreen->kernel_mm) { OUT_BATCH_PACKET3(R200_CP_CMD_INDX_BUFFER, 2); OUT_BATCH((0x80 << 24) | (0 << 16) | 0x810); @@ -206,7 +206,7 @@ GLushort *r200AllocEltsOpenEnded( r200ContextPtr rmesa, radeon_print(RADEON_RENDER, RADEON_VERBOSE, "%s %d prim %x\n", __FUNCTION__, min_nr, primitive); assert((primitive & R200_VF_PRIM_WALK_IND)); - + radeonEmitState(&rmesa->radeon); radeonAllocDmaRegion(&rmesa->radeon, &rmesa->radeon.tcl.elt_dma_bo, @@ -215,7 +215,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; @@ -260,7 +260,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", __FUNCTION__, nr, offset); @@ -269,14 +269,14 @@ void r200EmitAOS(r200ContextPtr rmesa, GLuint nr, GLuint offset) OUT_BATCH_PACKET3(R200_CP_CMD_3D_LOAD_VBPNTR, sz - 1); OUT_BATCH(nr); - + if (!rmesa->radeon.radeonScreen->kernel_mm) { for (i = 0; i + 1 < nr; i += 2) { OUT_BATCH((rmesa->radeon.tcl.aos[i].components << 0) | (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_RELOC(voffset, @@ -292,7 +292,7 @@ void r200EmitAOS(r200ContextPtr rmesa, GLuint nr, GLuint offset) RADEON_GEM_DOMAIN_GTT, 0, 0); } - + if (nr & 1) { OUT_BATCH((rmesa->radeon.tcl.aos[nr - 1].components << 0) | (rmesa->radeon.tcl.aos[nr - 1].stride << 8)); @@ -310,7 +310,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); @@ -318,7 +318,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)); diff --git a/src/mesa/drivers/dri/r200/r200_context.c b/src/mesa/drivers/dri/r200/r200_context.c index 5abfc9d..f63f9c3 100644 --- a/src/mesa/drivers/dri/r200/r200_context.c +++ b/src/mesa/drivers/dri/r200/r200_context.c @@ -181,7 +181,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 */ @@ -193,7 +193,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 @@ -202,7 +202,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 */ @@ -319,7 +319,7 @@ GLboolean r200CreateContext( gl_api api, else rmesa->using_hyperz = GL_TRUE; } - + if ( sPriv->drm_version.minor >= 15 ) rmesa->texmicrotile = GL_TRUE; @@ -360,7 +360,7 @@ GLboolean r200CreateContext( gl_api api, i = driQueryOptioni( &rmesa->radeon.optionCache, "allow_large_textures"); - /* 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.MaxTextureLevels = 12; ctx->Const.Max3DTextureLevels = 9; @@ -482,7 +482,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"); diff --git a/src/mesa/drivers/dri/r200/r200_context.h b/src/mesa/drivers/dri/r200/r200_context.h index 657902f..049c6da 100644 --- a/src/mesa/drivers/dri/r200/r200_context.h +++ b/src/mesa/drivers/dri/r200/r200_context.h @@ -67,7 +67,7 @@ typedef struct r200_context *r200ContextPtr; struct r200_vertex_program { struct gl_vertex_program mesa_program; /* Must be first */ int translated; - /* need excess instr: 1 for late loop checking, 2 for + /* need excess instr: 1 for late loop checking, 2 for additional instr due to instr/attr, 3 for fog */ VERTEX_SHADER_INSTRUCTION instr[R200_VSF_MAX_INST + 6]; int pos_end; @@ -97,7 +97,7 @@ struct r200_texture_state { /* Trying to keep these relatively short as the variables are becoming * extravagently long. Drop the driver name prefix off the front of * everything - I think we know which driver we're in by now, and keep the - * prefix to 3 letters unless absolutely impossible. + * prefix to 3 letters unless absolutely impossible. */ #define CTX_CMD_0 0 @@ -281,11 +281,11 @@ struct r200_texture_state { #define TCG_TEX_CYL_WRAP_CTL 5 #define TCG_STATE_SIZE 6 -#define MTL_CMD_0 0 -#define MTL_EMMISSIVE_RED 1 -#define MTL_EMMISSIVE_GREEN 2 -#define MTL_EMMISSIVE_BLUE 3 -#define MTL_EMMISSIVE_ALPHA 4 +#define MTL_CMD_0 0 +#define MTL_EMMISSIVE_RED 1 +#define MTL_EMMISSIVE_GREEN 2 +#define MTL_EMMISSIVE_BLUE 3 +#define MTL_EMMISSIVE_ALPHA 4 #define MTL_AMBIENT_RED 5 #define MTL_AMBIENT_GREEN 6 #define MTL_AMBIENT_BLUE 7 @@ -366,7 +366,7 @@ struct r200_texture_state { #define GRD_STATE_SIZE 5 /* position changes frequently when lighting in modelpos - separate - * out to new state item? + * out to new state item? */ #define LIT_CMD_0 0 #define LIT_AMBIENT_RED 1 @@ -485,7 +485,7 @@ struct r200_texture_state { #define STP_STATE_SIZE 35 struct r200_hw_state { - /* Hardware state, stored as cmdbuf commands: + /* Hardware state, stored as cmdbuf commands: * -- Need to doublebuffer for * - reviving state after loss of context * - eliding noop statechange loops? (except line stipple count) @@ -536,9 +536,9 @@ struct r200_state { GLuint envneeded; }; -#define R200_CMD_BUF_SZ (16*1024) +#define R200_CMD_BUF_SZ (16*1024) -#define R200_ELT_BUF_SZ (16*1024) +#define R200_ELT_BUF_SZ (16*1024) /* r200_tcl.c */ struct r200_tcl_info { @@ -580,10 +580,10 @@ struct r200_swtcl_info { /* A maximum total of 29 elements per vertex: 3 floats for position, 3 * floats for normal, 4 floats for color, 4 bytes for secondary color, * 3 floats for each texture unit (18 floats total). - * + * * we maybe need add. 4 to prevent segfault if someone specifies * GL_TEXTURE6/GL_TEXTURE7 (esp. for the codegen-path) (FIXME: ) - * + * * The position data is never actually stored here, so 3 elements could be * trimmed out of the buffer. */ diff --git a/src/mesa/drivers/dri/r200/r200_ioctl.h b/src/mesa/drivers/dri/r200/r200_ioctl.h index f252718..7621564 100644 --- a/src/mesa/drivers/dri/r200/r200_ioctl.h +++ b/src/mesa/drivers/dri/r200/r200_ioctl.h @@ -67,7 +67,7 @@ extern void r200InitIoctlFuncs( struct dd_function_table *functions ); extern GLboolean r200IsGartMemory( r200ContextPtr rmesa, const GLvoid *pointer, GLint size ); -extern GLuint r200GartOffsetFromVirtual( r200ContextPtr rmesa, +extern GLuint r200GartOffsetFromVirtual( r200ContextPtr rmesa, const GLvoid *pointer ); void r200SetUpAtomList( r200ContextPtr rmesa ); @@ -108,7 +108,7 @@ do { \ memcpy( rmesa->hw.ATOM.lastcmd, rmesa->hw.ATOM.cmd, \ rmesa->hw.ATOM.cmd_size * 4) -static INLINE int R200_DB_STATECHANGE( +static INLINE int R200_DB_STATECHANGE( r200ContextPtr rmesa, struct radeon_state_atom *atom ) { @@ -117,7 +117,7 @@ static INLINE int R200_DB_STATECHANGE( R200_NEWPRIM( rmesa ); atom->dirty = GL_TRUE; rmesa->radeon.hw.is_dirty = GL_TRUE; - tmp = atom->cmd; + tmp = atom->cmd; atom->cmd = atom->lastcmd; atom->lastcmd = tmp; return 1; diff --git a/src/mesa/drivers/dri/r200/r200_maos.c b/src/mesa/drivers/dri/r200/r200_maos.c index 23e1c96..08f4a5a 100644 --- a/src/mesa/drivers/dri/r200/r200_maos.c +++ b/src/mesa/drivers/dri/r200/r200_maos.c @@ -5,7 +5,7 @@ * To get an idea how the verts path works, look at the radeon implementation. */ #include - + #include "r200_context.h" #define R200_MAOS_VERTS 0 #if (R200_MAOS_VERTS) diff --git a/src/mesa/drivers/dri/r200/r200_maos_arrays.c b/src/mesa/drivers/dri/r200/r200_maos_arrays.c index b622902..9a62a58 100644 --- a/src/mesa/drivers/dri/r200/r200_maos_arrays.c +++ b/src/mesa/drivers/dri/r200/r200_maos_arrays.c @@ -101,7 +101,7 @@ static void r200_emit_vecfog(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 r200EmitArrays( struct gl_context *ctx, GLubyte *vimap_rev ) { diff --git a/src/mesa/drivers/dri/r200/r200_reg.h b/src/mesa/drivers/dri/r200/r200_reg.h index e331be2..65aeacf 100644 --- a/src/mesa/drivers/dri/r200/r200_reg.h +++ b/src/mesa/drivers/dri/r200/r200_reg.h @@ -29,7 +29,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #ifndef _R200_REG_H_ #define _R200_REG_H_ -#define R200_PP_MISC 0x1c14 +#define R200_PP_MISC 0x1c14 #define R200_REF_ALPHA_MASK 0x000000ff #define R200_ALPHA_TEST_FAIL (0 << 8) #define R200_ALPHA_TEST_LESS (1 << 8) @@ -48,7 +48,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #define R200_CHROMA_KEY_ZERO (1 << 18) #define R200_RIGHT_HAND_CUBE_D3D (0 << 24) #define R200_RIGHT_HAND_CUBE_OGL (1 << 24) -#define R200_PP_FOG_COLOR 0x1c18 +#define R200_PP_FOG_COLOR 0x1c18 #define R200_FOG_COLOR_MASK 0x00ffffff #define R200_FOG_VERTEX (0 << 24) #define R200_FOG_TABLE (1 << 24) @@ -58,7 +58,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #define R200_FOG_USE_SPEC_ALPHA (3 << 25) #define R200_FOG_USE_VTX_FOG (4 << 25) #define R200_FOG_USE_MASK (7 << 25) -#define R200_RE_SOLID_COLOR 0x1c1c +#define R200_RE_SOLID_COLOR 0x1c1c #define R200_RB3D_BLENDCNTL 0x1c20 #define R200_COMB_FCN_MASK (7 << 12) #define R200_COMB_FCN_ADD_CLAMP (0 << 12) @@ -94,7 +94,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #define R200_DEPTH_ENDIAN_NO_SWAP (0 << 18) #define R200_DEPTH_ENDIAN_WORD_SWAP (1 << 18) #define R200_DEPTH_ENDIAN_DWORD_SWAP (2 << 18) -#define R200_RB3D_ZSTENCILCNTL 0x1c2c +#define R200_RB3D_ZSTENCILCNTL 0x1c2c #define R200_DEPTH_FORMAT_MASK (0xf << 0) #define R200_DEPTH_FORMAT_16BIT_INT_Z (0 << 0) #define R200_DEPTH_FORMAT_24BIT_INT_Z (2 << 0) @@ -154,7 +154,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #define R200_Z_WRITE_ENABLE (1 << 30) #define R200_Z_DECOMPRESSION_ENABLE (1 << 31) /*gap*/ -#define R200_PP_CNTL 0x1c38 +#define R200_PP_CNTL 0x1c38 #define R200_TEX_0_ENABLE 0x00000010 #define R200_TEX_1_ENABLE 0x00000020 #define R200_TEX_2_ENABLE 0x00000040 @@ -181,7 +181,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #define R200_ANTI_ALIAS_LINE 0x01000000 #define R200_ANTI_ALIAS_POLY 0x02000000 #define R200_ANTI_ALIAS_MASK 0x03000000 -#define R200_RB3D_CNTL 0x1c3c +#define R200_RB3D_CNTL 0x1c3c #define R200_ALPHA_BLEND_ENABLE (1 << 0) #define R200_PLANE_MASK_ENABLE (1 << 1) #define R200_DITHER_ENABLE (1 << 2) @@ -204,19 +204,19 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #define R200_COLOR_FORMAT_ARGB4444 (15 << 10) #define R200_CLRCMP_FLIP_ENABLE (1 << 14) #define R200_SEPARATE_ALPHA_ENABLE (1 << 16) -#define R200_RB3D_COLOROFFSET 0x1c40 +#define R200_RB3D_COLOROFFSET 0x1c40 #define R200_COLOROFFSET_MASK 0xfffffff0 -#define R200_RE_WIDTH_HEIGHT 0x1c44 +#define R200_RE_WIDTH_HEIGHT 0x1c44 #define R200_RE_WIDTH_SHIFT 0 #define R200_RE_HEIGHT_SHIFT 16 -#define R200_RB3D_COLORPITCH 0x1c48 +#define R200_RB3D_COLORPITCH 0x1c48 #define R200_COLORPITCH_MASK 0x000001ff8 #define R200_COLOR_TILE_ENABLE (1 << 16) #define R200_COLOR_MICROTILE_ENABLE (1 << 17) #define R200_COLOR_ENDIAN_NO_SWAP (0 << 18) #define R200_COLOR_ENDIAN_WORD_SWAP (1 << 18) #define R200_COLOR_ENDIAN_DWORD_SWAP (2 << 18) -#define R200_SE_CNTL 0x1c4c +#define R200_SE_CNTL 0x1c4c #define R200_FFACE_CULL_CW (0 << 0) #define R200_FFACE_CULL_CCW (1 << 0) #define R200_FFACE_CULL_DIR_MASK (1 << 0) @@ -263,7 +263,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #define R200_ROUND_PREC_8TH_PIX (1 << 30) #define R200_ROUND_PREC_4TH_PIX (2 << 30) #define R200_ROUND_PREC_HALF_PIX (3 << 30) -#define R200_RE_CNTL 0x1c50 +#define R200_RE_CNTL 0x1c50 #define R200_STIPPLE_ENABLE 0x1 #define R200_SCISSOR_ENABLE 0x2 #define R200_PATTERN_ENABLE 0x4 @@ -278,14 +278,14 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. /* gap */ #define R200_RE_STIPPLE_ADDR 0x1cc8 #define R200_RE_STIPPLE_DATA 0x1ccc -#define R200_RE_LINE_PATTERN 0x1cd0 +#define R200_RE_LINE_PATTERN 0x1cd0 #define R200_LINE_PATTERN_MASK 0x0000ffff #define R200_LINE_REPEAT_COUNT_SHIFT 16 #define R200_LINE_PATTERN_START_SHIFT 24 #define R200_LINE_PATTERN_LITTLE_BIT_ORDER (0 << 28) #define R200_LINE_PATTERN_BIG_BIT_ORDER (1 << 28) #define R200_LINE_PATTERN_AUTO_RESET (1 << 29) -#define R200_RE_LINE_STATE 0x1cd4 +#define R200_RE_LINE_STATE 0x1cd4 #define R200_LINE_CURRENT_PTR_SHIFT 0 #define R200_LINE_CURRENT_COUNT_SHIFT 8 #define R200_RE_SCISSOR_TL_0 0x1cd8 @@ -295,18 +295,18 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #define R200_RE_SCISSOR_TL_2 0x1ce8 #define R200_RE_SCISSOR_BR_2 0x1cec /* gap */ -#define R200_RB3D_DEPTHXY_OFFSET 0x1d60 +#define R200_RB3D_DEPTHXY_OFFSET 0x1d60 #define R200_DEPTHX_SHIFT 0 #define R200_DEPTHY_SHIFT 16 /* gap */ -#define R200_RB3D_STENCILREFMASK 0x1d7c +#define R200_RB3D_STENCILREFMASK 0x1d7c #define R200_STENCIL_REF_SHIFT 0 #define R200_STENCIL_REF_MASK (0xff << 0) #define R200_STENCIL_MASK_SHIFT 16 #define R200_STENCIL_VALUE_MASK (0xff << 16) #define R200_STENCIL_WRITEMASK_SHIFT 24 #define R200_STENCIL_WRITE_MASK (0xff << 24) -#define R200_RB3D_ROPCNTL 0x1d80 +#define R200_RB3D_ROPCNTL 0x1d80 #define R200_ROP_MASK (15 << 8) #define R200_ROP_CLEAR (0 << 8) #define R200_ROP_NOR (1 << 8) @@ -324,17 +324,17 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #define R200_ROP_OR_REVERSE (13 << 8) #define R200_ROP_OR (14 << 8) #define R200_ROP_SET (15 << 8) -#define R200_RB3D_PLANEMASK 0x1d84 +#define R200_RB3D_PLANEMASK 0x1d84 /* gap */ -#define R200_SE_VPORT_XSCALE 0x1d98 -#define R200_SE_VPORT_XOFFSET 0x1d9c -#define R200_SE_VPORT_YSCALE 0x1da0 -#define R200_SE_VPORT_YOFFSET 0x1da4 -#define R200_SE_VPORT_ZSCALE 0x1da8 -#define R200_SE_VPORT_ZOFFSET 0x1dac -#define R200_SE_ZBIAS_FACTOR 0x1db0 -#define R200_SE_ZBIAS_CONSTANT 0x1db4 -#define R200_SE_LINE_WIDTH 0x1db8 +#define R200_SE_VPORT_XSCALE 0x1d98 +#define R200_SE_VPORT_XOFFSET 0x1d9c +#define R200_SE_VPORT_YSCALE 0x1da0 +#define R200_SE_VPORT_YOFFSET 0x1da4 +#define R200_SE_VPORT_ZSCALE 0x1da8 +#define R200_SE_VPORT_ZOFFSET 0x1dac +#define R200_SE_ZBIAS_FACTOR 0x1db0 +#define R200_SE_ZBIAS_CONSTANT 0x1db4 +#define R200_SE_LINE_WIDTH 0x1db8 #define R200_LINE_WIDTH_SHIFT 0x00000000 #define R200_MINPOINTSIZE_SHIFT 0x00000010 /* gap */ @@ -407,8 +407,8 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #define R200_VTX_TEX3_COMP_CNT_SHIFT 9 #define R200_VTX_TEX4_COMP_CNT_SHIFT 12 #define R200_VTX_TEX5_COMP_CNT_SHIFT 15 -#define R200_SE_TCL_OUTPUT_VTX_FMT_0 0x2090 -#define R200_SE_TCL_OUTPUT_VTX_FMT_1 0x2094 +#define R200_SE_TCL_OUTPUT_VTX_FMT_0 0x2090 +#define R200_SE_TCL_OUTPUT_VTX_FMT_1 0x2094 /* gap */ #define R200_SE_VTE_CNTL 0x20b0 #define R200_VPORT_X_SCALE_ENA 0x00000001 @@ -471,20 +471,20 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #define R200_SE_TCL_SCALAR_DATA_REG 0x220c /* gap */ #define R200_SE_TCL_MATRIX_SEL_0 0x2230 -#define R200_MODELVIEW_0_SHIFT (0) -#define R200_MODELVIEW_1_SHIFT (8) -#define R200_MODELVIEW_2_SHIFT (16) -#define R200_MODELVIEW_3_SHIFT (24) +#define R200_MODELVIEW_0_SHIFT (0) +#define R200_MODELVIEW_1_SHIFT (8) +#define R200_MODELVIEW_2_SHIFT (16) +#define R200_MODELVIEW_3_SHIFT (24) #define R200_SE_TCL_MATRIX_SEL_1 0x2234 #define R200_IT_MODELVIEW_0_SHIFT (0) -#define R200_IT_MODELVIEW_1_SHIFT (8) +#define R200_IT_MODELVIEW_1_SHIFT (8) #define R200_IT_MODELVIEW_2_SHIFT (16) #define R200_IT_MODELVIEW_3_SHIFT (24) #define R200_SE_TCL_MATRIX_SEL_2 0x2238 -#define R200_MODELPROJECT_0_SHIFT (0) -#define R200_MODELPROJECT_1_SHIFT (8) -#define R200_MODELPROJECT_2_SHIFT (16) -#define R200_MODELPROJECT_3_SHIFT (24) +#define R200_MODELPROJECT_0_SHIFT (0) +#define R200_MODELPROJECT_1_SHIFT (8) +#define R200_MODELPROJECT_2_SHIFT (16) +#define R200_MODELPROJECT_3_SHIFT (24) #define R200_SE_TCL_MATRIX_SEL_3 0x223c #define R200_TEXMAT_0_SHIFT 0 #define R200_TEXMAT_1_SHIFT 8 @@ -523,7 +523,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #define R200_VTX_TEX_5_ADDR__SHIFT 0x00000008 /* gap */ -#define R200_SE_TCL_LIGHT_MODEL_CTL_0 0x2268 +#define R200_SE_TCL_LIGHT_MODEL_CTL_0 0x2268 #define R200_LIGHTING_ENABLE (1<<0) #define R200_LIGHT_IN_MODELSPACE (1<<1) #define R200_LOCAL_VIEWER (1<<2) @@ -541,7 +541,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #define R200_LM0_SOURCE_MATERIAL_1 (1) #define R200_LM0_SOURCE_VERTEX_SHININESS_0 (2) #define R200_LM0_SOURCE_VERTEX_SHININESS_1 (3) -#define R200_SE_TCL_LIGHT_MODEL_CTL_1 0x226c +#define R200_SE_TCL_LIGHT_MODEL_CTL_1 0x226c #define R200_LM1_SOURCE_LIGHT_PREMULT (0) #define R200_LM1_SOURCE_MATERIAL_0 (1) #define R200_LM1_SOURCE_VERTEX_COLOR_0 (2) @@ -561,7 +561,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #define R200_BACK_AMBIENT_SOURCE_SHIFT (20) #define R200_BACK_DIFFUSE_SOURCE_SHIFT (24) #define R200_BACK_SPECULAR_SOURCE_SHIFT (28) -#define R200_SE_TCL_PER_LIGHT_CTL_0 0x2270 +#define R200_SE_TCL_PER_LIGHT_CTL_0 0x2270 #define R200_LIGHT_0_ENABLE (1<<0) #define R200_LIGHT_0_ENABLE_AMBIENT (1<<1) #define R200_LIGHT_0_ENABLE_SPECULAR (1<<2) @@ -580,17 +580,17 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #define R200_LIGHT_1_CONSTANT_RANGE_ATTEN (1<<23) #define R200_LIGHT_0_SHIFT (0) #define R200_LIGHT_1_SHIFT (16) -#define R200_SE_TCL_PER_LIGHT_CTL_1 0x2274 +#define R200_SE_TCL_PER_LIGHT_CTL_1 0x2274 #define R200_LIGHT_2_SHIFT (0) #define R200_LIGHT_3_SHIFT (16) -#define R200_SE_TCL_PER_LIGHT_CTL_2 0x2278 +#define R200_SE_TCL_PER_LIGHT_CTL_2 0x2278 #define R200_LIGHT_4_SHIFT (0) #define R200_LIGHT_5_SHIFT (16) -#define R200_SE_TCL_PER_LIGHT_CTL_3 0x227c +#define R200_SE_TCL_PER_LIGHT_CTL_3 0x227c #define R200_LIGHT_6_SHIFT (0) #define R200_LIGHT_7_SHIFT (16) /* gap */ -#define R200_SE_TCL_TEX_PROC_CTL_2 0x22a8 +#define R200_SE_TCL_TEX_PROC_CTL_2 0x22a8 #define R200_TEXGEN_COMP_MASK (0xf) #define R200_TEXGEN_COMP_S (0x1) #define R200_TEXGEN_COMP_T (0x2) @@ -602,14 +602,14 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #define R200_TEXGEN_3_COMP_MASK_SHIFT (12) #define R200_TEXGEN_4_COMP_MASK_SHIFT (16) #define R200_TEXGEN_5_COMP_MASK_SHIFT (20) -#define R200_SE_TCL_TEX_PROC_CTL_3 0x22ac +#define R200_SE_TCL_TEX_PROC_CTL_3 0x22ac #define R200_TEXGEN_0_INPUT_TEX_SHIFT (0) #define R200_TEXGEN_1_INPUT_TEX_SHIFT (4) #define R200_TEXGEN_2_INPUT_TEX_SHIFT (8) #define R200_TEXGEN_3_INPUT_TEX_SHIFT (12) #define R200_TEXGEN_4_INPUT_TEX_SHIFT (16) #define R200_TEXGEN_5_INPUT_TEX_SHIFT (20) -#define R200_SE_TCL_TEX_PROC_CTL_0 0x22b0 +#define R200_SE_TCL_TEX_PROC_CTL_0 0x22b0 #define R200_TEXGEN_TEXMAT_0_ENABLE (1<<0) #define R200_TEXGEN_TEXMAT_1_ENABLE (1<<1) #define R200_TEXGEN_TEXMAT_2_ENABLE (1<<2) @@ -623,7 +623,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #define R200_TEXMAT_4_ENABLE (1<<12) #define R200_TEXMAT_5_ENABLE (1<<13) #define R200_TEXGEN_FORCE_W_TO_ONE (1<<16) -#define R200_SE_TCL_TEX_PROC_CTL_1 0x22b4 +#define R200_SE_TCL_TEX_PROC_CTL_1 0x22b4 #define R200_TEXGEN_INPUT_MASK (0xf) #define R200_TEXGEN_INPUT_TEXCOORD_0 (0) #define R200_TEXGEN_INPUT_TEXCOORD_1 (1) @@ -644,7 +644,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #define R200_TEXGEN_5_INPUT_SHIFT (20) #define R200_SE_TC_TEX_CYL_WRAP_CTL 0x22b8 /* gap */ -#define R200_SE_TCL_UCP_VERT_BLEND_CTL 0x22c0 +#define R200_SE_TCL_UCP_VERT_BLEND_CTL 0x22c0 #define R200_UCP_IN_CLIP_SPACE (1<<0) #define R200_UCP_IN_MODEL_SPACE (1<<1) #define R200_UCP_ENABLE_0 (1<<2) @@ -804,10 +804,10 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #define R200_POINTSIZE_SHIFT 0 #define R200_MAXPOINTSIZE_SHIFT 16 /* gap */ -#define R200_RE_TOP_LEFT 0x26c0 +#define R200_RE_TOP_LEFT 0x26c0 #define R200_RE_LEFT_SHIFT 0 #define R200_RE_TOP_SHIFT 16 -#define R200_RE_MISC 0x26c4 +#define R200_RE_MISC 0x26c4 #define R200_STIPPLE_COORD_MASK 0x1f #define R200_STIPPLE_X_OFFSET_SHIFT 0 #define R200_STIPPLE_X_OFFSET_MASK (0x1f << 0) @@ -824,7 +824,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #define R200_SCISSOR_ENABLE_1 0x20000000 #define R200_SCISSOR_ENABLE_2 0x40000000 /* gap */ -#define R200_PP_TXFILTER_0 0x2c00 +#define R200_PP_TXFILTER_0 0x2c00 #define R200_MAG_FILTER_NEAREST (0 << 0) #define R200_MAG_FILTER_LINEAR (1 << 0) #define R200_MAG_FILTER_MASK (1 << 0) diff --git a/src/mesa/drivers/dri/r200/r200_sanity.c b/src/mesa/drivers/dri/r200/r200_sanity.c index a439fd8..2da11ef 100644 --- a/src/mesa/drivers/dri/r200/r200_sanity.c +++ b/src/mesa/drivers/dri/r200/r200_sanity.c @@ -31,8 +31,8 @@ USE OR OTHER DEALINGS IN THE SOFTWARE. * Keith Whitwell * */ - -#include + +#include #include "main/glheader.h" #include "main/imports.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 */ @@ -600,7 +600,7 @@ union fi { float f; int i; }; #define TOUCHED 4 struct reg { - int idx; + int idx; struct reg_names *closest; int flags; union fi current; @@ -658,7 +658,7 @@ static int find_or_add_value( struct reg *reg, int val ) if (j == reg->nalloc) { reg->nalloc += 5; reg->nalloc *= 2; - reg->values = (union fi *) realloc( reg->values, + reg->values = (union fi *) realloc( reg->values, reg->nalloc * sizeof(union fi) ); } @@ -684,14 +684,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 @@ -711,17 +711,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))) @@ -789,19 +789,19 @@ static void dump_state( void ) { int i; - for (i = 0 ; i < Elements(regs) ; i++) + for (i = 0 ; i < Elements(regs) ; i++) print_reg( ®s[i] ); - for (i = 0 ; i < Elements(scalars) ; i++) + for (i = 0 ; i < Elements(scalars) ; i++) print_reg( &scalars[i] ); - for (i = 0 ; i < Elements(vectors) ; i++) + for (i = 0 ; i < Elements(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 ) { @@ -809,9 +809,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; } @@ -820,8 +820,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++) { @@ -837,7 +837,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 ) { @@ -858,14 +858,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 ) { @@ -890,7 +890,7 @@ static int radeon_emit_scalars2( total_changed++; total++; } - + cmdbuf->buf += sz * sizeof(int); cmdbuf->bufsz -= sz * sizeof(int); return 0; @@ -899,7 +899,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 ) { @@ -929,14 +929,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 ) { @@ -1022,7 +1022,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"); @@ -1055,7 +1055,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", @@ -1068,7 +1068,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); @@ -1126,7 +1126,7 @@ static int print_prim_and_flags( int prim ) default: fprintf(stderr, "Bad primitive\n"); return -1; - } + } return 0; } @@ -1250,7 +1250,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: @@ -1259,41 +1259,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; @@ -1302,7 +1302,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; @@ -1312,7 +1312,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; @@ -1359,13 +1359,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; @@ -1425,7 +1425,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; @@ -1439,7 +1439,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); diff --git a/src/mesa/drivers/dri/r200/r200_state_init.c b/src/mesa/drivers/dri/r200/r200_state_init.c index e173cce..5c9bc7e 100644 --- a/src/mesa/drivers/dri/r200/r200_state_init.c +++ b/src/mesa/drivers/dri/r200/r200_state_init.c @@ -163,7 +163,7 @@ static struct { /* ============================================================= * State initialization */ -static int cmdpkt( r200ContextPtr rmesa, int id ) +static int cmdpkt( r200ContextPtr rmesa, int id ) { drm_radeon_cmd_header_t h; @@ -177,7 +177,7 @@ static int cmdpkt( r200ContextPtr rmesa, int id ) return h.i; } -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; @@ -190,7 +190,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; @@ -201,7 +201,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; @@ -212,7 +212,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; @@ -447,14 +447,14 @@ static void ctx_emit(struct gl_context *ctx, struct radeon_state_atom *atom) zbpitch |= RADEON_DEPTH_HYPERZ; OUT_BATCH_RELOC(0, rrb->bo, 0, 0, RADEON_GEM_DOMAIN_VRAM, 0); OUT_BATCH(zbpitch); - if (rrb->cpp == 4) - depth_fmt = RADEON_DEPTH_FORMAT_24BIT_INT_Z; - else - depth_fmt = RADEON_DEPTH_FORMAT_16BIT_INT_Z; - atom->cmd[CTX_RB3D_ZSTENCILCNTL] &= ~RADEON_DEPTH_FORMAT_MASK; - atom->cmd[CTX_RB3D_ZSTENCILCNTL] |= depth_fmt; + if (rrb->cpp == 4) + depth_fmt = RADEON_DEPTH_FORMAT_24BIT_INT_Z; + else + depth_fmt = RADEON_DEPTH_FORMAT_16BIT_INT_Z; + atom->cmd[CTX_RB3D_ZSTENCILCNTL] &= ~RADEON_DEPTH_FORMAT_MASK; + atom->cmd[CTX_RB3D_ZSTENCILCNTL] |= depth_fmt; } - + OUT_BATCH(atom->cmd[CTX_RB3D_ZSTENCILCNTL]); OUT_BATCH(atom->cmd[CTX_CMD_1]); OUT_BATCH(atom->cmd[CTX_PP_CNTL]); @@ -464,13 +464,13 @@ static void ctx_emit(struct gl_context *ctx, struct radeon_state_atom *atom) OUT_BATCH(atom->cmd[CTX_RB3D_CNTL]); OUT_BATCH(atom->cmd[CTX_RB3D_COLOROFFSET]); } else { - atom->cmd[CTX_RB3D_CNTL] &= ~(0xf << 10); - if (rrb->cpp == 4) - atom->cmd[CTX_RB3D_CNTL] |= RADEON_COLOR_FORMAT_ARGB8888; - else - atom->cmd[CTX_RB3D_CNTL] |= RADEON_COLOR_FORMAT_RGB565; - - OUT_BATCH(atom->cmd[CTX_RB3D_CNTL]); + atom->cmd[CTX_RB3D_CNTL] &= ~(0xf << 10); + if (rrb->cpp == 4) + atom->cmd[CTX_RB3D_CNTL] |= RADEON_COLOR_FORMAT_ARGB8888; + else + atom->cmd[CTX_RB3D_CNTL] |= RADEON_COLOR_FORMAT_RGB565; + + OUT_BATCH(atom->cmd[CTX_RB3D_CNTL]); OUT_BATCH_RELOC(0, rrb->bo, 0, 0, RADEON_GEM_DOMAIN_VRAM, 0); } @@ -1160,10 +1160,10 @@ void r200InitState( r200ContextPtr rmesa ) } - - 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 ); @@ -1179,43 +1179,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 ); } @@ -1251,11 +1251,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; @@ -1273,7 +1273,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" ) ) { @@ -1295,7 +1295,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; @@ -1317,13 +1317,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)); @@ -1333,7 +1333,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); @@ -1371,7 +1371,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; @@ -1382,7 +1382,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)); @@ -1445,11 +1445,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 | @@ -1457,50 +1457,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) | @@ -1508,34 +1508,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; @@ -1553,14 +1553,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 ); @@ -1575,7 +1575,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; diff --git a/src/mesa/drivers/dri/r200/r200_swtcl.h b/src/mesa/drivers/dri/r200/r200_swtcl.h index 668e175..66c3c20 100644 --- a/src/mesa/drivers/dri/r200/r200_swtcl.h +++ b/src/mesa/drivers/dri/r200/r200_swtcl.h @@ -51,8 +51,8 @@ extern void r200BuildVertices( struct gl_context *ctx, GLuint start, GLuint coun extern void r200PrintSetupFlags(char *msg, GLuint flags ); -extern void r200_translate_vertex( struct gl_context *ctx, - const radeonVertex *src, +extern void r200_translate_vertex( struct gl_context *ctx, + const radeonVertex *src, SWvertex *dst ); extern void r200_print_vertex( struct gl_context *ctx, const radeonVertex *v ); diff --git a/src/mesa/drivers/dri/r200/r200_tcl.c b/src/mesa/drivers/dri/r200/r200_tcl.c index 7aed116..fbc0ba3 100644 --- a/src/mesa/drivers/dri/r200/r200_tcl.c +++ b/src/mesa/drivers/dri/r200/r200_tcl.c @@ -101,7 +101,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 @@ -140,7 +140,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) { @@ -176,21 +176,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, @@ -240,7 +240,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 ) @@ -248,7 +248,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 ) @@ -256,7 +256,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 ) { @@ -446,14 +446,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 */ @@ -571,7 +571,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 = { @@ -605,9 +605,9 @@ static void transition_to_swtnl( struct gl_context *ctx ) r200ChooseVertexState( ctx ); r200ChooseRenderState( ctx ); - _mesa_validate_all_lighting_tables( ctx ); + _mesa_validate_all_lighting_tables( ctx ); - tnl->Driver.NotifyMaterialChange = + tnl->Driver.NotifyMaterialChange = _mesa_validate_all_lighting_tables; radeonReleaseArrays( ctx, ~0 ); @@ -630,11 +630,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; diff --git a/src/mesa/drivers/dri/r200/r200_tcl.h b/src/mesa/drivers/dri/r200/r200_tcl.h index 53a1f11..ff20da0 100644 --- a/src/mesa/drivers/dri/r200/r200_tcl.h +++ b/src/mesa/drivers/dri/r200/r200_tcl.h @@ -48,7 +48,7 @@ extern void r200TclFallback( struct gl_context *ctx, GLuint bit, GLboolean mode extern void r200InitStaticFogData( void ); extern float r200ComputeFogBlendFactor( struct gl_context *ctx, GLfloat fogcoord ); - + #define R200_TCL_FALLBACK_RASTER 0x1 /* rasterization */ #define R200_TCL_FALLBACK_UNFILLED 0x2 /* unfilled tris */ #define R200_TCL_FALLBACK_LIGHT_TWOSIDE 0x4 /* twoside tris */ diff --git a/src/mesa/drivers/dri/r200/r200_tex.c b/src/mesa/drivers/dri/r200/r200_tex.c index 0643247..1a21828 100644 --- a/src/mesa/drivers/dri/r200/r200_tex.c +++ b/src/mesa/drivers/dri/r200/r200_tex.c @@ -53,7 +53,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 @@ -206,7 +206,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; @@ -428,7 +428,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); @@ -436,13 +436,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(). */ diff --git a/src/mesa/drivers/dri/r200/r200_texstate.c b/src/mesa/drivers/dri/r200/r200_texstate.c index 24fb031..d10a403 100644 --- a/src/mesa/drivers/dri/r200/r200_texstate.c +++ b/src/mesa/drivers/dri/r200/r200_texstate.c @@ -549,7 +549,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 ); @@ -564,7 +564,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 ); @@ -928,7 +928,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) || @@ -1070,10 +1070,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)); @@ -1134,7 +1134,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, @@ -1211,10 +1211,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_texture_unit *texUnit = &ctx->Texture.Unit[unit]; GLuint inputshift = R200_TEXGEN_0_INPUT_SHIFT + unit*4; @@ -1241,7 +1241,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", __FUNCTION__, unit); if (texUnit->TexGenEnabled & S_BIT) { @@ -1310,7 +1310,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, @@ -1350,7 +1350,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, @@ -1384,7 +1384,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); @@ -1441,11 +1441,11 @@ static void setup_hardware_state(r200ContextPtr rmesa, radeonTexObj *t) if (VALID_FORMAT(firstImage->TexFormat)) { const struct tx_table *table = _mesa_little_endian() ? tx_table_le : tx_table_be; - + 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; @@ -1477,9 +1477,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); @@ -1552,7 +1552,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); diff --git a/src/mesa/drivers/dri/r200/r200_vertprog.c b/src/mesa/drivers/dri/r200/r200_vertprog.c index 5d69012..76be811 100644 --- a/src/mesa/drivers/dri/r200/r200_vertprog.c +++ b/src/mesa/drivers/dri/r200/r200_vertprog.c @@ -269,7 +269,7 @@ static unsigned long t_src_index(struct r200_vertex_program *vp, struct prog_src vp->inputs[src->Index] = max_reg+1;*/ - //vp_dump_inputs(vp, __FUNCTION__); + //vp_dump_inputs(vp, __FUNCTION__); assert(vp->inputs[src->Index] != -1); return vp->inputs[src->Index]; } else { @@ -330,7 +330,7 @@ static unsigned long t_opcode(enum prog_opcode opcode) case OPCODE_SGE: return R200_VPI_OUT_OP_SGE; case OPCODE_SLT: return R200_VPI_OUT_OP_SLT; - default: + default: fprintf(stderr, "%s: Should not be called with opcode %d!", __FUNCTION__, opcode); } exit(-1); @@ -736,7 +736,7 @@ static GLboolean r200_translate_vertex_program(struct gl_context *ctx, struct r2 } goto next; - case OPCODE_MOV://ADD RESULT 1.X Y Z W PARAM 0{} {X Y Z W} PARAM 0{} {ZERO ZERO ZERO ZERO} + case OPCODE_MOV://ADD RESULT 1.X Y Z W PARAM 0{} {X Y Z W} PARAM 0{} {ZERO ZERO ZERO ZERO} case OPCODE_SWZ: o_inst->op = MAKE_VSF_OP(R200_VPI_OUT_OP_ADD, t_dst(&dst), t_dst_mask(dst.WriteMask)); @@ -782,7 +782,7 @@ else { #endif goto next; - case OPCODE_DP3://DOT RESULT 1.X Y Z W PARAM 0{} {X Y Z ZERO} PARAM 0{} {X Y Z ZERO} + case OPCODE_DP3://DOT RESULT 1.X Y Z W PARAM 0{} {X Y Z ZERO} PARAM 0{} {X Y Z ZERO} o_inst->op = MAKE_VSF_OP(R200_VPI_OUT_OP_DOT, t_dst(&dst), t_dst_mask(dst.WriteMask)); @@ -805,7 +805,7 @@ else { o_inst->src2 = UNUSED_SRC_1; goto next; - case OPCODE_DPH://DOT RESULT 1.X Y Z W PARAM 0{} {X Y Z ONE} PARAM 0{} {X Y Z W} + case OPCODE_DPH://DOT RESULT 1.X Y Z W PARAM 0{} {X Y Z ONE} PARAM 0{} {X Y Z W} o_inst->op = MAKE_VSF_OP(R200_VPI_OUT_OP_DOT, t_dst(&dst), t_dst_mask(dst.WriteMask)); @@ -851,7 +851,7 @@ else { goto next; case OPCODE_FLR: - /* FRC TMP 0.X Y Z W PARAM 0{} {X Y Z W} + /* FRC TMP 0.X Y Z W PARAM 0{} {X Y Z W} ADD RESULT 1.X Y Z W PARAM 0{} {X Y Z W} TMP 0{X Y Z W } {X Y Z W} neg Xneg Yneg Zneg W */ o_inst->op = MAKE_VSF_OP(R200_VPI_OUT_OP_FRC, @@ -1208,7 +1208,7 @@ r200NewProgram(struct gl_context *ctx, GLenum target, GLuint id) default: _mesa_problem(ctx, "Bad target in r200NewProgram"); } - return NULL; + return NULL; } diff --git a/src/mesa/drivers/dri/r200/r200_vertprog.h b/src/mesa/drivers/dri/r200/r200_vertprog.h index 4757f4b..544cce7 100644 --- a/src/mesa/drivers/dri/r200/r200_vertprog.h +++ b/src/mesa/drivers/dri/r200/r200_vertprog.h @@ -104,7 +104,7 @@ extern void r200SetupVertexProg( struct gl_context *ctx ); /* first CARD32 of an instruction */ -/* possible operations: +/* possible operations: DOT, MUL, ADD, MAD, FRC, MAX, MIN, SGE, SLT, EXP, LOG, LIT, POW, RCP, RSQ, EX2, LG2, MAD_2, ARL */ diff --git a/src/mesa/drivers/dri/r300/compiler/r500_fragprog.c b/src/mesa/drivers/dri/r300/compiler/r500_fragprog.c index 140eeed..d863102 100644 --- a/src/mesa/drivers/dri/r300/compiler/r500_fragprog.c +++ b/src/mesa/drivers/dri/r300/compiler/r500_fragprog.c @@ -322,7 +322,7 @@ void r500FragmentProgramDump(struct radeon_compiler *c, void *user) /* JUMP_FUNC JUMP_ANY*/ fprintf(stderr, "0x%02x %1x ", inst >> 8 & 0xff, (inst & R500_FC_JUMP_ANY) >> 5); - + /* OP */ switch(inst & 0x7){ case R500_FC_OP_JUMP: @@ -350,7 +350,7 @@ void r500FragmentProgramDump(struct radeon_compiler *c, void *user) fprintf(stderr, "CONTINUE"); break; } - fprintf(stderr," "); + fprintf(stderr," "); /* A_OP */ switch(inst & (0x3 << 6)){ case R500_FC_A_OP_NONE: @@ -367,7 +367,7 @@ void r500FragmentProgramDump(struct radeon_compiler *c, void *user) for(i=0; i<2; i++){ fprintf(stderr, " "); switch(inst & (0x3 << (24 + (i * 2)))){ - /* R500_FC_B_OP0_NONE + /* R500_FC_B_OP0_NONE * R500_FC_B_OP1_NONE */ case 0: fprintf(stderr, "NONE"); @@ -387,14 +387,14 @@ void r500FragmentProgramDump(struct radeon_compiler *c, void *user) inst = code->inst[n].inst3; /* JUMP_ADDR */ fprintf(stderr, " %d", inst >> 16); - + if(code->inst[n].inst2 & R500_FC_IGNORE_UNCOVERED){ fprintf(stderr, " IGN_UNC"); } inst = code->inst[n].inst3; fprintf(stderr, "\n\t3:FC_ADDR 0x%08x:", inst); fprintf(stderr, "BOOL: 0x%02x, INT: 0x%02x, JUMP_ADDR: %d, JMP_GLBL: %1x\n", - inst & 0x1f, (inst >> 8) & 0x1f, (inst >> 16) & 0x1ff, inst >> 31); + inst & 0x1f, (inst >> 8) & 0x1f, (inst >> 16) & 0x1ff, inst >> 31); break; case R500_INST_TYPE_TEX: inst = code->inst[n].inst1; diff --git a/src/mesa/drivers/dri/r300/compiler/r500_fragprog_emit.c b/src/mesa/drivers/dri/r300/compiler/r500_fragprog_emit.c index d1086dd..1f36af2 100644 --- a/src/mesa/drivers/dri/r300/compiler/r500_fragprog_emit.c +++ b/src/mesa/drivers/dri/r300/compiler/r500_fragprog_emit.c @@ -524,7 +524,7 @@ static void emit_flowcontrol(struct emit_state * s, struct rc_instruction * inst /* actual instruction is filled in at ENDIF time */ break; - + case RC_OPCODE_ELSE: if (!s->CurrentBranchDepth) { rc_error(s->C, "%s: got ELSE outside a branch", __FUNCTION__); diff --git a/src/mesa/drivers/dri/r300/compiler/radeon_opcodes.h b/src/mesa/drivers/dri/r300/compiler/radeon_opcodes.h index 7e66610..6593948 100644 --- a/src/mesa/drivers/dri/r300/compiler/radeon_opcodes.h +++ b/src/mesa/drivers/dri/r300/compiler/radeon_opcodes.h @@ -189,7 +189,7 @@ typedef enum { /** branch instruction: has no effect */ RC_OPCODE_ENDIF, - + RC_OPCODE_BGNLOOP, RC_OPCODE_BRK, diff --git a/src/mesa/drivers/dri/r300/compiler/radeon_optimize.c b/src/mesa/drivers/dri/r300/compiler/radeon_optimize.c index 44f4c0f..d90bb99 100644 --- a/src/mesa/drivers/dri/r300/compiler/radeon_optimize.c +++ b/src/mesa/drivers/dri/r300/compiler/radeon_optimize.c @@ -577,7 +577,7 @@ static void presub_replace_inv( * of the add instruction must have the constatnt 1 swizzle. This function * does not check const registers to see if their value is 1.0, so it should * be called after the constant_folding optimization. - * @return + * @return * 0 if the ADD instruction is still part of the program. * 1 if the ADD instruction is no longer part of the program. */ diff --git a/src/mesa/drivers/dri/r300/r300_blit.c b/src/mesa/drivers/dri/r300/r300_blit.c index 9fd8e8f..849fbaf 100644 --- a/src/mesa/drivers/dri/r300/r300_blit.c +++ b/src/mesa/drivers/dri/r300/r300_blit.c @@ -380,7 +380,7 @@ static void emit_vap_setup(struct r300_context *r300) ((((R300_SWIZZLE_SELECT_X << R300_SWIZZLE_SELECT_X_SHIFT) | (R300_SWIZZLE_SELECT_Y << R300_SWIZZLE_SELECT_Y_SHIFT) | (R300_SWIZZLE_SELECT_FP_ZERO << R300_SWIZZLE_SELECT_Z_SHIFT) | - (R300_SWIZZLE_SELECT_FP_ONE << R300_SWIZZLE_SELECT_W_SHIFT) | + (R300_SWIZZLE_SELECT_FP_ONE << R300_SWIZZLE_SELECT_W_SHIFT) | (0xf << R300_WRITE_ENA_SHIFT) ) << 0) | (((R300_SWIZZLE_SELECT_X << R300_SWIZZLE_SELECT_X_SHIFT) | (R300_SWIZZLE_SELECT_Y << R300_SWIZZLE_SELECT_Y_SHIFT) | diff --git a/src/mesa/drivers/dri/r300/r300_render.c b/src/mesa/drivers/dri/r300/r300_render.c index 44090ec..9e8fd8d 100644 --- a/src/mesa/drivers/dri/r300/r300_render.c +++ b/src/mesa/drivers/dri/r300/r300_render.c @@ -370,7 +370,7 @@ void r300RunRenderPrimitive(struct gl_context * ctx, int start, int end, int pri WARN_ONCE("did the impossible happen? we never aligned nr to dword\n"); return; } - + } r300FireEB(rmesa, nr, type, offset); diff --git a/src/mesa/drivers/dri/r300/r300_state.c b/src/mesa/drivers/dri/r300/r300_state.c index ab8c1df..2613449 100644 --- a/src/mesa/drivers/dri/r300/r300_state.c +++ b/src/mesa/drivers/dri/r300/r300_state.c @@ -2250,7 +2250,7 @@ static void r300SetupUsOutputFormat(struct gl_context *ctx) if (!rrb) { return; } - + switch (rrb->base.Format) { case MESA_FORMAT_RGBA5551: diff --git a/src/mesa/drivers/dri/r300/r300_texstate.c b/src/mesa/drivers/dri/r300/r300_texstate.c index ed9955b..157836f 100644 --- a/src/mesa/drivers/dri/r300/r300_texstate.c +++ b/src/mesa/drivers/dri/r300/r300_texstate.c @@ -344,7 +344,7 @@ GLboolean r300ValidateBuffers(struct gl_context * ctx) rrb->bo, 0, RADEON_GEM_DOMAIN_VRAM); } - + for (i = 0; i < ctx->Const.MaxTextureImageUnits; ++i) { radeonTexObj *t; @@ -454,7 +454,7 @@ void r300SetTexBuffer2(__DRIcontext *pDRICtx, GLint target, GLint texture_format /* Failed to BO for the buffer */ return; } - + _mesa_lock_texture(radeon->glCtx, texObj); if (t->bo) { radeon_bo_unref(t->bo); diff --git a/src/mesa/drivers/dri/r600/evergreen_chip.c b/src/mesa/drivers/dri/r600/evergreen_chip.c index 53dacbf..3f90221 100644 --- a/src/mesa/drivers/dri/r600/evergreen_chip.c +++ b/src/mesa/drivers/dri/r600/evergreen_chip.c @@ -21,7 +21,7 @@ /* * Authors: - * Richard Li , + * Richard Li , */ #include "main/imports.h" @@ -41,7 +41,7 @@ void evergreenCreateChip(context_t *context) { - EVERGREEN_CHIP_CONTEXT * evergreen = + EVERGREEN_CHIP_CONTEXT * evergreen = (EVERGREEN_CHIP_CONTEXT*) CALLOC(sizeof(EVERGREEN_CHIP_CONTEXT)); context->pChip = (void*)evergreen; @@ -134,7 +134,7 @@ static void evergreenSendTexState(struct gl_context *ctx, struct radeon_state_at radeon_print(RADEON_STATE, RADEON_VERBOSE, "%s\n", __func__); for (i = 0; i < R700_TEXTURE_NUMBERUNITS; i++) { - if (ctx->Texture.Unit[i]._ReallyEnabled) { + if (ctx->Texture.Unit[i]._ReallyEnabled) { radeonTexObj *t = evergreen->textures[i]; if (t) { @@ -144,18 +144,18 @@ static void evergreenSendTexState(struct gl_context *ctx, struct radeon_state_at } else { bo = t->bo; } - if (bo) - { + if (bo) + { r700SyncSurf(context, bo, RADEON_GEM_DOMAIN_GTT|RADEON_GEM_DOMAIN_VRAM, - 0, TC_ACTION_ENA_bit); + 0, TC_ACTION_ENA_bit); BEGIN_BATCH_NO_AUTOSTATE(10 + 4); R600_OUT_BATCH(CP_PACKET3(R600_IT_SET_RESOURCE, 8)); - if( (1<r700AsmCode.unVetTexBits ) - { /* vs texture */ + if( (1<r700AsmCode.unVetTexBits ) + { /* vs texture */ R600_OUT_BATCH((i + VERT_ATTRIB_MAX + EG_SQ_FETCH_RESOURCE_VS_OFFSET) * EG_FETCH_RESOURCE_STRIDE); } else @@ -186,10 +186,10 @@ static void evergreenSendTexState(struct gl_context *ctx, struct radeon_state_at /* Tex sampler */ BEGIN_BATCH_NO_AUTOSTATE(5); R600_OUT_BATCH(CP_PACKET3(R600_IT_SET_SAMPLER, 3)); - - if( (1<r700AsmCode.unVetTexBits ) + + if( (1<r700AsmCode.unVetTexBits ) { /* vs texture */ - R600_OUT_BATCH((i+SQ_TEX_SAMPLER_VS_OFFSET) * 3); + R600_OUT_BATCH((i+SQ_TEX_SAMPLER_VS_OFFSET) * 3); } else { @@ -243,7 +243,7 @@ static void evergreenSendSQConfig(struct gl_context *ctx, struct radeon_state_at context_t *context = EVERGREEN_CONTEXT(ctx); EVERGREEN_CHIP_CONTEXT *evergreen = GET_EVERGREEN_CHIP(context); BATCH_LOCALS(&context->radeon); - radeon_print(RADEON_STATE, RADEON_VERBOSE, "%s\n", __func__); + radeon_print(RADEON_STATE, RADEON_VERBOSE, "%s\n", __func__); BEGIN_BATCH_NO_AUTOSTATE(19); //6 @@ -297,16 +297,16 @@ static void evergreenSetupVTXConstants(struct gl_context * ctx, //uSQ_VTX_CONSTANT_WORD1_0 uSQ_VTX_CONSTANT_WORD1_0 = paos->bo->size - paos->offset - 1; - + //uSQ_VTX_CONSTANT_WORD2_0 - SETfield(uSQ_VTX_CONSTANT_WORD2_0, - pStreamDesc->stride, - SQ_VTX_CONSTANT_WORD2_0__STRIDE_shift, + SETfield(uSQ_VTX_CONSTANT_WORD2_0, + pStreamDesc->stride, + SQ_VTX_CONSTANT_WORD2_0__STRIDE_shift, SQ_VTX_CONSTANT_WORD2_0__STRIDE_mask); SETfield(uSQ_VTX_CONSTANT_WORD2_0, GetSurfaceFormat(pStreamDesc->type, pStreamDesc->size, NULL), SQ_VTX_CONSTANT_WORD2_0__DATA_FORMAT_shift, - SQ_VTX_CONSTANT_WORD2_0__DATA_FORMAT_mask); // TODO : trace back api for initial data type, not only GL_FLOAT - SETfield(uSQ_VTX_CONSTANT_WORD2_0, 0, BASE_ADDRESS_HI_shift, BASE_ADDRESS_HI_mask); // TODO + SQ_VTX_CONSTANT_WORD2_0__DATA_FORMAT_mask); // TODO : trace back api for initial data type, not only GL_FLOAT + SETfield(uSQ_VTX_CONSTANT_WORD2_0, 0, BASE_ADDRESS_HI_shift, BASE_ADDRESS_HI_mask); // TODO if(GL_TRUE == pStreamDesc->normalize) { SETfield(uSQ_VTX_CONSTANT_WORD2_0, SQ_NUM_FORMAT_NORM, @@ -323,17 +323,17 @@ static void evergreenSetupVTXConstants(struct gl_context * ctx, } //uSQ_VTX_CONSTANT_WORD3_0 - SETfield(uSQ_VTX_CONSTANT_WORD3_0, SQ_SEL_X, - EG_SQ_VTX_CONSTANT_WORD3_0__DST_SEL_X_shift, + SETfield(uSQ_VTX_CONSTANT_WORD3_0, SQ_SEL_X, + EG_SQ_VTX_CONSTANT_WORD3_0__DST_SEL_X_shift, EG_SQ_VTX_CONSTANT_WORD3_0__DST_SEL_X_mask); - SETfield(uSQ_VTX_CONSTANT_WORD3_0, SQ_SEL_Y, - EG_SQ_VTX_CONSTANT_WORD3_0__DST_SEL_Y_shift, + SETfield(uSQ_VTX_CONSTANT_WORD3_0, SQ_SEL_Y, + EG_SQ_VTX_CONSTANT_WORD3_0__DST_SEL_Y_shift, EG_SQ_VTX_CONSTANT_WORD3_0__DST_SEL_Y_mask); - SETfield(uSQ_VTX_CONSTANT_WORD3_0, SQ_SEL_Z, - EG_SQ_VTX_CONSTANT_WORD3_0__DST_SEL_Z_shift, + SETfield(uSQ_VTX_CONSTANT_WORD3_0, SQ_SEL_Z, + EG_SQ_VTX_CONSTANT_WORD3_0__DST_SEL_Z_shift, EG_SQ_VTX_CONSTANT_WORD3_0__DST_SEL_Z_mask); - SETfield(uSQ_VTX_CONSTANT_WORD3_0, SQ_SEL_W, - EG_SQ_VTX_CONSTANT_WORD3_0__DST_SEL_W_shift, + SETfield(uSQ_VTX_CONSTANT_WORD3_0, SQ_SEL_W, + EG_SQ_VTX_CONSTANT_WORD3_0__DST_SEL_W_shift, EG_SQ_VTX_CONSTANT_WORD3_0__DST_SEL_W_mask); //uSQ_VTX_CONSTANT_WORD7_0 @@ -357,7 +357,7 @@ static void evergreenSetupVTXConstants(struct gl_context * ctx, uSQ_VTX_CONSTANT_WORD0_0, RADEON_GEM_DOMAIN_GTT, 0, 0); END_BATCH(); - + COMMIT_BATCH(); } @@ -374,7 +374,7 @@ static int check_evergreen_vtx(struct gl_context *ctx, struct radeon_state_atom } static void evergreenSendVTX(struct gl_context *ctx, struct radeon_state_atom *atom) -{ +{ context_t *context = EVERGREEN_CONTEXT(ctx); struct evergreen_vertex_program *vp = (struct evergreen_vertex_program *)(context->selected_vp); unsigned int i, j = 0; @@ -408,54 +408,54 @@ static void evergreenSendPA(struct gl_context *ctx, struct radeon_state_atom *at BEGIN_BATCH_NO_AUTOSTATE(22); EVERGREEN_OUT_BATCH_REGSEQ(EG_PA_SC_SCREEN_SCISSOR_TL, 2); - R600_OUT_BATCH(evergreen->PA_SC_SCREEN_SCISSOR_TL.u32All); - R600_OUT_BATCH(evergreen->PA_SC_SCREEN_SCISSOR_BR.u32All); + R600_OUT_BATCH(evergreen->PA_SC_SCREEN_SCISSOR_TL.u32All); + R600_OUT_BATCH(evergreen->PA_SC_SCREEN_SCISSOR_BR.u32All); EVERGREEN_OUT_BATCH_REGSEQ(EG_PA_SC_WINDOW_OFFSET, 12); - R600_OUT_BATCH(evergreen->PA_SC_WINDOW_OFFSET.u32All); - R600_OUT_BATCH(evergreen->PA_SC_WINDOW_SCISSOR_TL.u32All); - R600_OUT_BATCH(evergreen->PA_SC_WINDOW_SCISSOR_BR.u32All); - R600_OUT_BATCH(evergreen->PA_SC_CLIPRECT_RULE.u32All); - R600_OUT_BATCH(evergreen->PA_SC_CLIPRECT_0_TL.u32All); - R600_OUT_BATCH(evergreen->PA_SC_CLIPRECT_0_BR.u32All); - R600_OUT_BATCH(evergreen->PA_SC_CLIPRECT_1_TL.u32All); - R600_OUT_BATCH(evergreen->PA_SC_CLIPRECT_1_BR.u32All); - R600_OUT_BATCH(evergreen->PA_SC_CLIPRECT_2_TL.u32All); - R600_OUT_BATCH(evergreen->PA_SC_CLIPRECT_2_BR.u32All); - R600_OUT_BATCH(evergreen->PA_SC_CLIPRECT_3_TL.u32All); - R600_OUT_BATCH(evergreen->PA_SC_CLIPRECT_3_BR.u32All); - + R600_OUT_BATCH(evergreen->PA_SC_WINDOW_OFFSET.u32All); + R600_OUT_BATCH(evergreen->PA_SC_WINDOW_SCISSOR_TL.u32All); + R600_OUT_BATCH(evergreen->PA_SC_WINDOW_SCISSOR_BR.u32All); + R600_OUT_BATCH(evergreen->PA_SC_CLIPRECT_RULE.u32All); + R600_OUT_BATCH(evergreen->PA_SC_CLIPRECT_0_TL.u32All); + R600_OUT_BATCH(evergreen->PA_SC_CLIPRECT_0_BR.u32All); + R600_OUT_BATCH(evergreen->PA_SC_CLIPRECT_1_TL.u32All); + R600_OUT_BATCH(evergreen->PA_SC_CLIPRECT_1_BR.u32All); + R600_OUT_BATCH(evergreen->PA_SC_CLIPRECT_2_TL.u32All); + R600_OUT_BATCH(evergreen->PA_SC_CLIPRECT_2_BR.u32All); + R600_OUT_BATCH(evergreen->PA_SC_CLIPRECT_3_TL.u32All); + R600_OUT_BATCH(evergreen->PA_SC_CLIPRECT_3_BR.u32All); + EVERGREEN_OUT_BATCH_REGSEQ(EG_PA_SC_GENERIC_SCISSOR_TL, 2); - R600_OUT_BATCH(evergreen->PA_SC_GENERIC_SCISSOR_TL.u32All); - R600_OUT_BATCH(evergreen->PA_SC_GENERIC_SCISSOR_BR.u32All); + R600_OUT_BATCH(evergreen->PA_SC_GENERIC_SCISSOR_TL.u32All); + R600_OUT_BATCH(evergreen->PA_SC_GENERIC_SCISSOR_BR.u32All); END_BATCH(); BEGIN_BATCH_NO_AUTOSTATE(3); EVERGREEN_OUT_BATCH_REGVAL(EG_PA_SC_EDGERULE, evergreen->PA_SC_EDGERULE.u32All); END_BATCH(); - + BEGIN_BATCH_NO_AUTOSTATE(18); EVERGREEN_OUT_BATCH_REGSEQ(EG_PA_SC_VPORT_SCISSOR_0_TL, 4); - R600_OUT_BATCH(evergreen->viewport[id].PA_SC_VPORT_SCISSOR_0_TL.u32All); - R600_OUT_BATCH(evergreen->viewport[id].PA_SC_VPORT_SCISSOR_0_BR.u32All); - R600_OUT_BATCH(evergreen->viewport[id].PA_SC_VPORT_SCISSOR_0_TL.u32All); - R600_OUT_BATCH(evergreen->viewport[id].PA_SC_VPORT_SCISSOR_0_BR.u32All); + R600_OUT_BATCH(evergreen->viewport[id].PA_SC_VPORT_SCISSOR_0_TL.u32All); + R600_OUT_BATCH(evergreen->viewport[id].PA_SC_VPORT_SCISSOR_0_BR.u32All); + R600_OUT_BATCH(evergreen->viewport[id].PA_SC_VPORT_SCISSOR_0_TL.u32All); + R600_OUT_BATCH(evergreen->viewport[id].PA_SC_VPORT_SCISSOR_0_BR.u32All); EVERGREEN_OUT_BATCH_REGSEQ(EG_PA_SC_VPORT_ZMIN_0, 2); - R600_OUT_BATCH(evergreen->viewport[id].PA_SC_VPORT_ZMIN_0.u32All); - R600_OUT_BATCH(evergreen->viewport[id].PA_SC_VPORT_ZMAX_0.u32All); + R600_OUT_BATCH(evergreen->viewport[id].PA_SC_VPORT_ZMIN_0.u32All); + R600_OUT_BATCH(evergreen->viewport[id].PA_SC_VPORT_ZMAX_0.u32All); EVERGREEN_OUT_BATCH_REGSEQ(EG_PA_CL_VPORT_XSCALE, 6); - R600_OUT_BATCH(evergreen->viewport[id].PA_CL_VPORT_XSCALE.u32All); - R600_OUT_BATCH(evergreen->viewport[id].PA_CL_VPORT_XOFFSET.u32All); - R600_OUT_BATCH(evergreen->viewport[id].PA_CL_VPORT_YSCALE.u32All); - R600_OUT_BATCH(evergreen->viewport[id].PA_CL_VPORT_YOFFSET.u32All); - R600_OUT_BATCH(evergreen->viewport[id].PA_CL_VPORT_ZSCALE.u32All); - R600_OUT_BATCH(evergreen->viewport[id].PA_CL_VPORT_ZOFFSET.u32All); + R600_OUT_BATCH(evergreen->viewport[id].PA_CL_VPORT_XSCALE.u32All); + R600_OUT_BATCH(evergreen->viewport[id].PA_CL_VPORT_XOFFSET.u32All); + R600_OUT_BATCH(evergreen->viewport[id].PA_CL_VPORT_YSCALE.u32All); + R600_OUT_BATCH(evergreen->viewport[id].PA_CL_VPORT_YOFFSET.u32All); + R600_OUT_BATCH(evergreen->viewport[id].PA_CL_VPORT_ZSCALE.u32All); + R600_OUT_BATCH(evergreen->viewport[id].PA_CL_VPORT_ZOFFSET.u32All); END_BATCH(); - + for (id = 0; id < EVERGREEN_MAX_UCP; id++) { if (evergreen->ucp[id].enabled) { BEGIN_BATCH_NO_AUTOSTATE(6); @@ -464,53 +464,53 @@ static void evergreenSendPA(struct gl_context *ctx, struct radeon_state_atom *at R600_OUT_BATCH(evergreen->ucp[id].PA_CL_UCP_0_Y.u32All); R600_OUT_BATCH(evergreen->ucp[id].PA_CL_UCP_0_Z.u32All); R600_OUT_BATCH(evergreen->ucp[id].PA_CL_UCP_0_W.u32All); - END_BATCH(); + END_BATCH(); } } BEGIN_BATCH_NO_AUTOSTATE(42); EVERGREEN_OUT_BATCH_REGSEQ(EG_PA_CL_CLIP_CNTL, 5); - R600_OUT_BATCH(evergreen->PA_CL_CLIP_CNTL.u32All); - R600_OUT_BATCH(evergreen->PA_SU_SC_MODE_CNTL.u32All); - R600_OUT_BATCH(evergreen->PA_CL_VTE_CNTL.u32All); - R600_OUT_BATCH(evergreen->PA_CL_VS_OUT_CNTL.u32All); - R600_OUT_BATCH(evergreen->PA_CL_NANINF_CNTL.u32All); - + R600_OUT_BATCH(evergreen->PA_CL_CLIP_CNTL.u32All); + R600_OUT_BATCH(evergreen->PA_SU_SC_MODE_CNTL.u32All); + R600_OUT_BATCH(evergreen->PA_CL_VTE_CNTL.u32All); + R600_OUT_BATCH(evergreen->PA_CL_VS_OUT_CNTL.u32All); + R600_OUT_BATCH(evergreen->PA_CL_NANINF_CNTL.u32All); + EVERGREEN_OUT_BATCH_REGSEQ(EG_PA_SU_POINT_SIZE, 3); - R600_OUT_BATCH(evergreen->PA_SU_POINT_SIZE.u32All); - R600_OUT_BATCH(evergreen->PA_SU_POINT_MINMAX.u32All); - R600_OUT_BATCH(evergreen->PA_SU_LINE_CNTL.u32All); - + R600_OUT_BATCH(evergreen->PA_SU_POINT_SIZE.u32All); + R600_OUT_BATCH(evergreen->PA_SU_POINT_MINMAX.u32All); + R600_OUT_BATCH(evergreen->PA_SU_LINE_CNTL.u32All); + EVERGREEN_OUT_BATCH_REGSEQ(EG_PA_SC_MODE_CNTL_0, 2); - R600_OUT_BATCH(evergreen->PA_SC_MODE_CNTL_0.u32All); - R600_OUT_BATCH(evergreen->PA_SC_MODE_CNTL_1.u32All); + R600_OUT_BATCH(evergreen->PA_SC_MODE_CNTL_0.u32All); + R600_OUT_BATCH(evergreen->PA_SC_MODE_CNTL_1.u32All); EVERGREEN_OUT_BATCH_REGSEQ(EG_PA_SU_POLY_OFFSET_DB_FMT_CNTL, 6); - R600_OUT_BATCH(evergreen->PA_SU_POLY_OFFSET_DB_FMT_CNTL.u32All); - R600_OUT_BATCH(evergreen->PA_SU_POLY_OFFSET_CLAMP.u32All); - R600_OUT_BATCH(evergreen->PA_SU_POLY_OFFSET_FRONT_SCALE.u32All); - R600_OUT_BATCH(evergreen->PA_SU_POLY_OFFSET_FRONT_OFFSET.u32All); - R600_OUT_BATCH(evergreen->PA_SU_POLY_OFFSET_BACK_SCALE.u32All); - R600_OUT_BATCH(evergreen->PA_SU_POLY_OFFSET_BACK_OFFSET.u32All); + R600_OUT_BATCH(evergreen->PA_SU_POLY_OFFSET_DB_FMT_CNTL.u32All); + R600_OUT_BATCH(evergreen->PA_SU_POLY_OFFSET_CLAMP.u32All); + R600_OUT_BATCH(evergreen->PA_SU_POLY_OFFSET_FRONT_SCALE.u32All); + R600_OUT_BATCH(evergreen->PA_SU_POLY_OFFSET_FRONT_OFFSET.u32All); + R600_OUT_BATCH(evergreen->PA_SU_POLY_OFFSET_BACK_SCALE.u32All); + R600_OUT_BATCH(evergreen->PA_SU_POLY_OFFSET_BACK_OFFSET.u32All); EVERGREEN_OUT_BATCH_REGSEQ(EG_PA_SC_LINE_CNTL, 16); - R600_OUT_BATCH(evergreen->PA_SC_LINE_CNTL.u32All); - R600_OUT_BATCH(evergreen->PA_SC_AA_CONFIG.u32All); - R600_OUT_BATCH(evergreen->PA_SU_VTX_CNTL.u32All); - R600_OUT_BATCH(evergreen->PA_CL_GB_VERT_CLIP_ADJ.u32All); - R600_OUT_BATCH(evergreen->PA_CL_GB_VERT_DISC_ADJ.u32All); - R600_OUT_BATCH(evergreen->PA_CL_GB_HORZ_CLIP_ADJ.u32All); - R600_OUT_BATCH(evergreen->PA_CL_GB_HORZ_DISC_ADJ.u32All); - R600_OUT_BATCH(evergreen->PA_SC_AA_SAMPLE_LOCS_0.u32All); - R600_OUT_BATCH(evergreen->PA_SC_AA_SAMPLE_LOCS_1.u32All); - R600_OUT_BATCH(evergreen->PA_SC_AA_SAMPLE_LOCS_2.u32All); - R600_OUT_BATCH(evergreen->PA_SC_AA_SAMPLE_LOCS_3.u32All); - R600_OUT_BATCH(evergreen->PA_SC_AA_SAMPLE_LOCS_4.u32All); - R600_OUT_BATCH(evergreen->PA_SC_AA_SAMPLE_LOCS_5.u32All); - R600_OUT_BATCH(evergreen->PA_SC_AA_SAMPLE_LOCS_6.u32All); - R600_OUT_BATCH(evergreen->PA_SC_AA_SAMPLE_LOCS_7.u32All); - R600_OUT_BATCH(evergreen->PA_SC_AA_MASK.u32All); - + R600_OUT_BATCH(evergreen->PA_SC_LINE_CNTL.u32All); + R600_OUT_BATCH(evergreen->PA_SC_AA_CONFIG.u32All); + R600_OUT_BATCH(evergreen->PA_SU_VTX_CNTL.u32All); + R600_OUT_BATCH(evergreen->PA_CL_GB_VERT_CLIP_ADJ.u32All); + R600_OUT_BATCH(evergreen->PA_CL_GB_VERT_DISC_ADJ.u32All); + R600_OUT_BATCH(evergreen->PA_CL_GB_HORZ_CLIP_ADJ.u32All); + R600_OUT_BATCH(evergreen->PA_CL_GB_HORZ_DISC_ADJ.u32All); + R600_OUT_BATCH(evergreen->PA_SC_AA_SAMPLE_LOCS_0.u32All); + R600_OUT_BATCH(evergreen->PA_SC_AA_SAMPLE_LOCS_1.u32All); + R600_OUT_BATCH(evergreen->PA_SC_AA_SAMPLE_LOCS_2.u32All); + R600_OUT_BATCH(evergreen->PA_SC_AA_SAMPLE_LOCS_3.u32All); + R600_OUT_BATCH(evergreen->PA_SC_AA_SAMPLE_LOCS_4.u32All); + R600_OUT_BATCH(evergreen->PA_SC_AA_SAMPLE_LOCS_5.u32All); + R600_OUT_BATCH(evergreen->PA_SC_AA_SAMPLE_LOCS_6.u32All); + R600_OUT_BATCH(evergreen->PA_SC_AA_SAMPLE_LOCS_7.u32All); + R600_OUT_BATCH(evergreen->PA_SC_AA_MASK.u32All); + END_BATCH(); COMMIT_BATCH(); @@ -528,7 +528,7 @@ static void evergreenSendTP(struct gl_context *ctx, struct radeon_state_atom *at } static void evergreenSendPSresource(struct gl_context *ctx) -{ +{ context_t *context = EVERGREEN_CONTEXT(ctx); EVERGREEN_CHIP_CONTEXT *evergreen = GET_EVERGREEN_CHIP(context); struct radeon_bo * pbo; @@ -554,36 +554,36 @@ static void evergreenSendPSresource(struct gl_context *ctx) evergreen->ps.SQ_PGM_START_PS.u32All, RADEON_GEM_DOMAIN_GTT, 0, 0); END_BATCH(); - + BEGIN_BATCH_NO_AUTOSTATE(3); EVERGREEN_OUT_BATCH_REGVAL(EG_SQ_LOOP_CONST_0, 0x01000FFF); END_BATCH(); pbo_const = (struct radeon_bo *)(context->fp_Constbo); - + if(NULL != pbo_const) - { - r700SyncSurf(context, pbo_const, RADEON_GEM_DOMAIN_GTT, 0, SH_ACTION_ENA_bit); + { + r700SyncSurf(context, pbo_const, RADEON_GEM_DOMAIN_GTT, 0, SH_ACTION_ENA_bit); BEGIN_BATCH_NO_AUTOSTATE(3); EVERGREEN_OUT_BATCH_REGVAL(EG_SQ_ALU_CONST_BUFFER_SIZE_PS_0, const_size / 16); END_BATCH(); - BEGIN_BATCH_NO_AUTOSTATE(3 + 2); + BEGIN_BATCH_NO_AUTOSTATE(3 + 2); EVERGREEN_OUT_BATCH_REGSEQ(EG_SQ_ALU_CONST_CACHE_PS_0, 1); R600_OUT_BATCH(context->fp_bo_offset >> 8); R600_OUT_BATCH_RELOC(0, pbo_const, 0, RADEON_GEM_DOMAIN_GTT, 0, 0); - END_BATCH(); - } + END_BATCH(); + } - COMMIT_BATCH(); + COMMIT_BATCH(); } static void evergreenSendVSresource(struct gl_context *ctx, struct radeon_state_atom *atom) -{ +{ context_t *context = EVERGREEN_CONTEXT(ctx); EVERGREEN_CHIP_CONTEXT *evergreen = GET_EVERGREEN_CHIP(context); struct radeon_bo * pbo; @@ -597,7 +597,7 @@ static void evergreenSendVSresource(struct gl_context *ctx, struct radeon_state_ pbo = (struct radeon_bo *)evergreenGetActiveVpShaderBo(GL_CONTEXT(context)); if (!pbo) - return; + return; r700SyncSurf(context, pbo, RADEON_GEM_DOMAIN_GTT, 0, SH_ACTION_ENA_bit); @@ -614,28 +614,28 @@ static void evergreenSendVSresource(struct gl_context *ctx, struct radeon_state_ EVERGREEN_OUT_BATCH_REGVAL((EG_SQ_LOOP_CONST_0 + 32*1), 0x0100000F); //consts == 1 //EVERGREEN_OUT_BATCH_REGVAL((EG_SQ_LOOP_CONST_0 + (SQ_LOOP_CONST_vs<2)), 0x0100000F); END_BATCH(); - - pbo_const = (struct radeon_bo *)(context->vp_Constbo); + + pbo_const = (struct radeon_bo *)(context->vp_Constbo); if(NULL != pbo_const) - { + { r700SyncSurf(context, pbo_const, RADEON_GEM_DOMAIN_GTT, 0, SH_ACTION_ENA_bit); BEGIN_BATCH_NO_AUTOSTATE(3); EVERGREEN_OUT_BATCH_REGVAL(EG_SQ_ALU_CONST_BUFFER_SIZE_VS_0, const_size / 16); END_BATCH(); - BEGIN_BATCH_NO_AUTOSTATE(3 + 2); + BEGIN_BATCH_NO_AUTOSTATE(3 + 2); EVERGREEN_OUT_BATCH_REGSEQ(EG_SQ_ALU_CONST_CACHE_VS_0, 1); R600_OUT_BATCH(context->vp_bo_offset >> 8); R600_OUT_BATCH_RELOC(0, pbo_const, 0, RADEON_GEM_DOMAIN_GTT, 0, 0); - END_BATCH(); - } + END_BATCH(); + } - COMMIT_BATCH(); + COMMIT_BATCH(); } static void evergreenSendSQ(struct gl_context *ctx, struct radeon_state_atom *atom) @@ -657,97 +657,97 @@ static void evergreenSendSQ(struct gl_context *ctx, struct radeon_state_atom *at R600_OUT_BATCH(evergreen->SQ_VTX_SEMANTIC_3.u32All); //// // = 0x2838C, // SAME R600_OUT_BATCH(evergreen->SQ_VTX_SEMANTIC_4.u32All); //// // = 0x28390, // SAME R600_OUT_BATCH(evergreen->SQ_VTX_SEMANTIC_5.u32All); //// // = 0x28394, // SAME - R600_OUT_BATCH(evergreen->SQ_VTX_SEMANTIC_6.u32All); //// // = 0x28398, // SAME - R600_OUT_BATCH(evergreen->SQ_VTX_SEMANTIC_7.u32All); //// // = 0x2839C, // SAME - R600_OUT_BATCH(evergreen->SQ_VTX_SEMANTIC_8.u32All); //// // = 0x283A0, // SAME - R600_OUT_BATCH(evergreen->SQ_VTX_SEMANTIC_9.u32All); //// // = 0x283A4, // SAME - R600_OUT_BATCH(evergreen->SQ_VTX_SEMANTIC_10.u32All); //// // = 0x283A8, // SAME - R600_OUT_BATCH(evergreen->SQ_VTX_SEMANTIC_11.u32All); //// // = 0x283AC, // SAME - R600_OUT_BATCH(evergreen->SQ_VTX_SEMANTIC_12.u32All); //// // = 0x283B0, // SAME - R600_OUT_BATCH(evergreen->SQ_VTX_SEMANTIC_13.u32All); //// // = 0x283B4, // SAME - R600_OUT_BATCH(evergreen->SQ_VTX_SEMANTIC_14.u32All); //// // = 0x283B8, // SAME - R600_OUT_BATCH(evergreen->SQ_VTX_SEMANTIC_15.u32All); //// // = 0x283BC, // SAME - R600_OUT_BATCH(evergreen->SQ_VTX_SEMANTIC_16.u32All); //// // = 0x283C0, // SAME - R600_OUT_BATCH(evergreen->SQ_VTX_SEMANTIC_17.u32All); //// // = 0x283C4, // SAME - R600_OUT_BATCH(evergreen->SQ_VTX_SEMANTIC_18.u32All); //// // = 0x283C8, // SAME - R600_OUT_BATCH(evergreen->SQ_VTX_SEMANTIC_19.u32All); //// // = 0x283CC, // SAME - R600_OUT_BATCH(evergreen->SQ_VTX_SEMANTIC_20.u32All); //// // = 0x283D0, // SAME - R600_OUT_BATCH(evergreen->SQ_VTX_SEMANTIC_21.u32All); //// // = 0x283D4, // SAME - R600_OUT_BATCH(evergreen->SQ_VTX_SEMANTIC_22.u32All); //// // = 0x283D8, // SAME - R600_OUT_BATCH(evergreen->SQ_VTX_SEMANTIC_23.u32All); //// // = 0x283DC, // SAME - R600_OUT_BATCH(evergreen->SQ_VTX_SEMANTIC_24.u32All); //// // = 0x283E0, // SAME - R600_OUT_BATCH(evergreen->SQ_VTX_SEMANTIC_25.u32All); //// // = 0x283E4, // SAME - R600_OUT_BATCH(evergreen->SQ_VTX_SEMANTIC_26.u32All); //// // = 0x283E8, // SAME - R600_OUT_BATCH(evergreen->SQ_VTX_SEMANTIC_27.u32All); //// // = 0x283EC, // SAME - R600_OUT_BATCH(evergreen->SQ_VTX_SEMANTIC_28.u32All); //// // = 0x283F0, // SAME - R600_OUT_BATCH(evergreen->SQ_VTX_SEMANTIC_29.u32All); //// // = 0x283F4, // SAME - R600_OUT_BATCH(evergreen->SQ_VTX_SEMANTIC_30.u32All); //// // = 0x283F8, // SAME - R600_OUT_BATCH(evergreen->SQ_VTX_SEMANTIC_31.u32All); //// // = 0x283FC, // SAME - + R600_OUT_BATCH(evergreen->SQ_VTX_SEMANTIC_6.u32All); //// // = 0x28398, // SAME + R600_OUT_BATCH(evergreen->SQ_VTX_SEMANTIC_7.u32All); //// // = 0x2839C, // SAME + R600_OUT_BATCH(evergreen->SQ_VTX_SEMANTIC_8.u32All); //// // = 0x283A0, // SAME + R600_OUT_BATCH(evergreen->SQ_VTX_SEMANTIC_9.u32All); //// // = 0x283A4, // SAME + R600_OUT_BATCH(evergreen->SQ_VTX_SEMANTIC_10.u32All); //// // = 0x283A8, // SAME + R600_OUT_BATCH(evergreen->SQ_VTX_SEMANTIC_11.u32All); //// // = 0x283AC, // SAME + R600_OUT_BATCH(evergreen->SQ_VTX_SEMANTIC_12.u32All); //// // = 0x283B0, // SAME + R600_OUT_BATCH(evergreen->SQ_VTX_SEMANTIC_13.u32All); //// // = 0x283B4, // SAME + R600_OUT_BATCH(evergreen->SQ_VTX_SEMANTIC_14.u32All); //// // = 0x283B8, // SAME + R600_OUT_BATCH(evergreen->SQ_VTX_SEMANTIC_15.u32All); //// // = 0x283BC, // SAME + R600_OUT_BATCH(evergreen->SQ_VTX_SEMANTIC_16.u32All); //// // = 0x283C0, // SAME + R600_OUT_BATCH(evergreen->SQ_VTX_SEMANTIC_17.u32All); //// // = 0x283C4, // SAME + R600_OUT_BATCH(evergreen->SQ_VTX_SEMANTIC_18.u32All); //// // = 0x283C8, // SAME + R600_OUT_BATCH(evergreen->SQ_VTX_SEMANTIC_19.u32All); //// // = 0x283CC, // SAME + R600_OUT_BATCH(evergreen->SQ_VTX_SEMANTIC_20.u32All); //// // = 0x283D0, // SAME + R600_OUT_BATCH(evergreen->SQ_VTX_SEMANTIC_21.u32All); //// // = 0x283D4, // SAME + R600_OUT_BATCH(evergreen->SQ_VTX_SEMANTIC_22.u32All); //// // = 0x283D8, // SAME + R600_OUT_BATCH(evergreen->SQ_VTX_SEMANTIC_23.u32All); //// // = 0x283DC, // SAME + R600_OUT_BATCH(evergreen->SQ_VTX_SEMANTIC_24.u32All); //// // = 0x283E0, // SAME + R600_OUT_BATCH(evergreen->SQ_VTX_SEMANTIC_25.u32All); //// // = 0x283E4, // SAME + R600_OUT_BATCH(evergreen->SQ_VTX_SEMANTIC_26.u32All); //// // = 0x283E8, // SAME + R600_OUT_BATCH(evergreen->SQ_VTX_SEMANTIC_27.u32All); //// // = 0x283EC, // SAME + R600_OUT_BATCH(evergreen->SQ_VTX_SEMANTIC_28.u32All); //// // = 0x283F0, // SAME + R600_OUT_BATCH(evergreen->SQ_VTX_SEMANTIC_29.u32All); //// // = 0x283F4, // SAME + R600_OUT_BATCH(evergreen->SQ_VTX_SEMANTIC_30.u32All); //// // = 0x283F8, // SAME + R600_OUT_BATCH(evergreen->SQ_VTX_SEMANTIC_31.u32All); //// // = 0x283FC, // SAME + //3 EVERGREEN_OUT_BATCH_REGSEQ(EG_SQ_DYN_GPR_RESOURCE_LIMIT_1, 1); - R600_OUT_BATCH(evergreen->SQ_DYN_GPR_RESOURCE_LIMIT_1.u32All);//// // = 0x28838, // - + R600_OUT_BATCH(evergreen->SQ_DYN_GPR_RESOURCE_LIMIT_1.u32All);//// // = 0x28838, // + //5 EVERGREEN_OUT_BATCH_REGSEQ(EG_SQ_PGM_RESOURCES_PS, 3); - R600_OUT_BATCH(evergreen->SQ_PGM_RESOURCES_PS.u32All); //// // = 0x28844, // DIFF 0x28850 - R600_OUT_BATCH(evergreen->SQ_PGM_RESOURCES_2_PS.u32All); //// // = 0x28848, // - R600_OUT_BATCH(evergreen->SQ_PGM_EXPORTS_PS.u32All); //// // = 0x2884C, // SAME 0x28854 - + R600_OUT_BATCH(evergreen->SQ_PGM_RESOURCES_PS.u32All); //// // = 0x28844, // DIFF 0x28850 + R600_OUT_BATCH(evergreen->SQ_PGM_RESOURCES_2_PS.u32All); //// // = 0x28848, // + R600_OUT_BATCH(evergreen->SQ_PGM_EXPORTS_PS.u32All); //// // = 0x2884C, // SAME 0x28854 + //4 EVERGREEN_OUT_BATCH_REGSEQ(EG_SQ_PGM_RESOURCES_VS, 2); - R600_OUT_BATCH(evergreen->SQ_PGM_RESOURCES_VS.u32All);//// // = 0x28860, // DIFF 0x28868 - R600_OUT_BATCH(evergreen->SQ_PGM_RESOURCES_2_VS.u32All); //// // = 0x28864, // + R600_OUT_BATCH(evergreen->SQ_PGM_RESOURCES_VS.u32All);//// // = 0x28860, // DIFF 0x28868 + R600_OUT_BATCH(evergreen->SQ_PGM_RESOURCES_2_VS.u32All); //// // = 0x28864, // //5 EVERGREEN_OUT_BATCH_REGSEQ(EG_SQ_PGM_RESOURCES_GS, 2); /* - R600_OUT_BATCH(evergreen->SQ_PGM_START_GS.u32All); //// // = 0x28874, // SAME 0x2886C + R600_OUT_BATCH(evergreen->SQ_PGM_START_GS.u32All); //// // = 0x28874, // SAME 0x2886C */ - R600_OUT_BATCH(evergreen->SQ_PGM_RESOURCES_GS.u32All); //// // = 0x28878, // DIFF 0x2887C - R600_OUT_BATCH(evergreen->SQ_PGM_RESOURCES_2_GS.u32All); //// // = 0x2887C, // + R600_OUT_BATCH(evergreen->SQ_PGM_RESOURCES_GS.u32All); //// // = 0x28878, // DIFF 0x2887C + R600_OUT_BATCH(evergreen->SQ_PGM_RESOURCES_2_GS.u32All); //// // = 0x2887C, // //5 EVERGREEN_OUT_BATCH_REGSEQ(EG_SQ_PGM_RESOURCES_ES, 2); /* - R600_OUT_BATCH(evergreen->SQ_PGM_START_ES.u32All); //// // = 0x2888C, // SAME 0x28880 + R600_OUT_BATCH(evergreen->SQ_PGM_START_ES.u32All); //// // = 0x2888C, // SAME 0x28880 */ - R600_OUT_BATCH(evergreen->SQ_PGM_RESOURCES_ES.u32All); //// // = 0x28890, // DIFF - R600_OUT_BATCH(evergreen->SQ_PGM_RESOURCES_2_ES.u32All); //// // = 0x28894, // + R600_OUT_BATCH(evergreen->SQ_PGM_RESOURCES_ES.u32All); //// // = 0x28890, // DIFF + R600_OUT_BATCH(evergreen->SQ_PGM_RESOURCES_2_ES.u32All); //// // = 0x28894, // //4 EVERGREEN_OUT_BATCH_REGSEQ(EG_SQ_PGM_RESOURCES_FS, 1); /* - R600_OUT_BATCH(evergreen->SQ_PGM_START_FS.u32All); //// // = 0x288A4, // SAME 0x28894 + R600_OUT_BATCH(evergreen->SQ_PGM_START_FS.u32All); //// // = 0x288A4, // SAME 0x28894 */ - R600_OUT_BATCH(evergreen->SQ_PGM_RESOURCES_FS.u32All); //// // = 0x288A8, // DIFF 0x288A4 - + R600_OUT_BATCH(evergreen->SQ_PGM_RESOURCES_FS.u32All); //// // = 0x288A8, // DIFF 0x288A4 + //3 EVERGREEN_OUT_BATCH_REGSEQ(EG_SQ_PGM_RESOURCES_2_HS, 1); - R600_OUT_BATCH(evergreen->SQ_PGM_RESOURCES_2_HS.u32All);//// // = 0x288C0, // - + R600_OUT_BATCH(evergreen->SQ_PGM_RESOURCES_2_HS.u32All);//// // = 0x288C0, // + //3 EVERGREEN_OUT_BATCH_REGSEQ(EG_SQ_PGM_RESOURCES_2_LS, 1); - R600_OUT_BATCH(evergreen->SQ_PGM_RESOURCES_2_LS.u32All); //// // = 0x288D8, // - + R600_OUT_BATCH(evergreen->SQ_PGM_RESOURCES_2_LS.u32All); //// // = 0x288D8, // + //3 EVERGREEN_OUT_BATCH_REGSEQ(EG_SQ_LDS_ALLOC_PS, 1); - R600_OUT_BATCH(evergreen->SQ_LDS_ALLOC_PS.u32All); //// // = 0x288EC, // - + R600_OUT_BATCH(evergreen->SQ_LDS_ALLOC_PS.u32All); //// // = 0x288EC, // + //8 EVERGREEN_OUT_BATCH_REGSEQ(EG_SQ_ESGS_RING_ITEMSIZE, 6); - R600_OUT_BATCH(evergreen->SQ_ESGS_RING_ITEMSIZE.u32All); //// // = 0x28900, // SAME 0x288A8 - R600_OUT_BATCH(evergreen->SQ_GSVS_RING_ITEMSIZE.u32All); //// // = 0x28904, // SAME 0x288AC - R600_OUT_BATCH(evergreen->SQ_ESTMP_RING_ITEMSIZE.u32All); //// // = 0x28908, // SAME 0x288B0 - R600_OUT_BATCH(evergreen->SQ_GSTMP_RING_ITEMSIZE.u32All); //// // = 0x2890C, // SAME 0x288B4 - R600_OUT_BATCH(evergreen->SQ_VSTMP_RING_ITEMSIZE.u32All); //// // = 0x28910, // SAME 0x288B8 - R600_OUT_BATCH(evergreen->SQ_PSTMP_RING_ITEMSIZE.u32All); //// // = 0x28914, // SAME 0x288BC + R600_OUT_BATCH(evergreen->SQ_ESGS_RING_ITEMSIZE.u32All); //// // = 0x28900, // SAME 0x288A8 + R600_OUT_BATCH(evergreen->SQ_GSVS_RING_ITEMSIZE.u32All); //// // = 0x28904, // SAME 0x288AC + R600_OUT_BATCH(evergreen->SQ_ESTMP_RING_ITEMSIZE.u32All); //// // = 0x28908, // SAME 0x288B0 + R600_OUT_BATCH(evergreen->SQ_GSTMP_RING_ITEMSIZE.u32All); //// // = 0x2890C, // SAME 0x288B4 + R600_OUT_BATCH(evergreen->SQ_VSTMP_RING_ITEMSIZE.u32All); //// // = 0x28910, // SAME 0x288B8 + R600_OUT_BATCH(evergreen->SQ_PSTMP_RING_ITEMSIZE.u32All); //// // = 0x28914, // SAME 0x288BC //3 EVERGREEN_OUT_BATCH_REGSEQ(EG_SQ_GS_VERT_ITEMSIZE, 1); - R600_OUT_BATCH(evergreen->SQ_GS_VERT_ITEMSIZE.u32All); //// // = 0x2891C, // SAME 0x288C8 - + R600_OUT_BATCH(evergreen->SQ_GS_VERT_ITEMSIZE.u32All); //// // = 0x2891C, // SAME 0x288C8 + END_BATCH(); COMMIT_BATCH(); @@ -763,63 +763,63 @@ static void evergreenSendSPI(struct gl_context *ctx, struct radeon_state_atom *a BEGIN_BATCH_NO_AUTOSTATE(59); EVERGREEN_OUT_BATCH_REGSEQ(EG_SPI_VS_OUT_ID_0, 10); - R600_OUT_BATCH(evergreen->SPI_VS_OUT_ID_0.u32All); - R600_OUT_BATCH(evergreen->SPI_VS_OUT_ID_1.u32All); - R600_OUT_BATCH(evergreen->SPI_VS_OUT_ID_2.u32All); - R600_OUT_BATCH(evergreen->SPI_VS_OUT_ID_3.u32All); - R600_OUT_BATCH(evergreen->SPI_VS_OUT_ID_4.u32All); - R600_OUT_BATCH(evergreen->SPI_VS_OUT_ID_5.u32All); - R600_OUT_BATCH(evergreen->SPI_VS_OUT_ID_6.u32All); - R600_OUT_BATCH(evergreen->SPI_VS_OUT_ID_7.u32All); - R600_OUT_BATCH(evergreen->SPI_VS_OUT_ID_8.u32All); - R600_OUT_BATCH(evergreen->SPI_VS_OUT_ID_9.u32All); + R600_OUT_BATCH(evergreen->SPI_VS_OUT_ID_0.u32All); + R600_OUT_BATCH(evergreen->SPI_VS_OUT_ID_1.u32All); + R600_OUT_BATCH(evergreen->SPI_VS_OUT_ID_2.u32All); + R600_OUT_BATCH(evergreen->SPI_VS_OUT_ID_3.u32All); + R600_OUT_BATCH(evergreen->SPI_VS_OUT_ID_4.u32All); + R600_OUT_BATCH(evergreen->SPI_VS_OUT_ID_5.u32All); + R600_OUT_BATCH(evergreen->SPI_VS_OUT_ID_6.u32All); + R600_OUT_BATCH(evergreen->SPI_VS_OUT_ID_7.u32All); + R600_OUT_BATCH(evergreen->SPI_VS_OUT_ID_8.u32All); + R600_OUT_BATCH(evergreen->SPI_VS_OUT_ID_9.u32All); EVERGREEN_OUT_BATCH_REGSEQ(EG_SPI_PS_INPUT_CNTL_0, 45); R600_OUT_BATCH(evergreen->SPI_PS_INPUT_CNTL[0].u32All); - R600_OUT_BATCH(evergreen->SPI_PS_INPUT_CNTL[1].u32All); - R600_OUT_BATCH(evergreen->SPI_PS_INPUT_CNTL[2].u32All); - R600_OUT_BATCH(evergreen->SPI_PS_INPUT_CNTL[3].u32All); - R600_OUT_BATCH(evergreen->SPI_PS_INPUT_CNTL[4].u32All); - R600_OUT_BATCH(evergreen->SPI_PS_INPUT_CNTL[5].u32All); - R600_OUT_BATCH(evergreen->SPI_PS_INPUT_CNTL[6].u32All); - R600_OUT_BATCH(evergreen->SPI_PS_INPUT_CNTL[7].u32All); - R600_OUT_BATCH(evergreen->SPI_PS_INPUT_CNTL[8].u32All); - R600_OUT_BATCH(evergreen->SPI_PS_INPUT_CNTL[9].u32All); + R600_OUT_BATCH(evergreen->SPI_PS_INPUT_CNTL[1].u32All); + R600_OUT_BATCH(evergreen->SPI_PS_INPUT_CNTL[2].u32All); + R600_OUT_BATCH(evergreen->SPI_PS_INPUT_CNTL[3].u32All); + R600_OUT_BATCH(evergreen->SPI_PS_INPUT_CNTL[4].u32All); + R600_OUT_BATCH(evergreen->SPI_PS_INPUT_CNTL[5].u32All); + R600_OUT_BATCH(evergreen->SPI_PS_INPUT_CNTL[6].u32All); + R600_OUT_BATCH(evergreen->SPI_PS_INPUT_CNTL[7].u32All); + R600_OUT_BATCH(evergreen->SPI_PS_INPUT_CNTL[8].u32All); + R600_OUT_BATCH(evergreen->SPI_PS_INPUT_CNTL[9].u32All); R600_OUT_BATCH(evergreen->SPI_PS_INPUT_CNTL[10].u32All); - R600_OUT_BATCH(evergreen->SPI_PS_INPUT_CNTL[11].u32All); - R600_OUT_BATCH(evergreen->SPI_PS_INPUT_CNTL[12].u32All); - R600_OUT_BATCH(evergreen->SPI_PS_INPUT_CNTL[13].u32All); - R600_OUT_BATCH(evergreen->SPI_PS_INPUT_CNTL[14].u32All); - R600_OUT_BATCH(evergreen->SPI_PS_INPUT_CNTL[15].u32All); - R600_OUT_BATCH(evergreen->SPI_PS_INPUT_CNTL[16].u32All); - R600_OUT_BATCH(evergreen->SPI_PS_INPUT_CNTL[17].u32All); - R600_OUT_BATCH(evergreen->SPI_PS_INPUT_CNTL[18].u32All); + R600_OUT_BATCH(evergreen->SPI_PS_INPUT_CNTL[11].u32All); + R600_OUT_BATCH(evergreen->SPI_PS_INPUT_CNTL[12].u32All); + R600_OUT_BATCH(evergreen->SPI_PS_INPUT_CNTL[13].u32All); + R600_OUT_BATCH(evergreen->SPI_PS_INPUT_CNTL[14].u32All); + R600_OUT_BATCH(evergreen->SPI_PS_INPUT_CNTL[15].u32All); + R600_OUT_BATCH(evergreen->SPI_PS_INPUT_CNTL[16].u32All); + R600_OUT_BATCH(evergreen->SPI_PS_INPUT_CNTL[17].u32All); + R600_OUT_BATCH(evergreen->SPI_PS_INPUT_CNTL[18].u32All); R600_OUT_BATCH(evergreen->SPI_PS_INPUT_CNTL[19].u32All); R600_OUT_BATCH(evergreen->SPI_PS_INPUT_CNTL[20].u32All); - R600_OUT_BATCH(evergreen->SPI_PS_INPUT_CNTL[21].u32All); - R600_OUT_BATCH(evergreen->SPI_PS_INPUT_CNTL[22].u32All); - R600_OUT_BATCH(evergreen->SPI_PS_INPUT_CNTL[23].u32All); - R600_OUT_BATCH(evergreen->SPI_PS_INPUT_CNTL[24].u32All); - R600_OUT_BATCH(evergreen->SPI_PS_INPUT_CNTL[25].u32All); - R600_OUT_BATCH(evergreen->SPI_PS_INPUT_CNTL[26].u32All); - R600_OUT_BATCH(evergreen->SPI_PS_INPUT_CNTL[27].u32All); - R600_OUT_BATCH(evergreen->SPI_PS_INPUT_CNTL[28].u32All); + R600_OUT_BATCH(evergreen->SPI_PS_INPUT_CNTL[21].u32All); + R600_OUT_BATCH(evergreen->SPI_PS_INPUT_CNTL[22].u32All); + R600_OUT_BATCH(evergreen->SPI_PS_INPUT_CNTL[23].u32All); + R600_OUT_BATCH(evergreen->SPI_PS_INPUT_CNTL[24].u32All); + R600_OUT_BATCH(evergreen->SPI_PS_INPUT_CNTL[25].u32All); + R600_OUT_BATCH(evergreen->SPI_PS_INPUT_CNTL[26].u32All); + R600_OUT_BATCH(evergreen->SPI_PS_INPUT_CNTL[27].u32All); + R600_OUT_BATCH(evergreen->SPI_PS_INPUT_CNTL[28].u32All); R600_OUT_BATCH(evergreen->SPI_PS_INPUT_CNTL[29].u32All); R600_OUT_BATCH(evergreen->SPI_PS_INPUT_CNTL[30].u32All); R600_OUT_BATCH(evergreen->SPI_PS_INPUT_CNTL[31].u32All); - R600_OUT_BATCH(evergreen->SPI_VS_OUT_CONFIG.u32All); - R600_OUT_BATCH(evergreen->SPI_THREAD_GROUPING.u32All); - R600_OUT_BATCH(evergreen->SPI_PS_IN_CONTROL_0.u32All); - R600_OUT_BATCH(evergreen->SPI_PS_IN_CONTROL_1.u32All); - R600_OUT_BATCH(evergreen->SPI_INTERP_CONTROL_0.u32All); - R600_OUT_BATCH(evergreen->SPI_INPUT_Z.u32All); - R600_OUT_BATCH(evergreen->SPI_FOG_CNTL.u32All); - R600_OUT_BATCH(evergreen->SPI_BARYC_CNTL.u32All); - R600_OUT_BATCH(evergreen->SPI_PS_IN_CONTROL_2.u32All); - R600_OUT_BATCH(evergreen->SPI_COMPUTE_INPUT_CNTL.u32All); - R600_OUT_BATCH(evergreen->SPI_COMPUTE_NUM_THREAD_X.u32All); - R600_OUT_BATCH(evergreen->SPI_COMPUTE_NUM_THREAD_Y.u32All); - R600_OUT_BATCH(evergreen->SPI_COMPUTE_NUM_THREAD_Z.u32All); + R600_OUT_BATCH(evergreen->SPI_VS_OUT_CONFIG.u32All); + R600_OUT_BATCH(evergreen->SPI_THREAD_GROUPING.u32All); + R600_OUT_BATCH(evergreen->SPI_PS_IN_CONTROL_0.u32All); + R600_OUT_BATCH(evergreen->SPI_PS_IN_CONTROL_1.u32All); + R600_OUT_BATCH(evergreen->SPI_INTERP_CONTROL_0.u32All); + R600_OUT_BATCH(evergreen->SPI_INPUT_Z.u32All); + R600_OUT_BATCH(evergreen->SPI_FOG_CNTL.u32All); + R600_OUT_BATCH(evergreen->SPI_BARYC_CNTL.u32All); + R600_OUT_BATCH(evergreen->SPI_PS_IN_CONTROL_2.u32All); + R600_OUT_BATCH(evergreen->SPI_COMPUTE_INPUT_CNTL.u32All); + R600_OUT_BATCH(evergreen->SPI_COMPUTE_NUM_THREAD_X.u32All); + R600_OUT_BATCH(evergreen->SPI_COMPUTE_NUM_THREAD_Y.u32All); + R600_OUT_BATCH(evergreen->SPI_COMPUTE_NUM_THREAD_Z.u32All); END_BATCH(); @@ -833,8 +833,8 @@ static void evergreenSendSX(struct gl_context *ctx, struct radeon_state_atom *at radeon_print(RADEON_STATE, RADEON_VERBOSE, "%s\n", __func__); BEGIN_BATCH_NO_AUTOSTATE(9); - - EVERGREEN_OUT_BATCH_REGVAL(EG_SX_MISC, evergreen->SX_MISC.u32All); + + EVERGREEN_OUT_BATCH_REGVAL(EG_SX_MISC, evergreen->SX_MISC.u32All); EVERGREEN_OUT_BATCH_REGVAL(EG_SX_ALPHA_TEST_CONTROL, evergreen->SX_ALPHA_TEST_CONTROL.u32All); EVERGREEN_OUT_BATCH_REGVAL(EG_SX_ALPHA_REF, evergreen->SX_ALPHA_REF.u32All); @@ -857,8 +857,8 @@ static void evergreenSetDepthTarget(context_t *context) EVERGREEN_STATECHANGE(context, db); - evergreen->DB_DEPTH_SIZE.u32All = 0; - + evergreen->DB_DEPTH_SIZE.u32All = 0; + nPitchInPixel = rrb->pitch/rrb->cpp; if (context->radeon.radeonScreen->driScreen->dri2.enabled) @@ -871,28 +871,28 @@ static void evergreenSetDepthTarget(context_t *context) } SETfield(evergreen->DB_DEPTH_SIZE.u32All, (nPitchInPixel/8)-1, - EG_DB_DEPTH_SIZE__PITCH_TILE_MAX_shift, + EG_DB_DEPTH_SIZE__PITCH_TILE_MAX_shift, EG_DB_DEPTH_SIZE__PITCH_TILE_MAX_mask); SETfield(evergreen->DB_DEPTH_SIZE.u32All, (height/8)-1, - EG_DB_DEPTH_SIZE__HEIGHT_TILE_MAX_shift, + EG_DB_DEPTH_SIZE__HEIGHT_TILE_MAX_shift, EG_DB_DEPTH_SIZE__HEIGHT_TILE_MAX_mask); evergreen->DB_DEPTH_SLICE.u32All = ( (nPitchInPixel * height)/64 )-1; if(4 == rrb->cpp) { SETfield(evergreen->DB_Z_INFO.u32All, EG_Z_24, - EG_DB_Z_INFO__FORMAT_shift, + EG_DB_Z_INFO__FORMAT_shift, EG_DB_Z_INFO__FORMAT_mask); } else { SETfield(evergreen->DB_Z_INFO.u32All, EG_Z_16, - EG_DB_Z_INFO__FORMAT_shift, + EG_DB_Z_INFO__FORMAT_shift, EG_DB_Z_INFO__FORMAT_mask); } SETfield(evergreen->DB_Z_INFO.u32All, ARRAY_1D_TILED_THIN1, - EG_DB_Z_INFO__ARRAY_MODE_shift, - EG_DB_Z_INFO__ARRAY_MODE_mask); + EG_DB_Z_INFO__ARRAY_MODE_shift, + EG_DB_Z_INFO__ARRAY_MODE_mask); offtostencil = ((height * rrb->pitch) + 255) & ~255; @@ -907,34 +907,34 @@ static void evergreenSendDB(struct gl_context *ctx, struct radeon_state_atom *at EVERGREEN_CHIP_CONTEXT *evergreen = GET_EVERGREEN_CHIP(context); struct radeon_renderbuffer *rrb; BATCH_LOCALS(&context->radeon); - radeon_print(RADEON_STATE, RADEON_VERBOSE, "%s\n", __func__); - + radeon_print(RADEON_STATE, RADEON_VERBOSE, "%s\n", __func__); + evergreenSetDepthTarget(context); //8 - BEGIN_BATCH_NO_AUTOSTATE(7); + BEGIN_BATCH_NO_AUTOSTATE(7); EVERGREEN_OUT_BATCH_REGSEQ(EG_DB_RENDER_CONTROL, 5); - R600_OUT_BATCH(evergreen->DB_RENDER_CONTROL.u32All); - R600_OUT_BATCH(evergreen->DB_COUNT_CONTROL.u32All); - R600_OUT_BATCH(evergreen->DB_DEPTH_VIEW.u32All); - R600_OUT_BATCH(evergreen->DB_RENDER_OVERRIDE.u32All); - R600_OUT_BATCH(evergreen->DB_RENDER_OVERRIDE2.u32All); + R600_OUT_BATCH(evergreen->DB_RENDER_CONTROL.u32All); + R600_OUT_BATCH(evergreen->DB_COUNT_CONTROL.u32All); + R600_OUT_BATCH(evergreen->DB_DEPTH_VIEW.u32All); + R600_OUT_BATCH(evergreen->DB_RENDER_OVERRIDE.u32All); + R600_OUT_BATCH(evergreen->DB_RENDER_OVERRIDE2.u32All); END_BATCH(); //4 - BEGIN_BATCH_NO_AUTOSTATE(4); + BEGIN_BATCH_NO_AUTOSTATE(4); EVERGREEN_OUT_BATCH_REGSEQ(EG_DB_STENCIL_CLEAR, 2); - R600_OUT_BATCH(evergreen->DB_STENCIL_CLEAR.u32All); - R600_OUT_BATCH(evergreen->DB_DEPTH_CLEAR.u32All); + R600_OUT_BATCH(evergreen->DB_STENCIL_CLEAR.u32All); + R600_OUT_BATCH(evergreen->DB_DEPTH_CLEAR.u32All); END_BATCH(); - //4 + //4 BEGIN_BATCH_NO_AUTOSTATE(4); EVERGREEN_OUT_BATCH_REGSEQ(EG_DB_DEPTH_SIZE, 2); - R600_OUT_BATCH(evergreen->DB_DEPTH_SIZE.u32All); + R600_OUT_BATCH(evergreen->DB_DEPTH_SIZE.u32All); R600_OUT_BATCH(evergreen->DB_DEPTH_SLICE.u32All); - END_BATCH(); - + END_BATCH(); + //3 BEGIN_BATCH_NO_AUTOSTATE(3); EVERGREEN_OUT_BATCH_REGVAL(EG_DB_DEPTH_CONTROL, evergreen->DB_DEPTH_CONTROL.u32All); @@ -942,24 +942,24 @@ static void evergreenSendDB(struct gl_context *ctx, struct radeon_state_atom *at //3 BEGIN_BATCH_NO_AUTOSTATE(3); - EVERGREEN_OUT_BATCH_REGVAL(EG_DB_SHADER_CONTROL, evergreen->DB_SHADER_CONTROL.u32All); + EVERGREEN_OUT_BATCH_REGVAL(EG_DB_SHADER_CONTROL, evergreen->DB_SHADER_CONTROL.u32All); END_BATCH(); //5 BEGIN_BATCH_NO_AUTOSTATE(5); - EVERGREEN_OUT_BATCH_REGSEQ(EG_DB_SRESULTS_COMPARE_STATE0, 3); - R600_OUT_BATCH(evergreen->DB_SRESULTS_COMPARE_STATE0.u32All); - R600_OUT_BATCH(evergreen->DB_SRESULTS_COMPARE_STATE1.u32All); - R600_OUT_BATCH(evergreen->DB_PRELOAD_CONTROL.u32All); + EVERGREEN_OUT_BATCH_REGSEQ(EG_DB_SRESULTS_COMPARE_STATE0, 3); + R600_OUT_BATCH(evergreen->DB_SRESULTS_COMPARE_STATE0.u32All); + R600_OUT_BATCH(evergreen->DB_SRESULTS_COMPARE_STATE1.u32All); + R600_OUT_BATCH(evergreen->DB_PRELOAD_CONTROL.u32All); END_BATCH(); //3 BEGIN_BATCH_NO_AUTOSTATE(3); - EVERGREEN_OUT_BATCH_REGVAL(EG_DB_ALPHA_TO_MASK, evergreen->DB_ALPHA_TO_MASK.u32All); + EVERGREEN_OUT_BATCH_REGVAL(EG_DB_ALPHA_TO_MASK, evergreen->DB_ALPHA_TO_MASK.u32All); END_BATCH(); - + rrb = radeon_get_depthbuffer(&context->radeon); - + if( (rrb != NULL) && (rrb->bo != NULL) ) { @@ -985,7 +985,7 @@ static void evergreenSendDB(struct gl_context *ctx, struct radeon_state_atom *at if((evergreen->DB_DEPTH_CONTROL.u32All & Z_ENABLE_bit) > 0) { BEGIN_BATCH_NO_AUTOSTATE(3 + 2); - EVERGREEN_OUT_BATCH_REGVAL(EG_DB_Z_READ_BASE, evergreen->DB_Z_READ_BASE.u32All); + EVERGREEN_OUT_BATCH_REGVAL(EG_DB_Z_READ_BASE, evergreen->DB_Z_READ_BASE.u32All); R600_OUT_BATCH_RELOC(evergreen->DB_Z_READ_BASE.u32All, rrb->bo, evergreen->DB_Z_READ_BASE.u32All, @@ -996,21 +996,21 @@ static void evergreenSendDB(struct gl_context *ctx, struct radeon_state_atom *at if((evergreen->DB_DEPTH_CONTROL.u32All & Z_WRITE_ENABLE_bit) > 0) { BEGIN_BATCH_NO_AUTOSTATE(3 + 2); - EVERGREEN_OUT_BATCH_REGVAL(EG_DB_Z_WRITE_BASE, evergreen->DB_Z_READ_BASE.u32All); + EVERGREEN_OUT_BATCH_REGVAL(EG_DB_Z_WRITE_BASE, evergreen->DB_Z_READ_BASE.u32All); R600_OUT_BATCH_RELOC(evergreen->DB_Z_WRITE_BASE.u32All, rrb->bo, evergreen->DB_Z_WRITE_BASE.u32All, 0, RADEON_GEM_DOMAIN_VRAM, 0); - END_BATCH(); + END_BATCH(); } - } + } - if (ctx->DrawBuffer) + if (ctx->DrawBuffer) { rrb = radeon_get_renderbuffer(ctx->DrawBuffer, BUFFER_STENCIL); - + if((rrb != NULL) && (rrb->bo != NULL)) - { + { //5 BEGIN_BATCH_NO_AUTOSTATE(3 + 2); EVERGREEN_OUT_BATCH_REGVAL(EG_DB_STENCIL_INFO, evergreen->DB_STENCIL_INFO.u32All); @@ -1019,7 +1019,7 @@ static void evergreenSendDB(struct gl_context *ctx, struct radeon_state_atom *at evergreen->DB_STENCIL_INFO.u32All, 0, RADEON_GEM_DOMAIN_VRAM, 0); END_BATCH(); - + //4 BEGIN_BATCH_NO_AUTOSTATE(4); R600_OUT_BATCH_REGSEQ(DB_STENCILREFMASK, 2); @@ -1032,8 +1032,8 @@ static void evergreenSendDB(struct gl_context *ctx, struct radeon_state_atom *at if((evergreen->DB_DEPTH_CONTROL.u32All & STENCIL_ENABLE_bit) > 0) { - BEGIN_BATCH_NO_AUTOSTATE(3 + 2); - EVERGREEN_OUT_BATCH_REGVAL(EG_DB_STENCIL_READ_BASE, evergreen->DB_STENCIL_READ_BASE.u32All); + BEGIN_BATCH_NO_AUTOSTATE(3 + 2); + EVERGREEN_OUT_BATCH_REGVAL(EG_DB_STENCIL_READ_BASE, evergreen->DB_STENCIL_READ_BASE.u32All); R600_OUT_BATCH_RELOC(evergreen->DB_STENCIL_READ_BASE.u32All, rrb->bo, evergreen->DB_STENCIL_READ_BASE.u32All, @@ -1041,16 +1041,16 @@ static void evergreenSendDB(struct gl_context *ctx, struct radeon_state_atom *at END_BATCH(); BEGIN_BATCH_NO_AUTOSTATE(3 + 2); - EVERGREEN_OUT_BATCH_REGVAL(EG_DB_STENCIL_WRITE_BASE, evergreen->DB_STENCIL_WRITE_BASE.u32All); + EVERGREEN_OUT_BATCH_REGVAL(EG_DB_STENCIL_WRITE_BASE, evergreen->DB_STENCIL_WRITE_BASE.u32All); R600_OUT_BATCH_RELOC(evergreen->DB_STENCIL_WRITE_BASE.u32All, rrb->bo, evergreen->DB_STENCIL_WRITE_BASE.u32All, 0, RADEON_GEM_DOMAIN_VRAM, 0); - END_BATCH(); - } + END_BATCH(); + } } - } - + } + COMMIT_BATCH(); } @@ -1072,7 +1072,7 @@ static void evergreenSetRenderTarget(context_t *context, int id) evergreen->render_target[id].CB_COLOR0_BASE.u32All = context->radeon.state.color.draw_offset / 256; /* pitch */ - nPitchInPixel = rrb->pitch/rrb->cpp; + nPitchInPixel = rrb->pitch/rrb->cpp; if (context->radeon.radeonScreen->driScreen->dri2.enabled) { @@ -1084,28 +1084,28 @@ static void evergreenSetRenderTarget(context_t *context, int id) } SETfield(evergreen->render_target[id].CB_COLOR0_PITCH.u32All, (nPitchInPixel/8)-1, - EG_CB_COLOR0_PITCH__TILE_MAX_shift, + EG_CB_COLOR0_PITCH__TILE_MAX_shift, EG_CB_COLOR0_PITCH__TILE_MAX_mask); /* slice */ - SETfield(evergreen->render_target[id].CB_COLOR0_SLICE.u32All, + SETfield(evergreen->render_target[id].CB_COLOR0_SLICE.u32All, ( (nPitchInPixel * height)/64 )-1, - EG_CB_COLOR0_SLICE__TILE_MAX_shift, + EG_CB_COLOR0_SLICE__TILE_MAX_shift, EG_CB_COLOR0_SLICE__TILE_MAX_mask); /* CB_COLOR0_ATTRIB */ /* TODO : for z clear, this should be set to 0 */ - SETbit(evergreen->render_target[id].CB_COLOR0_ATTRIB.u32All, + SETbit(evergreen->render_target[id].CB_COLOR0_ATTRIB.u32All, EG_CB_COLOR0_ATTRIB__NON_DISP_TILING_ORDER_bit); /* CB_COLOR0_INFO */ - SETfield(evergreen->render_target[id].CB_COLOR0_INFO.u32All, - ENDIAN_NONE, - EG_CB_COLOR0_INFO__ENDIAN_shift, + SETfield(evergreen->render_target[id].CB_COLOR0_INFO.u32All, + ENDIAN_NONE, + EG_CB_COLOR0_INFO__ENDIAN_shift, EG_CB_COLOR0_INFO__ENDIAN_mask); - SETfield(evergreen->render_target[id].CB_COLOR0_INFO.u32All, - ARRAY_LINEAR_GENERAL, - EG_CB_COLOR0_INFO__ARRAY_MODE_shift, - EG_CB_COLOR0_INFO__ARRAY_MODE_mask); + SETfield(evergreen->render_target[id].CB_COLOR0_INFO.u32All, + ARRAY_LINEAR_GENERAL, + EG_CB_COLOR0_INFO__ARRAY_MODE_shift, + EG_CB_COLOR0_INFO__ARRAY_MODE_mask); switch (rrb->base.Format) { case MESA_FORMAT_RGBA8888: @@ -1371,7 +1371,7 @@ static void evergreenSetRenderTarget(context_t *context, int id) } static void evergreenSendCB(struct gl_context *ctx, struct radeon_state_atom *atom) -{ +{ context_t *context = EVERGREEN_CONTEXT(ctx); EVERGREEN_CHIP_CONTEXT *evergreen = GET_EVERGREEN_CHIP(context); struct radeon_renderbuffer *rrb; @@ -1408,14 +1408,14 @@ static void evergreenSendCB(struct gl_context *ctx, struct radeon_state_atom *at BEGIN_BATCH_NO_AUTOSTATE(5); EVERGREEN_OUT_BATCH_REGSEQ(EG_CB_COLOR0_PITCH, 3); - R600_OUT_BATCH(evergreen->render_target[id].CB_COLOR0_PITCH.u32All); - R600_OUT_BATCH(evergreen->render_target[id].CB_COLOR0_SLICE.u32All); - R600_OUT_BATCH(evergreen->render_target[id].CB_COLOR0_VIEW.u32All); + R600_OUT_BATCH(evergreen->render_target[id].CB_COLOR0_PITCH.u32All); + R600_OUT_BATCH(evergreen->render_target[id].CB_COLOR0_SLICE.u32All); + R600_OUT_BATCH(evergreen->render_target[id].CB_COLOR0_VIEW.u32All); END_BATCH(); BEGIN_BATCH_NO_AUTOSTATE(3 + 2); EVERGREEN_OUT_BATCH_REGSEQ(EG_CB_COLOR0_ATTRIB, 1); - R600_OUT_BATCH(evergreen->render_target[id].CB_COLOR0_ATTRIB.u32All); + R600_OUT_BATCH(evergreen->render_target[id].CB_COLOR0_ATTRIB.u32All); R600_OUT_BATCH_RELOC(0, rrb->bo, 0, @@ -1424,34 +1424,34 @@ static void evergreenSendCB(struct gl_context *ctx, struct radeon_state_atom *at BEGIN_BATCH_NO_AUTOSTATE(3); EVERGREEN_OUT_BATCH_REGSEQ(EG_CB_COLOR0_DIM, 1); - R600_OUT_BATCH(evergreen->render_target[id].CB_COLOR0_DIM.u32All); + R600_OUT_BATCH(evergreen->render_target[id].CB_COLOR0_DIM.u32All); /* - R600_OUT_BATCH(evergreen->render_target[id].CB_COLOR0_CMASK.u32All); - R600_OUT_BATCH(evergreen->render_target[id].CB_COLOR0_CMASK_SLICE.u32All); - R600_OUT_BATCH(evergreen->render_target[id].CB_COLOR0_FMASK.u32All); - R600_OUT_BATCH(evergreen->render_target[id].CB_COLOR0_FMASK_SLICE.u32All); + R600_OUT_BATCH(evergreen->render_target[id].CB_COLOR0_CMASK.u32All); + R600_OUT_BATCH(evergreen->render_target[id].CB_COLOR0_CMASK_SLICE.u32All); + R600_OUT_BATCH(evergreen->render_target[id].CB_COLOR0_FMASK.u32All); + R600_OUT_BATCH(evergreen->render_target[id].CB_COLOR0_FMASK_SLICE.u32All); */ END_BATCH(); BEGIN_BATCH_NO_AUTOSTATE(4); EVERGREEN_OUT_BATCH_REGSEQ(EG_CB_TARGET_MASK, 2); - R600_OUT_BATCH(evergreen->CB_TARGET_MASK.u32All); - R600_OUT_BATCH(evergreen->CB_SHADER_MASK.u32All); + R600_OUT_BATCH(evergreen->CB_TARGET_MASK.u32All); + R600_OUT_BATCH(evergreen->CB_SHADER_MASK.u32All); END_BATCH(); BEGIN_BATCH_NO_AUTOSTATE(6); EVERGREEN_OUT_BATCH_REGSEQ(EG_CB_BLEND_RED, 4); - R600_OUT_BATCH(evergreen->CB_BLEND_RED.u32All); - R600_OUT_BATCH(evergreen->CB_BLEND_GREEN.u32All); - R600_OUT_BATCH(evergreen->CB_BLEND_BLUE.u32All); - R600_OUT_BATCH(evergreen->CB_BLEND_ALPHA.u32All); + R600_OUT_BATCH(evergreen->CB_BLEND_RED.u32All); + R600_OUT_BATCH(evergreen->CB_BLEND_GREEN.u32All); + R600_OUT_BATCH(evergreen->CB_BLEND_BLUE.u32All); + R600_OUT_BATCH(evergreen->CB_BLEND_ALPHA.u32All); END_BATCH(); BEGIN_BATCH_NO_AUTOSTATE(6); - EVERGREEN_OUT_BATCH_REGVAL(EG_CB_BLEND0_CONTROL, evergreen->CB_BLEND0_CONTROL.u32All); - EVERGREEN_OUT_BATCH_REGVAL(EG_CB_COLOR_CONTROL, evergreen->CB_COLOR_CONTROL.u32All); + EVERGREEN_OUT_BATCH_REGVAL(EG_CB_BLEND0_CONTROL, evergreen->CB_BLEND0_CONTROL.u32All); + EVERGREEN_OUT_BATCH_REGVAL(EG_CB_COLOR_CONTROL, evergreen->CB_COLOR_CONTROL.u32All); END_BATCH(); - + COMMIT_BATCH(); } @@ -1463,55 +1463,55 @@ static void evergreenSendVGT(struct gl_context *ctx, struct radeon_state_atom *a radeon_print(RADEON_STATE, RADEON_VERBOSE, "%s\n", __func__); /* moved to draw: - VGT_DRAW_INITIATOR - VGT_INDEX_TYPE - VGT_PRIMITIVE_TYPE + VGT_DRAW_INITIATOR + VGT_INDEX_TYPE + VGT_PRIMITIVE_TYPE */ BEGIN_BATCH_NO_AUTOSTATE(5); EVERGREEN_OUT_BATCH_REGSEQ(EG_VGT_MAX_VTX_INDX, 3); - R600_OUT_BATCH(evergreen->VGT_MAX_VTX_INDX.u32All); - R600_OUT_BATCH(evergreen->VGT_MIN_VTX_INDX.u32All); - R600_OUT_BATCH(evergreen->VGT_INDX_OFFSET.u32All); + R600_OUT_BATCH(evergreen->VGT_MAX_VTX_INDX.u32All); + R600_OUT_BATCH(evergreen->VGT_MIN_VTX_INDX.u32All); + R600_OUT_BATCH(evergreen->VGT_INDX_OFFSET.u32All); END_BATCH(); - + BEGIN_BATCH_NO_AUTOSTATE(6); - EVERGREEN_OUT_BATCH_REGVAL(EG_VGT_OUTPUT_PATH_CNTL, evergreen->VGT_OUTPUT_PATH_CNTL.u32All); - - EVERGREEN_OUT_BATCH_REGVAL(EG_VGT_GS_MODE, evergreen->VGT_GS_MODE.u32All); + EVERGREEN_OUT_BATCH_REGVAL(EG_VGT_OUTPUT_PATH_CNTL, evergreen->VGT_OUTPUT_PATH_CNTL.u32All); + + EVERGREEN_OUT_BATCH_REGVAL(EG_VGT_GS_MODE, evergreen->VGT_GS_MODE.u32All); END_BATCH(); - + BEGIN_BATCH_NO_AUTOSTATE(3); EVERGREEN_OUT_BATCH_REGSEQ(EG_VGT_PRIMITIVEID_EN, 1); - R600_OUT_BATCH(evergreen->VGT_PRIMITIVEID_EN.u32All); + R600_OUT_BATCH(evergreen->VGT_PRIMITIVEID_EN.u32All); END_BATCH(); - + BEGIN_BATCH_NO_AUTOSTATE(4); EVERGREEN_OUT_BATCH_REGSEQ(EG_VGT_INSTANCE_STEP_RATE_0, 2); - R600_OUT_BATCH(evergreen->VGT_INSTANCE_STEP_RATE_0.u32All); - R600_OUT_BATCH(evergreen->VGT_INSTANCE_STEP_RATE_1.u32All); + R600_OUT_BATCH(evergreen->VGT_INSTANCE_STEP_RATE_0.u32All); + R600_OUT_BATCH(evergreen->VGT_INSTANCE_STEP_RATE_1.u32All); END_BATCH(); BEGIN_BATCH_NO_AUTOSTATE(4); EVERGREEN_OUT_BATCH_REGSEQ(EG_VGT_REUSE_OFF, 2); - R600_OUT_BATCH(evergreen->VGT_REUSE_OFF.u32All); - R600_OUT_BATCH(evergreen->VGT_VTX_CNT_EN.u32All); + R600_OUT_BATCH(evergreen->VGT_REUSE_OFF.u32All); + R600_OUT_BATCH(evergreen->VGT_VTX_CNT_EN.u32All); END_BATCH(); - + BEGIN_BATCH_NO_AUTOSTATE(3); - EVERGREEN_OUT_BATCH_REGVAL(EG_VGT_SHADER_STAGES_EN, evergreen->VGT_SHADER_STAGES_EN.u32All); + EVERGREEN_OUT_BATCH_REGVAL(EG_VGT_SHADER_STAGES_EN, evergreen->VGT_SHADER_STAGES_EN.u32All); END_BATCH(); - + BEGIN_BATCH_NO_AUTOSTATE(4); EVERGREEN_OUT_BATCH_REGSEQ(EG_VGT_STRMOUT_CONFIG, 2); - R600_OUT_BATCH(evergreen->VGT_STRMOUT_CONFIG.u32All); - R600_OUT_BATCH(evergreen->VGT_STRMOUT_BUFFER_CONFIG.u32All); + R600_OUT_BATCH(evergreen->VGT_STRMOUT_CONFIG.u32All); + R600_OUT_BATCH(evergreen->VGT_STRMOUT_BUFFER_CONFIG.u32All); END_BATCH(); COMMIT_BATCH(); } void evergreenInitAtoms(context_t *context) -{ +{ radeon_print(RADEON_STATE, RADEON_NORMAL, "%s %p\n", __func__, context); context->radeon.hw.max_state_size = 10 + 5 + 14 + 3; /* start 3d, idle, cb/db flush, 3 for time stamp */ @@ -1528,8 +1528,8 @@ void evergreenInitAtoms(context_t *context) EVERGREEN_ALLOC_STATE(spi, always, 59, evergreenSendSPI); EVERGREEN_ALLOC_STATE(sx, always, 9, evergreenSendSX); EVERGREEN_ALLOC_STATE(tx, evergreen_tx, (R700_TEXTURE_NUMBERUNITS * (21+5) + 6), evergreenSendTexState); /* 21 for resource, 5 for sampler */ - EVERGREEN_ALLOC_STATE(db, always, 69, evergreenSendDB); - EVERGREEN_ALLOC_STATE(cb, always, 37, evergreenSendCB); + EVERGREEN_ALLOC_STATE(db, always, 69, evergreenSendDB); + EVERGREEN_ALLOC_STATE(cb, always, 37, evergreenSendCB); EVERGREEN_ALLOC_STATE(vgt, always, 29, evergreenSendVGT); evergreen_init_query_stateobj(&context->radeon, 6 * 2); diff --git a/src/mesa/drivers/dri/r600/evergreen_chip.h b/src/mesa/drivers/dri/r600/evergreen_chip.h index 2ea5cd2..90b5208 100644 --- a/src/mesa/drivers/dri/r600/evergreen_chip.h +++ b/src/mesa/drivers/dri/r600/evergreen_chip.h @@ -21,7 +21,7 @@ /* * Authors: - * Richard Li , + * Richard Li , */ #ifndef _EVERGREEN_CHIP_H_ @@ -35,16 +35,16 @@ typedef struct _EVERGREEN_VIEWPORT_STATE { - union UINT_FLOAT PA_SC_VPORT_SCISSOR_0_TL; ////0,1 // = 0x28250, // DIFF - union UINT_FLOAT PA_SC_VPORT_SCISSOR_0_BR; ////0,1 // = 0x28254, // DIFF - union UINT_FLOAT PA_SC_VPORT_ZMIN_0; ////0 // = 0x282D0, // SAME - union UINT_FLOAT PA_SC_VPORT_ZMAX_0; ////0 // = 0x282D4, // SAME - union UINT_FLOAT PA_CL_VPORT_XSCALE; //// // = 0x2843C, // SAME - union UINT_FLOAT PA_CL_VPORT_XOFFSET; //// // = 0x28440, // SAME - union UINT_FLOAT PA_CL_VPORT_YSCALE; //// // = 0x28444, // SAME - union UINT_FLOAT PA_CL_VPORT_YOFFSET; //// // = 0x28448, // SAME - union UINT_FLOAT PA_CL_VPORT_ZSCALE; //// // = 0x2844C, // SAME - union UINT_FLOAT PA_CL_VPORT_ZOFFSET; //// // = 0x28450, // SAME + union UINT_FLOAT PA_SC_VPORT_SCISSOR_0_TL; ////0,1 // = 0x28250, // DIFF + union UINT_FLOAT PA_SC_VPORT_SCISSOR_0_BR; ////0,1 // = 0x28254, // DIFF + union UINT_FLOAT PA_SC_VPORT_ZMIN_0; ////0 // = 0x282D0, // SAME + union UINT_FLOAT PA_SC_VPORT_ZMAX_0; ////0 // = 0x282D4, // SAME + union UINT_FLOAT PA_CL_VPORT_XSCALE; //// // = 0x2843C, // SAME + union UINT_FLOAT PA_CL_VPORT_XOFFSET; //// // = 0x28440, // SAME + union UINT_FLOAT PA_CL_VPORT_YSCALE; //// // = 0x28444, // SAME + union UINT_FLOAT PA_CL_VPORT_YOFFSET; //// // = 0x28448, // SAME + union UINT_FLOAT PA_CL_VPORT_ZSCALE; //// // = 0x2844C, // SAME + union UINT_FLOAT PA_CL_VPORT_ZOFFSET; //// // = 0x28450, // SAME GLboolean enabled; GLboolean dirty; } EVERGREEN_VIEWPORT_STATE; @@ -53,10 +53,10 @@ typedef struct _EVERGREEN_VIEWPORT_STATE typedef struct _EVERGREEN_UCP_STATE { - union UINT_FLOAT PA_CL_UCP_0_X; // = 0x285BC, // SAME 0x28E20 - union UINT_FLOAT PA_CL_UCP_0_Y; // = 0x285C0, // SAME 0x28E24 - union UINT_FLOAT PA_CL_UCP_0_Z; // = 0x285C4, // SAME 0x28E28 - union UINT_FLOAT PA_CL_UCP_0_W; // = 0x285C8, // SAME 0x28E2C + union UINT_FLOAT PA_CL_UCP_0_X; // = 0x285BC, // SAME 0x28E20 + union UINT_FLOAT PA_CL_UCP_0_Y; // = 0x285C0, // SAME 0x28E24 + union UINT_FLOAT PA_CL_UCP_0_Z; // = 0x285C4, // SAME 0x28E28 + union UINT_FLOAT PA_CL_UCP_0_W; // = 0x285C8, // SAME 0x28E2C GLboolean enabled; GLboolean dirty; } EVERGREEN_UCP_STATE; @@ -65,20 +65,20 @@ typedef struct _EVERGREEN_UCP_STATE typedef struct _EVERGREEN_RENDER_TARGET_STATE { - union UINT_FLOAT CB_COLOR0_BASE; ////0 // = 0x28C60, // SAME 0x28040 - union UINT_FLOAT CB_COLOR0_PITCH; ////0 // = 0x28C64, // - union UINT_FLOAT CB_COLOR0_SLICE; ////0 // = 0x28C68, // - union UINT_FLOAT CB_COLOR0_VIEW; ////0 // = 0x28C6C, // SAME 0x28080 - union UINT_FLOAT CB_COLOR0_INFO; ////0,1,2,3,4,5,6,78,9,10,11 // = 0x28C70, // DIFF 0x280A0 - union UINT_FLOAT CB_COLOR0_ATTRIB; ////0 // = 0x28C74, // - union UINT_FLOAT CB_COLOR0_DIM; // = 0x28C78, // - union UINT_FLOAT CB_COLOR0_CMASK; ////0 // = 0x28C7C, // - union UINT_FLOAT CB_COLOR0_CMASK_SLICE; ////0 // = 0x28C80, // - union UINT_FLOAT CB_COLOR0_FMASK; ////0 // = 0x28C84, // - union UINT_FLOAT CB_COLOR0_FMASK_SLICE; ////0 // = 0x28C88, // - union UINT_FLOAT CB_COLOR0_CLEAR_WORD0; // = 0x28C8C, // - union UINT_FLOAT CB_COLOR0_CLEAR_WORD1; // = 0x28C90, // - union UINT_FLOAT CB_COLOR0_CLEAR_WORD2; // = 0x28C94, // + union UINT_FLOAT CB_COLOR0_BASE; ////0 // = 0x28C60, // SAME 0x28040 + union UINT_FLOAT CB_COLOR0_PITCH; ////0 // = 0x28C64, // + union UINT_FLOAT CB_COLOR0_SLICE; ////0 // = 0x28C68, // + union UINT_FLOAT CB_COLOR0_VIEW; ////0 // = 0x28C6C, // SAME 0x28080 + union UINT_FLOAT CB_COLOR0_INFO; ////0,1,2,3,4,5,6,78,9,10,11 // = 0x28C70, // DIFF 0x280A0 + union UINT_FLOAT CB_COLOR0_ATTRIB; ////0 // = 0x28C74, // + union UINT_FLOAT CB_COLOR0_DIM; // = 0x28C78, // + union UINT_FLOAT CB_COLOR0_CMASK; ////0 // = 0x28C7C, // + union UINT_FLOAT CB_COLOR0_CMASK_SLICE; ////0 // = 0x28C80, // + union UINT_FLOAT CB_COLOR0_FMASK; ////0 // = 0x28C84, // + union UINT_FLOAT CB_COLOR0_FMASK_SLICE; ////0 // = 0x28C88, // + union UINT_FLOAT CB_COLOR0_CLEAR_WORD0; // = 0x28C8C, // + union UINT_FLOAT CB_COLOR0_CLEAR_WORD1; // = 0x28C90, // + union UINT_FLOAT CB_COLOR0_CLEAR_WORD2; // = 0x28C94, // union UINT_FLOAT CB_COLOR0_CLEAR_WORD3; // = 0x28C98, // GLboolean enabled; GLboolean dirty; @@ -91,19 +91,19 @@ typedef struct _EVERGREEN_CONFIG union UINT_FLOAT CP_PERFMON_CNTL; // = 0x87FC, // SAME union UINT_FLOAT SQ_MS_FIFO_SIZES; // = 0x8CF0, // SAME - union UINT_FLOAT SQ_CONFIG; // = 0x8C00, // DIFF - union UINT_FLOAT SQ_GPR_RESOURCE_MGMT_1; // = 0x8C04, // SAME - union UINT_FLOAT SQ_GPR_RESOURCE_MGMT_2; // = 0x8C08, // SAME + union UINT_FLOAT SQ_CONFIG; // = 0x8C00, // DIFF + union UINT_FLOAT SQ_GPR_RESOURCE_MGMT_1; // = 0x8C04, // SAME + union UINT_FLOAT SQ_GPR_RESOURCE_MGMT_2; // = 0x8C08, // SAME union UINT_FLOAT SQ_GPR_RESOURCE_MGMT_3; // = 0x8C0C, // - union UINT_FLOAT SQ_THREAD_RESOURCE_MGMT; // = 0x8C18, // SAME 0x8C0C + union UINT_FLOAT SQ_THREAD_RESOURCE_MGMT; // = 0x8C18, // SAME 0x8C0C union UINT_FLOAT SQ_THREAD_RESOURCE_MGMT_2; // = 0x8C1C, // - union UINT_FLOAT SQ_STACK_RESOURCE_MGMT_1; // = 0x8C20, // SAME 0x8C10 - union UINT_FLOAT SQ_STACK_RESOURCE_MGMT_2; // = 0x8C24, // SAME 0x8C14 + union UINT_FLOAT SQ_STACK_RESOURCE_MGMT_1; // = 0x8C20, // SAME 0x8C10 + union UINT_FLOAT SQ_STACK_RESOURCE_MGMT_2; // = 0x8C24, // SAME 0x8C14 union UINT_FLOAT SQ_STACK_RESOURCE_MGMT_3; // = 0x8C28, // union UINT_FLOAT SQ_DYN_GPR_CNTL_PS_FLUSH_REQ; // = 0x8D8C, // DIFF - union UINT_FLOAT SQ_LDS_RESOURCE_MGMT; // = 0x8E2C, // + union UINT_FLOAT SQ_LDS_RESOURCE_MGMT; // = 0x8E2C, // union UINT_FLOAT VGT_CACHE_INVALIDATION; // = 0x88C4, // DIFF union UINT_FLOAT VGT_GS_VERTEX_REUSE; // = 0x88D4, // SAME union UINT_FLOAT PA_SC_FORCE_EOV_MAX_CNTS; // = 0x8B24, // SAME @@ -113,25 +113,25 @@ typedef struct _EVERGREEN_CONFIG typedef struct _EVERGREEN_PS_RES { - union UINT_FLOAT SQ_PGM_START_PS; //// // = 0x28840, // SAME + union UINT_FLOAT SQ_PGM_START_PS; //// // = 0x28840, // SAME GLboolean dirty; - union UINT_FLOAT SQ_ALU_CONST_CACHE_PS_0; // = 0x28940, // SAME - union UINT_FLOAT SQ_ALU_CONST_CACHE_PS_1; // = 0x28944, // SAME - union UINT_FLOAT SQ_ALU_CONST_CACHE_PS_2; // = 0x28948, // SAME - union UINT_FLOAT SQ_ALU_CONST_CACHE_PS_3; // = 0x2894C, // SAME - union UINT_FLOAT SQ_ALU_CONST_CACHE_PS_4; // = 0x28950, // SAME - union UINT_FLOAT SQ_ALU_CONST_CACHE_PS_5; // = 0x28954, // SAME - union UINT_FLOAT SQ_ALU_CONST_CACHE_PS_6; // = 0x28958, // SAME - union UINT_FLOAT SQ_ALU_CONST_CACHE_PS_7; // = 0x2895C, // SAME - union UINT_FLOAT SQ_ALU_CONST_CACHE_PS_8; // = 0x28960, // SAME - union UINT_FLOAT SQ_ALU_CONST_CACHE_PS_9; // = 0x28964, // SAME - union UINT_FLOAT SQ_ALU_CONST_CACHE_PS_10; // = 0x28968, // SAME - union UINT_FLOAT SQ_ALU_CONST_CACHE_PS_11; // = 0x2896C, // SAME - union UINT_FLOAT SQ_ALU_CONST_CACHE_PS_12; // = 0x28970, // SAME - union UINT_FLOAT SQ_ALU_CONST_CACHE_PS_13; // = 0x28974, // SAME - union UINT_FLOAT SQ_ALU_CONST_CACHE_PS_14; // = 0x28978, // SAME - union UINT_FLOAT SQ_ALU_CONST_CACHE_PS_15; // = 0x2897C, // SAME + union UINT_FLOAT SQ_ALU_CONST_CACHE_PS_0; // = 0x28940, // SAME + union UINT_FLOAT SQ_ALU_CONST_CACHE_PS_1; // = 0x28944, // SAME + union UINT_FLOAT SQ_ALU_CONST_CACHE_PS_2; // = 0x28948, // SAME + union UINT_FLOAT SQ_ALU_CONST_CACHE_PS_3; // = 0x2894C, // SAME + union UINT_FLOAT SQ_ALU_CONST_CACHE_PS_4; // = 0x28950, // SAME + union UINT_FLOAT SQ_ALU_CONST_CACHE_PS_5; // = 0x28954, // SAME + union UINT_FLOAT SQ_ALU_CONST_CACHE_PS_6; // = 0x28958, // SAME + union UINT_FLOAT SQ_ALU_CONST_CACHE_PS_7; // = 0x2895C, // SAME + union UINT_FLOAT SQ_ALU_CONST_CACHE_PS_8; // = 0x28960, // SAME + union UINT_FLOAT SQ_ALU_CONST_CACHE_PS_9; // = 0x28964, // SAME + union UINT_FLOAT SQ_ALU_CONST_CACHE_PS_10; // = 0x28968, // SAME + union UINT_FLOAT SQ_ALU_CONST_CACHE_PS_11; // = 0x2896C, // SAME + union UINT_FLOAT SQ_ALU_CONST_CACHE_PS_12; // = 0x28970, // SAME + union UINT_FLOAT SQ_ALU_CONST_CACHE_PS_13; // = 0x28974, // SAME + union UINT_FLOAT SQ_ALU_CONST_CACHE_PS_14; // = 0x28978, // SAME + union UINT_FLOAT SQ_ALU_CONST_CACHE_PS_15; // = 0x2897C, // SAME int num_consts; union UINT_FLOAT consts[EVERGREEN_MAX_DX9_CONSTS][4]; @@ -139,24 +139,24 @@ typedef struct _EVERGREEN_PS_RES typedef struct _EVERGREEN_VS_RES { - union UINT_FLOAT SQ_PGM_START_VS; //// // = 0x2885C, // SAME 0x28858 + union UINT_FLOAT SQ_PGM_START_VS; //// // = 0x2885C, // SAME 0x28858 union UINT_FLOAT SQ_ALU_CONST_BUFFER_SIZE_VS_0; //// // = 0x28180, //? - union UINT_FLOAT SQ_ALU_CONST_CACHE_VS_0; //// // = 0x28980, // SAME - - union UINT_FLOAT SQ_ALU_CONST_CACHE_VS_1; // = 0x28984, // SAME - union UINT_FLOAT SQ_ALU_CONST_CACHE_VS_2; // = 0x28988, // SAME - union UINT_FLOAT SQ_ALU_CONST_CACHE_VS_3; // = 0x2898C, // SAME - union UINT_FLOAT SQ_ALU_CONST_CACHE_VS_4; // = 0x28990, // SAME - union UINT_FLOAT SQ_ALU_CONST_CACHE_VS_5; // = 0x28994, // SAME - union UINT_FLOAT SQ_ALU_CONST_CACHE_VS_6; // = 0x28998, // SAME - union UINT_FLOAT SQ_ALU_CONST_CACHE_VS_7; // = 0x2899C, // SAME - union UINT_FLOAT SQ_ALU_CONST_CACHE_VS_8; // = 0x289A0, // SAME - union UINT_FLOAT SQ_ALU_CONST_CACHE_VS_9; // = 0x289A4, // SAME - union UINT_FLOAT SQ_ALU_CONST_CACHE_VS_10; // = 0x289A8, // SAME - union UINT_FLOAT SQ_ALU_CONST_CACHE_VS_11; // = 0x289AC, // SAME - union UINT_FLOAT SQ_ALU_CONST_CACHE_VS_12; // = 0x289B0, // SAME - union UINT_FLOAT SQ_ALU_CONST_CACHE_VS_13; // = 0x289B4, // SAME - union UINT_FLOAT SQ_ALU_CONST_CACHE_VS_14; // = 0x289B8, // SAME + union UINT_FLOAT SQ_ALU_CONST_CACHE_VS_0; //// // = 0x28980, // SAME + + union UINT_FLOAT SQ_ALU_CONST_CACHE_VS_1; // = 0x28984, // SAME + union UINT_FLOAT SQ_ALU_CONST_CACHE_VS_2; // = 0x28988, // SAME + union UINT_FLOAT SQ_ALU_CONST_CACHE_VS_3; // = 0x2898C, // SAME + union UINT_FLOAT SQ_ALU_CONST_CACHE_VS_4; // = 0x28990, // SAME + union UINT_FLOAT SQ_ALU_CONST_CACHE_VS_5; // = 0x28994, // SAME + union UINT_FLOAT SQ_ALU_CONST_CACHE_VS_6; // = 0x28998, // SAME + union UINT_FLOAT SQ_ALU_CONST_CACHE_VS_7; // = 0x2899C, // SAME + union UINT_FLOAT SQ_ALU_CONST_CACHE_VS_8; // = 0x289A0, // SAME + union UINT_FLOAT SQ_ALU_CONST_CACHE_VS_9; // = 0x289A4, // SAME + union UINT_FLOAT SQ_ALU_CONST_CACHE_VS_10; // = 0x289A8, // SAME + union UINT_FLOAT SQ_ALU_CONST_CACHE_VS_11; // = 0x289AC, // SAME + union UINT_FLOAT SQ_ALU_CONST_CACHE_VS_12; // = 0x289B0, // SAME + union UINT_FLOAT SQ_ALU_CONST_CACHE_VS_13; // = 0x289B4, // SAME + union UINT_FLOAT SQ_ALU_CONST_CACHE_VS_14; // = 0x289B8, // SAME union UINT_FLOAT SQ_ALU_CONST_CACHE_VS_15; // = 0x289BC, // SAME GLboolean dirty; @@ -164,347 +164,347 @@ typedef struct _EVERGREEN_VS_RES union UINT_FLOAT consts[EVERGREEN_MAX_DX9_CONSTS][4]; } EVERGREEN_VS_RES; -typedef struct _EVERGREEN_CHIP_CONTEXT +typedef struct _EVERGREEN_CHIP_CONTEXT { /* Registers from PA block: */ - union UINT_FLOAT PA_SC_SCREEN_SCISSOR_TL; //// // = 0x28030, // DIFF - union UINT_FLOAT PA_SC_SCREEN_SCISSOR_BR; //// // = 0x28034, // DIFF - union UINT_FLOAT PA_SC_WINDOW_OFFSET; //// // = 0x28200, // DIFF - union UINT_FLOAT PA_SC_WINDOW_SCISSOR_TL; //// // = 0x28204, // DIFF - union UINT_FLOAT PA_SC_WINDOW_SCISSOR_BR; //// // = 0x28208, // DIFF - union UINT_FLOAT PA_SC_CLIPRECT_RULE; //// // = 0x2820C, // SAME - union UINT_FLOAT PA_SC_CLIPRECT_0_TL; //// // = 0x28210, // DIFF - union UINT_FLOAT PA_SC_CLIPRECT_0_BR; //// // = 0x28214, // DIFF - union UINT_FLOAT PA_SC_CLIPRECT_1_TL; //// // = 0x28218, // DIFF - union UINT_FLOAT PA_SC_CLIPRECT_1_BR; //// // = 0x2821C, // DIFF - union UINT_FLOAT PA_SC_CLIPRECT_2_TL; //// // = 0x28220, // DIFF - union UINT_FLOAT PA_SC_CLIPRECT_2_BR; //// // = 0x28224, // DIFF - union UINT_FLOAT PA_SC_CLIPRECT_3_TL; //// // = 0x28228, // DIFF - union UINT_FLOAT PA_SC_CLIPRECT_3_BR; //// // = 0x2822C, // DIFF - union UINT_FLOAT PA_SC_EDGERULE; // = 0x28230, // SAME - union UINT_FLOAT PA_SU_HARDWARE_SCREEN_OFFSET; // = 0x28234, // - union UINT_FLOAT PA_SC_GENERIC_SCISSOR_TL; //// // = 0x28240, // DIFF + union UINT_FLOAT PA_SC_SCREEN_SCISSOR_TL; //// // = 0x28030, // DIFF + union UINT_FLOAT PA_SC_SCREEN_SCISSOR_BR; //// // = 0x28034, // DIFF + union UINT_FLOAT PA_SC_WINDOW_OFFSET; //// // = 0x28200, // DIFF + union UINT_FLOAT PA_SC_WINDOW_SCISSOR_TL; //// // = 0x28204, // DIFF + union UINT_FLOAT PA_SC_WINDOW_SCISSOR_BR; //// // = 0x28208, // DIFF + union UINT_FLOAT PA_SC_CLIPRECT_RULE; //// // = 0x2820C, // SAME + union UINT_FLOAT PA_SC_CLIPRECT_0_TL; //// // = 0x28210, // DIFF + union UINT_FLOAT PA_SC_CLIPRECT_0_BR; //// // = 0x28214, // DIFF + union UINT_FLOAT PA_SC_CLIPRECT_1_TL; //// // = 0x28218, // DIFF + union UINT_FLOAT PA_SC_CLIPRECT_1_BR; //// // = 0x2821C, // DIFF + union UINT_FLOAT PA_SC_CLIPRECT_2_TL; //// // = 0x28220, // DIFF + union UINT_FLOAT PA_SC_CLIPRECT_2_BR; //// // = 0x28224, // DIFF + union UINT_FLOAT PA_SC_CLIPRECT_3_TL; //// // = 0x28228, // DIFF + union UINT_FLOAT PA_SC_CLIPRECT_3_BR; //// // = 0x2822C, // DIFF + union UINT_FLOAT PA_SC_EDGERULE; // = 0x28230, // SAME + union UINT_FLOAT PA_SU_HARDWARE_SCREEN_OFFSET; // = 0x28234, // + union UINT_FLOAT PA_SC_GENERIC_SCISSOR_TL; //// // = 0x28240, // DIFF union UINT_FLOAT PA_SC_GENERIC_SCISSOR_BR; //// // = 0x28244, // DIFF - - EVERGREEN_VIEWPORT_STATE viewport[EVERGREEN_MAX_VIEWPORTS]; + + EVERGREEN_VIEWPORT_STATE viewport[EVERGREEN_MAX_VIEWPORTS]; EVERGREEN_UCP_STATE ucp[EVERGREEN_MAX_UCP]; - union UINT_FLOAT PA_CL_POINT_X_RAD; // = 0x287D4, // SAME 0x28E10 - union UINT_FLOAT PA_CL_POINT_Y_RAD; // = 0x287D8, // SAME 0x28E14 - union UINT_FLOAT PA_CL_POINT_SIZE; // = 0x287DC, // SAME 0x28E18 - union UINT_FLOAT PA_CL_POINT_CULL_RAD; // = 0x287E0, // SAME 0x28E1C - union UINT_FLOAT PA_CL_CLIP_CNTL; //// // = 0x28810, // SAME - union UINT_FLOAT PA_SU_SC_MODE_CNTL; //// // = 0x28814, // SAME - union UINT_FLOAT PA_CL_VTE_CNTL; //// // = 0x28818, // SAME - union UINT_FLOAT PA_CL_VS_OUT_CNTL; //// // = 0x2881C, // SAME - union UINT_FLOAT PA_CL_NANINF_CNTL; //// // = 0x28820, // SAME - union UINT_FLOAT PA_SU_LINE_STIPPLE_CNTL; // = 0x28824, // - union UINT_FLOAT PA_SU_LINE_STIPPLE_SCALE; // = 0x28828, // - union UINT_FLOAT PA_SU_PRIM_FILTER_CNTL; // = 0x2882C, // - union UINT_FLOAT PA_SU_POINT_SIZE; //// // = 0x28A00, // SAME - union UINT_FLOAT PA_SU_POINT_MINMAX; //// // = 0x28A04, // SAME - union UINT_FLOAT PA_SU_LINE_CNTL; //// // = 0x28A08, // SAME - union UINT_FLOAT PA_SC_LINE_STIPPLE; // = 0x28A0C, // SAME - union UINT_FLOAT PA_SC_MODE_CNTL_0; //// // = 0x28A48, // - union UINT_FLOAT PA_SC_MODE_CNTL_1; //// // = 0x28A4C, // - union UINT_FLOAT PA_SU_POLY_OFFSET_DB_FMT_CNTL; //// // = 0x28B78, // SAME 0x28DF8 - union UINT_FLOAT PA_SU_POLY_OFFSET_CLAMP; //// // = 0x28B7C, // SAME 0x28DFC - union UINT_FLOAT PA_SU_POLY_OFFSET_FRONT_SCALE;//// // = 0x28B80, // SAME 0x28E00 - union UINT_FLOAT PA_SU_POLY_OFFSET_FRONT_OFFSET; //// // = 0x28B84, // SAME 0x28E04 - union UINT_FLOAT PA_SU_POLY_OFFSET_BACK_SCALE; //// // = 0x28B88, // SAME 0x28E08 - union UINT_FLOAT PA_SU_POLY_OFFSET_BACK_OFFSET; //// // = 0x28B8C, // SAME 0x28E0C - union UINT_FLOAT PA_SC_LINE_CNTL; //// // = 0x28C00, // DIFF - union UINT_FLOAT PA_SC_AA_CONFIG; //// // = 0x28C04, // SAME - union UINT_FLOAT PA_SU_VTX_CNTL; //// // = 0x28C08, // SAME - union UINT_FLOAT PA_CL_GB_VERT_CLIP_ADJ; //// // = 0x28C0C, // SAME - union UINT_FLOAT PA_CL_GB_VERT_DISC_ADJ; //// // = 0x28C10, // SAME - union UINT_FLOAT PA_CL_GB_HORZ_CLIP_ADJ; //// // = 0x28C14, // SAME - union UINT_FLOAT PA_CL_GB_HORZ_DISC_ADJ; //// // = 0x28C18, // SAME - union UINT_FLOAT PA_SC_AA_SAMPLE_LOCS_0; //// // = 0x28C1C, // - union UINT_FLOAT PA_SC_AA_SAMPLE_LOCS_1; //// // = 0x28C20, // - union UINT_FLOAT PA_SC_AA_SAMPLE_LOCS_2; //// // = 0x28C24, // - union UINT_FLOAT PA_SC_AA_SAMPLE_LOCS_3; //// // = 0x28C28, // - union UINT_FLOAT PA_SC_AA_SAMPLE_LOCS_4; //// // = 0x28C2C, // - union UINT_FLOAT PA_SC_AA_SAMPLE_LOCS_5; //// // = 0x28C30, // - union UINT_FLOAT PA_SC_AA_SAMPLE_LOCS_6; //// // = 0x28C34, // - union UINT_FLOAT PA_SC_AA_SAMPLE_LOCS_7; //// // = 0x28C38, // - union UINT_FLOAT PA_SC_AA_MASK; //// // = 0x28C3C, // SAME 0x28C48 + union UINT_FLOAT PA_CL_POINT_X_RAD; // = 0x287D4, // SAME 0x28E10 + union UINT_FLOAT PA_CL_POINT_Y_RAD; // = 0x287D8, // SAME 0x28E14 + union UINT_FLOAT PA_CL_POINT_SIZE; // = 0x287DC, // SAME 0x28E18 + union UINT_FLOAT PA_CL_POINT_CULL_RAD; // = 0x287E0, // SAME 0x28E1C + union UINT_FLOAT PA_CL_CLIP_CNTL; //// // = 0x28810, // SAME + union UINT_FLOAT PA_SU_SC_MODE_CNTL; //// // = 0x28814, // SAME + union UINT_FLOAT PA_CL_VTE_CNTL; //// // = 0x28818, // SAME + union UINT_FLOAT PA_CL_VS_OUT_CNTL; //// // = 0x2881C, // SAME + union UINT_FLOAT PA_CL_NANINF_CNTL; //// // = 0x28820, // SAME + union UINT_FLOAT PA_SU_LINE_STIPPLE_CNTL; // = 0x28824, // + union UINT_FLOAT PA_SU_LINE_STIPPLE_SCALE; // = 0x28828, // + union UINT_FLOAT PA_SU_PRIM_FILTER_CNTL; // = 0x2882C, // + union UINT_FLOAT PA_SU_POINT_SIZE; //// // = 0x28A00, // SAME + union UINT_FLOAT PA_SU_POINT_MINMAX; //// // = 0x28A04, // SAME + union UINT_FLOAT PA_SU_LINE_CNTL; //// // = 0x28A08, // SAME + union UINT_FLOAT PA_SC_LINE_STIPPLE; // = 0x28A0C, // SAME + union UINT_FLOAT PA_SC_MODE_CNTL_0; //// // = 0x28A48, // + union UINT_FLOAT PA_SC_MODE_CNTL_1; //// // = 0x28A4C, // + union UINT_FLOAT PA_SU_POLY_OFFSET_DB_FMT_CNTL; //// // = 0x28B78, // SAME 0x28DF8 + union UINT_FLOAT PA_SU_POLY_OFFSET_CLAMP; //// // = 0x28B7C, // SAME 0x28DFC + union UINT_FLOAT PA_SU_POLY_OFFSET_FRONT_SCALE;//// // = 0x28B80, // SAME 0x28E00 + union UINT_FLOAT PA_SU_POLY_OFFSET_FRONT_OFFSET; //// // = 0x28B84, // SAME 0x28E04 + union UINT_FLOAT PA_SU_POLY_OFFSET_BACK_SCALE; //// // = 0x28B88, // SAME 0x28E08 + union UINT_FLOAT PA_SU_POLY_OFFSET_BACK_OFFSET; //// // = 0x28B8C, // SAME 0x28E0C + union UINT_FLOAT PA_SC_LINE_CNTL; //// // = 0x28C00, // DIFF + union UINT_FLOAT PA_SC_AA_CONFIG; //// // = 0x28C04, // SAME + union UINT_FLOAT PA_SU_VTX_CNTL; //// // = 0x28C08, // SAME + union UINT_FLOAT PA_CL_GB_VERT_CLIP_ADJ; //// // = 0x28C0C, // SAME + union UINT_FLOAT PA_CL_GB_VERT_DISC_ADJ; //// // = 0x28C10, // SAME + union UINT_FLOAT PA_CL_GB_HORZ_CLIP_ADJ; //// // = 0x28C14, // SAME + union UINT_FLOAT PA_CL_GB_HORZ_DISC_ADJ; //// // = 0x28C18, // SAME + union UINT_FLOAT PA_SC_AA_SAMPLE_LOCS_0; //// // = 0x28C1C, // + union UINT_FLOAT PA_SC_AA_SAMPLE_LOCS_1; //// // = 0x28C20, // + union UINT_FLOAT PA_SC_AA_SAMPLE_LOCS_2; //// // = 0x28C24, // + union UINT_FLOAT PA_SC_AA_SAMPLE_LOCS_3; //// // = 0x28C28, // + union UINT_FLOAT PA_SC_AA_SAMPLE_LOCS_4; //// // = 0x28C2C, // + union UINT_FLOAT PA_SC_AA_SAMPLE_LOCS_5; //// // = 0x28C30, // + union UINT_FLOAT PA_SC_AA_SAMPLE_LOCS_6; //// // = 0x28C34, // + union UINT_FLOAT PA_SC_AA_SAMPLE_LOCS_7; //// // = 0x28C38, // + union UINT_FLOAT PA_SC_AA_MASK; //// // = 0x28C3C, // SAME 0x28C48 /* Registers from VGT block: */ union UINT_FLOAT VGT_INDEX_TYPE; // = 0x895C, // SAME union UINT_FLOAT VGT_PRIMITIVE_TYPE; // = 0x8958, // SAME - union UINT_FLOAT VGT_MAX_VTX_INDX; //// // = 0x28400, // SAME - union UINT_FLOAT VGT_MIN_VTX_INDX; //// // = 0x28404, // SAME - union UINT_FLOAT VGT_INDX_OFFSET; //// // = 0x28408, // SAME - union UINT_FLOAT VGT_MULTI_PRIM_IB_RESET_INDX; // = 0x2840C, // SAME - - union UINT_FLOAT VGT_DRAW_INITIATOR; // = 0x287F0, // SAME - union UINT_FLOAT VGT_IMMED_DATA; // = 0x287F4, // SAME - - union UINT_FLOAT VGT_OUTPUT_PATH_CNTL; //// // = 0x28A10, // DIFF - union UINT_FLOAT VGT_HOS_CNTL; // = 0x28A14, // SAME - union UINT_FLOAT VGT_HOS_MAX_TESS_LEVEL; // = 0x28A18, // SAME - union UINT_FLOAT VGT_HOS_MIN_TESS_LEVEL; // = 0x28A1C, // SAME - union UINT_FLOAT VGT_HOS_REUSE_DEPTH; // = 0x28A20, // SAME - union UINT_FLOAT VGT_GROUP_PRIM_TYPE; // = 0x28A24, // SAME - union UINT_FLOAT VGT_GROUP_FIRST_DECR; // = 0x28A28, // SAME - union UINT_FLOAT VGT_GROUP_DECR; // = 0x28A2C, // SAME - union UINT_FLOAT VGT_GROUP_VECT_0_CNTL; // = 0x28A30, // SAME - union UINT_FLOAT VGT_GROUP_VECT_1_CNTL; // = 0x28A34, // SAME - union UINT_FLOAT VGT_GROUP_VECT_0_FMT_CNTL; // = 0x28A38, // SAME - union UINT_FLOAT VGT_GROUP_VECT_1_FMT_CNTL; // = 0x28A3C, // SAME - union UINT_FLOAT VGT_GS_MODE; //// // = 0x28A40, // DIFF - - union UINT_FLOAT VGT_PRIMITIVEID_EN; //// // = 0x28A84, // SAME - union UINT_FLOAT VGT_DMA_NUM_INSTANCES; //// // = 0x28A88, // SAME - union UINT_FLOAT VGT_EVENT_INITIATOR; // = 0x28A90, // SAME - union UINT_FLOAT VGT_MULTI_PRIM_IB_RESET_EN; // = 0x28A94, // SAME - union UINT_FLOAT VGT_INSTANCE_STEP_RATE_0; //// // = 0x28AA0, // SAME - union UINT_FLOAT VGT_INSTANCE_STEP_RATE_1; //// // = 0x28AA4, // SAME - union UINT_FLOAT VGT_REUSE_OFF; //// // = 0x28AB4, // SAME - union UINT_FLOAT VGT_VTX_CNT_EN; //// // = 0x28AB8, // SAME - + union UINT_FLOAT VGT_MAX_VTX_INDX; //// // = 0x28400, // SAME + union UINT_FLOAT VGT_MIN_VTX_INDX; //// // = 0x28404, // SAME + union UINT_FLOAT VGT_INDX_OFFSET; //// // = 0x28408, // SAME + union UINT_FLOAT VGT_MULTI_PRIM_IB_RESET_INDX; // = 0x2840C, // SAME + + union UINT_FLOAT VGT_DRAW_INITIATOR; // = 0x287F0, // SAME + union UINT_FLOAT VGT_IMMED_DATA; // = 0x287F4, // SAME + + union UINT_FLOAT VGT_OUTPUT_PATH_CNTL; //// // = 0x28A10, // DIFF + union UINT_FLOAT VGT_HOS_CNTL; // = 0x28A14, // SAME + union UINT_FLOAT VGT_HOS_MAX_TESS_LEVEL; // = 0x28A18, // SAME + union UINT_FLOAT VGT_HOS_MIN_TESS_LEVEL; // = 0x28A1C, // SAME + union UINT_FLOAT VGT_HOS_REUSE_DEPTH; // = 0x28A20, // SAME + union UINT_FLOAT VGT_GROUP_PRIM_TYPE; // = 0x28A24, // SAME + union UINT_FLOAT VGT_GROUP_FIRST_DECR; // = 0x28A28, // SAME + union UINT_FLOAT VGT_GROUP_DECR; // = 0x28A2C, // SAME + union UINT_FLOAT VGT_GROUP_VECT_0_CNTL; // = 0x28A30, // SAME + union UINT_FLOAT VGT_GROUP_VECT_1_CNTL; // = 0x28A34, // SAME + union UINT_FLOAT VGT_GROUP_VECT_0_FMT_CNTL; // = 0x28A38, // SAME + union UINT_FLOAT VGT_GROUP_VECT_1_FMT_CNTL; // = 0x28A3C, // SAME + union UINT_FLOAT VGT_GS_MODE; //// // = 0x28A40, // DIFF + + union UINT_FLOAT VGT_PRIMITIVEID_EN; //// // = 0x28A84, // SAME + union UINT_FLOAT VGT_DMA_NUM_INSTANCES; //// // = 0x28A88, // SAME + union UINT_FLOAT VGT_EVENT_INITIATOR; // = 0x28A90, // SAME + union UINT_FLOAT VGT_MULTI_PRIM_IB_RESET_EN; // = 0x28A94, // SAME + union UINT_FLOAT VGT_INSTANCE_STEP_RATE_0; //// // = 0x28AA0, // SAME + union UINT_FLOAT VGT_INSTANCE_STEP_RATE_1; //// // = 0x28AA4, // SAME + union UINT_FLOAT VGT_REUSE_OFF; //// // = 0x28AB4, // SAME + union UINT_FLOAT VGT_VTX_CNT_EN; //// // = 0x28AB8, // SAME + union UINT_FLOAT VGT_SHADER_STAGES_EN; //// // = 0x28B54, // - - union UINT_FLOAT VGT_STRMOUT_CONFIG; //// // = 0x28B94, // - union UINT_FLOAT VGT_STRMOUT_BUFFER_CONFIG; //// // = 0x28B98, // - union UINT_FLOAT VGT_VERTEX_REUSE_BLOCK_CNTL;//// // = 0x28C58, // SAME - union UINT_FLOAT VGT_OUT_DEALLOC_CNTL; //// // = 0x28C5C, // SAME -/* Registers from SQ block: */ + union UINT_FLOAT VGT_STRMOUT_CONFIG; //// // = 0x28B94, // + union UINT_FLOAT VGT_STRMOUT_BUFFER_CONFIG; //// // = 0x28B98, // + union UINT_FLOAT VGT_VERTEX_REUSE_BLOCK_CNTL;//// // = 0x28C58, // SAME + union UINT_FLOAT VGT_OUT_DEALLOC_CNTL; //// // = 0x28C5C, // SAME + +/* Registers from SQ block: */ union UINT_FLOAT SQ_VTX_SEMANTIC_0; //// // = 0x28380, // SAME union UINT_FLOAT SQ_VTX_SEMANTIC_1; //// // = 0x28384, // SAME union UINT_FLOAT SQ_VTX_SEMANTIC_2; //// // = 0x28388, // SAME union UINT_FLOAT SQ_VTX_SEMANTIC_3; //// // = 0x2838C, // SAME union UINT_FLOAT SQ_VTX_SEMANTIC_4; //// // = 0x28390, // SAME union UINT_FLOAT SQ_VTX_SEMANTIC_5; //// // = 0x28394, // SAME - union UINT_FLOAT SQ_VTX_SEMANTIC_6; //// // = 0x28398, // SAME - union UINT_FLOAT SQ_VTX_SEMANTIC_7; //// // = 0x2839C, // SAME - union UINT_FLOAT SQ_VTX_SEMANTIC_8; //// // = 0x283A0, // SAME - union UINT_FLOAT SQ_VTX_SEMANTIC_9; //// // = 0x283A4, // SAME - union UINT_FLOAT SQ_VTX_SEMANTIC_10; //// // = 0x283A8, // SAME - union UINT_FLOAT SQ_VTX_SEMANTIC_11; //// // = 0x283AC, // SAME - union UINT_FLOAT SQ_VTX_SEMANTIC_12; //// // = 0x283B0, // SAME - union UINT_FLOAT SQ_VTX_SEMANTIC_13; //// // = 0x283B4, // SAME - union UINT_FLOAT SQ_VTX_SEMANTIC_14; //// // = 0x283B8, // SAME - union UINT_FLOAT SQ_VTX_SEMANTIC_15; //// // = 0x283BC, // SAME - union UINT_FLOAT SQ_VTX_SEMANTIC_16; //// // = 0x283C0, // SAME - union UINT_FLOAT SQ_VTX_SEMANTIC_17; //// // = 0x283C4, // SAME - union UINT_FLOAT SQ_VTX_SEMANTIC_18; //// // = 0x283C8, // SAME - union UINT_FLOAT SQ_VTX_SEMANTIC_19; //// // = 0x283CC, // SAME - union UINT_FLOAT SQ_VTX_SEMANTIC_20; //// // = 0x283D0, // SAME - union UINT_FLOAT SQ_VTX_SEMANTIC_21; //// // = 0x283D4, // SAME - union UINT_FLOAT SQ_VTX_SEMANTIC_22; //// // = 0x283D8, // SAME - union UINT_FLOAT SQ_VTX_SEMANTIC_23; //// // = 0x283DC, // SAME - union UINT_FLOAT SQ_VTX_SEMANTIC_24; //// // = 0x283E0, // SAME - union UINT_FLOAT SQ_VTX_SEMANTIC_25; //// // = 0x283E4, // SAME - union UINT_FLOAT SQ_VTX_SEMANTIC_26; //// // = 0x283E8, // SAME - union UINT_FLOAT SQ_VTX_SEMANTIC_27; //// // = 0x283EC, // SAME - union UINT_FLOAT SQ_VTX_SEMANTIC_28; //// // = 0x283F0, // SAME - union UINT_FLOAT SQ_VTX_SEMANTIC_29; //// // = 0x283F4, // SAME - union UINT_FLOAT SQ_VTX_SEMANTIC_30; //// // = 0x283F8, // SAME - union UINT_FLOAT SQ_VTX_SEMANTIC_31; //// // = 0x283FC, // SAME - union UINT_FLOAT SQ_DYN_GPR_RESOURCE_LIMIT_1;//// // = 0x28838, // - - union UINT_FLOAT SQ_PGM_RESOURCES_PS; //// // = 0x28844, // DIFF 0x28850 - union UINT_FLOAT SQ_PGM_RESOURCES_2_PS; //// // = 0x28848, // - union UINT_FLOAT SQ_PGM_EXPORTS_PS; //// // = 0x2884C, // SAME 0x28854 - - union UINT_FLOAT SQ_PGM_RESOURCES_VS;//// // = 0x28860, // DIFF 0x28868 - union UINT_FLOAT SQ_PGM_RESOURCES_2_VS; //// // = 0x28864, // - union UINT_FLOAT SQ_PGM_START_GS; //// // = 0x28874, // SAME 0x2886C - union UINT_FLOAT SQ_PGM_RESOURCES_GS; //// // = 0x28878, // DIFF 0x2887C - union UINT_FLOAT SQ_PGM_RESOURCES_2_GS; //// // = 0x2887C, // - union UINT_FLOAT SQ_PGM_START_ES; //// // = 0x2888C, // SAME 0x28880 - union UINT_FLOAT SQ_PGM_RESOURCES_ES; //// // = 0x28890, // DIFF - union UINT_FLOAT SQ_PGM_RESOURCES_2_ES; //// // = 0x28894, // - union UINT_FLOAT SQ_PGM_START_FS; //// // = 0x288A4, // SAME 0x28894 - union UINT_FLOAT SQ_PGM_RESOURCES_FS; //// // = 0x288A8, // DIFF 0x288A4 - union UINT_FLOAT SQ_PGM_START_HS; // = 0x288B8, // - union UINT_FLOAT SQ_PGM_RESOURCES_HS; // = 0x288BC, // - union UINT_FLOAT SQ_PGM_RESOURCES_2_HS;//// // = 0x288C0, // - union UINT_FLOAT SQ_PGM_START_LS; // = 0x288D0, // - union UINT_FLOAT SQ_PGM_RESOURCES_LS; // = 0x288D4, // - union UINT_FLOAT SQ_PGM_RESOURCES_2_LS; //// // = 0x288D8, // - union UINT_FLOAT SQ_LDS_ALLOC_PS; //// // = 0x288EC, // - union UINT_FLOAT SQ_ESGS_RING_ITEMSIZE; //// // = 0x28900, // SAME 0x288A8 - union UINT_FLOAT SQ_GSVS_RING_ITEMSIZE; //// // = 0x28904, // SAME 0x288AC - union UINT_FLOAT SQ_ESTMP_RING_ITEMSIZE; //// // = 0x28908, // SAME 0x288B0 - union UINT_FLOAT SQ_GSTMP_RING_ITEMSIZE; //// // = 0x2890C, // SAME 0x288B4 - union UINT_FLOAT SQ_VSTMP_RING_ITEMSIZE; //// // = 0x28910, // SAME 0x288B8 - union UINT_FLOAT SQ_PSTMP_RING_ITEMSIZE; //// // = 0x28914, // SAME 0x288BC - union UINT_FLOAT SQ_GS_VERT_ITEMSIZE; //// // = 0x2891C, // SAME 0x288C8 - union UINT_FLOAT SQ_GS_VERT_ITEMSIZE_1; // = 0x28920, // - union UINT_FLOAT SQ_GS_VERT_ITEMSIZE_2; // = 0x28924, // - union UINT_FLOAT SQ_GS_VERT_ITEMSIZE_3; // = 0x28928, // - - union UINT_FLOAT SQ_ALU_CONST_CACHE_GS_0; // = 0x289C0, // SAME - union UINT_FLOAT SQ_ALU_CONST_CACHE_GS_1; // = 0x289C4, // SAME - union UINT_FLOAT SQ_ALU_CONST_CACHE_GS_2; // = 0x289C8, // SAME - union UINT_FLOAT SQ_ALU_CONST_CACHE_GS_3; // = 0x289CC, // SAME - union UINT_FLOAT SQ_ALU_CONST_CACHE_GS_4; // = 0x289D0, // SAME - union UINT_FLOAT SQ_ALU_CONST_CACHE_GS_5; // = 0x289D4, // SAME - union UINT_FLOAT SQ_ALU_CONST_CACHE_GS_6; // = 0x289D8, // SAME - union UINT_FLOAT SQ_ALU_CONST_CACHE_GS_7; // = 0x289DC, // SAME - union UINT_FLOAT SQ_ALU_CONST_CACHE_GS_8; // = 0x289E0, // SAME - union UINT_FLOAT SQ_ALU_CONST_CACHE_GS_9; // = 0x289E4, // SAME - union UINT_FLOAT SQ_ALU_CONST_CACHE_GS_10; // = 0x289E8, // SAME - union UINT_FLOAT SQ_ALU_CONST_CACHE_GS_11; // = 0x289EC, // SAME - union UINT_FLOAT SQ_ALU_CONST_CACHE_GS_12; // = 0x289F0, // SAME - union UINT_FLOAT SQ_ALU_CONST_CACHE_GS_13; // = 0x289F4, // SAME - union UINT_FLOAT SQ_ALU_CONST_CACHE_GS_14; // = 0x289F8, // SAME - union UINT_FLOAT SQ_ALU_CONST_CACHE_GS_15; // = 0x289FC, // SAME - union UINT_FLOAT SQ_ALU_CONST_CACHE_HS_0; // = 0x28F00, // - union UINT_FLOAT SQ_ALU_CONST_CACHE_HS_1; // = 0x28F04, // - union UINT_FLOAT SQ_ALU_CONST_CACHE_HS_2; // = 0x28F08, // - union UINT_FLOAT SQ_ALU_CONST_CACHE_HS_3; // = 0x28F0C, // - union UINT_FLOAT SQ_ALU_CONST_CACHE_HS_4; // = 0x28F10, // - union UINT_FLOAT SQ_ALU_CONST_CACHE_HS_5; // = 0x28F14, // - union UINT_FLOAT SQ_ALU_CONST_CACHE_HS_6; // = 0x28F18, // - union UINT_FLOAT SQ_ALU_CONST_CACHE_HS_7; // = 0x28F1C, // - union UINT_FLOAT SQ_ALU_CONST_CACHE_HS_8; // = 0x28F20, // - union UINT_FLOAT SQ_ALU_CONST_CACHE_HS_9; // = 0x28F24, // - union UINT_FLOAT SQ_ALU_CONST_CACHE_HS_10; // = 0x28F28, // - union UINT_FLOAT SQ_ALU_CONST_CACHE_HS_11; // = 0x28F2C, // - union UINT_FLOAT SQ_ALU_CONST_CACHE_HS_12; // = 0x28F30, // - union UINT_FLOAT SQ_ALU_CONST_CACHE_HS_13; // = 0x28F34, // - union UINT_FLOAT SQ_ALU_CONST_CACHE_HS_14; // = 0x28F38, // - union UINT_FLOAT SQ_ALU_CONST_CACHE_HS_15; // = 0x28F3C, // - union UINT_FLOAT SQ_ALU_CONST_CACHE_LS_0; // = 0x28F40, // - union UINT_FLOAT SQ_ALU_CONST_CACHE_LS_1; // = 0x28F44, // - union UINT_FLOAT SQ_ALU_CONST_CACHE_LS_2; // = 0x28F48, // - union UINT_FLOAT SQ_ALU_CONST_CACHE_LS_3; // = 0x28F4C, // - union UINT_FLOAT SQ_ALU_CONST_CACHE_LS_4; // = 0x28F50, // - union UINT_FLOAT SQ_ALU_CONST_CACHE_LS_5; // = 0x28F54, // - union UINT_FLOAT SQ_ALU_CONST_CACHE_LS_6; // = 0x28F58, // - union UINT_FLOAT SQ_ALU_CONST_CACHE_LS_7; // = 0x28F5C, // - union UINT_FLOAT SQ_ALU_CONST_CACHE_LS_8; // = 0x28F60, // - union UINT_FLOAT SQ_ALU_CONST_CACHE_LS_9; // = 0x28F64, // - union UINT_FLOAT SQ_ALU_CONST_CACHE_LS_10; // = 0x28F68, // - union UINT_FLOAT SQ_ALU_CONST_CACHE_LS_11; // = 0x28F6C, // - union UINT_FLOAT SQ_ALU_CONST_CACHE_LS_12; // = 0x28F70, // - union UINT_FLOAT SQ_ALU_CONST_CACHE_LS_13; // = 0x28F74, // - union UINT_FLOAT SQ_ALU_CONST_CACHE_LS_14; // = 0x28F78, // - union UINT_FLOAT SQ_ALU_CONST_CACHE_LS_15; // = 0x28F7C, // - union UINT_FLOAT SQ_ALU_CONST_BUFFER_SIZE_HS_0; // = 0x28F80, // - union UINT_FLOAT SQ_ALU_CONST_BUFFER_SIZE_HS_1; // = 0x28F84, // - union UINT_FLOAT SQ_ALU_CONST_BUFFER_SIZE_HS_2; // = 0x28F88, // - union UINT_FLOAT SQ_ALU_CONST_BUFFER_SIZE_HS_3; // = 0x28F8C, // - union UINT_FLOAT SQ_ALU_CONST_BUFFER_SIZE_HS_4; // = 0x28F90, // - union UINT_FLOAT SQ_ALU_CONST_BUFFER_SIZE_HS_5; // = 0x28F94, // - union UINT_FLOAT SQ_ALU_CONST_BUFFER_SIZE_HS_6; // = 0x28F98, // - union UINT_FLOAT SQ_ALU_CONST_BUFFER_SIZE_HS_7; // = 0x28F9C, // - union UINT_FLOAT SQ_ALU_CONST_BUFFER_SIZE_HS_8; // = 0x28FA0, // - union UINT_FLOAT SQ_ALU_CONST_BUFFER_SIZE_HS_9; // = 0x28FA4, // - union UINT_FLOAT SQ_ALU_CONST_BUFFER_SIZE_HS_10; // = 0x28FA8, // - union UINT_FLOAT SQ_ALU_CONST_BUFFER_SIZE_HS_11; // = 0x28FAC, // - union UINT_FLOAT SQ_ALU_CONST_BUFFER_SIZE_HS_12; // = 0x28FB0, // - union UINT_FLOAT SQ_ALU_CONST_BUFFER_SIZE_HS_13; // = 0x28FB4, // - union UINT_FLOAT SQ_ALU_CONST_BUFFER_SIZE_HS_14; // = 0x28FB8, // - union UINT_FLOAT SQ_ALU_CONST_BUFFER_SIZE_HS_15; // = 0x28FBC, // - union UINT_FLOAT SQ_ALU_CONST_BUFFER_SIZE_LS_0; // = 0x28FC0, // - union UINT_FLOAT SQ_ALU_CONST_BUFFER_SIZE_LS_1; // = 0x28FC4, // - union UINT_FLOAT SQ_ALU_CONST_BUFFER_SIZE_LS_2; // = 0x28FC8, // - union UINT_FLOAT SQ_ALU_CONST_BUFFER_SIZE_LS_3; // = 0x28FCC, // - union UINT_FLOAT SQ_ALU_CONST_BUFFER_SIZE_LS_4; // = 0x28FD0, // - union UINT_FLOAT SQ_ALU_CONST_BUFFER_SIZE_LS_5; // = 0x28FD4, // - union UINT_FLOAT SQ_ALU_CONST_BUFFER_SIZE_LS_6; // = 0x28FD8, // - union UINT_FLOAT SQ_ALU_CONST_BUFFER_SIZE_LS_7; // = 0x28FDC, // - union UINT_FLOAT SQ_ALU_CONST_BUFFER_SIZE_LS_8; // = 0x28FE0, // - union UINT_FLOAT SQ_ALU_CONST_BUFFER_SIZE_LS_9; // = 0x28FE4, // - union UINT_FLOAT SQ_ALU_CONST_BUFFER_SIZE_LS_10; // = 0x28FE8, // - union UINT_FLOAT SQ_ALU_CONST_BUFFER_SIZE_LS_11; // = 0x28FEC, // - union UINT_FLOAT SQ_ALU_CONST_BUFFER_SIZE_LS_12; // = 0x28FF0, // - union UINT_FLOAT SQ_ALU_CONST_BUFFER_SIZE_LS_13; // = 0x28FF4, // - union UINT_FLOAT SQ_ALU_CONST_BUFFER_SIZE_LS_14; // = 0x28FF8, // - union UINT_FLOAT SQ_ALU_CONST_BUFFER_SIZE_LS_15; // = 0x28FFC, // + union UINT_FLOAT SQ_VTX_SEMANTIC_6; //// // = 0x28398, // SAME + union UINT_FLOAT SQ_VTX_SEMANTIC_7; //// // = 0x2839C, // SAME + union UINT_FLOAT SQ_VTX_SEMANTIC_8; //// // = 0x283A0, // SAME + union UINT_FLOAT SQ_VTX_SEMANTIC_9; //// // = 0x283A4, // SAME + union UINT_FLOAT SQ_VTX_SEMANTIC_10; //// // = 0x283A8, // SAME + union UINT_FLOAT SQ_VTX_SEMANTIC_11; //// // = 0x283AC, // SAME + union UINT_FLOAT SQ_VTX_SEMANTIC_12; //// // = 0x283B0, // SAME + union UINT_FLOAT SQ_VTX_SEMANTIC_13; //// // = 0x283B4, // SAME + union UINT_FLOAT SQ_VTX_SEMANTIC_14; //// // = 0x283B8, // SAME + union UINT_FLOAT SQ_VTX_SEMANTIC_15; //// // = 0x283BC, // SAME + union UINT_FLOAT SQ_VTX_SEMANTIC_16; //// // = 0x283C0, // SAME + union UINT_FLOAT SQ_VTX_SEMANTIC_17; //// // = 0x283C4, // SAME + union UINT_FLOAT SQ_VTX_SEMANTIC_18; //// // = 0x283C8, // SAME + union UINT_FLOAT SQ_VTX_SEMANTIC_19; //// // = 0x283CC, // SAME + union UINT_FLOAT SQ_VTX_SEMANTIC_20; //// // = 0x283D0, // SAME + union UINT_FLOAT SQ_VTX_SEMANTIC_21; //// // = 0x283D4, // SAME + union UINT_FLOAT SQ_VTX_SEMANTIC_22; //// // = 0x283D8, // SAME + union UINT_FLOAT SQ_VTX_SEMANTIC_23; //// // = 0x283DC, // SAME + union UINT_FLOAT SQ_VTX_SEMANTIC_24; //// // = 0x283E0, // SAME + union UINT_FLOAT SQ_VTX_SEMANTIC_25; //// // = 0x283E4, // SAME + union UINT_FLOAT SQ_VTX_SEMANTIC_26; //// // = 0x283E8, // SAME + union UINT_FLOAT SQ_VTX_SEMANTIC_27; //// // = 0x283EC, // SAME + union UINT_FLOAT SQ_VTX_SEMANTIC_28; //// // = 0x283F0, // SAME + union UINT_FLOAT SQ_VTX_SEMANTIC_29; //// // = 0x283F4, // SAME + union UINT_FLOAT SQ_VTX_SEMANTIC_30; //// // = 0x283F8, // SAME + union UINT_FLOAT SQ_VTX_SEMANTIC_31; //// // = 0x283FC, // SAME + union UINT_FLOAT SQ_DYN_GPR_RESOURCE_LIMIT_1;//// // = 0x28838, // + + union UINT_FLOAT SQ_PGM_RESOURCES_PS; //// // = 0x28844, // DIFF 0x28850 + union UINT_FLOAT SQ_PGM_RESOURCES_2_PS; //// // = 0x28848, // + union UINT_FLOAT SQ_PGM_EXPORTS_PS; //// // = 0x2884C, // SAME 0x28854 + + union UINT_FLOAT SQ_PGM_RESOURCES_VS;//// // = 0x28860, // DIFF 0x28868 + union UINT_FLOAT SQ_PGM_RESOURCES_2_VS; //// // = 0x28864, // + union UINT_FLOAT SQ_PGM_START_GS; //// // = 0x28874, // SAME 0x2886C + union UINT_FLOAT SQ_PGM_RESOURCES_GS; //// // = 0x28878, // DIFF 0x2887C + union UINT_FLOAT SQ_PGM_RESOURCES_2_GS; //// // = 0x2887C, // + union UINT_FLOAT SQ_PGM_START_ES; //// // = 0x2888C, // SAME 0x28880 + union UINT_FLOAT SQ_PGM_RESOURCES_ES; //// // = 0x28890, // DIFF + union UINT_FLOAT SQ_PGM_RESOURCES_2_ES; //// // = 0x28894, // + union UINT_FLOAT SQ_PGM_START_FS; //// // = 0x288A4, // SAME 0x28894 + union UINT_FLOAT SQ_PGM_RESOURCES_FS; //// // = 0x288A8, // DIFF 0x288A4 + union UINT_FLOAT SQ_PGM_START_HS; // = 0x288B8, // + union UINT_FLOAT SQ_PGM_RESOURCES_HS; // = 0x288BC, // + union UINT_FLOAT SQ_PGM_RESOURCES_2_HS;//// // = 0x288C0, // + union UINT_FLOAT SQ_PGM_START_LS; // = 0x288D0, // + union UINT_FLOAT SQ_PGM_RESOURCES_LS; // = 0x288D4, // + union UINT_FLOAT SQ_PGM_RESOURCES_2_LS; //// // = 0x288D8, // + union UINT_FLOAT SQ_LDS_ALLOC_PS; //// // = 0x288EC, // + union UINT_FLOAT SQ_ESGS_RING_ITEMSIZE; //// // = 0x28900, // SAME 0x288A8 + union UINT_FLOAT SQ_GSVS_RING_ITEMSIZE; //// // = 0x28904, // SAME 0x288AC + union UINT_FLOAT SQ_ESTMP_RING_ITEMSIZE; //// // = 0x28908, // SAME 0x288B0 + union UINT_FLOAT SQ_GSTMP_RING_ITEMSIZE; //// // = 0x2890C, // SAME 0x288B4 + union UINT_FLOAT SQ_VSTMP_RING_ITEMSIZE; //// // = 0x28910, // SAME 0x288B8 + union UINT_FLOAT SQ_PSTMP_RING_ITEMSIZE; //// // = 0x28914, // SAME 0x288BC + union UINT_FLOAT SQ_GS_VERT_ITEMSIZE; //// // = 0x2891C, // SAME 0x288C8 + union UINT_FLOAT SQ_GS_VERT_ITEMSIZE_1; // = 0x28920, // + union UINT_FLOAT SQ_GS_VERT_ITEMSIZE_2; // = 0x28924, // + union UINT_FLOAT SQ_GS_VERT_ITEMSIZE_3; // = 0x28928, // + + union UINT_FLOAT SQ_ALU_CONST_CACHE_GS_0; // = 0x289C0, // SAME + union UINT_FLOAT SQ_ALU_CONST_CACHE_GS_1; // = 0x289C4, // SAME + union UINT_FLOAT SQ_ALU_CONST_CACHE_GS_2; // = 0x289C8, // SAME + union UINT_FLOAT SQ_ALU_CONST_CACHE_GS_3; // = 0x289CC, // SAME + union UINT_FLOAT SQ_ALU_CONST_CACHE_GS_4; // = 0x289D0, // SAME + union UINT_FLOAT SQ_ALU_CONST_CACHE_GS_5; // = 0x289D4, // SAME + union UINT_FLOAT SQ_ALU_CONST_CACHE_GS_6; // = 0x289D8, // SAME + union UINT_FLOAT SQ_ALU_CONST_CACHE_GS_7; // = 0x289DC, // SAME + union UINT_FLOAT SQ_ALU_CONST_CACHE_GS_8; // = 0x289E0, // SAME + union UINT_FLOAT SQ_ALU_CONST_CACHE_GS_9; // = 0x289E4, // SAME + union UINT_FLOAT SQ_ALU_CONST_CACHE_GS_10; // = 0x289E8, // SAME + union UINT_FLOAT SQ_ALU_CONST_CACHE_GS_11; // = 0x289EC, // SAME + union UINT_FLOAT SQ_ALU_CONST_CACHE_GS_12; // = 0x289F0, // SAME + union UINT_FLOAT SQ_ALU_CONST_CACHE_GS_13; // = 0x289F4, // SAME + union UINT_FLOAT SQ_ALU_CONST_CACHE_GS_14; // = 0x289F8, // SAME + union UINT_FLOAT SQ_ALU_CONST_CACHE_GS_15; // = 0x289FC, // SAME + union UINT_FLOAT SQ_ALU_CONST_CACHE_HS_0; // = 0x28F00, // + union UINT_FLOAT SQ_ALU_CONST_CACHE_HS_1; // = 0x28F04, // + union UINT_FLOAT SQ_ALU_CONST_CACHE_HS_2; // = 0x28F08, // + union UINT_FLOAT SQ_ALU_CONST_CACHE_HS_3; // = 0x28F0C, // + union UINT_FLOAT SQ_ALU_CONST_CACHE_HS_4; // = 0x28F10, // + union UINT_FLOAT SQ_ALU_CONST_CACHE_HS_5; // = 0x28F14, // + union UINT_FLOAT SQ_ALU_CONST_CACHE_HS_6; // = 0x28F18, // + union UINT_FLOAT SQ_ALU_CONST_CACHE_HS_7; // = 0x28F1C, // + union UINT_FLOAT SQ_ALU_CONST_CACHE_HS_8; // = 0x28F20, // + union UINT_FLOAT SQ_ALU_CONST_CACHE_HS_9; // = 0x28F24, // + union UINT_FLOAT SQ_ALU_CONST_CACHE_HS_10; // = 0x28F28, // + union UINT_FLOAT SQ_ALU_CONST_CACHE_HS_11; // = 0x28F2C, // + union UINT_FLOAT SQ_ALU_CONST_CACHE_HS_12; // = 0x28F30, // + union UINT_FLOAT SQ_ALU_CONST_CACHE_HS_13; // = 0x28F34, // + union UINT_FLOAT SQ_ALU_CONST_CACHE_HS_14; // = 0x28F38, // + union UINT_FLOAT SQ_ALU_CONST_CACHE_HS_15; // = 0x28F3C, // + union UINT_FLOAT SQ_ALU_CONST_CACHE_LS_0; // = 0x28F40, // + union UINT_FLOAT SQ_ALU_CONST_CACHE_LS_1; // = 0x28F44, // + union UINT_FLOAT SQ_ALU_CONST_CACHE_LS_2; // = 0x28F48, // + union UINT_FLOAT SQ_ALU_CONST_CACHE_LS_3; // = 0x28F4C, // + union UINT_FLOAT SQ_ALU_CONST_CACHE_LS_4; // = 0x28F50, // + union UINT_FLOAT SQ_ALU_CONST_CACHE_LS_5; // = 0x28F54, // + union UINT_FLOAT SQ_ALU_CONST_CACHE_LS_6; // = 0x28F58, // + union UINT_FLOAT SQ_ALU_CONST_CACHE_LS_7; // = 0x28F5C, // + union UINT_FLOAT SQ_ALU_CONST_CACHE_LS_8; // = 0x28F60, // + union UINT_FLOAT SQ_ALU_CONST_CACHE_LS_9; // = 0x28F64, // + union UINT_FLOAT SQ_ALU_CONST_CACHE_LS_10; // = 0x28F68, // + union UINT_FLOAT SQ_ALU_CONST_CACHE_LS_11; // = 0x28F6C, // + union UINT_FLOAT SQ_ALU_CONST_CACHE_LS_12; // = 0x28F70, // + union UINT_FLOAT SQ_ALU_CONST_CACHE_LS_13; // = 0x28F74, // + union UINT_FLOAT SQ_ALU_CONST_CACHE_LS_14; // = 0x28F78, // + union UINT_FLOAT SQ_ALU_CONST_CACHE_LS_15; // = 0x28F7C, // + union UINT_FLOAT SQ_ALU_CONST_BUFFER_SIZE_HS_0; // = 0x28F80, // + union UINT_FLOAT SQ_ALU_CONST_BUFFER_SIZE_HS_1; // = 0x28F84, // + union UINT_FLOAT SQ_ALU_CONST_BUFFER_SIZE_HS_2; // = 0x28F88, // + union UINT_FLOAT SQ_ALU_CONST_BUFFER_SIZE_HS_3; // = 0x28F8C, // + union UINT_FLOAT SQ_ALU_CONST_BUFFER_SIZE_HS_4; // = 0x28F90, // + union UINT_FLOAT SQ_ALU_CONST_BUFFER_SIZE_HS_5; // = 0x28F94, // + union UINT_FLOAT SQ_ALU_CONST_BUFFER_SIZE_HS_6; // = 0x28F98, // + union UINT_FLOAT SQ_ALU_CONST_BUFFER_SIZE_HS_7; // = 0x28F9C, // + union UINT_FLOAT SQ_ALU_CONST_BUFFER_SIZE_HS_8; // = 0x28FA0, // + union UINT_FLOAT SQ_ALU_CONST_BUFFER_SIZE_HS_9; // = 0x28FA4, // + union UINT_FLOAT SQ_ALU_CONST_BUFFER_SIZE_HS_10; // = 0x28FA8, // + union UINT_FLOAT SQ_ALU_CONST_BUFFER_SIZE_HS_11; // = 0x28FAC, // + union UINT_FLOAT SQ_ALU_CONST_BUFFER_SIZE_HS_12; // = 0x28FB0, // + union UINT_FLOAT SQ_ALU_CONST_BUFFER_SIZE_HS_13; // = 0x28FB4, // + union UINT_FLOAT SQ_ALU_CONST_BUFFER_SIZE_HS_14; // = 0x28FB8, // + union UINT_FLOAT SQ_ALU_CONST_BUFFER_SIZE_HS_15; // = 0x28FBC, // + union UINT_FLOAT SQ_ALU_CONST_BUFFER_SIZE_LS_0; // = 0x28FC0, // + union UINT_FLOAT SQ_ALU_CONST_BUFFER_SIZE_LS_1; // = 0x28FC4, // + union UINT_FLOAT SQ_ALU_CONST_BUFFER_SIZE_LS_2; // = 0x28FC8, // + union UINT_FLOAT SQ_ALU_CONST_BUFFER_SIZE_LS_3; // = 0x28FCC, // + union UINT_FLOAT SQ_ALU_CONST_BUFFER_SIZE_LS_4; // = 0x28FD0, // + union UINT_FLOAT SQ_ALU_CONST_BUFFER_SIZE_LS_5; // = 0x28FD4, // + union UINT_FLOAT SQ_ALU_CONST_BUFFER_SIZE_LS_6; // = 0x28FD8, // + union UINT_FLOAT SQ_ALU_CONST_BUFFER_SIZE_LS_7; // = 0x28FDC, // + union UINT_FLOAT SQ_ALU_CONST_BUFFER_SIZE_LS_8; // = 0x28FE0, // + union UINT_FLOAT SQ_ALU_CONST_BUFFER_SIZE_LS_9; // = 0x28FE4, // + union UINT_FLOAT SQ_ALU_CONST_BUFFER_SIZE_LS_10; // = 0x28FE8, // + union UINT_FLOAT SQ_ALU_CONST_BUFFER_SIZE_LS_11; // = 0x28FEC, // + union UINT_FLOAT SQ_ALU_CONST_BUFFER_SIZE_LS_12; // = 0x28FF0, // + union UINT_FLOAT SQ_ALU_CONST_BUFFER_SIZE_LS_13; // = 0x28FF4, // + union UINT_FLOAT SQ_ALU_CONST_BUFFER_SIZE_LS_14; // = 0x28FF8, // + union UINT_FLOAT SQ_ALU_CONST_BUFFER_SIZE_LS_15; // = 0x28FFC, // EVERGREEN_PS_RES ps; EVERGREEN_VS_RES vs; /* Registers from SPI block: */ - union UINT_FLOAT SPI_VS_OUT_ID_0; //// // = 0x2861C, // SAME 0x28614 - union UINT_FLOAT SPI_VS_OUT_ID_1; //// // = 0x28620, // SAME 0x28618 - union UINT_FLOAT SPI_VS_OUT_ID_2; //// // = 0x28624, // SAME 0x2861C - union UINT_FLOAT SPI_VS_OUT_ID_3; //// // = 0x28628, // SAME 0x28620 - union UINT_FLOAT SPI_VS_OUT_ID_4; //// // = 0x2862C, // SAME 0x28624 - union UINT_FLOAT SPI_VS_OUT_ID_5; //// // = 0x28630, // SAME 0x28628 - union UINT_FLOAT SPI_VS_OUT_ID_6; //// // = 0x28634, // SAME 0x2862C - union UINT_FLOAT SPI_VS_OUT_ID_7; //// // = 0x28638, // SAME 0x28630 - union UINT_FLOAT SPI_VS_OUT_ID_8; //// // = 0x2863C, // SAME 0x28634 - union UINT_FLOAT SPI_VS_OUT_ID_9; //// // = 0x28640, // SAME 0x28638 - union UINT_FLOAT SPI_PS_INPUT_CNTL[32]; //// // = 0x28644, // SAME - - union UINT_FLOAT SPI_VS_OUT_CONFIG; //// // = 0x286C4, // SAME - union UINT_FLOAT SPI_THREAD_GROUPING; //// // = 0x286C8, // DIFF - union UINT_FLOAT SPI_PS_IN_CONTROL_0; //// // = 0x286CC, // SAME - union UINT_FLOAT SPI_PS_IN_CONTROL_1; //// // = 0x286D0, // SAME - union UINT_FLOAT SPI_INTERP_CONTROL_0; //// // = 0x286D4, // SAME - union UINT_FLOAT SPI_INPUT_Z; //// // = 0x286D8, // SAME - union UINT_FLOAT SPI_FOG_CNTL; //// // = 0x286DC, // SAME - union UINT_FLOAT SPI_BARYC_CNTL; //// // = 0x286E0, // - union UINT_FLOAT SPI_PS_IN_CONTROL_2; //// // = 0x286E4, // - union UINT_FLOAT SPI_COMPUTE_INPUT_CNTL; // = 0x286E8, // - union UINT_FLOAT SPI_COMPUTE_NUM_THREAD_X; // = 0x286EC, // - union UINT_FLOAT SPI_COMPUTE_NUM_THREAD_Y; // = 0x286F0, // - union UINT_FLOAT SPI_COMPUTE_NUM_THREAD_Z; // = 0x286F4, // + union UINT_FLOAT SPI_VS_OUT_ID_0; //// // = 0x2861C, // SAME 0x28614 + union UINT_FLOAT SPI_VS_OUT_ID_1; //// // = 0x28620, // SAME 0x28618 + union UINT_FLOAT SPI_VS_OUT_ID_2; //// // = 0x28624, // SAME 0x2861C + union UINT_FLOAT SPI_VS_OUT_ID_3; //// // = 0x28628, // SAME 0x28620 + union UINT_FLOAT SPI_VS_OUT_ID_4; //// // = 0x2862C, // SAME 0x28624 + union UINT_FLOAT SPI_VS_OUT_ID_5; //// // = 0x28630, // SAME 0x28628 + union UINT_FLOAT SPI_VS_OUT_ID_6; //// // = 0x28634, // SAME 0x2862C + union UINT_FLOAT SPI_VS_OUT_ID_7; //// // = 0x28638, // SAME 0x28630 + union UINT_FLOAT SPI_VS_OUT_ID_8; //// // = 0x2863C, // SAME 0x28634 + union UINT_FLOAT SPI_VS_OUT_ID_9; //// // = 0x28640, // SAME 0x28638 + union UINT_FLOAT SPI_PS_INPUT_CNTL[32]; //// // = 0x28644, // SAME + + union UINT_FLOAT SPI_VS_OUT_CONFIG; //// // = 0x286C4, // SAME + union UINT_FLOAT SPI_THREAD_GROUPING; //// // = 0x286C8, // DIFF + union UINT_FLOAT SPI_PS_IN_CONTROL_0; //// // = 0x286CC, // SAME + union UINT_FLOAT SPI_PS_IN_CONTROL_1; //// // = 0x286D0, // SAME + union UINT_FLOAT SPI_INTERP_CONTROL_0; //// // = 0x286D4, // SAME + union UINT_FLOAT SPI_INPUT_Z; //// // = 0x286D8, // SAME + union UINT_FLOAT SPI_FOG_CNTL; //// // = 0x286DC, // SAME + union UINT_FLOAT SPI_BARYC_CNTL; //// // = 0x286E0, // + union UINT_FLOAT SPI_PS_IN_CONTROL_2; //// // = 0x286E4, // + union UINT_FLOAT SPI_COMPUTE_INPUT_CNTL; // = 0x286E8, // + union UINT_FLOAT SPI_COMPUTE_NUM_THREAD_X; // = 0x286EC, // + union UINT_FLOAT SPI_COMPUTE_NUM_THREAD_Y; // = 0x286F0, // + union UINT_FLOAT SPI_COMPUTE_NUM_THREAD_Z; // = 0x286F4, // /* Registers from SX block: */ - union UINT_FLOAT SX_MISC; // = 0x28350, // SAME - union UINT_FLOAT SX_SURFACE_SYNC; // = 0x28354, // DIFF - union UINT_FLOAT SX_ALPHA_TEST_CONTROL; //// // = 0x28410, // SAME - union UINT_FLOAT SX_ALPHA_REF; // = 0x28438, // SAME + union UINT_FLOAT SX_MISC; // = 0x28350, // SAME + union UINT_FLOAT SX_SURFACE_SYNC; // = 0x28354, // DIFF + union UINT_FLOAT SX_ALPHA_TEST_CONTROL; //// // = 0x28410, // SAME + union UINT_FLOAT SX_ALPHA_REF; // = 0x28438, // SAME /* Registers from DB block: */ - union UINT_FLOAT DB_RENDER_CONTROL; //// // = 0x28000, // DIFF 0x28D0C - union UINT_FLOAT DB_COUNT_CONTROL; //// // = 0x28004, // - union UINT_FLOAT DB_DEPTH_VIEW; //// // = 0x28008, // DIFF 0x28004 - union UINT_FLOAT DB_RENDER_OVERRIDE; //// // = 0x2800C, // DIFF 0x28D10 - union UINT_FLOAT DB_RENDER_OVERRIDE2; //// // = 0x28010, // - union UINT_FLOAT DB_HTILE_DATA_BASE; //// // = 0x28014, // SAME - union UINT_FLOAT DB_STENCIL_CLEAR; //// // = 0x28028, // SAME - union UINT_FLOAT DB_DEPTH_CLEAR; //// // = 0x2802C, // SAME - union UINT_FLOAT DB_Z_INFO; //// // = 0x28040, // - union UINT_FLOAT DB_STENCIL_INFO; //// // = 0x28044, // - union UINT_FLOAT DB_Z_READ_BASE; //// // = 0x28048, // - union UINT_FLOAT DB_STENCIL_READ_BASE;//// // = 0x2804C, // - union UINT_FLOAT DB_Z_WRITE_BASE; //// // = 0x28050, // - union UINT_FLOAT DB_STENCIL_WRITE_BASE; //// // = 0x28054, // - union UINT_FLOAT DB_DEPTH_SIZE; //// // = 0x28058, // DIFF 0x28000 - union UINT_FLOAT DB_DEPTH_SLICE; //// // = 0x2805C, // - union UINT_FLOAT DB_STENCILREFMASK; // = 0x28430, // SAME - union UINT_FLOAT DB_STENCILREFMASK_BF; // = 0x28434, // SAME - union UINT_FLOAT DB_DEPTH_CONTROL; //// // = 0x28800, // SAME - union UINT_FLOAT DB_SHADER_CONTROL;//// // = 0x2880C, // DIFF - union UINT_FLOAT DB_HTILE_SURFACE; //// // = 0x28ABC, // SAME 0x28D24 - union UINT_FLOAT DB_SRESULTS_COMPARE_STATE0; //// // = 0x28AC0, // SAME 0x28D28 - union UINT_FLOAT DB_SRESULTS_COMPARE_STATE1; //// // = 0x28AC4, // SAME 0x28D2C - union UINT_FLOAT DB_PRELOAD_CONTROL; //// // = 0x28AC8, // SAME 0x28D30 - union UINT_FLOAT DB_ALPHA_TO_MASK; //// // = 0x28B70, // SAME 0x28D44 + union UINT_FLOAT DB_RENDER_CONTROL; //// // = 0x28000, // DIFF 0x28D0C + union UINT_FLOAT DB_COUNT_CONTROL; //// // = 0x28004, // + union UINT_FLOAT DB_DEPTH_VIEW; //// // = 0x28008, // DIFF 0x28004 + union UINT_FLOAT DB_RENDER_OVERRIDE; //// // = 0x2800C, // DIFF 0x28D10 + union UINT_FLOAT DB_RENDER_OVERRIDE2; //// // = 0x28010, // + union UINT_FLOAT DB_HTILE_DATA_BASE; //// // = 0x28014, // SAME + union UINT_FLOAT DB_STENCIL_CLEAR; //// // = 0x28028, // SAME + union UINT_FLOAT DB_DEPTH_CLEAR; //// // = 0x2802C, // SAME + union UINT_FLOAT DB_Z_INFO; //// // = 0x28040, // + union UINT_FLOAT DB_STENCIL_INFO; //// // = 0x28044, // + union UINT_FLOAT DB_Z_READ_BASE; //// // = 0x28048, // + union UINT_FLOAT DB_STENCIL_READ_BASE;//// // = 0x2804C, // + union UINT_FLOAT DB_Z_WRITE_BASE; //// // = 0x28050, // + union UINT_FLOAT DB_STENCIL_WRITE_BASE; //// // = 0x28054, // + union UINT_FLOAT DB_DEPTH_SIZE; //// // = 0x28058, // DIFF 0x28000 + union UINT_FLOAT DB_DEPTH_SLICE; //// // = 0x2805C, // + union UINT_FLOAT DB_STENCILREFMASK; // = 0x28430, // SAME + union UINT_FLOAT DB_STENCILREFMASK_BF; // = 0x28434, // SAME + union UINT_FLOAT DB_DEPTH_CONTROL; //// // = 0x28800, // SAME + union UINT_FLOAT DB_SHADER_CONTROL;//// // = 0x2880C, // DIFF + union UINT_FLOAT DB_HTILE_SURFACE; //// // = 0x28ABC, // SAME 0x28D24 + union UINT_FLOAT DB_SRESULTS_COMPARE_STATE0; //// // = 0x28AC0, // SAME 0x28D28 + union UINT_FLOAT DB_SRESULTS_COMPARE_STATE1; //// // = 0x28AC4, // SAME 0x28D2C + union UINT_FLOAT DB_PRELOAD_CONTROL; //// // = 0x28AC8, // SAME 0x28D30 + union UINT_FLOAT DB_ALPHA_TO_MASK; //// // = 0x28B70, // SAME 0x28D44 /* Registers from CB block: */ - union UINT_FLOAT CB_TARGET_MASK; //// // = 0x28238, // SAME - union UINT_FLOAT CB_SHADER_MASK; //// // = 0x2823C, // SAME - union UINT_FLOAT CB_BLEND_RED; //// // = 0x28414, // SAME - union UINT_FLOAT CB_BLEND_GREEN; //// // = 0x28418, // SAME - union UINT_FLOAT CB_BLEND_BLUE; //// // = 0x2841C, // SAME - union UINT_FLOAT CB_BLEND_ALPHA; //// // = 0x28420, // SAME - union UINT_FLOAT CB_BLEND0_CONTROL; //// // = 0x28780, // DIFF - union UINT_FLOAT CB_BLEND1_CONTROL; // = 0x28784, // DIFF - union UINT_FLOAT CB_BLEND2_CONTROL; // = 0x28788, // DIFF - union UINT_FLOAT CB_BLEND3_CONTROL; // = 0x2878C, // DIFF - union UINT_FLOAT CB_BLEND4_CONTROL; // = 0x28790, // DIFF - union UINT_FLOAT CB_BLEND5_CONTROL; // = 0x28794, // DIFF - union UINT_FLOAT CB_BLEND6_CONTROL; // = 0x28798, // DIFF - union UINT_FLOAT CB_BLEND7_CONTROL; // = 0x2879C, // DIFF - union UINT_FLOAT CB_COLOR_CONTROL; //// // = 0x28808, // DIFF - union UINT_FLOAT CB_CLRCMP_CONTROL; //// // = 0x28C40, // SAME 0x28C30 - union UINT_FLOAT CB_CLRCMP_SRC; //// // = 0x28C44, // SAME 0x28C34 - union UINT_FLOAT CB_CLRCMP_DST; //// // = 0x28C48, // SAME 0x28C38 - union UINT_FLOAT CB_CLRCMP_MSK; //// // = 0x28C4C, // SAME 0x28C3C - - EVERGREEN_RENDER_TARGET_STATE render_target[EVERGREEN_MAX_RENDER_TARGETS]; - + union UINT_FLOAT CB_TARGET_MASK; //// // = 0x28238, // SAME + union UINT_FLOAT CB_SHADER_MASK; //// // = 0x2823C, // SAME + union UINT_FLOAT CB_BLEND_RED; //// // = 0x28414, // SAME + union UINT_FLOAT CB_BLEND_GREEN; //// // = 0x28418, // SAME + union UINT_FLOAT CB_BLEND_BLUE; //// // = 0x2841C, // SAME + union UINT_FLOAT CB_BLEND_ALPHA; //// // = 0x28420, // SAME + union UINT_FLOAT CB_BLEND0_CONTROL; //// // = 0x28780, // DIFF + union UINT_FLOAT CB_BLEND1_CONTROL; // = 0x28784, // DIFF + union UINT_FLOAT CB_BLEND2_CONTROL; // = 0x28788, // DIFF + union UINT_FLOAT CB_BLEND3_CONTROL; // = 0x2878C, // DIFF + union UINT_FLOAT CB_BLEND4_CONTROL; // = 0x28790, // DIFF + union UINT_FLOAT CB_BLEND5_CONTROL; // = 0x28794, // DIFF + union UINT_FLOAT CB_BLEND6_CONTROL; // = 0x28798, // DIFF + union UINT_FLOAT CB_BLEND7_CONTROL; // = 0x2879C, // DIFF + union UINT_FLOAT CB_COLOR_CONTROL; //// // = 0x28808, // DIFF + union UINT_FLOAT CB_CLRCMP_CONTROL; //// // = 0x28C40, // SAME 0x28C30 + union UINT_FLOAT CB_CLRCMP_SRC; //// // = 0x28C44, // SAME 0x28C34 + union UINT_FLOAT CB_CLRCMP_DST; //// // = 0x28C48, // SAME 0x28C38 + union UINT_FLOAT CB_CLRCMP_MSK; //// // = 0x28C4C, // SAME 0x28C3C + + EVERGREEN_RENDER_TARGET_STATE render_target[EVERGREEN_MAX_RENDER_TARGETS]; + radeonTexObj* textures[R700_TEXTURE_NUMBERUNITS]; EVERGREEN_CONFIG evergreen_config; diff --git a/src/mesa/drivers/dri/r600/evergreen_diff.h b/src/mesa/drivers/dri/r600/evergreen_diff.h index c3a5fd0..cd78cf0 100644 --- a/src/mesa/drivers/dri/r600/evergreen_diff.h +++ b/src/mesa/drivers/dri/r600/evergreen_diff.h @@ -31,34 +31,34 @@ enum { /* CB_BLEND_CONTROL */ EG_CB_BLENDX_CONTROL_ENABLE_bit = 1 << 30, /* PA_SC_SCREEN_SCISSOR_TL */ - EG_PA_SC_SCREEN_SCISSOR_TL__TL_X_mask = 0xffff << 0, + EG_PA_SC_SCREEN_SCISSOR_TL__TL_X_mask = 0xffff << 0, EG_PA_SC_SCREEN_SCISSOR_TL__TL_Y_mask = 0xffff << 16, /* PA_SC_SCREEN_SCISSOR_BR */ - EG_PA_SC_SCREEN_SCISSOR_BR__BR_X_mask = 0xffff << 0, + EG_PA_SC_SCREEN_SCISSOR_BR__BR_X_mask = 0xffff << 0, EG_PA_SC_SCREEN_SCISSOR_BR__BR_Y_mask = 0xffff << 16, - /* PA_SC_WINDOW_SCISSOR_TL */ - EG_PA_SC_WINDOW_SCISSOR_TL__TL_X_mask = 0x7fff << 0, - EG_PA_SC_WINDOW_SCISSOR_TL__TL_Y_mask = 0x7fff << 16, + /* PA_SC_WINDOW_SCISSOR_TL */ + EG_PA_SC_WINDOW_SCISSOR_TL__TL_X_mask = 0x7fff << 0, + EG_PA_SC_WINDOW_SCISSOR_TL__TL_Y_mask = 0x7fff << 16, /* PA_SC_WINDOW_SCISSOR_BR */ - EG_PA_SC_WINDOW_SCISSOR_BR__BR_X_mask = 0x7fff << 0, + EG_PA_SC_WINDOW_SCISSOR_BR__BR_X_mask = 0x7fff << 0, EG_PA_SC_WINDOW_SCISSOR_BR__BR_Y_mask = 0x7fff << 16, /* PA_SC_CLIPRECT_0_TL */ - EG_PA_SC_CLIPRECT_0_TL__TL_X_mask = 0x7fff << 0, - EG_PA_SC_CLIPRECT_0_TL__TL_Y_mask = 0x7fff << 16, - /* PA_SC_CLIPRECT_0_BR */ - EG_PA_SC_CLIPRECT_0_BR__BR_X_mask = 0x7fff << 0, + EG_PA_SC_CLIPRECT_0_TL__TL_X_mask = 0x7fff << 0, + EG_PA_SC_CLIPRECT_0_TL__TL_Y_mask = 0x7fff << 16, + /* PA_SC_CLIPRECT_0_BR */ + EG_PA_SC_CLIPRECT_0_BR__BR_X_mask = 0x7fff << 0, EG_PA_SC_CLIPRECT_0_BR__BR_Y_mask = 0x7fff << 16, /* PA_SC_GENERIC_SCISSOR_TL */ - EG_PA_SC_GENERIC_SCISSOR_TL__TL_X_mask = 0x7fff << 0, - EG_PA_SC_GENERIC_SCISSOR_TL__TL_Y_mask = 0x7fff << 16, + EG_PA_SC_GENERIC_SCISSOR_TL__TL_X_mask = 0x7fff << 0, + EG_PA_SC_GENERIC_SCISSOR_TL__TL_Y_mask = 0x7fff << 16, /* PA_SC_GENERIC_SCISSOR_BR */ - EG_PA_SC_GENERIC_SCISSOR_BR__BR_X_mask = 0x7fff << 0, + EG_PA_SC_GENERIC_SCISSOR_BR__BR_X_mask = 0x7fff << 0, EG_PA_SC_GENERIC_SCISSOR_BR__BR_Y_mask = 0x7fff << 16, - /* PA_SC_VPORT_SCISSOR_0_TL */ - EG_PA_SC_VPORT_SCISSOR_0_TL__TL_X_mask = 0x7fff << 0, - EG_PA_SC_VPORT_SCISSOR_0_TL__TL_Y_mask = 0x7fff << 16, - /* PA_SC_VPORT_SCISSOR_0_BR */ - EG_PA_SC_VPORT_SCISSOR_0_BR__BR_X_mask = 0x7fff << 0, + /* PA_SC_VPORT_SCISSOR_0_TL */ + EG_PA_SC_VPORT_SCISSOR_0_TL__TL_X_mask = 0x7fff << 0, + EG_PA_SC_VPORT_SCISSOR_0_TL__TL_Y_mask = 0x7fff << 16, + /* PA_SC_VPORT_SCISSOR_0_BR */ + EG_PA_SC_VPORT_SCISSOR_0_BR__BR_X_mask = 0x7fff << 0, EG_PA_SC_VPORT_SCISSOR_0_BR__BR_Y_mask = 0x7fff << 16, /* PA_SC_WINDOW_OFFSET */ EG_PA_SC_WINDOW_OFFSET__WINDOW_X_OFFSET_shift = 0, @@ -90,7 +90,7 @@ enum { //2; EG_DB_Z_INFO__BANK_HEIGHT_shift = 20, //2; EG_DB_Z_INFO__BANK_HEIGHT_mask = 0x3 << 20, - + EG_Z_INVALID = 0x00000000, EG_Z_16 = 0x00000001, EG_Z_24 = 0x00000002, @@ -104,7 +104,7 @@ enum { //7; EG_DB_STENCIL_INFO__TILE_SPLIT_shift = 8, //3; EG_DB_STENCIL_INFO__TILE_SPLIT_mask = 0x7 << 8, - + /* DB_DEPTH_SIZE */ EG_DB_DEPTH_SIZE__PITCH_TILE_MAX_shift = 0, // 11; EG_DB_DEPTH_SIZE__PITCH_TILE_MAX_mask = 0x7ff, @@ -115,7 +115,7 @@ enum { EG_DB_COUNT_CONTROL__ZPASS_INCREMENT_DISABLE_shift = 0, //1 EG_DB_COUNT_CONTROL__ZPASS_INCREMENT_DISABLE_bit = 1, EG_DB_COUNT_CONTROL__PERFECT_ZPASS_COUNTS_shift = 1, //1 - EG_DB_COUNT_CONTROL__PERFECT_ZPASS_COUNTS_bit = 1 << 1, + EG_DB_COUNT_CONTROL__PERFECT_ZPASS_COUNTS_bit = 1 << 1, /* CB_COLOR_CONTROL */ //3; @@ -185,27 +185,27 @@ enum { EG_PA_SC_FORCE_EOV_MAX_CNTS__FORCE_EOV_MAX_REZ_CNT_mask = 0x3fff << 16, /* VGT_CACHE_INVALIDATION */ EG_VGT_CACHE_INVALIDATION__CACHE_INVALIDATION_shift = 0, - EG_VGT_CACHE_INVALIDATION__CACHE_INVALIDATION_mask = 0x3, + EG_VGT_CACHE_INVALIDATION__CACHE_INVALIDATION_mask = 0x3, /* CB_COLOR0_PITCH */ EG_CB_COLOR0_PITCH__TILE_MAX_shift = 0, EG_CB_COLOR0_PITCH__TILE_MAX_mask = 0x7ff, /* CB_COLOR0_SLICE */ EG_CB_COLOR0_SLICE__TILE_MAX_shift = 0, - EG_CB_COLOR0_SLICE__TILE_MAX_mask = 0x3fffff, + EG_CB_COLOR0_SLICE__TILE_MAX_mask = 0x3fffff, /* SQ_VTX_CONSTANT_WORD3_0 */ EG_SQ_VTX_CONSTANT_WORD3_0__UNCACHED_shift = 2, EG_SQ_VTX_CONSTANT_WORD3_0__UNCACHED_bit = 1 << 2, - EG_SQ_VTX_CONSTANT_WORD3_0__DST_SEL_X_shift = 3, + EG_SQ_VTX_CONSTANT_WORD3_0__DST_SEL_X_shift = 3, EG_SQ_VTX_CONSTANT_WORD3_0__DST_SEL_X_mask = 0x7 << 3, - - EG_SQ_VTX_CONSTANT_WORD3_0__DST_SEL_Y_shift = 6, + + EG_SQ_VTX_CONSTANT_WORD3_0__DST_SEL_Y_shift = 6, EG_SQ_VTX_CONSTANT_WORD3_0__DST_SEL_Y_mask = 0x7 << 6, - - EG_SQ_VTX_CONSTANT_WORD3_0__DST_SEL_Z_shift = 9, + + EG_SQ_VTX_CONSTANT_WORD3_0__DST_SEL_Z_shift = 9, EG_SQ_VTX_CONSTANT_WORD3_0__DST_SEL_Z_mask = 0x7 << 9, - - EG_SQ_VTX_CONSTANT_WORD3_0__DST_SEL_W_shift = 12, + + EG_SQ_VTX_CONSTANT_WORD3_0__DST_SEL_W_shift = 12, EG_SQ_VTX_CONSTANT_WORD3_0__DST_SEL_W_mask = 0x7 << 12, /* SQ_VTX_CONSTANT_WORD4_0 */ EG_SQ_VTX_CONSTANT_WORD4_0__NUM_ELEMENTS_shift = 0, @@ -238,7 +238,7 @@ enum { EG_SQ_TEX_SAMPLER_WORD0_0__CHROMA_KEY_mask = 0x3 << 25, EG_SQ_TEX_SAMPLER_WORD0_0__ANISO_THRESHOLD_shift = 27, // 3; EG_SQ_TEX_SAMPLER_WORD0_0__ANISO_THRESHOLD_mask = 0x7 << 27, - EG_SQ_TEX_SAMPLER_WORD0_0__Reserved_shift = 30, // 2 + EG_SQ_TEX_SAMPLER_WORD0_0__Reserved_shift = 30, // 2 EG_SQ_TEX_SAMPLER_WORD0_0__Reserved_mask = 0x3 << 30, /* SQ_TEX_SAMPLER_WORD1_0 */ EG_SQ_TEX_SAMPLER_WORD1_0__MIN_LOD_shift = 0, // 12; @@ -288,11 +288,11 @@ enum { EG_SQ_TEX_RESOURCE_WORD1_0__ARRAY_MODE_mask = 0xf << 28, /* SQ_TEX_RESOURCE_WORD6_0 */ EG_SQ_TEX_RESOURCE_WORD6_0__MAX_ANISO_RATIO_shift = 0, //: 3; - EG_SQ_TEX_RESOURCE_WORD6_0__MAX_ANISO_RATIO_mask = 0x7, + EG_SQ_TEX_RESOURCE_WORD6_0__MAX_ANISO_RATIO_mask = 0x7, EG_SQ_TEX_RESOURCE_WORD6_0__INTERLACED_shift = 6, //1; - EG_SQ_TEX_RESOURCE_WORD6_0__INTERLACED_bit = 1 << 6, + EG_SQ_TEX_RESOURCE_WORD6_0__INTERLACED_bit = 1 << 6, EG_SQ_TEX_RESOURCE_WORD6_0__MIN_LOD_shift = 8, //12; - EG_SQ_TEX_RESOURCE_WORD6_0__MIN_LOD_mask = 0xfff << 8, + EG_SQ_TEX_RESOURCE_WORD6_0__MIN_LOD_mask = 0xfff << 8, EG_SQ_TEX_RESOURCE_WORD6_0__TILE_SPLIT_shift = 29,// 3; EG_SQ_TEX_RESOURCE_WORD6_0__TILE_SPLIT_mask = 0x7 << 29, /* SQ_TEX_RESOURCE_WORD7_0 */ @@ -303,11 +303,11 @@ enum { EG_SQ_TEX_RESOURCE_WORD7_0__BANK_WIDTH_shift = 8, // 2; EG_SQ_TEX_RESOURCE_WORD7_0__BANK_WIDTH_mask = 0x3 << 8, EG_SQ_TEX_RESOURCE_WORD7_0__BANK_HEIGHT_shift = 10,// 2; - EG_SQ_TEX_RESOURCE_WORD7_0__BANK_HEIGHT_mask = 0x3 << 10, + EG_SQ_TEX_RESOURCE_WORD7_0__BANK_HEIGHT_mask = 0x3 << 10, EG_SQ_TEX_RESOURCE_WORD7_0__DEPTH_SAMPLE_ORDER_shift = 15,// 1; EG_SQ_TEX_RESOURCE_WORD7_0__DEPTH_SAMPLE_ORDER_bit = 1 << 15, EG_SQ_TEX_RESOURCE_WORD7_0__NUM_BANKS_shift = 16,// 2; - EG_SQ_TEX_RESOURCE_WORD7_0__NUM_BANKS_mask = 0x3 << 16, + EG_SQ_TEX_RESOURCE_WORD7_0__NUM_BANKS_mask = 0x3 << 16, EG_SQ_TEX_RESOURCE_WORD7_0__TYPE_shift = 30,// 2; EG_SQ_TEX_RESOURCE_WORD7_0__TYPE_mask = 0x3 << 30, }; diff --git a/src/mesa/drivers/dri/r600/evergreen_fragprog.c b/src/mesa/drivers/dri/r600/evergreen_fragprog.c index cfb923e..02eb003 100644 --- a/src/mesa/drivers/dri/r600/evergreen_fragprog.c +++ b/src/mesa/drivers/dri/r600/evergreen_fragprog.c @@ -62,7 +62,7 @@ void evergreen_insert_wpos_code(struct gl_context *ctx, struct gl_fragment_progr inst = fprog->Base.Instructions; for (i = 0; i < fprog->Base.NumInstructions; i++) { for (j=0; j < 3; j++) { - if(inst->SrcReg[j].File == PROGRAM_INPUT && + if(inst->SrcReg[j].File == PROGRAM_INPUT && inst->SrcReg[j].Index == FRAG_ATTRIB_WPOS) { inst->SrcReg[j].File = PROGRAM_TEMPORARY; inst->SrcReg[j].Index = wpos_temp; @@ -95,7 +95,7 @@ void evergreen_insert_wpos_code(struct gl_context *ctx, struct gl_fragment_progr //TODO : Validate FP input with VP output. void evergreen_Map_Fragment_Program(r700_AssemblerBase *pAsm, struct gl_fragment_program *mesa_fp, - struct gl_context *ctx) + struct gl_context *ctx) { unsigned int unBit; unsigned int i; @@ -104,10 +104,10 @@ void evergreen_Map_Fragment_Program(r700_AssemblerBase *pAsm, struct evergreen_vertex_program_cont *vpc = (struct evergreen_vertex_program_cont *)ctx->VertexProgram._Current; GLbitfield OutputsWritten = vpc->mesa_program.Base.OutputsWritten; - + pAsm->number_used_registers = 0; -//Input mapping : mesa_fp->Base.InputsRead set the flag, set in +//Input mapping : mesa_fp->Base.InputsRead set the flag, set in //The flags parsed in parse_attrib_binding. FRAG_ATTRIB_COLx, FRAG_ATTRIB_TEXx, ... //MUST match order in Map_Vertex_Output unBit = 1 << FRAG_ATTRIB_WPOS; @@ -142,8 +142,8 @@ void evergreen_Map_Fragment_Program(r700_AssemblerBase *pAsm, pAsm->uiFP_AttributeMap[FRAG_ATTRIB_TEX0 + i] = pAsm->number_used_registers++; } } - -/* order has been taken care of */ + +/* order has been taken care of */ #if 1 for(i=VERT_RESULT_VAR0; iParameters + j; for(k=0; kNumParameters; k++) - { + { pVsParam = VsVarying->Parameters + k; if( strcmp(pPsParam->Name, pVsParam->Name) == 0) { - pAsm->uiFP_AttributeMap[i] = pAsm->number_used_registers + k; + pAsm->uiFP_AttributeMap[i] = pAsm->number_used_registers + k; if(k > unMaxVarying) { unMaxVarying = k; @@ -306,7 +306,7 @@ GLboolean evergreen_Find_Instruction_Dependencies_fp(struct evergreen_fragment_p fp->r700AsmCode.pInstDeps = pInstDeps; - //Find dep for tex inst + //Find dep for tex inst for(i=0; iBase.NumInstructions; i++) { pILInst = &(mesa_fp->Base.Instructions[i]); @@ -340,7 +340,7 @@ GLboolean evergreen_Find_Instruction_Dependencies_fp(struct evergreen_fragment_p { pInstDeps[nDepInstID].nDstDep = i; } - + } } @@ -354,7 +354,7 @@ GLboolean evergreen_Find_Instruction_Dependencies_fp(struct evergreen_fragment_p GLboolean evergreenTranslateFragmentShader(struct evergreen_fragment_program *fp, struct gl_fragment_program *mesa_fp, - struct gl_context *ctx) + struct gl_context *ctx) { GLuint number_of_colors_exported; GLboolean z_enabled = GL_FALSE; @@ -366,9 +366,9 @@ GLboolean evergreenTranslateFragmentShader(struct evergreen_fragment_program *fp //Init_Program Init_r700_AssemblerBase( SPT_FP, &(fp->r700AsmCode), &(fp->r700Shader) ); - + fp->constbo0 = NULL; - fp->r700AsmCode.bUseMemConstant = GL_TRUE; + fp->r700AsmCode.bUseMemConstant = GL_TRUE; fp->r700AsmCode.unAsic = 8; if(mesa_fp->Base.InputsRead & FRAG_BIT_WPOS) @@ -386,14 +386,14 @@ GLboolean evergreenTranslateFragmentShader(struct evergreen_fragment_program *fp { shadow_unit = inst->TexSrcUnit; shadow_ambient[2] = shadow_unit; - fp->r700AsmCode.shadow_regs[shadow_unit] = + fp->r700AsmCode.shadow_regs[shadow_unit] = _mesa_add_state_reference(mesa_fp->Base.Parameters, shadow_ambient); } inst++; } } - evergreen_Map_Fragment_Program(&(fp->r700AsmCode), mesa_fp, ctx); + evergreen_Map_Fragment_Program(&(fp->r700AsmCode), mesa_fp, ctx); if( GL_FALSE == evergreen_Find_Instruction_Dependencies_fp(fp, mesa_fp) ) { @@ -401,7 +401,7 @@ GLboolean evergreenTranslateFragmentShader(struct evergreen_fragment_program *fp } InitShaderProgram(&(fp->r700AsmCode)); - + for(i=0; i < MAX_SAMPLERS; i++) { fp->r700AsmCode.SamplerUnits[i] = fp->mesa_program.Base.SamplerUnits[i]; @@ -412,7 +412,7 @@ GLboolean evergreenTranslateFragmentShader(struct evergreen_fragment_program *fp if( GL_FALSE == AssembleInstr(0, 0, mesa_fp->Base.NumInstructions, - &(mesa_fp->Base.Instructions[0]), + &(mesa_fp->Base.Instructions[0]), &(fp->r700AsmCode)) ) { return GL_FALSE; @@ -428,7 +428,7 @@ GLboolean evergreenTranslateFragmentShader(struct evergreen_fragment_program *fp return GL_FALSE; } - fp->r700Shader.nRegs = (fp->r700AsmCode.number_used_registers == 0) ? 0 + fp->r700Shader.nRegs = (fp->r700AsmCode.number_used_registers == 0) ? 0 : (fp->r700AsmCode.number_used_registers - 1); fp->r700Shader.nParamExports = fp->r700AsmCode.number_of_exports; @@ -468,7 +468,7 @@ void evergreenSelectFragmentShader(struct gl_context *ctx) } if (GL_FALSE == fp->translated) - evergreenTranslateFragmentShader(fp, &(fp->mesa_program), ctx); + evergreenTranslateFragmentShader(fp, &(fp->mesa_program), ctx); } void * evergreenGetActiveFpShaderBo(struct gl_context * ctx) @@ -494,7 +494,7 @@ GLboolean evergreenSetupFragmentProgram(struct gl_context * ctx) struct evergreen_fragment_program *fp = (struct evergreen_fragment_program *) (ctx->FragmentProgram._Current); r700_AssemblerBase *pAsm = &(fp->r700AsmCode); - struct gl_fragment_program *mesa_fp = &(fp->mesa_program); + struct gl_fragment_program *mesa_fp = &(fp->mesa_program); unsigned int ui, i; unsigned int unNumOfReg; unsigned int unBit; @@ -513,7 +513,7 @@ GLboolean evergreenSetupFragmentProgram(struct gl_context * ctx) (GLvoid *)(fp->r700Shader.pProgram), fp->r700Shader.uShaderBinaryDWORDSize, "FS"); - + fp->loaded = GL_TRUE; } @@ -526,8 +526,8 @@ GLboolean evergreenSetupFragmentProgram(struct gl_context * ctx) evergreen->SQ_PGM_RESOURCES_PS.u32All = 0; SETbit(evergreen->SQ_PGM_RESOURCES_PS.u32All, PGM_RESOURCES__PRIME_CACHE_ON_DRAW_bit); - evergreen->ps.SQ_ALU_CONST_CACHE_PS_0.u32All = 0; - evergreen->ps.SQ_PGM_START_PS.u32All = 0; + evergreen->ps.SQ_ALU_CONST_CACHE_PS_0.u32All = 0; + evergreen->ps.SQ_PGM_START_PS.u32All = 0; EVERGREEN_STATECHANGE(context, spi); @@ -613,7 +613,7 @@ GLboolean evergreenSetupFragmentProgram(struct gl_context * ctx) struct evergreen_vertex_program_cont *vpc = (struct evergreen_vertex_program_cont *)ctx->VertexProgram._Current; GLbitfield OutputsWritten = vpc->mesa_program.Base.OutputsWritten; - + for(ui = 0; ui < EVERGREEN_MAX_SHADER_EXPORTS; ui++) evergreen->SPI_PS_INPUT_CNTL[ui].u32All = 0; @@ -753,7 +753,7 @@ GLboolean evergreenSetupFPconstants(struct gl_context * ctx) /* sent out shader constants. */ paramList = fp->mesa_program.Base.Parameters; - if(NULL != paramList) + if(NULL != paramList) { _mesa_load_state_parameters(ctx, paramList); @@ -777,16 +777,16 @@ GLboolean evergreenSetupFPconstants(struct gl_context * ctx) alloc_size = ((unNumParamData * 4 * 4) + 255) & ~255; /* Load fp constants to gpu */ - if(unNumParamData > 0) - { - radeonAllocDmaRegion(&context->radeon, - &context->fp_Constbo, - &context->fp_bo_offset, + if(unNumParamData > 0) + { + radeonAllocDmaRegion(&context->radeon, + &context->fp_Constbo, + &context->fp_bo_offset, alloc_size, - 256); + 256); r600EmitShaderConsts(ctx, context->fp_Constbo, - context->fp_bo_offset, + context->fp_bo_offset, (GLvoid *)&(evergreen->ps.consts[0][0]), unNumParamData * 4 * 4); } diff --git a/src/mesa/drivers/dri/r600/evergreen_fragprog.h b/src/mesa/drivers/dri/r600/evergreen_fragprog.h index 97f06a7..d5d3bc6 100644 --- a/src/mesa/drivers/dri/r600/evergreen_fragprog.h +++ b/src/mesa/drivers/dri/r600/evergreen_fragprog.h @@ -55,13 +55,13 @@ void evergreen_insert_wpos_code(struct gl_context *ctx, struct gl_fragment_progr void evergreen_Map_Fragment_Program(r700_AssemblerBase *pAsm, struct gl_fragment_program *mesa_fp, - struct gl_context *ctx); + struct gl_context *ctx); GLboolean evergreen_Find_Instruction_Dependencies_fp(struct evergreen_fragment_program *fp, struct gl_fragment_program *mesa_fp); GLboolean evergreenTranslateFragmentShader(struct evergreen_fragment_program *fp, struct gl_fragment_program *mesa_vp, - struct gl_context *ctx); + struct gl_context *ctx); /* Interface */ extern void evergreenSelectFragmentShader(struct gl_context *ctx); diff --git a/src/mesa/drivers/dri/r600/evergreen_ioctl.c b/src/mesa/drivers/dri/r600/evergreen_ioctl.c index 19f8e6b..ff8df7b 100644 --- a/src/mesa/drivers/dri/r600/evergreen_ioctl.c +++ b/src/mesa/drivers/dri/r600/evergreen_ioctl.c @@ -41,7 +41,7 @@ #include "r700_clear.h" void evergreenClear(struct gl_context * ctx, GLbitfield mask) -{ +{ r700Clear(ctx, mask); } diff --git a/src/mesa/drivers/dri/r600/evergreen_off.h b/src/mesa/drivers/dri/r600/evergreen_off.h index 8c25069..46fd1f0 100644 --- a/src/mesa/drivers/dri/r600/evergreen_off.h +++ b/src/mesa/drivers/dri/r600/evergreen_off.h @@ -21,362 +21,362 @@ /* * Authors: - * Richard Li , + * Richard Li , */ #ifndef _EVERGREEN_OFF_H_ #define _EVERGREEN_OFF_H_ -enum +enum { -/* Registers from PA block: */ - EG_PA_SC_SCREEN_SCISSOR_TL = 0x28030, // DIFF - EG_PA_SC_SCREEN_SCISSOR_BR = 0x28034, // DIFF - EG_PA_SC_WINDOW_OFFSET = 0x28200, // DIFF - EG_PA_SC_WINDOW_SCISSOR_TL = 0x28204, // DIFF - EG_PA_SC_WINDOW_SCISSOR_BR = 0x28208, // DIFF - EG_PA_SC_CLIPRECT_RULE = 0x2820C, // SAME - EG_PA_SC_CLIPRECT_0_TL = 0x28210, // DIFF - EG_PA_SC_CLIPRECT_0_BR = 0x28214, // DIFF - EG_PA_SC_CLIPRECT_1_TL = 0x28218, // DIFF - EG_PA_SC_CLIPRECT_1_BR = 0x2821C, // DIFF - EG_PA_SC_CLIPRECT_2_TL = 0x28220, // DIFF - EG_PA_SC_CLIPRECT_2_BR = 0x28224, // DIFF - EG_PA_SC_CLIPRECT_3_TL = 0x28228, // DIFF - EG_PA_SC_CLIPRECT_3_BR = 0x2822C, // DIFF - EG_PA_SC_EDGERULE = 0x28230, // SAME - EG_PA_SU_HARDWARE_SCREEN_OFFSET = 0x28234, // - EG_PA_SC_GENERIC_SCISSOR_TL = 0x28240, // DIFF - EG_PA_SC_GENERIC_SCISSOR_BR = 0x28244, // DIFF - EG_PA_SC_VPORT_SCISSOR_0_TL = 0x28250, // DIFF - EG_PA_SC_VPORT_SCISSOR_0_BR = 0x28254, // DIFF - EG_PA_SC_VPORT_SCISSOR_1_TL = 0x28258, // DIFF - EG_PA_SC_VPORT_SCISSOR_1_BR = 0x2825C, // DIFF - EG_PA_SC_VPORT_SCISSOR_2_TL = 0x28260, // DIFF - EG_PA_SC_VPORT_SCISSOR_2_BR = 0x28264, // DIFF - EG_PA_SC_VPORT_SCISSOR_3_TL = 0x28268, // DIFF - EG_PA_SC_VPORT_SCISSOR_3_BR = 0x2826C, // DIFF - EG_PA_SC_VPORT_SCISSOR_4_TL = 0x28270, // DIFF - EG_PA_SC_VPORT_SCISSOR_4_BR = 0x28274, // DIFF - EG_PA_SC_VPORT_SCISSOR_5_TL = 0x28278, // DIFF - EG_PA_SC_VPORT_SCISSOR_5_BR = 0x2827C, // DIFF - EG_PA_SC_VPORT_SCISSOR_6_TL = 0x28280, // DIFF - EG_PA_SC_VPORT_SCISSOR_6_BR = 0x28284, // DIFF - EG_PA_SC_VPORT_SCISSOR_7_TL = 0x28288, // DIFF - EG_PA_SC_VPORT_SCISSOR_7_BR = 0x2828C, // DIFF - EG_PA_SC_VPORT_SCISSOR_8_TL = 0x28290, // DIFF - EG_PA_SC_VPORT_SCISSOR_8_BR = 0x28294, // DIFF - EG_PA_SC_VPORT_SCISSOR_9_TL = 0x28298, // DIFF - EG_PA_SC_VPORT_SCISSOR_9_BR = 0x2829C, // DIFF - EG_PA_SC_VPORT_SCISSOR_10_TL = 0x282A0, // DIFF - EG_PA_SC_VPORT_SCISSOR_10_BR = 0x282A4, // DIFF - EG_PA_SC_VPORT_SCISSOR_11_TL = 0x282A8, // DIFF - EG_PA_SC_VPORT_SCISSOR_11_BR = 0x282AC, // DIFF - EG_PA_SC_VPORT_SCISSOR_12_TL = 0x282B0, // DIFF - EG_PA_SC_VPORT_SCISSOR_12_BR = 0x282B4, // DIFF - EG_PA_SC_VPORT_SCISSOR_13_TL = 0x282B8, // DIFF - EG_PA_SC_VPORT_SCISSOR_13_BR = 0x282BC, // DIFF - EG_PA_SC_VPORT_SCISSOR_14_TL = 0x282C0, // DIFF - EG_PA_SC_VPORT_SCISSOR_14_BR = 0x282C4, // DIFF - EG_PA_SC_VPORT_SCISSOR_15_TL = 0x282C8, // DIFF - EG_PA_SC_VPORT_SCISSOR_15_BR = 0x282CC, // DIFF - EG_PA_SC_VPORT_ZMIN_0 = 0x282D0, // SAME - EG_PA_SC_VPORT_ZMAX_0 = 0x282D4, // SAME - EG_PA_SC_VPORT_ZMIN_1 = 0x282D8, // SAME - EG_PA_SC_VPORT_ZMAX_1 = 0x282DC, // SAME - EG_PA_SC_VPORT_ZMIN_2 = 0x282E0, // SAME - EG_PA_SC_VPORT_ZMAX_2 = 0x282E4, // SAME - EG_PA_SC_VPORT_ZMIN_3 = 0x282E8, // SAME - EG_PA_SC_VPORT_ZMAX_3 = 0x282EC, // SAME - EG_PA_SC_VPORT_ZMIN_4 = 0x282F0, // SAME - EG_PA_SC_VPORT_ZMAX_4 = 0x282F4, // SAME - EG_PA_SC_VPORT_ZMIN_5 = 0x282F8, // SAME - EG_PA_SC_VPORT_ZMAX_5 = 0x282FC, // SAME - EG_PA_SC_VPORT_ZMIN_6 = 0x28300, // SAME - EG_PA_SC_VPORT_ZMAX_6 = 0x28304, // SAME - EG_PA_SC_VPORT_ZMIN_7 = 0x28308, // SAME - EG_PA_SC_VPORT_ZMAX_7 = 0x2830C, // SAME - EG_PA_SC_VPORT_ZMIN_8 = 0x28310, // SAME - EG_PA_SC_VPORT_ZMAX_8 = 0x28314, // SAME - EG_PA_SC_VPORT_ZMIN_9 = 0x28318, // SAME - EG_PA_SC_VPORT_ZMAX_9 = 0x2831C, // SAME - EG_PA_SC_VPORT_ZMIN_10 = 0x28320, // SAME - EG_PA_SC_VPORT_ZMAX_10 = 0x28324, // SAME - EG_PA_SC_VPORT_ZMIN_11 = 0x28328, // SAME - EG_PA_SC_VPORT_ZMAX_11 = 0x2832C, // SAME - EG_PA_SC_VPORT_ZMIN_12 = 0x28330, // SAME - EG_PA_SC_VPORT_ZMAX_12 = 0x28334, // SAME - EG_PA_SC_VPORT_ZMIN_13 = 0x28338, // SAME - EG_PA_SC_VPORT_ZMAX_13 = 0x2833C, // SAME - EG_PA_SC_VPORT_ZMIN_14 = 0x28340, // SAME - EG_PA_SC_VPORT_ZMAX_14 = 0x28344, // SAME - EG_PA_SC_VPORT_ZMIN_15 = 0x28348, // SAME - EG_PA_SC_VPORT_ZMAX_15 = 0x2834C, // SAME - EG_PA_CL_VPORT_XSCALE = 0x2843C, // SAME - EG_PA_CL_VPORT_XOFFSET = 0x28440, // SAME - EG_PA_CL_VPORT_YSCALE = 0x28444, // SAME - EG_PA_CL_VPORT_YOFFSET = 0x28448, // SAME - EG_PA_CL_VPORT_ZSCALE = 0x2844C, // SAME - EG_PA_CL_VPORT_ZOFFSET = 0x28450, // SAME - EG_PA_CL_VPORT_XSCALE_1 = 0x28454, // SAME - EG_PA_CL_VPORT_XOFFSET_1 = 0x28458, // SAME - EG_PA_CL_VPORT_YSCALE_1 = 0x2845C, // SAME - EG_PA_CL_VPORT_YOFFSET_1 = 0x28460, // SAME - EG_PA_CL_VPORT_ZSCALE_1 = 0x28464, // SAME - EG_PA_CL_VPORT_ZOFFSET_1 = 0x28468, // SAME - EG_PA_CL_VPORT_XSCALE_2 = 0x2846C, // SAME - EG_PA_CL_VPORT_XOFFSET_2 = 0x28470, // SAME - EG_PA_CL_VPORT_YSCALE_2 = 0x28474, // SAME - EG_PA_CL_VPORT_YOFFSET_2 = 0x28478, // SAME - EG_PA_CL_VPORT_ZSCALE_2 = 0x2847C, // SAME - EG_PA_CL_VPORT_ZOFFSET_2 = 0x28480, // SAME - EG_PA_CL_VPORT_XSCALE_3 = 0x28484, // SAME - EG_PA_CL_VPORT_XOFFSET_3 = 0x28488, // SAME - EG_PA_CL_VPORT_YSCALE_3 = 0x2848C, // SAME - EG_PA_CL_VPORT_YOFFSET_3 = 0x28490, // SAME - EG_PA_CL_VPORT_ZSCALE_3 = 0x28494, // SAME - EG_PA_CL_VPORT_ZOFFSET_3 = 0x28498, // SAME - EG_PA_CL_VPORT_XSCALE_4 = 0x2849C, // SAME - EG_PA_CL_VPORT_XOFFSET_4 = 0x284A0, // SAME - EG_PA_CL_VPORT_YSCALE_4 = 0x284A4, // SAME - EG_PA_CL_VPORT_YOFFSET_4 = 0x284A8, // SAME - EG_PA_CL_VPORT_ZSCALE_4 = 0x284AC, // SAME - EG_PA_CL_VPORT_ZOFFSET_4 = 0x284B0, // SAME - EG_PA_CL_VPORT_XSCALE_5 = 0x284B4, // SAME - EG_PA_CL_VPORT_XOFFSET_5 = 0x284B8, // SAME - EG_PA_CL_VPORT_YSCALE_5 = 0x284BC, // SAME - EG_PA_CL_VPORT_YOFFSET_5 = 0x284C0, // SAME - EG_PA_CL_VPORT_ZSCALE_5 = 0x284C4, // SAME - EG_PA_CL_VPORT_ZOFFSET_5 = 0x284C8, // SAME - EG_PA_CL_VPORT_XSCALE_6 = 0x284CC, // SAME - EG_PA_CL_VPORT_XOFFSET_6 = 0x284D0, // SAME - EG_PA_CL_VPORT_YSCALE_6 = 0x284D4, // SAME - EG_PA_CL_VPORT_YOFFSET_6 = 0x284D8, // SAME - EG_PA_CL_VPORT_ZSCALE_6 = 0x284DC, // SAME - EG_PA_CL_VPORT_ZOFFSET_6 = 0x284E0, // SAME - EG_PA_CL_VPORT_XSCALE_7 = 0x284E4, // SAME - EG_PA_CL_VPORT_XOFFSET_7 = 0x284E8, // SAME - EG_PA_CL_VPORT_YSCALE_7 = 0x284EC, // SAME - EG_PA_CL_VPORT_YOFFSET_7 = 0x284F0, // SAME - EG_PA_CL_VPORT_ZSCALE_7 = 0x284F4, // SAME - EG_PA_CL_VPORT_ZOFFSET_7 = 0x284F8, // SAME - EG_PA_CL_VPORT_XSCALE_8 = 0x284FC, // SAME - EG_PA_CL_VPORT_XOFFSET_8 = 0x28500, // SAME - EG_PA_CL_VPORT_YSCALE_8 = 0x28504, // SAME - EG_PA_CL_VPORT_YOFFSET_8 = 0x28508, // SAME - EG_PA_CL_VPORT_ZSCALE_8 = 0x2850C, // SAME - EG_PA_CL_VPORT_ZOFFSET_8 = 0x28510, // SAME - EG_PA_CL_VPORT_XSCALE_9 = 0x28514, // SAME - EG_PA_CL_VPORT_XOFFSET_9 = 0x28518, // SAME - EG_PA_CL_VPORT_YSCALE_9 = 0x2851C, // SAME - EG_PA_CL_VPORT_YOFFSET_9 = 0x28520, // SAME - EG_PA_CL_VPORT_ZSCALE_9 = 0x28524, // SAME - EG_PA_CL_VPORT_ZOFFSET_9 = 0x28528, // SAME - EG_PA_CL_VPORT_XSCALE_10 = 0x2852C, // SAME - EG_PA_CL_VPORT_XOFFSET_10 = 0x28530, // SAME - EG_PA_CL_VPORT_YSCALE_10 = 0x28534, // SAME - EG_PA_CL_VPORT_YOFFSET_10 = 0x28538, // SAME - EG_PA_CL_VPORT_ZSCALE_10 = 0x2853C, // SAME - EG_PA_CL_VPORT_ZOFFSET_10 = 0x28540, // SAME - EG_PA_CL_VPORT_XSCALE_11 = 0x28544, // SAME - EG_PA_CL_VPORT_XOFFSET_11 = 0x28548, // SAME - EG_PA_CL_VPORT_YSCALE_11 = 0x2854C, // SAME - EG_PA_CL_VPORT_YOFFSET_11 = 0x28550, // SAME - EG_PA_CL_VPORT_ZSCALE_11 = 0x28554, // SAME - EG_PA_CL_VPORT_ZOFFSET_11 = 0x28558, // SAME - EG_PA_CL_VPORT_XSCALE_12 = 0x2855C, // SAME - EG_PA_CL_VPORT_XOFFSET_12 = 0x28560, // SAME - EG_PA_CL_VPORT_YSCALE_12 = 0x28564, // SAME - EG_PA_CL_VPORT_YOFFSET_12 = 0x28568, // SAME - EG_PA_CL_VPORT_ZSCALE_12 = 0x2856C, // SAME - EG_PA_CL_VPORT_ZOFFSET_12 = 0x28570, // SAME - EG_PA_CL_VPORT_XSCALE_13 = 0x28574, // SAME - EG_PA_CL_VPORT_XOFFSET_13 = 0x28578, // SAME - EG_PA_CL_VPORT_YSCALE_13 = 0x2857C, // SAME - EG_PA_CL_VPORT_YOFFSET_13 = 0x28580, // SAME - EG_PA_CL_VPORT_ZSCALE_13 = 0x28584, // SAME - EG_PA_CL_VPORT_ZOFFSET_13 = 0x28588, // SAME - EG_PA_CL_VPORT_XSCALE_14 = 0x2858C, // SAME - EG_PA_CL_VPORT_XOFFSET_14 = 0x28590, // SAME - EG_PA_CL_VPORT_YSCALE_14 = 0x28594, // SAME - EG_PA_CL_VPORT_YOFFSET_14 = 0x28598, // SAME - EG_PA_CL_VPORT_ZSCALE_14 = 0x2859C, // SAME - EG_PA_CL_VPORT_ZOFFSET_14 = 0x285A0, // SAME - EG_PA_CL_VPORT_XSCALE_15 = 0x285A4, // SAME - EG_PA_CL_VPORT_XOFFSET_15 = 0x285A8, // SAME - EG_PA_CL_VPORT_YSCALE_15 = 0x285AC, // SAME - EG_PA_CL_VPORT_YOFFSET_15 = 0x285B0, // SAME - EG_PA_CL_VPORT_ZSCALE_15 = 0x285B4, // SAME - EG_PA_CL_VPORT_ZOFFSET_15 = 0x285B8, // SAME - EG_PA_CL_UCP_0_X = 0x285BC, // SAME 0x28E20 - EG_PA_CL_UCP_0_Y = 0x285C0, // SAME 0x28E24 - EG_PA_CL_UCP_0_Z = 0x285C4, // SAME 0x28E28 - EG_PA_CL_UCP_0_W = 0x285C8, // SAME 0x28E2C - EG_PA_CL_UCP_1_X = 0x285CC, // SAME 0x28E30 - EG_PA_CL_UCP_1_Y = 0x285D0, // SAME 0x28E34 - EG_PA_CL_UCP_1_Z = 0x285D4, // SAME 0x28E38 - EG_PA_CL_UCP_1_W = 0x285D8, // SAME 0x28E3C - EG_PA_CL_UCP_2_X = 0x285DC, // SAME 0x28E40 - EG_PA_CL_UCP_2_Y = 0x285E0, // SAME 0x28E44 - EG_PA_CL_UCP_2_Z = 0x285E4, // SAME 0x28E48 - EG_PA_CL_UCP_2_W = 0x285E8, // SAME 0x28E4C - EG_PA_CL_UCP_3_X = 0x285EC, // SAME 0x28E50 - EG_PA_CL_UCP_3_Y = 0x285F0, // SAME 0x28E54 - EG_PA_CL_UCP_3_Z = 0x285F4, // SAME 0x28E58 - EG_PA_CL_UCP_3_W = 0x285F8, // SAME 0x28E5C - EG_PA_CL_UCP_4_X = 0x285FC, // SAME 0x28E60 - EG_PA_CL_UCP_4_Y = 0x28600, // SAME 0x28E64 - EG_PA_CL_UCP_4_Z = 0x28604, // SAME 0x28E68 - EG_PA_CL_UCP_4_W = 0x28608, // SAME 0x28E6C - EG_PA_CL_UCP_5_X = 0x2860C, // SAME 0x28E70 - EG_PA_CL_UCP_5_Y = 0x28610, // SAME 0x28E74 - EG_PA_CL_UCP_5_Z = 0x28614, // SAME 0x28E78 - EG_PA_CL_UCP_5_W = 0x28618, // SAME 0x28E7C - EG_PA_CL_POINT_X_RAD = 0x287D4, // SAME 0x28E10 - EG_PA_CL_POINT_Y_RAD = 0x287D8, // SAME 0x28E14 - EG_PA_CL_POINT_SIZE = 0x287DC, // SAME 0x28E18 - EG_PA_CL_POINT_CULL_RAD = 0x287E0, // SAME 0x28E1C - EG_PA_CL_CLIP_CNTL = 0x28810, // SAME - EG_PA_SU_SC_MODE_CNTL = 0x28814, // SAME - EG_PA_CL_VTE_CNTL = 0x28818, // SAME - EG_PA_CL_VS_OUT_CNTL = 0x2881C, // SAME - EG_PA_CL_NANINF_CNTL = 0x28820, // SAME - EG_PA_SU_LINE_STIPPLE_CNTL = 0x28824, // - EG_PA_SU_LINE_STIPPLE_SCALE = 0x28828, // - EG_PA_SU_PRIM_FILTER_CNTL = 0x2882C, // - EG_PA_SU_POINT_SIZE = 0x28A00, // SAME - EG_PA_SU_POINT_MINMAX = 0x28A04, // SAME - EG_PA_SU_LINE_CNTL = 0x28A08, // SAME - EG_PA_SC_LINE_STIPPLE = 0x28A0C, // SAME - EG_PA_SC_MODE_CNTL_0 = 0x28A48, // - EG_PA_SC_MODE_CNTL_1 = 0x28A4C, // - EG_PA_SU_POLY_OFFSET_DB_FMT_CNTL = 0x28B78, // SAME 0x28DF8 - EG_PA_SU_POLY_OFFSET_CLAMP = 0x28B7C, // SAME 0x28DFC - EG_PA_SU_POLY_OFFSET_FRONT_SCALE = 0x28B80, // SAME 0x28E00 - EG_PA_SU_POLY_OFFSET_FRONT_OFFSET = 0x28B84, // SAME 0x28E04 - EG_PA_SU_POLY_OFFSET_BACK_SCALE = 0x28B88, // SAME 0x28E08 - EG_PA_SU_POLY_OFFSET_BACK_OFFSET = 0x28B8C, // SAME 0x28E0C - EG_PA_SC_LINE_CNTL = 0x28C00, // DIFF - EG_PA_SC_AA_CONFIG = 0x28C04, // SAME - EG_PA_SU_VTX_CNTL = 0x28C08, // SAME - EG_PA_CL_GB_VERT_CLIP_ADJ = 0x28C0C, // SAME - EG_PA_CL_GB_VERT_DISC_ADJ = 0x28C10, // SAME - EG_PA_CL_GB_HORZ_CLIP_ADJ = 0x28C14, // SAME - EG_PA_CL_GB_HORZ_DISC_ADJ = 0x28C18, // SAME - EG_PA_SC_AA_SAMPLE_LOCS_0 = 0x28C1C, // - EG_PA_SC_AA_SAMPLE_LOCS_1 = 0x28C20, // - EG_PA_SC_AA_SAMPLE_LOCS_2 = 0x28C24, // - EG_PA_SC_AA_SAMPLE_LOCS_3 = 0x28C28, // - EG_PA_SC_AA_SAMPLE_LOCS_4 = 0x28C2C, // - EG_PA_SC_AA_SAMPLE_LOCS_5 = 0x28C30, // - EG_PA_SC_AA_SAMPLE_LOCS_6 = 0x28C34, // - EG_PA_SC_AA_SAMPLE_LOCS_7 = 0x28C38, // - EG_PA_SC_AA_MASK = 0x28C3C, // SAME 0x28C48 +/* Registers from PA block: */ + EG_PA_SC_SCREEN_SCISSOR_TL = 0x28030, // DIFF + EG_PA_SC_SCREEN_SCISSOR_BR = 0x28034, // DIFF + EG_PA_SC_WINDOW_OFFSET = 0x28200, // DIFF + EG_PA_SC_WINDOW_SCISSOR_TL = 0x28204, // DIFF + EG_PA_SC_WINDOW_SCISSOR_BR = 0x28208, // DIFF + EG_PA_SC_CLIPRECT_RULE = 0x2820C, // SAME + EG_PA_SC_CLIPRECT_0_TL = 0x28210, // DIFF + EG_PA_SC_CLIPRECT_0_BR = 0x28214, // DIFF + EG_PA_SC_CLIPRECT_1_TL = 0x28218, // DIFF + EG_PA_SC_CLIPRECT_1_BR = 0x2821C, // DIFF + EG_PA_SC_CLIPRECT_2_TL = 0x28220, // DIFF + EG_PA_SC_CLIPRECT_2_BR = 0x28224, // DIFF + EG_PA_SC_CLIPRECT_3_TL = 0x28228, // DIFF + EG_PA_SC_CLIPRECT_3_BR = 0x2822C, // DIFF + EG_PA_SC_EDGERULE = 0x28230, // SAME + EG_PA_SU_HARDWARE_SCREEN_OFFSET = 0x28234, // + EG_PA_SC_GENERIC_SCISSOR_TL = 0x28240, // DIFF + EG_PA_SC_GENERIC_SCISSOR_BR = 0x28244, // DIFF + EG_PA_SC_VPORT_SCISSOR_0_TL = 0x28250, // DIFF + EG_PA_SC_VPORT_SCISSOR_0_BR = 0x28254, // DIFF + EG_PA_SC_VPORT_SCISSOR_1_TL = 0x28258, // DIFF + EG_PA_SC_VPORT_SCISSOR_1_BR = 0x2825C, // DIFF + EG_PA_SC_VPORT_SCISSOR_2_TL = 0x28260, // DIFF + EG_PA_SC_VPORT_SCISSOR_2_BR = 0x28264, // DIFF + EG_PA_SC_VPORT_SCISSOR_3_TL = 0x28268, // DIFF + EG_PA_SC_VPORT_SCISSOR_3_BR = 0x2826C, // DIFF + EG_PA_SC_VPORT_SCISSOR_4_TL = 0x28270, // DIFF + EG_PA_SC_VPORT_SCISSOR_4_BR = 0x28274, // DIFF + EG_PA_SC_VPORT_SCISSOR_5_TL = 0x28278, // DIFF + EG_PA_SC_VPORT_SCISSOR_5_BR = 0x2827C, // DIFF + EG_PA_SC_VPORT_SCISSOR_6_TL = 0x28280, // DIFF + EG_PA_SC_VPORT_SCISSOR_6_BR = 0x28284, // DIFF + EG_PA_SC_VPORT_SCISSOR_7_TL = 0x28288, // DIFF + EG_PA_SC_VPORT_SCISSOR_7_BR = 0x2828C, // DIFF + EG_PA_SC_VPORT_SCISSOR_8_TL = 0x28290, // DIFF + EG_PA_SC_VPORT_SCISSOR_8_BR = 0x28294, // DIFF + EG_PA_SC_VPORT_SCISSOR_9_TL = 0x28298, // DIFF + EG_PA_SC_VPORT_SCISSOR_9_BR = 0x2829C, // DIFF + EG_PA_SC_VPORT_SCISSOR_10_TL = 0x282A0, // DIFF + EG_PA_SC_VPORT_SCISSOR_10_BR = 0x282A4, // DIFF + EG_PA_SC_VPORT_SCISSOR_11_TL = 0x282A8, // DIFF + EG_PA_SC_VPORT_SCISSOR_11_BR = 0x282AC, // DIFF + EG_PA_SC_VPORT_SCISSOR_12_TL = 0x282B0, // DIFF + EG_PA_SC_VPORT_SCISSOR_12_BR = 0x282B4, // DIFF + EG_PA_SC_VPORT_SCISSOR_13_TL = 0x282B8, // DIFF + EG_PA_SC_VPORT_SCISSOR_13_BR = 0x282BC, // DIFF + EG_PA_SC_VPORT_SCISSOR_14_TL = 0x282C0, // DIFF + EG_PA_SC_VPORT_SCISSOR_14_BR = 0x282C4, // DIFF + EG_PA_SC_VPORT_SCISSOR_15_TL = 0x282C8, // DIFF + EG_PA_SC_VPORT_SCISSOR_15_BR = 0x282CC, // DIFF + EG_PA_SC_VPORT_ZMIN_0 = 0x282D0, // SAME + EG_PA_SC_VPORT_ZMAX_0 = 0x282D4, // SAME + EG_PA_SC_VPORT_ZMIN_1 = 0x282D8, // SAME + EG_PA_SC_VPORT_ZMAX_1 = 0x282DC, // SAME + EG_PA_SC_VPORT_ZMIN_2 = 0x282E0, // SAME + EG_PA_SC_VPORT_ZMAX_2 = 0x282E4, // SAME + EG_PA_SC_VPORT_ZMIN_3 = 0x282E8, // SAME + EG_PA_SC_VPORT_ZMAX_3 = 0x282EC, // SAME + EG_PA_SC_VPORT_ZMIN_4 = 0x282F0, // SAME + EG_PA_SC_VPORT_ZMAX_4 = 0x282F4, // SAME + EG_PA_SC_VPORT_ZMIN_5 = 0x282F8, // SAME + EG_PA_SC_VPORT_ZMAX_5 = 0x282FC, // SAME + EG_PA_SC_VPORT_ZMIN_6 = 0x28300, // SAME + EG_PA_SC_VPORT_ZMAX_6 = 0x28304, // SAME + EG_PA_SC_VPORT_ZMIN_7 = 0x28308, // SAME + EG_PA_SC_VPORT_ZMAX_7 = 0x2830C, // SAME + EG_PA_SC_VPORT_ZMIN_8 = 0x28310, // SAME + EG_PA_SC_VPORT_ZMAX_8 = 0x28314, // SAME + EG_PA_SC_VPORT_ZMIN_9 = 0x28318, // SAME + EG_PA_SC_VPORT_ZMAX_9 = 0x2831C, // SAME + EG_PA_SC_VPORT_ZMIN_10 = 0x28320, // SAME + EG_PA_SC_VPORT_ZMAX_10 = 0x28324, // SAME + EG_PA_SC_VPORT_ZMIN_11 = 0x28328, // SAME + EG_PA_SC_VPORT_ZMAX_11 = 0x2832C, // SAME + EG_PA_SC_VPORT_ZMIN_12 = 0x28330, // SAME + EG_PA_SC_VPORT_ZMAX_12 = 0x28334, // SAME + EG_PA_SC_VPORT_ZMIN_13 = 0x28338, // SAME + EG_PA_SC_VPORT_ZMAX_13 = 0x2833C, // SAME + EG_PA_SC_VPORT_ZMIN_14 = 0x28340, // SAME + EG_PA_SC_VPORT_ZMAX_14 = 0x28344, // SAME + EG_PA_SC_VPORT_ZMIN_15 = 0x28348, // SAME + EG_PA_SC_VPORT_ZMAX_15 = 0x2834C, // SAME + EG_PA_CL_VPORT_XSCALE = 0x2843C, // SAME + EG_PA_CL_VPORT_XOFFSET = 0x28440, // SAME + EG_PA_CL_VPORT_YSCALE = 0x28444, // SAME + EG_PA_CL_VPORT_YOFFSET = 0x28448, // SAME + EG_PA_CL_VPORT_ZSCALE = 0x2844C, // SAME + EG_PA_CL_VPORT_ZOFFSET = 0x28450, // SAME + EG_PA_CL_VPORT_XSCALE_1 = 0x28454, // SAME + EG_PA_CL_VPORT_XOFFSET_1 = 0x28458, // SAME + EG_PA_CL_VPORT_YSCALE_1 = 0x2845C, // SAME + EG_PA_CL_VPORT_YOFFSET_1 = 0x28460, // SAME + EG_PA_CL_VPORT_ZSCALE_1 = 0x28464, // SAME + EG_PA_CL_VPORT_ZOFFSET_1 = 0x28468, // SAME + EG_PA_CL_VPORT_XSCALE_2 = 0x2846C, // SAME + EG_PA_CL_VPORT_XOFFSET_2 = 0x28470, // SAME + EG_PA_CL_VPORT_YSCALE_2 = 0x28474, // SAME + EG_PA_CL_VPORT_YOFFSET_2 = 0x28478, // SAME + EG_PA_CL_VPORT_ZSCALE_2 = 0x2847C, // SAME + EG_PA_CL_VPORT_ZOFFSET_2 = 0x28480, // SAME + EG_PA_CL_VPORT_XSCALE_3 = 0x28484, // SAME + EG_PA_CL_VPORT_XOFFSET_3 = 0x28488, // SAME + EG_PA_CL_VPORT_YSCALE_3 = 0x2848C, // SAME + EG_PA_CL_VPORT_YOFFSET_3 = 0x28490, // SAME + EG_PA_CL_VPORT_ZSCALE_3 = 0x28494, // SAME + EG_PA_CL_VPORT_ZOFFSET_3 = 0x28498, // SAME + EG_PA_CL_VPORT_XSCALE_4 = 0x2849C, // SAME + EG_PA_CL_VPORT_XOFFSET_4 = 0x284A0, // SAME + EG_PA_CL_VPORT_YSCALE_4 = 0x284A4, // SAME + EG_PA_CL_VPORT_YOFFSET_4 = 0x284A8, // SAME + EG_PA_CL_VPORT_ZSCALE_4 = 0x284AC, // SAME + EG_PA_CL_VPORT_ZOFFSET_4 = 0x284B0, // SAME + EG_PA_CL_VPORT_XSCALE_5 = 0x284B4, // SAME + EG_PA_CL_VPORT_XOFFSET_5 = 0x284B8, // SAME + EG_PA_CL_VPORT_YSCALE_5 = 0x284BC, // SAME + EG_PA_CL_VPORT_YOFFSET_5 = 0x284C0, // SAME + EG_PA_CL_VPORT_ZSCALE_5 = 0x284C4, // SAME + EG_PA_CL_VPORT_ZOFFSET_5 = 0x284C8, // SAME + EG_PA_CL_VPORT_XSCALE_6 = 0x284CC, // SAME + EG_PA_CL_VPORT_XOFFSET_6 = 0x284D0, // SAME + EG_PA_CL_VPORT_YSCALE_6 = 0x284D4, // SAME + EG_PA_CL_VPORT_YOFFSET_6 = 0x284D8, // SAME + EG_PA_CL_VPORT_ZSCALE_6 = 0x284DC, // SAME + EG_PA_CL_VPORT_ZOFFSET_6 = 0x284E0, // SAME + EG_PA_CL_VPORT_XSCALE_7 = 0x284E4, // SAME + EG_PA_CL_VPORT_XOFFSET_7 = 0x284E8, // SAME + EG_PA_CL_VPORT_YSCALE_7 = 0x284EC, // SAME + EG_PA_CL_VPORT_YOFFSET_7 = 0x284F0, // SAME + EG_PA_CL_VPORT_ZSCALE_7 = 0x284F4, // SAME + EG_PA_CL_VPORT_ZOFFSET_7 = 0x284F8, // SAME + EG_PA_CL_VPORT_XSCALE_8 = 0x284FC, // SAME + EG_PA_CL_VPORT_XOFFSET_8 = 0x28500, // SAME + EG_PA_CL_VPORT_YSCALE_8 = 0x28504, // SAME + EG_PA_CL_VPORT_YOFFSET_8 = 0x28508, // SAME + EG_PA_CL_VPORT_ZSCALE_8 = 0x2850C, // SAME + EG_PA_CL_VPORT_ZOFFSET_8 = 0x28510, // SAME + EG_PA_CL_VPORT_XSCALE_9 = 0x28514, // SAME + EG_PA_CL_VPORT_XOFFSET_9 = 0x28518, // SAME + EG_PA_CL_VPORT_YSCALE_9 = 0x2851C, // SAME + EG_PA_CL_VPORT_YOFFSET_9 = 0x28520, // SAME + EG_PA_CL_VPORT_ZSCALE_9 = 0x28524, // SAME + EG_PA_CL_VPORT_ZOFFSET_9 = 0x28528, // SAME + EG_PA_CL_VPORT_XSCALE_10 = 0x2852C, // SAME + EG_PA_CL_VPORT_XOFFSET_10 = 0x28530, // SAME + EG_PA_CL_VPORT_YSCALE_10 = 0x28534, // SAME + EG_PA_CL_VPORT_YOFFSET_10 = 0x28538, // SAME + EG_PA_CL_VPORT_ZSCALE_10 = 0x2853C, // SAME + EG_PA_CL_VPORT_ZOFFSET_10 = 0x28540, // SAME + EG_PA_CL_VPORT_XSCALE_11 = 0x28544, // SAME + EG_PA_CL_VPORT_XOFFSET_11 = 0x28548, // SAME + EG_PA_CL_VPORT_YSCALE_11 = 0x2854C, // SAME + EG_PA_CL_VPORT_YOFFSET_11 = 0x28550, // SAME + EG_PA_CL_VPORT_ZSCALE_11 = 0x28554, // SAME + EG_PA_CL_VPORT_ZOFFSET_11 = 0x28558, // SAME + EG_PA_CL_VPORT_XSCALE_12 = 0x2855C, // SAME + EG_PA_CL_VPORT_XOFFSET_12 = 0x28560, // SAME + EG_PA_CL_VPORT_YSCALE_12 = 0x28564, // SAME + EG_PA_CL_VPORT_YOFFSET_12 = 0x28568, // SAME + EG_PA_CL_VPORT_ZSCALE_12 = 0x2856C, // SAME + EG_PA_CL_VPORT_ZOFFSET_12 = 0x28570, // SAME + EG_PA_CL_VPORT_XSCALE_13 = 0x28574, // SAME + EG_PA_CL_VPORT_XOFFSET_13 = 0x28578, // SAME + EG_PA_CL_VPORT_YSCALE_13 = 0x2857C, // SAME + EG_PA_CL_VPORT_YOFFSET_13 = 0x28580, // SAME + EG_PA_CL_VPORT_ZSCALE_13 = 0x28584, // SAME + EG_PA_CL_VPORT_ZOFFSET_13 = 0x28588, // SAME + EG_PA_CL_VPORT_XSCALE_14 = 0x2858C, // SAME + EG_PA_CL_VPORT_XOFFSET_14 = 0x28590, // SAME + EG_PA_CL_VPORT_YSCALE_14 = 0x28594, // SAME + EG_PA_CL_VPORT_YOFFSET_14 = 0x28598, // SAME + EG_PA_CL_VPORT_ZSCALE_14 = 0x2859C, // SAME + EG_PA_CL_VPORT_ZOFFSET_14 = 0x285A0, // SAME + EG_PA_CL_VPORT_XSCALE_15 = 0x285A4, // SAME + EG_PA_CL_VPORT_XOFFSET_15 = 0x285A8, // SAME + EG_PA_CL_VPORT_YSCALE_15 = 0x285AC, // SAME + EG_PA_CL_VPORT_YOFFSET_15 = 0x285B0, // SAME + EG_PA_CL_VPORT_ZSCALE_15 = 0x285B4, // SAME + EG_PA_CL_VPORT_ZOFFSET_15 = 0x285B8, // SAME + EG_PA_CL_UCP_0_X = 0x285BC, // SAME 0x28E20 + EG_PA_CL_UCP_0_Y = 0x285C0, // SAME 0x28E24 + EG_PA_CL_UCP_0_Z = 0x285C4, // SAME 0x28E28 + EG_PA_CL_UCP_0_W = 0x285C8, // SAME 0x28E2C + EG_PA_CL_UCP_1_X = 0x285CC, // SAME 0x28E30 + EG_PA_CL_UCP_1_Y = 0x285D0, // SAME 0x28E34 + EG_PA_CL_UCP_1_Z = 0x285D4, // SAME 0x28E38 + EG_PA_CL_UCP_1_W = 0x285D8, // SAME 0x28E3C + EG_PA_CL_UCP_2_X = 0x285DC, // SAME 0x28E40 + EG_PA_CL_UCP_2_Y = 0x285E0, // SAME 0x28E44 + EG_PA_CL_UCP_2_Z = 0x285E4, // SAME 0x28E48 + EG_PA_CL_UCP_2_W = 0x285E8, // SAME 0x28E4C + EG_PA_CL_UCP_3_X = 0x285EC, // SAME 0x28E50 + EG_PA_CL_UCP_3_Y = 0x285F0, // SAME 0x28E54 + EG_PA_CL_UCP_3_Z = 0x285F4, // SAME 0x28E58 + EG_PA_CL_UCP_3_W = 0x285F8, // SAME 0x28E5C + EG_PA_CL_UCP_4_X = 0x285FC, // SAME 0x28E60 + EG_PA_CL_UCP_4_Y = 0x28600, // SAME 0x28E64 + EG_PA_CL_UCP_4_Z = 0x28604, // SAME 0x28E68 + EG_PA_CL_UCP_4_W = 0x28608, // SAME 0x28E6C + EG_PA_CL_UCP_5_X = 0x2860C, // SAME 0x28E70 + EG_PA_CL_UCP_5_Y = 0x28610, // SAME 0x28E74 + EG_PA_CL_UCP_5_Z = 0x28614, // SAME 0x28E78 + EG_PA_CL_UCP_5_W = 0x28618, // SAME 0x28E7C + EG_PA_CL_POINT_X_RAD = 0x287D4, // SAME 0x28E10 + EG_PA_CL_POINT_Y_RAD = 0x287D8, // SAME 0x28E14 + EG_PA_CL_POINT_SIZE = 0x287DC, // SAME 0x28E18 + EG_PA_CL_POINT_CULL_RAD = 0x287E0, // SAME 0x28E1C + EG_PA_CL_CLIP_CNTL = 0x28810, // SAME + EG_PA_SU_SC_MODE_CNTL = 0x28814, // SAME + EG_PA_CL_VTE_CNTL = 0x28818, // SAME + EG_PA_CL_VS_OUT_CNTL = 0x2881C, // SAME + EG_PA_CL_NANINF_CNTL = 0x28820, // SAME + EG_PA_SU_LINE_STIPPLE_CNTL = 0x28824, // + EG_PA_SU_LINE_STIPPLE_SCALE = 0x28828, // + EG_PA_SU_PRIM_FILTER_CNTL = 0x2882C, // + EG_PA_SU_POINT_SIZE = 0x28A00, // SAME + EG_PA_SU_POINT_MINMAX = 0x28A04, // SAME + EG_PA_SU_LINE_CNTL = 0x28A08, // SAME + EG_PA_SC_LINE_STIPPLE = 0x28A0C, // SAME + EG_PA_SC_MODE_CNTL_0 = 0x28A48, // + EG_PA_SC_MODE_CNTL_1 = 0x28A4C, // + EG_PA_SU_POLY_OFFSET_DB_FMT_CNTL = 0x28B78, // SAME 0x28DF8 + EG_PA_SU_POLY_OFFSET_CLAMP = 0x28B7C, // SAME 0x28DFC + EG_PA_SU_POLY_OFFSET_FRONT_SCALE = 0x28B80, // SAME 0x28E00 + EG_PA_SU_POLY_OFFSET_FRONT_OFFSET = 0x28B84, // SAME 0x28E04 + EG_PA_SU_POLY_OFFSET_BACK_SCALE = 0x28B88, // SAME 0x28E08 + EG_PA_SU_POLY_OFFSET_BACK_OFFSET = 0x28B8C, // SAME 0x28E0C + EG_PA_SC_LINE_CNTL = 0x28C00, // DIFF + EG_PA_SC_AA_CONFIG = 0x28C04, // SAME + EG_PA_SU_VTX_CNTL = 0x28C08, // SAME + EG_PA_CL_GB_VERT_CLIP_ADJ = 0x28C0C, // SAME + EG_PA_CL_GB_VERT_DISC_ADJ = 0x28C10, // SAME + EG_PA_CL_GB_HORZ_CLIP_ADJ = 0x28C14, // SAME + EG_PA_CL_GB_HORZ_DISC_ADJ = 0x28C18, // SAME + EG_PA_SC_AA_SAMPLE_LOCS_0 = 0x28C1C, // + EG_PA_SC_AA_SAMPLE_LOCS_1 = 0x28C20, // + EG_PA_SC_AA_SAMPLE_LOCS_2 = 0x28C24, // + EG_PA_SC_AA_SAMPLE_LOCS_3 = 0x28C28, // + EG_PA_SC_AA_SAMPLE_LOCS_4 = 0x28C2C, // + EG_PA_SC_AA_SAMPLE_LOCS_5 = 0x28C30, // + EG_PA_SC_AA_SAMPLE_LOCS_6 = 0x28C34, // + EG_PA_SC_AA_SAMPLE_LOCS_7 = 0x28C38, // + EG_PA_SC_AA_MASK = 0x28C3C, // SAME 0x28C48 -/* Registers from VGT block: */ +/* Registers from VGT block: */ EG_VGT_INDEX_TYPE = 0x895C, //? config space EG_VGT_PRIMITIVE_TYPE = 0x8958, //? config space - - EG_VGT_MAX_VTX_INDX = 0x28400, // SAME - EG_VGT_MIN_VTX_INDX = 0x28404, // SAME - EG_VGT_INDX_OFFSET = 0x28408, // SAME - EG_VGT_MULTI_PRIM_IB_RESET_INDX = 0x2840C, // SAME - EG_CS_COPY_STATE = 0x287CC, // - EG_GFX_COPY_STATE = 0x287D0, // SAME - EG_VGT_DMA_BASE_HI = 0x287E4, // SAME - EG_VGT_DMA_BASE = 0x287E8, // SAME - EG_VGT_DRAW_INITIATOR = 0x287F0, // SAME - EG_VGT_IMMED_DATA = 0x287F4, // SAME - EG_VGT_EVENT_ADDRESS_REG = 0x287F8, // SAME - EG_VGT_OUTPUT_PATH_CNTL = 0x28A10, // DIFF - EG_VGT_HOS_CNTL = 0x28A14, // SAME - EG_VGT_HOS_MAX_TESS_LEVEL = 0x28A18, // SAME - EG_VGT_HOS_MIN_TESS_LEVEL = 0x28A1C, // SAME - EG_VGT_HOS_REUSE_DEPTH = 0x28A20, // SAME - EG_VGT_GROUP_PRIM_TYPE = 0x28A24, // SAME - EG_VGT_GROUP_FIRST_DECR = 0x28A28, // SAME - EG_VGT_GROUP_DECR = 0x28A2C, // SAME - EG_VGT_GROUP_VECT_0_CNTL = 0x28A30, // SAME - EG_VGT_GROUP_VECT_1_CNTL = 0x28A34, // SAME - EG_VGT_GROUP_VECT_0_FMT_CNTL = 0x28A38, // SAME - EG_VGT_GROUP_VECT_1_FMT_CNTL = 0x28A3C, // SAME - EG_VGT_GS_MODE = 0x28A40, // DIFF - EG_VGT_ENHANCE = 0x28A50, // DIFF - EG_VGT_GS_PER_ES = 0x28A54, // DIFF 0x88C8 - EG_VGT_ES_PER_GS = 0x28A58, // DIFF 0x88CC - EG_VGT_GS_PER_VS = 0x28A5C, // SAME 0x88E8 - EG_VGT_GS_OUT_PRIM_TYPE = 0x28A6C, // SAME - EG_VGT_DMA_SIZE = 0x28A74, // SAME - EG_VGT_DMA_MAX_SIZE = 0x28A78, // SAME - EG_VGT_DMA_INDEX_TYPE = 0x28A7C, // SAME - EG_VGT_PRIMITIVEID_EN = 0x28A84, // SAME - EG_VGT_DMA_NUM_INSTANCES = 0x28A88, // SAME - EG_VGT_EVENT_INITIATOR = 0x28A90, // SAME - EG_VGT_MULTI_PRIM_IB_RESET_EN = 0x28A94, // SAME - EG_VGT_INSTANCE_STEP_RATE_0 = 0x28AA0, // SAME - EG_VGT_INSTANCE_STEP_RATE_1 = 0x28AA4, // SAME - EG_VGT_REUSE_OFF = 0x28AB4, // SAME - EG_VGT_VTX_CNT_EN = 0x28AB8, // SAME - EG_VGT_STRMOUT_BUFFER_SIZE_0 = 0x28AD0, // SAME - EG_VGT_STRMOUT_VTX_STRIDE_0 = 0x28AD4, // SAME - EG_VGT_STRMOUT_BUFFER_BASE_0 = 0x28AD8, // SAME - EG_VGT_STRMOUT_BUFFER_OFFSET_0 = 0x28ADC, // SAME - EG_VGT_STRMOUT_BUFFER_SIZE_1 = 0x28AE0, // SAME - EG_VGT_STRMOUT_VTX_STRIDE_1 = 0x28AE4, // SAME - EG_VGT_STRMOUT_BUFFER_BASE_1 = 0x28AE8, // SAME - EG_VGT_STRMOUT_BUFFER_OFFSET_1 = 0x28AEC, // SAME - EG_VGT_STRMOUT_BUFFER_SIZE_2 = 0x28AF0, // SAME - EG_VGT_STRMOUT_VTX_STRIDE_2 = 0x28AF4, // SAME - EG_VGT_STRMOUT_BUFFER_BASE_2 = 0x28AF8, // SAME - EG_VGT_STRMOUT_BUFFER_OFFSET_2 = 0x28AFC, // SAME - EG_VGT_STRMOUT_BUFFER_SIZE_3 = 0x28B00, // SAME - EG_VGT_STRMOUT_VTX_STRIDE_3 = 0x28B04, // SAME - EG_VGT_STRMOUT_BUFFER_BASE_3 = 0x28B08, // SAME - EG_VGT_STRMOUT_BUFFER_OFFSET_3 = 0x28B0C, // SAME - EG_VGT_STRMOUT_BASE_OFFSET_0 = 0x28B10, // SAME - EG_VGT_STRMOUT_BASE_OFFSET_1 = 0x28B14, // SAME - EG_VGT_STRMOUT_BASE_OFFSET_2 = 0x28B18, // SAME - EG_VGT_STRMOUT_BASE_OFFSET_3 = 0x28B1C, // SAME - EG_VGT_STRMOUT_DRAW_OPAQUE_OFFSET = 0x28B28, // SAME - EG_VGT_STRMOUT_DRAW_OPAQUE_BUFFER_FILLED_SIZE = 0x28B2C, // SAME - EG_VGT_STRMOUT_DRAW_OPAQUE_VERTEX_STRIDE = 0x28B30, // DIFF - EG_VGT_GS_MAX_VERT_OUT = 0x28B38, // SAME - EG_VGT_STRMOUT_BASE_OFFSET_HI_0 = 0x28B44, // SAME - EG_VGT_STRMOUT_BASE_OFFSET_HI_1 = 0x28B48, // SAME - EG_VGT_STRMOUT_BASE_OFFSET_HI_2 = 0x28B4C, // SAME - EG_VGT_STRMOUT_BASE_OFFSET_HI_3 = 0x28B50, // SAME - EG_VGT_SHADER_STAGES_EN = 0x28B54, // - EG_VGT_LS_HS_CONFIG = 0x28B58, // - EG_VGT_LS_SIZE = 0x28B5C, // - EG_VGT_HS_SIZE = 0x28B60, // - EG_VGT_LS_HS_ALLOC = 0x28B64, // - EG_VGT_HS_PATCH_CONST = 0x28B68, // - EG_VGT_TF_PARAM = 0x28B6C, // - EG_VGT_DISPATCH_INITIATOR = 0x28B74, // - EG_VGT_GS_INSTANCE_CNT = 0x28B90, // - EG_VGT_STRMOUT_CONFIG = 0x28B94, // - EG_VGT_STRMOUT_BUFFER_CONFIG = 0x28B98, // - EG_VGT_VERTEX_REUSE_BLOCK_CNTL = 0x28C58, // SAME - EG_VGT_OUT_DEALLOC_CNTL = 0x28C5C, // SAME -/* Registers from TP block: */ - EG_GDS_ADDR_BASE = 0x28720, // - EG_GDS_ADDR_SIZE = 0x28724, // - EG_GDS_ORDERED_WAVE_PER_SE = 0x28728, // - EG_GDS_APPEND_CONSUME_UAV0 = 0x2872C, // - EG_GDS_APPEND_CONSUME_UAV1 = 0x28730, // - EG_GDS_APPEND_CONSUME_UAV2 = 0x28734, // - EG_GDS_APPEND_CONSUME_UAV3 = 0x28738, // - EG_GDS_APPEND_CONSUME_UAV4 = 0x2873C, // - EG_GDS_APPEND_CONSUME_UAV5 = 0x28740, // - EG_GDS_APPEND_CONSUME_UAV6 = 0x28744, // - EG_GDS_APPEND_CONSUME_UAV7 = 0x28748, // - EG_GDS_APPEND_CONSUME_UAV8 = 0x2874C, // - EG_GDS_APPEND_CONSUME_UAV9 = 0x28750, // - EG_GDS_APPEND_CONSUME_UAV10 = 0x28754, // - EG_GDS_APPEND_CONSUME_UAV11 = 0x28758, // + EG_VGT_MAX_VTX_INDX = 0x28400, // SAME + EG_VGT_MIN_VTX_INDX = 0x28404, // SAME + EG_VGT_INDX_OFFSET = 0x28408, // SAME + EG_VGT_MULTI_PRIM_IB_RESET_INDX = 0x2840C, // SAME + EG_CS_COPY_STATE = 0x287CC, // + EG_GFX_COPY_STATE = 0x287D0, // SAME + EG_VGT_DMA_BASE_HI = 0x287E4, // SAME + EG_VGT_DMA_BASE = 0x287E8, // SAME + EG_VGT_DRAW_INITIATOR = 0x287F0, // SAME + EG_VGT_IMMED_DATA = 0x287F4, // SAME + EG_VGT_EVENT_ADDRESS_REG = 0x287F8, // SAME + EG_VGT_OUTPUT_PATH_CNTL = 0x28A10, // DIFF + EG_VGT_HOS_CNTL = 0x28A14, // SAME + EG_VGT_HOS_MAX_TESS_LEVEL = 0x28A18, // SAME + EG_VGT_HOS_MIN_TESS_LEVEL = 0x28A1C, // SAME + EG_VGT_HOS_REUSE_DEPTH = 0x28A20, // SAME + EG_VGT_GROUP_PRIM_TYPE = 0x28A24, // SAME + EG_VGT_GROUP_FIRST_DECR = 0x28A28, // SAME + EG_VGT_GROUP_DECR = 0x28A2C, // SAME + EG_VGT_GROUP_VECT_0_CNTL = 0x28A30, // SAME + EG_VGT_GROUP_VECT_1_CNTL = 0x28A34, // SAME + EG_VGT_GROUP_VECT_0_FMT_CNTL = 0x28A38, // SAME + EG_VGT_GROUP_VECT_1_FMT_CNTL = 0x28A3C, // SAME + EG_VGT_GS_MODE = 0x28A40, // DIFF + EG_VGT_ENHANCE = 0x28A50, // DIFF + EG_VGT_GS_PER_ES = 0x28A54, // DIFF 0x88C8 + EG_VGT_ES_PER_GS = 0x28A58, // DIFF 0x88CC + EG_VGT_GS_PER_VS = 0x28A5C, // SAME 0x88E8 + EG_VGT_GS_OUT_PRIM_TYPE = 0x28A6C, // SAME + EG_VGT_DMA_SIZE = 0x28A74, // SAME + EG_VGT_DMA_MAX_SIZE = 0x28A78, // SAME + EG_VGT_DMA_INDEX_TYPE = 0x28A7C, // SAME + EG_VGT_PRIMITIVEID_EN = 0x28A84, // SAME + EG_VGT_DMA_NUM_INSTANCES = 0x28A88, // SAME + EG_VGT_EVENT_INITIATOR = 0x28A90, // SAME + EG_VGT_MULTI_PRIM_IB_RESET_EN = 0x28A94, // SAME + EG_VGT_INSTANCE_STEP_RATE_0 = 0x28AA0, // SAME + EG_VGT_INSTANCE_STEP_RATE_1 = 0x28AA4, // SAME + EG_VGT_REUSE_OFF = 0x28AB4, // SAME + EG_VGT_VTX_CNT_EN = 0x28AB8, // SAME + EG_VGT_STRMOUT_BUFFER_SIZE_0 = 0x28AD0, // SAME + EG_VGT_STRMOUT_VTX_STRIDE_0 = 0x28AD4, // SAME + EG_VGT_STRMOUT_BUFFER_BASE_0 = 0x28AD8, // SAME + EG_VGT_STRMOUT_BUFFER_OFFSET_0 = 0x28ADC, // SAME + EG_VGT_STRMOUT_BUFFER_SIZE_1 = 0x28AE0, // SAME + EG_VGT_STRMOUT_VTX_STRIDE_1 = 0x28AE4, // SAME + EG_VGT_STRMOUT_BUFFER_BASE_1 = 0x28AE8, // SAME + EG_VGT_STRMOUT_BUFFER_OFFSET_1 = 0x28AEC, // SAME + EG_VGT_STRMOUT_BUFFER_SIZE_2 = 0x28AF0, // SAME + EG_VGT_STRMOUT_VTX_STRIDE_2 = 0x28AF4, // SAME + EG_VGT_STRMOUT_BUFFER_BASE_2 = 0x28AF8, // SAME + EG_VGT_STRMOUT_BUFFER_OFFSET_2 = 0x28AFC, // SAME + EG_VGT_STRMOUT_BUFFER_SIZE_3 = 0x28B00, // SAME + EG_VGT_STRMOUT_VTX_STRIDE_3 = 0x28B04, // SAME + EG_VGT_STRMOUT_BUFFER_BASE_3 = 0x28B08, // SAME + EG_VGT_STRMOUT_BUFFER_OFFSET_3 = 0x28B0C, // SAME + EG_VGT_STRMOUT_BASE_OFFSET_0 = 0x28B10, // SAME + EG_VGT_STRMOUT_BASE_OFFSET_1 = 0x28B14, // SAME + EG_VGT_STRMOUT_BASE_OFFSET_2 = 0x28B18, // SAME + EG_VGT_STRMOUT_BASE_OFFSET_3 = 0x28B1C, // SAME + EG_VGT_STRMOUT_DRAW_OPAQUE_OFFSET = 0x28B28, // SAME + EG_VGT_STRMOUT_DRAW_OPAQUE_BUFFER_FILLED_SIZE = 0x28B2C, // SAME + EG_VGT_STRMOUT_DRAW_OPAQUE_VERTEX_STRIDE = 0x28B30, // DIFF + EG_VGT_GS_MAX_VERT_OUT = 0x28B38, // SAME + EG_VGT_STRMOUT_BASE_OFFSET_HI_0 = 0x28B44, // SAME + EG_VGT_STRMOUT_BASE_OFFSET_HI_1 = 0x28B48, // SAME + EG_VGT_STRMOUT_BASE_OFFSET_HI_2 = 0x28B4C, // SAME + EG_VGT_STRMOUT_BASE_OFFSET_HI_3 = 0x28B50, // SAME + EG_VGT_SHADER_STAGES_EN = 0x28B54, // + EG_VGT_LS_HS_CONFIG = 0x28B58, // + EG_VGT_LS_SIZE = 0x28B5C, // + EG_VGT_HS_SIZE = 0x28B60, // + EG_VGT_LS_HS_ALLOC = 0x28B64, // + EG_VGT_HS_PATCH_CONST = 0x28B68, // + EG_VGT_TF_PARAM = 0x28B6C, // + EG_VGT_DISPATCH_INITIATOR = 0x28B74, // + EG_VGT_GS_INSTANCE_CNT = 0x28B90, // + EG_VGT_STRMOUT_CONFIG = 0x28B94, // + EG_VGT_STRMOUT_BUFFER_CONFIG = 0x28B98, // + EG_VGT_VERTEX_REUSE_BLOCK_CNTL = 0x28C58, // SAME + EG_VGT_OUT_DEALLOC_CNTL = 0x28C5C, // SAME -/* Registers from SQ block: */ +/* Registers from TP block: */ + EG_GDS_ADDR_BASE = 0x28720, // + EG_GDS_ADDR_SIZE = 0x28724, // + EG_GDS_ORDERED_WAVE_PER_SE = 0x28728, // + EG_GDS_APPEND_CONSUME_UAV0 = 0x2872C, // + EG_GDS_APPEND_CONSUME_UAV1 = 0x28730, // + EG_GDS_APPEND_CONSUME_UAV2 = 0x28734, // + EG_GDS_APPEND_CONSUME_UAV3 = 0x28738, // + EG_GDS_APPEND_CONSUME_UAV4 = 0x2873C, // + EG_GDS_APPEND_CONSUME_UAV5 = 0x28740, // + EG_GDS_APPEND_CONSUME_UAV6 = 0x28744, // + EG_GDS_APPEND_CONSUME_UAV7 = 0x28748, // + EG_GDS_APPEND_CONSUME_UAV8 = 0x2874C, // + EG_GDS_APPEND_CONSUME_UAV9 = 0x28750, // + EG_GDS_APPEND_CONSUME_UAV10 = 0x28754, // + EG_GDS_APPEND_CONSUME_UAV11 = 0x28758, // + +/* Registers from SQ block: */ EG_SQ_LOOP_CONST_0 = 0x3A200, // 0x3E200 EG_SQ_ALU_CONST_BUFFER_SIZE_VS_0 = 0x28180, // ? EG_SQ_VTX_SEMANTIC_0 = 0x28380, // SAME @@ -385,408 +385,408 @@ enum EG_SQ_VTX_SEMANTIC_3 = 0x2838C, // SAME EG_SQ_VTX_SEMANTIC_4 = 0x28390, // SAME EG_SQ_VTX_SEMANTIC_5 = 0x28394, // SAME - EG_SQ_VTX_SEMANTIC_6 = 0x28398, // SAME - EG_SQ_VTX_SEMANTIC_7 = 0x2839C, // SAME - EG_SQ_VTX_SEMANTIC_8 = 0x283A0, // SAME - EG_SQ_VTX_SEMANTIC_9 = 0x283A4, // SAME - EG_SQ_VTX_SEMANTIC_10 = 0x283A8, // SAME - EG_SQ_VTX_SEMANTIC_11 = 0x283AC, // SAME - EG_SQ_VTX_SEMANTIC_12 = 0x283B0, // SAME - EG_SQ_VTX_SEMANTIC_13 = 0x283B4, // SAME - EG_SQ_VTX_SEMANTIC_14 = 0x283B8, // SAME - EG_SQ_VTX_SEMANTIC_15 = 0x283BC, // SAME - EG_SQ_VTX_SEMANTIC_16 = 0x283C0, // SAME - EG_SQ_VTX_SEMANTIC_17 = 0x283C4, // SAME - EG_SQ_VTX_SEMANTIC_18 = 0x283C8, // SAME - EG_SQ_VTX_SEMANTIC_19 = 0x283CC, // SAME - EG_SQ_VTX_SEMANTIC_20 = 0x283D0, // SAME - EG_SQ_VTX_SEMANTIC_21 = 0x283D4, // SAME - EG_SQ_VTX_SEMANTIC_22 = 0x283D8, // SAME - EG_SQ_VTX_SEMANTIC_23 = 0x283DC, // SAME - EG_SQ_VTX_SEMANTIC_24 = 0x283E0, // SAME - EG_SQ_VTX_SEMANTIC_25 = 0x283E4, // SAME - EG_SQ_VTX_SEMANTIC_26 = 0x283E8, // SAME - EG_SQ_VTX_SEMANTIC_27 = 0x283EC, // SAME - EG_SQ_VTX_SEMANTIC_28 = 0x283F0, // SAME - EG_SQ_VTX_SEMANTIC_29 = 0x283F4, // SAME - EG_SQ_VTX_SEMANTIC_30 = 0x283F8, // SAME - EG_SQ_VTX_SEMANTIC_31 = 0x283FC, // SAME - EG_SQ_LSTMP_RING_ITEMSIZE = 0x28830, // - EG_SQ_HSTMP_RING_ITEMSIZE = 0x28834, // - EG_SQ_DYN_GPR_RESOURCE_LIMIT_1 = 0x28838, // - EG_SQ_PGM_START_PS = 0x28840, // SAME - EG_SQ_PGM_RESOURCES_PS = 0x28844, // DIFF 0x28850 - EG_SQ_PGM_RESOURCES_2_PS = 0x28848, // - EG_SQ_PGM_EXPORTS_PS = 0x2884C, // SAME 0x28854 - EG_SQ_PGM_START_VS = 0x2885C, // SAME 0x28858 - EG_SQ_PGM_RESOURCES_VS = 0x28860, // DIFF 0x28868 - EG_SQ_PGM_RESOURCES_2_VS = 0x28864, // - EG_SQ_PGM_START_GS = 0x28874, // SAME 0x2886C - EG_SQ_PGM_RESOURCES_GS = 0x28878, // DIFF 0x2887C - EG_SQ_PGM_RESOURCES_2_GS = 0x2887C, // - EG_SQ_PGM_START_ES = 0x2888C, // SAME 0x28880 - EG_SQ_PGM_RESOURCES_ES = 0x28890, // DIFF - EG_SQ_PGM_RESOURCES_2_ES = 0x28894, // - EG_SQ_PGM_START_FS = 0x288A4, // SAME 0x28894 - EG_SQ_PGM_RESOURCES_FS = 0x288A8, // DIFF 0x288A4 - EG_SQ_PGM_START_HS = 0x288B8, // - EG_SQ_PGM_RESOURCES_HS = 0x288BC, // - EG_SQ_PGM_RESOURCES_2_HS = 0x288C0, // - EG_SQ_PGM_START_LS = 0x288D0, // - EG_SQ_PGM_RESOURCES_LS = 0x288D4, // - EG_SQ_PGM_RESOURCES_2_LS = 0x288D8, // - EG_SQ_THREAD_TRACE_USERDATA = 0x288DC, // - EG_SQ_LDS_ALLOC = 0x288E8, // - EG_SQ_LDS_ALLOC_PS = 0x288EC, // - EG_SQ_VTX_SEMANTIC_CLEAR = 0x288F0, // SAME 0x288E0 - EG_SQ_THREAD_TRACE_CTRL = 0x288F8, // - EG_SQ_ESGS_RING_ITEMSIZE = 0x28900, // SAME 0x288A8 - EG_SQ_GSVS_RING_ITEMSIZE = 0x28904, // SAME 0x288AC - EG_SQ_ESTMP_RING_ITEMSIZE = 0x28908, // SAME 0x288B0 - EG_SQ_GSTMP_RING_ITEMSIZE = 0x2890C, // SAME 0x288B4 - EG_SQ_VSTMP_RING_ITEMSIZE = 0x28910, // SAME 0x288B8 - EG_SQ_PSTMP_RING_ITEMSIZE = 0x28914, // SAME 0x288BC - EG_SQ_GS_VERT_ITEMSIZE = 0x2891C, // SAME 0x288C8 - EG_SQ_GS_VERT_ITEMSIZE_1 = 0x28920, // - EG_SQ_GS_VERT_ITEMSIZE_2 = 0x28924, // - EG_SQ_GS_VERT_ITEMSIZE_3 = 0x28928, // - EG_SQ_GSVS_RING_OFFSET_1 = 0x2892C, // - EG_SQ_GSVS_RING_OFFSET_2 = 0x28930, // - EG_SQ_GSVS_RING_OFFSET_3 = 0x28934, // - EG_SQ_ALU_CONST_CACHE_PS_0 = 0x28940, // SAME - EG_SQ_ALU_CONST_CACHE_PS_1 = 0x28944, // SAME - EG_SQ_ALU_CONST_CACHE_PS_2 = 0x28948, // SAME - EG_SQ_ALU_CONST_CACHE_PS_3 = 0x2894C, // SAME - EG_SQ_ALU_CONST_CACHE_PS_4 = 0x28950, // SAME - EG_SQ_ALU_CONST_CACHE_PS_5 = 0x28954, // SAME - EG_SQ_ALU_CONST_CACHE_PS_6 = 0x28958, // SAME - EG_SQ_ALU_CONST_CACHE_PS_7 = 0x2895C, // SAME - EG_SQ_ALU_CONST_CACHE_PS_8 = 0x28960, // SAME - EG_SQ_ALU_CONST_CACHE_PS_9 = 0x28964, // SAME - EG_SQ_ALU_CONST_CACHE_PS_10 = 0x28968, // SAME - EG_SQ_ALU_CONST_CACHE_PS_11 = 0x2896C, // SAME - EG_SQ_ALU_CONST_CACHE_PS_12 = 0x28970, // SAME - EG_SQ_ALU_CONST_CACHE_PS_13 = 0x28974, // SAME - EG_SQ_ALU_CONST_CACHE_PS_14 = 0x28978, // SAME - EG_SQ_ALU_CONST_CACHE_PS_15 = 0x2897C, // SAME - EG_SQ_ALU_CONST_CACHE_VS_0 = 0x28980, // SAME - EG_SQ_ALU_CONST_CACHE_VS_1 = 0x28984, // SAME - EG_SQ_ALU_CONST_CACHE_VS_2 = 0x28988, // SAME - EG_SQ_ALU_CONST_CACHE_VS_3 = 0x2898C, // SAME - EG_SQ_ALU_CONST_CACHE_VS_4 = 0x28990, // SAME - EG_SQ_ALU_CONST_CACHE_VS_5 = 0x28994, // SAME - EG_SQ_ALU_CONST_CACHE_VS_6 = 0x28998, // SAME - EG_SQ_ALU_CONST_CACHE_VS_7 = 0x2899C, // SAME - EG_SQ_ALU_CONST_CACHE_VS_8 = 0x289A0, // SAME - EG_SQ_ALU_CONST_CACHE_VS_9 = 0x289A4, // SAME - EG_SQ_ALU_CONST_CACHE_VS_10 = 0x289A8, // SAME - EG_SQ_ALU_CONST_CACHE_VS_11 = 0x289AC, // SAME - EG_SQ_ALU_CONST_CACHE_VS_12 = 0x289B0, // SAME - EG_SQ_ALU_CONST_CACHE_VS_13 = 0x289B4, // SAME - EG_SQ_ALU_CONST_CACHE_VS_14 = 0x289B8, // SAME - EG_SQ_ALU_CONST_CACHE_VS_15 = 0x289BC, // SAME - EG_SQ_ALU_CONST_CACHE_GS_0 = 0x289C0, // SAME - EG_SQ_ALU_CONST_CACHE_GS_1 = 0x289C4, // SAME - EG_SQ_ALU_CONST_CACHE_GS_2 = 0x289C8, // SAME - EG_SQ_ALU_CONST_CACHE_GS_3 = 0x289CC, // SAME - EG_SQ_ALU_CONST_CACHE_GS_4 = 0x289D0, // SAME - EG_SQ_ALU_CONST_CACHE_GS_5 = 0x289D4, // SAME - EG_SQ_ALU_CONST_CACHE_GS_6 = 0x289D8, // SAME - EG_SQ_ALU_CONST_CACHE_GS_7 = 0x289DC, // SAME - EG_SQ_ALU_CONST_CACHE_GS_8 = 0x289E0, // SAME - EG_SQ_ALU_CONST_CACHE_GS_9 = 0x289E4, // SAME - EG_SQ_ALU_CONST_CACHE_GS_10 = 0x289E8, // SAME - EG_SQ_ALU_CONST_CACHE_GS_11 = 0x289EC, // SAME - EG_SQ_ALU_CONST_CACHE_GS_12 = 0x289F0, // SAME - EG_SQ_ALU_CONST_CACHE_GS_13 = 0x289F4, // SAME - EG_SQ_ALU_CONST_CACHE_GS_14 = 0x289F8, // SAME - EG_SQ_ALU_CONST_CACHE_GS_15 = 0x289FC, // SAME - EG_SQ_ALU_CONST_CACHE_HS_0 = 0x28F00, // - EG_SQ_ALU_CONST_CACHE_HS_1 = 0x28F04, // - EG_SQ_ALU_CONST_CACHE_HS_2 = 0x28F08, // - EG_SQ_ALU_CONST_CACHE_HS_3 = 0x28F0C, // - EG_SQ_ALU_CONST_CACHE_HS_4 = 0x28F10, // - EG_SQ_ALU_CONST_CACHE_HS_5 = 0x28F14, // - EG_SQ_ALU_CONST_CACHE_HS_6 = 0x28F18, // - EG_SQ_ALU_CONST_CACHE_HS_7 = 0x28F1C, // - EG_SQ_ALU_CONST_CACHE_HS_8 = 0x28F20, // - EG_SQ_ALU_CONST_CACHE_HS_9 = 0x28F24, // - EG_SQ_ALU_CONST_CACHE_HS_10 = 0x28F28, // - EG_SQ_ALU_CONST_CACHE_HS_11 = 0x28F2C, // - EG_SQ_ALU_CONST_CACHE_HS_12 = 0x28F30, // - EG_SQ_ALU_CONST_CACHE_HS_13 = 0x28F34, // - EG_SQ_ALU_CONST_CACHE_HS_14 = 0x28F38, // - EG_SQ_ALU_CONST_CACHE_HS_15 = 0x28F3C, // - EG_SQ_ALU_CONST_CACHE_LS_0 = 0x28F40, // - EG_SQ_ALU_CONST_CACHE_LS_1 = 0x28F44, // - EG_SQ_ALU_CONST_CACHE_LS_2 = 0x28F48, // - EG_SQ_ALU_CONST_CACHE_LS_3 = 0x28F4C, // - EG_SQ_ALU_CONST_CACHE_LS_4 = 0x28F50, // - EG_SQ_ALU_CONST_CACHE_LS_5 = 0x28F54, // - EG_SQ_ALU_CONST_CACHE_LS_6 = 0x28F58, // - EG_SQ_ALU_CONST_CACHE_LS_7 = 0x28F5C, // - EG_SQ_ALU_CONST_CACHE_LS_8 = 0x28F60, // - EG_SQ_ALU_CONST_CACHE_LS_9 = 0x28F64, // - EG_SQ_ALU_CONST_CACHE_LS_10 = 0x28F68, // - EG_SQ_ALU_CONST_CACHE_LS_11 = 0x28F6C, // - EG_SQ_ALU_CONST_CACHE_LS_12 = 0x28F70, // - EG_SQ_ALU_CONST_CACHE_LS_13 = 0x28F74, // - EG_SQ_ALU_CONST_CACHE_LS_14 = 0x28F78, // - EG_SQ_ALU_CONST_CACHE_LS_15 = 0x28F7C, // + EG_SQ_VTX_SEMANTIC_6 = 0x28398, // SAME + EG_SQ_VTX_SEMANTIC_7 = 0x2839C, // SAME + EG_SQ_VTX_SEMANTIC_8 = 0x283A0, // SAME + EG_SQ_VTX_SEMANTIC_9 = 0x283A4, // SAME + EG_SQ_VTX_SEMANTIC_10 = 0x283A8, // SAME + EG_SQ_VTX_SEMANTIC_11 = 0x283AC, // SAME + EG_SQ_VTX_SEMANTIC_12 = 0x283B0, // SAME + EG_SQ_VTX_SEMANTIC_13 = 0x283B4, // SAME + EG_SQ_VTX_SEMANTIC_14 = 0x283B8, // SAME + EG_SQ_VTX_SEMANTIC_15 = 0x283BC, // SAME + EG_SQ_VTX_SEMANTIC_16 = 0x283C0, // SAME + EG_SQ_VTX_SEMANTIC_17 = 0x283C4, // SAME + EG_SQ_VTX_SEMANTIC_18 = 0x283C8, // SAME + EG_SQ_VTX_SEMANTIC_19 = 0x283CC, // SAME + EG_SQ_VTX_SEMANTIC_20 = 0x283D0, // SAME + EG_SQ_VTX_SEMANTIC_21 = 0x283D4, // SAME + EG_SQ_VTX_SEMANTIC_22 = 0x283D8, // SAME + EG_SQ_VTX_SEMANTIC_23 = 0x283DC, // SAME + EG_SQ_VTX_SEMANTIC_24 = 0x283E0, // SAME + EG_SQ_VTX_SEMANTIC_25 = 0x283E4, // SAME + EG_SQ_VTX_SEMANTIC_26 = 0x283E8, // SAME + EG_SQ_VTX_SEMANTIC_27 = 0x283EC, // SAME + EG_SQ_VTX_SEMANTIC_28 = 0x283F0, // SAME + EG_SQ_VTX_SEMANTIC_29 = 0x283F4, // SAME + EG_SQ_VTX_SEMANTIC_30 = 0x283F8, // SAME + EG_SQ_VTX_SEMANTIC_31 = 0x283FC, // SAME + EG_SQ_LSTMP_RING_ITEMSIZE = 0x28830, // + EG_SQ_HSTMP_RING_ITEMSIZE = 0x28834, // + EG_SQ_DYN_GPR_RESOURCE_LIMIT_1 = 0x28838, // + EG_SQ_PGM_START_PS = 0x28840, // SAME + EG_SQ_PGM_RESOURCES_PS = 0x28844, // DIFF 0x28850 + EG_SQ_PGM_RESOURCES_2_PS = 0x28848, // + EG_SQ_PGM_EXPORTS_PS = 0x2884C, // SAME 0x28854 + EG_SQ_PGM_START_VS = 0x2885C, // SAME 0x28858 + EG_SQ_PGM_RESOURCES_VS = 0x28860, // DIFF 0x28868 + EG_SQ_PGM_RESOURCES_2_VS = 0x28864, // + EG_SQ_PGM_START_GS = 0x28874, // SAME 0x2886C + EG_SQ_PGM_RESOURCES_GS = 0x28878, // DIFF 0x2887C + EG_SQ_PGM_RESOURCES_2_GS = 0x2887C, // + EG_SQ_PGM_START_ES = 0x2888C, // SAME 0x28880 + EG_SQ_PGM_RESOURCES_ES = 0x28890, // DIFF + EG_SQ_PGM_RESOURCES_2_ES = 0x28894, // + EG_SQ_PGM_START_FS = 0x288A4, // SAME 0x28894 + EG_SQ_PGM_RESOURCES_FS = 0x288A8, // DIFF 0x288A4 + EG_SQ_PGM_START_HS = 0x288B8, // + EG_SQ_PGM_RESOURCES_HS = 0x288BC, // + EG_SQ_PGM_RESOURCES_2_HS = 0x288C0, // + EG_SQ_PGM_START_LS = 0x288D0, // + EG_SQ_PGM_RESOURCES_LS = 0x288D4, // + EG_SQ_PGM_RESOURCES_2_LS = 0x288D8, // + EG_SQ_THREAD_TRACE_USERDATA = 0x288DC, // + EG_SQ_LDS_ALLOC = 0x288E8, // + EG_SQ_LDS_ALLOC_PS = 0x288EC, // + EG_SQ_VTX_SEMANTIC_CLEAR = 0x288F0, // SAME 0x288E0 + EG_SQ_THREAD_TRACE_CTRL = 0x288F8, // + EG_SQ_ESGS_RING_ITEMSIZE = 0x28900, // SAME 0x288A8 + EG_SQ_GSVS_RING_ITEMSIZE = 0x28904, // SAME 0x288AC + EG_SQ_ESTMP_RING_ITEMSIZE = 0x28908, // SAME 0x288B0 + EG_SQ_GSTMP_RING_ITEMSIZE = 0x2890C, // SAME 0x288B4 + EG_SQ_VSTMP_RING_ITEMSIZE = 0x28910, // SAME 0x288B8 + EG_SQ_PSTMP_RING_ITEMSIZE = 0x28914, // SAME 0x288BC + EG_SQ_GS_VERT_ITEMSIZE = 0x2891C, // SAME 0x288C8 + EG_SQ_GS_VERT_ITEMSIZE_1 = 0x28920, // + EG_SQ_GS_VERT_ITEMSIZE_2 = 0x28924, // + EG_SQ_GS_VERT_ITEMSIZE_3 = 0x28928, // + EG_SQ_GSVS_RING_OFFSET_1 = 0x2892C, // + EG_SQ_GSVS_RING_OFFSET_2 = 0x28930, // + EG_SQ_GSVS_RING_OFFSET_3 = 0x28934, // + EG_SQ_ALU_CONST_CACHE_PS_0 = 0x28940, // SAME + EG_SQ_ALU_CONST_CACHE_PS_1 = 0x28944, // SAME + EG_SQ_ALU_CONST_CACHE_PS_2 = 0x28948, // SAME + EG_SQ_ALU_CONST_CACHE_PS_3 = 0x2894C, // SAME + EG_SQ_ALU_CONST_CACHE_PS_4 = 0x28950, // SAME + EG_SQ_ALU_CONST_CACHE_PS_5 = 0x28954, // SAME + EG_SQ_ALU_CONST_CACHE_PS_6 = 0x28958, // SAME + EG_SQ_ALU_CONST_CACHE_PS_7 = 0x2895C, // SAME + EG_SQ_ALU_CONST_CACHE_PS_8 = 0x28960, // SAME + EG_SQ_ALU_CONST_CACHE_PS_9 = 0x28964, // SAME + EG_SQ_ALU_CONST_CACHE_PS_10 = 0x28968, // SAME + EG_SQ_ALU_CONST_CACHE_PS_11 = 0x2896C, // SAME + EG_SQ_ALU_CONST_CACHE_PS_12 = 0x28970, // SAME + EG_SQ_ALU_CONST_CACHE_PS_13 = 0x28974, // SAME + EG_SQ_ALU_CONST_CACHE_PS_14 = 0x28978, // SAME + EG_SQ_ALU_CONST_CACHE_PS_15 = 0x2897C, // SAME + EG_SQ_ALU_CONST_CACHE_VS_0 = 0x28980, // SAME + EG_SQ_ALU_CONST_CACHE_VS_1 = 0x28984, // SAME + EG_SQ_ALU_CONST_CACHE_VS_2 = 0x28988, // SAME + EG_SQ_ALU_CONST_CACHE_VS_3 = 0x2898C, // SAME + EG_SQ_ALU_CONST_CACHE_VS_4 = 0x28990, // SAME + EG_SQ_ALU_CONST_CACHE_VS_5 = 0x28994, // SAME + EG_SQ_ALU_CONST_CACHE_VS_6 = 0x28998, // SAME + EG_SQ_ALU_CONST_CACHE_VS_7 = 0x2899C, // SAME + EG_SQ_ALU_CONST_CACHE_VS_8 = 0x289A0, // SAME + EG_SQ_ALU_CONST_CACHE_VS_9 = 0x289A4, // SAME + EG_SQ_ALU_CONST_CACHE_VS_10 = 0x289A8, // SAME + EG_SQ_ALU_CONST_CACHE_VS_11 = 0x289AC, // SAME + EG_SQ_ALU_CONST_CACHE_VS_12 = 0x289B0, // SAME + EG_SQ_ALU_CONST_CACHE_VS_13 = 0x289B4, // SAME + EG_SQ_ALU_CONST_CACHE_VS_14 = 0x289B8, // SAME + EG_SQ_ALU_CONST_CACHE_VS_15 = 0x289BC, // SAME + EG_SQ_ALU_CONST_CACHE_GS_0 = 0x289C0, // SAME + EG_SQ_ALU_CONST_CACHE_GS_1 = 0x289C4, // SAME + EG_SQ_ALU_CONST_CACHE_GS_2 = 0x289C8, // SAME + EG_SQ_ALU_CONST_CACHE_GS_3 = 0x289CC, // SAME + EG_SQ_ALU_CONST_CACHE_GS_4 = 0x289D0, // SAME + EG_SQ_ALU_CONST_CACHE_GS_5 = 0x289D4, // SAME + EG_SQ_ALU_CONST_CACHE_GS_6 = 0x289D8, // SAME + EG_SQ_ALU_CONST_CACHE_GS_7 = 0x289DC, // SAME + EG_SQ_ALU_CONST_CACHE_GS_8 = 0x289E0, // SAME + EG_SQ_ALU_CONST_CACHE_GS_9 = 0x289E4, // SAME + EG_SQ_ALU_CONST_CACHE_GS_10 = 0x289E8, // SAME + EG_SQ_ALU_CONST_CACHE_GS_11 = 0x289EC, // SAME + EG_SQ_ALU_CONST_CACHE_GS_12 = 0x289F0, // SAME + EG_SQ_ALU_CONST_CACHE_GS_13 = 0x289F4, // SAME + EG_SQ_ALU_CONST_CACHE_GS_14 = 0x289F8, // SAME + EG_SQ_ALU_CONST_CACHE_GS_15 = 0x289FC, // SAME + EG_SQ_ALU_CONST_CACHE_HS_0 = 0x28F00, // + EG_SQ_ALU_CONST_CACHE_HS_1 = 0x28F04, // + EG_SQ_ALU_CONST_CACHE_HS_2 = 0x28F08, // + EG_SQ_ALU_CONST_CACHE_HS_3 = 0x28F0C, // + EG_SQ_ALU_CONST_CACHE_HS_4 = 0x28F10, // + EG_SQ_ALU_CONST_CACHE_HS_5 = 0x28F14, // + EG_SQ_ALU_CONST_CACHE_HS_6 = 0x28F18, // + EG_SQ_ALU_CONST_CACHE_HS_7 = 0x28F1C, // + EG_SQ_ALU_CONST_CACHE_HS_8 = 0x28F20, // + EG_SQ_ALU_CONST_CACHE_HS_9 = 0x28F24, // + EG_SQ_ALU_CONST_CACHE_HS_10 = 0x28F28, // + EG_SQ_ALU_CONST_CACHE_HS_11 = 0x28F2C, // + EG_SQ_ALU_CONST_CACHE_HS_12 = 0x28F30, // + EG_SQ_ALU_CONST_CACHE_HS_13 = 0x28F34, // + EG_SQ_ALU_CONST_CACHE_HS_14 = 0x28F38, // + EG_SQ_ALU_CONST_CACHE_HS_15 = 0x28F3C, // + EG_SQ_ALU_CONST_CACHE_LS_0 = 0x28F40, // + EG_SQ_ALU_CONST_CACHE_LS_1 = 0x28F44, // + EG_SQ_ALU_CONST_CACHE_LS_2 = 0x28F48, // + EG_SQ_ALU_CONST_CACHE_LS_3 = 0x28F4C, // + EG_SQ_ALU_CONST_CACHE_LS_4 = 0x28F50, // + EG_SQ_ALU_CONST_CACHE_LS_5 = 0x28F54, // + EG_SQ_ALU_CONST_CACHE_LS_6 = 0x28F58, // + EG_SQ_ALU_CONST_CACHE_LS_7 = 0x28F5C, // + EG_SQ_ALU_CONST_CACHE_LS_8 = 0x28F60, // + EG_SQ_ALU_CONST_CACHE_LS_9 = 0x28F64, // + EG_SQ_ALU_CONST_CACHE_LS_10 = 0x28F68, // + EG_SQ_ALU_CONST_CACHE_LS_11 = 0x28F6C, // + EG_SQ_ALU_CONST_CACHE_LS_12 = 0x28F70, // + EG_SQ_ALU_CONST_CACHE_LS_13 = 0x28F74, // + EG_SQ_ALU_CONST_CACHE_LS_14 = 0x28F78, // + EG_SQ_ALU_CONST_CACHE_LS_15 = 0x28F7C, // EG_SQ_ALU_CONST_BUFFER_SIZE_PS_0 = 0x28140, - EG_SQ_ALU_CONST_BUFFER_SIZE_HS_0 = 0x28F80, // - EG_SQ_ALU_CONST_BUFFER_SIZE_HS_1 = 0x28F84, // - EG_SQ_ALU_CONST_BUFFER_SIZE_HS_2 = 0x28F88, // - EG_SQ_ALU_CONST_BUFFER_SIZE_HS_3 = 0x28F8C, // - EG_SQ_ALU_CONST_BUFFER_SIZE_HS_4 = 0x28F90, // - EG_SQ_ALU_CONST_BUFFER_SIZE_HS_5 = 0x28F94, // - EG_SQ_ALU_CONST_BUFFER_SIZE_HS_6 = 0x28F98, // - EG_SQ_ALU_CONST_BUFFER_SIZE_HS_7 = 0x28F9C, // - EG_SQ_ALU_CONST_BUFFER_SIZE_HS_8 = 0x28FA0, // - EG_SQ_ALU_CONST_BUFFER_SIZE_HS_9 = 0x28FA4, // - EG_SQ_ALU_CONST_BUFFER_SIZE_HS_10 = 0x28FA8, // - EG_SQ_ALU_CONST_BUFFER_SIZE_HS_11 = 0x28FAC, // - EG_SQ_ALU_CONST_BUFFER_SIZE_HS_12 = 0x28FB0, // - EG_SQ_ALU_CONST_BUFFER_SIZE_HS_13 = 0x28FB4, // - EG_SQ_ALU_CONST_BUFFER_SIZE_HS_14 = 0x28FB8, // - EG_SQ_ALU_CONST_BUFFER_SIZE_HS_15 = 0x28FBC, // - EG_SQ_ALU_CONST_BUFFER_SIZE_LS_0 = 0x28FC0, // - EG_SQ_ALU_CONST_BUFFER_SIZE_LS_1 = 0x28FC4, // - EG_SQ_ALU_CONST_BUFFER_SIZE_LS_2 = 0x28FC8, // - EG_SQ_ALU_CONST_BUFFER_SIZE_LS_3 = 0x28FCC, // - EG_SQ_ALU_CONST_BUFFER_SIZE_LS_4 = 0x28FD0, // - EG_SQ_ALU_CONST_BUFFER_SIZE_LS_5 = 0x28FD4, // - EG_SQ_ALU_CONST_BUFFER_SIZE_LS_6 = 0x28FD8, // - EG_SQ_ALU_CONST_BUFFER_SIZE_LS_7 = 0x28FDC, // - EG_SQ_ALU_CONST_BUFFER_SIZE_LS_8 = 0x28FE0, // - EG_SQ_ALU_CONST_BUFFER_SIZE_LS_9 = 0x28FE4, // - EG_SQ_ALU_CONST_BUFFER_SIZE_LS_10 = 0x28FE8, // - EG_SQ_ALU_CONST_BUFFER_SIZE_LS_11 = 0x28FEC, // - EG_SQ_ALU_CONST_BUFFER_SIZE_LS_12 = 0x28FF0, // - EG_SQ_ALU_CONST_BUFFER_SIZE_LS_13 = 0x28FF4, // - EG_SQ_ALU_CONST_BUFFER_SIZE_LS_14 = 0x28FF8, // - EG_SQ_ALU_CONST_BUFFER_SIZE_LS_15 = 0x28FFC, // + EG_SQ_ALU_CONST_BUFFER_SIZE_HS_0 = 0x28F80, // + EG_SQ_ALU_CONST_BUFFER_SIZE_HS_1 = 0x28F84, // + EG_SQ_ALU_CONST_BUFFER_SIZE_HS_2 = 0x28F88, // + EG_SQ_ALU_CONST_BUFFER_SIZE_HS_3 = 0x28F8C, // + EG_SQ_ALU_CONST_BUFFER_SIZE_HS_4 = 0x28F90, // + EG_SQ_ALU_CONST_BUFFER_SIZE_HS_5 = 0x28F94, // + EG_SQ_ALU_CONST_BUFFER_SIZE_HS_6 = 0x28F98, // + EG_SQ_ALU_CONST_BUFFER_SIZE_HS_7 = 0x28F9C, // + EG_SQ_ALU_CONST_BUFFER_SIZE_HS_8 = 0x28FA0, // + EG_SQ_ALU_CONST_BUFFER_SIZE_HS_9 = 0x28FA4, // + EG_SQ_ALU_CONST_BUFFER_SIZE_HS_10 = 0x28FA8, // + EG_SQ_ALU_CONST_BUFFER_SIZE_HS_11 = 0x28FAC, // + EG_SQ_ALU_CONST_BUFFER_SIZE_HS_12 = 0x28FB0, // + EG_SQ_ALU_CONST_BUFFER_SIZE_HS_13 = 0x28FB4, // + EG_SQ_ALU_CONST_BUFFER_SIZE_HS_14 = 0x28FB8, // + EG_SQ_ALU_CONST_BUFFER_SIZE_HS_15 = 0x28FBC, // + EG_SQ_ALU_CONST_BUFFER_SIZE_LS_0 = 0x28FC0, // + EG_SQ_ALU_CONST_BUFFER_SIZE_LS_1 = 0x28FC4, // + EG_SQ_ALU_CONST_BUFFER_SIZE_LS_2 = 0x28FC8, // + EG_SQ_ALU_CONST_BUFFER_SIZE_LS_3 = 0x28FCC, // + EG_SQ_ALU_CONST_BUFFER_SIZE_LS_4 = 0x28FD0, // + EG_SQ_ALU_CONST_BUFFER_SIZE_LS_5 = 0x28FD4, // + EG_SQ_ALU_CONST_BUFFER_SIZE_LS_6 = 0x28FD8, // + EG_SQ_ALU_CONST_BUFFER_SIZE_LS_7 = 0x28FDC, // + EG_SQ_ALU_CONST_BUFFER_SIZE_LS_8 = 0x28FE0, // + EG_SQ_ALU_CONST_BUFFER_SIZE_LS_9 = 0x28FE4, // + EG_SQ_ALU_CONST_BUFFER_SIZE_LS_10 = 0x28FE8, // + EG_SQ_ALU_CONST_BUFFER_SIZE_LS_11 = 0x28FEC, // + EG_SQ_ALU_CONST_BUFFER_SIZE_LS_12 = 0x28FF0, // + EG_SQ_ALU_CONST_BUFFER_SIZE_LS_13 = 0x28FF4, // + EG_SQ_ALU_CONST_BUFFER_SIZE_LS_14 = 0x28FF8, // + EG_SQ_ALU_CONST_BUFFER_SIZE_LS_15 = 0x28FFC, // -/* Registers from SPI block: */ - EG_SPI_VS_OUT_ID_0 = 0x2861C, // SAME 0x28614 - EG_SPI_VS_OUT_ID_1 = 0x28620, // SAME 0x28618 - EG_SPI_VS_OUT_ID_2 = 0x28624, // SAME 0x2861C - EG_SPI_VS_OUT_ID_3 = 0x28628, // SAME 0x28620 - EG_SPI_VS_OUT_ID_4 = 0x2862C, // SAME 0x28624 - EG_SPI_VS_OUT_ID_5 = 0x28630, // SAME 0x28628 - EG_SPI_VS_OUT_ID_6 = 0x28634, // SAME 0x2862C - EG_SPI_VS_OUT_ID_7 = 0x28638, // SAME 0x28630 - EG_SPI_VS_OUT_ID_8 = 0x2863C, // SAME 0x28634 - EG_SPI_VS_OUT_ID_9 = 0x28640, // SAME 0x28638 - EG_SPI_PS_INPUT_CNTL_0 = 0x28644, // SAME - EG_SPI_PS_INPUT_CNTL_1 = 0x28648, // SAME - EG_SPI_PS_INPUT_CNTL_2 = 0x2864C, // SAME - EG_SPI_PS_INPUT_CNTL_3 = 0x28650, // SAME - EG_SPI_PS_INPUT_CNTL_4 = 0x28654, // SAME - EG_SPI_PS_INPUT_CNTL_5 = 0x28658, // SAME - EG_SPI_PS_INPUT_CNTL_6 = 0x2865C, // SAME - EG_SPI_PS_INPUT_CNTL_7 = 0x28660, // SAME - EG_SPI_PS_INPUT_CNTL_8 = 0x28664, // SAME - EG_SPI_PS_INPUT_CNTL_9 = 0x28668, // SAME - EG_SPI_PS_INPUT_CNTL_10 = 0x2866C, // SAME - EG_SPI_PS_INPUT_CNTL_11 = 0x28670, // SAME - EG_SPI_PS_INPUT_CNTL_12 = 0x28674, // SAME - EG_SPI_PS_INPUT_CNTL_13 = 0x28678, // SAME - EG_SPI_PS_INPUT_CNTL_14 = 0x2867C, // SAME - EG_SPI_PS_INPUT_CNTL_15 = 0x28680, // SAME - EG_SPI_PS_INPUT_CNTL_16 = 0x28684, // SAME - EG_SPI_PS_INPUT_CNTL_17 = 0x28688, // SAME - EG_SPI_PS_INPUT_CNTL_18 = 0x2868C, // SAME - EG_SPI_PS_INPUT_CNTL_19 = 0x28690, // SAME - EG_SPI_PS_INPUT_CNTL_20 = 0x28694, // SAME - EG_SPI_PS_INPUT_CNTL_21 = 0x28698, // SAME - EG_SPI_PS_INPUT_CNTL_22 = 0x2869C, // SAME - EG_SPI_PS_INPUT_CNTL_23 = 0x286A0, // SAME - EG_SPI_PS_INPUT_CNTL_24 = 0x286A4, // SAME - EG_SPI_PS_INPUT_CNTL_25 = 0x286A8, // SAME - EG_SPI_PS_INPUT_CNTL_26 = 0x286AC, // SAME - EG_SPI_PS_INPUT_CNTL_27 = 0x286B0, // SAME - EG_SPI_PS_INPUT_CNTL_28 = 0x286B4, // SAME - EG_SPI_PS_INPUT_CNTL_29 = 0x286B8, // SAME - EG_SPI_PS_INPUT_CNTL_30 = 0x286BC, // SAME - EG_SPI_PS_INPUT_CNTL_31 = 0x286C0, // SAME - EG_SPI_VS_OUT_CONFIG = 0x286C4, // SAME - EG_SPI_THREAD_GROUPING = 0x286C8, // DIFF - EG_SPI_PS_IN_CONTROL_0 = 0x286CC, // SAME - EG_SPI_PS_IN_CONTROL_1 = 0x286D0, // SAME - EG_SPI_INTERP_CONTROL_0 = 0x286D4, // SAME - EG_SPI_INPUT_Z = 0x286D8, // SAME - EG_SPI_FOG_CNTL = 0x286DC, // SAME - EG_SPI_BARYC_CNTL = 0x286E0, // - EG_SPI_PS_IN_CONTROL_2 = 0x286E4, // - EG_SPI_COMPUTE_INPUT_CNTL = 0x286E8, // - EG_SPI_COMPUTE_NUM_THREAD_X = 0x286EC, // - EG_SPI_COMPUTE_NUM_THREAD_Y = 0x286F0, // - EG_SPI_COMPUTE_NUM_THREAD_Z = 0x286F4, // +/* Registers from SPI block: */ + EG_SPI_VS_OUT_ID_0 = 0x2861C, // SAME 0x28614 + EG_SPI_VS_OUT_ID_1 = 0x28620, // SAME 0x28618 + EG_SPI_VS_OUT_ID_2 = 0x28624, // SAME 0x2861C + EG_SPI_VS_OUT_ID_3 = 0x28628, // SAME 0x28620 + EG_SPI_VS_OUT_ID_4 = 0x2862C, // SAME 0x28624 + EG_SPI_VS_OUT_ID_5 = 0x28630, // SAME 0x28628 + EG_SPI_VS_OUT_ID_6 = 0x28634, // SAME 0x2862C + EG_SPI_VS_OUT_ID_7 = 0x28638, // SAME 0x28630 + EG_SPI_VS_OUT_ID_8 = 0x2863C, // SAME 0x28634 + EG_SPI_VS_OUT_ID_9 = 0x28640, // SAME 0x28638 + EG_SPI_PS_INPUT_CNTL_0 = 0x28644, // SAME + EG_SPI_PS_INPUT_CNTL_1 = 0x28648, // SAME + EG_SPI_PS_INPUT_CNTL_2 = 0x2864C, // SAME + EG_SPI_PS_INPUT_CNTL_3 = 0x28650, // SAME + EG_SPI_PS_INPUT_CNTL_4 = 0x28654, // SAME + EG_SPI_PS_INPUT_CNTL_5 = 0x28658, // SAME + EG_SPI_PS_INPUT_CNTL_6 = 0x2865C, // SAME + EG_SPI_PS_INPUT_CNTL_7 = 0x28660, // SAME + EG_SPI_PS_INPUT_CNTL_8 = 0x28664, // SAME + EG_SPI_PS_INPUT_CNTL_9 = 0x28668, // SAME + EG_SPI_PS_INPUT_CNTL_10 = 0x2866C, // SAME + EG_SPI_PS_INPUT_CNTL_11 = 0x28670, // SAME + EG_SPI_PS_INPUT_CNTL_12 = 0x28674, // SAME + EG_SPI_PS_INPUT_CNTL_13 = 0x28678, // SAME + EG_SPI_PS_INPUT_CNTL_14 = 0x2867C, // SAME + EG_SPI_PS_INPUT_CNTL_15 = 0x28680, // SAME + EG_SPI_PS_INPUT_CNTL_16 = 0x28684, // SAME + EG_SPI_PS_INPUT_CNTL_17 = 0x28688, // SAME + EG_SPI_PS_INPUT_CNTL_18 = 0x2868C, // SAME + EG_SPI_PS_INPUT_CNTL_19 = 0x28690, // SAME + EG_SPI_PS_INPUT_CNTL_20 = 0x28694, // SAME + EG_SPI_PS_INPUT_CNTL_21 = 0x28698, // SAME + EG_SPI_PS_INPUT_CNTL_22 = 0x2869C, // SAME + EG_SPI_PS_INPUT_CNTL_23 = 0x286A0, // SAME + EG_SPI_PS_INPUT_CNTL_24 = 0x286A4, // SAME + EG_SPI_PS_INPUT_CNTL_25 = 0x286A8, // SAME + EG_SPI_PS_INPUT_CNTL_26 = 0x286AC, // SAME + EG_SPI_PS_INPUT_CNTL_27 = 0x286B0, // SAME + EG_SPI_PS_INPUT_CNTL_28 = 0x286B4, // SAME + EG_SPI_PS_INPUT_CNTL_29 = 0x286B8, // SAME + EG_SPI_PS_INPUT_CNTL_30 = 0x286BC, // SAME + EG_SPI_PS_INPUT_CNTL_31 = 0x286C0, // SAME + EG_SPI_VS_OUT_CONFIG = 0x286C4, // SAME + EG_SPI_THREAD_GROUPING = 0x286C8, // DIFF + EG_SPI_PS_IN_CONTROL_0 = 0x286CC, // SAME + EG_SPI_PS_IN_CONTROL_1 = 0x286D0, // SAME + EG_SPI_INTERP_CONTROL_0 = 0x286D4, // SAME + EG_SPI_INPUT_Z = 0x286D8, // SAME + EG_SPI_FOG_CNTL = 0x286DC, // SAME + EG_SPI_BARYC_CNTL = 0x286E0, // + EG_SPI_PS_IN_CONTROL_2 = 0x286E4, // + EG_SPI_COMPUTE_INPUT_CNTL = 0x286E8, // + EG_SPI_COMPUTE_NUM_THREAD_X = 0x286EC, // + EG_SPI_COMPUTE_NUM_THREAD_Y = 0x286F0, // + EG_SPI_COMPUTE_NUM_THREAD_Z = 0x286F4, // -/* Registers from SX block: */ - EG_SX_MISC = 0x28350, // SAME - EG_SX_SURFACE_SYNC = 0x28354, // DIFF - EG_SX_ALPHA_TEST_CONTROL = 0x28410, // SAME - EG_SX_ALPHA_REF = 0x28438, // SAME +/* Registers from SX block: */ + EG_SX_MISC = 0x28350, // SAME + EG_SX_SURFACE_SYNC = 0x28354, // DIFF + EG_SX_ALPHA_TEST_CONTROL = 0x28410, // SAME + EG_SX_ALPHA_REF = 0x28438, // SAME -/* Registers from DB block: */ - EG_DB_RENDER_CONTROL = 0x28000, // DIFF 0x28D0C - EG_DB_COUNT_CONTROL = 0x28004, // - EG_DB_DEPTH_VIEW = 0x28008, // DIFF 0x28004 - EG_DB_RENDER_OVERRIDE = 0x2800C, // DIFF 0x28D10 - EG_DB_RENDER_OVERRIDE2 = 0x28010, // - EG_DB_HTILE_DATA_BASE = 0x28014, // SAME +/* Registers from DB block: */ + EG_DB_RENDER_CONTROL = 0x28000, // DIFF 0x28D0C + EG_DB_COUNT_CONTROL = 0x28004, // + EG_DB_DEPTH_VIEW = 0x28008, // DIFF 0x28004 + EG_DB_RENDER_OVERRIDE = 0x2800C, // DIFF 0x28D10 + EG_DB_RENDER_OVERRIDE2 = 0x28010, // + EG_DB_HTILE_DATA_BASE = 0x28014, // SAME - EG_DB_STENCIL_CLEAR = 0x28028, // SAME - EG_DB_DEPTH_CLEAR = 0x2802C, // SAME + EG_DB_STENCIL_CLEAR = 0x28028, // SAME + EG_DB_DEPTH_CLEAR = 0x2802C, // SAME - EG_DB_Z_INFO = 0x28040, // - EG_DB_STENCIL_INFO = 0x28044, // - EG_DB_Z_READ_BASE = 0x28048, // - EG_DB_STENCIL_READ_BASE = 0x2804C, // - EG_DB_Z_WRITE_BASE = 0x28050, // - EG_DB_STENCIL_WRITE_BASE = 0x28054, // - EG_DB_DEPTH_SIZE = 0x28058, // DIFF 0x28000 - EG_DB_DEPTH_SLICE = 0x2805C, // + EG_DB_Z_INFO = 0x28040, // + EG_DB_STENCIL_INFO = 0x28044, // + EG_DB_Z_READ_BASE = 0x28048, // + EG_DB_STENCIL_READ_BASE = 0x2804C, // + EG_DB_Z_WRITE_BASE = 0x28050, // + EG_DB_STENCIL_WRITE_BASE = 0x28054, // + EG_DB_DEPTH_SIZE = 0x28058, // DIFF 0x28000 + EG_DB_DEPTH_SLICE = 0x2805C, // - EG_DB_STENCILREFMASK = 0x28430, // SAME - EG_DB_STENCILREFMASK_BF = 0x28434, // SAME - EG_DB_DEPTH_CONTROL = 0x28800, // SAME - EG_DB_SHADER_CONTROL = 0x2880C, // DIFF - EG_DB_HTILE_SURFACE = 0x28ABC, // SAME 0x28D24 - EG_DB_SRESULTS_COMPARE_STATE0 = 0x28AC0, // SAME 0x28D28 - EG_DB_SRESULTS_COMPARE_STATE1 = 0x28AC4, // SAME 0x28D2C - EG_DB_PRELOAD_CONTROL = 0x28AC8, // SAME 0x28D30 - EG_DB_ALPHA_TO_MASK = 0x28B70, // SAME 0x28D44 + EG_DB_STENCILREFMASK = 0x28430, // SAME + EG_DB_STENCILREFMASK_BF = 0x28434, // SAME + EG_DB_DEPTH_CONTROL = 0x28800, // SAME + EG_DB_SHADER_CONTROL = 0x2880C, // DIFF + EG_DB_HTILE_SURFACE = 0x28ABC, // SAME 0x28D24 + EG_DB_SRESULTS_COMPARE_STATE0 = 0x28AC0, // SAME 0x28D28 + EG_DB_SRESULTS_COMPARE_STATE1 = 0x28AC4, // SAME 0x28D2C + EG_DB_PRELOAD_CONTROL = 0x28AC8, // SAME 0x28D30 + EG_DB_ALPHA_TO_MASK = 0x28B70, // SAME 0x28D44 -/* Registers from CB block: */ - EG_CB_TARGET_MASK = 0x28238, // SAME - EG_CB_SHADER_MASK = 0x2823C, // SAME - EG_CB_BLEND_RED = 0x28414, // SAME - EG_CB_BLEND_GREEN = 0x28418, // SAME - EG_CB_BLEND_BLUE = 0x2841C, // SAME - EG_CB_BLEND_ALPHA = 0x28420, // SAME - EG_CB_BLEND0_CONTROL = 0x28780, // DIFF - EG_CB_BLEND1_CONTROL = 0x28784, // DIFF - EG_CB_BLEND2_CONTROL = 0x28788, // DIFF - EG_CB_BLEND3_CONTROL = 0x2878C, // DIFF - EG_CB_BLEND4_CONTROL = 0x28790, // DIFF - EG_CB_BLEND5_CONTROL = 0x28794, // DIFF - EG_CB_BLEND6_CONTROL = 0x28798, // DIFF - EG_CB_BLEND7_CONTROL = 0x2879C, // DIFF - EG_CB_COLOR_CONTROL = 0x28808, // DIFF - EG_CB_IMMED0_BASE = 0x28B9C, // - EG_CB_IMMED1_BASE = 0x28BA0, // - EG_CB_IMMED2_BASE = 0x28BA4, // - EG_CB_IMMED3_BASE = 0x28BA8, // - EG_CB_IMMED4_BASE = 0x28BAC, // - EG_CB_IMMED5_BASE = 0x28BB0, // - EG_CB_IMMED6_BASE = 0x28BB4, // - EG_CB_IMMED7_BASE = 0x28BB8, // - EG_CB_IMMED8_BASE = 0x28BBC, // - EG_CB_IMMED9_BASE = 0x28BC0, // - EG_CB_IMMED10_BASE = 0x28BC4, // - EG_CB_IMMED11_BASE = 0x28BC8, // - EG_CB_CLRCMP_CONTROL = 0x28C40, // SAME 0x28C30 - EG_CB_CLRCMP_SRC = 0x28C44, // SAME 0x28C34 - EG_CB_CLRCMP_DST = 0x28C48, // SAME 0x28C38 - EG_CB_CLRCMP_MSK = 0x28C4C, // SAME 0x28C3C - EG_CB_COLOR0_BASE = 0x28C60, // SAME 0x28040 - EG_CB_COLOR0_PITCH = 0x28C64, // - EG_CB_COLOR0_SLICE = 0x28C68, // - EG_CB_COLOR0_VIEW = 0x28C6C, // SAME 0x28080 - EG_CB_COLOR0_INFO = 0x28C70, // DIFF 0x280A0 - EG_CB_COLOR0_ATTRIB = 0x28C74, // - EG_CB_COLOR0_DIM = 0x28C78, // - EG_CB_COLOR0_CMASK = 0x28C7C, // - EG_CB_COLOR0_CMASK_SLICE = 0x28C80, // - EG_CB_COLOR0_FMASK = 0x28C84, // - EG_CB_COLOR0_FMASK_SLICE = 0x28C88, // - EG_CB_COLOR0_CLEAR_WORD0 = 0x28C8C, // - EG_CB_COLOR0_CLEAR_WORD1 = 0x28C90, // - EG_CB_COLOR0_CLEAR_WORD2 = 0x28C94, // - EG_CB_COLOR0_CLEAR_WORD3 = 0x28C98, // - EG_CB_COLOR1_BASE = 0x28C9C, // SAME 0x28044 - EG_CB_COLOR1_PITCH = 0x28CA0, // - EG_CB_COLOR1_SLICE = 0x28CA4, // - EG_CB_COLOR1_VIEW = 0x28CA8, // SAME 0x28084 - EG_CB_COLOR1_INFO = 0x28CAC, // DIFF 0x280A4 - EG_CB_COLOR1_ATTRIB = 0x28CB0, // - EG_CB_COLOR1_DIM = 0x28CB4, // - EG_CB_COLOR1_CMASK = 0x28CB8, // - EG_CB_COLOR1_CMASK_SLICE = 0x28CBC, // - EG_CB_COLOR1_FMASK = 0x28CC0, // - EG_CB_COLOR1_FMASK_SLICE = 0x28CC4, // - EG_CB_COLOR1_CLEAR_WORD0 = 0x28CC8, // - EG_CB_COLOR1_CLEAR_WORD1 = 0x28CCC, // - EG_CB_COLOR1_CLEAR_WORD2 = 0x28CD0, // - EG_CB_COLOR1_CLEAR_WORD3 = 0x28CD4, // - EG_CB_COLOR2_BASE = 0x28CD8, // SAME 0x28048 - EG_CB_COLOR2_PITCH = 0x28CDC, // - EG_CB_COLOR2_SLICE = 0x28CE0, // - EG_CB_COLOR2_VIEW = 0x28CE4, // SAME 0x28088 - EG_CB_COLOR2_INFO = 0x28CE8, // DIFF 0x280A8 - EG_CB_COLOR2_ATTRIB = 0x28CEC, // - EG_CB_COLOR2_DIM = 0x28CF0, // - EG_CB_COLOR2_CMASK = 0x28CF4, // - EG_CB_COLOR2_CMASK_SLICE = 0x28CF8, // - EG_CB_COLOR2_FMASK = 0x28CFC, // - EG_CB_COLOR2_FMASK_SLICE = 0x28D00, // - EG_CB_COLOR2_CLEAR_WORD0 = 0x28D04, // - EG_CB_COLOR2_CLEAR_WORD1 = 0x28D08, // - EG_CB_COLOR2_CLEAR_WORD2 = 0x28D0C, // - EG_CB_COLOR2_CLEAR_WORD3 = 0x28D10, // - EG_CB_COLOR3_BASE = 0x28D14, // SAME 0x2804C - EG_CB_COLOR3_PITCH = 0x28D18, // - EG_CB_COLOR3_SLICE = 0x28D1C, // - EG_CB_COLOR3_VIEW = 0x28D20, // SAME 0x2808C - EG_CB_COLOR3_INFO = 0x28D24, // DIFF 0x280AC - EG_CB_COLOR3_ATTRIB = 0x28D28, // - EG_CB_COLOR3_DIM = 0x28D2C, // - EG_CB_COLOR3_CMASK = 0x28D30, // - EG_CB_COLOR3_CMASK_SLICE = 0x28D34, // - EG_CB_COLOR3_FMASK = 0x28D38, // - EG_CB_COLOR3_FMASK_SLICE = 0x28D3C, // - EG_CB_COLOR3_CLEAR_WORD0 = 0x28D40, // - EG_CB_COLOR3_CLEAR_WORD1 = 0x28D44, // - EG_CB_COLOR3_CLEAR_WORD2 = 0x28D48, // - EG_CB_COLOR3_CLEAR_WORD3 = 0x28D4C, // - EG_CB_COLOR4_BASE = 0x28D50, // SAME 0x28050 - EG_CB_COLOR4_PITCH = 0x28D54, // - EG_CB_COLOR4_SLICE = 0x28D58, // - EG_CB_COLOR4_VIEW = 0x28D5C, // SAME 0x28090 - EG_CB_COLOR4_INFO = 0x28D60, // DIFF 0x280B0 - EG_CB_COLOR4_ATTRIB = 0x28D64, // - EG_CB_COLOR4_DIM = 0x28D68, // - EG_CB_COLOR4_CMASK = 0x28D6C, // - EG_CB_COLOR4_CMASK_SLICE = 0x28D70, // - EG_CB_COLOR4_FMASK = 0x28D74, // - EG_CB_COLOR4_FMASK_SLICE = 0x28D78, // - EG_CB_COLOR4_CLEAR_WORD0 = 0x28D7C, // - EG_CB_COLOR4_CLEAR_WORD1 = 0x28D80, // - EG_CB_COLOR4_CLEAR_WORD2 = 0x28D84, // - EG_CB_COLOR4_CLEAR_WORD3 = 0x28D88, // - EG_CB_COLOR5_BASE = 0x28D8C, // SAME 0x28054 - EG_CB_COLOR5_PITCH = 0x28D90, // - EG_CB_COLOR5_SLICE = 0x28D94, // - EG_CB_COLOR5_VIEW = 0x28D98, // SAME 0x28094 - EG_CB_COLOR5_INFO = 0x28D9C, // DIFF 0x280B4 - EG_CB_COLOR5_ATTRIB = 0x28DA0, // - EG_CB_COLOR5_DIM = 0x28DA4, // - EG_CB_COLOR5_CMASK = 0x28DA8, // - EG_CB_COLOR5_CMASK_SLICE = 0x28DAC, // - EG_CB_COLOR5_FMASK = 0x28DB0, // - EG_CB_COLOR5_FMASK_SLICE = 0x28DB4, // - EG_CB_COLOR5_CLEAR_WORD0 = 0x28DB8, // - EG_CB_COLOR5_CLEAR_WORD1 = 0x28DBC, // - EG_CB_COLOR5_CLEAR_WORD2 = 0x28DC0, // - EG_CB_COLOR5_CLEAR_WORD3 = 0x28DC4, // - EG_CB_COLOR6_BASE = 0x28DC8, // SAME 0x28058 - EG_CB_COLOR6_PITCH = 0x28DCC, // - EG_CB_COLOR6_SLICE = 0x28DD0, // - EG_CB_COLOR6_VIEW = 0x28DD4, // SAME 0x28098 - EG_CB_COLOR6_INFO = 0x28DD8, // DIFF 0x280B8 +/* Registers from CB block: */ + EG_CB_TARGET_MASK = 0x28238, // SAME + EG_CB_SHADER_MASK = 0x2823C, // SAME + EG_CB_BLEND_RED = 0x28414, // SAME + EG_CB_BLEND_GREEN = 0x28418, // SAME + EG_CB_BLEND_BLUE = 0x2841C, // SAME + EG_CB_BLEND_ALPHA = 0x28420, // SAME + EG_CB_BLEND0_CONTROL = 0x28780, // DIFF + EG_CB_BLEND1_CONTROL = 0x28784, // DIFF + EG_CB_BLEND2_CONTROL = 0x28788, // DIFF + EG_CB_BLEND3_CONTROL = 0x2878C, // DIFF + EG_CB_BLEND4_CONTROL = 0x28790, // DIFF + EG_CB_BLEND5_CONTROL = 0x28794, // DIFF + EG_CB_BLEND6_CONTROL = 0x28798, // DIFF + EG_CB_BLEND7_CONTROL = 0x2879C, // DIFF + EG_CB_COLOR_CONTROL = 0x28808, // DIFF + EG_CB_IMMED0_BASE = 0x28B9C, // + EG_CB_IMMED1_BASE = 0x28BA0, // + EG_CB_IMMED2_BASE = 0x28BA4, // + EG_CB_IMMED3_BASE = 0x28BA8, // + EG_CB_IMMED4_BASE = 0x28BAC, // + EG_CB_IMMED5_BASE = 0x28BB0, // + EG_CB_IMMED6_BASE = 0x28BB4, // + EG_CB_IMMED7_BASE = 0x28BB8, // + EG_CB_IMMED8_BASE = 0x28BBC, // + EG_CB_IMMED9_BASE = 0x28BC0, // + EG_CB_IMMED10_BASE = 0x28BC4, // + EG_CB_IMMED11_BASE = 0x28BC8, // + EG_CB_CLRCMP_CONTROL = 0x28C40, // SAME 0x28C30 + EG_CB_CLRCMP_SRC = 0x28C44, // SAME 0x28C34 + EG_CB_CLRCMP_DST = 0x28C48, // SAME 0x28C38 + EG_CB_CLRCMP_MSK = 0x28C4C, // SAME 0x28C3C + EG_CB_COLOR0_BASE = 0x28C60, // SAME 0x28040 + EG_CB_COLOR0_PITCH = 0x28C64, // + EG_CB_COLOR0_SLICE = 0x28C68, // + EG_CB_COLOR0_VIEW = 0x28C6C, // SAME 0x28080 + EG_CB_COLOR0_INFO = 0x28C70, // DIFF 0x280A0 + EG_CB_COLOR0_ATTRIB = 0x28C74, // + EG_CB_COLOR0_DIM = 0x28C78, // + EG_CB_COLOR0_CMASK = 0x28C7C, // + EG_CB_COLOR0_CMASK_SLICE = 0x28C80, // + EG_CB_COLOR0_FMASK = 0x28C84, // + EG_CB_COLOR0_FMASK_SLICE = 0x28C88, // + EG_CB_COLOR0_CLEAR_WORD0 = 0x28C8C, // + EG_CB_COLOR0_CLEAR_WORD1 = 0x28C90, // + EG_CB_COLOR0_CLEAR_WORD2 = 0x28C94, // + EG_CB_COLOR0_CLEAR_WORD3 = 0x28C98, // + EG_CB_COLOR1_BASE = 0x28C9C, // SAME 0x28044 + EG_CB_COLOR1_PITCH = 0x28CA0, // + EG_CB_COLOR1_SLICE = 0x28CA4, // + EG_CB_COLOR1_VIEW = 0x28CA8, // SAME 0x28084 + EG_CB_COLOR1_INFO = 0x28CAC, // DIFF 0x280A4 + EG_CB_COLOR1_ATTRIB = 0x28CB0, // + EG_CB_COLOR1_DIM = 0x28CB4, // + EG_CB_COLOR1_CMASK = 0x28CB8, // + EG_CB_COLOR1_CMASK_SLICE = 0x28CBC, // + EG_CB_COLOR1_FMASK = 0x28CC0, // + EG_CB_COLOR1_FMASK_SLICE = 0x28CC4, // + EG_CB_COLOR1_CLEAR_WORD0 = 0x28CC8, // + EG_CB_COLOR1_CLEAR_WORD1 = 0x28CCC, // + EG_CB_COLOR1_CLEAR_WORD2 = 0x28CD0, // + EG_CB_COLOR1_CLEAR_WORD3 = 0x28CD4, // + EG_CB_COLOR2_BASE = 0x28CD8, // SAME 0x28048 + EG_CB_COLOR2_PITCH = 0x28CDC, // + EG_CB_COLOR2_SLICE = 0x28CE0, // + EG_CB_COLOR2_VIEW = 0x28CE4, // SAME 0x28088 + EG_CB_COLOR2_INFO = 0x28CE8, // DIFF 0x280A8 + EG_CB_COLOR2_ATTRIB = 0x28CEC, // + EG_CB_COLOR2_DIM = 0x28CF0, // + EG_CB_COLOR2_CMASK = 0x28CF4, // + EG_CB_COLOR2_CMASK_SLICE = 0x28CF8, // + EG_CB_COLOR2_FMASK = 0x28CFC, // + EG_CB_COLOR2_FMASK_SLICE = 0x28D00, // + EG_CB_COLOR2_CLEAR_WORD0 = 0x28D04, // + EG_CB_COLOR2_CLEAR_WORD1 = 0x28D08, // + EG_CB_COLOR2_CLEAR_WORD2 = 0x28D0C, // + EG_CB_COLOR2_CLEAR_WORD3 = 0x28D10, // + EG_CB_COLOR3_BASE = 0x28D14, // SAME 0x2804C + EG_CB_COLOR3_PITCH = 0x28D18, // + EG_CB_COLOR3_SLICE = 0x28D1C, // + EG_CB_COLOR3_VIEW = 0x28D20, // SAME 0x2808C + EG_CB_COLOR3_INFO = 0x28D24, // DIFF 0x280AC + EG_CB_COLOR3_ATTRIB = 0x28D28, // + EG_CB_COLOR3_DIM = 0x28D2C, // + EG_CB_COLOR3_CMASK = 0x28D30, // + EG_CB_COLOR3_CMASK_SLICE = 0x28D34, // + EG_CB_COLOR3_FMASK = 0x28D38, // + EG_CB_COLOR3_FMASK_SLICE = 0x28D3C, // + EG_CB_COLOR3_CLEAR_WORD0 = 0x28D40, // + EG_CB_COLOR3_CLEAR_WORD1 = 0x28D44, // + EG_CB_COLOR3_CLEAR_WORD2 = 0x28D48, // + EG_CB_COLOR3_CLEAR_WORD3 = 0x28D4C, // + EG_CB_COLOR4_BASE = 0x28D50, // SAME 0x28050 + EG_CB_COLOR4_PITCH = 0x28D54, // + EG_CB_COLOR4_SLICE = 0x28D58, // + EG_CB_COLOR4_VIEW = 0x28D5C, // SAME 0x28090 + EG_CB_COLOR4_INFO = 0x28D60, // DIFF 0x280B0 + EG_CB_COLOR4_ATTRIB = 0x28D64, // + EG_CB_COLOR4_DIM = 0x28D68, // + EG_CB_COLOR4_CMASK = 0x28D6C, // + EG_CB_COLOR4_CMASK_SLICE = 0x28D70, // + EG_CB_COLOR4_FMASK = 0x28D74, // + EG_CB_COLOR4_FMASK_SLICE = 0x28D78, // + EG_CB_COLOR4_CLEAR_WORD0 = 0x28D7C, // + EG_CB_COLOR4_CLEAR_WORD1 = 0x28D80, // + EG_CB_COLOR4_CLEAR_WORD2 = 0x28D84, // + EG_CB_COLOR4_CLEAR_WORD3 = 0x28D88, // + EG_CB_COLOR5_BASE = 0x28D8C, // SAME 0x28054 + EG_CB_COLOR5_PITCH = 0x28D90, // + EG_CB_COLOR5_SLICE = 0x28D94, // + EG_CB_COLOR5_VIEW = 0x28D98, // SAME 0x28094 + EG_CB_COLOR5_INFO = 0x28D9C, // DIFF 0x280B4 + EG_CB_COLOR5_ATTRIB = 0x28DA0, // + EG_CB_COLOR5_DIM = 0x28DA4, // + EG_CB_COLOR5_CMASK = 0x28DA8, // + EG_CB_COLOR5_CMASK_SLICE = 0x28DAC, // + EG_CB_COLOR5_FMASK = 0x28DB0, // + EG_CB_COLOR5_FMASK_SLICE = 0x28DB4, // + EG_CB_COLOR5_CLEAR_WORD0 = 0x28DB8, // + EG_CB_COLOR5_CLEAR_WORD1 = 0x28DBC, // + EG_CB_COLOR5_CLEAR_WORD2 = 0x28DC0, // + EG_CB_COLOR5_CLEAR_WORD3 = 0x28DC4, // + EG_CB_COLOR6_BASE = 0x28DC8, // SAME 0x28058 + EG_CB_COLOR6_PITCH = 0x28DCC, // + EG_CB_COLOR6_SLICE = 0x28DD0, // + EG_CB_COLOR6_VIEW = 0x28DD4, // SAME 0x28098 + EG_CB_COLOR6_INFO = 0x28DD8, // DIFF 0x280B8 EG_CB_COLOR6_ATTRIB = 0x28DDC, // EG_CB_COLOR6_DIM = 0x28DE0, // EG_CB_COLOR6_CMASK = 0x28DE4, // @@ -797,54 +797,54 @@ enum EG_CB_COLOR6_CLEAR_WORD1 = 0x28DF8, // EG_CB_COLOR6_CLEAR_WORD2 = 0x28DFC, // EG_CB_COLOR6_CLEAR_WORD3 = 0x28E00, // - EG_CB_COLOR7_BASE = 0x28E04, // SAME 0x2805C - EG_CB_COLOR7_PITCH = 0x28E08, // - EG_CB_COLOR7_SLICE = 0x28E0C, // - EG_CB_COLOR7_VIEW = 0x28E10, // SAME 0x2809C - EG_CB_COLOR7_INFO = 0x28E14, // DIFF 0x280BC - EG_CB_COLOR7_ATTRIB = 0x28E18, // - EG_CB_COLOR7_DIM = 0x28E1C, // - EG_CB_COLOR7_CMASK = 0x28E20, // - EG_CB_COLOR7_CMASK_SLICE = 0x28E24, // - EG_CB_COLOR7_FMASK = 0x28E28, // - EG_CB_COLOR7_FMASK_SLICE = 0x28E2C, // - EG_CB_COLOR7_CLEAR_WORD0 = 0x28E30, // - EG_CB_COLOR7_CLEAR_WORD1 = 0x28E34, // - EG_CB_COLOR7_CLEAR_WORD2 = 0x28E38, // - EG_CB_COLOR7_CLEAR_WORD3 = 0x28E3C, // - EG_CB_COLOR8_BASE = 0x28E40, // - EG_CB_COLOR8_PITCH = 0x28E44, // - EG_CB_COLOR8_SLICE = 0x28E48, // - EG_CB_COLOR8_VIEW = 0x28E4C, // - EG_CB_COLOR8_INFO = 0x28E50, // - EG_CB_COLOR8_ATTRIB = 0x28E54, // - EG_CB_COLOR8_DIM = 0x28E58, // - EG_CB_COLOR9_BASE = 0x28E5C, // - EG_CB_COLOR9_PITCH = 0x28E60, // - EG_CB_COLOR9_SLICE = 0x28E64, // - EG_CB_COLOR9_VIEW = 0x28E68, // - EG_CB_COLOR9_INFO = 0x28E6C, // - EG_CB_COLOR9_ATTRIB = 0x28E70, // - EG_CB_COLOR9_DIM = 0x28E74, // - EG_CB_COLOR10_BASE = 0x28E78, // - EG_CB_COLOR10_PITCH = 0x28E7C, // - EG_CB_COLOR10_SLICE = 0x28E80, // - EG_CB_COLOR10_VIEW = 0x28E84, // - EG_CB_COLOR10_INFO = 0x28E88, // - EG_CB_COLOR10_ATTRIB = 0x28E8C, // - EG_CB_COLOR10_DIM = 0x28E90, // - EG_CB_COLOR11_BASE = 0x28E94, // - EG_CB_COLOR11_PITCH = 0x28E98, // - EG_CB_COLOR11_SLICE = 0x28E9C, // - EG_CB_COLOR11_VIEW = 0x28EA0, // - EG_CB_COLOR11_INFO = 0x28EA4, // - EG_CB_COLOR11_ATTRIB = 0x28EA8, // - EG_CB_COLOR11_DIM = 0x28EAC, // + EG_CB_COLOR7_BASE = 0x28E04, // SAME 0x2805C + EG_CB_COLOR7_PITCH = 0x28E08, // + EG_CB_COLOR7_SLICE = 0x28E0C, // + EG_CB_COLOR7_VIEW = 0x28E10, // SAME 0x2809C + EG_CB_COLOR7_INFO = 0x28E14, // DIFF 0x280BC + EG_CB_COLOR7_ATTRIB = 0x28E18, // + EG_CB_COLOR7_DIM = 0x28E1C, // + EG_CB_COLOR7_CMASK = 0x28E20, // + EG_CB_COLOR7_CMASK_SLICE = 0x28E24, // + EG_CB_COLOR7_FMASK = 0x28E28, // + EG_CB_COLOR7_FMASK_SLICE = 0x28E2C, // + EG_CB_COLOR7_CLEAR_WORD0 = 0x28E30, // + EG_CB_COLOR7_CLEAR_WORD1 = 0x28E34, // + EG_CB_COLOR7_CLEAR_WORD2 = 0x28E38, // + EG_CB_COLOR7_CLEAR_WORD3 = 0x28E3C, // + EG_CB_COLOR8_BASE = 0x28E40, // + EG_CB_COLOR8_PITCH = 0x28E44, // + EG_CB_COLOR8_SLICE = 0x28E48, // + EG_CB_COLOR8_VIEW = 0x28E4C, // + EG_CB_COLOR8_INFO = 0x28E50, // + EG_CB_COLOR8_ATTRIB = 0x28E54, // + EG_CB_COLOR8_DIM = 0x28E58, // + EG_CB_COLOR9_BASE = 0x28E5C, // + EG_CB_COLOR9_PITCH = 0x28E60, // + EG_CB_COLOR9_SLICE = 0x28E64, // + EG_CB_COLOR9_VIEW = 0x28E68, // + EG_CB_COLOR9_INFO = 0x28E6C, // + EG_CB_COLOR9_ATTRIB = 0x28E70, // + EG_CB_COLOR9_DIM = 0x28E74, // + EG_CB_COLOR10_BASE = 0x28E78, // + EG_CB_COLOR10_PITCH = 0x28E7C, // + EG_CB_COLOR10_SLICE = 0x28E80, // + EG_CB_COLOR10_VIEW = 0x28E84, // + EG_CB_COLOR10_INFO = 0x28E88, // + EG_CB_COLOR10_ATTRIB = 0x28E8C, // + EG_CB_COLOR10_DIM = 0x28E90, // + EG_CB_COLOR11_BASE = 0x28E94, // + EG_CB_COLOR11_PITCH = 0x28E98, // + EG_CB_COLOR11_SLICE = 0x28E9C, // + EG_CB_COLOR11_VIEW = 0x28EA0, // + EG_CB_COLOR11_INFO = 0x28EA4, // + EG_CB_COLOR11_ATTRIB = 0x28EA8, // + EG_CB_COLOR11_DIM = 0x28EAC, // -/* Registers from CP block: */ - EG_COHER_DEST_BASE_0 = 0x28248, // SAME - EG_COHER_DEST_BASE_1 = 0x2824C, // SAME - EG_CP_PERFMON_CNTX_CNTL = 0x28358, // +/* Registers from CP block: */ + EG_COHER_DEST_BASE_0 = 0x28248, // SAME + EG_COHER_DEST_BASE_1 = 0x2824C, // SAME + EG_CP_PERFMON_CNTX_CNTL = 0x28358, // /* Config: */ EG_SPI_CONFIG_CNTL = 0x9100, // DIFF @@ -864,7 +864,7 @@ enum EG_SQ_THREAD_RESOURCE_MGMT_2 = 0x8C1C, // EG_VGT_CACHE_INVALIDATION = 0x88C4, // DIFF EG_VGT_GS_VERTEX_REUSE = 0x88D4, // SAME - EG_PA_SC_FORCE_EOV_MAX_CNTS = 0x8B24, // SAME + EG_PA_SC_FORCE_EOV_MAX_CNTS = 0x8B24, // SAME EG_PA_SC_LINE_STIPPLE_STATE = 0x8B10, // SAME EG_PA_CL_ENHANCE = 0x8A14, // SAME @@ -875,7 +875,7 @@ enum EG_TD_PS_BORDER_COLOR_ALPHA = 0xA410, /* const */ - EG_SQ_VTX_CONSTANT_WORD0_0 = 0x30000, // 0x38000 + EG_SQ_VTX_CONSTANT_WORD0_0 = 0x30000, // 0x38000 }; #endif /* _EVERGREEN_OFF_H_ */ \ No newline at end of file diff --git a/src/mesa/drivers/dri/r600/evergreen_oglprog.c b/src/mesa/drivers/dri/r600/evergreen_oglprog.c index a2a361f..caeb37b 100644 --- a/src/mesa/drivers/dri/r600/evergreen_oglprog.c +++ b/src/mesa/drivers/dri/r600/evergreen_oglprog.c @@ -57,14 +57,14 @@ static void evergreen_freeVertProgCache(struct gl_context *ctx, struct r700_vert /* Clean up */ Clean_Up_Assembler(&(vp->r700AsmCode)); Clean_Up_Shader(&(vp->r700Shader)); - + _mesa_reference_vertprog(ctx, &vp->mesa_program, NULL); free(vp); vp = tmp; } } -static struct gl_program *evergreenNewProgram(struct gl_context * ctx, +static struct gl_program *evergreenNewProgram(struct gl_context * ctx, GLenum target, GLuint id) { @@ -76,23 +76,23 @@ static struct gl_program *evergreenNewProgram(struct gl_context * ctx, radeon_print(RADEON_SHADER, RADEON_VERBOSE, "%s %u, %u\n", __func__, target, id); - switch (target) + switch (target) { case GL_VERTEX_STATE_PROGRAM_NV: - case GL_VERTEX_PROGRAM_ARB: + case GL_VERTEX_PROGRAM_ARB: vpc = CALLOC_STRUCT(evergreen_vertex_program_cont); - pProgram = _mesa_init_vertex_program(ctx, + pProgram = _mesa_init_vertex_program(ctx, &vpc->mesa_program, - target, + target, id); - + break; case GL_FRAGMENT_PROGRAM_NV: case GL_FRAGMENT_PROGRAM_ARB: fp = CALLOC_STRUCT(evergreen_fragment_program); - pProgram = _mesa_init_fragment_program(ctx, + pProgram = _mesa_init_fragment_program(ctx, &fp->mesa_program, - target, + target, id); fp->translated = GL_FALSE; fp->loaded = GL_FALSE; @@ -117,10 +117,10 @@ static void evergreenDeleteProgram(struct gl_context * ctx, struct gl_program *p radeon_print(RADEON_SHADER, RADEON_VERBOSE, "%s %p\n", __func__, prog); - switch (prog->Target) + switch (prog->Target) { case GL_VERTEX_STATE_PROGRAM_NV: - case GL_VERTEX_PROGRAM_ARB: + case GL_VERTEX_PROGRAM_ARB: evergreen_freeVertProgCache(ctx, vpc); break; case GL_FRAGMENT_PROGRAM_NV: @@ -159,7 +159,7 @@ evergreenProgramStringNotify(struct gl_context * ctx, GLenum target, struct gl_p break; case GL_FRAGMENT_PROGRAM_ARB: r600DeleteShader(ctx, fp->shaderbo); - + if(NULL != fp->constbo0) { r600DeleteShader(ctx, fp->constbo0); @@ -173,7 +173,7 @@ evergreenProgramStringNotify(struct gl_context * ctx, GLenum target, struct gl_p fp->shaderbo = NULL; break; } - + /* XXX check if program is legal, within limits */ return GL_TRUE; } diff --git a/src/mesa/drivers/dri/r600/evergreen_oglprog.h b/src/mesa/drivers/dri/r600/evergreen_oglprog.h index 1cf3e79..18e6757 100644 --- a/src/mesa/drivers/dri/r600/evergreen_oglprog.h +++ b/src/mesa/drivers/dri/r600/evergreen_oglprog.h @@ -21,7 +21,7 @@ /* * Authors: - * Richard Li , + * Richard Li , */ #ifndef _EVERGREEN_OGLPROG_H_ diff --git a/src/mesa/drivers/dri/r600/evergreen_render.c b/src/mesa/drivers/dri/r600/evergreen_render.c index 6e51832..79d875c 100644 --- a/src/mesa/drivers/dri/r600/evergreen_render.c +++ b/src/mesa/drivers/dri/r600/evergreen_render.c @@ -21,7 +21,7 @@ /* * Authors: - * Richard Li , + * Richard Li , */ #include "main/glheader.h" @@ -276,7 +276,7 @@ static void evergreenRunRenderPrimitiveImmediate(struct gl_context * ctx, int st + 2 /* VGT_INDEX_TYPE */ + 2 /* NUM_INSTANCES */ + 4 /* VTX_BASE_VTX_LOC + VTX_START_INST_LOC */ - + 3; /* DRAW */ + + 3; /* DRAW */ BEGIN_BATCH_NO_AUTOSTATE(total_emit); // prim @@ -363,8 +363,8 @@ static void evergreenRunRenderPrimitiveImmediate(struct gl_context * ctx, int st * Convert attribute data type to float * If the attribute uses named buffer object replace the bo with newly allocated bo */ -static void evergreenConvertAttrib(struct gl_context *ctx, int count, - const struct gl_client_array *input, +static void evergreenConvertAttrib(struct gl_context *ctx, int count, + const struct gl_client_array *input, struct StreamDesc *attr) { context_t *context = R700_CONTEXT(ctx); @@ -381,22 +381,22 @@ static void evergreenConvertAttrib(struct gl_context *ctx, int count, count = 1; } - if (input->BufferObj->Name) + if (input->BufferObj->Name) { - if (!input->BufferObj->Pointer) + if (!input->BufferObj->Pointer) { ctx->Driver.MapBuffer(ctx, GL_ARRAY_BUFFER, GL_READ_ONLY_ARB, input->BufferObj); mapped_named_bo = GL_TRUE; } src_ptr = ADD_POINTERS(input->BufferObj->Pointer, input->Ptr); - } - else + } + else { src_ptr = input->Ptr; } - radeonAllocDmaRegion(&context->radeon, &attr->bo, &attr->bo_offset, + radeonAllocDmaRegion(&context->radeon, &attr->bo, &attr->bo_offset, sizeof(GLfloat) * input->Size * count, 32); radeon_bo_map(attr->bo, 1); @@ -405,7 +405,7 @@ static void evergreenConvertAttrib(struct gl_context *ctx, int count, assert(src_ptr != NULL); - switch (input->Type) + switch (input->Type) { case GL_DOUBLE: CONVERT(GLdouble, (GLfloat)); @@ -436,7 +436,7 @@ static void evergreenConvertAttrib(struct gl_context *ctx, int count, radeon_bo_unmap(attr->bo); - if (mapped_named_bo) + if (mapped_named_bo) { ctx->Driver.UnmapBuffer(ctx, GL_ARRAY_BUFFER, input->BufferObj); } @@ -620,9 +620,9 @@ static void evergreenSetupIndexBuffer(struct gl_context *ctx, const struct _mesa } } -static void evergreenAlignDataToDword(struct gl_context *ctx, - const struct gl_client_array *input, - int count, +static void evergreenAlignDataToDword(struct gl_context *ctx, + const struct gl_client_array *input, + int count, struct StreamDesc *attr) { context_t *context = EVERGREEN_CONTEXT(ctx); @@ -634,7 +634,7 @@ static void evergreenAlignDataToDword(struct gl_context *ctx, radeon_bo_map(attr->bo, 1); - if (!input->BufferObj->Pointer) + if (!input->BufferObj->Pointer) { ctx->Driver.MapBuffer(ctx, GL_ARRAY_BUFFER, GL_READ_ONLY_ARB, input->BufferObj); mapped_named_bo = GL_TRUE; @@ -645,7 +645,7 @@ static void evergreenAlignDataToDword(struct gl_context *ctx, GLvoid *dst_ptr = ADD_POINTERS(attr->bo->ptr, attr->bo_offset); int i; - for (i = 0; i < count; ++i) + for (i = 0; i < count; ++i) { memcpy(dst_ptr, src_ptr, input->StrideB); src_ptr += input->StrideB; @@ -654,7 +654,7 @@ static void evergreenAlignDataToDword(struct gl_context *ctx, } radeon_bo_unmap(attr->bo); - if (mapped_named_bo) + if (mapped_named_bo) { ctx->Driver.UnmapBuffer(ctx, GL_ARRAY_BUFFER, input->BufferObj); } @@ -671,7 +671,7 @@ static void evergreenSetupStreams(struct gl_context *ctx, const struct gl_client EVERGREEN_STATECHANGE(context, vtx); - for(index = 0; index < context->nNumActiveAos; index++) + for(index = 0; index < context->nNumActiveAos; index++) { struct radeon_aos *aos = &context->radeon.tcl.aos[index]; i = context->stream_desc[index].element; @@ -685,58 +685,58 @@ static void evergreenSetupStreams(struct gl_context *ctx, const struct gl_client ) { evergreenConvertAttrib(ctx, count, input[i], &context->stream_desc[index]); - } - else + } + else { - if (input[i]->BufferObj->Name) + if (input[i]->BufferObj->Name) { context->stream_desc[index].stride = input[i]->StrideB; context->stream_desc[index].bo_offset = (intptr_t) input[i]->Ptr; context->stream_desc[index].bo = get_radeon_buffer_object(input[i]->BufferObj)->bo; context->stream_desc[index].is_named_bo = GL_TRUE; - } - else + } + else { int size; int local_count = count; uint32_t *dst; - if (input[i]->StrideB == 0) + if (input[i]->StrideB == 0) { size = getTypeSize(input[i]->Type) * input[i]->Size; local_count = 1; - } - else + } + else { size = getTypeSize(input[i]->Type) * input[i]->Size * local_count; } - radeonAllocDmaRegion(&context->radeon, &context->stream_desc[index].bo, + radeonAllocDmaRegion(&context->radeon, &context->stream_desc[index].bo, &context->stream_desc[index].bo_offset, size, 32); radeon_bo_map(context->stream_desc[index].bo, 1); assert(context->stream_desc[index].bo->ptr != NULL); - dst = (uint32_t *)ADD_POINTERS(context->stream_desc[index].bo->ptr, + dst = (uint32_t *)ADD_POINTERS(context->stream_desc[index].bo->ptr, context->stream_desc[index].bo_offset); - switch (context->stream_desc[index].dwords) + switch (context->stream_desc[index].dwords) { - case 1: + case 1: radeonEmitVec4(dst, input[i]->Ptr, input[i]->StrideB, local_count); break; - case 2: - radeonEmitVec8(dst, input[i]->Ptr, input[i]->StrideB, local_count); + case 2: + radeonEmitVec8(dst, input[i]->Ptr, input[i]->StrideB, local_count); break; - case 3: - radeonEmitVec12(dst, input[i]->Ptr, input[i]->StrideB, local_count); + case 3: + radeonEmitVec12(dst, input[i]->Ptr, input[i]->StrideB, local_count); break; - case 4: - radeonEmitVec16(dst, input[i]->Ptr, input[i]->StrideB, local_count); + case 4: + radeonEmitVec16(dst, input[i]->Ptr, input[i]->StrideB, local_count); break; - default: - assert(0); + default: + assert(0); break; } @@ -750,17 +750,17 @@ static void evergreenSetupStreams(struct gl_context *ctx, const struct gl_client aos->bo = context->stream_desc[index].bo; aos->offset = context->stream_desc[index].bo_offset; - if(context->stream_desc[index].is_named_bo) + if(context->stream_desc[index].is_named_bo) { - radeon_cs_space_add_persistent_bo(context->radeon.cmdbuf.cs, - context->stream_desc[index].bo, + radeon_cs_space_add_persistent_bo(context->radeon.cmdbuf.cs, + context->stream_desc[index].bo, RADEON_GEM_DOMAIN_GTT, 0); } } - ret = radeon_cs_space_check_with_bo(context->radeon.cmdbuf.cs, - first_elem(&context->radeon.dma.reserved)->bo, - RADEON_GEM_DOMAIN_GTT, 0); + ret = radeon_cs_space_check_with_bo(context->radeon.cmdbuf.cs, + first_elem(&context->radeon.dma.reserved)->bo, + RADEON_GEM_DOMAIN_GTT, 0); } static void evergreenFreeData(struct gl_context *ctx) @@ -919,7 +919,7 @@ static void evergreenDrawPrims(struct gl_context *ctx, if (!vbo_all_varyings_in_vbos(arrays)) { if (!index_bounds_valid) vbo_get_minmax_index(ctx, prim, ib, &min_index, &max_index); - /* do we want to rebase, minimizes the + /* do we want to rebase, minimizes the * amount of data to upload? */ if (min_index) { vbo_rebase_prims( ctx, arrays, prim, nr_prims, ib, min_index, max_index, evergreenDrawPrims ); diff --git a/src/mesa/drivers/dri/r600/evergreen_sq.h b/src/mesa/drivers/dri/r600/evergreen_sq.h index b1a536e..d624f23 100644 --- a/src/mesa/drivers/dri/r600/evergreen_sq.h +++ b/src/mesa/drivers/dri/r600/evergreen_sq.h @@ -21,7 +21,7 @@ /* * Authors: - * Richard Li , + * Richard Li , */ #ifndef _EVERGREEN_SQ_H_ @@ -68,7 +68,7 @@ enum{ EG_CF_INST_PUSH = 11, EG_CF_INST_Reserved_12 = 12, EG_CF_INST_ELSE = 13, - EG_CF_INST_POP = 14, + EG_CF_INST_POP = 14, EG_CF_INST_Reserved_15 = 15, EG_CF_INST_Reserved_16 = 16, EG_CF_INST_Reserved_17 = 17, @@ -358,17 +358,17 @@ enum{ EG_ALU_WORD0__LAST_shift = 31,//1 bit EG_ALU_WORD0__LAST_bit = 1 << 31, - EG_ALU_WORD1_OP2__SRC0_ABS_shift = 0, //1 bit + EG_ALU_WORD1_OP2__SRC0_ABS_shift = 0, //1 bit EG_ALU_WORD1_OP2__SRC0_ABS_bit = 1, - EG_ALU_WORD1_OP2__SRC1_ABS_shift = 1, //1 bit + EG_ALU_WORD1_OP2__SRC1_ABS_shift = 1, //1 bit EG_ALU_WORD1_OP2__SRC1_ABS_bit = 1 << 1, - EG_ALU_WORD1_OP2__UEM_shift = 2, //1 bit + EG_ALU_WORD1_OP2__UEM_shift = 2, //1 bit EG_ALU_WORD1_OP2__UEM_bit = 1 << 2, - EG_ALU_WORD1_OP2__UPDATE_PRED_shift = 3, //1 bit + EG_ALU_WORD1_OP2__UPDATE_PRED_shift = 3, //1 bit EG_ALU_WORD1_OP2__UPDATE_PRED_bit = 1 << 3, - EG_ALU_WORD1_OP2__WRITE_MASK_shift = 4, //1 bit + EG_ALU_WORD1_OP2__WRITE_MASK_shift = 4, //1 bit EG_ALU_WORD1_OP2__WRITE_MASK_bit = 1 << 4, - EG_ALU_WORD1_OP2__OMOD_shift = 5, //2 bits + EG_ALU_WORD1_OP2__OMOD_shift = 5, //2 bits EG_ALU_WORD1_OP2__OMOD_mask = 0x3 << 5, EG_ALU_WORD1_OP2__ALU_INST_shift = 7, //11 bits EG_ALU_WORD1_OP2__ALU_INST_mask = 0x7FF << 7, @@ -646,7 +646,7 @@ enum{ EG_SRC_SEL__ALU_SRC_PS = 255, //ALLOC_EXPORT - EG_CF_ALLOC_EXPORT_WORD0__ARRAY_BASE_shift = 0, //13 bits + EG_CF_ALLOC_EXPORT_WORD0__ARRAY_BASE_shift = 0, //13 bits EG_CF_ALLOC_EXPORT_WORD0__ARRAY_BASE_mask = 0x1FFF, EG_CF_ALLOC_EXPORT_WORD0__TYPE_shift = 13,//2 bits EG_CF_ALLOC_EXPORT_WORD0__TYPE_mask = 0x3 << 13, @@ -676,7 +676,7 @@ enum{ EG_CF_ALLOC_EXPORT_WORD1_SWIZ__Resreve_mask = 0xF << 12, EG_CF_ALLOC_EXPORT_WORD1__BURST_COUNT_shift = 16, //4 bits - EG_CF_ALLOC_EXPORT_WORD1__BURST_COUNT_mask = 0xF << 16, + EG_CF_ALLOC_EXPORT_WORD1__BURST_COUNT_mask = 0xF << 16, EG_CF_ALLOC_EXPORT_WORD1__VPM_shift = 20, //1 bit EG_CF_ALLOC_EXPORT_WORD1__VPM_bit = 1 << 20, EG_CF_ALLOC_EXPORT_WORD1__EOP_shift = 21, //1 bit diff --git a/src/mesa/drivers/dri/r600/evergreen_state.c b/src/mesa/drivers/dri/r600/evergreen_state.c index 648cda0..45d1d42 100644 --- a/src/mesa/drivers/dri/r600/evergreen_state.c +++ b/src/mesa/drivers/dri/r600/evergreen_state.c @@ -190,8 +190,8 @@ static void evergreenInvalidateState(struct gl_context * ctx, GLuint new_state) CLEARbit(evergreen->SPI_PS_IN_CONTROL_0.u32All, LINEAR_GRADIENT_ENA_bit); SETfield(evergreen->SPI_BARYC_CNTL.u32All, 1, - EG_SPI_BARYC_CNTL__PERSP_CENTROID_ENA_shift, - EG_SPI_BARYC_CNTL__PERSP_CENTROID_ENA_mask); + EG_SPI_BARYC_CNTL__PERSP_CENTROID_ENA_shift, + EG_SPI_BARYC_CNTL__PERSP_CENTROID_ENA_mask); } else { @@ -200,13 +200,13 @@ static void evergreenInvalidateState(struct gl_context * ctx, GLuint new_state) SETbit(evergreen->PA_CL_VTE_CNTL.u32All, VTX_Z_FMT_bit); SETbit(evergreen->PA_CL_VTE_CNTL.u32All, VTX_W0_FMT_bit); - + CLEARbit(evergreen->SPI_PS_IN_CONTROL_0.u32All, PERSP_GRADIENT_ENA_bit); SETbit(evergreen->SPI_PS_IN_CONTROL_0.u32All, LINEAR_GRADIENT_ENA_bit); - + SETfield(evergreen->SPI_BARYC_CNTL.u32All, 1, - EG_SPI_BARYC_CNTL__LINEAR_CENTROID_ENA_shift, - EG_SPI_BARYC_CNTL__LINEAR_CENTROID_ENA_mask); + EG_SPI_BARYC_CNTL__LINEAR_CENTROID_ENA_shift, + EG_SPI_BARYC_CNTL__LINEAR_CENTROID_ENA_mask); } context->radeon.NewGLState |= new_state; @@ -455,8 +455,8 @@ static void evergreenSetBlendState(struct gl_context * ctx) //diff : CB_COLOR_CO SETbit(blend_reg, SEPARATE_ALPHA_BLEND_bit); SETbit(blend_reg, EG_CB_BLENDX_CONTROL_ENABLE_bit); - - evergreen->CB_BLEND0_CONTROL.u32All = blend_reg; + + evergreen->CB_BLEND0_CONTROL.u32All = blend_reg; } static void evergreenBlendEquationSeparate(struct gl_context * ctx, @@ -522,16 +522,16 @@ static void evergreenSetLogicOpState(struct gl_context *ctx) //diff : CB_COLOR_C if (RGBA_LOGICOP_ENABLED(ctx)) SETfield(evergreen->CB_COLOR_CONTROL.u32All, - evergreen_translate_logicop(ctx->Color.LogicOp), - EG_CB_COLOR_CONTROL__ROP3_shift, + evergreen_translate_logicop(ctx->Color.LogicOp), + EG_CB_COLOR_CONTROL__ROP3_shift, EG_CB_COLOR_CONTROL__ROP3_mask); else - SETfield(evergreen->CB_COLOR_CONTROL.u32All, 0xCC, - EG_CB_COLOR_CONTROL__ROP3_shift, + SETfield(evergreen->CB_COLOR_CONTROL.u32All, 0xCC, + EG_CB_COLOR_CONTROL__ROP3_shift, EG_CB_COLOR_CONTROL__ROP3_mask); } -static void evergreenClipPlane( struct gl_context *ctx, GLenum plane, const GLfloat *eq ) //same , but PA_CL_UCP_0_ offset diff +static void evergreenClipPlane( struct gl_context *ctx, GLenum plane, const GLfloat *eq ) //same , but PA_CL_UCP_0_ offset diff { context_t *context = EVERGREEN_CONTEXT(ctx); EVERGREEN_CHIP_CONTEXT *evergreen = GET_EVERGREEN_CHIP(context); @@ -570,41 +570,41 @@ static void evergreenSetClipPlaneState(struct gl_context * ctx, GLenum cap, GLbo } static void evergreenSetDBRenderState(struct gl_context * ctx) -{ +{ context_t *context = EVERGREEN_CONTEXT(ctx); EVERGREEN_CHIP_CONTEXT *evergreen = GET_EVERGREEN_CHIP(context); struct evergreen_fragment_program *fp = (struct evergreen_fragment_program *)(ctx->FragmentProgram._Current); - + EVERGREEN_STATECHANGE(context, db); - SETbit(evergreen->DB_SHADER_CONTROL.u32All, + SETbit(evergreen->DB_SHADER_CONTROL.u32All, DUAL_EXPORT_ENABLE_bit); - SETfield(evergreen->DB_SHADER_CONTROL.u32All, EARLY_Z_THEN_LATE_Z, - Z_ORDER_shift, + SETfield(evergreen->DB_SHADER_CONTROL.u32All, EARLY_Z_THEN_LATE_Z, + Z_ORDER_shift, Z_ORDER_mask); /* XXX need to enable htile for hiz/s */ - SETfield(evergreen->DB_RENDER_OVERRIDE.u32All, FORCE_DISABLE, - FORCE_HIZ_ENABLE_shift, + SETfield(evergreen->DB_RENDER_OVERRIDE.u32All, FORCE_DISABLE, + FORCE_HIZ_ENABLE_shift, FORCE_HIZ_ENABLE_mask); - SETfield(evergreen->DB_RENDER_OVERRIDE.u32All, FORCE_DISABLE, - FORCE_HIS_ENABLE0_shift, + SETfield(evergreen->DB_RENDER_OVERRIDE.u32All, FORCE_DISABLE, + FORCE_HIS_ENABLE0_shift, FORCE_HIS_ENABLE0_mask); - SETfield(evergreen->DB_RENDER_OVERRIDE.u32All, FORCE_DISABLE, - FORCE_HIS_ENABLE1_shift, + SETfield(evergreen->DB_RENDER_OVERRIDE.u32All, FORCE_DISABLE, + FORCE_HIS_ENABLE1_shift, FORCE_HIS_ENABLE1_mask); if (context->radeon.query.current) { - SETbit(evergreen->DB_RENDER_OVERRIDE.u32All, NOOP_CULL_DISABLE_bit); - SETbit(evergreen->DB_COUNT_CONTROL.u32All, - EG_DB_COUNT_CONTROL__PERFECT_ZPASS_COUNTS_bit); + SETbit(evergreen->DB_RENDER_OVERRIDE.u32All, NOOP_CULL_DISABLE_bit); + SETbit(evergreen->DB_COUNT_CONTROL.u32All, + EG_DB_COUNT_CONTROL__PERFECT_ZPASS_COUNTS_bit); } else { - CLEARbit(evergreen->DB_RENDER_OVERRIDE.u32All, NOOP_CULL_DISABLE_bit); - CLEARbit(evergreen->DB_COUNT_CONTROL.u32All, - EG_DB_COUNT_CONTROL__PERFECT_ZPASS_COUNTS_bit); + CLEARbit(evergreen->DB_RENDER_OVERRIDE.u32All, NOOP_CULL_DISABLE_bit); + CLEARbit(evergreen->DB_COUNT_CONTROL.u32All, + EG_DB_COUNT_CONTROL__PERFECT_ZPASS_COUNTS_bit); } if (fp) @@ -626,7 +626,7 @@ static void evergreenSetDBRenderState(struct gl_context * ctx) { CLEARbit(evergreen->DB_SHADER_CONTROL.u32All, Z_EXPORT_ENABLE_bit); } - } + } } void evergreenUpdateShaderStates(struct gl_context * ctx) @@ -694,7 +694,7 @@ static void evergreenSetDepthState(struct gl_context * ctx) //same break; } } - else + else { CLEARbit(evergreen->DB_DEPTH_CONTROL.u32All, Z_ENABLE_bit); CLEARbit(evergreen->DB_DEPTH_CONTROL.u32All, Z_WRITE_ENABLE_bit); @@ -941,7 +941,7 @@ static void evergreenUpdateWindow(struct gl_context * ctx, int id) //diff in cal GLfloat tz = v[MAT_TZ] * depthScale; EVERGREEN_STATECHANGE(context, pa); - + evergreen->viewport[id].PA_CL_VPORT_XSCALE.f32All = sx; evergreen->viewport[id].PA_CL_VPORT_XOFFSET.f32All = tx; @@ -1232,7 +1232,7 @@ static void evergreenStencilFuncSeparate(struct gl_context * ctx, GLenum face, EVERGREEN_CHIP_CONTEXT *evergreen = GET_EVERGREEN_CHIP(context); const unsigned back = ctx->Stencil._BackFace; - + EVERGREEN_STATECHANGE(context, db); //front @@ -1411,15 +1411,15 @@ static void evergreenRenderMode(struct gl_context * ctx, GLenum mode) //same static void evergreenInitSQConfig(struct gl_context * ctx) { context_t *context = EVERGREEN_CONTEXT(ctx); - EVERGREEN_CHIP_CONTEXT *evergreen = GET_EVERGREEN_CHIP(context); - + EVERGREEN_CHIP_CONTEXT *evergreen = GET_EVERGREEN_CHIP(context); + uint32_t uSqNumCfInsts, uMaxGPRs, uMaxThreads, uMaxStackEntries, uPSThreadCount, uOtherThreadCount; uint32_t NUM_PS_GPRS, NUM_VS_GPRS, NUM_GS_GPRS, NUM_ES_GPRS, NUM_HS_GPRS, NUM_LS_GPRS, NUM_CLAUSE_TEMP_GPRS; GLboolean bVC_ENABLE = GL_TRUE; R600_STATECHANGE(context, sq); - switch (context->radeon.radeonScreen->chip_family) + switch (context->radeon.radeonScreen->chip_family) { case CHIP_FAMILY_CEDAR: uSqNumCfInsts = 1; @@ -1507,54 +1507,54 @@ static void evergreenInitSQConfig(struct gl_context * ctx) evergreen->evergreen_config.SPI_CONFIG_CNTL.u32All = 0; evergreen->evergreen_config.SPI_CONFIG_CNTL_1.u32All = 0; - SETfield(evergreen->evergreen_config.SPI_CONFIG_CNTL_1.u32All, 4, - EG_SPI_CONFIG_CNTL_1__VTX_DONE_DELAY_shift, + SETfield(evergreen->evergreen_config.SPI_CONFIG_CNTL_1.u32All, 4, + EG_SPI_CONFIG_CNTL_1__VTX_DONE_DELAY_shift, EG_SPI_CONFIG_CNTL_1__VTX_DONE_DELAY_mask); evergreen->evergreen_config.CP_PERFMON_CNTL.u32All = 0; - + evergreen->evergreen_config.SQ_MS_FIFO_SIZES.u32All = 0; - SETfield(evergreen->evergreen_config.SQ_MS_FIFO_SIZES.u32All, 16 * uSqNumCfInsts, - EG_SQ_MS_FIFO_SIZES__CACHE_FIFO_SIZE_shift, + SETfield(evergreen->evergreen_config.SQ_MS_FIFO_SIZES.u32All, 16 * uSqNumCfInsts, + EG_SQ_MS_FIFO_SIZES__CACHE_FIFO_SIZE_shift, EG_SQ_MS_FIFO_SIZES__CACHE_FIFO_SIZE_mask); - SETfield(evergreen->evergreen_config.SQ_MS_FIFO_SIZES.u32All, 0x4, - EG_SQ_MS_FIFO_SIZES__FETCH_FIFO_HIWATER_shift, + SETfield(evergreen->evergreen_config.SQ_MS_FIFO_SIZES.u32All, 0x4, + EG_SQ_MS_FIFO_SIZES__FETCH_FIFO_HIWATER_shift, EG_SQ_MS_FIFO_SIZES__FETCH_FIFO_HIWATER_mask); - SETfield(evergreen->evergreen_config.SQ_MS_FIFO_SIZES.u32All, 0xE0, - EG_SQ_MS_FIFO_SIZES__DONE_FIFO_HIWATER_shift, + SETfield(evergreen->evergreen_config.SQ_MS_FIFO_SIZES.u32All, 0xE0, + EG_SQ_MS_FIFO_SIZES__DONE_FIFO_HIWATER_shift, EG_SQ_MS_FIFO_SIZES__DONE_FIFO_HIWATER_mask); - SETfield(evergreen->evergreen_config.SQ_MS_FIFO_SIZES.u32All, 0x8, - EG_SQ_MS_FIFO_SIZES__ALU_UPDATE_FIFO_HIWATER_shift, + SETfield(evergreen->evergreen_config.SQ_MS_FIFO_SIZES.u32All, 0x8, + EG_SQ_MS_FIFO_SIZES__ALU_UPDATE_FIFO_HIWATER_shift, EG_SQ_MS_FIFO_SIZES__ALU_UPDATE_FIFO_HIWATER_mask); - + if(bVC_ENABLE == GL_TRUE) { - SETbit(evergreen->evergreen_config.SQ_CONFIG.u32All, + SETbit(evergreen->evergreen_config.SQ_CONFIG.u32All, EG_SQ_CONFIG__VC_ENABLE_bit); } else { - CLEARbit(evergreen->evergreen_config.SQ_CONFIG.u32All, + CLEARbit(evergreen->evergreen_config.SQ_CONFIG.u32All, EG_SQ_CONFIG__VC_ENABLE_bit); } - SETbit(evergreen->evergreen_config.SQ_CONFIG.u32All, + SETbit(evergreen->evergreen_config.SQ_CONFIG.u32All, EG_SQ_CONFIG__EXPORT_SRC_C_bit); - SETfield(evergreen->evergreen_config.SQ_CONFIG.u32All, 0, - EG_SQ_CONFIG__PS_PRIO_shift, + SETfield(evergreen->evergreen_config.SQ_CONFIG.u32All, 0, + EG_SQ_CONFIG__PS_PRIO_shift, EG_SQ_CONFIG__PS_PRIO_mask); - SETfield(evergreen->evergreen_config.SQ_CONFIG.u32All, 1, - EG_SQ_CONFIG__VS_PRIO_shift, + SETfield(evergreen->evergreen_config.SQ_CONFIG.u32All, 1, + EG_SQ_CONFIG__VS_PRIO_shift, EG_SQ_CONFIG__VS_PRIO_mask); - SETfield(evergreen->evergreen_config.SQ_CONFIG.u32All, 2, - EG_SQ_CONFIG__GS_PRIO_shift, + SETfield(evergreen->evergreen_config.SQ_CONFIG.u32All, 2, + EG_SQ_CONFIG__GS_PRIO_shift, EG_SQ_CONFIG__GS_PRIO_mask); - SETfield(evergreen->evergreen_config.SQ_CONFIG.u32All, 3, - EG_SQ_CONFIG__ES_PRIO_shift, + SETfield(evergreen->evergreen_config.SQ_CONFIG.u32All, 3, + EG_SQ_CONFIG__ES_PRIO_shift, EG_SQ_CONFIG__ES_PRIO_mask); - NUM_CLAUSE_TEMP_GPRS = 4; + NUM_CLAUSE_TEMP_GPRS = 4; NUM_PS_GPRS = ((uMaxGPRs-(4*2))*12/32); // 93 - NUM_VS_GPRS = ((uMaxGPRs-(4*2))*6/32); // 46 + NUM_VS_GPRS = ((uMaxGPRs-(4*2))*6/32); // 46 NUM_GS_GPRS = ((uMaxGPRs-(4*2))*4/32); // 31 NUM_ES_GPRS = ((uMaxGPRs-(4*2))*4/32); // 31 NUM_HS_GPRS = ((uMaxGPRs-(4*2))*3/32); // 23 @@ -1564,19 +1564,19 @@ static void evergreenInitSQConfig(struct gl_context * ctx) evergreen->evergreen_config.SQ_GPR_RESOURCE_MGMT_2.u32All = 0; evergreen->evergreen_config.SQ_GPR_RESOURCE_MGMT_3.u32All = 0; - SETfield(evergreen->evergreen_config.SQ_GPR_RESOURCE_MGMT_1.u32All, NUM_PS_GPRS, + SETfield(evergreen->evergreen_config.SQ_GPR_RESOURCE_MGMT_1.u32All, NUM_PS_GPRS, NUM_PS_GPRS_shift, NUM_PS_GPRS_mask); - SETfield(evergreen->evergreen_config.SQ_GPR_RESOURCE_MGMT_1.u32All, NUM_VS_GPRS, + SETfield(evergreen->evergreen_config.SQ_GPR_RESOURCE_MGMT_1.u32All, NUM_VS_GPRS, NUM_VS_GPRS_shift, NUM_VS_GPRS_mask); SETfield(evergreen->evergreen_config.SQ_GPR_RESOURCE_MGMT_1.u32All, NUM_CLAUSE_TEMP_GPRS, NUM_CLAUSE_TEMP_GPRS_shift, NUM_CLAUSE_TEMP_GPRS_mask); - SETfield(evergreen->evergreen_config.SQ_GPR_RESOURCE_MGMT_2.u32All, NUM_GS_GPRS, + SETfield(evergreen->evergreen_config.SQ_GPR_RESOURCE_MGMT_2.u32All, NUM_GS_GPRS, NUM_GS_GPRS_shift, NUM_GS_GPRS_mask); - SETfield(evergreen->evergreen_config.SQ_GPR_RESOURCE_MGMT_2.u32All, NUM_ES_GPRS, + SETfield(evergreen->evergreen_config.SQ_GPR_RESOURCE_MGMT_2.u32All, NUM_ES_GPRS, NUM_ES_GPRS_shift, NUM_ES_GPRS_mask); - SETfield(evergreen->evergreen_config.SQ_GPR_RESOURCE_MGMT_3.u32All, NUM_HS_GPRS, + SETfield(evergreen->evergreen_config.SQ_GPR_RESOURCE_MGMT_3.u32All, NUM_HS_GPRS, NUM_PS_GPRS_shift, NUM_PS_GPRS_mask); - SETfield(evergreen->evergreen_config.SQ_GPR_RESOURCE_MGMT_3.u32All, NUM_LS_GPRS, + SETfield(evergreen->evergreen_config.SQ_GPR_RESOURCE_MGMT_3.u32All, NUM_LS_GPRS, NUM_VS_GPRS_shift, NUM_VS_GPRS_mask); uOtherThreadCount = (((uMaxThreads-uPSThreadCount)/6)/8)*8; @@ -1602,7 +1602,7 @@ static void evergreenInitSQConfig(struct gl_context * ctx) SETfield(evergreen->evergreen_config.SQ_STACK_RESOURCE_MGMT_1.u32All, uMaxStackEntries, NUM_PS_STACK_ENTRIES_shift, NUM_PS_STACK_ENTRIES_mask); SETfield(evergreen->evergreen_config.SQ_STACK_RESOURCE_MGMT_1.u32All, uMaxStackEntries, - NUM_VS_STACK_ENTRIES_shift, NUM_VS_STACK_ENTRIES_mask); + NUM_VS_STACK_ENTRIES_shift, NUM_VS_STACK_ENTRIES_mask); SETfield(evergreen->evergreen_config.SQ_STACK_RESOURCE_MGMT_2.u32All, uMaxStackEntries, NUM_GS_STACK_ENTRIES_shift, NUM_GS_STACK_ENTRIES_mask); SETfield(evergreen->evergreen_config.SQ_STACK_RESOURCE_MGMT_2.u32All, uMaxStackEntries, @@ -1610,34 +1610,34 @@ static void evergreenInitSQConfig(struct gl_context * ctx) SETfield(evergreen->evergreen_config.SQ_STACK_RESOURCE_MGMT_3.u32All, uMaxStackEntries, NUM_PS_STACK_ENTRIES_shift, NUM_PS_STACK_ENTRIES_mask); SETfield(evergreen->evergreen_config.SQ_STACK_RESOURCE_MGMT_3.u32All, uMaxStackEntries, - NUM_VS_STACK_ENTRIES_shift, NUM_VS_STACK_ENTRIES_mask); + NUM_VS_STACK_ENTRIES_shift, NUM_VS_STACK_ENTRIES_mask); evergreen->evergreen_config.PA_SC_FORCE_EOV_MAX_CNTS.u32All = 0; SETfield(evergreen->evergreen_config.PA_SC_FORCE_EOV_MAX_CNTS.u32All, 4095, - EG_PA_SC_FORCE_EOV_MAX_CNTS__FORCE_EOV_MAX_CLK_CNT_shift, - EG_PA_SC_FORCE_EOV_MAX_CNTS__FORCE_EOV_MAX_CLK_CNT_mask); + EG_PA_SC_FORCE_EOV_MAX_CNTS__FORCE_EOV_MAX_CLK_CNT_shift, + EG_PA_SC_FORCE_EOV_MAX_CNTS__FORCE_EOV_MAX_CLK_CNT_mask); SETfield(evergreen->evergreen_config.PA_SC_FORCE_EOV_MAX_CNTS.u32All, 255, - EG_PA_SC_FORCE_EOV_MAX_CNTS__FORCE_EOV_MAX_REZ_CNT_shift, - EG_PA_SC_FORCE_EOV_MAX_CNTS__FORCE_EOV_MAX_REZ_CNT_mask); - + EG_PA_SC_FORCE_EOV_MAX_CNTS__FORCE_EOV_MAX_REZ_CNT_shift, + EG_PA_SC_FORCE_EOV_MAX_CNTS__FORCE_EOV_MAX_REZ_CNT_mask); + evergreen->evergreen_config.VGT_CACHE_INVALIDATION.u32All = 0; SETfield(evergreen->evergreen_config.VGT_CACHE_INVALIDATION.u32All, 2, - EG_VGT_CACHE_INVALIDATION__CACHE_INVALIDATION_shift, - EG_VGT_CACHE_INVALIDATION__CACHE_INVALIDATION_mask); - + EG_VGT_CACHE_INVALIDATION__CACHE_INVALIDATION_shift, + EG_VGT_CACHE_INVALIDATION__CACHE_INVALIDATION_mask); + evergreen->evergreen_config.VGT_GS_VERTEX_REUSE.u32All = 0; SETfield(evergreen->evergreen_config.VGT_GS_VERTEX_REUSE.u32All, 16, - VERT_REUSE_shift, - VERT_REUSE_mask); + VERT_REUSE_shift, + VERT_REUSE_mask); evergreen->evergreen_config.PA_SC_LINE_STIPPLE_STATE.u32All = 0; evergreen->evergreen_config.PA_CL_ENHANCE.u32All = 0; - SETbit(evergreen->evergreen_config.PA_CL_ENHANCE.u32All, + SETbit(evergreen->evergreen_config.PA_CL_ENHANCE.u32All, CLIP_VTX_REORDER_ENA_bit); SETfield(evergreen->evergreen_config.PA_CL_ENHANCE.u32All, 3, - NUM_CLIP_SEQ_shift, - NUM_CLIP_SEQ_mask); + NUM_CLIP_SEQ_shift, + NUM_CLIP_SEQ_mask); } void evergreenInitState(struct gl_context * ctx) //diff @@ -1646,39 +1646,39 @@ void evergreenInitState(struct gl_context * ctx) //diff EVERGREEN_CHIP_CONTEXT *evergreen = GET_EVERGREEN_CHIP(context); int id = 0; - + //calloc should have done this memset(evergreen, 0, sizeof(EVERGREEN_CHIP_CONTEXT)); - + // Disable window clipping and offset: SETfield(evergreen->PA_SC_WINDOW_OFFSET.u32All, 0, EG_PA_SC_WINDOW_OFFSET__WINDOW_X_OFFSET_shift, EG_PA_SC_WINDOW_OFFSET__WINDOW_X_OFFSET_mask); SETfield(evergreen->PA_SC_WINDOW_OFFSET.u32All, 0, EG_PA_SC_WINDOW_OFFSET__WINDOW_Y_OFFSET_shift, EG_PA_SC_WINDOW_OFFSET__WINDOW_Y_OFFSET_mask); - SETbit(evergreen->PA_SC_WINDOW_SCISSOR_TL.u32All, WINDOW_OFFSET_DISABLE_bit); - + SETbit(evergreen->PA_SC_WINDOW_SCISSOR_TL.u32All, WINDOW_OFFSET_DISABLE_bit); + evergreen->PA_SC_CLIPRECT_RULE.u32All = 0x0000FFFF; evergreen->PA_SC_EDGERULE.u32All = 0xAAAAAAAA; // Set up Z min/max: - evergreen->viewport[id].PA_SC_VPORT_ZMIN_0.f32All = 0.0; + evergreen->viewport[id].PA_SC_VPORT_ZMIN_0.f32All = 0.0; evergreen->viewport[id].PA_SC_VPORT_ZMAX_0.f32All = 1.0; SETfield(evergreen->CB_TARGET_MASK.u32All, 0xF, TARGET0_ENABLE_shift, TARGET0_ENABLE_mask); SETfield(evergreen->CB_SHADER_MASK.u32All, 0xF, OUTPUT0_ENABLE_shift, OUTPUT0_ENABLE_mask); - + SETfield(evergreen->SPI_BARYC_CNTL.u32All, 1, - EG_SPI_BARYC_CNTL__PERSP_CENTROID_ENA_shift, + EG_SPI_BARYC_CNTL__PERSP_CENTROID_ENA_shift, EG_SPI_BARYC_CNTL__PERSP_CENTROID_ENA_mask); SETfield(evergreen->SPI_BARYC_CNTL.u32All, 1, - EG_SPI_BARYC_CNTL__LINEAR_CENTROID_ENA_shift, + EG_SPI_BARYC_CNTL__LINEAR_CENTROID_ENA_shift, EG_SPI_BARYC_CNTL__LINEAR_CENTROID_ENA_mask); - + // Turn off vgt reuse: evergreen->VGT_REUSE_OFF.u32All = 0; - SETbit(evergreen->VGT_REUSE_OFF.u32All, REUSE_OFF_bit); + SETbit(evergreen->VGT_REUSE_OFF.u32All, REUSE_OFF_bit); // Specify offsetting and clamp values for vertices: evergreen->VGT_MAX_VTX_INDX.u32All = 0xFFFFFF; @@ -1690,21 +1690,21 @@ void evergreenInitState(struct gl_context * ctx) //diff // Do not alpha blend: SETfield(evergreen->SX_ALPHA_TEST_CONTROL.u32All, REF_NEVER, ALPHA_FUNC_shift, ALPHA_FUNC_mask); - CLEARbit(evergreen->SX_ALPHA_TEST_CONTROL.u32All, ALPHA_TEST_ENABLE_bit); + CLEARbit(evergreen->SX_ALPHA_TEST_CONTROL.u32All, ALPHA_TEST_ENABLE_bit); evergreen->SPI_VS_OUT_ID_0.u32All = 0x03020100; evergreen->SPI_VS_OUT_ID_1.u32All = 0x07060504; - + evergreen->SPI_PS_INPUT_CNTL[0].u32All = 0x00000800; evergreen->SPI_PS_INPUT_CNTL[1].u32All = 0x00000801; evergreen->SPI_PS_INPUT_CNTL[2].u32All = 0x00000802; - // Depth buffer currently disabled: + // Depth buffer currently disabled: evergreen->DB_DEPTH_CONTROL.u32All = 0; SETbit(evergreen->DB_DEPTH_CONTROL.u32All, Z_WRITE_ENABLE_bit); SETfield(evergreen->DB_DEPTH_CONTROL.u32All, FRAG_ALWAYS, - ZFUNC_shift, ZFUNC_mask); + ZFUNC_shift, ZFUNC_mask); evergreen->DB_Z_READ_BASE.u32All = 0; evergreen->DB_Z_WRITE_BASE.u32All = 0; @@ -1714,7 +1714,7 @@ void evergreenInitState(struct gl_context * ctx) //diff evergreen->DB_DEPTH_VIEW.u32All = 0; evergreen->DB_SHADER_CONTROL.u32All = 0; - SETbit(evergreen->DB_SHADER_CONTROL.u32All, EG_DB_SHADER_CONTROL__DUAL_EXPORT_ENABLE_bit); + SETbit(evergreen->DB_SHADER_CONTROL.u32All, EG_DB_SHADER_CONTROL__DUAL_EXPORT_ENABLE_bit); evergreen->DB_Z_INFO.u32All = 0; SETfield(evergreen->DB_Z_INFO.u32All , ARRAY_1D_TILED_THIN1, @@ -1752,21 +1752,21 @@ void evergreenInitState(struct gl_context * ctx) //diff ctx->Stencil.ZPassFunc[0]); // Disable ROP3 modes by setting src to dst copy: - SETfield(evergreen->CB_COLOR_CONTROL.u32All, 0xCC, - EG_CB_COLOR_CONTROL__ROP3_shift, - EG_CB_COLOR_CONTROL__ROP3_mask); + SETfield(evergreen->CB_COLOR_CONTROL.u32All, 0xCC, + EG_CB_COLOR_CONTROL__ROP3_shift, + EG_CB_COLOR_CONTROL__ROP3_mask); SETfield(evergreen->CB_COLOR_CONTROL.u32All, EG_CB_NORMAL, EG_CB_COLOR_CONTROL__MODE_shift, EG_CB_COLOR_CONTROL__MODE_mask); SETfield(evergreen->CB_BLEND0_CONTROL.u32All, BLEND_ONE, COLOR_SRCBLEND_shift, COLOR_SRCBLEND_mask); - + SETfield(evergreen->CB_BLEND0_CONTROL.u32All, BLEND_ONE, ALPHA_SRCBLEND_shift, ALPHA_SRCBLEND_mask); //evergreen->PA_CL_CLIP_CNTL.CLIP_DISABLE = 1; - + SETbit(evergreen->PA_CL_CLIP_CNTL.u32All, DX_LINEAR_ATTR_CLIP_ENA_bit); // Set up the culling control register: @@ -1774,10 +1774,10 @@ void evergreenInitState(struct gl_context * ctx) //diff POLYMODE_FRONT_PTYPE_shift, POLYMODE_FRONT_PTYPE_mask); // draw using triangles SETfield(evergreen->PA_SU_SC_MODE_CNTL.u32All, 2, POLYMODE_BACK_PTYPE_shift, POLYMODE_BACK_PTYPE_mask); // draw using triangles - - // Do scale XY or X by 1/W0. eg: + + // Do scale XY or X by 1/W0. eg: evergreen->bEnablePerspective = GL_TRUE; - + CLEARbit(evergreen->PA_CL_VTE_CNTL.u32All, VTX_XY_FMT_bit); CLEARbit(evergreen->PA_CL_VTE_CNTL.u32All, VTX_Z_FMT_bit); SETbit(evergreen->PA_CL_VTE_CNTL.u32All, VTX_W0_FMT_bit); @@ -1798,27 +1798,27 @@ void evergreenInitState(struct gl_context * ctx) //diff CLEARfield(evergreen->PA_SU_POINT_MINMAX.u32All, MIN_SIZE_mask); SETfield(evergreen->PA_SU_POINT_MINMAX.u32All, 0x8000, MAX_SIZE_shift, MAX_SIZE_mask); SETfield(evergreen->PA_SU_LINE_CNTL.u32All,0x8, - PA_SU_LINE_CNTL__WIDTH_shift, PA_SU_LINE_CNTL__WIDTH_mask); + PA_SU_LINE_CNTL__WIDTH_shift, PA_SU_LINE_CNTL__WIDTH_mask); // Set up line control: evergreen->PA_SC_LINE_CNTL.u32All = 0; CLEARbit(evergreen->PA_SC_LINE_CNTL.u32All, EXPAND_LINE_WIDTH_bit); - SETbit(evergreen->PA_SC_LINE_CNTL.u32All, LAST_PIXEL_bit); + SETbit(evergreen->PA_SC_LINE_CNTL.u32All, LAST_PIXEL_bit); // Set up vertex control: evergreen->PA_SU_VTX_CNTL.u32All = 0; - CLEARfield(evergreen->PA_SU_VTX_CNTL.u32All, QUANT_MODE_mask); + CLEARfield(evergreen->PA_SU_VTX_CNTL.u32All, QUANT_MODE_mask); SETbit(evergreen->PA_SU_VTX_CNTL.u32All, PIX_CENTER_bit); SETfield(evergreen->PA_SU_VTX_CNTL.u32All, X_ROUND_TO_EVEN, PA_SU_VTX_CNTL__ROUND_MODE_shift, PA_SU_VTX_CNTL__ROUND_MODE_mask); - + // to 1.0 = no guard band: evergreen->PA_CL_GB_VERT_CLIP_ADJ.u32All = 0x3F800000; // 1.0 evergreen->PA_CL_GB_VERT_DISC_ADJ.u32All = 0x3F800000; // 1.0 evergreen->PA_CL_GB_HORZ_CLIP_ADJ.u32All = 0x3F800000; // 1.0 evergreen->PA_CL_GB_HORZ_DISC_ADJ.u32All = 0x3F800000; // 1.0 - // Diable color compares: + // Diable color compares: SETfield(evergreen->CB_CLRCMP_CONTROL.u32All, CLRCMP_DRAW_ALWAYS, CLRCMP_FCN_SRC_shift, CLRCMP_FCN_SRC_mask); SETfield(evergreen->CB_CLRCMP_CONTROL.u32All, CLRCMP_DRAW_ALWAYS, @@ -1839,12 +1839,12 @@ void evergreenInitState(struct gl_context * ctx) //diff evergreen->PA_SC_AA_MASK.u32All = 0xFFFFFFFF; // Turn off AA: evergreen->PA_SC_AA_CONFIG.u32All = 0; - + SETfield(evergreen->VGT_OUT_DEALLOC_CNTL.u32All, 16, DEALLOC_DIST_shift, DEALLOC_DIST_mask); SETfield(evergreen->VGT_VERTEX_REUSE_BLOCK_CNTL.u32All, 14, VTX_REUSE_DEPTH_shift, VTX_REUSE_DEPTH_mask); - + evergreen->SX_MISC.u32All = 0; SETfield(evergreen->render_target[id].CB_COLOR0_INFO.u32All, 1, @@ -1852,14 +1852,14 @@ void evergreenInitState(struct gl_context * ctx) //diff SETbit(evergreen->render_target[id].CB_COLOR0_INFO.u32All, EG_CB_COLOR0_INFO__BLEND_CLAMP_bit); SETfield(evergreen->render_target[id].CB_COLOR0_INFO.u32All, 0, EG_CB_COLOR0_INFO__NUMBER_TYPE_shift, EG_CB_COLOR0_INFO__NUMBER_TYPE_mask); - + SETfield(evergreen->render_target[id].CB_COLOR0_INFO.u32All, SWAP_STD, EG_CB_COLOR0_INFO__COMP_SWAP_shift, EG_CB_COLOR0_INFO__COMP_SWAP_mask); evergreen->render_target[id].CB_COLOR0_VIEW.u32All = 0; evergreen->render_target[id].CB_COLOR0_CMASK.u32All = 0; evergreen->render_target[id].CB_COLOR0_FMASK.u32All = 0; - evergreen->render_target[id].CB_COLOR0_FMASK_SLICE.u32All = 0; + evergreen->render_target[id].CB_COLOR0_FMASK_SLICE.u32All = 0; evergreenInitSQConfig(ctx); diff --git a/src/mesa/drivers/dri/r600/evergreen_tex.c b/src/mesa/drivers/dri/r600/evergreen_tex.c index 3b5448a..9be681f 100644 --- a/src/mesa/drivers/dri/r600/evergreen_tex.c +++ b/src/mesa/drivers/dri/r600/evergreen_tex.c @@ -73,18 +73,18 @@ static GLboolean evergreenGetTexFormat(struct gl_texture_object *tObj, gl_format CLEARbit(t->SQ_TEX_RESOURCE4, SQ_TEX_RESOURCE_WORD4_0__FORCE_DEGAMMA_bit); SETfield(t->SQ_TEX_RESOURCE4, SQ_FORMAT_COMP_UNSIGNED, - FORMAT_COMP_X_shift, + FORMAT_COMP_X_shift, FORMAT_COMP_X_mask); SETfield(t->SQ_TEX_RESOURCE4, SQ_FORMAT_COMP_UNSIGNED, - FORMAT_COMP_Y_shift, + FORMAT_COMP_Y_shift, FORMAT_COMP_Y_mask); SETfield(t->SQ_TEX_RESOURCE4, SQ_FORMAT_COMP_UNSIGNED, - FORMAT_COMP_Z_shift, + FORMAT_COMP_Z_shift, FORMAT_COMP_Z_mask); SETfield(t->SQ_TEX_RESOURCE4, SQ_FORMAT_COMP_UNSIGNED, - FORMAT_COMP_W_shift, + FORMAT_COMP_W_shift, FORMAT_COMP_W_mask); - + SETfield(t->SQ_TEX_RESOURCE1, ARRAY_LINEAR_GENERAL, EG_SQ_TEX_RESOURCE_WORD1_0__ARRAY_MODE_shift, EG_SQ_TEX_RESOURCE_WORD1_0__ARRAY_MODE_mask); @@ -94,7 +94,7 @@ static GLboolean evergreenGetTexFormat(struct gl_texture_object *tObj, gl_format case MESA_FORMAT_RGBA8888: case MESA_FORMAT_SIGNED_RGBA8888: SETfield(t->SQ_TEX_RESOURCE7, FMT_8_8_8_8, - EG_SQ_TEX_RESOURCE_WORD7_0__DATA_FORMAT_shift, + EG_SQ_TEX_RESOURCE_WORD7_0__DATA_FORMAT_shift, EG_SQ_TEX_RESOURCE_WORD7_0__DATA_FORMAT_mask); SETfield(t->SQ_TEX_RESOURCE4, SQ_SEL_W, @@ -119,7 +119,7 @@ static GLboolean evergreenGetTexFormat(struct gl_texture_object *tObj, gl_format case MESA_FORMAT_RGBA8888_REV: case MESA_FORMAT_SIGNED_RGBA8888_REV: SETfield(t->SQ_TEX_RESOURCE7, FMT_8_8_8_8, - EG_SQ_TEX_RESOURCE_WORD7_0__DATA_FORMAT_shift, + EG_SQ_TEX_RESOURCE_WORD7_0__DATA_FORMAT_shift, EG_SQ_TEX_RESOURCE_WORD7_0__DATA_FORMAT_mask); SETfield(t->SQ_TEX_RESOURCE4, SQ_SEL_X, @@ -143,7 +143,7 @@ static GLboolean evergreenGetTexFormat(struct gl_texture_object *tObj, gl_format break; case MESA_FORMAT_ARGB8888: SETfield(t->SQ_TEX_RESOURCE7, FMT_8_8_8_8, - EG_SQ_TEX_RESOURCE_WORD7_0__DATA_FORMAT_shift, + EG_SQ_TEX_RESOURCE_WORD7_0__DATA_FORMAT_shift, EG_SQ_TEX_RESOURCE_WORD7_0__DATA_FORMAT_mask); SETfield(t->SQ_TEX_RESOURCE4, SQ_SEL_Z, @@ -157,7 +157,7 @@ static GLboolean evergreenGetTexFormat(struct gl_texture_object *tObj, gl_format break; case MESA_FORMAT_XRGB8888: SETfield(t->SQ_TEX_RESOURCE7, FMT_8_8_8_8, - EG_SQ_TEX_RESOURCE_WORD7_0__DATA_FORMAT_shift, + EG_SQ_TEX_RESOURCE_WORD7_0__DATA_FORMAT_shift, EG_SQ_TEX_RESOURCE_WORD7_0__DATA_FORMAT_mask); SETfield(t->SQ_TEX_RESOURCE4, SQ_SEL_Z, @@ -171,7 +171,7 @@ static GLboolean evergreenGetTexFormat(struct gl_texture_object *tObj, gl_format break; case MESA_FORMAT_XRGB8888_REV: SETfield(t->SQ_TEX_RESOURCE7, FMT_8_8_8_8, - EG_SQ_TEX_RESOURCE_WORD7_0__DATA_FORMAT_shift, + EG_SQ_TEX_RESOURCE_WORD7_0__DATA_FORMAT_shift, EG_SQ_TEX_RESOURCE_WORD7_0__DATA_FORMAT_mask); SETfield(t->SQ_TEX_RESOURCE4, SQ_SEL_1, @@ -185,7 +185,7 @@ static GLboolean evergreenGetTexFormat(struct gl_texture_object *tObj, gl_format break; case MESA_FORMAT_ARGB8888_REV: SETfield(t->SQ_TEX_RESOURCE7, FMT_8_8_8_8, - EG_SQ_TEX_RESOURCE_WORD7_0__DATA_FORMAT_shift, + EG_SQ_TEX_RESOURCE_WORD7_0__DATA_FORMAT_shift, EG_SQ_TEX_RESOURCE_WORD7_0__DATA_FORMAT_mask); SETfield(t->SQ_TEX_RESOURCE4, SQ_SEL_Y, @@ -199,7 +199,7 @@ static GLboolean evergreenGetTexFormat(struct gl_texture_object *tObj, gl_format break; case MESA_FORMAT_RGB888: SETfield(t->SQ_TEX_RESOURCE7, FMT_8_8_8, - EG_SQ_TEX_RESOURCE_WORD7_0__DATA_FORMAT_shift, + EG_SQ_TEX_RESOURCE_WORD7_0__DATA_FORMAT_shift, EG_SQ_TEX_RESOURCE_WORD7_0__DATA_FORMAT_mask); SETfield(t->SQ_TEX_RESOURCE4, SQ_SEL_Z, @@ -213,7 +213,7 @@ static GLboolean evergreenGetTexFormat(struct gl_texture_object *tObj, gl_format break; case MESA_FORMAT_RGB565: SETfield(t->SQ_TEX_RESOURCE7, FMT_5_6_5, - EG_SQ_TEX_RESOURCE_WORD7_0__DATA_FORMAT_shift, + EG_SQ_TEX_RESOURCE_WORD7_0__DATA_FORMAT_shift, EG_SQ_TEX_RESOURCE_WORD7_0__DATA_FORMAT_mask); SETfield(t->SQ_TEX_RESOURCE4, SQ_SEL_Z, @@ -227,7 +227,7 @@ static GLboolean evergreenGetTexFormat(struct gl_texture_object *tObj, gl_format break; case MESA_FORMAT_RGB565_REV: SETfield(t->SQ_TEX_RESOURCE7, FMT_5_6_5, - EG_SQ_TEX_RESOURCE_WORD7_0__DATA_FORMAT_shift, + EG_SQ_TEX_RESOURCE_WORD7_0__DATA_FORMAT_shift, EG_SQ_TEX_RESOURCE_WORD7_0__DATA_FORMAT_mask); SETfield(t->SQ_TEX_RESOURCE4, SQ_SEL_X, @@ -241,7 +241,7 @@ static GLboolean evergreenGetTexFormat(struct gl_texture_object *tObj, gl_format break; case MESA_FORMAT_ARGB4444: SETfield(t->SQ_TEX_RESOURCE7, FMT_4_4_4_4, - EG_SQ_TEX_RESOURCE_WORD7_0__DATA_FORMAT_shift, + EG_SQ_TEX_RESOURCE_WORD7_0__DATA_FORMAT_shift, EG_SQ_TEX_RESOURCE_WORD7_0__DATA_FORMAT_mask); SETfield(t->SQ_TEX_RESOURCE4, SQ_SEL_Z, @@ -255,7 +255,7 @@ static GLboolean evergreenGetTexFormat(struct gl_texture_object *tObj, gl_format break; case MESA_FORMAT_ARGB4444_REV: SETfield(t->SQ_TEX_RESOURCE7, FMT_4_4_4_4, - EG_SQ_TEX_RESOURCE_WORD7_0__DATA_FORMAT_shift, + EG_SQ_TEX_RESOURCE_WORD7_0__DATA_FORMAT_shift, EG_SQ_TEX_RESOURCE_WORD7_0__DATA_FORMAT_mask); SETfield(t->SQ_TEX_RESOURCE4, SQ_SEL_Y, @@ -269,7 +269,7 @@ static GLboolean evergreenGetTexFormat(struct gl_texture_object *tObj, gl_format break; case MESA_FORMAT_ARGB1555: SETfield(t->SQ_TEX_RESOURCE7, FMT_1_5_5_5, - EG_SQ_TEX_RESOURCE_WORD7_0__DATA_FORMAT_shift, + EG_SQ_TEX_RESOURCE_WORD7_0__DATA_FORMAT_shift, EG_SQ_TEX_RESOURCE_WORD7_0__DATA_FORMAT_mask); SETfield(t->SQ_TEX_RESOURCE4, SQ_SEL_Z, @@ -283,7 +283,7 @@ static GLboolean evergreenGetTexFormat(struct gl_texture_object *tObj, gl_format break; case MESA_FORMAT_ARGB1555_REV: SETfield(t->SQ_TEX_RESOURCE7, FMT_1_5_5_5, - EG_SQ_TEX_RESOURCE_WORD7_0__DATA_FORMAT_shift, + EG_SQ_TEX_RESOURCE_WORD7_0__DATA_FORMAT_shift, EG_SQ_TEX_RESOURCE_WORD7_0__DATA_FORMAT_mask); SETfield(t->SQ_TEX_RESOURCE4, SQ_SEL_Y, @@ -298,7 +298,7 @@ static GLboolean evergreenGetTexFormat(struct gl_texture_object *tObj, gl_format case MESA_FORMAT_AL88: case MESA_FORMAT_AL88_REV: /* TODO : Check this. */ SETfield(t->SQ_TEX_RESOURCE7, FMT_8_8, - EG_SQ_TEX_RESOURCE_WORD7_0__DATA_FORMAT_shift, + EG_SQ_TEX_RESOURCE_WORD7_0__DATA_FORMAT_shift, EG_SQ_TEX_RESOURCE_WORD7_0__DATA_FORMAT_mask); SETfield(t->SQ_TEX_RESOURCE4, SQ_SEL_X, @@ -312,7 +312,7 @@ static GLboolean evergreenGetTexFormat(struct gl_texture_object *tObj, gl_format break; case MESA_FORMAT_RGB332: SETfield(t->SQ_TEX_RESOURCE7, FMT_3_3_2, - EG_SQ_TEX_RESOURCE_WORD7_0__DATA_FORMAT_shift, + EG_SQ_TEX_RESOURCE_WORD7_0__DATA_FORMAT_shift, EG_SQ_TEX_RESOURCE_WORD7_0__DATA_FORMAT_mask); SETfield(t->SQ_TEX_RESOURCE4, SQ_SEL_Z, @@ -326,7 +326,7 @@ static GLboolean evergreenGetTexFormat(struct gl_texture_object *tObj, gl_format break; case MESA_FORMAT_A8: /* ZERO, ZERO, ZERO, X */ SETfield(t->SQ_TEX_RESOURCE7, FMT_8, - EG_SQ_TEX_RESOURCE_WORD7_0__DATA_FORMAT_shift, + EG_SQ_TEX_RESOURCE_WORD7_0__DATA_FORMAT_shift, EG_SQ_TEX_RESOURCE_WORD7_0__DATA_FORMAT_mask); SETfield(t->SQ_TEX_RESOURCE4, SQ_SEL_0, @@ -340,7 +340,7 @@ static GLboolean evergreenGetTexFormat(struct gl_texture_object *tObj, gl_format break; case MESA_FORMAT_L8: /* X, X, X, ONE */ SETfield(t->SQ_TEX_RESOURCE7, FMT_8, - EG_SQ_TEX_RESOURCE_WORD7_0__DATA_FORMAT_shift, + EG_SQ_TEX_RESOURCE_WORD7_0__DATA_FORMAT_shift, EG_SQ_TEX_RESOURCE_WORD7_0__DATA_FORMAT_mask); SETfield(t->SQ_TEX_RESOURCE4, SQ_SEL_X, @@ -355,7 +355,7 @@ static GLboolean evergreenGetTexFormat(struct gl_texture_object *tObj, gl_format case MESA_FORMAT_I8: /* X, X, X, X */ case MESA_FORMAT_CI8: SETfield(t->SQ_TEX_RESOURCE7, FMT_8, - EG_SQ_TEX_RESOURCE_WORD7_0__DATA_FORMAT_shift, + EG_SQ_TEX_RESOURCE_WORD7_0__DATA_FORMAT_shift, EG_SQ_TEX_RESOURCE_WORD7_0__DATA_FORMAT_mask); SETfield(t->SQ_TEX_RESOURCE4, SQ_SEL_X, @@ -366,7 +366,7 @@ static GLboolean evergreenGetTexFormat(struct gl_texture_object *tObj, gl_format SQ_TEX_RESOURCE_WORD4_0__DST_SEL_Z_shift, SQ_TEX_RESOURCE_WORD4_0__DST_SEL_Z_mask); SETfield(t->SQ_TEX_RESOURCE4, SQ_SEL_X, SQ_TEX_RESOURCE_WORD4_0__DST_SEL_W_shift, SQ_TEX_RESOURCE_WORD4_0__DST_SEL_W_mask); - break; + break; case MESA_FORMAT_RGB_DXT1: /* not supported yet */ case MESA_FORMAT_RGBA_DXT1: /* not supported yet */ case MESA_FORMAT_RGBA_DXT3: /* not supported yet */ @@ -375,7 +375,7 @@ static GLboolean evergreenGetTexFormat(struct gl_texture_object *tObj, gl_format case MESA_FORMAT_RGBA_FLOAT32: SETfield(t->SQ_TEX_RESOURCE7, FMT_32_32_32_32_FLOAT, - EG_SQ_TEX_RESOURCE_WORD7_0__DATA_FORMAT_shift, + EG_SQ_TEX_RESOURCE_WORD7_0__DATA_FORMAT_shift, EG_SQ_TEX_RESOURCE_WORD7_0__DATA_FORMAT_mask); SETfield(t->SQ_TEX_RESOURCE4, SQ_SEL_X, @@ -389,7 +389,7 @@ static GLboolean evergreenGetTexFormat(struct gl_texture_object *tObj, gl_format break; case MESA_FORMAT_RGBA_FLOAT16: SETfield(t->SQ_TEX_RESOURCE7, FMT_16_16_16_16_FLOAT, - EG_SQ_TEX_RESOURCE_WORD7_0__DATA_FORMAT_shift, + EG_SQ_TEX_RESOURCE_WORD7_0__DATA_FORMAT_shift, EG_SQ_TEX_RESOURCE_WORD7_0__DATA_FORMAT_mask); SETfield(t->SQ_TEX_RESOURCE4, SQ_SEL_X, @@ -403,7 +403,7 @@ static GLboolean evergreenGetTexFormat(struct gl_texture_object *tObj, gl_format break; case MESA_FORMAT_RGB_FLOAT32: /* X, Y, Z, ONE */ SETfield(t->SQ_TEX_RESOURCE7, FMT_32_32_32_FLOAT, - EG_SQ_TEX_RESOURCE_WORD7_0__DATA_FORMAT_shift, + EG_SQ_TEX_RESOURCE_WORD7_0__DATA_FORMAT_shift, EG_SQ_TEX_RESOURCE_WORD7_0__DATA_FORMAT_mask); SETfield(t->SQ_TEX_RESOURCE4, SQ_SEL_X, @@ -417,7 +417,7 @@ static GLboolean evergreenGetTexFormat(struct gl_texture_object *tObj, gl_format break; case MESA_FORMAT_RGB_FLOAT16: SETfield(t->SQ_TEX_RESOURCE7, FMT_16_16_16_FLOAT, - EG_SQ_TEX_RESOURCE_WORD7_0__DATA_FORMAT_shift, + EG_SQ_TEX_RESOURCE_WORD7_0__DATA_FORMAT_shift, EG_SQ_TEX_RESOURCE_WORD7_0__DATA_FORMAT_mask); SETfield(t->SQ_TEX_RESOURCE4, SQ_SEL_X, @@ -431,7 +431,7 @@ static GLboolean evergreenGetTexFormat(struct gl_texture_object *tObj, gl_format break; case MESA_FORMAT_ALPHA_FLOAT32: /* ZERO, ZERO, ZERO, X */ SETfield(t->SQ_TEX_RESOURCE7, FMT_32_FLOAT, - EG_SQ_TEX_RESOURCE_WORD7_0__DATA_FORMAT_shift, + EG_SQ_TEX_RESOURCE_WORD7_0__DATA_FORMAT_shift, EG_SQ_TEX_RESOURCE_WORD7_0__DATA_FORMAT_mask); SETfield(t->SQ_TEX_RESOURCE4, SQ_SEL_0, @@ -445,7 +445,7 @@ static GLboolean evergreenGetTexFormat(struct gl_texture_object *tObj, gl_format break; case MESA_FORMAT_ALPHA_FLOAT16: /* ZERO, ZERO, ZERO, X */ SETfield(t->SQ_TEX_RESOURCE7, FMT_16_FLOAT, - EG_SQ_TEX_RESOURCE_WORD7_0__DATA_FORMAT_shift, + EG_SQ_TEX_RESOURCE_WORD7_0__DATA_FORMAT_shift, EG_SQ_TEX_RESOURCE_WORD7_0__DATA_FORMAT_mask); SETfield(t->SQ_TEX_RESOURCE4, SQ_SEL_0, @@ -459,7 +459,7 @@ static GLboolean evergreenGetTexFormat(struct gl_texture_object *tObj, gl_format break; case MESA_FORMAT_LUMINANCE_FLOAT32: /* X, X, X, ONE */ SETfield(t->SQ_TEX_RESOURCE7, FMT_32_FLOAT, - EG_SQ_TEX_RESOURCE_WORD7_0__DATA_FORMAT_shift, + EG_SQ_TEX_RESOURCE_WORD7_0__DATA_FORMAT_shift, EG_SQ_TEX_RESOURCE_WORD7_0__DATA_FORMAT_mask); SETfield(t->SQ_TEX_RESOURCE4, SQ_SEL_X, @@ -473,7 +473,7 @@ static GLboolean evergreenGetTexFormat(struct gl_texture_object *tObj, gl_format break; case MESA_FORMAT_LUMINANCE_FLOAT16: /* X, X, X, ONE */ SETfield(t->SQ_TEX_RESOURCE7, FMT_16_FLOAT, - EG_SQ_TEX_RESOURCE_WORD7_0__DATA_FORMAT_shift, + EG_SQ_TEX_RESOURCE_WORD7_0__DATA_FORMAT_shift, EG_SQ_TEX_RESOURCE_WORD7_0__DATA_FORMAT_mask); SETfield(t->SQ_TEX_RESOURCE4, SQ_SEL_X, @@ -487,7 +487,7 @@ static GLboolean evergreenGetTexFormat(struct gl_texture_object *tObj, gl_format break; case MESA_FORMAT_LUMINANCE_ALPHA_FLOAT32: SETfield(t->SQ_TEX_RESOURCE7, FMT_32_32_FLOAT, - EG_SQ_TEX_RESOURCE_WORD7_0__DATA_FORMAT_shift, + EG_SQ_TEX_RESOURCE_WORD7_0__DATA_FORMAT_shift, EG_SQ_TEX_RESOURCE_WORD7_0__DATA_FORMAT_mask); SETfield(t->SQ_TEX_RESOURCE4, SQ_SEL_X, @@ -501,7 +501,7 @@ static GLboolean evergreenGetTexFormat(struct gl_texture_object *tObj, gl_format break; case MESA_FORMAT_LUMINANCE_ALPHA_FLOAT16: SETfield(t->SQ_TEX_RESOURCE7, FMT_16_16_FLOAT, - EG_SQ_TEX_RESOURCE_WORD7_0__DATA_FORMAT_shift, + EG_SQ_TEX_RESOURCE_WORD7_0__DATA_FORMAT_shift, EG_SQ_TEX_RESOURCE_WORD7_0__DATA_FORMAT_mask); SETfield(t->SQ_TEX_RESOURCE4, SQ_SEL_X, @@ -515,7 +515,7 @@ static GLboolean evergreenGetTexFormat(struct gl_texture_object *tObj, gl_format break; case MESA_FORMAT_INTENSITY_FLOAT32: /* X, X, X, X */ SETfield(t->SQ_TEX_RESOURCE7, FMT_32_FLOAT, - EG_SQ_TEX_RESOURCE_WORD7_0__DATA_FORMAT_shift, + EG_SQ_TEX_RESOURCE_WORD7_0__DATA_FORMAT_shift, EG_SQ_TEX_RESOURCE_WORD7_0__DATA_FORMAT_mask); SETfield(t->SQ_TEX_RESOURCE4, SQ_SEL_X, @@ -529,7 +529,7 @@ static GLboolean evergreenGetTexFormat(struct gl_texture_object *tObj, gl_format break; case MESA_FORMAT_INTENSITY_FLOAT16: /* X, X, X, X */ SETfield(t->SQ_TEX_RESOURCE7, FMT_16_FLOAT, - EG_SQ_TEX_RESOURCE_WORD7_0__DATA_FORMAT_shift, + EG_SQ_TEX_RESOURCE_WORD7_0__DATA_FORMAT_shift, EG_SQ_TEX_RESOURCE_WORD7_0__DATA_FORMAT_mask); SETfield(t->SQ_TEX_RESOURCE4, SQ_SEL_X, @@ -546,36 +546,36 @@ static GLboolean evergreenGetTexFormat(struct gl_texture_object *tObj, gl_format case MESA_FORMAT_S8_Z24: case MESA_FORMAT_Z24_S8: case MESA_FORMAT_Z32: - case MESA_FORMAT_S8: - CLEARbit(t->SQ_TEX_RESOURCE0, EG_SQ_TEX_RESOURCE_WORD0_0__NDTO_bit); + case MESA_FORMAT_S8: + CLEARbit(t->SQ_TEX_RESOURCE0, EG_SQ_TEX_RESOURCE_WORD0_0__NDTO_bit); SETfield(t->SQ_TEX_RESOURCE1, ARRAY_1D_TILED_THIN1, EG_SQ_TEX_RESOURCE_WORD1_0__ARRAY_MODE_shift, EG_SQ_TEX_RESOURCE_WORD1_0__ARRAY_MODE_mask); switch (mesa_format) { case MESA_FORMAT_Z16: SETfield(t->SQ_TEX_RESOURCE7, FMT_16, - EG_SQ_TEX_RESOURCE_WORD7_0__DATA_FORMAT_shift, + EG_SQ_TEX_RESOURCE_WORD7_0__DATA_FORMAT_shift, EG_SQ_TEX_RESOURCE_WORD7_0__DATA_FORMAT_mask); break; case MESA_FORMAT_X8_Z24: case MESA_FORMAT_S8_Z24: SETfield(t->SQ_TEX_RESOURCE7, FMT_8_24, - EG_SQ_TEX_RESOURCE_WORD7_0__DATA_FORMAT_shift, + EG_SQ_TEX_RESOURCE_WORD7_0__DATA_FORMAT_shift, EG_SQ_TEX_RESOURCE_WORD7_0__DATA_FORMAT_mask); break; case MESA_FORMAT_Z24_S8: SETfield(t->SQ_TEX_RESOURCE7, FMT_24_8, - EG_SQ_TEX_RESOURCE_WORD7_0__DATA_FORMAT_shift, + EG_SQ_TEX_RESOURCE_WORD7_0__DATA_FORMAT_shift, EG_SQ_TEX_RESOURCE_WORD7_0__DATA_FORMAT_mask); break; case MESA_FORMAT_Z32: SETfield(t->SQ_TEX_RESOURCE7, FMT_32, - EG_SQ_TEX_RESOURCE_WORD7_0__DATA_FORMAT_shift, + EG_SQ_TEX_RESOURCE_WORD7_0__DATA_FORMAT_shift, EG_SQ_TEX_RESOURCE_WORD7_0__DATA_FORMAT_mask); break; case MESA_FORMAT_S8: SETfield(t->SQ_TEX_RESOURCE7, FMT_8, - EG_SQ_TEX_RESOURCE_WORD7_0__DATA_FORMAT_shift, + EG_SQ_TEX_RESOURCE_WORD7_0__DATA_FORMAT_shift, EG_SQ_TEX_RESOURCE_WORD7_0__DATA_FORMAT_mask); break; default: @@ -619,7 +619,7 @@ static GLboolean evergreenGetTexFormat(struct gl_texture_object *tObj, gl_format /* EXT_texture_sRGB */ case MESA_FORMAT_SRGBA8: SETfield(t->SQ_TEX_RESOURCE7, FMT_8_8_8_8, - EG_SQ_TEX_RESOURCE_WORD7_0__DATA_FORMAT_shift, + EG_SQ_TEX_RESOURCE_WORD7_0__DATA_FORMAT_shift, EG_SQ_TEX_RESOURCE_WORD7_0__DATA_FORMAT_mask); SETfield(t->SQ_TEX_RESOURCE4, SQ_SEL_W, @@ -634,7 +634,7 @@ static GLboolean evergreenGetTexFormat(struct gl_texture_object *tObj, gl_format break; case MESA_FORMAT_SLA8: SETfield(t->SQ_TEX_RESOURCE7, FMT_8_8, - EG_SQ_TEX_RESOURCE_WORD7_0__DATA_FORMAT_shift, + EG_SQ_TEX_RESOURCE_WORD7_0__DATA_FORMAT_shift, EG_SQ_TEX_RESOURCE_WORD7_0__DATA_FORMAT_mask); SETfield(t->SQ_TEX_RESOURCE4, SQ_SEL_X, @@ -649,7 +649,7 @@ static GLboolean evergreenGetTexFormat(struct gl_texture_object *tObj, gl_format break; case MESA_FORMAT_SL8: /* X, X, X, ONE */ SETfield(t->SQ_TEX_RESOURCE7, FMT_8, - EG_SQ_TEX_RESOURCE_WORD7_0__DATA_FORMAT_shift, + EG_SQ_TEX_RESOURCE_WORD7_0__DATA_FORMAT_shift, EG_SQ_TEX_RESOURCE_WORD7_0__DATA_FORMAT_mask); SETfield(t->SQ_TEX_RESOURCE4, SQ_SEL_X, @@ -700,24 +700,24 @@ static void evergreenUpdateTexWrap(radeonTexObjPtr t) struct gl_texture_object *tObj = &t->base; SETfield(t->SQ_TEX_SAMPLER0, evergreen_translate_wrap_mode(tObj->WrapS), - EG_SQ_TEX_SAMPLER_WORD0_0__CLAMP_X_shift, + EG_SQ_TEX_SAMPLER_WORD0_0__CLAMP_X_shift, EG_SQ_TEX_SAMPLER_WORD0_0__CLAMP_X_mask); - if (tObj->Target != GL_TEXTURE_1D) + if (tObj->Target != GL_TEXTURE_1D) { SETfield(t->SQ_TEX_SAMPLER0, evergreen_translate_wrap_mode(tObj->WrapT), - EG_SQ_TEX_SAMPLER_WORD0_0__CLAMP_Y_shift, + EG_SQ_TEX_SAMPLER_WORD0_0__CLAMP_Y_shift, EG_SQ_TEX_SAMPLER_WORD0_0__CLAMP_Y_mask); if (tObj->Target == GL_TEXTURE_3D) SETfield(t->SQ_TEX_SAMPLER0, evergreen_translate_wrap_mode(tObj->WrapR), - EG_SQ_TEX_SAMPLER_WORD0_0__CLAMP_Z_shift, + EG_SQ_TEX_SAMPLER_WORD0_0__CLAMP_Z_shift, EG_SQ_TEX_SAMPLER_WORD0_0__CLAMP_Z_mask); } } static void evergreenSetTexDefaultState(radeonTexObjPtr t) -{ +{ /* Init text object to default states. */ t->SQ_TEX_RESOURCE0 = 0; t->SQ_TEX_RESOURCE1 = 0; @@ -728,16 +728,16 @@ static void evergreenSetTexDefaultState(radeonTexObjPtr t) t->SQ_TEX_RESOURCE6 = 0; t->SQ_TEX_RESOURCE7 = 0; - SETfield(t->SQ_TEX_RESOURCE0, SQ_TEX_DIM_2D, - EG_SQ_TEX_RESOURCE_WORD0_0__DIM_shift, + SETfield(t->SQ_TEX_RESOURCE0, SQ_TEX_DIM_2D, + EG_SQ_TEX_RESOURCE_WORD0_0__DIM_shift, EG_SQ_TEX_RESOURCE_WORD0_0__DIM_mask); CLEARbit(t->SQ_TEX_RESOURCE0, EG_SQ_TEX_RESOURCE_WORD0_0__NDTO_bit); SETfield(t->SQ_TEX_RESOURCE1, ARRAY_LINEAR_GENERAL, - EG_SQ_TEX_RESOURCE_WORD1_0__ARRAY_MODE_shift, - EG_SQ_TEX_RESOURCE_WORD1_0__ARRAY_MODE_mask); - + EG_SQ_TEX_RESOURCE_WORD1_0__ARRAY_MODE_shift, + EG_SQ_TEX_RESOURCE_WORD1_0__ARRAY_MODE_mask); + SETfield(t->SQ_TEX_RESOURCE4, SQ_FORMAT_COMP_UNSIGNED, FORMAT_COMP_X_shift, FORMAT_COMP_X_mask); SETfield(t->SQ_TEX_RESOURCE4, SQ_FORMAT_COMP_UNSIGNED, @@ -752,7 +752,7 @@ static void evergreenSetTexDefaultState(radeonTexObjPtr t) CLEARbit(t->SQ_TEX_RESOURCE4, SQ_TEX_RESOURCE_WORD4_0__FORCE_DEGAMMA_bit); SETfield(t->SQ_TEX_RESOURCE4, SQ_ENDIAN_NONE, SQ_TEX_RESOURCE_WORD4_0__ENDIAN_SWAP_shift, SQ_TEX_RESOURCE_WORD4_0__ENDIAN_SWAP_mask); - + SETfield(t->SQ_TEX_RESOURCE4, SQ_SEL_X, SQ_TEX_RESOURCE_WORD4_0__DST_SEL_X_shift, SQ_TEX_RESOURCE_WORD4_0__DST_SEL_X_mask); @@ -765,47 +765,47 @@ static void evergreenSetTexDefaultState(radeonTexObjPtr t) SETfield(t->SQ_TEX_RESOURCE4, SQ_SEL_W, SQ_TEX_RESOURCE_WORD4_0__DST_SEL_W_shift, SQ_TEX_RESOURCE_WORD4_0__DST_SEL_W_mask); - SETfield(t->SQ_TEX_RESOURCE4, 0, - BASE_LEVEL_shift, - BASE_LEVEL_mask); /* mip-maps */ + SETfield(t->SQ_TEX_RESOURCE4, 0, + BASE_LEVEL_shift, + BASE_LEVEL_mask); /* mip-maps */ SETfield(t->SQ_TEX_RESOURCE7, FMT_8_8_8_8, - EG_SQ_TEX_RESOURCE_WORD7_0__DATA_FORMAT_shift, + EG_SQ_TEX_RESOURCE_WORD7_0__DATA_FORMAT_shift, EG_SQ_TEX_RESOURCE_WORD7_0__DATA_FORMAT_mask); SETfield(t->SQ_TEX_RESOURCE7, SQ_TEX_VTX_VALID_TEXTURE, - EG_SQ_TEX_RESOURCE_WORD7_0__TYPE_shift, + EG_SQ_TEX_RESOURCE_WORD7_0__TYPE_shift, EG_SQ_TEX_RESOURCE_WORD7_0__TYPE_mask); /* Initialize sampler registers */ t->SQ_TEX_SAMPLER0 = 0; - SETfield(t->SQ_TEX_SAMPLER0, SQ_TEX_WRAP, + SETfield(t->SQ_TEX_SAMPLER0, SQ_TEX_WRAP, EG_SQ_TEX_SAMPLER_WORD0_0__CLAMP_X_shift, EG_SQ_TEX_SAMPLER_WORD0_0__CLAMP_X_mask); - SETfield(t->SQ_TEX_SAMPLER0, SQ_TEX_WRAP, - EG_SQ_TEX_SAMPLER_WORD0_0__CLAMP_X_shift, + SETfield(t->SQ_TEX_SAMPLER0, SQ_TEX_WRAP, + EG_SQ_TEX_SAMPLER_WORD0_0__CLAMP_X_shift, EG_SQ_TEX_SAMPLER_WORD0_0__CLAMP_X_mask); - SETfield(t->SQ_TEX_SAMPLER0, SQ_TEX_WRAP, - EG_SQ_TEX_SAMPLER_WORD0_0__CLAMP_X_shift, + SETfield(t->SQ_TEX_SAMPLER0, SQ_TEX_WRAP, + EG_SQ_TEX_SAMPLER_WORD0_0__CLAMP_X_shift, EG_SQ_TEX_SAMPLER_WORD0_0__CLAMP_X_mask); - SETfield(t->SQ_TEX_SAMPLER0, SQ_TEX_XY_FILTER_POINT, - EG_SQ_TEX_SAMPLER_WORD0_0__XY_MAG_FILTER_shift, + SETfield(t->SQ_TEX_SAMPLER0, SQ_TEX_XY_FILTER_POINT, + EG_SQ_TEX_SAMPLER_WORD0_0__XY_MAG_FILTER_shift, EG_SQ_TEX_SAMPLER_WORD0_0__XY_MAG_FILTER_mask); - SETfield(t->SQ_TEX_SAMPLER0, SQ_TEX_XY_FILTER_POINT, - EG_SQ_TEX_SAMPLER_WORD0_0__XY_MIN_FILTER_shift, + SETfield(t->SQ_TEX_SAMPLER0, SQ_TEX_XY_FILTER_POINT, + EG_SQ_TEX_SAMPLER_WORD0_0__XY_MIN_FILTER_shift, EG_SQ_TEX_SAMPLER_WORD0_0__XY_MIN_FILTER_mask); - SETfield(t->SQ_TEX_SAMPLER0, SQ_TEX_Z_FILTER_NONE, - EG_SQ_TEX_SAMPLER_WORD0_0__Z_FILTER_shift, + SETfield(t->SQ_TEX_SAMPLER0, SQ_TEX_Z_FILTER_NONE, + EG_SQ_TEX_SAMPLER_WORD0_0__Z_FILTER_shift, EG_SQ_TEX_SAMPLER_WORD0_0__Z_FILTER_mask); - SETfield(t->SQ_TEX_SAMPLER0, SQ_TEX_Z_FILTER_NONE, - EG_SQ_TEX_SAMPLER_WORD0_0__MIP_FILTER_shift, + SETfield(t->SQ_TEX_SAMPLER0, SQ_TEX_Z_FILTER_NONE, + EG_SQ_TEX_SAMPLER_WORD0_0__MIP_FILTER_shift, EG_SQ_TEX_SAMPLER_WORD0_0__MIP_FILTER_mask); - SETfield(t->SQ_TEX_SAMPLER0, SQ_TEX_BORDER_COLOR_TRANS_BLACK, - EG_SQ_TEX_SAMPLER_WORD0_0__BORDER_COLOR_TYPE_shift, + SETfield(t->SQ_TEX_SAMPLER0, SQ_TEX_BORDER_COLOR_TRANS_BLACK, + EG_SQ_TEX_SAMPLER_WORD0_0__BORDER_COLOR_TYPE_shift, EG_SQ_TEX_SAMPLER_WORD0_0__BORDER_COLOR_TYPE_mask); t->SQ_TEX_SAMPLER1 = 0; - SETfield(t->SQ_TEX_SAMPLER1, 0x7ff, - EG_SQ_TEX_SAMPLER_WORD1_0__MAX_LOD_shift, + SETfield(t->SQ_TEX_SAMPLER1, 0x7ff, + EG_SQ_TEX_SAMPLER_WORD1_0__MAX_LOD_shift, EG_SQ_TEX_SAMPLER_WORD1_0__MAX_LOD_mask); t->SQ_TEX_SAMPLER2 = 0; @@ -831,54 +831,54 @@ static void evergreenSetTexFilter(radeonTexObjPtr t, GLenum minf, GLenum magf, G return; } - switch (minf) + switch (minf) { case GL_NEAREST: SETfield(t->SQ_TEX_SAMPLER0, TEX_XYFilter_Point, - EG_SQ_TEX_SAMPLER_WORD0_0__XY_MIN_FILTER_shift, + EG_SQ_TEX_SAMPLER_WORD0_0__XY_MIN_FILTER_shift, EG_SQ_TEX_SAMPLER_WORD0_0__XY_MIN_FILTER_mask); SETfield(t->SQ_TEX_SAMPLER0, TEX_MipFilter_None, - EG_SQ_TEX_SAMPLER_WORD0_0__MIP_FILTER_shift, + EG_SQ_TEX_SAMPLER_WORD0_0__MIP_FILTER_shift, EG_SQ_TEX_SAMPLER_WORD0_0__MIP_FILTER_mask); break; case GL_LINEAR: SETfield(t->SQ_TEX_SAMPLER0, TEX_XYFilter_Linear, - EG_SQ_TEX_SAMPLER_WORD0_0__XY_MIN_FILTER_shift, + EG_SQ_TEX_SAMPLER_WORD0_0__XY_MIN_FILTER_shift, EG_SQ_TEX_SAMPLER_WORD0_0__XY_MIN_FILTER_mask); SETfield(t->SQ_TEX_SAMPLER0, TEX_MipFilter_None, - EG_SQ_TEX_SAMPLER_WORD0_0__MIP_FILTER_shift, + EG_SQ_TEX_SAMPLER_WORD0_0__MIP_FILTER_shift, EG_SQ_TEX_SAMPLER_WORD0_0__MIP_FILTER_mask); break; case GL_NEAREST_MIPMAP_NEAREST: SETfield(t->SQ_TEX_SAMPLER0, TEX_XYFilter_Point, - EG_SQ_TEX_SAMPLER_WORD0_0__XY_MIN_FILTER_shift, + EG_SQ_TEX_SAMPLER_WORD0_0__XY_MIN_FILTER_shift, EG_SQ_TEX_SAMPLER_WORD0_0__XY_MIN_FILTER_mask); SETfield(t->SQ_TEX_SAMPLER0, TEX_MipFilter_Point, - EG_SQ_TEX_SAMPLER_WORD0_0__MIP_FILTER_shift, + EG_SQ_TEX_SAMPLER_WORD0_0__MIP_FILTER_shift, EG_SQ_TEX_SAMPLER_WORD0_0__MIP_FILTER_mask); break; case GL_NEAREST_MIPMAP_LINEAR: SETfield(t->SQ_TEX_SAMPLER0, TEX_XYFilter_Point, - EG_SQ_TEX_SAMPLER_WORD0_0__XY_MIN_FILTER_shift, + EG_SQ_TEX_SAMPLER_WORD0_0__XY_MIN_FILTER_shift, EG_SQ_TEX_SAMPLER_WORD0_0__XY_MIN_FILTER_mask); SETfield(t->SQ_TEX_SAMPLER0, TEX_MipFilter_Linear, - EG_SQ_TEX_SAMPLER_WORD0_0__MIP_FILTER_shift, + EG_SQ_TEX_SAMPLER_WORD0_0__MIP_FILTER_shift, EG_SQ_TEX_SAMPLER_WORD0_0__MIP_FILTER_mask); break; case GL_LINEAR_MIPMAP_NEAREST: SETfield(t->SQ_TEX_SAMPLER0, TEX_XYFilter_Linear, - EG_SQ_TEX_SAMPLER_WORD0_0__XY_MIN_FILTER_shift, + EG_SQ_TEX_SAMPLER_WORD0_0__XY_MIN_FILTER_shift, EG_SQ_TEX_SAMPLER_WORD0_0__XY_MIN_FILTER_mask); SETfield(t->SQ_TEX_SAMPLER0, TEX_MipFilter_Point, - EG_SQ_TEX_SAMPLER_WORD0_0__MIP_FILTER_shift, + EG_SQ_TEX_SAMPLER_WORD0_0__MIP_FILTER_shift, EG_SQ_TEX_SAMPLER_WORD0_0__MIP_FILTER_mask); break; case GL_LINEAR_MIPMAP_LINEAR: SETfield(t->SQ_TEX_SAMPLER0, TEX_XYFilter_Linear, - EG_SQ_TEX_SAMPLER_WORD0_0__XY_MIN_FILTER_shift, + EG_SQ_TEX_SAMPLER_WORD0_0__XY_MIN_FILTER_shift, EG_SQ_TEX_SAMPLER_WORD0_0__XY_MIN_FILTER_mask); SETfield(t->SQ_TEX_SAMPLER0, TEX_MipFilter_Linear, - EG_SQ_TEX_SAMPLER_WORD0_0__MIP_FILTER_shift, + EG_SQ_TEX_SAMPLER_WORD0_0__MIP_FILTER_shift, EG_SQ_TEX_SAMPLER_WORD0_0__MIP_FILTER_mask); break; } @@ -886,16 +886,16 @@ static void evergreenSetTexFilter(radeonTexObjPtr t, GLenum minf, GLenum magf, G /* Note we don't have 3D mipmaps so only use the mag filter setting * to set the 3D texture filter mode. */ - switch (magf) + switch (magf) { case GL_NEAREST: SETfield(t->SQ_TEX_SAMPLER0, TEX_XYFilter_Point, - EG_SQ_TEX_SAMPLER_WORD0_0__XY_MAG_FILTER_shift, + EG_SQ_TEX_SAMPLER_WORD0_0__XY_MAG_FILTER_shift, EG_SQ_TEX_SAMPLER_WORD0_0__XY_MAG_FILTER_mask); break; case GL_LINEAR: SETfield(t->SQ_TEX_SAMPLER0, TEX_XYFilter_Linear, - EG_SQ_TEX_SAMPLER_WORD0_0__XY_MAG_FILTER_shift, + EG_SQ_TEX_SAMPLER_WORD0_0__XY_MAG_FILTER_shift, EG_SQ_TEX_SAMPLER_WORD0_0__XY_MAG_FILTER_mask); break; } @@ -909,7 +909,7 @@ static void evergreenSetTexBorderColor(radeonTexObjPtr t, const GLfloat color[4] t->TD_PS_SAMPLER0_BORDER_BLUE = *((uint32_t*)&(color[0])); SETfield(t->SQ_TEX_SAMPLER0, SQ_TEX_BORDER_COLOR_REGISTER, - EG_SQ_TEX_SAMPLER_WORD0_0__BORDER_COLOR_TYPE_shift, + EG_SQ_TEX_SAMPLER_WORD0_0__BORDER_COLOR_TYPE_shift, EG_SQ_TEX_SAMPLER_WORD0_0__BORDER_COLOR_TYPE_mask); } @@ -946,47 +946,47 @@ static GLboolean evergreen_setup_hardware_state(struct gl_context * ctx, struct firstImage = t->base.Image[0][t->minLod]; - if (!t->image_override) { + if (!t->image_override) { if (!evergreenGetTexFormat(texObj, firstImage->TexFormat)) { radeon_warning("unsupported texture format in %s\n", __FUNCTION__); return GL_FALSE; - } + } } - switch (texObj->Target) + switch (texObj->Target) { case GL_TEXTURE_1D: - SETfield(t->SQ_TEX_RESOURCE0, SQ_TEX_DIM_1D, - EG_SQ_TEX_RESOURCE_WORD0_0__DIM_shift, + SETfield(t->SQ_TEX_RESOURCE0, SQ_TEX_DIM_1D, + EG_SQ_TEX_RESOURCE_WORD0_0__DIM_shift, EG_SQ_TEX_RESOURCE_WORD0_0__DIM_mask); - SETfield(t->SQ_TEX_RESOURCE1, 0, - EG_SQ_TEX_RESOURCE_WORD1_0__TEX_DEPTH_shift, + SETfield(t->SQ_TEX_RESOURCE1, 0, + EG_SQ_TEX_RESOURCE_WORD1_0__TEX_DEPTH_shift, EG_SQ_TEX_RESOURCE_WORD1_0__TEX_DEPTH_mask); break; case GL_TEXTURE_2D: case GL_TEXTURE_RECTANGLE_NV: - SETfield(t->SQ_TEX_RESOURCE0, SQ_TEX_DIM_2D, - EG_SQ_TEX_RESOURCE_WORD0_0__DIM_shift, + SETfield(t->SQ_TEX_RESOURCE0, SQ_TEX_DIM_2D, + EG_SQ_TEX_RESOURCE_WORD0_0__DIM_shift, EG_SQ_TEX_RESOURCE_WORD0_0__DIM_mask); - SETfield(t->SQ_TEX_RESOURCE1, 0, - EG_SQ_TEX_RESOURCE_WORD1_0__TEX_DEPTH_shift, + SETfield(t->SQ_TEX_RESOURCE1, 0, + EG_SQ_TEX_RESOURCE_WORD1_0__TEX_DEPTH_shift, EG_SQ_TEX_RESOURCE_WORD1_0__TEX_DEPTH_mask); break; case GL_TEXTURE_3D: - SETfield(t->SQ_TEX_RESOURCE0, SQ_TEX_DIM_3D, - EG_SQ_TEX_RESOURCE_WORD0_0__DIM_shift, + SETfield(t->SQ_TEX_RESOURCE0, SQ_TEX_DIM_3D, + EG_SQ_TEX_RESOURCE_WORD0_0__DIM_shift, EG_SQ_TEX_RESOURCE_WORD0_0__DIM_mask); SETfield(t->SQ_TEX_RESOURCE1, (firstImage->Depth - 1), // ??? - EG_SQ_TEX_RESOURCE_WORD1_0__TEX_DEPTH_shift, + EG_SQ_TEX_RESOURCE_WORD1_0__TEX_DEPTH_shift, EG_SQ_TEX_RESOURCE_WORD1_0__TEX_DEPTH_mask); break; case GL_TEXTURE_CUBE_MAP: - SETfield(t->SQ_TEX_RESOURCE0, SQ_TEX_DIM_CUBEMAP, - EG_SQ_TEX_RESOURCE_WORD0_0__DIM_shift, + SETfield(t->SQ_TEX_RESOURCE0, SQ_TEX_DIM_CUBEMAP, + EG_SQ_TEX_RESOURCE_WORD0_0__DIM_shift, EG_SQ_TEX_RESOURCE_WORD0_0__DIM_mask); - SETfield(t->SQ_TEX_RESOURCE1, 0, - EG_SQ_TEX_RESOURCE_WORD1_0__TEX_DEPTH_shift, + SETfield(t->SQ_TEX_RESOURCE1, 0, + EG_SQ_TEX_RESOURCE_WORD1_0__TEX_DEPTH_shift, EG_SQ_TEX_RESOURCE_WORD1_0__TEX_DEPTH_mask); break; default: @@ -1004,14 +1004,14 @@ static GLboolean evergreen_setup_hardware_state(struct gl_context * ctx, struct if (uTexelPitch < 8) uTexelPitch = 8; - SETfield(t->SQ_TEX_RESOURCE0, (uTexelPitch/8)-1, - EG_SQ_TEX_RESOURCE_WORD0_0__PITCH_shift, + SETfield(t->SQ_TEX_RESOURCE0, (uTexelPitch/8)-1, + EG_SQ_TEX_RESOURCE_WORD0_0__PITCH_shift, EG_SQ_TEX_RESOURCE_WORD0_0__PITCH_mask); SETfield(t->SQ_TEX_RESOURCE0, firstImage->Width - 1, - EG_SQ_TEX_RESOURCE_WORD0_0__TEX_WIDTH_shift, + EG_SQ_TEX_RESOURCE_WORD0_0__TEX_WIDTH_shift, EG_SQ_TEX_RESOURCE_WORD0_0__TEX_WIDTH_mask); SETfield(t->SQ_TEX_RESOURCE1, firstImage->Height - 1, - EG_SQ_TEX_RESOURCE_WORD1_0__TEX_HEIGHT_shift, + EG_SQ_TEX_RESOURCE_WORD1_0__TEX_HEIGHT_shift, EG_SQ_TEX_RESOURCE_WORD1_0__TEX_HEIGHT_mask); t->SQ_TEX_RESOURCE2 = get_base_teximage_offset(t) / 256; @@ -1020,24 +1020,24 @@ static GLboolean evergreen_setup_hardware_state(struct gl_context * ctx, struct SETfield(t->SQ_TEX_RESOURCE4, 0, BASE_LEVEL_shift, BASE_LEVEL_mask); SETfield(t->SQ_TEX_RESOURCE5, t->maxLod - t->minLod, LAST_LEVEL_shift, LAST_LEVEL_mask); - + SETfield(t->SQ_TEX_SAMPLER1, EG_S_FIXED(CLAMP(t->base.MinLod - t->minLod, 0, 15), 8), - EG_SQ_TEX_SAMPLER_WORD1_0__MIN_LOD_shift, + EG_SQ_TEX_SAMPLER_WORD1_0__MIN_LOD_shift, EG_SQ_TEX_SAMPLER_WORD1_0__MIN_LOD_mask); SETfield(t->SQ_TEX_SAMPLER1, EG_S_FIXED(CLAMP(t->base.MaxLod - t->minLod, 0, 15), 8), - EG_SQ_TEX_SAMPLER_WORD1_0__MAX_LOD_shift, + EG_SQ_TEX_SAMPLER_WORD1_0__MAX_LOD_shift, EG_SQ_TEX_SAMPLER_WORD1_0__MAX_LOD_mask); SETfield(t->SQ_TEX_SAMPLER2, EG_S_FIXED(CLAMP(ctx->Texture.Unit[unit].LodBias + t->base.LodBias, -16, 16), 8), - EG_SQ_TEX_SAMPLER_WORD2_0__LOD_BIAS_shift, + EG_SQ_TEX_SAMPLER_WORD2_0__LOD_BIAS_shift, EG_SQ_TEX_SAMPLER_WORD2_0__LOD_BIAS_mask); if(texObj->CompareMode == GL_COMPARE_R_TO_TEXTURE_ARB) { - SETfield(t->SQ_TEX_SAMPLER0, evergreen_translate_shadow_func(texObj->CompareFunc), - EG_SQ_TEX_SAMPLER_WORD0_0__DCF_shift, + SETfield(t->SQ_TEX_SAMPLER0, evergreen_translate_shadow_func(texObj->CompareFunc), + EG_SQ_TEX_SAMPLER_WORD0_0__DCF_shift, EG_SQ_TEX_SAMPLER_WORD0_0__DCF_mask); } else @@ -1079,7 +1079,7 @@ void evergreenSetTexOffset(__DRIcontext * pDRICtx, GLint texname, switch (depth) { case 32: SETfield(t->SQ_TEX_RESOURCE7, FMT_8_8_8_8, - EG_SQ_TEX_RESOURCE_WORD7_0__DATA_FORMAT_shift, + EG_SQ_TEX_RESOURCE_WORD7_0__DATA_FORMAT_shift, EG_SQ_TEX_RESOURCE_WORD7_0__DATA_FORMAT_mask); SETfield(t->SQ_TEX_RESOURCE4, SQ_SEL_Z, @@ -1095,7 +1095,7 @@ void evergreenSetTexOffset(__DRIcontext * pDRICtx, GLint texname, case 24: default: SETfield(t->SQ_TEX_RESOURCE7, FMT_8_8_8_8, - EG_SQ_TEX_RESOURCE_WORD7_0__DATA_FORMAT_shift, + EG_SQ_TEX_RESOURCE_WORD7_0__DATA_FORMAT_shift, EG_SQ_TEX_RESOURCE_WORD7_0__DATA_FORMAT_mask); SETfield(t->SQ_TEX_RESOURCE4, SQ_SEL_Z, @@ -1110,7 +1110,7 @@ void evergreenSetTexOffset(__DRIcontext * pDRICtx, GLint texname, break; case 16: SETfield(t->SQ_TEX_RESOURCE7, FMT_5_6_5, - EG_SQ_TEX_RESOURCE_WORD7_0__DATA_FORMAT_shift, + EG_SQ_TEX_RESOURCE_WORD7_0__DATA_FORMAT_shift, EG_SQ_TEX_RESOURCE_WORD7_0__DATA_FORMAT_mask); SETfield(t->SQ_TEX_RESOURCE4, SQ_SEL_Z, @@ -1132,8 +1132,8 @@ void evergreenSetTexOffset(__DRIcontext * pDRICtx, GLint texname, if (pitch_val < 8) pitch_val = 8; - SETfield(t->SQ_TEX_RESOURCE0, (pitch_val/8)-1, - EG_SQ_TEX_RESOURCE_WORD0_0__PITCH_shift, + SETfield(t->SQ_TEX_RESOURCE0, (pitch_val/8)-1, + EG_SQ_TEX_RESOURCE_WORD0_0__PITCH_shift, EG_SQ_TEX_RESOURCE_WORD0_0__PITCH_mask); } @@ -1202,7 +1202,7 @@ void evergreenSetTexBuffer(__DRIcontext *pDRICtx, GLint target, GLint glx_textur if (glx_texture_format == __DRI_TEXTURE_FORMAT_RGB) { texFormat = MESA_FORMAT_RGB888; SETfield(t->SQ_TEX_RESOURCE7, FMT_8_8_8_8, - EG_SQ_TEX_RESOURCE_WORD7_0__DATA_FORMAT_shift, + EG_SQ_TEX_RESOURCE_WORD7_0__DATA_FORMAT_shift, EG_SQ_TEX_RESOURCE_WORD7_0__DATA_FORMAT_mask); SETfield(t->SQ_TEX_RESOURCE4, SQ_SEL_Z, @@ -1216,7 +1216,7 @@ void evergreenSetTexBuffer(__DRIcontext *pDRICtx, GLint target, GLint glx_textur } else { texFormat = MESA_FORMAT_ARGB8888; SETfield(t->SQ_TEX_RESOURCE7, FMT_8_8_8_8, - EG_SQ_TEX_RESOURCE_WORD7_0__DATA_FORMAT_shift, + EG_SQ_TEX_RESOURCE_WORD7_0__DATA_FORMAT_shift, EG_SQ_TEX_RESOURCE_WORD7_0__DATA_FORMAT_mask); SETfield(t->SQ_TEX_RESOURCE4, SQ_SEL_Z, @@ -1235,7 +1235,7 @@ void evergreenSetTexBuffer(__DRIcontext *pDRICtx, GLint target, GLint glx_textur // FMT_8_8_8 ??? texFormat = MESA_FORMAT_RGB888; SETfield(t->SQ_TEX_RESOURCE7, FMT_8_8_8_8, - EG_SQ_TEX_RESOURCE_WORD7_0__DATA_FORMAT_shift, + EG_SQ_TEX_RESOURCE_WORD7_0__DATA_FORMAT_shift, EG_SQ_TEX_RESOURCE_WORD7_0__DATA_FORMAT_mask); SETfield(t->SQ_TEX_RESOURCE4, SQ_SEL_W, @@ -1251,7 +1251,7 @@ void evergreenSetTexBuffer(__DRIcontext *pDRICtx, GLint target, GLint glx_textur case 2: texFormat = MESA_FORMAT_RGB565; SETfield(t->SQ_TEX_RESOURCE7, FMT_5_6_5, - EG_SQ_TEX_RESOURCE_WORD7_0__DATA_FORMAT_shift, + EG_SQ_TEX_RESOURCE_WORD7_0__DATA_FORMAT_shift, EG_SQ_TEX_RESOURCE_WORD7_0__DATA_FORMAT_mask); SETfield(t->SQ_TEX_RESOURCE4, SQ_SEL_Z, @@ -1278,14 +1278,14 @@ void evergreenSetTexBuffer(__DRIcontext *pDRICtx, GLint target, GLint glx_textur if (pitch_val < 8) pitch_val = 8; - SETfield(t->SQ_TEX_RESOURCE0, (pitch_val/8)-1, - EG_SQ_TEX_RESOURCE_WORD0_0__PITCH_shift, + SETfield(t->SQ_TEX_RESOURCE0, (pitch_val/8)-1, + EG_SQ_TEX_RESOURCE_WORD0_0__PITCH_shift, EG_SQ_TEX_RESOURCE_WORD0_0__PITCH_mask); SETfield(t->SQ_TEX_RESOURCE0, rb->base.Width - 1, - EG_SQ_TEX_RESOURCE_WORD0_0__TEX_WIDTH_shift, + EG_SQ_TEX_RESOURCE_WORD0_0__TEX_WIDTH_shift, EG_SQ_TEX_RESOURCE_WORD0_0__TEX_WIDTH_mask); SETfield(t->SQ_TEX_RESOURCE1, rb->base.Height - 1, - EG_SQ_TEX_RESOURCE_WORD1_0__TEX_HEIGHT_shift, + EG_SQ_TEX_RESOURCE_WORD1_0__TEX_HEIGHT_shift, EG_SQ_TEX_RESOURCE_WORD1_0__TEX_HEIGHT_mask); t->validated = GL_TRUE; @@ -1296,12 +1296,12 @@ void evergreenSetTexBuffer(__DRIcontext *pDRICtx, GLint target, GLint glx_textur void evergreenUpdateTextureState(struct gl_context * ctx) { context_t *context = EVERGREEN_CONTEXT(ctx); - EVERGREEN_CHIP_CONTEXT * evergreen = GET_EVERGREEN_CHIP(context); + EVERGREEN_CHIP_CONTEXT * evergreen = GET_EVERGREEN_CHIP(context); struct gl_texture_unit *texUnit; struct radeon_tex_obj *t; GLuint unit; - EVERGREEN_STATECHANGE(context, tx); + EVERGREEN_STATECHANGE(context, tx); for (unit = 0; unit < R700_MAX_TEXTURE_UNITS; unit++) { texUnit = &ctx->Texture.Unit[unit]; @@ -1356,7 +1356,7 @@ GLboolean evergreenValidateBuffers(struct gl_context * ctx) rrb->bo, 0, RADEON_GEM_DOMAIN_VRAM); } - + for (i = 0; i < ctx->Const.MaxTextureImageUnits; ++i) { radeonTexObj *t; @@ -1400,7 +1400,7 @@ GLboolean evergreenValidateBuffers(struct gl_context * ctx) radeon_cs_space_add_persistent_bo(rmesa->radeon.cmdbuf.cs, pbo, RADEON_GEM_DOMAIN_GTT, 0); } - + ret = radeon_cs_space_check_with_bo(rmesa->radeon.cmdbuf.cs, first_elem(&rmesa->radeon.dma.reserved)->bo, RADEON_GEM_DOMAIN_GTT, 0); if (ret) return GL_FALSE; @@ -1421,7 +1421,7 @@ static struct gl_texture_object *evergreenNewTextureObject(struct gl_context * c _mesa_initialize_texture_object(&t->base, name, target); t->base.MaxAnisotropy = rmesa->radeon.initialMaxAnisotropy; - + evergreenSetTexDefaultState(t); evergreenUpdateTexWrap(t); evergreenSetTexFilter(t, t->base.MinFilter, t->base.MagFilter, t->base.MaxAnisotropy); diff --git a/src/mesa/drivers/dri/r600/evergreen_vertprog.c b/src/mesa/drivers/dri/r600/evergreen_vertprog.c index b3371f2..271a5c6 100644 --- a/src/mesa/drivers/dri/r600/evergreen_vertprog.c +++ b/src/mesa/drivers/dri/r600/evergreen_vertprog.c @@ -47,7 +47,7 @@ #include "evergreen_vertprog.h" -unsigned int evergreen_Map_Vertex_Output(r700_AssemblerBase *pAsm, +unsigned int evergreen_Map_Vertex_Output(r700_AssemblerBase *pAsm, struct gl_vertex_program *mesa_vp, unsigned int unStart) { @@ -123,7 +123,7 @@ unsigned int evergreen_Map_Vertex_Output(r700_AssemblerBase *pAsm, return (unTotal - unStart); } -unsigned int evergreen_Map_Vertex_Input(r700_AssemblerBase *pAsm, +unsigned int evergreen_Map_Vertex_Input(r700_AssemblerBase *pAsm, struct gl_vertex_program *mesa_vp, unsigned int unStart) { @@ -164,7 +164,7 @@ GLboolean evergreen_Process_Vertex_Program_Vfetch_Instructions( &vtxFetchMethod); } } - + return GL_TRUE; } @@ -302,7 +302,7 @@ struct evergreen_vertex_program* evergreenTranslateVertexShader(struct gl_contex vp = calloc(1, sizeof(*vp)); vp->mesa_program = _mesa_clone_vertex_program(ctx, mesa_vp); - + vp->constbo0 = NULL; if (mesa_vp->IsPositionInvariant) @@ -325,8 +325,8 @@ struct evergreen_vertex_program* evergreenTranslateVertexShader(struct gl_contex //Init_Program Init_r700_AssemblerBase(SPT_VP, &(vp->r700AsmCode), &(vp->r700Shader) ); - - vp->r700AsmCode.bUseMemConstant = GL_TRUE; + + vp->r700AsmCode.bUseMemConstant = GL_TRUE; vp->r700AsmCode.unAsic = 8; evergreen_Map_Vertex_Program(ctx, vp, vp->mesa_program ); @@ -364,7 +364,7 @@ struct evergreen_vertex_program* evergreenTranslateVertexShader(struct gl_contex return GL_FALSE; } - vp->r700Shader.nRegs = (vp->r700AsmCode.number_used_registers == 0) ? 0 + vp->r700Shader.nRegs = (vp->r700AsmCode.number_used_registers == 0) ? 0 : (vp->r700AsmCode.number_used_registers - 1); vp->r700Shader.nParamExports = vp->r700AsmCode.number_of_exports; @@ -424,7 +424,7 @@ void evergreenSelectVertexShader(struct gl_context *ctx) int evergreen_getTypeSize(GLenum type) { - switch (type) + switch (type) { case GL_DOUBLE: return sizeof(GLdouble); @@ -451,12 +451,12 @@ int evergreen_getTypeSize(GLenum type) static void evergreenTranslateAttrib(struct gl_context *ctx, GLuint unLoc, int count, const struct gl_client_array *input) { context_t *context = EVERGREEN_CONTEXT(ctx); - + StreamDesc * pStreamDesc = &(context->stream_desc[context->nNumActiveAos]); GLuint stride; - stride = (input->StrideB == 0) ? evergreen_getTypeSize(input->Type) * input->Size + stride = (input->StrideB == 0) ? evergreen_getTypeSize(input->Type) * input->Size : input->StrideB; if (input->Type == GL_DOUBLE || input->Type == GL_UNSIGNED_INT || input->Type == GL_INT @@ -467,28 +467,28 @@ static void evergreenTranslateAttrib(struct gl_context *ctx, GLuint unLoc, int c { pStreamDesc->type = GL_FLOAT; - if (input->StrideB == 0) + if (input->StrideB == 0) { pStreamDesc->stride = 0; - } - else + } + else { pStreamDesc->stride = sizeof(GLfloat) * input->Size; } pStreamDesc->dwords = input->Size; pStreamDesc->is_named_bo = GL_FALSE; - } - else + } + else { pStreamDesc->type = input->Type; pStreamDesc->dwords = (evergreen_getTypeSize(input->Type) * input->Size + 3)/ 4; - if (!input->BufferObj->Name) + if (!input->BufferObj->Name) { - if (input->StrideB == 0) + if (input->StrideB == 0) { pStreamDesc->stride = 0; - } - else + } + else { pStreamDesc->stride = (evergreen_getTypeSize(pStreamDesc->type) * input->Size + 3) & ~3; } @@ -502,7 +502,7 @@ static void evergreenTranslateAttrib(struct gl_context *ctx, GLuint unLoc, int c pStreamDesc->element = unLoc; pStreamDesc->format = input->Format; - switch (pStreamDesc->type) + switch (pStreamDesc->type) { //GetSurfaceFormat case GL_FLOAT: pStreamDesc->_signed = 0; @@ -527,7 +527,7 @@ static void evergreenTranslateAttrib(struct gl_context *ctx, GLuint unLoc, int c default: case GL_INT: case GL_UNSIGNED_INT: - case GL_DOUBLE: + case GL_DOUBLE: assert(0); break; } @@ -550,7 +550,7 @@ void evergreenSetVertexFormat(struct gl_context *ctx, const struct gl_client_arr unBit |= VERT_BIT_POS; } - while(unBit) + while(unBit) { if(unBit & 1) { @@ -604,21 +604,21 @@ GLboolean evergreenSetupVertexProgram(struct gl_context * ctx) (GLvoid *)(vp->r700Shader.pProgram), vp->r700Shader.uShaderBinaryDWORDSize, "VS"); - + vp->loaded = GL_TRUE; } - EVERGREEN_STATECHANGE(context, vs); - + EVERGREEN_STATECHANGE(context, vs); + /* TODO : enable this after MemUse fixed *= (context->chipobj.MemUse)(context, vp->shadercode.buf->id); - */ + */ evergreen->SQ_PGM_RESOURCES_VS.u32All = 0; SETbit(evergreen->SQ_PGM_RESOURCES_VS.u32All, PGM_RESOURCES__PRIME_CACHE_ON_DRAW_bit); - + evergreen->vs.SQ_ALU_CONST_CACHE_VS_0.u32All = 0; /* set from buffer object. */ - + evergreen->vs.SQ_PGM_START_VS.u32All = 0; SETfield(evergreen->SQ_PGM_RESOURCES_VS.u32All, vp->r700Shader.nRegs + 1, @@ -663,10 +663,10 @@ GLboolean evergreenSetupVPconstants(struct gl_context * ctx) if(NULL != paramList) { /* vp->mesa_program was cloned, not updated by glsl shader api. */ /* _mesa_reference_program has already checked glsl shProg is ok and set ctx->VertexProgem._Current */ - /* so, use ctx->VertexProgem._Current */ - struct gl_program_parameter_list *paramListOrginal = + /* so, use ctx->VertexProgem._Current */ + struct gl_program_parameter_list *paramListOrginal = ctx->VertexProgram._Current->Base.Parameters; - + _mesa_load_state_parameters(ctx, paramList); if (paramList->NumParameters > EVERGREEN_MAX_DX9_CONSTS) @@ -682,7 +682,7 @@ GLboolean evergreenSetupVPconstants(struct gl_context * ctx) alloc_size = ((unNumParamData * 4 * 4) + 255) & ~255; for(ui=0; uiParameters[ui].Type == PROGRAM_UNIFORM) + if(paramList->Parameters[ui].Type == PROGRAM_UNIFORM) { evergreen->vs.consts[ui][0].f32All = paramListOrginal->ParameterValues[ui][0]; evergreen->vs.consts[ui][1].f32All = paramListOrginal->ParameterValues[ui][1]; @@ -698,11 +698,11 @@ GLboolean evergreenSetupVPconstants(struct gl_context * ctx) } } - radeonAllocDmaRegion(&context->radeon, - &context->vp_Constbo, - &context->vp_bo_offset, + radeonAllocDmaRegion(&context->radeon, + &context->vp_Constbo, + &context->vp_bo_offset, alloc_size, - 256); + 256); r600EmitShaderConsts(ctx, context->vp_Constbo, context->vp_bo_offset, diff --git a/src/mesa/drivers/dri/r600/evergreen_vertprog.h b/src/mesa/drivers/dri/r600/evergreen_vertprog.h index 8163e36..2614200 100644 --- a/src/mesa/drivers/dri/r600/evergreen_vertprog.h +++ b/src/mesa/drivers/dri/r600/evergreen_vertprog.h @@ -29,7 +29,7 @@ #define _EVERGREEN_VERTPROG_H_ #include "main/glheader.h" -#include "main/mtypes.h" +#include "main/mtypes.h" #include "r700_shader.h" #include "r700_assembler.h" @@ -42,7 +42,7 @@ typedef struct evergreenArrayDesc //TEMP GLenum format; //GL_RGBA or GL_BGRA } evergreenArrayDesc; -struct evergreen_vertex_program +struct evergreen_vertex_program { struct gl_vertex_program *mesa_program; /* Must be first */ @@ -70,10 +70,10 @@ struct evergreen_vertex_program_cont }; //Internal -unsigned int evergreen_Map_Vertex_Output(r700_AssemblerBase *pAsm, +unsigned int evergreen_Map_Vertex_Output(r700_AssemblerBase *pAsm, struct gl_vertex_program *mesa_vp, unsigned int unStart); -unsigned int evergreen_Map_Vertex_Input(r700_AssemblerBase *pAsm, +unsigned int evergreen_Map_Vertex_Input(r700_AssemblerBase *pAsm, struct gl_vertex_program *mesa_vp, unsigned int unStart); GLboolean evergreen_Process_Vertex_Program_Vfetch_Instructions( diff --git a/src/mesa/drivers/dri/r600/r600_cmdbuf.c b/src/mesa/drivers/dri/r600/r600_cmdbuf.c index ce2f777..eca571b 100644 --- a/src/mesa/drivers/dri/r600/r600_cmdbuf.c +++ b/src/mesa/drivers/dri/r600/r600_cmdbuf.c @@ -255,9 +255,9 @@ static int r600_cs_end(struct radeon_cs_int *csi, return 0; } -static int r600_cs_process_relocs(struct radeon_cs_int *csi, +static int r600_cs_process_relocs(struct radeon_cs_int *csi, uint32_t * reloc_chunk, - uint32_t * length_dw_reloc_chunk) + uint32_t * length_dw_reloc_chunk) { struct r600_cs_manager_legacy *csm = (struct r600_cs_manager_legacy*)csi->csm; struct r600_cs_reloc_legacy *relocs; @@ -371,7 +371,7 @@ static int r600_cs_emit(struct radeon_cs_int *csi) //dump_cmdbuf(cs); - do + do { r = drmCommandWriteRead(csi->csm->fd, DRM_RADEON_CS, &cs_cmd, sizeof(cs_cmd)); retry++; @@ -479,7 +479,7 @@ void r600InitCmdBuf(context_t *r600) /* from rcommonInitCmdBuf */ else { r600InitAtoms(r600); - } + } /* Initialize command buffer */ size = 256 * driQueryOptioni(&rmesa->optionCache, diff --git a/src/mesa/drivers/dri/r600/r600_cmdbuf.h b/src/mesa/drivers/dri/r600/r600_cmdbuf.h index ffd6c8b..5c18661 100644 --- a/src/mesa/drivers/dri/r600/r600_cmdbuf.h +++ b/src/mesa/drivers/dri/r600/r600_cmdbuf.h @@ -192,7 +192,7 @@ do { \ #define R600_OUT_BATCH_REGSEQ(reg, count) \ R600_OUT_BATCH_REGS((reg), (count)) -/* evergreen */ +/* evergreen */ #define EVERGREEN_OUT_BATCH_REGS(reg, num) \ do { \ if ((reg) >= R600_SET_CONFIG_REG_OFFSET && (reg) < R600_SET_CONFIG_REG_END) { \ diff --git a/src/mesa/drivers/dri/r600/r600_context.c b/src/mesa/drivers/dri/r600/r600_context.c index 5f5a502..ce47a71 100644 --- a/src/mesa/drivers/dri/r600/r600_context.c +++ b/src/mesa/drivers/dri/r600/r600_context.c @@ -358,7 +358,7 @@ static void r600InitGLExtensions(struct gl_context *ctx) #ifdef R600_ENABLE_GLSL_TEST driInitExtensions(ctx, gl_20_extension, GL_TRUE); _mesa_enable_2_0_extensions(ctx); - + /* glsl compiler has problem if this is not GL_TRUE */ for (i = 0; i <= MESA_SHADER_FRAGMENT; i++) ctx->ShaderCompilerOptions[i].EmitCondCodes = GL_TRUE; @@ -422,7 +422,7 @@ GLboolean r600CreateContext(gl_api api, { r600_init_vtbl(&r600->radeon); } - + /* Init default driver functions then plug in our R600-specific functions * (the texture functions are especially important) */ @@ -441,7 +441,7 @@ GLboolean r600CreateContext(gl_api api, r600InitTextureFuncs(&r600->radeon, &functions); r700InitShaderFuncs(&functions); } - + radeonInitQueryObjFunctions(&functions); if(screen->chip_family >= CHIP_FAMILY_CEDAR) diff --git a/src/mesa/drivers/dri/r600/r600_context.h b/src/mesa/drivers/dri/r600/r600_context.h index d3dc901..2406826 100644 --- a/src/mesa/drivers/dri/r600/r600_context.h +++ b/src/mesa/drivers/dri/r600/r600_context.h @@ -123,7 +123,7 @@ struct evergreen_hw_state { struct radeon_state_atom db; struct radeon_state_atom cb; struct radeon_state_atom vtx; - struct radeon_state_atom cp; + struct radeon_state_atom cp; struct radeon_state_atom timestamp; }; @@ -132,7 +132,7 @@ typedef struct StreamDesc GLint size; //number of data element GLenum type; //data element type GLsizei stride; - GLenum format; // GL_RGBA,GLBGRA + GLenum format; // GL_RGBA,GLBGRA struct radeon_bo *bo; GLint bo_offset; diff --git a/src/mesa/drivers/dri/r600/r600_emit.c b/src/mesa/drivers/dri/r600/r600_emit.c index 53ece9a..b3d4f2d 100644 --- a/src/mesa/drivers/dri/r600/r600_emit.c +++ b/src/mesa/drivers/dri/r600/r600_emit.c @@ -50,7 +50,7 @@ void r600EmitCacheFlush(context_t *rmesa) } GLboolean r600AllocShaderConsts(struct gl_context * ctx, - void ** constbo, + void ** constbo, int sizeinBYTE, char * szShaderUsage) { @@ -60,7 +60,7 @@ GLboolean r600AllocShaderConsts(struct gl_context * ctx, if(sizeinBYTE < 64) /* SQ_ALU_CONST_BUFFER_SIZE need 64 bytes at least to be non 0 */ { sizeinBYTE = 64; - } + } shader_again_alloc: pbo = radeon_bo_open(radeonctx->radeonScreen->bom, @@ -98,7 +98,7 @@ GLboolean r600EmitShaderConsts(struct gl_context * ctx, int bo_offset, GLvoid * data, int sizeinBYTE) -{ +{ struct radeon_bo * pbo = (struct radeon_bo *)constbo; uint8_t *out; diff --git a/src/mesa/drivers/dri/r600/r600_emit.h b/src/mesa/drivers/dri/r600/r600_emit.h index c50b606..ebead82 100644 --- a/src/mesa/drivers/dri/r600/r600_emit.h +++ b/src/mesa/drivers/dri/r600/r600_emit.h @@ -43,17 +43,17 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. void r600EmitCacheFlush(context_t *rmesa); -extern GLboolean r600EmitShader(struct gl_context * ctx, +extern GLboolean r600EmitShader(struct gl_context * ctx, void ** shaderbo, - GLvoid * data, + GLvoid * data, int sizeinDWORD, - char * szShaderUsage); + char * szShaderUsage); -extern GLboolean r600DeleteShader(struct gl_context * ctx, +extern GLboolean r600DeleteShader(struct gl_context * ctx, void * shaderbo); extern GLboolean r600AllocShaderConsts(struct gl_context * ctx, - void ** constbo, + void ** constbo, int sizeinBYTE, char * szShaderUsage); GLboolean r600EmitShaderConsts(struct gl_context * ctx, diff --git a/src/mesa/drivers/dri/r600/r600_reg.h b/src/mesa/drivers/dri/r600/r600_reg.h index ffe5ee4..c1d4e2a 100644 --- a/src/mesa/drivers/dri/r600/r600_reg.h +++ b/src/mesa/drivers/dri/r600/r600_reg.h @@ -35,7 +35,7 @@ /* SET_*_REG offsets + ends */ -enum +enum { SET_CONFIG_REG_offset = 0x00008000, SET_CONFIG_REG_end = 0x0000ac00, @@ -56,7 +56,7 @@ enum }; /* packet3 IT_SURFACE_BASE_UPDATE bits */ -enum +enum { DEPTH_BASE = (1 << 0), COLOR0_BASE = (1 << 1), @@ -76,7 +76,7 @@ enum }; /* Packet3 commands */ -enum +enum { IT_NOP = 0x10, IT_INDIRECT_BUFFER_END = 0x17, diff --git a/src/mesa/drivers/dri/r600/r600_texstate.c b/src/mesa/drivers/dri/r600/r600_texstate.c index aafa687..f7c2a7f 100644 --- a/src/mesa/drivers/dri/r600/r600_texstate.c +++ b/src/mesa/drivers/dri/r600/r600_texstate.c @@ -847,7 +847,7 @@ GLboolean r600ValidateBuffers(struct gl_context * ctx) rrb->bo, 0, RADEON_GEM_DOMAIN_VRAM); } - + for (i = 0; i < ctx->Const.MaxTextureImageUnits; ++i) { radeonTexObj *t; @@ -890,7 +890,7 @@ GLboolean r600ValidateBuffers(struct gl_context * ctx) if (pbo) { radeon_cs_space_add_persistent_bo(rmesa->radeon.cmdbuf.cs, pbo, RADEON_GEM_DOMAIN_GTT, 0); - } + } ret = radeon_cs_space_check_with_bo(rmesa->radeon.cmdbuf.cs, first_elem(&rmesa->radeon.dma.reserved)->bo, RADEON_GEM_DOMAIN_GTT, 0); if (ret) @@ -915,7 +915,7 @@ void r600SetTexOffset(__DRIcontext * pDRICtx, GLint texname, { evergreenSetTexOffset(pDRICtx, texname, offset, depth, pitch); return; - } + } t->image_override = GL_TRUE; @@ -1014,7 +1014,7 @@ void r600SetTexBuffer2(__DRIcontext *pDRICtx, GLint target, GLint glx_texture_fo { evergreenSetTexBuffer(pDRICtx, target, glx_texture_format, dPriv); return; - } + } rfb = dPriv->driverPrivate; texUnit = &radeon->glCtx->Texture.Unit[radeon->glCtx->Texture.CurrentUnit]; diff --git a/src/mesa/drivers/dri/r600/r700_assembler.c b/src/mesa/drivers/dri/r600/r700_assembler.c index 024853c..daca24e 100644 --- a/src/mesa/drivers/dri/r600/r700_assembler.c +++ b/src/mesa/drivers/dri/r600/r700_assembler.c @@ -43,18 +43,18 @@ #define USE_CF_FOR_CONTINUE_BREAK 1 #define USE_CF_FOR_POP_AFTER 1 -struct prog_instruction noise1_insts[12] = { - {OPCODE_BGNSUB , {{13, 0, 1672, 0, 0, 0}, {13, 0, 1672, 0, 0, 0}, {13, 0, 1672, 0, 0, 0}}, {13, 0, 15, 0, 8, 1672, 0}, 0, 0, 0, 1, 0, 0, 0, -1, 0, 0, 0}, - {OPCODE_MOV , {{0, 0, 0, 0, 0, 0}, {13, 0, 1672, 0, 0, 0}, {13, 0, 1672, 0, 0, 0}}, {0, 0, 2, 0, 8, 1672, 0}, 0, 0, 0, 1, 0, 0, 0, -1, 0, 0, 0}, - {OPCODE_MOV , {{8, 0, 0, 0, 0, 0}, {13, 0, 1672, 0, 0, 0}, {13, 0, 1672, 0, 0, 0}}, {0, 0, 4, 0, 8, 1672, 0}, 0, 0, 0, 1, 0, 0, 0, -1, 0, 0, 0}, - {OPCODE_MOV , {{8, 0, 585, 0, 0, 0}, {13, 0, 1672, 0, 0, 0}, {13, 0, 1672, 0, 0, 0}}, {0, 0, 8, 0, 8, 1672, 0}, 0, 0, 0, 1, 0, 0, 0, -1, 0, 0, 0}, - {OPCODE_SGT , {{0, 0, 585, 0, 0, 0}, {8, 0, 1170, 0, 0, 0}, {13, 0, 1672, 0, 0, 0}}, {0, 1, 1, 0, 8, 1672, 0}, 1, 0, 0, 1, 0, 0, 0, -1, 0, 0, 0}, - {OPCODE_IF , {{13, 0, 1672, 0, 0, 0}, {13, 0, 1672, 0, 0, 0}, {13, 0, 1672, 0, 0, 0}}, {13, 0, 15, 0, 7, 0, 0}, 0, 0, 0, 1, 0, 0, 0, 15, 0, 0, 0}, - {OPCODE_MOV , {{0, 0, 1755, 0, 0, 0}, {13, 0, 1672, 0, 0, 0}, {13, 0, 1672, 0, 0, 0}}, {0, 0, 1, 0, 8, 1672, 0}, 0, 0, 0, 1, 0, 0, 0, -1, 0, 0, 0}, - {OPCODE_RET , {{13, 0, 1672, 0, 0, 0}, {13, 0, 1672, 0, 0, 0}, {13, 0, 1672, 0, 0, 0}}, {13, 0, 15, 0, 8, 1672, 0}, 0, 0, 0, 1, 0, 0, 0, -1, 0, 0, 0}, - {OPCODE_ENDIF , {{13, 0, 1672, 0, 0, 0}, {13, 0, 1672, 0, 0, 0}, {13, 0, 1672, 0, 0, 0}}, {13, 0, 15, 0, 8, 1672, 0}, 0, 0, 0, 1, 0, 0, 0, -1, 0, 0, 0}, - {OPCODE_MOV , {{0, 0, 1170, 0, 0, 0}, {13, 0, 1672, 0, 0, 0}, {13, 0, 1672, 0, 0, 0}}, {0, 0, 1, 0, 8, 1672, 0}, 0, 0, 0, 1, 0, 0, 0, -1, 0, 0, 0}, - {OPCODE_RET , {{13, 0, 1672, 0, 0, 0}, {13, 0, 1672, 0, 0, 0}, {13, 0, 1672, 0, 0, 0}}, {13, 0, 15, 0, 8, 1672, 0}, 0, 0, 0, 1, 0, 0, 0, -1, 0, 0, 0}, +struct prog_instruction noise1_insts[12] = { + {OPCODE_BGNSUB , {{13, 0, 1672, 0, 0, 0}, {13, 0, 1672, 0, 0, 0}, {13, 0, 1672, 0, 0, 0}}, {13, 0, 15, 0, 8, 1672, 0}, 0, 0, 0, 1, 0, 0, 0, -1, 0, 0, 0}, + {OPCODE_MOV , {{0, 0, 0, 0, 0, 0}, {13, 0, 1672, 0, 0, 0}, {13, 0, 1672, 0, 0, 0}}, {0, 0, 2, 0, 8, 1672, 0}, 0, 0, 0, 1, 0, 0, 0, -1, 0, 0, 0}, + {OPCODE_MOV , {{8, 0, 0, 0, 0, 0}, {13, 0, 1672, 0, 0, 0}, {13, 0, 1672, 0, 0, 0}}, {0, 0, 4, 0, 8, 1672, 0}, 0, 0, 0, 1, 0, 0, 0, -1, 0, 0, 0}, + {OPCODE_MOV , {{8, 0, 585, 0, 0, 0}, {13, 0, 1672, 0, 0, 0}, {13, 0, 1672, 0, 0, 0}}, {0, 0, 8, 0, 8, 1672, 0}, 0, 0, 0, 1, 0, 0, 0, -1, 0, 0, 0}, + {OPCODE_SGT , {{0, 0, 585, 0, 0, 0}, {8, 0, 1170, 0, 0, 0}, {13, 0, 1672, 0, 0, 0}}, {0, 1, 1, 0, 8, 1672, 0}, 1, 0, 0, 1, 0, 0, 0, -1, 0, 0, 0}, + {OPCODE_IF , {{13, 0, 1672, 0, 0, 0}, {13, 0, 1672, 0, 0, 0}, {13, 0, 1672, 0, 0, 0}}, {13, 0, 15, 0, 7, 0, 0}, 0, 0, 0, 1, 0, 0, 0, 15, 0, 0, 0}, + {OPCODE_MOV , {{0, 0, 1755, 0, 0, 0}, {13, 0, 1672, 0, 0, 0}, {13, 0, 1672, 0, 0, 0}}, {0, 0, 1, 0, 8, 1672, 0}, 0, 0, 0, 1, 0, 0, 0, -1, 0, 0, 0}, + {OPCODE_RET , {{13, 0, 1672, 0, 0, 0}, {13, 0, 1672, 0, 0, 0}, {13, 0, 1672, 0, 0, 0}}, {13, 0, 15, 0, 8, 1672, 0}, 0, 0, 0, 1, 0, 0, 0, -1, 0, 0, 0}, + {OPCODE_ENDIF , {{13, 0, 1672, 0, 0, 0}, {13, 0, 1672, 0, 0, 0}, {13, 0, 1672, 0, 0, 0}}, {13, 0, 15, 0, 8, 1672, 0}, 0, 0, 0, 1, 0, 0, 0, -1, 0, 0, 0}, + {OPCODE_MOV , {{0, 0, 1170, 0, 0, 0}, {13, 0, 1672, 0, 0, 0}, {13, 0, 1672, 0, 0, 0}}, {0, 0, 1, 0, 8, 1672, 0}, 0, 0, 0, 1, 0, 0, 0, -1, 0, 0, 0}, + {OPCODE_RET , {{13, 0, 1672, 0, 0, 0}, {13, 0, 1672, 0, 0, 0}, {13, 0, 1672, 0, 0, 0}}, {13, 0, 15, 0, 8, 1672, 0}, 0, 0, 0, 1, 0, 0, 0, -1, 0, 0, 0}, {OPCODE_ENDSUB , {{13, 0, 1672, 0, 0, 0}, {13, 0, 1672, 0, 0, 0}, {13, 0, 1672, 0, 0, 0}}, {13, 0, 15, 0, 8, 1672, 0}, 0, 0, 0, 1, 0, 0, 0, -1, 0, 0, 0} }; float noise1_const[2][4] = { @@ -63,17 +63,17 @@ float noise1_const[2][4] = { COMPILED_SUB noise1_presub = { &(noise1_insts[0]), - 12, - 2, - 1, - 0, - &(noise1_const[0]), - SWIZZLE_X, - SWIZZLE_X, - SWIZZLE_X, + 12, + 2, + 1, + 0, + &(noise1_const[0]), + SWIZZLE_X, + SWIZZLE_X, + SWIZZLE_X, SWIZZLE_X, {0,0,0}, - 0 + 0 }; BITS addrmode_PVSDST(PVSDST * pPVSDST) @@ -81,38 +81,38 @@ BITS addrmode_PVSDST(PVSDST * pPVSDST) return pPVSDST->addrmode0 | ((BITS)pPVSDST->addrmode1 << 1); } -void setaddrmode_PVSDST(PVSDST * pPVSDST, BITS addrmode) +void setaddrmode_PVSDST(PVSDST * pPVSDST, BITS addrmode) { pPVSDST->addrmode0 = addrmode & 1; pPVSDST->addrmode1 = (addrmode >> 1) & 1; } -void nomask_PVSDST(PVSDST * pPVSDST) +void nomask_PVSDST(PVSDST * pPVSDST) { pPVSDST->writex = pPVSDST->writey = pPVSDST->writez = pPVSDST->writew = 1; } -BITS addrmode_PVSSRC(PVSSRC* pPVSSRC) +BITS addrmode_PVSSRC(PVSSRC* pPVSSRC) { return pPVSSRC->addrmode0 | ((BITS)pPVSSRC->addrmode1 << 1); } -void setaddrmode_PVSSRC(PVSSRC* pPVSSRC, BITS addrmode) +void setaddrmode_PVSSRC(PVSSRC* pPVSSRC, BITS addrmode) { pPVSSRC->addrmode0 = addrmode & 1; pPVSSRC->addrmode1 = (addrmode >> 1) & 1; } -void setswizzle_PVSSRC(PVSSRC* pPVSSRC, BITS swz) +void setswizzle_PVSSRC(PVSSRC* pPVSSRC, BITS swz) { - pPVSSRC->swizzlex = - pPVSSRC->swizzley = - pPVSSRC->swizzlez = + pPVSSRC->swizzlex = + pPVSSRC->swizzley = + pPVSSRC->swizzlez = pPVSSRC->swizzlew = swz; } -void noswizzle_PVSSRC(PVSSRC* pPVSSRC) +void noswizzle_PVSSRC(PVSSRC* pPVSSRC) { pPVSSRC->swizzlex = SQ_SEL_X; pPVSSRC->swizzley = SQ_SEL_Y; @@ -123,54 +123,54 @@ void noswizzle_PVSSRC(PVSSRC* pPVSSRC) void swizzleagain_PVSSRC(PVSSRC * pPVSSRC, BITS x, BITS y, BITS z, BITS w) { - switch (x) + switch (x) { - case SQ_SEL_X: x = pPVSSRC->swizzlex; + case SQ_SEL_X: x = pPVSSRC->swizzlex; break; - case SQ_SEL_Y: x = pPVSSRC->swizzley; + case SQ_SEL_Y: x = pPVSSRC->swizzley; break; - case SQ_SEL_Z: x = pPVSSRC->swizzlez; + case SQ_SEL_Z: x = pPVSSRC->swizzlez; break; - case SQ_SEL_W: x = pPVSSRC->swizzlew; + case SQ_SEL_W: x = pPVSSRC->swizzlew; break; default:; } - switch (y) + switch (y) { - case SQ_SEL_X: y = pPVSSRC->swizzlex; + case SQ_SEL_X: y = pPVSSRC->swizzlex; break; - case SQ_SEL_Y: y = pPVSSRC->swizzley; + case SQ_SEL_Y: y = pPVSSRC->swizzley; break; - case SQ_SEL_Z: y = pPVSSRC->swizzlez; + case SQ_SEL_Z: y = pPVSSRC->swizzlez; break; - case SQ_SEL_W: y = pPVSSRC->swizzlew; + case SQ_SEL_W: y = pPVSSRC->swizzlew; break; default:; } - switch (z) + switch (z) { - case SQ_SEL_X: z = pPVSSRC->swizzlex; + case SQ_SEL_X: z = pPVSSRC->swizzlex; break; - case SQ_SEL_Y: z = pPVSSRC->swizzley; + case SQ_SEL_Y: z = pPVSSRC->swizzley; break; - case SQ_SEL_Z: z = pPVSSRC->swizzlez; + case SQ_SEL_Z: z = pPVSSRC->swizzlez; break; - case SQ_SEL_W: z = pPVSSRC->swizzlew; + case SQ_SEL_W: z = pPVSSRC->swizzlew; break; default:; } - switch (w) + switch (w) { - case SQ_SEL_X: w = pPVSSRC->swizzlex; + case SQ_SEL_X: w = pPVSSRC->swizzlex; break; - case SQ_SEL_Y: w = pPVSSRC->swizzley; + case SQ_SEL_Y: w = pPVSSRC->swizzley; break; - case SQ_SEL_Z: w = pPVSSRC->swizzlez; + case SQ_SEL_Z: w = pPVSSRC->swizzlez; break; - case SQ_SEL_W: w = pPVSSRC->swizzlew; + case SQ_SEL_W: w = pPVSSRC->swizzlew; break; default:; } @@ -181,7 +181,7 @@ swizzleagain_PVSSRC(PVSSRC * pPVSSRC, BITS x, BITS y, BITS z, BITS w) pPVSSRC->swizzlew = w; } -void neg_PVSSRC(PVSSRC* pPVSSRC) +void neg_PVSSRC(PVSSRC* pPVSSRC) { pPVSSRC->negx = 1; pPVSSRC->negy = 1; @@ -189,7 +189,7 @@ void neg_PVSSRC(PVSSRC* pPVSSRC) pPVSSRC->negw = 1; } -void noneg_PVSSRC(PVSSRC* pPVSSRC) +void noneg_PVSSRC(PVSSRC* pPVSSRC) { pPVSSRC->negx = 0; pPVSSRC->negy = 0; @@ -198,7 +198,7 @@ void noneg_PVSSRC(PVSSRC* pPVSSRC) } // negate argument (for SUB instead of ADD and alike) -void flipneg_PVSSRC(PVSSRC* pPVSSRC) +void flipneg_PVSSRC(PVSSRC* pPVSSRC) { pPVSSRC->negx = !pPVSSRC->negx; pPVSSRC->negy = !pPVSSRC->negy; @@ -206,31 +206,31 @@ void flipneg_PVSSRC(PVSSRC* pPVSSRC) pPVSSRC->negw = !pPVSSRC->negw; } -void zerocomp_PVSSRC(PVSSRC* pPVSSRC, int c) +void zerocomp_PVSSRC(PVSSRC* pPVSSRC, int c) { - switch (c) + switch (c) { case 0: pPVSSRC->swizzlex = SQ_SEL_0; pPVSSRC->negx = 0; break; case 1: pPVSSRC->swizzley = SQ_SEL_0; pPVSSRC->negy = 0; break; case 2: pPVSSRC->swizzlez = SQ_SEL_0; pPVSSRC->negz = 0; break; case 3: pPVSSRC->swizzlew = SQ_SEL_0; pPVSSRC->negw = 0; break; default:; - } + } } -void onecomp_PVSSRC(PVSSRC* pPVSSRC, int c) +void onecomp_PVSSRC(PVSSRC* pPVSSRC, int c) { - switch (c) + switch (c) { case 0: pPVSSRC->swizzlex = SQ_SEL_1; pPVSSRC->negx = 0; break; case 1: pPVSSRC->swizzley = SQ_SEL_1; pPVSSRC->negy = 0; break; case 2: pPVSSRC->swizzlez = SQ_SEL_1; pPVSSRC->negz = 0; break; case 3: pPVSSRC->swizzlew = SQ_SEL_1; pPVSSRC->negw = 0; break; default:; - } + } } -BITS is_misc_component_exported(VAP_OUT_VTX_FMT_0* pOutVTXFmt0) +BITS is_misc_component_exported(VAP_OUT_VTX_FMT_0* pOutVTXFmt0) { return (pOutVTXFmt0->point_size | pOutVTXFmt0->edge_flag | @@ -239,19 +239,19 @@ BITS is_misc_component_exported(VAP_OUT_VTX_FMT_0* pOutVTXFmt0) pOutVTXFmt0->viewport_index); } -BITS is_depth_component_exported(OUT_FRAGMENT_FMT_0* pFPOutFmt) +BITS is_depth_component_exported(OUT_FRAGMENT_FMT_0* pFPOutFmt) { - return (pFPOutFmt->depth | - pFPOutFmt->stencil_ref | - pFPOutFmt->mask | + return (pFPOutFmt->depth | + pFPOutFmt->stencil_ref | + pFPOutFmt->mask | pFPOutFmt->coverage_to_mask); } GLboolean is_reduction_opcode(PVSDWORD* dest) { - if (dest->dst.op3 == 0) + if (dest->dst.op3 == 0) { - if ( (dest->dst.opcode == SQ_OP2_INST_DOT4 || dest->dst.opcode == SQ_OP2_INST_DOT4_IEEE || dest->dst.opcode == SQ_OP2_INST_CUBE) ) + if ( (dest->dst.opcode == SQ_OP2_INST_DOT4 || dest->dst.opcode == SQ_OP2_INST_DOT4_IEEE || dest->dst.opcode == SQ_OP2_INST_CUBE) ) { return GL_TRUE; } @@ -261,9 +261,9 @@ GLboolean is_reduction_opcode(PVSDWORD* dest) GLboolean EG_is_reduction_opcode(PVSDWORD* dest) { - if (dest->dst.op3 == 0) + if (dest->dst.op3 == 0) { - if ( (dest->dst.opcode == EG_OP2_INST_DOT4 || dest->dst.opcode == EG_OP2_INST_DOT4_IEEE || dest->dst.opcode == EG_OP2_INST_CUBE) ) + if ( (dest->dst.opcode == EG_OP2_INST_DOT4 || dest->dst.opcode == EG_OP2_INST_DOT4_IEEE || dest->dst.opcode == EG_OP2_INST_CUBE) ) { return GL_TRUE; } @@ -382,7 +382,7 @@ GLuint GetSurfaceFormat(GLenum eType, GLuint nChannels, GLuint * pClient_size) return(format); } -unsigned int r700GetNumOperands(GLuint opcode, GLuint nIsOp3) +unsigned int r700GetNumOperands(GLuint opcode, GLuint nIsOp3) { if(nIsOp3 > 0) { @@ -396,12 +396,12 @@ unsigned int r700GetNumOperands(GLuint opcode, GLuint nIsOp3) case SQ_OP2_INST_KILLGT: case SQ_OP2_INST_KILLGE: case SQ_OP2_INST_KILLNE: - case SQ_OP2_INST_MUL: + case SQ_OP2_INST_MUL: case SQ_OP2_INST_MAX: case SQ_OP2_INST_MIN: //case SQ_OP2_INST_MAX_DX10: //case SQ_OP2_INST_MIN_DX10: - case SQ_OP2_INST_SETE: + case SQ_OP2_INST_SETE: case SQ_OP2_INST_SETNE: case SQ_OP2_INST_SETGT: case SQ_OP2_INST_SETGE: @@ -412,9 +412,9 @@ unsigned int r700GetNumOperands(GLuint opcode, GLuint nIsOp3) case SQ_OP2_INST_DOT4: case SQ_OP2_INST_DOT4_IEEE: case SQ_OP2_INST_CUBE: - return 2; + return 2; - case SQ_OP2_INST_MOV: + case SQ_OP2_INST_MOV: case SQ_OP2_INST_MOVA_FLOOR: case SQ_OP2_INST_FRACT: case SQ_OP2_INST_FLOOR: @@ -428,15 +428,15 @@ unsigned int r700GetNumOperands(GLuint opcode, GLuint nIsOp3) case SQ_OP2_INST_SIN: case SQ_OP2_INST_COS: return 1; - + default: radeon_error( - "Need instruction operand number for %x.\n", opcode); + "Need instruction operand number for %x.\n", opcode); }; return 3; } -unsigned int EG_GetNumOperands(GLuint opcode, GLuint nIsOp3) +unsigned int EG_GetNumOperands(GLuint opcode, GLuint nIsOp3) { if(nIsOp3 > 0) { @@ -450,12 +450,12 @@ unsigned int EG_GetNumOperands(GLuint opcode, GLuint nIsOp3) case EG_OP2_INST_KILLGT: case EG_OP2_INST_KILLGE: case EG_OP2_INST_KILLNE: - case EG_OP2_INST_MUL: + case EG_OP2_INST_MUL: case EG_OP2_INST_MAX: case EG_OP2_INST_MIN: //case EG_OP2_INST_MAX_DX10: //case EG_OP2_INST_MIN_DX10: - case EG_OP2_INST_SETE: + case EG_OP2_INST_SETE: case EG_OP2_INST_SETNE: case EG_OP2_INST_SETGT: case EG_OP2_INST_SETGE: @@ -466,9 +466,9 @@ unsigned int EG_GetNumOperands(GLuint opcode, GLuint nIsOp3) case EG_OP2_INST_DOT4: case EG_OP2_INST_DOT4_IEEE: case EG_OP2_INST_CUBE: - return 2; + return 2; - case EG_OP2_INST_MOV: + case EG_OP2_INST_MOV: //case SQ_OP2_INST_MOVA_FLOOR: case EG_OP2_INST_FRACT: case EG_OP2_INST_FLOOR: @@ -484,9 +484,9 @@ unsigned int EG_GetNumOperands(GLuint opcode, GLuint nIsOp3) case EG_OP2_INST_FLT_TO_INT_FLOOR: case EG_OP2_INST_MOVA_INT: return 1; - + default: radeon_error( - "Need instruction operand number for %x.\n", opcode); + "Need instruction operand number for %x.\n", opcode); }; return 3; @@ -524,14 +524,14 @@ int Init_r700_AssemblerBase(SHADER_PIPE_TYPE spt, r700_AssemblerBase* pAsm, R700 pAsm->S[1].bits = 0; pAsm->S[2].bits = 0; - pAsm->uLastPosUpdate = 0; - + pAsm->uLastPosUpdate = 0; + *(BITS *) &pAsm->fp_stOutFmt0 = 0; pAsm->uIIns = 0; pAsm->uOIns = 0; pAsm->number_used_registers = 0; - pAsm->uUsedConsts = 256; + pAsm->uUsedConsts = 256; // Fragment programs @@ -550,7 +550,7 @@ int Init_r700_AssemblerBase(SHADER_PIPE_TYPE spt, r700_AssemblerBase* pAsm, R700 pAsm->uOutputs = 0; - for (i=0; icolor_export_register_number[i] = (-1); } @@ -569,17 +569,17 @@ int Init_r700_AssemblerBase(SHADER_PIPE_TYPE spt, r700_AssemblerBase* pAsm, R700 pAsm->input_position_is_used = GL_FALSE; pAsm->input_normal_is_used = GL_FALSE; - for (i=0; iinput_color_is_used[ i ] = GL_FALSE; } - for (i=0; iinput_texture_unit_is_used[ i ] = GL_FALSE; } - for (i=0; ivfetch_instruction_ptr_array[ i ] = NULL; } @@ -641,36 +641,36 @@ GLboolean IsAlu(gl_inst_opcode Opcode) int check_current_clause(r700_AssemblerBase* pAsm, CF_CLAUSE_TYPE new_clause_type) { - if (pAsm->cf_current_clause_type != new_clause_type) + if (pAsm->cf_current_clause_type != new_clause_type) { //Close last open clause - switch (pAsm->cf_current_clause_type) + switch (pAsm->cf_current_clause_type) { case CF_ALU_CLAUSE: - if ( pAsm->cf_current_alu_clause_ptr != NULL) + if ( pAsm->cf_current_alu_clause_ptr != NULL) { pAsm->cf_current_alu_clause_ptr = NULL; } break; case CF_VTX_CLAUSE: - if ( pAsm->cf_current_vtx_clause_ptr != NULL) + if ( pAsm->cf_current_vtx_clause_ptr != NULL) { pAsm->cf_current_vtx_clause_ptr = NULL; } break; case CF_TEX_CLAUSE: - if ( pAsm->cf_current_tex_clause_ptr != NULL) + if ( pAsm->cf_current_tex_clause_ptr != NULL) { pAsm->cf_current_tex_clause_ptr = NULL; } break; case CF_EXPORT_CLAUSE: - if ( pAsm->cf_current_export_clause_ptr != NULL) + if ( pAsm->cf_current_export_clause_ptr != NULL) { pAsm->cf_current_export_clause_ptr = NULL; } break; case CF_OTHER_CLAUSE: - if ( pAsm->cf_current_cf_clause_ptr != NULL) + if ( pAsm->cf_current_cf_clause_ptr != NULL) { pAsm->cf_current_cf_clause_ptr = NULL; } @@ -686,7 +686,7 @@ int check_current_clause(r700_AssemblerBase* pAsm, pAsm->cf_current_clause_type = CF_EMPTY_CLAUSE; // Create new clause - switch (new_clause_type) + switch (new_clause_type) { case CF_ALU_CLAUSE: pAsm->cf_current_clause_type = CF_ALU_CLAUSE; @@ -694,23 +694,23 @@ int check_current_clause(r700_AssemblerBase* pAsm, case CF_VTX_CLAUSE: pAsm->cf_current_clause_type = CF_VTX_CLAUSE; break; - case CF_TEX_CLAUSE: + case CF_TEX_CLAUSE: pAsm->cf_current_clause_type = CF_TEX_CLAUSE; break; case CF_EXPORT_CLAUSE: { - R700ControlFlowSXClause* pR700ControlFlowSXClause - = (R700ControlFlowSXClause*) CALLOC_STRUCT(R700ControlFlowSXClause); - - // Add new export instruction to control flow program - if (pR700ControlFlowSXClause != 0) + R700ControlFlowSXClause* pR700ControlFlowSXClause + = (R700ControlFlowSXClause*) CALLOC_STRUCT(R700ControlFlowSXClause); + + // Add new export instruction to control flow program + if (pR700ControlFlowSXClause != 0) { pAsm->cf_current_export_clause_ptr = pR700ControlFlowSXClause; Init_R700ControlFlowSXClause(pR700ControlFlowSXClause); - AddCFInstruction( pAsm->pR700Shader, + AddCFInstruction( pAsm->pR700Shader, (R700ControlFlowInstruction *)pR700ControlFlowSXClause ); } - else + else { radeon_error( "Error allocating new EXPORT CF instruction in check_current_clause. \n"); @@ -741,16 +741,16 @@ GLboolean add_cf_instruction(r700_AssemblerBase* pAsm) return GL_FALSE; } - pAsm->cf_current_cf_clause_ptr = + pAsm->cf_current_cf_clause_ptr = (R700ControlFlowGenericClause*) CALLOC_STRUCT(R700ControlFlowGenericClause); - if (pAsm->cf_current_cf_clause_ptr != NULL) + if (pAsm->cf_current_cf_clause_ptr != NULL) { Init_R700ControlFlowGenericClause(pAsm->cf_current_cf_clause_ptr); - AddCFInstruction( pAsm->pR700Shader, + AddCFInstruction( pAsm->pR700Shader, (R700ControlFlowInstruction *)pAsm->cf_current_cf_clause_ptr ); } - else + else { radeon_error("Could not allocate a new VFetch CF instruction.\n"); return GL_FALSE; @@ -768,20 +768,20 @@ GLboolean add_vfetch_instruction(r700_AssemblerBase* pAsm, } if( pAsm->cf_current_vtx_clause_ptr == NULL || - ( (pAsm->cf_current_vtx_clause_ptr != NULL) && - (pAsm->cf_current_vtx_clause_ptr->m_Word1.f.count >= GetCFMaxInstructions(pAsm->cf_current_vtx_clause_ptr->m_ShaderInstType)-1) - ) ) - { + ( (pAsm->cf_current_vtx_clause_ptr != NULL) && + (pAsm->cf_current_vtx_clause_ptr->m_Word1.f.count >= GetCFMaxInstructions(pAsm->cf_current_vtx_clause_ptr->m_ShaderInstType)-1) + ) ) + { // Create new Vfetch control flow instruction for this new clause pAsm->cf_current_vtx_clause_ptr = (R700ControlFlowGenericClause*) CALLOC_STRUCT(R700ControlFlowGenericClause); - if (pAsm->cf_current_vtx_clause_ptr != NULL) + if (pAsm->cf_current_vtx_clause_ptr != NULL) { Init_R700ControlFlowGenericClause(pAsm->cf_current_vtx_clause_ptr); - AddCFInstruction( pAsm->pR700Shader, + AddCFInstruction( pAsm->pR700Shader, (R700ControlFlowInstruction *)pAsm->cf_current_vtx_clause_ptr ); } - else + else { radeon_error("Could not allocate a new VFetch CF instruction.\n"); return GL_FALSE; @@ -792,7 +792,7 @@ GLboolean add_vfetch_instruction(r700_AssemblerBase* pAsm, SETfield(pAsm->cf_current_vtx_clause_ptr->m_Word1.val, EG_CF_INST_VC, EG_CF_WORD1__CF_INST_shift, EG_CF_WORD1__CF_INST_mask); SETfield(pAsm->cf_current_vtx_clause_ptr->m_Word1.val, 0, - EG_CF_WORD1__POP_COUNT_shift, EG_CF_WORD1__POP_COUNT_mask); + EG_CF_WORD1__POP_COUNT_shift, EG_CF_WORD1__POP_COUNT_mask); SETfield(pAsm->cf_current_vtx_clause_ptr->m_Word1.val, 0, EG_CF_WORD1__CF_CONST_shift, EG_CF_WORD1__CF_CONST_mask); SETfield(pAsm->cf_current_vtx_clause_ptr->m_Word1.val, SQ_CF_COND_ACTIVE, @@ -802,7 +802,7 @@ GLboolean add_vfetch_instruction(r700_AssemblerBase* pAsm, SETfield(pAsm->cf_current_vtx_clause_ptr->m_Word1.val, 0, EG_CF_WORD1__VPM_shift, EG_CF_WORD1__VPM_bit); SETfield(pAsm->cf_current_vtx_clause_ptr->m_Word1.val, 0, - EG_CF_WORD1__EOP_shift, EG_CF_WORD1__EOP_bit); + EG_CF_WORD1__EOP_shift, EG_CF_WORD1__EOP_bit); SETfield(pAsm->cf_current_vtx_clause_ptr->m_Word1.val, 0, EG_CF_WORD1__WQM_shift, EG_CF_WORD1__WQM_bit); SETfield(pAsm->cf_current_vtx_clause_ptr->m_Word1.val, 1, @@ -827,7 +827,7 @@ GLboolean add_vfetch_instruction(r700_AssemblerBase* pAsm, { if(8 == pAsm->unAsic) { - unsigned int count = GETbits(pAsm->cf_current_vtx_clause_ptr->m_Word1.val, + unsigned int count = GETbits(pAsm->cf_current_vtx_clause_ptr->m_Word1.val, EG_CF_WORD1__COUNT_shift, EG_CF_WORD1__COUNT_mask) + 1; SETfield(pAsm->cf_current_vtx_clause_ptr->m_Word1.val, count, EG_CF_WORD1__COUNT_shift, EG_CF_WORD1__COUNT_mask); @@ -845,27 +845,27 @@ GLboolean add_vfetch_instruction(r700_AssemblerBase* pAsm, GLboolean add_tex_instruction(r700_AssemblerBase* pAsm, R700TextureInstruction* tex_instruction_ptr) -{ +{ if ( GL_FALSE == check_current_clause(pAsm, CF_TEX_CLAUSE) ) { return GL_FALSE; } if ( pAsm->cf_current_tex_clause_ptr == NULL || - ( (pAsm->cf_current_tex_clause_ptr != NULL) && - (pAsm->cf_current_tex_clause_ptr->m_Word1.f.count >= GetCFMaxInstructions(pAsm->cf_current_tex_clause_ptr->m_ShaderInstType)-1) - ) ) + ( (pAsm->cf_current_tex_clause_ptr != NULL) && + (pAsm->cf_current_tex_clause_ptr->m_Word1.f.count >= GetCFMaxInstructions(pAsm->cf_current_tex_clause_ptr->m_ShaderInstType)-1) + ) ) { - // new tex cf instruction for this new clause + // new tex cf instruction for this new clause pAsm->cf_current_tex_clause_ptr = (R700ControlFlowGenericClause*) CALLOC_STRUCT(R700ControlFlowGenericClause); - if (pAsm->cf_current_tex_clause_ptr != NULL) + if (pAsm->cf_current_tex_clause_ptr != NULL) { Init_R700ControlFlowGenericClause(pAsm->cf_current_tex_clause_ptr); - AddCFInstruction( pAsm->pR700Shader, + AddCFInstruction( pAsm->pR700Shader, (R700ControlFlowInstruction *)pAsm->cf_current_tex_clause_ptr ); } - else + else { radeon_error("Could not allocate a new TEX CF instruction.\n"); return GL_FALSE; @@ -876,7 +876,7 @@ GLboolean add_tex_instruction(r700_AssemblerBase* pAsm, SETfield(pAsm->cf_current_tex_clause_ptr->m_Word1.val, EG_CF_INST_TC, EG_CF_WORD1__CF_INST_shift, EG_CF_WORD1__CF_INST_mask); SETfield(pAsm->cf_current_tex_clause_ptr->m_Word1.val, 0, - EG_CF_WORD1__POP_COUNT_shift, EG_CF_WORD1__POP_COUNT_mask); + EG_CF_WORD1__POP_COUNT_shift, EG_CF_WORD1__POP_COUNT_mask); SETfield(pAsm->cf_current_tex_clause_ptr->m_Word1.val, 0, EG_CF_WORD1__CF_CONST_shift, EG_CF_WORD1__CF_CONST_mask); SETfield(pAsm->cf_current_tex_clause_ptr->m_Word1.val, SQ_CF_COND_ACTIVE, @@ -886,7 +886,7 @@ GLboolean add_tex_instruction(r700_AssemblerBase* pAsm, SETfield(pAsm->cf_current_tex_clause_ptr->m_Word1.val, 0, EG_CF_WORD1__VPM_shift, EG_CF_WORD1__VPM_bit); SETfield(pAsm->cf_current_tex_clause_ptr->m_Word1.val, 0, - EG_CF_WORD1__EOP_shift, EG_CF_WORD1__EOP_bit); + EG_CF_WORD1__EOP_shift, EG_CF_WORD1__EOP_bit); SETfield(pAsm->cf_current_tex_clause_ptr->m_Word1.val, 0, EG_CF_WORD1__WQM_shift, EG_CF_WORD1__WQM_bit); #ifdef FORCE_CF_TEX_BARRIER @@ -898,7 +898,7 @@ GLboolean add_tex_instruction(r700_AssemblerBase* pAsm, #endif } else - { + { pAsm->cf_current_tex_clause_ptr->m_Word1.f.pop_count = 0x0; pAsm->cf_current_tex_clause_ptr->m_Word1.f.cf_const = 0x0; pAsm->cf_current_tex_clause_ptr->m_Word1.f.cond = SQ_CF_COND_ACTIVE; @@ -910,27 +910,27 @@ GLboolean add_tex_instruction(r700_AssemblerBase* pAsm, pAsm->cf_current_tex_clause_ptr->m_Word1.f.barrier = 0x0; //0x1; } } - else - { + else + { if(8 == pAsm->unAsic) { - unsigned int count = GETbits(pAsm->cf_current_tex_clause_ptr->m_Word1.val, + unsigned int count = GETbits(pAsm->cf_current_tex_clause_ptr->m_Word1.val, EG_CF_WORD1__COUNT_shift, EG_CF_WORD1__COUNT_mask) + 1; SETfield(pAsm->cf_current_tex_clause_ptr->m_Word1.val, count, EG_CF_WORD1__COUNT_shift, EG_CF_WORD1__COUNT_mask); } else - { + { pAsm->cf_current_tex_clause_ptr->m_Word1.f.count++; } } - // If this clause constains any TEX instruction that is dependent on a - // previous instruction, set the barrier bit, also always set for vert + // If this clause constains any TEX instruction that is dependent on a + // previous instruction, set the barrier bit, also always set for vert // programs as tex deps are not(yet) computed for them if( pAsm->currentShaderType == SPT_VP || pAsm->pInstDeps[pAsm->uiCurInst].nDstDep > (-1) || pAsm->need_tex_barrier == GL_TRUE ) { - pAsm->cf_current_tex_clause_ptr->m_Word1.f.barrier = 0x1; + pAsm->cf_current_tex_clause_ptr->m_Word1.f.barrier = 0x1; } if(NULL == pAsm->cf_current_tex_clause_ptr->m_pLinkedTEXInstruction) @@ -959,16 +959,16 @@ GLboolean assemble_vfetch_instruction(r700_AssemblerBase* pAsm, R700VertexGenericFetch* vfetch_instruction_ptr; R700VertexGenericFetch* assembled_vfetch_instruction_ptr = pAsm->vfetch_instruction_ptr_array[ gl_client_id ]; - if (assembled_vfetch_instruction_ptr == NULL) + if (assembled_vfetch_instruction_ptr == NULL) { vfetch_instruction_ptr = (R700VertexGenericFetch*) CALLOC_STRUCT(R700VertexGenericFetch); - if (vfetch_instruction_ptr == NULL) + if (vfetch_instruction_ptr == NULL) { return GL_FALSE; } Init_R700VertexGenericFetch(vfetch_instruction_ptr); } - else + else { vfetch_instruction_ptr = assembled_vfetch_instruction_ptr; } @@ -993,7 +993,7 @@ GLboolean assemble_vfetch_instruction(r700_AssemblerBase* pAsm, vfetch_instruction_ptr->m_Word0.f.fetch_whole_quad = 0x0; vfetch_instruction_ptr->m_Word0.f.buffer_id = gl_client_id; - vfetch_instruction_ptr->m_Word0.f.src_gpr = 0x0; + vfetch_instruction_ptr->m_Word0.f.src_gpr = 0x0; vfetch_instruction_ptr->m_Word0.f.src_rel = SQ_ABSOLUTE; vfetch_instruction_ptr->m_Word0.f.src_sel_x = SQ_SEL_X; vfetch_instruction_ptr->m_Word0.f.mega_fetch_count = mega_fetch_count; @@ -1006,7 +1006,7 @@ GLboolean assemble_vfetch_instruction(r700_AssemblerBase* pAsm, vfetch_instruction_ptr->m_Word1.f.use_const_fields = 1; // Destination register - vfetch_instruction_ptr->m_Word1_GPR.f.dst_gpr = destination_register; + vfetch_instruction_ptr->m_Word1_GPR.f.dst_gpr = destination_register; vfetch_instruction_ptr->m_Word1_GPR.f.dst_rel = SQ_ABSOLUTE; vfetch_instruction_ptr->m_Word2.f.offset = 0; @@ -1014,18 +1014,18 @@ GLboolean assemble_vfetch_instruction(r700_AssemblerBase* pAsm, vfetch_instruction_ptr->m_Word2.f.mega_fetch = is_mega_fetch_flag; - if (assembled_vfetch_instruction_ptr == NULL) + if (assembled_vfetch_instruction_ptr == NULL) { - if ( GL_FALSE == add_vfetch_instruction(pAsm, (R700VertexInstruction *)vfetch_instruction_ptr) ) - { + if ( GL_FALSE == add_vfetch_instruction(pAsm, (R700VertexInstruction *)vfetch_instruction_ptr) ) + { return GL_FALSE; } - if (pAsm->vfetch_instruction_ptr_array[ gl_client_id ] != NULL) + if (pAsm->vfetch_instruction_ptr_array[ gl_client_id ] != NULL) { return GL_FALSE; } - else + else { pAsm->vfetch_instruction_ptr_array[ gl_client_id ] = vfetch_instruction_ptr; } @@ -1035,7 +1035,7 @@ GLboolean assemble_vfetch_instruction(r700_AssemblerBase* pAsm, } GLboolean EG_assemble_vfetch_instruction(r700_AssemblerBase* pAsm, - GLuint destination_register, + GLuint destination_register, GLenum type, GLint size, GLubyte element, @@ -1052,24 +1052,24 @@ GLboolean EG_assemble_vfetch_instruction(r700_AssemblerBase* pAsm, GLuint dst_sel_x, dst_sel_y, dst_sel_z, dst_sel_w; R700VertexGenericFetch* vfetch_instruction_ptr; - R700VertexGenericFetch* assembled_vfetch_instruction_ptr + R700VertexGenericFetch* assembled_vfetch_instruction_ptr = pAsm->vfetch_instruction_ptr_array[element]; - if (assembled_vfetch_instruction_ptr == NULL) + if (assembled_vfetch_instruction_ptr == NULL) { vfetch_instruction_ptr = (R700VertexGenericFetch*) CALLOC_STRUCT(R700VertexGenericFetch); - if (vfetch_instruction_ptr == NULL) + if (vfetch_instruction_ptr == NULL) { return GL_FALSE; } Init_R700VertexGenericFetch(vfetch_instruction_ptr); } - else + else { vfetch_instruction_ptr = assembled_vfetch_instruction_ptr; } - data_format = GetSurfaceFormat(type, size, &client_size_inbyte); + data_format = GetSurfaceFormat(type, size, &client_size_inbyte); if(GL_TRUE == pFetchMethod->bEnableMini) //More conditions here { @@ -1090,7 +1090,7 @@ GLboolean EG_assemble_vfetch_instruction(r700_AssemblerBase* pAsm, SETfield(vfetch_instruction_ptr->m_Word0.val, EG_VTX_FETCH_VERTEX_DATA, EG_VTX_WORD0__FETCH_TYPE_shift, EG_VTX_WORD0__FETCH_TYPE_mask); - CLEARbit(vfetch_instruction_ptr->m_Word0.val, + CLEARbit(vfetch_instruction_ptr->m_Word0.val, EG_VTX_WORD0__FWQ_bit); SETfield(vfetch_instruction_ptr->m_Word0.val, element, EG_VTX_WORD0__BUFFER_ID_shift, @@ -1107,9 +1107,9 @@ GLboolean EG_assemble_vfetch_instruction(r700_AssemblerBase* pAsm, SETfield(vfetch_instruction_ptr->m_Word0.val, mega_fetch_count, EG_VTX_WORD0__MFC_shift, EG_VTX_WORD0__MFC_mask); - + if(format == GL_BGRA) - { + { dst_sel_x = (size < 1) ? SQ_SEL_0 : SQ_SEL_Z; dst_sel_y = (size < 2) ? SQ_SEL_0 : SQ_SEL_Y; dst_sel_z = (size < 3) ? SQ_SEL_0 : SQ_SEL_X; @@ -1135,13 +1135,13 @@ GLboolean EG_assemble_vfetch_instruction(r700_AssemblerBase* pAsm, SETfield(vfetch_instruction_ptr->m_Word1.val, dst_sel_w, EG_VTX_WORD1__DST_SEL_W_shift, EG_VTX_WORD1__DST_SEL_W_mask); - - SETfield(vfetch_instruction_ptr->m_Word1.val, 1, + + SETfield(vfetch_instruction_ptr->m_Word1.val, 1, EG_VTX_WORD1__UCF_shift, EG_VTX_WORD1__UCF_bit); SETfield(vfetch_instruction_ptr->m_Word1.val, data_format, EG_VTX_WORD1__DATA_FORMAT_shift, - EG_VTX_WORD1__DATA_FORMAT_mask); + EG_VTX_WORD1__DATA_FORMAT_mask); #ifdef TEST_VFETCH SETfield(vfetch_instruction_ptr->m_Word1.val, SQ_FORMAT_COMP_SIGNED, EG_VTX_WORD1__FCA_shift, @@ -1151,13 +1151,13 @@ GLboolean EG_assemble_vfetch_instruction(r700_AssemblerBase* pAsm, { SETfield(vfetch_instruction_ptr->m_Word1.val, SQ_FORMAT_COMP_SIGNED, EG_VTX_WORD1__FCA_shift, - EG_VTX_WORD1__FCA_bit); + EG_VTX_WORD1__FCA_bit); } else { SETfield(vfetch_instruction_ptr->m_Word1.val, SQ_FORMAT_COMP_UNSIGNED, EG_VTX_WORD1__FCA_shift, - EG_VTX_WORD1__FCA_bit); + EG_VTX_WORD1__FCA_bit); } #endif /* TEST_VFETCH */ @@ -1165,13 +1165,13 @@ GLboolean EG_assemble_vfetch_instruction(r700_AssemblerBase* pAsm, { SETfield(vfetch_instruction_ptr->m_Word1.val, SQ_NUM_FORMAT_NORM, EG_VTX_WORD1__NFA_shift, - EG_VTX_WORD1__NFA_mask); + EG_VTX_WORD1__NFA_mask); } else { SETfield(vfetch_instruction_ptr->m_Word1.val, SQ_NUM_FORMAT_SCALED, EG_VTX_WORD1__NFA_shift, - EG_VTX_WORD1__NFA_mask); + EG_VTX_WORD1__NFA_mask); } /* Destination register */ @@ -1180,12 +1180,12 @@ GLboolean EG_assemble_vfetch_instruction(r700_AssemblerBase* pAsm, EG_VTX_WORD1_GPR__DST_GPR_mask); SETfield(vfetch_instruction_ptr->m_Word1.val, SQ_ABSOLUTE, EG_VTX_WORD1_GPR__DST_REL_shift, - EG_VTX_WORD1_GPR__DST_REL_bit); - + EG_VTX_WORD1_GPR__DST_REL_bit); + SETfield(vfetch_instruction_ptr->m_Word2.val, 0, EG_VTX_WORD2__OFFSET_shift, - EG_VTX_WORD2__OFFSET_mask); + EG_VTX_WORD2__OFFSET_mask); SETfield(vfetch_instruction_ptr->m_Word2.val, SQ_ENDIAN_NONE, EG_VTX_WORD2__ENDIAN_SWAP_shift, EG_VTX_WORD2__ENDIAN_SWAP_mask); @@ -1195,19 +1195,19 @@ GLboolean EG_assemble_vfetch_instruction(r700_AssemblerBase* pAsm, SETfield(vfetch_instruction_ptr->m_Word2.val, is_mega_fetch_flag, EG_VTX_WORD2__MEGA_FETCH_shift, EG_VTX_WORD2__MEGA_FETCH_mask); - - if (assembled_vfetch_instruction_ptr == NULL) + + if (assembled_vfetch_instruction_ptr == NULL) { - if ( GL_FALSE == add_vfetch_instruction(pAsm, (R700VertexInstruction *)vfetch_instruction_ptr) ) - { + if ( GL_FALSE == add_vfetch_instruction(pAsm, (R700VertexInstruction *)vfetch_instruction_ptr) ) + { return GL_FALSE; } - if (pAsm->vfetch_instruction_ptr_array[element] != NULL) + if (pAsm->vfetch_instruction_ptr_array[element] != NULL) { return GL_FALSE; } - else + else { pAsm->vfetch_instruction_ptr_array[element] = vfetch_instruction_ptr; } @@ -1217,7 +1217,7 @@ GLboolean EG_assemble_vfetch_instruction(r700_AssemblerBase* pAsm, } GLboolean assemble_vfetch_instruction2(r700_AssemblerBase* pAsm, - GLuint destination_register, + GLuint destination_register, GLenum type, GLint size, GLubyte element, @@ -1232,24 +1232,24 @@ GLboolean assemble_vfetch_instruction2(r700_AssemblerBase* pAsm, GLuint is_mega_fetch_flag; R700VertexGenericFetch* vfetch_instruction_ptr; - R700VertexGenericFetch* assembled_vfetch_instruction_ptr + R700VertexGenericFetch* assembled_vfetch_instruction_ptr = pAsm->vfetch_instruction_ptr_array[element]; - if (assembled_vfetch_instruction_ptr == NULL) + if (assembled_vfetch_instruction_ptr == NULL) { vfetch_instruction_ptr = (R700VertexGenericFetch*) CALLOC_STRUCT(R700VertexGenericFetch); - if (vfetch_instruction_ptr == NULL) + if (vfetch_instruction_ptr == NULL) { return GL_FALSE; } Init_R700VertexGenericFetch(vfetch_instruction_ptr); } - else + else { vfetch_instruction_ptr = assembled_vfetch_instruction_ptr; } - data_format = GetSurfaceFormat(type, size, &client_size_inbyte); + data_format = GetSurfaceFormat(type, size, &client_size_inbyte); if(GL_TRUE == pFetchMethod->bEnableMini) //More conditions here { @@ -1269,7 +1269,7 @@ GLboolean assemble_vfetch_instruction2(r700_AssemblerBase* pAsm, vfetch_instruction_ptr->m_Word0.f.fetch_whole_quad = 0x0; vfetch_instruction_ptr->m_Word0.f.buffer_id = element; - vfetch_instruction_ptr->m_Word0.f.src_gpr = 0x0; + vfetch_instruction_ptr->m_Word0.f.src_gpr = 0x0; vfetch_instruction_ptr->m_Word0.f.src_rel = SQ_ABSOLUTE; vfetch_instruction_ptr->m_Word0.f.src_sel_x = SQ_SEL_X; vfetch_instruction_ptr->m_Word0.f.mega_fetch_count = mega_fetch_count; @@ -1313,7 +1313,7 @@ GLboolean assemble_vfetch_instruction2(r700_AssemblerBase* pAsm, } // Destination register - vfetch_instruction_ptr->m_Word1_GPR.f.dst_gpr = destination_register; + vfetch_instruction_ptr->m_Word1_GPR.f.dst_gpr = destination_register; vfetch_instruction_ptr->m_Word1_GPR.f.dst_rel = SQ_ABSOLUTE; vfetch_instruction_ptr->m_Word2.f.offset = 0; @@ -1321,18 +1321,18 @@ GLboolean assemble_vfetch_instruction2(r700_AssemblerBase* pAsm, vfetch_instruction_ptr->m_Word2.f.mega_fetch = is_mega_fetch_flag; - if (assembled_vfetch_instruction_ptr == NULL) + if (assembled_vfetch_instruction_ptr == NULL) { - if ( GL_FALSE == add_vfetch_instruction(pAsm, (R700VertexInstruction *)vfetch_instruction_ptr) ) - { + if ( GL_FALSE == add_vfetch_instruction(pAsm, (R700VertexInstruction *)vfetch_instruction_ptr) ) + { return GL_FALSE; } - if (pAsm->vfetch_instruction_ptr_array[element] != NULL) + if (pAsm->vfetch_instruction_ptr_array[element] != NULL) { return GL_FALSE; } - else + else { pAsm->vfetch_instruction_ptr_array[element] = vfetch_instruction_ptr; } @@ -1347,17 +1347,17 @@ GLboolean cleanup_vfetch_instructions(r700_AssemblerBase* pAsm) pAsm->cf_current_clause_type = CF_EMPTY_CLAUSE; pAsm->cf_current_vtx_clause_ptr = NULL; - for (i=0; ivfetch_instruction_ptr_array[ i ] = NULL; } cleanup_vfetch_shaderinst(pAsm->pR700Shader); - + return GL_TRUE; } -GLuint gethelpr(r700_AssemblerBase* pAsm) +GLuint gethelpr(r700_AssemblerBase* pAsm) { GLuint r = pAsm->uHelpReg; pAsm->uHelpReg++; @@ -1367,7 +1367,7 @@ GLuint gethelpr(r700_AssemblerBase* pAsm) } return r; } -void resethelpr(r700_AssemblerBase* pAsm) +void resethelpr(r700_AssemblerBase* pAsm) { pAsm->uHelpReg = pAsm->uFirstHelpReg; } @@ -1439,7 +1439,7 @@ GLboolean mov_temp(r700_AssemblerBase* pAsm, int src) pAsm->D.dst.opcode = SQ_OP2_INST_MOV; setaddrmode_PVSDST(&(pAsm->D.dst), ADDR_ABSOLUTE); - + pAsm->D.dst.rtype = DST_REG_TEMPORARY; pAsm->D.dst.reg = tmp; @@ -1452,8 +1452,8 @@ GLboolean mov_temp(r700_AssemblerBase* pAsm, int src) noswizzle_PVSSRC(&(pAsm->S[0].src)); noneg_PVSSRC(&(pAsm->S[0].src)); - - if( GL_FALSE == next_ins(pAsm) ) + + if( GL_FALSE == next_ins(pAsm) ) { return GL_FALSE; } @@ -1476,7 +1476,7 @@ GLboolean checkop2(r700_AssemblerBase* pAsm) checkop_init(pAsm); - if( (pILInst->SrcReg[0].File == PROGRAM_UNIFORM) || + if( (pILInst->SrcReg[0].File == PROGRAM_UNIFORM) || (pILInst->SrcReg[0].File == PROGRAM_CONSTANT) || (pILInst->SrcReg[0].File == PROGRAM_LOCAL_PARAM) || (pILInst->SrcReg[0].File == PROGRAM_ENV_PARAM) || @@ -1488,7 +1488,7 @@ GLboolean checkop2(r700_AssemblerBase* pAsm) { bSrcConst[0] = GL_FALSE; } - if( (pILInst->SrcReg[1].File == PROGRAM_UNIFORM) || + if( (pILInst->SrcReg[1].File == PROGRAM_UNIFORM) || (pILInst->SrcReg[1].File == PROGRAM_CONSTANT) || (pILInst->SrcReg[1].File == PROGRAM_LOCAL_PARAM) || (pILInst->SrcReg[1].File == PROGRAM_ENV_PARAM) || @@ -1522,7 +1522,7 @@ GLboolean checkop3(r700_AssemblerBase* pAsm) checkop_init(pAsm); - if( (pILInst->SrcReg[0].File == PROGRAM_UNIFORM) || + if( (pILInst->SrcReg[0].File == PROGRAM_UNIFORM) || (pILInst->SrcReg[0].File == PROGRAM_CONSTANT) || (pILInst->SrcReg[0].File == PROGRAM_LOCAL_PARAM) || (pILInst->SrcReg[0].File == PROGRAM_ENV_PARAM) || @@ -1534,7 +1534,7 @@ GLboolean checkop3(r700_AssemblerBase* pAsm) { bSrcConst[0] = GL_FALSE; } - if( (pILInst->SrcReg[1].File == PROGRAM_UNIFORM) || + if( (pILInst->SrcReg[1].File == PROGRAM_UNIFORM) || (pILInst->SrcReg[1].File == PROGRAM_CONSTANT) || (pILInst->SrcReg[1].File == PROGRAM_LOCAL_PARAM) || (pILInst->SrcReg[1].File == PROGRAM_ENV_PARAM) || @@ -1546,7 +1546,7 @@ GLboolean checkop3(r700_AssemblerBase* pAsm) { bSrcConst[1] = GL_FALSE; } - if( (pILInst->SrcReg[2].File == PROGRAM_UNIFORM) || + if( (pILInst->SrcReg[2].File == PROGRAM_UNIFORM) || (pILInst->SrcReg[2].File == PROGRAM_CONSTANT) || (pILInst->SrcReg[2].File == PROGRAM_LOCAL_PARAM) || (pILInst->SrcReg[2].File == PROGRAM_ENV_PARAM) || @@ -1559,9 +1559,9 @@ GLboolean checkop3(r700_AssemblerBase* pAsm) bSrcConst[2] = GL_FALSE; } - if( (GL_TRUE == bSrcConst[0]) && - (GL_TRUE == bSrcConst[1]) && - (GL_TRUE == bSrcConst[2]) ) + if( (GL_TRUE == bSrcConst[0]) && + (GL_TRUE == bSrcConst[1]) && + (GL_TRUE == bSrcConst[2]) ) { if( GL_FALSE == mov_temp(pAsm, 1) ) { @@ -1574,10 +1574,10 @@ GLboolean checkop3(r700_AssemblerBase* pAsm) return GL_TRUE; } - else if( (GL_TRUE == bSrcConst[0]) && - (GL_TRUE == bSrcConst[1]) ) + else if( (GL_TRUE == bSrcConst[0]) && + (GL_TRUE == bSrcConst[1]) ) { - if(pILInst->SrcReg[0].Index != pILInst->SrcReg[1].Index) + if(pILInst->SrcReg[0].Index != pILInst->SrcReg[1].Index) { if( GL_FALSE == mov_temp(pAsm, 1) ) { @@ -1587,10 +1587,10 @@ GLboolean checkop3(r700_AssemblerBase* pAsm) return GL_TRUE; } - else if ( (GL_TRUE == bSrcConst[0]) && - (GL_TRUE == bSrcConst[2]) ) + else if ( (GL_TRUE == bSrcConst[0]) && + (GL_TRUE == bSrcConst[2]) ) { - if(pILInst->SrcReg[0].Index != pILInst->SrcReg[2].Index) + if(pILInst->SrcReg[0].Index != pILInst->SrcReg[2].Index) { if( GL_FALSE == mov_temp(pAsm, 2) ) { @@ -1600,8 +1600,8 @@ GLboolean checkop3(r700_AssemblerBase* pAsm) return GL_TRUE; } - else if( (GL_TRUE == bSrcConst[1]) && - (GL_TRUE == bSrcConst[2]) ) + else if( (GL_TRUE == bSrcConst[1]) && + (GL_TRUE == bSrcConst[2]) ) { if(pILInst->SrcReg[1].Index != pILInst->SrcReg[2].Index) { @@ -1618,7 +1618,7 @@ GLboolean checkop3(r700_AssemblerBase* pAsm) } GLboolean assemble_src(r700_AssemblerBase *pAsm, - int src, + int src, int fld) { struct prog_instruction *pILInst = &(pAsm->pILInst[pAsm->uiCurInst]); @@ -1628,14 +1628,14 @@ GLboolean assemble_src(r700_AssemblerBase *pAsm, fld = src; } - if(pAsm->aArgSubst[1+src] >= 0) + if(pAsm->aArgSubst[1+src] >= 0) { assert(fld >= 0); setaddrmode_PVSSRC(&(pAsm->S[fld].src), ADDR_ABSOLUTE); pAsm->S[fld].src.rtype = SRC_REG_TEMPORARY; pAsm->S[fld].src.reg = pAsm->aArgSubst[1+src]; } - else + else { if (1 == pILInst->SrcReg[src].RelAddr) { @@ -1661,12 +1661,12 @@ GLboolean assemble_src(r700_AssemblerBase *pAsm, { WARN_ONCE("Negative register offsets not supported yet!\n"); pAsm->S[fld].src.reg = 0; - } + } else { pAsm->S[fld].src.reg = pILInst->SrcReg[src].Index; } - break; + break; case PROGRAM_INPUT: pAsm->S[fld].src.rtype = SRC_REG_GPR; switch (pAsm->currentShaderType) @@ -1678,7 +1678,7 @@ GLboolean assemble_src(r700_AssemblerBase *pAsm, pAsm->S[fld].src.reg = pAsm->ucVP_AttributeMap[pILInst->SrcReg[src].Index]; break; } - break; + break; case PROGRAM_OUTPUT: pAsm->S[fld].src.rtype = SRC_REG_GPR; switch (pAsm->currentShaderType) @@ -1695,7 +1695,7 @@ GLboolean assemble_src(r700_AssemblerBase *pAsm, radeon_error("Invalid source argument type : %d \n", pILInst->SrcReg[src].File); return GL_FALSE; } - } + } pAsm->S[fld].src.swizzlex = pILInst->SrcReg[src].Swizzle & 0x7; pAsm->S[fld].src.swizzley = (pILInst->SrcReg[src].Swizzle >> 3) & 0x7; @@ -1706,14 +1706,14 @@ GLboolean assemble_src(r700_AssemblerBase *pAsm, pAsm->S[fld].src.negy = (pILInst->SrcReg[src].Negate >> 1) & 0x1; pAsm->S[fld].src.negz = (pILInst->SrcReg[src].Negate >> 2) & 0x1; pAsm->S[fld].src.negw = (pILInst->SrcReg[src].Negate >> 3) & 0x1; - + return GL_TRUE; } GLboolean assemble_dst(r700_AssemblerBase *pAsm) { struct prog_instruction *pILInst = &(pAsm->pILInst[pAsm->uiCurInst]); - switch (pILInst->DstReg.File) + switch (pILInst->DstReg.File) { case PROGRAM_TEMPORARY: if (1 == pILInst->DstReg.RelAddr) @@ -1751,7 +1751,7 @@ GLboolean assemble_dst(r700_AssemblerBase *pAsm) pAsm->D.dst.reg = pAsm->ucVP_OutputMap[pILInst->DstReg.Index]; break; } - break; + break; default: radeon_error("Invalid destination output argument type\n"); return GL_FALSE; @@ -1761,7 +1761,7 @@ GLboolean assemble_dst(r700_AssemblerBase *pAsm) pAsm->D.dst.writey = (pILInst->DstReg.WriteMask >> 1) & 0x1; pAsm->D.dst.writez = (pILInst->DstReg.WriteMask >> 2) & 0x1; pAsm->D.dst.writew = (pILInst->DstReg.WriteMask >> 3) & 0x1; - + if(pILInst->SaturateMode == SATURATE_ZERO_ONE) { pAsm->D2.dst2.SaturateMode = 1; @@ -1800,7 +1800,7 @@ GLboolean tex_dst(r700_AssemblerBase *pAsm) setaddrmode_PVSDST(&(pAsm->D.dst), ADDR_ABSOLUTE); } - else + else { radeon_error("Invalid destination output argument type\n"); return GL_FALSE; @@ -1810,7 +1810,7 @@ GLboolean tex_dst(r700_AssemblerBase *pAsm) pAsm->D.dst.writey = (pILInst->DstReg.WriteMask >> 1) & 0x1; pAsm->D.dst.writez = (pILInst->DstReg.WriteMask >> 2) & 0x1; pAsm->D.dst.writew = (pILInst->DstReg.WriteMask >> 3) & 0x1; - + return GL_TRUE; } @@ -1830,7 +1830,7 @@ GLboolean tex_src(r700_AssemblerBase *pAsm) else { switch (pILInst->SrcReg[0].File) { - case PROGRAM_UNIFORM: + case PROGRAM_UNIFORM: case PROGRAM_CONSTANT: case PROGRAM_LOCAL_PARAM: case PROGRAM_ENV_PARAM: @@ -1932,9 +1932,9 @@ GLboolean assemble_tex_instruction(r700_AssemblerBase *pAsm, GLboolean normalize { PVSSRC * texture_coordinate_source; PVSSRC * texture_unit_source; - + R700TextureInstruction* tex_instruction_ptr = (R700TextureInstruction*) CALLOC_STRUCT(R700TextureInstruction); - if (tex_instruction_ptr == NULL) + if (tex_instruction_ptr == NULL) { return GL_FALSE; } @@ -1945,7 +1945,7 @@ GLboolean assemble_tex_instruction(r700_AssemblerBase *pAsm, GLboolean normalize if(8 == pAsm->unAsic) /* evergreen */ { - + SETfield(tex_instruction_ptr->m_Word0.val, pAsm->D.dst.opcode, EG_TEX_WORD0__TEX_INST_shift, EG_TEX_WORD0__TEX_INST_mask); @@ -1965,7 +1965,7 @@ GLboolean assemble_tex_instruction(r700_AssemblerBase *pAsm, GLboolean normalize EG_TEX_WORD0__INST_MOD_mask); } - CLEARbit(tex_instruction_ptr->m_Word0.val, EG_TEX_WORD0__FWQ_bit); + CLEARbit(tex_instruction_ptr->m_Word0.val, EG_TEX_WORD0__FWQ_bit); if(SPT_VP == pAsm->currentShaderType) { @@ -1980,7 +1980,7 @@ GLboolean assemble_tex_instruction(r700_AssemblerBase *pAsm, GLboolean normalize EG_TEX_WORD0__RESOURCE_ID_shift, EG_TEX_WORD0__RESOURCE_ID_mask); } - + CLEARbit(tex_instruction_ptr->m_Word0.val, EG_TEX_WORD0__ALT_CONST_bit); SETfield(tex_instruction_ptr->m_Word0.val, 0, EG_TEX_WORD0__RIM_shift, @@ -2027,8 +2027,8 @@ GLboolean assemble_tex_instruction(r700_AssemblerBase *pAsm, GLboolean normalize tex_instruction_ptr->m_Word2.f.sampler_id = texture_unit_source->reg; // dst - if ( (pAsm->D.dst.rtype == DST_REG_TEMPORARY) || - (pAsm->D.dst.rtype == DST_REG_OUT) ) + if ( (pAsm->D.dst.rtype == DST_REG_TEMPORARY) || + (pAsm->D.dst.rtype == DST_REG_OUT) ) { if(8 == pAsm->unAsic) /* evergreen */ { @@ -2059,7 +2059,7 @@ GLboolean assemble_tex_instruction(r700_AssemblerBase *pAsm, GLboolean normalize tex_instruction_ptr->m_Word2.f.src_sel_z = texture_coordinate_source->swizzlez; tex_instruction_ptr->m_Word2.f.src_sel_w = texture_coordinate_source->swizzlew; } - else + else { radeon_error("Only temp destination registers supported for TEX dest regs.\n"); return GL_FALSE; @@ -2077,14 +2077,14 @@ void initialize(r700_AssemblerBase *pAsm) { GLuint cycle, component; - for (cycle=0; cyclehw_gpr[cycle][component] = (-1); } } - for (component=0; componenthw_cfile_addr[component] = (-1); pAsm->hw_cfile_chan[component] = (-1); @@ -2103,9 +2103,9 @@ GLboolean assemble_alu_src(R700ALUInstruction* alu_instruction_ptr, BITS src_neg; //-------------------------------------------------------------------------- - // Source for operands src0, src1. - // Values [0,127] correspond to GPR[0..127]. - // Values [256,511] correspond to cfile constants c[0..255]. + // Source for operands src0, src1. + // Values [0,127] correspond to GPR[0..127]. + // Values [256,511] correspond to cfile constants c[0..255]. //-------------------------------------------------------------------------- // Other special values are shown in the list below. @@ -2124,7 +2124,7 @@ GLboolean assemble_alu_src(R700ALUInstruction* alu_instruction_ptr, //-------------------------------------------------------------------------- BITS channel_swizzle; - switch (scalar_channel_index) + switch (scalar_channel_index) { case 0: channel_swizzle = pSource->swizzlex; break; case 1: channel_swizzle = pSource->swizzley; break; @@ -2133,38 +2133,38 @@ GLboolean assemble_alu_src(R700ALUInstruction* alu_instruction_ptr, default: channel_swizzle = SQ_SEL_MASK; break; } - if(channel_swizzle == SQ_SEL_0) + if(channel_swizzle == SQ_SEL_0) { - src_sel = SQ_ALU_SRC_0; + src_sel = SQ_ALU_SRC_0; } - else if (channel_swizzle == SQ_SEL_1) + else if (channel_swizzle == SQ_SEL_1) { - src_sel = SQ_ALU_SRC_1; + src_sel = SQ_ALU_SRC_1; } - else + else { - if ( (pSource->rtype == SRC_REG_TEMPORARY) || + if ( (pSource->rtype == SRC_REG_TEMPORARY) || (pSource->rtype == SRC_REG_GPR) - ) + ) { src_sel = pSource->reg; } else if (pSource->rtype == SRC_REG_CONSTANT) { /* TODO : 4 const buffers */ - if(GL_TRUE == pAsm->bUseMemConstant) + if(GL_TRUE == pAsm->bUseMemConstant) { src_sel = pSource->reg + SQ_ALU_SRC_KCACHE0_BASE; pAsm->kcacheUsed = SQ_ALU_SRC_KCACHE0_BASE; } else { - src_sel = pSource->reg + CFILE_REGISTER_OFFSET; + src_sel = pSource->reg + CFILE_REGISTER_OFFSET; } } else if (pSource->rtype == SRC_REC_LITERAL) { - src_sel = SQ_ALU_SRC_LITERAL; + src_sel = SQ_ALU_SRC_LITERAL; } else { @@ -2174,33 +2174,33 @@ GLboolean assemble_alu_src(R700ALUInstruction* alu_instruction_ptr, } } - if( ADDR_ABSOLUTE == addrmode_PVSSRC(pSource) ) + if( ADDR_ABSOLUTE == addrmode_PVSSRC(pSource) ) { src_rel = SQ_ABSOLUTE; } - else + else { src_rel = SQ_RELATIVE; } - switch (channel_swizzle) + switch (channel_swizzle) { - case SQ_SEL_X: - src_chan = SQ_CHAN_X; + case SQ_SEL_X: + src_chan = SQ_CHAN_X; break; - case SQ_SEL_Y: - src_chan = SQ_CHAN_Y; + case SQ_SEL_Y: + src_chan = SQ_CHAN_Y; break; - case SQ_SEL_Z: - src_chan = SQ_CHAN_Z; + case SQ_SEL_Z: + src_chan = SQ_CHAN_Z; break; - case SQ_SEL_W: - src_chan = SQ_CHAN_W; + case SQ_SEL_W: + src_chan = SQ_CHAN_W; break; case SQ_SEL_0: case SQ_SEL_1: // Does not matter since src_sel controls - src_chan = SQ_CHAN_X; + src_chan = SQ_CHAN_X; break; default: radeon_error("Unknown source select value (%d) in assemble_alu_src().\n", channel_swizzle); @@ -2208,7 +2208,7 @@ GLboolean assemble_alu_src(R700ALUInstruction* alu_instruction_ptr, break; } - switch (scalar_channel_index) + switch (scalar_channel_index) { case 0: src_neg = pSource->negx; break; case 1: src_neg = pSource->negy; break; @@ -2217,7 +2217,7 @@ GLboolean assemble_alu_src(R700ALUInstruction* alu_instruction_ptr, default: src_neg = 0; break; } - switch (source_index) + switch (source_index) { case 0: assert(alu_instruction_ptr); @@ -2260,22 +2260,22 @@ GLboolean add_alu_instruction(r700_AssemblerBase* pAsm, if ( pAsm->alu_x_opcode != 0 || pAsm->cf_current_alu_clause_ptr == NULL || - ( (pAsm->cf_current_alu_clause_ptr != NULL) && + ( (pAsm->cf_current_alu_clause_ptr != NULL) && (pAsm->cf_current_alu_clause_ptr->m_Word1.f.count >= (GetCFMaxInstructions(pAsm->cf_current_alu_clause_ptr->m_ShaderInstType)-contiguous_slots_needed-1) ) - ) ) + ) ) { //new cf inst for this clause pAsm->cf_current_alu_clause_ptr = (R700ControlFlowALUClause*) CALLOC_STRUCT(R700ControlFlowALUClause); - - // link the new cf to cf segment - if(NULL != pAsm->cf_current_alu_clause_ptr) + + // link the new cf to cf segment + if(NULL != pAsm->cf_current_alu_clause_ptr) { Init_R700ControlFlowALUClause(pAsm->cf_current_alu_clause_ptr); - AddCFInstruction( pAsm->pR700Shader, - (R700ControlFlowInstruction *)pAsm->cf_current_alu_clause_ptr ); + AddCFInstruction( pAsm->pR700Shader, + (R700ControlFlowInstruction *)pAsm->cf_current_alu_clause_ptr ); } - else + else { radeon_error("Could not allocate a new ALU CF instruction.\n"); return GL_FALSE; @@ -2305,7 +2305,7 @@ GLboolean add_alu_instruction(r700_AssemblerBase* pAsm, pAsm->cf_current_alu_clause_ptr->m_Word1.f.barrier = 0x1; } - else + else { pAsm->cf_current_alu_clause_ptr->m_Word1.f.count += (GetInstructionSize(alu_instruction_ptr->m_ShaderInstType) / 2); } @@ -2321,14 +2321,14 @@ GLboolean add_alu_instruction(r700_AssemblerBase* pAsm, pAsm->cf_current_alu_clause_ptr->m_Word1.f.kcache_addr1 = 0x0; } - // If this clause constains any instruction that is forward dependent on a TEX instruction, + // If this clause constains any instruction that is forward dependent on a TEX instruction, // set the whole_quad_mode for this clause - if ( pAsm->pInstDeps[pAsm->uiCurInst].nDstDep > (-1) ) + if ( pAsm->pInstDeps[pAsm->uiCurInst].nDstDep > (-1) ) { - pAsm->cf_current_alu_clause_ptr->m_Word1.f.whole_quad_mode = 0x1; + pAsm->cf_current_alu_clause_ptr->m_Word1.f.whole_quad_mode = 0x1; } - if (pAsm->cf_current_alu_clause_ptr->m_Word1.f.count >= (GetCFMaxInstructions(pAsm->cf_current_alu_clause_ptr->m_ShaderInstType)-1) ) + if (pAsm->cf_current_alu_clause_ptr->m_Word1.f.count >= (GetCFMaxInstructions(pAsm->cf_current_alu_clause_ptr->m_ShaderInstType)-1) ) { alu_instruction_ptr->m_Word0.f.last = 1; } @@ -2338,7 +2338,7 @@ GLboolean add_alu_instruction(r700_AssemblerBase* pAsm, pAsm->cf_current_alu_clause_ptr->m_pLinkedALUInstruction = alu_instruction_ptr; alu_instruction_ptr->m_pLinkedALUClause = pAsm->cf_current_alu_clause_ptr; } - + AddALUInstruction(pAsm->pR700Shader, alu_instruction_ptr); return GL_TRUE; @@ -2354,14 +2354,14 @@ GLboolean EG_add_ps_interp(r700_AssemblerBase* pAsm) unsigned int unWord1Temp = 0x146B10; //SQ_SEL_X if(pAsm->uIIns > 0) - { + { for(ui=(pAsm->uIIns-1); ui>=0; ui--) - { + { for(uj=0; uj<8; uj++) { alu_instruction_ptr = (R700ALUInstruction*) CALLOC_STRUCT(R700ALUInstruction); Init_R700ALUInstruction(alu_instruction_ptr); - alu_instruction_ptr->m_Word0.val = unWord0Temp; + alu_instruction_ptr->m_Word0.val = unWord0Temp; alu_instruction_ptr->m_Word1.val = unWord1Temp; if(uj < 4) @@ -2388,12 +2388,12 @@ GLboolean EG_add_ps_interp(r700_AssemblerBase* pAsm) { SETfield(alu_instruction_ptr->m_Word1.val, ui, EG_ALU_WORD1__DST_GPR_shift, EG_ALU_WORD1__DST_GPR_mask); - } + } else { SETfield(alu_instruction_ptr->m_Word1.val, 111, EG_ALU_WORD1__DST_GPR_shift, EG_ALU_WORD1__DST_GPR_mask); - } + } SETfield(alu_instruction_ptr->m_Word1.val, (uj % 4), EG_ALU_WORD1__DST_CHAN_shift, EG_ALU_WORD1__DST_CHAN_mask); @@ -2408,10 +2408,10 @@ GLboolean EG_add_ps_interp(r700_AssemblerBase* pAsm) } if(GL_FALSE == add_alu_instruction(pAsm, alu_instruction_ptr, 4) ) - { + { return GL_FALSE; } - } + } } } @@ -2425,7 +2425,7 @@ void get_src_properties(R700ALUInstruction* alu_instruction_ptr, BITS* psrc_chan, BITS* psrc_neg) { - switch (source_index) + switch (source_index) { case 0: *psrc_sel = alu_instruction_ptr->m_Word0.f.src0_sel ; @@ -2450,31 +2450,31 @@ void get_src_properties(R700ALUInstruction* alu_instruction_ptr, } } -int is_cfile(BITS sel) +int is_cfile(BITS sel) { - if (sel > 255 && sel < 512) + if (sel > 255 && sel < 512) { return 1; } return 0; } -int is_const(BITS sel) +int is_const(BITS sel) { - if (is_cfile(sel)) + if (is_cfile(sel)) { return 1; } - else if(sel >= SQ_ALU_SRC_0 && sel <= SQ_ALU_SRC_LITERAL) + else if(sel >= SQ_ALU_SRC_0 && sel <= SQ_ALU_SRC_LITERAL) { return 1; } return 0; } -int is_gpr(BITS sel) +int is_gpr(BITS sel) { - if (sel >= 0 && sel < 128) + if (sel >= 0 && sel < 128) { return 1; } @@ -2493,7 +2493,7 @@ const GLuint BANK_SWIZZLE_VEC[8] = {SQ_ALU_VEC_210, //000 SQ_ALU_VEC_012}; //111 const GLuint BANK_SWIZZLE_SCL[8] = {SQ_ALU_SCL_210, //000 - SQ_ALU_SCL_122, //001 + SQ_ALU_SCL_122, //001 SQ_ALU_SCL_122, //010 SQ_ALU_SCL_221, //011 @@ -2503,8 +2503,8 @@ const GLuint BANK_SWIZZLE_SCL[8] = {SQ_ALU_SCL_210, //000 SQ_ALU_SCL_122, //110 SQ_ALU_SCL_122}; //111 -GLboolean reserve_cfile(r700_AssemblerBase* pAsm, - GLuint sel, +GLboolean reserve_cfile(r700_AssemblerBase* pAsm, + GLuint sel, GLuint chan) { int res_match = (-1); @@ -2512,31 +2512,31 @@ GLboolean reserve_cfile(r700_AssemblerBase* pAsm, GLint res; - for (res=3; res>=0; res--) + for (res=3; res>=0; res--) { - if(pAsm->hw_cfile_addr[ res] < 0) + if(pAsm->hw_cfile_addr[ res] < 0) { res_empty = res; } else if( (pAsm->hw_cfile_addr[res] == (int)sel) && - (pAsm->hw_cfile_chan[ res ] == (int) chan) ) + (pAsm->hw_cfile_chan[ res ] == (int) chan) ) { res_match = res; } } - if(res_match >= 0) + if(res_match >= 0) { // Read for this scalar component already reserved, nothing to do here. ; } - else if(res_empty >= 0) + else if(res_empty >= 0) { pAsm->hw_cfile_addr[ res_empty ] = sel; pAsm->hw_cfile_chan[ res_empty ] = chan; } - else + else { radeon_error("All cfile read ports are used, cannot reference C$sel, channel $chan.\n"); return GL_FALSE; @@ -2546,11 +2546,11 @@ GLboolean reserve_cfile(r700_AssemblerBase* pAsm, GLboolean reserve_gpr(r700_AssemblerBase* pAsm, GLuint sel, GLuint chan, GLuint cycle) { - if(pAsm->hw_gpr[cycle][chan] < 0) + if(pAsm->hw_gpr[cycle][chan] < 0) { pAsm->hw_gpr[cycle][chan] = sel; } - else if(pAsm->hw_gpr[cycle][chan] != (int)sel) + else if(pAsm->hw_gpr[cycle][chan] != (int)sel) { radeon_error("Another scalar operation has already used GPR read port for given channel\n"); return GL_FALSE; @@ -2561,7 +2561,7 @@ GLboolean reserve_gpr(r700_AssemblerBase* pAsm, GLuint sel, GLuint chan, GLuint GLboolean cycle_for_scalar_bank_swizzle(const int swiz, const int sel, GLuint* pCycle) { - switch (swiz) + switch (swiz) { case SQ_ALU_SCL_210: { @@ -2578,7 +2578,7 @@ GLboolean cycle_for_scalar_bank_swizzle(const int swiz, const int sel, GLuint* p } break; case SQ_ALU_SCL_212: - { + { int table[3] = {2, 1, 2}; *pCycle = table[sel]; return GL_TRUE; @@ -2601,7 +2601,7 @@ GLboolean cycle_for_scalar_bank_swizzle(const int swiz, const int sel, GLuint* p GLboolean cycle_for_vector_bank_swizzle(const int swiz, const int sel, GLuint* pCycle) { - switch (swiz) + switch (swiz) { case SQ_ALU_VEC_012: { @@ -2614,7 +2614,7 @@ GLboolean cycle_for_vector_bank_swizzle(const int swiz, const int sel, GLuint* p int table[3] = {0, 2, 1}; *pCycle = table[sel]; } - break; + break; case SQ_ALU_VEC_120: { int table[3] = {1, 2, 0}; @@ -2679,36 +2679,36 @@ GLboolean check_scalar(r700_AssemblerBase* pAsm, number_of_operands = r700GetNumOperands(pAsm->D.dst.opcode, pAsm->D.dst.op3); } - for (src=0; srcm_Word1.f.bank_swizzle = BANK_SWIZZLE_SCL[ swizzle_key ]; - for (src=0; srcm_Word1.f.bank_swizzle; @@ -2732,7 +2732,7 @@ GLboolean check_scalar(r700_AssemblerBase* pAsm, return GL_FALSE; } - if(cycle < const_count) + if(cycle < const_count) { if( GL_FALSE == reserve_gpr(pAsm, sel, chan, cycle) ) { @@ -2776,25 +2776,25 @@ GLboolean check_vector(r700_AssemblerBase* pAsm, number_of_operands = r700GetNumOperands(pAsm->D.dst.opcode, pAsm->D.dst.op3); } - for (src=0; srcm_Word1.f.bank_swizzle = BANK_SWIZZLE_VEC[swizzle_key]; - for (src=0; srcm_Word1.f.bank_swizzle; - if( is_gpr(sel) ) + if( is_gpr(sel) ) { if( GL_FALSE == cycle_for_vector_bank_swizzle(bank_swizzle, src, &cycle) ) - { + { return GL_FALSE; } - if ( (src == 1) && + if ( (src == 1) && (sel == src_sel[0]) && - (chan == src_chan[0]) ) - { + (chan == src_chan[0]) ) + { } - else + else { if( GL_FALSE == reserve_gpr(pAsm, sel, chan, cycle) ) - { + { return GL_FALSE; } } } - else if( is_const(sel) ) - { + else if( is_const(sel) ) + { const_count++; - if( is_cfile(sel) ) - { + if( is_cfile(sel) ) + { if( GL_FALSE == reserve_cfile(pAsm, sel, chan) ) - { + { return GL_FALSE; } } @@ -2856,7 +2856,7 @@ GLboolean assemble_alu_instruction(r700_AssemblerBase *pAsm) GLuint contiguous_slots_needed; GLuint uNumSrc; GLboolean bSplitInst; - + if(8 == pAsm->unAsic) { uNumSrc = EG_GetNumOperands(pAsm->D.dst.opcode, pAsm->D.dst.op3); @@ -2872,30 +2872,30 @@ GLboolean assemble_alu_instruction(r700_AssemblerBase *pAsm) bSplitInst = GL_FALSE; pAsm->kcacheUsed = 0; - if (1 == pAsm->D.dst.math) + if (1 == pAsm->D.dst.math) { is_single_scalar_operation = GL_TRUE; number_of_scalar_operations = 1; } - else + else { is_single_scalar_operation = GL_FALSE; number_of_scalar_operations = 4; /* current assembler doesn't do more than 1 register per source */ #if 0 - /* check read port, only very preliminary algorithm, not count in + /* check read port, only very preliminary algorithm, not count in src0/1 same comp case and prev slot repeat case; also not count relative addressing. TODO: improve performance. */ for(j=0; jS[j].src); } - for(scalar_channel_index=0; scalar_channel_index<4; scalar_channel_index++) + for(scalar_channel_index=0; scalar_channel_index<4; scalar_channel_index++) { - for(j=0; jswizzlex; break; case 1: channel_swizzle = pSource[j]->swizzley; break; @@ -2903,11 +2903,11 @@ GLboolean assemble_alu_instruction(r700_AssemblerBase *pAsm) case 3: channel_swizzle = pSource[j]->swizzlew; break; default: channel_swizzle = SQ_SEL_MASK; break; } - if ( ((pSource[j]->rtype == SRC_REG_TEMPORARY) || + if ( ((pSource[j]->rtype == SRC_REG_TEMPORARY) || (pSource[j]->rtype == SRC_REG_GPR)) && (channel_swizzle <= SQ_SEL_W) ) - { - chan_counter[channel_swizzle]++; + { + chan_counter[channel_swizzle]++; } } } @@ -2923,18 +2923,18 @@ GLboolean assemble_alu_instruction(r700_AssemblerBase *pAsm) contiguous_slots_needed = 0; - if(!is_single_scalar_operation) + if(!is_single_scalar_operation) { contiguous_slots_needed = 4; } contiguous_slots_needed += pAsm->D2.dst2.literal_slots; - initialize(pAsm); + initialize(pAsm); for (scalar_channel_index=0; - scalar_channel_index < number_of_scalar_operations; - scalar_channel_index++) + scalar_channel_index < number_of_scalar_operations; + scalar_channel_index++) { if(scalar_channel_index == (number_of_scalar_operations-1)) { @@ -2961,32 +2961,32 @@ GLboolean assemble_alu_instruction(r700_AssemblerBase *pAsm) alu_instruction_ptr = (R700ALUInstruction*) CALLOC_STRUCT(R700ALUInstruction); Init_R700ALUInstruction(alu_instruction_ptr); } - + //src 0 current_source_index = 0; pcurrent_source = &(pAsm->S[0].src); if (GL_FALSE == assemble_alu_src(alu_instruction_ptr, current_source_index, - pcurrent_source, + pcurrent_source, scalar_channel_index, - pAsm) ) - { + pAsm) ) + { return GL_FALSE; } - - if (uNumSrc > 1) - { - // Process source 1 + + if (uNumSrc > 1) + { + // Process source 1 current_source_index = 1; pcurrent_source = &(pAsm->S[current_source_index].src); if (GL_FALSE == assemble_alu_src(alu_instruction_ptr, current_source_index, - pcurrent_source, + pcurrent_source, scalar_channel_index, - pAsm) ) - { + pAsm) ) + { return GL_FALSE; } } @@ -2994,12 +2994,12 @@ GLboolean assemble_alu_instruction(r700_AssemblerBase *pAsm) //other bits alu_instruction_ptr->m_Word0.f.index_mode = pAsm->D2.dst2.index_mode; - if( (is_single_scalar_operation == GL_TRUE) + if( (is_single_scalar_operation == GL_TRUE) || (GL_TRUE == bSplitInst) ) { alu_instruction_ptr->m_Word0.f.last = 1; } - else + else { alu_instruction_ptr->m_Word0.f.last = (scalar_channel_index == 3) ? 1 : 0; } @@ -3017,13 +3017,13 @@ GLboolean assemble_alu_instruction(r700_AssemblerBase *pAsm) } // dst - if( (pAsm->D.dst.rtype == DST_REG_TEMPORARY) || - (pAsm->D.dst.rtype == DST_REG_OUT) ) + if( (pAsm->D.dst.rtype == DST_REG_TEMPORARY) || + (pAsm->D.dst.rtype == DST_REG_OUT) ) { alu_instruction_ptr->m_Word1.f.dst_gpr = pAsm->D.dst.reg; } - else - { + else + { radeon_error("Only temp destination registers supported for ALU dest regs.\n"); return GL_FALSE; } @@ -3037,22 +3037,22 @@ GLboolean assemble_alu_instruction(r700_AssemblerBase *pAsm) alu_instruction_ptr->m_Word1.f.dst_rel = SQ_ABSOLUTE; } - if ( is_single_scalar_operation == GL_TRUE ) + if ( is_single_scalar_operation == GL_TRUE ) { // Override scalar_channel_index since only one scalar value will be written - if(pAsm->D.dst.writex) + if(pAsm->D.dst.writex) { scalar_channel_index = 0; } - else if(pAsm->D.dst.writey) + else if(pAsm->D.dst.writey) { scalar_channel_index = 1; } - else if(pAsm->D.dst.writez) + else if(pAsm->D.dst.writez) { scalar_channel_index = 2; } - else if(pAsm->D.dst.writew) + else if(pAsm->D.dst.writew) { scalar_channel_index = 3; } @@ -3062,8 +3062,8 @@ GLboolean assemble_alu_instruction(r700_AssemblerBase *pAsm) alu_instruction_ptr->m_Word1.f.clamp = pAsm->D2.dst2.SaturateMode; - if (pAsm->D.dst.op3) - { + if (pAsm->D.dst.op3) + { //op3 alu_instruction_ptr->m_Word1_OP3.f.alu_inst = pAsm->D.dst.opcode; @@ -3074,14 +3074,14 @@ GLboolean assemble_alu_instruction(r700_AssemblerBase *pAsm) if ( GL_FALSE == assemble_alu_src(alu_instruction_ptr, current_source_index, - pcurrent_source, + pcurrent_source, scalar_channel_index, - pAsm) ) + pAsm) ) { return GL_FALSE; } } - else + else { //op2 if (pAsm->bR6xx) @@ -3093,24 +3093,24 @@ GLboolean assemble_alu_instruction(r700_AssemblerBase *pAsm) //alu_instruction_ptr->m_Word1_OP2.f6.update_execute_mask = 0x0; //alu_instruction_ptr->m_Word1_OP2.f6.update_pred = 0x0; - switch (scalar_channel_index) + switch (scalar_channel_index) { - case 0: - alu_instruction_ptr->m_Word1_OP2.f6.write_mask = pAsm->D.dst.writex; + case 0: + alu_instruction_ptr->m_Word1_OP2.f6.write_mask = pAsm->D.dst.writex; break; - case 1: - alu_instruction_ptr->m_Word1_OP2.f6.write_mask = pAsm->D.dst.writey; + case 1: + alu_instruction_ptr->m_Word1_OP2.f6.write_mask = pAsm->D.dst.writey; break; - case 2: - alu_instruction_ptr->m_Word1_OP2.f6.write_mask = pAsm->D.dst.writez; + case 2: + alu_instruction_ptr->m_Word1_OP2.f6.write_mask = pAsm->D.dst.writez; break; - case 3: - alu_instruction_ptr->m_Word1_OP2.f6.write_mask = pAsm->D.dst.writew; + case 3: + alu_instruction_ptr->m_Word1_OP2.f6.write_mask = pAsm->D.dst.writew; break; - default: + default: alu_instruction_ptr->m_Word1_OP2.f6.write_mask = 1; //SQ_SEL_MASK; break; - } + } alu_instruction_ptr->m_Word1_OP2.f6.omod = SQ_ALU_OMOD_OFF; } else @@ -3122,49 +3122,49 @@ GLboolean assemble_alu_instruction(r700_AssemblerBase *pAsm) //alu_instruction_ptr->m_Word1_OP2.f.update_execute_mask = 0x0; //alu_instruction_ptr->m_Word1_OP2.f.update_pred = 0x0; - switch (scalar_channel_index) + switch (scalar_channel_index) { - case 0: - alu_instruction_ptr->m_Word1_OP2.f.write_mask = pAsm->D.dst.writex; + case 0: + alu_instruction_ptr->m_Word1_OP2.f.write_mask = pAsm->D.dst.writex; break; - case 1: - alu_instruction_ptr->m_Word1_OP2.f.write_mask = pAsm->D.dst.writey; + case 1: + alu_instruction_ptr->m_Word1_OP2.f.write_mask = pAsm->D.dst.writey; break; - case 2: - alu_instruction_ptr->m_Word1_OP2.f.write_mask = pAsm->D.dst.writez; + case 2: + alu_instruction_ptr->m_Word1_OP2.f.write_mask = pAsm->D.dst.writez; break; - case 3: - alu_instruction_ptr->m_Word1_OP2.f.write_mask = pAsm->D.dst.writew; + case 3: + alu_instruction_ptr->m_Word1_OP2.f.write_mask = pAsm->D.dst.writew; break; - default: + default: alu_instruction_ptr->m_Word1_OP2.f.write_mask = 1; //SQ_SEL_MASK; break; - } + } alu_instruction_ptr->m_Word1_OP2.f.omod = SQ_ALU_OMOD_OFF; } } if(GL_FALSE == add_alu_instruction(pAsm, alu_instruction_ptr, contiguous_slots_needed) ) - { + { return GL_FALSE; } /* - * Judge the type of current instruction, is it vector or scalar + * Judge the type of current instruction, is it vector or scalar * instruction. - */ - if (is_single_scalar_operation) + */ + if (is_single_scalar_operation) { if(GL_FALSE == check_scalar(pAsm, alu_instruction_ptr) ) - { + { return GL_FALSE; } } - else + else { if(GL_FALSE == check_vector(pAsm, alu_instruction_ptr) ) - { - return GL_FALSE; + { + return GL_FALSE; } } @@ -3201,7 +3201,7 @@ GLboolean assemble_math_function(r700_AssemblerBase* pAsm, BITS opcode) if( pAsm->pILInst[pAsm->uiCurInst].Opcode == OPCODE_RSQ ) pAsm->S[0].src.abs = 1; - if ( GL_FALSE == next_ins(pAsm) ) + if ( GL_FALSE == next_ins(pAsm) ) { return GL_FALSE; } @@ -3233,7 +3233,7 @@ GLboolean assemble_ABS(r700_AssemblerBase *pAsm) { checkop1(pAsm); - pAsm->D.dst.opcode = SQ_OP2_INST_MAX; + pAsm->D.dst.opcode = SQ_OP2_INST_MAX; if( GL_FALSE == assemble_dst(pAsm) ) { @@ -3243,11 +3243,11 @@ GLboolean assemble_ABS(r700_AssemblerBase *pAsm) { return GL_FALSE; } - + pAsm->S[1].bits = pAsm->S[0].bits; flipneg_PVSSRC(&(pAsm->S[1].src)); - if ( GL_FALSE == next_ins(pAsm) ) + if ( GL_FALSE == next_ins(pAsm) ) { return GL_FALSE; } @@ -3263,12 +3263,12 @@ GLboolean assemble_ADD(r700_AssemblerBase *pAsm) } pAsm->D.dst.opcode = SQ_OP2_INST_ADD; - + if( GL_FALSE == assemble_dst(pAsm) ) { return GL_FALSE; } - + if( GL_FALSE == assemble_src(pAsm, 0, -1) ) { return GL_FALSE; @@ -3284,7 +3284,7 @@ GLboolean assemble_ADD(r700_AssemblerBase *pAsm) flipneg_PVSSRC(&(pAsm->S[1].src)); } - if( GL_FALSE == next_ins(pAsm) ) + if( GL_FALSE == next_ins(pAsm) ) { return GL_FALSE; } @@ -3374,7 +3374,7 @@ GLboolean assemble_ARL(r700_AssemblerBase *pAsm) return GL_TRUE; } -GLboolean assemble_BAD(char *opcode_str) +GLboolean assemble_BAD(char *opcode_str) { radeon_error("Not yet implemented instruction (%s)\n", opcode_str); return GL_FALSE; @@ -3397,7 +3397,7 @@ GLboolean assemble_CMP(r700_AssemblerBase *pAsm) { pAsm->D.dst.opcode = SQ_OP3_INST_CNDGE; } - pAsm->D.dst.op3 = 1; + pAsm->D.dst.op3 = 1; tmp = (-1); @@ -3412,7 +3412,7 @@ GLboolean assemble_CMP(r700_AssemblerBase *pAsm) nomask_PVSDST(&(pAsm->D.dst)); } - else + else { if( GL_FALSE == assemble_dst(pAsm) ) { @@ -3424,13 +3424,13 @@ GLboolean assemble_CMP(r700_AssemblerBase *pAsm) { return GL_FALSE; } - - if( GL_FALSE == assemble_src(pAsm, 2, 1) ) + + if( GL_FALSE == assemble_src(pAsm, 2, 1) ) { return GL_FALSE; } - if( GL_FALSE == assemble_src(pAsm, 1, 2) ) + if( GL_FALSE == assemble_src(pAsm, 1, 2) ) { return GL_FALSE; } @@ -3440,7 +3440,7 @@ GLboolean assemble_CMP(r700_AssemblerBase *pAsm) return GL_FALSE; } - if (0xF != pAsm->pILInst[pAsm->uiCurInst].DstReg.WriteMask) + if (0xF != pAsm->pILInst[pAsm->uiCurInst].DstReg.WriteMask) { if( GL_FALSE == assemble_dst(pAsm) ) { @@ -3468,12 +3468,12 @@ GLboolean assemble_CMP(r700_AssemblerBase *pAsm) GLboolean assemble_TRIG(r700_AssemblerBase *pAsm, BITS opcode) { - /* + /* * r600 - trunc to -PI..PI range * r700 - normalize by dividing by 2PI * see fdo bug 27901 */ - + int tmp; checkop1(pAsm); @@ -3496,14 +3496,14 @@ GLboolean assemble_TRIG(r700_AssemblerBase *pAsm, BITS opcode) pAsm->S[1].src.rtype = SRC_REC_LITERAL; setswizzle_PVSSRC(&(pAsm->S[1].src), SQ_SEL_X); - + pAsm->S[2].src.rtype = SRC_REC_LITERAL; setswizzle_PVSSRC(&(pAsm->S[2].src), SQ_SEL_Y); pAsm->D2.dst2.literal_slots = 1; pAsm->C[0].f = 1/(3.1415926535 * 2); pAsm->C[1].f = 0.5f; - + if ( GL_FALSE == next_ins(pAsm) ) { return GL_FALSE; @@ -3557,7 +3557,7 @@ GLboolean assemble_TRIG(r700_AssemblerBase *pAsm, BITS opcode) pAsm->C[0].f = 3.1415926535897f * 2.0f; pAsm->C[1].f = -3.1415926535897f; } - else + else { pAsm->C[0].f = 1.0f; pAsm->C[1].f = -0.5f; @@ -3585,21 +3585,21 @@ GLboolean assemble_TRIG(r700_AssemblerBase *pAsm, BITS opcode) return GL_TRUE; } - + GLboolean assemble_DOT(r700_AssemblerBase *pAsm) { if( GL_FALSE == checkop2(pAsm) ) { return GL_FALSE; } - + if(8 == pAsm->unAsic) { pAsm->D.dst.opcode = EG_OP2_INST_DOT4; } else { - pAsm->D.dst.opcode = SQ_OP2_INST_DOT4; + pAsm->D.dst.opcode = SQ_OP2_INST_DOT4; } if( GL_FALSE == assemble_dst(pAsm) ) @@ -3629,19 +3629,19 @@ GLboolean assemble_DOT(r700_AssemblerBase *pAsm) zerocomp_PVSSRC(&(pAsm->S[0].src), 3); zerocomp_PVSSRC(&(pAsm->S[1].src), 3); } - else if(pAsm->pILInst[pAsm->uiCurInst].Opcode == OPCODE_DPH) + else if(pAsm->pILInst[pAsm->uiCurInst].Opcode == OPCODE_DPH) { onecomp_PVSSRC(&(pAsm->S[0].src), 3); - } + } - if ( GL_FALSE == next_ins(pAsm) ) + if ( GL_FALSE == next_ins(pAsm) ) { return GL_FALSE; } return GL_TRUE; } - + GLboolean assemble_DST(r700_AssemblerBase *pAsm) { if( GL_FALSE == checkop2(pAsm) ) @@ -3672,7 +3672,7 @@ GLboolean assemble_DST(r700_AssemblerBase *pAsm) onecomp_PVSSRC(&(pAsm->S[1].src), 0); onecomp_PVSSRC(&(pAsm->S[1].src), 2); - if ( GL_FALSE == next_ins(pAsm) ) + if ( GL_FALSE == next_ins(pAsm) ) { return GL_FALSE; } @@ -3830,12 +3830,12 @@ GLboolean assemble_EXP(r700_AssemblerBase *pAsm) return GL_TRUE; } - + GLboolean assemble_FLR(r700_AssemblerBase *pAsm) { checkop1(pAsm); - pAsm->D.dst.opcode = SQ_OP2_INST_FLOOR; + pAsm->D.dst.opcode = SQ_OP2_INST_FLOOR; if ( GL_FALSE == assemble_dst(pAsm) ) { @@ -3847,7 +3847,7 @@ GLboolean assemble_FLR(r700_AssemblerBase *pAsm) return GL_FALSE; } - if ( GL_FALSE == next_ins(pAsm) ) + if ( GL_FALSE == next_ins(pAsm) ) { return GL_FALSE; } @@ -3869,7 +3869,7 @@ GLboolean assemble_FRC(r700_AssemblerBase *pAsm) { checkop1(pAsm); - pAsm->D.dst.opcode = SQ_OP2_INST_FRACT; + pAsm->D.dst.opcode = SQ_OP2_INST_FRACT; if ( GL_FALSE == assemble_dst(pAsm) ) { @@ -3888,15 +3888,15 @@ GLboolean assemble_FRC(r700_AssemblerBase *pAsm) return GL_TRUE; } - + GLboolean assemble_KIL(r700_AssemblerBase *pAsm, GLuint opcode) -{ +{ struct prog_instruction *pILInst = &(pAsm->pILInst[pAsm->uiCurInst]); if(pILInst->Opcode == OPCODE_KIL) checkop1(pAsm); - pAsm->D.dst.opcode = opcode; + pAsm->D.dst.opcode = opcode; //pAsm->D.dst.math = 1; setaddrmode_PVSDST(&(pAsm->D.dst), ADDR_ABSOLUTE); @@ -3938,12 +3938,12 @@ GLboolean assemble_KIL(r700_AssemblerBase *pAsm, GLuint opcode) /* Doc says KILL has to be last(end) ALU clause */ pAsm->pR700Shader->killIsUsed = GL_TRUE; pAsm->alu_x_opcode = SQ_CF_INST_ALU; - + return GL_TRUE; } -GLboolean assemble_LG2(r700_AssemblerBase *pAsm) -{ +GLboolean assemble_LG2(r700_AssemblerBase *pAsm) +{ if(8 == pAsm->unAsic) { return assemble_math_function(pAsm, EG_OP2_INST_LOG_IEEE); @@ -3952,7 +3952,7 @@ GLboolean assemble_LG2(r700_AssemblerBase *pAsm) return assemble_math_function(pAsm, SQ_OP2_INST_LOG_IEEE); } -GLboolean assemble_LRP(r700_AssemblerBase *pAsm) +GLboolean assemble_LRP(r700_AssemblerBase *pAsm) { BITS tmp; @@ -3970,20 +3970,20 @@ GLboolean assemble_LRP(r700_AssemblerBase *pAsm) setaddrmode_PVSDST(&(pAsm->D.dst), ADDR_ABSOLUTE); nomask_PVSDST(&(pAsm->D.dst)); - - if( GL_FALSE == assemble_src(pAsm, 1, 0) ) + + if( GL_FALSE == assemble_src(pAsm, 1, 0) ) { return GL_FALSE; } - if ( GL_FALSE == assemble_src(pAsm, 2, 1) ) + if ( GL_FALSE == assemble_src(pAsm, 2, 1) ) { return GL_FALSE; } neg_PVSSRC(&(pAsm->S[1].src)); - if( GL_FALSE == next_ins(pAsm) ) + if( GL_FALSE == next_ins(pAsm) ) { return GL_FALSE; } @@ -4009,17 +4009,17 @@ GLboolean assemble_LRP(r700_AssemblerBase *pAsm) noswizzle_PVSSRC(&(pAsm->S[0].src)); - if( GL_FALSE == assemble_src(pAsm, 0, 1) ) + if( GL_FALSE == assemble_src(pAsm, 0, 1) ) { return GL_FALSE; } - if( GL_FALSE == assemble_src(pAsm, 2, -1) ) + if( GL_FALSE == assemble_src(pAsm, 2, -1) ) { return GL_FALSE; } - if( GL_FALSE == next_ins(pAsm) ) + if( GL_FALSE == next_ins(pAsm) ) { return GL_FALSE; } @@ -4036,7 +4036,7 @@ GLboolean assemble_LRP(r700_AssemblerBase *pAsm) pAsm->S[0].src.reg = tmp; noswizzle_PVSSRC(&(pAsm->S[0].src)); - if( GL_FALSE == next_ins(pAsm) ) + if( GL_FALSE == next_ins(pAsm) ) { return GL_FALSE; } @@ -4060,7 +4060,7 @@ GLboolean assemble_LOG(r700_AssemblerBase *pAsm) // MAX tmp1.x, a.x, -a.x (fabs(a.x)) - pAsm->D.dst.opcode = SQ_OP2_INST_MAX; + pAsm->D.dst.opcode = SQ_OP2_INST_MAX; setaddrmode_PVSDST(&(pAsm->D.dst), ADDR_ABSOLUTE); pAsm->D.dst.rtype = DST_REG_TEMPORARY; @@ -4071,11 +4071,11 @@ GLboolean assemble_LOG(r700_AssemblerBase *pAsm) { return GL_FALSE; } - + pAsm->S[1].bits = pAsm->S[0].bits; flipneg_PVSSRC(&(pAsm->S[1].src)); - if ( GL_FALSE == next_ins(pAsm) ) + if ( GL_FALSE == next_ins(pAsm) ) { return GL_FALSE; } @@ -4269,7 +4269,7 @@ GLboolean assemble_LOG(r700_AssemblerBase *pAsm) return GL_TRUE; } -GLboolean assemble_MAD(struct r700_AssemblerBase *pAsm) +GLboolean assemble_MAD(struct r700_AssemblerBase *pAsm) { int tmp, ii; GLboolean bReplaceDst = GL_FALSE; @@ -4286,9 +4286,9 @@ GLboolean assemble_MAD(struct r700_AssemblerBase *pAsm) } else { - pAsm->D.dst.opcode = SQ_OP3_INST_MULADD; + pAsm->D.dst.opcode = SQ_OP3_INST_MULADD; } - pAsm->D.dst.op3 = 1; + pAsm->D.dst.op3 = 1; tmp = (-1); @@ -4319,7 +4319,7 @@ GLboolean assemble_MAD(struct r700_AssemblerBase *pAsm) nomask_PVSDST(&(pAsm->D.dst)); } - else + else { if( GL_FALSE == assemble_dst(pAsm) ) { @@ -4331,13 +4331,13 @@ GLboolean assemble_MAD(struct r700_AssemblerBase *pAsm) { return GL_FALSE; } - - if( GL_FALSE == assemble_src(pAsm, 1, -1) ) + + if( GL_FALSE == assemble_src(pAsm, 1, -1) ) { return GL_FALSE; } - if( GL_FALSE == assemble_src(pAsm, 2, -1) ) + if( GL_FALSE == assemble_src(pAsm, 2, -1) ) { return GL_FALSE; } @@ -4347,7 +4347,7 @@ GLboolean assemble_MAD(struct r700_AssemblerBase *pAsm) return GL_FALSE; } - if (GL_TRUE == bReplaceDst) + if (GL_TRUE == bReplaceDst) { if( GL_FALSE == assemble_dst(pAsm) ) { @@ -4418,7 +4418,7 @@ GLboolean assemble_LIT(r700_AssemblerBase *pAsm) return GL_FALSE; } - if( pAsm->D.dst.writey ) { + if( pAsm->D.dst.writey ) { if( GL_FALSE == assemble_src(pAsm, 0, -1) ) { @@ -4559,16 +4559,16 @@ GLboolean assemble_LIT(r700_AssemblerBase *pAsm) } return GL_TRUE; } - -GLboolean assemble_MAX(r700_AssemblerBase *pAsm) + +GLboolean assemble_MAX(r700_AssemblerBase *pAsm) { if( GL_FALSE == checkop2(pAsm) ) { return GL_FALSE; } - pAsm->D.dst.opcode = SQ_OP2_INST_MAX; - + pAsm->D.dst.opcode = SQ_OP2_INST_MAX; + if( GL_FALSE == assemble_dst(pAsm) ) { return GL_FALSE; @@ -4591,15 +4591,15 @@ GLboolean assemble_MAX(r700_AssemblerBase *pAsm) return GL_TRUE; } - -GLboolean assemble_MIN(r700_AssemblerBase *pAsm) + +GLboolean assemble_MIN(r700_AssemblerBase *pAsm) { if( GL_FALSE == checkop2(pAsm) ) { return GL_FALSE; } - pAsm->D.dst.opcode = SQ_OP2_INST_MIN; + pAsm->D.dst.opcode = SQ_OP2_INST_MIN; if( GL_FALSE == assemble_dst(pAsm) ) { @@ -4615,7 +4615,7 @@ GLboolean assemble_MIN(r700_AssemblerBase *pAsm) { return GL_FALSE; } - + if( GL_FALSE == next_ins(pAsm) ) { return GL_FALSE; @@ -4623,8 +4623,8 @@ GLboolean assemble_MIN(r700_AssemblerBase *pAsm) return GL_TRUE; } - -GLboolean assemble_MOV(r700_AssemblerBase *pAsm) + +GLboolean assemble_MOV(r700_AssemblerBase *pAsm) { checkop1(pAsm); @@ -4640,15 +4640,15 @@ GLboolean assemble_MOV(r700_AssemblerBase *pAsm) return GL_FALSE; } - if ( GL_FALSE == next_ins(pAsm) ) + if ( GL_FALSE == next_ins(pAsm) ) { return GL_FALSE; } return GL_TRUE; } - -GLboolean assemble_MUL(r700_AssemblerBase *pAsm) + +GLboolean assemble_MUL(r700_AssemblerBase *pAsm) { if( GL_FALSE == checkop2(pAsm) ) { @@ -4672,15 +4672,15 @@ GLboolean assemble_MUL(r700_AssemblerBase *pAsm) return GL_FALSE; } - if( GL_FALSE == next_ins(pAsm) ) + if( GL_FALSE == next_ins(pAsm) ) { return GL_FALSE; } return GL_TRUE; } - -GLboolean assemble_POW(r700_AssemblerBase *pAsm) + +GLboolean assemble_POW(r700_AssemblerBase *pAsm) { BITS tmp; @@ -4695,7 +4695,7 @@ GLboolean assemble_POW(r700_AssemblerBase *pAsm) } else { - pAsm->D.dst.opcode = SQ_OP2_INST_LOG_IEEE; + pAsm->D.dst.opcode = SQ_OP2_INST_LOG_IEEE; } pAsm->D.dst.math = 1; @@ -4709,7 +4709,7 @@ GLboolean assemble_POW(r700_AssemblerBase *pAsm) return GL_FALSE; } - if( GL_FALSE == next_ins(pAsm) ) + if( GL_FALSE == next_ins(pAsm) ) { return GL_FALSE; } @@ -4733,7 +4733,7 @@ GLboolean assemble_POW(r700_AssemblerBase *pAsm) return GL_FALSE; } - if( GL_FALSE == next_ins(pAsm) ) + if( GL_FALSE == next_ins(pAsm) ) { return GL_FALSE; } @@ -4761,7 +4761,7 @@ GLboolean assemble_POW(r700_AssemblerBase *pAsm) setswizzle_PVSSRC(&(pAsm->S[0].src), SQ_SEL_X); noneg_PVSSRC(&(pAsm->S[0].src)); - if( GL_FALSE == next_ins(pAsm) ) + if( GL_FALSE == next_ins(pAsm) ) { return GL_FALSE; } @@ -4788,8 +4788,8 @@ GLboolean assemble_POW(r700_AssemblerBase *pAsm) return GL_TRUE; } - -GLboolean assemble_RCP(r700_AssemblerBase *pAsm) + +GLboolean assemble_RCP(r700_AssemblerBase *pAsm) { if(8 == pAsm->unAsic) { @@ -4798,8 +4798,8 @@ GLboolean assemble_RCP(r700_AssemblerBase *pAsm) return assemble_math_function(pAsm, SQ_OP2_INST_RECIP_IEEE); } - -GLboolean assemble_RSQ(r700_AssemblerBase *pAsm) + +GLboolean assemble_RSQ(r700_AssemblerBase *pAsm) { if(8 == pAsm->unAsic) { @@ -4808,8 +4808,8 @@ GLboolean assemble_RSQ(r700_AssemblerBase *pAsm) return assemble_math_function(pAsm, SQ_OP2_INST_RECIPSQRT_IEEE); } - -GLboolean assemble_SCS(r700_AssemblerBase *pAsm) + +GLboolean assemble_SCS(r700_AssemblerBase *pAsm) { BITS tmp; @@ -4959,7 +4959,7 @@ GLboolean assemble_SCS(r700_AssemblerBase *pAsm) return GL_TRUE; } -GLboolean assemble_LOGIC(r700_AssemblerBase *pAsm, BITS opcode) +GLboolean assemble_LOGIC(r700_AssemblerBase *pAsm, BITS opcode) { if( GL_FALSE == checkop2(pAsm) ) { @@ -4984,7 +4984,7 @@ GLboolean assemble_LOGIC(r700_AssemblerBase *pAsm, BITS opcode) return GL_FALSE; } - if( GL_FALSE == next_ins(pAsm) ) + if( GL_FALSE == next_ins(pAsm) ) { return GL_FALSE; } @@ -4992,7 +4992,7 @@ GLboolean assemble_LOGIC(r700_AssemblerBase *pAsm, BITS opcode) return GL_TRUE; } -GLboolean assemble_LOGIC_PRED(r700_AssemblerBase *pAsm, BITS opcode) +GLboolean assemble_LOGIC_PRED(r700_AssemblerBase *pAsm, BITS opcode) { struct prog_instruction *pILInst = &(pAsm->pILInst[pAsm->uiCurInst]); @@ -5021,22 +5021,22 @@ GLboolean assemble_LOGIC_PRED(r700_AssemblerBase *pAsm, BITS opcode) pAsm->S[1].src.swizzlez = SQ_SEL_0; pAsm->S[1].src.swizzlew = SQ_SEL_0; - if( GL_FALSE == next_ins(pAsm) ) + if( GL_FALSE == next_ins(pAsm) ) { return GL_FALSE; } return GL_TRUE; } - -GLboolean assemble_SGE(r700_AssemblerBase *pAsm) + +GLboolean assemble_SGE(r700_AssemblerBase *pAsm) { if( GL_FALSE == checkop2(pAsm) ) { return GL_FALSE; } - pAsm->D.dst.opcode = SQ_OP2_INST_SETGE; + pAsm->D.dst.opcode = SQ_OP2_INST_SETGE; if( GL_FALSE == assemble_dst(pAsm) ) { @@ -5053,34 +5053,34 @@ GLboolean assemble_SGE(r700_AssemblerBase *pAsm) return GL_FALSE; } - if( GL_FALSE == next_ins(pAsm) ) + if( GL_FALSE == next_ins(pAsm) ) { return GL_FALSE; } return GL_TRUE; } - -GLboolean assemble_SLT(r700_AssemblerBase *pAsm) + +GLboolean assemble_SLT(r700_AssemblerBase *pAsm) { if( GL_FALSE == checkop2(pAsm) ) { return GL_FALSE; } - pAsm->D.dst.opcode = SQ_OP2_INST_SETGT; + pAsm->D.dst.opcode = SQ_OP2_INST_SETGT; if( GL_FALSE == assemble_dst(pAsm) ) { return GL_FALSE; } - - if( GL_FALSE == assemble_src(pAsm, 0, 1) ) + + if( GL_FALSE == assemble_src(pAsm, 0, 1) ) { return GL_FALSE; } - if( GL_FALSE == assemble_src(pAsm, 1, 0) ) + if( GL_FALSE == assemble_src(pAsm, 1, 0) ) { return GL_FALSE; } @@ -5092,11 +5092,11 @@ GLboolean assemble_SLT(r700_AssemblerBase *pAsm) return GL_TRUE; } - + GLboolean assemble_SSG(r700_AssemblerBase *pAsm) { checkop1(pAsm); - + GLuint tmp = gethelpr(pAsm); /* tmp = (src > 0 ? 1 : src) */ if(8 == pAsm->unAsic) @@ -5166,21 +5166,21 @@ GLboolean assemble_SSG(r700_AssemblerBase *pAsm) return GL_TRUE; } -GLboolean assemble_STP(r700_AssemblerBase *pAsm) +GLboolean assemble_STP(r700_AssemblerBase *pAsm) { return GL_TRUE; } - -GLboolean assemble_TEX(r700_AssemblerBase *pAsm) + +GLboolean assemble_TEX(r700_AssemblerBase *pAsm) { GLboolean src_const; - GLboolean need_barrier = GL_FALSE; + GLboolean need_barrier = GL_FALSE; checkop1(pAsm); - + switch (pAsm->pILInst[pAsm->uiCurInst].SrcReg[0].File) { - case PROGRAM_UNIFORM: + case PROGRAM_UNIFORM: case PROGRAM_CONSTANT: case PROGRAM_LOCAL_PARAM: case PROGRAM_ENV_PARAM: @@ -5250,7 +5250,7 @@ GLboolean assemble_TEX(r700_AssemblerBase *pAsm) { return GL_FALSE; } - + pAsm->aArgSubst[1] = tmp; need_barrier = GL_TRUE; } @@ -5259,7 +5259,7 @@ GLboolean assemble_TEX(r700_AssemblerBase *pAsm) { GLuint tmp1 = gethelpr(pAsm); GLuint tmp2 = gethelpr(pAsm); - + /* tmp1.xyzw = CUBE(R0.zzxy, R0.yxzz) */ if(8 == pAsm->unAsic) { @@ -5273,7 +5273,7 @@ GLboolean assemble_TEX(r700_AssemblerBase *pAsm) pAsm->D.dst.rtype = DST_REG_TEMPORARY; pAsm->D.dst.reg = tmp1; nomask_PVSDST(&(pAsm->D.dst)); - + if( GL_FALSE == assemble_src(pAsm, 0, -1) ) { return GL_FALSE; @@ -5285,13 +5285,13 @@ GLboolean assemble_TEX(r700_AssemblerBase *pAsm) } swizzleagain_PVSSRC(&(pAsm->S[0].src), SQ_SEL_Z, SQ_SEL_Z, SQ_SEL_X, SQ_SEL_Y); - swizzleagain_PVSSRC(&(pAsm->S[1].src), SQ_SEL_Y, SQ_SEL_X, SQ_SEL_Z, SQ_SEL_Z); + swizzleagain_PVSSRC(&(pAsm->S[1].src), SQ_SEL_Y, SQ_SEL_X, SQ_SEL_Z, SQ_SEL_Z); if( GL_FALSE == next_ins(pAsm) ) { return GL_FALSE; } - + /* tmp1.z = RCP_e(|tmp1.z|) */ if(8 == pAsm->unAsic) { @@ -5317,7 +5317,7 @@ GLboolean assemble_TEX(r700_AssemblerBase *pAsm) /* MULADD R0.x, R0.x, PS1, (0x3FC00000, 1.5f).x * MULADD R0.y, R0.y, PS1, (0x3FC00000, 1.5f).x - * muladd has no writemask, have to use another temp + * muladd has no writemask, have to use another temp */ if(8 == pAsm->unAsic) { @@ -5381,8 +5381,8 @@ GLboolean assemble_TEX(r700_AssemblerBase *pAsm) pAsm->D.dst.opcode = SQ_TEX_INST_GET_GRADIENTS_V; break; case OPCODE_TXB: - /* this should actually be SAMPLE_LB but that needs bias to be - * embedded in the instruction - cant do here */ + /* this should actually be SAMPLE_LB but that needs bias to be + * embedded in the instruction - cant do here */ pAsm->D.dst.opcode = SQ_TEX_INST_SAMPLE_L; break; case OPCODE_TXL: @@ -5428,7 +5428,7 @@ GLboolean assemble_TEX(r700_AssemblerBase *pAsm) /* hopefully did swizzles before */ noswizzle_PVSSRC(&(pAsm->S[0].src)); } - + if(pAsm->pILInst[pAsm->uiCurInst].TexSrcTarget == TEXTURE_CUBE_INDEX) { /* SAMPLE dst, tmp.yxwy, CUBE */ @@ -5437,7 +5437,7 @@ GLboolean assemble_TEX(r700_AssemblerBase *pAsm) pAsm->S[0].src.swizzlez = SQ_SEL_W; pAsm->S[0].src.swizzlew = SQ_SEL_Y; } - + if(pAsm->pILInst[pAsm->uiCurInst].TexShadow == 1) { /* compare value goes to w chan ? */ @@ -5481,7 +5481,7 @@ GLboolean assemble_TEX(r700_AssemblerBase *pAsm) return GL_TRUE; } -GLboolean assemble_XPD(r700_AssemblerBase *pAsm) +GLboolean assemble_XPD(r700_AssemblerBase *pAsm) { BITS tmp1; BITS tmp2 = 0; @@ -5499,7 +5499,7 @@ GLboolean assemble_XPD(r700_AssemblerBase *pAsm) pAsm->D.dst.rtype = DST_REG_TEMPORARY; pAsm->D.dst.reg = tmp1; nomask_PVSDST(&(pAsm->D.dst)); - + if( GL_FALSE == assemble_src(pAsm, 0, -1) ) { return GL_FALSE; @@ -5509,11 +5509,11 @@ GLboolean assemble_XPD(r700_AssemblerBase *pAsm) { return GL_FALSE; } - + swizzleagain_PVSSRC(&(pAsm->S[0].src), SQ_SEL_Z, SQ_SEL_X, SQ_SEL_Y, SQ_SEL_0); swizzleagain_PVSSRC(&(pAsm->S[1].src), SQ_SEL_Y, SQ_SEL_Z, SQ_SEL_X, SQ_SEL_0); - if( GL_FALSE == next_ins(pAsm) ) + if( GL_FALSE == next_ins(pAsm) ) { return GL_FALSE; } @@ -5538,7 +5538,7 @@ GLboolean assemble_XPD(r700_AssemblerBase *pAsm) nomask_PVSDST(&(pAsm->D.dst)); } - else + else { if( GL_FALSE == assemble_dst(pAsm) ) { @@ -5555,7 +5555,7 @@ GLboolean assemble_XPD(r700_AssemblerBase *pAsm) { return GL_FALSE; } - + swizzleagain_PVSSRC(&(pAsm->S[0].src), SQ_SEL_Y, SQ_SEL_Z, SQ_SEL_X, SQ_SEL_0); swizzleagain_PVSSRC(&(pAsm->S[1].src), SQ_SEL_Z, SQ_SEL_X, SQ_SEL_Y, SQ_SEL_0); @@ -5567,13 +5567,13 @@ GLboolean assemble_XPD(r700_AssemblerBase *pAsm) neg_PVSSRC(&(pAsm->S[2].src)); noswizzle_PVSSRC(&(pAsm->S[2].src)); - if( GL_FALSE == next_ins(pAsm) ) + if( GL_FALSE == next_ins(pAsm) ) { return GL_FALSE; } - if(0xF != pAsm->pILInst[pAsm->uiCurInst].DstReg.WriteMask) + if(0xF != pAsm->pILInst[pAsm->uiCurInst].DstReg.WriteMask) { if( GL_FALSE == assemble_dst(pAsm) ) { @@ -5684,31 +5684,31 @@ GLboolean jumpToOffest(r700_AssemblerBase *pAsm, GLuint pops, GLint offset) if(8 == pAsm->unAsic) { - SETfield(pAsm->cf_current_cf_clause_ptr->m_Word1.val, + SETfield(pAsm->cf_current_cf_clause_ptr->m_Word1.val, EG_CF_INST_JUMP, EG_CF_WORD1__CF_INST_shift, EG_CF_WORD1__CF_INST_mask); - SETfield(pAsm->cf_current_cf_clause_ptr->m_Word1.val, + SETfield(pAsm->cf_current_cf_clause_ptr->m_Word1.val, pops, - EG_CF_WORD1__POP_COUNT_shift, EG_CF_WORD1__POP_COUNT_mask); - SETfield(pAsm->cf_current_cf_clause_ptr->m_Word1.val, + EG_CF_WORD1__POP_COUNT_shift, EG_CF_WORD1__POP_COUNT_mask); + SETfield(pAsm->cf_current_cf_clause_ptr->m_Word1.val, 0, EG_CF_WORD1__CF_CONST_shift, EG_CF_WORD1__CF_CONST_mask); - SETfield(pAsm->cf_current_cf_clause_ptr->m_Word1.val, + SETfield(pAsm->cf_current_cf_clause_ptr->m_Word1.val, SQ_CF_COND_ACTIVE, EG_CF_WORD1__COND_shift, EG_CF_WORD1__COND_mask); - SETfield(pAsm->cf_current_cf_clause_ptr->m_Word1.val, + SETfield(pAsm->cf_current_cf_clause_ptr->m_Word1.val, 0, EG_CF_WORD1__COUNT_shift, EG_CF_WORD1__COUNT_mask); - SETfield(pAsm->cf_current_cf_clause_ptr->m_Word1.val, + SETfield(pAsm->cf_current_cf_clause_ptr->m_Word1.val, 0, EG_CF_WORD1__VPM_shift, EG_CF_WORD1__VPM_bit); - SETfield(pAsm->cf_current_cf_clause_ptr->m_Word1.val, + SETfield(pAsm->cf_current_cf_clause_ptr->m_Word1.val, 0, - EG_CF_WORD1__EOP_shift, EG_CF_WORD1__EOP_bit); - SETfield(pAsm->cf_current_cf_clause_ptr->m_Word1.val, + EG_CF_WORD1__EOP_shift, EG_CF_WORD1__EOP_bit); + SETfield(pAsm->cf_current_cf_clause_ptr->m_Word1.val, 0, EG_CF_WORD1__WQM_shift, EG_CF_WORD1__WQM_bit); - SETfield(pAsm->cf_current_cf_clause_ptr->m_Word1.val, + SETfield(pAsm->cf_current_cf_clause_ptr->m_Word1.val, 1, EG_CF_WORD1__BARRIER_shift, EG_CF_WORD1__BARRIER_bit); } @@ -5740,44 +5740,44 @@ GLboolean pops(r700_AssemblerBase *pAsm, GLuint pops) if(8 == pAsm->unAsic) { - SETfield(pAsm->cf_current_cf_clause_ptr->m_Word1.val, + SETfield(pAsm->cf_current_cf_clause_ptr->m_Word1.val, EG_CF_INST_POP, EG_CF_WORD1__CF_INST_shift, EG_CF_WORD1__CF_INST_mask); - SETfield(pAsm->cf_current_cf_clause_ptr->m_Word1.val, + SETfield(pAsm->cf_current_cf_clause_ptr->m_Word1.val, pops, - EG_CF_WORD1__POP_COUNT_shift, EG_CF_WORD1__POP_COUNT_mask); - SETfield(pAsm->cf_current_cf_clause_ptr->m_Word1.val, + EG_CF_WORD1__POP_COUNT_shift, EG_CF_WORD1__POP_COUNT_mask); + SETfield(pAsm->cf_current_cf_clause_ptr->m_Word1.val, 0, EG_CF_WORD1__CF_CONST_shift, EG_CF_WORD1__CF_CONST_mask); - SETfield(pAsm->cf_current_cf_clause_ptr->m_Word1.val, + SETfield(pAsm->cf_current_cf_clause_ptr->m_Word1.val, SQ_CF_COND_ACTIVE, EG_CF_WORD1__COND_shift, EG_CF_WORD1__COND_mask); - SETfield(pAsm->cf_current_cf_clause_ptr->m_Word1.val, + SETfield(pAsm->cf_current_cf_clause_ptr->m_Word1.val, 0, - EG_CF_WORD1__EOP_shift, EG_CF_WORD1__EOP_bit); - SETfield(pAsm->cf_current_cf_clause_ptr->m_Word1.val, + EG_CF_WORD1__EOP_shift, EG_CF_WORD1__EOP_bit); + SETfield(pAsm->cf_current_cf_clause_ptr->m_Word1.val, 0, - EG_CF_WORD1__VPM_shift, EG_CF_WORD1__VPM_bit); - SETfield(pAsm->cf_current_cf_clause_ptr->m_Word1.val, + EG_CF_WORD1__VPM_shift, EG_CF_WORD1__VPM_bit); + SETfield(pAsm->cf_current_cf_clause_ptr->m_Word1.val, 0, - EG_CF_WORD1__WQM_shift, EG_CF_WORD1__WQM_bit); - SETfield(pAsm->cf_current_cf_clause_ptr->m_Word1.val, + EG_CF_WORD1__WQM_shift, EG_CF_WORD1__WQM_bit); + SETfield(pAsm->cf_current_cf_clause_ptr->m_Word1.val, 1, EG_CF_WORD1__BARRIER_shift, EG_CF_WORD1__BARRIER_bit); - SETfield(pAsm->cf_current_cf_clause_ptr->m_Word1.val, + SETfield(pAsm->cf_current_cf_clause_ptr->m_Word1.val, 0, EG_CF_WORD1__COUNT_shift, EG_CF_WORD1__COUNT_mask); } else { pAsm->cf_current_cf_clause_ptr->m_Word1.f.pop_count = pops; - pAsm->cf_current_cf_clause_ptr->m_Word1.f.cf_const = 0x0; + pAsm->cf_current_cf_clause_ptr->m_Word1.f.cf_const = 0x0; pAsm->cf_current_cf_clause_ptr->m_Word1.f.cond = SQ_CF_COND_ACTIVE; pAsm->cf_current_cf_clause_ptr->m_Word1.f.end_of_program = 0x0; - pAsm->cf_current_cf_clause_ptr->m_Word1.f.valid_pixel_mode = 0x0; + pAsm->cf_current_cf_clause_ptr->m_Word1.f.valid_pixel_mode = 0x0; pAsm->cf_current_cf_clause_ptr->m_Word1.f.cf_inst = SQ_CF_INST_POP; - + pAsm->cf_current_cf_clause_ptr->m_Word1.f.whole_quad_mode = 0x0; pAsm->cf_current_cf_clause_ptr->m_Word1.f.barrier = 0x1; @@ -5800,42 +5800,42 @@ GLboolean assemble_IF(r700_AssemblerBase *pAsm, GLboolean bHasElse) } if(8 == pAsm->unAsic) - { + { if(GL_TRUE != bHasElse) - { - SETfield(pAsm->cf_current_cf_clause_ptr->m_Word1.val, + { + SETfield(pAsm->cf_current_cf_clause_ptr->m_Word1.val, 1, EG_CF_WORD1__POP_COUNT_shift, EG_CF_WORD1__POP_COUNT_mask); } else - { - SETfield(pAsm->cf_current_cf_clause_ptr->m_Word1.val, + { + SETfield(pAsm->cf_current_cf_clause_ptr->m_Word1.val, 0, EG_CF_WORD1__POP_COUNT_shift, EG_CF_WORD1__POP_COUNT_mask); } - SETfield(pAsm->cf_current_cf_clause_ptr->m_Word1.val, + SETfield(pAsm->cf_current_cf_clause_ptr->m_Word1.val, EG_CF_INST_JUMP, - EG_CF_WORD1__CF_INST_shift, EG_CF_WORD1__CF_INST_mask); - SETfield(pAsm->cf_current_cf_clause_ptr->m_Word1.val, + EG_CF_WORD1__CF_INST_shift, EG_CF_WORD1__CF_INST_mask); + SETfield(pAsm->cf_current_cf_clause_ptr->m_Word1.val, 0, EG_CF_WORD1__CF_CONST_shift, EG_CF_WORD1__CF_CONST_mask); - SETfield(pAsm->cf_current_cf_clause_ptr->m_Word1.val, + SETfield(pAsm->cf_current_cf_clause_ptr->m_Word1.val, SQ_CF_COND_ACTIVE, EG_CF_WORD1__COND_shift, EG_CF_WORD1__COND_mask); - SETfield(pAsm->cf_current_cf_clause_ptr->m_Word1.val, + SETfield(pAsm->cf_current_cf_clause_ptr->m_Word1.val, 0, - EG_CF_WORD1__EOP_shift, EG_CF_WORD1__EOP_bit); - SETfield(pAsm->cf_current_cf_clause_ptr->m_Word1.val, + EG_CF_WORD1__EOP_shift, EG_CF_WORD1__EOP_bit); + SETfield(pAsm->cf_current_cf_clause_ptr->m_Word1.val, 0, - EG_CF_WORD1__VPM_shift, EG_CF_WORD1__VPM_bit); - SETfield(pAsm->cf_current_cf_clause_ptr->m_Word1.val, + EG_CF_WORD1__VPM_shift, EG_CF_WORD1__VPM_bit); + SETfield(pAsm->cf_current_cf_clause_ptr->m_Word1.val, 0, - EG_CF_WORD1__WQM_shift, EG_CF_WORD1__WQM_bit); - SETfield(pAsm->cf_current_cf_clause_ptr->m_Word1.val, + EG_CF_WORD1__WQM_shift, EG_CF_WORD1__WQM_bit); + SETfield(pAsm->cf_current_cf_clause_ptr->m_Word1.val, 1, EG_CF_WORD1__BARRIER_shift, EG_CF_WORD1__BARRIER_bit); - SETfield(pAsm->cf_current_cf_clause_ptr->m_Word1.val, + SETfield(pAsm->cf_current_cf_clause_ptr->m_Word1.val, 0, EG_CF_WORD1__COUNT_shift, EG_CF_WORD1__COUNT_mask); } @@ -5843,7 +5843,7 @@ GLboolean assemble_IF(r700_AssemblerBase *pAsm, GLboolean bHasElse) { if(GL_TRUE != bHasElse) { - pAsm->cf_current_cf_clause_ptr->m_Word1.f.pop_count = 1; + pAsm->cf_current_cf_clause_ptr->m_Word1.f.pop_count = 1; } else { @@ -5873,7 +5873,7 @@ GLboolean assemble_IF(r700_AssemblerBase *pAsm, GLboolean bHasElse) } #endif /* USE_CF_FOR_POP_AFTER */ - checkStackDepth(pAsm, FC_PUSH_VPM, GL_FALSE); + checkStackDepth(pAsm, FC_PUSH_VPM, GL_FALSE); return GL_TRUE; } @@ -5886,32 +5886,32 @@ GLboolean assemble_ELSE(r700_AssemblerBase *pAsm) } if(8 == pAsm->unAsic) - { - SETfield(pAsm->cf_current_cf_clause_ptr->m_Word1.val, + { + SETfield(pAsm->cf_current_cf_clause_ptr->m_Word1.val, 1, - EG_CF_WORD1__POP_COUNT_shift, EG_CF_WORD1__POP_COUNT_mask); - SETfield(pAsm->cf_current_cf_clause_ptr->m_Word1.val, + EG_CF_WORD1__POP_COUNT_shift, EG_CF_WORD1__POP_COUNT_mask); + SETfield(pAsm->cf_current_cf_clause_ptr->m_Word1.val, EG_CF_INST_ELSE, - EG_CF_WORD1__CF_INST_shift, EG_CF_WORD1__CF_INST_mask); - SETfield(pAsm->cf_current_cf_clause_ptr->m_Word1.val, + EG_CF_WORD1__CF_INST_shift, EG_CF_WORD1__CF_INST_mask); + SETfield(pAsm->cf_current_cf_clause_ptr->m_Word1.val, 0, EG_CF_WORD1__CF_CONST_shift, EG_CF_WORD1__CF_CONST_mask); - SETfield(pAsm->cf_current_cf_clause_ptr->m_Word1.val, + SETfield(pAsm->cf_current_cf_clause_ptr->m_Word1.val, SQ_CF_COND_ACTIVE, EG_CF_WORD1__COND_shift, EG_CF_WORD1__COND_mask); - SETfield(pAsm->cf_current_cf_clause_ptr->m_Word1.val, + SETfield(pAsm->cf_current_cf_clause_ptr->m_Word1.val, 0, - EG_CF_WORD1__EOP_shift, EG_CF_WORD1__EOP_bit); - SETfield(pAsm->cf_current_cf_clause_ptr->m_Word1.val, + EG_CF_WORD1__EOP_shift, EG_CF_WORD1__EOP_bit); + SETfield(pAsm->cf_current_cf_clause_ptr->m_Word1.val, 0, - EG_CF_WORD1__VPM_shift, EG_CF_WORD1__VPM_bit); - SETfield(pAsm->cf_current_cf_clause_ptr->m_Word1.val, + EG_CF_WORD1__VPM_shift, EG_CF_WORD1__VPM_bit); + SETfield(pAsm->cf_current_cf_clause_ptr->m_Word1.val, 0, - EG_CF_WORD1__WQM_shift, EG_CF_WORD1__WQM_bit); - SETfield(pAsm->cf_current_cf_clause_ptr->m_Word1.val, + EG_CF_WORD1__WQM_shift, EG_CF_WORD1__WQM_bit); + SETfield(pAsm->cf_current_cf_clause_ptr->m_Word1.val, 1, EG_CF_WORD1__BARRIER_shift, EG_CF_WORD1__BARRIER_bit); - SETfield(pAsm->cf_current_cf_clause_ptr->m_Word1.val, + SETfield(pAsm->cf_current_cf_clause_ptr->m_Word1.val, 0, EG_CF_WORD1__COUNT_shift, EG_CF_WORD1__COUNT_mask); } @@ -5939,7 +5939,7 @@ GLboolean assemble_ELSE(r700_AssemblerBase *pAsm) pAsm->alu_x_opcode = SQ_CF_INST_ALU_POP_AFTER; #endif /* USE_CF_FOR_POP_AFTER */ - pAsm->fc_stack[pAsm->FCSP].first->m_Word0.f.addr = pAsm->pR700Shader->plstCFInstructions_active->uNumOfNode - 1; + pAsm->fc_stack[pAsm->FCSP].first->m_Word0.f.addr = pAsm->pR700Shader->plstCFInstructions_active->uNumOfNode - 1; return GL_TRUE; } @@ -5947,7 +5947,7 @@ GLboolean assemble_ELSE(r700_AssemblerBase *pAsm) GLboolean assemble_ENDIF(r700_AssemblerBase *pAsm) { #ifdef USE_CF_FOR_POP_AFTER - pops(pAsm, 1); + pops(pAsm, 1); #endif /* USE_CF_FOR_POP_AFTER */ pAsm->alu_x_opcode = SQ_CF_INST_ALU; @@ -5972,7 +5972,7 @@ GLboolean assemble_ENDIF(r700_AssemblerBase *pAsm) radeon_error("if/endif in shader code are not paired. \n"); return GL_FALSE; } - + pAsm->FCSP--; decreaseCurrent(pAsm, FC_PUSH_VPM); @@ -5988,43 +5988,43 @@ GLboolean assemble_BGNLOOP(r700_AssemblerBase *pAsm) } if(8 == pAsm->unAsic) - { - SETfield(pAsm->cf_current_cf_clause_ptr->m_Word1.val, + { + SETfield(pAsm->cf_current_cf_clause_ptr->m_Word1.val, 0, - EG_CF_WORD1__POP_COUNT_shift, EG_CF_WORD1__POP_COUNT_mask); - SETfield(pAsm->cf_current_cf_clause_ptr->m_Word1.val, + EG_CF_WORD1__POP_COUNT_shift, EG_CF_WORD1__POP_COUNT_mask); + SETfield(pAsm->cf_current_cf_clause_ptr->m_Word1.val, EG_CF_INST_LOOP_START_NO_AL, - EG_CF_WORD1__CF_INST_shift, EG_CF_WORD1__CF_INST_mask); - SETfield(pAsm->cf_current_cf_clause_ptr->m_Word1.val, + EG_CF_WORD1__CF_INST_shift, EG_CF_WORD1__CF_INST_mask); + SETfield(pAsm->cf_current_cf_clause_ptr->m_Word1.val, 0, EG_CF_WORD1__CF_CONST_shift, EG_CF_WORD1__CF_CONST_mask); - SETfield(pAsm->cf_current_cf_clause_ptr->m_Word1.val, + SETfield(pAsm->cf_current_cf_clause_ptr->m_Word1.val, SQ_CF_COND_ACTIVE, EG_CF_WORD1__COND_shift, EG_CF_WORD1__COND_mask); - SETfield(pAsm->cf_current_cf_clause_ptr->m_Word1.val, + SETfield(pAsm->cf_current_cf_clause_ptr->m_Word1.val, 0, - EG_CF_WORD1__EOP_shift, EG_CF_WORD1__EOP_bit); - SETfield(pAsm->cf_current_cf_clause_ptr->m_Word1.val, + EG_CF_WORD1__EOP_shift, EG_CF_WORD1__EOP_bit); + SETfield(pAsm->cf_current_cf_clause_ptr->m_Word1.val, 0, - EG_CF_WORD1__VPM_shift, EG_CF_WORD1__VPM_bit); - SETfield(pAsm->cf_current_cf_clause_ptr->m_Word1.val, + EG_CF_WORD1__VPM_shift, EG_CF_WORD1__VPM_bit); + SETfield(pAsm->cf_current_cf_clause_ptr->m_Word1.val, 0, - EG_CF_WORD1__WQM_shift, EG_CF_WORD1__WQM_bit); - SETfield(pAsm->cf_current_cf_clause_ptr->m_Word1.val, + EG_CF_WORD1__WQM_shift, EG_CF_WORD1__WQM_bit); + SETfield(pAsm->cf_current_cf_clause_ptr->m_Word1.val, 1, EG_CF_WORD1__BARRIER_shift, EG_CF_WORD1__BARRIER_bit); - SETfield(pAsm->cf_current_cf_clause_ptr->m_Word1.val, + SETfield(pAsm->cf_current_cf_clause_ptr->m_Word1.val, 0, EG_CF_WORD1__COUNT_shift, EG_CF_WORD1__COUNT_mask); } else { pAsm->cf_current_cf_clause_ptr->m_Word1.f.pop_count = 0; - pAsm->cf_current_cf_clause_ptr->m_Word1.f.cf_const = 0x0; + pAsm->cf_current_cf_clause_ptr->m_Word1.f.cf_const = 0x0; pAsm->cf_current_cf_clause_ptr->m_Word1.f.cond = SQ_CF_COND_ACTIVE; pAsm->cf_current_cf_clause_ptr->m_Word1.f.end_of_program = 0x0; - pAsm->cf_current_cf_clause_ptr->m_Word1.f.valid_pixel_mode = 0x0; + pAsm->cf_current_cf_clause_ptr->m_Word1.f.valid_pixel_mode = 0x0; pAsm->cf_current_cf_clause_ptr->m_Word1.f.cf_inst = SQ_CF_INST_LOOP_START_NO_AL; pAsm->cf_current_cf_clause_ptr->m_Word1.f.whole_quad_mode = 0x0; @@ -6050,7 +6050,7 @@ GLboolean assemble_BRK(r700_AssemblerBase *pAsm) pAsm->alu_x_opcode = SQ_CF_INST_ALU_PUSH_BEFORE; assemble_LOGIC_PRED(pAsm, SQ_OP2_INST_PRED_SETNE); - + unsigned int unFCSP; for(unFCSP=pAsm->FCSP; unFCSP>0; unFCSP--) { @@ -6071,51 +6071,51 @@ GLboolean assemble_BRK(r700_AssemblerBase *pAsm) } if(8 == pAsm->unAsic) - { - SETfield(pAsm->cf_current_cf_clause_ptr->m_Word1.val, + { + SETfield(pAsm->cf_current_cf_clause_ptr->m_Word1.val, 1, - EG_CF_WORD1__POP_COUNT_shift, EG_CF_WORD1__POP_COUNT_mask); - SETfield(pAsm->cf_current_cf_clause_ptr->m_Word1.val, + EG_CF_WORD1__POP_COUNT_shift, EG_CF_WORD1__POP_COUNT_mask); + SETfield(pAsm->cf_current_cf_clause_ptr->m_Word1.val, EG_CF_INST_LOOP_BREAK, - EG_CF_WORD1__CF_INST_shift, EG_CF_WORD1__CF_INST_mask); - SETfield(pAsm->cf_current_cf_clause_ptr->m_Word1.val, + EG_CF_WORD1__CF_INST_shift, EG_CF_WORD1__CF_INST_mask); + SETfield(pAsm->cf_current_cf_clause_ptr->m_Word1.val, 0, EG_CF_WORD1__CF_CONST_shift, EG_CF_WORD1__CF_CONST_mask); - SETfield(pAsm->cf_current_cf_clause_ptr->m_Word1.val, + SETfield(pAsm->cf_current_cf_clause_ptr->m_Word1.val, SQ_CF_COND_ACTIVE, EG_CF_WORD1__COND_shift, EG_CF_WORD1__COND_mask); - SETfield(pAsm->cf_current_cf_clause_ptr->m_Word1.val, + SETfield(pAsm->cf_current_cf_clause_ptr->m_Word1.val, 0, - EG_CF_WORD1__EOP_shift, EG_CF_WORD1__EOP_bit); - SETfield(pAsm->cf_current_cf_clause_ptr->m_Word1.val, + EG_CF_WORD1__EOP_shift, EG_CF_WORD1__EOP_bit); + SETfield(pAsm->cf_current_cf_clause_ptr->m_Word1.val, 0, - EG_CF_WORD1__VPM_shift, EG_CF_WORD1__VPM_bit); - SETfield(pAsm->cf_current_cf_clause_ptr->m_Word1.val, + EG_CF_WORD1__VPM_shift, EG_CF_WORD1__VPM_bit); + SETfield(pAsm->cf_current_cf_clause_ptr->m_Word1.val, 0, - EG_CF_WORD1__WQM_shift, EG_CF_WORD1__WQM_bit); - SETfield(pAsm->cf_current_cf_clause_ptr->m_Word1.val, + EG_CF_WORD1__WQM_shift, EG_CF_WORD1__WQM_bit); + SETfield(pAsm->cf_current_cf_clause_ptr->m_Word1.val, 1, EG_CF_WORD1__BARRIER_shift, EG_CF_WORD1__BARRIER_bit); - SETfield(pAsm->cf_current_cf_clause_ptr->m_Word1.val, + SETfield(pAsm->cf_current_cf_clause_ptr->m_Word1.val, 0, EG_CF_WORD1__COUNT_shift, EG_CF_WORD1__COUNT_mask); } else { pAsm->cf_current_cf_clause_ptr->m_Word1.f.pop_count = 1; - pAsm->cf_current_cf_clause_ptr->m_Word1.f.cf_const = 0x0; + pAsm->cf_current_cf_clause_ptr->m_Word1.f.cf_const = 0x0; pAsm->cf_current_cf_clause_ptr->m_Word1.f.cond = SQ_CF_COND_ACTIVE; pAsm->cf_current_cf_clause_ptr->m_Word1.f.end_of_program = 0x0; - pAsm->cf_current_cf_clause_ptr->m_Word1.f.valid_pixel_mode = 0x0; + pAsm->cf_current_cf_clause_ptr->m_Word1.f.valid_pixel_mode = 0x0; pAsm->cf_current_cf_clause_ptr->m_Word1.f.cf_inst = SQ_CF_INST_LOOP_BREAK; - + pAsm->cf_current_cf_clause_ptr->m_Word1.f.whole_quad_mode = 0x0; pAsm->cf_current_cf_clause_ptr->m_Word1.f.barrier = 0x1; } - pAsm->fc_stack[unFCSP].mid = (R700ControlFlowGenericClause **)_mesa_realloc( + pAsm->fc_stack[unFCSP].mid = (R700ControlFlowGenericClause **)_mesa_realloc( (void *)pAsm->fc_stack[unFCSP].mid, sizeof(R700ControlFlowGenericClause *) * pAsm->fc_stack[unFCSP].unNumMid, sizeof(R700ControlFlowGenericClause *) * (pAsm->fc_stack[unFCSP].unNumMid + 1) ); @@ -6128,45 +6128,45 @@ GLboolean assemble_BRK(r700_AssemblerBase *pAsm) } if(8 == pAsm->unAsic) - { - SETfield(pAsm->cf_current_cf_clause_ptr->m_Word1.val, + { + SETfield(pAsm->cf_current_cf_clause_ptr->m_Word1.val, 1, - EG_CF_WORD1__POP_COUNT_shift, EG_CF_WORD1__POP_COUNT_mask); - SETfield(pAsm->cf_current_cf_clause_ptr->m_Word1.val, + EG_CF_WORD1__POP_COUNT_shift, EG_CF_WORD1__POP_COUNT_mask); + SETfield(pAsm->cf_current_cf_clause_ptr->m_Word1.val, EG_CF_INST_POP, - EG_CF_WORD1__CF_INST_shift, EG_CF_WORD1__CF_INST_mask); - SETfield(pAsm->cf_current_cf_clause_ptr->m_Word1.val, + EG_CF_WORD1__CF_INST_shift, EG_CF_WORD1__CF_INST_mask); + SETfield(pAsm->cf_current_cf_clause_ptr->m_Word1.val, 0, EG_CF_WORD1__CF_CONST_shift, EG_CF_WORD1__CF_CONST_mask); - SETfield(pAsm->cf_current_cf_clause_ptr->m_Word1.val, + SETfield(pAsm->cf_current_cf_clause_ptr->m_Word1.val, SQ_CF_COND_ACTIVE, EG_CF_WORD1__COND_shift, EG_CF_WORD1__COND_mask); - SETfield(pAsm->cf_current_cf_clause_ptr->m_Word1.val, + SETfield(pAsm->cf_current_cf_clause_ptr->m_Word1.val, 0, - EG_CF_WORD1__EOP_shift, EG_CF_WORD1__EOP_bit); - SETfield(pAsm->cf_current_cf_clause_ptr->m_Word1.val, + EG_CF_WORD1__EOP_shift, EG_CF_WORD1__EOP_bit); + SETfield(pAsm->cf_current_cf_clause_ptr->m_Word1.val, 0, - EG_CF_WORD1__VPM_shift, EG_CF_WORD1__VPM_bit); - SETfield(pAsm->cf_current_cf_clause_ptr->m_Word1.val, + EG_CF_WORD1__VPM_shift, EG_CF_WORD1__VPM_bit); + SETfield(pAsm->cf_current_cf_clause_ptr->m_Word1.val, 0, - EG_CF_WORD1__WQM_shift, EG_CF_WORD1__WQM_bit); - SETfield(pAsm->cf_current_cf_clause_ptr->m_Word1.val, + EG_CF_WORD1__WQM_shift, EG_CF_WORD1__WQM_bit); + SETfield(pAsm->cf_current_cf_clause_ptr->m_Word1.val, 1, EG_CF_WORD1__BARRIER_shift, EG_CF_WORD1__BARRIER_bit); - SETfield(pAsm->cf_current_cf_clause_ptr->m_Word1.val, + SETfield(pAsm->cf_current_cf_clause_ptr->m_Word1.val, 0, EG_CF_WORD1__COUNT_shift, EG_CF_WORD1__COUNT_mask); } else { pAsm->cf_current_cf_clause_ptr->m_Word1.f.pop_count = 1; - pAsm->cf_current_cf_clause_ptr->m_Word1.f.cf_const = 0x0; + pAsm->cf_current_cf_clause_ptr->m_Word1.f.cf_const = 0x0; pAsm->cf_current_cf_clause_ptr->m_Word1.f.cond = SQ_CF_COND_ACTIVE; pAsm->cf_current_cf_clause_ptr->m_Word1.f.end_of_program = 0x0; - pAsm->cf_current_cf_clause_ptr->m_Word1.f.valid_pixel_mode = 0x0; + pAsm->cf_current_cf_clause_ptr->m_Word1.f.valid_pixel_mode = 0x0; pAsm->cf_current_cf_clause_ptr->m_Word1.f.cf_inst = SQ_CF_INST_POP; - + pAsm->cf_current_cf_clause_ptr->m_Word1.f.whole_quad_mode = 0x0; pAsm->cf_current_cf_clause_ptr->m_Word1.f.barrier = 0x1; @@ -6207,51 +6207,51 @@ GLboolean assemble_CONT(r700_AssemblerBase *pAsm) } if(8 == pAsm->unAsic) - { - SETfield(pAsm->cf_current_cf_clause_ptr->m_Word1.val, + { + SETfield(pAsm->cf_current_cf_clause_ptr->m_Word1.val, 1, - EG_CF_WORD1__POP_COUNT_shift, EG_CF_WORD1__POP_COUNT_mask); - SETfield(pAsm->cf_current_cf_clause_ptr->m_Word1.val, + EG_CF_WORD1__POP_COUNT_shift, EG_CF_WORD1__POP_COUNT_mask); + SETfield(pAsm->cf_current_cf_clause_ptr->m_Word1.val, EG_CF_INST_LOOP_CONTINUE, - EG_CF_WORD1__CF_INST_shift, EG_CF_WORD1__CF_INST_mask); - SETfield(pAsm->cf_current_cf_clause_ptr->m_Word1.val, + EG_CF_WORD1__CF_INST_shift, EG_CF_WORD1__CF_INST_mask); + SETfield(pAsm->cf_current_cf_clause_ptr->m_Word1.val, 0, EG_CF_WORD1__CF_CONST_shift, EG_CF_WORD1__CF_CONST_mask); - SETfield(pAsm->cf_current_cf_clause_ptr->m_Word1.val, + SETfield(pAsm->cf_current_cf_clause_ptr->m_Word1.val, SQ_CF_COND_ACTIVE, EG_CF_WORD1__COND_shift, EG_CF_WORD1__COND_mask); - SETfield(pAsm->cf_current_cf_clause_ptr->m_Word1.val, + SETfield(pAsm->cf_current_cf_clause_ptr->m_Word1.val, 0, - EG_CF_WORD1__EOP_shift, EG_CF_WORD1__EOP_bit); - SETfield(pAsm->cf_current_cf_clause_ptr->m_Word1.val, + EG_CF_WORD1__EOP_shift, EG_CF_WORD1__EOP_bit); + SETfield(pAsm->cf_current_cf_clause_ptr->m_Word1.val, 0, - EG_CF_WORD1__VPM_shift, EG_CF_WORD1__VPM_bit); - SETfield(pAsm->cf_current_cf_clause_ptr->m_Word1.val, + EG_CF_WORD1__VPM_shift, EG_CF_WORD1__VPM_bit); + SETfield(pAsm->cf_current_cf_clause_ptr->m_Word1.val, 0, - EG_CF_WORD1__WQM_shift, EG_CF_WORD1__WQM_bit); - SETfield(pAsm->cf_current_cf_clause_ptr->m_Word1.val, + EG_CF_WORD1__WQM_shift, EG_CF_WORD1__WQM_bit); + SETfield(pAsm->cf_current_cf_clause_ptr->m_Word1.val, 1, EG_CF_WORD1__BARRIER_shift, EG_CF_WORD1__BARRIER_bit); - SETfield(pAsm->cf_current_cf_clause_ptr->m_Word1.val, + SETfield(pAsm->cf_current_cf_clause_ptr->m_Word1.val, 0, EG_CF_WORD1__COUNT_shift, EG_CF_WORD1__COUNT_mask); } else { pAsm->cf_current_cf_clause_ptr->m_Word1.f.pop_count = 1; - pAsm->cf_current_cf_clause_ptr->m_Word1.f.cf_const = 0x0; + pAsm->cf_current_cf_clause_ptr->m_Word1.f.cf_const = 0x0; pAsm->cf_current_cf_clause_ptr->m_Word1.f.cond = SQ_CF_COND_ACTIVE; pAsm->cf_current_cf_clause_ptr->m_Word1.f.end_of_program = 0x0; - pAsm->cf_current_cf_clause_ptr->m_Word1.f.valid_pixel_mode = 0x0; + pAsm->cf_current_cf_clause_ptr->m_Word1.f.valid_pixel_mode = 0x0; pAsm->cf_current_cf_clause_ptr->m_Word1.f.cf_inst = SQ_CF_INST_LOOP_CONTINUE; - + pAsm->cf_current_cf_clause_ptr->m_Word1.f.whole_quad_mode = 0x0; pAsm->cf_current_cf_clause_ptr->m_Word1.f.barrier = 0x1; } - pAsm->fc_stack[unFCSP].mid = (R700ControlFlowGenericClause **)_mesa_realloc( + pAsm->fc_stack[unFCSP].mid = (R700ControlFlowGenericClause **)_mesa_realloc( (void *)pAsm->fc_stack[unFCSP].mid, sizeof(R700ControlFlowGenericClause *) * pAsm->fc_stack[unFCSP].unNumMid, sizeof(R700ControlFlowGenericClause *) * (pAsm->fc_stack[unFCSP].unNumMid + 1) ); @@ -6264,45 +6264,45 @@ GLboolean assemble_CONT(r700_AssemblerBase *pAsm) } if(8 == pAsm->unAsic) - { - SETfield(pAsm->cf_current_cf_clause_ptr->m_Word1.val, + { + SETfield(pAsm->cf_current_cf_clause_ptr->m_Word1.val, 1, - EG_CF_WORD1__POP_COUNT_shift, EG_CF_WORD1__POP_COUNT_mask); - SETfield(pAsm->cf_current_cf_clause_ptr->m_Word1.val, + EG_CF_WORD1__POP_COUNT_shift, EG_CF_WORD1__POP_COUNT_mask); + SETfield(pAsm->cf_current_cf_clause_ptr->m_Word1.val, EG_CF_INST_POP, - EG_CF_WORD1__CF_INST_shift, EG_CF_WORD1__CF_INST_mask); - SETfield(pAsm->cf_current_cf_clause_ptr->m_Word1.val, + EG_CF_WORD1__CF_INST_shift, EG_CF_WORD1__CF_INST_mask); + SETfield(pAsm->cf_current_cf_clause_ptr->m_Word1.val, 0, EG_CF_WORD1__CF_CONST_shift, EG_CF_WORD1__CF_CONST_mask); - SETfield(pAsm->cf_current_cf_clause_ptr->m_Word1.val, + SETfield(pAsm->cf_current_cf_clause_ptr->m_Word1.val, SQ_CF_COND_ACTIVE, EG_CF_WORD1__COND_shift, EG_CF_WORD1__COND_mask); - SETfield(pAsm->cf_current_cf_clause_ptr->m_Word1.val, + SETfield(pAsm->cf_current_cf_clause_ptr->m_Word1.val, 0, - EG_CF_WORD1__EOP_shift, EG_CF_WORD1__EOP_bit); - SETfield(pAsm->cf_current_cf_clause_ptr->m_Word1.val, + EG_CF_WORD1__EOP_shift, EG_CF_WORD1__EOP_bit); + SETfield(pAsm->cf_current_cf_clause_ptr->m_Word1.val, 0, - EG_CF_WORD1__VPM_shift, EG_CF_WORD1__VPM_bit); - SETfield(pAsm->cf_current_cf_clause_ptr->m_Word1.val, + EG_CF_WORD1__VPM_shift, EG_CF_WORD1__VPM_bit); + SETfield(pAsm->cf_current_cf_clause_ptr->m_Word1.val, 0, - EG_CF_WORD1__WQM_shift, EG_CF_WORD1__WQM_bit); - SETfield(pAsm->cf_current_cf_clause_ptr->m_Word1.val, + EG_CF_WORD1__WQM_shift, EG_CF_WORD1__WQM_bit); + SETfield(pAsm->cf_current_cf_clause_ptr->m_Word1.val, 1, EG_CF_WORD1__BARRIER_shift, EG_CF_WORD1__BARRIER_bit); - SETfield(pAsm->cf_current_cf_clause_ptr->m_Word1.val, + SETfield(pAsm->cf_current_cf_clause_ptr->m_Word1.val, 0, EG_CF_WORD1__COUNT_shift, EG_CF_WORD1__COUNT_mask); } else { pAsm->cf_current_cf_clause_ptr->m_Word1.f.pop_count = 1; - pAsm->cf_current_cf_clause_ptr->m_Word1.f.cf_const = 0x0; + pAsm->cf_current_cf_clause_ptr->m_Word1.f.cf_const = 0x0; pAsm->cf_current_cf_clause_ptr->m_Word1.f.cond = SQ_CF_COND_ACTIVE; pAsm->cf_current_cf_clause_ptr->m_Word1.f.end_of_program = 0x0; - pAsm->cf_current_cf_clause_ptr->m_Word1.f.valid_pixel_mode = 0x0; + pAsm->cf_current_cf_clause_ptr->m_Word1.f.valid_pixel_mode = 0x0; pAsm->cf_current_cf_clause_ptr->m_Word1.f.cf_inst = SQ_CF_INST_POP; - + pAsm->cf_current_cf_clause_ptr->m_Word1.f.whole_quad_mode = 0x0; pAsm->cf_current_cf_clause_ptr->m_Word1.f.barrier = 0x1; @@ -6327,43 +6327,43 @@ GLboolean assemble_ENDLOOP(r700_AssemblerBase *pAsm) } if(8 == pAsm->unAsic) - { - SETfield(pAsm->cf_current_cf_clause_ptr->m_Word1.val, + { + SETfield(pAsm->cf_current_cf_clause_ptr->m_Word1.val, 0, - EG_CF_WORD1__POP_COUNT_shift, EG_CF_WORD1__POP_COUNT_mask); - SETfield(pAsm->cf_current_cf_clause_ptr->m_Word1.val, + EG_CF_WORD1__POP_COUNT_shift, EG_CF_WORD1__POP_COUNT_mask); + SETfield(pAsm->cf_current_cf_clause_ptr->m_Word1.val, EG_CF_INST_LOOP_END, - EG_CF_WORD1__CF_INST_shift, EG_CF_WORD1__CF_INST_mask); - SETfield(pAsm->cf_current_cf_clause_ptr->m_Word1.val, + EG_CF_WORD1__CF_INST_shift, EG_CF_WORD1__CF_INST_mask); + SETfield(pAsm->cf_current_cf_clause_ptr->m_Word1.val, 0, EG_CF_WORD1__CF_CONST_shift, EG_CF_WORD1__CF_CONST_mask); - SETfield(pAsm->cf_current_cf_clause_ptr->m_Word1.val, + SETfield(pAsm->cf_current_cf_clause_ptr->m_Word1.val, SQ_CF_COND_ACTIVE, EG_CF_WORD1__COND_shift, EG_CF_WORD1__COND_mask); - SETfield(pAsm->cf_current_cf_clause_ptr->m_Word1.val, + SETfield(pAsm->cf_current_cf_clause_ptr->m_Word1.val, 0, - EG_CF_WORD1__EOP_shift, EG_CF_WORD1__EOP_bit); - SETfield(pAsm->cf_current_cf_clause_ptr->m_Word1.val, + EG_CF_WORD1__EOP_shift, EG_CF_WORD1__EOP_bit); + SETfield(pAsm->cf_current_cf_clause_ptr->m_Word1.val, 0, - EG_CF_WORD1__VPM_shift, EG_CF_WORD1__VPM_bit); - SETfield(pAsm->cf_current_cf_clause_ptr->m_Word1.val, + EG_CF_WORD1__VPM_shift, EG_CF_WORD1__VPM_bit); + SETfield(pAsm->cf_current_cf_clause_ptr->m_Word1.val, 0, - EG_CF_WORD1__WQM_shift, EG_CF_WORD1__WQM_bit); - SETfield(pAsm->cf_current_cf_clause_ptr->m_Word1.val, + EG_CF_WORD1__WQM_shift, EG_CF_WORD1__WQM_bit); + SETfield(pAsm->cf_current_cf_clause_ptr->m_Word1.val, 1, EG_CF_WORD1__BARRIER_shift, EG_CF_WORD1__BARRIER_bit); - SETfield(pAsm->cf_current_cf_clause_ptr->m_Word1.val, + SETfield(pAsm->cf_current_cf_clause_ptr->m_Word1.val, 0, EG_CF_WORD1__COUNT_shift, EG_CF_WORD1__COUNT_mask); } else { pAsm->cf_current_cf_clause_ptr->m_Word1.f.pop_count = 0; - pAsm->cf_current_cf_clause_ptr->m_Word1.f.cf_const = 0x0; + pAsm->cf_current_cf_clause_ptr->m_Word1.f.cf_const = 0x0; pAsm->cf_current_cf_clause_ptr->m_Word1.f.cond = SQ_CF_COND_ACTIVE; pAsm->cf_current_cf_clause_ptr->m_Word1.f.end_of_program = 0x0; - pAsm->cf_current_cf_clause_ptr->m_Word1.f.valid_pixel_mode = 0x0; + pAsm->cf_current_cf_clause_ptr->m_Word1.f.valid_pixel_mode = 0x0; pAsm->cf_current_cf_clause_ptr->m_Word1.f.cf_inst = SQ_CF_INST_LOOP_END; pAsm->cf_current_cf_clause_ptr->m_Word1.f.whole_quad_mode = 0x0; @@ -6393,7 +6393,7 @@ GLboolean assemble_ENDLOOP(r700_AssemblerBase *pAsm) GLuint unFCSP; GLuint unIF = 0; if((pAsm->unCFflags & HAS_CURRENT_LOOPRET) > 0) - { + { for(unFCSP=(pAsm->FCSP-1); unFCSP>pAsm->CALLSTACK[pAsm->CALLSP].FCSP_BeforeEntry; unFCSP--) { if(FC_LOOP == pAsm->fc_stack[unFCSP].type) @@ -6407,9 +6407,9 @@ GLboolean assemble_ENDLOOP(r700_AssemblerBase *pAsm) } } if(unFCSP <= pAsm->CALLSTACK[pAsm->CALLSP].FCSP_BeforeEntry) - { + { #ifdef USE_CF_FOR_POP_AFTER - returnOnFlag(pAsm, unIF); + returnOnFlag(pAsm, unIF); #else returnOnFlag(pAsm, 0); #endif /* USE_CF_FOR_POP_AFTER */ @@ -6420,7 +6420,7 @@ GLboolean assemble_ENDLOOP(r700_AssemblerBase *pAsm) pAsm->FCSP--; decreaseCurrent(pAsm, FC_LOOP); - + return GL_TRUE; } @@ -6432,32 +6432,32 @@ void add_return_inst(r700_AssemblerBase *pAsm) } if(8 == pAsm->unAsic) - { - SETfield(pAsm->cf_current_cf_clause_ptr->m_Word1.val, + { + SETfield(pAsm->cf_current_cf_clause_ptr->m_Word1.val, 0, - EG_CF_WORD1__POP_COUNT_shift, EG_CF_WORD1__POP_COUNT_mask); - SETfield(pAsm->cf_current_cf_clause_ptr->m_Word1.val, + EG_CF_WORD1__POP_COUNT_shift, EG_CF_WORD1__POP_COUNT_mask); + SETfield(pAsm->cf_current_cf_clause_ptr->m_Word1.val, EG_CF_INST_RETURN, - EG_CF_WORD1__CF_INST_shift, EG_CF_WORD1__CF_INST_mask); - SETfield(pAsm->cf_current_cf_clause_ptr->m_Word1.val, + EG_CF_WORD1__CF_INST_shift, EG_CF_WORD1__CF_INST_mask); + SETfield(pAsm->cf_current_cf_clause_ptr->m_Word1.val, 0, EG_CF_WORD1__CF_CONST_shift, EG_CF_WORD1__CF_CONST_mask); - SETfield(pAsm->cf_current_cf_clause_ptr->m_Word1.val, + SETfield(pAsm->cf_current_cf_clause_ptr->m_Word1.val, SQ_CF_COND_ACTIVE, EG_CF_WORD1__COND_shift, EG_CF_WORD1__COND_mask); - SETfield(pAsm->cf_current_cf_clause_ptr->m_Word1.val, + SETfield(pAsm->cf_current_cf_clause_ptr->m_Word1.val, 0, - EG_CF_WORD1__EOP_shift, EG_CF_WORD1__EOP_bit); - SETfield(pAsm->cf_current_cf_clause_ptr->m_Word1.val, + EG_CF_WORD1__EOP_shift, EG_CF_WORD1__EOP_bit); + SETfield(pAsm->cf_current_cf_clause_ptr->m_Word1.val, 0, - EG_CF_WORD1__VPM_shift, EG_CF_WORD1__VPM_bit); - SETfield(pAsm->cf_current_cf_clause_ptr->m_Word1.val, + EG_CF_WORD1__VPM_shift, EG_CF_WORD1__VPM_bit); + SETfield(pAsm->cf_current_cf_clause_ptr->m_Word1.val, 0, - EG_CF_WORD1__WQM_shift, EG_CF_WORD1__WQM_bit); - SETfield(pAsm->cf_current_cf_clause_ptr->m_Word1.val, + EG_CF_WORD1__WQM_shift, EG_CF_WORD1__WQM_bit); + SETfield(pAsm->cf_current_cf_clause_ptr->m_Word1.val, 1, EG_CF_WORD1__BARRIER_shift, EG_CF_WORD1__BARRIER_bit); - SETfield(pAsm->cf_current_cf_clause_ptr->m_Word1.val, + SETfield(pAsm->cf_current_cf_clause_ptr->m_Word1.val, 0, EG_CF_WORD1__COUNT_shift, EG_CF_WORD1__COUNT_mask); } @@ -6493,8 +6493,8 @@ GLboolean assemble_BGNSUB(r700_AssemblerBase *pAsm, GLint nILindex, GLuint uiIL_ } pAsm->subs[pAsm->unSubArrayPointer].subIL_Offset = nILindex + uiIL_Shift; - pAsm->subs[pAsm->unSubArrayPointer].lstCFInstructions_local.pHead=NULL; - pAsm->subs[pAsm->unSubArrayPointer].lstCFInstructions_local.pTail=NULL; + pAsm->subs[pAsm->unSubArrayPointer].lstCFInstructions_local.pHead=NULL; + pAsm->subs[pAsm->unSubArrayPointer].lstCFInstructions_local.pTail=NULL; pAsm->subs[pAsm->unSubArrayPointer].lstCFInstructions_local.uNumOfNode=0; pAsm->CALLSP++; @@ -6504,7 +6504,7 @@ GLboolean assemble_BGNSUB(r700_AssemblerBase *pAsm, GLint nILindex, GLuint uiIL_ = &(pAsm->subs[pAsm->unSubArrayPointer].lstCFInstructions_local); pAsm->CALLSTACK[pAsm->CALLSP].max = 0; pAsm->CALLSTACK[pAsm->CALLSP].current = 0; - SetActiveCFlist(pAsm->pR700Shader, + SetActiveCFlist(pAsm->pR700Shader, pAsm->CALLSTACK[pAsm->CALLSP].plstCFInstructions_local); pAsm->unSubArrayPointer++; @@ -6535,9 +6535,9 @@ GLboolean assemble_ENDSUB(r700_AssemblerBase *pAsm) decreaseCurrent(pAsm, FC_REP); pAsm->CALLSP--; - SetActiveCFlist(pAsm->pR700Shader, + SetActiveCFlist(pAsm->pR700Shader, pAsm->CALLSTACK[pAsm->CALLSP].plstCFInstructions_local); - + pAsm->alu_x_opcode = SQ_CF_INST_ALU; pAsm->FCSP--; @@ -6551,7 +6551,7 @@ GLboolean assemble_RET(r700_AssemblerBase *pAsm) if(pAsm->CALLSP > 0) { /* in sub */ - GLuint unFCSP; + GLuint unFCSP; for(unFCSP=pAsm->FCSP; unFCSP>pAsm->CALLSTACK[pAsm->CALLSP].FCSP_BeforeEntry; unFCSP--) { if(FC_LOOP == pAsm->fc_stack[unFCSP].type) @@ -6569,7 +6569,7 @@ GLboolean assemble_RET(r700_AssemblerBase *pAsm) } } -#ifdef USE_CF_FOR_POP_AFTER +#ifdef USE_CF_FOR_POP_AFTER if(unIF > 0) { pops(pAsm, unIF); @@ -6581,7 +6581,7 @@ GLboolean assemble_RET(r700_AssemblerBase *pAsm) return GL_TRUE; } -GLboolean assemble_CAL(r700_AssemblerBase *pAsm, +GLboolean assemble_CAL(r700_AssemblerBase *pAsm, GLint nILindex, GLuint uiIL_Shift, GLuint uiNumberInsts, @@ -6598,32 +6598,32 @@ GLboolean assemble_CAL(r700_AssemblerBase *pAsm, } if(8 == pAsm->unAsic) - { - SETfield(pAsm->cf_current_cf_clause_ptr->m_Word1.val, + { + SETfield(pAsm->cf_current_cf_clause_ptr->m_Word1.val, 0, - EG_CF_WORD1__POP_COUNT_shift, EG_CF_WORD1__POP_COUNT_mask); - SETfield(pAsm->cf_current_cf_clause_ptr->m_Word1.val, + EG_CF_WORD1__POP_COUNT_shift, EG_CF_WORD1__POP_COUNT_mask); + SETfield(pAsm->cf_current_cf_clause_ptr->m_Word1.val, EG_CF_INST_CALL, - EG_CF_WORD1__CF_INST_shift, EG_CF_WORD1__CF_INST_mask); - SETfield(pAsm->cf_current_cf_clause_ptr->m_Word1.val, + EG_CF_WORD1__CF_INST_shift, EG_CF_WORD1__CF_INST_mask); + SETfield(pAsm->cf_current_cf_clause_ptr->m_Word1.val, 0, EG_CF_WORD1__CF_CONST_shift, EG_CF_WORD1__CF_CONST_mask); - SETfield(pAsm->cf_current_cf_clause_ptr->m_Word1.val, + SETfield(pAsm->cf_current_cf_clause_ptr->m_Word1.val, SQ_CF_COND_ACTIVE, EG_CF_WORD1__COND_shift, EG_CF_WORD1__COND_mask); - SETfield(pAsm->cf_current_cf_clause_ptr->m_Word1.val, + SETfield(pAsm->cf_current_cf_clause_ptr->m_Word1.val, 0, - EG_CF_WORD1__EOP_shift, EG_CF_WORD1__EOP_bit); - SETfield(pAsm->cf_current_cf_clause_ptr->m_Word1.val, + EG_CF_WORD1__EOP_shift, EG_CF_WORD1__EOP_bit); + SETfield(pAsm->cf_current_cf_clause_ptr->m_Word1.val, 0, - EG_CF_WORD1__VPM_shift, EG_CF_WORD1__VPM_bit); - SETfield(pAsm->cf_current_cf_clause_ptr->m_Word1.val, + EG_CF_WORD1__VPM_shift, EG_CF_WORD1__VPM_bit); + SETfield(pAsm->cf_current_cf_clause_ptr->m_Word1.val, 0, - EG_CF_WORD1__WQM_shift, EG_CF_WORD1__WQM_bit); - SETfield(pAsm->cf_current_cf_clause_ptr->m_Word1.val, + EG_CF_WORD1__WQM_shift, EG_CF_WORD1__WQM_bit); + SETfield(pAsm->cf_current_cf_clause_ptr->m_Word1.val, 1, EG_CF_WORD1__BARRIER_shift, EG_CF_WORD1__BARRIER_bit); - SETfield(pAsm->cf_current_cf_clause_ptr->m_Word1.val, + SETfield(pAsm->cf_current_cf_clause_ptr->m_Word1.val, 1, EG_CF_WORD1__COUNT_shift, EG_CF_WORD1__COUNT_mask); } @@ -6631,11 +6631,11 @@ GLboolean assemble_CAL(r700_AssemblerBase *pAsm, { pAsm->cf_current_cf_clause_ptr->m_Word1.f.call_count = 1; pAsm->cf_current_cf_clause_ptr->m_Word1.f.pop_count = 0; - pAsm->cf_current_cf_clause_ptr->m_Word1.f.cf_const = 0x0; + pAsm->cf_current_cf_clause_ptr->m_Word1.f.cf_const = 0x0; pAsm->cf_current_cf_clause_ptr->m_Word1.f.cond = SQ_CF_COND_ACTIVE; pAsm->cf_current_cf_clause_ptr->m_Word1.f.end_of_program = 0x0; - pAsm->cf_current_cf_clause_ptr->m_Word1.f.valid_pixel_mode = 0x0; + pAsm->cf_current_cf_clause_ptr->m_Word1.f.valid_pixel_mode = 0x0; pAsm->cf_current_cf_clause_ptr->m_Word1.f.cf_inst = SQ_CF_INST_CALL; pAsm->cf_current_cf_clause_ptr->m_Word1.f.whole_quad_mode = 0x0; @@ -6645,8 +6645,8 @@ GLboolean assemble_CAL(r700_AssemblerBase *pAsm, /* Put in caller */ if( (pAsm->unCallerArrayPointer + 1) > pAsm->unCallerArraySize ) { - pAsm->callers = (CALLER_POINTER*)_mesa_realloc( (void *)pAsm->callers, - sizeof(CALLER_POINTER) * pAsm->unCallerArraySize, + pAsm->callers = (CALLER_POINTER*)_mesa_realloc( (void *)pAsm->callers, + sizeof(CALLER_POINTER) * pAsm->unCallerArraySize, sizeof(CALLER_POINTER) * (pAsm->unCallerArraySize + 10) ); if(NULL == pAsm->callers) { @@ -6654,13 +6654,13 @@ GLboolean assemble_CAL(r700_AssemblerBase *pAsm, } pAsm->unCallerArraySize += 10; } - + uiIL_Offset = nILindex + uiIL_Shift; - pAsm->callers[pAsm->unCallerArrayPointer].subIL_Offset = uiIL_Offset; + pAsm->callers[pAsm->unCallerArrayPointer].subIL_Offset = uiIL_Offset; pAsm->callers[pAsm->unCallerArrayPointer].cf_ptr = pAsm->cf_current_cf_clause_ptr; - - pAsm->callers[pAsm->unCallerArrayPointer].finale_cf_ptr = NULL; - pAsm->callers[pAsm->unCallerArrayPointer].prelude_cf_ptr = NULL; + + pAsm->callers[pAsm->unCallerArrayPointer].finale_cf_ptr = NULL; + pAsm->callers[pAsm->unCallerArrayPointer].prelude_cf_ptr = NULL; pAsm->unCallerArrayPointer++; @@ -6673,14 +6673,14 @@ GLboolean assemble_CAL(r700_AssemblerBase *pAsm, if(uiIL_Offset == pAsm->subs[j].subIL_Offset) { /* compiled before */ - max = pAsm->subs[j].unStackDepthMax + max = pAsm->subs[j].unStackDepthMax + pAsm->CALLSTACK[pAsm->CALLSP].current; if(max > pAsm->CALLSTACK[pAsm->CALLSP].max) { pAsm->CALLSTACK[pAsm->CALLSP].max = max; } - - pAsm->callers[pAsm->unCallerArrayPointer - 1].subDescIndex = j; + + pAsm->callers[pAsm->unCallerArrayPointer - 1].subDescIndex = j; return GL_TRUE; } } @@ -6692,7 +6692,7 @@ GLboolean assemble_CAL(r700_AssemblerBase *pAsm, if(GL_TRUE == bRet) { - max = pAsm->subs[unSubID].unStackDepthMax + max = pAsm->subs[unSubID].unStackDepthMax + pAsm->CALLSTACK[pAsm->CALLSP].current; if(max > pAsm->CALLSTACK[pAsm->CALLSP].max) { @@ -6834,58 +6834,58 @@ GLboolean returnOnFlag(r700_AssemblerBase *pAsm, GLuint unIF) GLboolean breakLoopOnFlag(r700_AssemblerBase *pAsm, GLuint unFCSP) { testFlag(pAsm); - + //break if(GL_FALSE == add_cf_instruction(pAsm) ) { return GL_FALSE; } - + if(8 == pAsm->unAsic) - { - SETfield(pAsm->cf_current_cf_clause_ptr->m_Word1.val, + { + SETfield(pAsm->cf_current_cf_clause_ptr->m_Word1.val, 1, - EG_CF_WORD1__POP_COUNT_shift, EG_CF_WORD1__POP_COUNT_mask); - SETfield(pAsm->cf_current_cf_clause_ptr->m_Word1.val, + EG_CF_WORD1__POP_COUNT_shift, EG_CF_WORD1__POP_COUNT_mask); + SETfield(pAsm->cf_current_cf_clause_ptr->m_Word1.val, EG_CF_INST_LOOP_BREAK, - EG_CF_WORD1__CF_INST_shift, EG_CF_WORD1__CF_INST_mask); - SETfield(pAsm->cf_current_cf_clause_ptr->m_Word1.val, + EG_CF_WORD1__CF_INST_shift, EG_CF_WORD1__CF_INST_mask); + SETfield(pAsm->cf_current_cf_clause_ptr->m_Word1.val, 0, EG_CF_WORD1__CF_CONST_shift, EG_CF_WORD1__CF_CONST_mask); - SETfield(pAsm->cf_current_cf_clause_ptr->m_Word1.val, + SETfield(pAsm->cf_current_cf_clause_ptr->m_Word1.val, SQ_CF_COND_ACTIVE, EG_CF_WORD1__COND_shift, EG_CF_WORD1__COND_mask); - SETfield(pAsm->cf_current_cf_clause_ptr->m_Word1.val, + SETfield(pAsm->cf_current_cf_clause_ptr->m_Word1.val, 0, - EG_CF_WORD1__EOP_shift, EG_CF_WORD1__EOP_bit); - SETfield(pAsm->cf_current_cf_clause_ptr->m_Word1.val, + EG_CF_WORD1__EOP_shift, EG_CF_WORD1__EOP_bit); + SETfield(pAsm->cf_current_cf_clause_ptr->m_Word1.val, 0, - EG_CF_WORD1__VPM_shift, EG_CF_WORD1__VPM_bit); - SETfield(pAsm->cf_current_cf_clause_ptr->m_Word1.val, + EG_CF_WORD1__VPM_shift, EG_CF_WORD1__VPM_bit); + SETfield(pAsm->cf_current_cf_clause_ptr->m_Word1.val, 0, - EG_CF_WORD1__WQM_shift, EG_CF_WORD1__WQM_bit); - SETfield(pAsm->cf_current_cf_clause_ptr->m_Word1.val, + EG_CF_WORD1__WQM_shift, EG_CF_WORD1__WQM_bit); + SETfield(pAsm->cf_current_cf_clause_ptr->m_Word1.val, 1, EG_CF_WORD1__BARRIER_shift, EG_CF_WORD1__BARRIER_bit); - SETfield(pAsm->cf_current_cf_clause_ptr->m_Word1.val, + SETfield(pAsm->cf_current_cf_clause_ptr->m_Word1.val, 1, EG_CF_WORD1__COUNT_shift, EG_CF_WORD1__COUNT_mask); } else { pAsm->cf_current_cf_clause_ptr->m_Word1.f.pop_count = 1; - pAsm->cf_current_cf_clause_ptr->m_Word1.f.cf_const = 0x0; + pAsm->cf_current_cf_clause_ptr->m_Word1.f.cf_const = 0x0; pAsm->cf_current_cf_clause_ptr->m_Word1.f.cond = SQ_CF_COND_ACTIVE; pAsm->cf_current_cf_clause_ptr->m_Word1.f.end_of_program = 0x0; - pAsm->cf_current_cf_clause_ptr->m_Word1.f.valid_pixel_mode = 0x0; + pAsm->cf_current_cf_clause_ptr->m_Word1.f.valid_pixel_mode = 0x0; pAsm->cf_current_cf_clause_ptr->m_Word1.f.cf_inst = SQ_CF_INST_LOOP_BREAK; pAsm->cf_current_cf_clause_ptr->m_Word1.f.whole_quad_mode = 0x0; pAsm->cf_current_cf_clause_ptr->m_Word1.f.barrier = 0x1; } - pAsm->fc_stack[unFCSP].mid = (R700ControlFlowGenericClause **)_mesa_realloc( + pAsm->fc_stack[unFCSP].mid = (R700ControlFlowGenericClause **)_mesa_realloc( (void *)pAsm->fc_stack[unFCSP].mid, sizeof(R700ControlFlowGenericClause *) * pAsm->fc_stack[unFCSP].unNumMid, sizeof(R700ControlFlowGenericClause *) * (pAsm->fc_stack[unFCSP].unNumMid + 1) ); @@ -6893,14 +6893,14 @@ GLboolean breakLoopOnFlag(r700_AssemblerBase *pAsm, GLuint unFCSP) pAsm->fc_stack[unFCSP].unNumMid++; pops(pAsm, 1); - + return GL_TRUE; } GLboolean AssembleInstr(GLuint uiFirstInst, GLuint uiIL_Shift, GLuint uiNumberInsts, - struct prog_instruction *pILInst, + struct prog_instruction *pILInst, r700_AssemblerBase *pR700AsmCode) { GLuint i; @@ -6913,7 +6913,7 @@ GLboolean AssembleInstr(GLuint uiFirstInst, #ifndef USE_CF_FOR_CONTINUE_BREAK if(OPCODE_BRK == pILInst[i+1].Opcode) { - switch(pILInst[i].Opcode) + switch(pILInst[i].Opcode) { case OPCODE_SLE: pILInst[i].Opcode = OPCODE_SGT; @@ -6942,208 +6942,208 @@ GLboolean AssembleInstr(GLuint uiFirstInst, { /* remember dest register used for cond evaluation */ /* XXX also handle PROGRAM_OUTPUT registers here? */ - pR700AsmCode->last_cond_register = pILInst[i].DstReg.Index; + pR700AsmCode->last_cond_register = pILInst[i].DstReg.Index; } switch (pILInst[i].Opcode) { - case OPCODE_ABS: - if ( GL_FALSE == assemble_ABS(pR700AsmCode) ) + case OPCODE_ABS: + if ( GL_FALSE == assemble_ABS(pR700AsmCode) ) return GL_FALSE; - break; - case OPCODE_ADD: - case OPCODE_SUB: - if ( GL_FALSE == assemble_ADD(pR700AsmCode) ) + break; + case OPCODE_ADD: + case OPCODE_SUB: + if ( GL_FALSE == assemble_ADD(pR700AsmCode) ) return GL_FALSE; - break; + break; - case OPCODE_ARL: - if ( GL_FALSE == assemble_ARL(pR700AsmCode) ) + case OPCODE_ARL: + if ( GL_FALSE == assemble_ARL(pR700AsmCode) ) return GL_FALSE; break; - case OPCODE_ARR: + case OPCODE_ARR: radeon_error("Not yet implemented instruction OPCODE_ARR \n"); - //if ( GL_FALSE == assemble_BAD("ARR") ) + //if ( GL_FALSE == assemble_BAD("ARR") ) return GL_FALSE; break; - case OPCODE_CMP: - if ( GL_FALSE == assemble_CMP(pR700AsmCode) ) + case OPCODE_CMP: + if ( GL_FALSE == assemble_CMP(pR700AsmCode) ) return GL_FALSE; - break; - case OPCODE_COS: + break; + case OPCODE_COS: if(8 == pR700AsmCode->unAsic) { - if ( GL_FALSE == assemble_TRIG(pR700AsmCode, EG_OP2_INST_COS) ) + if ( GL_FALSE == assemble_TRIG(pR700AsmCode, EG_OP2_INST_COS) ) return GL_FALSE; } else { - if ( GL_FALSE == assemble_TRIG(pR700AsmCode, SQ_OP2_INST_COS) ) + if ( GL_FALSE == assemble_TRIG(pR700AsmCode, SQ_OP2_INST_COS) ) return GL_FALSE; } - break; + break; case OPCODE_DP2: - case OPCODE_DP3: - case OPCODE_DP4: - case OPCODE_DPH: - if ( GL_FALSE == assemble_DOT(pR700AsmCode) ) + case OPCODE_DP3: + case OPCODE_DP4: + case OPCODE_DPH: + if ( GL_FALSE == assemble_DOT(pR700AsmCode) ) return GL_FALSE; - break; + break; - case OPCODE_DST: - if ( GL_FALSE == assemble_DST(pR700AsmCode) ) + case OPCODE_DST: + if ( GL_FALSE == assemble_DST(pR700AsmCode) ) return GL_FALSE; - break; + break; - case OPCODE_EX2: - if ( GL_FALSE == assemble_EX2(pR700AsmCode) ) + case OPCODE_EX2: + if ( GL_FALSE == assemble_EX2(pR700AsmCode) ) return GL_FALSE; - break; - case OPCODE_EXP: - if ( GL_FALSE == assemble_EXP(pR700AsmCode) ) + break; + case OPCODE_EXP: + if ( GL_FALSE == assemble_EXP(pR700AsmCode) ) return GL_FALSE; break; - case OPCODE_FLR: - if ( GL_FALSE == assemble_FLR(pR700AsmCode) ) + case OPCODE_FLR: + if ( GL_FALSE == assemble_FLR(pR700AsmCode) ) return GL_FALSE; - break; + break; //case OP_FLR_INT: ; - // if ( GL_FALSE == assemble_FLR_INT() ) + // if ( GL_FALSE == assemble_FLR_INT() ) // return GL_FALSE; - // break; + // break; - case OPCODE_FRC: - if ( GL_FALSE == assemble_FRC(pR700AsmCode) ) + case OPCODE_FRC: + if ( GL_FALSE == assemble_FRC(pR700AsmCode) ) return GL_FALSE; - break; + break; - case OPCODE_KIL: - case OPCODE_KIL_NV: - if ( GL_FALSE == assemble_KIL(pR700AsmCode, SQ_OP2_INST_KILLGT) ) + case OPCODE_KIL: + case OPCODE_KIL_NV: + if ( GL_FALSE == assemble_KIL(pR700AsmCode, SQ_OP2_INST_KILLGT) ) return GL_FALSE; break; - case OPCODE_LG2: - if ( GL_FALSE == assemble_LG2(pR700AsmCode) ) + case OPCODE_LG2: + if ( GL_FALSE == assemble_LG2(pR700AsmCode) ) return GL_FALSE; - break; + break; case OPCODE_LIT: - if ( GL_FALSE == assemble_LIT(pR700AsmCode) ) + if ( GL_FALSE == assemble_LIT(pR700AsmCode) ) return GL_FALSE; break; - case OPCODE_LRP: - if ( GL_FALSE == assemble_LRP(pR700AsmCode) ) + case OPCODE_LRP: + if ( GL_FALSE == assemble_LRP(pR700AsmCode) ) return GL_FALSE; - break; - case OPCODE_LOG: - if ( GL_FALSE == assemble_LOG(pR700AsmCode) ) + break; + case OPCODE_LOG: + if ( GL_FALSE == assemble_LOG(pR700AsmCode) ) return GL_FALSE; break; - case OPCODE_MAD: - if ( GL_FALSE == assemble_MAD(pR700AsmCode) ) + case OPCODE_MAD: + if ( GL_FALSE == assemble_MAD(pR700AsmCode) ) return GL_FALSE; - break; - case OPCODE_MAX: - if ( GL_FALSE == assemble_MAX(pR700AsmCode) ) + break; + case OPCODE_MAX: + if ( GL_FALSE == assemble_MAX(pR700AsmCode) ) return GL_FALSE; - break; - case OPCODE_MIN: - if ( GL_FALSE == assemble_MIN(pR700AsmCode) ) + break; + case OPCODE_MIN: + if ( GL_FALSE == assemble_MIN(pR700AsmCode) ) return GL_FALSE; - break; + break; - case OPCODE_MOV: - if ( GL_FALSE == assemble_MOV(pR700AsmCode) ) + case OPCODE_MOV: + if ( GL_FALSE == assemble_MOV(pR700AsmCode) ) return GL_FALSE; - break; - case OPCODE_MUL: - if ( GL_FALSE == assemble_MUL(pR700AsmCode) ) + break; + case OPCODE_MUL: + if ( GL_FALSE == assemble_MUL(pR700AsmCode) ) return GL_FALSE; break; - + case OPCODE_NOISE1: - { - callPreSub(pR700AsmCode, - GLSL_NOISE1, - &noise1_presub, - pILInst->DstReg.Index + pR700AsmCode->starting_temp_register_number, - 1); + { + callPreSub(pR700AsmCode, + GLSL_NOISE1, + &noise1_presub, + pILInst->DstReg.Index + pR700AsmCode->starting_temp_register_number, + 1); radeon_error("noise1: not yet supported shader instruction\n"); }; - break; - case OPCODE_NOISE2: + break; + case OPCODE_NOISE2: radeon_error("noise2: not yet supported shader instruction\n"); - break; - case OPCODE_NOISE3: + break; + case OPCODE_NOISE3: radeon_error("noise3: not yet supported shader instruction\n"); - break; - case OPCODE_NOISE4: + break; + case OPCODE_NOISE4: radeon_error("noise4: not yet supported shader instruction\n"); - break; + break; - case OPCODE_POW: - if ( GL_FALSE == assemble_POW(pR700AsmCode) ) + case OPCODE_POW: + if ( GL_FALSE == assemble_POW(pR700AsmCode) ) return GL_FALSE; - break; - case OPCODE_RCP: - if ( GL_FALSE == assemble_RCP(pR700AsmCode) ) + break; + case OPCODE_RCP: + if ( GL_FALSE == assemble_RCP(pR700AsmCode) ) return GL_FALSE; - break; - case OPCODE_RSQ: - if ( GL_FALSE == assemble_RSQ(pR700AsmCode) ) + break; + case OPCODE_RSQ: + if ( GL_FALSE == assemble_RSQ(pR700AsmCode) ) return GL_FALSE; - break; - case OPCODE_SIN: + break; + case OPCODE_SIN: if(8 == pR700AsmCode->unAsic) { - if ( GL_FALSE == assemble_TRIG(pR700AsmCode, EG_OP2_INST_SIN) ) + if ( GL_FALSE == assemble_TRIG(pR700AsmCode, EG_OP2_INST_SIN) ) return GL_FALSE; } else { - if ( GL_FALSE == assemble_TRIG(pR700AsmCode, SQ_OP2_INST_SIN) ) + if ( GL_FALSE == assemble_TRIG(pR700AsmCode, SQ_OP2_INST_SIN) ) return GL_FALSE; } - break; - case OPCODE_SCS: - if ( GL_FALSE == assemble_SCS(pR700AsmCode) ) + break; + case OPCODE_SCS: + if ( GL_FALSE == assemble_SCS(pR700AsmCode) ) return GL_FALSE; - break; - + break; + case OPCODE_SEQ: - if ( GL_FALSE == assemble_LOGIC(pR700AsmCode, SQ_OP2_INST_SETE) ) + if ( GL_FALSE == assemble_LOGIC(pR700AsmCode, SQ_OP2_INST_SETE) ) { return GL_FALSE; } break; - case OPCODE_SGT: - if ( GL_FALSE == assemble_LOGIC(pR700AsmCode, SQ_OP2_INST_SETGT) ) + case OPCODE_SGT: + if ( GL_FALSE == assemble_LOGIC(pR700AsmCode, SQ_OP2_INST_SETGT) ) { return GL_FALSE; } break; - case OPCODE_SGE: - if ( GL_FALSE == assemble_SGE(pR700AsmCode) ) - { + case OPCODE_SGE: + if ( GL_FALSE == assemble_SGE(pR700AsmCode) ) + { return GL_FALSE; } break; - + /* NO LT, LE, TODO : use GE => LE, GT => LT : reverse 2 src order would be simpliest. Or use SQ_CF_COND_FALSE for SQ_CF_COND_ACTIVE.*/ - case OPCODE_SLT: + case OPCODE_SLT: { struct prog_src_register SrcRegSave[2]; SrcRegSave[0] = pILInst[i].SrcReg[0]; SrcRegSave[1] = pILInst[i].SrcReg[1]; pILInst[i].SrcReg[0] = SrcRegSave[1]; pILInst[i].SrcReg[1] = SrcRegSave[0]; - if ( GL_FALSE == assemble_LOGIC(pR700AsmCode, SQ_OP2_INST_SETGT) ) + if ( GL_FALSE == assemble_LOGIC(pR700AsmCode, SQ_OP2_INST_SETGT) ) { pILInst[i].SrcReg[0] = SrcRegSave[0]; pILInst[i].SrcReg[1] = SrcRegSave[1]; @@ -7154,14 +7154,14 @@ GLboolean AssembleInstr(GLuint uiFirstInst, } break; - case OPCODE_SLE: + case OPCODE_SLE: { struct prog_src_register SrcRegSave[2]; SrcRegSave[0] = pILInst[i].SrcReg[0]; SrcRegSave[1] = pILInst[i].SrcReg[1]; pILInst[i].SrcReg[0] = SrcRegSave[1]; pILInst[i].SrcReg[1] = SrcRegSave[0]; - if ( GL_FALSE == assemble_LOGIC(pR700AsmCode, SQ_OP2_INST_SETGE) ) + if ( GL_FALSE == assemble_LOGIC(pR700AsmCode, SQ_OP2_INST_SETGE) ) { pILInst[i].SrcReg[0] = SrcRegSave[0]; pILInst[i].SrcReg[1] = SrcRegSave[1]; @@ -7172,15 +7172,15 @@ GLboolean AssembleInstr(GLuint uiFirstInst, } break; - case OPCODE_SNE: - if ( GL_FALSE == assemble_LOGIC(pR700AsmCode, SQ_OP2_INST_SETNE) ) + case OPCODE_SNE: + if ( GL_FALSE == assemble_LOGIC(pR700AsmCode, SQ_OP2_INST_SETNE) ) { return GL_FALSE; } break; - //case OP_STP: - // if ( GL_FALSE == assemble_STP(pR700AsmCode) ) + //case OP_STP: + // if ( GL_FALSE == assemble_STP(pR700AsmCode) ) // return GL_FALSE; // break; @@ -7191,10 +7191,10 @@ GLboolean AssembleInstr(GLuint uiFirstInst, } break; - case OPCODE_SWZ: - if ( GL_FALSE == assemble_MOV(pR700AsmCode) ) + case OPCODE_SWZ: + if ( GL_FALSE == assemble_MOV(pR700AsmCode) ) { - return GL_FALSE; + return GL_FALSE; } else { @@ -7212,11 +7212,11 @@ GLboolean AssembleInstr(GLuint uiFirstInst, break; case OPCODE_DDX: case OPCODE_DDY: - case OPCODE_TEX: + case OPCODE_TEX: case OPCODE_TXB: case OPCODE_TXL: - case OPCODE_TXP: - if ( GL_FALSE == assemble_TEX(pR700AsmCode) ) + case OPCODE_TXP: + if ( GL_FALSE == assemble_TEX(pR700AsmCode) ) return GL_FALSE; break; @@ -7225,13 +7225,13 @@ GLboolean AssembleInstr(GLuint uiFirstInst, return GL_FALSE; break; - case OPCODE_XPD: - if ( GL_FALSE == assemble_XPD(pR700AsmCode) ) + case OPCODE_XPD: + if ( GL_FALSE == assemble_XPD(pR700AsmCode) ) return GL_FALSE; - break; + break; case OPCODE_IF: - { + { GLboolean bHasElse = GL_FALSE; if(pILInst[pILInst[i].BranchTarget].Opcode == OPCODE_ELSE) @@ -7239,20 +7239,20 @@ GLboolean AssembleInstr(GLuint uiFirstInst, bHasElse = GL_TRUE; } - if ( GL_FALSE == assemble_IF(pR700AsmCode, bHasElse) ) + if ( GL_FALSE == assemble_IF(pR700AsmCode, bHasElse) ) { return GL_FALSE; } } break; - case OPCODE_ELSE : - if ( GL_FALSE == assemble_ELSE(pR700AsmCode) ) + case OPCODE_ELSE : + if ( GL_FALSE == assemble_ELSE(pR700AsmCode) ) return GL_FALSE; break; - case OPCODE_ENDIF: - if ( GL_FALSE == assemble_ENDIF(pR700AsmCode) ) + case OPCODE_ENDIF: + if ( GL_FALSE == assemble_ENDIF(pR700AsmCode) ) return GL_FALSE; break; @@ -7290,16 +7290,16 @@ GLboolean AssembleInstr(GLuint uiFirstInst, return GL_FALSE; } break; - + case OPCODE_RET: if( GL_FALSE == assemble_RET(pR700AsmCode) ) { return GL_FALSE; } break; - + case OPCODE_CAL: - if( GL_FALSE == assemble_CAL(pR700AsmCode, + if( GL_FALSE == assemble_CAL(pR700AsmCode, pILInst[i].BranchTarget, uiIL_Shift, uiNumberInsts, @@ -7310,15 +7310,15 @@ GLboolean AssembleInstr(GLuint uiFirstInst, } break; - //case OPCODE_EXPORT: - // if ( GL_FALSE == assemble_EXPORT() ) + //case OPCODE_EXPORT: + // if ( GL_FALSE == assemble_EXPORT() ) // return GL_FALSE; // break; case OPCODE_ENDSUB: return assemble_ENDSUB(pR700AsmCode); - case OPCODE_END: + case OPCODE_END: //pR700AsmCode->uiCurInst = i; //This is to remaind that if in later exoort there is depth/stencil //export, we need a mov to re-arrange DST channel, where using a @@ -7385,7 +7385,7 @@ GLboolean RelocProgram(r700_AssemblerBase * pAsm, struct gl_program * pILProg) else { R700ALUInstruction * pALU = pCF_ALU->m_pLinkedALUInstruction; - + pALU->m_pLinkedALUClause = NULL; pALU = (R700ALUInstruction *)(pALU->pNextInst); pALU->m_pLinkedALUClause = pCF_ALU; @@ -7413,7 +7413,7 @@ GLboolean RelocProgram(r700_AssemblerBase * pAsm, struct gl_program * pILProg) unCFoffset = plstCFmain->uNumOfNode; if(NULL != pILProg->Parameters) - { + { unConstOffset = pILProg->Parameters->NumParameters; } @@ -7447,8 +7447,8 @@ GLboolean RelocProgram(r700_AssemblerBase * pAsm, struct gl_program * pILProg) default: break; } - } - + } + pInst->m_uIndex += unCFoffset; pInst = pInst->pNextInst; @@ -7456,10 +7456,10 @@ GLboolean RelocProgram(r700_AssemblerBase * pAsm, struct gl_program * pILProg) if(NULL != pAsm->subs[i].pPresubDesc) { - GLuint uNumSrc; - + GLuint uNumSrc; + unMinRegIndex = pAsm->subs[i].pPresubDesc->pCompiledSub->MinRegIndex; - unRegOffset = pAsm->subs[i].pPresubDesc->maxStartReg; + unRegOffset = pAsm->subs[i].pPresubDesc->maxStartReg; unConstOffset += pAsm->subs[i].pPresubDesc->unConstantsStart; pInst = plstCFsub->pHead; @@ -7475,33 +7475,33 @@ GLboolean RelocProgram(r700_AssemblerBase * pAsm, struct gl_program * pILProg) pALU->m_Word1.f.dst_gpr = pALU->m_Word1.f.dst_gpr + unRegOffset - unMinRegIndex; if(pALU->m_Word0.f.src0_sel < SQ_ALU_SRC_GPR_SIZE) - { + { pALU->m_Word0.f.src0_sel = pALU->m_Word0.f.src0_sel + unRegOffset - unMinRegIndex; } else if(pALU->m_Word0.f.src0_sel >= SQ_ALU_SRC_CFILE_BASE) - { + { pALU->m_Word0.f.src0_sel += unConstOffset; } - if( ((pALU->m_Word1.val >> SQ_ALU_WORD1_OP3_ALU_INST_SHIFT) & 0x0000001F) + if( ((pALU->m_Word1.val >> SQ_ALU_WORD1_OP3_ALU_INST_SHIFT) & 0x0000001F) >= SQ_OP3_INST_MUL_LIT ) { /* op3 : 3 srcs */ if(pALU->m_Word1_OP3.f.src2_sel < SQ_ALU_SRC_GPR_SIZE) - { + { pALU->m_Word1_OP3.f.src2_sel = pALU->m_Word1_OP3.f.src2_sel + unRegOffset - unMinRegIndex; } else if(pALU->m_Word1_OP3.f.src2_sel >= SQ_ALU_SRC_CFILE_BASE) - { + { pALU->m_Word1_OP3.f.src2_sel += unConstOffset; - } + } if(pALU->m_Word0.f.src1_sel < SQ_ALU_SRC_GPR_SIZE) - { + { pALU->m_Word0.f.src1_sel = pALU->m_Word0.f.src1_sel + unRegOffset - unMinRegIndex; } else if(pALU->m_Word0.f.src1_sel >= SQ_ALU_SRC_CFILE_BASE) - { + { pALU->m_Word0.f.src1_sel += unConstOffset; - } + } } else { @@ -7523,18 +7523,18 @@ GLboolean RelocProgram(r700_AssemblerBase * pAsm, struct gl_program * pILProg) if(2 == uNumSrc) { /* 2 srcs */ if(pALU->m_Word0.f.src1_sel < SQ_ALU_SRC_GPR_SIZE) - { + { pALU->m_Word0.f.src1_sel = pALU->m_Word0.f.src1_sel + unRegOffset - unMinRegIndex; } else if(pALU->m_Word0.f.src1_sel >= SQ_ALU_SRC_CFILE_BASE) - { + { pALU->m_Word0.f.src1_sel += unConstOffset; - } - } + } + } } pALU = (R700ALUInstruction*)(pALU->pNextInst); - } - } + } + } pInst = pInst->pNextInst; }; } @@ -7551,15 +7551,15 @@ GLboolean RelocProgram(r700_AssemblerBase * pAsm, struct gl_program * pILProg) for(i=0; iunCallerArrayPointer; i++) { pAsm->callers[i].cf_ptr->m_Word0.f.addr - = pAsm->subs[pAsm->callers[i].subDescIndex].unCFoffset; + = pAsm->subs[pAsm->callers[i].subDescIndex].unCFoffset; if(NULL != pAsm->subs[pAsm->callers[i].subDescIndex].pPresubDesc) - { + { unMinRegIndex = pAsm->subs[pAsm->callers[i].subDescIndex].pPresubDesc->pCompiledSub->MinRegIndex; unRegOffset = pAsm->subs[pAsm->callers[i].subDescIndex].pPresubDesc->maxStartReg; if(NULL != pAsm->callers[i].prelude_cf_ptr) - { + { pCF_ALU = (R700ControlFlowALUClause * )(pAsm->callers[i].prelude_cf_ptr); pALU = pCF_ALU->m_pLinkedALUInstruction; for(int j=0; j<=pCF_ALU->m_Word1.f.count; j++) @@ -7584,9 +7584,9 @@ GLboolean RelocProgram(r700_AssemblerBase * pAsm, struct gl_program * pILProg) return GL_TRUE; } -GLboolean callPreSub(r700_AssemblerBase* pAsm, - LOADABLE_SCRIPT_SIGNITURE scriptSigniture, - COMPILED_SUB * pCompiledSub, +GLboolean callPreSub(r700_AssemblerBase* pAsm, + LOADABLE_SCRIPT_SIGNITURE scriptSigniture, + COMPILED_SUB * pCompiledSub, GLshort uOutReg, GLshort uNumValidSrc) { @@ -7661,14 +7661,14 @@ GLboolean callPreSub(r700_AssemblerBase* pAsm, } pAsm->unPresubArraySize += 4; } - + pPresubDesc = &(pAsm->presubs[i]); pPresubDesc->sptSigniture = scriptSigniture; /* constants offsets need to be final resolved at reloc. */ if(0 == pAsm->unNumPresub) { - pPresubDesc->unConstantsStart = 0; + pPresubDesc->unConstantsStart = 0; } else { @@ -7690,31 +7690,31 @@ GLboolean callPreSub(r700_AssemblerBase* pAsm, pAsm->uFirstHelpReg = pAsm->number_used_registers; pAsm->uHelpReg = pAsm->uFirstHelpReg; - bRet = assemble_CAL(pAsm, - 0, - pPresubDesc->subIL_Shift, + bRet = assemble_CAL(pAsm, + 0, + pPresubDesc->subIL_Shift, pCompiledSub->NumInstructions, pCompiledSub->Instructions, pPresubDesc); - - pPresubDesc->number_used_registers = pAsm->number_used_registers; + + pPresubDesc->number_used_registers = pAsm->number_used_registers; /* restore assemble context */ - pAsm->number_used_registers = number_used_registers_save; + pAsm->number_used_registers = number_used_registers_save; pAsm->uFirstHelpReg = uFirstHelpReg_save; pAsm->uHelpReg = uHelpReg_save; pAsm->starting_temp_register_number = starting_temp_register_number_save; - pAsm->pILInst = pILInst_save; + pAsm->pILInst = pILInst_save; pAsm->uiCurInst = uiCurInst_save; } else { /* was loaded */ - pPresubDesc = &(pAsm->presubs[i]); - - bRet = assemble_CAL(pAsm, - 0, - pPresubDesc->subIL_Shift, + pPresubDesc = &(pAsm->presubs[i]); + + bRet = assemble_CAL(pAsm, + 0, + pPresubDesc->subIL_Shift, pCompiledSub->NumInstructions, pCompiledSub->Instructions, pPresubDesc); @@ -7726,7 +7726,7 @@ GLboolean callPreSub(r700_AssemblerBase* pAsm, } else { - /* copy presub output to real dst */ + /* copy presub output to real dst */ pAsm->alu_x_opcode = SQ_CF_INST_ALU; pAsm->D.dst.opcode = SQ_OP2_INST_MOV; @@ -7743,7 +7743,7 @@ GLboolean callPreSub(r700_AssemblerBase* pAsm, pAsm->S[0].src.swizzlez = pCompiledSub->outputSwizzleZ; pAsm->S[0].src.swizzlew = pCompiledSub->outputSwizzleW; - next_ins(pAsm); + next_ins(pAsm); pAsm->callers[pAsm->unCallerArrayPointer - 1].finale_cf_ptr = (R700ControlFlowGenericClause*) pAsm->cf_current_alu_clause_ptr; pAsm->callers[pAsm->unCallerArrayPointer - 1].prelude_cf_ptr = prelude_cf_ptr; @@ -7765,7 +7765,7 @@ GLboolean callPreSub(r700_AssemblerBase* pAsm, GLboolean Process_Export(r700_AssemblerBase* pAsm, GLuint type, GLuint export_starting_index, - GLuint export_count, + GLuint export_count, GLuint starting_register_number, GLboolean is_depth_export) { @@ -7774,25 +7774,25 @@ GLboolean Process_Export(r700_AssemblerBase* pAsm, pAsm->cf_current_export_clause_ptr->m_Word0.f.type = type; - switch (type) + switch (type) { case SQ_EXPORT_PIXEL: - if(GL_TRUE == is_depth_export) + if(GL_TRUE == is_depth_export) { pAsm->cf_current_export_clause_ptr->m_Word0.f.array_base = SQ_CF_PIXEL_Z; } - else + else { pAsm->cf_current_export_clause_ptr->m_Word0.f.array_base = SQ_CF_PIXEL_MRT0 + export_starting_index; } break; case SQ_EXPORT_POS: - pAsm->cf_current_export_clause_ptr->m_Word0.f.array_base = SQ_CF_POS_0 + export_starting_index; + pAsm->cf_current_export_clause_ptr->m_Word0.f.array_base = SQ_CF_POS_0 + export_starting_index; break; case SQ_EXPORT_PARAM: - pAsm->cf_current_export_clause_ptr->m_Word0.f.array_base = 0x0 + export_starting_index; + pAsm->cf_current_export_clause_ptr->m_Word0.f.array_base = 0x0 + export_starting_index; break; default: @@ -7805,31 +7805,31 @@ GLboolean Process_Export(r700_AssemblerBase* pAsm, pAsm->cf_current_export_clause_ptr->m_Word0.f.rw_rel = SQ_ABSOLUTE; pAsm->cf_current_export_clause_ptr->m_Word0.f.index_gpr = 0x0; - pAsm->cf_current_export_clause_ptr->m_Word0.f.elem_size = 0x3; + pAsm->cf_current_export_clause_ptr->m_Word0.f.elem_size = 0x3; if(8 == pAsm->unAsic) { - SETfield(pAsm->cf_current_export_clause_ptr->m_Word1.val, + SETfield(pAsm->cf_current_export_clause_ptr->m_Word1.val, (export_count - 1), EG_CF_ALLOC_EXPORT_WORD1__BURST_COUNT_shift, EG_CF_ALLOC_EXPORT_WORD1__BURST_COUNT_mask); - SETfield(pAsm->cf_current_export_clause_ptr->m_Word1.val, + SETfield(pAsm->cf_current_export_clause_ptr->m_Word1.val, 0, EG_CF_ALLOC_EXPORT_WORD1__EOP_shift, EG_CF_ALLOC_EXPORT_WORD1__EOP_bit); - SETfield(pAsm->cf_current_export_clause_ptr->m_Word1.val, + SETfield(pAsm->cf_current_export_clause_ptr->m_Word1.val, 0, EG_CF_ALLOC_EXPORT_WORD1__VPM_shift, EG_CF_ALLOC_EXPORT_WORD1__VPM_bit); - SETfield(pAsm->cf_current_export_clause_ptr->m_Word1.val, + SETfield(pAsm->cf_current_export_clause_ptr->m_Word1.val, EG_CF_INST_EXPORT, - EG_CF_WORD1__CF_INST_shift, + EG_CF_WORD1__CF_INST_shift, EG_CF_WORD1__CF_INST_mask); - SETfield(pAsm->cf_current_export_clause_ptr->m_Word1.val, + SETfield(pAsm->cf_current_export_clause_ptr->m_Word1.val, 0, EG_CF_ALLOC_EXPORT_WORD1__MARK_shift, EG_CF_ALLOC_EXPORT_WORD1__MARK_bit); - SETfield(pAsm->cf_current_export_clause_ptr->m_Word1.val, + SETfield(pAsm->cf_current_export_clause_ptr->m_Word1.val, 1, EG_CF_ALLOC_EXPORT_WORD1__BARRIER_shift, EG_CF_ALLOC_EXPORT_WORD1__BARRIER_bit); @@ -7844,7 +7844,7 @@ GLboolean Process_Export(r700_AssemblerBase* pAsm, pAsm->cf_current_export_clause_ptr->m_Word1.f.barrier = 0x1; } - if (export_count == 1) + if (export_count == 1) { assert(starting_register_number >= pAsm->starting_export_register_number); @@ -7864,7 +7864,7 @@ GLboolean Process_Export(r700_AssemblerBase* pAsm, pAsm->cf_current_export_clause_ptr->m_Word1_SWIZ.f.sel_w = SQ_SEL_W; } } - else + else { // This should only be used if all components for all registers have been written pAsm->cf_current_export_clause_ptr->m_Word1_SWIZ.f.sel_x = SQ_SEL_X; @@ -7879,8 +7879,8 @@ GLboolean Process_Export(r700_AssemblerBase* pAsm, } GLboolean Process_Fragment_Exports(r700_AssemblerBase *pR700AsmCode, - GLbitfield OutputsWritten) -{ + GLbitfield OutputsWritten) +{ unsigned int unBit; GLuint export_count = 0; unsigned int i; @@ -7904,18 +7904,18 @@ GLboolean Process_Fragment_Exports(r700_AssemblerBase *pR700AsmCode, { Process_Export(pR700AsmCode, SQ_EXPORT_PIXEL, 0, 1, pR700AsmCode->starting_export_register_number, GL_FALSE); } - - if(pR700AsmCode->cf_last_export_ptr != NULL) + + if(pR700AsmCode->cf_last_export_ptr != NULL) { if(8 == pR700AsmCode->unAsic) - { - SETfield(pR700AsmCode->cf_last_export_ptr->m_Word1.val, + { + SETfield(pR700AsmCode->cf_last_export_ptr->m_Word1.val, 1, EG_CF_ALLOC_EXPORT_WORD1__EOP_shift, - EG_CF_ALLOC_EXPORT_WORD1__EOP_bit); - SETfield(pR700AsmCode->cf_last_export_ptr->m_Word1.val, + EG_CF_ALLOC_EXPORT_WORD1__EOP_bit); + SETfield(pR700AsmCode->cf_last_export_ptr->m_Word1.val, EG_CF_INST_EXPORT_DONE, - EG_CF_WORD1__CF_INST_shift, + EG_CF_WORD1__CF_INST_shift, EG_CF_WORD1__CF_INST_mask); } else @@ -7929,7 +7929,7 @@ GLboolean Process_Fragment_Exports(r700_AssemblerBase *pR700AsmCode, } GLboolean Process_Vertex_Exports(r700_AssemblerBase *pR700AsmCode, - GLbitfield OutputsWritten) + GLbitfield OutputsWritten) { unsigned int unBit; unsigned int i; @@ -7940,10 +7940,10 @@ GLboolean Process_Vertex_Exports(r700_AssemblerBase *pR700AsmCode, unBit = 1 << VERT_RESULT_HPOS; if(OutputsWritten & unBit) { - if( GL_FALSE == Process_Export(pR700AsmCode, - SQ_EXPORT_POS, - export_starting_index, - 1, + if( GL_FALSE == Process_Export(pR700AsmCode, + SQ_EXPORT_POS, + export_starting_index, + 1, pR700AsmCode->ucVP_OutputMap[VERT_RESULT_HPOS], GL_FALSE) ) { @@ -7969,10 +7969,10 @@ GLboolean Process_Vertex_Exports(r700_AssemblerBase *pR700AsmCode, } if(8 == pR700AsmCode->unAsic) - { - SETfield(pR700AsmCode->cf_last_export_ptr->m_Word1.val, + { + SETfield(pR700AsmCode->cf_last_export_ptr->m_Word1.val, EG_CF_INST_EXPORT_DONE, - EG_CF_WORD1__CF_INST_shift, + EG_CF_WORD1__CF_INST_shift, EG_CF_WORD1__CF_INST_mask); } else @@ -7987,10 +7987,10 @@ GLboolean Process_Vertex_Exports(r700_AssemblerBase *pR700AsmCode, unBit = 1 << VERT_RESULT_COL0; if(OutputsWritten & unBit) { - if( GL_FALSE == Process_Export(pR700AsmCode, - SQ_EXPORT_PARAM, - export_starting_index, - 1, + if( GL_FALSE == Process_Export(pR700AsmCode, + SQ_EXPORT_PARAM, + export_starting_index, + 1, pR700AsmCode->ucVP_OutputMap[VERT_RESULT_COL0], GL_FALSE) ) { @@ -8003,10 +8003,10 @@ GLboolean Process_Vertex_Exports(r700_AssemblerBase *pR700AsmCode, unBit = 1 << VERT_RESULT_COL1; if(OutputsWritten & unBit) { - if( GL_FALSE == Process_Export(pR700AsmCode, - SQ_EXPORT_PARAM, - export_starting_index, - 1, + if( GL_FALSE == Process_Export(pR700AsmCode, + SQ_EXPORT_PARAM, + export_starting_index, + 1, pR700AsmCode->ucVP_OutputMap[VERT_RESULT_COL1], GL_FALSE) ) { @@ -8038,9 +8038,9 @@ GLboolean Process_Vertex_Exports(r700_AssemblerBase *pR700AsmCode, if(OutputsWritten & unBit) { if( GL_FALSE == Process_Export(pR700AsmCode, - SQ_EXPORT_PARAM, - export_starting_index, - 1, + SQ_EXPORT_PARAM, + export_starting_index, + 1, pR700AsmCode->ucVP_OutputMap[VERT_RESULT_TEX0 + i], GL_FALSE) ) { @@ -8050,19 +8050,19 @@ GLboolean Process_Vertex_Exports(r700_AssemblerBase *pR700AsmCode, export_starting_index++; } } - + for(i=VERT_RESULT_VAR0; iucVP_OutputMap[i], GL_FALSE) ) - { + { return GL_FALSE; } @@ -8071,41 +8071,41 @@ GLboolean Process_Vertex_Exports(r700_AssemblerBase *pR700AsmCode, } // At least one param should be exported - if (export_count) + if (export_count) { if(8 == pR700AsmCode->unAsic) - { - SETfield(pR700AsmCode->cf_last_export_ptr->m_Word1.val, + { + SETfield(pR700AsmCode->cf_last_export_ptr->m_Word1.val, EG_CF_INST_EXPORT_DONE, - EG_CF_WORD1__CF_INST_shift, + EG_CF_WORD1__CF_INST_shift, EG_CF_WORD1__CF_INST_mask); } else { - pR700AsmCode->cf_last_export_ptr->m_Word1.f.cf_inst = SQ_CF_INST_EXPORT_DONE; + pR700AsmCode->cf_last_export_ptr->m_Word1.f.cf_inst = SQ_CF_INST_EXPORT_DONE; } } else { if( GL_FALSE == Process_Export(pR700AsmCode, - SQ_EXPORT_PARAM, - 0, - 1, + SQ_EXPORT_PARAM, + 0, + 1, pR700AsmCode->starting_export_register_number, GL_FALSE) ) { return GL_FALSE; } - + pR700AsmCode->cf_last_export_ptr->m_Word1_SWIZ.f.sel_x = SQ_SEL_0; pR700AsmCode->cf_last_export_ptr->m_Word1_SWIZ.f.sel_y = SQ_SEL_0; pR700AsmCode->cf_last_export_ptr->m_Word1_SWIZ.f.sel_z = SQ_SEL_0; pR700AsmCode->cf_last_export_ptr->m_Word1_SWIZ.f.sel_w = SQ_SEL_1; if(8 == pR700AsmCode->unAsic) - { - SETfield(pR700AsmCode->cf_last_export_ptr->m_Word1.val, + { + SETfield(pR700AsmCode->cf_last_export_ptr->m_Word1.val, EG_CF_INST_EXPORT_DONE, - EG_CF_WORD1__CF_INST_shift, + EG_CF_WORD1__CF_INST_shift, EG_CF_WORD1__CF_INST_mask); } else diff --git a/src/mesa/drivers/dri/r600/r700_assembler.h b/src/mesa/drivers/dri/r600/r700_assembler.h index c7c7ab2..fa5c2e0 100644 --- a/src/mesa/drivers/dri/r600/r700_assembler.h +++ b/src/mesa/drivers/dri/r600/r700_assembler.h @@ -50,7 +50,7 @@ typedef struct COMPILED_SUB GLuint NumParameters; GLuint MinRegIndex; GLfloat (*ParameterValues)[4]; - GLbyte outputSwizzleX; + GLbyte outputSwizzleX; GLbyte outputSwizzleY; GLbyte outputSwizzleZ; GLbyte outputSwizzleW; @@ -58,7 +58,7 @@ typedef struct COMPILED_SUB GLushort dstRegIndex; }COMPILED_SUB; -typedef struct PRESUB_DESCtag +typedef struct PRESUB_DESCtag { LOADABLE_SCRIPT_SIGNITURE sptSigniture; GLint subIL_Shift; @@ -73,19 +73,19 @@ typedef struct PRESUB_DESCtag COMPILED_SUB * pCompiledSub; } PRESUB_DESC; -typedef enum SHADER_PIPE_TYPE +typedef enum SHADER_PIPE_TYPE { SPT_VP = 0, SPT_FP = 1 } SHADER_PIPE_TYPE; -typedef enum ConstantCycles +typedef enum ConstantCycles { NUMBER_OF_CYCLES = 3, NUMBER_OF_COMPONENTS = 4 } ConstantCycles; -typedef enum HARDWARE_LIMIT_VALUES +typedef enum HARDWARE_LIMIT_VALUES { TEMPORARY_REGISTER_OFFSET = SQ_ALU_SRC_GPR_BASE, MAX_TEMPORARY_REGISTERS = SQ_ALU_SRC_GPR_SIZE, @@ -97,7 +97,7 @@ typedef enum HARDWARE_LIMIT_VALUES MEGA_FETCH_BYTES = 32 } HARDWARE_LIMIT_VALUES; -typedef enum AddressMode +typedef enum AddressMode { ADDR_ABSOLUTE = 0, ADDR_RELATIVE_A0 = 1, @@ -105,17 +105,17 @@ typedef enum AddressMode NUMBER_OF_ADDR_MOD = 3 } AddressMode; -typedef enum SrcRegisterType +typedef enum SrcRegisterType { SRC_REG_TEMPORARY = 0, SRC_REG_GPR = 1, SRC_REG_CONSTANT = 2, SRC_REG_ALT_TEMPORARY = 3, - SRC_REC_LITERAL = 4, + SRC_REC_LITERAL = 4, NUMBER_OF_SRC_REG_TYPE = 5 } SrcRegisterType; -typedef enum DstRegisterType +typedef enum DstRegisterType { DST_REG_TEMPORARY = 0, DST_REG_A0 = 1, @@ -128,7 +128,7 @@ typedef enum DstRegisterType typedef unsigned int BITS; -typedef struct PVSDSTtag +typedef struct PVSDSTtag { BITS opcode:8; //(:6) //@@@ really should be 10 bits for OP2 BITS math:1; @@ -153,20 +153,20 @@ typedef struct PVSDSTtag typedef struct PVSINSTtag { - BITS literal_slots :2; - BITS SaturateMode :2; + BITS literal_slots :2; + BITS SaturateMode :2; BITS index_mode :3; } PVSINST; -typedef struct PVSSRCtag +typedef struct PVSSRCtag { - BITS rtype:3; - BITS addrmode0:1; + BITS rtype:3; + BITS addrmode0:1; BITS reg:10; //14 (8) BITS swizzlex:3; BITS swizzley:3; BITS swizzlez:3; - BITS swizzlew:3; //26 + BITS swizzlew:3; //26 BITS abs:1; BITS negx:1; @@ -177,7 +177,7 @@ typedef struct PVSSRCtag BITS addrmode1:1; //32 } PVSSRC; -typedef struct PVSMATHtag +typedef struct PVSMATHtag { BITS rtype:4; BITS spare:1; @@ -192,7 +192,7 @@ typedef struct PVSMATHtag BITS spare2:3; } PVSMATH; -typedef union PVSDWORDtag +typedef union PVSDWORDtag { BITS bits; PVSDST dst; @@ -202,7 +202,7 @@ typedef union PVSDWORDtag float f; } PVSDWORD; -typedef struct VAP_OUT_VTX_FMT_0tag +typedef struct VAP_OUT_VTX_FMT_0tag { BITS pos:1; // 0 BITS misc:1; @@ -219,20 +219,20 @@ typedef struct VAP_OUT_VTX_FMT_0tag BITS color6:1; BITS color7:1; - BITS normal:1; + BITS normal:1; BITS depth:1; // 14 - BITS point_size:1; // 15 - BITS edge_flag:1; + BITS point_size:1; // 15 + BITS edge_flag:1; BITS rta_index:1; // shares same channel as kill_flag BITS kill_flag:1; - BITS viewport_index:1; // 19 + BITS viewport_index:1; // 19 BITS resvd1:12; // 20 } VAP_OUT_VTX_FMT_0; -typedef struct VAP_OUT_VTX_FMT_1tag +typedef struct VAP_OUT_VTX_FMT_1tag { BITS tex0comp:3; BITS tex1comp:3; @@ -246,7 +246,7 @@ typedef struct VAP_OUT_VTX_FMT_1tag BITS resvd:8; } VAP_OUT_VTX_FMT_1; -typedef struct VAP_OUT_VTX_FMT_2tag +typedef struct VAP_OUT_VTX_FMT_2tag { BITS tex8comp :3; BITS tex9comp :3; @@ -260,7 +260,7 @@ typedef struct VAP_OUT_VTX_FMT_2tag BITS resvd:8; } VAP_OUT_VTX_FMT_2; -typedef struct OUT_FRAGMENT_FMT_0tag +typedef struct OUT_FRAGMENT_FMT_0tag { BITS color0:1; BITS color1:1; @@ -279,7 +279,7 @@ typedef struct OUT_FRAGMENT_FMT_0tag BITS resvd1:20; } OUT_FRAGMENT_FMT_0; -typedef enum CF_CLAUSE_TYPE +typedef enum CF_CLAUSE_TYPE { CF_EXPORT_CLAUSE, CF_ALU_CLAUSE, @@ -290,7 +290,7 @@ typedef enum CF_CLAUSE_TYPE NUMBER_CF_CLAUSE_TYPES } CF_CLAUSE_TYPE; -enum +enum { MAX_BOOL_CONSTANTS = 32, MAX_INT_CONSTANTS = 32, @@ -312,7 +312,7 @@ enum SAFEDIST_ALU = 6 ///< the same for alu->fc }; -typedef struct FC_LEVEL +typedef struct FC_LEVEL { R700ControlFlowGenericClause * first; R700ControlFlowGenericClause ** mid; @@ -324,7 +324,7 @@ typedef struct FC_LEVEL int id; ///< id of bool or int variable } FC_LEVEL; -typedef struct VTX_FETCH_METHOD +typedef struct VTX_FETCH_METHOD { GLboolean bEnableMini; GLuint mega_fetch_remainder; @@ -364,7 +364,7 @@ typedef struct CALL_LEVEL #define HAS_LOOPRET 0x2L #define LOOPRET_FLAGS HAS_LOOPRET | HAS_CURRENT_LOOPRET -typedef struct r700_AssemblerBase +typedef struct r700_AssemblerBase { R700ControlFlowSXClause* cf_last_export_ptr; R700ControlFlowSXClause* cf_current_export_clause_ptr; @@ -398,7 +398,7 @@ typedef struct r700_AssemblerBase unsigned int uIIns; unsigned int uOIns; unsigned int number_used_registers; - unsigned int uUsedConsts; + unsigned int uUsedConsts; unsigned int flag_reg_index; @@ -430,7 +430,7 @@ typedef struct r700_AssemblerBase GLint hw_cfile_chan[ NUMBER_OF_COMPONENTS ]; GLuint uOutputs; - + GLint color_export_register_number[NUMBER_OF_OUTPUT_COLORS]; GLint depth_export_register_number; @@ -448,11 +448,11 @@ typedef struct r700_AssemblerBase GLboolean input_normal_is_used; GLboolean input_color_is_used[NUMBER_OF_INPUT_COLORS]; - + GLboolean input_texture_unit_is_used[NUMBER_OF_TEXTURE_UNITS]; - + R700VertexGenericFetch* vfetch_instruction_ptr_array[VERT_ATTRIB_MAX]; - + GLuint number_of_inputs; InstDeps *pInstDeps; @@ -468,8 +468,8 @@ typedef struct r700_AssemblerBase /* helper to decide which type of instruction to assemble */ GLboolean is_tex; - /* we inserted helper intructions and need barrier on next TEX ins */ - GLboolean need_tex_barrier; + /* we inserted helper intructions and need barrier on next TEX ins */ + GLboolean need_tex_barrier; SUB_OFFSET * subs; GLuint unSubArraySize; @@ -492,7 +492,7 @@ typedef struct r700_AssemblerBase GLuint shadow_regs[R700_MAX_TEXTURE_UNITS]; GLboolean bUseMemConstant; - GLuint kcacheUsed; + GLuint kcacheUsed; } r700_AssemblerBase; @@ -534,7 +534,7 @@ GLboolean assemble_vfetch_instruction(r700_AssemblerBase* pAsm, GLenum dataElementType, VTX_FETCH_METHOD* pFetchMethod); GLboolean assemble_vfetch_instruction2(r700_AssemblerBase* pAsm, - GLuint destination_register, + GLuint destination_register, GLenum type, GLint size, GLubyte element, @@ -544,7 +544,7 @@ GLboolean assemble_vfetch_instruction2(r700_AssemblerBase* pAsm, VTX_FETCH_METHOD * pFetchMethod); GLboolean EG_assemble_vfetch_instruction(r700_AssemblerBase* pAsm, - GLuint destination_register, + GLuint destination_register, GLenum type, GLint size, GLubyte element, @@ -563,7 +563,7 @@ GLboolean checkop1(r700_AssemblerBase* pAsm); GLboolean checkop2(r700_AssemblerBase* pAsm); GLboolean checkop3(r700_AssemblerBase* pAsm); GLboolean assemble_src(r700_AssemblerBase *pAsm, - int src, + int src, int fld); GLboolean assemble_dst(r700_AssemblerBase *pAsm); GLboolean tex_dst(r700_AssemblerBase *pAsm); @@ -572,7 +572,7 @@ GLboolean assemble_tex_instruction(r700_AssemblerBase *pAsm, GLboolean normalize void initialize(r700_AssemblerBase *pAsm); GLboolean assemble_alu_src(R700ALUInstruction* alu_instruction_ptr, int source_index, - PVSSRC* pSource, + PVSSRC* pSource, BITS scalar_channel_index, r700_AssemblerBase *pAsm); @@ -592,8 +592,8 @@ void get_src_properties(R700ALUInstruction* alu_instruction_ptr, int is_cfile(BITS sel); int is_const(BITS sel); int is_gpr(BITS sel); -GLboolean reserve_cfile(r700_AssemblerBase* pAsm, - GLuint sel, +GLboolean reserve_cfile(r700_AssemblerBase* pAsm, + GLuint sel, GLuint chan); GLboolean reserve_gpr(r700_AssemblerBase* pAsm, GLuint sel, GLuint chan, GLuint cycle); GLboolean cycle_for_scalar_bank_swizzle(const int swiz, const int sel, GLuint* pCycle); @@ -642,7 +642,7 @@ GLboolean assemble_SGE(r700_AssemblerBase *pAsm); GLboolean assemble_CONT(r700_AssemblerBase *pAsm); GLboolean assemble_LOGIC(r700_AssemblerBase *pAsm, BITS opcode); -GLboolean assemble_LOGIC_PRED(r700_AssemblerBase *pAsm, BITS opcode); +GLboolean assemble_LOGIC_PRED(r700_AssemblerBase *pAsm, BITS opcode); GLboolean assemble_TRIG(r700_AssemblerBase *pAsm, BITS opcode); GLboolean assemble_SLT(r700_AssemblerBase *pAsm); @@ -663,7 +663,7 @@ GLboolean assemble_ENDLOOP(r700_AssemblerBase *pAsm); GLboolean assemble_BGNSUB(r700_AssemblerBase *pAsm, GLint nILindex, GLuint uiIL_Shift); GLboolean assemble_ENDSUB(r700_AssemblerBase *pAsm); GLboolean assemble_RET(r700_AssemblerBase *pAsm); -GLboolean assemble_CAL(r700_AssemblerBase *pAsm, +GLboolean assemble_CAL(r700_AssemblerBase *pAsm, GLint nILindex, GLuint uiIL_Offest, GLuint uiNumberInsts, @@ -671,18 +671,18 @@ GLboolean assemble_CAL(r700_AssemblerBase *pAsm, PRESUB_DESC * pPresubDesc); GLboolean Process_Export(r700_AssemblerBase* pAsm, - GLuint type, + GLuint type, GLuint export_starting_index, - GLuint export_count, + GLuint export_count, GLuint starting_register_number, GLboolean is_depth_export); -GLboolean Move_Depth_Exports_To_Correct_Channels(r700_AssemblerBase *pAsm, +GLboolean Move_Depth_Exports_To_Correct_Channels(r700_AssemblerBase *pAsm, BITS depth_channel_select); -GLboolean callPreSub(r700_AssemblerBase* pAsm, +GLboolean callPreSub(r700_AssemblerBase* pAsm, LOADABLE_SCRIPT_SIGNITURE scriptSigniture, /* struct prog_instruction ** pILInstParent, */ - COMPILED_SUB * pCompiledSub, + COMPILED_SUB * pCompiledSub, GLshort uOutReg, GLshort uNumValidSrc); GLboolean EG_add_ps_interp(r700_AssemblerBase* pAsm); @@ -691,9 +691,9 @@ GLboolean EG_add_ps_interp(r700_AssemblerBase* pAsm); GLboolean AssembleInstr(GLuint uiFirstInst, GLuint uiIL_Shift, GLuint uiNumberInsts, - struct prog_instruction *pILInst, + struct prog_instruction *pILInst, r700_AssemblerBase *pR700AsmCode); -GLboolean Process_Fragment_Exports(r700_AssemblerBase *pR700AsmCode, GLbitfield OutputsWritten); +GLboolean Process_Fragment_Exports(r700_AssemblerBase *pR700AsmCode, GLbitfield OutputsWritten); GLboolean Process_Vertex_Exports(r700_AssemblerBase *pR700AsmCode, GLbitfield OutputsWritten); GLboolean RelocProgram(r700_AssemblerBase * pAsm, struct gl_program * pILProg); diff --git a/src/mesa/drivers/dri/r600/r700_chip.c b/src/mesa/drivers/dri/r600/r700_chip.c index 4ec2845..efb6f07 100644 --- a/src/mesa/drivers/dri/r600/r700_chip.c +++ b/src/mesa/drivers/dri/r600/r700_chip.c @@ -53,7 +53,7 @@ static void r700SendTexState(struct gl_context *ctx, struct radeon_state_atom *a radeon_print(RADEON_STATE, RADEON_VERBOSE, "%s\n", __func__); for (i = 0; i < R700_TEXTURE_NUMBERUNITS; i++) { - if (ctx->Texture.Unit[i]._ReallyEnabled) { + if (ctx->Texture.Unit[i]._ReallyEnabled) { radeonTexObj *t = r700->textures[i]; if (t) { if (!t->image_override) { @@ -70,8 +70,8 @@ static void r700SendTexState(struct gl_context *ctx, struct radeon_state_atom *a BEGIN_BATCH_NO_AUTOSTATE(9 + 4); R600_OUT_BATCH(CP_PACKET3(R600_IT_SET_RESOURCE, 7)); - if( (1<r700AsmCode.unVetTexBits ) - { /* vs texture */ + if( (1<r700AsmCode.unVetTexBits ) + { /* vs texture */ R600_OUT_BATCH((i + VERT_ATTRIB_MAX + SQ_FETCH_RESOURCE_VS_OFFSET) * FETCH_RESOURCE_STRIDE); } else @@ -116,13 +116,13 @@ static void r700SendTexSamplerState(struct gl_context *ctx, struct radeon_state_ radeon_print(RADEON_STATE, RADEON_VERBOSE, "%s\n", __func__); for (i = 0; i < R700_TEXTURE_NUMBERUNITS; i++) { - if (ctx->Texture.Unit[i]._ReallyEnabled) { + if (ctx->Texture.Unit[i]._ReallyEnabled) { radeonTexObj *t = r700->textures[i]; if (t) { BEGIN_BATCH_NO_AUTOSTATE(5); R600_OUT_BATCH(CP_PACKET3(R600_IT_SET_SAMPLER, 3)); - if( (1<r700AsmCode.unVetTexBits ) + if( (1<r700AsmCode.unVetTexBits ) { /* vs texture */ R600_OUT_BATCH((i+SQ_TEX_SAMPLER_VS_OFFSET) * SAMPLER_STRIDE); //work 1 } @@ -202,7 +202,7 @@ static void r700SetupVTXConstants(struct gl_context * ctx, SETfield(uSQ_VTX_CONSTANT_WORD2_0, GetSurfaceFormat(pStreamDesc->type, pStreamDesc->size, NULL), SQ_VTX_CONSTANT_WORD2_0__DATA_FORMAT_shift, SQ_VTX_CONSTANT_WORD2_0__DATA_FORMAT_mask); /* TODO : trace back api for initial data type, not only GL_FLOAT */ - + if(GL_TRUE == pStreamDesc->normalize) { SETfield(uSQ_VTX_CONSTANT_WORD2_0, SQ_NUM_FORMAT_NORM, @@ -574,7 +574,7 @@ static void r700SetDepthTarget(context_t *context) { height = rrb->base.Height; } - else + else { height = context->radeon.radeonScreen->driScreen->fbHeight; } @@ -809,11 +809,11 @@ static void r700SendVSState(struct gl_context *ctx, struct radeon_state_atom *at { r700SyncSurf(context, pbo_const, RADEON_GEM_DOMAIN_GTT, 0, SH_ACTION_ENA_bit); /* TODO : Check kc bit. */ - BEGIN_BATCH_NO_AUTOSTATE(3); - R600_OUT_BATCH_REGVAL(SQ_ALU_CONST_BUFFER_SIZE_VS_0, (r700->vs.num_consts * 4)/16 ); + BEGIN_BATCH_NO_AUTOSTATE(3); + R600_OUT_BATCH_REGVAL(SQ_ALU_CONST_BUFFER_SIZE_VS_0, (r700->vs.num_consts * 4)/16 ); END_BATCH(); - BEGIN_BATCH_NO_AUTOSTATE(3 + 2); + BEGIN_BATCH_NO_AUTOSTATE(3 + 2); R600_OUT_BATCH_REGSEQ(SQ_ALU_CONST_CACHE_VS_0, 1); R600_OUT_BATCH(r700->vs.SQ_ALU_CONST_CACHE_VS_0.u32All); R600_OUT_BATCH_RELOC(r700->vs.SQ_ALU_CONST_CACHE_VS_0.u32All, @@ -823,7 +823,7 @@ static void r700SendVSState(struct gl_context *ctx, struct radeon_state_atom *at END_BATCH(); } } - + COMMIT_BATCH(); } diff --git a/src/mesa/drivers/dri/r600/r700_chip.h b/src/mesa/drivers/dri/r600/r700_chip.h index 0ca237b..39eb255 100644 --- a/src/mesa/drivers/dri/r600/r700_chip.h +++ b/src/mesa/drivers/dri/r600/r700_chip.h @@ -61,13 +61,13 @@ #define ASIC_CTL_CONST_BASE_INDEX 0xF3FC -enum +enum { SQ_ABSOLUTE = 0x00000000, SQ_RELATIVE = 0x00000001, }; -enum +enum { SQ_ALU_SCL_210 = 0x00000000, SQ_ALU_SCL_122 = 0x00000001, @@ -75,13 +75,13 @@ enum SQ_ALU_SCL_221 = 0x00000003, }; -enum +enum { SQ_TEX_UNNORMALIZED = 0x00000000, SQ_TEX_NORMALIZED = 0x00000001, }; -enum +enum { SQ_CF_PIXEL_MRT0 = 0x00000000, SQ_CF_PIXEL_MRT1 = 0x00000001, @@ -106,7 +106,7 @@ enum PGM_RESOURCES__PRIME_CACHE_ON_DRAW_bit = 23, }; -enum +enum { TEX_XYFilter_Point = 0x00000000, TEX_XYFilter_Linear = 0x00000001, @@ -118,7 +118,7 @@ enum TEX_MipFilter_Linear = 0x00000002, }; -enum +enum { SQ_EXPORT_WRITE = 0x00000000, SQ_EXPORT_WRITE_IND = 0x00000001, @@ -148,7 +148,7 @@ enum #define PM4_OPCODE_SET_SAMPLER (R700_PM4_PACKET3_NOP | (IT_SET_SAMPLER << 8)) #define PM4_OPCODE_CONTEXT_CONTROL (R700_PM4_PACKET3_NOP | (IT_CONTEXT_CONTROL << 8)) -union UINT_FLOAT +union UINT_FLOAT { unsigned int u32All; float f32All; diff --git a/src/mesa/drivers/dri/r600/r700_clear.c b/src/mesa/drivers/dri/r600/r700_clear.c index 853dec9..5cec98b 100644 --- a/src/mesa/drivers/dri/r600/r700_clear.c +++ b/src/mesa/drivers/dri/r600/r700_clear.c @@ -24,7 +24,7 @@ * Richard Li , * CooperYuan , */ - + #include "main/glheader.h" #include "main/context.h" #include "main/macros.h" diff --git a/src/mesa/drivers/dri/r600/r700_fragprog.c b/src/mesa/drivers/dri/r600/r700_fragprog.c index 2a6a39d..a59ce1a 100644 --- a/src/mesa/drivers/dri/r600/r700_fragprog.c +++ b/src/mesa/drivers/dri/r600/r700_fragprog.c @@ -62,7 +62,7 @@ void insert_wpos_code(struct gl_context *ctx, struct gl_fragment_program *fprog) inst = fprog->Base.Instructions; for (i = 0; i < fprog->Base.NumInstructions; i++) { for (j=0; j < 3; j++) { - if(inst->SrcReg[j].File == PROGRAM_INPUT && + if(inst->SrcReg[j].File == PROGRAM_INPUT && inst->SrcReg[j].Index == FRAG_ATTRIB_WPOS) { inst->SrcReg[j].File = PROGRAM_TEMPORARY; inst->SrcReg[j].Index = wpos_temp; @@ -95,7 +95,7 @@ void insert_wpos_code(struct gl_context *ctx, struct gl_fragment_program *fprog) //TODO : Validate FP input with VP output. void Map_Fragment_Program(r700_AssemblerBase *pAsm, struct gl_fragment_program *mesa_fp, - struct gl_context *ctx) + struct gl_context *ctx) { unsigned int unBit; unsigned int i; @@ -104,10 +104,10 @@ void Map_Fragment_Program(r700_AssemblerBase *pAsm, struct r700_vertex_program_cont *vpc = (struct r700_vertex_program_cont *)ctx->VertexProgram._Current; GLbitfield OutputsWritten = vpc->mesa_program.Base.OutputsWritten; - + pAsm->number_used_registers = 0; -//Input mapping : mesa_fp->Base.InputsRead set the flag, set in +//Input mapping : mesa_fp->Base.InputsRead set the flag, set in //The flags parsed in parse_attrib_binding. FRAG_ATTRIB_COLx, FRAG_ATTRIB_TEXx, ... //MUST match order in Map_Vertex_Output unBit = 1 << FRAG_ATTRIB_WPOS; @@ -142,8 +142,8 @@ void Map_Fragment_Program(r700_AssemblerBase *pAsm, pAsm->uiFP_AttributeMap[FRAG_ATTRIB_TEX0 + i] = pAsm->number_used_registers++; } } - -/* order has been taken care of */ + +/* order has been taken care of */ #if 1 for(i=VERT_RESULT_VAR0; iParameters + j; for(k=0; kNumParameters; k++) - { + { pVsParam = VsVarying->Parameters + k; if( strcmp(pPsParam->Name, pVsParam->Name) == 0) { - pAsm->uiFP_AttributeMap[i] = pAsm->number_used_registers + k; + pAsm->uiFP_AttributeMap[i] = pAsm->number_used_registers + k; if(k > unMaxVarying) { unMaxVarying = k; @@ -305,7 +305,7 @@ GLboolean Find_Instruction_Dependencies_fp(struct r700_fragment_program *fp, fp->r700AsmCode.pInstDeps = pInstDeps; - //Find dep for tex inst + //Find dep for tex inst for(i=0; iBase.NumInstructions; i++) { pILInst = &(mesa_fp->Base.Instructions[i]); @@ -339,7 +339,7 @@ GLboolean Find_Instruction_Dependencies_fp(struct r700_fragment_program *fp, { pInstDeps[nDepInstID].nDstDep = i; } - + } } @@ -353,9 +353,9 @@ GLboolean Find_Instruction_Dependencies_fp(struct r700_fragment_program *fp, GLboolean r700TranslateFragmentShader(struct r700_fragment_program *fp, struct gl_fragment_program *mesa_fp, - struct gl_context *ctx) + struct gl_context *ctx) { - context_t *context = R700_CONTEXT(ctx); + context_t *context = R700_CONTEXT(ctx); R700_CHIP_CONTEXT *r700 = (R700_CHIP_CONTEXT*)(&context->hw); GLuint number_of_colors_exported; @@ -395,14 +395,14 @@ GLboolean r700TranslateFragmentShader(struct r700_fragment_program *fp, { shadow_unit = inst->TexSrcUnit; shadow_ambient[2] = shadow_unit; - fp->r700AsmCode.shadow_regs[shadow_unit] = + fp->r700AsmCode.shadow_regs[shadow_unit] = _mesa_add_state_reference(mesa_fp->Base.Parameters, shadow_ambient); } inst++; } } - Map_Fragment_Program(&(fp->r700AsmCode), mesa_fp, ctx); + Map_Fragment_Program(&(fp->r700AsmCode), mesa_fp, ctx); if( GL_FALSE == Find_Instruction_Dependencies_fp(fp, mesa_fp) ) { @@ -410,7 +410,7 @@ GLboolean r700TranslateFragmentShader(struct r700_fragment_program *fp, } InitShaderProgram(&(fp->r700AsmCode)); - + for(i=0; i < MAX_SAMPLERS; i++) { fp->r700AsmCode.SamplerUnits[i] = fp->mesa_program.Base.SamplerUnits[i]; @@ -421,7 +421,7 @@ GLboolean r700TranslateFragmentShader(struct r700_fragment_program *fp, if( GL_FALSE == AssembleInstr(0, 0, mesa_fp->Base.NumInstructions, - &(mesa_fp->Base.Instructions[0]), + &(mesa_fp->Base.Instructions[0]), &(fp->r700AsmCode)) ) { return GL_FALSE; @@ -437,7 +437,7 @@ GLboolean r700TranslateFragmentShader(struct r700_fragment_program *fp, return GL_FALSE; } - fp->r700Shader.nRegs = (fp->r700AsmCode.number_used_registers == 0) ? 0 + fp->r700Shader.nRegs = (fp->r700AsmCode.number_used_registers == 0) ? 0 : (fp->r700AsmCode.number_used_registers - 1); fp->r700Shader.nParamExports = fp->r700AsmCode.number_of_exports; @@ -477,7 +477,7 @@ void r700SelectFragmentShader(struct gl_context *ctx) } if (GL_FALSE == fp->translated) - r700TranslateFragmentShader(fp, &(fp->mesa_program), ctx); + r700TranslateFragmentShader(fp, &(fp->mesa_program), ctx); } void * r700GetActiveFpShaderBo(struct gl_context * ctx) @@ -634,7 +634,7 @@ GLboolean r700SetupFragmentProgram(struct gl_context * ctx) struct r700_vertex_program_cont *vpc = (struct r700_vertex_program_cont *)ctx->VertexProgram._Current; GLbitfield OutputsWritten = vpc->mesa_program.Base.OutputsWritten; - + for(ui = 0; ui < R700_MAX_SHADER_EXPORTS; ui++) r700->SPI_PS_INPUT_CNTL[ui].u32All = 0; @@ -764,7 +764,7 @@ GLboolean r700SetupFragmentProgram(struct gl_context * ctx) /* sent out shader constants. */ paramList = fp->mesa_program.Base.Parameters; - if(NULL != paramList) + if(NULL != paramList) { _mesa_load_state_parameters(ctx, paramList); diff --git a/src/mesa/drivers/dri/r600/r700_fragprog.h b/src/mesa/drivers/dri/r600/r700_fragprog.h index bdb95ff..2275a8b 100644 --- a/src/mesa/drivers/dri/r600/r700_fragprog.h +++ b/src/mesa/drivers/dri/r600/r700_fragprog.h @@ -55,13 +55,13 @@ void insert_wpos_code(struct gl_context *ctx, struct gl_fragment_program *fprog) void Map_Fragment_Program(r700_AssemblerBase *pAsm, struct gl_fragment_program *mesa_fp, - struct gl_context *ctx); + struct gl_context *ctx); GLboolean Find_Instruction_Dependencies_fp(struct r700_fragment_program *fp, struct gl_fragment_program *mesa_fp); GLboolean r700TranslateFragmentShader(struct r700_fragment_program *fp, struct gl_fragment_program *mesa_vp, - struct gl_context *ctx); + struct gl_context *ctx); /* Interface */ extern void r700SelectFragmentShader(struct gl_context *ctx); diff --git a/src/mesa/drivers/dri/r600/r700_oglprog.c b/src/mesa/drivers/dri/r600/r700_oglprog.c index 6ca7458..b356a64 100644 --- a/src/mesa/drivers/dri/r600/r700_oglprog.c +++ b/src/mesa/drivers/dri/r600/r700_oglprog.c @@ -57,14 +57,14 @@ static void freeVertProgCache(struct gl_context *ctx, struct r700_vertex_program /* Clean up */ Clean_Up_Assembler(&(vp->r700AsmCode)); Clean_Up_Shader(&(vp->r700Shader)); - + _mesa_reference_vertprog(ctx, &vp->mesa_program, NULL); free(vp); vp = tmp; } } -static struct gl_program *r700NewProgram(struct gl_context * ctx, +static struct gl_program *r700NewProgram(struct gl_context * ctx, GLenum target, GLuint id) { @@ -76,23 +76,23 @@ static struct gl_program *r700NewProgram(struct gl_context * ctx, radeon_print(RADEON_SHADER, RADEON_VERBOSE, "%s %u, %u\n", __func__, target, id); - switch (target) + switch (target) { case GL_VERTEX_STATE_PROGRAM_NV: - case GL_VERTEX_PROGRAM_ARB: + case GL_VERTEX_PROGRAM_ARB: vpc = CALLOC_STRUCT(r700_vertex_program_cont); - pProgram = _mesa_init_vertex_program(ctx, + pProgram = _mesa_init_vertex_program(ctx, &vpc->mesa_program, - target, + target, id); - + break; case GL_FRAGMENT_PROGRAM_NV: case GL_FRAGMENT_PROGRAM_ARB: fp = CALLOC_STRUCT(r700_fragment_program); - pProgram = _mesa_init_fragment_program(ctx, + pProgram = _mesa_init_fragment_program(ctx, &fp->mesa_program, - target, + target, id); fp->translated = GL_FALSE; fp->loaded = GL_FALSE; @@ -117,10 +117,10 @@ static void r700DeleteProgram(struct gl_context * ctx, struct gl_program *prog) radeon_print(RADEON_SHADER, RADEON_VERBOSE, "%s %p\n", __func__, prog); - switch (prog->Target) + switch (prog->Target) { case GL_VERTEX_STATE_PROGRAM_NV: - case GL_VERTEX_PROGRAM_ARB: + case GL_VERTEX_PROGRAM_ARB: freeVertProgCache(ctx, vpc); break; case GL_FRAGMENT_PROGRAM_NV: @@ -173,7 +173,7 @@ r700ProgramStringNotify(struct gl_context * ctx, GLenum target, struct gl_progra fp->shaderbo = NULL; break; } - + /* XXX check if program is legal, within limits */ return GL_TRUE; } diff --git a/src/mesa/drivers/dri/r600/r700_render.c b/src/mesa/drivers/dri/r600/r700_render.c index bb14a23..3b018da 100644 --- a/src/mesa/drivers/dri/r600/r700_render.c +++ b/src/mesa/drivers/dri/r600/r700_render.c @@ -501,8 +501,8 @@ static GLuint r700PredictRenderSize(struct gl_context* ctx, * Convert attribute data type to float * If the attribute uses named buffer object replace the bo with newly allocated bo */ -static void r700ConvertAttrib(struct gl_context *ctx, int count, - const struct gl_client_array *input, +static void r700ConvertAttrib(struct gl_context *ctx, int count, + const struct gl_client_array *input, struct StreamDesc *attr) { context_t *context = R700_CONTEXT(ctx); @@ -519,22 +519,22 @@ static void r700ConvertAttrib(struct gl_context *ctx, int count, count = 1; } - if (input->BufferObj->Name) + if (input->BufferObj->Name) { - if (!input->BufferObj->Pointer) + if (!input->BufferObj->Pointer) { ctx->Driver.MapBuffer(ctx, GL_ARRAY_BUFFER, GL_READ_ONLY_ARB, input->BufferObj); mapped_named_bo = GL_TRUE; } src_ptr = ADD_POINTERS(input->BufferObj->Pointer, input->Ptr); - } - else + } + else { src_ptr = input->Ptr; } - radeonAllocDmaRegion(&context->radeon, &attr->bo, &attr->bo_offset, + radeonAllocDmaRegion(&context->radeon, &attr->bo, &attr->bo_offset, sizeof(GLfloat) * input->Size * count, 32); radeon_bo_map(attr->bo, 1); @@ -543,7 +543,7 @@ static void r700ConvertAttrib(struct gl_context *ctx, int count, assert(src_ptr != NULL); - switch (input->Type) + switch (input->Type) { case GL_DOUBLE: CONVERT(GLdouble, (GLfloat)); @@ -574,15 +574,15 @@ static void r700ConvertAttrib(struct gl_context *ctx, int count, radeon_bo_unmap(attr->bo); - if (mapped_named_bo) + if (mapped_named_bo) { ctx->Driver.UnmapBuffer(ctx, GL_ARRAY_BUFFER, input->BufferObj); } } -static void r700AlignDataToDword(struct gl_context *ctx, - const struct gl_client_array *input, - int count, +static void r700AlignDataToDword(struct gl_context *ctx, + const struct gl_client_array *input, + int count, struct StreamDesc *attr) { context_t *context = R700_CONTEXT(ctx); @@ -594,7 +594,7 @@ static void r700AlignDataToDword(struct gl_context *ctx, radeon_bo_map(attr->bo, 1); - if (!input->BufferObj->Pointer) + if (!input->BufferObj->Pointer) { ctx->Driver.MapBuffer(ctx, GL_ARRAY_BUFFER, GL_READ_ONLY_ARB, input->BufferObj); mapped_named_bo = GL_TRUE; @@ -605,7 +605,7 @@ static void r700AlignDataToDword(struct gl_context *ctx, GLvoid *dst_ptr = ADD_POINTERS(attr->bo->ptr, attr->bo_offset); int i; - for (i = 0; i < count; ++i) + for (i = 0; i < count; ++i) { memcpy(dst_ptr, src_ptr, input->StrideB); src_ptr += input->StrideB; @@ -614,7 +614,7 @@ static void r700AlignDataToDword(struct gl_context *ctx, } radeon_bo_unmap(attr->bo); - if (mapped_named_bo) + if (mapped_named_bo) { ctx->Driver.UnmapBuffer(ctx, GL_ARRAY_BUFFER, input->BufferObj); } @@ -631,7 +631,7 @@ static void r700SetupStreams(struct gl_context *ctx, const struct gl_client_arra R600_STATECHANGE(context, vtx); - for(index = 0; index < context->nNumActiveAos; index++) + for(index = 0; index < context->nNumActiveAos; index++) { struct radeon_aos *aos = &context->radeon.tcl.aos[index]; i = context->stream_desc[index].element; @@ -642,62 +642,62 @@ static void r700SetupStreams(struct gl_context *ctx, const struct gl_client_arra #if MESA_BIG_ENDIAN || getTypeSize(input[i]->Type) != 4 #endif - ) + ) { assert(count); r700ConvertAttrib(ctx, count, input[i], &context->stream_desc[index]); - } - else + } + else { - if (input[i]->BufferObj->Name) + if (input[i]->BufferObj->Name) { context->stream_desc[index].stride = input[i]->StrideB; context->stream_desc[index].bo_offset = (intptr_t) input[i]->Ptr; context->stream_desc[index].bo = get_radeon_buffer_object(input[i]->BufferObj)->bo; context->stream_desc[index].is_named_bo = GL_TRUE; - } - else + } + else { int size; int local_count = count; uint32_t *dst; - if (input[i]->StrideB == 0) + if (input[i]->StrideB == 0) { size = getTypeSize(input[i]->Type) * input[i]->Size; local_count = 1; - } - else + } + else { size = getTypeSize(input[i]->Type) * input[i]->Size * local_count; } - radeonAllocDmaRegion(&context->radeon, &context->stream_desc[index].bo, + radeonAllocDmaRegion(&context->radeon, &context->stream_desc[index].bo, &context->stream_desc[index].bo_offset, size, 32); radeon_bo_map(context->stream_desc[index].bo, 1); assert(context->stream_desc[index].bo->ptr != NULL); - dst = (uint32_t *)ADD_POINTERS(context->stream_desc[index].bo->ptr, + dst = (uint32_t *)ADD_POINTERS(context->stream_desc[index].bo->ptr, context->stream_desc[index].bo_offset); - switch (context->stream_desc[index].dwords) + switch (context->stream_desc[index].dwords) { - case 1: + case 1: radeonEmitVec4(dst, input[i]->Ptr, input[i]->StrideB, local_count); break; - case 2: - radeonEmitVec8(dst, input[i]->Ptr, input[i]->StrideB, local_count); + case 2: + radeonEmitVec8(dst, input[i]->Ptr, input[i]->StrideB, local_count); break; - case 3: - radeonEmitVec12(dst, input[i]->Ptr, input[i]->StrideB, local_count); + case 3: + radeonEmitVec12(dst, input[i]->Ptr, input[i]->StrideB, local_count); break; - case 4: - radeonEmitVec16(dst, input[i]->Ptr, input[i]->StrideB, local_count); + case 4: + radeonEmitVec16(dst, input[i]->Ptr, input[i]->StrideB, local_count); break; - default: - assert(0); + default: + assert(0); break; } radeon_bo_unmap(context->stream_desc[index].bo); @@ -710,17 +710,17 @@ static void r700SetupStreams(struct gl_context *ctx, const struct gl_client_arra aos->bo = context->stream_desc[index].bo; aos->offset = context->stream_desc[index].bo_offset; - if(context->stream_desc[index].is_named_bo) + if(context->stream_desc[index].is_named_bo) { - radeon_cs_space_add_persistent_bo(context->radeon.cmdbuf.cs, - context->stream_desc[index].bo, + radeon_cs_space_add_persistent_bo(context->radeon.cmdbuf.cs, + context->stream_desc[index].bo, RADEON_GEM_DOMAIN_GTT, 0); } } - ret = radeon_cs_space_check_with_bo(context->radeon.cmdbuf.cs, - first_elem(&context->radeon.dma.reserved)->bo, - RADEON_GEM_DOMAIN_GTT, 0); + ret = radeon_cs_space_check_with_bo(context->radeon.cmdbuf.cs, + first_elem(&context->radeon.dma.reserved)->bo, + RADEON_GEM_DOMAIN_GTT, 0); } static void r700FreeData(struct gl_context *ctx) @@ -994,7 +994,7 @@ static void r700DrawPrims(struct gl_context *ctx, if (!vbo_all_varyings_in_vbos(arrays)) { if (!index_bounds_valid) vbo_get_minmax_index(ctx, prim, ib, &min_index, &max_index); - /* do we want to rebase, minimizes the + /* do we want to rebase, minimizes the * amount of data to upload? */ if (min_index) { vbo_rebase_prims( ctx, arrays, prim, nr_prims, ib, min_index, max_index, r700DrawPrims ); diff --git a/src/mesa/drivers/dri/r600/r700_shader.c b/src/mesa/drivers/dri/r600/r700_shader.c index cbbfaed..c514d6a 100644 --- a/src/mesa/drivers/dri/r600/r700_shader.c +++ b/src/mesa/drivers/dri/r600/r700_shader.c @@ -70,7 +70,7 @@ void TakeInstOutFromList(TypedShaderList * plstCFInstructions, R700ShaderInstruc while(NULL != pCurInst) { if(pCurInst == pInst) - { + { bFound = GL_TRUE; break; } @@ -129,7 +129,7 @@ void Init_R700_Shader(R700_Shader * pShader) pShader->miscVectorIsExported = GL_FALSE; pShader->renderTargetArrayIndexIsExported = GL_FALSE; pShader->ccDist0VectorIsExported = GL_FALSE; - pShader->ccDist1VectorIsExported = GL_FALSE; + pShader->ccDist1VectorIsExported = GL_FALSE; pShader->depthIsExported = GL_FALSE; @@ -143,18 +143,18 @@ void Init_R700_Shader(R700_Shader * pShader) pShader->uMaxCallDepth = 0; pShader->bSurfAllocated = GL_FALSE; - - pShader->lstCFInstructions.pHead=NULL; - pShader->lstCFInstructions.pTail=NULL; + + pShader->lstCFInstructions.pHead=NULL; + pShader->lstCFInstructions.pTail=NULL; pShader->lstCFInstructions.uNumOfNode=0; - pShader->lstALUInstructions.pHead=NULL; - pShader->lstALUInstructions.pTail=NULL; + pShader->lstALUInstructions.pHead=NULL; + pShader->lstALUInstructions.pTail=NULL; pShader->lstALUInstructions.uNumOfNode=0; - pShader->lstTEXInstructions.pHead=NULL; - pShader->lstTEXInstructions.pTail=NULL; + pShader->lstTEXInstructions.pHead=NULL; + pShader->lstTEXInstructions.pTail=NULL; pShader->lstTEXInstructions.uNumOfNode=0; - pShader->lstVTXInstructions.pHead=NULL; - pShader->lstVTXInstructions.pTail=NULL; + pShader->lstVTXInstructions.pHead=NULL; + pShader->lstVTXInstructions.pTail=NULL; pShader->lstVTXInstructions.uNumOfNode=0; } @@ -165,16 +165,16 @@ void SetActiveCFlist(R700_Shader *pShader, TypedShaderList * plstCF) void AddCFInstruction(R700_Shader *pShader, R700ControlFlowInstruction *pCFInst) { - R700ControlFlowSXClause* pSXClause; + R700ControlFlowSXClause* pSXClause; R700ControlFlowSMXClause* pSMXClause; pCFInst->m_uIndex = pShader->plstCFInstructions_active->uNumOfNode; - AddInstToList(pShader->plstCFInstructions_active, + AddInstToList(pShader->plstCFInstructions_active, (R700ShaderInstruction*)pCFInst); pShader->uShaderBinaryDWORDSize += GetInstructionSize(pCFInst->m_ShaderInstType); pSXClause = NULL; - pSMXClause = NULL; + pSMXClause = NULL; switch (pCFInst->m_ShaderInstType) { case SIT_CF_ALL_EXP_SX: @@ -206,13 +206,13 @@ void AddCFInstruction(R700_Shader *pShader, R700ControlFlowInstruction *pCFInst) void AddVTXInstruction(R700_Shader *pShader, R700VertexInstruction *pVTXInst) { pVTXInst->m_uIndex = pShader->lstVTXInstructions.uNumOfNode; - AddInstToList(&(pShader->lstVTXInstructions), + AddInstToList(&(pShader->lstVTXInstructions), (R700ShaderInstruction*)pVTXInst); pShader->uShaderBinaryDWORDSize += GetInstructionSize(pVTXInst->m_ShaderInstType); if(pVTXInst->m_ShaderInstType == SIT_VTX_GENERIC) { - R700VertexGenericFetch* pVTXGenericClause = (R700VertexGenericFetch*)pVTXInst; + R700VertexGenericFetch* pVTXGenericClause = (R700VertexGenericFetch*)pVTXInst; pShader->nRegs = (pShader->nRegs < pVTXGenericClause->m_Word1_GPR.f.dst_gpr) ? pVTXGenericClause->m_Word1_GPR.f.dst_gpr : pShader->nRegs; } @@ -225,7 +225,7 @@ void AddVTXInstruction(R700_Shader *pShader, R700VertexInstruction *pVTXInst) void AddTEXInstruction(R700_Shader *pShader, R700TextureInstruction *pTEXInst) { pTEXInst->m_uIndex = pShader->lstTEXInstructions.uNumOfNode; - AddInstToList(&(pShader->lstTEXInstructions), + AddInstToList(&(pShader->lstTEXInstructions), (R700ShaderInstruction*)pTEXInst); pShader->uShaderBinaryDWORDSize += GetInstructionSize(pTEXInst->m_ShaderInstType); @@ -240,7 +240,7 @@ void AddTEXInstruction(R700_Shader *pShader, R700TextureInstruction *pTEXInst) void AddALUInstruction(R700_Shader *pShader, R700ALUInstruction *pALUInst) { pALUInst->m_uIndex = pShader->lstALUInstructions.uNumOfNode; - AddInstToList(&(pShader->lstALUInstructions), + AddInstToList(&(pShader->lstALUInstructions), (R700ShaderInstruction*)pALUInst); pShader->uShaderBinaryDWORDSize += GetInstructionSize(pALUInst->m_ShaderInstType); @@ -258,11 +258,11 @@ void ResolveLinks(R700_Shader *pShader) R700ShaderInstruction *pInst; R700ALUInstruction *pALUinst; R700TextureInstruction *pTEXinst; - R700VertexInstruction *pVTXinst; + R700VertexInstruction *pVTXinst; GLuint vtxOffset; - GLuint cfOffset = 0x0; + GLuint cfOffset = 0x0; GLuint aluOffset = cfOffset + pShader->lstCFInstructions.uNumOfNode * GetInstructionSize(SIT_CF); @@ -275,10 +275,10 @@ void ResolveLinks(R700_Shader *pShader) pInst = pInst->pNextInst; }; - + vtxOffset = texOffset + pShader->lstTEXInstructions.uNumOfNode * GetInstructionSize(SIT_TEX); - if ( ((pShader->lstTEXInstructions.uNumOfNode > 0) && (texOffset % 4 != 0)) || + if ( ((pShader->lstTEXInstructions.uNumOfNode > 0) && (texOffset % 4 != 0)) || ((pShader->lstVTXInstructions.uNumOfNode > 0) && (vtxOffset % 4 != 0)) ) { pALUinst = (R700ALUInstruction*) CALLOC_STRUCT(R700ALUInstruction); @@ -357,15 +357,15 @@ void Assemble(R700_Shader *pShader) return; } - if(pShader->bLinksDirty == GL_TRUE) + if(pShader->bLinksDirty == GL_TRUE) { ResolveLinks(pShader); } size_of_program = pShader->uShaderBinaryDWORDSize; - + pShaderBinary = (GLuint*) MALLOC(sizeof(GLuint)*size_of_program); - + pCurrPos = pShaderBinary; for (i = 0; i < size_of_program; i++) @@ -378,28 +378,28 @@ void Assemble(R700_Shader *pShader) { switch (pInst->m_ShaderInstType) { - case SIT_CF_GENERIC: + case SIT_CF_GENERIC: { R700ControlFlowGenericClause* pCFgeneric = (R700ControlFlowGenericClause*)pInst; *pCurrPos++ = pCFgeneric->m_Word0.val; *pCurrPos++ = pCFgeneric->m_Word1.val; } break; - case SIT_CF_ALU: + case SIT_CF_ALU: { R700ControlFlowALUClause* pCFalu = (R700ControlFlowALUClause*)pInst; *pCurrPos++ = pCFalu->m_Word0.val; *pCurrPos++ = pCFalu->m_Word1.val; } break; - case SIT_CF_ALL_EXP_SX: + case SIT_CF_ALL_EXP_SX: { R700ControlFlowSXClause* pCFsx = (R700ControlFlowSXClause*)pInst; *pCurrPos++ = pCFsx->m_Word0.val; *pCurrPos++ = (pCFsx->m_Word1.val | pCFsx->m_Word1_SWIZ.val); } break; - case SIT_CF_ALL_EXP_SMX: + case SIT_CF_ALL_EXP_SMX: { R700ControlFlowSMXClause* pCFsmx = (R700ControlFlowSMXClause*)pInst; *pCurrPos++ = pCFsmx->m_Word0.val; @@ -412,14 +412,14 @@ void Assemble(R700_Shader *pShader) pInst = pInst->pNextInst; }; - + number_of_alu_dwords = 0; pInst = pShader->lstALUInstructions.pHead; while(NULL != pInst) { switch (pInst->m_ShaderInstType) { - case SIT_ALU: + case SIT_ALU: { R700ALUInstruction* pALU = (R700ALUInstruction*)pInst; @@ -429,7 +429,7 @@ void Assemble(R700_Shader *pShader) number_of_alu_dwords += 2; } break; - case SIT_ALU_HALF_LIT: + case SIT_ALU_HALF_LIT: { R700ALUInstructionHalfLiteral* pALUhalf = (R700ALUInstructionHalfLiteral*)pInst; @@ -441,7 +441,7 @@ void Assemble(R700_Shader *pShader) number_of_alu_dwords += 4; } break; - case SIT_ALU_FALL_LIT: + case SIT_ALU_FALL_LIT: { R700ALUInstructionFullLiteral* pALUfull = (R700ALUInstructionFullLiteral*)pInst; @@ -462,7 +462,7 @@ void Assemble(R700_Shader *pShader) pInst = pInst->pNextInst; }; - + pInst = pShader->lstTEXInstructions.pHead; while(NULL != pInst) { @@ -475,7 +475,7 @@ void Assemble(R700_Shader *pShader) pInst = pInst->pNextInst; }; - + pInst = pShader->lstVTXInstructions.pHead; while(NULL != pInst) { @@ -515,7 +515,7 @@ void Assemble(R700_Shader *pShader) pShader->pProgram = (GLubyte*)pShaderBinary; end_of_cf_instructions = pShader->uCFOffset + pShader->lstCFInstructions.uNumOfNode * GetInstructionSize(SIT_CF); - + pShader->uEndOfCF = end_of_cf_instructions >> 1; pShader->uEndOfALU = (end_of_cf_instructions + number_of_alu_dwords) >> 1; @@ -551,14 +551,14 @@ void cleanup_vfetch_shaderinst(R700_Shader *pShader) pInst = pShader->lstVTXInstructions.pHead; while(NULL != pInst) { - pVTXInst = (R700VertexInstruction *)pInst; + pVTXInst = (R700VertexInstruction *)pInst; pShader->uShaderBinaryDWORDSize -= GetInstructionSize(pVTXInst->m_ShaderInstType); if(NULL != pVTXInst->m_pLinkedGenericClause) { pCFInst = (R700ControlFlowInstruction*)(pVTXInst->m_pLinkedGenericClause); - TakeInstOutFromList(&(pShader->lstCFInstructions), + TakeInstOutFromList(&(pShader->lstCFInstructions), (R700ShaderInstruction*)pCFInst); pShader->uShaderBinaryDWORDSize -= GetInstructionSize(pCFInst->m_ShaderInstType); @@ -577,8 +577,8 @@ void cleanup_vfetch_shaderinst(R700_Shader *pShader) }; //set NULL pShader->lstVTXInstructions - pShader->lstVTXInstructions.pHead=NULL; - pShader->lstVTXInstructions.pTail=NULL; + pShader->lstVTXInstructions.pHead=NULL; + pShader->lstVTXInstructions.pTail=NULL; pShader->lstVTXInstructions.uNumOfNode=0; } diff --git a/src/mesa/drivers/dri/r600/r700_shader.h b/src/mesa/drivers/dri/r600/r700_shader.h index 183dd33..8c6096e 100644 --- a/src/mesa/drivers/dri/r600/r700_shader.h +++ b/src/mesa/drivers/dri/r600/r700_shader.h @@ -45,14 +45,14 @@ typedef enum R700ShaderType R700_SHADER_INVALID = 0x5, } R700ShaderType; -typedef struct TypedShaderList +typedef struct TypedShaderList { R700ShaderInstruction * pHead; R700ShaderInstruction * pTail; GLuint uNumOfNode; } TypedShaderList; -typedef struct RealRegister +typedef struct RealRegister { GLuint uAddr; GLuint uValue; @@ -64,7 +64,7 @@ typedef struct InstDeps GLint nSrcDeps[3]; } InstDeps; -typedef struct R700_Shader +typedef struct R700_Shader { R700ShaderType Type; @@ -76,30 +76,30 @@ typedef struct R700_Shader GLboolean bLinksDirty; GLuint uShaderBinaryDWORDSize; // in DWORDS - GLuint nRegs; + GLuint nRegs; GLuint nParamExports; // VS_ EXPORT_COUNT (1 based, the actual register is 0 based!) - GLuint nMemExports; + GLuint nMemExports; GLuint resource; // VS and PS _RESOURCE GLuint exportMode; // VS and PS _EXPORT_MODE - GLboolean depthIsImported; + GLboolean depthIsImported; // Vertex program exports - GLboolean positionVectorIsExported; + GLboolean positionVectorIsExported; - GLboolean miscVectorIsExported; - GLboolean renderTargetArrayIndexIsExported; + GLboolean miscVectorIsExported; + GLboolean renderTargetArrayIndexIsExported; - GLboolean ccDist0VectorIsExported; - GLboolean ccDist1VectorIsExported; + GLboolean ccDist0VectorIsExported; + GLboolean ccDist1VectorIsExported; // Pixel program exports - GLboolean depthIsExported; - GLboolean stencilRefIsExported; - GLboolean coverageToMaskIsExported; - GLboolean maskIsExported; + GLboolean depthIsExported; + GLboolean stencilRefIsExported; + GLboolean coverageToMaskIsExported; + GLboolean maskIsExported; - GLboolean killIsUsed; + GLboolean killIsUsed; GLuint uStartAddr; GLuint uCFOffset; @@ -123,7 +123,7 @@ typedef struct R700_Shader // -------- constants GLfloat ConstantArray[SQ_ALU_CONSTANT_PS_COUNT * 4]; - + GLboolean bSurfAllocated; } R700_Shader; diff --git a/src/mesa/drivers/dri/r600/r700_shaderinst.c b/src/mesa/drivers/dri/r600/r700_shaderinst.c index f120d9f..d9b5656 100644 --- a/src/mesa/drivers/dri/r600/r700_shaderinst.c +++ b/src/mesa/drivers/dri/r600/r700_shaderinst.c @@ -172,11 +172,11 @@ unsigned int GetInstructionSize(ShaderInstType instType) { switch(instType) { - case SIT_ALU_HALF_LIT: - case SIT_TEX: - case SIT_VTX: - case SIT_VTX_GENERIC: - case SIT_VTX_SEM: + case SIT_ALU_HALF_LIT: + case SIT_TEX: + case SIT_VTX: + case SIT_VTX_GENERIC: + case SIT_VTX_SEM: return 4; case SIT_ALU_FALL_LIT: return 6; @@ -191,9 +191,9 @@ unsigned int GetCFMaxInstructions(ShaderInstType instType) { switch (instType) { - case SIT_CF_ALL_EXP: - case SIT_CF_ALL_EXP_SX: - case SIT_CF_ALL_EXP_SMX: + case SIT_CF_ALL_EXP: + case SIT_CF_ALL_EXP_SX: + case SIT_CF_ALL_EXP_SMX: return 0x10; case SIT_CF_GENERIC: return 0x8; //For tex and vtx diff --git a/src/mesa/drivers/dri/r600/r700_shaderinst.h b/src/mesa/drivers/dri/r600/r700_shaderinst.h index cdb9a57..c1fb2fe 100644 --- a/src/mesa/drivers/dri/r600/r700_shaderinst.h +++ b/src/mesa/drivers/dri/r600/r700_shaderinst.h @@ -30,7 +30,7 @@ #include "main/glheader.h" -#include "defaultendian.h" +#include "defaultendian.h" #include "sq_micro_reg.h" #define SQ_ALU_CONSTANT_PS_OFFSET 0x00000000 @@ -54,7 +54,7 @@ #define SHADERINST_TYPEMASK_TEX 0x40 #define SHADERINST_TYPEMASK_VTX 0x80 -typedef enum ShaderInstType +typedef enum ShaderInstType { SIT_CF = 0x10, /*SIZE = 0x2*/ SIT_CF_ALL_EXP = 0x14, /*SIZE = 0x2, MAX_INSTRUCTIONS = 0x10;*/ @@ -71,7 +71,7 @@ typedef enum ShaderInstType SIT_VTX_SEM = 0x82 /*SIZE = 0x4, MEGA_FETCH_BYTES = 0x20*/ } ShaderInstType; -typedef struct R700ShaderInstruction +typedef struct R700ShaderInstruction { ShaderInstType m_ShaderInstType; struct R700ShaderInstruction *pNextInst; @@ -83,23 +83,23 @@ typedef struct R700ShaderInstruction typedef R700ShaderInstruction R700ControlFlowInstruction; -typedef struct R700ControlFlowAllocExportClause +typedef struct R700ControlFlowAllocExportClause { ShaderInstType m_ShaderInstType; - R700ShaderInstruction * pNextInst; + R700ShaderInstruction * pNextInst; GLuint m_uIndex; GLuint useCount; - + sq_cf_alloc_export_word0_u m_Word0; sq_cf_alloc_export_word1_u m_Word1; } R700ControlFlowAllocExportClause; -typedef struct R700ControlFlowSXClause +typedef struct R700ControlFlowSXClause { ShaderInstType m_ShaderInstType; R700ShaderInstruction * pNextInst; //R700ControlFlowAllocExportClause - //R700ControlFlowInstruction + //R700ControlFlowInstruction //R700ShaderInstruction GLuint m_uIndex; GLuint useCount; @@ -112,12 +112,12 @@ typedef struct R700ControlFlowSXClause sq_cf_alloc_export_word1_swiz_u m_Word1_SWIZ; } R700ControlFlowSXClause; -typedef struct R700ControlFlowSMXClause +typedef struct R700ControlFlowSMXClause { ShaderInstType m_ShaderInstType; R700ShaderInstruction * pNextInst; //R700ControlFlowAllocExportClause - //R700ControlFlowInstruction + //R700ControlFlowInstruction //R700ShaderInstruction GLuint m_uIndex; GLuint useCount; @@ -130,7 +130,7 @@ typedef struct R700ControlFlowSMXClause sq_cf_alloc_export_word1_buf_u m_Word1_BUF; } R700ControlFlowSMXClause; -typedef struct R700ControlFlowGenericClause +typedef struct R700ControlFlowGenericClause { ShaderInstType m_ShaderInstType; R700ShaderInstruction * pNextInst; @@ -148,7 +148,7 @@ typedef struct R700ControlFlowGenericClause struct R700TextureInstruction *m_pLinkedTEXInstruction; } R700ControlFlowGenericClause; -typedef struct R700ControlFlowALUClause +typedef struct R700ControlFlowALUClause { ShaderInstType m_ShaderInstType; R700ShaderInstruction * pNextInst; @@ -161,14 +161,14 @@ typedef struct R700ControlFlowALUClause sq_cf_alu_word0_u m_Word0; sq_cf_alu_word1_u m_Word1; - + struct R700ALUInstruction *m_pLinkedALUInstruction; } R700ControlFlowALUClause; // ------------------- End of CF Inst ------------------------ // ------------------- ALU Inst ------------------------------ -typedef struct R700ALUInstruction +typedef struct R700ALUInstruction { ShaderInstType m_ShaderInstType; R700ShaderInstruction * pNextInst; @@ -189,7 +189,7 @@ typedef struct R700ALUInstructionHalfLiteral { ShaderInstType m_ShaderInstType; R700ShaderInstruction * pNextInst; - //R700ALUInstruction + //R700ALUInstruction //R700ShaderInstruction GLuint m_uIndex; GLuint useCount; @@ -207,11 +207,11 @@ typedef struct R700ALUInstructionHalfLiteral m_fLiteralY; } R700ALUInstructionHalfLiteral; -typedef struct R700ALUInstructionFullLiteral +typedef struct R700ALUInstructionFullLiteral { ShaderInstType m_ShaderInstType; R700ShaderInstruction * pNextInst; - //R700ALUInstruction + //R700ALUInstruction //R700ShaderInstruction GLuint m_uIndex; GLuint useCount; @@ -234,7 +234,7 @@ typedef struct R700ALUInstructionFullLiteral // ------------------- Textuer/Vertex Instruction -------------------- -typedef struct R700TextureInstruction +typedef struct R700TextureInstruction { ShaderInstType m_ShaderInstType; R700ShaderInstruction * pNextInst; @@ -242,7 +242,7 @@ typedef struct R700TextureInstruction GLuint m_uIndex; GLuint useCount; //--------------------- - + sq_tex_word0_u m_Word0; sq_tex_word1_u m_Word1; sq_tex_word2_u m_Word2; @@ -250,7 +250,7 @@ typedef struct R700TextureInstruction struct R700ControlFlowGenericClause *m_pLinkedGenericClause; } R700TextureInstruction; -typedef struct R700VertexInstruction +typedef struct R700VertexInstruction { ShaderInstType m_ShaderInstType; R700ShaderInstruction * pNextInst; @@ -258,7 +258,7 @@ typedef struct R700VertexInstruction GLuint m_uIndex; GLuint useCount; //--------------------- - + sq_vtx_word0_u m_Word0; sq_vtx_word1_u m_Word1; sq_vtx_word2_u m_Word2; @@ -266,7 +266,7 @@ typedef struct R700VertexInstruction struct R700ControlFlowGenericClause *m_pLinkedGenericClause; } R700VertexInstruction; // -typedef struct R700VertexSemanticFetch +typedef struct R700VertexSemanticFetch { ShaderInstType m_ShaderInstType; R700ShaderInstruction * pNextInst; @@ -275,7 +275,7 @@ typedef struct R700VertexSemanticFetch GLuint m_uIndex; GLuint useCount; //--------------------- - + sq_vtx_word0_u m_Word0; sq_vtx_word1_u m_Word1; sq_vtx_word2_u m_Word2; @@ -286,7 +286,7 @@ typedef struct R700VertexSemanticFetch sq_vtx_word1_sem_u m_Word1_SEM; } R700VertexSemanticFetch; // -typedef struct R700VertexGenericFetch +typedef struct R700VertexGenericFetch { ShaderInstType m_ShaderInstType; R700ShaderInstruction * pNextInst; @@ -295,7 +295,7 @@ typedef struct R700VertexGenericFetch GLuint m_uIndex; GLuint useCount; //--------------------- - + sq_vtx_word0_u m_Word0; sq_vtx_word1_u m_Word1; sq_vtx_word2_u m_Word2; diff --git a/src/mesa/drivers/dri/r600/r700_state.c b/src/mesa/drivers/dri/r600/r700_state.c index bd04a63..c89398e 100644 --- a/src/mesa/drivers/dri/r600/r700_state.c +++ b/src/mesa/drivers/dri/r600/r700_state.c @@ -1698,8 +1698,8 @@ void r700InitState(struct gl_context * ctx) //------------------- SETbit(r700->PA_SC_MODE_CNTL.u32All, FORCE_EOV_CNTDWN_ENABLE_bit); } - /* Do scale XY and Z by 1/W0. */ - r700->bEnablePerspective = GL_TRUE; + /* Do scale XY and Z by 1/W0. */ + r700->bEnablePerspective = GL_TRUE; CLEARbit(r700->PA_CL_VTE_CNTL.u32All, VTX_XY_FMT_bit); CLEARbit(r700->PA_CL_VTE_CNTL.u32All, VTX_Z_FMT_bit); diff --git a/src/mesa/drivers/dri/r600/r700_vertprog.c b/src/mesa/drivers/dri/r600/r700_vertprog.c index 7ba49d8..3c66930 100644 --- a/src/mesa/drivers/dri/r600/r700_vertprog.c +++ b/src/mesa/drivers/dri/r600/r700_vertprog.c @@ -48,7 +48,7 @@ #include "r700_debug.h" #include "r700_vertprog.h" -unsigned int Map_Vertex_Output(r700_AssemblerBase *pAsm, +unsigned int Map_Vertex_Output(r700_AssemblerBase *pAsm, struct gl_vertex_program *mesa_vp, unsigned int unStart) { @@ -124,7 +124,7 @@ unsigned int Map_Vertex_Output(r700_AssemblerBase *pAsm, return (unTotal - unStart); } -unsigned int Map_Vertex_Input(r700_AssemblerBase *pAsm, +unsigned int Map_Vertex_Input(r700_AssemblerBase *pAsm, struct gl_vertex_program *mesa_vp, unsigned int unStart) { @@ -165,7 +165,7 @@ GLboolean Process_Vertex_Program_Vfetch_Instructions( &vtxFetchMethod); } } - + return GL_TRUE; } @@ -375,7 +375,7 @@ struct r700_vertex_program* r700TranslateVertexShader(struct gl_context *ctx, return GL_FALSE; } - vp->r700Shader.nRegs = (vp->r700AsmCode.number_used_registers == 0) ? 0 + vp->r700Shader.nRegs = (vp->r700AsmCode.number_used_registers == 0) ? 0 : (vp->r700AsmCode.number_used_registers - 1); vp->r700Shader.nParamExports = vp->r700AsmCode.number_of_exports; @@ -435,7 +435,7 @@ void r700SelectVertexShader(struct gl_context *ctx) int getTypeSize(GLenum type) { - switch (type) + switch (type) { case GL_DOUBLE: return sizeof(GLdouble); @@ -462,44 +462,44 @@ int getTypeSize(GLenum type) static void r700TranslateAttrib(struct gl_context *ctx, GLuint unLoc, int count, const struct gl_client_array *input) { context_t *context = R700_CONTEXT(ctx); - + StreamDesc * pStreamDesc = &(context->stream_desc[context->nNumActiveAos]); GLuint stride; - stride = (input->StrideB == 0) ? getTypeSize(input->Type) * input->Size + stride = (input->StrideB == 0) ? getTypeSize(input->Type) * input->Size : input->StrideB; if (input->Type == GL_DOUBLE || input->Type == GL_UNSIGNED_INT || input->Type == GL_INT #if MESA_BIG_ENDIAN || getTypeSize(input->Type) != 4 #endif - ) + ) { pStreamDesc->type = GL_FLOAT; - if (input->StrideB == 0) + if (input->StrideB == 0) { pStreamDesc->stride = 0; - } - else + } + else { pStreamDesc->stride = sizeof(GLfloat) * input->Size; } pStreamDesc->dwords = input->Size; pStreamDesc->is_named_bo = GL_FALSE; - } - else + } + else { pStreamDesc->type = input->Type; pStreamDesc->dwords = (getTypeSize(input->Type) * input->Size + 3)/ 4; - if (!input->BufferObj->Name) + if (!input->BufferObj->Name) { - if (input->StrideB == 0) + if (input->StrideB == 0) { pStreamDesc->stride = 0; - } - else + } + else { pStreamDesc->stride = (getTypeSize(pStreamDesc->type) * input->Size + 3) & ~3; } @@ -513,7 +513,7 @@ static void r700TranslateAttrib(struct gl_context *ctx, GLuint unLoc, int count, pStreamDesc->element = unLoc; pStreamDesc->format = input->Format; - switch (pStreamDesc->type) + switch (pStreamDesc->type) { //GetSurfaceFormat case GL_FLOAT: pStreamDesc->_signed = 0; @@ -538,7 +538,7 @@ static void r700TranslateAttrib(struct gl_context *ctx, GLuint unLoc, int count, default: case GL_INT: case GL_UNSIGNED_INT: - case GL_DOUBLE: + case GL_DOUBLE: assert(0); break; } @@ -561,7 +561,7 @@ void r700SetVertexFormat(struct gl_context *ctx, const struct gl_client_array *a unBit |= VERT_BIT_POS; } - while(unBit) + while(unBit) { if(unBit & 1) { @@ -627,11 +627,11 @@ GLboolean r700SetupVertexProgram(struct gl_context * ctx) { unNumParamData = paramList->NumParameters; r600AllocShaderConsts(ctx, - &(vp->constbo0), + &(vp->constbo0), unNumParamData *4*4, "VSCON"); } - } + } vp->loaded = GL_TRUE; } @@ -650,7 +650,7 @@ GLboolean r700SetupVertexProgram(struct gl_context * ctx) SETbit(r700->vs.SQ_PGM_RESOURCES_VS.u32All, PGM_RESOURCES__PRIME_CACHE_ON_DRAW_bit); r700->vs.SQ_ALU_CONST_CACHE_VS_0.u32All = 0; /* set from buffer object. */ - + r700->vs.SQ_PGM_START_VS.u32All = 0; SETfield(r700->vs.SQ_PGM_RESOURCES_VS.u32All, vp->r700Shader.nRegs + 1, @@ -691,10 +691,10 @@ GLboolean r700SetupVertexProgram(struct gl_context * ctx) if(NULL != paramList) { /* vp->mesa_program was cloned, not updated by glsl shader api. */ /* _mesa_reference_program has already checked glsl shProg is ok and set ctx->VertexProgem._Current */ - /* so, use ctx->VertexProgem._Current */ - struct gl_program_parameter_list *paramListOrginal = + /* so, use ctx->VertexProgem._Current */ + struct gl_program_parameter_list *paramListOrginal = ctx->VertexProgram._Current->Base.Parameters; - + _mesa_load_state_parameters(ctx, paramList); if (paramList->NumParameters > R700_MAX_DX9_CONSTS) @@ -707,7 +707,7 @@ GLboolean r700SetupVertexProgram(struct gl_context * ctx) unNumParamData = paramList->NumParameters; for(ui=0; uiParameters[ui].Type == PROGRAM_UNIFORM) + if(paramList->Parameters[ui].Type == PROGRAM_UNIFORM) { r700->vs.consts[ui][0].f32All = paramListOrginal->ParameterValues[ui][0]; r700->vs.consts[ui][1].f32All = paramListOrginal->ParameterValues[ui][1]; diff --git a/src/mesa/drivers/dri/r600/r700_vertprog.h b/src/mesa/drivers/dri/r600/r700_vertprog.h index 859afb6..eb7ff74 100644 --- a/src/mesa/drivers/dri/r600/r700_vertprog.h +++ b/src/mesa/drivers/dri/r600/r700_vertprog.h @@ -29,7 +29,7 @@ #define _R700_VERTPROG_H_ #include "main/glheader.h" -#include "main/mtypes.h" +#include "main/mtypes.h" #include "r700_shader.h" #include "r700_assembler.h" @@ -42,7 +42,7 @@ typedef struct ArrayDesc //TEMP GLenum format; //GL_RGBA or GL_BGRA } ArrayDesc; -struct r700_vertex_program +struct r700_vertex_program { struct gl_vertex_program *mesa_program; /* Must be first */ @@ -70,10 +70,10 @@ struct r700_vertex_program_cont }; //Internal -unsigned int Map_Vertex_Output(r700_AssemblerBase *pAsm, +unsigned int Map_Vertex_Output(r700_AssemblerBase *pAsm, struct gl_vertex_program *mesa_vp, unsigned int unStart); -unsigned int Map_Vertex_Input(r700_AssemblerBase *pAsm, +unsigned int Map_Vertex_Input(r700_AssemblerBase *pAsm, struct gl_vertex_program *mesa_vp, unsigned int unStart); GLboolean Process_Vertex_Program_Vfetch_Instructions( diff --git a/src/mesa/drivers/dri/radeon/Makefile b/src/mesa/drivers/dri/radeon/Makefile index 93219e4..409f236 100644 --- a/src/mesa/drivers/dri/radeon/Makefile +++ b/src/mesa/drivers/dri/radeon/Makefile @@ -55,7 +55,7 @@ DRIVER_DEFINES = -DRADEON_R100 DRI_LIB_DEPS += $(RADEON_LDFLAGS) -X86_SOURCES = +X86_SOURCES = include ../Makefile.template diff --git a/src/mesa/drivers/dri/radeon/radeon_bo_drm.h b/src/mesa/drivers/dri/radeon/radeon_bo_drm.h index beb2369..2213d82 100644 --- a/src/mesa/drivers/dri/radeon/radeon_bo_drm.h +++ b/src/mesa/drivers/dri/radeon/radeon_bo_drm.h @@ -1,7 +1,7 @@ -/* +/* * Copyright © 2008 Jérôme Glisse * 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 @@ -9,14 +9,14 @@ * 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 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. IN NO EVENT SHALL THE COPYRIGHT HOLDERS, AUTHORS * AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, - * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE * USE OR OTHER DEALINGS IN THE SOFTWARE. * * The above copyright notice and this permission notice (including the diff --git a/src/mesa/drivers/dri/radeon/radeon_bo_legacy.c b/src/mesa/drivers/dri/radeon/radeon_bo_legacy.c index 78f73bf..49396dc 100644 --- a/src/mesa/drivers/dri/radeon/radeon_bo_legacy.c +++ b/src/mesa/drivers/dri/radeon/radeon_bo_legacy.c @@ -1,9 +1,9 @@ -/* +/* * Copyright © 2008 Nicolai Haehnle * Copyright © 2008 Dave Airlie * Copyright © 2008 Jérôme Glisse * 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 @@ -11,13 +11,13 @@ * 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 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. IN NO EVENT SHALL * THE COPYRIGHT HOLDERS, AUTHORS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, - * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR - * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE + * 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. * * The above copyright notice and this permission notice (including the @@ -99,7 +99,7 @@ struct bo_manager_legacy { static void bo_legacy_tobj_destroy(void *data, driTextureObject *t) { struct bo_legacy_texture_object *tobj = (struct bo_legacy_texture_object *)t; - + if (tobj->parent) { tobj->parent->tobj = NULL; tobj->parent->validated = 0; @@ -174,8 +174,8 @@ static void legacy_get_current_age(struct bo_manager_legacy *boml) unsigned char *RADEONMMIO = NULL; int r; - if ( IS_R300_CLASS(boml->screen) - || IS_R600_CLASS(boml->screen) ) + if ( IS_R300_CLASS(boml->screen) + || IS_R600_CLASS(boml->screen) ) { gp.param = RADEON_PARAM_LAST_CLEAR; gp.value = (int *)&boml->current_age; @@ -185,7 +185,7 @@ static void legacy_get_current_age(struct bo_manager_legacy *boml) fprintf(stderr, "%s: drmRadeonGetParam: %d\n", __FUNCTION__, r); exit(1); } - } + } else { RADEONMMIO = boml->screen->mmio.map; boml->current_age = boml->screen->scratch[3]; @@ -257,7 +257,7 @@ void legacy_track_pending(struct radeon_bo_manager *bom, int debug) if (legacy_is_pending(&(bo_legacy->base))) { } bo_legacy = next; - } + } } static int legacy_wait_any_pending(struct bo_manager_legacy *boml) @@ -448,16 +448,16 @@ static struct radeon_bo *bo_open(struct radeon_bo_manager *bom, bo_free(bo_legacy); return NULL; } - if (bo_legacy->base.domains & RADEON_GEM_DOMAIN_GTT) + if (bo_legacy->base.domains & RADEON_GEM_DOMAIN_GTT) { retry: legacy_track_pending(&boml->base, 0); /* dma buffers */ r = bo_dma_alloc(&(bo_legacy->base)); - if (r) + if (r) { - if (legacy_wait_any_pending(boml) == -1) + if (legacy_wait_any_pending(boml) == -1) { bo_free(bo_legacy); return NULL; @@ -465,8 +465,8 @@ static struct radeon_bo *bo_open(struct radeon_bo_manager *bom, goto retry; return NULL; } - } - else + } + else { bo_legacy->ptr = malloc(bo_legacy->base.size); if (bo_legacy->ptr == NULL) { @@ -538,11 +538,11 @@ static int bo_unmap(struct radeon_bo_int *bo) { struct bo_legacy *bo_legacy = (struct bo_legacy*)bo; - if (--bo_legacy->map_count > 0) + if (--bo_legacy->map_count > 0) { return 0; } - + bo->ptr = NULL; return 0; @@ -588,7 +588,7 @@ static int bo_vram_validate(struct radeon_bo_int *bo, struct bo_legacy *bo_legacy = (struct bo_legacy*)bo; int r; int retry_count = 0, pending_retry = 0; - + if (!bo_legacy->tobj) { bo_legacy->tobj = CALLOC(sizeof(struct bo_legacy_texture_object)); bo_legacy->tobj->parent = bo_legacy; @@ -694,7 +694,7 @@ static int bo_vram_validate(struct radeon_bo_int *bo, return 0; } -/* +/* * radeon_bo_legacy_validate - * returns: * 0 - all good @@ -759,7 +759,7 @@ void radeon_bo_legacy_pending(struct radeon_bo *bo, uint32_t pending) /* add to pending list */ radeon_bo_ref(bo); if (bo_legacy->is_pending > 1) { - return; + return; } bo_legacy->pprev = boml->pending_bos.pprev; bo_legacy->pnext = NULL; @@ -854,7 +854,7 @@ struct radeon_bo_manager *radeon_bo_manager_legacy_ctor(struct radeon_screen *sc } /* biggest framebuffer size */ - size = 4096*4096*4; + size = 4096*4096*4; /* allocate front */ bo = radeon_legacy_bo_alloc_static(bom, size, bom->screen->frontOffset); diff --git a/src/mesa/drivers/dri/radeon/radeon_bo_legacy.h b/src/mesa/drivers/dri/radeon/radeon_bo_legacy.h index 2cf15df..365d9cb 100644 --- a/src/mesa/drivers/dri/radeon/radeon_bo_legacy.h +++ b/src/mesa/drivers/dri/radeon/radeon_bo_legacy.h @@ -1,8 +1,8 @@ -/* +/* * Copyright © 2008 Nicolai Haehnle * Copyright © 2008 Jérôme Glisse * 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,13 +10,13 @@ * 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 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. IN NO EVENT SHALL * THE COPYRIGHT HOLDERS, AUTHORS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, - * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR - * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE + * 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. * * The above copyright notice and this permission notice (including the diff --git a/src/mesa/drivers/dri/radeon/radeon_chipset.h b/src/mesa/drivers/dri/radeon/radeon_chipset.h index 60943d1..800e5ee 100644 --- a/src/mesa/drivers/dri/radeon/radeon_chipset.h +++ b/src/mesa/drivers/dri/radeon/radeon_chipset.h @@ -66,9 +66,9 @@ #define PCI_CHIP_R300_NF 0x4E46 #define PCI_CHIP_R300_NG 0x4E47 #define PCI_CHIP_R350_NH 0x4E48 -#define PCI_CHIP_R350_NI 0x4E49 -#define PCI_CHIP_R360_NJ 0x4E4A -#define PCI_CHIP_R350_NK 0x4E4B +#define PCI_CHIP_R350_NI 0x4E49 +#define PCI_CHIP_R360_NJ 0x4E4A +#define PCI_CHIP_R350_NK 0x4E4B #define PCI_CHIP_RV350_NP 0x4E50 #define PCI_CHIP_RV350_NQ 0x4E51 #define PCI_CHIP_RV350_NR 0x4E52 diff --git a/src/mesa/drivers/dri/radeon/radeon_common_context.c b/src/mesa/drivers/dri/radeon/radeon_common_context.c index a112448..b6996c7 100644 --- a/src/mesa/drivers/dri/radeon/radeon_common_context.c +++ b/src/mesa/drivers/dri/radeon/radeon_common_context.c @@ -503,7 +503,7 @@ radeon_make_renderbuffer_current(radeonContextPtr radeon, static unsigned radeon_bits_per_pixel(const struct radeon_renderbuffer *rb) { - return _mesa_get_format_bytes(rb->base.Format) * 8; + return _mesa_get_format_bytes(rb->base.Format) * 8; } /* diff --git a/src/mesa/drivers/dri/radeon/radeon_context.c b/src/mesa/drivers/dri/radeon/radeon_context.c index e3de534..540f616 100644 --- a/src/mesa/drivers/dri/radeon/radeon_context.c +++ b/src/mesa/drivers/dri/radeon/radeon_context.c @@ -120,7 +120,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 */ @@ -149,10 +149,10 @@ static void r100_get_lock(radeonContextPtr radeon) rmesa->hw.ctx.cmd[CTX_RB3D_COLORPITCH] &= ~RADEON_COLOR_TILE_ENABLE; } - + if (sarea->ctx_owner != rmesa->radeon.dri.hwContext) { sarea->ctx_owner = rmesa->radeon.dri.hwContext; - + if (!radeon->radeonScreen->kernel_mm) radeon_bo_legacy_texture_age(radeon->radeonScreen->bom); } @@ -165,7 +165,7 @@ static void r100_vtbl_emit_cs_header(struct radeon_cs *cs, radeonContextPtr rmes 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; @@ -236,7 +236,7 @@ r100CreateContext( gl_api api, /* init exp fog table data */ radeonInitStaticFogData(); - + /* Parse configuration files. * Do this here so that initialMaxAnisotropy is set before we create * the default textures. @@ -289,7 +289,7 @@ r100CreateContext( gl_api api, i = driQueryOptioni( &rmesa->radeon.optionCache, "allow_large_textures"); - /* 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.MaxTextureLevels = 12; ctx->Const.Max3DTextureLevels = 9; @@ -316,9 +316,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; @@ -387,7 +387,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"); diff --git a/src/mesa/drivers/dri/radeon/radeon_context.h b/src/mesa/drivers/dri/radeon/radeon_context.h index de71aa2..72ee80a 100644 --- a/src/mesa/drivers/dri/radeon/radeon_context.h +++ b/src/mesa/drivers/dri/radeon/radeon_context.h @@ -86,7 +86,7 @@ struct radeon_texture_state { /* Trying to keep these relatively short as the variables are becoming * extravagently long. Drop the driver name prefix off the front of * everything - I think we know which driver we're in by now, and keep the - * prefix to 3 letters unless absolutely impossible. + * prefix to 3 letters unless absolutely impossible. */ #define CTX_CMD_0 0 @@ -219,7 +219,7 @@ struct radeon_texture_state { #define GRD_STATE_SIZE 5 /* position changes frequently when lighting in modelpos - separate - * out to new state item? + * out to new state item? */ #define LIT_CMD_0 0 #define LIT_AMBIENT_RED 1 @@ -305,7 +305,7 @@ struct radeon_texture_state { #define STP_STATE_SIZE 35 struct r100_hw_state { - /* Hardware state, stored as cmdbuf commands: + /* Hardware state, stored as cmdbuf commands: * -- Need to doublebuffer for * - eliding noop statechange loops? (except line stipple count) */ @@ -391,7 +391,7 @@ struct r100_swtcl_info { /* A maximum total of 20 elements per vertex: 3 floats for position, 3 * floats for normal, 4 floats for color, 4 bytes for secondary color, * 3 floats for each texture unit (9 floats total). - * + * * The position data is never actually stored here, so 3 elements could be * trimmed out of the buffer. This number is only valid for vtxfmt! */ diff --git a/src/mesa/drivers/dri/radeon/radeon_cs_drm.h b/src/mesa/drivers/dri/radeon/radeon_cs_drm.h index a3f1750..533811f 100644 --- a/src/mesa/drivers/dri/radeon/radeon_cs_drm.h +++ b/src/mesa/drivers/dri/radeon/radeon_cs_drm.h @@ -1,8 +1,8 @@ -/* +/* * Copyright © 2008 Nicolai Haehnle * Copyright © 2008 Jérôme Glisse * 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,13 +10,13 @@ * 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 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. IN NO EVENT SHALL * THE COPYRIGHT HOLDERS, AUTHORS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, - * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR - * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE + * 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. * * The above copyright notice and this permission notice (including the diff --git a/src/mesa/drivers/dri/radeon/radeon_cs_int_drm.h b/src/mesa/drivers/dri/radeon/radeon_cs_int_drm.h index 8ba76bf..3b76e20 100644 --- a/src/mesa/drivers/dri/radeon/radeon_cs_int_drm.h +++ b/src/mesa/drivers/dri/radeon/radeon_cs_int_drm.h @@ -11,7 +11,7 @@ struct radeon_cs_space_check { struct radeon_cs_int { /* keep first two in same place */ - uint32_t *packets; + uint32_t *packets; unsigned cdw; unsigned ndw; unsigned section_ndw; diff --git a/src/mesa/drivers/dri/radeon/radeon_cs_legacy.c b/src/mesa/drivers/dri/radeon/radeon_cs_legacy.c index c2722a4..a39829f 100644 --- a/src/mesa/drivers/dri/radeon/radeon_cs_legacy.c +++ b/src/mesa/drivers/dri/radeon/radeon_cs_legacy.c @@ -1,8 +1,8 @@ -/* +/* * Copyright © 2008 Nicolai Haehnle * Copyright © 2008 Jérôme Glisse * 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,13 +10,13 @@ * 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 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. IN NO EVENT SHALL * THE COPYRIGHT HOLDERS, AUTHORS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, - * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR - * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE + * 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. * * The above copyright notice and this permission notice (including the @@ -225,9 +225,9 @@ static int cs_process_relocs(struct radeon_cs_int *cs) csm = (struct cs_manager_legacy*)cs->csm; relocs = (struct cs_reloc_legacy *)cs->relocs; restart: - for (i = 0; i < cs->crelocs; i++) + for (i = 0; i < cs->crelocs; i++) { - for (j = 0; j < relocs[i].cindices; j++) + for (j = 0; j < relocs[i].cindices; j++) { uint32_t soffset, eoffset; @@ -237,14 +237,14 @@ static int cs_process_relocs(struct radeon_cs_int *cs) { goto restart; } - if (r) + if (r) { fprintf(stderr, "validated %p [0x%08X, 0x%08X]\n", relocs[i].base.bo, soffset, eoffset); return r; } cs->packets[relocs[i].indices[j]] += soffset; - if (cs->packets[relocs[i].indices[j]] >= eoffset) + if (cs->packets[relocs[i].indices[j]] >= eoffset) { /* radeon_bo_debug(relocs[i].base.bo, 12); */ fprintf(stderr, "validated %p [0x%08X, 0x%08X]\n", @@ -287,7 +287,7 @@ static int cs_emit(struct radeon_cs_int *cs) /* append buffer age */ if ( IS_R300_CLASS(csm->ctx->radeonScreen) ) - { + { age.scratch.cmd_type = R300_CMD_SCRATCH; /* Scratch register 2 corresponds to what radeonGetAge polls */ csm->pending_age = 0; diff --git a/src/mesa/drivers/dri/radeon/radeon_cs_legacy.h b/src/mesa/drivers/dri/radeon/radeon_cs_legacy.h index cafbc9e..2417cc9 100644 --- a/src/mesa/drivers/dri/radeon/radeon_cs_legacy.h +++ b/src/mesa/drivers/dri/radeon/radeon_cs_legacy.h @@ -1,8 +1,8 @@ -/* +/* * Copyright © 2008 Nicolai Haehnle * Copyright © 2008 Jérôme Glisse * 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,13 +10,13 @@ * 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 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. IN NO EVENT SHALL * THE COPYRIGHT HOLDERS, AUTHORS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, - * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR - * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE + * 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. * * The above copyright notice and this permission notice (including the diff --git a/src/mesa/drivers/dri/radeon/radeon_cs_space_drm.c b/src/mesa/drivers/dri/radeon/radeon_cs_space_drm.c index e22b437..9bbba93 100644 --- a/src/mesa/drivers/dri/radeon/radeon_cs_space_drm.c +++ b/src/mesa/drivers/dri/radeon/radeon_cs_space_drm.c @@ -1,7 +1,7 @@ -/* +/* * Copyright © 2009 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 @@ -9,14 +9,14 @@ * 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 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. IN NO EVENT SHALL THE COPYRIGHT HOLDERS, AUTHORS * AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, - * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE * USE OR OTHER DEALINGS IN THE SOFTWARE. * * The above copyright notice and this permission notice (including the @@ -74,10 +74,10 @@ static inline int radeon_cs_setup_bo(struct radeon_cs_space_check *sc, struct ra sc->new_accounted = (read_domains << 16) | write_domain; } else { uint16_t old_read, old_write; - + old_read = bo->space_accounted >> 16; old_write = bo->space_accounted & 0xffff; - + if (write_domain && (old_read & write_domain)) { sc->new_accounted = write_domain; /* moving from read to a write domain */ @@ -129,7 +129,7 @@ static int radeon_cs_do_space_check(struct radeon_cs_int *cs, struct radeon_cs_s if (ret) return ret; } - + if (sizes.op_read < 0) sizes.op_read = 0; @@ -138,12 +138,12 @@ static int radeon_cs_do_space_check(struct radeon_cs_int *cs, struct radeon_cs_s (sizes.op_vram_write > csm->vram_limit)) { return RADEON_CS_SPACE_OP_TO_BIG; } - + if (((csm->vram_write_used + sizes.op_vram_write) > csm->vram_limit) || ((csm->read_used + csm->gart_write_used + sizes.op_gart_write + sizes.op_read) > csm->gart_limit)) { return RADEON_CS_SPACE_FLUSH; } - + csm->gart_write_used += sizes.op_gart_write; csm->vram_write_used += sizes.op_vram_write; csm->read_used += sizes.op_read; @@ -154,7 +154,7 @@ static int radeon_cs_do_space_check(struct radeon_cs_int *cs, struct radeon_cs_s } if (new_tmp) new_tmp->bo->space_accounted = new_tmp->new_accounted; - + return RADEON_CS_SPACE_OK; } @@ -207,7 +207,7 @@ int radeon_cs_space_check_with_bo(struct radeon_cs *cs, struct radeon_cs_int *csi = (struct radeon_cs_int *)cs; struct radeon_bo_int *boi = (struct radeon_bo_int *)bo; struct radeon_cs_space_check temp_bo; - + int ret = 0; if (bo) { diff --git a/src/mesa/drivers/dri/radeon/radeon_fbo.c b/src/mesa/drivers/dri/radeon/radeon_fbo.c index a36a1dc..f2ebd2e 100644 --- a/src/mesa/drivers/dri/radeon/radeon_fbo.c +++ b/src/mesa/drivers/dri/radeon/radeon_fbo.c @@ -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,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. - * + * **************************************************************************/ @@ -169,8 +169,8 @@ radeon_alloc_renderbuffer_storage(struct gl_context * ctx, struct gl_renderbuffe if (rrb->bo) radeon_bo_unref(rrb->bo); - - + + if (software_buffer) { return _mesa_soft_renderbuffer_storage(ctx, rb, internalFormat, width, height); @@ -195,8 +195,8 @@ radeon_alloc_renderbuffer_storage(struct gl_context * ctx, struct gl_renderbuffe rb->Width = width; rb->Height = height; return GL_TRUE; - } - + } + } #if FEATURE_OES_EGL_image @@ -452,7 +452,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) { radeon_print(RADEON_TEXTURE, RADEON_TRACE, @@ -485,7 +485,7 @@ radeon_update_wrapper(struct gl_context *ctx, struct radeon_renderbuffer *rrb, rrb->base.DataType = GL_UNSIGNED_INT_24_8_EXT; break; } - + rrb->cpp = _mesa_get_format_bytes(texImage->TexFormat); rrb->pitch = texImage->Width * rrb->cpp; rrb->base.Format = texImage->TexFormat; @@ -527,7 +527,7 @@ radeon_wrap_texture(struct gl_context * ctx, struct gl_texture_image *texImage) } return rrb; - + } static void radeon_render_texture(struct gl_context * ctx, @@ -670,7 +670,7 @@ void radeon_fbo_init(struct radeon_context *radeon) #endif } - + void radeon_renderbuffer_set_bo(struct radeon_renderbuffer *rb, struct radeon_bo *bo) { diff --git a/src/mesa/drivers/dri/radeon/radeon_ioctl.h b/src/mesa/drivers/dri/radeon/radeon_ioctl.h index 7902057..72d50c5 100644 --- a/src/mesa/drivers/dri/radeon/radeon_ioctl.h +++ b/src/mesa/drivers/dri/radeon/radeon_ioctl.h @@ -51,7 +51,7 @@ extern void radeonEmitVbufPrim( r100ContextPtr rmesa, GLuint vertex_nr ); extern void radeonFlushElts( struct gl_context *ctx ); - + extern GLushort *radeonAllocEltsOpenEnded( r100ContextPtr rmesa, GLuint vertex_format, @@ -118,7 +118,7 @@ static INLINE int RADEON_DB_STATECHANGE(r100ContextPtr rmesa, RADEON_NEWPRIM( rmesa ); atom->dirty = GL_TRUE; rmesa->radeon.hw.is_dirty = GL_TRUE; - tmp = atom->cmd; + tmp = atom->cmd; atom->cmd = atom->lastcmd; atom->lastcmd = tmp; return 1; diff --git a/src/mesa/drivers/dri/radeon/radeon_maos_arrays.c b/src/mesa/drivers/dri/radeon/radeon_maos_arrays.c index 94fe7e4..b6996d4 100644 --- a/src/mesa/drivers/dri/radeon/radeon_maos_arrays.c +++ b/src/mesa/drivers/dri/radeon/radeon_maos_arrays.c @@ -180,7 +180,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 ) { @@ -190,15 +190,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( __FUNCTION__, 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, @@ -214,11 +214,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, @@ -288,7 +288,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) diff --git a/src/mesa/drivers/dri/radeon/radeon_maos_vbtmp.h b/src/mesa/drivers/dri/radeon/radeon_maos_vbtmp.h index b73fc8a..64b3a0e 100644 --- a/src/mesa/drivers/dri/radeon/radeon_maos_vbtmp.h +++ b/src/mesa/drivers/dri/radeon/radeon_maos_vbtmp.h @@ -108,7 +108,7 @@ static void TAG(emit)( struct gl_context *ctx, tc0 = (GLuint (*)[4])&ctx->Current.Attrib[VERT_ATTRIB_TEX0]; tc0_stride = 0; } - + } if (DO_NORM) { @@ -150,19 +150,19 @@ static void TAG(emit)( struct gl_context *ctx, fog_stride = 0; } } - - + + if (start) { coord = (GLuint (*)[4])((GLubyte *)coord + start * coord_stride); if (DO_TEX0) tc0 = (GLuint (*)[4])((GLubyte *)tc0 + start * tc0_stride); - if (DO_TEX1) + if (DO_TEX1) tc1 = (GLuint (*)[4])((GLubyte *)tc1 + start * tc1_stride); - if (DO_TEX2) + if (DO_TEX2) tc2 = (GLuint (*)[4])((GLubyte *)tc2 + start * tc2_stride); - if (DO_NORM) + if (DO_NORM) norm = (GLuint (*)[4])((GLubyte *)norm + start * norm_stride); - if (DO_RGBA) + if (DO_RGBA) STRIDE_4F(col, start * col_stride); if (DO_SPEC) STRIDE_4F(spec, start * spec_stride); @@ -173,14 +173,14 @@ static void TAG(emit)( struct gl_context *ctx, { for (i=start; i < end; i++) { - + v[0].ui = coord[0][0]; v[1].ui = coord[0][1]; v[2].ui = coord[0][2]; if (DO_W) { v[3].ui = coord[0][3]; v += 4; - } + } else v += 3; coord = (GLuint (*)[4])((GLubyte *)coord + coord_stride); @@ -227,7 +227,7 @@ static void TAG(emit)( struct gl_context *ctx, v[2].ui = tc0[0][3]; if (TCL_DEBUG) fprintf(stderr, "%.2f ", v[2].f); v += 3; - } + } else v += 2; tc0 = (GLuint (*)[4])((GLubyte *)tc0 + tc0_stride); @@ -245,11 +245,11 @@ static void TAG(emit)( struct gl_context *ctx, v[2].ui = tc1[0][3]; if (TCL_DEBUG) fprintf(stderr, "%.2f ", v[2].f); v += 3; - } + } else v += 2; tc1 = (GLuint (*)[4])((GLubyte *)tc1 + tc1_stride); - } + } if (DO_TEX2) { v[0].ui = tc2[0][0]; v[1].ui = tc2[0][1]; @@ -263,11 +263,11 @@ static void TAG(emit)( struct gl_context *ctx, v[2].ui = tc2[0][3]; if (TCL_DEBUG) fprintf(stderr, "%.2f ", v[2].f); v += 3; - } + } else v += 2; tc2 = (GLuint (*)[4])((GLubyte *)tc2 + tc2_stride); - } + } if (TCL_DEBUG) fprintf(stderr, "\n"); } } diff --git a/src/mesa/drivers/dri/radeon/radeon_maos_verts.c b/src/mesa/drivers/dri/radeon/radeon_maos_verts.c index 5dac2a3..e492eda 100644 --- a/src/mesa/drivers/dri/radeon/radeon_maos_verts.c +++ b/src/mesa/drivers/dri/radeon/radeon_maos_verts.c @@ -279,7 +279,7 @@ static struct { /*********************************************************************** - * Initialization + * Initialization ***********************************************************************/ @@ -368,8 +368,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 && @@ -382,12 +382,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 && @@ -420,7 +420,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; diff --git a/src/mesa/drivers/dri/radeon/radeon_mipmap_tree.c b/src/mesa/drivers/dri/radeon/radeon_mipmap_tree.c index 1fadad2..c7df10e 100644 --- a/src/mesa/drivers/dri/radeon/radeon_mipmap_tree.c +++ b/src/mesa/drivers/dri/radeon/radeon_mipmap_tree.c @@ -628,7 +628,7 @@ int radeon_validate_texture_miptree(struct gl_context * ctx, struct gl_texture_o radeon_print(RADEON_TEXTURE, RADEON_TRACE, "Checking image level %d, face %d, mt %p ... ", level, face, img->mt); - + if (img->mt != t->mt) { radeon_print(RADEON_TEXTURE, RADEON_TRACE, "MIGRATING\n"); diff --git a/src/mesa/drivers/dri/radeon/radeon_sanity.c b/src/mesa/drivers/dri/radeon/radeon_sanity.c index 3e64be8..55d3070 100644 --- a/src/mesa/drivers/dri/radeon/radeon_sanity.c +++ b/src/mesa/drivers/dri/radeon/radeon_sanity.c @@ -31,7 +31,7 @@ USE OR OTHER DEALINGS IN THE SOFTWARE. * Keith Whitwell * */ -#include +#include #include "main/glheader.h" @@ -53,11 +53,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" }, @@ -111,15 +111,15 @@ static struct { { 0, 1, "R200_SE_VTE_CNTL" }, { 0, 1, "R200_SE_TCL_OUTPUT_VTX_COMP_SEL" }, { 0, 1, "R200_PP_TAM_DEBUG3" }, - { 0, 1, "R200_PP_CNTL_X" }, - { 0, 1, "R200_RB3D_DEPTHXY_OFFSET" }, - { 0, 1, "R200_RE_AUX_SCISSOR_CNTL" }, - { 0, 2, "R200_RE_SCISSOR_TL_0" }, - { 0, 2, "R200_RE_SCISSOR_TL_1" }, - { 0, 2, "R200_RE_SCISSOR_TL_2" }, - { 0, 1, "R200_SE_VAP_CNTL_STATUS" }, - { 0, 1, "R200_SE_VTX_STATE_CNTL" }, - { 0, 1, "R200_RE_POINTSIZE" }, + { 0, 1, "R200_PP_CNTL_X" }, + { 0, 1, "R200_RB3D_DEPTHXY_OFFSET" }, + { 0, 1, "R200_RE_AUX_SCISSOR_CNTL" }, + { 0, 2, "R200_RE_SCISSOR_TL_0" }, + { 0, 2, "R200_RE_SCISSOR_TL_1" }, + { 0, 2, "R200_RE_SCISSOR_TL_2" }, + { 0, 1, "R200_SE_VAP_CNTL_STATUS" }, + { 0, 1, "R200_SE_VTX_STATE_CNTL" }, + { 0, 1, "R200_RE_POINTSIZE" }, { 0, 4, "R200_SE_TCL_INPUT_VTX_VECTOR_ADDR_0" }, { 0, 1, "R200_PP_CUBIC_FACES_0" }, /* 61 */ { 0, 5, "R200_PP_CUBIC_OFFSET_F1_0" }, /* 62 */ @@ -322,7 +322,7 @@ union fi { float f; int i; }; #define TOUCHED 4 struct reg { - int idx; + int idx; struct reg_names *closest; int flags; union fi current; @@ -380,7 +380,7 @@ static int find_or_add_value( struct reg *reg, int val ) if (j == reg->nalloc) { reg->nalloc += 5; reg->nalloc *= 2; - reg->values = (union fi *) realloc( reg->values, + reg->values = (union fi *) realloc( reg->values, reg->nalloc * sizeof(union fi) ); } @@ -406,14 +406,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 @@ -433,17 +433,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))) @@ -511,19 +511,19 @@ static void dump_state( void ) { int i; - for (i = 0 ; i < Elements(regs) ; i++) + for (i = 0 ; i < Elements(regs) ; i++) print_reg( ®s[i] ); - for (i = 0 ; i < Elements(scalars) ; i++) + for (i = 0 ; i < Elements(scalars) ; i++) print_reg( &scalars[i] ); - for (i = 0 ; i < Elements(vectors) ; i++) + for (i = 0 ; i < Elements(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 ) { @@ -531,9 +531,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; } @@ -542,8 +542,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++) { @@ -559,7 +559,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 ) { @@ -580,14 +580,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 ) { @@ -612,7 +612,7 @@ static int radeon_emit_scalars2( total_changed++; total++; } - + cmdbuf->buf += sz * sizeof(int); cmdbuf->bufsz -= sz * sizeof(int); return 0; @@ -621,7 +621,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 ) { @@ -651,7 +651,7 @@ static int radeon_emit_vectors( total_changed += 4; total += 4; } - + cmdbuf->buf += sz * sizeof(int); cmdbuf->bufsz -= sz * sizeof(int); @@ -688,7 +688,7 @@ static int print_vertex_format( int vfmt ) (vfmt & RADEON_CP_VC_FRMT_W1) ? "w1," : "", (vfmt & RADEON_CP_VC_FRMT_N1) ? "n1," : ""); - + /* if (!find_or_add_value( &others[V_VTXFMT], vfmt )) */ /* fprintf(stderr, " *** NEW VALUE"); */ @@ -715,7 +715,7 @@ static char *primname[0xf] = { static int print_prim_and_flags( int prim ) { int numverts; - + if (NORMAL) fprintf(stderr, " %s(%x): %s%s%s%s%s%s%s\n", "prim flags", @@ -734,7 +734,7 @@ static int print_prim_and_flags( int prim ) } numverts = prim>>16; - + if (NORMAL) fprintf(stderr, " prim: %s numverts %d\n", primname[prim&0xf], numverts); @@ -777,7 +777,7 @@ static int print_prim_and_flags( int prim ) default: fprintf(stderr, "Bad primitive\n"); return -1; - } + } return 0; } @@ -904,7 +904,7 @@ static int radeon_emit_packet3( drm_radeon_cmd_buffer_t *cmdbuf ) break; case RADEON_CP_PACKET3_CNTL_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 RADEON_CP_PACKET3_CNTL_POLYLINE: @@ -913,29 +913,29 @@ static int radeon_emit_packet3( drm_radeon_cmd_buffer_t *cmdbuf ) break; case RADEON_CP_PACKET3_CNTL_POLYSCANLINES: if (NORMAL) - fprintf(stderr, "PACKET3_CNTL_POLYSCANLINES, %d dwords\n", + fprintf(stderr, "PACKET3_CNTL_POLYSCANLINES, %d dwords\n", cmdsz); break; case RADEON_CP_PACKET3_CNTL_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 RADEON_CP_PACKET3_CNTL_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 RADEON_CP_PACKET3_CNTL_TRANS_BITBLT: if (NORMAL) - fprintf(stderr, "PACKET3_CNTL_TRANS_BITBLT, %d dwords\n", + fprintf(stderr, "PACKET3_CNTL_TRANS_BITBLT, %d dwords\n", cmdsz); break; default: fprintf(stderr, "UNKNOWN PACKET, %d dwords\n", cmdsz); break; } - + cmdbuf->buf += cmdsz * 4; cmdbuf->bufsz -= cmdsz * 4; return 0; @@ -945,7 +945,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 = cmdbuf->boxes; int i = 0; @@ -992,13 +992,13 @@ int radeonSanityCmdBuffer( r100ContextPtr 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; @@ -1051,7 +1051,7 @@ int radeonSanityCmdBuffer( r100ContextPtr 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; @@ -1065,7 +1065,7 @@ int radeonSanityCmdBuffer( r100ContextPtr 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); diff --git a/src/mesa/drivers/dri/radeon/radeon_screen.c b/src/mesa/drivers/dri/radeon/radeon_screen.c index 2a7e2d0..5e58b7b 100644 --- a/src/mesa/drivers/dri/radeon/radeon_screen.c +++ b/src/mesa/drivers/dri/radeon/radeon_screen.c @@ -1419,7 +1419,7 @@ radeonCreateScreen( __DRIscreen *sPriv ) } } else - { + { screen->fbLocation = (temp & 0xffff) << 16; } } diff --git a/src/mesa/drivers/dri/radeon/radeon_span.c b/src/mesa/drivers/dri/radeon/radeon_span.c index caf3f25..01ac0b4 100644 --- a/src/mesa/drivers/dri/radeon/radeon_span.c +++ b/src/mesa/drivers/dri/radeon/radeon_span.c @@ -431,7 +431,7 @@ static GLubyte *r600_ptr_color(const struct radeon_renderbuffer * rrb, macro-linear/micro-tiled macro-tiled /micro-linear macro-tiled /micro-tiled - 1 byte surface + 1 byte surface 2 byte surface - two types - we only provide 8x2 microtiling 4 byte surface 8/16 byte (unused) @@ -1049,7 +1049,7 @@ radeon_map_unmap_framebuffer(struct gl_context *ctx, struct gl_framebuffer *fb, radeon_teximage_unmap(image); } } - + /* depth buffer (Note wrapper!) */ if (fb->_DepthBuffer) map_unmap_rb(fb->_DepthBuffer->Wrapped, map); diff --git a/src/mesa/drivers/dri/radeon/radeon_state.c b/src/mesa/drivers/dri/radeon/radeon_state.c index 51e4b8f..ef90696 100644 --- a/src/mesa/drivers/dri/radeon/radeon_state.c +++ b/src/mesa/drivers/dri/radeon/radeon_state.c @@ -1516,7 +1516,7 @@ static void radeonClearColor( struct gl_context *ctx, const GLfloat color[4] ) rrb = radeon_get_colorbuffer(&rmesa->radeon); if (!rrb) return; - + CLAMPED_FLOAT_TO_UBYTE(c[0], color[0]); CLAMPED_FLOAT_TO_UBYTE(c[1], color[1]); CLAMPED_FLOAT_TO_UBYTE(c[2], color[2]); diff --git a/src/mesa/drivers/dri/radeon/radeon_state_init.c b/src/mesa/drivers/dri/radeon/radeon_state_init.c index 33b504c..d461359 100644 --- a/src/mesa/drivers/dri/radeon/radeon_state_init.c +++ b/src/mesa/drivers/dri/radeon/radeon_state_init.c @@ -158,7 +158,7 @@ static struct { /* ============================================================= * State initialization */ -static int cmdpkt( r100ContextPtr rmesa, int id ) +static int cmdpkt( r100ContextPtr rmesa, int id ) { drm_radeon_cmd_header_t h; @@ -172,7 +172,7 @@ static int cmdpkt( r100ContextPtr rmesa, int id ) return h.i; } -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; @@ -183,7 +183,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; @@ -299,7 +299,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_NO_AUTOSTATE(dwords); OUT_SCL(atom->cmd[0], atom->cmd+1); END_BATCH(); @@ -361,7 +361,7 @@ static void ctx_emit(struct gl_context *ctx, struct radeon_state_atom *atom) atom->cmd[CTX_RB3D_ZSTENCILCNTL] &= ~RADEON_DEPTH_FORMAT_MASK; atom->cmd[CTX_RB3D_ZSTENCILCNTL] |= depth_fmt; } - + OUT_BATCH(atom->cmd[CTX_RB3D_ZSTENCILCNTL]); OUT_BATCH(atom->cmd[CTX_CMD_1]); OUT_BATCH(atom->cmd[CTX_PP_CNTL]); @@ -463,7 +463,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_NO_AUTOSTATE(dwords); @@ -782,7 +782,7 @@ void radeonInitState( r100ContextPtr rmesa ) if (rmesa->radeon.radeonScreen->kernel_mm) { ALLOC_STATE( stp, always, STP_STATE_SIZE, "STP/stp", 0 ); } - + for (i = 0; i < 3; i++) { if (rmesa->radeon.radeonScreen->kernel_mm) rmesa->hw.tex[i].emit = tex_emit_cs; @@ -843,34 +843,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 ); } @@ -883,7 +883,7 @@ void radeonInitState( r100ContextPtr rmesa ) rmesa->hw.fog.emit = vec_emit; rmesa->hw.glt.emit = vec_emit; rmesa->hw.eye.emit = vec_emit; - + for (i = 0; i < 6; i++) rmesa->hw.mat[i].emit = vec_emit; @@ -930,7 +930,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 | @@ -992,13 +992,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)); @@ -1006,7 +1006,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); @@ -1020,7 +1020,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] */ @@ -1032,14 +1032,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 | @@ -1064,12 +1064,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) | @@ -1078,23 +1078,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 | @@ -1117,14 +1117,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 ); @@ -1139,7 +1139,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; @@ -1155,7 +1155,7 @@ void radeonInitState( r100ContextPtr rmesa ) 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); diff --git a/src/mesa/drivers/dri/radeon/radeon_swtcl.c b/src/mesa/drivers/dri/radeon/radeon_swtcl.c index ff3506b..205c47d 100644 --- a/src/mesa/drivers/dri/radeon/radeon_swtcl.c +++ b/src/mesa/drivers/dri/radeon/radeon_swtcl.c @@ -61,7 +61,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 ) \ @@ -115,19 +115,19 @@ static void radeonSetVertexFormat( struct gl_context *ctx ) */ if ( !rmesa->swtcl.needproj || RENDERINPUTS_TEST_RANGE( index_bitset, _TNL_FIRST_TEX, _TNL_LAST_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, @@ -139,7 +139,7 @@ static void radeonSetVertexFormat( struct gl_context *ctx ) if (RENDERINPUTS_TEST( index_bitset, _TNL_ATTRIB_COLOR1 ) || RENDERINPUTS_TEST( index_bitset, _TNL_ATTRIB_FOG )) { -#if MESA_LITTLE_ENDIAN +#if MESA_LITTLE_ENDIAN if (RENDERINPUTS_TEST( index_bitset, _TNL_ATTRIB_COLOR1 )) { rmesa->swtcl.specoffset = offset; EMIT_ATTR( _TNL_ATTRIB_COLOR1, EMIT_3UB_3F_RGB, @@ -212,7 +212,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; @@ -266,7 +266,7 @@ void radeonChooseVertexState( struct gl_context *ctx ) TNLcontext *tnl = TNL_CONTEXT(ctx); GLuint se_coord_fmt = rmesa->hw.set.cmd[SET_SE_COORDFMT]; - + 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); @@ -314,7 +314,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, @@ -407,9 +407,9 @@ static GLboolean radeon_run_render( struct gl_context *ctx, tnl_render_func *tab = TAG(render_tab_verts); GLuint i; - if (rmesa->radeon.swtcl.RenderIndex != 0 || + if (rmesa->radeon.swtcl.RenderIndex != 0 || !radeon_dma_validate_render( ctx, VB )) - return GL_TRUE; + return GL_TRUE; radeon_prepare_render(&rmesa->radeon); if (rmesa->radeon.NewGLState) @@ -428,7 +428,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_lookup_enum_by_nr(prim & PRIM_MODE_MASK), + _mesa_lookup_enum_by_nr(prim & PRIM_MODE_MASK), start, start+length); if (length) @@ -488,7 +488,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" @@ -687,7 +687,7 @@ void radeonChooseRenderState( struct gl_context *ctx ) GLuint index = 0; GLuint flags = ctx->_TriangleCaps; - if (!rmesa->radeon.TclFallback || rmesa->radeon.Fallback) + if (!rmesa->radeon.TclFallback || rmesa->radeon.Fallback) return; if (flags & DD_TRI_LIGHT_TWOSIDE) index |= RADEON_TWOSIDE_BIT; @@ -734,7 +734,7 @@ static void radeonRenderPrimitive( struct gl_context *ctx, GLenum prim ) { r100ContextPtr rmesa = R100_CONTEXT(ctx); rmesa->radeon.swtcl.render_primitive = prim; - if (prim < GL_TRIANGLES || !(ctx->_TriangleCaps & DD_TRI_UNFILLED)) + if (prim < GL_TRIANGLES || !(ctx->_TriangleCaps & DD_TRI_UNFILLED)) radeonRasterPrimitive( ctx, reduced_hw_prim[prim] ); } @@ -853,9 +853,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; diff --git a/src/mesa/drivers/dri/radeon/radeon_swtcl.h b/src/mesa/drivers/dri/radeon/radeon_swtcl.h index ce2aa1e..1c74f9e 100644 --- a/src/mesa/drivers/dri/radeon/radeon_swtcl.h +++ b/src/mesa/drivers/dri/radeon/radeon_swtcl.h @@ -56,8 +56,8 @@ extern void radeon_emit_indexed_verts( struct gl_context *ctx, GLuint start, GLuint count ); -extern void radeon_translate_vertex( struct gl_context *ctx, - const radeonVertex *src, +extern void radeon_translate_vertex( struct gl_context *ctx, + const radeonVertex *src, SWvertex *dst ); extern void radeon_print_vertex( struct gl_context *ctx, const radeonVertex *v ); diff --git a/src/mesa/drivers/dri/radeon/radeon_tcl.c b/src/mesa/drivers/dri/radeon/radeon_tcl.c index 5d2e8f4..64d258d 100644 --- a/src/mesa/drivers/dri/radeon/radeon_tcl.c +++ b/src/mesa/drivers/dri/radeon/radeon_tcl.c @@ -103,7 +103,7 @@ static GLboolean discrete_prim[0x10] = { 0, 0, }; - + #define LOCAL_VARS r100ContextPtr rmesa = R100_CONTEXT(ctx) #define ELT_TYPE GLushort @@ -144,7 +144,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 ); @@ -164,19 +164,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, @@ -228,7 +228,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 ) @@ -236,7 +236,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 ) @@ -244,7 +244,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 ) { @@ -265,7 +265,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->_TriangleCaps & DD_FLATSHADE)) + if (prim == GL_POLYGON && (ctx->_TriangleCaps & DD_FLATSHADE)) se_cntl |= RADEON_FLAT_SHADE_VTX_0; else se_cntl |= RADEON_FLAT_SHADE_VTX_LAST; @@ -443,7 +443,7 @@ static GLboolean radeon_run_tcl_render( struct gl_context *ctx, GLuint inputs = VERT_BIT_POS | VERT_BIT_COLOR0; GLuint i; - /* 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 */ @@ -507,7 +507,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 = { @@ -543,16 +543,16 @@ static void transition_to_swtnl( struct gl_context *ctx ) radeonChooseVertexState( ctx ); radeonChooseRenderState( ctx ); - _mesa_validate_all_lighting_tables( ctx ); + _mesa_validate_all_lighting_tables( ctx ); - tnl->Driver.NotifyMaterialChange = + tnl->Driver.NotifyMaterialChange = _mesa_validate_all_lighting_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; @@ -581,14 +581,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, // __FUNCTION__ ); if (RADEON_DEBUG & RADEON_FALLBACKS) diff --git a/src/mesa/drivers/dri/radeon/radeon_tex.c b/src/mesa/drivers/dri/radeon/radeon_tex.c index 83b1d1b..5134d7f 100644 --- a/src/mesa/drivers/dri/radeon/radeon_tex.c +++ b/src/mesa/drivers/dri/radeon/radeon_tex.c @@ -53,7 +53,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 +158,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 @@ -382,13 +382,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(). */ @@ -422,7 +422,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.WrapS, t->base.WrapT ); radeonSetTexMaxAnisotropy( t, t->base.MaxAnisotropy ); radeonSetTexFilter( t, t->base.MinFilter, t->base.MagFilter ); diff --git a/src/mesa/drivers/dri/radeon/radeon_texstate.c b/src/mesa/drivers/dri/radeon/radeon_texstate.c index e972a67..f7a22f6 100644 --- a/src/mesa/drivers/dri/radeon/radeon_texstate.c +++ b/src/mesa/drivers/dri/radeon/radeon_texstate.c @@ -385,7 +385,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 (ctx->Texture.Unit[txunit]._Current->Image[0][0]->_BaseFormat == GL_LUMINANCE) alpha_arg[i] = radeon_zero_alpha[op+1]; @@ -617,7 +617,7 @@ void radeonSetTexOffset(__DRIcontext * pDRICtx, GLint texname, if (!offset) return; - + t->bo = NULL; t->override_offset = offset; t->pp_txpitch = pitch - 32; @@ -794,7 +794,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] ); @@ -802,7 +802,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<radeon.glCtx, (RADEON_TCL_FALLBACK_TEXGEN_0<recheck_texgen[unit] = GL_TRUE; @@ -825,7 +825,7 @@ static void disable_tex_obj_state( r100ContextPtr rmesa, rmesa->TexGenEnabled &= ~(RADEON_TEXMAT_0_ENABLE<TexGenEnabled &= ~(RADEON_TEXGEN_INPUT_MASK<TexGenNeedNormals[unit] = 0; - rmesa->TexGenEnabled |= + rmesa->TexGenEnabled |= (RADEON_TEXGEN_INPUT_TEXCOORD_0+unit) << inputshift; if (tmp != rmesa->TexGenEnabled) { @@ -882,7 +882,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, @@ -1057,8 +1057,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 { @@ -1070,7 +1070,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 | @@ -1133,7 +1133,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); diff --git a/src/mesa/drivers/dri/radeon/radeon_texture.c b/src/mesa/drivers/dri/radeon/radeon_texture.c index 8b1e34f..0741181 100644 --- a/src/mesa/drivers/dri/radeon/radeon_texture.c +++ b/src/mesa/drivers/dri/radeon/radeon_texture.c @@ -270,7 +270,7 @@ static void radeon_generate_mipmap(struct gl_context *ctx, GLenum target, radeon_miptree_unreference(&image->mt); } } - + } void radeonGenerateMipmap(struct gl_context* ctx, GLenum target, struct gl_texture_object *texObj) diff --git a/src/mesa/drivers/dri/radeon/server/radeon.h b/src/mesa/drivers/dri/radeon/server/radeon.h index 3fb1e37..babeee0 100644 --- a/src/mesa/drivers/dri/radeon/server/radeon.h +++ b/src/mesa/drivers/dri/radeon/server/radeon.h @@ -130,7 +130,7 @@ typedef struct { drm_handle_t registerHandle; /**< \brief MMIO register map handle */ int IsPCI; /* Current card is a PCI card */ - + /** * \name AGP */ @@ -193,7 +193,7 @@ typedef struct { unsigned int frontPitchOffset; unsigned int backPitchOffset; unsigned int depthPitchOffset; - + int colorTiling; /**< \brief Enable color tiling */ int irq; /**< \brief IRQ number */ diff --git a/src/mesa/drivers/dri/radeon/server/radeon_dri.h b/src/mesa/drivers/dri/radeon/server/radeon_dri.h index dc51372..88c8610 100644 --- a/src/mesa/drivers/dri/radeon/server/radeon_dri.h +++ b/src/mesa/drivers/dri/radeon/server/radeon_dri.h @@ -1,7 +1,7 @@ /** * \file server/radeon_dri.h * \brief Radeon server-side structures. - * + * * \author Kevin E. Martin * \author Rickard E. Faith */ diff --git a/src/mesa/drivers/dri/radeon/server/radeon_reg.h b/src/mesa/drivers/dri/radeon/server/radeon_reg.h index 1b33de1..6beb35a 100644 --- a/src/mesa/drivers/dri/radeon/server/radeon_reg.h +++ b/src/mesa/drivers/dri/radeon/server/radeon_reg.h @@ -296,8 +296,8 @@ # define RADEON_CRTC2_HSYNC_DIS (1 << 28) # define RADEON_CRTC2_VSYNC_DIS (1 << 29) #define RADEON_CRTC_MORE_CNTL 0x27c -# define RADEON_CRTC_H_CUTOFF_ACTIVE_EN (1<<4) -# define RADEON_CRTC_V_CUTOFF_ACTIVE_EN (1<<5) +# define RADEON_CRTC_H_CUTOFF_ACTIVE_EN (1<<4) +# define RADEON_CRTC_V_CUTOFF_ACTIVE_EN (1<<5) #define RADEON_CRTC_GUI_TRIG_VLINE 0x0218 #define RADEON_CRTC_H_SYNC_STRT_WID 0x0204 # define RADEON_CRTC_H_SYNC_STRT_PIX (0x07 << 0) diff --git a/src/mesa/drivers/dri/savage/Makefile b/src/mesa/drivers/dri/savage/Makefile index 5351155..466c1f5 100644 --- a/src/mesa/drivers/dri/savage/Makefile +++ b/src/mesa/drivers/dri/savage/Makefile @@ -17,9 +17,9 @@ DRIVER_SOURCES = \ C_SOURCES = \ $(COMMON_SOURCES) \ - $(DRIVER_SOURCES) + $(DRIVER_SOURCES) -ASM_SOURCES = +ASM_SOURCES = include ../Makefile.template diff --git a/src/mesa/drivers/dri/savage/savage_3d_reg.h b/src/mesa/drivers/dri/savage/savage_3d_reg.h index 45733cd..42725b2 100644 --- a/src/mesa/drivers/dri/savage/savage_3d_reg.h +++ b/src/mesa/drivers/dri/savage/savage_3d_reg.h @@ -294,7 +294,7 @@ typedef union /** * This bit enables \c GL_FUNC_SUBTRACT. Like most DirectX oriented * hardware, there's no way to do \c GL_FUNC_REVERSE_SUBTRACT. - * + * * \todo * Add support for \c GL_FUNC_SUBTRACT! */ @@ -384,7 +384,7 @@ typedef union Address Registers **********************************/ -/* I havn't found a Savage3D equivalent of this reg in the Utah-driver. +/* I havn't found a Savage3D equivalent of this reg in the Utah-driver. * But Tim Roberts claims that the Savage3D supports DMA vertex and * command buffers. */ typedef union @@ -399,7 +399,7 @@ typedef union uint32_t ui; } savageRegVertBufAddr; -/* I havn't found a Savage3D equivalent of this reg in the Utah-driver. +/* I havn't found a Savage3D equivalent of this reg in the Utah-driver. * But Tim Roberts claims that the Savage3D supports DMA vertex and * command buffers. */ typedef union @@ -498,7 +498,7 @@ typedef union unsigned offset : 14; unsigned reserved : 11; /* 12-bits in Utah-driver */ unsigned zBufWidthInTiles : 6; - + /** * 0 selects 16-bit depth buffer. On Savage4 hardware, 1 selects * 24-bit depth buffer (with 8-bits for stencil). Though it has never @@ -635,7 +635,7 @@ typedef union #define SAVAGE_DESTCTRL_S3D 0x34 #define SAVAGE_SCSTART_S3D 0x35 #define SAVAGE_SCEND_S3D 0x36 -#define SAVAGE_ZWATERMARK_S3D 0x37 +#define SAVAGE_ZWATERMARK_S3D 0x37 #define SAVAGE_DESTTEXRWWATERMARK_S3D 0x38 #define SAVAGE_FIRST_REG 0x18 diff --git a/src/mesa/drivers/dri/savage/savage_bci.h b/src/mesa/drivers/dri/savage/savage_bci.h index 33cfac3..77db029 100644 --- a/src/mesa/drivers/dri/savage/savage_bci.h +++ b/src/mesa/drivers/dri/savage/savage_bci.h @@ -84,7 +84,7 @@ typedef enum { AMO_LPBCapVEUVerSRR=0x0100FFB4, AMO_LPBCapVeuDnScDR=0x0100FFB8 -}AddressMapOffset; +}AddressMapOffset; /*more to add*/ @@ -225,7 +225,7 @@ typedef enum { CRI_MV2 = 0x48, CRI_MV3 = 0x49, CRI_MacroDescr = 0x4a, /*kickoff?*/ - + CRI_MeuCtrl = 0x50, CRI_SrcYAddr = 0x51, CRI_DestAddr = 0x52, @@ -234,9 +234,9 @@ typedef enum { CRI_SrcCbAddr = 0x55, CRI_SrcCrAddr = 0x56, CRI_SrcCrCbStride = 0x57, - + CRI_BCI_Power= 0x5f, - + CRI_PSCtrl=0xA0, CRI_SSClrKeyCtrl=0xA1, CRI_SSCtrl=0xA4, diff --git a/src/mesa/drivers/dri/savage/savage_init.h b/src/mesa/drivers/dri/savage/savage_init.h index bfd3077..6a2340b 100644 --- a/src/mesa/drivers/dri/savage/savage_init.h +++ b/src/mesa/drivers/dri/savage/savage_init.h @@ -51,7 +51,7 @@ typedef struct { unsigned int bufferSize; -#if 0 +#if 0 int bitsPerPixel; #endif unsigned int frontFormat; @@ -65,7 +65,7 @@ typedef struct { unsigned int textureSize[SAVAGE_NR_TEX_HEAPS]; unsigned int logTextureGranularity[SAVAGE_NR_TEX_HEAPS]; drmAddress texVirtual[SAVAGE_NR_TEX_HEAPS]; - + __DRIscreen *driScrnPriv; savageRegion aperture; @@ -90,7 +90,7 @@ extern void savageXMesaSetClipRects(savageContextPtr imesa); #define GET_ENQUEUE_AGE( imesa ) imesa->sarea->last_enqueue -/* Lock the hardware and validate our state. +/* Lock the hardware and validate our state. */ #define LOCK_HARDWARE( imesa ) \ do { \ @@ -103,7 +103,7 @@ extern void savageXMesaSetClipRects(savageContextPtr imesa); -/* Unlock the hardware using the global current context +/* Unlock the hardware using the global current context */ #define UNLOCK_HARDWARE(imesa) \ DRM_UNLOCK(imesa->driFd, imesa->driHwLock, imesa->hHWContext); @@ -111,7 +111,7 @@ extern void savageXMesaSetClipRects(savageContextPtr imesa); /* This is the wrong way to do it, I'm sure. Otherwise the drm * bitches that I've already got the heavyweight lock. At worst, - * this is 3 ioctls. The best solution probably only gets me down + * this is 3 ioctls. The best solution probably only gets me down * to 2 ioctls in the worst case. */ #define LOCK_HARDWARE_QUIESCENT( imesa ) do { \ @@ -137,7 +137,7 @@ extern void savageXMesaSetClipRects(savageContextPtr imesa); #define S3_MOBILE_TWISTER_SERIES(chip) ((chip==S3_TWISTER) \ ||(chip==S3_PROSAVAGEDDR)) -/* Chip tags. These are used to group the adapters into +/* Chip tags. These are used to group the adapters into * related families. */ diff --git a/src/mesa/drivers/dri/savage/savage_xmesa.c b/src/mesa/drivers/dri/savage/savage_xmesa.c index 92fb4f4..d627f68 100644 --- a/src/mesa/drivers/dri/savage/savage_xmesa.c +++ b/src/mesa/drivers/dri/savage/savage_xmesa.c @@ -184,7 +184,7 @@ savageInitDriver(__DRIscreen *sPriv) savageScreen->driScrnPriv = sPriv; sPriv->private = (void *)savageScreen; - savageScreen->chipset=gDRIPriv->chipset; + savageScreen->chipset=gDRIPriv->chipset; savageScreen->width=gDRIPriv->width; savageScreen->height=gDRIPriv->height; savageScreen->mem=gDRIPriv->mem; @@ -195,24 +195,24 @@ savageInitDriver(__DRIscreen *sPriv) savageScreen->bufferSize=gDRIPriv->bufferSize; - if (gDRIPriv->cpp == 4) + if (gDRIPriv->cpp == 4) savageScreen->frontFormat = DV_PF_8888; else savageScreen->frontFormat = DV_PF_565; savageScreen->frontOffset=gDRIPriv->frontOffset; - savageScreen->backOffset = gDRIPriv->backOffset; + savageScreen->backOffset = gDRIPriv->backOffset; savageScreen->depthOffset=gDRIPriv->depthOffset; - savageScreen->textureOffset[SAVAGE_CARD_HEAP] = + savageScreen->textureOffset[SAVAGE_CARD_HEAP] = gDRIPriv->textureOffset; - savageScreen->textureSize[SAVAGE_CARD_HEAP] = + savageScreen->textureSize[SAVAGE_CARD_HEAP] = gDRIPriv->textureSize; - savageScreen->logTextureGranularity[SAVAGE_CARD_HEAP] = + savageScreen->logTextureGranularity[SAVAGE_CARD_HEAP] = gDRIPriv->logTextureGranularity; - savageScreen->textureOffset[SAVAGE_AGP_HEAP] = + savageScreen->textureOffset[SAVAGE_AGP_HEAP] = gDRIPriv->agpTextureHandle; - savageScreen->textureSize[SAVAGE_AGP_HEAP] = + savageScreen->textureSize[SAVAGE_AGP_HEAP] = gDRIPriv->agpTextureSize; savageScreen->logTextureGranularity[SAVAGE_AGP_HEAP] = gDRIPriv->logAgpTextureGranularity; @@ -220,7 +220,7 @@ savageInitDriver(__DRIscreen *sPriv) savageScreen->agpTextures.handle = gDRIPriv->agpTextureHandle; savageScreen->agpTextures.size = gDRIPriv->agpTextureSize; if (gDRIPriv->agpTextureSize) { - if (drmMap(sPriv->fd, + if (drmMap(sPriv->fd, savageScreen->agpTextures.handle, savageScreen->agpTextures.size, (drmAddress *)&(savageScreen->agpTextures.map)) != 0) { @@ -231,18 +231,18 @@ savageInitDriver(__DRIscreen *sPriv) } else savageScreen->agpTextures.map = NULL; - savageScreen->texVirtual[SAVAGE_CARD_HEAP] = + savageScreen->texVirtual[SAVAGE_CARD_HEAP] = (drmAddress)(((GLubyte *)sPriv->pFB)+gDRIPriv->textureOffset); - savageScreen->texVirtual[SAVAGE_AGP_HEAP] = + savageScreen->texVirtual[SAVAGE_AGP_HEAP] = (drmAddress)(savageScreen->agpTextures.map); savageScreen->aperture.handle = gDRIPriv->apertureHandle; savageScreen->aperture.size = gDRIPriv->apertureSize; savageScreen->aperturePitch = gDRIPriv->aperturePitch; - if (drmMap(sPriv->fd, - savageScreen->aperture.handle, - savageScreen->aperture.size, - (drmAddress *)&savageScreen->aperture.map) != 0) + if (drmMap(sPriv->fd, + savageScreen->aperture.handle, + savageScreen->aperture.size, + (drmAddress *)&savageScreen->aperture.map) != 0) { free(savageScreen); sPriv->private = NULL; @@ -312,7 +312,7 @@ savageCreateContext( gl_api api, /* Allocate the Mesa context */ if (sharedContextPrivate) shareCtx = ((savageContextPtr) sharedContextPrivate)->glCtx; - else + else shareCtx = NULL; ctx = _mesa_create_context(mesaVis, shareCtx, &functions, imesa); if (!ctx) { @@ -350,25 +350,25 @@ savageCreateContext( gl_api api, imesa->hHWContext = driContextPriv->hHWContext; imesa->driFd = sPriv->fd; imesa->driHwLock = &sPriv->pSAREA->lock; - + imesa->savageScreen = savageScreen; imesa->driScreen = sPriv; imesa->sarea = saPriv; imesa->glBuffer = NULL; - + /* DMA buffer */ for(i=0;i<5;i++) { - imesa->apertureBase[i] = (GLubyte *)savageScreen->aperture.map + + imesa->apertureBase[i] = (GLubyte *)savageScreen->aperture.map + 0x01000000 * i; } - + imesa->aperturePitch = savageScreen->aperturePitch; /* change texHeap initialize to support two kind of texture heap*/ /* here is some parts of initialization, others in InitDriver() */ - + (void) memset( imesa->textureHeaps, 0, sizeof( imesa->textureHeaps ) ); make_empty_list( & imesa->swapped ); @@ -386,7 +386,7 @@ savageCreateContext( gl_api api, break; /*default: Nothing to do, use all available memory. */ } - + for (i = 0; i < imesa->lastTexHeap; i++) { imesa->textureHeaps[i] = driCreateTextureHeap( i, imesa, @@ -479,7 +479,7 @@ savageCreateContext( gl_api api, _swrast_CreateContext( ctx ); _vbo_CreateContext( ctx ); _tnl_CreateContext( ctx ); - + _swsetup_CreateContext( ctx ); /* Install the customized pipeline: @@ -687,7 +687,7 @@ savageDestroyBuffer(__DRIdrawable *driDrawPriv) void XMesaSwapBuffers(__DRIdrawable *driDrawPriv) { /* XXX should do swap according to the buffer, not the context! */ - savageContextPtr imesa = savageCtx; + savageContextPtr imesa = savageCtx; FLUSH_VB( imesa->glCtx, "swap buffers" ); savageSwapBuffers(imesa); @@ -716,7 +716,7 @@ void savageXMesaSetClipRects(savageContextPtr imesa) } -static void savageXMesaWindowMoved( savageContextPtr imesa ) +static void savageXMesaWindowMoved( savageContextPtr imesa ) { __DRIdrawable *const drawable = imesa->driDrawable; __DRIdrawable *const readable = imesa->driReadable; @@ -747,16 +747,16 @@ savageUnbindContext(__DRIcontext *driContextPriv) static GLboolean savageOpenFullScreen(__DRIcontext *driContextPriv) { - - - + + + if (driContextPriv) { savageContextPtr imesa = (savageContextPtr) driContextPriv->driverPrivate; imesa->IsFullScreen = GL_TRUE; imesa->backup_frontOffset = imesa->savageScreen->frontOffset; imesa->backup_backOffset = imesa->savageScreen->backOffset; imesa->backup_frontBitmapDesc = imesa->savageScreen->frontBitmapDesc; - imesa->savageScreen->frontBitmapDesc = imesa->savageScreen->backBitmapDesc; + imesa->savageScreen->frontBitmapDesc = imesa->savageScreen->backBitmapDesc; imesa->toggle = TARGET_BACK; } @@ -766,11 +766,11 @@ savageOpenFullScreen(__DRIcontext *driContextPriv) static GLboolean savageCloseFullScreen(__DRIcontext *driContextPriv) { - + if (driContextPriv) { savageContextPtr imesa = (savageContextPtr) driContextPriv->driverPrivate; WAIT_IDLE_EMPTY(imesa); - imesa->IsFullScreen = GL_FALSE; + imesa->IsFullScreen = GL_FALSE; imesa->savageScreen->frontOffset = imesa->backup_frontOffset; imesa->savageScreen->backOffset = imesa->backup_backOffset; imesa->savageScreen->frontBitmapDesc = imesa->backup_frontBitmapDesc; @@ -804,12 +804,12 @@ savageMakeCurrent(__DRIcontext *driContextPriv, imesa->driReadable = driReadPriv; imesa->driDrawable = driDrawPriv; imesa->dirty = ~0; - + _mesa_make_current(imesa->glCtx, drawBuffer, readBuffer); - + savageXMesaWindowMoved( imesa ); } - else + else { _mesa_make_current(NULL, NULL, NULL); } @@ -817,22 +817,22 @@ savageMakeCurrent(__DRIcontext *driContextPriv, } -void savageGetLock( savageContextPtr imesa, GLuint flags ) +void savageGetLock( savageContextPtr imesa, GLuint flags ) { __DRIdrawable *const drawable = imesa->driDrawable; __DRIdrawable *const readable = imesa->driReadable; __DRIscreen *sPriv = imesa->driScreen; drm_savage_sarea_t *sarea = imesa->sarea; int me = imesa->hHWContext; - int stamp = drawable->lastStamp; + int stamp = drawable->lastStamp; int heap; unsigned int timestamp = 0; - + /* We know there has been contention. */ - drmGetLock(imesa->driFd, imesa->hHWContext, flags); + drmGetLock(imesa->driFd, imesa->hHWContext, flags); /* Note contention for throttling hint @@ -916,7 +916,7 @@ savageFillInModes( __DRIscreen *psp, depth_bits_array[0] = depth_bits; depth_bits_array[1] = depth_bits; - + /* Just like with the accumulation buffer, always provide some modes * with a stencil buffer. It will be a sw fallback, but some apps won't * care about that. @@ -964,7 +964,7 @@ savageFillInModes( __DRIscreen *psp, /** * This is the driver specific part of the createNewScreen entry point. - * + * * \todo maybe fold this into intelInitDriver * * \return the struct gl_config supported by this driver @@ -994,7 +994,7 @@ savageInitScreen(__DRIscreen *psp) } const struct __DriverAPIRec driDriverAPI = { - savageInitScreen, + savageInitScreen, savageDestroyScreen, savageCreateContext, savageDestroyContext, diff --git a/src/mesa/drivers/dri/savage/savagecontext.h b/src/mesa/drivers/dri/savage/savagecontext.h index 75bec62..d86bb95 100644 --- a/src/mesa/drivers/dri/savage/savagecontext.h +++ b/src/mesa/drivers/dri/savage/savagecontext.h @@ -50,8 +50,8 @@ typedef struct savage_texture_object_t *savageTextureObjectPtr; #define SAVAGE_FALLBACK_TEXTURE 0x1 #define SAVAGE_FALLBACK_DRAW_BUFFER 0x2 #define SAVAGE_FALLBACK_READ_BUFFER 0x4 -#define SAVAGE_FALLBACK_COLORMASK 0x8 -#define SAVAGE_FALLBACK_SPECULAR 0x10 +#define SAVAGE_FALLBACK_COLORMASK 0x8 +#define SAVAGE_FALLBACK_SPECULAR 0x10 #define SAVAGE_FALLBACK_LOGICOP 0x20 /*frank 2001/11/12 add the stencil fallbak*/ #define SAVAGE_FALLBACK_STENCIL 0x40 @@ -71,7 +71,7 @@ typedef struct savage_texture_object_t *savageTextureObjectPtr; /* What needs to be changed for the current vertex dma buffer? * This will go away! */ -#define SAVAGE_UPLOAD_LOCAL 0x1 /* DrawLocalCtrl (S4) or +#define SAVAGE_UPLOAD_LOCAL 0x1 /* DrawLocalCtrl (S4) or DrawCtrl and ZBufCtrl (S3D) */ #define SAVAGE_UPLOAD_TEX0 0x2 /* texture unit 0 */ #define SAVAGE_UPLOAD_TEX1 0x4 /* texture unit 1 (S4 only) */ @@ -162,7 +162,7 @@ struct savage_context_t { savageRegisters regs, oldRegs, globalRegMask; /* Manage our own state */ - GLuint new_state; + GLuint new_state; GLuint new_gl_state; GLboolean ptexHack; @@ -190,19 +190,19 @@ struct savage_context_t { GLuint LcsCullMode; GLuint texEnvColor; - /* Vertex state + /* Vertex state */ GLuint vertex_size; struct tnl_attr_map vertex_attrs[VERT_ATTRIB_MAX]; GLuint vertex_attr_count; char *verts; /* points to tnl->clipspace.vertex_buf */ - /* Rasterization state + /* Rasterization state */ GLuint SetupNewInputs; GLuint SetupIndex; GLuint RenderIndex; - + GLuint hw_primitive; GLenum raster_primitive; GLenum render_primitive; @@ -211,7 +211,7 @@ struct savage_context_t { GLubyte HwPrim; GLuint HwVertexSize; - /* Fallback rasterization functions + /* Fallback rasterization functions */ savage_point_func draw_point; savage_line_func draw_line; @@ -227,7 +227,7 @@ struct savage_context_t { GLuint bufferSize; struct gl_framebuffer *glBuffer; - + /* Two flags to keep track of fallbacks. */ GLuint Fallback; @@ -243,7 +243,7 @@ struct savage_context_t { /* use this bit to support single/double buffer */ GLuint IsDouble; - /* use this to indicate Fullscreen mode */ + /* use this to indicate Fullscreen mode */ GLuint IsFullScreen; /* FIXME - open/close fullscreen is gone, is this needed? */ GLuint backup_frontOffset; GLuint backup_backOffset; @@ -251,7 +251,7 @@ struct savage_context_t { GLuint toggle; GLuint backup_streamFIFO; GLuint NotFirstFrame; - + GLboolean inSwap; GLuint lastSwap; GLuint ctxAge; @@ -275,7 +275,7 @@ struct savage_context_t { __DRIdrawable *driReadable; __DRIscreen *driScreen; - savageScreenPrivate *savageScreen; + savageScreenPrivate *savageScreen; drm_savage_sarea_t *sarea; GLboolean hw_stencil; @@ -298,7 +298,7 @@ struct savage_context_t { #define SAVAGE_CONTEXT(ctx) ((savageContextPtr)(ctx->DriverCtx)) /* To remove all debugging, make sure SAVAGE_DEBUG is defined as a - * preprocessor symbol, and equal to zero. + * preprocessor symbol, and equal to zero. */ #ifndef SAVAGE_DEBUG extern int SAVAGE_DEBUG; diff --git a/src/mesa/drivers/dri/savage/savageioctl.c b/src/mesa/drivers/dri/savage/savageioctl.c index 46bbb65..dcfdec8 100644 --- a/src/mesa/drivers/dri/savage/savageioctl.c +++ b/src/mesa/drivers/dri/savage/savageioctl.c @@ -126,7 +126,7 @@ static void savage_BCI_clear(struct gl_context *ctx, drm_savage_clear_t *pclear) drm_clip_rect_t *pbox = imesa->sarea->boxes; int i; - + if (nbox > SAVAGE_NR_SAREA_CLIPRECTS) nbox = SAVAGE_NR_SAREA_CLIPRECTS; @@ -163,14 +163,14 @@ static void savage_BCI_clear(struct gl_context *ctx, drm_savage_clear_t *pclear) WRITE_CMD((bciptr) , (height << 16) | width,uint32_t); savageDMACommit (imesa, bciptr); } - + if ( pclear->flags & (SAVAGE_DEPTH |SAVAGE_STENCIL) ) { uint32_t writeMask = 0x0; if(imesa->hw_stencil) - { + { if(pclear->flags & SAVAGE_STENCIL) { - + writeMask |= 0xFF000000; } if(pclear->flags & SAVAGE_DEPTH) @@ -184,14 +184,14 @@ static void savage_BCI_clear(struct gl_context *ctx, drm_savage_clear_t *pclear) imesa->regs.s4.zBufCtrl.ni.autoZEnable = GL_TRUE; imesa->regs.s4.zBufCtrl.ni.frameID = ~imesa->regs.s4.zBufCtrl.ni.frameID; - + imesa->dirty |= SAVAGE_UPLOAD_GLOBAL; } else { if(imesa->IsFullScreen) imesa->NotFirstFrame = GL_TRUE; - + if(imesa->hw_stencil) { bciptr = savageDMAAlloc (imesa, 10); @@ -217,7 +217,7 @@ static void savage_BCI_clear(struct gl_context *ctx, drm_savage_clear_t *pclear) if(writeMask != 0xFFFFFFFF) { WRITE_CMD((bciptr) , 0x960100D7,uint32_t); - WRITE_CMD((bciptr) , 0xFFFFFFFF,uint32_t); + WRITE_CMD((bciptr) , 0xFFFFFFFF,uint32_t); } } savageDMACommit (imesa, bciptr); @@ -235,23 +235,23 @@ static void savage_BCI_swap(savageContextPtr imesa) drm_clip_rect_t *pbox = imesa->sarea->boxes; int i; volatile uint32_t *bciptr; - + if (nbox > SAVAGE_NR_SAREA_CLIPRECTS) nbox = SAVAGE_NR_SAREA_CLIPRECTS; savageDMAFlush (imesa); - + if(imesa->IsFullScreen) { /* full screen*/ unsigned int tmp0; - tmp0 = imesa->savageScreen->frontOffset; + tmp0 = imesa->savageScreen->frontOffset; imesa->savageScreen->frontOffset = imesa->savageScreen->backOffset; imesa->savageScreen->backOffset = tmp0; - + if(imesa->toggle == TARGET_BACK) imesa->toggle = TARGET_FRONT; else - imesa->toggle = TARGET_BACK; - + imesa->toggle = TARGET_BACK; + driFlipRenderbuffers(imesa->glCtx->DrawBuffer, imesa->toggle != TARGET_FRONT); @@ -259,18 +259,18 @@ static void savage_BCI_swap(savageContextPtr imesa) imesa->dirty |= SAVAGE_UPLOAD_GLOBAL; bciptr = SAVAGE_GET_BCI_POINTER(imesa,3); *(bciptr) = 0x960100B0; - *(bciptr) = (imesa->savageScreen->frontOffset); + *(bciptr) = (imesa->savageScreen->frontOffset); *(bciptr) = 0xA0000000; - } - + } + else { /* Use bitblt copy from back to front buffer*/ - + for (i = 0 ; i < nbox; i++, pbox++) { unsigned int w = pbox->x2 - pbox->x1; unsigned int h = pbox->y2 - pbox->y1; - + if (pbox->x1 > pbox->x2 || pbox->y1 > pbox->y2 || pbox->x2 > imesa->savageScreen->width || @@ -278,16 +278,16 @@ static void savage_BCI_swap(savageContextPtr imesa) continue; bciptr = SAVAGE_GET_BCI_POINTER(imesa,6); - + *(bciptr) = 0x4BCC00C0; - + *(bciptr) = imesa->savageScreen->backOffset; *(bciptr) = imesa->savageScreen->backBitmapDesc; *(bciptr) = (pbox->y1 <<16) | pbox->x1; /*x0, y0*/ *(bciptr) = (pbox->y1 <<16) | pbox->x1; *(bciptr) = (h << 16) | w; } - + } } #endif @@ -388,7 +388,7 @@ static void savageDDClear( struct gl_context *ctx, GLbitfield mask ) (imesa->savageScreen->zpp == 2) ? 0xffffffff : 0x00ffffff; mask &= ~BUFFER_BIT_DEPTH; } - + if((mask & BUFFER_BIT_STENCIL) && imesa->hw_stencil) { flags |= SAVAGE_DEPTH; @@ -424,12 +424,12 @@ static void savageDDClear( struct gl_context *ctx, GLbitfield mask ) } } - if (mask) + if (mask) _swrast_Clear( ctx, mask ); } /* - * Copy the back buffer to the front buffer. + * Copy the back buffer to the front buffer. */ void savageSwapBuffers( __DRIdrawable *dPriv ) { @@ -625,7 +625,7 @@ void savageFlushCmdBufLocked( savageContextPtr imesa, GLboolean discard ) } -void savageFlushCmdBuf( savageContextPtr imesa, GLboolean discard ) +void savageFlushCmdBuf( savageContextPtr imesa, GLboolean discard ) { if (SAVAGE_DEBUG & DEBUG_VERBOSE_MSG) fprintf (stderr, "%s\n", __FUNCTION__); @@ -644,7 +644,7 @@ static void savageDDFlush( struct gl_context *ctx ) savageFlushCmdBuf(imesa, GL_FALSE); } -static void savageDDFinish( struct gl_context *ctx ) +static void savageDDFinish( struct gl_context *ctx ) { savageContextPtr imesa = SAVAGE_CONTEXT(ctx); if (SAVAGE_DEBUG & DEBUG_VERBOSE_MSG) diff --git a/src/mesa/drivers/dri/savage/savageioctl.h b/src/mesa/drivers/dri/savage/savageioctl.h index 7d34825..0bb34a4 100644 --- a/src/mesa/drivers/dri/savage/savageioctl.h +++ b/src/mesa/drivers/dri/savage/savageioctl.h @@ -28,7 +28,7 @@ #include "savagecontext.h" -void savageFlushVertices( savageContextPtr mmesa ); +void savageFlushVertices( savageContextPtr mmesa ); unsigned int savageEmitEventLocked( savageContextPtr imesa, unsigned int flags ); unsigned int savageEmitEvent( savageContextPtr imesa, unsigned int flags ); diff --git a/src/mesa/drivers/dri/savage/savagerender.c b/src/mesa/drivers/dri/savage/savagerender.c index 8cc448a..ac42c5c 100644 --- a/src/mesa/drivers/dri/savage/savagerender.c +++ b/src/mesa/drivers/dri/savage/savagerender.c @@ -57,7 +57,7 @@ #define HAVE_ELTS 1 -#define LOCAL_VARS savageContextPtr imesa = SAVAGE_CONTEXT(ctx) +#define LOCAL_VARS savageContextPtr imesa = SAVAGE_CONTEXT(ctx) #define INIT( prim ) do { \ if (0) fprintf(stderr, "%s\n", __FUNCTION__); \ savageFlushVertices(imesa); \ @@ -147,7 +147,7 @@ static GLboolean savage_run_render( struct gl_context *ctx, { savageContextPtr imesa = SAVAGE_CONTEXT(ctx); TNLcontext *tnl = TNL_CONTEXT(ctx); - struct vertex_buffer *VB = &tnl->vb; + struct vertex_buffer *VB = &tnl->vb; tnl_render_func *tab, *tab_elts; GLboolean valid; GLuint i; @@ -171,7 +171,7 @@ static GLboolean savage_run_render( struct gl_context *ctx, if (imesa->RenderIndex != 0 || !valid) { return GL_TRUE; } - + tnl->Driver.Render.Start( ctx ); /* Check RenderIndex again. The ptexHack is detected late in RenderStart. * Also check for ptex fallbacks detected late. @@ -212,8 +212,8 @@ static GLboolean savage_run_render( struct gl_context *ctx, return GL_FALSE; /* finished the pipe */ } -struct tnl_pipeline_stage _savage_render_stage = -{ +struct tnl_pipeline_stage _savage_render_stage = +{ "savage render", NULL, NULL, @@ -321,7 +321,7 @@ static GLboolean alloc_texnorm_data( struct gl_context *ctx, for (i = 0 ; i < ctx->Const.MaxTextureUnits ; i++) _mesa_vector4f_alloc( &store->texcoord[i], 0, VB->Size, 32 ); - + return GL_TRUE; } diff --git a/src/mesa/drivers/dri/savage/savagestate.c b/src/mesa/drivers/dri/savage/savagestate.c index 0906f85..e30ae61 100644 --- a/src/mesa/drivers/dri/savage/savagestate.c +++ b/src/mesa/drivers/dri/savage/savagestate.c @@ -76,8 +76,8 @@ static void savageBlendFunc_s4(struct gl_context *); static void savageBlendFunc_s3d(struct gl_context *); -static INLINE GLuint savagePackColor(GLuint format, - GLubyte r, GLubyte g, +static INLINE GLuint savagePackColor(GLuint format, + GLubyte r, GLubyte g, GLubyte b, GLubyte a) { switch (format) { @@ -86,7 +86,7 @@ static INLINE GLuint savagePackColor(GLuint format, case DV_PF_565: return SAVAGEPACKCOLOR565(r,g,b); default: - + return 0; } } @@ -106,11 +106,11 @@ static void savageDDBlendEquationSeparate(struct gl_context *ctx, { assert( modeRGB == modeA ); - /* BlendEquation sets ColorLogicOpEnabled in an unexpected - * manner. + /* BlendEquation sets ColorLogicOpEnabled in an unexpected + * manner. */ FALLBACK( ctx, SAVAGE_FALLBACK_LOGICOP, - (ctx->Color.ColorLogicOpEnabled && + (ctx->Color.ColorLogicOpEnabled && ctx->Color.LogicOp != GL_COPY)); /* Can only do blend addition, not min, max, subtract, etc. */ @@ -233,7 +233,7 @@ static void savageBlendFunc_s4(struct gl_context *ctx) break; case GL_ONE_MINUS_DST_ALPHA: - if (imesa->glCtx->Visual.alphaBits == 0) + if (imesa->glCtx->Visual.alphaBits == 0) { imesa->regs.s4.drawLocalCtrl.ni.srcAlphaMode = SAM_Zero; } @@ -253,25 +253,25 @@ static void savageBlendFunc_s4(struct gl_context *ctx) /* alpha test*/ - if(ctx->Color.AlphaEnabled) + if(ctx->Color.AlphaEnabled) { ACmpFunc a; GLubyte alphaRef; CLAMPED_FLOAT_TO_UBYTE(alphaRef,ctx->Color.AlphaRef); - - switch(ctx->Color.AlphaFunc) { + + switch(ctx->Color.AlphaFunc) { case GL_NEVER: a = CF_Never; break; case GL_ALWAYS: a = CF_Always; break; - case GL_LESS: a = CF_Less; break; + case GL_LESS: a = CF_Less; break; case GL_LEQUAL: a = CF_LessEqual; break; case GL_EQUAL: a = CF_Equal; break; case GL_GREATER: a = CF_Greater; break; case GL_GEQUAL: a = CF_GreaterEqual; break; case GL_NOTEQUAL: a = CF_NotEqual; break; default:return; - } - + } + imesa->regs.s4.drawCtrl1.ni.alphaTestEn = GL_TRUE; imesa->regs.s4.drawCtrl1.ni.alphaTestCmpFunc = a; imesa->regs.s4.drawCtrl0.ni.alphaRefVal = alphaRef; @@ -407,7 +407,7 @@ static void savageBlendFunc_s3d(struct gl_context *ctx) break; case GL_ONE_MINUS_DST_ALPHA: - if (imesa->glCtx->Visual.alphaBits == 0) + if (imesa->glCtx->Visual.alphaBits == 0) { imesa->regs.s3d.drawCtrl.ni.srcAlphaMode = SAM_Zero; } @@ -427,24 +427,24 @@ static void savageBlendFunc_s3d(struct gl_context *ctx) /* alpha test*/ - if(ctx->Color.AlphaEnabled) + if(ctx->Color.AlphaEnabled) { ACmpFunc a; GLubyte alphaRef; CLAMPED_FLOAT_TO_UBYTE(alphaRef,ctx->Color.AlphaRef); - - switch(ctx->Color.AlphaFunc) { + + switch(ctx->Color.AlphaFunc) { case GL_NEVER: a = CF_Never; break; case GL_ALWAYS: a = CF_Always; break; - case GL_LESS: a = CF_Less; break; + case GL_LESS: a = CF_Less; break; case GL_LEQUAL: a = CF_LessEqual; break; case GL_EQUAL: a = CF_Equal; break; case GL_GREATER: a = CF_Greater; break; case GL_GEQUAL: a = CF_GreaterEqual; break; case GL_NOTEQUAL: a = CF_NotEqual; break; default:return; - } + } imesa->regs.s3d.drawCtrl.ni.alphaTestEn = GL_TRUE; imesa->regs.s3d.drawCtrl.ni.alphaTestCmpFunc = a; @@ -465,14 +465,14 @@ static void savageBlendFunc_s3d(struct gl_context *ctx) imesa->dirty |= SAVAGE_UPLOAD_LOCAL; } -static void savageDDBlendFuncSeparate_s4( struct gl_context *ctx, GLenum sfactorRGB, +static void savageDDBlendFuncSeparate_s4( struct gl_context *ctx, GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorA, GLenum dfactorA ) { assert (dfactorRGB == dfactorA && sfactorRGB == sfactorA); savageBlendFunc_s4( ctx ); } -static void savageDDBlendFuncSeparate_s3d( struct gl_context *ctx, GLenum sfactorRGB, +static void savageDDBlendFuncSeparate_s3d( struct gl_context *ctx, GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorA, GLenum dfactorA ) { @@ -498,14 +498,14 @@ static void savageDDDepthFunc_s4(struct gl_context *ctx, GLenum func) switch(func) { /* reversed (see savageCalcViewport) */ case GL_NEVER: zmode = CF_Never; break; case GL_ALWAYS: zmode = CF_Always; break; - case GL_LESS: zmode = CF_Greater; break; + case GL_LESS: zmode = CF_Greater; break; case GL_LEQUAL: zmode = CF_GreaterEqual; break; case GL_EQUAL: zmode = CF_Equal; break; case GL_GREATER: zmode = CF_Less; break; case GL_GEQUAL: zmode = CF_LessEqual; break; case GL_NOTEQUAL: zmode = CF_NotEqual; break; default:return; - } + } if (ctx->Depth.Test) { @@ -561,20 +561,20 @@ static void savageDDDepthFunc_s3d(struct gl_context *ctx, GLenum func) switch(func) { /* reversed (see savageCalcViewport) */ case GL_NEVER: zmode = CF_Never; break; case GL_ALWAYS: zmode = CF_Always; break; - case GL_LESS: zmode = CF_Greater; break; + case GL_LESS: zmode = CF_Greater; break; case GL_LEQUAL: zmode = CF_GreaterEqual; break; case GL_EQUAL: zmode = CF_Equal; break; case GL_GREATER: zmode = CF_Less; break; case GL_GEQUAL: zmode = CF_LessEqual; break; case GL_NOTEQUAL: zmode = CF_NotEqual; break; default:return; - } + } if (ctx->Depth.Test) { imesa->regs.s3d.zBufCtrl.ni.zBufEn = GL_TRUE; imesa->regs.s3d.zBufCtrl.ni.zCmpFunc = zmode; imesa->regs.s3d.zBufCtrl.ni.zUpdateEn = ctx->Depth.Mask; - + imesa->regs.s3d.drawCtrl.ni.flushPdZbufWrites = GL_TRUE; } else @@ -592,7 +592,7 @@ static void savageDDDepthFunc_s3d(struct gl_context *ctx, GLenum func) imesa->regs.s3d.zBufCtrl.ni.zUpdateEn = GL_FALSE; imesa->regs.s3d.drawCtrl.ni.flushPdZbufWrites = GL_FALSE; } - + if (drawCtrl != imesa->regs.s3d.drawCtrl.ui || zBufCtrl != imesa->regs.s3d.zBufCtrl.ui) imesa->dirty |= SAVAGE_UPLOAD_LOCAL; @@ -617,7 +617,7 @@ static void savageDDDepthMask_s3d(struct gl_context *ctx, GLboolean flag) */ -static void savageDDScissor( struct gl_context *ctx, GLint x, GLint y, +static void savageDDScissor( struct gl_context *ctx, GLint x, GLint y, GLsizei w, GLsizei h ) { savageContextPtr imesa = SAVAGE_CONTEXT(ctx); @@ -658,7 +658,7 @@ static void savageDDDrawBuffer(struct gl_context *ctx, GLenum mode ) FALLBACK( ctx, SAVAGE_FALLBACK_DRAW_BUFFER, GL_TRUE ); return; } - + imesa->NotFirstFrame = GL_FALSE; savageXMesaSetClipRects(imesa); FALLBACK(ctx, SAVAGE_FALLBACK_DRAW_BUFFER, GL_FALSE); @@ -673,7 +673,7 @@ static void savageDDReadBuffer(struct gl_context *ctx, GLenum mode ) } #if 0 -static void savageDDSetColor(struct gl_context *ctx, +static void savageDDSetColor(struct gl_context *ctx, GLubyte r, GLubyte g, GLubyte b, GLubyte a ) { @@ -712,14 +712,14 @@ void savageCalcViewport( struct gl_context *ctx ) imesa->SetupNewInputs = ~0; } -static void savageViewport( struct gl_context *ctx, - GLint x, GLint y, +static void savageViewport( struct gl_context *ctx, + GLint x, GLint y, GLsizei width, GLsizei height ) { savageCalcViewport( ctx ); } -static void savageDepthRange( struct gl_context *ctx, +static void savageDepthRange( struct gl_context *ctx, GLclampd nearval, GLclampd farval ) { savageCalcViewport( ctx ); @@ -730,7 +730,7 @@ static void savageDepthRange( struct gl_context *ctx, * Miscellaneous */ -static void savageDDClearColor(struct gl_context *ctx, +static void savageDDClearColor(struct gl_context *ctx, const GLfloat color[4] ) { savageContextPtr imesa = SAVAGE_CONTEXT(ctx); @@ -761,7 +761,7 @@ static void savageRenderMode( struct gl_context *ctx, GLenum mode ) static void savageDDCullFaceFrontFace(struct gl_context *ctx, GLenum unused) { savageContextPtr imesa = SAVAGE_CONTEXT(ctx); - GLuint cullMode=imesa->LcsCullMode; + GLuint cullMode=imesa->LcsCullMode; switch (ctx->Polygon.CullFaceMode) { case GL_FRONT: @@ -788,7 +788,7 @@ static void savageDDCullFaceFrontFace(struct gl_context *ctx, GLenum unused) } break; } - imesa->LcsCullMode = cullMode; + imesa->LcsCullMode = cullMode; imesa->new_state |= SAVAGE_NEW_CULL; } #endif /* end #if HW_CULL */ @@ -829,8 +829,8 @@ static void savageUpdateCull( struct gl_context *ctx ) * to have any effect. If only some channels are masked we need a * software fallback on all chips. */ -static void savageDDColorMask_s4(struct gl_context *ctx, - GLboolean r, GLboolean g, +static void savageDDColorMask_s4(struct gl_context *ctx, + GLboolean r, GLboolean g, GLboolean b, GLboolean a ) { savageContextPtr imesa = SAVAGE_CONTEXT( ctx ); @@ -855,8 +855,8 @@ static void savageDDColorMask_s4(struct gl_context *ctx, imesa->dirty |= SAVAGE_UPLOAD_LOCAL; } } -static void savageDDColorMask_s3d(struct gl_context *ctx, - GLboolean r, GLboolean g, +static void savageDDColorMask_s3d(struct gl_context *ctx, + GLboolean r, GLboolean g, GLboolean b, GLboolean a ) { if (ctx->Visual.alphaBits) @@ -893,12 +893,12 @@ static void savageUpdateSpecular_s3d(struct gl_context *ctx) { imesa->dirty |= SAVAGE_UPLOAD_LOCAL; } -static void savageDDLightModelfv_s4(struct gl_context *ctx, GLenum pname, +static void savageDDLightModelfv_s4(struct gl_context *ctx, GLenum pname, const GLfloat *param) { savageUpdateSpecular_s4 (ctx); } -static void savageDDLightModelfv_s3d(struct gl_context *ctx, GLenum pname, +static void savageDDLightModelfv_s3d(struct gl_context *ctx, GLenum pname, const GLfloat *param) { savageUpdateSpecular_s3d (ctx); @@ -909,8 +909,8 @@ static void savageDDShadeModel_s4(struct gl_context *ctx, GLuint mod) savageContextPtr imesa = SAVAGE_CONTEXT( ctx ); uint32_t drawLocalCtrl = imesa->regs.s4.drawLocalCtrl.ui; - if (mod == GL_SMOOTH) - { + if (mod == GL_SMOOTH) + { imesa->regs.s4.drawLocalCtrl.ni.flatShadeEn = GL_FALSE; } else @@ -926,8 +926,8 @@ static void savageDDShadeModel_s3d(struct gl_context *ctx, GLuint mod) savageContextPtr imesa = SAVAGE_CONTEXT( ctx ); uint32_t drawCtrl = imesa->regs.s3d.drawCtrl.ui; - if (mod == GL_SMOOTH) - { + if (mod == GL_SMOOTH) + { imesa->regs.s3d.drawCtrl.ni.flatShadeEn = GL_FALSE; } else @@ -961,12 +961,12 @@ static void savageDDFogfv(struct gl_context *ctx, GLenum pname, const GLfloat *p imesa->regs.s4.fogCtrl.ni.fogEn = GL_TRUE; /*cheap fog*/ imesa->regs.s4.fogCtrl.ni.fogMode = GL_TRUE; - imesa->regs.s4.fogCtrl.ni.fogClr = fogClr; - } + imesa->regs.s4.fogCtrl.ni.fogClr = fogClr; + } else { /*No fog*/ - + imesa->regs.s4.fogCtrl.ni.fogEn = 0; imesa->regs.s4.fogCtrl.ni.fogMode = 0; } @@ -992,7 +992,7 @@ savageDDStencilFuncSeparate(struct gl_context *ctx, GLenum face, GLenum func, { case GL_NEVER: a = CF_Never; break; case GL_ALWAYS: a = CF_Always; break; - case GL_LESS: a = CF_Less; break; + case GL_LESS: a = CF_Less; break; case GL_LEQUAL: a = CF_LessEqual; break; case GL_EQUAL: a = CF_Equal; break; case GL_GREATER: a = CF_Greater; break; @@ -1059,7 +1059,7 @@ savageDDStencilOpSeparate(struct gl_context *ctx, GLenum face, GLenum fail, static void savageDDEnable_s4(struct gl_context *ctx, GLenum cap, GLboolean state) { - + savageContextPtr imesa = SAVAGE_CONTEXT(ctx); switch(cap) { case GL_ALPHA_TEST: @@ -1070,10 +1070,10 @@ static void savageDDEnable_s4(struct gl_context *ctx, GLenum cap, GLboolean stat /*add the savageBlendFunc 2001/11/25 * if call no such function, then glDisable(GL_BLEND) will do noting, *our chip has no disable bit - */ + */ savageBlendFunc_s4(ctx); case GL_COLOR_LOGIC_OP: - /* Fall through: + /* Fall through: * For some reason enable(GL_BLEND) affects ColorLogicOpEnabled. */ FALLBACK (ctx, SAVAGE_FALLBACK_LOGICOP, @@ -1104,7 +1104,7 @@ static void savageDDEnable_s4(struct gl_context *ctx, GLenum cap, GLboolean stat } break; case GL_FOG: - savageDDFogfv(ctx,0,0); + savageDDFogfv(ctx,0,0); break; case GL_CULL_FACE: #if HW_CULL @@ -1126,31 +1126,31 @@ static void savageDDEnable_s4(struct gl_context *ctx, GLenum cap, GLboolean stat { imesa->regs.s4.drawCtrl1.ni.ditherEn=GL_TRUE; } - } + } if (!ctx->Color.DitherFlag ) { imesa->regs.s4.drawCtrl1.ni.ditherEn=GL_FALSE; } imesa->dirty |= SAVAGE_UPLOAD_GLOBAL; break; - + case GL_LIGHTING: savageUpdateSpecular_s4 (ctx); break; - case GL_TEXTURE_1D: - case GL_TEXTURE_3D: + case GL_TEXTURE_1D: + case GL_TEXTURE_3D: imesa->new_state |= SAVAGE_NEW_TEXTURE; break; - case GL_TEXTURE_2D: + case GL_TEXTURE_2D: imesa->new_state |= SAVAGE_NEW_TEXTURE; break; default: - ; - } + ; + } } static void savageDDEnable_s3d(struct gl_context *ctx, GLenum cap, GLboolean state) { - + savageContextPtr imesa = SAVAGE_CONTEXT(ctx); switch(cap) { case GL_ALPHA_TEST: @@ -1161,10 +1161,10 @@ static void savageDDEnable_s3d(struct gl_context *ctx, GLenum cap, GLboolean sta /*add the savageBlendFunc 2001/11/25 * if call no such function, then glDisable(GL_BLEND) will do noting, *our chip has no disable bit - */ + */ savageBlendFunc_s3d(ctx); case GL_COLOR_LOGIC_OP: - /* Fall through: + /* Fall through: * For some reason enable(GL_BLEND) affects ColorLogicOpEnabled. */ FALLBACK (ctx, SAVAGE_FALLBACK_LOGICOP, @@ -1182,7 +1182,7 @@ static void savageDDEnable_s3d(struct gl_context *ctx, GLenum cap, GLboolean sta FALLBACK (ctx, SAVAGE_FALLBACK_STENCIL, state); break; case GL_FOG: - savageDDFogfv(ctx,0,0); + savageDDFogfv(ctx,0,0); break; case GL_CULL_FACE: #if HW_CULL @@ -1211,20 +1211,20 @@ static void savageDDEnable_s3d(struct gl_context *ctx, GLenum cap, GLboolean sta } imesa->dirty |= SAVAGE_UPLOAD_LOCAL; break; - + case GL_LIGHTING: savageUpdateSpecular_s3d (ctx); break; - case GL_TEXTURE_1D: - case GL_TEXTURE_3D: + case GL_TEXTURE_1D: + case GL_TEXTURE_3D: imesa->new_state |= SAVAGE_NEW_TEXTURE; break; - case GL_TEXTURE_2D: + case GL_TEXTURE_2D: imesa->new_state |= SAVAGE_NEW_TEXTURE; break; default: - ; - } + ; + } } void savageDDUpdateHwState( struct gl_context *ctx ) @@ -1246,7 +1246,7 @@ void savageDDUpdateHwState( struct gl_context *ctx ) static void savageDDPrintDirty( const char *msg, GLuint state ) { - fprintf(stderr, "%s (0x%x): %s%s%s%s%s%s\n", + fprintf(stderr, "%s (0x%x): %s%s%s%s%s%s\n", msg, (unsigned int) state, (state & SAVAGE_UPLOAD_LOCAL) ? "upload-local, " : "", @@ -1649,13 +1649,13 @@ void savageDDInitState( savageContextPtr imesa ) { imesa->regs.s4.zBufOffset.ni.offset=imesa->savageScreen->depthOffset>>11; if(imesa->savageScreen->zpp == 2) { - imesa->regs.s4.zBufOffset.ni.zBufWidthInTiles = + imesa->regs.s4.zBufOffset.ni.zBufWidthInTiles = (imesa->savageScreen->width+63)>>6; imesa->regs.s4.zBufOffset.ni.zDepthSelect = 0; - } else { - imesa->regs.s4.zBufOffset.ni.zBufWidthInTiles = + } else { + imesa->regs.s4.zBufOffset.ni.zBufWidthInTiles = (imesa->savageScreen->width+31)>>5; - imesa->regs.s4.zBufOffset.ni.zDepthSelect = 1; + imesa->regs.s4.zBufOffset.ni.zDepthSelect = 1; } memcpy (imesa->oldRegs.ui, imesa->regs.ui, SAVAGE_NR_REGS*sizeof(uint32_t)); diff --git a/src/mesa/drivers/dri/savage/savagetex.c b/src/mesa/drivers/dri/savage/savagetex.c index 3aece73..c5fa10c 100644 --- a/src/mesa/drivers/dri/savage/savagetex.c +++ b/src/mesa/drivers/dri/savage/savagetex.c @@ -243,7 +243,7 @@ static void savageUploadTexLevel( savageTexObjPtr t, int level ) * * DO THIS IN DRIVER STATE MANAGMENT, not hardware state. */ - if(image->Border != 0) + if(image->Border != 0) fprintf (stderr, "Not supported texture border %d.\n", (int) image->Border); @@ -475,7 +475,7 @@ static void savageSetTexBorderColor(savageTexObjPtr t, const GLfloat color[4]) static savageTexObjPtr -savageAllocTexObj( struct gl_texture_object *texObj ) +savageAllocTexObj( struct gl_texture_object *texObj ) { savageTexObjPtr t; @@ -499,7 +499,7 @@ savageAllocTexObj( struct gl_texture_object *texObj ) /* FIXME Something here to set initial values for other parts of * FIXME t->setup? */ - + make_empty_list( &t->base ); savageSetTexWrapping(t,texObj->WrapS,texObj->WrapT); @@ -545,7 +545,7 @@ static struct gl_texture_format _savage_texformat_a1114444 = { 0, /* StencilBits */ 2, /* TexelBytes */ _savage_texstore_a1114444, /* StoreTexImageFunc */ - NULL, NULL, NULL, NULL, NULL, NULL /* FetchTexel* filled in by + NULL, NULL, NULL, NULL, NULL, NULL /* FetchTexel* filled in by * savageDDInitTextureFuncs */ }; static struct gl_texture_format _savage_texformat_a1118888 = { @@ -563,7 +563,7 @@ static struct gl_texture_format _savage_texformat_a1118888 = { 0, /* StencilBits */ 4, /* TexelBytes */ _savage_texstore_a1118888, /* StoreTexImageFunc */ - NULL, NULL, NULL, NULL, NULL, NULL /* FetchTexel* filled in by + NULL, NULL, NULL, NULL, NULL, NULL /* FetchTexel* filled in by * savageDDInitTextureFuncs */ }; @@ -930,7 +930,7 @@ static void savageSetTexImages( savageContextPtr imesa, * this function is called for the first time on this tex object or * the image or the destination color format changed. So all tiles * are marked as dirty. - */ + */ offset = 0; size = 1; for ( i = firstLevel ; i <= lastLevel && tObj->Image[0][i] ; i++ ) { @@ -981,7 +981,7 @@ void savageDestroyTexObj(savageContextPtr imesa, savageTexObjPtr t) /* See if it was the driver's current object. */ if ( imesa != NULL ) - { + { for ( i = 0 ; i < imesa->glCtx->Const.MaxTextureUnits ; i++ ) { if ( &t->base == imesa->CurrentTexObj[ i ] ) { @@ -1004,7 +1004,7 @@ static void savageUploadTexImages( savageContextPtr imesa, savageTexObjPtr t ) assert(t); LOCK_HARDWARE(imesa); - + /* Do we need to eject LRU texture objects? */ if (!t->base.memBlock) { @@ -1108,7 +1108,7 @@ savage4_set_wrap_mode( savageContextPtr imesa, unsigned unit, /** * Sets the hardware bits for the specified GL texture filter modes. - * + * * \todo * Does the Savage4 have the ability to select the magnification filter? */ @@ -1185,9 +1185,9 @@ static void savageUpdateTex0State_s4( struct gl_context *ctx ) if (t->base.dirty_images[0] || t->dirtySubImages) { savageSetTexImages(imesa, tObj); - savageUploadTexImages(imesa, t); + savageUploadTexImages(imesa, t); } - + driUpdateTextureLRU( &t->base ); format = tObj->Image[0][tObj->BaseLevel]->_BaseFormat; @@ -1358,7 +1358,7 @@ static void savageUpdateTex0State_s4( struct gl_context *ctx ) default: fprintf(stderr, "unknown tex env mode"); exit(1); - break; + break; } savage4_set_wrap_mode( imesa, 0, t->setup.sWrapMode, t->setup.tWrapMode ); @@ -1389,7 +1389,7 @@ static void savageUpdateTex0State_s4( struct gl_context *ctx ) imesa->regs.s4.texAddr[0].ui = (uint32_t) t->setup.physAddr | 0x2; if(t->base.heap->heapId == SAVAGE_AGP_HEAP) imesa->regs.s4.texAddr[0].ui |= 0x1; - + return; } static void savageUpdateTex1State_s4( struct gl_context *ctx ) @@ -1431,7 +1431,7 @@ static void savageUpdateTex1State_s4( struct gl_context *ctx ) if (!t) return; } - + imesa->CurrentTexObj[1] = &t->base; t->base.bound |= 2; @@ -1440,7 +1440,7 @@ static void savageUpdateTex1State_s4( struct gl_context *ctx ) savageSetTexImages(imesa, tObj); savageUploadTexImages(imesa, t); } - + driUpdateTextureLRU( &t->base ); format = tObj->Image[0][tObj->BaseLevel]->_BaseFormat; @@ -1545,7 +1545,7 @@ static void savageUpdateTex1State_s4( struct gl_context *ctx ) default: fprintf(stderr, "unknown tex 1 env mode\n"); exit(1); - break; + break; } savage4_set_wrap_mode( imesa, 1, t->setup.sWrapMode, t->setup.tWrapMode ); @@ -1650,7 +1650,7 @@ static void savageUpdateTexState_s3d( struct gl_context *ctx ) default: fprintf(stderr, "unknown tex env mode\n"); /*exit(1);*/ - break; + break; } /* The Savage3D can't handle different wrapping modes in s and t. @@ -1765,10 +1765,10 @@ static void savageUpdateTextureState_s4( struct gl_context *ctx ) if (imesa->CurrentTexObj[0]) imesa->CurrentTexObj[0]->bound &= ~1; if (imesa->CurrentTexObj[1]) imesa->CurrentTexObj[1]->bound &= ~2; imesa->CurrentTexObj[0] = 0; - imesa->CurrentTexObj[1] = 0; + imesa->CurrentTexObj[1] = 0; savageUpdateTex0State_s4( ctx ); savageUpdateTex1State_s4( ctx ); - imesa->dirty |= (SAVAGE_UPLOAD_TEX0 | + imesa->dirty |= (SAVAGE_UPLOAD_TEX0 | SAVAGE_UPLOAD_TEX1); } static void savageUpdateTextureState_s3d( struct gl_context *ctx ) @@ -1806,7 +1806,7 @@ void savageUpdateTextureState( struct gl_context *ctx) * DRIVER functions *****************************************/ -static void savageTexEnv( struct gl_context *ctx, GLenum target, +static void savageTexEnv( struct gl_context *ctx, GLenum target, GLenum pname, const GLfloat *param ) { savageContextPtr imesa = SAVAGE_CONTEXT( ctx ); @@ -1817,7 +1817,7 @@ static void savageTexEnv( struct gl_context *ctx, GLenum target, } else if (pname == GL_TEXTURE_ENV_COLOR) { - struct gl_texture_unit *texUnit = + struct gl_texture_unit *texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit]; const GLfloat *fc = texUnit->EnvColor; GLuint r, g, b, a; @@ -1826,11 +1826,11 @@ static void savageTexEnv( struct gl_context *ctx, GLenum target, CLAMPED_FLOAT_TO_UBYTE(b, fc[2]); CLAMPED_FLOAT_TO_UBYTE(a, fc[3]); - imesa->texEnvColor = ((a << 24) | (r << 16) | + imesa->texEnvColor = ((a << 24) | (r << 16) | (g << 8) | (b << 0)); - - } + + } } /* Update the heap's time stamp, so the new image is not uploaded @@ -1872,9 +1872,9 @@ static void savageTexImage1D( struct gl_context *ctx, GLenum target, GLint level SAVAGE_CONTEXT(ctx)->new_state |= SAVAGE_NEW_TEXTURE; } -static void savageTexSubImage1D( struct gl_context *ctx, +static void savageTexSubImage1D( struct gl_context *ctx, GLenum target, - GLint level, + GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, @@ -1897,7 +1897,7 @@ static void savageTexSubImage1D( struct gl_context *ctx, } t->base.dirty_images[0] |= (1 << level); } - _mesa_store_texsubimage1d(ctx, target, level, xoffset, width, + _mesa_store_texsubimage1d(ctx, target, level, xoffset, width, format, type, pixels, packing, texObj, texImage); t->dirtySubImages |= (1 << level); @@ -1929,9 +1929,9 @@ static void savageTexImage2D( struct gl_context *ctx, GLenum target, GLint level SAVAGE_CONTEXT(ctx)->new_state |= SAVAGE_NEW_TEXTURE; } -static void savageTexSubImage2D( struct gl_context *ctx, +static void savageTexSubImage2D( struct gl_context *ctx, GLenum target, - GLint level, + GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, @@ -1954,7 +1954,7 @@ static void savageTexSubImage2D( struct gl_context *ctx, } t->base.dirty_images[0] |= (1 << level); } - _mesa_store_texsubimage2d(ctx, target, level, xoffset, yoffset, width, + _mesa_store_texsubimage2d(ctx, target, level, xoffset, yoffset, width, height, format, type, pixels, packing, texObj, texImage); t->dirtySubImages |= (1 << level); @@ -1987,9 +1987,9 @@ savageCompressedTexImage2D( struct gl_context *ctx, GLenum target, GLint level, } static void -savageCompressedTexSubImage2D( struct gl_context *ctx, +savageCompressedTexSubImage2D( struct gl_context *ctx, GLenum target, - GLint level, + GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, @@ -2038,7 +2038,7 @@ static void savageTexParameter( struct gl_context *ctx, GLenum target, case GL_TEXTURE_WRAP_T: savageSetTexWrapping(t,tObj->WrapS,tObj->WrapT); break; - + case GL_TEXTURE_BORDER_COLOR: savageSetTexBorderColor(t,tObj->BorderColor.f); break; @@ -2054,7 +2054,7 @@ static void savageBindTexture( struct gl_context *ctx, GLenum target, struct gl_texture_object *tObj ) { savageContextPtr imesa = SAVAGE_CONTEXT( ctx ); - + assert( (target != GL_TEXTURE_1D && target != GL_TEXTURE_2D) || (tObj->DriverData != NULL) ); diff --git a/src/mesa/drivers/dri/savage/savagetris.c b/src/mesa/drivers/dri/savage/savagetris.c index 79a9511..cb1a440 100644 --- a/src/mesa/drivers/dri/savage/savagetris.c +++ b/src/mesa/drivers/dri/savage/savagetris.c @@ -70,7 +70,7 @@ static GLenum reduced_prim[GL_POLYGON+1] = { GL_TRIANGLES }; - + /*********************************************************************** * Emit primitives * ***********************************************************************/ @@ -202,7 +202,7 @@ static INLINE void savage_draw_line (savageContextPtr imesa, *(float *)&vb[0] = v1->v.x + ix; *(float *)&vb[1] = v1->v.y + iy; EMIT_VERT (j, vb, vertsize, 2, v1); -} +} /* Fallback drawing functions for the ptex hack. Code duplication * (especially lines and points) isn't beautiful, but I didn't feel @@ -278,7 +278,7 @@ static INLINE void savage_ptex_line (savageContextPtr imesa, *(float *)&vb[0] = v1->v.x + ix; *(float *)&vb[1] = v1->v.y + iy; EMIT_VERT (j, vb, vertsize, 2, &tmp1); -} +} static INLINE void savage_ptex_point (savageContextPtr imesa, savageVertexPtr v0) { @@ -318,7 +318,7 @@ static INLINE void savage_ptex_point (savageContextPtr imesa, *(float *)&vb[1] = y - sz; EMIT_VERT (j, vb, vertsize, 2, &tmp); } - + /*********************************************************************** * Macros for t_dd_tritmp.h to draw basic primitives * ***********************************************************************/ @@ -860,7 +860,7 @@ static void savageRenderPrimitive( struct gl_context *ctx, GLenum prim ) if (rprim == GL_TRIANGLES && (ctx->_TriangleCaps & DD_TRI_UNFILLED)) return; - + if (imesa->raster_primitive != rprim) { savageRasterPrimitive( ctx, rprim ); } @@ -1147,7 +1147,7 @@ static void savageRenderStart( struct gl_context *ctx ) /* Important: */ VB->AttribPtr[VERT_ATTRIB_POS] = VB->NdcPtr; - + if (imesa->savageScreen->chipset < S3_SAVAGE4) { setupIndex = savageChooseVertexFormat_s3d(ctx); } else { @@ -1159,8 +1159,8 @@ static void savageRenderStart( struct gl_context *ctx ) if (setupIndex != imesa->SetupIndex || imesa->vertex_size == 0) { GLuint hwVertexSize; imesa->vertex_size = - _tnl_install_attrs( ctx, - imesa->vertex_attrs, + _tnl_install_attrs( ctx, + imesa->vertex_attrs, imesa->vertex_attr_count, imesa->hw_viewport, 0 ); imesa->vertex_size >>= 2; @@ -1261,10 +1261,10 @@ void savageFallback( struct gl_context *ctx, GLuint bit, GLboolean mode ) _tnl_invalidate_vertex_state( ctx, ~0 ); _tnl_invalidate_vertices( ctx, ~0 ); - _tnl_install_attrs( ctx, - imesa->vertex_attrs, + _tnl_install_attrs( ctx, + imesa->vertex_attrs, imesa->vertex_attr_count, - imesa->hw_viewport, 0 ); + imesa->hw_viewport, 0 ); imesa->new_gl_state |= _SAVAGE_NEW_RENDER_STATE; } @@ -1299,8 +1299,8 @@ void savageInitTriFuncs( 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, (6 + 2*ctx->Const.MaxTextureUnits) * sizeof(GLfloat) ); - + SAVAGE_CONTEXT(ctx)->verts = (char *)tnl->clipspace.vertex_buf; } diff --git a/src/mesa/drivers/dri/savage/server/savage_dri.h b/src/mesa/drivers/dri/savage/server/savage_dri.h index 214d985..0a92aaa 100644 --- a/src/mesa/drivers/dri/savage/server/savage_dri.h +++ b/src/mesa/drivers/dri/savage/server/savage_dri.h @@ -41,7 +41,7 @@ typedef struct { unsigned int sarea_priv_offset; unsigned int bufferSize; /* size of DMA buffers */ - + unsigned int frontbufferSize; unsigned int frontOffset; diff --git a/src/mesa/drivers/dri/sis/Makefile b/src/mesa/drivers/dri/sis/Makefile index 6b4f938..b0b146a 100644 --- a/src/mesa/drivers/dri/sis/Makefile +++ b/src/mesa/drivers/dri/sis/Makefile @@ -26,7 +26,7 @@ C_SOURCES = \ $(COMMON_SOURCES) \ $(DRIVER_SOURCES) -ASM_SOURCES = +ASM_SOURCES = include ../Makefile.template diff --git a/src/mesa/drivers/dri/sis/sis6326_clear.c b/src/mesa/drivers/dri/sis/sis6326_clear.c index fba6c7f..a889253 100644 --- a/src/mesa/drivers/dri/sis/sis6326_clear.c +++ b/src/mesa/drivers/dri/sis/sis6326_clear.c @@ -82,7 +82,7 @@ sis6326DDClear(struct gl_context *ctx, GLbitfield mask) y1 = Y_FLIP(y1 + height1 - 1); /* XXX: Scissoring */ - + fprintf(stderr, "Clear\n"); /* Mask out any non-existent buffers */ @@ -140,7 +140,7 @@ sis_clear_back_buffer(struct gl_context *ctx, GLenum mask, GLint x, GLint y, GLint width, GLint height) { sisContextPtr smesa = SIS_CONTEXT(ctx); - + /* XXX: The order of writing these registers seems to matter, while * it actually shouldn't. */ @@ -166,7 +166,7 @@ sis_clear_front_buffer(struct gl_context *ctx, GLenum mask, GLint x, GLint y, sisContextPtr smesa = SIS_CONTEXT(ctx); int count; drm_clip_rect_t *pExtents = NULL; - + pExtents = smesa->driDrawable->pClipRects; count = smesa->driDrawable->numClipRects; diff --git a/src/mesa/drivers/dri/sis/sis6326_reg.h b/src/mesa/drivers/dri/sis/sis6326_reg.h index 8e645f0..a2cf95d 100644 --- a/src/mesa/drivers/dri/sis/sis6326_reg.h +++ b/src/mesa/drivers/dri/sis/sis6326_reg.h @@ -287,7 +287,7 @@ #define S_SBLEND_BOTH_SRC_ALPHA 0x0B000000 #define S_SBLEND_BOTH_INV_SRC_ALPHA 0x0C000000 -/* +/* * REG_6326_3D_TextureSet (0x8A38 - 0x8A3B) */ #define MASK_6326_TextureMinFilter 0x00000007 @@ -359,7 +359,7 @@ #define TEX_FILTER_MAG_NEAREST 0x00000000 #define TEX_FILTER_MAG_LINEAR 0x00000008 -/* +/* * REG_6326_3D_TextureBlendSet (0x8A3C - 0x8A3F) */ #define MASK_TextureTransparencyLowB 0x000000ff @@ -377,7 +377,7 @@ #define TB_A_AF (1 << 24) #define TB_A_AFAS (1 << 24) -/* +/* * REG_6326_3D_TextureTransparencyColorHigh (0x8A40 - 0x8A43) */ #define MASK_TextureTransparencyHighB 0x000000FF @@ -391,13 +391,13 @@ #define MASK_TexturePitchEven 0x03FF0000 #define SHIFT_TexturePitchEven 16 -/* +/* * REG_3D_TextureWidthHeightMix (0x8A80 - 0x8A83) */ #define MASK_TextureWidthLog2 0xf0000000 #define MASK_TextureHeightLog2 0x0f000000 -/* +/* * REG_3D_TextureBorderColor (0x8A90 - 0x8A93) */ #define MASK_TextureBorderColorB 0x000000FF diff --git a/src/mesa/drivers/dri/sis/sis6326_state.c b/src/mesa/drivers/dri/sis/sis6326_state.c index 9708f63..cc08fdb 100644 --- a/src/mesa/drivers/dri/sis/sis6326_state.c +++ b/src/mesa/drivers/dri/sis/sis6326_state.c @@ -91,7 +91,7 @@ sis6326DDAlphaFunc( struct gl_context *ctx, GLenum func, GLfloat ref ) } static void -sis6326DDBlendFuncSeparate( struct gl_context *ctx, +sis6326DDBlendFuncSeparate( struct gl_context *ctx, GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorA, GLenum dfactorA ) { @@ -338,7 +338,7 @@ static void sis6326DDColorMask( struct gl_context *ctx, GLboolean b, GLboolean a ) { sisContextPtr smesa = SIS_CONTEXT(ctx); - + if (r && g && b && ((ctx->Visual.alphaBits == 0) || a)) { FALLBACK(smesa, SIS_FALLBACK_WRITEMASK, 0); } else { @@ -678,7 +678,7 @@ void sis6326DDInitState( sisContextPtr smesa ) /* Src blend is BLEND_ONE, Dst blend is D3DBLEND_ZERO */ current->hwDstSrcBlend = S_SBLEND_ONE | S_DBLEND_ZERO; - + switch (smesa->bytesPerPixel) { case 2: diff --git a/src/mesa/drivers/dri/sis/sis_alloc.c b/src/mesa/drivers/dri/sis/sis_alloc.c index ce34e44..27c9a46 100644 --- a/src/mesa/drivers/dri/sis/sis_alloc.c +++ b/src/mesa/drivers/dri/sis/sis_alloc.c @@ -59,7 +59,7 @@ sisAllocFB( sisContextPtr smesa, GLuint size, void **handle ) fb.context = smesa->hHWContext; fb.size = size; - if (drmCommandWriteRead( smesa->driFd, DRM_SIS_FB_ALLOC, &fb, + if (drmCommandWriteRead( smesa->driFd, DRM_SIS_FB_ALLOC, &fb, sizeof(drm_sis_mem_t) ) || fb.offset == 0) { return NULL; @@ -67,8 +67,8 @@ sisAllocFB( sisContextPtr smesa, GLuint size, void **handle ) *handle = (void *)fb.free; if (SIS_VERBOSE & VERBOSE_SIS_MEMORY) { - fprintf(stderr, "sisAllocFB: size=%d, offset=%lu, pid=%d, count=%d\n", - size, fb.offset, (GLint)getpid(), + fprintf(stderr, "sisAllocFB: size=%d, offset=%lu, pid=%d, count=%d\n", + size, fb.offset, (GLint)getpid(), ++_total_video_memory_count); } @@ -81,7 +81,7 @@ sisFreeFB( sisContextPtr smesa, void *handle ) drm_sis_mem_t fb; if (SIS_VERBOSE & VERBOSE_SIS_MEMORY) { - fprintf(stderr, "sisFreeFB: free=%p, pid=%d, count=%d\n", + fprintf(stderr, "sisFreeFB: free=%p, pid=%d, count=%d\n", handle, (GLint)getpid(), --_total_video_memory_count); } @@ -94,7 +94,7 @@ void * sisAllocAGP( sisContextPtr smesa, GLuint size, void **handle ) { drm_sis_mem_t agp; - + if (smesa->AGPSize == 0) return NULL; @@ -108,8 +108,8 @@ sisAllocAGP( sisContextPtr smesa, GLuint size, void **handle ) *handle = (void *)agp.free; if (SIS_VERBOSE & VERBOSE_SIS_MEMORY) { - fprintf(stderr, "sisAllocAGP: size=%u, offset=%lu, pid=%d, count=%d\n", - size, agp.offset, (GLint)getpid(), + fprintf(stderr, "sisAllocAGP: size=%u, offset=%lu, pid=%d, count=%d\n", + size, agp.offset, (GLint)getpid(), ++_total_video_memory_count); } @@ -122,10 +122,10 @@ sisFreeAGP( sisContextPtr smesa, void *handle ) drm_sis_mem_t agp; if (SIS_VERBOSE & VERBOSE_SIS_MEMORY) { - fprintf(stderr, "sisFreeAGP: free=%p, pid=%d, count=%d\n", + fprintf(stderr, "sisFreeAGP: free=%p, pid=%d, count=%d\n", handle, (GLint)getpid(), --_total_video_memory_count); } - + agp.context = smesa->hHWContext; agp.free = handle; drmCommandWrite( smesa->driFd, DRM_SIS_AGP_FREE, &agp, @@ -165,8 +165,8 @@ void sisFreeZStencilBuffer( sisContextPtr smesa ) { sisFreeFB(smesa, smesa->depth.handle); - smesa->depth.map = NULL; - smesa->depth.offset = 0; + smesa->depth.map = NULL; + smesa->depth.offset = 0; } void @@ -193,6 +193,6 @@ void sisFreeBackbuffer( sisContextPtr smesa ) { sisFreeFB(smesa, smesa->back.handle); - smesa->back.map = NULL; - smesa->back.offset = 0; + smesa->back.map = NULL; + smesa->back.offset = 0; } diff --git a/src/mesa/drivers/dri/sis/sis_clear.c b/src/mesa/drivers/dri/sis/sis_clear.c index a5d8704..d7f5b88 100644 --- a/src/mesa/drivers/dri/sis/sis_clear.c +++ b/src/mesa/drivers/dri/sis/sis_clear.c @@ -123,7 +123,7 @@ sisDDClear( struct gl_context * ctx, GLbitfield mask ) if ((smesa->current.hwCapEnable2 & (MASK_AlphaMaskWriteEnable | MASK_ColorMaskWriteEnable) && (mask & (BUFFER_BIT_BACK_LEFT | BUFFER_BIT_FRONT_LEFT)) != 0) || - ((ctx->Stencil.WriteMask[0] & 0xff) != 0xff && + ((ctx->Stencil.WriteMask[0] & 0xff) != 0xff && (mask & BUFFER_BIT_STENCIL) != 0) ) { mask = sis_3D_Clear( ctx, mask, x1, y1, width1, height1 ); @@ -280,7 +280,7 @@ sis_3D_Clear( struct gl_context * ctx, GLbitfield mask, MMIO(REG_3D_ClipLeftRight, ((GLint)left << 13) | (GLint)right); /* the first triangle */ - dwPrimitiveSet = OP_3D_TRIANGLE_DRAW | OP_3D_FIRE_TSARGBc | + dwPrimitiveSet = OP_3D_TRIANGLE_DRAW | OP_3D_FIRE_TSARGBc | SHADE_FLAT_VertexC; MMIO(REG_3D_PrimitiveSet, dwPrimitiveSet); @@ -335,7 +335,7 @@ sis_clear_color_buffer( struct gl_context *ctx, GLenum mask, GLint x, GLint y, /* Clear back buffer */ if (mask & BUFFER_BIT_BACK_LEFT) { mWait3DCmdQueue (8); - MMIO(REG_SRC_PITCH, (smesa->bytesPerPixel == 4) ? + MMIO(REG_SRC_PITCH, (smesa->bytesPerPixel == 4) ? BLIT_DEPTH_32 : BLIT_DEPTH_16); MMIO(REG_DST_X_Y, (x << 16) | y); MMIO(REG_DST_ADDR, smesa->back.offset); @@ -345,7 +345,7 @@ sis_clear_color_buffer( struct gl_context *ctx, GLenum mask, GLint x, GLint y, MMIO(REG_BLIT_CMD, CMD_DIR_X_INC | CMD_DIR_Y_INC | CMD_ROP_PAT); MMIO(REG_CommandQueue, -1); } - + if ((mask & BUFFER_BIT_FRONT_LEFT) == 0) return; @@ -376,7 +376,7 @@ sis_clear_color_buffer( struct gl_context *ctx, GLenum mask, GLint x, GLint y, continue; mWait3DCmdQueue (8); - MMIO(REG_SRC_PITCH, (smesa->bytesPerPixel == 4) ? + MMIO(REG_SRC_PITCH, (smesa->bytesPerPixel == 4) ? BLIT_DEPTH_32 : BLIT_DEPTH_16); MMIO(REG_DST_X_Y, (x << 16) | y); MMIO(REG_DST_ADDR, smesa->front.offset); diff --git a/src/mesa/drivers/dri/sis/sis_context.c b/src/mesa/drivers/dri/sis/sis_context.c index c5a9fdf..5b0ff72 100644 --- a/src/mesa/drivers/dri/sis/sis_context.c +++ b/src/mesa/drivers/dri/sis/sis_context.c @@ -184,7 +184,7 @@ sisCreateContext( gl_api api, /* Allocate the Mesa context */ if (sharedContextPrivate) shareCtx = ((sisContextPtr)sharedContextPrivate)->glCtx; - else + else shareCtx = NULL; smesa->glCtx = _mesa_create_context( glVisual, shareCtx, &functions, (void *) smesa); @@ -204,7 +204,7 @@ sisCreateContext( gl_api api, smesa->hHWContext = driContextPriv->hHWContext; smesa->driHwLock = &sPriv->pSAREA->lock; smesa->driFd = sPriv->fd; - + smesa->virtualX = sisScreen->screenX; smesa->virtualY = sisScreen->screenY; smesa->bytesPerPixel = sisScreen->cpp; @@ -268,7 +268,7 @@ sisCreateContext( gl_api api, smesa->AGPAddr = sisScreen->agpBaseOffset; /* Create AGP command buffer */ - if (smesa->AGPSize != 0 && + if (smesa->AGPSize != 0 && !driQueryOptionb(&smesa->optionCache, "agp_disable")) { smesa->vb = sisAllocAGP(smesa, 64 * 1024, &smesa->vb_agp_handle); @@ -441,7 +441,7 @@ sis_update_render_state( sisContextPtr smesa ) /* Line Setting */ #if 0 - if (smesa->GlobalFlag & GFLAG_LINESETTING) + if (smesa->GlobalFlag & GFLAG_LINESETTING) MMIO(REG_3D_LinePattern, prev->hwLinePattern); #endif diff --git a/src/mesa/drivers/dri/sis/sis_context.h b/src/mesa/drivers/dri/sis/sis_context.h index a82a659..839e97b 100644 --- a/src/mesa/drivers/dri/sis/sis_context.h +++ b/src/mesa/drivers/dri/sis/sis_context.h @@ -220,18 +220,18 @@ __GLSiSHardware; typedef struct sis_context sisContextRec; typedef struct sis_context *sisContextPtr; -typedef void (*sis_quad_func)( sisContextPtr, +typedef void (*sis_quad_func)( sisContextPtr, sisVertex *, sisVertex *, sisVertex *, sisVertex * ); -typedef void (*sis_tri_func)( sisContextPtr, +typedef void (*sis_tri_func)( sisContextPtr, sisVertex *, sisVertex *, sisVertex * ); -typedef void (*sis_line_func)( sisContextPtr, +typedef void (*sis_line_func)( sisContextPtr, sisVertex *, sisVertex * ); @@ -298,7 +298,7 @@ struct sis_context unsigned int clearColorPattern; unsigned int clearZStencilPattern; - /* Fallback rasterization functions + /* Fallback rasterization functions */ sis_point_func draw_point; sis_line_func draw_line; @@ -311,12 +311,12 @@ struct sis_context /* DRM fd */ int driFd; - + /* AGP Memory */ unsigned int AGPSize; unsigned char *AGPBase; unsigned int AGPAddr; - + /* register 0x89F4 */ GLint AGPParseSet; diff --git a/src/mesa/drivers/dri/sis/sis_dd.c b/src/mesa/drivers/dri/sis/sis_dd.c index 90e894b..986340d 100644 --- a/src/mesa/drivers/dri/sis/sis_dd.c +++ b/src/mesa/drivers/dri/sis/sis_dd.c @@ -187,7 +187,7 @@ sisUpdateBufferSize(sisContextPtr smesa) } if (smesa->glCtx->Visual.depthBits > 0) { - sisInitRenderbuffer(&smesa->depth.Base, + sisInitRenderbuffer(&smesa->depth.Base, (smesa->glCtx->Visual.depthBits == 16 ? GL_DEPTH_COMPONENT16 : GL_DEPTH_COMPONENT24)); sisSetSpanFunctions(&smesa->depth, &fb->Visual); @@ -251,7 +251,7 @@ sisUpdateBufferSize(sisContextPtr smesa) prev->hwZ = current->hwZ; smesa->GlobalFlag |= GFLAG_ZSETTING; } - + sisUpdateClipping( smesa->glCtx ); } diff --git a/src/mesa/drivers/dri/sis/sis_reg.h b/src/mesa/drivers/dri/sis/sis_reg.h index e40c437..9a64a86 100644 --- a/src/mesa/drivers/dri/sis/sis_reg.h +++ b/src/mesa/drivers/dri/sis/sis_reg.h @@ -69,7 +69,7 @@ USE OR OTHER DEALINGS IN THE SOFTWARE. # define CMD_DIR_Y_INC 0x00020000 #define REG_CommandQueue 0x8240 - + #define REG_3D_TSFSa 0x8800 #define REG_3D_TSZa 0x8804 #define REG_3D_TSXa 0x8808 @@ -685,7 +685,7 @@ USE OR OTHER DEALINGS IN THE SOFTWARE. #define MASK_RightClip 0x00001FFF #define MASK_LeftClip 0x03FFE000 -/* +/* * REG_3D_TextureSet (0x8A7C - 0x8A7F) * REG_3D_Texture1Set (0x8ADC - 0x8ADF) */ @@ -787,7 +787,7 @@ USE OR OTHER DEALINGS IN THE SOFTWARE. #define TEXEL_LUV655 0x02800000 #define TEXEL_LUV888 0x03000000 -/* +/* * REG_3D_TextureMip (0x8A80 - 0x8A83) * REG_3D_Texture1Mip (0x8AE0 - 0x8AE3) */ @@ -807,7 +807,7 @@ USE OR OTHER DEALINGS IN THE SOFTWARE. #define TEXTURE_FILTER_LINEAR_MIP_NEAREST 0x0000c000 #define TEXTURE_FILTER_LINEAR_MIP_LINEAR 0x00014000 -/* +/* * REG_3D_TextureTransparencyColorHigh (0x8A84 - 0x8A87) * REG_3D_Texture1TransparencyColorHigh (0x8AE4 - 0x8AE7) */ @@ -816,7 +816,7 @@ USE OR OTHER DEALINGS IN THE SOFTWARE. #define MASK_TextureTransparencyColorHighR 0x00FF0000 #define MASK_TextureAlphaTransparencyMode 0x08000000 -/* +/* * REG_3D_TextureTransparencyColorLow (0x8A88 - 0x8A8B) * REG_3D_Texture1TransparencyColorLow (0x8AE8 - 0x8AEB) */ @@ -826,7 +826,7 @@ USE OR OTHER DEALINGS IN THE SOFTWARE. #define MASK_TextureBlockHeight 0x07000000 #define MASK_TextureBlockWidth 0x70000000 -/* +/* * REG_3D_TextureTransparencyColorLow (0x8A8C - 0x8A8F) * REG_3D_Texture1TransparencyColorLow (0x8AEC - 0x8AEF) */ diff --git a/src/mesa/drivers/dri/sis/sis_screen.c b/src/mesa/drivers/dri/sis/sis_screen.c index 75f6fcf..40edcd2 100644 --- a/src/mesa/drivers/dri/sis/sis_screen.c +++ b/src/mesa/drivers/dri/sis/sis_screen.c @@ -238,7 +238,7 @@ static void sisCopyBuffer( __DRIdrawable *dPriv ) mWait3DCmdQueue(10); MMIO(REG_SRC_ADDR, smesa->back.offset); - MMIO(REG_SRC_PITCH, smesa->back.pitch | ((smesa->bytesPerPixel == 4) ? + MMIO(REG_SRC_PITCH, smesa->back.pitch | ((smesa->bytesPerPixel == 4) ? BLIT_DEPTH_32 : BLIT_DEPTH_16)); MMIO(REG_SRC_X_Y, ((box->x1 - dPriv->x) << 16) | (box->y1 - dPriv->y)); MMIO(REG_DST_X_Y, ((box->x1 - dPriv->x) << 16) | (box->y1 - dPriv->y)); @@ -250,7 +250,7 @@ static void sisCopyBuffer( __DRIdrawable *dPriv ) } *(GLint *)(smesa->IOBase+0x8a2c) = *smesa->FrameCountPtr; - (*smesa->FrameCountPtr)++; + (*smesa->FrameCountPtr)++; UNLOCK_HARDWARE (); } @@ -277,7 +277,7 @@ sisSwapBuffers(__DRIdrawable *dPriv) /** * This is the driver specific part of the createNewScreen entry point. - * + * * \todo maybe fold this into intelInitDriver * * \return the struct gl_config supported by this driver diff --git a/src/mesa/drivers/dri/sis/sis_span.c b/src/mesa/drivers/dri/sis/sis_span.c index 01c1fc4..67c0053 100644 --- a/src/mesa/drivers/dri/sis/sis_span.c +++ b/src/mesa/drivers/dri/sis/sis_span.c @@ -48,7 +48,7 @@ USE OR OTHER DEALINGS IN THE SOFTWARE. char *buf = srb->map; \ GLuint p; \ (void) buf; (void) p; - + #define LOCAL_DEPTH_VARS \ sisContextPtr smesa = SIS_CONTEXT(ctx); \ @@ -56,7 +56,7 @@ USE OR OTHER DEALINGS IN THE SOFTWARE. struct sis_renderbuffer *srb = (struct sis_renderbuffer *) rb; \ char *buf = srb->map; -#define LOCAL_STENCIL_VARS LOCAL_DEPTH_VARS +#define LOCAL_STENCIL_VARS LOCAL_DEPTH_VARS #define HW_LOCK() do {} while(0); @@ -165,7 +165,7 @@ sisDDInitSpanFuncs( struct gl_context *ctx ) { struct swrast_device_driver *swdd = _swrast_GetDeviceDriverReference(ctx); swdd->SpanRenderStart = sisSpanRenderStart; - swdd->SpanRenderFinish = sisSpanRenderFinish; + swdd->SpanRenderFinish = sisSpanRenderFinish; } diff --git a/src/mesa/drivers/dri/sis/sis_span.h b/src/mesa/drivers/dri/sis/sis_span.h index cbe4bbd..5cac512 100644 --- a/src/mesa/drivers/dri/sis/sis_span.h +++ b/src/mesa/drivers/dri/sis/sis_span.h @@ -30,7 +30,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #ifndef __SIS_SPAN_H__ #define __SIS_SPAN_H__ - + #include "drirenderbuffer.h" diff --git a/src/mesa/drivers/dri/sis/sis_state.c b/src/mesa/drivers/dri/sis/sis_state.c index e53c326..3784abb 100644 --- a/src/mesa/drivers/dri/sis/sis_state.c +++ b/src/mesa/drivers/dri/sis/sis_state.c @@ -94,7 +94,7 @@ sisDDAlphaFunc( struct gl_context * ctx, GLenum func, GLfloat ref ) } static void -sisDDBlendFuncSeparate( struct gl_context *ctx, +sisDDBlendFuncSeparate( struct gl_context *ctx, GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorA, GLenum dfactorA ) { @@ -391,7 +391,7 @@ static void sisDDColorMask( struct gl_context *ctx, (b) ? smesa->blueMask : 0 | (a) ? smesa->alphaMask : 0; } - + if (current->hwDstMask != prev->hwDstMask) { prev->hwDstMask = current->hwDstMask; smesa->GlobalFlag |= GFLAG_DESTSETTING; @@ -751,7 +751,7 @@ void sisDDInitState( sisContextPtr smesa ) /* Stenciling disabled, function ALWAYS, ref value zero, mask all ones */ prev->hwStSetting = STENCIL_FORMAT_8 | SiS_STENCIL_ALWAYS | 0xff; /* Op is KEEP for all three operations */ - prev->hwStSetting2 = SiS_SFAIL_KEEP | SiS_SPASS_ZFAIL_KEEP | + prev->hwStSetting2 = SiS_SFAIL_KEEP | SiS_SPASS_ZFAIL_KEEP | SiS_SPASS_ZPASS_KEEP; /* Texture mapping mode is Tile */ @@ -768,7 +768,7 @@ void sisDDInitState( sisContextPtr smesa ) prev->hwTexBlendColor1 = STAGE1_C_CF; prev->hwTexBlendAlpha0 = STAGE0_A_AF; prev->hwTexBlendAlpha1 = STAGE1_A_AF; - + switch (smesa->bytesPerPixel) { case 2: diff --git a/src/mesa/drivers/dri/sis/sis_stencil.c b/src/mesa/drivers/dri/sis/sis_stencil.c index 92eb08f..fcac4ae 100644 --- a/src/mesa/drivers/dri/sis/sis_stencil.c +++ b/src/mesa/drivers/dri/sis/sis_stencil.c @@ -43,8 +43,8 @@ sisDDStencilFuncSeparate( struct gl_context * ctx, GLenum face, __GLSiSHardware *prev = &smesa->prev; __GLSiSHardware *current = &smesa->current; - /* set reference */ - current->hwStSetting = (STENCIL_FORMAT_8 | + /* set reference */ + current->hwStSetting = (STENCIL_FORMAT_8 | ((ctx->Stencil.Ref[0] & 0xff) << 8) | (ctx->Stencil.ValueMask[0] & 0xff)); diff --git a/src/mesa/drivers/dri/sis/sis_tex.c b/src/mesa/drivers/dri/sis/sis_tex.c index bb4896d..ed8cad6 100644 --- a/src/mesa/drivers/dri/sis/sis_tex.c +++ b/src/mesa/drivers/dri/sis/sis_tex.c @@ -115,7 +115,7 @@ sisAllocTexImage( sisContextPtr smesa, sisTexObjPtr t, int level, } else t->image[level].memType = VIDEO_TYPE; - + t->image[level].Data = ALIGN(addr, TEXTURE_HW_ALIGNMENT); t->image[level].pitch = image->Width * texel_size; t->image[level].size = image->Width * image->Height * texel_size; @@ -141,7 +141,7 @@ sisFreeTexImage( sisContextPtr smesa, sisTexObjPtr t, int level ) } t->image[level].Data = NULL; t->image[level].handle = NULL; - /* If there are no textures loaded any more, reset the hw format so the + /* If there are no textures loaded any more, reset the hw format so the * object can be reused for new formats */ t->numImages--; @@ -151,7 +151,7 @@ sisFreeTexImage( sisContextPtr smesa, sisTexObjPtr t, int level ) } } -static void +static void sisTexEnv( struct gl_context *ctx, GLenum target, GLenum pname, const GLfloat *param ) { sisContextPtr smesa = SIS_CONTEXT(ctx); @@ -204,8 +204,8 @@ sisDeleteTexture( struct gl_context * ctx, struct gl_texture_object *texObj ) t = texObj->DriverData; if (t == NULL) { - /* - * this shows the texture is default object and never be a + /* + * this shows the texture is default object and never be a * argument of sisTexImage* */ return; @@ -379,7 +379,7 @@ static void sisTexImage1D( struct gl_context *ctx, GLenum target, GLint level, /* Upload the texture */ WaitEngIdle(smesa); memcpy(t->image[level].Data, texImage->Data, t->image[level].size); - + if (smesa->PrevTexFormat[ctx->Texture.CurrentUnit] != t->format) { smesa->TexStates[ctx->Texture.CurrentUnit] |= NEW_TEXTURE_ENV; @@ -466,7 +466,7 @@ static void sisTexImage2D( struct gl_context *ctx, GLenum target, GLint level, /* Upload the texture */ WaitEngIdle(smesa); memcpy(t->image[level].Data, texImage->Data, t->image[level].size); - + if (smesa->PrevTexFormat[ctx->Texture.CurrentUnit] != t->format) { smesa->TexStates[ctx->Texture.CurrentUnit] |= NEW_TEXTURE_ENV; diff --git a/src/mesa/drivers/dri/sis/sis_texstate.c b/src/mesa/drivers/dri/sis/sis_texstate.c index daec239..bac7f4e 100644 --- a/src/mesa/drivers/dri/sis/sis_texstate.c +++ b/src/mesa/drivers/dri/sis/sis_texstate.c @@ -461,17 +461,17 @@ sis_set_texobj_parm( struct gl_context *ctx, struct gl_texture_object *texObj, CLAMPED_FLOAT_TO_UBYTE(c[2], texObj->BorderColor.f[2]); CLAMPED_FLOAT_TO_UBYTE(c[3], texObj->BorderColor.f[3]); - current->texture[hw_unit].hwTextureBorderColor = + current->texture[hw_unit].hwTextureBorderColor = PACK_COLOR_8888(c[3], c[0], c[1], c[2]); } if (current->texture[hw_unit].hwTextureBorderColor != - prev->texture[hw_unit].hwTextureBorderColor) + prev->texture[hw_unit].hwTextureBorderColor) { prev->texture[hw_unit].hwTextureBorderColor = - current->texture[hw_unit].hwTextureBorderColor; + current->texture[hw_unit].hwTextureBorderColor; if (hw_unit == 1) - smesa->GlobalFlag |= GFLAG_TEXBORDERCOLOR_1; + smesa->GlobalFlag |= GFLAG_TEXBORDERCOLOR_1; else smesa->GlobalFlag |= GFLAG_TEXBORDERCOLOR; } @@ -557,7 +557,7 @@ sis_set_texobj_parm( struct gl_context *ctx, struct gl_texture_object *texObj, } } - if (current->texture[hw_unit].hwTextureSet != + if (current->texture[hw_unit].hwTextureSet != prev->texture[hw_unit].hwTextureSet) { prev->texture[hw_unit].hwTextureSet = @@ -567,7 +567,7 @@ sis_set_texobj_parm( struct gl_context *ctx, struct gl_texture_object *texObj, else smesa->GlobalFlag |= CFLAG_TEXTURERESET; } - if (current->texture[hw_unit].hwTextureMip != + if (current->texture[hw_unit].hwTextureMip != prev->texture[hw_unit].hwTextureMip) { prev->texture[hw_unit].hwTextureMip = @@ -594,7 +594,7 @@ sis_reset_texture_env (struct gl_context *ctx, int hw_unit) { current->hwTexBlendColor1 = STAGE1_C_CF; current->hwTexBlendAlpha1 = STAGE1_A_AF; - + if ((current->hwTexBlendColor1 != prev->hwTexBlendColor1) || (current->hwTexBlendAlpha1 != prev->hwTexBlendAlpha1) || (current->hwTexEnvColor != prev->hwTexEnvColor)) @@ -607,7 +607,7 @@ sis_reset_texture_env (struct gl_context *ctx, int hw_unit) } else { current->hwTexBlendColor0 = STAGE0_C_CF; current->hwTexBlendAlpha0 = STAGE0_A_AF; - + if ((current->hwTexBlendColor0 != prev->hwTexBlendColor0) || (current->hwTexBlendAlpha0 != prev->hwTexBlendAlpha0) || (current->hwTexEnvColor != prev->hwTexEnvColor)) @@ -626,7 +626,7 @@ static void updateTextureUnit( struct gl_context *ctx, int unit ) const struct gl_texture_unit *texUnit = &ctx->Texture.Unit[unit]; struct gl_texture_object *texObj = texUnit->_Current; GLint fallbackbit; - + if (unit == 0) fallbackbit = SIS_FALLBACK_TEXTURE0; else diff --git a/src/mesa/drivers/dri/sis/sis_tris.c b/src/mesa/drivers/dri/sis/sis_tris.c index 8db593f..e99f04b 100644 --- a/src/mesa/drivers/dri/sis/sis_tris.c +++ b/src/mesa/drivers/dri/sis/sis_tris.c @@ -110,7 +110,7 @@ static void sisRenderPrimitive( struct gl_context *ctx, GLenum prim ); sisContextPtr smesa = SIS_CONTEXT(ctx); \ const char *vertptr = smesa->verts; #define VERT(x) (sisVertex *)(vertptr + (x * vertsize * sizeof(int))) -#define VERTEX sisVertex +#define VERTEX sisVertex #undef TAG #define TAG(x) sis_##x #include "tnl_dd/t_dd_triemit.h" @@ -835,7 +835,7 @@ do { \ smesa->vertex_attrs[smesa->vertex_attr_count].offset = (N); \ smesa->vertex_attr_count++; \ } while (0) - + static void sisRenderStart( struct gl_context *ctx ) { TNLcontext *tnl = TNL_CONTEXT(ctx); @@ -847,7 +847,7 @@ static void sisRenderStart( struct gl_context *ctx ) RENDERINPUTS_COPY( index_bitset, tnl->render_inputs_bitset ); - if (ctx->DrawBuffer->_ColorDrawBufferIndexes[0] == BUFFER_FRONT_LEFT && + if (ctx->DrawBuffer->_ColorDrawBufferIndexes[0] == BUFFER_FRONT_LEFT && smesa->driDrawable->numClipRects != 0) { multipass_cliprect(ctx, 0); @@ -919,7 +919,7 @@ static void sisRenderStart( struct gl_context *ctx ) if (!RENDERINPUTS_EQUAL( smesa->last_tcl_state_bitset, index_bitset )) { smesa->AGPParseSet = AGPParseSet; - smesa->vertex_size = _tnl_install_attrs( ctx, smesa->vertex_attrs, + smesa->vertex_size = _tnl_install_attrs( ctx, smesa->vertex_attrs, smesa->vertex_attr_count, smesa->hw_viewport, 0 ); smesa->vertex_size >>= 2; @@ -1071,10 +1071,10 @@ void sisFallback( struct gl_context *ctx, GLuint bit, GLboolean mode ) _tnl_invalidate_vertex_state( ctx, ~0 ); _tnl_invalidate_vertices( ctx, ~0 ); - _tnl_install_attrs( ctx, - smesa->vertex_attrs, + _tnl_install_attrs( ctx, + smesa->vertex_attrs, smesa->vertex_attr_count, - smesa->hw_viewport, 0 ); + smesa->hw_viewport, 0 ); smesa->NewGLState |= _SIS_NEW_RENDER_STATE; if (SIS_DEBUG & DEBUG_FALLBACKS) { @@ -1147,7 +1147,7 @@ void sisInitTriFuncs( 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, (6 + 2*ctx->Const.MaxTextureUnits) * sizeof(GLfloat) ); smesa->verts = (char *)tnl->clipspace.vertex_buf; diff --git a/src/mesa/drivers/dri/sis/sis_tritmp.h b/src/mesa/drivers/dri/sis/sis_tritmp.h index f75e173..26a8aff 100644 --- a/src/mesa/drivers/dri/sis/sis_tritmp.h +++ b/src/mesa/drivers/dri/sis/sis_tritmp.h @@ -70,7 +70,7 @@ static void TAG(sis6326_draw_tri_mmio)(sisContextPtr smesa, char *verts) GLfloat delt02, diffx02, diffy02, diffy12; GLint dwPrimitiveSet = smesa->dwPrimitiveSet; sisVertex tv0, tv1, tv2; - + /* XXX Culling? */ tv0 = *v0; @@ -91,7 +91,7 @@ static void TAG(sis6326_draw_tri_mmio)(sisContextPtr smesa, char *verts) y0 = v0->v.y; y1 = v1->v.y; y2 = v2->v.y; - + if (y0 > y1) { if (y1 > y2) { @@ -172,7 +172,7 @@ static void TAG(sis6326_draw_tri_mmio)(sisContextPtr smesa, char *verts) if (tmp <= 0.0) dwPrimitiveSet |= OP_3D_DIRECTION_LEFT; } - + tv0 = *v0; tv1 = *v1; tv2 = *v2; @@ -182,7 +182,7 @@ static void TAG(sis6326_draw_tri_mmio)(sisContextPtr smesa, char *verts) v0 = &tv0; v1 = &tv1; v2 = &tv2; - + y0 = v0->v.y; y1 = v1->v.y; y2 = v2->v.y; @@ -191,7 +191,7 @@ static void TAG(sis6326_draw_tri_mmio)(sisContextPtr smesa, char *verts) fprintf(stderr, "Vertex1 %f %f %f\n", v1->v.x, v1->v.y, v1->v.z); fprintf(stderr, "Vertex2 %f %f %f\n", v2->v.x, v2->v.y, v2->v.z);*/ mWait3DCmdQueue(MMIO_VERT_REG_COUNT * 3 + 1); - MMIO(REG_3D_PrimitiveSet, dwPrimitiveSet); + MMIO(REG_3D_PrimitiveSet, dwPrimitiveSet); SIS_MMIO_WRITE_VERTEX(v0, 0, 0); SIS_MMIO_WRITE_VERTEX(v1, 1, 0); SIS_MMIO_WRITE_VERTEX(v2, 2, 1); @@ -219,7 +219,7 @@ static void TAG(sis6326_draw_line_mmio)(sisContextPtr smesa, char *verts) } mWait3DCmdQueue (MMIO_VERT_REG_COUNT * 2 + 1); - MMIO(REG_3D_PrimitiveSet, dwPrimitiveSet); + MMIO(REG_3D_PrimitiveSet, dwPrimitiveSet); SIS_MMIO_WRITE_VERTEX(v0, 0, 0); SIS_MMIO_WRITE_VERTEX(v1, 1, 1); } @@ -229,7 +229,7 @@ static void TAG(sis6326_draw_point_mmio)(sisContextPtr smesa, char *verts) sisVertexPtr v0 = (sisVertexPtr)verts; mWait3DCmdQueue (MMIO_VERT_REG_COUNT * 1 + 1); - MMIO(REG_3D_PrimitiveSet, smesa->dwPrimitiveSet | OP_6326_3D_ATOP); + MMIO(REG_3D_PrimitiveSet, smesa->dwPrimitiveSet | OP_6326_3D_ATOP); SIS_MMIO_WRITE_VERTEX(v0, 1, 1); } #endif diff --git a/src/mesa/drivers/dri/tdfx/Makefile b/src/mesa/drivers/dri/tdfx/Makefile index 96bd8f8..ba91ea2 100644 --- a/src/mesa/drivers/dri/tdfx/Makefile +++ b/src/mesa/drivers/dri/tdfx/Makefile @@ -25,7 +25,7 @@ C_SOURCES = \ $(DRIVER_SOURCES) -ASM_SOURCES = +ASM_SOURCES = include ../Makefile.template diff --git a/src/mesa/drivers/dri/tdfx/tdfx_context.c b/src/mesa/drivers/dri/tdfx/tdfx_context.c index 63dfa5a..4604cbc 100644 --- a/src/mesa/drivers/dri/tdfx/tdfx_context.c +++ b/src/mesa/drivers/dri/tdfx/tdfx_context.c @@ -142,14 +142,14 @@ static void tdfxDDInitExtensions( struct gl_context *ctx ) static const struct tnl_pipeline_stage *tdfx_pipeline[] = { - &_tnl_vertex_transform_stage, - &_tnl_normal_transform_stage, + &_tnl_vertex_transform_stage, + &_tnl_normal_transform_stage, &_tnl_lighting_stage, - &_tnl_fog_coordinate_stage, - &_tnl_texgen_stage, - &_tnl_texture_transform_stage, + &_tnl_fog_coordinate_stage, + &_tnl_texgen_stage, + &_tnl_texture_transform_stage, &_tnl_point_attenuation_stage, - &_tnl_render_stage, + &_tnl_render_stage, 0, }; @@ -191,7 +191,7 @@ GLboolean tdfxCreateContext( gl_api api, /* Allocate the Mesa context */ if (sharedContextPrivate) shareCtx = ((tdfxContextPtr) sharedContextPrivate)->glCtx; - else + else shareCtx = NULL; fxMesa->glCtx = _mesa_create_context(mesaVis, shareCtx, @@ -327,7 +327,7 @@ GLboolean tdfxCreateContext( gl_api api, tdfxDDInitExtensions( ctx ); /* XXX these should really go right after _mesa_init_driver_functions() */ - tdfxDDInitSpanFuncs( ctx ); + tdfxDDInitSpanFuncs( ctx ); tdfxDDInitStateFuncs( ctx ); tdfxDDInitTriFuncs( ctx ); tdfxInitVB( ctx ); @@ -827,7 +827,7 @@ GLboolean tdfxInitGlide(tdfxContextPtr tmesa) /* The device-specific Glide library filename didn't work, try the * old, generic libglide3.so library. */ - libHandle = dlopen(defaultGlide, RTLD_NOW); + libHandle = dlopen(defaultGlide, RTLD_NOW); if (!libHandle) { __driUtilMessage( "can't find Glide library, dlopen(%s) and dlopen(%s) both failed.", @@ -843,7 +843,7 @@ GLboolean tdfxInitGlide(tdfxContextPtr tmesa) if (env && strstr(env, "verbose")) { fprintf(stderr, "libGL: using Glide library %s\n", libName); } - } + } #define GET_FUNCTION(PTR, NAME) \ tmesa->Glide.PTR = dlsym(libHandle, NAME); \ @@ -978,7 +978,7 @@ GLboolean tdfxInitGlide(tdfxContextPtr tmesa) tmesa->Glide.txImgQuantize = dlsym(libHandle, "txImgQuantize"); tmesa->Glide.txImgDequantizeFXT1 = dlsym(libHandle, "_txImgDequantizeFXT1"); tmesa->Glide.txErrorSetCallback = dlsym(libHandle, "txErrorSetCallback"); - + #ifdef DEBUG_TRAP /* wrap the drawing functions so we can trap them */ real_grDrawTriangle = tmesa->Glide.grDrawTriangle; diff --git a/src/mesa/drivers/dri/tdfx/tdfx_context.h b/src/mesa/drivers/dri/tdfx/tdfx_context.h index 7e2f0e0..e4b3a96 100644 --- a/src/mesa/drivers/dri/tdfx/tdfx_context.h +++ b/src/mesa/drivers/dri/tdfx/tdfx_context.h @@ -667,7 +667,7 @@ struct tdfx_glide { GrTextureClampMode_t t_clampmode ); void (*grTexCombine)( GrChipID_t tmu, GrCombineFunction_t rgb_function, - GrCombineFactor_t rgb_factor, + GrCombineFactor_t rgb_factor, GrCombineFunction_t alpha_function, GrCombineFactor_t alpha_factor, FxBool rgb_invert, @@ -699,7 +699,7 @@ struct tdfx_glide { int start, int end ); void (*grTexDownloadTable)( GrTexTable_t type, void *data ); - void (*grTexDownloadTablePartial)( GrTexTable_t type, + void (*grTexDownloadTablePartial)( GrTexTable_t type, void *data, int start, int end ); void (*grTexMipMapMode)( GrChipID_t tmu, GrMipMapMode_t mode, FxBool lodBlend ); @@ -711,17 +711,17 @@ struct tdfx_glide { GrTexInfo *info ); FxBool (*grLfbLock)( GrLock_t type, GrBuffer_t buffer, GrLfbWriteMode_t writeMode, - GrOriginLocation_t origin, FxBool pixelPipeline, + GrOriginLocation_t origin, FxBool pixelPipeline, GrLfbInfo_t *info ); FxBool (*grLfbUnlock)( GrLock_t type, GrBuffer_t buffer ); void (*grLfbConstantAlpha)( GrAlpha_t alpha ); void (*grLfbConstantDepth)( FxU32 depth ); void (*grLfbWriteColorSwizzle)(FxBool swizzleBytes, FxBool swapWords); void (*grLfbWriteColorFormat)(GrColorFormat_t colorFormat); - FxBool (*grLfbWriteRegion)( GrBuffer_t dst_buffer, - FxU32 dst_x, FxU32 dst_y, - GrLfbSrcFmt_t src_format, - FxU32 src_width, FxU32 src_height, + FxBool (*grLfbWriteRegion)( GrBuffer_t dst_buffer, + FxU32 dst_x, FxU32 dst_y, + GrLfbSrcFmt_t src_format, + FxU32 src_width, FxU32 src_height, FxBool pixelPipeline, FxI32 src_stride, void *src_data ); FxBool (*grLfbReadRegion)( GrBuffer_t src_buffer, @@ -847,7 +847,7 @@ struct tdfx_context { struct tdfx_glide Glide; - /* Fallback rasterization functions + /* Fallback rasterization functions */ tdfx_point_func draw_point; tdfx_line_func draw_line; @@ -859,9 +859,9 @@ struct tdfx_context { GLuint vertexFormat; /* the current format */ void *layout[TDFX_NUM_LAYOUTS]; tdfxVertex *verts; - + GLfloat hw_viewport[16]; - + GLuint SetupIndex; GLuint SetupNewInputs; GLuint RenderIndex; diff --git a/src/mesa/drivers/dri/tdfx/tdfx_dd.c b/src/mesa/drivers/dri/tdfx/tdfx_dd.c index d60931a..ef228b3 100644 --- a/src/mesa/drivers/dri/tdfx/tdfx_dd.c +++ b/src/mesa/drivers/dri/tdfx/tdfx_dd.c @@ -27,7 +27,7 @@ /** * \file tdfx_dd.c * Device driver interface functions for 3Dfx based cards. - * + * * \author Gareth Hughes (Original rewrite 29 Sep - 1 Oct 2000) * \author Brian Paul */ @@ -135,7 +135,7 @@ tdfxEndQuery(struct gl_context *ctx, struct gl_query_object *q) fxMesa->Glide.grGet(GR_STATS_PIXELS_IN, sizeof(FxI32), &total_pixels); q->Result = total_pixels - z_fail_pixels; - + /* Apparently, people have seen z_fail_pixels > total_pixels under * some conditions on some 3Dfx hardware. The occlusion query spec * requires that we clamp to 0. diff --git a/src/mesa/drivers/dri/tdfx/tdfx_pixels.c b/src/mesa/drivers/dri/tdfx/tdfx_pixels.c index bbbd0d5..20158e8 100644 --- a/src/mesa/drivers/dri/tdfx/tdfx_pixels.c +++ b/src/mesa/drivers/dri/tdfx/tdfx_pixels.c @@ -601,7 +601,7 @@ tdfx_drawpixels_R8G8B8A8(struct gl_context * ctx, GLint x, GLint y, if ((!(format == GL_BGRA && type == GL_UNSIGNED_INT_8_8_8_8) && !(format == GL_BGRA && type == GL_UNSIGNED_BYTE)) || - ctx->Pixel.ZoomX != 1.0F || + ctx->Pixel.ZoomX != 1.0F || ctx->Pixel.ZoomY != 1.0F || (ctx->_ImageTransferState & (IMAGE_SCALE_BIAS_BIT| IMAGE_MAP_COLOR_BIT)) || @@ -616,11 +616,11 @@ tdfx_drawpixels_R8G8B8A8(struct gl_context * ctx, GLint x, GLint y, !ctx->Color.ColorMask[0][3] || ctx->Color.ColorLogicOpEnabled || ctx->Texture._EnabledUnits || - fxMesa->Fallback) + fxMesa->Fallback) { - _swrast_DrawPixels( ctx, x, y, width, height, format, type, + _swrast_DrawPixels( ctx, x, y, width, height, format, type, unpack, pixels ); - return; + return; } { @@ -646,7 +646,7 @@ tdfx_drawpixels_R8G8B8A8(struct gl_context * ctx, GLint x, GLint y, if (fxMesa->glCtx->Color.DrawBuffer[0] == GL_FRONT) { if (!inClipRects_Region(fxMesa, scrX, scrY, width, height)) { UNLOCK_HARDWARE(fxMesa); - _swrast_DrawPixels( ctx, x, y, width, height, format, type, + _swrast_DrawPixels( ctx, x, y, width, height, format, type, unpack, pixels ); return; } diff --git a/src/mesa/drivers/dri/tdfx/tdfx_screen.c b/src/mesa/drivers/dri/tdfx/tdfx_screen.c index 084560f..b83bd46 100644 --- a/src/mesa/drivers/dri/tdfx/tdfx_screen.c +++ b/src/mesa/drivers/dri/tdfx/tdfx_screen.c @@ -391,7 +391,7 @@ tdfxFillInModes(__DRIscreen *psp, /** * This is the driver specific part of the createNewScreen entry point. - * + * * \todo maybe fold this into intelInitDriver * * \return the struct gl_config supported by this driver @@ -418,7 +418,7 @@ tdfxInitScreen(__DRIscreen *psp) if (!tdfxInitDriver(psp)) return NULL; - + return tdfxFillInModes(psp, bpp, (bpp == 16) ? 16 : 24, (bpp == 16) ? 0 : 8, diff --git a/src/mesa/drivers/dri/tdfx/tdfx_span.c b/src/mesa/drivers/dri/tdfx/tdfx_span.c index 12524e2..e3d17b1 100644 --- a/src/mesa/drivers/dri/tdfx/tdfx_span.c +++ b/src/mesa/drivers/dri/tdfx/tdfx_span.c @@ -1339,7 +1339,7 @@ void tdfxDDInitSpanFuncs( struct gl_context *ctx ) { struct swrast_device_driver *swdd = _swrast_GetDeviceDriverReference( ctx ); swdd->SpanRenderStart = tdfxSpanRenderStart; - swdd->SpanRenderFinish = tdfxSpanRenderFinish; + swdd->SpanRenderFinish = tdfxSpanRenderFinish; } diff --git a/src/mesa/drivers/dri/tdfx/tdfx_state.c b/src/mesa/drivers/dri/tdfx/tdfx_state.c index 3f6822d..eeb8af9 100644 --- a/src/mesa/drivers/dri/tdfx/tdfx_state.c +++ b/src/mesa/drivers/dri/tdfx/tdfx_state.c @@ -67,7 +67,7 @@ static void tdfxUpdateAlphaMode( struct gl_context *ctx ) GrAlphaBlendFnc_t srcRGB, dstRGB, srcA, dstA; GrAlphaBlendOp_t eqRGB, eqA; GrAlpha_t ref = (GLint) (ctx->Color.AlphaRef * 255.0); - + GLboolean isNapalm = TDFX_IS_NAPALM(fxMesa); GLboolean have32bpp = (ctx->Visual.greenBits == 8); GLboolean haveAlpha = fxMesa->haveHwAlpha; @@ -291,7 +291,7 @@ static void tdfxDDAlphaFunc( struct gl_context *ctx, GLenum func, GLfloat ref ) fxMesa->new_state |= TDFX_NEW_ALPHA; } -static void tdfxDDBlendEquationSeparate( struct gl_context *ctx, +static void tdfxDDBlendEquationSeparate( struct gl_context *ctx, GLenum modeRGB, GLenum modeA ) { tdfxContextPtr fxMesa = TDFX_CONTEXT( ctx ); @@ -354,7 +354,7 @@ static void tdfxUpdateZMode( struct gl_context *ctx ) FxI32 bias; FxBool mask; - if ( TDFX_DEBUG & DEBUG_VERBOSE_API ) + if ( TDFX_DEBUG & DEBUG_VERBOSE_API ) fprintf( stderr, "%s()\n", __FUNCTION__ ); diff --git a/src/mesa/drivers/dri/tdfx/tdfx_tex.c b/src/mesa/drivers/dri/tdfx/tdfx_tex.c index 4cca243..e0f37aa 100644 --- a/src/mesa/drivers/dri/tdfx/tdfx_tex.c +++ b/src/mesa/drivers/dri/tdfx/tdfx_tex.c @@ -714,11 +714,11 @@ tdfxUpdateTexturePalette(struct gl_context * ctx, struct gl_texture_object *tObj if (tObj) { /* per-texture palette */ tdfxTexInfo *ti; - + /* This might be a proxy texture. */ if (!tObj->Palette.TableUB) return; - + if (!tObj->DriverData) tObj->DriverData = fxAllocTexObjData(fxMesa); ti = TDFX_TEXTURE_DATA(tObj); @@ -1650,10 +1650,10 @@ tdfxCompressedTexImage2D (struct gl_context *ctx, GLenum target, */ const GLuint mesaFormat = texImage->TexFormat; GLuint srcRowStride = _mesa_format_row_stride(mesaFormat, width); - + GLuint destRowStride = _mesa_format_row_stride(mesaFormat, mml->width); - + _mesa_upscale_teximage2d(srcRowStride, (height+3) / 4, destRowStride, (mml->height+3) / 4, 1, data, srcRowStride, @@ -1717,7 +1717,7 @@ tdfxCompressedTexSubImage2D( struct gl_context *ctx, GLenum target, */ if (mml->wScale != 1 || mml->hScale != 1) { srcRowStride = _mesa_format_row_stride(mesaFormat, texImage->Width); - + destRowStride = _mesa_format_row_stride(mesaFormat, mml->width); _mesa_upscale_teximage2d(srcRowStride, texImage->Height / 4, destRowStride, mml->height / 4, diff --git a/src/mesa/drivers/dri/tdfx/tdfx_texstate.c b/src/mesa/drivers/dri/tdfx/tdfx_texstate.c index 227f36b..7991fe8 100644 --- a/src/mesa/drivers/dri/tdfx/tdfx_texstate.c +++ b/src/mesa/drivers/dri/tdfx/tdfx_texstate.c @@ -2032,7 +2032,7 @@ tdfxUpdateTextureState( struct gl_context *ctx ) setupTextureSingleTMU(ctx, 0); UNLOCK_HARDWARE( fxMesa ); } - else if (ctx->Texture.Unit[0]._ReallyEnabled == 0 && + else if (ctx->Texture.Unit[0]._ReallyEnabled == 0 && ctx->Texture.Unit[1]._ReallyEnabled & (TEXTURE_1D_BIT|TEXTURE_2D_BIT)) { LOCK_HARDWARE( fxMesa ); setupTextureSingleTMU(ctx, 1); @@ -2173,7 +2173,7 @@ tdfxUpdateTextureBinding( struct gl_context *ctx ) } } } - else if (ctx->Texture.Unit[0]._ReallyEnabled == 0 && + else if (ctx->Texture.Unit[0]._ReallyEnabled == 0 && ctx->Texture.Unit[0]._ReallyEnabled & (TEXTURE_1D_BIT|TEXTURE_2D_BIT)) { /* Only unit 1 2D enabled */ if (shared->umaTexMemory) { @@ -2182,7 +2182,7 @@ tdfxUpdateTextureBinding( struct gl_context *ctx ) fxMesa->TexSource[0].Info = &(ti1->info); } } - else if (ctx->Texture.Unit[0]._ReallyEnabled & (TEXTURE_1D_BIT|TEXTURE_2D_BIT) && + else if (ctx->Texture.Unit[0]._ReallyEnabled & (TEXTURE_1D_BIT|TEXTURE_2D_BIT) && ctx->Texture.Unit[0]._ReallyEnabled & (TEXTURE_1D_BIT|TEXTURE_2D_BIT)) { /* Both 2D enabled */ if (shared->umaTexMemory) { diff --git a/src/mesa/drivers/dri/tdfx/tdfx_tris.c b/src/mesa/drivers/dri/tdfx/tdfx_tris.c index 1f8cf6c..8071413 100644 --- a/src/mesa/drivers/dri/tdfx/tdfx_tris.c +++ b/src/mesa/drivers/dri/tdfx/tdfx_tris.c @@ -129,13 +129,13 @@ do { \ * Fallback to swrast for basic primitives * ***********************************************************************/ -/* Build an SWvertex from a hardware vertex. +/* Build an SWvertex from a hardware vertex. * * This code is hit only when a mix of accelerated and unaccelerated * primitives are being drawn, and only for the unaccelerated - * primitives. + * primitives. */ -static void +static void tdfx_translate_vertex( struct gl_context *ctx, const tdfxVertex *src, SWvertex *dst) { tdfxContextPtr fxMesa = TDFX_CONTEXT(ctx); @@ -150,7 +150,7 @@ tdfx_translate_vertex( struct gl_context *ctx, const tdfxVertex *src, SWvertex * dst->color[1] = src->color[1]; dst->color[2] = src->color[0]; dst->color[3] = src->color[3]; - } + } else { GLfloat w = 1.0 / src->rhw; @@ -187,10 +187,10 @@ tdfx_translate_vertex( struct gl_context *ctx, const tdfxVertex *src, SWvertex * } -static void -tdfx_fallback_tri( tdfxContextPtr fxMesa, - tdfxVertex *v0, - tdfxVertex *v1, +static void +tdfx_fallback_tri( tdfxContextPtr fxMesa, + tdfxVertex *v0, + tdfxVertex *v1, tdfxVertex *v2 ) { struct gl_context *ctx = fxMesa->glCtx; @@ -202,7 +202,7 @@ tdfx_fallback_tri( tdfxContextPtr fxMesa, } -static void +static void tdfx_fallback_line( tdfxContextPtr fxMesa, tdfxVertex *v0, tdfxVertex *v1 ) @@ -215,8 +215,8 @@ tdfx_fallback_line( tdfxContextPtr fxMesa, } -static void -tdfx_fallback_point( tdfxContextPtr fxMesa, +static void +tdfx_fallback_point( tdfxContextPtr fxMesa, tdfxVertex *v0 ) { struct gl_context *ctx = fxMesa->glCtx; @@ -237,17 +237,17 @@ static void tdfx_print_vertex( struct gl_context *ctx, const tdfxVertex *v ) if (tmesa->vertexFormat == TDFX_LAYOUT_TINY) { fprintf(stderr, "x %f y %f z %f\n", v->x, v->y, v->z); - } + } else { - fprintf(stderr, "x %f y %f z %f oow %f\n", + fprintf(stderr, "x %f y %f z %f oow %f\n", v->x, v->y, v->z, v->rhw); } - fprintf(stderr, "r %d g %d b %d a %d\n", + fprintf(stderr, "r %d g %d b %d a %d\n", v->color[0], v->color[1], v->color[2], v->color[3]); - + fprintf(stderr, "\n"); } @@ -638,8 +638,8 @@ static void tdfx_render_vb_line_loop( struct gl_context *ctx, fxMesa->Glide.grDrawVertexArrayContiguous( GR_LINE_STRIP, count-j, fxVB + j, sizeof(tdfxVertex)); - if (flags & PRIM_END) - fxMesa->Glide.grDrawLine( fxVB + (count - 1), + if (flags & PRIM_END) + fxMesa->Glide.grDrawLine( fxVB + (count - 1), fxVB + start ); /* restore line coords */ @@ -756,7 +756,7 @@ static void tdfx_render_vb_quads( struct gl_context *ctx, (void) flags; INIT(GL_QUADS); - + for (i = start + 3 ; i < count ; i += 4 ) { #define VERT(x) (fxVB + (x)) tdfxVertex *_v_[4]; @@ -798,7 +798,7 @@ static void tdfx_render_vb_poly( struct gl_context *ctx, (void) flags; INIT(GL_POLYGON); - + fxMesa->Glide.grDrawVertexArrayContiguous( GR_POLYGON, count-start, fxVB + start, sizeof(tdfxVertex)); } @@ -814,7 +814,7 @@ static void tdfx_render_vb_noop( struct gl_context *ctx, static void (*tdfx_render_tab_verts[GL_POLYGON+2])(struct gl_context *, GLuint, GLuint, - GLuint) = + GLuint) = { tdfx_render_vb_points, tdfx_render_vb_lines, @@ -869,8 +869,8 @@ static void (*tdfx_render_tab_verts[GL_POLYGON+2])(struct gl_context *, const GLuint * const elt = TNL_CONTEXT(ctx)->vb.Elts; \ (void) elt; -#define RESET_STIPPLE -#define RESET_OCCLUSION +#define RESET_STIPPLE +#define RESET_OCCLUSION #define PRESERVE_VB_DEFS /* Elts, no clipping. @@ -897,7 +897,7 @@ static void (*tdfx_render_tab_verts[GL_POLYGON+2])(struct gl_context *, -static void tdfxRenderClippedPoly( struct gl_context *ctx, const GLuint *elts, +static void tdfxRenderClippedPoly( struct gl_context *ctx, const GLuint *elts, GLuint n ) { tdfxContextPtr fxMesa = TDFX_CONTEXT(ctx); @@ -905,7 +905,7 @@ static void tdfxRenderClippedPoly( struct gl_context *ctx, const GLuint *elts, struct vertex_buffer *VB = &tnl->vb; GLuint prim = fxMesa->render_primitive; - /* Render the new vertices as an unclipped polygon. + /* Render the new vertices as an unclipped polygon. */ { GLuint *tmp = VB->Elts; @@ -926,7 +926,7 @@ static void tdfxRenderClippedLine( struct gl_context *ctx, GLuint ii, GLuint jj tnl->Driver.Render.Line( ctx, ii, jj ); } -static void tdfxFastRenderClippedPoly( struct gl_context *ctx, const GLuint *elts, +static void tdfxFastRenderClippedPoly( struct gl_context *ctx, const GLuint *elts, GLuint n ) { int i; @@ -1058,7 +1058,7 @@ static void tdfxChooseRenderState(struct gl_context *ctx) /* TODO: Benchmark this. - * TODO: Use single back-buffer cliprect where possible. + * TODO: Use single back-buffer cliprect where possible. * NOTE: starts at 1, not zero! */ static GLboolean multipass_cliprect( struct gl_context *ctx, GLuint pass ) @@ -1066,12 +1066,12 @@ static GLboolean multipass_cliprect( struct gl_context *ctx, GLuint pass ) tdfxContextPtr fxMesa = TDFX_CONTEXT(ctx); if (pass >= fxMesa->numClipRects) return GL_FALSE; - else { + else { fxMesa->Glide.grClipWindow(fxMesa->pClipRects[pass].x1, fxMesa->screen_height - fxMesa->pClipRects[pass].y2, fxMesa->pClipRects[pass].x2, fxMesa->screen_height - fxMesa->pClipRects[pass].y1); - + return GL_TRUE; } } @@ -1092,10 +1092,10 @@ static void tdfxRunPipeline( struct gl_context *ctx ) if (!fxMesa->Fallback && fxMesa->new_gl_state) { if (fxMesa->new_gl_state & _TDFX_NEW_RASTERSETUP) tdfxChooseVertexState( ctx ); - + if (fxMesa->new_gl_state & _TDFX_NEW_RENDERSTATE) tdfxChooseRenderState( ctx ); - + fxMesa->new_gl_state = 0; } @@ -1113,7 +1113,7 @@ static void tdfxRenderStart( struct gl_context *ctx ) LOCK_HARDWARE(fxMesa); /* Make sure vertex format changes get uploaded before we start - * sending triangles. + * sending triangles. */ if (fxMesa->dirty) { tdfxEmitHwStateLocked( fxMesa ); @@ -1162,7 +1162,7 @@ static void tdfxRasterPrimitive( struct gl_context *ctx, GLenum prim ) -/* Determine the rasterized primitive when not drawing unfilled +/* Determine the rasterized primitive when not drawing unfilled * polygons. * * Used only for the default render stage which always decomposes @@ -1179,7 +1179,7 @@ static void tdfxRenderPrimitive( struct gl_context *ctx, GLenum prim ) if (rprim == GL_TRIANGLES && (ctx->_TriangleCaps & DD_TRI_UNFILLED)) return; - + if (fxMesa->raster_primitive != rprim) { tdfxRasterPrimitive( ctx, rprim ); } @@ -1278,10 +1278,10 @@ void tdfxDDInitTriFuncs( struct gl_context *ctx ) } fxMesa->RenderIndex = ~0; - + tnl->Driver.RunPipeline = tdfxRunPipeline; tnl->Driver.Render.Start = tdfxRenderStart; - tnl->Driver.Render.Finish = tdfxRenderFinish; + tnl->Driver.Render.Finish = tdfxRenderFinish; tnl->Driver.Render.PrimitiveNotify = tdfxRenderPrimitive; tnl->Driver.Render.ResetLineStipple = _swrast_ResetLineStipple; tnl->Driver.Render.BuildVertices = tdfxBuildVertices; diff --git a/src/mesa/drivers/dri/tdfx/tdfx_vb.c b/src/mesa/drivers/dri/tdfx/tdfx_vb.c index dafb6ec..fbbdd7d 100644 --- a/src/mesa/drivers/dri/tdfx/tdfx_vb.c +++ b/src/mesa/drivers/dri/tdfx/tdfx_vb.c @@ -15,14 +15,14 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * KEITH WHITWELL, OR ANY OTHER CONTRIBUTORS BE LIABLE FOR ANY CLAIM, - * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR - * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE + * KEITH WHITWELL, OR ANY OTHER CONTRIBUTORS BE LIABLE FOR ANY CLAIM, + * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * * */ - + #include "main/glheader.h" #include "main/mtypes.h" #include "main/imports.h" @@ -194,8 +194,8 @@ void tdfxPrintSetupFlags(char *msg, GLuint flags ) fprintf(stderr, "%s(%x): %s%s%s%s%s%s\n", msg, (int)flags, - (flags & TDFX_XYZ_BIT) ? " xyz," : "", - (flags & TDFX_W_BIT) ? " w," : "", + (flags & TDFX_XYZ_BIT) ? " xyz," : "", + (flags & TDFX_W_BIT) ? " w," : "", (flags & TDFX_RGBA_BIT) ? " rgba," : "", (flags & TDFX_TEX0_BIT) ? " tex-0," : "", (flags & TDFX_TEX1_BIT) ? " tex-1," : "", @@ -217,7 +217,7 @@ void tdfxCheckTexSizes( struct gl_context *ctx ) */ if (setup_tab[ind].vertex_format != fxMesa->vertexFormat) { FLUSH_BATCH(fxMesa); - fxMesa->dirty |= TDFX_UPLOAD_VERTEX_LAYOUT; + fxMesa->dirty |= TDFX_UPLOAD_VERTEX_LAYOUT; fxMesa->vertexFormat = setup_tab[ind].vertex_format; /* This is required as we have just changed the vertex @@ -256,7 +256,7 @@ void tdfxBuildVertices( struct gl_context *ctx, GLuint start, GLuint end, if (newinputs & VERT_BIT_FOG) ind |= TDFX_FOGC_BIT; - + if (newinputs & VERT_BIT_TEX0) ind |= TDFX_TEX0_BIT; @@ -314,7 +314,7 @@ void tdfxChooseVertexState( struct gl_context *ctx ) if (setup_tab[ind].vertex_format != fxMesa->vertexFormat) { FLUSH_BATCH(fxMesa); - fxMesa->dirty |= TDFX_UPLOAD_VERTEX_LAYOUT; + fxMesa->dirty |= TDFX_UPLOAD_VERTEX_LAYOUT; fxMesa->vertexFormat = setup_tab[ind].vertex_format; } } diff --git a/src/mesa/drivers/dri/tdfx/tdfx_vb.h b/src/mesa/drivers/dri/tdfx/tdfx_vb.h index 238a076..b88b8ea 100644 --- a/src/mesa/drivers/dri/tdfx/tdfx_vb.h +++ b/src/mesa/drivers/dri/tdfx/tdfx_vb.h @@ -15,9 +15,9 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * KEITH WHITWELL, OR ANY OTHER CONTRIBUTORS BE LIABLE FOR ANY CLAIM, - * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR - * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE + * KEITH WHITWELL, OR ANY OTHER CONTRIBUTORS BE LIABLE FOR ANY CLAIM, + * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * * @@ -36,7 +36,7 @@ #define TDFX_W_BIT 0x2 #define TDFX_RGBA_BIT 0x4 #define TDFX_TEX1_BIT 0x8 -#define TDFX_TEX0_BIT 0x10 +#define TDFX_TEX0_BIT 0x10 #define TDFX_PTEX_BIT 0x20 #define TDFX_FOGC_BIT 0x40 #define TDFX_MAX_SETUP 0x80 diff --git a/src/mesa/drivers/dri/tdfx/tdfx_vbtmp.h b/src/mesa/drivers/dri/tdfx/tdfx_vbtmp.h index c593ce0..9f07c09 100644 --- a/src/mesa/drivers/dri/tdfx/tdfx_vbtmp.h +++ b/src/mesa/drivers/dri/tdfx/tdfx_vbtmp.h @@ -45,7 +45,7 @@ static void TAG(emit)( struct gl_context *ctx, GLfloat (*col)[4]; GLuint tc0_stride, tc1_stride, col_stride; GLuint tc0_size, tc1_size, col_size; - GLfloat (*proj)[4] = VB->NdcPtr->data; + GLfloat (*proj)[4] = VB->NdcPtr->data; GLuint proj_stride = VB->NdcPtr->stride; GLfloat (*fog)[4]; GLuint fog_stride; @@ -74,13 +74,13 @@ static void TAG(emit)( struct gl_context *ctx, if (IND & TDFX_PTEX_BIT) tc1_size = VB->AttribPtr[_TNL_ATTRIB_TEX0 + tmu1_source]->size; } - + if (IND & TDFX_RGBA_BIT) { col = VB->AttribPtr[_TNL_ATTRIB_COLOR0]->data; col_stride = VB->AttribPtr[_TNL_ATTRIB_COLOR0]->stride; col_size = VB->AttribPtr[_TNL_ATTRIB_COLOR0]->size; } - + if (IND & TDFX_FOGC_BIT) { fog = VB->AttribPtr[_TNL_ATTRIB_FOG]->data; fog_stride = VB->AttribPtr[_TNL_ATTRIB_FOG]->stride; @@ -93,11 +93,11 @@ static void TAG(emit)( struct gl_context *ctx, proj = (GLfloat (*)[4])((GLubyte *)proj + start * proj_stride); if (IND & TDFX_TEX0_BIT) tc0 = (GLfloat (*)[4])((GLubyte *)tc0 + start * tc0_stride); - if (IND & TDFX_TEX1_BIT) + if (IND & TDFX_TEX1_BIT) tc1 = (GLfloat (*)[4])((GLubyte *)tc1 + start * tc1_stride); - if (IND & TDFX_RGBA_BIT) + if (IND & TDFX_RGBA_BIT) STRIDE_4F(col, start * col_stride); - if (IND & TDFX_FOGC_BIT) + if (IND & TDFX_FOGC_BIT) STRIDE_4F(fog, start * fog_stride); } @@ -108,7 +108,7 @@ static void TAG(emit)( struct gl_context *ctx, VIEWPORT_X(v->x, proj[0][0]); VIEWPORT_Y(v->y, proj[0][1]); VIEWPORT_Z(v->z, proj[0][2]); - v->rhw = proj[0][3]; + v->rhw = proj[0][3]; } else { /* clipped */ v->rhw = 1.0; @@ -136,9 +136,9 @@ static void TAG(emit)( struct gl_context *ctx, v->tv0 = tc0[0][1] * v0scale * w; if (IND & TDFX_PTEX_BIT) { v->tq0 = w; - if (tc0_size == 4) + if (tc0_size == 4) v->tq0 = tc0[0][3] * w; - } + } tc0 = (GLfloat (*)[4])((GLubyte *)tc0 + tc0_stride); } if (IND & TDFX_TEX1_BIT) { @@ -147,11 +147,11 @@ static void TAG(emit)( struct gl_context *ctx, v->tv1 = tc1[0][1] * v1scale * w; if (IND & TDFX_PTEX_BIT) { v->tq1 = w; - if (tc1_size == 4) + if (tc1_size == 4) v->tq1 = tc1[0][3] * w; } tc1 = (GLfloat (*)[4])((GLubyte *)tc1 + tc1_stride); - } + } } } } @@ -163,14 +163,14 @@ static GLboolean TAG(check_tex_sizes)( struct gl_context *ctx ) if (IND & TDFX_PTEX_BIT) return GL_TRUE; - + if (IND & TDFX_TEX0_BIT) { struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb; if (IND & TDFX_TEX1_BIT) { if (VB->AttribPtr[_TNL_ATTRIB_TEX0] == 0) VB->AttribPtr[_TNL_ATTRIB_TEX0] = VB->AttribPtr[_TNL_ATTRIB_TEX1]; - + if (VB->AttribPtr[_TNL_ATTRIB_TEX1]->size == 4) return GL_FALSE; } @@ -184,7 +184,7 @@ static GLboolean TAG(check_tex_sizes)( struct gl_context *ctx ) static void TAG(interp)( struct gl_context *ctx, - GLfloat t, + GLfloat t, GLuint edst, GLuint eout, GLuint ein, GLboolean force_boundary ) { @@ -246,7 +246,7 @@ static void TAG(init)( void ) else { setup_tab[IND].vertex_format = TDFX_LAYOUT_MULTI; } - } + } else if (IND & TDFX_TEX0_BIT) { if (IND & TDFX_PTEX_BIT) { setup_tab[IND].vertex_format = TDFX_LAYOUT_PROJ1; diff --git a/src/mesa/drivers/dri/unichrome/Makefile b/src/mesa/drivers/dri/unichrome/Makefile index 14cf9f3..7a162fc 100644 --- a/src/mesa/drivers/dri/unichrome/Makefile +++ b/src/mesa/drivers/dri/unichrome/Makefile @@ -16,13 +16,13 @@ DRIVER_SOURCES = \ via_span.c \ via_state.c \ via_texcombine.c \ - via_tris.c + via_tris.c C_SOURCES = \ $(COMMON_SOURCES) \ $(DRIVER_SOURCES) -ASM_SOURCES = +ASM_SOURCES = include ../Makefile.template diff --git a/src/mesa/drivers/dri/unichrome/server/via_priv.h b/src/mesa/drivers/dri/unichrome/server/via_priv.h index 352eac0..954d377 100644 --- a/src/mesa/drivers/dri/unichrome/server/via_priv.h +++ b/src/mesa/drivers/dri/unichrome/server/via_priv.h @@ -32,7 +32,7 @@ typedef struct { VIAMem HQVMem; VIAMem SWfbMem; - DDPIXELFORMAT DPFsrc; + DDPIXELFORMAT DPFsrc; DDUPDATEOVERLAY UpdateOverlayBackup; /* For HQVcontrol func use // To save MPEG updateoverlay info.*/ diff --git a/src/mesa/drivers/dri/unichrome/via_3d_reg.h b/src/mesa/drivers/dri/unichrome/via_3d_reg.h index 77b24dc..f3abbe8 100644 --- a/src/mesa/drivers/dri/unichrome/via_3d_reg.h +++ b/src/mesa/drivers/dri/unichrome/via_3d_reg.h @@ -51,8 +51,8 @@ /* Transmission Space */ -#define HC_REG_Hpara0 0x0040 -#define HC_REG_HpataAF 0x02fc +#define HC_REG_Hpara0 0x0040 +#define HC_REG_HpataAF 0x02fc /* Read */ @@ -302,10 +302,10 @@ #define HC_HZWTMD_GE 0x00060000 #define HC_HZWTMD_AllPass 0x00070000 #define HC_HEBEBias_SHIFT 8 -/* HC_SubA_HZWCDL 0x0016 +/* HC_SubA_HZWCDL 0x0016 */ #define HC_HZWCDL_MASK 0x00ffffff -/* HC_SubA_HZWCTAGnum 0x0017 +/* HC_SubA_HZWCTAGnum 0x0017 */ #define HC_HZWCTAGnum_MASK 0x00ff0000 #define HC_HZWCTAGnum_SHIFT 16 @@ -1056,8 +1056,8 @@ #define HC_XTC_Atex 0x00000007 #define HC_XTC_Acur 0x00000008 #define HC_XTC_HTXnTBLRC 0x00000009 -#define HC_XTC_Ctexnext 0x0000000a -/** HC_SubA_HTXnTBLCsat 0x0080 +#define HC_XTC_Ctexnext 0x0000000a +/** HC_SubA_HTXnTBLCsat 0x0080 */ #define HC_HTXnTBLCsat_MASK 0x00800000 #define HC_HTXnTBLCa_MASK 0x000fc000 @@ -1076,7 +1076,7 @@ #define HC_HTXnTBLCa_Atex (HC_XTC_Atex << 14) #define HC_HTXnTBLCa_Acur (HC_XTC_Acur << 14) #define HC_HTXnTBLCa_HTXnTBLRC (HC_XTC_HTXnTBLRC << 14) -#define HC_HTXnTBLCa_Ctexnext (HC_XTC_Ctexnext << 14) +#define HC_HTXnTBLCa_Ctexnext (HC_XTC_Ctexnext << 14) #define HC_HTXnTBLCb_TOPC (HC_XTC_TOPC << 7) #define HC_HTXnTBLCb_InvTOPC (HC_XTC_InvTOPC << 7) #define HC_HTXnTBLCb_TOPCp5 (HC_XTC_TOPCp5 << 7) @@ -1090,7 +1090,7 @@ #define HC_HTXnTBLCb_Atex (HC_XTC_Atex << 7) #define HC_HTXnTBLCb_Acur (HC_XTC_Acur << 7) #define HC_HTXnTBLCb_HTXnTBLRC (HC_XTC_HTXnTBLRC << 7) -#define HC_HTXnTBLCb_Ctexnext (HC_XTC_Ctexnext << 7) +#define HC_HTXnTBLCb_Ctexnext (HC_XTC_Ctexnext << 7) #define HC_HTXnTBLCc_TOPC (HC_XTC_TOPC << 0) #define HC_HTXnTBLCc_InvTOPC (HC_XTC_InvTOPC << 0) #define HC_HTXnTBLCc_TOPCp5 (HC_XTC_TOPCp5 << 0) @@ -1104,7 +1104,7 @@ #define HC_HTXnTBLCc_Atex (HC_XTC_Atex << 0) #define HC_HTXnTBLCc_Acur (HC_XTC_Acur << 0) #define HC_HTXnTBLCc_HTXnTBLRC (HC_XTC_HTXnTBLRC << 0) -#define HC_HTXnTBLCc_Ctexnext (HC_XTC_Ctexnext << 0) +#define HC_HTXnTBLCc_Ctexnext (HC_XTC_Ctexnext << 0) /* HC_SubA_HTXnTBLCop 0x0081 */ #define HC_HTXnTBLdot_MASK 0x00c00000 @@ -1172,7 +1172,7 @@ #define HC_XTA_Acur 0x00000002 #define HC_XTA_HTXnTBLRA 0x00000003 #define HC_XTA_Atex 0x00000004 -#define HC_XTA_Atexnext 0x00000005 +#define HC_XTA_Atexnext 0x00000005 /*-- */ #define HC_HTXnTBLAsat_MASK 0x00800000 @@ -1189,7 +1189,7 @@ #define HC_HTXnTBLAa_Acur (HC_XTA_Acur << 14) #define HC_HTXnTBLAa_HTXnTBLRA (HC_XTA_HTXnTBLRA << 14) #define HC_HTXnTBLAa_Atex (HC_XTA_Atex << 14) -#define HC_HTXnTBLAa_Atexnext (HC_XTA_Atexnext << 14) +#define HC_HTXnTBLAa_Atexnext (HC_XTA_Atexnext << 14) #define HC_HTXnTBLAb_TOPA (HC_XTA_TOPA << 7) #define HC_HTXnTBLAb_InvTOPA (HC_XTA_InvTOPA << 7) #define HC_HTXnTBLAb_TOPAp5 (HC_XTA_TOPAp5 << 7) @@ -1198,7 +1198,7 @@ #define HC_HTXnTBLAb_Acur (HC_XTA_Acur << 7) #define HC_HTXnTBLAb_HTXnTBLRA (HC_XTA_HTXnTBLRA << 7) #define HC_HTXnTBLAb_Atex (HC_XTA_Atex << 7) -#define HC_HTXnTBLAb_Atexnext (HC_XTA_Atexnext << 7) +#define HC_HTXnTBLAb_Atexnext (HC_XTA_Atexnext << 7) #define HC_HTXnTBLAc_TOPA (HC_XTA_TOPA << 0) #define HC_HTXnTBLAc_InvTOPA (HC_XTA_InvTOPA << 0) #define HC_HTXnTBLAc_TOPAp5 (HC_XTA_TOPAp5 << 0) @@ -1207,7 +1207,7 @@ #define HC_HTXnTBLAc_Acur (HC_XTA_Acur << 0) #define HC_HTXnTBLAc_HTXnTBLRA (HC_XTA_HTXnTBLRA << 0) #define HC_HTXnTBLAc_Atex (HC_XTA_Atex << 0) -#define HC_HTXnTBLAc_Atexnext (HC_XTA_Atexnext << 0) +#define HC_HTXnTBLAc_Atexnext (HC_XTA_Atexnext << 0) /* HC_SubA_HTXnTBLRAa 0x0089 */ #define HC_HTXnTBLRAa_MASK 0x00ff0000 @@ -1589,44 +1589,44 @@ /****************************************************************************** ** Define the AGP command header. ******************************************************************************/ -#define HC_ACMD_MASK 0xfe000000 -#define HC_ACMD_SUB_MASK 0x0c000000 -#define HC_ACMD_HCmdA 0xee000000 -#define HC_ACMD_HCmdB 0xec000000 -#define HC_ACMD_HCmdC 0xea000000 -#define HC_ACMD_H1 0xf0000000 -#define HC_ACMD_H2 0xf2000000 -#define HC_ACMD_H3 0xf4000000 -#define HC_ACMD_H4 0xf6000000 +#define HC_ACMD_MASK 0xfe000000 +#define HC_ACMD_SUB_MASK 0x0c000000 +#define HC_ACMD_HCmdA 0xee000000 +#define HC_ACMD_HCmdB 0xec000000 +#define HC_ACMD_HCmdC 0xea000000 +#define HC_ACMD_H1 0xf0000000 +#define HC_ACMD_H2 0xf2000000 +#define HC_ACMD_H3 0xf4000000 +#define HC_ACMD_H4 0xf6000000 #define HC_ACMD_H1IO_MASK 0x000001ff -#define HC_ACMD_H2IO1_MASK 0x001ff000 +#define HC_ACMD_H2IO1_MASK 0x001ff000 #define HC_ACMD_H2IO2_MASK 0x000001ff -#define HC_ACMD_H2IO1_SHIFT 12 +#define HC_ACMD_H2IO1_SHIFT 12 #define HC_ACMD_H2IO2_SHIFT 0 #define HC_ACMD_H3IO_MASK 0x000001ff -#define HC_ACMD_H3COUNT_MASK 0x01fff000 -#define HC_ACMD_H3COUNT_SHIFT 12 +#define HC_ACMD_H3COUNT_MASK 0x01fff000 +#define HC_ACMD_H3COUNT_SHIFT 12 #define HC_ACMD_H4ID_MASK 0x000001ff #define HC_ACMD_H4COUNT_MASK 0x01fffe00 #define HC_ACMD_H4COUNT_SHIFT 9 /******************************************************************************** -** Define Header +** Define Header ********************************************************************************/ #define HC_HEADER2 0xF210F110 /******************************************************************************** -** Define Dummy Value +** Define Dummy Value ********************************************************************************/ #define HC_DUMMY 0xCCCCCCCC /******************************************************************************** -** Define for DMA use +** Define for DMA use ********************************************************************************/ #define HALCYON_HEADER2 0XF210F110 -#define HALCYON_FIRECMD 0XEE100000 +#define HALCYON_FIRECMD 0XEE100000 #define HALCYON_FIREMASK 0XFFF00000 -#define HALCYON_CMDB 0XEC000000 +#define HALCYON_CMDB 0XEC000000 #define HALCYON_CMDBMASK 0XFFFE0000 #define HALCYON_SUB_ADDR0 0X00000000 #define HALCYON_HEADER1MASK 0XFFFFFF00 diff --git a/src/mesa/drivers/dri/unichrome/via_context.c b/src/mesa/drivers/dri/unichrome/via_context.c index 963609b..707a6cf 100644 --- a/src/mesa/drivers/dri/unichrome/via_context.c +++ b/src/mesa/drivers/dri/unichrome/via_context.c @@ -24,7 +24,7 @@ /** * \file via_context.c - * + * * \author John Sheng (presumably of either VIA Technologies or S3 Graphics) * \author Others at VIA Technologies? * \author Others at S3 Graphics? @@ -98,7 +98,7 @@ static const GLubyte *viaGetString(struct gl_context *ctx, GLenum name) struct via_context *vmesa = VIA_CONTEXT(ctx); unsigned id = vmesa->viaScreen->deviceID; - offset = driGetRendererString( buffer, + offset = driGetRendererString( buffer, chipset_names[(id > VIA_PM800) ? 0 : id], DRIVER_DATE, 0 ); return (GLubyte *)buffer; @@ -116,7 +116,7 @@ static const GLubyte *viaGetString(struct gl_context *ctx, GLenum name) * 16 pixels. * * \param width Minimum buffer width, in pixels. - * + * * \returns A pixel width that meets the alignment requirements. */ static INLINE unsigned @@ -194,11 +194,11 @@ viaInitRenderbuffer(struct via_renderbuffer *vrb, GLenum format, /** * Calculate the framebuffer parameters for all buffers (front, back, depth, * and stencil) associated with the specified context. - * + * * \warning * This function also calls \c AllocateBuffer to actually allocate the * buffers. - * + * * \sa AllocateBuffer */ static GLboolean @@ -278,7 +278,7 @@ calculate_buffer_parameters(struct via_context *vmesa, vmesa->front.bpp = vmesa->viaScreen->bitsPerPixel; vmesa->front.pitch = buffer_align( w ) << shift; /* bytes, not pixels */ vmesa->front.size = vmesa->front.pitch * h; - if (getenv("ALTERNATE_SCREEN")) + if (getenv("ALTERNATE_SCREEN")) vmesa->front.offset = vmesa->front.size; else vmesa->front.offset = 0; @@ -311,7 +311,7 @@ calculate_buffer_parameters(struct via_context *vmesa, if (vmesa->depth.bpp == 24) vmesa->depth.bpp = 32; - vmesa->depth.pitch = (buffer_align( vmesa->driDrawable->w ) * + vmesa->depth.pitch = (buffer_align( vmesa->driDrawable->w ) * (vmesa->depth.bpp/8)) + extra; vmesa->depth.size = vmesa->depth.pitch * vmesa->driDrawable->h; @@ -338,7 +338,7 @@ calculate_buffer_parameters(struct via_context *vmesa, vmesa->stencil.orig = vmesa->depth.orig; vmesa->stencil.origMap = vmesa->depth.origMap; - if( vmesa->viaScreen->width == vmesa->driDrawable->w && + if( vmesa->viaScreen->width == vmesa->driDrawable->w && vmesa->viaScreen->height == vmesa->driDrawable->h ) { vmesa->doPageFlip = vmesa->allowPageFlip; if (vmesa->hasBack) { @@ -426,7 +426,7 @@ AllocateDmaBuffer(struct via_context *vmesa) { if (vmesa->dma) via_free_dma_buffer(vmesa); - + if (!via_alloc_dma_buffer(vmesa)) return GL_FALSE; @@ -484,9 +484,9 @@ viaCreateContext(gl_api api, vmesa->hasBack = visual->doubleBufferMode; switch(visual->depthBits) { - case 0: + case 0: vmesa->hasDepth = GL_FALSE; - vmesa->depthBits = 0; + vmesa->depthBits = 0; vmesa->depth_max = 1.0; break; case 16: @@ -524,7 +524,7 @@ viaCreateContext(gl_api api, vmesa->polygon_offset_scale = 2.0 / vmesa->depth_max; break; default: - assert(0); + assert(0); break; } @@ -544,9 +544,9 @@ viaCreateContext(gl_api api, vmesa->glCtx = _mesa_create_context(visual, shareCtx, &functions, (void*) vmesa); - + vmesa->shareCtx = shareCtx; - + if (!vmesa->glCtx) { FREE(vmesa); return GL_FALSE; @@ -650,7 +650,7 @@ viaCreateContext(gl_api api, viaInitSpanFuncs(ctx); viaInitIoctlFuncs(ctx); viaInitState(ctx); - + if (getenv("VIA_DEBUG")) VIA_DEBUG = driParseDebugString( getenv( "VIA_DEBUG" ), debug_control ); @@ -738,13 +738,13 @@ void viaXMesaWindowMoved(struct via_context *vmesa) draw_buffer = (struct via_renderbuffer *) drawable->driverPrivate; read_buffer = (struct via_renderbuffer *) readable->driverPrivate; - + switch (vmesa->glCtx->DrawBuffer->_ColorDrawBufferIndexes[0]) { - case BUFFER_BACK_LEFT: + case BUFFER_BACK_LEFT: if (drawable->numBackClipRects == 0) { vmesa->numClipRects = drawable->numClipRects; vmesa->pClipRects = drawable->pClipRects; - } + } else { vmesa->numClipRects = drawable->numBackClipRects; vmesa->pClipRects = drawable->pBackClipRects; @@ -759,7 +759,7 @@ void viaXMesaWindowMoved(struct via_context *vmesa) break; } - if ((draw_buffer->drawW != drawable->w) + if ((draw_buffer->drawW != drawable->w) || (draw_buffer->drawH != drawable->h)) { calculate_buffer_parameters(vmesa, vmesa->glCtx->DrawBuffer, drawable); @@ -771,7 +771,7 @@ void viaXMesaWindowMoved(struct via_context *vmesa) draw_buffer->drawH = drawable->h; if (drawable != readable) { - if ((read_buffer->drawW != readable->w) + if ((read_buffer->drawW != readable->w) || (read_buffer->drawH != readable->h)) { calculate_buffer_parameters(vmesa, vmesa->glCtx->ReadBuffer, readable); @@ -783,12 +783,12 @@ void viaXMesaWindowMoved(struct via_context *vmesa) read_buffer->drawH = readable->h; } - vmesa->front.orig = (vmesa->front.offset + - draw_buffer->drawY * vmesa->front.pitch + + vmesa->front.orig = (vmesa->front.offset + + draw_buffer->drawY * vmesa->front.pitch + draw_buffer->drawX * bytePerPixel); - vmesa->front.origMap = (vmesa->front.map + - draw_buffer->drawY * vmesa->front.pitch + + vmesa->front.origMap = (vmesa->front.map + + draw_buffer->drawY * vmesa->front.pitch + draw_buffer->drawX * bytePerPixel); vmesa->back.orig = (vmesa->back.offset + @@ -801,7 +801,7 @@ void viaXMesaWindowMoved(struct via_context *vmesa) vmesa->depth.orig = (vmesa->depth.offset + draw_buffer->drawY * vmesa->depth.pitch + - draw_buffer->drawX * bytePerPixel); + draw_buffer->drawX * bytePerPixel); vmesa->depth.origMap = (vmesa->depth.map + draw_buffer->drawY * vmesa->depth.pitch + @@ -823,12 +823,12 @@ viaMakeCurrent(__DRIcontext *driContextPriv, { if (VIA_DEBUG & DEBUG_DRI) { fprintf(stderr, "driContextPriv = %016lx\n", (unsigned long)driContextPriv); - fprintf(stderr, "driDrawPriv = %016lx\n", (unsigned long)driDrawPriv); + fprintf(stderr, "driDrawPriv = %016lx\n", (unsigned long)driDrawPriv); fprintf(stderr, "driReadPriv = %016lx\n", (unsigned long)driReadPriv); - } + } if (driContextPriv) { - struct via_context *vmesa = + struct via_context *vmesa = (struct via_context *)driContextPriv->driverPrivate; struct gl_context *ctx = vmesa->glCtx; struct gl_framebuffer *drawBuffer, *readBuffer; @@ -850,7 +850,7 @@ viaMakeCurrent(__DRIcontext *driContextPriv, vmesa->driDrawable = driDrawPriv; vmesa->driReadable = driReadPriv; - if ((drawBuffer->Width != driDrawPriv->w) + if ((drawBuffer->Width != driDrawPriv->w) || (drawBuffer->Height != driDrawPriv->h)) { _mesa_resize_framebuffer(ctx, drawBuffer, driDrawPriv->w, driDrawPriv->h); @@ -878,7 +878,7 @@ viaMakeCurrent(__DRIcontext *driContextPriv, _mesa_make_current(vmesa->glCtx, drawBuffer, readBuffer); ctx->Driver.DrawBuffer( ctx, ctx->Color.DrawBuffer[0] ); - + viaXMesaWindowMoved(vmesa); ctx->Driver.Scissor(vmesa->glCtx, vmesa->glCtx->Scissor.X, @@ -889,7 +889,7 @@ viaMakeCurrent(__DRIcontext *driContextPriv, else { _mesa_make_current(NULL, NULL, NULL); } - + return GL_TRUE; } @@ -930,10 +930,10 @@ viaSwapBuffers(__DRIdrawable *drawablePrivate) { __DRIdrawable *dPriv = (__DRIdrawable *)drawablePrivate; - if (dPriv && - dPriv->driContextPriv && + if (dPriv && + dPriv->driContextPriv && dPriv->driContextPriv->driverPrivate) { - struct via_context *vmesa = + struct via_context *vmesa = (struct via_context *)dPriv->driContextPriv->driverPrivate; struct gl_context *ctx = vmesa->glCtx; diff --git a/src/mesa/drivers/dri/unichrome/via_context.h b/src/mesa/drivers/dri/unichrome/via_context.h index 660e771..9fc4d14 100644 --- a/src/mesa/drivers/dri/unichrome/via_context.h +++ b/src/mesa/drivers/dri/unichrome/via_context.h @@ -95,15 +95,15 @@ struct via_renderbuffer { GLuint pitch; GLuint bpp; char *map; - GLuint orig; /* The drawing origin, + GLuint orig; /* The drawing origin, * at (drawX,drawY) in screen space. */ char *origMap; int drawX; /* origin of drawable in draw buffer */ - int drawY; - int drawW; - int drawH; + int drawY; + int drawW; + int drawH; __DRIdrawable *dPriv; }; @@ -117,7 +117,7 @@ struct via_tex_buffer { unsigned long index; unsigned long offset; GLuint size; - GLuint memType; + GLuint memType; unsigned char *bufAddr; GLuint texBase; GLuint lastUsed; @@ -147,12 +147,12 @@ struct via_texture_object { } regTexBaseAndPitch[12]; GLint firstLevel, lastLevel; /* upload tObj->Image[first .. lastLevel] */ -}; +}; struct via_context { - GLint refcount; + GLint refcount; struct gl_context *glCtx; struct gl_context *shareCtx; @@ -179,7 +179,7 @@ struct via_context { GLubyte *dma; viaRegion tex; - + /* Bit flag to keep 0track of fallbacks. */ GLuint Fallback; @@ -207,9 +207,9 @@ struct via_context { GLuint dmaCliprectAddr; GLuint dmaLastPrim; GLboolean useAgp; - - /* Fallback rasterization functions + + /* Fallback rasterization functions */ via_point_func drawPoint; via_line_func drawLine; @@ -246,7 +246,7 @@ struct via_context { GLuint regHLP; GLuint regHLPRF; - + GLuint regHTXnCLOD[2]; GLuint regHTXnTB[2]; GLuint regHTXnMPMD[2]; @@ -336,12 +336,12 @@ struct via_context { GLuint lastBreadcrumbWrite; GLuint lastSwap[2]; GLuint lastDma; - + GLuint total_alloc[VIA_MEM_SYSTEM+1]; struct via_tex_buffer tex_image_list[VIA_MEM_SYSTEM+1]; struct via_tex_buffer freed_tex_buffers; - + }; @@ -350,7 +350,7 @@ struct via_context { -/* Lock the hardware and validate our state. +/* Lock the hardware and validate our state. */ #define LOCK_HARDWARE(vmesa) \ do { \ @@ -365,9 +365,9 @@ struct via_context { /* Release the kernel lock. */ #define UNLOCK_HARDWARE(vmesa) \ - DRM_UNLOCK(vmesa->driFd, vmesa->driHwLock, vmesa->hHWContext); + DRM_UNLOCK(vmesa->driFd, vmesa->driHwLock, vmesa->hHWContext); + - extern GLuint VIA_DEBUG; @@ -398,7 +398,7 @@ extern void viaReAllocateBuffers(struct gl_context *ctx, struct gl_framebuffer * extern void viaXMesaWindowMoved(struct via_context *vmesa); extern GLboolean viaTexCombineState(struct via_context *vmesa, - const struct gl_tex_env_combine_state * combine, + const struct gl_tex_env_combine_state * combine, unsigned unit ); /* Via hw already adjusted for GL pixel centers: diff --git a/src/mesa/drivers/dri/unichrome/via_fb.c b/src/mesa/drivers/dri/unichrome/via_fb.c index bebf061..7c2b569 100644 --- a/src/mesa/drivers/dri/unichrome/via_fb.c +++ b/src/mesa/drivers/dri/unichrome/via_fb.c @@ -42,10 +42,10 @@ via_alloc_draw_buffer(struct via_context *vmesa, struct via_renderbuffer *buf) mem.offset = 0; mem.index = 0; - if (ioctl(vmesa->driFd, DRM_IOCTL_VIA_ALLOCMEM, &mem)) + if (ioctl(vmesa->driFd, DRM_IOCTL_VIA_ALLOCMEM, &mem)) return GL_FALSE; - - + + buf->offset = mem.offset; buf->map = (char *)vmesa->driScreen->pFB + mem.offset; buf->index = mem.index; @@ -76,23 +76,23 @@ via_alloc_dma_buffer(struct via_context *vmesa) drm_via_dma_init_t init; vmesa->dma = (GLubyte *) malloc(VIA_DMA_BUFSIZ); - + /* * Check whether AGP DMA has been initialized. */ memset(&init, 0, sizeof(init)); init.func = VIA_DMA_INITIALIZED; - vmesa->useAgp = - ( 0 == drmCommandWrite(vmesa->driFd, DRM_VIA_DMA_INIT, + vmesa->useAgp = + ( 0 == drmCommandWrite(vmesa->driFd, DRM_VIA_DMA_INIT, &init, sizeof(init))); if (VIA_DEBUG & DEBUG_DMA) { - if (vmesa->useAgp) + if (vmesa->useAgp) fprintf(stderr, "unichrome_dri.so: Using AGP.\n"); else fprintf(stderr, "unichrome_dri.so: Using PCI.\n"); } - + return ((vmesa->dma) ? GL_TRUE : GL_FALSE); } @@ -102,7 +102,7 @@ via_free_dma_buffer(struct via_context *vmesa) if (!vmesa) return; free(vmesa->dma); vmesa->dma = 0; -} +} /* These functions now allocate and free the via_tex_buffer struct as well: @@ -113,7 +113,7 @@ via_alloc_texture(struct via_context *vmesa, GLuint memType) { struct via_tex_buffer *t = CALLOC_STRUCT(via_tex_buffer); - + if (!t) goto cleanup; @@ -121,7 +121,7 @@ via_alloc_texture(struct via_context *vmesa, t->memType = memType; insert_at_tail(&vmesa->tex_image_list[memType], t); - if (t->memType == VIA_MEM_AGP || + if (t->memType == VIA_MEM_AGP || t->memType == VIA_MEM_VIDEO) { drm_via_mem_t fb; @@ -131,8 +131,8 @@ via_alloc_texture(struct via_context *vmesa, fb.offset = 0; fb.index = 0; - if (ioctl(vmesa->driFd, DRM_IOCTL_VIA_ALLOCMEM, &fb) != 0 || - fb.index == 0) + if (ioctl(vmesa->driFd, DRM_IOCTL_VIA_ALLOCMEM, &fb) != 0 || + fb.index == 0) goto cleanup; if (0) @@ -140,10 +140,10 @@ via_alloc_texture(struct via_context *vmesa, t->offset = fb.offset; t->index = fb.index; - + if (t->memType == VIA_MEM_AGP) { t->bufAddr = (GLubyte *)((unsigned long)vmesa->viaScreen->agpLinearStart + - fb.offset); + fb.offset); t->texBase = vmesa->agpBase + fb.offset; } else { @@ -155,8 +155,8 @@ via_alloc_texture(struct via_context *vmesa, return t; } else if (t->memType == VIA_MEM_SYSTEM) { - - t->bufAddr = malloc(t->size); + + t->bufAddr = malloc(t->size); if (!t->bufAddr) goto cleanup; @@ -200,21 +200,21 @@ via_do_free_texture(struct via_context *vmesa, struct via_tex_buffer *t) /* Release textures which were potentially still being referenced by * hardware at the time when they were originally freed. */ -void +void via_release_pending_textures( struct via_context *vmesa ) { struct via_tex_buffer *s, *tmp; - + foreach_s( s, tmp, &vmesa->freed_tex_buffers ) { if (!VIA_GEQ_WRAP(s->lastUsed, vmesa->lastBreadcrumbRead)) { if (VIA_DEBUG & DEBUG_TEXTURE) fprintf(stderr, "%s: release tex sz %d lastUsed %x\n", - __FUNCTION__, s->size, s->lastUsed); + __FUNCTION__, s->size, s->lastUsed); via_do_free_texture(vmesa, s); } } } - + void @@ -235,7 +235,7 @@ via_free_texture(struct via_context *vmesa, struct via_tex_buffer *t) else { /* Close current breadcrumb so that we can free this eventually: */ - if (t->lastUsed == vmesa->lastBreadcrumbWrite) + if (t->lastUsed == vmesa->lastBreadcrumbWrite) viaEmitBreadcrumb(vmesa); move_to_tail( &vmesa->freed_tex_buffers, t ); diff --git a/src/mesa/drivers/dri/unichrome/via_ioctl.c b/src/mesa/drivers/dri/unichrome/via_ioctl.c index 116adda..52dd319 100644 --- a/src/mesa/drivers/dri/unichrome/via_ioctl.c +++ b/src/mesa/drivers/dri/unichrome/via_ioctl.c @@ -48,9 +48,9 @@ #define VIA_REG_GEMODE 0x004 #define VIA_REG_SRCBASE 0x030 #define VIA_REG_DSTBASE 0x034 -#define VIA_REG_PITCH 0x038 -#define VIA_REG_SRCCOLORKEY 0x01C -#define VIA_REG_KEYCONTROL 0x02C +#define VIA_REG_PITCH 0x038 +#define VIA_REG_SRCCOLORKEY 0x01C +#define VIA_REG_KEYCONTROL 0x02C #define VIA_REG_SRCPOS 0x008 #define VIA_REG_DSTPOS 0x00C #define VIA_REG_GECMD 0x000 @@ -107,18 +107,18 @@ void viaCheckDma(struct via_context *vmesa, GLuint bytes) static void viaBlit(struct via_context *vmesa, GLuint bpp, - GLuint srcBase, GLuint srcPitch, + GLuint srcBase, GLuint srcPitch, GLuint dstBase, GLuint dstPitch, - GLuint w, GLuint h, - GLuint blitMode, - GLuint color, GLuint nMask ) + GLuint w, GLuint h, + GLuint blitMode, + GLuint color, GLuint nMask ) { GLuint dwGEMode, srcX, dstX, cmd; RING_VARS; if (VIA_DEBUG & DEBUG_2D) - fprintf(stderr, + fprintf(stderr, "%s bpp %d src %x/%x dst %x/%x w %d h %d " " mode: %x color: 0x%08x mask 0x%08x\n", __FUNCTION__, bpp, srcBase, srcPitch, dstBase, @@ -152,7 +152,7 @@ static void viaBlit(struct via_context *vmesa, GLuint bpp, break; default: return; - } + } BEGIN_RING(22); SetReg2DAGP( VIA_REG_GEMODE, dwGEMode); @@ -180,22 +180,22 @@ static void viaFillBuffer(struct via_context *vmesa, GLuint bytePerPixel = buffer->bpp >> 3; GLuint i; - for (i = 0; i < nboxes ; i++) { + for (i = 0; i < nboxes ; i++) { int x = pbox[i].x1 - buffer->drawX; int y = pbox[i].y1 - buffer->drawY; int w = pbox[i].x2 - pbox[i].x1; int h = pbox[i].y2 - pbox[i].y1; - int offset = (buffer->offset + - y * buffer->pitch + + int offset = (buffer->offset + + y * buffer->pitch + x * bytePerPixel); viaBlit(vmesa, - buffer->bpp, + buffer->bpp, + offset, buffer->pitch, offset, buffer->pitch, - offset, buffer->pitch, w, h, - VIA_BLIT_FILL, pixel, mask); + VIA_BLIT_FILL, pixel, mask); } } @@ -205,7 +205,7 @@ static void viaClear(struct gl_context *ctx, GLbitfield mask) { struct via_context *vmesa = VIA_CONTEXT(ctx); __DRIdrawable *dPriv = vmesa->driDrawable; - struct via_renderbuffer *const vrb = + struct via_renderbuffer *const vrb = (struct via_renderbuffer *) dPriv->driverPrivate; int flag = 0; GLuint i = 0; @@ -220,7 +220,7 @@ static void viaClear(struct gl_context *ctx, GLbitfield mask) } if (mask & BUFFER_BIT_BACK_LEFT) { - flag |= VIA_BACK; + flag |= VIA_BACK; mask &= ~BUFFER_BIT_BACK_LEFT; } @@ -230,7 +230,7 @@ static void viaClear(struct gl_context *ctx, GLbitfield mask) clear_depth_mask &= ~vmesa->depth_clear_mask; mask &= ~BUFFER_BIT_DEPTH; } - + if (mask & BUFFER_BIT_STENCIL) { if (vmesa->have_hw_stencil) { if ((ctx->Stencil.WriteMask[0] & 0xff) == 0xff) { @@ -242,7 +242,7 @@ static void viaClear(struct gl_context *ctx, GLbitfield mask) } else { if (VIA_DEBUG & DEBUG_2D) - fprintf(stderr, "Clear stencil writemask %x\n", + fprintf(stderr, "Clear stencil writemask %x\n", ctx->Stencil.WriteMask[0]); } } @@ -257,7 +257,7 @@ static void viaClear(struct gl_context *ctx, GLbitfield mask) mask |= BUFFER_BIT_BACK_LEFT; flag &= ~(VIA_FRONT | VIA_BACK); } - + if (flag) { drm_clip_rect_t *boxes, *tmp_boxes = 0; int nr = 0; @@ -265,7 +265,7 @@ static void viaClear(struct gl_context *ctx, GLbitfield mask) GLboolean all; LOCK_HARDWARE(vmesa); - + /* get region after locking: */ cx = ctx->DrawBuffer->_Xmin; cy = ctx->DrawBuffer->_Ymin; @@ -277,13 +277,13 @@ static void viaClear(struct gl_context *ctx, GLbitfield mask) cy = dPriv->h - cy - ch; cx += vrb->drawX; cy += vrb->drawY; - + if (!all) { - drm_clip_rect_t *b = vmesa->pClipRects; - - boxes = tmp_boxes = - (drm_clip_rect_t *)malloc(vmesa->numClipRects * - sizeof(drm_clip_rect_t)); + drm_clip_rect_t *b = vmesa->pClipRects; + + boxes = tmp_boxes = + (drm_clip_rect_t *)malloc(vmesa->numClipRects * + sizeof(drm_clip_rect_t)); if (!boxes) { UNLOCK_HARDWARE(vmesa); return; @@ -313,21 +313,21 @@ static void viaClear(struct gl_context *ctx, GLbitfield mask) boxes = vmesa->pClipRects; nr = vmesa->numClipRects; } - + if (flag & VIA_FRONT) { viaFillBuffer(vmesa, &vmesa->front, boxes, nr, vmesa->ClearColor, vmesa->ClearMask); - } - + } + if (flag & VIA_BACK) { - viaFillBuffer(vmesa, &vmesa->back, boxes, nr, vmesa->ClearColor, + viaFillBuffer(vmesa, &vmesa->back, boxes, nr, vmesa->ClearColor, vmesa->ClearMask); } if (flag & VIA_DEPTH) { viaFillBuffer(vmesa, &vmesa->depth, boxes, nr, clear_depth, clear_depth_mask); - } + } viaFlushDmaLocked(vmesa, VIA_NO_CLIPRECTS); UNLOCK_HARDWARE(vmesa); @@ -335,7 +335,7 @@ static void viaClear(struct gl_context *ctx, GLbitfield mask) if (tmp_boxes) free(tmp_boxes); } - + if (mask) _swrast_Clear(ctx, mask); } @@ -346,27 +346,27 @@ static void viaClear(struct gl_context *ctx, GLbitfield mask) static void viaDoSwapBuffers(struct via_context *vmesa, drm_clip_rect_t *b, GLuint nbox) -{ +{ GLuint bytePerPixel = vmesa->viaScreen->bitsPerPixel >> 3; struct via_renderbuffer *front = &vmesa->front; struct via_renderbuffer *back = &vmesa->back; GLuint i; - - for (i = 0; i < nbox; i++, b++) { + + for (i = 0; i < nbox; i++, b++) { GLint x = b->x1 - back->drawX; GLint y = b->y1 - back->drawY; GLint w = b->x2 - b->x1; GLint h = b->y2 - b->y1; - + GLuint src = back->offset + y * back->pitch + x * bytePerPixel; GLuint dest = front->offset + y * front->pitch + x * bytePerPixel; - viaBlit(vmesa, - bytePerPixel << 3, + viaBlit(vmesa, + bytePerPixel << 3, src, back->pitch, dest, front->pitch, w, h, - VIA_BLIT_COPY, 0, 0); + VIA_BLIT_COPY, 0, 0); } viaFlushDmaLocked(vmesa, VIA_NO_CLIPRECTS); /* redundant */ @@ -378,17 +378,17 @@ static void viaEmitBreadcrumbLocked( struct via_context *vmesa ) struct via_renderbuffer *buffer = &vmesa->breadcrumb; GLuint value = vmesa->lastBreadcrumbWrite + 1; - if (VIA_DEBUG & DEBUG_IOCTL) + if (VIA_DEBUG & DEBUG_IOCTL) fprintf(stderr, "%s %d\n", __FUNCTION__, value); assert(!vmesa->dmaLow); viaBlit(vmesa, - buffer->bpp, + buffer->bpp, + buffer->offset, buffer->pitch, buffer->offset, buffer->pitch, - buffer->offset, buffer->pitch, 1, 1, - VIA_BLIT_FILL, value, 0); + VIA_BLIT_FILL, value, 0); viaFlushDmaLocked(vmesa, VIA_NO_CLIPRECTS); /* often redundant */ vmesa->lastBreadcrumbWrite = value; @@ -397,7 +397,7 @@ static void viaEmitBreadcrumbLocked( struct via_context *vmesa ) void viaEmitBreadcrumb( struct via_context *vmesa ) { LOCK_HARDWARE(vmesa); - if (vmesa->dmaLow) + if (vmesa->dmaLow) viaFlushDmaLocked(vmesa, 0); viaEmitBreadcrumbLocked( vmesa ); @@ -415,11 +415,11 @@ static GLboolean viaCheckIdle( struct via_context *vmesa ) GLboolean viaCheckBreadcrumb( struct via_context *vmesa, GLuint value ) { - GLuint *buf = (GLuint *)vmesa->breadcrumb.map; + GLuint *buf = (GLuint *)vmesa->breadcrumb.map; vmesa->lastBreadcrumbRead = *buf; - if (VIA_DEBUG & DEBUG_IOCTL) - fprintf(stderr, "%s %d < %d: %d\n", __FUNCTION__, value, + if (VIA_DEBUG & DEBUG_IOCTL) + fprintf(stderr, "%s %d < %d: %d\n", __FUNCTION__, value, vmesa->lastBreadcrumbRead, !VIA_GEQ_WRAP(value, vmesa->lastBreadcrumbRead)); @@ -428,7 +428,7 @@ GLboolean viaCheckBreadcrumb( struct via_context *vmesa, GLuint value ) static void viaWaitBreadcrumb( struct via_context *vmesa, GLuint value ) { - if (VIA_DEBUG & DEBUG_IOCTL) + if (VIA_DEBUG & DEBUG_IOCTL) fprintf(stderr, "%s %d\n", __FUNCTION__, value); assert(!VIA_GEQ_WRAP(value, vmesa->lastBreadcrumbWrite)); @@ -458,7 +458,7 @@ void viaWaitIdle( struct via_context *vmesa, GLboolean light ) /* Need to wait? */ - if (VIA_GEQ_WRAP(vmesa->lastDma, vmesa->lastBreadcrumbRead)) + if (VIA_GEQ_WRAP(vmesa->lastDma, vmesa->lastBreadcrumbRead)) viaWaitBreadcrumb( vmesa, vmesa->lastDma ); if (light) return; @@ -473,7 +473,7 @@ void viaWaitIdle( struct via_context *vmesa, GLboolean light ) void viaWaitIdleLocked( struct via_context *vmesa, GLboolean light ) { - if (vmesa->dmaLow) + if (vmesa->dmaLow) viaFlushDmaLocked(vmesa, 0); if (VIA_DEBUG & DEBUG_IOCTL) @@ -488,7 +488,7 @@ void viaWaitIdleLocked( struct via_context *vmesa, GLboolean light ) /* Need to wait? */ - if (vmesa->lastDma >= vmesa->lastBreadcrumbRead) + if (vmesa->lastDma >= vmesa->lastBreadcrumbRead) viaWaitBreadcrumb( vmesa, vmesa->lastDma ); if (light) return; @@ -506,14 +506,14 @@ void viaWaitIdleLocked( struct via_context *vmesa, GLboolean light ) * except that WAIT_IDLE() will spin the CPU polling, while this is * IRQ driven. */ -static void viaWaitIdleVBlank( __DRIdrawable *dPriv, +static void viaWaitIdleVBlank( __DRIdrawable *dPriv, struct via_context *vmesa, GLuint value ) { GLboolean missed_target; __DRIscreen *psp = dPriv->driScreenPriv; - VIA_FLUSH_DMA(vmesa); + VIA_FLUSH_DMA(vmesa); if (!value) return; @@ -528,11 +528,11 @@ static void viaWaitIdleVBlank( __DRIdrawable *dPriv, vmesa->swap_missed_count++; (*psp->systemTime->getUST)( &vmesa->swap_missed_ust ); } - } - while (!viaCheckBreadcrumb(vmesa, value)); + } + while (!viaCheckBreadcrumb(vmesa, value)); vmesa->thrashing = 0; /* reset flag on swap */ - vmesa->swap_count++; + vmesa->swap_count++; via_release_pending_textures( vmesa ); } @@ -588,20 +588,20 @@ void viaResetPageFlippingLocked(struct via_context *vmesa) /* - * Copy the back buffer to the front buffer. + * Copy the back buffer to the front buffer. */ void viaCopyBuffer(__DRIdrawable *dPriv) { - struct via_context *vmesa = + struct via_context *vmesa = (struct via_context *)dPriv->driContextPriv->driverPrivate; __DRIscreen *psp = dPriv->driScreenPriv; if (VIA_DEBUG & DEBUG_IOCTL) - fprintf(stderr, + fprintf(stderr, "%s: lastSwap[1] %d lastSwap[0] %d lastWrite %d lastRead %d\n", __FUNCTION__, - vmesa->lastSwap[1], - vmesa->lastSwap[0], + vmesa->lastSwap[1], + vmesa->lastSwap[0], vmesa->lastBreadcrumbWrite, vmesa->lastBreadcrumbRead); @@ -636,7 +636,7 @@ void viaCopyBuffer(__DRIdrawable *dPriv) void viaPageFlip(__DRIdrawable *dPriv) { - struct via_context *vmesa = + struct via_context *vmesa = (struct via_context *)dPriv->driContextPriv->driverPrivate; struct via_renderbuffer buffer_tmp; __DRIscreen *psp = dPriv->driScreenPriv; @@ -688,7 +688,7 @@ static int fire_buffer(struct via_context *vmesa) bSiz.wait = 1; bSiz.size = VIA_CMDBUF_MAX_LAG; do { - ret = drmCommandWriteRead(vmesa->driFd, DRM_VIA_CMDBUF_SIZE, + ret = drmCommandWriteRead(vmesa->driFd, DRM_VIA_CMDBUF_SIZE, &bSiz, sizeof(bSiz)); } while (ret == -EAGAIN); if (ret) { @@ -702,7 +702,7 @@ static int fire_buffer(struct via_context *vmesa) /* Actually fire the buffer: */ do { - ret = drmCommandWrite(vmesa->driFd, DRM_VIA_CMDBUFFER, + ret = drmCommandWrite(vmesa->driFd, DRM_VIA_CMDBUFFER, &bufI, sizeof(bufI)); } while (ret == -EAGAIN); if (ret) { @@ -710,22 +710,22 @@ static int fire_buffer(struct via_context *vmesa) fprintf(stderr, "%s: DRM_VIA_CMDBUFFER returned %d\n", __FUNCTION__, ret); abort(); - /* If this fails, the original code fell back to the PCI path. + /* If this fails, the original code fell back to the PCI path. */ } - else + else return 0; /* Fall through to PCI handling?!? */ viaWaitIdleLocked(vmesa, GL_FALSE); } - + ret = drmCommandWrite(vmesa->driFd, DRM_VIA_PCICMD, &bufI, sizeof(bufI)); if (ret) { UNLOCK_HARDWARE(vmesa); dump_dma(vmesa); - fprintf(stderr, "%s: DRM_VIA_PCICMD returned %d\n", __FUNCTION__, ret); + fprintf(stderr, "%s: DRM_VIA_PCICMD returned %d\n", __FUNCTION__, ret); abort(); } @@ -738,20 +738,20 @@ static int fire_buffer(struct via_context *vmesa) * for each cliprect. */ static void via_emit_cliprect(struct via_context *vmesa, - drm_clip_rect_t *b) + drm_clip_rect_t *b) { struct via_renderbuffer *buffer = vmesa->drawBuffer; GLuint *vb = (GLuint *)(vmesa->dma + vmesa->dmaCliprectAddr); - GLuint format = (vmesa->viaScreen->bitsPerPixel == 0x20 - ? HC_HDBFM_ARGB8888 + GLuint format = (vmesa->viaScreen->bitsPerPixel == 0x20 + ? HC_HDBFM_ARGB8888 : HC_HDBFM_RGB565); GLuint pitch = buffer->pitch; GLuint offset = buffer->offset; if (0) - fprintf(stderr, "emit cliprect for box %d,%d %d,%d\n", + fprintf(stderr, "emit cliprect for box %d,%d %d,%d\n", b->x1, b->y1, b->x2, b->y2); vb[0] = HC_HEADER2; @@ -767,9 +767,9 @@ static void via_emit_cliprect(struct via_context *vmesa, vb[2] = (HC_SubA_HClipTB << 24) | (b->y1 << 12) | b->y2; vb[3] = (HC_SubA_HClipLR << 24) | (b->x1 << 12) | b->x2; } - + vb[4] = (HC_SubA_HDBBasL << 24) | (offset & 0xFFFFFF); - vb[5] = (HC_SubA_HDBBasH << 24) | ((offset & 0xFF000000) >> 24); + vb[5] = (HC_SubA_HDBBasH << 24) | ((offset & 0xFF000000) >> 24); vb[6] = (HC_SubA_HSPXYOS << 24); vb[7] = (HC_SubA_HDBFM << 24) | HC_HDBLoc_Local | format | pitch; @@ -782,9 +782,9 @@ static int intersect_rect(drm_clip_rect_t *out, drm_clip_rect_t *b) { *out = *a; - + if (0) - fprintf(stderr, "intersect %d,%d %d,%d and %d,%d %d,%d\n", + fprintf(stderr, "intersect %d,%d %d,%d and %d,%d %d,%d\n", a->x1, a->y1, a->x2, a->y2, b->x1, b->y1, b->x2, b->y2); @@ -808,7 +808,7 @@ void viaFlushDmaLocked(struct via_context *vmesa, GLuint flags) fprintf(stderr, "%s\n", __FUNCTION__); if (*(GLuint *)vmesa->driHwLock != (DRM_LOCK_HELD|vmesa->hHWContext) && - *(GLuint *)vmesa->driHwLock != + *(GLuint *)vmesa->driHwLock != (DRM_LOCK_HELD|DRM_LOCK_CONT|vmesa->hHWContext)) { fprintf(stderr, "%s called without lock held\n", __FUNCTION__); abort(); @@ -827,7 +827,7 @@ void viaFlushDmaLocked(struct via_context *vmesa, GLuint flags) abort(); } - switch (vmesa->dmaLow & 0x1F) { + switch (vmesa->dmaLow & 0x1F) { case 8: BEGIN_RING_NOCHECK( 6 ); OUT_RING( HC_HEADER2 ); @@ -845,7 +845,7 @@ void viaFlushDmaLocked(struct via_context *vmesa, GLuint flags) OUT_RING( HC_DUMMY ); OUT_RING( HC_DUMMY ); ADVANCE_RING(); - break; + break; case 24: BEGIN_RING_NOCHECK( 10 ); OUT_RING( HC_HEADER2 ); @@ -857,9 +857,9 @@ void viaFlushDmaLocked(struct via_context *vmesa, GLuint flags) OUT_RING( HC_DUMMY ); OUT_RING( HC_DUMMY ); OUT_RING( HC_DUMMY ); - OUT_RING( HC_DUMMY ); + OUT_RING( HC_DUMMY ); ADVANCE_RING(); - break; + break; case 0: break; default: @@ -896,7 +896,7 @@ void viaFlushDmaLocked(struct via_context *vmesa, GLuint flags) b.y2 = pbox[i].y2; if (vmesa->scissor && - !intersect_rect(&b, &b, &vmesa->scissorRect)) + !intersect_rect(&b, &b, &vmesa->scissorRect)) continue; via_emit_cliprect(vmesa, &b); @@ -927,10 +927,10 @@ void viaWrapPrimitive( struct via_context *vmesa ) GLenum hwPrimitive = vmesa->hwPrimitive; if (VIA_DEBUG & DEBUG_PRIMS) fprintf(stderr, "%s\n", __FUNCTION__); - + if (vmesa->dmaLastPrim) viaFinishPrimitive( vmesa ); - + viaFlushDma(vmesa); if (renderPrimitive != GL_POLYGON + 1) @@ -945,7 +945,7 @@ void viaFlushDma(struct via_context *vmesa) if (vmesa->dmaLow) { assert(!vmesa->dmaLastPrim); - LOCK_HARDWARE(vmesa); + LOCK_HARDWARE(vmesa); viaFlushDmaLocked(vmesa, 0); UNLOCK_HARDWARE(vmesa); } diff --git a/src/mesa/drivers/dri/unichrome/via_ioctl.h b/src/mesa/drivers/dri/unichrome/via_ioctl.h index 03df789..471c289 100644 --- a/src/mesa/drivers/dri/unichrome/via_ioctl.h +++ b/src/mesa/drivers/dri/unichrome/via_ioctl.h @@ -54,7 +54,7 @@ void viaEmitBreadcrumb( struct via_context *vmesa ); if (vmesa->dmaLow) \ viaFlushDma(vmesa); \ } while (0) - + void viaWrapPrimitive( struct via_context *vmesa ); @@ -129,5 +129,5 @@ static GLuint INLINE *viaExtendPrimitive(struct via_context *vmesa, int bytes) #define VIA_GEQ_WRAP(left, right) \ (((left) - (right)) < ( 1 << 23)) - + #endif diff --git a/src/mesa/drivers/dri/unichrome/via_render.c b/src/mesa/drivers/dri/unichrome/via_render.c index 10e2b4e..946226c 100644 --- a/src/mesa/drivers/dri/unichrome/via_render.c +++ b/src/mesa/drivers/dri/unichrome/via_render.c @@ -52,7 +52,7 @@ #define HAVE_LINE_LOOP 1 #define HAVE_TRIANGLES 1 #define HAVE_TRI_STRIPS 1 -#define HAVE_TRI_STRIP_1 0 +#define HAVE_TRI_STRIP_1 0 #define HAVE_TRI_FANS 1 #define HAVE_POLYGONS 1 #define HAVE_QUADS 0 @@ -73,8 +73,8 @@ viaExtendPrimitive( vmesa, (nr) * vmesa->vertexSize * 4) #define EMIT_VERTS(ctx, j, nr, buf) \ - _tnl_emit_vertices_to_buffer(ctx, j, (j)+(nr), buf ) - + _tnl_emit_vertices_to_buffer(ctx, j, (j)+(nr), buf ) + #define FLUSH() VIA_FINISH_PRIM( vmesa ) #define TAG(x) via_fast##x @@ -93,12 +93,12 @@ static GLboolean via_run_fastrender(struct gl_context *ctx, TNLcontext *tnl = TNL_CONTEXT(ctx); struct vertex_buffer *VB = &tnl->vb; GLuint i; - + tnl->Driver.Render.Start(ctx); - - if (VB->ClipOrMask || - vmesa->renderIndex != 0 || + + if (VB->ClipOrMask || + vmesa->renderIndex != 0 || !via_fastvalidate_render( ctx, VB )) { tnl->Driver.Render.Finish(ctx); return GL_TRUE; diff --git a/src/mesa/drivers/dri/unichrome/via_screen.c b/src/mesa/drivers/dri/unichrome/via_screen.c index 9ea656c..d639d77 100644 --- a/src/mesa/drivers/dri/unichrome/via_screen.c +++ b/src/mesa/drivers/dri/unichrome/via_screen.c @@ -124,10 +124,10 @@ viaInitDriver(__DRIscreen *sPriv) if (VIA_DEBUG & DEBUG_DRI) { fprintf(stderr, "deviceID = %08x\n", viaScreen->deviceID); - fprintf(stderr, "width = %08x\n", viaScreen->width); - fprintf(stderr, "height = %08x\n", viaScreen->height); - fprintf(stderr, "cpp = %08x\n", viaScreen->cpp); - fprintf(stderr, "fbOffset = %08x\n", viaScreen->fbOffset); + fprintf(stderr, "width = %08x\n", viaScreen->width); + fprintf(stderr, "height = %08x\n", viaScreen->height); + fprintf(stderr, "cpp = %08x\n", viaScreen->cpp); + fprintf(stderr, "fbOffset = %08x\n", viaScreen->fbOffset); } viaScreen->bufs = via_create_empty_buffers(); @@ -207,7 +207,7 @@ viaCreateBuffer(__DRIscreen *driScrnPriv, viaScreenPrivate *screen = (viaScreenPrivate *) driScrnPriv->private; #endif - GLboolean swStencil = (mesaVis->stencilBits > 0 && + GLboolean swStencil = (mesaVis->stencilBits > 0 && mesaVis->depthBits != 24); GLboolean swAccum = mesaVis->accumRedBits > 0; @@ -366,7 +366,7 @@ viaFillInModes( __DRIscreen *psp, /** * This is the driver specific part of the createNewScreen entry point. - * + * * \todo maybe fold this into intelInitDriver * * \return the struct gl_config supported by this driver diff --git a/src/mesa/drivers/dri/unichrome/via_screen.h b/src/mesa/drivers/dri/unichrome/via_screen.h index 292646d..0ce3188 100644 --- a/src/mesa/drivers/dri/unichrome/via_screen.h +++ b/src/mesa/drivers/dri/unichrome/via_screen.h @@ -38,13 +38,13 @@ typedef struct { int height; int mem; - int cpp; + int cpp; int bitsPerPixel; int bytesPerPixel; int fbFormat; int fbOffset; int fbSize; - + int fbStride; int backOffset; @@ -56,7 +56,7 @@ typedef struct { int textureOffset; int textureSize; int logTextureGranularity; - + drmAddress reg; drmAddress agpLinearStart; GLuint agpBase; diff --git a/src/mesa/drivers/dri/unichrome/via_span.c b/src/mesa/drivers/dri/unichrome/via_span.c index 4ca5842..1d3534a 100644 --- a/src/mesa/drivers/dri/unichrome/via_span.c +++ b/src/mesa/drivers/dri/unichrome/via_span.c @@ -36,7 +36,7 @@ #define Y_FLIP(_y) (height - _y - 1) -#define HW_LOCK() +#define HW_LOCK() #define HW_UNLOCK() @@ -85,7 +85,7 @@ GLuint height = dPriv->h; \ char *buf = (char *)(vrb->map) -#define LOCAL_STENCIL_VARS LOCAL_DEPTH_VARS +#define LOCAL_STENCIL_VARS LOCAL_DEPTH_VARS #define VALUE_TYPE GLushort @@ -151,7 +151,7 @@ */ void viaSpanRenderStart( struct gl_context *ctx ) { - struct via_context *vmesa = VIA_CONTEXT(ctx); + struct via_context *vmesa = VIA_CONTEXT(ctx); viaWaitIdle(vmesa, GL_FALSE); LOCK_HARDWARE(vmesa); } @@ -167,7 +167,7 @@ void viaInitSpanFuncs(struct gl_context *ctx) { struct swrast_device_driver *swdd = _swrast_GetDeviceDriverReference(ctx); swdd->SpanRenderStart = viaSpanRenderStart; - swdd->SpanRenderFinish = viaSpanRenderFinish; + swdd->SpanRenderFinish = viaSpanRenderFinish; } diff --git a/src/mesa/drivers/dri/unichrome/via_state.c b/src/mesa/drivers/dri/unichrome/via_state.c index 0333521..3f6e7a5 100644 --- a/src/mesa/drivers/dri/unichrome/via_state.c +++ b/src/mesa/drivers/dri/unichrome/via_state.c @@ -84,27 +84,27 @@ void viaEmitState(struct via_context *vmesa) RING_VARS; viaCheckDma(vmesa, 0x110); - + BEGIN_RING(5); OUT_RING( HC_HEADER2 ); OUT_RING( (HC_ParaType_NotTex << 16) ); OUT_RING( ((HC_SubA_HEnable << 24) | vmesa->regEnable) ); - OUT_RING( ((HC_SubA_HFBBMSKL << 24) | vmesa->regHFBBMSKL) ); - OUT_RING( ((HC_SubA_HROP << 24) | vmesa->regHROP) ); + OUT_RING( ((HC_SubA_HFBBMSKL << 24) | vmesa->regHFBBMSKL) ); + OUT_RING( ((HC_SubA_HROP << 24) | vmesa->regHROP) ); ADVANCE_RING(); - + if (vmesa->have_hw_stencil) { GLuint pitch, format, offset; - - format = HC_HZWBFM_24; + + format = HC_HZWBFM_24; offset = vmesa->depth.offset; pitch = vmesa->depth.pitch; - + BEGIN_RING(6); OUT_RING( (HC_SubA_HZWBBasL << 24) | (offset & 0xFFFFFF) ); - OUT_RING( (HC_SubA_HZWBBasH << 24) | ((offset & 0xFF000000) >> 24) ); + OUT_RING( (HC_SubA_HZWBBasH << 24) | ((offset & 0xFF000000) >> 24) ); OUT_RING( (HC_SubA_HZWBType << 24) | HC_HDBLoc_Local | HC_HZONEasFF_MASK | - format | pitch ); + format | pitch ); OUT_RING( (HC_SubA_HZWTMD << 24) | vmesa->regHZWTMD ); OUT_RING( (HC_SubA_HSTREF << 24) | vmesa->regHSTREF ); OUT_RING( (HC_SubA_HSTMD << 24) | vmesa->regHSTMD ); @@ -112,18 +112,18 @@ void viaEmitState(struct via_context *vmesa) } else if (vmesa->hasDepth) { GLuint pitch, format, offset; - + if (vmesa->depthBits == 16) { format = HC_HZWBFM_16; - } + } else { format = HC_HZWBFM_32; } - - + + offset = vmesa->depth.offset; pitch = vmesa->depth.pitch; - + BEGIN_RING(4); OUT_RING( (HC_SubA_HZWBBasL << 24) | (offset & 0xFFFFFF) ); OUT_RING( (HC_SubA_HZWBBasH << 24) | ((offset & 0xFF000000) >> 24) ); @@ -132,54 +132,54 @@ void viaEmitState(struct via_context *vmesa) OUT_RING( (HC_SubA_HZWTMD << 24) | vmesa->regHZWTMD ); ADVANCE_RING(); } - + if (ctx->Color.AlphaEnabled) { BEGIN_RING(1); OUT_RING( (HC_SubA_HATMD << 24) | vmesa->regHATMD ); ADVANCE_RING(); i++; - } + } if (ctx->Color.BlendEnabled) { BEGIN_RING(11); OUT_RING( (HC_SubA_HABLCsat << 24) | vmesa->regHABLCsat ); - OUT_RING( (HC_SubA_HABLCop << 24) | vmesa->regHABLCop ); - OUT_RING( (HC_SubA_HABLAsat << 24) | vmesa->regHABLAsat ); - OUT_RING( (HC_SubA_HABLAop << 24) | vmesa->regHABLAop ); - OUT_RING( (HC_SubA_HABLRCa << 24) | vmesa->regHABLRCa ); - OUT_RING( (HC_SubA_HABLRFCa << 24) | vmesa->regHABLRFCa ); - OUT_RING( (HC_SubA_HABLRCbias << 24) | vmesa->regHABLRCbias ); - OUT_RING( (HC_SubA_HABLRCb << 24) | vmesa->regHABLRCb ); - OUT_RING( (HC_SubA_HABLRFCb << 24) | vmesa->regHABLRFCb ); - OUT_RING( (HC_SubA_HABLRAa << 24) | vmesa->regHABLRAa ); - OUT_RING( (HC_SubA_HABLRAb << 24) | vmesa->regHABLRAb ); + OUT_RING( (HC_SubA_HABLCop << 24) | vmesa->regHABLCop ); + OUT_RING( (HC_SubA_HABLAsat << 24) | vmesa->regHABLAsat ); + OUT_RING( (HC_SubA_HABLAop << 24) | vmesa->regHABLAop ); + OUT_RING( (HC_SubA_HABLRCa << 24) | vmesa->regHABLRCa ); + OUT_RING( (HC_SubA_HABLRFCa << 24) | vmesa->regHABLRFCa ); + OUT_RING( (HC_SubA_HABLRCbias << 24) | vmesa->regHABLRCbias ); + OUT_RING( (HC_SubA_HABLRCb << 24) | vmesa->regHABLRCb ); + OUT_RING( (HC_SubA_HABLRFCb << 24) | vmesa->regHABLRFCb ); + OUT_RING( (HC_SubA_HABLRAa << 24) | vmesa->regHABLRAa ); + OUT_RING( (HC_SubA_HABLRAb << 24) | vmesa->regHABLRAb ); ADVANCE_RING(); } - + if (ctx->Fog.Enabled) { BEGIN_RING(3); - OUT_RING( (HC_SubA_HFogLF << 24) | vmesa->regHFogLF ); - OUT_RING( (HC_SubA_HFogCL << 24) | vmesa->regHFogCL ); - OUT_RING( (HC_SubA_HFogCH << 24) | vmesa->regHFogCH ); + OUT_RING( (HC_SubA_HFogLF << 24) | vmesa->regHFogLF ); + OUT_RING( (HC_SubA_HFogCL << 24) | vmesa->regHFogCL ); + OUT_RING( (HC_SubA_HFogCH << 24) | vmesa->regHFogCH ); ADVANCE_RING(); } - + if (ctx->Line.StippleFlag) { BEGIN_RING(2); - OUT_RING( (HC_SubA_HLP << 24) | ctx->Line.StipplePattern ); + OUT_RING( (HC_SubA_HLP << 24) | ctx->Line.StipplePattern ); OUT_RING( (HC_SubA_HLPRF << 24) | ctx->Line.StippleFactor ); ADVANCE_RING(); } BEGIN_RING(1); - OUT_RING( (HC_SubA_HPixGC << 24) | 0x0 ); + OUT_RING( (HC_SubA_HPixGC << 24) | 0x0 ); ADVANCE_RING(); - + QWORD_PAD_RING(); if (ctx->Texture._EnabledUnits) { - + struct gl_texture_unit *texUnit0 = &ctx->Texture.Unit[0]; struct gl_texture_unit *texUnit1 = &ctx->Texture.Unit[1]; @@ -191,7 +191,7 @@ void viaEmitState(struct via_context *vmesa) OUT_RING( (HC_ParaType_Tex << 16) | (HC_SubType_TexGeneral << 24) ); if (texUnit0->Enabled && texUnit1->Enabled) { - nDummyValue = (HC_SubA_HTXSMD << 24) | (1 << 3); + nDummyValue = (HC_SubA_HTXSMD << 24) | (1 << 3); } else { nDummyValue = (HC_SubA_HTXSMD << 24) | 0; @@ -220,7 +220,7 @@ void viaEmitState(struct via_context *vmesa) GLuint numLevels = t->lastLevel - t->firstLevel + 1; if (VIA_DEBUG & DEBUG_STATE) { fprintf(stderr, "texture0 enabled\n"); - } + } if (numLevels == 8) { BEGIN_RING(27); OUT_RING( HC_HEADER2 ); @@ -263,14 +263,14 @@ void viaEmitState(struct via_context *vmesa) ((t->lastLevel) << HC_HTXnLVmax_SHIFT) | t->firstLevel ); OUT_RING( t->regTexWidthLog2[0] ); OUT_RING( t->regTexHeightLog2[0] ); - + if (numLevels > 6) { OUT_RING( t->regTexWidthLog2[1] ); OUT_RING( t->regTexHeightLog2[1] ); } - + OUT_RING( t->regTexBaseH[0] ); - + if (numLevels > 3) { OUT_RING( t->regTexBaseH[1] ); } @@ -331,15 +331,15 @@ void viaEmitState(struct via_context *vmesa) BEGIN_RING(2 + table->Size); OUT_RING( HC_HEADER2 ); OUT_RING( (HC_ParaType_Palette << 16) | (0 << 24) ); - for (j = 0; j < table->Size; j++) + for (j = 0; j < table->Size; j++) OUT_RING( tableF[j] ); ADVANCE_RING(); - + } QWORD_PAD_RING(); } - + if (texUnit1->Enabled) { struct gl_texture_object *texObj = texUnit1->_Current; struct via_texture_object *t = (struct via_texture_object *)texObj; @@ -347,7 +347,7 @@ void viaEmitState(struct via_context *vmesa) int texunit = (texUnit0->Enabled ? 1 : 0); if (VIA_DEBUG & DEBUG_STATE) { fprintf(stderr, "texture1 enabled\n"); - } + } if (numLevels == 8) { BEGIN_RING(27); OUT_RING( HC_HEADER2 ); @@ -389,16 +389,16 @@ void viaEmitState(struct via_context *vmesa) ((t->lastLevel) << HC_HTXnLVmax_SHIFT) | t->firstLevel ); OUT_RING( t->regTexWidthLog2[0] ); OUT_RING( t->regTexHeightLog2[0] ); - + if (numLevels > 6) { OUT_RING( t->regTexWidthLog2[1] ); OUT_RING( t->regTexHeightLog2[1] ); i += 2; } - + OUT_RING( t->regTexBaseH[0] ); - - if (numLevels > 3) { + + if (numLevels > 3) { OUT_RING( t->regTexBaseH[1] ); } if (numLevels > 6) { @@ -407,7 +407,7 @@ void viaEmitState(struct via_context *vmesa) if (numLevels > 9) { OUT_RING( t->regTexBaseH[3] ); } - + for (j = 0; j < numLevels; j++) { OUT_RING( t->regTexBaseAndPitch[j].baseL ); OUT_RING( t->regTexBaseAndPitch[j].pitchLog2 ); @@ -465,7 +465,7 @@ void viaEmitState(struct via_context *vmesa) QWORD_PAD_RING(); } } - + #if 0 /* Polygon stipple is broken - for certain stipple values, * eg. 0xf0f0f0f0, the hardware will refuse to accept the stipple. @@ -474,12 +474,12 @@ void viaEmitState(struct via_context *vmesa) if (ctx->Polygon.StippleFlag) { GLuint *stipple = &ctx->PolygonStipple[0]; __DRIdrawable *dPriv = vmesa->driDrawable; - struct via_renderbuffer *const vrb = + struct via_renderbuffer *const vrb = (struct via_renderbuffer *) dPriv->driverPrivate; GLint i; - + BEGIN_RING(38); - OUT_RING( HC_HEADER2 ); + OUT_RING( HC_HEADER2 ); OUT_RING( ((HC_ParaType_Palette << 16) | (HC_SubType_Stipple << 24)) ); for (i = 31; i >= 0; i--) { @@ -492,10 +492,10 @@ void viaEmitState(struct via_context *vmesa) if (stipple[i] & (1<newEmitState = 0; } @@ -516,7 +516,7 @@ static INLINE GLuint viaPackColor(GLuint bpp, case 16: return PACK_COLOR_565(r, g, b); case 32: - return PACK_COLOR_8888(a, r, g, b); + return PACK_COLOR_8888(a, r, g, b); default: assert(0); return 0; @@ -524,17 +524,17 @@ static INLINE GLuint viaPackColor(GLuint bpp, } static void viaBlendEquationSeparate(struct gl_context *ctx, - GLenum rgbMode, + GLenum rgbMode, GLenum aMode) { - if (VIA_DEBUG & DEBUG_STATE) + if (VIA_DEBUG & DEBUG_STATE) fprintf(stderr, "%s in\n", __FUNCTION__); /* GL_EXT_blend_equation_separate not supported */ ASSERT(rgbMode == aMode); /* Can only do GL_ADD equation in hardware */ - FALLBACK(VIA_CONTEXT(ctx), VIA_FALLBACK_BLEND_EQ, + FALLBACK(VIA_CONTEXT(ctx), VIA_FALLBACK_BLEND_EQ, rgbMode != GL_FUNC_ADD_EXT); /* BlendEquation sets ColorLogicOpEnabled in an unexpected @@ -549,11 +549,11 @@ static void viaBlendFunc(struct gl_context *ctx, GLenum sfactor, GLenum dfactor) { struct via_context *vmesa = VIA_CONTEXT(ctx); GLboolean fallback = GL_FALSE; - if (VIA_DEBUG & DEBUG_STATE) + if (VIA_DEBUG & DEBUG_STATE) fprintf(stderr, "%s in\n", __FUNCTION__); switch (ctx->Color.BlendSrcRGB) { - case GL_SRC_ALPHA_SATURATE: + case GL_SRC_ALPHA_SATURATE: case GL_CONSTANT_COLOR: case GL_ONE_MINUS_CONSTANT_COLOR: case GL_CONSTANT_ALPHA: @@ -606,7 +606,7 @@ static void viaScissor(struct gl_context *ctx, GLint x, GLint y, return; if (VIA_DEBUG & DEBUG_STATE) - fprintf(stderr, "%s %d,%d %dx%d, drawH %d\n", __FUNCTION__, + fprintf(stderr, "%s %d,%d %dx%d, drawH %d\n", __FUNCTION__, x,y,w,h, vmesa->driDrawable->h); if (vmesa->scissor) { @@ -647,7 +647,7 @@ static void viaDrawBuffer(struct gl_context *ctx, GLenum mode) { struct via_context *vmesa = VIA_CONTEXT(ctx); - if (VIA_DEBUG & (DEBUG_DRI|DEBUG_STATE)) + if (VIA_DEBUG & (DEBUG_DRI|DEBUG_STATE)) fprintf(stderr, "%s in\n", __FUNCTION__); if (!ctx->DrawBuffer) @@ -720,11 +720,11 @@ void viaCalcViewport(struct gl_context *ctx) { struct via_context *vmesa = VIA_CONTEXT(ctx); __DRIdrawable *dPriv = vmesa->driDrawable; - struct via_renderbuffer *const vrb = + struct via_renderbuffer *const vrb = (struct via_renderbuffer *) dPriv->driverPrivate; const GLfloat *v = ctx->Viewport._WindowMap.m; GLfloat *m = vmesa->ViewportMatrix.m; - + m[MAT_SX] = v[MAT_SX]; m[MAT_TX] = v[MAT_TX] + vrb->drawX + SUBPIXEL_X; m[MAT_SY] = - v[MAT_SY]; @@ -756,7 +756,7 @@ void viaInitState(struct gl_context *ctx) /* Mesa should do this for us: */ - ctx->Driver.BlendEquationSeparate( ctx, + ctx->Driver.BlendEquationSeparate( ctx, ctx->Color.BlendEquationRGB, ctx->Color.BlendEquationA); @@ -806,7 +806,7 @@ get_wrap_mode( GLenum sWrap, GLenum tWrap ) v |= HC_HTXnMPMD_Tmirror; break; } - + return v; } @@ -865,7 +865,7 @@ get_minmag_filter( GLenum min, GLenum mag ) } -static GLboolean viaChooseTextureState(struct gl_context *ctx) +static GLboolean viaChooseTextureState(struct gl_context *ctx) { struct via_context *vmesa = VIA_CONTEXT(ctx); struct gl_texture_unit *texUnit0 = &ctx->Texture.Unit[0]; @@ -876,7 +876,7 @@ static GLboolean viaChooseTextureState(struct gl_context *ctx) if (texUnit0->_ReallyEnabled) { struct gl_texture_object *texObj = texUnit0->_Current; - + vmesa->regHTXnTB[0] = get_minmag_filter( texObj->MinFilter, texObj->MagFilter ); @@ -887,7 +887,7 @@ static GLboolean viaChooseTextureState(struct gl_context *ctx) vmesa->regHTXnTB[0] &= ~(HC_HTXnTB_TBC_S | HC_HTXnTB_TBC_T); if (texObj->Image[0][texObj->BaseLevel]->Border > 0) { vmesa->regHTXnTB[0] |= (HC_HTXnTB_TBC_S | HC_HTXnTB_TBC_T); - vmesa->regHTXnTBC[0] = + vmesa->regHTXnTBC[0] = PACK_COLOR_888(FLOAT_TO_UBYTE(texObj->BorderColor.f[0]), FLOAT_TO_UBYTE(texObj->BorderColor.f[1]), FLOAT_TO_UBYTE(texObj->BorderColor.f[2])); @@ -920,7 +920,7 @@ static GLboolean viaChooseTextureState(struct gl_context *ctx) vmesa->regHTXnTB[1] &= ~(HC_HTXnTB_TBC_S | HC_HTXnTB_TBC_T); if (texObj->Image[0][texObj->BaseLevel]->Border > 0) { vmesa->regHTXnTB[1] |= (HC_HTXnTB_TBC_S | HC_HTXnTB_TBC_T); - vmesa->regHTXnTBC[1] = + vmesa->regHTXnTBC[1] = PACK_COLOR_888(FLOAT_TO_UBYTE(texObj->BorderColor.f[0]), FLOAT_TO_UBYTE(texObj->BorderColor.f[1]), FLOAT_TO_UBYTE(texObj->BorderColor.f[2])); @@ -943,14 +943,14 @@ static GLboolean viaChooseTextureState(struct gl_context *ctx) } } else { - vmesa->regEnable &= ~(HC_HenTXMP_MASK | HC_HenTXCH_MASK | + vmesa->regEnable &= ~(HC_HenTXMP_MASK | HC_HenTXCH_MASK | HC_HenTXPP_MASK); } - + return GL_TRUE; } -static void viaChooseColorState(struct gl_context *ctx) +static void viaChooseColorState(struct gl_context *ctx) { struct via_context *vmesa = VIA_CONTEXT(ctx); GLenum s = ctx->Color.BlendSrcRGB; @@ -1029,9 +1029,9 @@ static void viaChooseColorState(struct gl_context *ctx) if (vmesa->viaScreen->bitsPerPixel == 16) { /* (1, 1, 1, 1) */ - vmesa->regHABLCsat |= (HC_HABLFCa_InvOPC | + vmesa->regHABLCsat |= (HC_HABLFCa_InvOPC | HC_HABLFCa_HABLRCa); - vmesa->regHABLAsat |= (HC_HABLFAa_InvOPA | + vmesa->regHABLAsat |= (HC_HABLFAa_InvOPA | HC_HABLFAa_HABLFRA); vmesa->regHABLRFCa = 0x0; vmesa->regHABLRAa = 0x0; @@ -1069,7 +1069,7 @@ static void viaChooseColorState(struct gl_context *ctx) * So (f, f, f, 1) = (0, 0, 0, 1) */ vmesa->regHABLCsat |= HC_HABLFCa_OPC | HC_HABLFCa_HABLRCa; - vmesa->regHABLAsat |= (HC_HABLFAa_InvOPA | + vmesa->regHABLAsat |= (HC_HABLFAa_InvOPA | HC_HABLFAa_HABLFRA); vmesa->regHABLRFCa = 0x0; vmesa->regHABLRAa = 0x0; @@ -1077,9 +1077,9 @@ static void viaChooseColorState(struct gl_context *ctx) else { /* (f, f, f, 1), f = min(As, 1 - Ad) */ - vmesa->regHABLCsat |= (HC_HABLFCa_OPC | + vmesa->regHABLCsat |= (HC_HABLFCa_OPC | HC_HABLFCa_mimAsrcInvAdst); - vmesa->regHABLAsat |= (HC_HABLFAa_InvOPA | + vmesa->regHABLAsat |= (HC_HABLFAa_InvOPA | HC_HABLFAa_HABLFRA); vmesa->regHABLRFCa = 0x0; vmesa->regHABLRAa = 0x0; @@ -1230,7 +1230,7 @@ static void viaChooseColorState(struct gl_context *ctx) vmesa->regEnable &= ~HC_HenDT_MASK; - if (ctx->Color.ColorLogicOpEnabled) + if (ctx->Color.ColorLogicOpEnabled) vmesa->regHROP = ROP[ctx->Color.LogicOp & 0xF]; else vmesa->regHROP = HC_HROP_P; @@ -1246,7 +1246,7 @@ static void viaChooseColorState(struct gl_context *ctx) vmesa->regEnable &= ~HC_HenAW_MASK; } -static void viaChooseFogState(struct gl_context *ctx) +static void viaChooseFogState(struct gl_context *ctx) { struct via_context *vmesa = VIA_CONTEXT(ctx); @@ -1271,7 +1271,7 @@ static void viaChooseFogState(struct gl_context *ctx) } } -static void viaChooseDepthState(struct gl_context *ctx) +static void viaChooseDepthState(struct gl_context *ctx) { struct via_context *vmesa = VIA_CONTEXT(ctx); if (ctx->Depth.Test) { @@ -1281,11 +1281,11 @@ static void viaChooseDepthState(struct gl_context *ctx) else vmesa->regEnable &= (~HC_HenZW_MASK); vmesa->regHZWTMD = (ctx->Depth.Func - GL_NEVER) << 16; - + } else { vmesa->regEnable &= ~HC_HenZT_MASK; - + /*=* [DBG] racer : can't display cars in car selection menu *=*/ /*if (ctx->Depth.Mask) vmesa->regEnable |= HC_HenZW_MASK; @@ -1295,7 +1295,7 @@ static void viaChooseDepthState(struct gl_context *ctx) } } -static void viaChooseLineState(struct gl_context *ctx) +static void viaChooseLineState(struct gl_context *ctx) { struct via_context *vmesa = VIA_CONTEXT(ctx); @@ -1309,7 +1309,7 @@ static void viaChooseLineState(struct gl_context *ctx) } } -static void viaChoosePolygonState(struct gl_context *ctx) +static void viaChoosePolygonState(struct gl_context *ctx) { struct via_context *vmesa = VIA_CONTEXT(ctx); @@ -1323,7 +1323,7 @@ static void viaChoosePolygonState(struct gl_context *ctx) vmesa->regEnable &= ~HC_HenSP_MASK; } #else - FALLBACK(vmesa, VIA_FALLBACK_POLY_STIPPLE, + FALLBACK(vmesa, VIA_FALLBACK_POLY_STIPPLE, ctx->Polygon.StippleFlag); #endif @@ -1335,10 +1335,10 @@ static void viaChoosePolygonState(struct gl_context *ctx) } } -static void viaChooseStencilState(struct gl_context *ctx) +static void viaChooseStencilState(struct gl_context *ctx) { struct via_context *vmesa = VIA_CONTEXT(ctx); - + if (ctx->Stencil._Enabled) { GLuint temp; @@ -1421,8 +1421,8 @@ static void viaChooseStencilState(struct gl_context *ctx) -static void viaChooseTriangle(struct gl_context *ctx) -{ +static void viaChooseTriangle(struct gl_context *ctx) +{ struct via_context *vmesa = VIA_CONTEXT(ctx); if (ctx->Polygon.CullFlag == GL_TRUE) { @@ -1475,7 +1475,7 @@ void viaValidateState( struct gl_context *ctx ) if ((vmesa->newState & _NEW_STENCIL) && vmesa->have_hw_stencil) viaChooseStencilState(ctx); - + if (ctx->_TriangleCaps & DD_SEPARATE_SPECULAR) vmesa->regEnable |= HC_HenCS_MASK; else @@ -1485,7 +1485,7 @@ void viaValidateState( struct gl_context *ctx ) ctx->Line.SmoothFlag || ctx->Polygon.SmoothFlag) vmesa->regEnable |= HC_HenAA_MASK; - else + else vmesa->regEnable &= ~HC_HenAA_MASK; vmesa->newEmitState |= vmesa->newState; diff --git a/src/mesa/drivers/dri/unichrome/via_tex.c b/src/mesa/drivers/dri/unichrome/via_tex.c index 18fb8f3..9017e15 100644 --- a/src/mesa/drivers/dri/unichrome/via_tex.c +++ b/src/mesa/drivers/dri/unichrome/via_tex.c @@ -176,17 +176,17 @@ viaChooseTexFormat( struct gl_context *ctx, GLint internalFormat, case GL_COMPRESSED_RGBA_S3TC_DXT5_EXT: return MESA_FORMAT_RGBA_DXT5; - case GL_COLOR_INDEX: - case GL_COLOR_INDEX1_EXT: - case GL_COLOR_INDEX2_EXT: - case GL_COLOR_INDEX4_EXT: - case GL_COLOR_INDEX8_EXT: - case GL_COLOR_INDEX12_EXT: + case GL_COLOR_INDEX: + case GL_COLOR_INDEX1_EXT: + case GL_COLOR_INDEX2_EXT: + case GL_COLOR_INDEX4_EXT: + case GL_COLOR_INDEX8_EXT: + case GL_COLOR_INDEX12_EXT: case GL_COLOR_INDEX16_EXT: return MESA_FORMAT_CI8; default: - fprintf(stderr, "unexpected texture format %s in %s\n", + fprintf(stderr, "unexpected texture format %s in %s\n", _mesa_lookup_enum_by_nr(internalFormat), __FUNCTION__); return MESA_FORMAT_NONE; @@ -238,9 +238,9 @@ static GLboolean viaMoveTexBuffers( struct via_context *vmesa, memset(newTexBuf, 0, sizeof(newTexBuf)); /* First do all the allocations (or fail): - */ - for (i = 0; i < nr; i++) { - if (buffers[i]->memType != newMemType) { + */ + for (i = 0; i < nr; i++) { + if (buffers[i]->memType != newMemType) { /* Don't allow uploads in a thrash state. Should try and * catch this earlier. @@ -248,10 +248,10 @@ static GLboolean viaMoveTexBuffers( struct via_context *vmesa, if (vmesa->thrashing && newMemType != VIA_MEM_SYSTEM) goto cleanup; - newTexBuf[i] = via_alloc_texture(vmesa, + newTexBuf[i] = via_alloc_texture(vmesa, buffers[i]->size, newMemType); - if (!newTexBuf[i]) + if (!newTexBuf[i]) goto cleanup; } } @@ -259,10 +259,10 @@ static GLboolean viaMoveTexBuffers( struct via_context *vmesa, /* Now copy all the image data and free the old texture memory. */ - for (i = 0; i < nr; i++) { + for (i = 0; i < nr; i++) { if (newTexBuf[i]) { memcpy(newTexBuf[i]->bufAddr, - buffers[i]->bufAddr, + buffers[i]->bufAddr, buffers[i]->size); newTexBuf[i]->image = buffers[i]->image; @@ -283,21 +283,21 @@ static GLboolean viaMoveTexBuffers( struct via_context *vmesa, if (VIA_DEBUG & DEBUG_TEXTURE) fprintf(stderr, "%s - failed\n", __FUNCTION__); - for (i = 0; i < nr; i++) { + for (i = 0; i < nr; i++) { if (newTexBuf[i]) { via_free_texture(vmesa, newTexBuf[i]); } } - - return GL_FALSE; + + return GL_FALSE; } static GLboolean viaMoveTexObject( struct via_context *vmesa, struct via_texture_object *viaObj, GLint newMemType ) -{ - struct via_texture_image **viaImage = +{ + struct via_texture_image **viaImage = (struct via_texture_image **)&viaObj->obj.Image[0][0]; struct via_tex_buffer *buffers[VIA_MAX_TEXLEVELS]; GLuint i, nr = 0; @@ -318,13 +318,13 @@ static GLboolean viaMoveTexObject( struct via_context *vmesa, static GLboolean viaSwapInTexObject( struct via_context *vmesa, struct via_texture_object *viaObj ) { - const struct via_texture_image *baseImage = - (struct via_texture_image *)viaObj->obj.Image[0][viaObj->obj.BaseLevel]; + const struct via_texture_image *baseImage = + (struct via_texture_image *)viaObj->obj.Image[0][viaObj->obj.BaseLevel]; if (VIA_DEBUG & DEBUG_TEXTURE) fprintf(stderr, "%s\n", __FUNCTION__); - if (baseImage->texMem->memType != VIA_MEM_SYSTEM) + if (baseImage->texMem->memType != VIA_MEM_SYSTEM) return viaMoveTexObject( vmesa, viaObj, baseImage->texMem->memType ); return (viaMoveTexObject( vmesa, viaObj, VIA_MEM_AGP ) || @@ -341,17 +341,17 @@ static GLboolean viaIsTexMemLow( struct via_context *vmesa, struct via_tex_buffer *buf = via_alloc_texture(vmesa, 512 * 1024, heap ); if (!buf) return GL_TRUE; - + via_free_texture(vmesa, buf); return GL_FALSE; } /* Speculatively move texture images which haven't been used in a - * while back to system memory. - * + * while back to system memory. + * * TODO: only do this when texture memory is low. - * + * * TODO: use dma. * * TODO: keep the fb/agp version hanging around and use the local @@ -371,7 +371,7 @@ GLboolean viaSwapOutWork( struct via_context *vmesa ) vmesa->total_alloc[VIA_MEM_AGP], vmesa->total_alloc[VIA_MEM_SYSTEM]); - + for (heap = VIA_MEM_VIDEO; heap <= VIA_MEM_AGP; heap++) { GLuint nr = 0, sz = 0; @@ -393,12 +393,12 @@ GLboolean viaSwapOutWork( struct via_context *vmesa ) foreach_s( s, tmp, &vmesa->tex_image_list[heap] ) { if (s->lastUsed < vmesa->lastSwap[1]) { - struct via_texture_object *viaObj = + struct via_texture_object *viaObj = (struct via_texture_object *) s->image->image.TexObject; if (VIA_DEBUG & DEBUG_TEXTURE) - fprintf(stderr, - "back copy tex sz %d, lastUsed %d lastSwap %d\n", + fprintf(stderr, + "back copy tex sz %d, lastUsed %d lastSwap %d\n", s->size, s->lastUsed, vmesa->lastSwap[1]); if (viaMoveTexBuffers( vmesa, &s, 1, VIA_MEM_SYSTEM )) { @@ -423,12 +423,12 @@ GLboolean viaSwapOutWork( struct via_context *vmesa ) } assert(sz == vmesa->total_alloc[heap]); - + if (VIA_DEBUG & DEBUG_TEXTURE) fprintf(stderr, "Heap %d: nr %d tot sz %d\n", heap, nr, sz); } - + return done != 0; } @@ -442,7 +442,7 @@ static GLboolean viaSetTexImages(struct gl_context *ctx, { struct via_context *vmesa = VIA_CONTEXT(ctx); struct via_texture_object *viaObj = (struct via_texture_object *)texObj; - const struct via_texture_image *baseImage = + const struct via_texture_image *baseImage = (struct via_texture_image *)texObj->Image[0][texObj->BaseLevel]; GLint firstLevel, lastLevel, numLevels; GLuint texFormat; @@ -451,38 +451,38 @@ static GLboolean viaSetTexImages(struct gl_context *ctx, GLuint texBase; GLuint basH = 0; GLuint widthExp = 0; - GLuint heightExp = 0; + GLuint heightExp = 0; switch (baseImage->image.TexFormat) { case MESA_FORMAT_ARGB8888: texFormat = HC_HTXnFM_ARGB8888; break; case MESA_FORMAT_ARGB4444: - texFormat = HC_HTXnFM_ARGB4444; + texFormat = HC_HTXnFM_ARGB4444; break; case MESA_FORMAT_RGB565: - texFormat = HC_HTXnFM_RGB565; + texFormat = HC_HTXnFM_RGB565; break; case MESA_FORMAT_ARGB1555: - texFormat = HC_HTXnFM_ARGB1555; + texFormat = HC_HTXnFM_ARGB1555; break; case MESA_FORMAT_RGB888: texFormat = HC_HTXnFM_ARGB0888; break; case MESA_FORMAT_L8: - texFormat = HC_HTXnFM_L8; + texFormat = HC_HTXnFM_L8; break; case MESA_FORMAT_I8: - texFormat = HC_HTXnFM_T8; + texFormat = HC_HTXnFM_T8; break; case MESA_FORMAT_CI8: - texFormat = HC_HTXnFM_Index8; + texFormat = HC_HTXnFM_Index8; break; case MESA_FORMAT_AL88: - texFormat = HC_HTXnFM_AL88; + texFormat = HC_HTXnFM_AL88; break; case MESA_FORMAT_A8: - texFormat = HC_HTXnFM_A8; + texFormat = HC_HTXnFM_A8; break; default: _mesa_problem(vmesa->glCtx, "Bad texture format in viaSetTexImages"); @@ -531,13 +531,13 @@ static GLboolean viaSetTexImages(struct gl_context *ctx, __FUNCTION__, get_memtype_name(viaObj->memType)); - + if (viaObj->memType == VIA_MEM_MIXED || viaObj->memType == VIA_MEM_SYSTEM) { if (!viaSwapInTexObject(vmesa, viaObj)) { - if (VIA_DEBUG & DEBUG_TEXTURE) + if (VIA_DEBUG & DEBUG_TEXTURE) if (!vmesa->thrashing) - fprintf(stderr, "Thrashing flag set for frame %d\n", + fprintf(stderr, "Thrashing flag set for frame %d\n", vmesa->swap_count); vmesa->thrashing = GL_TRUE; return GL_FALSE; @@ -550,8 +550,8 @@ static GLboolean viaSetTexImages(struct gl_context *ctx, viaObj->regTexFM = (HC_SubA_HTXnFM << 24) | HC_HTXnLoc_Local | texFormat; - for (i = 0; i < numLevels; i++) { - struct via_texture_image *viaImage = + for (i = 0; i < numLevels; i++) { + struct via_texture_image *viaImage = (struct via_texture_image *)texObj->Image[0][firstLevel + i]; w = viaImage->image.WidthLog2; @@ -563,7 +563,7 @@ static GLboolean viaSetTexImages(struct gl_context *ctx, texBase = viaImage->texMem->texBase; if (!texBase) { if (VIA_DEBUG & DEBUG_TEXTURE) - fprintf(stderr, "%s: no texBase[%d]\n", __FUNCTION__, i); + fprintf(stderr, "%s: no texBase[%d]\n", __FUNCTION__, i); return GL_FALSE; } @@ -574,13 +574,13 @@ static GLboolean viaSetTexImages(struct gl_context *ctx, viaImage->texMem->lastUsed = vmesa->lastBreadcrumbWrite; - viaObj->regTexBaseAndPitch[i].baseL = + viaObj->regTexBaseAndPitch[i].baseL = ((HC_SubA_HTXnL0BasL + i) << 24) | (texBase & 0xFFFFFF); - viaObj->regTexBaseAndPitch[i].pitchLog2 = + viaObj->regTexBaseAndPitch[i].pitchLog2 = ((HC_SubA_HTXnL0Pit + i) << 24) | (p << 20); - - + + /* The base high bytes for each 3 levels are packed * together into one register: */ @@ -591,7 +591,7 @@ static GLboolean viaSetTexImages(struct gl_context *ctx, viaObj->regTexBaseH[j] = ((j + HC_SubA_HTXnL012BasH) << 24) | basH; basH = 0; } - + /* Likewise, sets of 6 log2width and log2height values are * packed into individual registers: */ @@ -600,20 +600,20 @@ static GLboolean viaSetTexImages(struct gl_context *ctx, widthExp |= (((GLuint)w & 0xF) << (m << 2)); heightExp |= (((GLuint)h & 0xF) << (m << 2)); if (m == 5) { - viaObj->regTexWidthLog2[l] = + viaObj->regTexWidthLog2[l] = (l + HC_SubA_HTXnL0_5WE) << 24 | widthExp; - viaObj->regTexHeightLog2[l] = + viaObj->regTexHeightLog2[l] = (l + HC_SubA_HTXnL0_5HE) << 24 | heightExp; widthExp = 0; heightExp = 0; } if (w) w--; if (h) h--; - if (p) p--; + if (p) p--; } - + if (k != 1) { - viaObj->regTexBaseH[j] = ((j + HC_SubA_HTXnL012BasH) << 24) | basH; + viaObj->regTexBaseH[j] = ((j + HC_SubA_HTXnL012BasH) << 24) | basH; } if (m != 5) { viaObj->regTexWidthLog2[l] = (l + HC_SubA_HTXnL0_5WE) << 24 | widthExp; @@ -629,18 +629,18 @@ GLboolean viaUpdateTextureState( struct gl_context *ctx ) struct gl_texture_unit *texUnit = ctx->Texture.Unit; GLuint i; - for (i = 0; i < 2; i++) { - if (texUnit[i]._ReallyEnabled == TEXTURE_2D_BIT || + for (i = 0; i < 2; i++) { + if (texUnit[i]._ReallyEnabled == TEXTURE_2D_BIT || texUnit[i]._ReallyEnabled == TEXTURE_1D_BIT) { - if (!viaSetTexImages(ctx, texUnit[i]._Current)) + if (!viaSetTexImages(ctx, texUnit[i]._Current)) return GL_FALSE; } else if (texUnit[i]._ReallyEnabled) { return GL_FALSE; - } + } } - + return GL_TRUE; } @@ -648,10 +648,10 @@ GLboolean viaUpdateTextureState( struct gl_context *ctx ) - -static void viaTexImage(struct gl_context *ctx, + +static void viaTexImage(struct gl_context *ctx, GLint dims, GLenum target, GLint level, GLint internalFormat, @@ -675,7 +675,7 @@ static void viaTexImage(struct gl_context *ctx, } /* choose the texture format */ - texImage->TexFormat = viaChooseTexFormat(ctx, internalFormat, + texImage->TexFormat = viaChooseTexFormat(ctx, internalFormat, format, type); assert(texImage->TexFormat); @@ -707,8 +707,8 @@ static void viaTexImage(struct gl_context *ctx, * TODO: make room in agp if this fails. * TODO: use fb ram for textures as well. */ - - + + switch (viaObj->memType) { case VIA_MEM_UNKNOWN: heaps[0] = VIA_MEM_AGP; @@ -729,9 +729,9 @@ static void viaTexImage(struct gl_context *ctx, nheaps = 1; break; } - + for (i = 0; i < nheaps && !viaImage->texMem; i++) { - if (VIA_DEBUG & DEBUG_TEXTURE) + if (VIA_DEBUG & DEBUG_TEXTURE) fprintf(stderr, "try %s (obj %s)\n", get_memtype_name(heaps[i]), get_memtype_name(viaObj->memType)); viaImage->texMem = via_alloc_texture(vmesa, sizeInBytes, heaps[i]); @@ -743,7 +743,7 @@ static void viaTexImage(struct gl_context *ctx, } if (VIA_DEBUG & DEBUG_TEXTURE) - fprintf(stderr, "upload %d bytes to %s\n", sizeInBytes, + fprintf(stderr, "upload %d bytes to %s\n", sizeInBytes, get_memtype_name(viaImage->texMem->memType)); viaImage->texMem->image = viaImage; @@ -756,13 +756,13 @@ static void viaTexImage(struct gl_context *ctx, if (VIA_DEBUG & DEBUG_TEXTURE) fprintf(stderr, "%s, obj %s, image : %s\n", - __FUNCTION__, + __FUNCTION__, get_memtype_name(viaObj->memType), get_memtype_name(viaImage->texMem->memType)); vmesa->clearTexCache = 1; - pixels = _mesa_validate_pbo_teximage(ctx, dims, width, height, 1, + pixels = _mesa_validate_pbo_teximage(ctx, dims, width, height, 1, format, type, pixels, packing, "glTexImage"); if (!pixels) { @@ -798,7 +798,7 @@ static void viaTexImage(struct gl_context *ctx, _mesa_unmap_teximage_pbo(ctx, packing); } -static void viaTexImage2D(struct gl_context *ctx, +static void viaTexImage2D(struct gl_context *ctx, GLenum target, GLint level, GLint internalFormat, GLint width, GLint height, GLint border, @@ -807,7 +807,7 @@ static void viaTexImage2D(struct gl_context *ctx, struct gl_texture_object *texObj, struct gl_texture_image *texImage) { - viaTexImage( ctx, 2, target, level, + viaTexImage( ctx, 2, target, level, internalFormat, width, height, border, format, type, pixels, packing, texObj, texImage ); @@ -825,7 +825,7 @@ static void viaTexSubImage2D(struct gl_context *ctx, struct gl_texture_image *texImage) { struct via_context *vmesa = VIA_CONTEXT(ctx); - + viaWaitIdle(vmesa, GL_TRUE); vmesa->clearTexCache = 1; @@ -834,7 +834,7 @@ static void viaTexSubImage2D(struct gl_context *ctx, texImage); } -static void viaTexImage1D(struct gl_context *ctx, +static void viaTexImage1D(struct gl_context *ctx, GLenum target, GLint level, GLint internalFormat, GLint width, GLint border, @@ -843,7 +843,7 @@ static void viaTexImage1D(struct gl_context *ctx, struct gl_texture_object *texObj, struct gl_texture_image *texImage) { - viaTexImage( ctx, 1, target, level, + viaTexImage( ctx, 1, target, level, internalFormat, width, 1, border, format, type, pixels, packing, texObj, texImage ); @@ -862,7 +862,7 @@ static void viaTexSubImage1D(struct gl_context *ctx, { struct via_context *vmesa = VIA_CONTEXT(ctx); - viaWaitIdle(vmesa, GL_TRUE); + viaWaitIdle(vmesa, GL_TRUE); vmesa->clearTexCache = 1; _mesa_store_texsubimage1d(ctx, target, level, xoffset, width, @@ -875,7 +875,7 @@ static void viaTexSubImage1D(struct gl_context *ctx, static GLboolean viaIsTextureResident(struct gl_context *ctx, struct gl_texture_object *texObj) { - struct via_texture_object *viaObj = + struct via_texture_object *viaObj = (struct via_texture_object *)texObj; return (viaObj->memType == VIA_MEM_AGP || @@ -891,8 +891,8 @@ static struct gl_texture_image *viaNewTextureImage( struct gl_context *ctx ) } -static struct gl_texture_object *viaNewTextureObject( struct gl_context *ctx, - GLuint name, +static struct gl_texture_object *viaNewTextureObject( struct gl_context *ctx, + GLuint name, GLenum target ) { struct via_texture_object *obj = CALLOC_STRUCT(via_texture_object); @@ -906,7 +906,7 @@ static struct gl_texture_object *viaNewTextureObject( struct gl_context *ctx, } -static void viaFreeTextureImageData( struct gl_context *ctx, +static void viaFreeTextureImageData( struct gl_context *ctx, struct gl_texture_image *texImage ) { struct via_context *vmesa = VIA_CONTEXT(ctx); @@ -916,7 +916,7 @@ static void viaFreeTextureImageData( struct gl_context *ctx, via_free_texture(vmesa, image->texMem); image->texMem = NULL; } - + texImage->Data = NULL; } diff --git a/src/mesa/drivers/dri/unichrome/via_texcombine.c b/src/mesa/drivers/dri/unichrome/via_texcombine.c index f87ba07..2cd1c83 100644 --- a/src/mesa/drivers/dri/unichrome/via_texcombine.c +++ b/src/mesa/drivers/dri/unichrome/via_texcombine.c @@ -86,7 +86,7 @@ static const unsigned a_shift_table[3] = { * 4x shift levels, which need to be programed for DOT3. Maybe newer * hardware fixes these issues. * - * \bug + * \bug * KW: needs attention to the case where texunit 1 is enabled but * texunit 0 is not. */ @@ -110,7 +110,7 @@ viaTexCombineState( struct via_context *vmesa, unsigned constant_alpha[3]; unsigned bias_alpha = 0; unsigned abc_alpha = 0; - const struct gl_texture_unit * texUnit = + const struct gl_texture_unit * texUnit = &vmesa->glCtx->Texture.Unit[unit]; unsigned env_color[4]; @@ -143,23 +143,23 @@ viaTexCombineState( struct via_context *vmesa, switch( op ) { case 0: /* GL_SRC_COLOR */ - constant_color[i] = ((env_color[0] << 16) | - (env_color[1] << 8) | + constant_color[i] = ((env_color[0] << 16) | + (env_color[1] << 8) | env_color[2]); break; case 1: /* GL_ONE_MINUS_SRC_COLOR */ - constant_color[i] = ~((env_color[0] << 16) | - (env_color[1] << 8) | + constant_color[i] = ~((env_color[0] << 16) | + (env_color[1] << 8) | env_color[2]) & 0x00ffffff; break; case 2: /* GL_SRC_ALPHA */ - constant_color[i] = ((env_color[3] << 16) | - (env_color[3] << 8) | + constant_color[i] = ((env_color[3] << 16) | + (env_color[3] << 8) | env_color[3]); break; case 3: /* GL_ONE_MINUS_SRC_ALPHA */ - constant_color[i] = ~((env_color[3] << 16) | - (env_color[3] << 8) | + constant_color[i] = ~((env_color[3] << 16) | + (env_color[3] << 8) | env_color[3]) & 0x00ffffff; break; } @@ -174,12 +174,12 @@ viaTexCombineState( struct via_context *vmesa, break; } } - - + + /* On the Unichrome, all combine operations take on some form of: * * (xA * (xB op xC) + xBias) << xShift - * + * * 'op' can be selected as add, subtract, min, max, or mask. The min, max * and mask modes are currently unused. With the exception of DOT3, all * standard GL_COMBINE modes can be implemented simply by selecting the @@ -195,14 +195,14 @@ viaTexCombineState( struct via_context *vmesa, case GL_REPLACE: color |= ((CONST_ONE << INPUT_A_SHIFT) | (color_arg[0] << INPUT_B_SHIFT)); - + ordered_constant_color[1] = constant_color[0]; break; - + /* Ca = arg[0], Cb = arg[1], Cc = 0, Cbias = 0 */ case GL_MODULATE: - color |= ((color_arg[0] << INPUT_A_SHIFT) | + color |= ((color_arg[0] << INPUT_A_SHIFT) | (color_arg[1] << INPUT_B_SHIFT)); ordered_constant_color[0] = constant_color[0]; @@ -229,7 +229,7 @@ viaTexCombineState( struct via_context *vmesa, */ case GL_ADD_SIGNED: color |= ((CONST_ONE << INPUT_A_SHIFT) | - (color_arg[0] << INPUT_B_SHIFT) | + (color_arg[0] << INPUT_B_SHIFT) | (color_arg[1] << INPUT_C_SHIFT)); bias |= HC_HTXnTBLCbias_HTXnTBLRC; @@ -314,8 +314,8 @@ viaTexCombineState( struct via_context *vmesa, case GL_PREVIOUS: alpha_arg[i] = (unit == 0) ? HC_XTA_Adif : HC_XTA_Acur; alpha_arg[i] += alpha_operand_modifier[op]; - bias_alpha_arg[i] = (unit == 0 ? - HC_HTXnTBLAbias_Adif : + bias_alpha_arg[i] = (unit == 0 ? + HC_HTXnTBLAbias_Adif : HC_HTXnTBLAbias_Acur); bias_alpha_arg[i] += bias_alpha_operand_modifier[op]; break; @@ -334,12 +334,12 @@ viaTexCombineState( struct via_context *vmesa, bias |= bias_alpha_arg[0]; bias_alpha = constant_alpha[0] >> 1; break; - + /* Aa = arg[0], Ab = arg[1], Ac = 0, Abias = 0 */ case GL_MODULATE: - alpha |= ((alpha_arg[1] << INPUT_A_SHIFT) | - (alpha_arg[0] << INPUT_B_SHIFT) | + alpha |= ((alpha_arg[1] << INPUT_A_SHIFT) | + (alpha_arg[0] << INPUT_B_SHIFT) | (HC_XTA_HTXnTBLRA << INPUT_C_SHIFT)); abc_alpha = ((constant_alpha[1] << HC_HTXnTBLRAa_SHIFT) | @@ -374,7 +374,7 @@ viaTexCombineState( struct via_context *vmesa, */ case GL_ADD_SIGNED: alpha |= ((HC_XTA_HTXnTBLRA << INPUT_A_SHIFT) | - (alpha_arg[0] << INPUT_B_SHIFT) | + (alpha_arg[0] << INPUT_B_SHIFT) | (alpha_arg[1] << INPUT_C_SHIFT)); abc_alpha = ((0xff << HC_HTXnTBLRAa_SHIFT) | (constant_alpha[0] << HC_HTXnTBLRAb_SHIFT) | @@ -400,7 +400,7 @@ viaTexCombineState( struct via_context *vmesa, bias_alpha = constant_alpha[1] >> 1; break; } - + op |= c_shift_table[ c_shift ] | a_shift_table[ a_shift ]; diff --git a/src/mesa/drivers/dri/unichrome/via_tris.c b/src/mesa/drivers/dri/unichrome/via_tris.c index 51f6af9..142da01 100644 --- a/src/mesa/drivers/dri/unichrome/via_tris.c +++ b/src/mesa/drivers/dri/unichrome/via_tris.c @@ -489,7 +489,7 @@ via_fallback_tri(struct via_context *vmesa, viaVertex *v0, viaVertex *v1, viaVertex *v2) -{ +{ struct gl_context *ctx = vmesa->glCtx; SWvertex v[3]; _swsetup_Translate(ctx, v0, &v[0]); @@ -621,7 +621,7 @@ static void viaFastRenderClippedPoly(struct gl_context *ctx, const GLuint *elts, for (i = 2; i < n; i++) { COPY_DWORDS(vb, vertsize, V(elts[i - 1])); COPY_DWORDS(vb, vertsize, V(elts[i])); - COPY_DWORDS(vb, vertsize, start); + COPY_DWORDS(vb, vertsize, start); } } @@ -677,7 +677,7 @@ static void viaChooseRenderState(struct gl_context *ctx) /* Hook in fallbacks for specific primitives. */ if (flags & POINT_FALLBACK) vmesa->drawPoint = via_fallback_point; - + if (flags & LINE_FALLBACK) vmesa->drawLine = via_fallback_line; @@ -749,7 +749,7 @@ static void viaChooseVertexState( struct gl_context *ctx ) RENDERINPUTS_COPY( index_bitset, tnl->render_inputs_bitset ); vmesa->vertex_attr_count = 0; - + /* EMIT_ATTR's must be in order as they tell t_vertex.c how to * build up a hardware vertex. */ @@ -764,15 +764,15 @@ static void viaChooseVertexState( struct gl_context *ctx ) } /* t_context.c always includes a diffuse color */ - EMIT_ATTR( _TNL_ATTRIB_COLOR0, EMIT_4UB_4F_BGRA, VIA_EMIT_RGBA, + EMIT_ATTR( _TNL_ATTRIB_COLOR0, EMIT_4UB_4F_BGRA, VIA_EMIT_RGBA, HC_HVPMSK_Cd ); - + vmesa->specoffset = 0; if (RENDERINPUTS_TEST( index_bitset, _TNL_ATTRIB_COLOR1 ) || RENDERINPUTS_TEST( index_bitset, _TNL_ATTRIB_FOG )) { if (RENDERINPUTS_TEST( index_bitset, _TNL_ATTRIB_COLOR1 )) { vmesa->specoffset = vmesa->coloroffset + 1; - EMIT_ATTR( _TNL_ATTRIB_COLOR1, EMIT_3UB_3F_BGR, VIA_EMIT_SPEC, + EMIT_ATTR( _TNL_ATTRIB_COLOR1, EMIT_3UB_3F_BGR, VIA_EMIT_SPEC, HC_HVPMSK_Cs ); } else @@ -786,21 +786,21 @@ static void viaChooseVertexState( struct gl_context *ctx ) if (RENDERINPUTS_TEST( index_bitset, _TNL_ATTRIB_TEX0 )) { if (vmesa->ptexHack) - EMIT_ATTR( _TNL_ATTRIB_TEX0, EMIT_3F_XYW, VIA_EMIT_PTEX0, + EMIT_ATTR( _TNL_ATTRIB_TEX0, EMIT_3F_XYW, VIA_EMIT_PTEX0, (HC_HVPMSK_S | HC_HVPMSK_T) ); - else - EMIT_ATTR( _TNL_ATTRIB_TEX0, EMIT_2F, VIA_EMIT_TEX0, + else + EMIT_ATTR( _TNL_ATTRIB_TEX0, EMIT_2F, VIA_EMIT_TEX0, (HC_HVPMSK_S | HC_HVPMSK_T) ); } if (RENDERINPUTS_TEST( index_bitset, _TNL_ATTRIB_TEX1 )) { - EMIT_ATTR( _TNL_ATTRIB_TEX1, EMIT_2F, VIA_EMIT_TEX1, + EMIT_ATTR( _TNL_ATTRIB_TEX1, EMIT_2F, VIA_EMIT_TEX1, (HC_HVPMSK_S | HC_HVPMSK_T) ); } if (setupIndex != vmesa->setupIndex) { - vmesa->vertexSize = _tnl_install_attrs( ctx, - vmesa->vertex_attrs, + vmesa->vertexSize = _tnl_install_attrs( ctx, + vmesa->vertex_attrs, vmesa->vertex_attr_count, vmesa->ViewportMatrix.m, 0 ); vmesa->vertexSize >>= 2; @@ -808,7 +808,7 @@ static void viaChooseVertexState( struct gl_context *ctx ) vmesa->regCmdB &= ~HC_HVPMSK_MASK; vmesa->regCmdB |= regCmdB; - if (vmesa->ptexHack) + if (vmesa->ptexHack) vmesa->hwVertexSize = vmesa->vertexSize - 1; else vmesa->hwVertexSize = vmesa->vertexSize; @@ -834,7 +834,7 @@ static GLboolean viaCheckPTexHack( struct gl_context *ctx ) if (RENDERINPUTS_TEST( index_bitset, _TNL_ATTRIB_TEX0 ) && VB->AttribPtr[_TNL_ATTRIB_TEX0]->size == 4) { if (!RENDERINPUTS_TEST_RANGE( index_bitset, _TNL_ATTRIB_TEX1, _TNL_LAST_TEX )) - ptexHack = GL_TRUE; + ptexHack = GL_TRUE; else fallback = GL_TRUE; } @@ -905,8 +905,8 @@ void viaRasterPrimitive(struct gl_context *ctx, GLuint regCmdB; RING_VARS; - if (VIA_DEBUG & DEBUG_PRIMS) - fprintf(stderr, "%s: %s/%s/%s\n", + if (VIA_DEBUG & DEBUG_PRIMS) + fprintf(stderr, "%s: %s/%s/%s\n", __FUNCTION__, _mesa_lookup_enum_by_nr(glprim), _mesa_lookup_enum_by_nr(hwprim), _mesa_lookup_enum_by_nr(ctx->Light.ShadeModel)); @@ -920,33 +920,33 @@ void viaRasterPrimitive(struct gl_context *ctx, VIA_FINISH_PRIM(vmesa); - /* Ensure no wrapping inside this function */ - viaCheckDma( vmesa, 1024 ); + /* Ensure no wrapping inside this function */ + viaCheckDma( vmesa, 1024 ); if (vmesa->newEmitState) { viaEmitState(vmesa); } - + vmesa->regCmdA_End = HC_ACMD_HCmdA; if (ctx->Light.ShadeModel == GL_SMOOTH) { vmesa->regCmdA_End |= HC_HShading_Gouraud; } - + vmesa->hwShadeModel = ctx->Light.ShadeModel; regCmdB = vmesa->regCmdB; switch (hwprim) { case GL_POINTS: vmesa->regCmdA_End |= HC_HPMType_Point | HC_HVCycle_Full; - vmesa->regCmdA_End |= HC_HShading_Gouraud; /* always Gouraud + vmesa->regCmdA_End |= HC_HShading_Gouraud; /* always Gouraud shade points?!? */ break; case GL_LINES: vmesa->regCmdA_End |= HC_HPMType_Line | HC_HVCycle_Full; regCmdB |= HC_HLPrst_MASK; if (ctx->Light.ShadeModel == GL_FLAT) - vmesa->regCmdA_End |= HC_HShading_FlatB; + vmesa->regCmdA_End |= HC_HShading_FlatB; break; case GL_LINE_LOOP: case GL_LINE_STRIP: @@ -954,26 +954,26 @@ void viaRasterPrimitive(struct gl_context *ctx, HC_HVCycle_AB | HC_HVCycle_NewB; regCmdB |= HC_HVCycle_AB | HC_HVCycle_NewB | HC_HLPrst_MASK; if (ctx->Light.ShadeModel == GL_FLAT) - vmesa->regCmdA_End |= HC_HShading_FlatB; + vmesa->regCmdA_End |= HC_HShading_FlatB; break; case GL_TRIANGLES: vmesa->regCmdA_End |= HC_HPMType_Tri | HC_HVCycle_Full; if (ctx->Light.ShadeModel == GL_FLAT) - vmesa->regCmdA_End |= HC_HShading_FlatC; + vmesa->regCmdA_End |= HC_HShading_FlatC; break; case GL_TRIANGLE_STRIP: vmesa->regCmdA_End |= HC_HPMType_Tri | HC_HVCycle_AFP | HC_HVCycle_AC | HC_HVCycle_BB | HC_HVCycle_NewC; regCmdB |= HC_HVCycle_AA | HC_HVCycle_BC | HC_HVCycle_NewC; if (ctx->Light.ShadeModel == GL_FLAT) - vmesa->regCmdA_End |= HC_HShading_FlatC; + vmesa->regCmdA_End |= HC_HShading_FlatC; break; case GL_TRIANGLE_FAN: vmesa->regCmdA_End |= HC_HPMType_Tri | HC_HVCycle_AFP | HC_HVCycle_AA | HC_HVCycle_BC | HC_HVCycle_NewC; regCmdB |= HC_HVCycle_AA | HC_HVCycle_BC | HC_HVCycle_NewC; if (ctx->Light.ShadeModel == GL_FLAT) - vmesa->regCmdA_End |= HC_HShading_FlatC; + vmesa->regCmdA_End |= HC_HShading_FlatC; break; case GL_QUADS: abort(); @@ -986,21 +986,21 @@ void viaRasterPrimitive(struct gl_context *ctx, HC_HVCycle_AA | HC_HVCycle_BC | HC_HVCycle_NewC; regCmdB |= HC_HVCycle_AA | HC_HVCycle_BC | HC_HVCycle_NewC; if (ctx->Light.ShadeModel == GL_FLAT) - vmesa->regCmdA_End |= HC_HShading_FlatC; - break; + vmesa->regCmdA_End |= HC_HShading_FlatC; + break; default: abort(); return; } - + /* assert((vmesa->dmaLow & 0x4) == 0); */ if (vmesa->dmaCliprectAddr == ~0) { - if (VIA_DEBUG & DEBUG_DMA) + if (VIA_DEBUG & DEBUG_DMA) fprintf(stderr, "reserve cliprect space at %x\n", vmesa->dmaLow); vmesa->dmaCliprectAddr = vmesa->dmaLow; BEGIN_RING(8); - OUT_RING( HC_HEADER2 ); + OUT_RING( HC_HEADER2 ); OUT_RING( (HC_ParaType_NotTex << 16) ); OUT_RING( 0xCCCCCCCC ); OUT_RING( 0xCCCCCCCC ); @@ -1014,18 +1014,18 @@ void viaRasterPrimitive(struct gl_context *ctx, assert(vmesa->dmaLastPrim == 0); BEGIN_RING(8); - OUT_RING( HC_HEADER2 ); + OUT_RING( HC_HEADER2 ); OUT_RING( (HC_ParaType_NotTex << 16) ); OUT_RING( 0xCCCCCCCC ); OUT_RING( 0xDDDDDDDD ); - OUT_RING( HC_HEADER2 ); + OUT_RING( HC_HEADER2 ); OUT_RING( (HC_ParaType_CmdVdata << 16) ); OUT_RING( regCmdB ); OUT_RING( vmesa->regCmdA_End ); ADVANCE_RING(); - vmesa->hwPrimitive = hwprim; + vmesa->hwPrimitive = hwprim; vmesa->dmaLastPrim = vmesa->dmaLow; } else { @@ -1043,15 +1043,15 @@ static void viaRenderPrimitive( struct gl_context *ctx, GLuint prim ) void viaFinishPrimitive(struct via_context *vmesa) { - if (VIA_DEBUG & (DEBUG_DMA|DEBUG_PRIMS)) + if (VIA_DEBUG & (DEBUG_DMA|DEBUG_PRIMS)) fprintf(stderr, "%s\n", __FUNCTION__); if (!vmesa->dmaLastPrim || vmesa->dmaCliprectAddr == ~0) { assert(0); } else if (vmesa->dmaLow != vmesa->dmaLastPrim) { - GLuint cmdA = (vmesa->regCmdA_End | HC_HPLEND_MASK | - HC_HPMValidN_MASK | HC_HE3Fire_MASK); + GLuint cmdA = (vmesa->regCmdA_End | HC_HPLEND_MASK | + HC_HPMValidN_MASK | HC_HE3Fire_MASK); RING_VARS; vmesa->dmaLastPrim = 0; @@ -1062,19 +1062,19 @@ void viaFinishPrimitive(struct via_context *vmesa) BEGIN_RING_NOCHECK( 1 ); OUT_RING( cmdA ); ADVANCE_RING(); - } - else { + } + else { BEGIN_RING_NOCHECK( 2 ); OUT_RING( cmdA ); OUT_RING( cmdA ); ADVANCE_RING(); - } + } if (vmesa->dmaLow > VIA_DMA_HIGHWATER) viaFlushDma( vmesa ); } else { - if (VIA_DEBUG & (DEBUG_DMA|DEBUG_PRIMS)) + if (VIA_DEBUG & (DEBUG_DMA|DEBUG_PRIMS)) fprintf(stderr, "remove empty primitive\n"); /* Remove the primitive header: @@ -1106,13 +1106,13 @@ void viaFallback(struct via_context *vmesa, GLuint bit, GLboolean mode) struct gl_context *ctx = vmesa->glCtx; TNLcontext *tnl = TNL_CONTEXT(ctx); GLuint oldfallback = vmesa->Fallback; - + if (mode) { vmesa->Fallback |= bit; if (oldfallback == 0) { VIA_FLUSH_DMA(vmesa); - if (VIA_DEBUG & DEBUG_FALLBACKS) + if (VIA_DEBUG & DEBUG_FALLBACKS) fprintf(stderr, "ENTER FALLBACK %x\n", bit); _swsetup_Wakeup(ctx); @@ -1124,7 +1124,7 @@ void viaFallback(struct via_context *vmesa, GLuint bit, GLboolean mode) if (oldfallback == bit) { _swrast_flush( ctx ); - if (VIA_DEBUG & DEBUG_FALLBACKS) + if (VIA_DEBUG & DEBUG_FALLBACKS) fprintf(stderr, "LEAVE FALLBACK %x\n", bit); tnl->Driver.Render.Start = viaRenderStart; @@ -1138,14 +1138,14 @@ void viaFallback(struct via_context *vmesa, GLuint bit, GLboolean mode) _tnl_invalidate_vertex_state( ctx, ~0 ); _tnl_invalidate_vertices( ctx, ~0 ); - _tnl_install_attrs( ctx, - vmesa->vertex_attrs, + _tnl_install_attrs( ctx, + vmesa->vertex_attrs, vmesa->vertex_attr_count, - vmesa->ViewportMatrix.m, 0 ); + vmesa->ViewportMatrix.m, 0 ); vmesa->newState |= (_VIA_NEW_RENDERSTATE|_VIA_NEW_VERTEX); } - } + } } static void viaRunPipeline( struct gl_context *ctx ) @@ -1186,9 +1186,9 @@ void viaInitTriFuncs(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, (6 + 2*ctx->Const.MaxTextureUnits) * sizeof(GLfloat) ); - + vmesa->verts = (GLubyte *)tnl->clipspace.vertex_buf; } diff --git a/src/mesa/drivers/osmesa/osmesa.c b/src/mesa/drivers/osmesa/osmesa.c index 10ba6b7..aacdaf8 100644 --- a/src/mesa/drivers/osmesa/osmesa.c +++ b/src/mesa/drivers/osmesa/osmesa.c @@ -683,7 +683,7 @@ osmesa_choose_triangle_function( struct gl_context *ctx ) if (osmesa->format != OSMESA_RGBA && osmesa->format != OSMESA_BGRA && osmesa->format != OSMESA_ARGB) 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; @@ -1215,7 +1215,7 @@ OSMesaCreateContextExt( GLenum format, GLint depthBits, GLint stencilBits, free(osmesa); return NULL; } - + _swsetup_Wakeup( ctx ); /* use default TCL pipeline */ @@ -1334,7 +1334,7 @@ OSMesaMakeCurrent( OSMesaContext osmesa, void *buffer, GLenum type, assert(osmesa->rb->RefCount == 2); } - /* 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->rb->Data = buffer; diff --git a/src/mesa/drivers/windows/gdi/mesa.def b/src/mesa/drivers/windows/gdi/mesa.def index b537b34..d4668aa 100644 --- a/src/mesa/drivers/windows/gdi/mesa.def +++ b/src/mesa/drivers/windows/gdi/mesa.def @@ -12,7 +12,7 @@ VERSION 6.5 ; ; The linker exports STDCALL entry points with ; 'decorated' names; e.g., _glBegin@0, where the -; trailing number is the number of bytes of +; trailing number is the number of bytes of ; parameter data pushed onto the stack. The ; callee is responsible for popping this data ; off the stack, usually via a RETF n instruction. diff --git a/src/mesa/drivers/windows/gdi/wgl.c b/src/mesa/drivers/windows/gdi/wgl.c index 8d80870..10f5af9 100644 --- a/src/mesa/drivers/windows/gdi/wgl.c +++ b/src/mesa/drivers/windows/gdi/wgl.c @@ -22,7 +22,7 @@ * Some things originated from the 3Dfx WGL functions */ -/* +/* * This file contains the implementation of the wgl* functions for * Mesa on Windows. Since these functions are provided by Windows in * GDI/OpenGL, we must supply our versions that work with Mesa here. @@ -39,7 +39,7 @@ #include # if defined(BUILD_GL32) -# define WINGDIAPI __declspec(dllexport) +# define WINGDIAPI __declspec(dllexport) # else # define __W32API_USE_DLLIMPORT__ # endif @@ -74,81 +74,81 @@ struct __pixelformat__ /* These are the PFD's supported by this driver. */ struct __pixelformat__ pfd[] = { -#if 0 +#if 0 /* Double Buffer, alpha */ - { - { + { + { sizeof(PIXELFORMATDESCRIPTOR), 1, PFD_DRAW_TO_WINDOW|PFD_SUPPORT_OPENGL| PFD_GENERIC_FORMAT|PFD_DOUBLEBUFFER|PFD_SWAP_COPY, PFD_TYPE_RGBA, - 24, - 8, 0, - 8, 8, - 8, 16, + 24, + 8, 0, + 8, 8, + 8, 16, 8, 24, - 0, 0, 0, 0, 0, - DEFAULT_SOFTWARE_DEPTH_BITS, 8, - 0, 0, 0, - 0, 0, 0 + 0, 0, 0, 0, 0, + DEFAULT_SOFTWARE_DEPTH_BITS, 8, + 0, 0, 0, + 0, 0, 0 }, GL_TRUE }, /* Single Buffer, alpha */ - { - { + { + { sizeof(PIXELFORMATDESCRIPTOR), 1, PFD_DRAW_TO_WINDOW|PFD_SUPPORT_OPENGL| PFD_GENERIC_FORMAT, PFD_TYPE_RGBA, - 24, - 8, 0, - 8, 8, - 8, 16, + 24, + 8, 0, + 8, 8, + 8, 16, 8, 24, - 0, 0, 0, 0, 0, - DEFAULT_SOFTWARE_DEPTH_BITS, 8, - 0, 0, 0, + 0, 0, 0, 0, 0, + DEFAULT_SOFTWARE_DEPTH_BITS, 8, + 0, 0, 0, 0, 0, 0 }, GL_FALSE }, -#endif +#endif /* Double Buffer, no alpha */ - { - { + { + { sizeof(PIXELFORMATDESCRIPTOR), 1, PFD_DRAW_TO_WINDOW|PFD_SUPPORT_OPENGL| PFD_GENERIC_FORMAT|PFD_DOUBLEBUFFER|PFD_SWAP_COPY, PFD_TYPE_RGBA, - 24, + 24, 8, 0, 8, 8, 8, 16, 0, 0, 0, 0, 0, 0, 0, - DEFAULT_SOFTWARE_DEPTH_BITS, 8, - 0, 0, 0, - 0, 0, 0 + DEFAULT_SOFTWARE_DEPTH_BITS, 8, + 0, 0, 0, + 0, 0, 0 }, GL_TRUE }, /* Single Buffer, no alpha */ - { + { { sizeof(PIXELFORMATDESCRIPTOR), 1, PFD_DRAW_TO_WINDOW|PFD_SUPPORT_OPENGL| PFD_GENERIC_FORMAT, PFD_TYPE_RGBA, - 24, + 24, 8, 0, 8, 8, 8, 16, 0, 0, 0, 0, 0, 0, 0, - DEFAULT_SOFTWARE_DEPTH_BITS, 8, + DEFAULT_SOFTWARE_DEPTH_BITS, 8, 0, 0, 0, - 0, 0, 0 + 0, 0, 0 }, GL_FALSE }, @@ -186,11 +186,11 @@ WINGDIAPI HGLRC GLAPIENTRY wglCreateContext(HDC hdc) } for( i = 0; i < MESAWGL_CTX_MAX_COUNT; i++ ) { if ( wgl_ctx[i].ctx == NULL ) { - wgl_ctx[i].ctx = + wgl_ctx[i].ctx = WMesaCreateContext(hdc, NULL, (GLboolean)GL_TRUE, (GLboolean) (pfd[curPFD-1].doubleBuffered ? - GL_TRUE : GL_FALSE), - (GLboolean)(pfd[curPFD-1].pfd.cAlphaBits ? + GL_TRUE : GL_FALSE), + (GLboolean)(pfd[curPFD-1].pfd.cAlphaBits ? GL_TRUE : GL_FALSE) ); if (wgl_ctx[i].ctx == NULL) break; @@ -234,7 +234,7 @@ WINGDIAPI HDC GLAPIENTRY wglGetCurrentDC(VOID) WINGDIAPI BOOL GLAPIENTRY wglMakeCurrent(HDC hdc, HGLRC hglrc) { int i; - + CurrentHDC = hdc; if (!hdc || !hglrc) { @@ -242,7 +242,7 @@ WINGDIAPI BOOL GLAPIENTRY wglMakeCurrent(HDC hdc, HGLRC hglrc) ctx_current = -1; return TRUE; } - + for ( i = 0; i < MESAWGL_CTX_MAX_COUNT; i++ ) { if ( wgl_ctx[i].ctx == (WMesaContext) hglrc ) { WMesaMakeCurrent( (WMesaContext) hglrc, hdc ); @@ -255,12 +255,12 @@ WINGDIAPI BOOL GLAPIENTRY wglMakeCurrent(HDC hdc, HGLRC hglrc) WINGDIAPI int GLAPIENTRY wglChoosePixelFormat(HDC hdc, - CONST + CONST PIXELFORMATDESCRIPTOR *ppfd) { int i,best = -1,bestdelta = 0x7FFFFFFF,delta; (void) hdc; - + if(ppfd->nSize != sizeof(PIXELFORMATDESCRIPTOR) || ppfd->nVersion != 1) { SetLastError(0); @@ -287,12 +287,12 @@ WINGDIAPI int GLAPIENTRY wglChoosePixelFormat(HDC hdc, continue; if( !(ppfd->dwFlags & PFD_DOUBLEBUFFER_DONTCARE) && - ((ppfd->dwFlags & PFD_DOUBLEBUFFER) != + ((ppfd->dwFlags & PFD_DOUBLEBUFFER) != (pfd[i].pfd.dwFlags & PFD_DOUBLEBUFFER))) continue; if( !(ppfd->dwFlags & PFD_STEREO_DONTCARE) && - ((ppfd->dwFlags & PFD_STEREO) != + ((ppfd->dwFlags & PFD_STEREO) != (pfd[i].pfd.dwFlags & PFD_STEREO))) continue; if(ppfd->iPixelType != pfd[i].pfd.iPixelType) @@ -321,10 +321,10 @@ WINGDIAPI int GLAPIENTRY wglDescribePixelFormat(HDC hdc, LPPIXELFORMATDESCRIPTOR ppfd) { (void) hdc; - + if(ppfd == NULL) return(npfd); - if(iPixelFormat < 1 || iPixelFormat > npfd || + if(iPixelFormat < 1 || iPixelFormat > npfd || nBytes != sizeof(PIXELFORMATDESCRIPTOR)) { SetLastError(0); @@ -339,7 +339,7 @@ WINGDIAPI PROC GLAPIENTRY wglGetProcAddress(LPCSTR lpszProc) PROC p = (PROC) _glapi_get_proc_address((const char *) lpszProc); if (p) return p; - + SetLastError(0); return(NULL); } @@ -358,8 +358,8 @@ WINGDIAPI BOOL GLAPIENTRY wglSetPixelFormat(HDC hdc,int iPixelFormat, const PIXELFORMATDESCRIPTOR *ppfd) { (void) hdc; - - if(iPixelFormat < 1 || iPixelFormat > npfd || + + if(iPixelFormat < 1 || iPixelFormat > npfd || ppfd->nSize != sizeof(PIXELFORMATDESCRIPTOR)) { SetLastError(0); return(FALSE); @@ -391,31 +391,31 @@ static BOOL wglUseFontBitmaps_FX(HDC fontDevice, DWORD firstChar, DWORD numChars, DWORD listBase) { #define VERIFY(a) a - + TEXTMETRIC metric; BITMAPINFO *dibInfo; HDC bitDevice; COLORREF tempColor; int i; - + VERIFY(GetTextMetrics(fontDevice, &metric)); - + dibInfo = (BITMAPINFO *) calloc(sizeof(BITMAPINFO) + sizeof(RGBQUAD), 1); dibInfo->bmiHeader.biSize = sizeof(BITMAPINFOHEADER); dibInfo->bmiHeader.biPlanes = 1; dibInfo->bmiHeader.biBitCount = 1; dibInfo->bmiHeader.biCompression = BI_RGB; - + bitDevice = CreateCompatibleDC(fontDevice); - + /* Swap fore and back colors so the bitmap has the right polarity */ tempColor = GetBkColor(bitDevice); SetBkColor(bitDevice, GetTextColor(bitDevice)); SetTextColor(bitDevice, tempColor); - + /* Place chars based on base line */ VERIFY(SetTextAlign(bitDevice, TA_BASELINE) != GDI_ERROR ? 1 : 0); - + for(i = 0; i < (int)numChars; i++) { SIZE size; char curChar; @@ -423,38 +423,38 @@ static BOOL wglUseFontBitmaps_FX(HDC fontDevice, DWORD firstChar, HBITMAP bitObject; HGDIOBJ origBmap; unsigned char *bmap; - + curChar = (char)(i + firstChar); - + /* Find how high/wide this character is */ VERIFY(GetTextExtentPoint32(bitDevice, &curChar, 1, &size)); - + /* Create the output bitmap */ charWidth = size.cx; charHeight = size.cy; /* Round up to the next multiple of 32 bits */ - bmapWidth = ((charWidth + 31) / 32) * 32; + bmapWidth = ((charWidth + 31) / 32) * 32; bmapHeight = charHeight; bitObject = CreateCompatibleBitmap(bitDevice, bmapWidth, bmapHeight); /* VERIFY(bitObject); */ - + /* Assign the output bitmap to the device */ origBmap = SelectObject(bitDevice, bitObject); (void) VERIFY(origBmap); - + VERIFY( PatBlt( bitDevice, 0, 0, bmapWidth, bmapHeight,BLACKNESS ) ); - + /* Use our source font on the device */ VERIFY(SelectObject(bitDevice, GetCurrentObject(fontDevice,OBJ_FONT))); - + /* Draw the character */ VERIFY(TextOut(bitDevice, 0, metric.tmAscent, &curChar, 1)); - + /* Unselect our bmap object */ VERIFY(SelectObject(bitDevice, origBmap)); - + /* Convert the display dependant representation to a 1 bit deep DIB */ numBytes = (bmapWidth * bmapHeight) / 8; bmap = malloc(numBytes); @@ -464,7 +464,7 @@ static BOOL wglUseFontBitmaps_FX(HDC fontDevice, DWORD firstChar, dibInfo, DIB_RGB_COLORS); /* VERIFY(res); */ - + /* Create the GL object */ glNewList(i + listBase, GL_COMPILE); glBitmap(bmapWidth, bmapHeight, 0.0, (GLfloat)metric.tmDescent, @@ -472,19 +472,19 @@ static BOOL wglUseFontBitmaps_FX(HDC fontDevice, DWORD firstChar, bmap); glEndList(); /* CheckGL(); */ - + /* Destroy the bmap object */ DeleteObject(bitObject); - + /* Deallocate the bitmap data */ free(bmap); } - + /* Destroy the DC */ VERIFY(DeleteDC(bitDevice)); - + free(dibInfo); - + return TRUE; #undef VERIFY } @@ -500,19 +500,19 @@ WINGDIAPI BOOL GLAPIENTRY wglUseFontBitmapsA(HDC hdc, DWORD first, LPSTR lpBits; MAT2 mat; int success = TRUE; - + if (count == 0) return FALSE; - + font_list = listBase; - + mat.eM11 = FixedFromDouble(1); mat.eM12 = FixedFromDouble(0); mat.eM21 = FixedFromDouble(0); mat.eM22 = FixedFromDouble(-1); - + memset(&gm,0,sizeof(gm)); - + /* ** If we can't get the glyph outline, it may be because this is a fixed ** font. Try processing it that way. @@ -521,17 +521,17 @@ WINGDIAPI BOOL GLAPIENTRY wglUseFontBitmapsA(HDC hdc, DWORD first, == GDI_ERROR ) { return wglUseFontBitmaps_FX( hdc, first, count, listBase ); } - + /* ** Otherwise process all desired characters. */ for (i = 0; i < (int)count; i++) { DWORD err; - + glNewList( font_list+i, GL_COMPILE ); - + /* allocate space for the bitmap/outline */ - size = GetGlyphOutline(hdc, first + i, GGO_BITMAP, + size = GetGlyphOutline(hdc, first + i, GGO_BITMAP, &gm, 0, NULL, &mat); if (size == GDI_ERROR) { glEndList( ); @@ -539,11 +539,11 @@ WINGDIAPI BOOL GLAPIENTRY wglUseFontBitmapsA(HDC hdc, DWORD first, success = FALSE; continue; } - + hBits = GlobalAlloc(GHND, size+1); lpBits = GlobalLock(hBits); - - err = + + err = GetGlyphOutline(hdc, /* handle to device context */ first + i, /* character to query */ GGO_BITMAP, /* format of data to return */ @@ -553,30 +553,30 @@ WINGDIAPI BOOL GLAPIENTRY wglUseFontBitmapsA(HDC hdc, DWORD first, &mat /* pointer to transformation */ /* matrix structure */ ); - + if (err == GDI_ERROR) { GlobalUnlock(hBits); GlobalFree(hBits); - + glEndList( ); err = GetLastError(); success = FALSE; continue; } - + glBitmap(gm.gmBlackBoxX,gm.gmBlackBoxY, (GLfloat)-gm.gmptGlyphOrigin.x, (GLfloat)gm.gmptGlyphOrigin.y, (GLfloat)gm.gmCellIncX, (GLfloat)gm.gmCellIncY, (const GLubyte * )lpBits); - + GlobalUnlock(hBits); GlobalFree(hBits); - + glEndList( ); } - + return success; } @@ -655,7 +655,7 @@ WINGDIAPI BOOL GLAPIENTRY wglDescribeLayerPlane(HDC hdc, UINT nBytes, LPLAYERPLANEDESCRIPTOR plpd) { - (void) hdc; (void) iPixelFormat; (void) iLayerPlane; + (void) hdc; (void) iPixelFormat; (void) iLayerPlane; (void) nBytes; (void) plpd; SetLastError(0); return(FALSE); @@ -667,7 +667,7 @@ WINGDIAPI int GLAPIENTRY wglSetLayerPaletteEntries(HDC hdc, int cEntries, CONST COLORREF *pcr) { - (void) hdc; (void) iLayerPlane; (void) iStart; + (void) hdc; (void) iLayerPlane; (void) iStart; (void) cEntries; (void) pcr; SetLastError(0); return(0); diff --git a/src/mesa/drivers/windows/gdi/wmesa.c b/src/mesa/drivers/windows/gdi/wmesa.c index 833e252..f60be6c 100644 --- a/src/mesa/drivers/windows/gdi/wmesa.c +++ b/src/mesa/drivers/windows/gdi/wmesa.c @@ -63,7 +63,7 @@ wmesa_free_framebuffer(HDC hdc) else prev->next = pwfb->next; fb = &pwfb->Base; - _mesa_reference_framebuffer(&fb, NULL); + _mesa_reference_framebuffer(&fb, NULL); } } @@ -106,7 +106,7 @@ static WMesaContext wmesa_context(const struct gl_context *ctx) */ static const GLubyte *wmesa_get_string(struct gl_context *ctx, GLenum name) { - return (name == GL_RENDERER) ? + return (name == GL_RENDERER) ? (GLubyte *) "Mesa Windows GDI Driver" : NULL; } @@ -120,8 +120,8 @@ static void wmSetPixelFormat(WMesaFramebuffer pwfb, HDC hDC) /* Only 16 and 32 bit targets are supported now */ assert(pwfb->cColorBits == 0 || - pwfb->cColorBits == 16 || - pwfb->cColorBits == 24 || + pwfb->cColorBits == 16 || + pwfb->cColorBits == 24 || pwfb->cColorBits == 32); switch(pwfb->cColorBits){ @@ -163,13 +163,13 @@ BOOL wmCreateBackingStore(WMesaFramebuffer pwfb, long lxSize, long lySize) pbmi->bmiHeader.biYPelsPerMeter = 0; pbmi->bmiHeader.biClrUsed = 0; pbmi->bmiHeader.biClrImportant = 0; - + pwfb->cColorBits = pbmi->bmiHeader.biBitCount; pwfb->ScanWidth = (lxSize * (pwfb->cColorBits / 8) + 3) & ~3; - + hic = CreateIC("display", NULL, NULL, NULL); pwfb->dib_hDC = CreateCompatibleDC(hic); - + pwfb->hbmDIB = CreateDIBSection(hic, &pwfb->bmi, DIB_RGB_COLORS, @@ -177,7 +177,7 @@ BOOL wmCreateBackingStore(WMesaFramebuffer pwfb, long lxSize, long lySize) 0, 0); pwfb->hOldBitmap = SelectObject(pwfb->dib_hDC, pwfb->hbmDIB); - + DeleteDC(hic); wmSetPixelFormat(pwfb, pwfb->hDC); @@ -255,7 +255,7 @@ static void clear_color(struct gl_context *ctx, const GLfloat color[4]) WMesaContext pwc = wmesa_context(ctx); WMesaFramebuffer pwfb = wmesa_framebuffer(ctx->DrawBuffer); GLubyte col[3]; - UINT bytesPerPixel = pwfb->cColorBits / 8; + UINT bytesPerPixel = pwfb->cColorBits / 8; CLAMPED_FLOAT_TO_UBYTE(col[0], color[0]); CLAMPED_FLOAT_TO_UBYTE(col[1], color[1]); @@ -263,19 +263,19 @@ static void clear_color(struct gl_context *ctx, const GLfloat color[4]) pwc->clearColorRef = RGB(col[0], col[1], col[2]); DeleteObject(pwc->clearPen); DeleteObject(pwc->clearBrush); - pwc->clearPen = CreatePen(PS_SOLID, 1, pwc->clearColorRef); - pwc->clearBrush = CreateSolidBrush(pwc->clearColorRef); + pwc->clearPen = CreatePen(PS_SOLID, 1, pwc->clearColorRef); + pwc->clearBrush = CreateSolidBrush(pwc->clearColorRef); } -/* - * Clear the specified region of the color buffer using the clear color - * or index as specified by one of the two functions above. - * - * This procedure clears either the front and/or the back COLOR buffers. - * Only the "left" buffer is cleared since we are not stereo. - * Clearing of the other non-color buffers is left to the swrast. - */ +/* + * Clear the specified region of the color buffer using the clear color + * or index as specified by one of the two functions above. + * + * This procedure clears either the front and/or the back COLOR buffers. + * Only the "left" buffer is cleared since we are not stereo. + * Clearing of the other non-color buffers is left to the swrast. + */ static void clear(struct gl_context *ctx, GLbitfield mask) { @@ -300,18 +300,18 @@ static void clear(struct gl_context *ctx, GLbitfield mask) } /* Back buffer */ - if (mask & BUFFER_BIT_BACK_LEFT) { - - int i, rowSize; - UINT bytesPerPixel = pwfb->cColorBits / 8; + if (mask & BUFFER_BIT_BACK_LEFT) { + + int i, rowSize; + UINT bytesPerPixel = pwfb->cColorBits / 8; LPBYTE lpb, clearRow; LPWORD lpw; - BYTE bColor; - WORD wColor; - BYTE r, g, b; - DWORD dwColor; - LPDWORD lpdw; - + BYTE bColor; + WORD wColor; + BYTE r, g, b; + DWORD dwColor; + LPDWORD lpdw; + /* Try for a fast clear - clearing entire buffer with a single * byte value. */ if (width == ctx->DrawBuffer->Width && @@ -319,19 +319,19 @@ static void clear(struct gl_context *ctx, GLbitfield mask) /* Now check for an easy clear value */ switch (bytesPerPixel) { case 1: - bColor = BGR8(GetRValue(pwc->clearColorRef), - GetGValue(pwc->clearColorRef), + bColor = BGR8(GetRValue(pwc->clearColorRef), + GetGValue(pwc->clearColorRef), GetBValue(pwc->clearColorRef)); - memset(pwfb->pbPixels, bColor, + memset(pwfb->pbPixels, bColor, pwfb->ScanWidth * height); done = 1; break; case 2: - wColor = BGR16(GetRValue(pwc->clearColorRef), - GetGValue(pwc->clearColorRef), - GetBValue(pwc->clearColorRef)); + wColor = BGR16(GetRValue(pwc->clearColorRef), + GetGValue(pwc->clearColorRef), + GetBValue(pwc->clearColorRef)); if (((wColor >> 8) & 0xff) == (wColor & 0xff)) { - memset(pwfb->pbPixels, wColor & 0xff, + memset(pwfb->pbPixels, wColor & 0xff, pwfb->ScanWidth * height); done = 1; } @@ -339,12 +339,12 @@ static void clear(struct gl_context *ctx, GLbitfield mask) case 3: /* fall through */ case 4: - if (GetRValue(pwc->clearColorRef) == + if (GetRValue(pwc->clearColorRef) == GetGValue(pwc->clearColorRef) && - GetRValue(pwc->clearColorRef) == + GetRValue(pwc->clearColorRef) == GetBValue(pwc->clearColorRef)) { - memset(pwfb->pbPixels, - GetRValue(pwc->clearColorRef), + memset(pwfb->pbPixels, + GetRValue(pwc->clearColorRef), pwfb->ScanWidth * height); done = 1; } @@ -357,81 +357,81 @@ static void clear(struct gl_context *ctx, GLbitfield mask) if (!done) { /* Need to clear a row at a time. Begin by setting the first * row in the area to be cleared to the clear color. */ - - clearRow = pwfb->pbPixels + + + clearRow = pwfb->pbPixels + pwfb->ScanWidth * FLIP(y) + - bytesPerPixel * x; + bytesPerPixel * x; switch (bytesPerPixel) { case 1: lpb = clearRow; - bColor = BGR8(GetRValue(pwc->clearColorRef), - GetGValue(pwc->clearColorRef), + bColor = BGR8(GetRValue(pwc->clearColorRef), + GetGValue(pwc->clearColorRef), GetBValue(pwc->clearColorRef)); memset(lpb, bColor, width); break; case 2: lpw = (LPWORD)clearRow; - wColor = BGR16(GetRValue(pwc->clearColorRef), - GetGValue(pwc->clearColorRef), - GetBValue(pwc->clearColorRef)); + wColor = BGR16(GetRValue(pwc->clearColorRef), + GetGValue(pwc->clearColorRef), + GetBValue(pwc->clearColorRef)); for (i=0; iclearColorRef); - g = GetGValue(pwc->clearColorRef); - b = GetBValue(pwc->clearColorRef); + r = GetRValue(pwc->clearColorRef); + g = GetGValue(pwc->clearColorRef); + b = GetBValue(pwc->clearColorRef); for (i=0; iclearColorRef), - GetGValue(pwc->clearColorRef), - GetBValue(pwc->clearColorRef)); + case 4: + lpdw = (LPDWORD)clearRow; + dwColor = BGR32(GetRValue(pwc->clearColorRef), + GetGValue(pwc->clearColorRef), + GetBValue(pwc->clearColorRef)); for (i=0; iScanWidth; rowSize = width * bytesPerPixel; - for (i=1; iScanWidth; - } + for (i=1; iScanWidth; + } } /* not done */ mask &= ~BUFFER_BIT_BACK_LEFT; - } /* back buffer */ + } /* back buffer */ /* front buffer */ - if (mask & BUFFER_BIT_FRONT_LEFT) { - HDC DC = pwc->hDC; - HPEN Old_Pen = SelectObject(DC, pwc->clearPen); + if (mask & BUFFER_BIT_FRONT_LEFT) { + HDC DC = pwc->hDC; + HPEN Old_Pen = SelectObject(DC, pwc->clearPen); HBRUSH Old_Brush = SelectObject(DC, pwc->clearBrush); Rectangle(DC, x, FLIP(y) + 1, x + width + 1, FLIP(y) - height + 1); - SelectObject(DC, Old_Pen); - SelectObject(DC, Old_Brush); + SelectObject(DC, Old_Pen); + SelectObject(DC, Old_Brush); mask &= ~BUFFER_BIT_FRONT_LEFT; - } /* front buffer */ - - /* Call swrast if there is anything left to clear (like DEPTH) */ - if (mask) + } /* front buffer */ + + /* Call swrast if there is anything left to clear (like DEPTH) */ + if (mask) _swrast_Clear(ctx, mask); - + #undef FLIP -} +} /**********************************************************************/ @@ -447,10 +447,10 @@ static void clear(struct gl_context *ctx, GLbitfield mask) **/ /* Write a horizontal span of RGBA color pixels with a boolean mask. */ -static void write_rgba_span_front(const struct gl_context *ctx, - struct gl_renderbuffer *rb, +static void write_rgba_span_front(const struct gl_context *ctx, + struct gl_renderbuffer *rb, GLuint n, GLint x, GLint y, - const GLubyte rgba[][4], + const GLubyte rgba[][4], const GLubyte mask[] ) { WMesaContext pwc = wmesa_context(ctx); @@ -534,39 +534,39 @@ static void write_rgba_span_front(const struct gl_context *ctx, } /* Write a horizontal span of RGB color pixels with a boolean mask. */ -static void write_rgb_span_front(const struct gl_context *ctx, - struct gl_renderbuffer *rb, +static void write_rgb_span_front(const struct gl_context *ctx, + struct gl_renderbuffer *rb, GLuint n, GLint x, GLint y, - const GLubyte rgb[][3], + const GLubyte rgb[][3], const GLubyte mask[] ) { WMesaContext pwc = wmesa_context(ctx); GLuint i; - + (void) ctx; y=FLIP(y); if (mask) { for (i=0; ihDC, x+i, y, RGB(rgb[i][RCOMP], rgb[i][GCOMP], + SetPixel(pwc->hDC, x+i, y, RGB(rgb[i][RCOMP], rgb[i][GCOMP], rgb[i][BCOMP])); } else { for (i=0; ihDC, x+i, y, RGB(rgb[i][RCOMP], rgb[i][GCOMP], + SetPixel(pwc->hDC, x+i, y, RGB(rgb[i][RCOMP], rgb[i][GCOMP], rgb[i][BCOMP])); } - + } /* * Write a horizontal span of pixels with a boolean mask. The current color * is used for all pixels. */ -static void write_mono_rgba_span_front(const struct gl_context *ctx, +static void write_mono_rgba_span_front(const struct gl_context *ctx, struct gl_renderbuffer *rb, GLuint n, GLint x, GLint y, - const GLchan color[4], + const GLchan color[4], const GLubyte mask[]) { GLuint i; @@ -588,11 +588,11 @@ static void write_mono_rgba_span_front(const struct gl_context *ctx, } /* Write an array of RGBA pixels with a boolean mask. */ -static void write_rgba_pixels_front(const struct gl_context *ctx, +static void write_rgba_pixels_front(const struct gl_context *ctx, struct gl_renderbuffer *rb, - GLuint n, + GLuint n, const GLint x[], const GLint y[], - const GLubyte rgba[][4], + const GLubyte rgba[][4], const GLubyte mask[] ) { GLuint i; @@ -600,8 +600,8 @@ static void write_rgba_pixels_front(const struct gl_context *ctx, (void) ctx; for (i=0; ihDC, x[i], FLIP(y[i]), - RGB(rgba[i][RCOMP], rgba[i][GCOMP], + SetPixel(pwc->hDC, x[i], FLIP(y[i]), + RGB(rgba[i][RCOMP], rgba[i][GCOMP], rgba[i][BCOMP])); } @@ -611,7 +611,7 @@ static void write_rgba_pixels_front(const struct gl_context *ctx, * Write an array of pixels with a boolean mask. The current color * is used for all pixels. */ -static void write_mono_rgba_pixels_front(const struct gl_context *ctx, +static void write_mono_rgba_pixels_front(const struct gl_context *ctx, struct gl_renderbuffer *rb, GLuint n, const GLint x[], const GLint y[], @@ -629,7 +629,7 @@ static void write_mono_rgba_pixels_front(const struct gl_context *ctx, } /* Read a horizontal span of color pixels. */ -static void read_rgba_span_front(const struct gl_context *ctx, +static void read_rgba_span_front(const struct gl_context *ctx, struct gl_renderbuffer *rb, GLuint n, GLint x, GLint y, GLubyte rgba[][4] ) @@ -649,7 +649,7 @@ static void read_rgba_span_front(const struct gl_context *ctx, /* Read an array of color pixels. */ -static void read_rgba_pixels_front(const struct gl_context *ctx, +static void read_rgba_pixels_front(const struct gl_context *ctx, struct gl_renderbuffer *rb, GLuint n, const GLint x[], const GLint y[], GLubyte rgba[][4]) @@ -678,10 +678,10 @@ LPDWORD lpdw = ((LPDWORD)((pwc)->pbPixels + (pwc)->ScanWidth * (y)) + (x)); \ /* Write a horizontal span of RGBA color pixels with a boolean mask. */ -static void write_rgba_span_32(const struct gl_context *ctx, - struct gl_renderbuffer *rb, +static void write_rgba_span_32(const struct gl_context *ctx, + struct gl_renderbuffer *rb, GLuint n, GLint x, GLint y, - const GLubyte rgba[][4], + const GLubyte rgba[][4], const GLubyte mask[] ) { WMesaContext pwc = wmesa_context(ctx); @@ -690,28 +690,28 @@ static void write_rgba_span_32(const struct gl_context *ctx, LPDWORD lpdw; (void) ctx; - + y=FLIP(y); lpdw = ((LPDWORD)(pwfb->pbPixels + pwfb->ScanWidth * y)) + x; if (mask) { for (i=0; ipbPixels + pwfb->ScanWidth * y)) + x; if (mask) { for (i=0; iDrawBuffer); - + y = FLIP(y); lpdw = ((LPDWORD)(pwfb->pbPixels + pwfb->ScanWidth * y)) + x; for (i=0; ipbPixels + pwfb->ScanWidth * y)) + (3 * x); if (mask) { @@ -894,10 +894,10 @@ static void write_rgba_span_24(const struct gl_context *ctx, /* Write a horizontal span of RGB color pixels with a boolean mask. */ -static void write_rgb_span_24(const struct gl_context *ctx, - struct gl_renderbuffer *rb, +static void write_rgb_span_24(const struct gl_context *ctx, + struct gl_renderbuffer *rb, GLuint n, GLint x, GLint y, - const GLubyte rgb[][3], + const GLubyte rgb[][3], const GLubyte mask[] ) { WMesaContext pwc = wmesa_context(ctx); @@ -906,7 +906,7 @@ static void write_rgb_span_24(const struct gl_context *ctx, LPBYTE lpb; (void) ctx; - + y=FLIP(y); lpb = ((LPBYTE)(pwfb->pbPixels + pwfb->ScanWidth * y)) + (3 * x); if (mask) { @@ -930,10 +930,10 @@ static void write_rgb_span_24(const struct gl_context *ctx, * Write a horizontal span of pixels with a boolean mask. The current color * is used for all pixels. */ -static void write_mono_rgba_span_24(const struct gl_context *ctx, +static void write_mono_rgba_span_24(const struct gl_context *ctx, struct gl_renderbuffer *rb, GLuint n, GLint x, GLint y, - const GLchan color[4], + const GLchan color[4], const GLubyte mask[]) { LPBYTE lpb; @@ -954,15 +954,15 @@ static void write_mono_rgba_span_24(const struct gl_context *ctx, for (i=0; iDrawBuffer); - + y = FLIP(y); lpb = ((LPBYTE)(pwfb->pbPixels + pwfb->ScanWidth * y)) + (3 * x); for (i=0; ipbPixels + (pwc)->ScanWidth * (y)) + (x)); \ /* Write a horizontal span of RGBA color pixels with a boolean mask. */ -static void write_rgba_span_16(const struct gl_context *ctx, - struct gl_renderbuffer *rb, +static void write_rgba_span_16(const struct gl_context *ctx, + struct gl_renderbuffer *rb, GLuint n, GLint x, GLint y, - const GLubyte rgba[][4], + const GLubyte rgba[][4], const GLubyte mask[] ) { WMesaContext pwc = wmesa_context(ctx); @@ -1061,28 +1061,28 @@ static void write_rgba_span_16(const struct gl_context *ctx, LPWORD lpw; (void) ctx; - + y=FLIP(y); lpw = ((LPWORD)(pwfb->pbPixels + pwfb->ScanWidth * y)) + x; if (mask) { for (i=0; ipbPixels + pwfb->ScanWidth * y)) + x; if (mask) { for (i=0; iDrawBuffer); - + y = FLIP(y); lpw = ((LPWORD)(pwfb->pbPixels + pwfb->ScanWidth * y)) + x; for (i=0; iWidth = width; @@ -1348,8 +1348,8 @@ wmesa_resize_buffers(struct gl_context *ctx, struct gl_framebuffer *buffer, * we get the viewport set correctly, even if the app does not call * glViewport and relies on the defaults. */ -static void wmesa_viewport(struct gl_context *ctx, - GLint x, GLint y, +static void wmesa_viewport(struct gl_context *ctx, + GLint x, GLint y, GLsizei width, GLsizei height) { WMesaContext pwc = wmesa_context(ctx); @@ -1378,7 +1378,7 @@ static void wmesa_update_state(struct gl_context *ctx, GLuint new_state) _vbo_InvalidateState(ctx, new_state); _tnl_InvalidateState(ctx, new_state); - /* TODO - This code is not complete yet because I + /* TODO - This code is not complete yet because I * don't know what to do for all state updates. */ @@ -1394,7 +1394,7 @@ static void wmesa_update_state(struct gl_context *ctx, GLuint new_state) /***** WMESA Functions *****/ /**********************************************************************/ -WMesaContext WMesaCreateContext(HDC hDC, +WMesaContext WMesaCreateContext(HDC hDC, HPALETTE* Pal, GLboolean rgb_flag, GLboolean db_flag, @@ -1407,7 +1407,7 @@ WMesaContext WMesaCreateContext(HDC hDC, struct gl_config *visual; (void) Pal; - + /* Indexed mode not supported */ if (!rgb_flag) return NULL; @@ -1432,7 +1432,7 @@ WMesaContext WMesaCreateContext(HDC hDC, /* Get data for visual */ /* Dealing with this is actually a bit of overkill because Mesa will end - * up treating all color component size requests less than 8 by using + * up treating all color component size requests less than 8 by using * a single byte per channel. In addition, the interface to the span * routines passes colors as an entire byte per channel anyway, so there * is nothing to be saved by telling the visual to be 16 bits if the device @@ -1460,7 +1460,7 @@ WMesaContext WMesaCreateContext(HDC hDC, 16,16,16, /* accum RGB */ alpha_flag ? 16 : 0, /* accum A */ 1); /* num samples */ - + if (!visual) { free(c); return NULL; @@ -1490,7 +1490,7 @@ WMesaContext WMesaCreateContext(HDC hDC, _mesa_enable_1_5_extensions(ctx); _mesa_enable_2_0_extensions(ctx); _mesa_enable_2_1_extensions(ctx); - + _mesa_meta_init(ctx); /* Initialize the software rasterizer and helper modules. */ @@ -1533,16 +1533,16 @@ void WMesaDestroyContext( WMesaContext pwc ) { ReleaseDC(WindowFromDC(pwc->hDC), pwc->hDC); } - DeleteObject(pwc->clearPen); - DeleteObject(pwc->clearBrush); - + DeleteObject(pwc->clearPen); + DeleteObject(pwc->clearBrush); + _mesa_meta_free(ctx); _swsetup_DestroyContext(ctx); _tnl_DestroyContext(ctx); _vbo_DestroyContext(ctx); _swrast_DestroyContext(ctx); - + _mesa_free_context_data(ctx); free(pwc); } @@ -1559,7 +1559,7 @@ wmesa_new_renderbuffer(void) return NULL; _mesa_init_renderbuffer(rb, (GLuint)0); - + rb->_BaseFormat = GL_RGBA; rb->InternalFormat = GL_RGBA; rb->DataType = CHAN_TYPE; @@ -1591,8 +1591,8 @@ void WMesaMakeCurrent(WMesaContext c, HDC hdc) get_window_size(hdc, &width, &height); - c->clearPen = CreatePen(PS_SOLID, 1, 0); - c->clearBrush = CreateSolidBrush(0); + c->clearPen = CreatePen(PS_SOLID, 1, 0); + c->clearBrush = CreateSolidBrush(0); pwfb = wmesa_new_framebuffer(hdc, visual); @@ -1600,7 +1600,7 @@ void WMesaMakeCurrent(WMesaContext c, HDC hdc) if (visual->doubleBufferMode == 1) { wmCreateBackingStore(pwfb, width, height); } - + /* make render buffers */ if (visual->doubleBufferMode == 1) { rb = wmesa_new_renderbuffer(); @@ -1617,7 +1617,7 @@ void WMesaMakeCurrent(WMesaContext c, HDC hdc) visual->depthBits > 0, visual->stencilBits > 0, visual->accumRedBits > 0, - visual->alphaBits >0, + visual->alphaBits >0, GL_FALSE); } @@ -1656,6 +1656,6 @@ void WMesaSwapBuffers( HDC hdc ) void WMesaShareLists(WMesaContext ctx_to_share, WMesaContext ctx) { - _mesa_share_state(&ctx->gl_ctx, &ctx_to_share->gl_ctx); + _mesa_share_state(&ctx->gl_ctx, &ctx_to_share->gl_ctx); } diff --git a/src/mesa/drivers/windows/gldirect/dglcontext.c b/src/mesa/drivers/windows/gldirect/dglcontext.c index 10ea057..f9b09b8 100644 --- a/src/mesa/drivers/windows/gldirect/dglcontext.c +++ b/src/mesa/drivers/windows/gldirect/dglcontext.c @@ -823,13 +823,13 @@ BOOL dglCreateContextBuffers( // Test for Fullscreen if (bHaveWin95) { // Problems with fullscreen on Win2K/XP - if ((GetSystemMetrics(SM_CXSCREEN) == lpCtx->dwWidth) && + if ((GetSystemMetrics(SM_CXSCREEN) == lpCtx->dwWidth) && (GetSystemMetrics(SM_CYSCREEN) == lpCtx->dwHeight)) { // Workaround for some apps that crash when going fullscreen. //lpCtx->bFullscreen = TRUE; } - + } #ifdef _USE_GLD3_WGL @@ -1456,7 +1456,7 @@ BOOL dglCreateContextBuffers( _swsetup_CreateContext( lpCtx->glCtx ); _gldDriver.InitialiseMesa(lpCtx); - + lpCtx->glCtx->imports.warning = _gld_mesa_warning; lpCtx->glCtx->imports.fatal = _gld_mesa_fatal; diff --git a/src/mesa/drivers/windows/gldirect/dglglobals.h b/src/mesa/drivers/windows/gldirect/dglglobals.h index 995f1cd..9d82904 100644 --- a/src/mesa/drivers/windows/gldirect/dglglobals.h +++ b/src/mesa/drivers/windows/gldirect/dglglobals.h @@ -81,7 +81,7 @@ typedef struct { BOOL bPrimary; // Is ddraw device the Primary device? BOOL bHardware; // Is the d3d driver a Hardware driver? #ifndef _USE_GLD3_WGL - GUID ddGuid; // GUID of the ddraw device + GUID ddGuid; // GUID of the ddraw device GUID d3dGuid; // GUID of the direct3d driver #endif // _USE_GLD3_WGL // BOOL bFullscreen; // Force fullscreen - only useful for primary adaptors. diff --git a/src/mesa/drivers/windows/gldirect/dglpf.c b/src/mesa/drivers/windows/gldirect/dglpf.c index 4cd4d03..36b1d7f 100644 --- a/src/mesa/drivers/windows/gldirect/dglpf.c +++ b/src/mesa/drivers/windows/gldirect/dglpf.c @@ -301,7 +301,7 @@ void dglBuildPixelFormatList() hRes = DirectDrawCreate(NULL, &lpDD1, NULL); else hRes = DirectDrawCreate(&glb.ddGuid, &lpDD1, NULL); - + if (FAILED(hRes)) { ddlogError(DDLOG_ERROR, "dglBPFL: DirectDrawCreate failed", hRes); return; @@ -501,7 +501,7 @@ void dglBuildPixelFormatList() strcat(buf, cat); /* should find transparent pixel from LAYERPLANEDESCRIPTOR */ - sprintf(cat, " . "); + sprintf(cat, " . "); strcat(buf, cat); sprintf(cat, "%2d ", lpPF->pfd.cColorBits); @@ -509,7 +509,7 @@ void dglBuildPixelFormatList() /* bReserved field indicates number of over/underlays */ if(lpPF->pfd.bReserved) sprintf(cat, " %d ", lpPF->pfd.bReserved); - else sprintf(cat, " . "); + else sprintf(cat, " . "); strcat(buf, cat); sprintf(cat, " %c ", lpPF->pfd.iPixelType == PFD_TYPE_RGBA ? 'r' : 'c'); @@ -521,38 +521,38 @@ void dglBuildPixelFormatList() sprintf(cat, " %c ", lpPF->pfd.dwFlags & PFD_STEREO ? 'y' : '.'); strcat(buf, cat); - if(lpPF->pfd.cRedBits && lpPF->pfd.iPixelType == PFD_TYPE_RGBA) + if(lpPF->pfd.cRedBits && lpPF->pfd.iPixelType == PFD_TYPE_RGBA) sprintf(cat, "%2d ", lpPF->pfd.cRedBits); else sprintf(cat, " . "); strcat(buf, cat); - if(lpPF->pfd.cGreenBits && lpPF->pfd.iPixelType == PFD_TYPE_RGBA) + if(lpPF->pfd.cGreenBits && lpPF->pfd.iPixelType == PFD_TYPE_RGBA) sprintf(cat, "%2d ", lpPF->pfd.cGreenBits); else sprintf(cat, " . "); strcat(buf, cat); - if(lpPF->pfd.cBlueBits && lpPF->pfd.iPixelType == PFD_TYPE_RGBA) + if(lpPF->pfd.cBlueBits && lpPF->pfd.iPixelType == PFD_TYPE_RGBA) sprintf(cat, "%2d ", lpPF->pfd.cBlueBits); else sprintf(cat, " . "); strcat(buf, cat); - - if(lpPF->pfd.cAlphaBits && lpPF->pfd.iPixelType == PFD_TYPE_RGBA) + + if(lpPF->pfd.cAlphaBits && lpPF->pfd.iPixelType == PFD_TYPE_RGBA) sprintf(cat, "%2d ", lpPF->pfd.cAlphaBits); else sprintf(cat, " . "); strcat(buf, cat); - + if(lpPF->pfd.cAuxBuffers) sprintf(cat, "%2d ", lpPF->pfd.cAuxBuffers); else sprintf(cat, " . "); strcat(buf, cat); - + if(lpPF->pfd.cDepthBits) sprintf(cat, "%2d ", lpPF->pfd.cDepthBits); else sprintf(cat, " . "); strcat(buf, cat); - + if(lpPF->pfd.cStencilBits) sprintf(cat, "%2d ", lpPF->pfd.cStencilBits); else sprintf(cat, " . "); strcat(buf, cat); - + if(lpPF->pfd.cAccumRedBits) sprintf(cat, "%2d ", lpPF->pfd.cAccumRedBits); else sprintf(cat, " . "); strcat(buf, cat); @@ -560,15 +560,15 @@ void dglBuildPixelFormatList() if(lpPF->pfd.cAccumGreenBits) sprintf(cat, "%2d ", lpPF->pfd.cAccumGreenBits); else sprintf(cat, " . "); strcat(buf, cat); - + if(lpPF->pfd.cAccumBlueBits) sprintf(cat, "%2d ", lpPF->pfd.cAccumBlueBits); else sprintf(cat, " . "); strcat(buf, cat); - + if(lpPF->pfd.cAccumAlphaBits) sprintf(cat, "%2d ", lpPF->pfd.cAccumAlphaBits); else sprintf(cat, " . "); strcat(buf, cat); - + /* no multisample in Win32 */ sprintf(cat, " . .\n"); strcat(buf, cat); diff --git a/src/mesa/drivers/windows/gldirect/dglwgl.c b/src/mesa/drivers/windows/gldirect/dglwgl.c index c46cfe1..258e8bd 100644 --- a/src/mesa/drivers/windows/gldirect/dglwgl.c +++ b/src/mesa/drivers/windows/gldirect/dglwgl.c @@ -298,7 +298,7 @@ int APIENTRY _GLD_WGL_EXPORT(ChoosePixelFormat)( char buf[128]; char cat[8]; - DWORD dwAllFlags = + DWORD dwAllFlags = PFD_DRAW_TO_WINDOW | PFD_DRAW_TO_BITMAP | PFD_SUPPORT_GDI | @@ -345,7 +345,7 @@ int APIENTRY _GLD_WGL_EXPORT(ChoosePixelFormat)( strcat(buf, cat); /* should find transparent pixel from LAYERPLANEDESCRIPTOR */ - sprintf(cat, " . "); + sprintf(cat, " . "); strcat(buf, cat); sprintf(cat, "%2d ", ppfd->cColorBits); @@ -353,7 +353,7 @@ int APIENTRY _GLD_WGL_EXPORT(ChoosePixelFormat)( /* bReserved field indicates number of over/underlays */ if(ppfd->bReserved) sprintf(cat, " %d ", ppfd->bReserved); - else sprintf(cat, " . "); + else sprintf(cat, " . "); strcat(buf, cat); sprintf(cat, " %c ", ppfd->iPixelType == PFD_TYPE_RGBA ? 'r' : 'c'); @@ -365,38 +365,38 @@ int APIENTRY _GLD_WGL_EXPORT(ChoosePixelFormat)( sprintf(cat, " %c ", ppfd->dwFlags & PFD_STEREO ? 'y' : '.'); strcat(buf, cat); - if(ppfd->cRedBits && ppfd->iPixelType == PFD_TYPE_RGBA) + if(ppfd->cRedBits && ppfd->iPixelType == PFD_TYPE_RGBA) sprintf(cat, "%2d ", ppfd->cRedBits); else sprintf(cat, " . "); strcat(buf, cat); - if(ppfd->cGreenBits && ppfd->iPixelType == PFD_TYPE_RGBA) + if(ppfd->cGreenBits && ppfd->iPixelType == PFD_TYPE_RGBA) sprintf(cat, "%2d ", ppfd->cGreenBits); else sprintf(cat, " . "); strcat(buf, cat); - if(ppfd->cBlueBits && ppfd->iPixelType == PFD_TYPE_RGBA) + if(ppfd->cBlueBits && ppfd->iPixelType == PFD_TYPE_RGBA) sprintf(cat, "%2d ", ppfd->cBlueBits); else sprintf(cat, " . "); strcat(buf, cat); - - if(ppfd->cAlphaBits && ppfd->iPixelType == PFD_TYPE_RGBA) + + if(ppfd->cAlphaBits && ppfd->iPixelType == PFD_TYPE_RGBA) sprintf(cat, "%2d ", ppfd->cAlphaBits); else sprintf(cat, " . "); strcat(buf, cat); - + if(ppfd->cAuxBuffers) sprintf(cat, "%2d ", ppfd->cAuxBuffers); else sprintf(cat, " . "); strcat(buf, cat); - + if(ppfd->cDepthBits) sprintf(cat, "%2d ", ppfd->cDepthBits); else sprintf(cat, " . "); strcat(buf, cat); - + if(ppfd->cStencilBits) sprintf(cat, "%2d ", ppfd->cStencilBits); else sprintf(cat, " . "); strcat(buf, cat); - + if(ppfd->cAccumRedBits) sprintf(cat, "%2d ", ppfd->cAccumRedBits); else sprintf(cat, " . "); strcat(buf, cat); @@ -404,15 +404,15 @@ int APIENTRY _GLD_WGL_EXPORT(ChoosePixelFormat)( if(ppfd->cAccumGreenBits) sprintf(cat, "%2d ", ppfd->cAccumGreenBits); else sprintf(cat, " . "); strcat(buf, cat); - + if(ppfd->cAccumBlueBits) sprintf(cat, "%2d ", ppfd->cAccumBlueBits); else sprintf(cat, " . "); strcat(buf, cat); - + if(ppfd->cAccumAlphaBits) sprintf(cat, "%2d ", ppfd->cAccumAlphaBits); else sprintf(cat, " . "); strcat(buf, cat); - + /* no multisample in Win32 */ sprintf(cat, " . .\n"); strcat(buf, cat); @@ -435,7 +435,7 @@ int APIENTRY _GLD_WGL_EXPORT(ChoosePixelFormat)( // Mask illegal flags and continue dwFlags = dwFlags & dwAllFlags; } - + switch (ppfd->iPixelType) { case PFD_TYPE_RGBA: case PFD_TYPE_COLORINDEX: @@ -445,7 +445,7 @@ int APIENTRY _GLD_WGL_EXPORT(ChoosePixelFormat)( ddlogMessage(DDLOG_WARN, "ChoosePixelFormat: bad pixel type\n"); return 0; } - + switch (ppfd->iLayerType) { case PFD_MAIN_PLANE: case PFD_OVERLAY_PLANE: @@ -456,15 +456,15 @@ int APIENTRY _GLD_WGL_EXPORT(ChoosePixelFormat)( ddlogMessage(DDLOG_WARN, "ChoosePixelFormat: bad layer type\n"); return 0; } - + numPixelFormats = glb.nPixelFormatCount; - + /* loop through candidate pixel format descriptors */ for (i=0; iiLayerType != ppfdCandidate.iLayerType) { continue; } - + if (((dwFlags ^ ppfdCandidate.dwFlags) & dwFlags) & (PFD_DRAW_TO_WINDOW | PFD_DRAW_TO_BITMAP | PFD_SUPPORT_GDI | PFD_SUPPORT_OPENGL)) { continue; } - + if (!(dwFlags & PFD_DOUBLEBUFFER_DONTCARE)) { if ((dwFlags & PFD_DOUBLEBUFFER) != (ppfdCandidate.dwFlags & PFD_DOUBLEBUFFER)) @@ -490,7 +490,7 @@ int APIENTRY _GLD_WGL_EXPORT(ChoosePixelFormat)( continue; } } - + // if (!(dwFlags & PFD_STEREO_DONTCARE)) { if ((dwFlags & PFD_STEREO) != (ppfdCandidate.dwFlags & PFD_STEREO)) @@ -498,21 +498,21 @@ int APIENTRY _GLD_WGL_EXPORT(ChoosePixelFormat)( continue; } // } - + if (ppfd->iPixelType==PFD_TYPE_RGBA && ppfd->cAlphaBits && !ppfdCandidate.cAlphaBits) { continue; } - + if (ppfd->iPixelType==PFD_TYPE_RGBA && ppfd->cAccumBits && !ppfdCandidate.cAccumBits) { continue; } - + if (ppfd->cDepthBits && !ppfdCandidate.cDepthBits) { continue; } - + if (ppfd->cStencilBits && !ppfdCandidate.cStencilBits) { continue; } @@ -520,7 +520,7 @@ int APIENTRY _GLD_WGL_EXPORT(ChoosePixelFormat)( if (ppfd->cAuxBuffers && !ppfdCandidate.cAuxBuffers) { continue; } - + /* ** See if candidate is better than the previous best choice */ @@ -529,7 +529,7 @@ int APIENTRY _GLD_WGL_EXPORT(ChoosePixelFormat)( bestIndex = i; continue; } - + if ((ppfd->cColorBits > ppfdBest.cColorBits && ppfdCandidate.cColorBits > ppfdBest.cColorBits) || (ppfd->cColorBits <= ppfdCandidate.cColorBits && @@ -539,7 +539,7 @@ int APIENTRY _GLD_WGL_EXPORT(ChoosePixelFormat)( bestIndex = i; continue; } - + if (ppfd->iPixelType==PFD_TYPE_RGBA && ppfd->cAlphaBits && ppfdCandidate.cAlphaBits > ppfdBest.cAlphaBits) @@ -548,7 +548,7 @@ int APIENTRY _GLD_WGL_EXPORT(ChoosePixelFormat)( bestIndex = i; continue; } - + if (ppfd->iPixelType==PFD_TYPE_RGBA && ppfd->cAccumBits && ppfdCandidate.cAccumBits > ppfdBest.cAccumBits) @@ -557,7 +557,7 @@ int APIENTRY _GLD_WGL_EXPORT(ChoosePixelFormat)( bestIndex = i; continue; } - + if ((ppfd->cDepthBits > ppfdBest.cDepthBits && ppfdCandidate.cDepthBits > ppfdBest.cDepthBits) || (ppfd->cDepthBits <= ppfdCandidate.cDepthBits && @@ -567,7 +567,7 @@ int APIENTRY _GLD_WGL_EXPORT(ChoosePixelFormat)( bestIndex = i; continue; } - + if (ppfd->cStencilBits && ppfdCandidate.cStencilBits > ppfdBest.cStencilBits) { @@ -575,7 +575,7 @@ int APIENTRY _GLD_WGL_EXPORT(ChoosePixelFormat)( bestIndex = i; continue; } - + if (ppfd->cAuxBuffers && ppfdCandidate.cAuxBuffers > ppfdBest.cAuxBuffers) { @@ -1783,12 +1783,12 @@ void * __wglRealloc( size_t newSize) { void *newPtr = NULL; - + if (newSize != 0) { newPtr = (void *) GlobalAlloc(GPTR, newSize); if (oldPtr && newPtr) { DWORD oldSize = GlobalSize(oldPtr); - + memcpy(newPtr, oldPtr, (oldSize <= newSize ? oldSize : newSize)); GlobalFree(oldPtr); } @@ -1927,7 +1927,7 @@ BOOL APIENTRY _GLD_WGL_EXPORT(UseFontOutlinesA)( __wglFree(glyphBuf); return FALSE; /*WGL_STATUS_FAILURE*/ } - + glyphMetricsFloat->gmfBlackBoxX = (FLOAT) glyphMetrics.gmBlackBoxX * ScaleFactor; glyphMetricsFloat->gmfBlackBoxY = @@ -1940,7 +1940,7 @@ BOOL APIENTRY _GLD_WGL_EXPORT(UseFontOutlinesA)( (FLOAT) glyphMetrics.gmCellIncX * ScaleFactor; glyphMetricsFloat->gmfCellIncY = (FLOAT) glyphMetrics.gmCellIncY * ScaleFactor; - + /* * Turn the glyph into a display list: */ @@ -1984,7 +1984,7 @@ BOOL APIENTRY _GLD_WGL_EXPORT(UseFontOutlinesA)( * * Gets metrics for the current font and creates an equivalent font * scaled to the design units of the font. - * + * *****************************************************************************/ static HFONT @@ -1996,7 +1996,7 @@ CreateHighResolutionFont(HDC hDC) LOGFONT logFont; otmSize = GetOutlineTextMetrics(hDC, 0, NULL); - if (otmSize == 0) + if (otmSize == 0) return NULL; otm = (OUTLINETEXTMETRIC *) __wglMalloc(otmSize); @@ -2004,14 +2004,14 @@ CreateHighResolutionFont(HDC hDC) return NULL; otm->otmSize = otmSize; - if (GetOutlineTextMetrics(hDC, otmSize, otm) == 0) + if (GetOutlineTextMetrics(hDC, otmSize, otm) == 0) return NULL; - + fontHeight = otm->otmTextMetrics.tmHeight - otm->otmTextMetrics.tmInternalLeading; fontWidth = otm->otmTextMetrics.tmAveCharWidth; fontUnits = (LONG) otm->otmEMSquare; - + ScaleFactor = 1.0F / (FLOAT) fontUnits; logFont.lfHeight = - ((LONG) fontUnits); @@ -2045,7 +2045,7 @@ CreateHighResolutionFont(HDC hDC) /***************************************************************************** * MakeDisplayListFromGlyph - * + * * Converts the outline of a glyph to an OpenGL display list. * * Return value is nonzero for success, zero for failure. @@ -2071,7 +2071,7 @@ MakeDisplayListFromGlyph( IN DWORD listName, chordalDeviation, extrusion, format); - + _GLD_glTranslatef(glyphMetricsFloat->gmfCellIncX, glyphMetricsFloat->gmfCellIncY, 0.0F); @@ -2084,7 +2084,7 @@ MakeDisplayListFromGlyph( IN DWORD listName, /***************************************************************************** * DrawGlyph - * + * * Converts the outline of a glyph to OpenGL drawing primitives, tessellating * as needed, and then draws the glyph. Tessellation of the quadratic splines * in the outline is controlled by "chordalDeviation", and the drawing @@ -2153,7 +2153,7 @@ DrawGlyph( IN UCHAR* glyphBuf, double v[3]; FLOAT *save_p = p; GLfloat z_value; - + /* * This is the hard case. We have to set up a tessellator * to convert the outlines into a set of polygonal @@ -2183,7 +2183,7 @@ DrawGlyph( IN UCHAR* glyphBuf, for (loop = (DWORD) *p++; loop; --loop) { gluTessBeginContourProc(tess); - + for (point = (DWORD) *p++; point; --point) { v[0] = p[0]; @@ -2253,7 +2253,7 @@ DrawGlyph( IN UCHAR* glyphBuf, count = (DWORD) *p++; gluTessBeginContourProc(tess); - + for (point = 0; point < count; point++) { vert = p + ((count-point-1)<<1); @@ -2290,7 +2290,7 @@ DrawGlyph( IN UCHAR* glyphBuf, /***************************************************************************** * LoadGLUTesselator * - * Maps the glu32.dll module and gets function pointers for the + * Maps the glu32.dll module and gets function pointers for the * tesselator functions. *****************************************************************************/ @@ -2333,31 +2333,31 @@ LoadGLUTesselator(void) if ((gluNewTessProc = (gluNewTessProto) GetProcAddress(gluModuleHandle, "gluNewTess")) == NULL) return FALSE; - + if ((gluDeleteTessProc = (gluDeleteTessProto) GetProcAddress(gluModuleHandle, "gluDeleteTess")) == NULL) return FALSE; - + if ((gluTessBeginPolygonProc = (gluTessBeginPolygonProto) GetProcAddress(gluModuleHandle, "gluTessBeginPolygon")) == NULL) return FALSE; - + if ((gluTessBeginContourProc = (gluTessBeginContourProto) GetProcAddress(gluModuleHandle, "gluTessBeginContour")) == NULL) return FALSE; - + if ((gluTessVertexProc = (gluTessVertexProto) GetProcAddress(gluModuleHandle, "gluTessVertex")) == NULL) return FALSE; - + if ((gluTessEndContourProc = (gluTessEndContourProto) GetProcAddress(gluModuleHandle, "gluTessEndContour")) == NULL) return FALSE; - + if ((gluTessEndPolygonProc = (gluTessEndPolygonProto) GetProcAddress(gluModuleHandle, "gluTessEndPolygon")) == NULL) return FALSE; - + if ((gluTessPropertyProc = (gluTessPropertyProto) GetProcAddress(gluModuleHandle, "gluTessProperty")) == NULL) return FALSE; @@ -2365,7 +2365,7 @@ LoadGLUTesselator(void) if ((gluTessNormalProc = (gluTessNormalProto) GetProcAddress(gluModuleHandle, "gluTessNormal")) == NULL) return FALSE; - + if ((gluTessCallbackProc = (gluTessCallbackProto) GetProcAddress(gluModuleHandle, "gluTessCallback")) == NULL) return FALSE; @@ -2397,7 +2397,7 @@ UnloadGLUTesselator(void) * * Used by tessellator to handle output vertexes. *****************************************************************************/ - + static void CALLBACK TessVertexOut(FLOAT p[3]) { @@ -2426,7 +2426,7 @@ TessVertexOutData(FLOAT p[3], GLfloat z) * Used by tessellator to handle self-intersecting contours and degenerate * geometry. *****************************************************************************/ - + static void CALLBACK TessCombine(double coords[3], void* vertex_data[4], @@ -2447,7 +2447,7 @@ TessCombine(double coords[3], * * Saves the last tessellator error code in the global TessErrorOccurred. *****************************************************************************/ - + static void CALLBACK TessError(GLenum error) { @@ -2458,7 +2458,7 @@ TessError(GLenum error) /***************************************************************************** * MakeLinesFromGlyph - * + * * Converts the outline of a glyph from the TTPOLYGON format to a simple * array of floating-point values containing one or more loops. * @@ -2755,7 +2755,7 @@ MakeLinesFromArc( IN FLOAT x0, midPointX, midPointY, vertexCountIndex, chordalDeviationSquared); - + MakeLinesFromArc( midPointX, midPointY, x12, y12, x2, y2, @@ -2832,7 +2832,7 @@ AppendToLineBuf(FLOAT value) if (LineBufIndex >= LineBufSize) { FLOAT* f; - + f = (FLOAT*) __wglRealloc(LineBuf, (LineBufSize += LINE_BUF_QUANT) * sizeof(FLOAT)); if (!f) diff --git a/src/mesa/drivers/windows/gldirect/dglwgl.h b/src/mesa/drivers/windows/gldirect/dglwgl.h index 3e7e589..b9ee4d9 100644 --- a/src/mesa/drivers/windows/gldirect/dglwgl.h +++ b/src/mesa/drivers/windows/gldirect/dglwgl.h @@ -64,7 +64,7 @@ typedef struct { /* XXX why is this here? * It should probaby be somewhere in src/mesa/drivers/windows/ */ -#if defined(_WIN32) && !defined(_WINGDI_) && !defined(_WINGDI_H) && !defined(_GNU_H_WINDOWS32_DEFINES) && !defined(OPENSTEP) && !defined(BUILD_FOR_SNAP) +#if defined(_WIN32) && !defined(_WINGDI_) && !defined(_WINGDI_H) && !defined(_GNU_H_WINDOWS32_DEFINES) && !defined(OPENSTEP) && !defined(BUILD_FOR_SNAP) # define WGL_FONT_LINES 0 # define WGL_FONT_POLYGONS 1 #ifndef _GNU_H_WINDOWS32_FUNCTIONS diff --git a/src/mesa/drivers/windows/gldirect/dll_main.c b/src/mesa/drivers/windows/gldirect/dll_main.c index 1d7ac64..f32d8b0 100644 --- a/src/mesa/drivers/windows/gldirect/dll_main.c +++ b/src/mesa/drivers/windows/gldirect/dll_main.c @@ -390,7 +390,7 @@ BOOL dllReadRegistry( if (bRegistryError || !bSuccess) return FALSE; else - + return TRUE; #undef REG_READ_DWORD diff --git a/src/mesa/drivers/windows/gldirect/gld_dispatch.c b/src/mesa/drivers/windows/gldirect/gld_dispatch.c index e05d767..40024c5 100644 --- a/src/mesa/drivers/windows/gldirect/gld_dispatch.c +++ b/src/mesa/drivers/windows/gldirect/gld_dispatch.c @@ -49,7 +49,7 @@ #endif #if 0 -// Altered these to get the dispatch table from +// Altered these to get the dispatch table from // the current context of the calling thread. #define DISPATCH(FUNC, ARGS, MESSAGE) \ GET_CURRENT_CONTEXT(gc); \ diff --git a/src/mesa/drivers/windows/gldirect/gld_driver.c b/src/mesa/drivers/windows/gldirect/gld_driver.c index aa7bc27..fd5cf58 100644 --- a/src/mesa/drivers/windows/gldirect/gld_driver.c +++ b/src/mesa/drivers/windows/gldirect/gld_driver.c @@ -257,7 +257,7 @@ BOOL gldInitDriverPointers( _gldDriver.GetDisplayMode = gldGetDisplayMode_MesaSW; return TRUE; } - + if ((dwDriver == GLDS_DRIVER_REF) || (dwDriver == GLDS_DRIVER_HAL)) { // Direct3D driver, either HW or SW _gldDriver.CreateDrawable = gldCreateDrawable_DX; diff --git a/src/mesa/drivers/windows/icd/icd.c b/src/mesa/drivers/windows/icd/icd.c index 4bc6176..f88f0fe 100644 --- a/src/mesa/drivers/windows/icd/icd.c +++ b/src/mesa/drivers/windows/icd/icd.c @@ -156,7 +156,7 @@ WGLAPI HGLRC GLAPIENTRY DrvCreateContext(HDC hdc) if ( wgl_ctx[i].ctx == NULL ) { wgl_ctx[i].ctx = WMesaCreateContext( hWnd, NULL, GL_TRUE, - pix[curPFD-1].doubleBuffered, + pix[curPFD-1].doubleBuffered, pix[curPFD-1].pfd.cAlphaBits ? GL_TRUE : GL_FALSE); if (wgl_ctx[i].ctx == NULL) break; diff --git a/src/mesa/drivers/x11/fakeglx.c b/src/mesa/drivers/x11/fakeglx.c index 577e27d..1d91906 100644 --- a/src/mesa/drivers/x11/fakeglx.c +++ b/src/mesa/drivers/x11/fakeglx.c @@ -345,8 +345,8 @@ save_glx_visual( Display *dpy, XVisualInfo *vinfo, */ xmvis->vishandle = vinfo; /* Allocate more space for additional visual */ - VisualTable = (XMesaVisual *) _mesa_realloc( VisualTable, - sizeof(XMesaVisual) * NumVisuals, + VisualTable = (XMesaVisual *) _mesa_realloc( VisualTable, + sizeof(XMesaVisual) * NumVisuals, sizeof(XMesaVisual) * (NumVisuals + 1)); /* add xmvis to the list */ VisualTable[NumVisuals] = xmvis; @@ -1214,8 +1214,8 @@ choose_visual( Display *dpy, int screen, const int *list, GLboolean fbConfig ) stencil_size = STENCIL_BITS; if (accumRedSize > 0 || accumGreenSize > 0 || accumBlueSize > 0 || accumAlphaSize > 0) { - accumRedSize = - accumGreenSize = + accumRedSize = + accumGreenSize = accumBlueSize = default_accum_bits(); accumAlphaSize = alpha_flag ? accumRedSize : 0; } @@ -2019,7 +2019,7 @@ Fake_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 */ @@ -2868,7 +2868,7 @@ Fake_glXAllocateMemoryNV( GLsizei size, } -static void +static void Fake_glXFreeMemoryNV( GLvoid *pointer ) { (void) pointer; diff --git a/src/mesa/drivers/x11/glxapi.c b/src/mesa/drivers/x11/glxapi.c index 255a37b..0fb962d 100644 --- a/src/mesa/drivers/x11/glxapi.c +++ b/src/mesa/drivers/x11/glxapi.c @@ -1,19 +1,19 @@ /* * Mesa 3-D graphics library * Version: 7.1 - * + * * Copyright (C) 1999-2007 Brian Paul All Rights Reserved. - * + * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: - * + * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. - * + * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL @@ -152,7 +152,7 @@ get_dispatch(Display *dpy) TABLE = get_dispatch(DPY); \ } - + /** diff --git a/src/mesa/drivers/x11/glxapi.h b/src/mesa/drivers/x11/glxapi.h index 37de81e..5f7fb4d 100644 --- a/src/mesa/drivers/x11/glxapi.h +++ b/src/mesa/drivers/x11/glxapi.h @@ -1,19 +1,19 @@ /* * Mesa 3-D graphics library * Version: 6.3 - * + * * Copyright (C) 1999-2004 Brian Paul All Rights Reserved. - * + * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: - * + * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. - * + * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL diff --git a/src/mesa/drivers/x11/glxheader.h b/src/mesa/drivers/x11/glxheader.h index ee00219..f7f0e39 100644 --- a/src/mesa/drivers/x11/glxheader.h +++ b/src/mesa/drivers/x11/glxheader.h @@ -1,19 +1,19 @@ /* * Mesa 3-D graphics library * Version: 6.5.1 - * + * * Copyright (C) 1999-2006 Brian Paul All Rights Reserved. - * + * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: - * + * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. - * + * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL diff --git a/src/mesa/drivers/x11/realglx.c b/src/mesa/drivers/x11/realglx.c index 30adb74..afb171a 100644 --- a/src/mesa/drivers/x11/realglx.c +++ b/src/mesa/drivers/x11/realglx.c @@ -2,19 +2,19 @@ /* * Mesa 3-D graphics library * Version: 5.1 - * + * * Copyright (C) 1999-2002 Brian Paul All Rights Reserved. - * + * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: - * + * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. - * + * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL diff --git a/src/mesa/drivers/x11/realglx.h b/src/mesa/drivers/x11/realglx.h index 150129d..00245f2 100644 --- a/src/mesa/drivers/x11/realglx.h +++ b/src/mesa/drivers/x11/realglx.h @@ -2,19 +2,19 @@ /* * Mesa 3-D graphics library * Version: 3.5 - * + * * Copyright (C) 1999-2001 Brian Paul All Rights Reserved. - * + * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: - * + * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. - * + * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL diff --git a/src/mesa/drivers/x11/xm_api.c b/src/mesa/drivers/x11/xm_api.c index b5eabad..3e91382 100644 --- a/src/mesa/drivers/x11/xm_api.c +++ b/src/mesa/drivers/x11/xm_api.c @@ -174,7 +174,7 @@ static int host_byte_order( void ) */ static int check_for_xshm( XMesaDisplay *display ) { -#if defined(USE_XSHM) +#if defined(USE_XSHM) int major, minor, ignore; Bool pixmaps; @@ -385,7 +385,7 @@ create_xmesa_buffer(XMesaDrawable d, BufferType type, b->backxrb->Parent = b; /* determine back buffer implementation */ b->db_mode = vis->ximage_flag ? BACK_XIMAGE : BACK_PIXMAP; - + _mesa_add_renderbuffer(&b->mesa_buffer, BUFFER_BACK_LEFT, &b->backxrb->Base); } @@ -1181,12 +1181,12 @@ xmesa_color_to_pixel(struct gl_context *ctx, /** * 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. @@ -1848,7 +1848,7 @@ void XMesaSwapBuffers( XMesaBuffer b ) #endif if (b->backxrb->ximage) { /* Copy Ximage (back buf) from client memory to server window */ -#if defined(USE_XSHM) +#if defined(USE_XSHM) if (b->shm) { /*_glthread_LOCK_MUTEX(_xmesa_lock);*/ XShmPutImage( b->xm_visual->display, b->frontxrb->drawable, @@ -1905,7 +1905,7 @@ void XMesaCopySubBuffer( XMesaBuffer b, int x, int y, int width, int height ) if (!b->backxrb) { /* single buffered */ - return; + return; } if (b->db_mode) { @@ -1916,7 +1916,7 @@ void XMesaCopySubBuffer( XMesaBuffer b, int x, int y, int width, int height ) #endif if (b->backxrb->ximage) { /* Copy Ximage from host's memory to server's window */ -#if defined(USE_XSHM) +#if defined(USE_XSHM) if (b->shm) { /* XXX assuming width and height aren't too large! */ XShmPutImage( b->xm_visual->display, b->frontxrb->drawable, diff --git a/src/mesa/drivers/x11/xm_buffer.c b/src/mesa/drivers/x11/xm_buffer.c index 10829b4..a1fc7d7 100644 --- a/src/mesa/drivers/x11/xm_buffer.c +++ b/src/mesa/drivers/x11/xm_buffer.c @@ -37,7 +37,7 @@ #include "main/renderbuffer.h" -#if defined(USE_XSHM) +#if defined(USE_XSHM) static volatile int mesaXErrorFlag = 0; /** @@ -170,7 +170,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); @@ -369,7 +369,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 ); diff --git a/src/mesa/drivers/x11/xm_dd.c b/src/mesa/drivers/x11/xm_dd.c index b8d9e20..198bdb8 100644 --- a/src/mesa/drivers/x11/xm_dd.c +++ b/src/mesa/drivers/x11/xm_dd.c @@ -404,7 +404,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) { @@ -538,7 +538,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) { @@ -578,7 +578,7 @@ xmesa_DrawPixels_5R6G5B( struct gl_context *ctx, if (swrast->NewState) _swrast_validate_derived( ctx ); - + if (unpack->BufferObj->Name) { /* unpack from PBO */ GLubyte *buf; diff --git a/src/mesa/drivers/x11/xm_glide.c b/src/mesa/drivers/x11/xm_glide.c index d8a0e6d..7b3a182 100644 --- a/src/mesa/drivers/x11/xm_glide.c +++ b/src/mesa/drivers/x11/xm_glide.c @@ -241,7 +241,7 @@ GLboolean XMesaSetFXmode( GLint mode ) return GL_FALSE; } if (ctx) { - /* [dBorca] Hack alert: + /* [dBorca] Hack alert: * oh, this is sooo wrong: ctx above is * really an fxMesaContext, not an XMesaContext */ diff --git a/src/mesa/drivers/x11/xm_span.c b/src/mesa/drivers/x11/xm_span.c index 294b93a..581f525 100644 --- a/src/mesa/drivers/x11/xm_span.c +++ b/src/mesa/drivers/x11/xm_span.c @@ -2847,7 +2847,7 @@ static void put_mono_row_pixmap( PUT_MONO_ROW_ARGS ) y = YFLIP(xrb, y); /* New code contributed by Jeff Epler and cleaned up by Keith - * Whitwell. + * Whitwell. */ for (i = 0; i < n; ) { GLuint start = i; @@ -2857,7 +2857,7 @@ static void put_mono_row_pixmap( PUT_MONO_ROW_ARGS ) while (i < n && (!mask || mask[i])) i++; - if (start < i) + if (start < i) XMesaFillRectangle( dpy, buffer, gc, (int)(x+start), (int) y, (int)(i-start), 1); @@ -2886,15 +2886,15 @@ put_mono_row_ci_pixmap( PUT_MONO_ROW_ARGS ) for (i = 0 ; i < n ;) { GLuint start = i; - - /* Identify and emit contiguous rendered pixels + + /* Identify and emit contiguous rendered pixels */ while (i < n && (!mask || mask[i])) i++; - if (start < i) - XMesaFillRectangle( dpy, buffer, gc, - (int)(x+start), (int) y, + if (start < i) + XMesaFillRectangle( dpy, buffer, gc, + (int)(x+start), (int) y, (int)(i-start), 1); /* Eat up non-rendered pixels diff --git a/src/mesa/drivers/x11/xm_tri.c b/src/mesa/drivers/x11/xm_tri.c index 98dece1..de28d10 100644 --- a/src/mesa/drivers/x11/xm_tri.c +++ b/src/mesa/drivers/x11/xm_tri.c @@ -1473,7 +1473,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; if (xmbuf->swAlpha) diff --git a/src/mesa/drivers/x11/xmesa.h b/src/mesa/drivers/x11/xmesa.h index 98737fa..018ad76 100644 --- a/src/mesa/drivers/x11/xmesa.h +++ b/src/mesa/drivers/x11/xmesa.h @@ -1,19 +1,19 @@ /* * Mesa 3-D graphics library * Version: 7.1 - * + * * Copyright (C) 1999-2007 Brian Paul All Rights Reserved. - * + * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: - * + * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. - * + * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL diff --git a/src/mesa/drivers/x11/xmesaP.h b/src/mesa/drivers/x11/xmesaP.h index 63e3e21..52a3e27 100644 --- a/src/mesa/drivers/x11/xmesaP.h +++ b/src/mesa/drivers/x11/xmesaP.h @@ -225,7 +225,7 @@ struct xmesa_buffer { /* 0 = not available */ /* 1 = XImage support available */ /* 2 = Pixmap support available too */ -#if defined(USE_XSHM) +#if defined(USE_XSHM) XShmSegmentInfo shminfo; #endif diff --git a/src/mesa/main/accum.c b/src/mesa/main/accum.c index 9026110..ae29ab3 100644 --- a/src/mesa/main/accum.c +++ b/src/mesa/main/accum.c @@ -114,7 +114,7 @@ _mesa_init_accum_dispatch(struct _glapi_table *disp) #endif /* FEATURE_accum */ -void +void _mesa_init_accum( struct gl_context *ctx ) { /* Accumulate buffer group */ diff --git a/src/mesa/main/accum.h b/src/mesa/main/accum.h index 9344244..1dd512f 100644 --- a/src/mesa/main/accum.h +++ b/src/mesa/main/accum.h @@ -1,7 +1,7 @@ /** * \file accum.h * Accumulation buffer operations. - * + * * \if subset * (No-op) * diff --git a/src/mesa/main/api_arrayelt.c b/src/mesa/main/api_arrayelt.c index c22e18c..e64ab3f 100644 --- a/src/mesa/main/api_arrayelt.c +++ b/src/mesa/main/api_arrayelt.c @@ -1525,7 +1525,7 @@ static void _ae_update_state( struct gl_context *ctx ) } } - /* generic vertex attribute arrays */ + /* generic vertex attribute arrays */ for (i = 1; i < Elements(arrayObj->VertexAttrib); i++) { /* skip zero! */ struct gl_client_array *attribArray = &arrayObj->VertexAttrib[i]; if (attribArray->Enabled) { @@ -1592,7 +1592,7 @@ void _ae_map_vbos( struct gl_context *ctx ) { AEcontext *actx = AE_CONTEXT(ctx); GLuint i; - + if (actx->mapped_vbos) return; @@ -1653,7 +1653,7 @@ void GLAPIENTRY _ae_ArrayElement( GLint elt ) if (do_map) _ae_map_vbos(ctx); - + /* emit generic attribute elements */ for (at = actx->attribs; at->func; at++) { const GLubyte *src @@ -1667,7 +1667,7 @@ void GLAPIENTRY _ae_ArrayElement( GLint elt ) const GLubyte *src = ADD_POINTERS(aa->array->BufferObj->Pointer, aa->array->Ptr) + elt * aa->array->StrideB; - CALL_by_offset( disp, (array_func), aa->offset, + CALL_by_offset( disp, (array_func), aa->offset, ((const void *) src) ); } @@ -1680,12 +1680,12 @@ void _ae_invalidate_state( struct gl_context *ctx, GLuint new_state ) { AEcontext *actx = AE_CONTEXT(ctx); - + /* Only interested in this subset of mesa state. Need to prune * this down as both tnl/ and the drivers can raise statechanges * for arcane reasons in the middle of seemingly atomic operations * like DrawElements, over which we'd like to keep a known set of - * arrays and vbo's mapped. + * arrays and vbo's mapped. * * Luckily, neither the drivers nor tnl muck with the state that * concerns us here: diff --git a/src/mesa/main/api_loopback.c b/src/mesa/main/api_loopback.c index c438307..67d69c3 100644 --- a/src/mesa/main/api_loopback.c +++ b/src/mesa/main/api_loopback.c @@ -776,14 +776,14 @@ loopback_MultiTexCoord3svARB(GLenum target, const GLshort *v) static void GLAPIENTRY loopback_MultiTexCoord4dARB(GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q) { - MULTI_TEXCOORD4( target, (GLfloat) s, (GLfloat) t, + MULTI_TEXCOORD4( target, (GLfloat) s, (GLfloat) t, (GLfloat) r, (GLfloat) q ); } static void GLAPIENTRY loopback_MultiTexCoord4dvARB(GLenum target, const GLdouble *v) { - MULTI_TEXCOORD4( target, (GLfloat) v[0], (GLfloat) v[1], + MULTI_TEXCOORD4( target, (GLfloat) v[0], (GLfloat) v[1], (GLfloat) v[2], (GLfloat) v[3] ); } @@ -1146,7 +1146,7 @@ loopback_VertexAttrib3dvNV(GLuint index, const GLdouble *v) static void GLAPIENTRY loopback_VertexAttrib4svNV(GLuint index, const GLshort *v) { - ATTRIB4NV(index, (GLfloat) v[0], (GLfloat) v[1], (GLfloat) v[2], + ATTRIB4NV(index, (GLfloat) v[0], (GLfloat) v[1], (GLfloat) v[2], (GLfloat)v[3]); } @@ -1362,7 +1362,7 @@ loopback_VertexAttrib3dvARB(GLuint index, const GLdouble *v) static void GLAPIENTRY loopback_VertexAttrib4svARB(GLuint index, const GLshort *v) { - ATTRIB4ARB(index, (GLfloat) v[0], (GLfloat) v[1], (GLfloat) v[2], + ATTRIB4ARB(index, (GLfloat) v[0], (GLfloat) v[1], (GLfloat) v[2], (GLfloat)v[3]); } @@ -1547,7 +1547,7 @@ _mesa_loopback_init_api_table( struct _glapi_table *dest ) SET_SecondaryColor3uivEXT(dest, loopback_SecondaryColor3uivEXT_f); SET_SecondaryColor3usvEXT(dest, loopback_SecondaryColor3usvEXT_f); SET_SecondaryColor3ubvEXT(dest, loopback_SecondaryColor3ubvEXT_f); - + SET_EdgeFlagv(dest, loopback_EdgeFlagv); SET_Indexd(dest, loopback_Indexd); diff --git a/src/mesa/main/api_noop.c b/src/mesa/main/api_noop.c index 08b4b4a..66f8545 100644 --- a/src/mesa/main/api_noop.c +++ b/src/mesa/main/api_noop.c @@ -584,9 +584,9 @@ _mesa_noop_Materialfv( GLenum face, GLenum pname, const GLfloat *params ) default: nr = 4 ; break; } - for (i = 0 ; i < MAT_ATTRIB_MAX ; i++) + for (i = 0 ; i < MAT_ATTRIB_MAX ; i++) if (bitmask & (1<Attrib[i], nr, params ); + COPY_SZ_4V( mat->Attrib[i], nr, params ); _mesa_update_material( ctx, bitmask ); } @@ -905,7 +905,7 @@ _mesa_noop_EvalMesh1( GLenum mode, GLint i1, GLint i2 ) /* No effect if vertex maps disabled. */ - if (!ctx->Eval.Map1Vertex4 && + if (!ctx->Eval.Map1Vertex4 && !ctx->Eval.Map1Vertex3 && !(ctx->VertexProgram._Enabled && ctx->Eval.Map1Attrib[VERT_ATTRIB_POS])) return; @@ -941,7 +941,7 @@ _mesa_noop_EvalMesh2( GLenum mode, GLint i1, GLint i2, GLint j1, GLint j2 ) /* No effect if vertex maps disabled. */ - if (!ctx->Eval.Map2Vertex4 && + if (!ctx->Eval.Map2Vertex4 && !ctx->Eval.Map2Vertex3 && !(ctx->VertexProgram._Enabled && ctx->Eval.Map2Attrib[VERT_ATTRIB_POS])) return; @@ -997,7 +997,7 @@ _mesa_noop_EvalMesh2( GLenum mode, GLint i1, GLint i2, GLint j1, GLint j2 ) /** * Build a vertexformat of functions to use outside begin/end pairs. - * + * * TODO -- build a whole dispatch table for this purpose, and likewise * for inside begin/end. */ diff --git a/src/mesa/main/arbprogram.c b/src/mesa/main/arbprogram.c index 26d7819..f15fd03 100644 --- a/src/mesa/main/arbprogram.c +++ b/src/mesa/main/arbprogram.c @@ -160,7 +160,7 @@ _mesa_BindProgram(GLenum target, GLuint id) * \note Not compiled into display lists. * \note Called by both glDeleteProgramsNV and glDeleteProgramsARB. */ -void GLAPIENTRY +void GLAPIENTRY _mesa_DeletePrograms(GLsizei n, const GLuint *ids) { GLint i; @@ -255,7 +255,7 @@ _mesa_GenPrograms(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); @@ -352,7 +352,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); } @@ -367,8 +367,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]); } @@ -509,7 +509,7 @@ _mesa_GetProgramEnvParameterdvARB(GLenum target, GLuint index, void GLAPIENTRY -_mesa_GetProgramEnvParameterfvARB(GLenum target, GLuint index, +_mesa_GetProgramEnvParameterfvARB(GLenum target, GLuint index, GLfloat *params) { GET_CURRENT_CONTEXT(ctx); @@ -642,7 +642,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); } diff --git a/src/mesa/main/arbprogram.h b/src/mesa/main/arbprogram.h index e2e535e..b371e0f 100644 --- a/src/mesa/main/arbprogram.h +++ b/src/mesa/main/arbprogram.h @@ -106,7 +106,7 @@ _mesa_GetProgramEnvParameterdvARB(GLenum target, GLuint index, extern void GLAPIENTRY -_mesa_GetProgramEnvParameterfvARB(GLenum target, GLuint index, +_mesa_GetProgramEnvParameterfvARB(GLenum target, GLuint index, GLfloat *params); @@ -116,7 +116,7 @@ _mesa_GetProgramLocalParameterdvARB(GLenum target, GLuint index, extern void GLAPIENTRY -_mesa_GetProgramLocalParameterfvARB(GLenum target, GLuint index, +_mesa_GetProgramLocalParameterfvARB(GLenum target, GLuint index, GLfloat *params); diff --git a/src/mesa/main/arrayobj.c b/src/mesa/main/arrayobj.c index df7d183..b51d65b 100644 --- a/src/mesa/main/arrayobj.c +++ b/src/mesa/main/arrayobj.c @@ -53,7 +53,7 @@ /** * Look up the array object for the given ID. - * + * * \returns * Either a pointer to the array object with the specified ID or \c NULL for * a non-existent ID. The spec defines ID 0 as being technically @@ -104,7 +104,7 @@ unbind_array_object_vbos(struct gl_context *ctx, struct gl_array_object *obj) /** * Allocate and initialize a new vertex array object. - * + * * This function is intended to be called via * \c dd_function_table::NewArrayObject. */ @@ -120,7 +120,7 @@ _mesa_new_array_object( struct gl_context *ctx, GLuint name ) /** * Delete an array object. - * + * * This function is intended to be called via * \c dd_function_table::DeleteArrayObject. */ @@ -445,7 +445,7 @@ _mesa_BindVertexArrayAPPLE( GLuint id ) /** * Delete a set of array objects. - * + * * \param n Number of array objects to delete. * \param ids Array of \c n array object IDs. */ @@ -478,7 +478,7 @@ _mesa_DeleteVertexArraysAPPLE(GLsizei n, const GLuint *ids) /* The ID is immediately freed for re-use */ remove_array_object(ctx, obj); - /* Unreference the array object. + /* Unreference the array object. * If refcount hits zero, the object will be deleted. */ _mesa_reference_array_object(ctx, &obj, NULL); @@ -494,7 +494,7 @@ _mesa_DeleteVertexArraysAPPLE(GLsizei n, const GLuint *ids) * \param arrays Array of \c n locations to store the IDs. * \param vboOnly Will arrays have to reside in VBOs? */ -static void +static void gen_vertex_arrays(struct gl_context *ctx, GLsizei n, GLuint *arrays, GLboolean vboOnly) { GLuint first; @@ -555,9 +555,9 @@ _mesa_GenVertexArraysAPPLE(GLsizei n, GLuint *arrays) /** * Determine if ID is the name of an array object. - * + * * \param id ID of the potential array object. - * \return \c GL_TRUE if \c id is the name of a array object, + * \return \c GL_TRUE if \c id is the name of a array object, * \c GL_FALSE otherwise. */ GLboolean GLAPIENTRY diff --git a/src/mesa/main/atifragshader.c b/src/mesa/main/atifragshader.c index ae2feb3..0827102 100644 --- a/src/mesa/main/atifragshader.c +++ b/src/mesa/main/atifragshader.c @@ -143,7 +143,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, @@ -155,14 +155,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_lookup_enum_by_nr(op), _mesa_lookup_enum_by_nr(dst)); if (!optype) fprintf(stderr, ", %d", dstMask); - + fprintf(stderr, ", %s", create_dst_mod_str(dstMod)); - + fprintf(stderr, ", %s, %s, %d", _mesa_lookup_enum_by_nr(arg1), _mesa_lookup_enum_by_nr(arg1Rep), arg1Mod); if (arg_count>1) diff --git a/src/mesa/main/attrib.c b/src/mesa/main/attrib.c index fb6fbe5..7fd4758 100644 --- a/src/mesa/main/attrib.c +++ b/src/mesa/main/attrib.c @@ -903,7 +903,7 @@ _mesa_PopAttrib(void) else { GLuint i; for (i = 0; i < ctx->Const.MaxDrawBuffers; i++) { - _mesa_ColorMaskIndexed(i, + _mesa_ColorMaskIndexed(i, (GLboolean) (color->ColorMask[i][0] != 0), (GLboolean) (color->ColorMask[i][1] != 0), (GLboolean) (color->ColorMask[i][2] != 0), @@ -1045,7 +1045,7 @@ _mesa_PopAttrib(void) /* per-light state */ if (_math_matrix_is_dirty(ctx->ModelviewMatrixStack.Top)) _math_matrix_analyse( ctx->ModelviewMatrixStack.Top ); - + for (i = 0; i < ctx->Const.MaxLights; i++) { const struct gl_light *l = &light->Light[i]; _mesa_set_enable(ctx, GL_LIGHT0 + i, l->Enabled); @@ -1447,7 +1447,7 @@ _mesa_PopClientAttrib(void) (struct gl_array_attrib *) node->data; adjust_buffer_object_ref_counts(ctx->Array.ArrayObj, -1); - + ctx->Array.ActiveTexture = data->ActiveTexture; if (data->LockCount != 0) _mesa_LockArraysEXT(data->LockFirst, data->LockCount); @@ -1455,7 +1455,7 @@ _mesa_PopClientAttrib(void) _mesa_UnlockArraysEXT(); _mesa_BindVertexArrayAPPLE( data->ArrayObj->Name ); - + #if FEATURE_ARB_vertex_buffer_object _mesa_BindBufferARB(GL_ARRAY_BUFFER_ARB, data->ArrayBufferObj->Name); @@ -1467,7 +1467,7 @@ _mesa_PopClientAttrib(void) sizeof( struct gl_array_object ) ); FREE( data->ArrayObj ); - + /* FIXME: Should some bits in ctx->Array->NewState also be set * FIXME: here? It seems like it should be set to inclusive-or * FIXME: of the old ArrayObj->_Enabled and the new _Enabled. diff --git a/src/mesa/main/attrib.h b/src/mesa/main/attrib.h index d59d31b..afb4d2c 100644 --- a/src/mesa/main/attrib.h +++ b/src/mesa/main/attrib.h @@ -71,10 +71,10 @@ _mesa_init_attrib_dispatch(struct _glapi_table *disp) #endif /* FEATURE_attrib_stack */ -extern void +extern void _mesa_init_attrib( struct gl_context *ctx ); -extern void +extern void _mesa_free_attrib_data( struct gl_context *ctx ); #endif /* ATTRIB_H */ diff --git a/src/mesa/main/bitset.h b/src/mesa/main/bitset.h index 9f48b3c..b1ab6af 100644 --- a/src/mesa/main/bitset.h +++ b/src/mesa/main/bitset.h @@ -99,7 +99,7 @@ __bitset_ffs(const BITSET_WORD *x, int n) /**************************************************************************** * 64-bit bitset implementation */ - + #define BITSET64_WORD GLuint #define BITSET64_WORDBITS (sizeof (BITSET64_WORD) * 8) diff --git a/src/mesa/main/blend.c b/src/mesa/main/blend.c index ec778b7..d65c5ec 100644 --- a/src/mesa/main/blend.c +++ b/src/mesa/main/blend.c @@ -354,7 +354,7 @@ _mesa_BlendColor( GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha ) * \param func alpha comparison function. * \param ref reference value. * - * Verifies the parameters and updates gl_colorbuffer_attrib. + * Verifies the parameters and updates gl_colorbuffer_attrib. * On a change, flushes the vertices and notifies the driver via * dd_function_table::AlphaFunc callback. */ diff --git a/src/mesa/main/blend.h b/src/mesa/main/blend.h index f72c779..2b7957b 100644 --- a/src/mesa/main/blend.h +++ b/src/mesa/main/blend.h @@ -83,7 +83,7 @@ extern void GLAPIENTRY _mesa_ClampColorARB(GLenum target, GLenum clamp); -extern void +extern void _mesa_init_color( struct gl_context * ctx ); #endif diff --git a/src/mesa/main/bufferobj.c b/src/mesa/main/bufferobj.c index 4d62f54..f8074b2 100644 --- a/src/mesa/main/bufferobj.c +++ b/src/mesa/main/bufferobj.c @@ -150,7 +150,7 @@ simplified_access_mode(GLbitfield access) * \sa glBufferSubDataARB, glGetBufferSubDataARB */ static struct gl_buffer_object * -buffer_object_subdata_range_good( struct gl_context * ctx, GLenum target, +buffer_object_subdata_range_good( struct gl_context * ctx, GLenum target, GLintptrARB offset, GLsizeiptrARB size, const char *caller ) { @@ -192,7 +192,7 @@ buffer_object_subdata_range_good( struct gl_context * ctx, GLenum target, /** * Allocate and initialize a new buffer object. - * + * * Default callback for the \c dd_function_table::NewBufferObject() hook. */ static struct gl_buffer_object * @@ -210,7 +210,7 @@ _mesa_new_buffer_object( struct gl_context *ctx, GLuint name, GLenum target ) /** * Delete a buffer object. - * + * * Default callback for the \c dd_function_table::DeleteBuffer() hook. */ static void @@ -483,7 +483,7 @@ _mesa_buffer_map_range( struct gl_context *ctx, GLenum target, GLintptr offset, * Called via glFlushMappedBufferRange(). */ static void -_mesa_buffer_flush_mapped_range( struct gl_context *ctx, GLenum target, +_mesa_buffer_flush_mapped_range( struct gl_context *ctx, GLenum target, GLintptr offset, GLsizeiptr length, struct gl_buffer_object *obj ) { @@ -628,7 +628,7 @@ bind_buffer_object(struct gl_context *ctx, GLenum target, GLuint buffer) _mesa_HashInsert(ctx->Shared->BufferObjects, buffer, newBufObj); } } - + /* bind new buffer */ _mesa_reference_buffer_object(ctx, bindTarget, newBufObj); @@ -640,7 +640,7 @@ bind_buffer_object(struct gl_context *ctx, GLenum target, GLuint buffer) /** * Update the default buffer objects in the given context to reference those - * specified in the shared state and release those referencing the old + * specified in the shared state and release those referencing the old * shared state. */ void @@ -974,7 +974,7 @@ _mesa_BindBufferARB(GLenum target, GLuint buffer) /** * Delete a set of buffer objects. - * + * * \param n Number of buffer objects to delete. * \param ids Array of \c n buffer object IDs. */ @@ -1050,7 +1050,7 @@ _mesa_DeleteBuffersARB(GLsizei n, const GLuint *ids) /** * Generate a set of unique buffer object IDs and store them in \c buffer. - * + * * \param n Number of IDs to generate. * \param buffer Array of \c n locations to store the IDs. */ @@ -1091,9 +1091,9 @@ _mesa_GenBuffersARB(GLsizei n, GLuint *buffer) /** * Determine if ID is the name of a buffer object. - * + * * \param id ID of the potential buffer object. - * \return \c GL_TRUE if \c id is the name of a buffer object, + * \return \c GL_TRUE if \c id is the name of a buffer object, * \c GL_FALSE otherwise. */ GLboolean GLAPIENTRY @@ -1150,13 +1150,13 @@ _mesa_BufferDataARB(GLenum target, GLsizeiptrARB size, _mesa_error(ctx, GL_INVALID_OPERATION, "glBufferDataARB(buffer 0)" ); return; } - + if (_mesa_bufferobj_mapped(bufObj)) { /* Unmap the existing buffer. We'll replace it now. Not an error. */ ctx->Driver.UnmapBuffer(ctx, target, bufObj); bufObj->AccessFlags = DEFAULT_ACCESS; ASSERT(bufObj->Pointer == NULL); - } + } FLUSH_VERTICES(ctx, _NEW_BUFFER_OBJECT); @@ -1669,7 +1669,7 @@ _mesa_MapBufferRange(GLenum target, GLintptr offset, GLsizeiptr length, "glMapBufferRange(buffer already mapped)"); return NULL; } - + ASSERT(ctx->Driver.MapBufferRange); map = ctx->Driver.MapBufferRange(ctx, target, offset, length, access, bufObj); diff --git a/src/mesa/main/buffers.c b/src/mesa/main/buffers.c index 8644631..06e86c3 100644 --- a/src/mesa/main/buffers.c +++ b/src/mesa/main/buffers.c @@ -306,7 +306,7 @@ _mesa_DrawBuffersARB(GLsizei n, const GLenum *buffers) || _mesa_bitcount(destMask[output]) > 1) { _mesa_error(ctx, GL_INVALID_ENUM, "glDrawBuffersARB(buffer)"); return; - } + } destMask[output] &= supportedMask; if (destMask[output] == 0) { _mesa_error(ctx, GL_INVALID_OPERATION, diff --git a/src/mesa/main/clear.c b/src/mesa/main/clear.c index c4c1d96..025dd79 100644 --- a/src/mesa/main/clear.c +++ b/src/mesa/main/clear.c @@ -159,14 +159,14 @@ _mesa_ClearColorIuiEXT(GLuint r, GLuint g, GLuint b, GLuint a) /** * Clear buffers. - * + * * \param mask bit-mask indicating the buffers to be cleared. * * Flushes the vertices and verifies the parameter. If __struct gl_contextRec::NewState * is set then calls _mesa_update_state() to update gl_frame_buffer::_Xmin, * etc. If the rasterization mode is set to GL_RENDER then requests the driver * to clear the buffers, via the dd_function_table::Clear callback. - */ + */ void GLAPIENTRY _mesa_Clear( GLbitfield mask ) { diff --git a/src/mesa/main/clip.h b/src/mesa/main/clip.h index 11431dc..d9a564b 100644 --- a/src/mesa/main/clip.h +++ b/src/mesa/main/clip.h @@ -33,10 +33,10 @@ #include "glheader.h" -extern void GLAPIENTRY +extern void GLAPIENTRY _mesa_ClipPlane( GLenum plane, const GLdouble *equation ); -extern void GLAPIENTRY +extern void GLAPIENTRY _mesa_GetClipPlane( GLenum plane, GLdouble *equation ); #endif diff --git a/src/mesa/main/colortab.c b/src/mesa/main/colortab.c index caa9583..f12124b 100644 --- a/src/mesa/main/colortab.c +++ b/src/mesa/main/colortab.c @@ -185,7 +185,7 @@ store_colortable_entries(struct gl_context *ctx, struct gl_color_table *table, GLfloat bScale, GLfloat bBias, GLfloat aScale, GLfloat aBias) { - data = _mesa_map_validate_pbo_source(ctx, + data = _mesa_map_validate_pbo_source(ctx, 1, &ctx->Unpack, count, 1, 1, format, type, data, "glColor[Sub]Table"); @@ -641,7 +641,7 @@ _mesa_GetColorTable( GLenum target, GLenum format, return; } - data = _mesa_map_validate_pbo_dest(ctx, + data = _mesa_map_validate_pbo_dest(ctx, 1, &ctx->Pack, table->Size, 1, 1, format, type, data, "glGetColorTable"); diff --git a/src/mesa/main/compiler.h b/src/mesa/main/compiler.h index 5557a3b..e5e48cb 100644 --- a/src/mesa/main/compiler.h +++ b/src/mesa/main/compiler.h @@ -168,7 +168,7 @@ extern "C" { * If we build the library with gcc's -fvisibility=hidden flag, we'll * use the PUBLIC macro to mark functions that are to be exported. * - * We also need to define a USED attribute, so the optimizer doesn't + * We also need to define a USED attribute, so the optimizer doesn't * inline a static function that we later use in an alias. - ajax */ #if defined(__GNUC__) || (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590)) @@ -320,7 +320,7 @@ static INLINE GLuint CPU_TO_LE32(GLuint x) */ #if !defined(_WIN32_WCE) #if defined(BUILD_FOR_SNAP) && defined(CHECKED) -# define ASSERT(X) _CHECK(X) +# define ASSERT(X) _CHECK(X) #elif defined(DEBUG) # define ASSERT(X) assert(X) #else diff --git a/src/mesa/main/config.h b/src/mesa/main/config.h index fffb1a7..60c669f 100644 --- a/src/mesa/main/config.h +++ b/src/mesa/main/config.h @@ -138,8 +138,8 @@ #define MAX_TEXTURE_UNITS ((MAX_TEXTURE_COORD_UNITS > MAX_TEXTURE_IMAGE_UNITS) ? MAX_TEXTURE_COORD_UNITS : MAX_TEXTURE_IMAGE_UNITS) -/** - * Maximum viewport/image width. Must accomodate all texture sizes too. +/** + * Maximum viewport/image width. Must accomodate all texture sizes too. */ #ifndef MAX_WIDTH @@ -338,7 +338,7 @@ /* * Color channel component order - * + * * \note Changes will almost certainly cause problems at this time. */ #define RCOMP 0 @@ -348,7 +348,7 @@ /** - * Maximum number of temporary vertices required for clipping. + * Maximum number of temporary vertices required for clipping. * * Used in array_cache and tnl modules. */ diff --git a/src/mesa/main/context.c b/src/mesa/main/context.c index 661107d..894025e 100644 --- a/src/mesa/main/context.c +++ b/src/mesa/main/context.c @@ -157,7 +157,7 @@ GLfloat _mesa_ubyte_to_float_color_tab[256]; /** * Swap buffers notification callback. - * + * * \param ctx GL context. * * Called by window system just before swapping buffers. @@ -183,7 +183,7 @@ _mesa_notifySwapBuffers(struct gl_context *ctx) /** * Allocates a struct gl_config structure and initializes it via * _mesa_initialize_visual(). - * + * * \param dbFlag double buffering * \param stereoFlag stereo buffer * \param depthBits requested bits per depth buffer value. Any value in [0, 32] @@ -198,7 +198,7 @@ _mesa_notifySwapBuffers(struct gl_context *ctx) * \param blueBits same as above. * \param alphaBits same as above. * \param numSamples not really used. - * + * * \return pointer to new struct gl_config or NULL if requested parameters can't be * met. * @@ -310,7 +310,7 @@ _mesa_initialize_visual( struct gl_config *vis, * Destroy a visual and free its memory. * * \param vis visual. - * + * * Frees the visual structure. */ void @@ -539,7 +539,7 @@ init_program_limits(GLenum type, struct gl_program_constants *prog) * Use defaults from config.h. The device drivers will often override * some of these values (such as number of texture units). */ -static void +static void _mesa_init_constants(struct gl_context *ctx) { assert(ctx); @@ -852,7 +852,7 @@ _mesa_alloc_dispatch_table(int size) * Note that the driver needs to pass in its dd_function_table here since * we need to at least call driverFunctions->NewTextureObject to create the * default texture objects. - * + * * Called by _mesa_create_context(). * * Performs the imports and exports callback tables initialization, and @@ -1037,7 +1037,7 @@ _mesa_initialize_context(struct gl_context *ctx, * \param driverFunctions points to the dd_function_table into which the * driver has plugged in all its special functions. * \param driverContext points to the device driver's private context state - * + * * \return pointer to a new __struct gl_contextRec or NULL if error. */ struct gl_context * @@ -1085,7 +1085,7 @@ _mesa_create_context(const struct gl_config *visual, /** * Free the data associated with the given context. - * + * * But doesn't free the struct gl_context struct itself. * * \sa _mesa_initialize_context() and init_attrib_groups(). @@ -1168,7 +1168,7 @@ _mesa_free_context_data( struct gl_context *ctx ) * Destroy a struct gl_context structure. * * \param ctx GL context. - * + * * Calls _mesa_free_context_data() and frees the gl_context object itself. */ void @@ -1184,7 +1184,7 @@ _mesa_destroy_context( struct gl_context *ctx ) #if _HAVE_FULL_GL /** * Copy attribute groups from one context to another. - * + * * \param src source context * \param dst destination context * \param mask bitwise OR of GL_*_BIT flags @@ -1313,7 +1313,7 @@ _mesa_copy_context( const struct gl_context *src, struct gl_context *dst, GLuint * * \return GL_TRUE if compatible, GL_FALSE otherwise. */ -static GLboolean +static GLboolean check_compatible(const struct gl_context *ctx, const struct gl_framebuffer *buffer) { @@ -1432,7 +1432,7 @@ _mesa_make_current( struct gl_context *newCtx, } } - if (curCtx && + if (curCtx && (curCtx->WinSysDrawBuffer || curCtx->WinSysReadBuffer) && /* make sure this context is valid for flushing */ curCtx != newCtx) _mesa_flush(curCtx); @@ -1460,7 +1460,7 @@ _mesa_make_current( struct gl_context *newCtx, * or not bound to a user-created FBO. */ if (!newCtx->DrawBuffer || newCtx->DrawBuffer->Name == 0) { - /* KW: merge conflict here, revisit. + /* KW: merge conflict here, revisit. */ /* fix up the fb fields - these will end up wrong otherwise * if the DRIdrawable changes, and everything relies on them. @@ -1542,7 +1542,7 @@ _mesa_make_current( struct gl_context *newCtx, newCtx->FirstTimeCurrent = GL_FALSE; } } - + return GL_TRUE; } @@ -1560,7 +1560,7 @@ _mesa_share_state(struct gl_context *ctx, struct gl_context *ctxToShare) struct gl_shared_state *oldSharedState = ctx->Shared; ctx->Shared = ctxToShare->Shared; - + _glthread_LOCK_MUTEX(ctx->Shared->Mutex); ctx->Shared->RefCount++; _glthread_UNLOCK_MUTEX(ctx->Shared->Mutex); @@ -1580,7 +1580,7 @@ _mesa_share_state(struct gl_context *ctx, struct gl_context *ctxToShare) /** * \return pointer to the current GL context for this thread. - * + * * Calls _glapi_get_context(). This isn't the fastest way to get the current * context. If you need speed, see the #GET_CURRENT_CONTEXT macro in * context.h. @@ -1597,7 +1597,7 @@ _mesa_get_current_context( void ) * * It'll either be the immediate-mode execute dispatcher or the display list * compile dispatcher. - * + * * \param ctx GL context. * * \return pointer to dispatch_table. @@ -1623,7 +1623,7 @@ _mesa_get_dispatch(struct gl_context *ctx) * * \param ctx GL context. * \param error error code. - * + * * Records the given error code and call the driver's dd_function_table::Error * function if defined. * diff --git a/src/mesa/main/context.h b/src/mesa/main/context.h index 42d98a3..cd571e8 100644 --- a/src/mesa/main/context.h +++ b/src/mesa/main/context.h @@ -58,7 +58,7 @@ struct _glapi_table; /** \name Visual-related functions */ /*@{*/ - + extern struct gl_config * _mesa_create_visual( GLboolean dbFlag, GLboolean stereoFlag, @@ -244,7 +244,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 value in case the assertion fails. */ @@ -259,7 +259,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) \ @@ -273,7 +273,7 @@ do { \ /** * Macro to assert that the API call was made outside the * glBegin()/glEnd() pair and flush the vertices. - * + * * \param ctx GL context. */ #define ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx) \ @@ -285,7 +285,7 @@ do { \ /** * Macro to assert that the API call was made outside the * glBegin()/glEnd() pair and flush the vertices, with return value. - * + * * \param ctx GL context. * \param retval value to return value in case the assertion fails. */ diff --git a/src/mesa/main/dd.h b/src/mesa/main/dd.h index c62969e..fa8fdda 100644 --- a/src/mesa/main/dd.h +++ b/src/mesa/main/dd.h @@ -85,7 +85,7 @@ struct dd_function_table { const GLubyte * (*GetString)( struct gl_context *ctx, GLenum name ); /** - * Notify the driver after Mesa has made some internal state changes. + * Notify the driver after Mesa has made some internal state changes. * * This is in addition to any state change callbacks Mesa may already have * made. @@ -109,7 +109,7 @@ struct dd_function_table { GLuint width, GLuint height); /** - * Called whenever an error is generated. + * Called whenever an error is generated. * __struct gl_contextRec::ErrorValue contains the error value. */ void (*Error)( struct gl_context *ctx ); @@ -167,14 +167,14 @@ struct dd_function_table { GLvoid *dest ); /** - * Called by glCopyPixels(). + * Called by glCopyPixels(). */ void (*CopyPixels)( struct gl_context *ctx, GLint srcx, GLint srcy, GLsizei width, GLsizei height, GLint dstx, GLint dsty, GLenum type ); /** - * Called by glBitmap(). + * Called by glBitmap(). */ void (*Bitmap)( struct gl_context *ctx, GLint x, GLint y, GLsizei width, GLsizei height, @@ -182,7 +182,7 @@ struct dd_function_table { const GLubyte *bitmap ); /*@}*/ - + /** * \name Texture image functions */ @@ -190,7 +190,7 @@ struct dd_function_table { /** * Choose texture format. - * + * * This is called by the \c _mesa_store_tex[sub]image[123]d() fallback * functions. The driver should examine \p internalFormat and return a * gl_format value. @@ -200,7 +200,7 @@ struct dd_function_table { /** * Called by glTexImage1D(). - * + * * \param target user specified. * \param format user specified. * \param type user specified. @@ -209,7 +209,7 @@ struct dd_function_table { * \param texObj is the target texture object. * \param texImage is the target texture image. It will have the texture \p * width, \p height, \p depth, \p border and \p internalFormat information. - * + * * \p retainInternalCopy is returned by this function and indicates whether * core Mesa should keep an internal copy of the texture image. * @@ -225,7 +225,7 @@ struct dd_function_table { /** * Called by glTexImage2D(). - * + * * \sa dd_function_table::TexImage1D. */ void (*TexImage2D)( struct gl_context *ctx, GLenum target, GLint level, @@ -235,10 +235,10 @@ struct dd_function_table { const struct gl_pixelstore_attrib *packing, struct gl_texture_object *texObj, struct gl_texture_image *texImage ); - + /** * Called by glTexImage3D(). - * + * * \sa dd_function_table::TexImage1D. */ void (*TexImage3D)( struct gl_context *ctx, GLenum target, GLint level, @@ -277,7 +277,7 @@ struct dd_function_table { const struct gl_pixelstore_attrib *packing, struct gl_texture_object *texObj, struct gl_texture_image *texImage ); - + /** * Called by glTexSubImage2D(). * @@ -291,7 +291,7 @@ struct dd_function_table { const struct gl_pixelstore_attrib *packing, struct gl_texture_object *texObj, struct gl_texture_image *texImage ); - + /** * Called by glTexSubImage3D(). * @@ -316,7 +316,7 @@ struct dd_function_table { /** * Called by glCopyTexImage1D(). - * + * * Drivers should use a fallback routine from texstore.c if needed. */ void (*CopyTexImage1D)( struct gl_context *ctx, GLenum target, GLint level, @@ -325,7 +325,7 @@ struct dd_function_table { /** * Called by glCopyTexImage2D(). - * + * * Drivers should use a fallback routine from texstore.c if needed. */ void (*CopyTexImage2D)( struct gl_context *ctx, GLenum target, GLint level, @@ -334,7 +334,7 @@ struct dd_function_table { /** * Called by glCopyTexSubImage1D(). - * + * * Drivers should use a fallback routine from texstore.c if needed. */ void (*CopyTexSubImage1D)( struct gl_context *ctx, GLenum target, GLint level, @@ -342,7 +342,7 @@ struct dd_function_table { GLint x, GLint y, GLsizei width ); /** * Called by glCopyTexSubImage2D(). - * + * * Drivers should use a fallback routine from texstore.c if needed. */ void (*CopyTexSubImage2D)( struct gl_context *ctx, GLenum target, GLint level, @@ -351,7 +351,7 @@ struct dd_function_table { GLsizei width, GLsizei height ); /** * Called by glCopyTexSubImage3D(). - * + * * Drivers should use a fallback routine from texstore.c if needed. */ void (*CopyTexSubImage3D)( struct gl_context *ctx, GLenum target, GLint level, @@ -367,7 +367,7 @@ struct dd_function_table { /** * Called by glTexImage[123]D when user specifies a proxy texture - * target. + * target. * * \return GL_TRUE if the proxy test passes, or GL_FALSE if the test fails. */ @@ -378,7 +378,7 @@ struct dd_function_table { GLint depth, GLint border); /*@}*/ - + /** * \name Compressed texture functions */ @@ -395,7 +395,7 @@ struct dd_function_table { * \param texObj is the target texture object. * \param texImage is the target texture image. It will have the texture \p * width, \p height, \p depth, \p border and \p internalFormat information. - * + * * \a retainInternalCopy is returned by this function and indicates whether * core Mesa should keep an internal copy of the texture image. */ @@ -431,7 +431,7 @@ struct dd_function_table { /** * Called by glCompressedTexSubImage1D(). - * + * * \param target user specified. * \param level user specified. * \param xoffset user specified. @@ -507,7 +507,7 @@ struct dd_function_table { struct gl_texture_object * (*NewTextureObject)( struct gl_context *ctx, GLuint name, GLenum target ); /** - * Called when a texture object is about to be deallocated. + * Called when a texture object is about to be deallocated. * * Driver should delete the gl_texture_object object and anything * hanging off of it. @@ -519,7 +519,7 @@ struct dd_function_table { */ struct gl_texture_image * (*NewTextureImage)( struct gl_context *ctx ); - /** + /** * Called to free tImage->Data. */ void (*FreeTexImageData)( struct gl_context *ctx, struct gl_texture_image *tImage ); @@ -535,7 +535,7 @@ struct dd_function_table { * that knows for sure how the texture memory is allocated - via * the above callbacks. There is then an argument that the driver * knows what memcpy paths might be fast. Typically this is invoked with - * + * * to -- a pointer into texture memory allocated by NewTextureImage() above. * from -- a pointer into client memory or a mesa temporary. * sz -- nr bytes to copy. @@ -550,7 +550,7 @@ struct dd_function_table { /** * Called when the texture's color lookup table is changed. - * + * * If \p tObj is NULL then the shared texture palette * gl_texture_object::Palette is to be updated. */ @@ -558,7 +558,7 @@ struct dd_function_table { struct gl_texture_object *tObj ); /*@}*/ - + /** * \name Imaging functionality */ @@ -582,19 +582,19 @@ struct dd_function_table { /** Allocate a new program */ struct gl_program * (*NewProgram)(struct gl_context *ctx, GLenum target, GLuint id); /** Delete a program */ - void (*DeleteProgram)(struct gl_context *ctx, struct gl_program *prog); + void (*DeleteProgram)(struct gl_context *ctx, struct gl_program *prog); /** * Notify driver that a program string (and GPU code) has been specified * or modified. Return GL_TRUE or GL_FALSE to indicate if the program is * supported by the driver. */ - GLboolean (*ProgramStringNotify)(struct gl_context *ctx, GLenum target, + GLboolean (*ProgramStringNotify)(struct gl_context *ctx, GLenum target, struct gl_program *prog); /** Query if program can be loaded onto hardware */ - GLboolean (*IsProgramNative)(struct gl_context *ctx, GLenum target, + GLboolean (*IsProgramNative)(struct gl_context *ctx, GLenum target, struct gl_program *prog); - + /*@}*/ /** @@ -738,7 +738,7 @@ struct dd_function_table { struct gl_buffer_object * (*NewBufferObject)( struct gl_context *ctx, GLuint buffer, GLenum target ); - + void (*DeleteBuffer)( struct gl_context *ctx, struct gl_buffer_object *obj ); GLboolean (*BufferData)( struct gl_context *ctx, GLenum target, GLsizeiptrARB size, @@ -768,7 +768,7 @@ struct dd_function_table { GLsizeiptr length, GLbitfield access, struct gl_buffer_object *obj); - void (*FlushMappedBufferRange)(struct gl_context *ctx, GLenum target, + void (*FlushMappedBufferRange)(struct gl_context *ctx, GLenum target, GLintptr offset, GLsizeiptr length, struct gl_buffer_object *obj); @@ -800,7 +800,7 @@ struct dd_function_table { void (*BindFramebuffer)(struct gl_context *ctx, GLenum target, struct gl_framebuffer *drawFb, struct gl_framebuffer *readFb); - void (*FramebufferRenderbuffer)(struct gl_context *ctx, + void (*FramebufferRenderbuffer)(struct gl_context *ctx, struct gl_framebuffer *fb, GLenum attachment, struct gl_renderbuffer *rb); @@ -864,7 +864,7 @@ struct dd_function_table { GLuint NeedValidate; /** - * Validate the current T&L module. + * Validate the current T&L module. * * This is called directly after UpdateState() when a state change that has * occurred matches the dd_function_table::NeedValidate bitmask above. This @@ -882,14 +882,14 @@ struct dd_function_table { #define PRIM_UNKNOWN (GL_POLYGON+3) /** - * Set by the driver-supplied T&L engine. + * Set by the driver-supplied T&L engine. * * Set to PRIM_OUTSIDE_BEGIN_END when outside glBegin()/glEnd(). */ GLuint CurrentExecPrimitive; /** - * Current state of an in-progress compilation. + * Current state of an in-progress compilation. * * May take on any of the additional values PRIM_OUTSIDE_BEGIN_END, * PRIM_INSIDE_UNKNOWN_PRIM or PRIM_UNKNOWN defined above. @@ -960,7 +960,7 @@ struct dd_function_table { * * Notify the T&L component before and after calling a display list. */ - void (*BeginCallList)( struct gl_context *ctx, + void (*BeginCallList)( struct gl_context *ctx, struct gl_display_list *dlist ); /** * Called by glEndCallList(). diff --git a/src/mesa/main/debug.c b/src/mesa/main/debug.c index 79aa535..0d7ce58 100644 --- a/src/mesa/main/debug.c +++ b/src/mesa/main/debug.c @@ -230,7 +230,7 @@ static void add_debug_flags( const char *debug ) } -void +void _mesa_init_debug( struct gl_context *ctx ) { char *c; @@ -335,7 +335,7 @@ 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; diff --git a/src/mesa/main/debug.h b/src/mesa/main/debug.h index 17aa897..1490690 100644 --- a/src/mesa/main/debug.h +++ b/src/mesa/main/debug.h @@ -25,7 +25,7 @@ /** * \file debug.h * Debugging functions. - * + * * \if subset * (No-op) * diff --git a/src/mesa/main/depth.h b/src/mesa/main/depth.h index 2f42862..6bc930e 100644 --- a/src/mesa/main/depth.h +++ b/src/mesa/main/depth.h @@ -55,7 +55,7 @@ _mesa_DepthMask( GLboolean flag ); extern void GLAPIENTRY _mesa_DepthBoundsEXT( GLclampd zmin, GLclampd zmax ); -extern void +extern void _mesa_init_depth( struct gl_context * ctx ); #else diff --git a/src/mesa/main/dispatch.h b/src/mesa/main/dispatch.h index a597959..cb6a5ef 100644 --- a/src/mesa/main/dispatch.h +++ b/src/mesa/main/dispatch.h @@ -1,18 +1,18 @@ /* * (C) Copyright IBM Corporation 2005 * All Rights Reserved. - * + * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, 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. IN NO EVENT SHALL diff --git a/src/mesa/main/dlist.c b/src/mesa/main/dlist.c index 6c0c556..fa66766 100644 --- a/src/mesa/main/dlist.c +++ b/src/mesa/main/dlist.c @@ -116,7 +116,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 value in case the assertion fails. */ @@ -132,7 +132,7 @@ do { \ /** * Macro to assert that the API call was made outside the * glBegin()/glEnd() pair. - * + * * \param ctx GL context. */ #define ASSERT_OUTSIDE_SAVE_BEGIN_END(ctx) \ @@ -147,7 +147,7 @@ do { \ /** * Macro to assert that the API call was made outside the * glBegin()/glEnd() pair and flush the vertices. - * + * * \param ctx GL context. */ #define ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx) \ @@ -159,7 +159,7 @@ do { \ /** * Macro to assert that the API call was made outside the * glBegin()/glEnd() pair and flush the vertices, with return value. - * + * * \param ctx GL context. * \param retval value to return value in case the assertion fails. */ @@ -5536,7 +5536,7 @@ static INLINE GLboolean compare4fv( const GLfloat *a, { return memcmp( a, b, count * sizeof(GLfloat) ) == 0; } - + static void GLAPIENTRY save_Materialfv(GLenum face, GLenum pname, const GLfloat * param) @@ -5574,7 +5574,7 @@ save_Materialfv(GLenum face, GLenum pname, const GLfloat * param) _mesa_compile_error(ctx, GL_INVALID_ENUM, "material(pname)"); return; } - + if (ctx->ExecuteFlag) { CALL_Materialfv(ctx->Exec, (face, pname, param)); } @@ -8241,7 +8241,7 @@ _mesa_NewList(GLuint name, GLenum mode) /** - * End definition of current display list. + * End definition of current display list. */ static void GLAPIENTRY _mesa_EndList(void) @@ -8258,7 +8258,7 @@ _mesa_EndList(void) _mesa_error(ctx, GL_INVALID_OPERATION, "glEndList"); return; } - + /* Call before emitting END_OF_LIST, in case the driver wants to * emit opcodes itself. */ @@ -9338,7 +9338,7 @@ _mesa_create_save_table(void) SET_StencilMaskSeparate(table, save_StencilMaskSeparate); SET_StencilOpSeparate(table, save_StencilOpSeparate); - /* ATI_separate_stencil */ + /* ATI_separate_stencil */ SET_StencilFuncSeparateATI(table, save_StencilFuncSeparateATI); /* GL_ARB_imaging */ diff --git a/src/mesa/main/drawpix.c b/src/mesa/main/drawpix.c index 757aae6..0bcfced 100644 --- a/src/mesa/main/drawpix.c +++ b/src/mesa/main/drawpix.c @@ -181,7 +181,7 @@ _mesa_CopyPixels( GLint srcx, GLint srcy, GLsizei width, GLsizei height, else if (ctx->RenderMode == GL_FEEDBACK) { FLUSH_CURRENT( ctx, 0 ); _mesa_feedback_token( ctx, (GLfloat) (GLint) GL_COPY_PIXEL_TOKEN ); - _mesa_feedback_vertex( ctx, + _mesa_feedback_vertex( ctx, ctx->Current.RasterPos, ctx->Current.RasterColor, ctx->Current.RasterTexCoords[0] ); diff --git a/src/mesa/main/enable.c b/src/mesa/main/enable.c index a038a95..26b4fff 100644 --- a/src/mesa/main/enable.c +++ b/src/mesa/main/enable.c @@ -323,7 +323,7 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state) } else { ctx->Transform.ClipPlanesEnabled &= ~(1 << p); - } + } } break; #endif @@ -786,7 +786,7 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state) CHECK_EXTENSION2(ARB_vertex_program, NV_vertex_program, cap); if (ctx->VertexProgram.Enabled == state) return; - FLUSH_VERTICES(ctx, _NEW_PROGRAM); + FLUSH_VERTICES(ctx, _NEW_PROGRAM); ctx->VertexProgram.Enabled = state; break; case GL_VERTEX_PROGRAM_POINT_SIZE_ARB: @@ -800,7 +800,7 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state) CHECK_EXTENSION2(ARB_vertex_program, NV_vertex_program, cap); if (ctx->VertexProgram.TwoSideEnabled == state) return; - FLUSH_VERTICES(ctx, _NEW_PROGRAM); + FLUSH_VERTICES(ctx, _NEW_PROGRAM); ctx->VertexProgram.TwoSideEnabled = state; break; #endif diff --git a/src/mesa/main/enums.c b/src/mesa/main/enums.c index 9ceee99..2f573fc 100644 --- a/src/mesa/main/enums.c +++ b/src/mesa/main/enums.c @@ -3,18 +3,18 @@ /* * Copyright (C) 1999-2005 Brian Paul All Rights Reserved. * All Rights Reserved. - * + * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, 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. IN NO EVENT SHALL @@ -35,7 +35,7 @@ typedef struct { int n; } enum_elt; -LONGSTRING static const char enum_string_table[] = +LONGSTRING static const char enum_string_table[] = "GL_2D\0" "GL_2_BYTES\0" "GL_3D\0" diff --git a/src/mesa/main/enums.h b/src/mesa/main/enums.h index c03cd34..6714139 100644 --- a/src/mesa/main/enums.h +++ b/src/mesa/main/enums.h @@ -1,7 +1,7 @@ /** * \file enums.h * Enumeration name/number lookup functions. - * + * * \if subset * (No-op) * diff --git a/src/mesa/main/eval.c b/src/mesa/main/eval.c index c607e6a..4b7a6a9 100644 --- a/src/mesa/main/eval.c +++ b/src/mesa/main/eval.c @@ -537,7 +537,7 @@ _mesa_Map2d( GLenum target, GLdouble v1, GLdouble v2, GLint vstride, GLint vorder, const GLdouble *points ) { - map2(target, (GLfloat) u1, (GLfloat) u2, ustride, uorder, + map2(target, (GLfloat) u1, (GLfloat) u2, ustride, uorder, (GLfloat) v1, (GLfloat) v2, vstride, vorder, points, GL_DOUBLE); } @@ -796,7 +796,7 @@ static void GLAPIENTRY _mesa_MapGrid2d( GLint un, GLdouble u1, GLdouble u2, GLint vn, GLdouble v1, GLdouble v2 ) { - _mesa_MapGrid2f( un, (GLfloat) u1, (GLfloat) u2, + _mesa_MapGrid2f( un, (GLfloat) u1, (GLfloat) u2, vn, (GLfloat) v1, (GLfloat) v2 ); } @@ -860,7 +860,7 @@ init_1d_map( struct gl_1d_map *map, int n, const float *initial ) /** - * Initialize a 2-D evaluator map + * Initialize a 2-D evaluator map */ static void init_2d_map( struct gl_2d_map *map, int n, const float *initial ) diff --git a/src/mesa/main/eval.h b/src/mesa/main/eval.h index bd908f0..eff7fba 100644 --- a/src/mesa/main/eval.h +++ b/src/mesa/main/eval.h @@ -1,7 +1,7 @@ /** * \file eval.h * Eval operations. - * + * * \if subset * (No-op) * diff --git a/src/mesa/main/execmem.c b/src/mesa/main/execmem.c index ccd6ab4..1aa4ccd 100644 --- a/src/mesa/main/execmem.c +++ b/src/mesa/main/execmem.c @@ -78,7 +78,7 @@ init_heap(void) if (!exec_heap) exec_heap = 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); @@ -105,24 +105,24 @@ _mesa_exec_malloc(GLuint size) if (block) addr = exec_mem + block->ofs; - else + else printf("_mesa_exec_malloc failed\n"); bail: _glthread_UNLOCK_MUTEX(exec_mutex); - + return addr; } - -void + +void _mesa_exec_free(void *addr) { _glthread_LOCK_MUTEX(exec_mutex); if (exec_heap) { struct mem_block *block = mmFindBlock(exec_heap, (unsigned char *)addr - exec_mem); - + if (block) mmFreeMem(block); } @@ -143,8 +143,8 @@ _mesa_exec_malloc(GLuint size) return malloc( size ); } - -void + +void _mesa_exec_free(void *addr) { free(addr); diff --git a/src/mesa/main/extensions.h b/src/mesa/main/extensions.h index a9ed41f..506acc2 100644 --- a/src/mesa/main/extensions.h +++ b/src/mesa/main/extensions.h @@ -1,7 +1,7 @@ /** * \file extensions.h * Extension handling. - * + * * \if subset * (No-op) * diff --git a/src/mesa/main/fbobject.c b/src/mesa/main/fbobject.c index a98200e..0b5caf6 100644 --- a/src/mesa/main/fbobject.c +++ b/src/mesa/main/fbobject.c @@ -726,7 +726,7 @@ _mesa_test_framebuffer_completeness(struct gl_context *ctx, fb->_Status = GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE; fbo_incomplete("inconsistant number of samples", i); return; - } + } } } @@ -1028,7 +1028,7 @@ _mesa_base_fbo_format(struct gl_context *ctx, GLenum internalFormat) /** - * Helper function used by _mesa_RenderbufferStorageEXT() and + * Helper function used by _mesa_RenderbufferStorageEXT() and * _mesa_RenderbufferStorageMultisample(). * samples will be NO_SAMPLES if called by _mesa_RenderbufferStorageEXT(). */ @@ -1541,7 +1541,7 @@ _mesa_DeleteFramebuffersEXT(GLsizei n, const GLuint *framebuffers) /* bind default */ ASSERT(fb->RefCount >= 2); _mesa_BindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0); - } + } } /* remove from hash table immediately, to free the ID */ @@ -1643,7 +1643,7 @@ _mesa_CheckFramebufferStatusEXT(GLenum target) * Common code called by glFramebufferTexture1D/2D/3DEXT(). */ static void -framebuffer_texture(struct gl_context *ctx, const char *caller, GLenum target, +framebuffer_texture(struct gl_context *ctx, const char *caller, GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset) { @@ -1737,7 +1737,7 @@ framebuffer_texture(struct gl_context *ctx, const char *caller, GLenum target, } } - if ((level < 0) || + if ((level < 0) || (level >= _mesa_max_texture_levels(ctx, texObj->Target))) { _mesa_error(ctx, GL_INVALID_VALUE, "glFramebufferTexture%sEXT(level)", caller); @@ -2277,7 +2277,7 @@ _mesa_BlitFramebufferEXT(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, struct gl_renderbuffer *drawRb = drawFb->_StencilBuffer; if (!readRb || !drawRb || - _mesa_get_format_bits(readRb->Format, GL_STENCIL_BITS) != + _mesa_get_format_bits(readRb->Format, GL_STENCIL_BITS) != _mesa_get_format_bits(drawRb->Format, GL_STENCIL_BITS)) { _mesa_error(ctx, GL_INVALID_OPERATION, "glBlitFramebufferEXT(stencil buffer size mismatch"); @@ -2290,7 +2290,7 @@ _mesa_BlitFramebufferEXT(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, struct gl_renderbuffer *drawRb = drawFb->_DepthBuffer; if (!readRb || !drawRb || - _mesa_get_format_bits(readRb->Format, GL_DEPTH_BITS) != + _mesa_get_format_bits(readRb->Format, GL_DEPTH_BITS) != _mesa_get_format_bits(drawRb->Format, GL_DEPTH_BITS)) { _mesa_error(ctx, GL_INVALID_OPERATION, "glBlitFramebufferEXT(depth buffer size mismatch"); diff --git a/src/mesa/main/feedback.c b/src/mesa/main/feedback.c index ffdecae..65d4006 100644 --- a/src/mesa/main/feedback.c +++ b/src/mesa/main/feedback.c @@ -150,14 +150,14 @@ _mesa_feedback_vertex(struct gl_context *ctx, /** * Establish a buffer for selection mode values. - * + * * \param size buffer size. * \param buffer buffer. * * \sa glSelectBuffer(). - * + * * \note this function can't be put in a display list. - * + * * Verifies we're not in selection mode, flushes the vertices and initialize * the fields in __struct gl_contextRec::Select with the given buffer. */ @@ -172,7 +172,7 @@ _mesa_SelectBuffer( GLsizei size, GLuint *buffer ) return; /* KW: added return */ } - FLUSH_VERTICES(ctx, _NEW_RENDERMODE); + FLUSH_VERTICES(ctx, _NEW_RENDERMODE); ctx->Select.Buffer = buffer; ctx->Select.BufferSize = size; ctx->Select.BufferCount = 0; @@ -184,7 +184,7 @@ _mesa_SelectBuffer( GLsizei size, GLuint *buffer ) /** * Write a value of a record into the selection buffer. - * + * * \param ctx GL context. * \param value value. * @@ -230,7 +230,7 @@ _mesa_update_hitflag(struct gl_context *ctx, GLfloat z) * * Write the hit record, i.e., the number of names in the stack, the minimum and * maximum depth values and the number of names in the name stack at the time - * of the event. Resets the hit flag. + * of the event. Resets the hit flag. * * \sa gl_selection. */ @@ -405,7 +405,7 @@ _mesa_PopName( void ) * \note this function can't be put in a display list. * * \sa glRenderMode(). - * + * * Flushes the vertices and do the necessary cleanup according to the previous * rasterization mode, such as writing the hit record or resent the select * buffer index when exiting the select mode. Updates diff --git a/src/mesa/main/ffvertex_prog.h b/src/mesa/main/ffvertex_prog.h index 837a15e..de36e7c 100644 --- a/src/mesa/main/ffvertex_prog.h +++ b/src/mesa/main/ffvertex_prog.h @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ diff --git a/src/mesa/main/fog.h b/src/mesa/main/fog.h index 9191a4a..b03d135 100644 --- a/src/mesa/main/fog.h +++ b/src/mesa/main/fog.h @@ -1,7 +1,7 @@ /** * \file fog.h * Fog operations. - * + * * \if subset * (No-op) * diff --git a/src/mesa/main/formats.c b/src/mesa/main/formats.c index ce072e9..262ce9e 100644 --- a/src/mesa/main/formats.c +++ b/src/mesa/main/formats.c @@ -450,7 +450,7 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] = MESA_FORMAT_SRGBA8, "MESA_FORMAT_SRGBA8", GL_RGBA, - GL_UNSIGNED_NORMALIZED, + GL_UNSIGNED_NORMALIZED, 8, 8, 8, 8, 0, 0, 0, 0, 0, 1, 1, 4 @@ -459,7 +459,7 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] = MESA_FORMAT_SARGB8, "MESA_FORMAT_SARGB8", GL_RGBA, - GL_UNSIGNED_NORMALIZED, + GL_UNSIGNED_NORMALIZED, 8, 8, 8, 8, 0, 0, 0, 0, 0, 1, 1, 4 @@ -468,7 +468,7 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] = MESA_FORMAT_SL8, "MESA_FORMAT_SL8", GL_LUMINANCE, - GL_UNSIGNED_NORMALIZED, + GL_UNSIGNED_NORMALIZED, 0, 0, 0, 0, 8, 0, 0, 0, 0, 1, 1, 1 @@ -477,7 +477,7 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] = MESA_FORMAT_SLA8, "MESA_FORMAT_SLA8", GL_LUMINANCE_ALPHA, - GL_UNSIGNED_NORMALIZED, + GL_UNSIGNED_NORMALIZED, 0, 0, 0, 8, 8, 0, 0, 0, 0, 1, 1, 2 @@ -551,7 +551,7 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] = MESA_FORMAT_RGBA_DXT1, "MESA_FORMAT_RGBA_DXT1", GL_RGBA, - GL_UNSIGNED_NORMALIZED, + GL_UNSIGNED_NORMALIZED, 4, 4, 4, 4, 0, 0, 0, 0, 0, 4, 4, 8 /* 8 bytes per 4x4 block */ @@ -560,7 +560,7 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] = MESA_FORMAT_RGBA_DXT3, "MESA_FORMAT_RGBA_DXT3", GL_RGBA, - GL_UNSIGNED_NORMALIZED, + GL_UNSIGNED_NORMALIZED, 4, 4, 4, 4, 0, 0, 0, 0, 0, 4, 4, 16 /* 16 bytes per 4x4 block */ @@ -569,7 +569,7 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] = MESA_FORMAT_RGBA_DXT5, "MESA_FORMAT_RGBA_DXT5", GL_RGBA, - GL_UNSIGNED_NORMALIZED, + GL_UNSIGNED_NORMALIZED, 4, 4, 4, 4, 0, 0, 0, 0, 0, 4, 4, 16 /* 16 bytes per 4x4 block */ diff --git a/src/mesa/main/formats.h b/src/mesa/main/formats.h index 997229b..b2460b6 100644 --- a/src/mesa/main/formats.h +++ b/src/mesa/main/formats.h @@ -44,7 +44,7 @@ typedef enum { MESA_FORMAT_NONE = 0, - /** + /** * \name Basic hardware formats */ /*@{*/ diff --git a/src/mesa/main/framebuffer.c b/src/mesa/main/framebuffer.c index 5530c51..d937cb8 100644 --- a/src/mesa/main/framebuffer.c +++ b/src/mesa/main/framebuffer.c @@ -253,7 +253,7 @@ _mesa_reference_framebuffer(struct gl_framebuffer **ptr, oldFb->RefCount--; deleteFlag = (oldFb->RefCount == 0); _glthread_UNLOCK_MUTEX(oldFb->Mutex); - + if (deleteFlag) oldFb->Delete(oldFb); @@ -542,7 +542,7 @@ _mesa_update_framebuffer_visual(struct gl_framebuffer *fb) const struct gl_renderbuffer *rb = fb->Attachment[i].Renderbuffer; const GLenum baseFormat = _mesa_get_format_base_format(rb->Format); const gl_format fmt = rb->Format; - + if (baseFormat == GL_RGBA || baseFormat == GL_RGB || baseFormat == GL_ALPHA) { fb->Visual.redBits = _mesa_get_format_bits(fmt, GL_RED_BITS); @@ -793,7 +793,7 @@ update_framebuffer(struct gl_context *ctx, struct gl_framebuffer *fb) ctx->Color.DrawBuffer, NULL); } if (fb->ColorReadBuffer != ctx->Pixel.ReadBuffer) { - + } } else { diff --git a/src/mesa/main/framebuffer.h b/src/mesa/main/framebuffer.h index 20e3ff5..04bb50c 100644 --- a/src/mesa/main/framebuffer.h +++ b/src/mesa/main/framebuffer.h @@ -66,7 +66,7 @@ extern void GLAPIENTRY _mesa_ResizeBuffersMESA( void ); -extern void +extern void _mesa_update_draw_buffer_bounds(struct gl_context *ctx); extern void diff --git a/src/mesa/main/get.c b/src/mesa/main/get.c index d5eef49..d103316 100644 --- a/src/mesa/main/get.c +++ b/src/mesa/main/get.c @@ -129,7 +129,7 @@ enum value_extra { EXTRA_VERSION_31, EXTRA_VERSION_32, EXTRA_VERSION_ES2, - EXTRA_NEW_BUFFERS, + EXTRA_NEW_BUFFERS, EXTRA_VALID_DRAW_BUFFER, EXTRA_VALID_TEXTURE_UNIT, EXTRA_FLUSH_CURRENT, @@ -767,7 +767,7 @@ static const struct value_desc values[] = { { GL_GREEN_SCALE, CONTEXT_FLOAT(Pixel.GreenScale), NO_EXTRA }, { GL_INDEX_BITS, BUFFER_INT(Visual.indexBits), extra_new_buffers }, { GL_INDEX_CLEAR_VALUE, CONTEXT_INT(Color.ClearIndex), NO_EXTRA }, - { GL_INDEX_MODE, CONST(0) , NO_EXTRA}, + { GL_INDEX_MODE, CONST(0) , NO_EXTRA}, { GL_INDEX_OFFSET, CONTEXT_INT(Pixel.IndexOffset), NO_EXTRA }, { GL_INDEX_SHIFT, CONTEXT_INT(Pixel.IndexShift), NO_EXTRA }, { GL_INDEX_WRITEMASK, CONTEXT_INT(Color.IndexMask), NO_EXTRA }, @@ -1048,13 +1048,13 @@ static const struct value_desc values[] = { extra_NV_light_max_exponent }, { GL_MAX_SPOT_EXPONENT_NV, CONTEXT_FLOAT(Const.MaxSpotExponent), extra_NV_light_max_exponent }, - + /* GL_NV_primitive_restart */ { GL_PRIMITIVE_RESTART_NV, CONTEXT_BOOL(Array.PrimitiveRestart), extra_NV_primitive_restart }, { GL_PRIMITIVE_RESTART_INDEX_NV, CONTEXT_INT(Array.RestartIndex), extra_NV_primitive_restart }, - + /* GL_ARB_vertex_buffer_object */ { GL_INDEX_ARRAY_BUFFER_BINDING_ARB, LOC_CUSTOM, TYPE_INT, offsetof(struct gl_array_object, Index.BufferObj), NO_EXTRA }, @@ -1147,7 +1147,7 @@ static const struct value_desc values[] = { /* GL_EXT_framebuffer_object */ { GL_MAX_COLOR_ATTACHMENTS_EXT, CONTEXT_INT(Const.MaxColorAttachments), extra_EXT_framebuffer_object }, - + /* GL_EXT_framebuffer_blit * NOTE: GL_DRAW_FRAMEBUFFER_BINDING_EXT == GL_FRAMEBUFFER_BINDING_EXT */ { GL_READ_FRAMEBUFFER_BINDING_EXT, LOC_CUSTOM, TYPE_INT, 0, @@ -1245,7 +1245,7 @@ static const struct value_desc values[] = { extra_version_31 }, { GL_PRIMITIVE_RESTART_INDEX, CONTEXT_INT(Array.RestartIndex), extra_version_31 }, - + /* GL 3.2 */ { GL_CONTEXT_PROFILE_MASK, CONTEXT_INT(Const.ProfileMask), @@ -1309,7 +1309,7 @@ print_table_stats(void) #endif /** - * Initialize the enum hash for a given API + * Initialize the enum hash for a given API * * This is called from one_time_init() to insert the enum values that * are valid for the API in question into the enum hash table. @@ -1538,7 +1538,7 @@ find_custom_value(struct gl_context *ctx, const struct value_desc *d, union valu v->value_int = _mesa_get_compressed_formats(ctx, NULL, GL_FALSE); break; case GL_COMPRESSED_TEXTURE_FORMATS_ARB: - v->value_int_n.n = + v->value_int_n.n = _mesa_get_compressed_formats(ctx, v->value_int_n.ints, GL_FALSE); ASSERT(v->value_int_n.n <= 100); break; @@ -1593,7 +1593,7 @@ find_custom_value(struct gl_context *ctx, const struct value_desc *d, union valu break; case GL_FRAGMENT_PROGRAM_BINDING_NV: - v->value_int = + v->value_int = ctx->FragmentProgram.Current ? ctx->FragmentProgram.Current->Base.Id : 0; break; case GL_VERTEX_PROGRAM_BINDING_NV: @@ -1640,7 +1640,7 @@ find_custom_value(struct gl_context *ctx, const struct value_desc *d, union valu case GL_MAX_FRAGMENT_UNIFORM_VECTORS: v->value_int = ctx->Const.FragmentProgram.MaxUniformComponents / 4; break; - } + } } /** @@ -1737,7 +1737,7 @@ static const struct value_desc error_value = /** * Find the struct value_desc corresponding to the enum 'pname'. - * + * * We hash the enum value to get an index into the 'table' array, * which holds the index in the 'values' array of struct value_desc. * Once we've found the entry, we do the extra checks, if any, then @@ -1746,7 +1746,7 @@ static const struct value_desc error_value = * If the value has to be computed (for example, it's the result of a * function call or we need to add 1 to it), we use the tmp 'v' to * store the result. - * + * * \param func name of glGet*v() func for error reporting * \param pname the enum value we're looking up * \param p is were we return the pointer to the value @@ -1879,7 +1879,7 @@ _mesa_GetBooleanv(GLenum pname, GLboolean *params) case TYPE_BOOLEAN: params[0] = ((GLboolean*) p)[0]; - break; + break; case TYPE_MATRIX: m = *(GLmatrix **) p; @@ -1963,7 +1963,7 @@ _mesa_GetFloatv(GLenum pname, GLfloat *params) case TYPE_BOOLEAN: params[0] = BOOLEAN_TO_FLOAT(*(GLboolean*) p); - break; + break; case TYPE_MATRIX: m = *(GLmatrix **) p; @@ -2053,7 +2053,7 @@ _mesa_GetIntegerv(GLenum pname, GLint *params) case TYPE_BOOLEAN: params[0] = BOOLEAN_TO_INT(*(GLboolean*) p); - break; + break; case TYPE_MATRIX: m = *(GLmatrix **) p; @@ -2144,7 +2144,7 @@ _mesa_GetInteger64v(GLenum pname, GLint64 *params) case TYPE_BOOLEAN: params[0] = ((GLboolean*) p)[0]; - break; + break; case TYPE_MATRIX: m = *(GLmatrix **) p; @@ -2229,7 +2229,7 @@ _mesa_GetDoublev(GLenum pname, GLdouble *params) case TYPE_BOOLEAN: params[0] = *(GLboolean*) p; - break; + break; case TYPE_MATRIX: m = *(GLmatrix **) p; @@ -2372,7 +2372,7 @@ _mesa_GetInteger64Indexedv( GLenum pname, GLuint index, GLint64 *params ) { union value v; enum value_type type = - find_value_indexed("glGetIntegerIndexedv", pname, index, &v); + find_value_indexed("glGetIntegerIndexedv", pname, index, &v); switch (type) { case TYPE_INT: @@ -2452,7 +2452,7 @@ _mesa_GetFixedv(GLenum pname, GLfixed *params) case TYPE_BOOLEAN: params[0] = BOOLEAN_TO_FIXED(((GLboolean*) p)[0]); - break; + break; case TYPE_MATRIX: m = *(GLmatrix **) p; diff --git a/src/mesa/main/glapidispatch.h b/src/mesa/main/glapidispatch.h index 29823d0..3c6c3a9 100644 --- a/src/mesa/main/glapidispatch.h +++ b/src/mesa/main/glapidispatch.h @@ -3,18 +3,18 @@ /* * (C) Copyright IBM Corporation 2005 * All Rights Reserved. - * + * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, 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. IN NO EVENT SHALL diff --git a/src/mesa/main/hash.c b/src/mesa/main/hash.c index 72d924d..ed1e0ae 100644 --- a/src/mesa/main/hash.c +++ b/src/mesa/main/hash.c @@ -1,10 +1,10 @@ /** * \file hash.c - * Generic hash table. + * Generic hash table. * * Used for display lists, texture objects, vertex/fragment programs, * buffer objects, etc. The hash functions are thread-safe. - * + * * \note key=0 is illegal. * * \author Brian Paul @@ -47,7 +47,7 @@ /** - * An entry in the hash table. + * An entry in the hash table. */ struct HashEntry { GLuint Key; /**< the entry's key */ @@ -57,7 +57,7 @@ struct HashEntry { /** - * The hash table data structure. + * The hash table data structure. */ struct _mesa_HashTable { struct HashEntry *Table[TABLE_SIZE]; /**< the lookup table */ @@ -71,7 +71,7 @@ struct _mesa_HashTable { /** * Create a new hash table. - * + * * \return pointer to a new, empty hash table. */ struct _mesa_HashTable * @@ -146,10 +146,10 @@ _mesa_HashLookup_unlocked(struct _mesa_HashTable *table, GLuint key) /** * Lookup an entry in the hash table. - * + * * \param table the hash table. * \param key the key. - * + * * \return pointer to user's data or NULL if key not in table */ void * @@ -165,9 +165,9 @@ _mesa_HashLookup(struct _mesa_HashTable *table, GLuint key) /** - * Insert a key/pointer pair into the hash table. + * Insert a key/pointer pair into the hash table. * If an entry with this key already exists we'll replace the existing entry. - * + * * \param table the hash table. * \param key the key (not zero). * \param data pointer to user data. @@ -220,7 +220,7 @@ _mesa_HashInsert(struct _mesa_HashTable *table, GLuint key, void *data) /** * Remove an entry from the hash table. - * + * * \param table the hash table. * \param key key of entry to remove. * @@ -342,7 +342,7 @@ _mesa_HashWalk(const struct _mesa_HashTable *table, * Return the key of the "first" entry in the hash table. * While holding the lock, walks through all table positions until finding * the first entry of the first non-empty one. - * + * * \param table the hash table * \return key for the "first" entry in the hash table. */ @@ -411,7 +411,7 @@ _mesa_HashNextEntry(const struct _mesa_HashTable *table, GLuint key) /** * Dump contents of hash table for debugging. - * + * * \param table the hash table. */ void @@ -432,10 +432,10 @@ _mesa_HashPrint(const struct _mesa_HashTable *table) /** * Find a block of adjacent unused hash keys. - * + * * \param table the hash table. * \param numKeys number of keys needed. - * + * * \return Starting key of free block or 0 if failure. * * If there are enough free keys between the maximum key existing in the table diff --git a/src/mesa/main/hash.h b/src/mesa/main/hash.h index 4f916f9..92a5cbb 100644 --- a/src/mesa/main/hash.h +++ b/src/mesa/main/hash.h @@ -1,6 +1,6 @@ /** * \file hash.h - * Generic hash table. + * Generic hash table. */ /* diff --git a/src/mesa/main/hint.h b/src/mesa/main/hint.h index 6c62068..371c6e5 100644 --- a/src/mesa/main/hint.h +++ b/src/mesa/main/hint.h @@ -1,7 +1,7 @@ /** * \file hint.h * Hints operations. - * + * * \if subset * (No-op) * @@ -46,7 +46,7 @@ struct gl_context; extern void GLAPIENTRY _mesa_Hint( GLenum target, GLenum mode ); -extern void +extern void _mesa_init_hint( struct gl_context * ctx ); #else diff --git a/src/mesa/main/histogram.h b/src/mesa/main/histogram.h index 5773242..59d6521 100644 --- a/src/mesa/main/histogram.h +++ b/src/mesa/main/histogram.h @@ -1,7 +1,7 @@ /** * \file histogram.h * Histogram. - * + * * \if subset * (No-op) * diff --git a/src/mesa/main/image.c b/src/mesa/main/image.c index f9f2ed7..cb79d65 100644 --- a/src/mesa/main/image.c +++ b/src/mesa/main/image.c @@ -214,7 +214,7 @@ _mesa_sizeof_packed_type( GLenum type ) return sizeof(GLuint); case GL_UNSIGNED_SHORT_8_8_MESA: case GL_UNSIGNED_SHORT_8_8_REV_MESA: - return sizeof(GLushort); + return sizeof(GLushort); case GL_UNSIGNED_INT_24_8_EXT: return sizeof(GLuint); default: @@ -1041,7 +1041,7 @@ _mesa_is_compressed_format(struct gl_context *ctx, GLenum format) * \param img which image in the volume (0 for 1D or 2D images) * \param row row of pixel in the image (0 for 1D images) * \param column column of pixel in the image - * + * * \return address of pixel on success, or NULL on error. * * \sa gl_pixelstore_attrib. @@ -1197,7 +1197,7 @@ _mesa_image_address3d( const struct gl_pixelstore_attrib *packing, * \param width image width. * \param format pixel format. * \param type pixel data type. - * + * * \return the stride in bytes for the given parameters, or -1 if error */ GLint diff --git a/src/mesa/main/image.h b/src/mesa/main/image.h index 005fbcc..07678ab 100644 --- a/src/mesa/main/image.h +++ b/src/mesa/main/image.h @@ -160,7 +160,7 @@ _mesa_clip_copytexsubimage(const struct gl_context *ctx, GLint *destX, GLint *destY, GLint *srcX, GLint *srcY, GLsizei *width, GLsizei *height); - + extern GLboolean _mesa_clip_to_region(GLint xmin, GLint ymin, GLint xmax, GLint ymax, diff --git a/src/mesa/main/imports.c b/src/mesa/main/imports.c index 643740d..947754c 100644 --- a/src/mesa/main/imports.c +++ b/src/mesa/main/imports.c @@ -1,7 +1,7 @@ /** * \file imports.c * Standard C library function wrappers. - * + * * Imports are services which the device driver or window system or * operating system provides to the core renderer. The core renderer (Mesa) * will call these functions in order to do memory allocation, simple I/O, @@ -76,7 +76,7 @@ extern int vsnprintf(char *str, size_t count, const char *fmt, va_list arg); * * \param bytes number of bytes to allocate. * \param alignment alignment (must be greater than zero). - * + * * Allocates extra memory to accommodate rounding up the address for * alignment and to record the real malloc address. * @@ -126,7 +126,7 @@ _mesa_align_calloc(size_t bytes, unsigned long alignment) { #if defined(HAVE_POSIX_MEMALIGN) void *mem; - + mem = _mesa_align_malloc(bytes, alignment); if (mem != NULL) { (void) memset(mem, 0, bytes); @@ -548,7 +548,7 @@ _mesa_float_to_half(float val) const int flt_s = (fi.i >> 31) & 0x1; int s, e, m = 0; GLhalfARB result; - + /* sign bit */ s = flt_s; @@ -684,7 +684,7 @@ _mesa_half_to_float(GLhalfARB val) * Wrapper for bsearch(). */ void * -_mesa_bsearch( const void *key, const void *base, size_t nmemb, size_t size, +_mesa_bsearch( const void *key, const void *base, size_t nmemb, size_t size, int (*compar)(const void *, const void *) ) { #if defined(_WIN32_WCE) @@ -793,7 +793,7 @@ _mesa_snprintf( char *str, size_t size, const char *fmt, ... ) { int r; va_list args; - va_start( args, fmt ); + va_start( args, fmt ); r = vsnprintf( str, size, fmt, args ); va_end( args ); return r; @@ -835,8 +835,8 @@ output_if_debug(const char *prefixString, const char *outputString, fprintf(stderr, "\n"); #if defined(_WIN32) && !defined(_WIN32_WCE) - /* 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]; _mesa_snprintf(buf, sizeof(buf), "%s: %s%s", prefixString, outputString, newline ? "\n" : ""); @@ -888,7 +888,7 @@ flush_delayed_errors( struct gl_context *ctx ) char s[MAXSTRING]; if (ctx->ErrorDebugCount) { - _mesa_snprintf(s, MAXSTRING, "%d similar %s errors", + _mesa_snprintf(s, MAXSTRING, "%d similar %s errors", ctx->ErrorDebugCount, error_string(ctx->ErrorValue)); @@ -911,10 +911,10 @@ _mesa_warning( struct gl_context *ctx, const char *fmtString, ... ) { char str[MAXSTRING]; va_list args; - va_start( args, fmtString ); + va_start( args, fmtString ); (void) vsnprintf( str, MAXSTRING, fmtString, args ); va_end( args ); - + if (ctx) flush_delayed_errors( ctx ); @@ -936,7 +936,7 @@ _mesa_problem( const struct gl_context *ctx, const char *fmtString, ... ) char str[MAXSTRING]; (void) ctx; - va_start( args, fmtString ); + va_start( args, fmtString ); vsnprintf( str, MAXSTRING, fmtString, args ); va_end( args ); @@ -952,7 +952,7 @@ _mesa_problem( const struct gl_context *ctx, const char *fmtString, ... ) * If debugging is enabled (either at compile-time via the DEBUG macro, or * run-time via the MESA_DEBUG environment variable), report the error with * _mesa_debug(). - * + * * \param ctx the GL context. * \param error the error value. * \param fmtString printf() style format string, followed by optional args @@ -980,7 +980,7 @@ _mesa_error( struct gl_context *ctx, GLenum error, const char *fmtString, ... ) #endif } - if (debug) { + if (debug) { if (ctx->ErrorValue == error && ctx->ErrorDebugFmtString == fmtString) { ctx->ErrorDebugCount++; @@ -990,14 +990,14 @@ _mesa_error( struct gl_context *ctx, GLenum error, const char *fmtString, ... ) va_list args; flush_delayed_errors( ctx ); - + va_start(args, fmtString); vsnprintf(s, MAXSTRING, fmtString, args); va_end(args); _mesa_snprintf(s2, MAXSTRING, "%s in %s", error_string(error), s); output_if_debug("Mesa: User error", s2, GL_TRUE); - + ctx->ErrorDebugFmtString = fmtString; ctx->ErrorDebugCount = 0; } @@ -1010,7 +1010,7 @@ _mesa_error( struct gl_context *ctx, GLenum error, const char *fmtString, ... ) /** * Report debug information. Print error message to stderr via fprintf(). * No-op if DEBUG mode not enabled. - * + * * \param ctx GL context. * \param fmtString printf()-style format string, followed by optional args. */ diff --git a/src/mesa/main/light.c b/src/mesa/main/light.c index c27cf1d..5734042 100644 --- a/src/mesa/main/light.c +++ b/src/mesa/main/light.c @@ -633,7 +633,7 @@ _mesa_copy_materials( struct gl_material *dst, { int i; - for (i = 0 ; i < MAT_ATTRIB_MAX ; i++) + for (i = 0 ; i < MAT_ATTRIB_MAX ; i++) if (bitmask & (1<Attrib[i], src->Attrib[i] ); } @@ -648,7 +648,7 @@ _mesa_update_material( struct gl_context *ctx, GLuint bitmask ) struct gl_light *light, *list = &ctx->Light.EnabledList; GLfloat (*mat)[4] = ctx->Light.Material.Attrib; - if (MESA_VERBOSE & VERBOSE_MATERIAL) + if (MESA_VERBOSE & VERBOSE_MATERIAL) _mesa_debug(ctx, "_mesa_update_material, mask 0x%x\n", bitmask); if (!bitmask) @@ -657,14 +657,14 @@ _mesa_update_material( struct gl_context *ctx, GLuint bitmask ) /* update material ambience */ if (bitmask & MAT_BIT_FRONT_AMBIENT) { foreach (light, list) { - SCALE_3V( light->_MatAmbient[0], light->Ambient, + SCALE_3V( light->_MatAmbient[0], light->Ambient, mat[MAT_ATTRIB_FRONT_AMBIENT]); } } if (bitmask & MAT_BIT_BACK_AMBIENT) { foreach (light, list) { - SCALE_3V( light->_MatAmbient[1], light->Ambient, + SCALE_3V( light->_MatAmbient[1], light->Ambient, mat[MAT_ATTRIB_BACK_AMBIENT]); } } @@ -685,14 +685,14 @@ _mesa_update_material( struct gl_context *ctx, GLuint bitmask ) /* update material diffuse values */ if (bitmask & MAT_BIT_FRONT_DIFFUSE) { foreach (light, list) { - SCALE_3V( light->_MatDiffuse[0], light->Diffuse, + SCALE_3V( light->_MatDiffuse[0], light->Diffuse, mat[MAT_ATTRIB_FRONT_DIFFUSE] ); } } if (bitmask & MAT_BIT_BACK_DIFFUSE) { foreach (light, list) { - SCALE_3V( light->_MatDiffuse[1], light->Diffuse, + SCALE_3V( light->_MatDiffuse[1], light->Diffuse, mat[MAT_ATTRIB_BACK_DIFFUSE] ); } } @@ -700,7 +700,7 @@ _mesa_update_material( struct gl_context *ctx, GLuint bitmask ) /* update material specular values */ if (bitmask & MAT_BIT_FRONT_SPECULAR) { foreach (light, list) { - SCALE_3V( light->_MatSpecular[0], light->Specular, + SCALE_3V( light->_MatSpecular[0], light->Specular, mat[MAT_ATTRIB_FRONT_SPECULAR]); } } @@ -734,7 +734,7 @@ _mesa_update_color_material( struct gl_context *ctx, const GLfloat color[4] ) struct gl_material *mat = &ctx->Light.Material; int i; - for (i = 0 ; i < MAT_ATTRIB_MAX ; i++) + for (i = 0 ; i < MAT_ATTRIB_MAX ; i++) if (bitmask & (1<Attrib[i], color ); @@ -1038,7 +1038,7 @@ _mesa_validate_all_lighting_tables( struct gl_context *ctx ) { GLuint i; GLfloat shininess; - + shininess = ctx->Light.Material.Attrib[MAT_ATTRIB_FRONT_SHININESS][0]; if (!ctx->_ShineTable[0] || ctx->_ShineTable[0]->shininess != shininess) validate_shine_table( ctx, 0, shininess ); @@ -1296,7 +1296,7 @@ _mesa_allow_light_in_model( struct gl_context *ctx, GLboolean flag ) * Initialize the n-th light data structure. * * \param l pointer to the gl_light structure to be initialized. - * \param n number of the light. + * \param n number of the light. * \note The defaults for light 0 are different than the other lights. */ static void @@ -1344,7 +1344,7 @@ init_lightmodel( struct gl_lightmodel *lm ) /** * Initialize the material data structure. - * + * * \param m pointer to the gl_material structure to be initialized. */ static void @@ -1356,7 +1356,7 @@ init_material( struct gl_material *m ) ASSIGN_4V( m->Attrib[MAT_ATTRIB_FRONT_EMISSION], 0.0F, 0.0F, 0.0F, 1.0F ); ASSIGN_4V( m->Attrib[MAT_ATTRIB_FRONT_SHININESS], 0.0F, 0.0F, 0.0F, 0.0F ); ASSIGN_4V( m->Attrib[MAT_ATTRIB_FRONT_INDEXES], 0.0F, 1.0F, 1.0F, 0.0F ); - + ASSIGN_4V( m->Attrib[MAT_ATTRIB_BACK_AMBIENT], 0.2F, 0.2F, 0.2F, 1.0F ); ASSIGN_4V( m->Attrib[MAT_ATTRIB_BACK_DIFFUSE], 0.8F, 0.8F, 0.8F, 1.0F ); ASSIGN_4V( m->Attrib[MAT_ATTRIB_BACK_SPECULAR], 0.0F, 0.0F, 0.0F, 1.0F ); diff --git a/src/mesa/main/lines.c b/src/mesa/main/lines.c index 81e179a..a410fe9 100644 --- a/src/mesa/main/lines.c +++ b/src/mesa/main/lines.c @@ -64,7 +64,7 @@ _mesa_LineWidth( GLfloat width ) * * \param factor pattern scale factor. * \param pattern bit pattern. - * + * * \sa glLineStipple(). * * Updates gl_line_attrib::StippleFactor and gl_line_attrib::StipplePattern. On diff --git a/src/mesa/main/lines.h b/src/mesa/main/lines.h index 8e8b3f8..ced7087 100644 --- a/src/mesa/main/lines.h +++ b/src/mesa/main/lines.h @@ -43,7 +43,7 @@ _mesa_LineWidth( GLfloat width ); extern void GLAPIENTRY _mesa_LineStipple( GLint factor, GLushort pattern ); -extern void GLAPIENTRY +extern void GLAPIENTRY _mesa_init_line( struct gl_context * ctx ); #endif diff --git a/src/mesa/main/matrix.c b/src/mesa/main/matrix.c index 105d4a3..063d84c 100644 --- a/src/mesa/main/matrix.c +++ b/src/mesa/main/matrix.c @@ -80,8 +80,8 @@ _mesa_Frustum( GLdouble left, GLdouble right, } _math_matrix_frustum( ctx->CurrentStack->Top, - (GLfloat) left, (GLfloat) right, - (GLfloat) bottom, (GLfloat) top, + (GLfloat) left, (GLfloat) right, + (GLfloat) bottom, (GLfloat) top, (GLfloat) nearval, (GLfloat) farval ); ctx->NewState |= ctx->CurrentStack->DirtyFlag; } @@ -124,8 +124,8 @@ _mesa_Ortho( GLdouble left, GLdouble right, } _math_matrix_ortho( ctx->CurrentStack->Top, - (GLfloat) left, (GLfloat) right, - (GLfloat) bottom, (GLfloat) top, + (GLfloat) left, (GLfloat) right, + (GLfloat) bottom, (GLfloat) top, (GLfloat) nearval, (GLfloat) farval ); ctx->NewState |= ctx->CurrentStack->DirtyFlag; } @@ -229,7 +229,7 @@ _mesa_MatrixMode( GLenum mode ) * Push the current matrix stack. * * \sa glPushMatrix(). - * + * * Verifies the current matrix stack is not full, and duplicates the top-most * matrix in the stack. Marks __struct gl_contextRec::NewState with the stack dirty * flag. @@ -269,7 +269,7 @@ _mesa_PushMatrix( void ) * Pop the current matrix stack. * * \sa glPopMatrix(). - * + * * Flushes the vertices, verifies the current matrix stack is not empty, and * moves the stack head down. Marks __struct gl_contextRec::NewState with the dirty * stack flag. @@ -456,7 +456,7 @@ _mesa_Translatef( GLfloat x, GLfloat y, GLfloat z ) ctx->NewState |= ctx->CurrentStack->DirtyFlag; } - + #if _HAVE_FULL_GL void GLAPIENTRY _mesa_LoadMatrixd( const GLdouble *m ) @@ -558,7 +558,7 @@ _mesa_MultTransposeMatrixdARB( const GLdouble *m ) * * Calls _math_matrix_analyse() with the top-matrix of the projection matrix * stack, and recomputes user clip positions if necessary. - * + * * \note This routine references __struct gl_contextRec::Tranform attribute values to * compute userclip positions in clip space, but is only called on * _NEW_PROJECTION. The _mesa_ClipPlane() function keeps these values up to @@ -622,10 +622,10 @@ void _mesa_update_modelview_project( struct gl_context *ctx, GLuint new_state ) { if (new_state & _NEW_MODELVIEW) { _math_matrix_analyse( ctx->ModelviewMatrixStack.Top ); - + /* Bring cull position uptodate. */ - TRANSFORM_POINT3( ctx->Transform.CullObjPos, + TRANSFORM_POINT3( ctx->Transform.CullObjPos, ctx->ModelviewMatrixStack.Top->inv, ctx->Transform.CullEyePos ); } @@ -654,7 +654,7 @@ void _mesa_update_modelview_project( struct gl_context *ctx, GLuint new_state ) * \param stack matrix stack. * \param maxDepth maximum stack depth. * \param dirtyFlag dirty flag. - * + * * Allocates an array of \p maxDepth elements for the matrix stack and calls * _math_matrix_ctr() and _math_matrix_alloc_inv() for each element to * initialize it. @@ -679,9 +679,9 @@ init_matrix_stack( struct gl_matrix_stack *stack, /** * Free matrix stack. - * + * * \param stack matrix stack. - * + * * Calls _math_matrix_dtr() for each element of the matrix stack and * frees the array. */ @@ -725,7 +725,7 @@ void _mesa_init_matrix( struct gl_context * ctx ) init_matrix_stack(&ctx->TextureMatrixStack[i], MAX_TEXTURE_STACK_DEPTH, _NEW_TEXTURE_MATRIX); for (i = 0; i < Elements(ctx->ProgramMatrixStack); i++) - init_matrix_stack(&ctx->ProgramMatrixStack[i], + init_matrix_stack(&ctx->ProgramMatrixStack[i], MAX_PROGRAM_MATRIX_STACK_DEPTH, _NEW_TRACK_MATRIX); ctx->CurrentStack = &ctx->ModelviewMatrixStack; @@ -736,7 +736,7 @@ void _mesa_init_matrix( struct gl_context * ctx ) /** * Free the context matrix data. - * + * * \param ctx GL context. * * Frees each of the matrix stacks and the combined modelview-projection @@ -758,7 +758,7 @@ void _mesa_free_matrix_data( struct gl_context *ctx ) } -/** +/** * Initialize the context transform attribute group. * * \param ctx GL context. diff --git a/src/mesa/main/matrix.h b/src/mesa/main/matrix.h index 2878cc1..01c06b6 100644 --- a/src/mesa/main/matrix.h +++ b/src/mesa/main/matrix.h @@ -97,16 +97,16 @@ extern void GLAPIENTRY _mesa_MultTransposeMatrixdARB( const GLdouble *m ); -extern void +extern void _mesa_init_matrix( struct gl_context * ctx ); -extern void +extern void _mesa_init_transform( struct gl_context *ctx ); extern void _mesa_free_matrix_data( struct gl_context *ctx ); -extern void +extern void _mesa_update_modelview_project( struct gl_context *ctx, GLuint newstate ); diff --git a/src/mesa/main/mipmap.c b/src/mesa/main/mipmap.c index 29ba2ca..29826cd 100644 --- a/src/mesa/main/mipmap.c +++ b/src/mesa/main/mipmap.c @@ -1316,7 +1316,7 @@ make_3d_mipmap(GLenum datatype, GLuint comps, GLint border, GLubyte *dstImgRow = imgDst; for (row = 0; row < dstHeightNB; row++) { - do_row_3D(datatype, comps, srcWidthNB, + do_row_3D(datatype, comps, srcWidthNB, srcImgARowA, srcImgARowB, srcImgBRowA, srcImgBRowB, dstWidthNB, dstImgRow); @@ -1479,7 +1479,7 @@ make_2d_stack_mipmap(GLenum datatype, GLuint comps, GLint border, /* Compute src and dst pointers, skipping any border */ srcA = srcPtr + border * ((srcWidth + 1) * bpt); - if (srcHeight > 1) + if (srcHeight > 1) srcB = srcA + srcRowBytes; else srcB = srcA; @@ -1632,7 +1632,7 @@ next_mipmap_level_size(GLenum target, GLint border, *dstWidth = srcWidth; /* can't go smaller */ } - if ((srcHeight - 2 * border > 1) && + if ((srcHeight - 2 * border > 1) && (target != GL_TEXTURE_1D_ARRAY_EXT)) { *dstHeight = (srcHeight - 2 * border) / 2 + 2 * border; } @@ -1823,9 +1823,9 @@ _mesa_generate_mipmap(struct gl_context *ctx, GLenum target, ASSERT(dstImage->FetchTexelf); _mesa_generate_mipmap_level(target, datatype, comps, border, - srcWidth, srcHeight, srcDepth, + srcWidth, srcHeight, srcDepth, srcData, srcImage->RowStride, - dstWidth, dstHeight, dstDepth, + dstWidth, dstHeight, dstDepth, dstData, dstImage->RowStride); diff --git a/src/mesa/main/mm.c b/src/mesa/main/mm.c index 25a0293..59d45a9 100644 --- a/src/mesa/main/mm.c +++ b/src/mesa/main/mm.c @@ -15,9 +15,9 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * WITTAWAT YAMWONG, OR ANY OTHER CONTRIBUTORS BE LIABLE FOR ANY CLAIM, - * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR - * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE + * WITTAWAT YAMWONG, OR ANY OTHER CONTRIBUTORS BE LIABLE FOR ANY CLAIM, + * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * */ @@ -61,14 +61,14 @@ struct mem_block * mmInit(unsigned ofs, unsigned size) { struct mem_block *heap, *block; - - if (!size) + + if (!size) return NULL; heap = (struct mem_block *) calloc(1, sizeof(struct mem_block)); - if (!heap) + if (!heap) return NULL; - + block = (struct mem_block *) calloc(1, sizeof(struct mem_block)); if (!block) { free(heap); @@ -95,8 +95,8 @@ mmInit(unsigned ofs, unsigned size) static struct mem_block * -SliceBlock(struct mem_block *p, - unsigned startofs, unsigned size, +SliceBlock(struct mem_block *p, + unsigned startofs, unsigned size, unsigned reserved, unsigned alignment) { struct mem_block *newblock; @@ -144,14 +144,14 @@ SliceBlock(struct mem_block *p, newblock->prev_free = p; p->next_free->prev_free = newblock; p->next_free = newblock; - + p->size = size; } /* p = middle block */ p->free = 0; - /* Remove p from the free list: + /* Remove p from the free list: */ p->next_free->prev_free = p->prev_free; p->prev_free->next_free = p->next_free; @@ -187,7 +187,7 @@ mmAllocMem(struct mem_block *heap, unsigned size, unsigned align2, unsigned star break; } - if (p == heap) + if (p == heap) return NULL; assert(p->free); @@ -203,7 +203,7 @@ mmFindBlock(struct mem_block *heap, unsigned start) struct mem_block *p; for (p = heap->next; p != heap; p = p->next) { - if (p->ofs == start) + if (p->ofs == start) return p; } @@ -227,9 +227,9 @@ Join2Blocks(struct mem_block *p) p->next = q->next; q->next->prev = p; - q->next_free->prev_free = q->prev_free; + q->next_free->prev_free = q->prev_free; q->prev_free->next_free = q->next_free; - + free(q); return 1; } diff --git a/src/mesa/main/mm.h b/src/mesa/main/mm.h index 228721c..925b7cf 100644 --- a/src/mesa/main/mm.h +++ b/src/mesa/main/mm.h @@ -15,9 +15,9 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * KEITH WHITWELL, OR ANY OTHER CONTRIBUTORS BE LIABLE FOR ANY CLAIM, - * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR - * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE + * KEITH WHITWELL, OR ANY OTHER CONTRIBUTORS BE LIABLE FOR ANY CLAIM, + * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ @@ -44,7 +44,7 @@ struct mem_block { -/** +/** * input: total size in bytes * return: a heap pointer if OK, NULL if error */ @@ -60,7 +60,7 @@ extern struct mem_block *mmInit(unsigned ofs, unsigned size); * startSearch = linear offset from start of heap to begin search * return: pointer to the allocated block, 0 if error */ -extern struct mem_block *mmAllocMem(struct mem_block *heap, unsigned size, +extern struct mem_block *mmAllocMem(struct mem_block *heap, unsigned size, unsigned align2, unsigned startSearch); /** diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h index 6b98a09..83db031 100644 --- a/src/mesa/main/mtypes.h +++ b/src/mesa/main/mtypes.h @@ -544,11 +544,11 @@ struct gl_color_table * \name Bit flags used for updating material values. */ /*@{*/ -#define MAT_ATTRIB_FRONT_AMBIENT 0 +#define MAT_ATTRIB_FRONT_AMBIENT 0 #define MAT_ATTRIB_BACK_AMBIENT 1 -#define MAT_ATTRIB_FRONT_DIFFUSE 2 +#define MAT_ATTRIB_FRONT_DIFFUSE 2 #define MAT_ATTRIB_BACK_DIFFUSE 3 -#define MAT_ATTRIB_FRONT_SPECULAR 4 +#define MAT_ATTRIB_FRONT_SPECULAR 4 #define MAT_ATTRIB_BACK_SPECULAR 5 #define MAT_ATTRIB_FRONT_EMISSION 6 #define MAT_ATTRIB_BACK_EMISSION 7 @@ -558,12 +558,12 @@ struct gl_color_table #define MAT_ATTRIB_BACK_INDEXES 11 #define MAT_ATTRIB_MAX 12 -#define MAT_ATTRIB_AMBIENT(f) (MAT_ATTRIB_FRONT_AMBIENT+(f)) -#define MAT_ATTRIB_DIFFUSE(f) (MAT_ATTRIB_FRONT_DIFFUSE+(f)) -#define MAT_ATTRIB_SPECULAR(f) (MAT_ATTRIB_FRONT_SPECULAR+(f)) -#define MAT_ATTRIB_EMISSION(f) (MAT_ATTRIB_FRONT_EMISSION+(f)) +#define MAT_ATTRIB_AMBIENT(f) (MAT_ATTRIB_FRONT_AMBIENT+(f)) +#define MAT_ATTRIB_DIFFUSE(f) (MAT_ATTRIB_FRONT_DIFFUSE+(f)) +#define MAT_ATTRIB_SPECULAR(f) (MAT_ATTRIB_FRONT_SPECULAR+(f)) +#define MAT_ATTRIB_EMISSION(f) (MAT_ATTRIB_FRONT_EMISSION+(f)) #define MAT_ATTRIB_SHININESS(f)(MAT_ATTRIB_FRONT_SHININESS+(f)) -#define MAT_ATTRIB_INDEXES(f) (MAT_ATTRIB_FRONT_INDEXES+(f)) +#define MAT_ATTRIB_INDEXES(f) (MAT_ATTRIB_FRONT_INDEXES+(f)) #define MAT_INDEX_AMBIENT 0 #define MAT_INDEX_DIFFUSE 1 @@ -638,7 +638,7 @@ struct gl_light GLfloat QuadraticAttenuation; GLboolean Enabled; /**< On/off flag */ - /** + /** * \name Derived fields */ /*@{*/ @@ -704,7 +704,7 @@ struct gl_colorbuffer_attrib GLenum DrawBuffer[MAX_DRAW_BUFFERS]; /**< Which buffer to draw into */ - /** + /** * \name alpha testing */ /*@{*/ @@ -713,7 +713,7 @@ struct gl_colorbuffer_attrib GLclampf AlphaRef; /**< Alpha reference value */ /*@}*/ - /** + /** * \name Blending */ /*@{*/ @@ -727,7 +727,7 @@ struct gl_colorbuffer_attrib GLfloat BlendColor[4]; /**< Blending color */ /*@}*/ - /** + /** * \name Logic op */ /*@{*/ @@ -752,7 +752,7 @@ struct gl_current_attrib /** * \name Current vertex attributes. * \note Values are valid only after FLUSH_VERTICES has been called. - * \note Index and Edgeflag current values are stored as floats in the + * \note Index and Edgeflag current values are stored as floats in the * SIX and SEVEN attribute slots. */ GLfloat Attrib[VERT_ATTRIB_MAX][4]; /**< Position, color, texcoords, etc */ @@ -792,7 +792,7 @@ struct gl_depthbuffer_attrib struct gl_eval_attrib { /** - * \name Enable bits + * \name Enable bits */ /*@{*/ GLboolean Map1Color4; @@ -817,7 +817,7 @@ struct gl_eval_attrib GLboolean Map2Attrib[16]; /* GL_NV_vertex_program */ GLboolean AutoNormal; /*@}*/ - + /** * \name Map Grid endpoints and divisions and calculated du values */ @@ -849,9 +849,9 @@ struct gl_fog_attrib }; -/** +/** * Hint attribute group (GL_HINT_BIT). - * + * * Values are always one of GL_FASTEST, GL_NICEST, or GL_DONT_CARE. */ struct gl_hint_attrib @@ -904,11 +904,11 @@ struct gl_light_attrib struct gl_light EnabledList; /**< List sentinel */ - /** - * Derived state for optimizations: + /** + * Derived state for optimizations: */ /*@{*/ - GLboolean _NeedEyeCoords; + GLboolean _NeedEyeCoords; GLboolean _NeedVertices; /**< Use fast shader? */ GLbitfield _Flags; /**< LIGHT_* flags, see above */ GLfloat _BaseColor[2][3]; @@ -1181,7 +1181,7 @@ typedef enum * extract RGBA, color indexes and depth components out of 1D, 2D and 3D * texture images. These functions help to isolate us from the gritty * details of all the various texture image encodings. - * + * * \param texImage texture image. * \param col texel column. * \param row texel row. @@ -1392,8 +1392,8 @@ struct gl_texture_unit GLenum BumpTarget; GLfloat RotMatrix[4]; /* 2x2 matrix */ - /** - * \name GL_EXT_texture_env_combine + /** + * \name GL_EXT_texture_env_combine */ struct gl_tex_env_combine_state Combine; @@ -1687,7 +1687,7 @@ struct gl_2d_map */ struct gl_evaluators { - /** + /** * \name 1-D maps */ /*@{*/ @@ -1703,8 +1703,8 @@ struct gl_evaluators struct gl_1d_map Map1Attrib[16]; /**< GL_NV_vertex_program */ /*@}*/ - /** - * \name 2-D maps + /** + * \name 2-D maps */ /*@{*/ struct gl_2d_map Map2Vertex3; @@ -2138,7 +2138,7 @@ struct gl_shader_program * \c NULL. */ struct gl_shader *_LinkedShaders[MESA_SHADER_TYPES]; -}; +}; #define GLSL_DUMP 0x1 /**< Dump shaders to stdout */ @@ -2277,7 +2277,7 @@ struct gl_shared_state /** * \name Thread safety and statechange notification for texture - * objects. + * objects. * * \todo Improve the granularity of locking. */ @@ -2582,7 +2582,7 @@ struct gl_program_constants struct gl_constants { GLint MaxTextureMbytes; /**< Max memory per image, in MB */ - GLint MaxTextureLevels; /**< Max mipmap levels. */ + GLint MaxTextureLevels; /**< Max mipmap levels. */ GLint Max3DTextureLevels; /**< Max mipmap levels for 3D textures */ GLint MaxCubeTextureLevels; /**< Max mipmap levels for cube textures */ GLint MaxArrayTextureLayers; /**< Max layers in array textures */ @@ -2848,7 +2848,7 @@ struct gl_matrix_stack /** - * \name Bits for image transfer operations + * \name Bits for image transfer operations * \sa __struct gl_contextRec::ImageTransferState. */ /*@{*/ @@ -2864,7 +2864,7 @@ struct gl_matrix_stack IMAGE_MAP_COLOR_BIT) /** - * \name Bits to indicate what state has changed. + * \name Bits to indicate what state has changed. * * 4 unused flags. */ @@ -2904,7 +2904,7 @@ struct gl_matrix_stack /** - * \name Bits to track array state changes + * \name Bits to track array state changes * * Also used to summarize array enabled. */ @@ -2938,7 +2938,7 @@ struct gl_matrix_stack /** * \name A bunch of flags that we think might be useful to drivers. - * + * * Set in the __struct gl_contextRec::_TriangleCaps bitfield. */ /*@{*/ @@ -3008,7 +3008,7 @@ struct gl_matrix_stack * worthwhile adding a tnl private structure just to hold this one bit * of information: */ -#define DLIST_DANGLING_REFS 0x1 +#define DLIST_DANGLING_REFS 0x1 /** Opaque declaration of display list payload data type */ @@ -3044,13 +3044,13 @@ struct gl_dlist_state GLubyte ActiveAttribSize[VERT_ATTRIB_MAX]; GLfloat CurrentAttrib[VERT_ATTRIB_MAX][4]; - + GLubyte ActiveMaterialSize[MAT_ATTRIB_MAX]; GLfloat CurrentMaterial[MAT_ATTRIB_MAX][4]; GLubyte ActiveIndex; GLfloat CurrentIndex; - + GLubyte ActiveEdgeFlag; GLboolean CurrentEdgeFlag; @@ -3142,7 +3142,7 @@ struct gl_context /*@}*/ /** \name Renderer attribute groups - * + * * We define a struct for each attribute group to make pushing and popping * attributes easy. Also it's a good organization. */ @@ -3238,7 +3238,7 @@ struct gl_context GLfloat _EyeZDir[3]; GLfloat _ModelViewInvScale; GLboolean _NeedEyeCoords; - GLboolean _ForceEyeCoords; + GLboolean _ForceEyeCoords; GLuint TextureStateTimestamp; /**< detect changes to shared state */ @@ -3259,14 +3259,14 @@ struct gl_context /** software compression/decompression supported or not */ GLboolean Mesa_DXTn; - /** + /** * Use dp4 (rather than mul/mad) instructions for position * transformation? */ GLboolean mvp_with_dp4; /** - * \name Hooks for module contexts. + * \name Hooks for module contexts. * * These will eventually live in the driver or elsewhere. */ diff --git a/src/mesa/main/nvprogram.c b/src/mesa/main/nvprogram.c index 36cea3b..de10d96 100644 --- a/src/mesa/main/nvprogram.c +++ b/src/mesa/main/nvprogram.c @@ -76,7 +76,7 @@ _mesa_ExecuteProgramNV(GLenum target, GLuint id, const GLfloat *params) _mesa_error(ctx, GL_INVALID_OPERATION, "glExecuteProgramNV"); return; } - + _mesa_problem(ctx, "glExecuteProgramNV() not supported"); } @@ -856,7 +856,7 @@ void GLAPIENTRY _mesa_ProgramNamedParameter4dNV(GLuint id, GLsizei len, const GLubyte *name, GLdouble x, GLdouble y, GLdouble z, GLdouble w) { - _mesa_ProgramNamedParameter4fNV(id, len, name, (GLfloat)x, (GLfloat)y, + _mesa_ProgramNamedParameter4fNV(id, len, name, (GLfloat)x, (GLfloat)y, (GLfloat)z, (GLfloat)w); } diff --git a/src/mesa/main/nvprogram.h b/src/mesa/main/nvprogram.h index 3a55783..302a71c 100644 --- a/src/mesa/main/nvprogram.h +++ b/src/mesa/main/nvprogram.h @@ -37,7 +37,7 @@ struct gl_program; extern void GLAPIENTRY _mesa_ExecuteProgramNV(GLenum target, GLuint id, const GLfloat *params); -extern GLboolean GLAPIENTRY +extern GLboolean GLAPIENTRY _mesa_AreProgramsResidentNV(GLsizei n, const GLuint *ids, GLboolean *residences); extern void GLAPIENTRY diff --git a/src/mesa/main/pack.c b/src/mesa/main/pack.c index 6d524e6..3a5c61d 100644 --- a/src/mesa/main/pack.c +++ b/src/mesa/main/pack.c @@ -4994,7 +4994,7 @@ _mesa_unpack_image( GLuint dimensions, for (i = 0; i < width; i++) { if (*s & srcMask) { *d |= dstMask; - } + } if (srcMask == 128) { srcMask = 1; s++; @@ -5036,7 +5036,7 @@ _mesa_unpack_image( GLuint dimensions, } else { dstMask = dstMask >> 1; - } + } } } } diff --git a/src/mesa/main/pixel.h b/src/mesa/main/pixel.h index 6f04eb6..947c5ef 100644 --- a/src/mesa/main/pixel.h +++ b/src/mesa/main/pixel.h @@ -43,7 +43,7 @@ struct gl_context; #if FEATURE_pixel_transfer -extern void +extern void _mesa_update_pixel( struct gl_context *ctx, GLuint newstate ); extern void @@ -64,7 +64,7 @@ _mesa_init_pixel_dispatch(struct _glapi_table *disp) #endif /* FEATURE_pixel_transfer */ -extern void +extern void _mesa_init_pixel( struct gl_context * ctx ); /*@}*/ diff --git a/src/mesa/main/points.h b/src/mesa/main/points.h index 306a8a5..f4a0960 100644 --- a/src/mesa/main/points.h +++ b/src/mesa/main/points.h @@ -52,7 +52,7 @@ _mesa_PointParameterf( GLenum pname, GLfloat param ); extern void GLAPIENTRY _mesa_PointParameterfv( GLenum pname, const GLfloat *params ); -extern void +extern void _mesa_init_point( struct gl_context * ctx ); diff --git a/src/mesa/main/polygon.c b/src/mesa/main/polygon.c index 9c213b9..eafa6e8 100644 --- a/src/mesa/main/polygon.c +++ b/src/mesa/main/polygon.c @@ -76,7 +76,7 @@ _mesa_CullFace( GLenum mode ) /** - * Define front- and back-facing + * Define front- and back-facing * * \param mode orientation of front-facing polygons. * @@ -119,8 +119,8 @@ _mesa_FrontFace( GLenum mode ) * \param face the polygons which \p mode applies to. * \param mode how polygons should be rasterized. * - * \sa glPolygonMode(). - * + * \sa glPolygonMode(). + * * Verifies the parameters and updates gl_polygon_attrib::FrontMode and * gl_polygon_attrib::BackMode. On change flushes the vertices and notifies the * driver via the dd_function_table::PolygonMode callback. diff --git a/src/mesa/main/polygon.h b/src/mesa/main/polygon.h index 13f7c91..cfb5dfb 100644 --- a/src/mesa/main/polygon.h +++ b/src/mesa/main/polygon.h @@ -61,7 +61,7 @@ _mesa_PolygonStipple( const GLubyte *mask ); extern void GLAPIENTRY _mesa_GetPolygonStipple( GLubyte *mask ); -extern void +extern void _mesa_init_polygon( struct gl_context * ctx ); #endif diff --git a/src/mesa/main/rastpos.c b/src/mesa/main/rastpos.c index 6f52f07..15e305d 100644 --- a/src/mesa/main/rastpos.c +++ b/src/mesa/main/rastpos.c @@ -187,7 +187,7 @@ _mesa_RasterPos3sv(const GLshort *v) static void GLAPIENTRY _mesa_RasterPos4dv(const GLdouble *v) { - rasterpos((GLfloat) v[0], (GLfloat) v[1], + rasterpos((GLfloat) v[0], (GLfloat) v[1], (GLfloat) v[2], (GLfloat) v[3]); } @@ -200,7 +200,7 @@ _mesa_RasterPos4fv(const GLfloat *v) static void GLAPIENTRY _mesa_RasterPos4iv(const GLint *v) { - rasterpos((GLfloat) v[0], (GLfloat) v[1], + rasterpos((GLfloat) v[0], (GLfloat) v[1], (GLfloat) v[2], (GLfloat) v[3]); } @@ -412,7 +412,7 @@ _mesa_WindowPos3svMESA(const GLshort *v) static void GLAPIENTRY _mesa_WindowPos4dvMESA(const GLdouble *v) { - window_pos4f((GLfloat) v[0], (GLfloat) v[1], + window_pos4f((GLfloat) v[0], (GLfloat) v[1], (GLfloat) v[2], (GLfloat) v[3]); } @@ -425,7 +425,7 @@ _mesa_WindowPos4fvMESA(const GLfloat *v) static void GLAPIENTRY _mesa_WindowPos4ivMESA(const GLint *v) { - window_pos4f((GLfloat) v[0], (GLfloat) v[1], + window_pos4f((GLfloat) v[0], (GLfloat) v[1], (GLfloat) v[2], (GLfloat) v[3]); } diff --git a/src/mesa/main/rastpos.h b/src/mesa/main/rastpos.h index d113906..8b8991b 100644 --- a/src/mesa/main/rastpos.h +++ b/src/mesa/main/rastpos.h @@ -52,7 +52,7 @@ _mesa_init_rastpos_dispatch(struct _glapi_table *disp) #endif /* FEATURE_rastpos */ -extern void +extern void _mesa_init_rastpos(struct gl_context *ctx); /*@}*/ diff --git a/src/mesa/main/readpix.c b/src/mesa/main/readpix.c index a5612e3..703da5f 100644 --- a/src/mesa/main/readpix.c +++ b/src/mesa/main/readpix.c @@ -160,7 +160,7 @@ _mesa_error_check_format_type(struct gl_context *ctx, GLenum format, GLenum type /* no errors */ return GL_FALSE; } - + void GLAPIENTRY diff --git a/src/mesa/main/remap_helper.h b/src/mesa/main/remap_helper.h index b6d3355..ee404c9 100644 --- a/src/mesa/main/remap_helper.h +++ b/src/mesa/main/remap_helper.h @@ -3,18 +3,18 @@ /* * Copyright (C) 2009 Chia-I Wu * All Rights Reserved. - * + * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, 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. IN NO EVENT SHALL diff --git a/src/mesa/main/renderbuffer.c b/src/mesa/main/renderbuffer.c index 3d1a8f8..6a2a5ad 100644 --- a/src/mesa/main/renderbuffer.c +++ b/src/mesa/main/renderbuffer.c @@ -278,7 +278,7 @@ put_values_ushort(struct gl_context *ctx, struct gl_renderbuffer *rb, GLuint cou } } } - + static void put_mono_values_ushort(struct gl_context *ctx, struct gl_renderbuffer *rb, @@ -304,7 +304,7 @@ put_mono_values_ushort(struct gl_context *ctx, struct gl_renderbuffer *rb, } } } - + /********************************************************************** * Functions for buffers of 1 X GLuint values. diff --git a/src/mesa/main/scissor.c b/src/mesa/main/scissor.c index 4cf0bc2..fdfc041 100644 --- a/src/mesa/main/scissor.c +++ b/src/mesa/main/scissor.c @@ -63,7 +63,7 @@ _mesa_Scissor( GLint x, GLint y, GLsizei width, GLsizei height ) * the dd_function_table::Scissor callback. */ void -_mesa_set_scissor(struct gl_context *ctx, +_mesa_set_scissor(struct gl_context *ctx, GLint x, GLint y, GLsizei width, GLsizei height) { if (x == ctx->Scissor.X && diff --git a/src/mesa/main/scissor.h b/src/mesa/main/scissor.h index da9385e..095e183 100644 --- a/src/mesa/main/scissor.h +++ b/src/mesa/main/scissor.h @@ -36,11 +36,11 @@ _mesa_Scissor( GLint x, GLint y, GLsizei width, GLsizei height ); extern void -_mesa_set_scissor(struct gl_context *ctx, +_mesa_set_scissor(struct gl_context *ctx, GLint x, GLint y, GLsizei width, GLsizei height); -extern void +extern void _mesa_init_scissor(struct gl_context *ctx); diff --git a/src/mesa/main/shaderapi.c b/src/mesa/main/shaderapi.c index 3378efa..afae022 100644 --- a/src/mesa/main/shaderapi.c +++ b/src/mesa/main/shaderapi.c @@ -432,7 +432,7 @@ create_shader(struct gl_context *ctx, GLenum type) } -static GLuint +static GLuint create_shader_program(struct gl_context *ctx) { GLuint name; @@ -668,7 +668,7 @@ get_programiv(struct gl_context *ctx, GLuint program, GLenum pname, GLint *param switch (pname) { case GL_DELETE_STATUS: *params = shProg->DeletePending; - break; + break; case GL_LINK_STATUS: *params = shProg->LinkStatus; break; @@ -923,7 +923,7 @@ print_shader_info(const struct gl_shader_program *shProg) default: s = ""; } - printf(" %s shader %u, checksum %u\n", s, + printf(" %s shader %u, checksum %u\n", s, shProg->Shaders[i]->Name, shProg->Shaders[i]->SourceChecksum); } @@ -1093,7 +1093,7 @@ validate_shader_program(const struct gl_shader_program *shProg, any active sampler in the current program object refers to a texture image unit where fixed-function fragment processing accesses a - texture target that does not match the sampler type, or + texture target that does not match the sampler type, or the sum of the number of active samplers in the program and the number of texture image units enabled for fixed-function fragment @@ -1561,7 +1561,7 @@ _mesa_ShaderSourceARB(GLhandleARB shaderObj, GLsizei count, free(source); source = newSource; } - } + } shader_source(ctx, shaderObj, source); diff --git a/src/mesa/main/shared.c b/src/mesa/main/shared.c index 3abee01..48f806a 100644 --- a/src/mesa/main/shared.c +++ b/src/mesa/main/shared.c @@ -272,7 +272,7 @@ delete_renderbuffer_cb(GLuint id, void *data, void *userData) * * \param ctx GL context. * \param shared shared state pointer. - * + * * Frees the display lists, the texture objects (calling the driver texture * deletion callback to free its private data) and the vertex programs, as well * as their hash tables. diff --git a/src/mesa/main/simple_list.h b/src/mesa/main/simple_list.h index ff7f888..8f2d12a 100644 --- a/src/mesa/main/simple_list.h +++ b/src/mesa/main/simple_list.h @@ -4,7 +4,7 @@ * * Intended to work with a list sentinal which is created as an empty * list. Insert & delete are O(1). - * + * * \author * (C) 1997, Keith Whitwell */ @@ -154,19 +154,19 @@ do { \ /** * Test whether element is at end of the list. - * + * * \param list list. * \param elem element. - * + * * \return non-zero if element is at end of list, or zero otherwise. */ #define at_end(list, elem) ((elem) == (list)) /** * Test if a list is empty. - * + * * \param list list. - * + * * \return non-zero if list empty, or zero otherwise. */ #define is_empty_list(list) ((list)->next == (list)) @@ -188,7 +188,7 @@ do { \ * * Same as #foreach but lets you unlink the current value during a list * traversal. Useful for freeing a list, element by element. - * + * * \param ptr pointer to the current element. * \param t temporary pointer. * \param list list. diff --git a/src/mesa/main/state.c b/src/mesa/main/state.c index cce1b46..475f6bf 100644 --- a/src/mesa/main/state.c +++ b/src/mesa/main/state.c @@ -26,7 +26,7 @@ /** * \file state.c * State management. - * + * * This file manages recalculation of derived values in struct gl_context. */ @@ -543,7 +543,7 @@ update_tricaps(struct gl_context *ctx, GLbitfield new_state) * * Calls dd_function_table::UpdateState to perform any internal state * management necessary. - * + * * \sa _mesa_update_modelview_project(), _mesa_update_texture(), * _mesa_update_buffer_bounds(), * _mesa_update_lighting() and _mesa_update_tnl_spaces(). @@ -555,7 +555,7 @@ _mesa_update_state_locked( struct gl_context *ctx ) GLbitfield prog_flags = _NEW_PROGRAM; GLbitfield new_prog_state = 0x0; - if (new_state == _NEW_CURRENT_ATTRIB) + if (new_state == _NEW_CURRENT_ATTRIB) goto out; if (MESA_VERBOSE & VERBOSE_STATE) @@ -632,7 +632,7 @@ _mesa_update_state_locked( struct gl_context *ctx ) * If the lighting space hasn't changed, may still need to recompute * light positions & normal transforms for other reasons. */ - if (new_state & _MESA_NEW_NEED_EYE_COORDS) + if (new_state & _MESA_NEW_NEED_EYE_COORDS) _mesa_update_tnl_spaces( ctx, new_state ); if (new_state & prog_flags) { @@ -690,12 +690,12 @@ _mesa_update_state( struct gl_context *ctx ) * generating vp from fixed function state, basically want to * calculate: * - * vp_out_2_fp_in( vp_in_2_vp_out( varying_inputs ) | + * vp_out_2_fp_in( vp_in_2_vp_out( varying_inputs ) | * potential_vp_outputs ) * * Where potential_vp_outputs is calculated by looking at enabled * texgen, etc. - * + * * The generated fragment program should then only declare inputs that * may vary or otherwise differ from the ctx->Current values. * Otherwise, the fp should track them as state values instead. diff --git a/src/mesa/main/state.h b/src/mesa/main/state.h index f0eb43d..d1ac21e 100644 --- a/src/mesa/main/state.h +++ b/src/mesa/main/state.h @@ -31,7 +31,7 @@ extern void _mesa_update_state(struct gl_context *ctx); -/* As above but can only be called between _mesa_lock_context_textures() and +/* As above but can only be called between _mesa_lock_context_textures() and * _mesa_unlock_context_textures(). */ extern void diff --git a/src/mesa/main/stencil.c b/src/mesa/main/stencil.c index 93e2e97..0af6de3 100644 --- a/src/mesa/main/stencil.c +++ b/src/mesa/main/stencil.c @@ -308,9 +308,9 @@ _mesa_StencilMask( GLuint mask ) * \param zfail action to take when stencil test passes, but depth test fails. * \param zpass action to take when stencil test passes and the depth test * passes (or depth testing is not enabled). - * + * * \sa glStencilOp(). - * + * * Verifies the parameters and updates the respective fields in * __struct gl_contextRec::Stencil. On change flushes the vertices and notifies the * driver via the dd_function_table::StencilOp callback. diff --git a/src/mesa/main/stencil.h b/src/mesa/main/stencil.h index b772bfd..b19bb46 100644 --- a/src/mesa/main/stencil.h +++ b/src/mesa/main/stencil.h @@ -75,7 +75,7 @@ extern void _mesa_update_stencil(struct gl_context *ctx); -extern void +extern void _mesa_init_stencil( struct gl_context * ctx ); #endif diff --git a/src/mesa/main/texcompress_fxt1.c b/src/mesa/main/texcompress_fxt1.c index 33f46d4..fa61761 100644 --- a/src/mesa/main/texcompress_fxt1.c +++ b/src/mesa/main/texcompress_fxt1.c @@ -699,7 +699,7 @@ fxt1_quantize_ALPHA1 (GLuint *cc, } sumL += sum; } - + nn_comp--; } @@ -774,7 +774,7 @@ fxt1_quantize_ALPHA1 (GLuint *cc, lolo <<= 2; lolo |= texel; } - + cc[0] = lolo; } @@ -1149,7 +1149,7 @@ fxt1_quantize_MIXED0 (GLuint *cc, } lolo = ~lolo; } - + cc[0] = lolo; } diff --git a/src/mesa/main/texenv.c b/src/mesa/main/texenv.c index 508dbf4..0bca369 100644 --- a/src/mesa/main/texenv.c +++ b/src/mesa/main/texenv.c @@ -23,7 +23,7 @@ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -/** +/** * \file texenv.c * * glTexEnv-related functions diff --git a/src/mesa/main/texenvprogram.c b/src/mesa/main/texenvprogram.c index 6e62ef7..5ef8ec5 100644 --- a/src/mesa/main/texenvprogram.c +++ b/src/mesa/main/texenvprogram.c @@ -1,9 +1,9 @@ /************************************************************************** - * + * * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas. * All Rights Reserved. * Copyright 2009 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 @@ -11,11 +11,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. @@ -23,7 +23,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. - * + * **************************************************************************/ #include "glheader.h" @@ -364,7 +364,7 @@ static GLbitfield get_fp_input_mask( struct gl_context *ctx ) if (varying_inputs & VERT_BIT_COLOR1) fp_inputs |= FRAG_BIT_COL1; - fp_inputs |= (((varying_inputs & VERT_BIT_TEX_ANY) >> VERT_ATTRIB_TEX0) + fp_inputs |= (((varying_inputs & VERT_BIT_TEX_ANY) >> VERT_ATTRIB_TEX0) << FRAG_ATTRIB_TEX0); } @@ -396,10 +396,10 @@ static GLbitfield get_fp_input_mask( struct gl_context *ctx ) if (vp_outputs & (1 << VERT_RESULT_COL1)) fp_inputs |= FRAG_BIT_COL1; - fp_inputs |= (((vp_outputs & VERT_RESULT_TEX_ANY) >> VERT_RESULT_TEX0) + fp_inputs |= (((vp_outputs & VERT_RESULT_TEX_ANY) >> VERT_RESULT_TEX0) << FRAG_ATTRIB_TEX0); } - + return fp_inputs; } @@ -438,7 +438,7 @@ static GLuint make_state_key( struct gl_context *ctx, struct state_key *key ) translate_tex_src_bit(texUnit->_ReallyEnabled); key->unit[i].shadow = ((texObj->CompareMode == GL_COMPARE_R_TO_TEXTURE) && - ((format == GL_DEPTH_COMPONENT) || + ((format == GL_DEPTH_COMPONENT) || (format == GL_DEPTH_STENCIL_EXT))); key->unit[i].NumArgsRGB = comb->_NumArgsRGB; @@ -502,7 +502,7 @@ static GLuint make_state_key( struct gl_context *ctx, struct state_key *key ) /** * Use uregs to represent registers internally, translate to Mesa's - * expected formats on emit. + * expected formats on emit. * * NOTE: These are passed by value extensively in this file rather * than as usual by pointer reference. If this disturbs you, try @@ -521,7 +521,7 @@ struct ureg { GLuint pad:7; }; -static const struct ureg undef = { +static const struct ureg undef = { PROGRAM_UNDEFINED, ~0, 0, @@ -541,7 +541,7 @@ struct texenv_fragment_program { GLbitfield temp_in_use; /**< Tracks temporary regs which are in use. */ GLboolean error; - struct ureg src_texture[MAX_TEXTURE_COORD_UNITS]; + struct ureg src_texture[MAX_TEXTURE_COORD_UNITS]; /* Reg containing each texture unit's sampled texture color, * else undef. */ @@ -551,7 +551,7 @@ struct texenv_fragment_program { * needed for bump mapping, else undef. */ - struct ureg src_previous; /**< Reg containing color from previous + struct ureg src_previous; /**< Reg containing color from previous * stage. May need to be decl'd. */ @@ -605,7 +605,7 @@ static GLboolean is_undef( struct ureg reg ) static struct ureg get_temp( struct texenv_fragment_program *p ) { GLint bit; - + /* First try and reuse temps which have been used already: */ bit = _mesa_ffs( ~p->temp_in_use & p->alu_temps ); @@ -630,7 +630,7 @@ static struct ureg get_temp( struct texenv_fragment_program *p ) static struct ureg get_tex_temp( struct texenv_fragment_program *p ) { int bit; - + /* First try to find available temp not previously used (to avoid * starting a new texture indirection). According to the spec, the * ~p->temps_output isn't necessary, but will keep it there for @@ -640,7 +640,7 @@ static struct ureg get_tex_temp( struct texenv_fragment_program *p ) /* Then any unused temporary: */ - if (!bit) + if (!bit) bit = _mesa_ffs( ~p->temp_in_use ); if (!bit) { @@ -678,7 +678,7 @@ static void release_temps(struct gl_context *ctx, struct texenv_fragment_program } -static struct ureg register_param5( struct texenv_fragment_program *p, +static struct ureg register_param5( struct texenv_fragment_program *p, GLint s0, GLint s1, GLint s2, @@ -765,11 +765,11 @@ emit_op(struct texenv_fragment_program *p, _mesa_init_instructions(inst, 1); inst->Opcode = op; - + emit_arg( &inst->SrcReg[0], src0 ); emit_arg( &inst->SrcReg[1], src1 ); emit_arg( &inst->SrcReg[2], src2 ); - + inst->SaturateMode = saturate ? SATURATE_ZERO_ONE : SATURATE_OFF; emit_dst( &inst->DstReg, dest, mask ); @@ -783,7 +783,7 @@ emit_op(struct texenv_fragment_program *p, return inst; } - + static struct ureg emit_arith( struct texenv_fragment_program *p, enum prog_opcode op, @@ -795,7 +795,7 @@ static struct ureg emit_arith( struct texenv_fragment_program *p, struct ureg src2 ) { emit_op(p, op, dest, mask, saturate, src0, src1, src2); - + /* Accounting for indirection tracking: */ if (src0.file == PROGRAM_TEMPORARY) @@ -809,7 +809,7 @@ static struct ureg emit_arith( struct texenv_fragment_program *p, if (dest.file == PROGRAM_TEMPORARY) p->alu_temps |= 1 << dest.idx; - + p->program->Base.NumAluInstructions++; return dest; } @@ -823,13 +823,13 @@ static struct ureg emit_texld( struct texenv_fragment_program *p, GLuint tex_shadow, struct ureg coord ) { - struct prog_instruction *inst = emit_op( p, op, - dest, destmask, + struct prog_instruction *inst = emit_op( p, op, + dest, destmask, GL_FALSE, /* don't saturate? */ coord, /* arg 0? */ undef, undef); - + inst->TexSrcTarget = tex_idx; inst->TexSrcUnit = tex_unit; inst->TexShadow = tex_shadow; @@ -858,7 +858,7 @@ static struct ureg emit_texld( struct texenv_fragment_program *p, } -static struct ureg register_const4f( struct texenv_fragment_program *p, +static struct ureg register_const4f( struct texenv_fragment_program *p, GLfloat s0, GLfloat s1, GLfloat s2, @@ -886,21 +886,21 @@ static struct ureg register_const4f( struct texenv_fragment_program *p, static struct ureg get_one( struct texenv_fragment_program *p ) { - if (is_undef(p->one)) + if (is_undef(p->one)) p->one = register_scalar_const(p, 1.0); return p->one; } static struct ureg get_half( struct texenv_fragment_program *p ) { - if (is_undef(p->half)) + if (is_undef(p->half)) p->half = register_scalar_const(p, 0.5); return p->half; } static struct ureg get_zero( struct texenv_fragment_program *p ) { - if (is_undef(p->zero)) + if (is_undef(p->zero)) p->zero = register_scalar_const(p, 0.0); return p->zero; } @@ -912,11 +912,11 @@ static void program_error( struct texenv_fragment_program *p, const char *msg ) p->error = 1; } -static struct ureg get_source( struct texenv_fragment_program *p, +static struct ureg get_source( struct texenv_fragment_program *p, GLuint src, GLuint unit ) { switch (src) { - case SRC_TEXTURE: + case SRC_TEXTURE: assert(!is_undef(p->src_texture[unit])); return p->src_texture[unit]; @@ -927,7 +927,7 @@ static struct ureg get_source( struct texenv_fragment_program *p, case SRC_TEXTURE4: case SRC_TEXTURE5: case SRC_TEXTURE6: - case SRC_TEXTURE7: + case SRC_TEXTURE7: assert(!is_undef(p->src_texture[src - SRC_TEXTURE0])); return p->src_texture[src - SRC_TEXTURE0]; @@ -952,10 +952,10 @@ static struct ureg get_source( struct texenv_fragment_program *p, } } -static struct ureg emit_combine_source( struct texenv_fragment_program *p, +static struct ureg emit_combine_source( struct texenv_fragment_program *p, GLuint mask, GLuint unit, - GLuint source, + GLuint source, GLuint operand ) { struct ureg arg, src, one; @@ -963,7 +963,7 @@ static struct ureg emit_combine_source( struct texenv_fragment_program *p, src = get_source(p, source, unit); switch (operand) { - case OPR_ONE_MINUS_SRC_COLOR: + case OPR_ONE_MINUS_SRC_COLOR: /* Get unused tmp, * Emit tmp = 1.0 - arg.xyzw */ @@ -971,12 +971,12 @@ static struct ureg emit_combine_source( struct texenv_fragment_program *p, one = get_one( p ); return emit_arith( p, OPCODE_SUB, arg, mask, 0, one, src, undef); - case OPR_SRC_ALPHA: + case OPR_SRC_ALPHA: if (mask == WRITEMASK_W) return src; else return swizzle1( src, SWIZZLE_W ); - case OPR_ONE_MINUS_SRC_ALPHA: + case OPR_ONE_MINUS_SRC_ALPHA: /* Get unused tmp, * Emit tmp = 1.0 - arg.wwww */ @@ -988,7 +988,7 @@ static struct ureg emit_combine_source( struct texenv_fragment_program *p, return get_zero(p); case OPR_ONE: return get_one(p); - case OPR_SRC_COLOR: + case OPR_SRC_COLOR: return src; default: assert(0); @@ -1006,29 +1006,29 @@ static GLboolean args_match( const struct state_key *key, GLuint unit ) GLuint i, numArgs = key->unit[unit].NumArgsRGB; for (i = 0; i < numArgs; i++) { - if (key->unit[unit].OptA[i].Source != key->unit[unit].OptRGB[i].Source) + if (key->unit[unit].OptA[i].Source != key->unit[unit].OptRGB[i].Source) return GL_FALSE; switch (key->unit[unit].OptA[i].Operand) { - case OPR_SRC_ALPHA: + case OPR_SRC_ALPHA: switch (key->unit[unit].OptRGB[i].Operand) { - case OPR_SRC_COLOR: - case OPR_SRC_ALPHA: + case OPR_SRC_COLOR: + case OPR_SRC_ALPHA: break; default: return GL_FALSE; } break; - case OPR_ONE_MINUS_SRC_ALPHA: + case OPR_ONE_MINUS_SRC_ALPHA: switch (key->unit[unit].OptRGB[i].Operand) { - case OPR_ONE_MINUS_SRC_COLOR: - case OPR_ONE_MINUS_SRC_ALPHA: + case OPR_ONE_MINUS_SRC_COLOR: + case OPR_ONE_MINUS_SRC_ALPHA: break; default: return GL_FALSE; } break; - default: + default: return GL_FALSE; /* impossible */ } } @@ -1055,16 +1055,16 @@ static struct ureg emit_combine( struct texenv_fragment_program *p, src[i] = emit_combine_source( p, mask, unit, opt[i].Source, opt[i].Operand ); switch (mode) { - case MODE_REPLACE: + case MODE_REPLACE: if (mask == WRITEMASK_XYZW && !saturate) return src[0]; else return emit_arith( p, OPCODE_MOV, dest, mask, saturate, src[0], undef, undef ); - case MODE_MODULATE: + case MODE_MODULATE: return emit_arith( p, OPCODE_MUL, dest, mask, saturate, src[0], src[1], undef ); - case MODE_ADD: - return emit_arith( p, OPCODE_ADD, dest, mask, saturate, + case MODE_ADD: + return emit_arith( p, OPCODE_ADD, dest, mask, saturate, src[0], src[1], undef ); case MODE_ADD_SIGNED: /* tmp = arg0 + arg1 @@ -1075,16 +1075,16 @@ static struct ureg emit_combine( struct texenv_fragment_program *p, emit_arith( p, OPCODE_ADD, tmp, mask, 0, src[0], src[1], undef ); emit_arith( p, OPCODE_SUB, dest, mask, saturate, tmp, half, undef ); return dest; - case MODE_INTERPOLATE: + case MODE_INTERPOLATE: /* Arg0 * (Arg2) + Arg1 * (1-Arg2) -- note arguments are reordered: */ return emit_arith( p, OPCODE_LRP, dest, mask, saturate, src[2], src[0], src[1] ); - case MODE_SUBTRACT: + case MODE_SUBTRACT: return emit_arith( p, OPCODE_SUB, dest, mask, saturate, src[0], src[1], undef ); case MODE_DOT3_RGBA: - case MODE_DOT3_RGBA_EXT: + case MODE_DOT3_RGBA_EXT: case MODE_DOT3_RGB_EXT: case MODE_DOT3_RGB: { struct ureg tmp0 = get_temp( p ); @@ -1095,15 +1095,15 @@ static struct ureg emit_combine( struct texenv_fragment_program *p, /* tmp0 = 2*src0 - 1 * tmp1 = 2*src1 - 1 * - * dst = tmp0 dot3 tmp1 + * dst = tmp0 dot3 tmp1 */ - emit_arith( p, OPCODE_MAD, tmp0, WRITEMASK_XYZW, 0, + emit_arith( p, OPCODE_MAD, tmp0, WRITEMASK_XYZW, 0, two, src[0], neg1); if (memcmp(&src[0], &src[1], sizeof(struct ureg)) == 0) tmp1 = tmp0; else - emit_arith( p, OPCODE_MAD, tmp1, WRITEMASK_XYZW, 0, + emit_arith( p, OPCODE_MAD, tmp1, WRITEMASK_XYZW, 0, two, src[1], neg1); emit_arith( p, OPCODE_DP3, dest, mask, saturate, tmp0, tmp1, undef); return dest; @@ -1146,7 +1146,7 @@ static struct ureg emit_combine( struct texenv_fragment_program *p, /* special - not handled here */ assert(0); return src[0]; - default: + default: assert(0); return src[0]; } @@ -1171,7 +1171,7 @@ emit_texenv(struct texenv_fragment_program *p, GLuint unit) /* this isn't really a env stage delivering a color and handled elsewhere */ return get_source(p, SRC_PREVIOUS, 0); } - + switch (key->unit[unit].ModeRGB) { case MODE_DOT3_RGB_EXT: alpha_shift = key->unit[unit].ScaleShiftA; @@ -1186,7 +1186,7 @@ emit_texenv(struct 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. */ @@ -1261,13 +1261,13 @@ emit_texenv(struct texenv_fragment_program *p, GLuint unit) shift = register_scalar_const(p, (GLfloat)(1<src_texture[unit] = emit_texld( p, OPCODE_TXP, - tmp, WRITEMASK_XYZW, + tmp, WRITEMASK_XYZW, unit, texTarget, shadow, texcoord ); @@ -1325,7 +1325,7 @@ static void load_texture( struct texenv_fragment_program *p, GLuint unit ) } } -static GLboolean load_texenv_source( struct texenv_fragment_program *p, +static GLboolean load_texenv_source( struct texenv_fragment_program *p, GLuint src, GLuint unit ) { switch (src) { @@ -1340,15 +1340,15 @@ static GLboolean load_texenv_source( struct texenv_fragment_program *p, case SRC_TEXTURE4: case SRC_TEXTURE5: case SRC_TEXTURE6: - case SRC_TEXTURE7: + case SRC_TEXTURE7: load_texture(p, src - SRC_TEXTURE0); break; - + default: /* not a texture src - do nothing */ break; } - + return GL_TRUE; } @@ -1537,7 +1537,7 @@ create_new_program(struct gl_context *ctx, struct state_key *key, p.program->FogOption = GL_NONE; } - if (p.program->Base.NumTexIndirections > ctx->Const.FragmentProgram.MaxTexIndirections) + if (p.program->Base.NumTexIndirections > ctx->Const.FragmentProgram.MaxTexIndirections) program_error(&p, "Exceeded max nr indirect texture lookups"); if (p.program->Base.NumTexInstructions > ctx->Const.FragmentProgram.MaxTexInstructions) @@ -1569,7 +1569,7 @@ create_new_program(struct gl_context *ctx, struct state_key *key, */ if (ctx->Driver.ProgramStringNotify) { GLboolean ok = ctx->Driver.ProgramStringNotify(ctx, - GL_FRAGMENT_PROGRAM_ARB, + GL_FRAGMENT_PROGRAM_ARB, &p.program->Base); /* Driver should be able to handle any texenv programs as long as * the driver correctly reported max number of texture units correctly, @@ -1596,15 +1596,15 @@ _mesa_get_fixed_func_fragment_program(struct gl_context *ctx) struct gl_fragment_program *prog; struct state_key key; GLuint keySize; - + keySize = make_state_key(ctx, &key); - + prog = (struct gl_fragment_program *) _mesa_search_program_cache(ctx->FragmentProgram.Cache, &key, keySize); if (!prog) { - prog = (struct gl_fragment_program *) + prog = (struct gl_fragment_program *) ctx->Driver.NewProgram(ctx, GL_FRAGMENT_PROGRAM_ARB, 0); create_new_program(ctx, &key, prog); diff --git a/src/mesa/main/texfetch_tmp.h b/src/mesa/main/texfetch_tmp.h index 6a0b2de..dd8e53e 100644 --- a/src/mesa/main/texfetch_tmp.h +++ b/src/mesa/main/texfetch_tmp.h @@ -27,14 +27,14 @@ /** * \file texfetch_tmp.h * Texel fetch functions template. - * + * * This template file is used by texfetch.c to generate texel fetch functions - * for 1-D, 2-D and 3-D texture images. + * for 1-D, 2-D and 3-D texture images. * * It should be expanded by defining \p DIM as the number texture dimensions * (1, 2 or 3). According to the value of \p DIM a series of macros is defined * for the texel lookup in the gl_texture_image::Data. - * + * * \author Gareth Hughes * \author Brian Paul */ @@ -872,8 +872,8 @@ static void FETCH(f_al88)( const struct gl_texture_image *texImage, GLint i, GLint j, GLint k, GLfloat *texel ) { const GLushort s = *TEXEL_ADDR(GLushort, texImage, i, j, k, 1); - texel[RCOMP] = - texel[GCOMP] = + texel[RCOMP] = + texel[GCOMP] = texel[BCOMP] = UBYTE_TO_FLOAT( s & 0xff ); texel[ACOMP] = UBYTE_TO_FLOAT( s >> 8 ); } @@ -944,8 +944,8 @@ static void FETCH(f_al88_rev)( const struct gl_texture_image *texImage, GLint i, GLint j, GLint k, GLfloat *texel ) { const GLushort s = *TEXEL_ADDR(GLushort, texImage, i, j, k, 1); - texel[RCOMP] = - texel[GCOMP] = + texel[RCOMP] = + texel[GCOMP] = texel[BCOMP] = UBYTE_TO_FLOAT( s >> 8 ); texel[ACOMP] = UBYTE_TO_FLOAT( s & 0xff ); } @@ -1307,8 +1307,8 @@ static void FETCH(sl8)(const struct gl_texture_image *texImage, GLint i, GLint j, GLint k, GLfloat *texel ) { const GLubyte *src = TEXEL_ADDR(GLubyte, texImage, i, j, k, 1); - texel[RCOMP] = - texel[GCOMP] = + texel[RCOMP] = + texel[GCOMP] = texel[BCOMP] = nonlinear_to_linear(src[0]); texel[ACOMP] = 1.0F; } @@ -1695,7 +1695,7 @@ store_texel_signed_rg_16(struct gl_texture_image *texImage, /* MESA_FORMAT_SIGNED_RGBA_16 ***********************************************/ -static void +static void FETCH(signed_rgb_16)(const struct gl_texture_image *texImage, GLint i, GLint j, GLint k, GLfloat *texel) { diff --git a/src/mesa/main/texformat.c b/src/mesa/main/texformat.c index 894c013..d7a1dee 100644 --- a/src/mesa/main/texformat.c +++ b/src/mesa/main/texformat.c @@ -49,7 +49,7 @@ * * \return a pointer to a gl_texture_format object which describes the * choosen texture format, or NULL on failure. - * + * * This is called via dd_function_table::ChooseTextureFormat. Hardware drivers * will typically override this function with a specialized version. */ diff --git a/src/mesa/main/texgen.c b/src/mesa/main/texgen.c index 108ea4c..9ac64e7 100644 --- a/src/mesa/main/texgen.c +++ b/src/mesa/main/texgen.c @@ -23,7 +23,7 @@ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -/** +/** * \file texgen.c * * glTexGen-related functions diff --git a/src/mesa/main/texgetimage.c b/src/mesa/main/texgetimage.c index 800ee31..97f367a 100644 --- a/src/mesa/main/texgetimage.c +++ b/src/mesa/main/texgetimage.c @@ -678,7 +678,7 @@ getteximage_error_check(struct gl_context *ctx, GLenum target, GLint level, } baseFormat = _mesa_get_format_base_format(texImage->TexFormat); - + /* Make sure the requested image format is compatible with the * texture's format. Note that a color index texture can be converted * to RGBA so that combo is allowed. diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c index c5ae630..449c5ba 100644 --- a/src/mesa/main/teximage.c +++ b/src/mesa/main/teximage.c @@ -225,7 +225,7 @@ _mesa_base_tex_format( struct gl_context *ctx, GLint internalFormat ) default: ; /* fallthrough */ } - + if (ctx->Extensions.TDFX_texture_compression_FXT1) { switch (internalFormat) { case GL_COMPRESSED_RGB_FXT1_3DFX: @@ -522,12 +522,12 @@ _mesa_tex_target_to_face(GLenum target) /** * Store a gl_texture_image pointer in a gl_texture_object structure * according to the target and level parameters. - * + * * \param tObj texture object. * \param target texture target. * \param level image level. * \param texImage texture image. - * + * * This was basically prompted by the introduction of cube maps. */ void @@ -550,7 +550,7 @@ _mesa_set_tex_image(struct gl_texture_object *tObj, /** * Allocate a texture image structure. - * + * * Called via ctx->Driver.NewTextureImage() unless overriden by a device * driver. * @@ -685,7 +685,7 @@ get_proxy_target(GLenum target) * \param target texture target. * * \return pointer to the texture object on success, or NULL on failure. - * + * * \sa gl_texture_unit. */ struct gl_texture_object * @@ -794,7 +794,7 @@ _mesa_get_tex_image(struct gl_context *ctx, struct gl_texture_object *texObj, if (!texObj) return NULL; - + texImage = _mesa_select_tex_image(ctx, texObj, target, level); if (!texImage) { texImage = ctx->Driver.NewTextureImage(ctx); @@ -885,7 +885,7 @@ _mesa_get_proxy_tex_image(struct gl_context *ctx, GLenum target, GLint level) * * \param ctx GL context. * \param target texture target. - * + * * \return the maximum number of allowed mipmap levels for the given * texture target, or zero if passed a bad target. * @@ -1024,7 +1024,7 @@ make_null_texture(GLint width, GLint height, GLint depth, GLenum format) /** * Reset the fields of a gl_texture_image struct to zero. - * + * * \param img texture image structure. * * This is called when a proxy texture test fails, we set all the @@ -1375,7 +1375,7 @@ target_can_be_compressed(const struct gl_context *ctx, GLenum target, return ctx->Extensions.MESA_texture_array; default: return GL_FALSE; - } + } } @@ -1484,7 +1484,7 @@ legal_texsubimage_target(struct gl_context *ctx, GLuint dims, GLenum target) /** * Test the glTexImage[123]D() parameters for errors. - * + * * \param ctx GL context. * \param dimensions texture image dimensions (must be 1, 2 or 3). * \param target texture target given by the user. @@ -1496,7 +1496,7 @@ legal_texsubimage_target(struct gl_context *ctx, GLuint dims, GLenum target) * \param height image height given by the user. * \param depth image depth given by the user. * \param border image border given by the user. - * + * * \return GL_TRUE if an error was detected, or GL_FALSE if no errors. * * Verifies each of the parameters against the constants specified in @@ -1692,7 +1692,7 @@ texture_error_check( struct gl_context *ctx, /** * Test glTexSubImage[123]D() parameters for errors. - * + * * \param ctx GL context. * \param dimensions texture image dimensions (must be 1, 2 or 3). * \param target texture target given by the user. @@ -1705,7 +1705,7 @@ texture_error_check( struct gl_context *ctx, * \param width image width given by the user. * \param height image height given by the user. * \param depth image depth given by the user. - * + * * \return GL_TRUE if an error was detected, or GL_FALSE if no errors. * * Verifies each of the parameters against the constants specified in @@ -1827,12 +1827,12 @@ subtexture_error_check2( struct gl_context *ctx, GLuint dimensions, _mesa_error(ctx, GL_INVALID_OPERATION, "glTexSubImage%dD(width = %d)", dimensions, width); return GL_TRUE; - } + } if ((height % bh != 0) && (GLuint) height != destTex->Height) { _mesa_error(ctx, GL_INVALID_OPERATION, "glTexSubImage%dD(height = %d)", dimensions, height); return GL_TRUE; - } + } } return GL_FALSE; @@ -1841,7 +1841,7 @@ subtexture_error_check2( struct gl_context *ctx, GLuint dimensions, /** * Test glCopyTexImage[12]D() parameters for errors. - * + * * \param ctx GL context. * \param dimensions texture image dimensions (must be 1, 2 or 3). * \param target texture target given by the user. @@ -1850,9 +1850,9 @@ subtexture_error_check2( struct gl_context *ctx, GLuint dimensions, * \param width image width given by the user. * \param height image height given by the user. * \param border texture border. - * + * * \return GL_TRUE if an error was detected, or GL_FALSE if no errors. - * + * * Verifies each of the parameters against the constants specified in * __struct gl_contextRec::Const and the supported extensions, and according * to the OpenGL specification. @@ -1872,7 +1872,7 @@ copytexture_error_check( struct gl_context *ctx, GLuint dimensions, _mesa_error(ctx, GL_INVALID_ENUM, "glCopyTexImage%uD(target=%s)", dimensions, _mesa_lookup_enum_by_nr(target)); return GL_TRUE; - } + } /* Basic level check (more checking in ctx->Driver.TestProxyTexImage) */ if (level < 0 || level >= MAX_TEXTURE_LEVELS) { @@ -1971,12 +1971,12 @@ copytexture_error_check( struct gl_context *ctx, GLuint dimensions, * Test glCopyTexSubImage[12]D() parameters for errors. * Note that this is the first part of error checking. * See also copytexsubimage_error_check2() below for the second part. - * + * * \param ctx GL context. * \param dimensions texture image dimensions (must be 1, 2 or 3). * \param target texture target given by the user. * \param level image level given by the user. - * + * * \return GL_TRUE if an error was detected, or GL_FALSE if no errors. */ static GLboolean @@ -2097,12 +2097,12 @@ copytexsubimage_error_check2( struct gl_context *ctx, GLuint dimensions, _mesa_error(ctx, GL_INVALID_VALUE, "glCopyTexSubImage%dD(width)", dimensions); return GL_TRUE; - } + } if ((height & 3) != 0 && (GLuint) height != teximage->Height) { _mesa_error(ctx, GL_INVALID_VALUE, "glCopyTexSubImage%dD(height)", dimensions); return GL_TRUE; - } + } } if (teximage->InternalFormat == GL_YCBCR_MESA) { @@ -2594,7 +2594,7 @@ texsubimage(struct gl_context *ctx, GLuint dims, GLenum target, GLint level, _mesa_error(ctx, GL_INVALID_ENUM, "glTexSubImage%uD(target=%s)", dims, _mesa_lookup_enum_by_nr(target)); return; - } + } if (ctx->NewState & _MESA_NEW_TRANSFER_STATE) _mesa_update_state(ctx); @@ -3007,7 +3007,7 @@ compressed_texture_error_check(struct gl_context *ctx, GLint dimensions, /* * Per GL_ARB_texture_compression: GL_INVALID_OPERATION is * generated [...] if any parameter combinations are not - * supported by the specific compressed internal format. + * supported by the specific compressed internal format. */ return GL_INVALID_OPERATION; } diff --git a/src/mesa/main/teximage.h b/src/mesa/main/teximage.h index 5bb9d49..654bb93 100644 --- a/src/mesa/main/teximage.h +++ b/src/mesa/main/teximage.h @@ -62,7 +62,7 @@ extern void _mesa_delete_texture_image( struct gl_context *ctx, struct gl_texture_image *teximage ); extern void -_mesa_free_texture_image_data( struct gl_context *ctx, +_mesa_free_texture_image_data( struct gl_context *ctx, struct gl_texture_image *texImage ); diff --git a/src/mesa/main/texobj.c b/src/mesa/main/texobj.c index 5bc5639..dabd074 100644 --- a/src/mesa/main/texobj.c +++ b/src/mesa/main/texobj.c @@ -67,7 +67,7 @@ _mesa_lookup_texture(struct gl_context *ctx, GLuint id) * * Called via ctx->Driver.NewTextureObject, unless overridden by a device * driver. - * + * * \param shared the shared GL state structure to contain the texture object * \param name integer name for the texture object * \param target either GL_TEXTURE_1D, GL_TEXTURE_2D, GL_TEXTURE_3D, @@ -642,7 +642,7 @@ _mesa_test_texobj_completeness( const struct gl_context *ctx, return; } /* check that all six images have same size */ - if (t->Image[face][i]->Width2 != width || + if (t->Image[face][i]->Width2 != width || t->Image[face][i]->Height2 != height) { incomplete(t, "CubeMap Image[n][i] bad size"); return; @@ -759,7 +759,7 @@ _mesa_get_fallback_texture(struct gl_context *ctx) /* init the image fields */ _mesa_init_teximage_fields(ctx, GL_TEXTURE_2D, texImage, - 8, 8, 1, 0, GL_RGBA, texFormat); + 8, 8, 1, 0, GL_RGBA, texFormat); ASSERT(texImage->TexFormat != MESA_FORMAT_NONE); @@ -797,7 +797,7 @@ _mesa_get_fallback_texture(struct gl_context *ctx) * Calls _mesa_HashFindFreeKeyBlock() to find a block of free texture * IDs which are stored in \p textures. Corresponding empty texture * objects are also generated. - */ + */ void GLAPIENTRY _mesa_GenTextures( GLsizei n, GLuint *textures ) { @@ -861,7 +861,7 @@ unbind_texobj_from_fbo(struct gl_context *ctx, for (j = 0; j < BUFFER_COUNT; j++) { if (fb->Attachment[j].Type == GL_TEXTURE && fb->Attachment[j].Texture == texObj) { - _mesa_remove_attachment(ctx, fb->Attachment + j); + _mesa_remove_attachment(ctx, fb->Attachment + j); } } } @@ -989,10 +989,10 @@ target_enum_to_index(GLenum target) /** * Bind a named texture to a texturing target. - * + * * \param target texture target. * \param texName texture name. - * + * * \sa glBindTexture(). * * Determines the old texture object bound and returns immediately if rebinding @@ -1093,13 +1093,13 @@ _mesa_BindTexture( GLenum target, GLuint texName ) /** * Set texture priorities. - * + * * \param n number of textures. * \param texName texture names. * \param priorities corresponding texture priorities. - * + * * \sa glPrioritizeTextures(). - * + * * Looks up each texture in the hash, clamps the corresponding priority between * 0.0 and 1.0, and calls dd_function_table::PrioritizeTexture. */ @@ -1135,13 +1135,13 @@ _mesa_PrioritizeTextures( GLsizei n, const GLuint *texName, /** * See if textures are loaded in texture memory. - * + * * \param n number of textures to query. * \param texName array with the texture names. * \param residences array which will hold the residence status. * - * \return GL_TRUE if all textures are resident and \p residences is left unchanged, - * + * \return GL_TRUE if all textures are resident and \p residences is left unchanged, + * * \sa glAreTexturesResident(). * * Looks up each texture in the hash and calls @@ -1191,7 +1191,7 @@ _mesa_AreTexturesResident(GLsizei n, const GLuint *texName, residences[i] = GL_FALSE; } } - + return allResident; } @@ -1203,7 +1203,7 @@ _mesa_AreTexturesResident(GLsizei n, const GLuint *texName, * * \return GL_TRUE if texture name corresponds to a texture, or GL_FALSE * otherwise. - * + * * \sa glIsTexture(). * * Calls _mesa_HashLookup(). diff --git a/src/mesa/main/texparam.c b/src/mesa/main/texparam.c index d5c83de..e14e25f 100644 --- a/src/mesa/main/texparam.c +++ b/src/mesa/main/texparam.c @@ -23,7 +23,7 @@ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -/** +/** * \file texparam.c * * glTexParameter-related functions @@ -46,7 +46,7 @@ * Check if a coordinate wrap mode is supported for the texture target. * \return GL_TRUE if legal, GL_FALSE otherwise */ -static GLboolean +static GLboolean validate_texture_wrap_mode(struct gl_context * ctx, GLenum target, GLenum wrap) { const struct gl_extensions * const e = & ctx->Extensions; @@ -1126,7 +1126,7 @@ _mesa_GetTexParameterfv( GLenum target, GLenum pname, GLfloat *params ) if (ctx->Extensions.ARB_shadow_ambient) { *params = obj->CompareFailValue; } - else + else error = GL_TRUE; break; case GL_GENERATE_MIPMAP_SGIS: @@ -1136,28 +1136,28 @@ _mesa_GetTexParameterfv( GLenum target, GLenum pname, GLfloat *params ) if (ctx->Extensions.ARB_shadow) { *params = (GLfloat) obj->CompareMode; } - else + else error = GL_TRUE; break; case GL_TEXTURE_COMPARE_FUNC_ARB: if (ctx->Extensions.ARB_shadow) { *params = (GLfloat) obj->CompareFunc; } - else + else error = GL_TRUE; break; case GL_DEPTH_TEXTURE_MODE_ARB: if (ctx->Extensions.ARB_depth_texture) { *params = (GLfloat) obj->DepthMode; } - else + else error = GL_TRUE; break; case GL_TEXTURE_LOD_BIAS: if (ctx->Extensions.EXT_texture_lod_bias) { *params = obj->LodBias; } - else + else error = GL_TRUE; break; #if FEATURE_OES_draw_texture @@ -1376,7 +1376,7 @@ _mesa_GetTexParameterIiv(GLenum target, GLenum pname, GLint *params) ASSERT_OUTSIDE_BEGIN_END(ctx); texObj = get_texobj(ctx, target, GL_TRUE); - + switch (pname) { case GL_TEXTURE_BORDER_COLOR: COPY_4V(params, texObj->BorderColor.i); @@ -1396,7 +1396,7 @@ _mesa_GetTexParameterIuiv(GLenum target, GLenum pname, GLuint *params) ASSERT_OUTSIDE_BEGIN_END(ctx); texObj = get_texobj(ctx, target, GL_TRUE); - + switch (pname) { case GL_TEXTURE_BORDER_COLOR: COPY_4V(params, texObj->BorderColor.i); @@ -1406,7 +1406,7 @@ _mesa_GetTexParameterIuiv(GLenum target, GLenum pname, GLuint *params) GLint ip[4]; _mesa_GetTexParameteriv(target, pname, ip); params[0] = ip[0]; - if (pname == GL_TEXTURE_SWIZZLE_RGBA_EXT || + if (pname == GL_TEXTURE_SWIZZLE_RGBA_EXT || pname == GL_TEXTURE_CROP_RECT_OES) { params[1] = ip[1]; params[2] = ip[2]; diff --git a/src/mesa/main/texstate.c b/src/mesa/main/texstate.c index f4d7718..02f2c8e 100644 --- a/src/mesa/main/texstate.c +++ b/src/mesa/main/texstate.c @@ -22,7 +22,7 @@ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -/** +/** * \file texstate.c * * Texture state handling. @@ -152,7 +152,7 @@ _mesa_print_texunit_state( struct gl_context *ctx, GLuint unit ) /** * Convert "classic" texture environment to ARB_texture_env_combine style * environments. - * + * * \param state texture_env_combine state vector to be filled-in. * \param mode Classic texture environment mode (i.e., \c GL_REPLACE, * \c GL_BLEND, \c GL_DECAL, etc.). @@ -186,7 +186,7 @@ calculate_derived_texenv( struct gl_tex_env_combine_state *state, case GL_DUDV_ATI: state->SourceA[0] = GL_PREVIOUS; break; - + default: _mesa_problem(NULL, "Invalid texBaseFormat 0x%x in calculate_derived_texenv", @@ -203,7 +203,7 @@ calculate_derived_texenv( struct gl_tex_env_combine_state *state, mode_rgb = (texBaseFormat == GL_ALPHA) ? GL_REPLACE : mode; mode_a = mode; break; - + case GL_DECAL: mode_rgb = GL_INTERPOLATE; mode_a = GL_REPLACE; @@ -274,7 +274,7 @@ calculate_derived_texenv( struct gl_tex_env_combine_state *state, mode); return; } - + state->ModeRGB = (state->SourceRGB[0] != GL_PREVIOUS) ? mode_rgb : GL_REPLACE; state->ModeA = (state->SourceA[0] != GL_PREVIOUS) @@ -297,7 +297,7 @@ _mesa_ActiveTextureARB(GLenum texture) ctx->Const.MaxTextureCoordUnits); ASSERT(k <= Elements(ctx->Texture.Unit)); - + ASSERT_OUTSIDE_BEGIN_END(ctx); if (MESA_VERBOSE & (VERBOSE_API|VERBOSE_TEXTURE)) @@ -674,11 +674,11 @@ _mesa_update_texture( struct gl_context *ctx, GLuint new_state ) /** * Allocate the proxy textures for the given context. - * + * * \param ctx the context to allocate proxies for. - * + * * \return GL_TRUE on success, or GL_FALSE on failure - * + * * If run out of memory part way through the allocations, clean up and return * GL_FALSE. */ @@ -826,7 +826,7 @@ _mesa_free_texture_data(struct gl_context *ctx) /** * Update the default texture objects in the given context to reference those - * specified in the shared state and release those referencing the old + * specified in the shared state and release those referencing the old * shared state. */ void diff --git a/src/mesa/main/texstate.h b/src/mesa/main/texstate.h index 9871230..eee72ca 100644 --- a/src/mesa/main/texstate.h +++ b/src/mesa/main/texstate.h @@ -75,13 +75,13 @@ _mesa_ClientActiveTextureARB( GLenum target ); */ /*@{*/ -extern void +extern void _mesa_update_texture( struct gl_context *ctx, GLuint new_state ); extern GLboolean _mesa_init_texture( struct gl_context *ctx ); -extern void +extern void _mesa_free_texture_data( struct gl_context *ctx ); extern void diff --git a/src/mesa/main/texstore.c b/src/mesa/main/texstore.c index 89677c5..fa57725 100644 --- a/src/mesa/main/texstore.c +++ b/src/mesa/main/texstore.c @@ -70,7 +70,7 @@ enum { - ZERO = 4, + ZERO = 4, ONE = 5 }; @@ -137,7 +137,7 @@ static const struct { GLubyte format_idx; GLubyte to_rgba[6]; GLubyte from_rgba[6]; -} mappings[MAX_IDX] = +} mappings[MAX_IDX] = { { IDX_LUMINANCE, @@ -244,7 +244,7 @@ get_map_idx(GLenum value) _mesa_problem(NULL, "Unexpected inFormat"); return 0; } -} +} /** @@ -256,7 +256,7 @@ get_map_idx(GLenum value) * \return map[6] a full 6-component map */ static void -compute_component_mapping(GLenum inFormat, GLenum outFormat, +compute_component_mapping(GLenum inFormat, GLenum outFormat, GLubyte *map) { const int inFmt = get_map_idx(inFormat); @@ -264,23 +264,23 @@ compute_component_mapping(GLenum inFormat, GLenum outFormat, const GLubyte *in2rgba = mappings[inFmt].to_rgba; const GLubyte *rgba2out = mappings[outFmt].from_rgba; int i; - + for (i = 0; i < 4; i++) map[i] = in2rgba[rgba2out[i]]; map[ZERO] = ZERO; - map[ONE] = ONE; + map[ONE] = ONE; #if 0 printf("from %x/%s to %x/%s map %d %d %d %d %d %d\n", inFormat, _mesa_lookup_enum_by_nr(inFormat), outFormat, _mesa_lookup_enum_by_nr(outFormat), - map[0], - map[1], - map[2], - map[3], - map[4], - map[5]); + map[0], + map[1], + map[2], + map[3], + map[4], + map[5]); #endif } @@ -669,7 +669,7 @@ _mesa_make_temp_chan_image(struct gl_context *ctx, GLuint dims, * \param count number of pixels to copy/swizzle. */ static void -swizzle_copy(GLubyte *dst, GLuint dstComponents, const GLubyte *src, +swizzle_copy(GLubyte *dst, GLuint dstComponents, const GLubyte *src, GLuint srcComponents, const GLubyte *map, GLuint count) { #define SWZ_CPY(dst, src, count, dstComps, srcComps) \ @@ -815,7 +815,7 @@ static const GLubyte * byteswap_mapping( GLboolean swapBytes, GLenum srcType ) { - if (!swapBytes) + if (!swapBytes) return map_identity; switch (srcType) { @@ -836,7 +836,7 @@ byteswap_mapping( GLboolean swapBytes, * Transfer a GLubyte texture image with component swizzling. */ static void -_mesa_swizzle_ubyte_image(struct gl_context *ctx, +_mesa_swizzle_ubyte_image(struct gl_context *ctx, GLuint dimensions, GLenum srcFormat, GLenum srcType, @@ -895,7 +895,7 @@ _mesa_swizzle_ubyte_image(struct gl_context *ctx, GLubyte *dstImage = (GLubyte *) dstAddr + dstYoffset * dstRowStride + dstXoffset * dstComponents; - swizzle_copy(dstImage, dstComponents, srcImage, srcComponents, map, + swizzle_copy(dstImage, dstComponents, srcImage, srcComponents, map, srcWidth * srcHeight); } else { @@ -1343,7 +1343,7 @@ _mesa_texstore_rgba8888(TEXSTORE_PARAMS) dstmap[1] = 1; dstmap[0] = 0; } - + _mesa_swizzle_ubyte_image(ctx, dims, srcFormat, srcType, @@ -1352,7 +1352,7 @@ _mesa_texstore_rgba8888(TEXSTORE_PARAMS) dstAddr, dstXoffset, dstYoffset, dstZoffset, dstRowStride, dstImageOffsets, srcWidth, srcHeight, srcDepth, srcAddr, - srcPacking); + srcPacking); } else { /* general path */ @@ -1516,7 +1516,7 @@ _mesa_texstore_argb8888(TEXSTORE_PARAMS) (srcType == GL_UNSIGNED_BYTE || srcType == GL_UNSIGNED_INT_8_8_8_8 || srcType == GL_UNSIGNED_INT_8_8_8_8_REV) && - can_swizzle(baseInternalFormat) && + can_swizzle(baseInternalFormat) && can_swizzle(srcFormat)) { GLubyte dstmap[4]; @@ -1542,7 +1542,7 @@ _mesa_texstore_argb8888(TEXSTORE_PARAMS) dstmap[1] = 0; dstmap[0] = 3; } - + _mesa_swizzle_ubyte_image(ctx, dims, srcFormat, srcType, @@ -1552,7 +1552,7 @@ _mesa_texstore_argb8888(TEXSTORE_PARAMS) dstRowStride, dstImageOffsets, srcWidth, srcHeight, srcDepth, srcAddr, - srcPacking); + srcPacking); } else { /* general path */ @@ -1672,7 +1672,7 @@ _mesa_texstore_rgb888(TEXSTORE_PARAMS) dstmap[1] = 1; dstmap[2] = 0; dstmap[3] = ONE; /* ? */ - + _mesa_swizzle_ubyte_image(ctx, dims, srcFormat, srcType, @@ -1681,7 +1681,7 @@ _mesa_texstore_rgb888(TEXSTORE_PARAMS) dstAddr, dstXoffset, dstYoffset, dstZoffset, dstRowStride, dstImageOffsets, srcWidth, srcHeight, srcDepth, srcAddr, - srcPacking); + srcPacking); } else { /* general path */ @@ -1798,7 +1798,7 @@ _mesa_texstore_bgr888(TEXSTORE_PARAMS) dstmap[1] = 1; dstmap[2] = 2; dstmap[3] = ONE; /* ? */ - + _mesa_swizzle_ubyte_image(ctx, dims, srcFormat, srcType, @@ -1807,8 +1807,8 @@ _mesa_texstore_bgr888(TEXSTORE_PARAMS) dstAddr, dstXoffset, dstYoffset, dstZoffset, dstRowStride, dstImageOffsets, srcWidth, srcHeight, srcDepth, srcAddr, - srcPacking); - } + srcPacking); + } else { /* general path */ const GLchan *tempImage = _mesa_make_temp_chan_image(ctx, dims, @@ -2101,7 +2101,7 @@ _mesa_texstore_unorm88(TEXSTORE_PARAMS) } dstmap[2] = ZERO; /* ? */ dstmap[3] = ONE; /* ? */ - + _mesa_swizzle_ubyte_image(ctx, dims, srcFormat, srcType, @@ -2110,8 +2110,8 @@ _mesa_texstore_unorm88(TEXSTORE_PARAMS) dstAddr, dstXoffset, dstYoffset, dstZoffset, dstRowStride, dstImageOffsets, srcWidth, srcHeight, srcDepth, srcAddr, - srcPacking); - } + srcPacking); + } else { /* general path */ const GLchan *tempImage = _mesa_make_temp_chan_image(ctx, dims, @@ -2529,7 +2529,7 @@ _mesa_texstore_a8(TEXSTORE_PARAMS) dstmap[1] = ZERO; /* ? */ dstmap[2] = ZERO; /* ? */ dstmap[3] = ONE; /* ? */ - + _mesa_swizzle_ubyte_image(ctx, dims, srcFormat, srcType, @@ -2538,8 +2538,8 @@ _mesa_texstore_a8(TEXSTORE_PARAMS) dstAddr, dstXoffset, dstYoffset, dstZoffset, dstRowStride, dstImageOffsets, srcWidth, srcHeight, srcDepth, srcAddr, - srcPacking); - } + srcPacking); + } else { /* general path */ const GLchan *tempImage = _mesa_make_temp_chan_image(ctx, dims, @@ -2703,7 +2703,7 @@ _mesa_texstore_dudv8(TEXSTORE_PARAMS) } dstmap[2] = ZERO; /* ? */ dstmap[3] = ONE; /* ? */ - + _mesa_swizzle_ubyte_image(ctx, dims, GL_LUMINANCE_ALPHA, /* hack */ GL_UNSIGNED_BYTE, /* hack */ @@ -2712,8 +2712,8 @@ _mesa_texstore_dudv8(TEXSTORE_PARAMS) dstAddr, dstXoffset, dstYoffset, dstZoffset, dstRowStride, dstImageOffsets, srcWidth, srcHeight, srcDepth, srcAddr, - srcPacking); - } + srcPacking); + } else { /* general path - note this is defined for 2d textures only */ const GLint components = _mesa_components_in_format(baseInternalFormat); @@ -2740,7 +2740,7 @@ _mesa_texstore_dudv8(TEXSTORE_PARAMS) dst += srcWidth * components; src += srcStride; } - + src = tempImage; dst = (GLbyte *) dstAddr + dstYoffset * dstRowStride @@ -2961,7 +2961,7 @@ _mesa_texstore_signed_rgba8888(TEXSTORE_PARAMS) dstmap[1] = 1; dstmap[0] = 0; } - + _mesa_swizzle_ubyte_image(ctx, dims, srcFormat, srcType, @@ -2970,7 +2970,7 @@ _mesa_texstore_signed_rgba8888(TEXSTORE_PARAMS) dstAddr, dstXoffset, dstYoffset, dstZoffset, dstRowStride, dstImageOffsets, srcWidth, srcHeight, srcDepth, srcAddr, - srcPacking); + srcPacking); } else { /* general path */ @@ -3137,7 +3137,7 @@ _mesa_texstore_s8_z24(TEXSTORE_PARAMS) GLubyte stencil[MAX_WIDTH]; GLint i; GLboolean keepdepth = GL_FALSE, keepstencil = GL_FALSE; - + if (srcFormat == GL_DEPTH_COMPONENT) { /* preserve stencil */ keepstencil = GL_TRUE; } @@ -3151,7 +3151,7 @@ _mesa_texstore_s8_z24(TEXSTORE_PARAMS) GL_UNSIGNED_INT, /* dst type */ keepstencil ? depth : dstRow, /* dst addr */ depthScale, - srcType, src, srcPacking); + srcType, src, srcPacking); if (keepstencil == GL_FALSE) /* get the 8-bit stencil values */ @@ -3203,7 +3203,7 @@ _mesa_texstore_s8(TEXSTORE_PARAMS) = _mesa_image_row_stride(srcPacking, srcWidth, srcFormat, srcType) / sizeof(GLuint); GLint img, row; - + for (img = 0; img < srcDepth; img++) { GLubyte *dstRow = (GLubyte *) dstAddr + dstImageOffsets[dstZoffset + img] diff --git a/src/mesa/main/transformfeedback.c b/src/mesa/main/transformfeedback.c index d297b5e..d8f27da 100644 --- a/src/mesa/main/transformfeedback.c +++ b/src/mesa/main/transformfeedback.c @@ -457,14 +457,14 @@ _mesa_BindBufferRange(GLenum target, GLuint index, /* must be positive and multiple of four */ _mesa_error(ctx, GL_INVALID_VALUE, "glBindBufferRange(size%d)", (int) size); return; - } + } if (offset & 0x3) { /* must be multiple of four */ _mesa_error(ctx, GL_INVALID_VALUE, "glBindBufferRange(offset=%d)", (int) offset); return; - } + } bufObj = _mesa_lookup_bufferobj(ctx, buffer); if (!bufObj) { @@ -478,7 +478,7 @@ _mesa_BindBufferRange(GLenum target, GLuint index, "glBindBufferRange(offset + size %d > buffer size %d)", (int) (offset + size), (int) (bufObj->Size)); return; - } + } bind_buffer_range(ctx, index, bufObj, offset, size); } diff --git a/src/mesa/main/varray.c b/src/mesa/main/varray.c index 3fcd1f4..e6966eb 100644 --- a/src/mesa/main/varray.c +++ b/src/mesa/main/varray.c @@ -345,7 +345,7 @@ _mesa_PointSizePointer(GLenum type, GLsizei stride, const GLvoid *ptr) "glPointSizePointer(ES 1.x only)"); return; } - + update_array(ctx, "glPointSizePointer", &ctx->Array.ArrayObj->PointSize, _NEW_ARRAY_POINT_SIZE, legalTypes, 1, 1, @@ -1133,7 +1133,7 @@ _mesa_print_arrays(struct gl_context *ctx) /** * Initialize vertex array state for given context. */ -void +void _mesa_init_varray(struct gl_context *ctx) { ctx->Array.DefaultArrayObj = _mesa_new_array_object(ctx, 0); @@ -1160,7 +1160,7 @@ delete_arrayobj_cb(GLuint id, void *data, void *userData) /** * Free vertex array state for given context. */ -void +void _mesa_free_varray_data(struct gl_context *ctx) { _mesa_HashDeleteAll(ctx->Array.Objects, delete_arrayobj_cb, ctx); diff --git a/src/mesa/main/varray.h b/src/mesa/main/varray.h index af93241..37f513f 100644 --- a/src/mesa/main/varray.h +++ b/src/mesa/main/varray.h @@ -230,7 +230,7 @@ _mesa_print_arrays(struct gl_context *ctx); extern void _mesa_init_varray( struct gl_context * ctx ); -extern void +extern void _mesa_free_varray_data(struct gl_context *ctx); #else diff --git a/src/mesa/main/viewport.c b/src/mesa/main/viewport.c index 323edc0..d22e15c 100644 --- a/src/mesa/main/viewport.c +++ b/src/mesa/main/viewport.c @@ -53,7 +53,7 @@ _mesa_Viewport(GLint x, GLint y, GLsizei width, GLsizei height) /** * Set new viewport parameters and update derived state (the _WindowMap * matrix). Usually called from _mesa_Viewport(). - * + * * \param ctx GL context. * \param x, y coordinates of the lower left corner of the viewport rectangle. * \param width width of the viewport rectangle. @@ -151,7 +151,7 @@ _mesa_DepthRangef(GLclampf nearval, GLclampf farval) _mesa_DepthRange(nearval, farval); } -/** +/** * Initialize the context viewport attribute group. * \param ctx the GL context. */ @@ -173,7 +173,7 @@ void _mesa_init_viewport(struct gl_context *ctx) } -/** +/** * Free the context viewport attribute group data. * \param ctx the GL context. */ diff --git a/src/mesa/main/viewport.h b/src/mesa/main/viewport.h index db4507b..405e8e7 100644 --- a/src/mesa/main/viewport.h +++ b/src/mesa/main/viewport.h @@ -35,7 +35,7 @@ extern void GLAPIENTRY _mesa_Viewport(GLint x, GLint y, GLsizei width, GLsizei height); -extern void +extern void _mesa_set_viewport(struct gl_context *ctx, GLint x, GLint y, GLsizei width, GLsizei height); @@ -47,11 +47,11 @@ extern void GLAPIENTRY _mesa_DepthRangef(GLclampf nearval, GLclampf farval); -extern void +extern void _mesa_init_viewport(struct gl_context *ctx); -extern void +extern void _mesa_free_viewport_data(struct gl_context *ctx); diff --git a/src/mesa/main/vtxfmt.h b/src/mesa/main/vtxfmt.h index 147385c..beb9d31 100644 --- a/src/mesa/main/vtxfmt.h +++ b/src/mesa/main/vtxfmt.h @@ -1,6 +1,6 @@ /** * \file vtxfmt.h - * + * * \author Keith Whitwell * \author Gareth Hughes */ diff --git a/src/mesa/math/descrip.mms b/src/mesa/math/descrip.mms index 3aaa6eb..7a71072 100644 --- a/src/mesa/math/descrip.mms +++ b/src/mesa/math/descrip.mms @@ -23,7 +23,7 @@ SOURCES = m_debug_clip.c m_debug_norm.c m_debug_xform.c m_eval.c m_matrix.c\ OBJECTS = m_debug_clip.obj,m_debug_norm.obj,m_debug_xform.obj,m_eval.obj,\ m_matrix.obj,m_translate.obj,m_vector.obj,m_xform.obj - + ##### RULES ##### VERSION=Mesa V3.4 diff --git a/src/mesa/math/m_debug_util.h b/src/mesa/math/m_debug_util.h index ed11c84..09740a6 100644 --- a/src/mesa/math/m_debug_util.h +++ b/src/mesa/math/m_debug_util.h @@ -191,7 +191,7 @@ extern char *mesa_profile; unsigned int a,d; \ __asm__ volatile("rdtsc" : "=a" (a), "=d" (d)); \ (val) = ((unsigned long)a) | (((unsigned long)d)<<32); \ -} while(0) +} while(0) /* Copied from i386 PIII version */ #define INIT_COUNTER() \ @@ -306,9 +306,9 @@ enum { NIL = 0, ONE = 1, NEG = -1, VAR = 2 }; #elif defined(_MSC_VER) # define ALIGN16(type, array) type array __declspec(align(16)) /* GH: Does this work? */ #elif defined(__WATCOMC__) -# define ALIGN16(type, array) /* Watcom does not support this */ +# define ALIGN16(type, array) /* Watcom does not support this */ #elif defined(__xlC__) -# define ALIGN16(type, array) type __align (16) array +# define ALIGN16(type, array) type __align (16) array #else # warning "ALIGN16 will not 16-byte align!\n" # define ALIGN16 diff --git a/src/mesa/math/m_matrix.c b/src/mesa/math/m_matrix.c index 02aedba..4104d65 100644 --- a/src/mesa/math/m_matrix.c +++ b/src/mesa/math/m_matrix.c @@ -100,15 +100,15 @@ /*@}*/ -/** +/** * Test geometry related matrix flags. - * + * * \param mat a pointer to a GLmatrix structure. * \param a flags mask. * * \returns non-zero if all geometry related matrix flags are contained within * the mask, or zero otherwise. - */ + */ #define TEST_MAT_FLAGS(mat, a) \ ((MAT_FLAGS_GEOMETRY & (~(a)) & ((mat)->flags) ) == 0) @@ -158,7 +158,7 @@ static GLfloat Identity[16] = { * \warning Is assumed that \p product != \p b. \p product == \p a is allowed. * * \note KW: 4*16 = 64 multiplications - * + * * \author This \c matmul was contributed by Thomas Malik */ static void matmul4( GLfloat *product, const GLfloat *a, const GLfloat *b ) @@ -208,7 +208,7 @@ static void matmul34( GLfloat *product, const GLfloat *a, const GLfloat *b ) * matrix, and that will receive the product result. * \param m right multiplication matrix array. * \param flags flags of the matrix \p m. - * + * * Joins both flags and marks the type and inverse as dirty. Calls matmul34() * if both matrices are 3D, or matmul4() otherwise. */ @@ -228,7 +228,7 @@ static void matrix_multf( GLmatrix *mat, const GLfloat *m, GLuint flags ) * \param dest destination matrix. * \param a left matrix. * \param b right matrix. - * + * * Joins both flags and marks the type and inverse as dirty. Calls matmul34() * if both matrices are 3D, or matmul4() otherwise. */ @@ -251,7 +251,7 @@ _math_matrix_mul_matrix( GLmatrix *dest, const GLmatrix *a, const GLmatrix *b ) * * \param dest left and destination matrix. * \param m right matrix array. - * + * * Marks the matrix flags with general flag, and type and inverse dirty flags. * Calls matmul4() for the multiplication. */ @@ -290,7 +290,7 @@ static void print_matrix_floats( const GLfloat m[16] ) /** * Dumps the contents of a GLmatrix structure. - * + * * \param m pointer to the GLmatrix structure. */ void @@ -320,10 +320,10 @@ _math_matrix_print( const GLmatrix *m ) * \param m matrix array. * \param c column of the desired element. * \param r row of the desired element. - * + * * \return value of the desired element. * - * Calculate the linear storage index of the element and references it. + * Calculate the linear storage index of the element and references it. */ #define MAT(m,r,c) (m)[(c)*4+(r)] @@ -341,12 +341,12 @@ _math_matrix_print( const GLmatrix *m ) /** * Compute inverse of 4x4 transformation matrix. - * + * * \param mat pointer to a GLmatrix structure. The matrix inverse will be * stored in the GLmatrix::inv attribute. - * + * * \return GL_TRUE for success, GL_FALSE for failure (\p singular matrix). - * + * * \author * Code contributed by Jacques Leroy jle@star.be * @@ -469,10 +469,10 @@ static GLboolean invert_matrix_general( GLmatrix *mat ) /** * Compute inverse of a general 3d transformation matrix. - * + * * \param mat pointer to a GLmatrix structure. The matrix inverse will be * stored in the GLmatrix::inv attribute. - * + * * \return GL_TRUE for success, GL_FALSE for failure (\p singular matrix). * * \author Adapted from graphics gems II. @@ -543,10 +543,10 @@ static GLboolean invert_matrix_3d_general( GLmatrix *mat ) /** * Compute inverse of a 3d transformation matrix. - * + * * \param mat pointer to a GLmatrix structure. The matrix inverse will be * stored in the GLmatrix::inv attribute. - * + * * \return GL_TRUE for success, GL_FALSE for failure (\p singular matrix). * * If the matrix is not an angle preserving matrix then calls @@ -626,10 +626,10 @@ static GLboolean invert_matrix_3d( GLmatrix *mat ) /** * Compute inverse of an identity transformation matrix. - * + * * \param mat pointer to a GLmatrix structure. The matrix inverse will be * stored in the GLmatrix::inv attribute. - * + * * \return always GL_TRUE. * * Simply copies Identity into GLmatrix::inv. @@ -642,13 +642,13 @@ static GLboolean invert_matrix_identity( GLmatrix *mat ) /** * Compute inverse of a no-rotation 3d transformation matrix. - * + * * \param mat pointer to a GLmatrix structure. The matrix inverse will be * stored in the GLmatrix::inv attribute. - * + * * \return GL_TRUE for success, GL_FALSE for failure (\p singular matrix). * - * Calculates the + * Calculates the */ static GLboolean invert_matrix_3d_no_rot( GLmatrix *mat ) { @@ -674,10 +674,10 @@ static GLboolean invert_matrix_3d_no_rot( GLmatrix *mat ) /** * Compute inverse of a no-rotation 2d transformation matrix. - * + * * \param mat pointer to a GLmatrix structure. The matrix inverse will be * stored in the GLmatrix::inv attribute. - * + * * \return GL_TRUE for success, GL_FALSE for failure (\p singular matrix). * * Calculates the inverse matrix by applying the inverse scaling and @@ -758,10 +758,10 @@ static inv_mat_func inv_mat_tab[7] = { /** * Compute inverse of a transformation matrix. - * + * * \param mat pointer to a GLmatrix structure. The matrix inverse will be * stored in the GLmatrix::inv attribute. - * + * * \return GL_TRUE for success, GL_FALSE for failure (\p singular matrix). * * Calls the matrix inversion function in inv_mat_tab corresponding to the @@ -1199,10 +1199,10 @@ _math_matrix_set_identity( GLmatrix *mat ) #define SQ(x) ((x)*(x)) /** - * Determine type and flags from scratch. + * Determine type and flags from scratch. * * \param mat matrix. - * + * * This is expensive enough to only want to do it once. */ static void analyse_from_scratch( GLmatrix *mat ) @@ -1315,7 +1315,7 @@ static void analyse_from_scratch( GLmatrix *mat ) /** * Analyze a matrix given that its flags are accurate. - * + * * This is the more common operation, hopefully. */ static void analyse_from_flags( GLmatrix *mat ) @@ -1459,7 +1459,7 @@ _math_matrix_copy( GLmatrix *to, const GLmatrix *from ) /** * Loads a matrix array into GLmatrix. - * + * * \param m matrix array. * \param mat matrix. * diff --git a/src/mesa/ppc/common_ppc.c b/src/mesa/ppc/common_ppc.c index c7cec96..a365b1f 100644 --- a/src/mesa/ppc/common_ppc.c +++ b/src/mesa/ppc/common_ppc.c @@ -47,7 +47,7 @@ unsigned long _mesa_ppc_cpu_features = 0; * Detect CPU features and install optimized transform and lighting routines. * Currently, CPU features are only detected. The optimized routines have * yet to be written. - * + * * \bug * This routine is highly specific to Linux kernel 2.6. I'm still waiting * to hear back from the glibc folk on how to do this "right". @@ -83,7 +83,7 @@ void _mesa_init_all_ppc_transform_asm( void ) fclose( f ); } - + # ifndef USE_VMX_ASM _mesa_ppc_cpu_features &= ~PPC_FEATURE_HAS_ALTIVEC; # endif diff --git a/src/mesa/program/arbprogparse.c b/src/mesa/program/arbprogparse.c index ca63e72..10f4356 100644 --- a/src/mesa/program/arbprogparse.c +++ b/src/mesa/program/arbprogparse.c @@ -184,7 +184,7 @@ _mesa_parse_arb_vertex_program(struct gl_context *ctx, GLenum target, if (program->Base.String != NULL) free(program->Base.String); - /* Copy the relevant contents of the arb_program struct into the + /* Copy the relevant contents of the arb_program struct into the * vertex_program struct. */ program->Base.String = prog.String; @@ -210,7 +210,7 @@ _mesa_parse_arb_vertex_program(struct gl_context *ctx, GLenum target, if (program->Base.Parameters) _mesa_free_parameter_list(program->Base.Parameters); - program->Base.Parameters = prog.Parameters; + program->Base.Parameters = prog.Parameters; #if DEBUG_VP printf("____________Vertex program %u __________\n", program->Base.Id); diff --git a/src/mesa/program/descrip.mms b/src/mesa/program/descrip.mms index 5973002..90288e3 100644 --- a/src/mesa/program/descrip.mms +++ b/src/mesa/program/descrip.mms @@ -60,7 +60,7 @@ OBJECTS = \ VERSION=Mesa V3.4 ##### TARGETS ##### -all : +all : $(MMS)$(MMSQUALIFIERS) $(LIBDIR)$(GL_LIB) set def [.slang] $(MMS)$(MMSQUALIFIERS) diff --git a/src/mesa/program/hash_table.c b/src/mesa/program/hash_table.c index f7ef366..46e6b3f 100644 --- a/src/mesa/program/hash_table.c +++ b/src/mesa/program/hash_table.c @@ -65,7 +65,7 @@ hash_table_ctor(unsigned num_buckets, hash_func_t hash, num_buckets = 16; } - ht = malloc(sizeof(*ht) + ((num_buckets - 1) + ht = malloc(sizeof(*ht) + ((num_buckets - 1) * sizeof(ht->buckets[0]))); if (ht != NULL) { ht->hash = hash; diff --git a/src/mesa/program/ir_to_mesa.cpp b/src/mesa/program/ir_to_mesa.cpp index 6712a98..b1e1725 100644 --- a/src/mesa/program/ir_to_mesa.cpp +++ b/src/mesa/program/ir_to_mesa.cpp @@ -703,7 +703,7 @@ ir_to_mesa_visitor::get_temp(const glsl_type *type) variable_storage * ir_to_mesa_visitor::find_variable_storage(ir_variable *var) { - + variable_storage *entry; foreach_iter(exec_list_iterator, iter, this->variables) { diff --git a/src/mesa/program/lex.yy.c b/src/mesa/program/lex.yy.c index 135eca6..5f02654 100644 --- a/src/mesa/program/lex.yy.c +++ b/src/mesa/program/lex.yy.c @@ -33,7 +33,7 @@ #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L /* C99 says to define __STDC_LIMIT_MACROS before including stdint.h, - * if you want the limit (max/min) macros for int types. + * if you want the limit (max/min) macros for int types. */ #ifndef __STDC_LIMIT_MACROS #define __STDC_LIMIT_MACROS 1 @@ -50,7 +50,7 @@ typedef uint32_t flex_uint32_t; typedef signed char flex_int8_t; typedef short int flex_int16_t; typedef int flex_int32_t; -typedef unsigned char flex_uint8_t; +typedef unsigned char flex_uint8_t; typedef unsigned short int flex_uint16_t; typedef unsigned int flex_uint32_t; @@ -183,7 +183,7 @@ typedef struct yy_buffer_state *YY_BUFFER_STATE; #define EOB_ACT_LAST_MATCH 2 #define YY_LESS_LINENO(n) - + /* Return all but the first "n" matched characters back to the input stream. */ #define yyless(n) \ do \ @@ -245,7 +245,7 @@ struct yy_buffer_state int yy_bs_lineno; /**< The line count. */ int yy_bs_column; /**< The column count. */ - + /* Whether to try to fill the input buffer when we reach the * end of it. */ @@ -1232,9 +1232,9 @@ static int yy_init_globals (yyscan_t yyscanner ); /* This must go here because YYSTYPE and YYLTYPE are included * from bison output in section 1.*/ # define yylval yyg->yylval_r - + # define yylloc yyg->yylloc_r - + int yylex_init (yyscan_t* scanner); int yylex_init_extra (YY_EXTRA_TYPE user_defined,yyscan_t* scanner); @@ -1273,9 +1273,9 @@ YYSTYPE * yyget_lval (yyscan_t yyscanner ); void yyset_lval (YYSTYPE * yylval_param ,yyscan_t yyscanner ); YYLTYPE *yyget_lloc (yyscan_t yyscanner ); - + void yyset_lloc (YYLTYPE * yylloc_param ,yyscan_t yyscanner ); - + /* Macros after this point can all be overridden by user definitions in * section 1. */ @@ -1289,7 +1289,7 @@ extern int yywrap (yyscan_t yyscanner ); #endif static void yyunput (int c,char *buf_ptr ,yyscan_t yyscanner); - + #ifndef yytext_ptr static void yy_flex_strncpy (char *,yyconst char *,int ,yyscan_t yyscanner); #endif @@ -2329,7 +2329,7 @@ YY_RULE_SETUP const unsigned s = swiz_from_char(yytext[1]); yylval->swiz_mask.swizzle = MAKE_SWIZZLE4(s, s, s, s); yylval->swiz_mask.mask = mask_from_char(yytext[1]); - return MASK1; + return MASK1; } YY_BREAK case 154: @@ -3004,7 +3004,7 @@ static void yy_load_buffer_state (yyscan_t yyscanner) YY_BUFFER_STATE yy_create_buffer (FILE * file, int size , yyscan_t yyscanner) { YY_BUFFER_STATE b; - + b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) ,yyscanner ); if ( ! b ) YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); @@ -3070,7 +3070,7 @@ static void yy_load_buffer_state (yyscan_t yyscanner) } b->yy_is_interactive = 0; - + errno = oerrno; } @@ -3176,9 +3176,9 @@ static void yyensure_buffer_stack (yyscan_t yyscanner) , yyscanner); if ( ! yyg->yy_buffer_stack ) YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" ); - + memset(yyg->yy_buffer_stack, 0, num_to_alloc * sizeof(struct yy_buffer_state*)); - + yyg->yy_buffer_stack_max = num_to_alloc; yyg->yy_buffer_stack_top = 0; return; @@ -3207,12 +3207,12 @@ static void yyensure_buffer_stack (yyscan_t yyscanner) * @param base the character buffer * @param size the size in bytes of the character buffer * @param yyscanner The scanner object. - * @return the newly allocated buffer state object. + * @return the newly allocated buffer state object. */ YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size , yyscan_t yyscanner) { YY_BUFFER_STATE b; - + if ( size < 2 || base[size-2] != YY_END_OF_BUFFER_CHAR || base[size-1] != YY_END_OF_BUFFER_CHAR ) @@ -3248,7 +3248,7 @@ YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size , yyscan_t yyscann */ YY_BUFFER_STATE yy_scan_string (yyconst char * yystr , yyscan_t yyscanner) { - + return yy_scan_bytes(yystr,strlen(yystr) ,yyscanner); } @@ -3265,7 +3265,7 @@ YY_BUFFER_STATE yy_scan_bytes (yyconst char * yybytes, int _yybytes_len , yysc char *buf; yy_size_t n; int i; - + /* Get memory for full buffer, including space for trailing EOB's. */ n = _yybytes_len + 2; buf = (char *) yyalloc(n ,yyscanner ); @@ -3333,10 +3333,10 @@ YY_EXTRA_TYPE yyget_extra (yyscan_t yyscanner) int yyget_lineno (yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - + if (! YY_CURRENT_BUFFER) return 0; - + return yylineno; } @@ -3346,10 +3346,10 @@ int yyget_lineno (yyscan_t yyscanner) int yyget_column (yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - + if (! YY_CURRENT_BUFFER) return 0; - + return yycolumn; } @@ -3410,8 +3410,8 @@ void yyset_lineno (int line_number , yyscan_t yyscanner) /* lineno is only valid if an input buffer exists. */ if (! YY_CURRENT_BUFFER ) - yy_fatal_error( "yyset_lineno called with no buffer" , yyscanner); - + yy_fatal_error( "yyset_lineno called with no buffer" , yyscanner); + yylineno = line_number; } @@ -3425,8 +3425,8 @@ void yyset_column (int column_no , yyscan_t yyscanner) /* column is only valid if an input buffer exists. */ if (! YY_CURRENT_BUFFER ) - yy_fatal_error( "yyset_column called with no buffer" , yyscanner); - + yy_fatal_error( "yyset_column called with no buffer" , yyscanner); + yycolumn = column_no; } @@ -3479,13 +3479,13 @@ YYLTYPE *yyget_lloc (yyscan_t yyscanner) struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; return yylloc; } - + void yyset_lloc (YYLTYPE * yylloc_param , yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; yylloc = yylloc_param; } - + /* User-visible API */ /* yylex_init is special because it creates the scanner itself, so it is @@ -3533,20 +3533,20 @@ int yylex_init_extra(YY_EXTRA_TYPE yy_user_defined,yyscan_t* ptr_yy_globals ) errno = EINVAL; return 1; } - + *ptr_yy_globals = (yyscan_t) yyalloc ( sizeof( struct yyguts_t ), &dummy_yyguts ); - + if (*ptr_yy_globals == NULL){ errno = ENOMEM; return 1; } - + /* By setting to 0xAA, we expose bugs in yy_init_globals. Leave at 0x00 for releases. */ memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t)); - + yyset_extra (yy_user_defined, *ptr_yy_globals); - + return yy_init_globals ( *ptr_yy_globals ); } diff --git a/src/mesa/program/nvfragparse.c b/src/mesa/program/nvfragparse.c index 8516b5f..37b6560 100644 --- a/src/mesa/program/nvfragparse.c +++ b/src/mesa/program/nvfragparse.c @@ -574,7 +574,7 @@ Parse_TextureImageId(struct parse_state *parseState, if (!Parse_Token(parseState, imageSrc)) RETURN_ERROR; - + if (imageSrc[0] != 'T' || imageSrc[1] != 'E' || imageSrc[2] != 'X') { @@ -1030,7 +1030,7 @@ Parse_VectorSrc(struct parse_state *parseState, RETURN_ERROR2("Undefined constant or parameter: ", ident); } srcReg->File = PROGRAM_NAMED_PARAM; - srcReg->Index = paramIndex; + srcReg->Index = paramIndex; } else if (IsDigit(token[0]) || token[0] == '-' || token[0] == '+' || token[0] == '.'){ /* literal scalar constant */ @@ -1053,7 +1053,7 @@ Parse_VectorSrc(struct parse_state *parseState, paramIndex = _mesa_add_unnamed_constant(parseState->parameters, values, 4, NULL); srcReg->File = PROGRAM_NAMED_PARAM; - srcReg->Index = paramIndex; + srcReg->Index = paramIndex; } else { RETURN_ERROR2("Invalid source register name", token); @@ -1147,7 +1147,7 @@ Parse_ScalarSrcReg(struct parse_state *parseState, paramIndex = _mesa_add_unnamed_constant(parseState->parameters, values, 4, NULL); srcReg->File = PROGRAM_NAMED_PARAM; - srcReg->Index = paramIndex; + srcReg->Index = paramIndex; } else if (IsLetter(token[0])){ /* named param/constant */ @@ -1161,7 +1161,7 @@ Parse_ScalarSrcReg(struct parse_state *parseState, RETURN_ERROR2("Undefined constant or parameter: ", ident); } srcReg->File = PROGRAM_NAMED_PARAM; - srcReg->Index = paramIndex; + srcReg->Index = paramIndex; } else if (IsDigit(token[0])) { /* scalar literal */ @@ -1171,7 +1171,7 @@ Parse_ScalarSrcReg(struct parse_state *parseState, RETURN_ERROR; paramIndex = _mesa_add_unnamed_constant(parseState->parameters, values, 4, NULL); - srcReg->Index = paramIndex; + srcReg->Index = paramIndex; srcReg->File = PROGRAM_NAMED_PARAM; needSuffix = GL_FALSE; } diff --git a/src/mesa/program/nvvertparse.c b/src/mesa/program/nvvertparse.c index bdd44a4..8a2a313 100644 --- a/src/mesa/program/nvvertparse.c +++ b/src/mesa/program/nvvertparse.c @@ -288,8 +288,8 @@ static const char *InputRegisters[MAX_NV_VERTEX_PROGRAM_INPUTS + 1] = { }; static const char *OutputRegisters[MAX_NV_VERTEX_PROGRAM_OUTPUTS + 1] = { - "HPOS", "COL0", "COL1", "FOGC", - "TEX0", "TEX1", "TEX2", "TEX3", "TEX4", "TEX5", "TEX6", "TEX7", + "HPOS", "COL0", "COL1", "FOGC", + "TEX0", "TEX1", "TEX2", "TEX3", "TEX4", "TEX5", "TEX6", "TEX7", "PSIZ", "BFC0", "BFC1", NULL }; diff --git a/src/mesa/program/prog_cache.c b/src/mesa/program/prog_cache.c index 56ca598..f2e9f06 100644 --- a/src/mesa/program/prog_cache.c +++ b/src/mesa/program/prog_cache.c @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2003 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ @@ -108,7 +108,7 @@ clear_cache(struct gl_context *ctx, struct gl_program_cache *cache) { struct cache_item *c, *next; GLuint i; - + cache->last = NULL; for (i = 0; i < cache->size; i++) { @@ -157,7 +157,7 @@ struct gl_program * _mesa_search_program_cache(struct gl_program_cache *cache, const void *key, GLuint keysize) { - if (cache->last && + if (cache->last && memcmp(cache->last->key, key, keysize) == 0) { return cache->last->program; } @@ -196,7 +196,7 @@ _mesa_program_cache_insert(struct gl_context *ctx, if (cache->n_items > cache->size * 1.5) { if (cache->size < 1000) rehash(cache); - else + else clear_cache(ctx, cache); } diff --git a/src/mesa/program/prog_cache.h b/src/mesa/program/prog_cache.h index 4907ae3..d0caa14 100644 --- a/src/mesa/program/prog_cache.h +++ b/src/mesa/program/prog_cache.h @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2003 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ diff --git a/src/mesa/program/prog_execute.c b/src/mesa/program/prog_execute.c index 1d97a07..90dc695 100644 --- a/src/mesa/program/prog_execute.c +++ b/src/mesa/program/prog_execute.c @@ -325,7 +325,7 @@ fetch_vector4_deriv(struct gl_context * ctx, result[1] = deriv[GET_SWZ(source->Swizzle, 1)]; result[2] = deriv[GET_SWZ(source->Swizzle, 2)]; result[3] = deriv[GET_SWZ(source->Swizzle, 3)]; - + if (source->Abs) { result[0] = FABSF(result[0]); result[1] = FABSF(result[1]); @@ -895,7 +895,7 @@ _mesa_execute_program(struct gl_context * ctx, } else { q[0] = LDEXPF(1.0, (int) floor_t0); - /* Note: GL_NV_vertex_program expects + /* Note: GL_NV_vertex_program expects * result.z = result.x * APPX(result.y) * We do what the ARB extension says. */ diff --git a/src/mesa/program/prog_optimize.c b/src/mesa/program/prog_optimize.c index 164297a..16fc10d 100644 --- a/src/mesa/program/prog_optimize.c +++ b/src/mesa/program/prog_optimize.c @@ -778,7 +778,7 @@ _mesa_remove_extra_moves(struct gl_program *prog) if (prevInst->DstReg.File == PROGRAM_TEMPORARY && prevInst->DstReg.Index == id && prevInst->DstReg.RelAddr == 0 && - prevInst->DstReg.CondSrc == 0 && + prevInst->DstReg.CondSrc == 0 && prevInst->DstReg.CondMask == COND_TR) { const GLuint dst_mask = prevInst->DstReg.WriteMask; diff --git a/src/mesa/program/prog_parameter.c b/src/mesa/program/prog_parameter.c index 3570cab..2e5ec09 100644 --- a/src/mesa/program/prog_parameter.c +++ b/src/mesa/program/prog_parameter.c @@ -97,7 +97,7 @@ _mesa_free_parameter_list(struct gl_program_parameter_list *paramList) * store all the values (in blocks of 4). * * \param paramList the list to add the parameter to - * \param type type of parameter, such as + * \param type type of parameter, such as * \param name the parameter name, will be duplicated/copied! * \param size number of elements in 'values' vector (1..4, or more) * \param datatype GL_FLOAT, GL_FLOAT_VECx, GL_INT, GL_INT_VECx or GL_NONE. @@ -188,7 +188,7 @@ _mesa_add_named_parameter(struct gl_program_parameter_list *paramList, { return _mesa_add_parameter(paramList, PROGRAM_NAMED_PARAM, name, 4, GL_NONE, values, NULL, 0x0); - + } @@ -574,7 +574,7 @@ _mesa_clone_parameter_list(const struct gl_program_parameter_list *list) else { clone->Parameters[j].Size = p->Size; } - + } clone->StateFlags = list->StateFlags; diff --git a/src/mesa/program/prog_parameter_layout.c b/src/mesa/program/prog_parameter_layout.c index d7dc97e..e5aab2c 100644 --- a/src/mesa/program/prog_parameter_layout.c +++ b/src/mesa/program/prog_parameter_layout.c @@ -82,7 +82,7 @@ copy_indirect_accessed_array(struct gl_program_parameter_list *src, j = dst->NumParameters; } else { for (j = 0; j < dst->NumParameters; j++) { - if (memcmp(dst->Parameters[j].StateIndexes, curr->StateIndexes, + if (memcmp(dst->Parameters[j].StateIndexes, curr->StateIndexes, sizeof(curr->StateIndexes)) == 0) { return -1; } @@ -188,7 +188,7 @@ _mesa_layout_parameters(struct asm_parser_state *state) inst->Base.SrcReg[i].Index = _mesa_add_unnamed_constant(layout, v, p->Size, & swizzle); - inst->Base.SrcReg[i].Swizzle = + inst->Base.SrcReg[i].Swizzle = _mesa_combine_swizzles(swizzle, inst->Base.SrcReg[i].Swizzle); break; } diff --git a/src/mesa/program/prog_print.c b/src/mesa/program/prog_print.c index abebf39..6511767 100644 --- a/src/mesa/program/prog_print.c +++ b/src/mesa/program/prog_print.c @@ -488,7 +488,7 @@ fprint_dst_reg(FILE * f, dstReg->Index, mode, dstReg->RelAddr, prog, GL_FALSE, GL_FALSE, 0), _mesa_writemask_string(dstReg->WriteMask)); - + if (dstReg->CondMask != COND_TR) { fprintf(f, " (%s.%s)", _mesa_condcode_string(dstReg->CondMask), @@ -507,7 +507,7 @@ fprint_dst_reg(FILE * f, static void fprint_src_reg(FILE *f, - const struct prog_src_register *srcReg, + const struct prog_src_register *srcReg, gl_prog_print_mode mode, const struct gl_program *prog) { @@ -916,7 +916,7 @@ _mesa_fprint_program_parameters(FILE *f, fprintf(f, "InputsRead: 0x%x (0b%s)\n", prog->InputsRead, binary(prog->InputsRead)); fprintf(f, "OutputsWritten: 0x%llx (0b%s)\n", - (unsigned long long)prog->OutputsWritten, + (unsigned long long)prog->OutputsWritten, binary(prog->OutputsWritten)); fprintf(f, "NumInstructions=%d\n", prog->NumInstructions); fprintf(f, "NumTemporaries=%d\n", prog->NumTemporaries); @@ -941,7 +941,7 @@ _mesa_fprint_program_parameters(FILE *f, const GLfloat *p = prog->LocalParams[i]; fprintf(f, "%2d: %f, %f, %f, %f\n", i, p[0], p[1], p[2], p[3]); } -#endif +#endif _mesa_print_parameter_list(prog->Parameters); } diff --git a/src/mesa/program/prog_statevars.c b/src/mesa/program/prog_statevars.c index c310acb..b8d1b31 100644 --- a/src/mesa/program/prog_statevars.c +++ b/src/mesa/program/prog_statevars.c @@ -400,10 +400,10 @@ _mesa_fetch_state(struct gl_context *ctx, const gl_state_index state[], return; case STATE_NORMAL_SCALE: - ASSIGN_4V(value, - ctx->_ModelViewInvScale, - ctx->_ModelViewInvScale, - ctx->_ModelViewInvScale, + ASSIGN_4V(value, + ctx->_ModelViewInvScale, + ctx->_ModelViewInvScale, + ctx->_ModelViewInvScale, 1); return; @@ -594,7 +594,7 @@ _mesa_fetch_state(struct gl_context *ctx, const gl_state_index state[], { const int unit = (int) state[2]; GLfloat *rotMat22 = ctx->Texture.Unit[unit].RotMatrix; - value[0] = rotMat22[0]; + value[0] = rotMat22[0]; value[1] = rotMat22[2]; value[2] = 0.0; value[3] = 0.0; @@ -612,7 +612,7 @@ _mesa_fetch_state(struct gl_context *ctx, const gl_state_index state[], } return; - /* XXX: make sure new tokens added here are also handled in the + /* XXX: make sure new tokens added here are also handled in the * _mesa_program_state_flags() switch, below. */ default: diff --git a/src/mesa/program/program_lexer.l b/src/mesa/program/program_lexer.l index 0a50dab..6d281a3 100644 --- a/src/mesa/program/program_lexer.l +++ b/src/mesa/program/program_lexer.l @@ -397,7 +397,7 @@ ARRAYSHADOW2D { return_token_or_IDENTIFIER(require_ARB_fp && require const unsigned s = swiz_from_char(yytext[1]); yylval->swiz_mask.swizzle = MAKE_SWIZZLE4(s, s, s, s); yylval->swiz_mask.mask = mask_from_char(yytext[1]); - return MASK1; + return MASK1; } "."[xyzw]{4} { diff --git a/src/mesa/program/program_parse.tab.c b/src/mesa/program/program_parse.tab.c index baef311..e1d5f72 100644 --- a/src/mesa/program/program_parse.tab.c +++ b/src/mesa/program/program_parse.tab.c @@ -2,20 +2,20 @@ /* A Bison parser, made by GNU Bison 2.4.1. */ /* Skeleton implementation for Bison's Yacc-like parsers in C - + Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. - + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - + You should have received a copy of the GNU General Public License along with this program. If not, see . */ @@ -28,7 +28,7 @@ special exception, which will cause the skeleton and the resulting Bison output files to be licensed under the GNU General Public License without this special exception. - + This special exception was added by the Free Software Foundation in version 2.2 of Bison. */ @@ -2861,7 +2861,7 @@ YYLTYPE yylloc; /* Line 1455 of yacc.c */ #line 849 "program_parse.y" { - gl_register_file file = ((yyvsp[(1) - (1)].temp_sym).name != NULL) + gl_register_file file = ((yyvsp[(1) - (1)].temp_sym).name != NULL) ? (yyvsp[(1) - (1)].temp_sym).param_binding_type : PROGRAM_CONSTANT; set_src_reg_swz(& (yyval.src_reg), file, (yyvsp[(1) - (1)].temp_sym).param_binding_begin, @@ -3380,7 +3380,7 @@ YYLTYPE yylloc; { if (((yyvsp[(4) - (6)].integer) != 0) && ((unsigned) (yyvsp[(4) - (6)].integer) != (yyvsp[(6) - (6)].temp_sym).param_binding_length)) { free((yyvsp[(2) - (6)].string)); - yyerror(& (yylsp[(4) - (6)]), state, + yyerror(& (yylsp[(4) - (6)]), state, "parameter array size and number of bindings must match"); YYERROR; } else { @@ -4744,7 +4744,7 @@ YYLTYPE yylloc; /* Line 1455 of yacc.c */ #line 2088 "program_parse.y" { - (yyval.integer) = 0; + (yyval.integer) = 0; ;} break; @@ -5412,7 +5412,7 @@ int add_state_reference(struct gl_program_parameter_list *param_list, int initialize_symbol_from_state(struct gl_program *prog, - struct asm_symbol *param_var, + struct asm_symbol *param_var, const gl_state_index tokens[STATE_LENGTH]) { int idx = -1; @@ -5464,7 +5464,7 @@ initialize_symbol_from_state(struct gl_program *prog, int initialize_symbol_from_param(struct gl_program *prog, - struct asm_symbol *param_var, + struct asm_symbol *param_var, const gl_state_index tokens[STATE_LENGTH]) { int idx = -1; @@ -5529,7 +5529,7 @@ initialize_symbol_from_param(struct gl_program *prog, */ int initialize_symbol_from_const(struct gl_program *prog, - struct asm_symbol *param_var, + struct asm_symbol *param_var, const struct asm_vector *vec, GLboolean allowSwizzle) { @@ -5669,7 +5669,7 @@ _mesa_parse_arb_program(struct gl_context *ctx, GLenum target, const GLubyte *st } - + /* Add one instruction to store the "END" instruction. */ state->prog->Instructions = diff --git a/src/mesa/program/program_parse.tab.h b/src/mesa/program/program_parse.tab.h index 045241d..07ef4da 100644 --- a/src/mesa/program/program_parse.tab.h +++ b/src/mesa/program/program_parse.tab.h @@ -2,20 +2,20 @@ /* A Bison parser, made by GNU Bison 2.4.1. */ /* Skeleton interface for Bison's Yacc-like parsers in C - + Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. - + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - + You should have received a copy of the GNU General Public License along with this program. If not, see . */ @@ -28,7 +28,7 @@ special exception, which will cause the skeleton and the resulting Bison output files to be licensed under the GNU General Public License without this special exception. - + This special exception was added by the Free Software Foundation in version 2.2 of Bison. */ diff --git a/src/mesa/program/program_parse.y b/src/mesa/program/program_parse.y index 784ea28..7d41f02 100644 --- a/src/mesa/program/program_parse.y +++ b/src/mesa/program/program_parse.y @@ -184,7 +184,7 @@ static struct asm_instruction *asm_instruction_copy_ctor( %token TEXCOORD TEXENV TEXGEN TEXGEN_Q TEXGEN_R TEXGEN_S TEXGEN_T TEXTURE TRANSPOSE %token TEXTURE_UNIT TEX_1D TEX_2D TEX_3D TEX_CUBE TEX_RECT %token TEX_SHADOW1D TEX_SHADOW2D TEX_SHADOWRECT -%token TEX_ARRAY1D TEX_ARRAY2D TEX_ARRAYSHADOW1D TEX_ARRAYSHADOW2D +%token TEX_ARRAY1D TEX_ARRAY2D TEX_ARRAYSHADOW1D TEX_ARRAYSHADOW2D %token VERTEX VTXATTRIB %token WEIGHT @@ -249,7 +249,7 @@ static struct asm_instruction *asm_instruction_copy_ctor( %type statePointProperty %type stateOptMatModifier stateMatModifier stateMatrixRowNum -%type stateOptModMatNum stateModMatNum statePaletteMatNum +%type stateOptModMatNum stateModMatNum statePaletteMatNum %type stateProgramMatNum %type ambDiffSpecProperty @@ -847,7 +847,7 @@ srcReg: USED_IDENTIFIER /* temporaryReg | progParamSingle */ } | paramSingleItemUse { - gl_register_file file = ($1.name != NULL) + gl_register_file file = ($1.name != NULL) ? $1.param_binding_type : PROGRAM_CONSTANT; set_src_reg_swz(& $$, file, $1.param_binding_begin, @@ -1012,7 +1012,7 @@ swizzleSuffix: MASK1 | { $$.swizzle = SWIZZLE_NOOP; $$.mask = WRITEMASK_XYZW; } ; -optionalMask: MASK4 | MASK3 | MASK2 | MASK1 +optionalMask: MASK4 | MASK3 | MASK2 | MASK1 | { $$.swizzle = SWIZZLE_NOOP; $$.mask = WRITEMASK_XYZW; } ; @@ -1230,7 +1230,7 @@ PARAM_multipleStmt: PARAM IDENTIFIER '[' optArraySize ']' paramMultipleInit { if (($4 != 0) && ((unsigned) $4 != $6.param_binding_length)) { free($2); - yyerror(& @4, state, + yyerror(& @4, state, "parameter array size and number of bindings must match"); YYERROR; } else { @@ -1639,7 +1639,7 @@ stateMatrixItem: MATRIX stateMatrixName stateOptMatModifier } ; -stateOptMatModifier: +stateOptMatModifier: { $$ = 0; } @@ -1649,11 +1649,11 @@ stateOptMatModifier: } ; -stateMatModifier: INVERSE +stateMatModifier: INVERSE { $$ = STATE_MATRIX_INVERSE; } - | TRANSPOSE + | TRANSPOSE { $$ = STATE_MATRIX_TRANSPOSE; } @@ -2086,7 +2086,7 @@ optResultFaceType: optResultColorType: { - $$ = 0; + $$ = 0; } | PRIMARY { @@ -2451,7 +2451,7 @@ int add_state_reference(struct gl_program_parameter_list *param_list, int initialize_symbol_from_state(struct gl_program *prog, - struct asm_symbol *param_var, + struct asm_symbol *param_var, const gl_state_index tokens[STATE_LENGTH]) { int idx = -1; @@ -2503,7 +2503,7 @@ initialize_symbol_from_state(struct gl_program *prog, int initialize_symbol_from_param(struct gl_program *prog, - struct asm_symbol *param_var, + struct asm_symbol *param_var, const gl_state_index tokens[STATE_LENGTH]) { int idx = -1; @@ -2568,7 +2568,7 @@ initialize_symbol_from_param(struct gl_program *prog, */ int initialize_symbol_from_const(struct gl_program *prog, - struct asm_symbol *param_var, + struct asm_symbol *param_var, const struct asm_vector *vec, GLboolean allowSwizzle) { @@ -2708,7 +2708,7 @@ _mesa_parse_arb_program(struct gl_context *ctx, GLenum target, const GLubyte *st } - + /* Add one instruction to store the "END" instruction. */ state->prog->Instructions = diff --git a/src/mesa/program/program_parser.h b/src/mesa/program/program_parser.h index d689eef..ade49bc 100644 --- a/src/mesa/program/program_parser.h +++ b/src/mesa/program/program_parser.h @@ -47,7 +47,7 @@ struct asm_symbol { */ unsigned param_binding_type; - /** + /** * Offset into the program_parameter_list where the tokens representing our * bound state (or constants) start. */ diff --git a/src/mesa/program/programopt.c b/src/mesa/program/programopt.c index f92881f..8dffb0a 100644 --- a/src/mesa/program/programopt.c +++ b/src/mesa/program/programopt.c @@ -23,7 +23,7 @@ */ /** - * \file programopt.c + * \file programopt.c * Vertex/Fragment program optimizations and transformations for program * options, etc. * @@ -218,12 +218,12 @@ _mesa_insert_mvp_mad_code(struct gl_context *ctx, struct gl_vertex_program *vpro void _mesa_insert_mvp_code(struct gl_context *ctx, struct gl_vertex_program *vprog) { - if (ctx->mvp_with_dp4) + if (ctx->mvp_with_dp4) _mesa_insert_mvp_dp4_code( ctx, vprog ); else _mesa_insert_mvp_mad_code( ctx, vprog ); } - + @@ -416,7 +416,7 @@ is_texture_instruction(const struct prog_instruction *inst) return GL_FALSE; } } - + /** * Count the number of texure indirections in the given program. @@ -437,11 +437,11 @@ _mesa_count_texture_indirections(struct gl_program *prog) const struct prog_instruction *inst = prog->Instructions + i; if (is_texture_instruction(inst)) { - if (((inst->SrcReg[0].File == PROGRAM_TEMPORARY) && + if (((inst->SrcReg[0].File == PROGRAM_TEMPORARY) && (tempsOutput & (1 << inst->SrcReg[0].Index))) || ((inst->Opcode != OPCODE_KIL) && - (inst->DstReg.File == PROGRAM_TEMPORARY) && - (aluTemps & (1 << inst->DstReg.Index)))) + (inst->DstReg.File == PROGRAM_TEMPORARY) && + (aluTemps & (1 << inst->DstReg.Index)))) { indirections++; tempsOutput = 0x0; diff --git a/src/mesa/program/symbol_table.c b/src/mesa/program/symbol_table.c index 004f1f8..52d7e5e 100644 --- a/src/mesa/program/symbol_table.c +++ b/src/mesa/program/symbol_table.c @@ -88,7 +88,7 @@ struct symbol_header { struct scope_level { /** Link to next (inner) scope level. */ struct scope_level *next; - + /** Linked list of symbols with the same scope. */ struct symbol *symbols; }; @@ -187,7 +187,7 @@ void _mesa_symbol_table_push_scope(struct _mesa_symbol_table *table) { struct scope_level *const scope = calloc(1, sizeof(*scope)); - + scope->next = table->current_scope; table->current_scope = scope; table->depth++; @@ -207,7 +207,7 @@ _mesa_symbol_table_iterator_ctor(struct _mesa_symbol_table *table, { struct _mesa_symbol_table_iterator *iter = calloc(1, sizeof(*iter)); struct symbol_header *const hdr = find_symbol(table, name); - + iter->name_space = name_space; if (hdr != NULL) { diff --git a/src/mesa/sources.mak b/src/mesa/sources.mak index 9a78a23..89cfbfd 100644 --- a/src/mesa/sources.mak +++ b/src/mesa/sources.mak @@ -144,7 +144,7 @@ SWRAST_SOURCES = \ SWRAST_SETUP_SOURCES = \ swrast_setup/ss_context.c \ - swrast_setup/ss_triangle.c + swrast_setup/ss_triangle.c TNL_SOURCES = \ tnl/t_context.c \ @@ -163,7 +163,7 @@ TNL_SOURCES = \ tnl/t_vp_build.c \ tnl/t_vertex.c \ tnl/t_vertex_sse.c \ - tnl/t_vertex_generic.c + tnl/t_vertex_generic.c VBO_SOURCES = \ vbo/vbo_context.c \ @@ -179,7 +179,7 @@ VBO_SOURCES = \ vbo/vbo_save.c \ vbo/vbo_save_api.c \ vbo/vbo_save_draw.c \ - vbo/vbo_save_loopback.c + vbo/vbo_save_loopback.c STATETRACKER_SOURCES = \ state_tracker/st_atom.c \ diff --git a/src/mesa/sparc/clip.S b/src/mesa/sparc/clip.S index dc23917..0844939 100644 --- a/src/mesa/sparc/clip.S +++ b/src/mesa/sparc/clip.S @@ -57,7 +57,7 @@ clip_table: .byte 31, 29, 31, 30, 23, 21, 23, 22 .byte 31, 29, 31, 30, 27, 25, 27, 26 -/* GLvector4f *clip_vec, GLvector4f *proj_vec, +/* GLvector4f *clip_vec, GLvector4f *proj_vec, GLubyte clipMask[], GLubyte *orMask, GLubyte *andMask, GLboolean viewport_z_enable */ diff --git a/src/mesa/sparc/norm.S b/src/mesa/sparc/norm.S index 117d36f..79ec8cc 100644 --- a/src/mesa/sparc/norm.S +++ b/src/mesa/sparc/norm.S @@ -155,7 +155,7 @@ _mesa_sparc_transform_normalize_normals: 7: retl nop - + .globl _mesa_sparc_transform_normalize_normals_no_rot _mesa_sparc_transform_normalize_normals_no_rot: /* o0=mat o1=scale o2=in o3=lengths o4=dest */ diff --git a/src/mesa/sparc/sparc.c b/src/mesa/sparc/sparc.c index cea0c7c..6771418 100644 --- a/src/mesa/sparc/sparc.c +++ b/src/mesa/sparc/sparc.c @@ -1,19 +1,19 @@ /* * Mesa 3-D graphics library * Version: 6.3 - * + * * Copyright (C) 1999-2003 Brian Paul All Rights Reserved. - * + * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: - * + * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. - * + * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL diff --git a/src/mesa/sparc/sparc.h b/src/mesa/sparc/sparc.h index b9ea336..c1b40b6 100644 --- a/src/mesa/sparc/sparc.h +++ b/src/mesa/sparc/sparc.h @@ -2,19 +2,19 @@ /* * Mesa 3-D graphics library * Version: 3.1 - * + * * Copyright (C) 1999 Brian Paul All Rights Reserved. - * + * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: - * + * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. - * + * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL diff --git a/src/mesa/state_tracker/st_atom.c b/src/mesa/state_tracker/st_atom.c index e29ab46..0d165fa 100644 --- a/src/mesa/state_tracker/st_atom.c +++ b/src/mesa/state_tracker/st_atom.c @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2003 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ @@ -152,14 +152,14 @@ void st_validate_state( struct st_context *st ) * state flags which are generated and checked to help ensure * state atoms are ordered correctly in the list. */ - struct st_state_flags examined, prev; + struct st_state_flags examined, prev; memset(&examined, 0, sizeof(examined)); prev = *state; - for (i = 0; i < Elements(atoms); i++) { + for (i = 0; i < Elements(atoms); i++) { const struct st_tracked_state *atom = atoms[i]; struct st_state_flags generated; - + /*printf("atom %s %x/%x\n", atom->name, atom->dirty.mesa, atom->dirty.st);*/ if (!(atom->dirty.mesa || atom->dirty.st) || @@ -187,7 +187,7 @@ void st_validate_state( struct st_context *st ) } else { - for (i = 0; i < Elements(atoms); i++) { + for (i = 0; i < Elements(atoms); i++) { if (check_state(state, &atoms[i]->dirty)) atoms[i]->update( st ); } diff --git a/src/mesa/state_tracker/st_atom.h b/src/mesa/state_tracker/st_atom.h index 6a5ea36..14ca15c 100644 --- a/src/mesa/state_tracker/st_atom.h +++ b/src/mesa/state_tracker/st_atom.h @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2003 Tungsten Graphics, Inc., Cedar Park, Texas. * 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,14 @@ * 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. - * + * **************************************************************************/ /* * Authors: * Keith Whitwell */ - + #ifndef ST_ATOM_H #define ST_ATOM_H diff --git a/src/mesa/state_tracker/st_atom_blend.c b/src/mesa/state_tracker/st_atom_blend.c index a8ec4ad..d336847 100644 --- a/src/mesa/state_tracker/st_atom_blend.c +++ b/src/mesa/state_tracker/st_atom_blend.c @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ /* @@ -30,7 +30,7 @@ * Keith Whitwell * Brian Paul */ - + #include "st_context.h" #include "st_atom.h" @@ -181,7 +181,7 @@ blend_per_rt(struct gl_context *ctx) return GL_FALSE; } -static void +static void update_blend( struct st_context *st ) { struct pipe_blend_state *blend = &st->state.blend; diff --git a/src/mesa/state_tracker/st_atom_clip.c b/src/mesa/state_tracker/st_atom_clip.c index 16f7aaa..af10511 100644 --- a/src/mesa/state_tracker/st_atom_clip.c +++ b/src/mesa/state_tracker/st_atom_clip.c @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas. * 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,14 @@ * 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. - * + * **************************************************************************/ /* * Authors: * Keith Whitwell */ - + #include "st_context.h" #include "pipe/p_context.h" @@ -49,15 +49,15 @@ static void update_clip( struct st_context *st ) for (i = 0; i < PIPE_MAX_CLIP_PLANES; i++) { if (st->ctx->Transform.ClipPlanesEnabled & (1 << i)) { - memcpy(clip.ucp[clip.nr], - st->ctx->Transform._ClipUserPlane[i], + memcpy(clip.ucp[clip.nr], + st->ctx->Transform._ClipUserPlane[i], sizeof(clip.ucp[0])); clip.nr++; } } clip.depth_clamp = st->ctx->Transform.DepthClamp != GL_FALSE; - + if (memcmp(&clip, &st->state.clip, sizeof(clip)) != 0) { st->state.clip = clip; cso_set_clip(st->cso_context, &clip); diff --git a/src/mesa/state_tracker/st_atom_constbuf.c b/src/mesa/state_tracker/st_atom_constbuf.c index f1d08a3..0e2408d 100644 --- a/src/mesa/state_tracker/st_atom_constbuf.c +++ b/src/mesa/state_tracker/st_atom_constbuf.c @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ /* @@ -82,7 +82,7 @@ void st_upload_constants( struct st_context *st, paramBytes ); if (ST_DEBUG & DEBUG_CONSTANTS) { - debug_printf("%s(shader=%d, numParams=%d, stateFlags=0x%x)\n", + debug_printf("%s(shader=%d, numParams=%d, stateFlags=0x%x)\n", __FUNCTION__, shader_type, params->NumParameters, params->StateFlags); _mesa_print_parameter_list(params); diff --git a/src/mesa/state_tracker/st_atom_constbuf.h b/src/mesa/state_tracker/st_atom_constbuf.h index 97b0766..9029779 100644 --- a/src/mesa/state_tracker/st_atom_constbuf.h +++ b/src/mesa/state_tracker/st_atom_constbuf.h @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ diff --git a/src/mesa/state_tracker/st_atom_depth.c b/src/mesa/state_tracker/st_atom_depth.c index aaee432..436a30d 100644 --- a/src/mesa/state_tracker/st_atom_depth.c +++ b/src/mesa/state_tracker/st_atom_depth.c @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas. * 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,7 @@ * Brian Paul * Zack Rusin */ - + #include diff --git a/src/mesa/state_tracker/st_atom_framebuffer.c b/src/mesa/state_tracker/st_atom_framebuffer.c index 2843b7b..a31e67d 100644 --- a/src/mesa/state_tracker/st_atom_framebuffer.c +++ b/src/mesa/state_tracker/st_atom_framebuffer.c @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ /* @@ -30,7 +30,7 @@ * Keith Whitwell * Brian Paul */ - + #include "st_context.h" #include "st_atom.h" #include "st_cb_fbo.h" diff --git a/src/mesa/state_tracker/st_atom_msaa.c b/src/mesa/state_tracker/st_atom_msaa.c index ea9eb9a..31958cf 100644 --- a/src/mesa/state_tracker/st_atom_msaa.c +++ b/src/mesa/state_tracker/st_atom_msaa.c @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2010 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. - * + * **************************************************************************/ diff --git a/src/mesa/state_tracker/st_atom_pixeltransfer.c b/src/mesa/state_tracker/st_atom_pixeltransfer.c index 378b30e..ed26b9d 100644 --- a/src/mesa/state_tracker/st_atom_pixeltransfer.c +++ b/src/mesa/state_tracker/st_atom_pixeltransfer.c @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ /* diff --git a/src/mesa/state_tracker/st_atom_rasterizer.c b/src/mesa/state_tracker/st_atom_rasterizer.c index f92ca13..9a5bb26 100644 --- a/src/mesa/state_tracker/st_atom_rasterizer.c +++ b/src/mesa/state_tracker/st_atom_rasterizer.c @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas. * 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,14 @@ * 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. - * + * **************************************************************************/ /* * Authors: * Keith Whitwell */ - + #include "main/macros.h" #include "st_context.h" #include "st_atom.h" @@ -140,13 +140,13 @@ static void update_raster_state( struct st_context *st ) if (raster->cull_face & PIPE_FACE_FRONT) { raster->fill_front = raster->fill_back; } - + if (raster->cull_face & PIPE_FACE_BACK) { raster->fill_back = raster->fill_front; } } - /* _NEW_POLYGON + /* _NEW_POLYGON */ if (ctx->Polygon.OffsetUnits != 0.0 || ctx->Polygon.OffsetFactor != 0.0) { @@ -182,7 +182,7 @@ static void update_raster_state( struct st_context *st ) if ((ctx->Point.SpriteOrigin == GL_UPPER_LEFT) ^ (st_fb_orientation(ctx->DrawBuffer) == Y_0_BOTTOM)) raster->sprite_coord_mode = PIPE_SPRITE_COORD_UPPER_LEFT; - else + else raster->sprite_coord_mode = PIPE_SPRITE_COORD_LOWER_LEFT; /* Coord replacement flags. If bit 'k' is set that means diff --git a/src/mesa/state_tracker/st_atom_sampler.c b/src/mesa/state_tracker/st_atom_sampler.c index 5f1849d..56249bf 100644 --- a/src/mesa/state_tracker/st_atom_sampler.c +++ b/src/mesa/state_tracker/st_atom_sampler.c @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ /* @@ -30,7 +30,7 @@ * Keith Whitwell * Brian Paul */ - + #include "main/macros.h" @@ -118,7 +118,7 @@ gl_filter_to_img_filter(GLenum filter) } -static void +static void update_samplers(struct st_context *st) { struct gl_vertex_program *vprog = st->ctx->VertexProgram._Current; diff --git a/src/mesa/state_tracker/st_atom_scissor.c b/src/mesa/state_tracker/st_atom_scissor.c index 56b1383..ce6e146 100644 --- a/src/mesa/state_tracker/st_atom_scissor.c +++ b/src/mesa/state_tracker/st_atom_scissor.c @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas. * 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,14 @@ * 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. - * + * **************************************************************************/ /* * Authors: * Keith Whitwell */ - + #include "main/macros.h" #include "st_context.h" diff --git a/src/mesa/state_tracker/st_atom_shader.c b/src/mesa/state_tracker/st_atom_shader.c index 05442ef..e8d2a7e 100644 --- a/src/mesa/state_tracker/st_atom_shader.c +++ b/src/mesa/state_tracker/st_atom_shader.c @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2003 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ /** @@ -119,7 +119,7 @@ find_translated_vp(struct st_context *st, */ stvp->lastSerialNo = stvp->serialNo; } - + /* See if we've got a translated vertex program whose outputs match * the fragment program's inputs. */ @@ -134,7 +134,7 @@ find_translated_vp(struct st_context *st, vpv = st_translate_vertex_program(st, stvp, &key); if (!vpv) return NULL; - + vpv->next = stvp->varients; stvp->varients = vpv; } @@ -218,7 +218,7 @@ update_vp( struct st_context *st ) st_reference_vertprog(st, &st->vp, stvp); - cso_set_vertex_shader_handle(st->cso_context, + cso_set_vertex_shader_handle(st->cso_context, st->vp_varient->driver_shader); st->vertex_result_to_slot = stvp->result_to_output; diff --git a/src/mesa/state_tracker/st_atom_shader.h b/src/mesa/state_tracker/st_atom_shader.h index 56d4c68..963274f 100644 --- a/src/mesa/state_tracker/st_atom_shader.h +++ b/src/mesa/state_tracker/st_atom_shader.h @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2007-2008 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ diff --git a/src/mesa/state_tracker/st_atom_stipple.c b/src/mesa/state_tracker/st_atom_stipple.c index ecdd9f0..1ce60ea 100644 --- a/src/mesa/state_tracker/st_atom_stipple.c +++ b/src/mesa/state_tracker/st_atom_stipple.c @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas. * 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,7 @@ * Authors: * Brian Paul */ - + #include @@ -61,7 +61,7 @@ invert_stipple(GLuint dest[32], const GLuint src[32], GLuint winHeight) -static void +static void update_stipple( struct st_context *st ) { const GLuint sz = sizeof(st->state.poly_stipple); diff --git a/src/mesa/state_tracker/st_atom_texture.c b/src/mesa/state_tracker/st_atom_texture.c index 029b040..1810987 100644 --- a/src/mesa/state_tracker/st_atom_texture.c +++ b/src/mesa/state_tracker/st_atom_texture.c @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ /* @@ -30,7 +30,7 @@ * Keith Whitwell * Brian Paul */ - + #include "main/macros.h" #include "program/prog_instruction.h" @@ -135,7 +135,7 @@ static INLINE struct pipe_sampler_view * st_create_texture_sampler_view_from_stobj(struct pipe_context *pipe, struct st_texture_object *stObj, enum pipe_format format) - + { struct pipe_sampler_view templ; GLuint swizzle = apply_depthmode(stObj->pt->format, @@ -174,7 +174,7 @@ st_get_texture_sampler_view_from_stobj(struct st_texture_object *stObj, return stObj->sampler_view; } -static void +static void update_textures(struct st_context *st) { struct pipe_context *pipe = st->pipe; @@ -264,7 +264,7 @@ const struct st_tracked_state st_update_texture = { -static void +static void finalize_textures(struct st_context *st) { struct gl_fragment_program *fprog = st->ctx->FragmentProgram._Current; diff --git a/src/mesa/state_tracker/st_atom_viewport.c b/src/mesa/state_tracker/st_atom_viewport.c index d10f184..6f5078b 100644 --- a/src/mesa/state_tracker/st_atom_viewport.c +++ b/src/mesa/state_tracker/st_atom_viewport.c @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ @@ -55,7 +55,7 @@ update_viewport( struct st_context *st ) yBias = 0.0; } - /* _NEW_VIEWPORT + /* _NEW_VIEWPORT */ { GLfloat x = (GLfloat)ctx->Viewport.X; @@ -64,7 +64,7 @@ update_viewport( struct st_context *st ) GLfloat half_width = (GLfloat)ctx->Viewport.Width * 0.5f; GLfloat half_height = (GLfloat)ctx->Viewport.Height * 0.5f; GLfloat half_depth = (GLfloat)(ctx->Viewport.Far - ctx->Viewport.Near) * 0.5f; - + st->state.viewport.scale[0] = half_width; st->state.viewport.scale[1] = half_height * yScale; st->state.viewport.scale[2] = half_depth; diff --git a/src/mesa/state_tracker/st_cb_accum.c b/src/mesa/state_tracker/st_cb_accum.c index a76ae92..1e8d302 100644 --- a/src/mesa/state_tracker/st_cb_accum.c +++ b/src/mesa/state_tracker/st_cb_accum.c @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ /* @@ -67,7 +67,7 @@ st_clear_accum_buffer(struct gl_context *ctx, struct gl_renderbuffer *rb) if(!data) return; - + switch (acc_strb->format) { case PIPE_FORMAT_R16G16B16A16_SNORM: { @@ -301,7 +301,7 @@ st_Accum(struct gl_context *ctx, GLenum op, GLfloat value) if(!acc_strb->data) return; - + switch (op) { case GL_ADD: if (value != 0.0F) { diff --git a/src/mesa/state_tracker/st_cb_accum.h b/src/mesa/state_tracker/st_cb_accum.h index b8c9c35..eb1fa30 100644 --- a/src/mesa/state_tracker/st_cb_accum.h +++ b/src/mesa/state_tracker/st_cb_accum.h @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ diff --git a/src/mesa/state_tracker/st_cb_bitmap.c b/src/mesa/state_tracker/st_cb_bitmap.c index f08697f..83f8d33 100644 --- a/src/mesa/state_tracker/st_cb_bitmap.c +++ b/src/mesa/state_tracker/st_cb_bitmap.c @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ /* @@ -347,7 +347,7 @@ setup_bitmap_vertex_data(struct st_context *st, bool normalized, } if (!st->bitmap.vbuf) { - st->bitmap.vbuf = pipe_buffer_create(pipe->screen, + st->bitmap.vbuf = pipe_buffer_create(pipe->screen, PIPE_BIND_VERTEX_BUFFER, max_slots * sizeof(st->bitmap.vertices)); } @@ -364,17 +364,17 @@ setup_bitmap_vertex_data(struct st_context *st, bool normalized, st->bitmap.vertices[1][0][1] = clip_y0; st->bitmap.vertices[1][2][0] = sRight; st->bitmap.vertices[1][2][1] = tTop; - + st->bitmap.vertices[2][0][0] = clip_x1; st->bitmap.vertices[2][0][1] = clip_y1; st->bitmap.vertices[2][2][0] = sRight; st->bitmap.vertices[2][2][1] = tBot; - + st->bitmap.vertices[3][0][0] = clip_x0; st->bitmap.vertices[3][0][1] = clip_y1; st->bitmap.vertices[3][2][0] = sLeft; st->bitmap.vertices[3][2][1] = tBot; - + /* same for all verts: */ for (i = 0; i < 4; i++) { st->bitmap.vertices[i][0][2] = z; @@ -610,7 +610,7 @@ st_flush_bitmap_cache(struct st_context *st) struct pipe_sampler_view *sv; assert(cache->xmin <= cache->xmax); - + /* printf("flush size %d x %d at %d, %d\n", cache->xmax - cache->xmin, cache->ymax - cache->ymin, diff --git a/src/mesa/state_tracker/st_cb_bitmap.h b/src/mesa/state_tracker/st_cb_bitmap.h index d04b2b6..ed07a5b 100644 --- a/src/mesa/state_tracker/st_cb_bitmap.h +++ b/src/mesa/state_tracker/st_cb_bitmap.h @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ diff --git a/src/mesa/state_tracker/st_cb_blit.c b/src/mesa/state_tracker/st_cb_blit.c index d9eb806..051d1ef 100644 --- a/src/mesa/state_tracker/st_cb_blit.c +++ b/src/mesa/state_tracker/st_cb_blit.c @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ /* @@ -161,7 +161,7 @@ st_BlitFramebuffer(struct gl_context *ctx, struct st_renderbuffer *srcDepthRb = st_renderbuffer(readFB->Attachment[BUFFER_DEPTH].Renderbuffer); - struct st_renderbuffer *dstDepthRb = + struct st_renderbuffer *dstDepthRb = st_renderbuffer(drawFB->Attachment[BUFFER_DEPTH].Renderbuffer); struct pipe_surface *dstDepthSurf = dstDepthRb ? dstDepthRb->surface : NULL; diff --git a/src/mesa/state_tracker/st_cb_blit.h b/src/mesa/state_tracker/st_cb_blit.h index c230652..f2d2543 100644 --- a/src/mesa/state_tracker/st_cb_blit.h +++ b/src/mesa/state_tracker/st_cb_blit.h @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ #ifndef ST_CB_BLIT_H diff --git a/src/mesa/state_tracker/st_cb_bufferobjects.c b/src/mesa/state_tracker/st_cb_bufferobjects.c index 8b60f90..1cf4959 100644 --- a/src/mesa/state_tracker/st_cb_bufferobjects.c +++ b/src/mesa/state_tracker/st_cb_bufferobjects.c @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ @@ -77,7 +77,7 @@ st_bufferobj_free(struct gl_context *ctx, struct gl_buffer_object *obj) assert(obj->RefCount == 0); assert(st_obj->transfer == NULL); - if (st_obj->buffer) + if (st_obj->buffer) pipe_resource_reference(&st_obj->buffer, NULL); free(st_obj); @@ -165,7 +165,7 @@ st_bufferobj_data(struct gl_context *ctx, GLenum target, GLsizeiptrARB size, const GLvoid * data, - GLenum usage, + GLenum usage, struct gl_buffer_object *obj) { struct st_context *st = st_context(ctx); @@ -175,7 +175,7 @@ st_bufferobj_data(struct gl_context *ctx, st_obj->Base.Size = size; st_obj->Base.Usage = usage; - + switch(target) { case GL_PIXEL_PACK_BUFFER_ARB: case GL_PIXEL_UNPACK_BUFFER_ARB: @@ -237,7 +237,7 @@ st_bufferobj_map(struct gl_context *ctx, GLenum target, GLenum access, case GL_READ_WRITE: default: flags = PIPE_TRANSFER_READ_WRITE; - break; + break; } /* Handle zero-size buffers here rather than in drivers */ @@ -263,7 +263,7 @@ st_bufferobj_map(struct gl_context *ctx, GLenum target, GLenum access, * Called via glMapBufferRange(). */ static void * -st_bufferobj_map_range(struct gl_context *ctx, GLenum target, +st_bufferobj_map_range(struct gl_context *ctx, GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access, struct gl_buffer_object *obj) { @@ -285,7 +285,7 @@ st_bufferobj_map_range(struct gl_context *ctx, GLenum target, if (access & GL_MAP_INVALIDATE_BUFFER_BIT) flags |= PIPE_TRANSFER_DISCARD; - + if (access & GL_MAP_UNSYNCHRONIZED_BIT) flags |= PIPE_TRANSFER_UNSYNCHRONIZED; @@ -308,7 +308,7 @@ st_bufferobj_map_range(struct gl_context *ctx, GLenum target, obj->Pointer = &st_bufferobj_zero_length; } else { - obj->Pointer = pipe_buffer_map_range(pipe, + obj->Pointer = pipe_buffer_map_range(pipe, st_obj->buffer, offset, length, flags, @@ -317,7 +317,7 @@ st_bufferobj_map_range(struct gl_context *ctx, GLenum target, obj->Pointer = (ubyte *) obj->Pointer + offset; } } - + if (obj->Pointer) { obj->Offset = offset; obj->Length = length; @@ -329,7 +329,7 @@ st_bufferobj_map_range(struct gl_context *ctx, GLenum target, static void -st_bufferobj_flush_mapped_range(struct gl_context *ctx, GLenum target, +st_bufferobj_flush_mapped_range(struct gl_context *ctx, GLenum target, GLintptr offset, GLsizeiptr length, struct gl_buffer_object *obj) { @@ -341,11 +341,11 @@ st_bufferobj_flush_mapped_range(struct gl_context *ctx, GLenum target, assert(length >= 0); assert(offset + length <= obj->Length); assert(obj->Pointer); - + if (!length) return; - pipe_buffer_flush_mapped_range(pipe, st_obj->transfer, + pipe_buffer_flush_mapped_range(pipe, st_obj->transfer, obj->Offset + offset, length); } diff --git a/src/mesa/state_tracker/st_cb_bufferobjects.h b/src/mesa/state_tracker/st_cb_bufferobjects.h index 1c991d2..8b857d2 100644 --- a/src/mesa/state_tracker/st_cb_bufferobjects.h +++ b/src/mesa/state_tracker/st_cb_bufferobjects.h @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2005 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ #ifndef ST_CB_BUFFEROBJECTS_H diff --git a/src/mesa/state_tracker/st_cb_clear.c b/src/mesa/state_tracker/st_cb_clear.c index 5aedeb2..0a120aa 100644 --- a/src/mesa/state_tracker/st_cb_clear.c +++ b/src/mesa/state_tracker/st_cb_clear.c @@ -1,9 +1,9 @@ /************************************************************************** - * + * * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas. * All Rights Reserved. * Copyright 2009 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 @@ -11,11 +11,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. @@ -23,7 +23,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. - * + * **************************************************************************/ /* @@ -173,8 +173,8 @@ draw_quad(struct st_context *st, st->clear.vertices); /* draw */ - util_draw_vertex_buffer(pipe, - st->clear.vbuf, + util_draw_vertex_buffer(pipe, + st->clear.vbuf, st->clear.vbuf_slot * sizeof(st->clear.vertices), PIPE_PRIM_TRIANGLE_FAN, 4, /* verts */ @@ -206,7 +206,7 @@ clear_with_quad(struct gl_context *ctx, float clearColor[4]; /* - printf("%s %s%s%s %f,%f %f,%f\n", __FUNCTION__, + printf("%s %s%s%s %f,%f %f,%f\n", __FUNCTION__, color ? "color, " : "", depth ? "depth, " : "", stencil ? "stencil" : "", @@ -412,7 +412,7 @@ check_clear_stencil_with_quad(struct gl_context *ctx, struct gl_renderbuffer *rb rb->Format == MESA_FORMAT_Z24_S8 || rb->Format == MESA_FORMAT_S8_Z24); - if (maskStencil) + if (maskStencil) return GL_TRUE; if (ctx->Scissor.Enabled && @@ -447,7 +447,7 @@ st_flush_clear(struct st_context *st) pipe_resource_reference(&st->clear.vbuf, NULL); st->clear.vbuf_slot = 0; } - + /** diff --git a/src/mesa/state_tracker/st_cb_clear.h b/src/mesa/state_tracker/st_cb_clear.h index b27c09d..cb2a701 100644 --- a/src/mesa/state_tracker/st_cb_clear.h +++ b/src/mesa/state_tracker/st_cb_clear.h @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ diff --git a/src/mesa/state_tracker/st_cb_condrender.c b/src/mesa/state_tracker/st_cb_condrender.c index 7766ead..0ff9a0f 100644 --- a/src/mesa/state_tracker/st_cb_condrender.c +++ b/src/mesa/state_tracker/st_cb_condrender.c @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2009 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. - * + * **************************************************************************/ diff --git a/src/mesa/state_tracker/st_cb_condrender.h b/src/mesa/state_tracker/st_cb_condrender.h index 79d0db8..de8edc1 100644 --- a/src/mesa/state_tracker/st_cb_condrender.h +++ b/src/mesa/state_tracker/st_cb_condrender.h @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2009 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. - * + * **************************************************************************/ #ifndef ST_CB_CONDRENDER_H diff --git a/src/mesa/state_tracker/st_cb_drawpixels.c b/src/mesa/state_tracker/st_cb_drawpixels.c index f7c9198..4707e5d 100644 --- a/src/mesa/state_tracker/st_cb_drawpixels.c +++ b/src/mesa/state_tracker/st_cb_drawpixels.c @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ /* @@ -262,7 +262,7 @@ make_fragment_shader_z_stencil(struct st_context *st, GLboolean write_depth, * vertex position and texcoord (and optionally, color). */ static void * -make_passthrough_vertex_shader(struct st_context *st, +make_passthrough_vertex_shader(struct st_context *st, GLboolean passColor) { if (!st->drawpix.vert_shaders[passColor]) { @@ -272,25 +272,25 @@ make_passthrough_vertex_shader(struct st_context *st, return NULL; /* MOV result.pos, vertex.pos; */ - ureg_MOV(ureg, + ureg_MOV(ureg, ureg_DECL_output( ureg, TGSI_SEMANTIC_POSITION, 0 ), ureg_DECL_vs_input( ureg, 0 )); - + /* MOV result.texcoord0, vertex.attr[1]; */ - ureg_MOV(ureg, + ureg_MOV(ureg, ureg_DECL_output( ureg, TGSI_SEMANTIC_GENERIC, 0 ), ureg_DECL_vs_input( ureg, 1 )); - + if (passColor) { /* MOV result.color0, vertex.attr[2]; */ - ureg_MOV(ureg, + ureg_MOV(ureg, ureg_DECL_output( ureg, TGSI_SEMANTIC_COLOR, 0 ), ureg_DECL_vs_input( ureg, 2 )); } ureg_END( ureg ); - - st->drawpix.vert_shaders[passColor] = + + st->drawpix.vert_shaders[passColor] = ureg_create_shader_and_destroy( ureg, st->pipe ); } @@ -756,7 +756,7 @@ draw_stencil_pixels(struct gl_context *ctx, GLint x, GLint y, y = ctx->DrawBuffer->Height - y - height; } - if(format != GL_DEPTH_STENCIL && + if(format != GL_DEPTH_STENCIL && util_format_get_component_bits(strb->format, UTIL_FORMAT_COLORSPACE_ZS, 0) != 0) usage = PIPE_TRANSFER_READ_WRITE; @@ -902,7 +902,7 @@ st_DrawPixels(struct gl_context *ctx, GLint x, GLint y, /* can we write to stencil if not fallback */ if (!pipe->screen->get_param(pipe->screen, PIPE_CAP_SHADER_STENCIL_EXPORT)) goto stencil_fallback; - + tex_format = st_choose_format(st->pipe->screen, base_format(format), PIPE_TEXTURE_2D, 0, PIPE_BIND_SAMPLER_VIEW); @@ -1271,7 +1271,7 @@ st_CopyPixels(struct gl_context *ctx, GLint srcx, GLint srcy, width, height, ctx->Pixel.ZoomX, ctx->Pixel.ZoomY, sv, num_sampler_view, - driver_vp, + driver_vp, driver_fp, color, invertTex, GL_FALSE, GL_FALSE); diff --git a/src/mesa/state_tracker/st_cb_drawpixels.h b/src/mesa/state_tracker/st_cb_drawpixels.h index 575f169..5063b77 100644 --- a/src/mesa/state_tracker/st_cb_drawpixels.h +++ b/src/mesa/state_tracker/st_cb_drawpixels.h @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ diff --git a/src/mesa/state_tracker/st_cb_drawtex.c b/src/mesa/state_tracker/st_cb_drawtex.c index 6cad7d3..66c1823 100644 --- a/src/mesa/state_tracker/st_cb_drawtex.c +++ b/src/mesa/state_tracker/st_cb_drawtex.c @@ -1,5 +1,5 @@ /************************************************************************** - * + * * Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas. * All Rights Reserved. * @@ -157,7 +157,7 @@ st_DrawTex(struct gl_context *ctx, GLfloat x, GLfloat y, GLfloat z, PIPE_TRANSFER_WRITE, &vbuffer_transfer); GLuint attr; - + z = CLAMP(z, 0.0f, 1.0f); /* positions (in clip coords) */ diff --git a/src/mesa/state_tracker/st_cb_drawtex.h b/src/mesa/state_tracker/st_cb_drawtex.h index d21262f..0a8361c 100644 --- a/src/mesa/state_tracker/st_cb_drawtex.h +++ b/src/mesa/state_tracker/st_cb_drawtex.h @@ -1,5 +1,5 @@ /************************************************************************** - * + * * Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas. * All Rights Reserved. * diff --git a/src/mesa/state_tracker/st_cb_fbo.c b/src/mesa/state_tracker/st_cb_fbo.c index 473ed4d..bbb8f23 100644 --- a/src/mesa/state_tracker/st_cb_fbo.c +++ b/src/mesa/state_tracker/st_cb_fbo.c @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ @@ -76,7 +76,7 @@ st_renderbuffer_alloc_storage(struct gl_context * ctx, struct gl_renderbuffer *r format = strb->format; else format = st_choose_renderbuffer_format(screen, internalFormat, rb->NumSamples); - + if (format == PIPE_FORMAT_NONE) { return FALSE; } @@ -92,21 +92,21 @@ st_renderbuffer_alloc_storage(struct gl_context * ctx, struct gl_renderbuffer *r if (strb->software) { size_t size; - + free(strb->data); assert(strb->format != PIPE_FORMAT_NONE); - + strb->stride = util_format_get_stride(strb->format, width); size = util_format_get_2d_size(strb->format, strb->stride, height); - + strb->data = malloc(size); - + return strb->data != NULL; } else { struct pipe_resource template; - + /* Free the old surface and texture */ pipe_surface_reference( &strb->surface, NULL ); @@ -134,7 +134,7 @@ st_renderbuffer_alloc_storage(struct gl_context * ctx, struct gl_renderbuffer *r strb->texture = screen->resource_create(screen, &template); - if (!strb->texture) + if (!strb->texture) return FALSE; memset(&surf_tmpl, 0, sizeof(surf_tmpl)); @@ -240,7 +240,7 @@ st_new_renderbuffer_fb(enum pipe_format format, int samples, boolean sw) strb->Base.DataType = st_format_datatype(format); strb->format = format; strb->software = sw; - + switch (format) { case PIPE_FORMAT_R8G8B8A8_UNORM: case PIPE_FORMAT_B8G8R8A8_UNORM: @@ -318,7 +318,7 @@ st_bind_framebuffer(struct gl_context *ctx, GLenum target, * Called by ctx->Driver.FramebufferRenderbuffer */ static void -st_framebuffer_renderbuffer(struct gl_context *ctx, +st_framebuffer_renderbuffer(struct gl_context *ctx, struct gl_framebuffer *fb, GLenum attachment, struct gl_renderbuffer *rb) @@ -346,7 +346,7 @@ st_render_texture(struct gl_context *ctx, struct pipe_surface surf_tmpl; /* When would this fail? Perhaps assert? */ - if (!pt) + if (!pt) return; /* get pointer to texture image we're rendeing to */ @@ -495,7 +495,7 @@ st_is_depth_stencil_combined(const struct gl_renderbuffer_attachment *depth, return GL_FALSE; } - + /** * Check that the framebuffer configuration is valid in terms of what diff --git a/src/mesa/state_tracker/st_cb_fbo.h b/src/mesa/state_tracker/st_cb_fbo.h index 3e9815c..66057a7 100644 --- a/src/mesa/state_tracker/st_cb_fbo.h +++ b/src/mesa/state_tracker/st_cb_fbo.h @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ @@ -58,7 +58,7 @@ struct st_renderbuffer boolean software; size_t stride; void *data; - + struct st_texture_object *rtt; /**< GL render to texture's texture */ int rtt_level, rtt_face, rtt_slice; diff --git a/src/mesa/state_tracker/st_cb_feedback.c b/src/mesa/state_tracker/st_cb_feedback.c index 5c01856..cae9ad2 100644 --- a/src/mesa/state_tracker/st_cb_feedback.c +++ b/src/mesa/state_tracker/st_cb_feedback.c @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ /** diff --git a/src/mesa/state_tracker/st_cb_feedback.h b/src/mesa/state_tracker/st_cb_feedback.h index f2342f5..1363148 100644 --- a/src/mesa/state_tracker/st_cb_feedback.h +++ b/src/mesa/state_tracker/st_cb_feedback.h @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ diff --git a/src/mesa/state_tracker/st_cb_flush.c b/src/mesa/state_tracker/st_cb_flush.c index 5a2343d..175e431 100644 --- a/src/mesa/state_tracker/st_cb_flush.c +++ b/src/mesa/state_tracker/st_cb_flush.c @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ /* diff --git a/src/mesa/state_tracker/st_cb_flush.h b/src/mesa/state_tracker/st_cb_flush.h index 7672b4c..786f31d 100644 --- a/src/mesa/state_tracker/st_cb_flush.h +++ b/src/mesa/state_tracker/st_cb_flush.h @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ diff --git a/src/mesa/state_tracker/st_cb_program.c b/src/mesa/state_tracker/st_cb_program.c index 4d83fcc..4e0f5cf 100644 --- a/src/mesa/state_tracker/st_cb_program.c +++ b/src/mesa/state_tracker/st_cb_program.c @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2003 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ /* @@ -54,13 +54,13 @@ static GLuint SerialNo = 1; * fragment program. */ static void st_bind_program( struct gl_context *ctx, - GLenum target, + GLenum target, struct gl_program *prog ) { struct st_context *st = st_context(ctx); switch (target) { - case GL_VERTEX_PROGRAM_ARB: + case GL_VERTEX_PROGRAM_ARB: st->dirty.st |= ST_NEW_VERTEX_PROGRAM; break; case GL_FRAGMENT_PROGRAM_ARB: @@ -102,9 +102,9 @@ static struct gl_program *st_new_program( struct gl_context *ctx, prog->serialNo = SerialNo++; - return _mesa_init_vertex_program( ctx, + return _mesa_init_vertex_program( ctx, &prog->Base, - target, + target, id ); } @@ -114,9 +114,9 @@ static struct gl_program *st_new_program( struct gl_context *ctx, prog->serialNo = SerialNo++; - return _mesa_init_fragment_program( ctx, + return _mesa_init_fragment_program( ctx, &prog->Base, - target, + target, id ); } @@ -173,7 +173,7 @@ st_delete_program(struct gl_context *ctx, struct gl_program *prog) cso_delete_fragment_shader(st->cso_context, stfp->driver_shader); stfp->driver_shader = NULL; } - + if (stfp->tgsi.tokens) { st_free_tokens(stfp->tgsi.tokens); stfp->tgsi.tokens = NULL; @@ -196,7 +196,7 @@ st_delete_program(struct gl_context *ctx, struct gl_program *prog) static GLboolean st_is_program_native( struct gl_context *ctx, - GLenum target, + GLenum target, struct gl_program *prog ) { return GL_TRUE; diff --git a/src/mesa/state_tracker/st_cb_queryobj.c b/src/mesa/state_tracker/st_cb_queryobj.c index aa31b37..3684cbc 100644 --- a/src/mesa/state_tracker/st_cb_queryobj.c +++ b/src/mesa/state_tracker/st_cb_queryobj.c @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ @@ -139,14 +139,14 @@ st_WaitQuery(struct gl_context *ctx, struct gl_query_object *q) assert(!stq->base.Ready); while (!stq->base.Ready && - !pipe->get_query_result(pipe, + !pipe->get_query_result(pipe, stq->pq, TRUE, &q->Result)) { /* nothing */ } - + q->Ready = GL_TRUE; } diff --git a/src/mesa/state_tracker/st_cb_queryobj.h b/src/mesa/state_tracker/st_cb_queryobj.h index 017471b..e30fbfd 100644 --- a/src/mesa/state_tracker/st_cb_queryobj.h +++ b/src/mesa/state_tracker/st_cb_queryobj.h @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ #ifndef ST_CB_QUERYOBJ_H diff --git a/src/mesa/state_tracker/st_cb_rasterpos.c b/src/mesa/state_tracker/st_cb_rasterpos.c index 15a4f60..16a55c7 100644 --- a/src/mesa/state_tracker/st_cb_rasterpos.c +++ b/src/mesa/state_tracker/st_cb_rasterpos.c @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ /** diff --git a/src/mesa/state_tracker/st_cb_rasterpos.h b/src/mesa/state_tracker/st_cb_rasterpos.h index 2dc109b..ed5bd1d 100644 --- a/src/mesa/state_tracker/st_cb_rasterpos.h +++ b/src/mesa/state_tracker/st_cb_rasterpos.h @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ #ifndef ST_CB_RASTERPOS_H diff --git a/src/mesa/state_tracker/st_cb_readpixels.c b/src/mesa/state_tracker/st_cb_readpixels.c index 0507be7..ff7d99d 100644 --- a/src/mesa/state_tracker/st_cb_readpixels.c +++ b/src/mesa/state_tracker/st_cb_readpixels.c @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ diff --git a/src/mesa/state_tracker/st_cb_readpixels.h b/src/mesa/state_tracker/st_cb_readpixels.h index 83c9b65..244b381 100644 --- a/src/mesa/state_tracker/st_cb_readpixels.h +++ b/src/mesa/state_tracker/st_cb_readpixels.h @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ diff --git a/src/mesa/state_tracker/st_cb_strings.c b/src/mesa/state_tracker/st_cb_strings.c index 2132379..e2ec7f1 100644 --- a/src/mesa/state_tracker/st_cb_strings.c +++ b/src/mesa/state_tracker/st_cb_strings.c @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ /* @@ -55,7 +55,7 @@ st_get_string(struct gl_context * ctx, GLenum name) } case GL_RENDERER: - util_snprintf(st->renderer, sizeof(st->renderer), "Gallium %s on %s", + util_snprintf(st->renderer, sizeof(st->renderer), "Gallium %s on %s", ST_VERSION_STRING, screen->get_name( screen )); diff --git a/src/mesa/state_tracker/st_cb_strings.h b/src/mesa/state_tracker/st_cb_strings.h index 92d5d2d..713e42c 100644 --- a/src/mesa/state_tracker/st_cb_strings.h +++ b/src/mesa/state_tracker/st_cb_strings.h @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ diff --git a/src/mesa/state_tracker/st_cb_texture.c b/src/mesa/state_tracker/st_cb_texture.c index 09a10ba..077428f 100644 --- a/src/mesa/state_tracker/st_cb_texture.c +++ b/src/mesa/state_tracker/st_cb_texture.c @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ #include "main/mfeatures.h" @@ -117,7 +117,7 @@ st_NewTextureObject(struct gl_context * ctx, GLuint name, GLenum target) } /** called via ctx->Driver.DeleteTextureObject() */ -static void +static void st_DeleteTextureObject(struct gl_context *ctx, struct gl_texture_object *texObj) { @@ -195,7 +195,7 @@ __memcpy(void *to, const void *from, size_t n) * * The sse_memcpy seems to have a slight cliff at 64/32 bytes, but * isn't much faster than x86_memcpy for agp copies. - * + * * TODO: switch dynamically. */ static void * @@ -313,7 +313,7 @@ guess_and_alloc_texture(struct st_context *st, if (depth != 1) depth <<= 1; level--; - } + } assert(level == 0); @@ -591,7 +591,7 @@ st_TexImage(struct gl_context * ctx, _mesa_set_fetch_functions(texImage, dims); - /* Release the reference to a potentially orphaned buffer. + /* Release the reference to a potentially orphaned buffer. * Release any old malloced memory. */ if (stImage->pt) { @@ -755,9 +755,9 @@ st_TexImage(struct gl_context * ctx, const GLubyte *src = (const GLubyte *) pixels; for (i = 0; i < depth; i++) { - if (!_mesa_texstore(ctx, dims, - texImage->_BaseFormat, - texImage->TexFormat, + if (!_mesa_texstore(ctx, dims, + texImage->_BaseFormat, + texImage->TexFormat, texImage->Data, 0, 0, 0, /* dstX/Y/Zoffset */ dstRowStride, @@ -1119,7 +1119,7 @@ st_TexSubimage(struct gl_context *ctx, GLint dims, GLenum target, GLint level, else transfer_usage = PIPE_TRANSFER_WRITE; - texImage->Data = st_texture_image_map(st, stImage, zoffset, + texImage->Data = st_texture_image_map(st, stImage, zoffset, transfer_usage, xoffset, yoffset, width, height); @@ -1243,11 +1243,11 @@ st_CompressedTexSubImage2D(struct gl_context *ctx, GLenum target, GLint level, if (stImage->pt) { pformat = stImage->pt->format; - texImage->Data = st_texture_image_map(st, stImage, 0, + texImage->Data = st_texture_image_map(st, stImage, 0, PIPE_TRANSFER_WRITE, xoffset, yoffset, width, height); - + srcBlockStride = util_format_get_stride(pformat, width); dstBlockStride = stImage->transfer->stride; } else { @@ -1396,8 +1396,8 @@ fallback_copy_texsubimage(struct gl_context *ctx, GLenum target, GLint level, * need to fill-in/override the alpha channel with 1.0. */ _mesa_texstore(ctx, dims, - texImage->_BaseFormat, - texImage->TexFormat, + texImage->_BaseFormat, + texImage->TexFormat, texDest, 0, 0, 0, dstRowStride, @@ -1474,7 +1474,7 @@ compatible_src_dst_formats(struct gl_context *ctx, else { if (ST_DEBUG & DEBUG_FALLBACK) debug_printf("%s failed for src %s, dst %s\n", - __FUNCTION__, + __FUNCTION__, _mesa_lookup_enum_by_nr(srcFormat), _mesa_lookup_enum_by_nr(dstFormat)); @@ -1520,7 +1520,7 @@ st_copy_texsubimage(struct gl_context *ctx, struct pipe_surface *dest_surface = NULL; GLboolean do_flip = (st_fb_orientation(ctx->ReadBuffer) == Y_0_TOP); - /* make sure finalize_textures has been called? + /* make sure finalize_textures has been called? */ if (0) st_validate_state(st); @@ -1694,7 +1694,7 @@ st_CopyTexImage1D(struct gl_context * ctx, GLenum target, GLint level, _mesa_select_tex_image(ctx, texObj, target, level); /* Setup or redefine the texture object, texture and texture - * image. Don't populate yet. + * image. Don't populate yet. */ ctx->Driver.TexImage1D(ctx, target, level, internalFormat, width, border, @@ -1721,7 +1721,7 @@ st_CopyTexImage2D(struct gl_context * ctx, GLenum target, GLint level, _mesa_select_tex_image(ctx, texObj, target, level); /* Setup or redefine the texture object, texture and texture - * image. Don't populate yet. + * image. Don't populate yet. */ ctx->Driver.TexImage2D(ctx, target, level, internalFormat, width, height, border, @@ -1805,7 +1805,7 @@ copy_image_data_to_texture(struct st_context *st, stImage->face, dstLevel, stImage->base.Data, - stImage->base.RowStride * + stImage->base.RowStride * util_format_get_blocksize(stObj->pt->format), stImage->base.RowStride * stImage->base.Height * diff --git a/src/mesa/state_tracker/st_cb_texture.h b/src/mesa/state_tracker/st_cb_texture.h index 6098705..287f7c9 100644 --- a/src/mesa/state_tracker/st_cb_texture.h +++ b/src/mesa/state_tracker/st_cb_texture.h @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ @@ -39,7 +39,7 @@ struct st_context; extern GLboolean st_finalize_texture(struct gl_context *ctx, - struct pipe_context *pipe, + struct pipe_context *pipe, struct gl_texture_object *tObj); diff --git a/src/mesa/state_tracker/st_cb_xformfb.c b/src/mesa/state_tracker/st_cb_xformfb.c index 838a0a4..1a2fb20 100644 --- a/src/mesa/state_tracker/st_cb_xformfb.c +++ b/src/mesa/state_tracker/st_cb_xformfb.c @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2010 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. - * + * **************************************************************************/ diff --git a/src/mesa/state_tracker/st_cb_xformfb.h b/src/mesa/state_tracker/st_cb_xformfb.h index 574cf48..4b856ed 100644 --- a/src/mesa/state_tracker/st_cb_xformfb.h +++ b/src/mesa/state_tracker/st_cb_xformfb.h @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2010 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. - * + * **************************************************************************/ #ifndef ST_CB_XFORMFB_H diff --git a/src/mesa/state_tracker/st_context.c b/src/mesa/state_tracker/st_context.c index 6ec9c69..e635b26 100644 --- a/src/mesa/state_tracker/st_context.c +++ b/src/mesa/state_tracker/st_context.c @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ #include "main/imports.h" @@ -101,7 +101,7 @@ st_create_context_priv( struct gl_context *ctx, struct pipe_context *pipe ) { uint i; struct st_context *st = ST_CALLOC_STRUCT( st_context ); - + ctx->st = st; st->ctx = ctx; @@ -109,7 +109,7 @@ st_create_context_priv( struct gl_context *ctx, struct pipe_context *pipe ) /* XXX: this is one-off, per-screen init: */ st_debug_init(); - + /* state tracker needs the VBO module */ _vbo_CreateContext(ctx); @@ -221,7 +221,7 @@ static void st_destroy_context_priv( struct st_context *st ) free( st ); } - + void st_destroy_context( struct st_context *st ) { struct pipe_context *pipe = st->pipe; diff --git a/src/mesa/state_tracker/st_context.h b/src/mesa/state_tracker/st_context.h index d342c0c..c60a446 100644 --- a/src/mesa/state_tracker/st_context.h +++ b/src/mesa/state_tracker/st_context.h @@ -1,9 +1,9 @@ //struct dd_function_table; /************************************************************************** - * + * * Copyright 2003 Tungsten Graphics, Inc., Cedar Park, Texas. * 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 @@ -11,11 +11,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. @@ -23,7 +23,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. - * + * **************************************************************************/ #ifndef ST_CONTEXT_H diff --git a/src/mesa/state_tracker/st_debug.c b/src/mesa/state_tracker/st_debug.c index df32491..e38bd21 100644 --- a/src/mesa/state_tracker/st_debug.c +++ b/src/mesa/state_tracker/st_debug.c @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ diff --git a/src/mesa/state_tracker/st_debug.h b/src/mesa/state_tracker/st_debug.h index 4a060d7..a944074 100644 --- a/src/mesa/state_tracker/st_debug.h +++ b/src/mesa/state_tracker/st_debug.h @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ diff --git a/src/mesa/state_tracker/st_draw.c b/src/mesa/state_tracker/st_draw.c index 73e3aeb..f0942bf 100644 --- a/src/mesa/state_tracker/st_draw.c +++ b/src/mesa/state_tracker/st_draw.c @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ /* @@ -210,7 +210,7 @@ st_pipe_vertex_format(GLenum type, GLuint size, GLenum format, case GL_UNSIGNED_BYTE: return ubyte_types_norm[size-1]; case GL_FIXED: return fixed_types[size-1]; default: assert(0); return 0; - } + } } else { switch (type) { @@ -225,7 +225,7 @@ st_pipe_vertex_format(GLenum type, GLuint size, GLenum format, case GL_UNSIGNED_BYTE: return ubyte_types_scale[size-1]; case GL_FIXED: return fixed_types[size-1]; default: assert(0); return 0; - } + } } return 0; /* silence compiler warning */ } @@ -264,7 +264,7 @@ is_interleaved_arrays(const struct st_vertex_program *vp, else if (firstStride != stride) { return GL_FALSE; } - + if (!bufObj || !bufObj->Name) { num_client_arrays++; /* Try to detect if the client-space arrays are @@ -320,7 +320,7 @@ get_arrays_bounds(const struct st_vertex_program *vp, const GLuint mesaAttr = vp->index_to_input[attr]; const GLint stride = arrays[mesaAttr]->StrideB; const GLubyte *start = arrays[mesaAttr]->Ptr; - const unsigned sz = (arrays[mesaAttr]->Size * + const unsigned sz = (arrays[mesaAttr]->Size * _mesa_sizeof_type(arrays[mesaAttr]->Type)); const GLubyte *end = start + (max_index * stride) + sz; @@ -453,7 +453,7 @@ setup_non_interleaved_attribs(struct gl_context *ctx, /* attribute data is in user-space memory, not a VBO */ uint bytes; /*printf("user-space array %d stride %d\n", attr, stride);*/ - + *userSpace = GL_TRUE; /* wrap user data */ @@ -466,7 +466,7 @@ setup_non_interleaved_attribs(struct gl_context *ctx, bytes = arrays[mesaAttr]->Size * _mesa_sizeof_type(arrays[mesaAttr]->Type); } - vbuffer[attr].buffer = + vbuffer[attr].buffer = pipe_user_buffer_create(pipe->screen, (void *) arrays[mesaAttr]->Ptr, bytes, PIPE_BIND_VERTEX_BUFFER); @@ -474,7 +474,7 @@ setup_non_interleaved_attribs(struct gl_context *ctx, else { /* no array, use ctx->Current.Attrib[] value */ bytes = sizeof(ctx->Current.Attrib[0]); - vbuffer[attr].buffer = + vbuffer[attr].buffer = pipe_user_buffer_create(pipe->screen, (void *) ctx->Current.Attrib[mesaAttr], bytes, @@ -748,7 +748,7 @@ st_draw_vbo(struct gl_context *ctx, assert(!vbuffer[attr].buffer); } - if (userSpace) + if (userSpace) { pipe->set_vertex_buffers(pipe, 0, NULL); } diff --git a/src/mesa/state_tracker/st_draw.h b/src/mesa/state_tracker/st_draw.h index 2e4c468..0cc9abf 100644 --- a/src/mesa/state_tracker/st_draw.h +++ b/src/mesa/state_tracker/st_draw.h @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2004 Tungsten Graphics, Inc., Cedar Park, Texas. * 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,14 @@ * 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. - * + * **************************************************************************/ /* * Authors: * Keith Whitwell */ - + #ifndef ST_DRAW_H #define ST_DRAW_H diff --git a/src/mesa/state_tracker/st_draw_feedback.c b/src/mesa/state_tracker/st_draw_feedback.c index 7f392fc..dc5f6a2 100644 --- a/src/mesa/state_tracker/st_draw_feedback.c +++ b/src/mesa/state_tracker/st_draw_feedback.c @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ #include "main/imports.h" @@ -183,7 +183,7 @@ st_feedback_draw_vbo(struct gl_context *ctx, vbuffers[attr].max_index = max_index; velements[attr].instance_divisor = 0; velements[attr].vertex_buffer_index = attr; - velements[attr].src_format = + velements[attr].src_format = st_pipe_vertex_format(arrays[mesaAttr]->Type, arrays[mesaAttr]->Size, arrays[mesaAttr]->Format, @@ -267,7 +267,7 @@ st_feedback_draw_vbo(struct gl_context *ctx, */ for (i = 0; i < PIPE_MAX_ATTRIBS; i++) { if (draw->pt.vertex_buffer[i].buffer) { - pipe_buffer_unmap(pipe, draw->pt.vertex_buffer[i].buffer, + pipe_buffer_unmap(pipe, draw->pt.vertex_buffer[i].buffer, vb_transfer[i]); pipe_resource_reference(&draw->pt.vertex_buffer[i].buffer, NULL); draw_set_mapped_vertex_buffer(draw, i, NULL); diff --git a/src/mesa/state_tracker/st_extensions.c b/src/mesa/state_tracker/st_extensions.c index 51a45a7..5635c8f 100644 --- a/src/mesa/state_tracker/st_extensions.c +++ b/src/mesa/state_tracker/st_extensions.c @@ -1,9 +1,9 @@ /************************************************************************** - * + * * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas. * Copyright (c) 2008 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 @@ -11,11 +11,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. @@ -23,7 +23,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. - * + * **************************************************************************/ #include "main/imports.h" @@ -405,10 +405,10 @@ void st_init_extensions(struct st_context *st) } /* ycbcr support */ - if (screen->is_format_supported(screen, PIPE_FORMAT_UYVY, + if (screen->is_format_supported(screen, PIPE_FORMAT_UYVY, PIPE_TEXTURE_2D, 0, PIPE_BIND_SAMPLER_VIEW, 0) || - screen->is_format_supported(screen, PIPE_FORMAT_YUYV, + screen->is_format_supported(screen, PIPE_FORMAT_YUYV, PIPE_TEXTURE_2D, 0, PIPE_BIND_SAMPLER_VIEW, 0)) { ctx->Extensions.MESA_ycbcr_texture = GL_TRUE; diff --git a/src/mesa/state_tracker/st_extensions.h b/src/mesa/state_tracker/st_extensions.h index aa9b2b2..a8ec0b6 100644 --- a/src/mesa/state_tracker/st_extensions.h +++ b/src/mesa/state_tracker/st_extensions.h @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ diff --git a/src/mesa/state_tracker/st_format.c b/src/mesa/state_tracker/st_format.c index f9b6096..32b0f89 100644 --- a/src/mesa/state_tracker/st_format.c +++ b/src/mesa/state_tracker/st_format.c @@ -1,9 +1,9 @@ /************************************************************************** - * + * * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas. * Copyright (c) 2008-2010 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 @@ -11,11 +11,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. @@ -23,7 +23,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. - * + * **************************************************************************/ @@ -362,7 +362,7 @@ st_pipe_format_to_mesa_format(enum pipe_format format) * Return first supported format from the given list. */ static enum pipe_format -find_supported_format(struct pipe_screen *screen, +find_supported_format(struct pipe_screen *screen, const enum pipe_format formats[], uint num_formats, enum pipe_texture_target target, @@ -385,7 +385,7 @@ find_supported_format(struct pipe_screen *screen, * Find an RGBA format supported by the context/winsys. */ static enum pipe_format -default_rgba_format(struct pipe_screen *screen, +default_rgba_format(struct pipe_screen *screen, enum pipe_texture_target target, unsigned sample_count, unsigned tex_usage, @@ -406,7 +406,7 @@ default_rgba_format(struct pipe_screen *screen, * Find an RGB format supported by the context/winsys. */ static enum pipe_format -default_rgb_format(struct pipe_screen *screen, +default_rgb_format(struct pipe_screen *screen, enum pipe_texture_target target, unsigned sample_count, unsigned tex_usage, @@ -429,7 +429,7 @@ default_rgb_format(struct pipe_screen *screen, * Find an sRGBA format supported by the context/winsys. */ static enum pipe_format -default_srgba_format(struct pipe_screen *screen, +default_srgba_format(struct pipe_screen *screen, enum pipe_texture_target target, unsigned sample_count, unsigned tex_usage, @@ -927,7 +927,7 @@ st_ChooseTextureFormat_renderable(struct gl_context *ctx, GLint internalFormat, if (_mesa_is_depth_format(internalFormat) || _mesa_is_depth_or_stencil_format(internalFormat)) bindings |= PIPE_BIND_DEPTH_STENCIL; - else + else bindings |= PIPE_BIND_RENDER_TARGET; } diff --git a/src/mesa/state_tracker/st_format.h b/src/mesa/state_tracker/st_format.h index ea4ee26..5713304 100644 --- a/src/mesa/state_tracker/st_format.h +++ b/src/mesa/state_tracker/st_format.h @@ -1,9 +1,9 @@ /************************************************************************** - * + * * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas. * Copyright (c) 2010 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 @@ -11,11 +11,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. @@ -23,7 +23,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. - * + * **************************************************************************/ diff --git a/src/mesa/state_tracker/st_gen_mipmap.c b/src/mesa/state_tracker/st_gen_mipmap.c index c5f6008..d57d782 100644 --- a/src/mesa/state_tracker/st_gen_mipmap.c +++ b/src/mesa/state_tracker/st_gen_mipmap.c @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ @@ -288,7 +288,7 @@ compute_num_levels(struct gl_context *ctx, return 1; } else { - const struct gl_texture_image *baseImage = + const struct gl_texture_image *baseImage = _mesa_get_tex_image(ctx, texObj, target, texObj->BaseLevel); GLuint size, numLevels; @@ -397,7 +397,7 @@ st_generate_mipmap(struct gl_context *ctx, GLenum target, struct st_texture_image *stImage; uint dstWidth = u_minify(pt->width0, dstLevel); uint dstHeight = u_minify(pt->height0, dstLevel); - uint dstDepth = u_minify(pt->depth0, dstLevel); + uint dstDepth = u_minify(pt->depth0, dstLevel); uint border = srcImage->Border; dstImage = _mesa_get_tex_image(ctx, texObj, target, dstLevel); diff --git a/src/mesa/state_tracker/st_gen_mipmap.h b/src/mesa/state_tracker/st_gen_mipmap.h index 3ba091d..d5bff92 100644 --- a/src/mesa/state_tracker/st_gen_mipmap.h +++ b/src/mesa/state_tracker/st_gen_mipmap.h @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ diff --git a/src/mesa/state_tracker/st_manager.c b/src/mesa/state_tracker/st_manager.c index 0307b48..9da5886 100644 --- a/src/mesa/state_tracker/st_manager.c +++ b/src/mesa/state_tracker/st_manager.c @@ -571,7 +571,7 @@ st_context_teximage(struct st_context_iface *stctxi, enum st_texture_type target */ if (!st_sampler_compat_formats(tex->format, internal_format)) internal_format = tex->format; - + if (util_format_get_component_bits(internal_format, UTIL_FORMAT_COLORSPACE_RGB, 3) > 0) internalFormat = GL_RGBA; @@ -612,7 +612,7 @@ st_context_teximage(struct st_context_iface *stctxi, enum st_texture_type target _mesa_dirty_texobj(ctx, texObj, GL_TRUE); _mesa_unlock_texture(ctx, texObj); - + return TRUE; } diff --git a/src/mesa/state_tracker/st_mesa_to_tgsi.c b/src/mesa/state_tracker/st_mesa_to_tgsi.c index 9020d41..2ee63dd 100644 --- a/src/mesa/state_tracker/st_mesa_to_tgsi.c +++ b/src/mesa/state_tracker/st_mesa_to_tgsi.c @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2007-2008 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ /* @@ -118,8 +118,8 @@ static unsigned *get_label( struct st_translate *t, if (t->labels_count + 1 >= t->labels_size) { unsigned old_size = t->labels_size; t->labels_size = 1 << (util_logbase2(t->labels_size) + 1); - t->labels = REALLOC( t->labels, - old_size * sizeof t->labels[0], + t->labels = REALLOC( t->labels, + old_size * sizeof t->labels[0], t->labels_size * sizeof t->labels[0] ); if (t->labels == NULL) { static unsigned dummy; @@ -146,8 +146,8 @@ static void set_insn_start( struct st_translate *t, if (t->insn_count + 1 >= t->insn_size) { unsigned old_size = t->insn_size; t->insn_size = 1 << (util_logbase2(t->insn_size) + 1); - t->insn = REALLOC( t->insn, - old_size * sizeof t->insn[0], + t->insn = REALLOC( t->insn, + old_size * sizeof t->insn[0], t->insn_size * sizeof t->insn[0] ); if (t->insn == NULL) { t->error = TRUE; @@ -289,13 +289,13 @@ translate_dst( struct st_translate *t, const struct prog_dst_register *DstReg, boolean saturate ) { - struct ureg_dst dst = dst_register( t, + struct ureg_dst dst = dst_register( t, DstReg->File, DstReg->Index ); - dst = ureg_writemask( dst, + dst = ureg_writemask( dst, DstReg->WriteMask ); - + if (saturate) dst = ureg_saturate( dst ); @@ -333,7 +333,7 @@ translate_src( struct st_translate *t, if (SrcReg->Negate == NEGATE_XYZW) src = ureg_negate(src); - if (SrcReg->Abs) + if (SrcReg->Abs) src = ureg_abs(src); if (SrcReg->RelAddr) { @@ -363,8 +363,8 @@ static struct ureg_src swizzle_4v( struct ureg_src src, /** * Translate a SWZ instruction into a MOV, MUL or MAD instruction. EG: * - * SWZ dst, src.x-y10 - * + * SWZ dst, src.x-y10 + * * becomes: * * MAD dst {1,-1,0,0}, src.xyxx, {0,0,1,0} @@ -390,7 +390,7 @@ static void emit_swz( struct st_translate *t, unsigned negative_one_mask = one_mask & negate_mask; unsigned positive_one_mask = one_mask & ~negate_mask; - + struct ureg_src imm; unsigned i; unsigned mul_swizzle[4] = {0,0,0,0}; @@ -406,7 +406,7 @@ static void emit_swz( struct st_translate *t, */ if (zero_mask == 0 && one_mask == 0 && - (negate_mask == 0 || negate_mask == TGSI_WRITEMASK_XYZW)) + (negate_mask == 0 || negate_mask == TGSI_WRITEMASK_XYZW)) { ureg_MOV( ureg, dst, translate_src( t, SrcReg )); return; @@ -452,20 +452,20 @@ static void emit_swz( struct st_translate *t, } if (need_mul && need_add) { - ureg_MAD( ureg, + ureg_MAD( ureg, dst, swizzle_4v( src, src_swizzle ), swizzle_4v( imm, mul_swizzle ), swizzle_4v( imm, add_swizzle ) ); } else if (need_mul) { - ureg_MUL( ureg, + ureg_MUL( ureg, dst, swizzle_4v( src, src_swizzle ), swizzle_4v( imm, mul_swizzle ) ); } else if (need_add) { - ureg_MOV( ureg, + ureg_MOV( ureg, dst, swizzle_4v( imm, add_swizzle ) ); } @@ -655,12 +655,12 @@ compile_instruction( num_dst = _mesa_num_inst_dst_regs( inst->Opcode ); num_src = _mesa_num_inst_src_regs( inst->Opcode ); - if (num_dst) - dst[0] = translate_dst( t, + if (num_dst) + dst[0] = translate_dst( t, &inst->DstReg, inst->SaturateMode ); - for (i = 0; i < num_src; i++) + for (i = 0; i < num_src; i++) src[i] = translate_src( t, &inst->SrcReg[i] ); switch( inst->Opcode ) { @@ -688,7 +688,7 @@ compile_instruction( src[num_src++] = t->samplers[inst->TexSrcUnit]; ureg_tex_insn( ureg, translate_opcode( inst->Opcode ), - dst, num_dst, + dst, num_dst, translate_texture_target( inst->TexSrcTarget, inst->TexShadow ), src, num_src ); @@ -696,17 +696,17 @@ compile_instruction( case OPCODE_SCS: dst[0] = ureg_writemask(dst[0], TGSI_WRITEMASK_XY ); - ureg_insn( ureg, - translate_opcode( inst->Opcode ), - dst, num_dst, + ureg_insn( ureg, + translate_opcode( inst->Opcode ), + dst, num_dst, src, num_src ); break; case OPCODE_XPD: dst[0] = ureg_writemask(dst[0], TGSI_WRITEMASK_XYZ ); - ureg_insn( ureg, - translate_opcode( inst->Opcode ), - dst, num_dst, + ureg_insn( ureg, + translate_opcode( inst->Opcode ), + dst, num_dst, src, num_src ); break; @@ -722,15 +722,15 @@ compile_instruction( */ ureg_MOV( ureg, dst[0], ureg_imm1f(ureg, 0.5) ); break; - + case OPCODE_DDY: emit_ddy( t, dst[0], &inst->SrcReg[0] ); break; default: - ureg_insn( ureg, - translate_opcode( inst->Opcode ), - dst, num_dst, + ureg_insn( ureg, + translate_opcode( inst->Opcode ), + dst, num_dst, src, num_src ); break; } @@ -778,7 +778,7 @@ emit_wpos_inversion( struct st_translate *t, */ static const gl_state_index wposTransformState[STATE_LENGTH] = { STATE_INTERNAL, STATE_FB_WPOS_Y_TRANSFORM, 0, 0, 0 }; - + /* XXX: note we are modifying the incoming shader here! Need to * do this before emitting the constant decls below, or this * will be missed: @@ -855,7 +855,7 @@ emit_wpos(struct st_context *st, else assert(0); } - + if (fp->PixelCenterInteger) { if (pscreen->get_param(pscreen, PIPE_CAP_TGSI_FS_COORD_PIXEL_CENTER_INTEGER)) ureg_property_fs_coord_pixel_center(ureg, TGSI_FS_COORD_PIXEL_CENTER_INTEGER); @@ -1132,7 +1132,7 @@ st_translate_mesa_program( if (program->IndirectRegisterFiles & PROGRAM_ANY_CONST) t->constants[i] = ureg_DECL_constant( ureg, i ); else - t->constants[i] = + t->constants[i] = ureg_DECL_immediate( ureg, program->Parameters->ParameterValues[i], 4 ); diff --git a/src/mesa/state_tracker/st_mesa_to_tgsi.h b/src/mesa/state_tracker/st_mesa_to_tgsi.h index 9bfd496..d12b3ca 100644 --- a/src/mesa/state_tracker/st_mesa_to_tgsi.h +++ b/src/mesa/state_tracker/st_mesa_to_tgsi.h @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ diff --git a/src/mesa/state_tracker/st_program.c b/src/mesa/state_tracker/st_program.c index aae2913..7eb1ce9 100644 --- a/src/mesa/state_tracker/st_program.c +++ b/src/mesa/state_tracker/st_program.c @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ /* * Authors: @@ -63,17 +63,17 @@ st_vp_release_varients( struct st_context *st, for (vpv = stvp->varients; vpv; ) { struct st_vp_varient *next = vpv->next; - if (vpv->driver_shader) + if (vpv->driver_shader) cso_delete_vertex_shader(st->cso_context, vpv->driver_shader); - + #if FEATURE_feedback || FEATURE_rastpos if (vpv->draw_shader) draw_delete_vertex_shader( st->draw, vpv->draw_shader ); #endif - + if (vpv->tgsi.tokens) st_free_tokens(vpv->tgsi.tokens); - + FREE( vpv ); vpv = next; @@ -181,9 +181,9 @@ st_prepare_vertex_program(struct st_context *st, default: assert(attr < VERT_RESULT_MAX); stvp->output_semantic_name[slot] = TGSI_SEMANTIC_GENERIC; - stvp->output_semantic_index[slot] = (FRAG_ATTRIB_VAR0 - + stvp->output_semantic_index[slot] = (FRAG_ATTRIB_VAR0 - FRAG_ATTRIB_TEX0 + - attr - + attr - VERT_RESULT_VAR0); break; } @@ -231,7 +231,7 @@ st_translate_vertex_program(struct st_context *st, debug_printf("\n"); } - error = + error = st_translate_mesa_program(st->ctx, TGSI_PROCESSOR_VERTEX, ureg, @@ -343,14 +343,14 @@ st_translate_fragment_program(struct st_context *st, /* In most cases, there is nothing special about these * inputs, so adopt a convention to use the generic * semantic name and the mesa FRAG_ATTRIB_ number as the - * index. - * + * index. + * * All that is required is that the vertex shader labels * its own outputs similarly, and that the vertex shader * generates at least every output required by the * fragment shader plus fixed-function hardware (such as * BFC). - * + * * There is no requirement that semantic indexes start at * zero or be restricted to a particular range -- nobody * should be building tables based on semantic index. @@ -442,7 +442,7 @@ st_translate_fragment_program(struct st_context *st, debug_printf("\n"); } - error = + error = st_translate_mesa_program(st->ctx, TGSI_PROCESSOR_FRAGMENT, ureg, diff --git a/src/mesa/state_tracker/st_program.h b/src/mesa/state_tracker/st_program.h index 72dbc71..e97f58c 100644 --- a/src/mesa/state_tracker/st_program.h +++ b/src/mesa/state_tracker/st_program.h @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2003 Tungsten Graphics, Inc., Cedar Park, Texas. * 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,14 @@ * 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. - * + * **************************************************************************/ /* * Authors: * Keith Whitwell */ - + #ifndef ST_PROGRAM_H #define ST_PROGRAM_H @@ -88,7 +88,7 @@ struct st_vp_varient struct draw_vertex_shader *draw_shader; /** Next in linked list */ - struct st_vp_varient *next; + struct st_vp_varient *next; /** similar to that in st_vertex_program, but with information about edgeflags too */ GLuint num_inputs; diff --git a/src/mesa/state_tracker/st_texture.c b/src/mesa/state_tracker/st_texture.c index 155ea39..80c798c 100644 --- a/src/mesa/state_tracker/st_texture.c +++ b/src/mesa/state_tracker/st_texture.c @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ #include @@ -105,9 +105,9 @@ st_texture_match_image(const struct pipe_resource *pt, const struct gl_texture_image *image, GLuint face, GLuint level) { - /* Images with borders are never pulled into mipmap textures. + /* Images with borders are never pulled into mipmap textures. */ - if (image->Border) + if (image->Border) return GL_FALSE; /* Check if this image's format matches the established texture's format. @@ -192,9 +192,9 @@ st_surface_data(struct pipe_context *pipe, util_copy_rect(map, dst->resource->format, dst->stride, - dstx, dsty, - width, height, - src, src_stride, + dstx, dsty, + width, height, + src, src_stride, srcx, srcy); pipe_transfer_unmap(pipe, dst); diff --git a/src/mesa/state_tracker/st_texture.h b/src/mesa/state_tracker/st_texture.h index c78901c..642864d 100644 --- a/src/mesa/state_tracker/st_texture.h +++ b/src/mesa/state_tracker/st_texture.h @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ #ifndef ST_TEXTURE_H @@ -45,7 +45,7 @@ struct st_texture_image { struct gl_texture_image base; - /* These aren't stored in gl_texture_image + /* These aren't stored in gl_texture_image */ GLuint level; GLuint face; diff --git a/src/mesa/swrast/descrip.mms b/src/mesa/swrast/descrip.mms index 0b23deb..80000d5 100644 --- a/src/mesa/swrast/descrip.mms +++ b/src/mesa/swrast/descrip.mms @@ -28,7 +28,7 @@ SOURCES = s_aaline.c s_aatriangle.c s_accum.c s_alpha.c \ s_masking.c s_points.c s_readpix.c \ s_span.c s_stencil.c s_texstore.c s_texcombine.c s_texfilter.c \ s_triangle.c s_zoom.c s_atifragshader.c - + OBJECTS = s_aaline.obj,s_aatriangle.obj,s_accum.obj,s_alpha.obj,\ s_bitmap.obj,s_blend.obj,s_blit.obj,s_fragprog.obj,\ s_buffers.obj,s_context.obj,s_atifragshader.obj,\ @@ -37,7 +37,7 @@ OBJECTS = s_aaline.obj,s_aatriangle.obj,s_accum.obj,s_alpha.obj,\ s_points.obj,s_readpix.obj,s_span.obj,s_stencil.obj,\ s_texstore.obj,s_texcombine.obj,s_texfilter.obj,s_triangle.obj,\ s_zoom.obj - + ##### RULES ##### VERSION=Mesa V3.4 diff --git a/src/mesa/swrast/s_aaline.c b/src/mesa/swrast/s_aaline.c index 65b9af0..cf3e9c9 100644 --- a/src/mesa/swrast/s_aaline.c +++ b/src/mesa/swrast/s_aaline.c @@ -325,7 +325,7 @@ compute_coveragef(const struct LineInfo *info, typedef void (*plot_func)(struct gl_context *ctx, struct LineInfo *line, int ix, int iy); - + /* diff --git a/src/mesa/swrast/s_aatritemp.h b/src/mesa/swrast/s_aatritemp.h index 91d4f7a..6aae416 100644 --- a/src/mesa/swrast/s_aatritemp.h +++ b/src/mesa/swrast/s_aatritemp.h @@ -47,9 +47,9 @@ GLfloat yMin, yMax; GLboolean ltor; GLfloat majDx, majDy; /* major (i.e. long) edge dx and dy */ - + SWspan span; - + #ifdef DO_Z GLfloat zPlane[4]; #endif @@ -59,7 +59,7 @@ GLfloat wPlane[4]; /* win[3] */ #endif GLfloat bf = SWRAST_CONTEXT(ctx)->_BackfaceCullSign; - + (void) swrast; INIT_SPAN(span, GL_POLYGON); @@ -227,10 +227,10 @@ count++; coverage = compute_coveragef(pMin, pMid, pMax, ix, iy); } - + if (ix <= startX) continue; - + span.x = startX; span.y = iy; span.end = (GLuint) ix - (GLuint) startX; @@ -250,7 +250,7 @@ GLint ix, left, startX = (GLint) (x + xAdj); GLuint count, n; GLfloat coverage = 0.0F; - + /* make sure we're not past the window edge */ if (startX >= ctx->DrawBuffer->_Xmax) { startX = ctx->DrawBuffer->_Xmax - 1; @@ -263,7 +263,7 @@ break; startX--; } - + /* enter interior of triangle */ ix = startX; count = 0; @@ -284,7 +284,7 @@ count++; coverage = compute_coveragef(pMin, pMax, pMid, ix, iy); } - + #if defined(DO_ATTRIBS) /* compute attributes at left-most fragment */ span.attrStart[FRAG_ATTRIB_WPOS][3] = solve_plane(ix + 1.5F, iy + 0.5F, wPlane); diff --git a/src/mesa/swrast/s_blend.c b/src/mesa/swrast/s_blend.c index d61baba..6248027 100644 --- a/src/mesa/swrast/s_blend.c +++ b/src/mesa/swrast/s_blend.c @@ -147,7 +147,7 @@ blend_transparency_ubyte(struct gl_context *ctx, GLuint n, const GLubyte mask[], const GLint r = DIV255((rgba[i][RCOMP] - dest[i][RCOMP]) * t) + dest[i][RCOMP]; const GLint g = DIV255((rgba[i][GCOMP] - dest[i][GCOMP]) * t) + dest[i][GCOMP]; const GLint b = DIV255((rgba[i][BCOMP] - dest[i][BCOMP]) * t) + dest[i][BCOMP]; - const GLint a = DIV255((rgba[i][ACOMP] - dest[i][ACOMP]) * t) + dest[i][ACOMP]; + const GLint a = DIV255((rgba[i][ACOMP] - dest[i][ACOMP]) * t) + dest[i][ACOMP]; ASSERT(r <= 255); ASSERT(g <= 255); ASSERT(b <= 255); diff --git a/src/mesa/swrast/s_blit.c b/src/mesa/swrast/s_blit.c index d943e09..b14f356 100644 --- a/src/mesa/swrast/s_blit.c +++ b/src/mesa/swrast/s_blit.c @@ -302,7 +302,7 @@ resample_linear_row_ub(GLint srcWidth, GLint dstWidth, alpha = lerp_2d(colWeight, rowWeight, srcColor0[srcCol0][ACOMP], srcColor0[srcCol1][ACOMP], srcColor1[srcCol0][ACOMP], srcColor1[srcCol1][ACOMP]); - + dstColor[dstCol][RCOMP] = IFLOOR(red); dstColor[dstCol][GCOMP] = IFLOOR(green); dstColor[dstCol][BCOMP] = IFLOOR(blue); diff --git a/src/mesa/swrast/s_clear.c b/src/mesa/swrast/s_clear.c index 75805f9..67f848d 100644 --- a/src/mesa/swrast/s_clear.c +++ b/src/mesa/swrast/s_clear.c @@ -120,7 +120,7 @@ clear_rgba_buffer(struct gl_context *ctx, struct gl_renderbuffer *rb, GLuint buf ASSERT(ctx->Color.ColorMask[buf][0] && ctx->Color.ColorMask[buf][1] && ctx->Color.ColorMask[buf][2] && - ctx->Color.ColorMask[buf][3]); + ctx->Color.ColorMask[buf][3]); ASSERT(rb->PutMonoRow); diff --git a/src/mesa/swrast/s_context.c b/src/mesa/swrast/s_context.c index 491fcfc..6a4aeeb 100644 --- a/src/mesa/swrast/s_context.c +++ b/src/mesa/swrast/s_context.c @@ -664,7 +664,7 @@ _swrast_validate_derived( struct gl_context *ctx ) _NEW_TEXTURE)) _swrast_update_active_attribs(ctx); - if (swrast->NewState & (_NEW_FOG | + if (swrast->NewState & (_NEW_FOG | _NEW_PROGRAM | _NEW_LIGHT | _NEW_TEXTURE)) @@ -903,7 +903,7 @@ _swrast_render_start( struct gl_context *ctx ) swrast->Driver.SpanRenderStart( ctx ); swrast->PointSpan.end = 0; } - + void _swrast_render_finish( struct gl_context *ctx ) { diff --git a/src/mesa/swrast/s_copypix.c b/src/mesa/swrast/s_copypix.c index 46d6379..18b1b68 100644 --- a/src/mesa/swrast/s_copypix.c +++ b/src/mesa/swrast/s_copypix.c @@ -690,7 +690,7 @@ _swrast_CopyPixels( struct gl_context *ctx, { SWcontext *swrast = SWRAST_CONTEXT(ctx); swrast_render_start(ctx); - + if (!_mesa_check_conditional_render(ctx)) return; /* don't copy */ diff --git a/src/mesa/swrast/s_depth.c b/src/mesa/swrast/s_depth.c index 58440cb..566f90a 100644 --- a/src/mesa/swrast/s_depth.c +++ b/src/mesa/swrast/s_depth.c @@ -526,7 +526,7 @@ _swrast_depth_clamp_span( struct gl_context *ctx, SWspan *span ) /* Convert floating point values in [0,1] to device Z coordinates in * [0, DepthMax]. * ex: If the Z buffer has 24 bits, DepthMax = 0xffffff. - * + * * XXX this all falls apart if we have 31 or more bits of Z because * the triangle rasterization code produces unsigned Z values. Negative * vertex Z values come out as large fragment Z uints. @@ -565,7 +565,7 @@ depth_test_span( struct gl_context *ctx, SWspan *span) ASSERT((span->arrayMask & SPAN_XY) == 0); ASSERT(span->arrayMask & SPAN_Z); - + if (rb->GetPointer(ctx, rb, 0, 0)) { /* Directly access buffer */ if (rb->DataType == GL_UNSIGNED_SHORT) { diff --git a/src/mesa/swrast/s_drawpix.c b/src/mesa/swrast/s_drawpix.c index 4d06668..239bdbc 100644 --- a/src/mesa/swrast/s_drawpix.c +++ b/src/mesa/swrast/s_drawpix.c @@ -569,7 +569,7 @@ draw_depth_stencil_pixels(struct gl_context *ctx, GLint x, GLint y, = ctx->Pixel.DepthScale != 1.0 || ctx->Pixel.DepthBias != 0.0; const GLuint depthMax = ctx->DrawBuffer->_DepthMax; const GLuint stencilMask = ctx->Stencil.WriteMask[0]; - const GLuint stencilType = (STENCIL_BITS == 8) ? + const GLuint stencilType = (STENCIL_BITS == 8) ? GL_UNSIGNED_BYTE : GL_UNSIGNED_SHORT; const GLboolean zoom = ctx->Pixel.ZoomX != 1.0 || ctx->Pixel.ZoomY != 1.0; struct gl_renderbuffer *depthRb, *stencilRb; @@ -582,7 +582,7 @@ draw_depth_stencil_pixels(struct gl_context *ctx, GLint x, GLint y, return; } } - + depthRb = ctx->ReadBuffer->Attachment[BUFFER_DEPTH].Renderbuffer; stencilRb = ctx->ReadBuffer->Attachment[BUFFER_STENCIL].Renderbuffer; ASSERT(depthRb); @@ -601,7 +601,7 @@ draw_depth_stencil_pixels(struct gl_context *ctx, GLint x, GLint y, */ GLint i; for (i = 0; i < height; i++) { - const GLuint *src = (const GLuint *) + const GLuint *src = (const GLuint *) _mesa_image_address2d(&clippedUnpack, pixels, width, height, GL_DEPTH_STENCIL_EXT, type, i, 0); depthRb->PutRow(ctx, depthRb, width, x, y + i, src, NULL); diff --git a/src/mesa/swrast/s_fog.c b/src/mesa/swrast/s_fog.c index d808e2b..649bb16 100644 --- a/src/mesa/swrast/s_fog.c +++ b/src/mesa/swrast/s_fog.c @@ -59,7 +59,7 @@ _swrast_z_to_fogfactor(struct gl_context *ctx, GLfloat z) return f; default: _mesa_problem(ctx, "Bad fog mode in _swrast_z_to_fogfactor"); - return 0.0; + return 0.0; } } diff --git a/src/mesa/swrast/s_linetemp.h b/src/mesa/swrast/s_linetemp.h index f9f2d29..d25590c 100644 --- a/src/mesa/swrast/s_linetemp.h +++ b/src/mesa/swrast/s_linetemp.h @@ -115,10 +115,10 @@ NAME( struct gl_context *ctx, const SWvertex *vert0, const SWvertex *vert1 ) vert1->attrib[FRAG_ATTRIB_WPOS][1], vert1->attrib[FRAG_ATTRIB_WPOS][2]); printf(" (%d, %d, %d) -> (%d, %d, %d)\n", - vert0->color[0], vert0->color[1], vert0->color[2], + vert0->color[0], vert0->color[1], vert0->color[2], vert1->color[0], vert1->color[1], vert1->color[2]); printf(" (%d, %d, %d) -> (%d, %d, %d)\n", - vert0->specular[0], vert0->specular[1], vert0->specular[2], + vert0->specular[0], vert0->specular[1], vert0->specular[2], vert1->specular[0], vert1->specular[1], vert1->specular[2]); */ diff --git a/src/mesa/swrast/s_span.c b/src/mesa/swrast/s_span.c index 3240b13..4c1b9ac 100644 --- a/src/mesa/swrast/s_span.c +++ b/src/mesa/swrast/s_span.c @@ -66,7 +66,7 @@ _swrast_span_default_attribs(struct gl_context *ctx, SWspan *span) if (ctx->DrawBuffer->Visual.depthBits <= 16) span->z = FloatToFixed(ctx->Current.RasterPos[2] * depthMax + 0.5F); else { - GLfloat tmpf = ctx->Current.RasterPos[2] * depthMax; + GLfloat tmpf = ctx->Current.RasterPos[2] * depthMax; tmpf = MIN2(tmpf, depthMax); span->z = (GLint)tmpf; } @@ -379,7 +379,7 @@ _swrast_span_interpolate_z( const struct gl_context *ctx, SWspan *span ) if (ctx->DrawBuffer->Visual.depthBits <= 16) { GLfixed zval = span->z; - GLuint *z = span->array->z; + GLuint *z = span->array->z; for (i = 0; i < n; i++) { z[i] = FixedToInt(zval); zval += span->zStep; @@ -1212,7 +1212,7 @@ _swrast_write_rgba_span( struct gl_context *ctx, SWspan *span) { const GLuint numBuffers = fb->_NumColorDrawBuffers; const struct gl_fragment_program *fp = ctx->FragmentProgram._Current; - const GLboolean multiFragOutputs = + const GLboolean multiFragOutputs = (fp && fp->Base.OutputsWritten >= (1 << FRAG_RESULT_DATA0)); GLuint buf; diff --git a/src/mesa/swrast/s_span.h b/src/mesa/swrast/s_span.h index 18e275e..86e35f5 100644 --- a/src/mesa/swrast/s_span.h +++ b/src/mesa/swrast/s_span.h @@ -51,7 +51,7 @@ /** - * \sw_span_arrays + * \sw_span_arrays * \brief Arrays of fragment values. * * These will either be computed from the span x/xStep values or diff --git a/src/mesa/swrast/s_stencil.c b/src/mesa/swrast/s_stencil.c index 5bec71c..59ea85f 100644 --- a/src/mesa/swrast/s_stencil.c +++ b/src/mesa/swrast/s_stencil.c @@ -499,9 +499,9 @@ stencil_and_ztest_span(struct gl_context *ctx, SWspan *span, GLuint face) if (!rb->GetPointer(ctx, rb, 0, 0)) { rb->PutRow(ctx, rb, n, x, y, stencil, NULL); } - + span->writeAll = GL_FALSE; - + return GL_TRUE; /* one or more fragments passed both tests */ } @@ -918,7 +918,7 @@ stencil_and_ztest_pixels( struct gl_context *ctx, SWspan *span, GLuint face ) ASSERT(rb->DataType == GL_UNSIGNED_BYTE); _swrast_get_values(ctx, rb, n, x, y, stencil, sizeof(GLubyte)); - memcpy(origMask, mask, n * sizeof(GLubyte)); + memcpy(origMask, mask, n * sizeof(GLubyte)); (void) do_stencil_test(ctx, face, n, stencil, mask); @@ -927,7 +927,7 @@ stencil_and_ztest_pixels( struct gl_context *ctx, SWspan *span, GLuint face ) n, stencil, mask); } else { - GLubyte tmpMask[MAX_WIDTH]; + GLubyte tmpMask[MAX_WIDTH]; memcpy(tmpMask, mask, n * sizeof(GLubyte)); _swrast_depth_test_span(ctx, span); diff --git a/src/mesa/swrast/s_texcombine.c b/src/mesa/swrast/s_texcombine.c index 99c4441..fe45cf7 100644 --- a/src/mesa/swrast/s_texcombine.c +++ b/src/mesa/swrast/s_texcombine.c @@ -68,7 +68,7 @@ get_texel_array(SWcontext *swrast, GLuint unit) * \param n number of fragments to process (span width) * \param primary_rgba incoming fragment color array * \param texelBuffer pointer to texel colors for all texture units - * + * * \param rgba incoming/result fragment colors */ static void diff --git a/src/mesa/swrast/s_texfilter.c b/src/mesa/swrast/s_texfilter.c index 539d878..681e307 100644 --- a/src/mesa/swrast/s_texfilter.c +++ b/src/mesa/swrast/s_texfilter.c @@ -1338,7 +1338,7 @@ sample_linear_2d(struct gl_context *ctx, * Optimized 2-D texture sampling: * S and T wrap mode == GL_REPEAT * GL_NEAREST min/mag filter - * No border, + * No border, * RowStride == Width, * Format = GL_RGB */ @@ -1923,7 +1923,7 @@ choose_cube_face(const struct gl_texture_object *texObj, } } - { + { const float ima = 1.0F / ma; newCoord[0] = ( sc * ima + 1.0F ) * 0.5F; newCoord[1] = ( tc * ima + 1.0F ) * 0.5F; @@ -2390,7 +2390,7 @@ sample_2d_array_linear(struct gl_context *ctx, else { img->FetchTexelf(img, i1, j1, array, t11); } - + /* trilinear interpolation of samples */ lerp_rgba_2d(rgba, a, b, t00, t10, t01, t11); } @@ -2551,7 +2551,7 @@ sample_lambda_2d_array(struct gl_context *ctx, rgba + minStart); break; case GL_LINEAR_MIPMAP_NEAREST: - sample_2d_array_linear_mipmap_nearest(ctx, tObj, m, + sample_2d_array_linear_mipmap_nearest(ctx, tObj, m, texcoords + minStart, lambda + minStart, rgba + minStart); @@ -2563,9 +2563,9 @@ sample_lambda_2d_array(struct gl_context *ctx, rgba + minStart); break; case GL_LINEAR_MIPMAP_LINEAR: - sample_2d_array_linear_mipmap_linear(ctx, tObj, m, + sample_2d_array_linear_mipmap_linear(ctx, tObj, m, texcoords + minStart, - lambda + minStart, + lambda + minStart, rgba + minStart); break; default: @@ -2830,7 +2830,7 @@ sample_lambda_1d_array(struct gl_context *ctx, lambda + minStart, rgba + minStart); break; case GL_LINEAR_MIPMAP_NEAREST: - sample_1d_array_linear_mipmap_nearest(ctx, tObj, m, + sample_1d_array_linear_mipmap_nearest(ctx, tObj, m, texcoords + minStart, lambda + minStart, rgba + minStart); @@ -2840,9 +2840,9 @@ sample_lambda_1d_array(struct gl_context *ctx, lambda + minStart, rgba + minStart); break; case GL_LINEAR_MIPMAP_LINEAR: - sample_1d_array_linear_mipmap_linear(ctx, tObj, m, + sample_1d_array_linear_mipmap_linear(ctx, tObj, m, texcoords + minStart, - lambda + minStart, + lambda + minStart, rgba + minStart); break; default: @@ -3036,7 +3036,7 @@ sample_depth_texture( struct gl_context *ctx, nearest_texcoord(tObj, level, texcoords[i], &col, &row, &slice); - if (col >= 0 && row >= 0 && col < width && row < height && + if (col >= 0 && row >= 0 && col < width && row < height && slice >= 0 && slice < depth) { img->FetchTexelf(img, col, row, slice, &depthSample); } diff --git a/src/mesa/swrast/s_triangle.c b/src/mesa/swrast/s_triangle.c index 85513e1..d65efce 100644 --- a/src/mesa/swrast/s_triangle.c +++ b/src/mesa/swrast/s_triangle.c @@ -768,7 +768,7 @@ fast_persp_span(struct gl_context *ctx, SWspan *span, } break; } - + ASSERT(span->arrayMask & SPAN_RGBA); _swrast_write_rgba_span(ctx, span); diff --git a/src/mesa/swrast/swrast.h b/src/mesa/swrast/swrast.h index 9b88c70..ad2bfff 100644 --- a/src/mesa/swrast/swrast.h +++ b/src/mesa/swrast/swrast.h @@ -37,7 +37,7 @@ /** * \struct SWvertex * \brief Data-structure to handle vertices in the software rasterizer. - * + * * The software rasterizer now uses this format for vertices. Thus a * 'RasterSetup' stage or other translation is required between the * tnl module and the swrast rasterization functions. This serves to diff --git a/src/mesa/swrast_setup/ss_context.c b/src/mesa/swrast_setup/ss_context.c index 5da2e1e..9d4f50f 100644 --- a/src/mesa/swrast_setup/ss_context.c +++ b/src/mesa/swrast_setup/ss_context.c @@ -59,7 +59,7 @@ _swsetup_CreateContext( struct gl_context *ctx ) swsetup->NewState = ~0; _swsetup_trifuncs_init( ctx ); - _tnl_init_vertices( ctx, ctx->Const.MaxArrayLockSize + 12, + _tnl_init_vertices( ctx, ctx->Const.MaxArrayLockSize + 12, sizeof(SWvertex) ); @@ -266,7 +266,7 @@ _swsetup_Wakeup( struct gl_context *ctx ) /** * Populate a swrast SWvertex from an attrib-style vertex. */ -void +void _swsetup_Translate( struct gl_context *ctx, const void *vertex, SWvertex *dest ) { const GLfloat *m = ctx->Viewport._WindowMap.m; diff --git a/src/mesa/swrast_setup/swrast_setup.h b/src/mesa/swrast_setup/swrast_setup.h index 1d87ec1..fc0fc83 100644 --- a/src/mesa/swrast_setup/swrast_setup.h +++ b/src/mesa/swrast_setup/swrast_setup.h @@ -32,7 +32,7 @@ * * The internals of the implementation are private, but can be hooked * into tnl at any time (except between RenderStart/RenderEnd) by - * calling _swsetup_Wakeup(). + * calling _swsetup_Wakeup(). */ #ifndef SWRAST_SETUP_H @@ -55,7 +55,7 @@ _swsetup_Wakeup( struct gl_context *ctx ); /* Helper function to translate a hardware vertex (as understood by * the tnl/t_vertex.c code) to a swrast vertex. */ -extern void +extern void _swsetup_Translate( struct gl_context *ctx, const void *vertex, SWvertex *dest ); #endif diff --git a/src/mesa/tnl/t_context.c b/src/mesa/tnl/t_context.c index 47aeeb8..7110027 100644 --- a/src/mesa/tnl/t_context.c +++ b/src/mesa/tnl/t_context.c @@ -148,7 +148,7 @@ _tnl_InvalidateState( struct gl_context *ctx, GLuint new_state ) } } - if (ctx->Polygon.FrontMode != GL_FILL || + if (ctx->Polygon.FrontMode != GL_FILL || ctx->Polygon.BackMode != GL_FILL) RENDERINPUTS_SET( tnl->render_inputs_bitset, _TNL_ATTRIB_EDGEFLAG ); @@ -181,7 +181,7 @@ _tnl_wakeup( struct gl_context *ctx ) #if 0 if (ctx->Light.ColorMaterialEnabled) { - _mesa_update_color_material( ctx, + _mesa_update_color_material( ctx, ctx->Current.Attrib[VERT_ATTRIB_COLOR0] ); } #endif diff --git a/src/mesa/tnl/t_context.h b/src/mesa/tnl/t_context.h index bc01646..1d556e5 100644 --- a/src/mesa/tnl/t_context.h +++ b/src/mesa/tnl/t_context.h @@ -201,7 +201,7 @@ struct vertex_buffer * such as backface color or eye-space coordinates, they are stored * here. */ - GLuint *Elts; + GLuint *Elts; GLvector4f *EyePtr; /* _TNL_BIT_POS */ GLvector4f *ClipPtr; /* _TNL_BIT_POS */ GLvector4f *NdcPtr; /* _TNL_BIT_POS */ @@ -214,8 +214,8 @@ struct vertex_buffer GLvector4f *BackfaceColorPtr; GLvector4f *BackfaceSecondaryColorPtr; - const struct _mesa_prim *Primitive; - GLuint PrimitiveCount; + const struct _mesa_prim *Primitive; + GLuint PrimitiveCount; /* Inputs to the vertex program stage */ GLvector4f *AttribPtr[_TNL_ATTRIB_MAX]; /* GL_NV_vertex_program */ @@ -260,10 +260,10 @@ struct tnl_pipeline_stage /** Contains the array of all pipeline stages. - * The default values are defined at the end of t_pipeline.c + * The default values are defined at the end of t_pipeline.c */ struct tnl_pipeline { - + GLuint last_attrib_stride[_TNL_ATTRIB_MAX]; GLuint last_attrib_size[_TNL_ATTRIB_MAX]; GLuint input_changes; @@ -276,16 +276,16 @@ struct tnl_pipeline { struct tnl_clipspace; struct tnl_clipspace_attr; -typedef void (*tnl_extract_func)( const struct tnl_clipspace_attr *a, - GLfloat *out, +typedef void (*tnl_extract_func)( const struct tnl_clipspace_attr *a, + GLfloat *out, const GLubyte *v ); -typedef void (*tnl_insert_func)( const struct tnl_clipspace_attr *a, - GLubyte *v, +typedef void (*tnl_insert_func)( const struct tnl_clipspace_attr *a, + GLubyte *v, const GLfloat *in ); -typedef void (*tnl_emit_func)( struct gl_context *ctx, - GLuint count, +typedef void (*tnl_emit_func)( struct gl_context *ctx, + GLuint count, GLubyte *dest ); @@ -353,7 +353,7 @@ struct tnl_clipspace_fastpath { struct tnl_clipspace { GLboolean need_extras; - + GLuint new_inputs; GLubyte *vertex_buf; @@ -370,13 +370,13 @@ struct tnl_clipspace /* Parameters and constants for codegen: */ GLboolean need_viewport; - GLfloat vp_scale[4]; + GLfloat vp_scale[4]; GLfloat vp_xlate[4]; GLfloat chan_scale[4]; GLfloat identity[4]; struct tnl_clipspace_fastpath *fastpath; - + void (*codegen_emit)( struct gl_context *ctx ); }; @@ -390,7 +390,7 @@ struct tnl_device_driver void (*RunPipeline)(struct gl_context *ctx); /* Replaces PipelineStart/PipelineFinish -- intended to allow * drivers to wrap _tnl_run_pipeline() with code to validate state - * and grab/release hardware locks. + * and grab/release hardware locks. */ void (*NotifyMaterialChange)(struct gl_context *ctx); @@ -465,7 +465,7 @@ struct tnl_device_driver * * This function is called only from _tnl_render_stage in tnl/t_render.c. */ - + GLboolean (*Multipass)( struct gl_context *ctx, GLuint passno ); /* Driver may request additional render passes by returning GL_TRUE @@ -522,7 +522,7 @@ typedef struct GLvector4f tmp_inputs[VERT_ATTRIB_MAX]; - /* Temp storage for t_draw.c: + /* Temp storage for t_draw.c: */ GLubyte *block[VERT_ATTRIB_MAX]; GLuint nr_blocks; diff --git a/src/mesa/tnl/t_draw.c b/src/mesa/tnl/t_draw.c index ccf8943..43a6432 100644 --- a/src/mesa/tnl/t_draw.c +++ b/src/mesa/tnl/t_draw.c @@ -42,7 +42,7 @@ static GLubyte *get_space(struct gl_context *ctx, GLuint bytes) { TNLcontext *tnl = TNL_CONTEXT(ctx); GLubyte *space = malloc(bytes); - + tnl->block[tnl->nr_blocks++] = space; return space; } @@ -181,32 +181,32 @@ static void _tnl_import_array( struct gl_context *ctx, GLfloat *fptr = (GLfloat *)buf; switch (input->Type) { - case GL_BYTE: - CONVERT(GLbyte, BYTE_TO_FLOAT); + case GL_BYTE: + CONVERT(GLbyte, BYTE_TO_FLOAT); break; - case GL_UNSIGNED_BYTE: + case GL_UNSIGNED_BYTE: if (input->Format == GL_BGRA) { /* See GL_EXT_vertex_array_bgra */ convert_bgra_to_float(input, ptr, fptr, count); } else { - CONVERT(GLubyte, UBYTE_TO_FLOAT); + CONVERT(GLubyte, UBYTE_TO_FLOAT); } break; - case GL_SHORT: - CONVERT(GLshort, SHORT_TO_FLOAT); + case GL_SHORT: + CONVERT(GLshort, SHORT_TO_FLOAT); break; - case GL_UNSIGNED_SHORT: - CONVERT(GLushort, USHORT_TO_FLOAT); + case GL_UNSIGNED_SHORT: + CONVERT(GLushort, USHORT_TO_FLOAT); break; - case GL_INT: - CONVERT(GLint, INT_TO_FLOAT); + case GL_INT: + CONVERT(GLint, INT_TO_FLOAT); break; - case GL_UNSIGNED_INT: - CONVERT(GLuint, UINT_TO_FLOAT); + case GL_UNSIGNED_INT: + CONVERT(GLuint, UINT_TO_FLOAT); break; - case GL_DOUBLE: - CONVERT(GLdouble, (GLfloat)); + case GL_DOUBLE: + CONVERT(GLdouble, (GLfloat)); break; case GL_HALF_FLOAT: convert_half_to_float(input, ptr, fptr, count, sz); @@ -230,12 +230,12 @@ static void _tnl_import_array( struct gl_context *ctx, VB->AttribPtr[attrib]->stride = stride; VB->AttribPtr[attrib]->size = input->Size; - /* This should die, but so should the whole GLvector4f concept: + /* This should die, but so should the whole GLvector4f concept: */ - VB->AttribPtr[attrib]->flags = (((1<Size)-1) | + VB->AttribPtr[attrib]->flags = (((1<Size)-1) | VEC_NOT_WRITEABLE | (stride == 4*sizeof(GLfloat) ? 0 : VEC_BAD_STRIDE)); - + VB->AttribPtr[attrib]->storage = NULL; } @@ -261,7 +261,7 @@ static GLboolean *_tnl_import_edgeflag( struct gl_context *ctx, } -static void bind_inputs( struct gl_context *ctx, +static void bind_inputs( struct gl_context *ctx, const struct gl_client_array *inputs[], GLint count, struct gl_buffer_object **bo, @@ -276,18 +276,18 @@ static void bind_inputs( struct gl_context *ctx, for (i = 0; i < VERT_ATTRIB_MAX; i++) { const void *ptr; - if (inputs[i]->BufferObj->Name) { + if (inputs[i]->BufferObj->Name) { if (!inputs[i]->BufferObj->Pointer) { bo[*nr_bo] = inputs[i]->BufferObj; (*nr_bo)++; - ctx->Driver.MapBuffer(ctx, + ctx->Driver.MapBuffer(ctx, GL_ARRAY_BUFFER, GL_READ_ONLY_ARB, inputs[i]->BufferObj); - + assert(inputs[i]->BufferObj->Pointer); } - + ptr = ADD_POINTERS(inputs[i]->BufferObj->Pointer, inputs[i]->Ptr); } @@ -295,7 +295,7 @@ static void bind_inputs( struct gl_context *ctx, ptr = inputs[i]->Ptr; /* Just make sure the array is floating point, otherwise convert to - * temporary storage. + * temporary storage. * * XXX: remove the GLvector4f type at some stage and just use * client arrays. @@ -319,7 +319,7 @@ static void bind_inputs( struct gl_context *ctx, if (ctx->Polygon.FrontMode != GL_FILL || ctx->Polygon.BackMode != GL_FILL) { - VB->EdgeFlag = _tnl_import_edgeflag( ctx, + VB->EdgeFlag = _tnl_import_edgeflag( ctx, VB->AttribPtr[_TNL_ATTRIB_EDGEFLAG], VB->Count ); } @@ -350,7 +350,7 @@ static void bind_indices( struct gl_context *ctx, if (ib->obj->Name && !ib->obj->Pointer) { bo[*nr_bo] = ib->obj; (*nr_bo)++; - ctx->Driver.MapBuffer(ctx, + ctx->Driver.MapBuffer(ctx, GL_ELEMENT_ARRAY_BUFFER, GL_READ_ONLY_ARB, ib->obj); @@ -374,12 +374,12 @@ static void bind_indices( struct gl_context *ctx, } else if (ib->type == GL_UNSIGNED_SHORT) { const GLushort *in = (GLushort *)ptr; - for (i = 0; i < ib->count; i++) + for (i = 0; i < ib->count; i++) *elts++ = (GLuint)(*in++) + VB->Primitive[0].basevertex; } else { const GLubyte *in = (GLubyte *)ptr; - for (i = 0; i < ib->count; i++) + for (i = 0; i < ib->count; i++) *elts++ = (GLuint)(*in++) + VB->Primitive[0].basevertex; } } @@ -401,8 +401,8 @@ static void unmap_vbos( struct gl_context *ctx, GLuint nr_bo ) { GLuint i; - for (i = 0; i < nr_bo; i++) { - ctx->Driver.UnmapBuffer(ctx, + for (i = 0; i < nr_bo; i++) { + ctx->Driver.UnmapBuffer(ctx, 0, /* target -- I don't see why this would be needed */ bo[i]); } @@ -455,16 +455,16 @@ void _tnl_draw_prims( struct gl_context *ctx, { printf("%s %d..%d\n", __FUNCTION__, min_index, max_index); for (i = 0; i < nr_prims; i++) - printf("prim %d: %s start %d count %d\n", i, + printf("prim %d: %s start %d count %d\n", i, _mesa_lookup_enum_by_nr(prim[i].mode), prim[i].start, prim[i].count); } if (min_index) { - /* We always translate away calls with min_index != 0. + /* We always translate away calls with min_index != 0. */ - vbo_rebase_prims( ctx, arrays, prim, nr_prims, ib, + vbo_rebase_prims( ctx, arrays, prim, nr_prims, ib, min_index, max_index, _tnl_vbo_draw_prims ); return; @@ -482,7 +482,7 @@ void _tnl_draw_prims( struct gl_context *ctx, /* This will split the buffers one way or another and * recursively call back into this function. */ - vbo_split_prims( ctx, arrays, prim, nr_prims, ib, + vbo_split_prims( ctx, arrays, prim, nr_prims, ib, 0, max_index + prim->basevertex, _tnl_vbo_draw_prims, &limits ); diff --git a/src/mesa/tnl/t_pipeline.c b/src/mesa/tnl/t_pipeline.c index 18f095f..1b4beb1 100644 --- a/src/mesa/tnl/t_pipeline.c +++ b/src/mesa/tnl/t_pipeline.c @@ -75,7 +75,7 @@ static GLuint check_input_changes( struct gl_context *ctx ) { TNLcontext *tnl = TNL_CONTEXT(ctx); GLuint i; - + for (i = 0; i <= _TNL_LAST_MAT; i++) { if (tnl->vb.AttribPtr[i]->size != tnl->pipeline.last_attrib_size[i] || tnl->vb.AttribPtr[i]->stride != tnl->pipeline.last_attrib_stride[i]) { @@ -93,7 +93,7 @@ static GLuint check_output_changes( struct gl_context *ctx ) { #if 0 TNLcontext *tnl = TNL_CONTEXT(ctx); - + for (i = 0; i < VERT_RESULT_MAX; i++) { if (tnl->vb.ResultPtr[i]->size != tnl->last_result_size[i] || tnl->vb.ResultPtr[i]->stride != tnl->last_result_stride[i]) { @@ -103,9 +103,9 @@ static GLuint check_output_changes( struct gl_context *ctx ) } } - if (tnl->pipeline.output_changes) + if (tnl->pipeline.output_changes) tnl->Driver.NotifyOutputChanges( ctx, tnl->pipeline.output_changes ); - + return tnl->pipeline.output_changes; #else return ~0; @@ -134,10 +134,10 @@ void _tnl_run_pipeline( struct gl_context *ctx ) if (s->validate) s->validate( ctx, s ); } - + tnl->pipeline.new_state = 0; tnl->pipeline.input_changes = 0; - + /* Pipeline can only change its output in response to either a * statechange or an input size/stride change. No other changes * are allowed. @@ -197,10 +197,10 @@ const struct tnl_pipeline_stage *_tnl_default_pipeline[] = { &_tnl_texgen_stage, &_tnl_texture_transform_stage, &_tnl_point_attenuation_stage, - &_tnl_vertex_program_stage, + &_tnl_vertex_program_stage, &_tnl_fog_coordinate_stage, &_tnl_render_stage, - NULL + NULL }; const struct tnl_pipeline_stage *_tnl_vp_pipeline[] = { diff --git a/src/mesa/tnl/t_pipeline.h b/src/mesa/tnl/t_pipeline.h index 0eb0339..166b524 100644 --- a/src/mesa/tnl/t_pipeline.h +++ b/src/mesa/tnl/t_pipeline.h @@ -64,7 +64,7 @@ extern const struct tnl_pipeline_stage *_tnl_vp_pipeline[]; extern tnl_render_func _tnl_render_tab_elts[]; extern tnl_render_func _tnl_render_tab_verts[]; -extern void _tnl_RenderClippedPolygon( struct gl_context *ctx, +extern void _tnl_RenderClippedPolygon( struct gl_context *ctx, const GLuint *elts, GLuint n ); extern void _tnl_RenderClippedLine( struct gl_context *ctx, GLuint ii, GLuint jj ); diff --git a/src/mesa/tnl/t_rasterpos.c b/src/mesa/tnl/t_rasterpos.c index 0492490..005e9f7 100644 --- a/src/mesa/tnl/t_rasterpos.c +++ b/src/mesa/tnl/t_rasterpos.c @@ -40,7 +40,7 @@ * Clip a point against the view volume. * * \param v vertex vector describing the point to clip. - * + * * \return zero if outside view volume, or one if inside. */ static GLuint @@ -60,7 +60,7 @@ viewclip_point_xy( const GLfloat v[] ) * Clip a point against the far/near Z clipping planes. * * \param v vertex vector describing the point to clip. - * + * * \return zero if outside view volume, or one if inside. */ static GLuint @@ -77,10 +77,10 @@ viewclip_point_z( const GLfloat v[] ) /** * Clip a point against the user clipping planes. - * + * * \param ctx GL context. * \param v vertex vector describing the point to clip. - * + * * \return zero if the point was clipped, or one otherwise. */ static GLuint @@ -128,7 +128,7 @@ shade_rastpos(struct gl_context *ctx, _mesa_validate_all_lighting_tables( ctx ); COPY_3V(diffuseColor, base[0]); - diffuseColor[3] = CLAMP( + diffuseColor[3] = CLAMP( ctx->Light.Material.Attrib[MAT_ATTRIB_FRONT_DIFFUSE][3], 0.0F, 1.0F ); ASSIGN_4V(specularColor, 0.0, 0.0, 0.0, 1.0); diff --git a/src/mesa/tnl/t_vb_light.c b/src/mesa/tnl/t_vb_light.c index 3acedf6..5219d14 100644 --- a/src/mesa/tnl/t_vb_light.c +++ b/src/mesa/tnl/t_vb_light.c @@ -95,7 +95,7 @@ update_materials(struct gl_context *ctx, struct light_stage_data *store) /* increment src vertex color pointer */ STRIDE_F(store->mat[i].ptr, store->mat[i].stride); } - + /* recompute derived light/material values */ _mesa_update_material( ctx, store->mat_bitmask ); /* XXX we should only call this if we're tracking/changing the specular @@ -114,7 +114,7 @@ prepare_materials(struct gl_context *ctx, struct vertex_buffer *VB, struct light_stage_data *store) { GLuint i; - + store->mat_count = 0; store->mat_bitmask = 0; @@ -192,7 +192,7 @@ static void init_lighting_tables( void ) } -static GLboolean run_lighting( struct gl_context *ctx, +static GLboolean run_lighting( struct gl_context *ctx, struct tnl_pipeline_stage *stage ) { struct light_stage_data *store = LIGHT_STAGE_DATA(stage); @@ -221,7 +221,7 @@ static GLboolean run_lighting( struct gl_context *ctx, */ _mesa_vector4f_clean_elem(&store->Input, VB->Count, 2); } - + if (input->size <= 1) { /* Clean y. */ @@ -230,7 +230,7 @@ static GLboolean run_lighting( struct gl_context *ctx, input = &store->Input; } - + idx = 0; if (prepare_materials( ctx, VB, store )) @@ -240,7 +240,7 @@ static GLboolean run_lighting( struct gl_context *ctx, idx |= LIGHT_TWOSIDE; /* The individual functions know about replaying side-effects - * vs. full re-execution. + * vs. full re-execution. */ store->light_func_tab[idx]( ctx, VB, stage, input ); diff --git a/src/mesa/tnl/t_vb_program.c b/src/mesa/tnl/t_vb_program.c index 94372bb..191e9d1 100644 --- a/src/mesa/tnl/t_vb_program.c +++ b/src/mesa/tnl/t_vb_program.c @@ -96,7 +96,7 @@ userclip( struct gl_context *ctx, GLuint count = clip->count; for (nr = 0, i = 0 ; i < count ; i++) { - GLfloat dp = (coord[0] * a + + GLfloat dp = (coord[0] * a + coord[1] * b + coord[2] * c + coord[3] * d); @@ -404,9 +404,9 @@ run_vp( struct gl_context *ctx, struct tnl_pipeline_stage *stage ) #endif #if 0 printf("HPOS: %f %f %f %f\n", - machine->Outputs[0][0], - machine->Outputs[0][1], - machine->Outputs[0][2], + machine->Outputs[0][0], + machine->Outputs[0][1], + machine->Outputs[0][2], machine->Outputs[0][3]); #endif } diff --git a/src/mesa/tnl/t_vb_render.c b/src/mesa/tnl/t_vb_render.c index cb31921..4343039 100644 --- a/src/mesa/tnl/t_vb_render.c +++ b/src/mesa/tnl/t_vb_render.c @@ -295,8 +295,8 @@ static GLboolean run_render( struct gl_context *ctx, clip_render_tab_elts[GL_TRIANGLES] = clip_elt_triangles; } else { - tab = (VB->Elts ? - tnl->Driver.Render.PrimTabElts : + tab = (VB->Elts ? + tnl->Driver.Render.PrimTabElts : tnl->Driver.Render.PrimTabVerts); } @@ -312,9 +312,9 @@ static GLboolean run_render( struct gl_context *ctx, assert((prim & PRIM_MODE_MASK) <= GL_POLYGON); - if (MESA_VERBOSE & VERBOSE_PRIMS) - _mesa_debug(NULL, "MESA prim %s %d..%d\n", - _mesa_lookup_enum_by_nr(prim & PRIM_MODE_MASK), + if (MESA_VERBOSE & VERBOSE_PRIMS) + _mesa_debug(NULL, "MESA prim %s %d..%d\n", + _mesa_lookup_enum_by_nr(prim & PRIM_MODE_MASK), start, start+length); if (length) diff --git a/src/mesa/tnl/t_vb_texgen.c b/src/mesa/tnl/t_vb_texgen.c index 61430c3..943543b 100644 --- a/src/mesa/tnl/t_vb_texgen.c +++ b/src/mesa/tnl/t_vb_texgen.c @@ -264,7 +264,7 @@ static void texgen_reflection_map_nv( struct gl_context *ctx, out->flags |= (in->flags & VEC_SIZE_FLAGS) | VEC_SIZE_3; out->count = VB->Count; out->size = MAX2(in->size, 3); - if (in->size == 4) + if (in->size == 4) _mesa_copy_tab[0x8]( out, in ); } @@ -293,7 +293,7 @@ static void texgen_normal_map_nv( struct gl_context *ctx, out->flags |= (in->flags & VEC_SIZE_FLAGS) | VEC_SIZE_3; out->count = count; out->size = MAX2(in->size, 3); - if (in->size == 4) + if (in->size == 4) _mesa_copy_tab[0x8]( out, in ); } @@ -487,7 +487,7 @@ static GLboolean run_texgen_stage( struct gl_context *ctx, struct texgen_stage_data *store = TEXGEN_STAGE_DATA(stage); GLuint i; - if (!ctx->Texture._TexGenEnabled || ctx->VertexProgram._Current) + if (!ctx->Texture._TexGenEnabled || ctx->VertexProgram._Current) return GL_TRUE; for (i = 0 ; i < ctx->Const.MaxTextureCoordUnits ; i++) { @@ -511,7 +511,7 @@ static void validate_texgen_stage( struct gl_context *ctx, struct texgen_stage_data *store = TEXGEN_STAGE_DATA(stage); GLuint i; - if (!ctx->Texture._TexGenEnabled || ctx->VertexProgram._Current) + if (!ctx->Texture._TexGenEnabled || ctx->VertexProgram._Current) return; for (i = 0 ; i < ctx->Const.MaxTextureCoordUnits ; i++) { diff --git a/src/mesa/tnl/t_vb_texmat.c b/src/mesa/tnl/t_vb_texmat.c index 38aa51f..4cfe566 100644 --- a/src/mesa/tnl/t_vb_texmat.c +++ b/src/mesa/tnl/t_vb_texmat.c @@ -60,7 +60,7 @@ static GLboolean run_texmat_stage( struct gl_context *ctx, struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb; GLuint i; - if (!ctx->Texture._TexMatEnabled || ctx->VertexProgram._Current) + if (!ctx->Texture._TexMatEnabled || ctx->VertexProgram._Current) return GL_TRUE; /* ENABLE_TEXMAT implies that the texture matrix is not the diff --git a/src/mesa/tnl/t_vb_vertex.c b/src/mesa/tnl/t_vb_vertex.c index 26e8ae0..88bf335 100644 --- a/src/mesa/tnl/t_vb_vertex.c +++ b/src/mesa/tnl/t_vb_vertex.c @@ -141,7 +141,7 @@ static GLboolean run_vertex_stage( struct gl_context *ctx, TNLcontext *tnl = TNL_CONTEXT(ctx); struct vertex_buffer *VB = &tnl->vb; - if (ctx->VertexProgram._Current) + if (ctx->VertexProgram._Current) return GL_TRUE; tnl_clip_prepare(ctx); @@ -165,7 +165,7 @@ static GLboolean run_vertex_stage( struct gl_context *ctx, /* Drivers expect this to be clean to element 4... */ switch (VB->ClipPtr->size) { - case 1: + case 1: /* impossible */ case 2: _mesa_vector4f_clean_elem( VB->ClipPtr, VB->Count, 2 ); diff --git a/src/mesa/tnl/t_vertex.c b/src/mesa/tnl/t_vertex.c index f1cb795..73bcbf1 100644 --- a/src/mesa/tnl/t_vertex.c +++ b/src/mesa/tnl/t_vertex.c @@ -42,24 +42,24 @@ static GLboolean match_fastpath( struct tnl_clipspace *vtx, { GLuint j; - if (vtx->attr_count != fp->attr_count) + if (vtx->attr_count != fp->attr_count) return GL_FALSE; - for (j = 0; j < vtx->attr_count; j++) + for (j = 0; j < vtx->attr_count; j++) if (vtx->attr[j].format != fp->attr[j].format || vtx->attr[j].inputsize != fp->attr[j].size || - vtx->attr[j].vertoffset != fp->attr[j].offset) + vtx->attr[j].vertoffset != fp->attr[j].offset) return GL_FALSE; - + if (fp->match_strides) { if (vtx->vertex_size != fp->vertex_size) return GL_FALSE; - for (j = 0; j < vtx->attr_count; j++) - if (vtx->attr[j].inputstride != fp->attr[j].stride) + for (j = 0; j < vtx->attr_count; j++) + if (vtx->attr[j].inputstride != fp->attr[j].stride) return GL_FALSE; } - + return GL_TRUE; } @@ -122,7 +122,7 @@ static void choose_emit_func( struct gl_context *ctx, GLuint count, GLubyte *des } vtx->emit = NULL; - + /* Does this match an existing (hardwired, codegen or known-bad) * fastpath? */ @@ -157,7 +157,7 @@ static void choose_interp_func( struct gl_context *ctx, { struct tnl_clipspace *vtx = GET_VERTEX_STATE(ctx); - if (vtx->need_extras && + if (vtx->need_extras && (ctx->_TriangleCaps & (DD_TRI_LIGHT_TWOSIDE|DD_TRI_UNFILLED))) { vtx->interp = _tnl_generic_interp_extras; } else { @@ -172,7 +172,7 @@ static void choose_copy_pv_func( struct gl_context *ctx, GLuint edst, GLuint es { struct tnl_clipspace *vtx = GET_VERTEX_STATE(ctx); - if (vtx->need_extras && + if (vtx->need_extras && (ctx->_TriangleCaps & (DD_TRI_LIGHT_TWOSIDE|DD_TRI_UNFILLED))) { vtx->copy_pv = _tnl_generic_copy_pv_extras; } else { @@ -286,7 +286,7 @@ static void invalidate_funcs( struct tnl_clipspace *vtx ) } GLuint _tnl_install_attrs( struct gl_context *ctx, const struct tnl_attr_map *map, - GLuint nr, const GLfloat *vp, + GLuint nr, const GLfloat *vp, GLuint unpacked_size ) { struct tnl_clipspace *vtx = GET_VERTEX_STATE(ctx); @@ -307,8 +307,8 @@ GLuint _tnl_install_attrs( struct gl_context *ctx, const struct tnl_attr_map *ma const GLuint format = map[i].format; if (format == EMIT_PAD) { if (DBG) - printf("%d: pad %d, offset %d\n", i, - map[i].offset, offset); + printf("%d: pad %d, offset %d\n", i, + map[i].offset, offset); offset += map[i].offset; @@ -316,7 +316,7 @@ GLuint _tnl_install_attrs( struct gl_context *ctx, const struct tnl_attr_map *ma else { GLuint tmpoffset; - if (unpacked_size) + if (unpacked_size) tmpoffset = map[i].offset; else tmpoffset = offset; @@ -336,11 +336,11 @@ GLuint _tnl_install_attrs( struct gl_context *ctx, const struct tnl_attr_map *ma vtx->attr[j].vertoffset = tmpoffset; } - + if (DBG) - printf("%d: %s, vp %p, offset %d\n", i, + printf("%d: %s, vp %p, offset %d\n", i, _tnl_format_info[format].name, (void *)vp, - vtx->attr[j].vertoffset); + vtx->attr[j].vertoffset); offset += _tnl_format_info[format].attrsize; j++; @@ -399,7 +399,7 @@ static void update_input_ptrs( struct gl_context *ctx, GLuint start ) struct tnl_clipspace_attr *a = vtx->attr; const GLuint count = vtx->attr_count; GLuint j; - + for (j = 0; j < count; j++) { GLvector4f *vptr = VB->AttribPtr[a[j].attrib]; @@ -410,7 +410,7 @@ static void update_input_ptrs( struct gl_context *ctx, GLuint start ) a[j].inputptr = ((GLubyte *)vptr->data) + start * vptr->stride; } - + if (a->vp) { vtx->vp_scale[0] = a->vp[MAT_SX]; vtx->vp_scale[1] = a->vp[MAT_SY]; @@ -429,10 +429,10 @@ void _tnl_build_vertices( struct gl_context *ctx, GLuint end, GLuint newinputs ) { - struct tnl_clipspace *vtx = GET_VERTEX_STATE(ctx); - update_input_ptrs( ctx, start ); - vtx->emit( ctx, end - start, - (GLubyte *)(vtx->vertex_buf + + struct tnl_clipspace *vtx = GET_VERTEX_STATE(ctx); + update_input_ptrs( ctx, start ); + vtx->emit( ctx, end - start, + (GLubyte *)(vtx->vertex_buf + start * vtx->vertex_size)); } @@ -449,7 +449,7 @@ void *_tnl_emit_vertices_to_buffer( struct gl_context *ctx, update_input_ptrs(ctx, start); /* Note: dest should not be adjusted for non-zero 'start' values: */ - vtx->emit( ctx, end - start, (GLubyte*) dest ); + vtx->emit( ctx, end - start, (GLubyte*) dest ); return (void *)((GLubyte *)dest + vtx->vertex_size * (end - start)); } @@ -482,11 +482,11 @@ void *_tnl_emit_indexed_vertices_to_buffer( struct gl_context *ctx, } -void _tnl_init_vertices( struct gl_context *ctx, +void _tnl_init_vertices( struct gl_context *ctx, GLuint vb_size, GLuint max_vertex_size ) { - struct tnl_clipspace *vtx = GET_VERTEX_STATE(ctx); + struct tnl_clipspace *vtx = GET_VERTEX_STATE(ctx); _tnl_install_attrs( ctx, NULL, 0, NULL, 0 ); diff --git a/src/mesa/tnl/t_vertex.h b/src/mesa/tnl/t_vertex.h index 252f2f7..37486f6 100644 --- a/src/mesa/tnl/t_vertex.h +++ b/src/mesa/tnl/t_vertex.h @@ -32,7 +32,7 @@ #include "t_context.h" /* New mechanism to specify hardware vertices so that tnl can build - * and manipulate them directly. + * and manipulate them directly. */ @@ -97,7 +97,7 @@ extern void _tnl_get_attr( struct gl_context *ctx, const void *vertex, GLenum at /* Complementary to the above. */ -extern void _tnl_set_attr( struct gl_context *ctx, void *vout, GLenum attrib, +extern void _tnl_set_attr( struct gl_context *ctx, void *vout, GLenum attrib, const GLfloat *src ); @@ -110,7 +110,7 @@ extern GLuint _tnl_install_attrs( struct gl_context *ctx, extern void _tnl_free_vertices( struct gl_context *ctx ); -extern void _tnl_init_vertices( struct gl_context *ctx, +extern void _tnl_init_vertices( struct gl_context *ctx, GLuint vb_size, GLuint max_vertex_size ); @@ -119,11 +119,11 @@ extern void *_tnl_emit_vertices_to_buffer( struct gl_context *ctx, GLuint end, void *dest ); -/* This function isn't optimal. Check out +/* This function isn't optimal. Check out * gallium/auxilary/translate for a more comprehensive implementation of * the same functionality. */ - + extern void *_tnl_emit_indexed_vertices_to_buffer( struct gl_context *ctx, const GLuint *elts, GLuint start, @@ -153,7 +153,7 @@ void _tnl_register_fastpath( struct tnl_clipspace *vtx, /* t_vertex_generic.c -- Internal functions for t_vertex.c */ -void _tnl_generic_copy_pv_extras( struct gl_context *ctx, +void _tnl_generic_copy_pv_extras( struct gl_context *ctx, GLuint dst, GLuint src ); void _tnl_generic_interp_extras( struct gl_context *ctx, diff --git a/src/mesa/tnl/t_vertex_generic.c b/src/mesa/tnl/t_vertex_generic.c index 12da30f..a282eb9 100644 --- a/src/mesa/tnl/t_vertex_generic.c +++ b/src/mesa/tnl/t_vertex_generic.c @@ -276,55 +276,55 @@ static INLINE void insert_null( const struct tnl_clipspace_attr *a, GLubyte *v, (void) a; (void) v; (void) in; } -static INLINE void insert_4chan_4f_rgba_4( const struct tnl_clipspace_attr *a, GLubyte *v, +static INLINE void insert_4chan_4f_rgba_4( const struct tnl_clipspace_attr *a, GLubyte *v, const GLfloat *in ) { GLchan *c = (GLchan *)v; DEBUG_INSERT; (void) a; - UNCLAMPED_FLOAT_TO_CHAN(c[0], in[0]); - UNCLAMPED_FLOAT_TO_CHAN(c[1], in[1]); - UNCLAMPED_FLOAT_TO_CHAN(c[2], in[2]); + UNCLAMPED_FLOAT_TO_CHAN(c[0], in[0]); + UNCLAMPED_FLOAT_TO_CHAN(c[1], in[1]); + UNCLAMPED_FLOAT_TO_CHAN(c[2], in[2]); UNCLAMPED_FLOAT_TO_CHAN(c[3], in[3]); } -static INLINE void insert_4chan_4f_rgba_3( const struct tnl_clipspace_attr *a, GLubyte *v, +static INLINE void insert_4chan_4f_rgba_3( const struct tnl_clipspace_attr *a, GLubyte *v, const GLfloat *in ) { GLchan *c = (GLchan *)v; DEBUG_INSERT; (void) a; - UNCLAMPED_FLOAT_TO_CHAN(c[0], in[0]); - UNCLAMPED_FLOAT_TO_CHAN(c[1], in[1]); - UNCLAMPED_FLOAT_TO_CHAN(c[2], in[2]); + UNCLAMPED_FLOAT_TO_CHAN(c[0], in[0]); + UNCLAMPED_FLOAT_TO_CHAN(c[1], in[1]); + UNCLAMPED_FLOAT_TO_CHAN(c[2], in[2]); c[3] = CHAN_MAX; } -static INLINE void insert_4chan_4f_rgba_2( const struct tnl_clipspace_attr *a, GLubyte *v, +static INLINE void insert_4chan_4f_rgba_2( const struct tnl_clipspace_attr *a, GLubyte *v, const GLfloat *in ) { GLchan *c = (GLchan *)v; DEBUG_INSERT; (void) a; - UNCLAMPED_FLOAT_TO_CHAN(c[0], in[0]); - UNCLAMPED_FLOAT_TO_CHAN(c[1], in[1]); + UNCLAMPED_FLOAT_TO_CHAN(c[0], in[0]); + UNCLAMPED_FLOAT_TO_CHAN(c[1], in[1]); c[2] = 0; c[3] = CHAN_MAX; } -static INLINE void insert_4chan_4f_rgba_1( const struct tnl_clipspace_attr *a, GLubyte *v, +static INLINE void insert_4chan_4f_rgba_1( const struct tnl_clipspace_attr *a, GLubyte *v, const GLfloat *in ) { GLchan *c = (GLchan *)v; DEBUG_INSERT; (void) a; - UNCLAMPED_FLOAT_TO_CHAN(c[0], in[0]); + UNCLAMPED_FLOAT_TO_CHAN(c[0], in[0]); c[1] = 0; c[2] = 0; c[3] = CHAN_MAX; } -static INLINE void insert_4ub_4f_rgba_4( const struct tnl_clipspace_attr *a, GLubyte *v, +static INLINE void insert_4ub_4f_rgba_4( const struct tnl_clipspace_attr *a, GLubyte *v, const GLfloat *in ) { DEBUG_INSERT; @@ -335,7 +335,7 @@ static INLINE void insert_4ub_4f_rgba_4( const struct tnl_clipspace_attr *a, GLu UNCLAMPED_FLOAT_TO_UBYTE(v[3], in[3]); } -static INLINE void insert_4ub_4f_rgba_3( const struct tnl_clipspace_attr *a, GLubyte *v, +static INLINE void insert_4ub_4f_rgba_3( const struct tnl_clipspace_attr *a, GLubyte *v, const GLfloat *in ) { DEBUG_INSERT; @@ -346,7 +346,7 @@ static INLINE void insert_4ub_4f_rgba_3( const struct tnl_clipspace_attr *a, GLu v[3] = 0xff; } -static INLINE void insert_4ub_4f_rgba_2( const struct tnl_clipspace_attr *a, GLubyte *v, +static INLINE void insert_4ub_4f_rgba_2( const struct tnl_clipspace_attr *a, GLubyte *v, const GLfloat *in ) { DEBUG_INSERT; @@ -357,7 +357,7 @@ static INLINE void insert_4ub_4f_rgba_2( const struct tnl_clipspace_attr *a, GLu v[3] = 0xff; } -static INLINE void insert_4ub_4f_rgba_1( const struct tnl_clipspace_attr *a, GLubyte *v, +static INLINE void insert_4ub_4f_rgba_1( const struct tnl_clipspace_attr *a, GLubyte *v, const GLfloat *in ) { DEBUG_INSERT; @@ -368,7 +368,7 @@ static INLINE void insert_4ub_4f_rgba_1( const struct tnl_clipspace_attr *a, GLu v[3] = 0xff; } -static INLINE void insert_4ub_4f_bgra_4( const struct tnl_clipspace_attr *a, GLubyte *v, +static INLINE void insert_4ub_4f_bgra_4( const struct tnl_clipspace_attr *a, GLubyte *v, const GLfloat *in ) { DEBUG_INSERT; @@ -379,7 +379,7 @@ static INLINE void insert_4ub_4f_bgra_4( const struct tnl_clipspace_attr *a, GLu UNCLAMPED_FLOAT_TO_UBYTE(v[3], in[3]); } -static INLINE void insert_4ub_4f_bgra_3( const struct tnl_clipspace_attr *a, GLubyte *v, +static INLINE void insert_4ub_4f_bgra_3( const struct tnl_clipspace_attr *a, GLubyte *v, const GLfloat *in ) { DEBUG_INSERT; @@ -390,7 +390,7 @@ static INLINE void insert_4ub_4f_bgra_3( const struct tnl_clipspace_attr *a, GLu v[3] = 0xff; } -static INLINE void insert_4ub_4f_bgra_2( const struct tnl_clipspace_attr *a, GLubyte *v, +static INLINE void insert_4ub_4f_bgra_2( const struct tnl_clipspace_attr *a, GLubyte *v, const GLfloat *in ) { DEBUG_INSERT; @@ -401,7 +401,7 @@ static INLINE void insert_4ub_4f_bgra_2( const struct tnl_clipspace_attr *a, GLu v[3] = 0xff; } -static INLINE void insert_4ub_4f_bgra_1( const struct tnl_clipspace_attr *a, GLubyte *v, +static INLINE void insert_4ub_4f_bgra_1( const struct tnl_clipspace_attr *a, GLubyte *v, const GLfloat *in ) { DEBUG_INSERT; @@ -412,7 +412,7 @@ static INLINE void insert_4ub_4f_bgra_1( const struct tnl_clipspace_attr *a, GLu v[3] = 0xff; } -static INLINE void insert_4ub_4f_argb_4( const struct tnl_clipspace_attr *a, GLubyte *v, +static INLINE void insert_4ub_4f_argb_4( const struct tnl_clipspace_attr *a, GLubyte *v, const GLfloat *in ) { DEBUG_INSERT; @@ -423,7 +423,7 @@ static INLINE void insert_4ub_4f_argb_4( const struct tnl_clipspace_attr *a, GLu UNCLAMPED_FLOAT_TO_UBYTE(v[0], in[3]); } -static INLINE void insert_4ub_4f_argb_3( const struct tnl_clipspace_attr *a, GLubyte *v, +static INLINE void insert_4ub_4f_argb_3( const struct tnl_clipspace_attr *a, GLubyte *v, const GLfloat *in ) { DEBUG_INSERT; @@ -434,7 +434,7 @@ static INLINE void insert_4ub_4f_argb_3( const struct tnl_clipspace_attr *a, GLu v[0] = 0xff; } -static INLINE void insert_4ub_4f_argb_2( const struct tnl_clipspace_attr *a, GLubyte *v, +static INLINE void insert_4ub_4f_argb_2( const struct tnl_clipspace_attr *a, GLubyte *v, const GLfloat *in ) { DEBUG_INSERT; @@ -445,7 +445,7 @@ static INLINE void insert_4ub_4f_argb_2( const struct tnl_clipspace_attr *a, GLu v[0] = 0xff; } -static INLINE void insert_4ub_4f_argb_1( const struct tnl_clipspace_attr *a, GLubyte *v, +static INLINE void insert_4ub_4f_argb_1( const struct tnl_clipspace_attr *a, GLubyte *v, const GLfloat *in ) { DEBUG_INSERT; @@ -456,7 +456,7 @@ static INLINE void insert_4ub_4f_argb_1( const struct tnl_clipspace_attr *a, GLu v[0] = 0xff; } -static INLINE void insert_4ub_4f_abgr_4( const struct tnl_clipspace_attr *a, GLubyte *v, +static INLINE void insert_4ub_4f_abgr_4( const struct tnl_clipspace_attr *a, GLubyte *v, const GLfloat *in ) { DEBUG_INSERT; @@ -467,7 +467,7 @@ static INLINE void insert_4ub_4f_abgr_4( const struct tnl_clipspace_attr *a, GLu UNCLAMPED_FLOAT_TO_UBYTE(v[0], in[3]); } -static INLINE void insert_4ub_4f_abgr_3( const struct tnl_clipspace_attr *a, GLubyte *v, +static INLINE void insert_4ub_4f_abgr_3( const struct tnl_clipspace_attr *a, GLubyte *v, const GLfloat *in ) { DEBUG_INSERT; @@ -478,7 +478,7 @@ static INLINE void insert_4ub_4f_abgr_3( const struct tnl_clipspace_attr *a, GLu v[0] = 0xff; } -static INLINE void insert_4ub_4f_abgr_2( const struct tnl_clipspace_attr *a, GLubyte *v, +static INLINE void insert_4ub_4f_abgr_2( const struct tnl_clipspace_attr *a, GLubyte *v, const GLfloat *in ) { DEBUG_INSERT; @@ -489,7 +489,7 @@ static INLINE void insert_4ub_4f_abgr_2( const struct tnl_clipspace_attr *a, GLu v[0] = 0xff; } -static INLINE void insert_4ub_4f_abgr_1( const struct tnl_clipspace_attr *a, GLubyte *v, +static INLINE void insert_4ub_4f_abgr_1( const struct tnl_clipspace_attr *a, GLubyte *v, const GLfloat *in ) { DEBUG_INSERT; @@ -500,7 +500,7 @@ static INLINE void insert_4ub_4f_abgr_1( const struct tnl_clipspace_attr *a, GLu v[0] = 0xff; } -static INLINE void insert_3ub_3f_rgb_3( const struct tnl_clipspace_attr *a, GLubyte *v, +static INLINE void insert_3ub_3f_rgb_3( const struct tnl_clipspace_attr *a, GLubyte *v, const GLfloat *in ) { DEBUG_INSERT; @@ -510,7 +510,7 @@ static INLINE void insert_3ub_3f_rgb_3( const struct tnl_clipspace_attr *a, GLub UNCLAMPED_FLOAT_TO_UBYTE(v[2], in[2]); } -static INLINE void insert_3ub_3f_rgb_2( const struct tnl_clipspace_attr *a, GLubyte *v, +static INLINE void insert_3ub_3f_rgb_2( const struct tnl_clipspace_attr *a, GLubyte *v, const GLfloat *in ) { DEBUG_INSERT; @@ -520,7 +520,7 @@ static INLINE void insert_3ub_3f_rgb_2( const struct tnl_clipspace_attr *a, GLub v[2] = 0; } -static INLINE void insert_3ub_3f_rgb_1( const struct tnl_clipspace_attr *a, GLubyte *v, +static INLINE void insert_3ub_3f_rgb_1( const struct tnl_clipspace_attr *a, GLubyte *v, const GLfloat *in ) { DEBUG_INSERT; @@ -530,7 +530,7 @@ static INLINE void insert_3ub_3f_rgb_1( const struct tnl_clipspace_attr *a, GLub v[2] = 0; } -static INLINE void insert_3ub_3f_bgr_3( const struct tnl_clipspace_attr *a, GLubyte *v, +static INLINE void insert_3ub_3f_bgr_3( const struct tnl_clipspace_attr *a, GLubyte *v, const GLfloat *in ) { DEBUG_INSERT; @@ -540,7 +540,7 @@ static INLINE void insert_3ub_3f_bgr_3( const struct tnl_clipspace_attr *a, GLub UNCLAMPED_FLOAT_TO_UBYTE(v[0], in[2]); } -static INLINE void insert_3ub_3f_bgr_2( const struct tnl_clipspace_attr *a, GLubyte *v, +static INLINE void insert_3ub_3f_bgr_2( const struct tnl_clipspace_attr *a, GLubyte *v, const GLfloat *in ) { DEBUG_INSERT; @@ -550,7 +550,7 @@ static INLINE void insert_3ub_3f_bgr_2( const struct tnl_clipspace_attr *a, GLub v[0] = 0; } -static INLINE void insert_3ub_3f_bgr_1( const struct tnl_clipspace_attr *a, GLubyte *v, +static INLINE void insert_3ub_3f_bgr_1( const struct tnl_clipspace_attr *a, GLubyte *v, const GLfloat *in ) { DEBUG_INSERT; @@ -561,7 +561,7 @@ static INLINE void insert_3ub_3f_bgr_1( const struct tnl_clipspace_attr *a, GLub } -static INLINE void insert_1ub_1f_1( const struct tnl_clipspace_attr *a, GLubyte *v, +static INLINE void insert_1ub_1f_1( const struct tnl_clipspace_attr *a, GLubyte *v, const GLfloat *in ) { DEBUG_INSERT; @@ -573,16 +573,16 @@ static INLINE void insert_1ub_1f_1( const struct tnl_clipspace_attr *a, GLubyte /*********************************************************************** * Functions to perform the reverse operations to the above, for * swrast translation and clip-interpolation. - * + * * Currently always extracts a full 4 floats. */ -static void extract_4f_viewport( const struct tnl_clipspace_attr *a, GLfloat *out, +static void extract_4f_viewport( const struct tnl_clipspace_attr *a, GLfloat *out, const GLubyte *v ) { const GLfloat *in = (const GLfloat *)v; const GLfloat * const vp = a->vp; - + /* Although included for completeness, the position coordinate is * usually handled differently during clipping. */ @@ -593,7 +593,7 @@ static void extract_4f_viewport( const struct tnl_clipspace_attr *a, GLfloat *ou out[3] = in[3]; } -static void extract_3f_viewport( const struct tnl_clipspace_attr *a, GLfloat *out, +static void extract_3f_viewport( const struct tnl_clipspace_attr *a, GLfloat *out, const GLubyte *v ) { const GLfloat *in = (const GLfloat *)v; @@ -606,7 +606,7 @@ static void extract_3f_viewport( const struct tnl_clipspace_attr *a, GLfloat *ou } -static void extract_2f_viewport( const struct tnl_clipspace_attr *a, GLfloat *out, +static void extract_2f_viewport( const struct tnl_clipspace_attr *a, GLfloat *out, const GLubyte *v ) { const GLfloat *in = (const GLfloat *)v; @@ -623,7 +623,7 @@ static void extract_4f( const struct tnl_clipspace_attr *a, GLfloat *out, const { const GLfloat *in = (const GLfloat *)v; (void) a; - + out[0] = in[0]; out[1] = in[1]; out[2] = in[2]; @@ -634,7 +634,7 @@ static void extract_3f_xyw( const struct tnl_clipspace_attr *a, GLfloat *out, co { const GLfloat *in = (const GLfloat *)v; (void) a; - + out[0] = in[0]; out[1] = in[1]; out[2] = 0; @@ -646,7 +646,7 @@ static void extract_3f( const struct tnl_clipspace_attr *a, GLfloat *out, const { const GLfloat *in = (const GLfloat *)v; (void) a; - + out[0] = in[0]; out[1] = in[1]; out[2] = in[2]; @@ -658,7 +658,7 @@ static void extract_2f( const struct tnl_clipspace_attr *a, GLfloat *out, const { const GLfloat *in = (const GLfloat *)v; (void) a; - + out[0] = in[0]; out[1] = in[1]; out[2] = 0; @@ -669,14 +669,14 @@ static void extract_1f( const struct tnl_clipspace_attr *a, GLfloat *out, const { const GLfloat *in = (const GLfloat *)v; (void) a; - + out[0] = in[0]; out[1] = 0; out[2] = 0; out[3] = 1; } -static void extract_4chan_4f_rgba( const struct tnl_clipspace_attr *a, GLfloat *out, +static void extract_4chan_4f_rgba( const struct tnl_clipspace_attr *a, GLfloat *out, const GLubyte *v ) { GLchan *c = (GLchan *)v; @@ -688,7 +688,7 @@ static void extract_4chan_4f_rgba( const struct tnl_clipspace_attr *a, GLfloat * out[3] = CHAN_TO_FLOAT(c[3]); } -static void extract_4ub_4f_rgba( const struct tnl_clipspace_attr *a, GLfloat *out, +static void extract_4ub_4f_rgba( const struct tnl_clipspace_attr *a, GLfloat *out, const GLubyte *v ) { (void) a; @@ -698,7 +698,7 @@ static void extract_4ub_4f_rgba( const struct tnl_clipspace_attr *a, GLfloat *ou out[3] = UBYTE_TO_FLOAT(v[3]); } -static void extract_4ub_4f_bgra( const struct tnl_clipspace_attr *a, GLfloat *out, +static void extract_4ub_4f_bgra( const struct tnl_clipspace_attr *a, GLfloat *out, const GLubyte *v ) { (void) a; @@ -708,7 +708,7 @@ static void extract_4ub_4f_bgra( const struct tnl_clipspace_attr *a, GLfloat *ou out[3] = UBYTE_TO_FLOAT(v[3]); } -static void extract_4ub_4f_argb( const struct tnl_clipspace_attr *a, GLfloat *out, +static void extract_4ub_4f_argb( const struct tnl_clipspace_attr *a, GLfloat *out, const GLubyte *v ) { (void) a; @@ -718,7 +718,7 @@ static void extract_4ub_4f_argb( const struct tnl_clipspace_attr *a, GLfloat *ou out[2] = UBYTE_TO_FLOAT(v[3]); } -static void extract_4ub_4f_abgr( const struct tnl_clipspace_attr *a, GLfloat *out, +static void extract_4ub_4f_abgr( const struct tnl_clipspace_attr *a, GLfloat *out, const GLubyte *v ) { (void) a; @@ -728,7 +728,7 @@ static void extract_4ub_4f_abgr( const struct tnl_clipspace_attr *a, GLfloat *ou out[0] = UBYTE_TO_FLOAT(v[3]); } -static void extract_3ub_3f_rgb( const struct tnl_clipspace_attr *a, GLfloat *out, +static void extract_3ub_3f_rgb( const struct tnl_clipspace_attr *a, GLfloat *out, const GLubyte *v ) { (void) a; @@ -738,7 +738,7 @@ static void extract_3ub_3f_rgb( const struct tnl_clipspace_attr *a, GLfloat *out out[3] = 1; } -static void extract_3ub_3f_bgr( const struct tnl_clipspace_attr *a, GLfloat *out, +static void extract_3ub_3f_bgr( const struct tnl_clipspace_attr *a, GLfloat *out, const GLubyte *v ) { (void) a; @@ -758,7 +758,7 @@ static void extract_1ub_1f( const struct tnl_clipspace_attr *a, GLfloat *out, co } -const struct tnl_format_info _tnl_format_info[EMIT_MAX] = +const struct tnl_format_info _tnl_format_info[EMIT_MAX] = { { "1f", extract_1f, @@ -795,12 +795,12 @@ const struct tnl_format_info _tnl_format_info[EMIT_MAX] = { "4f_viewport", extract_4f_viewport, { insert_4f_viewport_1, insert_4f_viewport_2, insert_4f_viewport_3, - insert_4f_viewport_4 }, + insert_4f_viewport_4 }, 4 * sizeof(GLfloat) }, { "3f_xyw", extract_3f_xyw, - { insert_3f_xyw_err, insert_3f_xyw_err, insert_3f_xyw_err, + { insert_3f_xyw_err, insert_3f_xyw_err, insert_3f_xyw_err, insert_3f_xyw_4 }, 3 * sizeof(GLfloat) }, @@ -823,7 +823,7 @@ const struct tnl_format_info _tnl_format_info[EMIT_MAX] = { "4ub_4f_rgba", extract_4ub_4f_rgba, - { insert_4ub_4f_rgba_1, insert_4ub_4f_rgba_2, insert_4ub_4f_rgba_3, + { insert_4ub_4f_rgba_1, insert_4ub_4f_rgba_2, insert_4ub_4f_rgba_3, insert_4ub_4f_rgba_4 }, 4 * sizeof(GLubyte) }, @@ -860,7 +860,7 @@ const struct tnl_format_info _tnl_format_info[EMIT_MAX] = - + /*********************************************************************** * Hardwired fastpaths for emitting whole vertices or groups of * vertices @@ -902,16 +902,16 @@ static void NAME( struct gl_context *ctx, \ } \ } - + #define EMIT2(F0, F1, NAME) EMIT5(2, F0, F1, insert_null, \ insert_null, insert_null, NAME) #define EMIT3(F0, F1, F2, NAME) EMIT5(3, F0, F1, F2, insert_null, \ insert_null, NAME) - + #define EMIT4(F0, F1, F2, F3, NAME) EMIT5(4, F0, F1, F2, F3, \ insert_null, NAME) - + EMIT2(insert_3f_viewport_3, insert_4ub_4f_rgba_4, emit_viewport3_rgba4) EMIT2(insert_3f_viewport_3, insert_4ub_4f_bgra_4, emit_viewport3_bgra4) @@ -940,14 +940,14 @@ void _tnl_generate_hardwired_emit( struct gl_context *ctx ) switch (vtx->attr_count) { case 2: if (vtx->attr[0].emit == insert_3f_viewport_3) { - if (vtx->attr[1].emit == insert_4ub_4f_bgra_4) + if (vtx->attr[1].emit == insert_4ub_4f_bgra_4) func = emit_viewport3_bgra4; - else if (vtx->attr[1].emit == insert_4ub_4f_rgba_4) + else if (vtx->attr[1].emit == insert_4ub_4f_rgba_4) func = emit_viewport3_rgba4; } else if (vtx->attr[0].emit == insert_3f_3 && vtx->attr[1].emit == insert_4ub_4f_rgba_4) { - func = emit_xyz3_rgba4; + func = emit_xyz3_rgba4; } break; case 3: @@ -955,7 +955,7 @@ void _tnl_generate_hardwired_emit( struct gl_context *ctx ) if (vtx->attr[1].emit == insert_4ub_4f_rgba_4) { if (vtx->attr[0].emit == insert_4f_viewport_4) func = emit_viewport4_rgba4_st2; - else if (vtx->attr[0].emit == insert_4f_4) + else if (vtx->attr[0].emit == insert_4f_4) func = emit_xyzw4_rgba4_st2; } else if (vtx->attr[1].emit == insert_4ub_4f_bgra_4 && @@ -969,7 +969,7 @@ void _tnl_generate_hardwired_emit( struct gl_context *ctx ) if (vtx->attr[1].emit == insert_4ub_4f_rgba_4) { if (vtx->attr[0].emit == insert_4f_viewport_4) func = emit_viewport4_rgba4_st2_st2; - else if (vtx->attr[0].emit == insert_4f_4) + else if (vtx->attr[0].emit == insert_4f_4) func = emit_xyzw4_rgba4_st2_st2; } else if (vtx->attr[1].emit == insert_4ub_4f_bgra_4 && @@ -1044,7 +1044,7 @@ void _tnl_generic_interp( struct gl_context *ctx, for (j = 1; j < attr_count; j++) { GLfloat fin[4], fout[4], fdst[4]; - + a[j].extract( &a[j], fin, vin + a[j].vertoffset ); a[j].extract( &a[j], fout, vout + a[j].vertoffset ); @@ -1108,13 +1108,13 @@ void _tnl_generic_interp_extras( struct gl_context *ctx, if (VB->BackfaceSecondaryColorPtr) { assert(VB->BackfaceSecondaryColorPtr->stride == 4 * sizeof(GLfloat)); - + INTERP_3F( t, VB->BackfaceSecondaryColorPtr->data[dst], VB->BackfaceSecondaryColorPtr->data[out], VB->BackfaceSecondaryColorPtr->data[in] ); } - + if (VB->BackfaceIndexPtr) { VB->BackfaceIndexPtr->data[dst][0] = LINTERP( t, VB->BackfaceIndexPtr->data[out][0], @@ -1128,7 +1128,7 @@ void _tnl_generic_interp_extras( struct gl_context *ctx, _tnl_generic_interp(ctx, t, dst, out, in, force_boundary); } -void _tnl_generic_copy_pv_extras( struct gl_context *ctx, +void _tnl_generic_copy_pv_extras( struct gl_context *ctx, GLuint dst, GLuint src ) { struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb; diff --git a/src/mesa/tnl/t_vertex_sse.c b/src/mesa/tnl/t_vertex_sse.c index 9318965..6f89c9a 100644 --- a/src/mesa/tnl/t_vertex_sse.c +++ b/src/mesa/tnl/t_vertex_sse.c @@ -58,7 +58,7 @@ struct x86_program { GLboolean inputs_safe; GLboolean outputs_safe; GLboolean have_sse2; - + struct x86_reg identity; struct x86_reg chan0; }; @@ -69,14 +69,14 @@ static struct x86_reg get_identity( struct x86_program *p ) return p->identity; } -static void emit_load4f_4( struct x86_program *p, +static void emit_load4f_4( struct x86_program *p, struct x86_reg dest, struct x86_reg arg0 ) { sse_movups(&p->func, dest, arg0); } -static void emit_load4f_3( struct x86_program *p, +static void emit_load4f_3( struct x86_program *p, struct x86_reg dest, struct x86_reg arg0 ) { @@ -93,7 +93,7 @@ static void emit_load4f_3( struct x86_program *p, sse_movlps(&p->func, dest, arg0); } -static void emit_load4f_2( struct x86_program *p, +static void emit_load4f_2( struct x86_program *p, struct x86_reg dest, struct x86_reg arg0 ) { @@ -103,7 +103,7 @@ static void emit_load4f_2( struct x86_program *p, sse_movlps(&p->func, dest, arg0); } -static void emit_load4f_1( struct x86_program *p, +static void emit_load4f_1( struct x86_program *p, struct x86_reg dest, struct x86_reg arg0 ) { @@ -114,7 +114,7 @@ static void emit_load4f_1( struct x86_program *p, -static void emit_load3f_3( struct x86_program *p, +static void emit_load3f_3( struct x86_program *p, struct x86_reg dest, struct x86_reg arg0 ) { @@ -123,11 +123,11 @@ static void emit_load3f_3( struct x86_program *p, */ if (p->inputs_safe) { sse_movups(&p->func, dest, arg0); - } + } else { /* c 0 0 0 * c c c c - * a b c c + * a b c c */ sse_movss(&p->func, dest, x86_make_disp(arg0, 8)); sse_shufps(&p->func, dest, dest, SHUF(X,X,X,X)); @@ -135,14 +135,14 @@ static void emit_load3f_3( struct x86_program *p, } } -static void emit_load3f_2( struct x86_program *p, +static void emit_load3f_2( struct x86_program *p, struct x86_reg dest, struct x86_reg arg0 ) { emit_load4f_2(p, dest, arg0); } -static void emit_load3f_1( struct x86_program *p, +static void emit_load3f_1( struct x86_program *p, struct x86_reg dest, struct x86_reg arg0 ) { @@ -150,14 +150,14 @@ static void emit_load3f_1( struct x86_program *p, sse_movss(&p->func, dest, arg0); } -static void emit_load2f_2( struct x86_program *p, +static void emit_load2f_2( struct x86_program *p, struct x86_reg dest, struct x86_reg arg0 ) { sse_movlps(&p->func, dest, arg0); } -static void emit_load2f_1( struct x86_program *p, +static void emit_load2f_1( struct x86_program *p, struct x86_reg dest, struct x86_reg arg0 ) { @@ -165,35 +165,35 @@ static void emit_load2f_1( struct x86_program *p, sse_movss(&p->func, dest, arg0); } -static void emit_load1f_1( struct x86_program *p, +static void emit_load1f_1( struct x86_program *p, struct x86_reg dest, struct x86_reg arg0 ) { sse_movss(&p->func, dest, arg0); } -static void (*load[4][4])( struct x86_program *p, +static void (*load[4][4])( struct x86_program *p, struct x86_reg dest, struct x86_reg arg0 ) = { - { emit_load1f_1, - emit_load1f_1, - emit_load1f_1, + { emit_load1f_1, + emit_load1f_1, + emit_load1f_1, emit_load1f_1 }, - { emit_load2f_1, - emit_load2f_2, - emit_load2f_2, + { emit_load2f_1, + emit_load2f_2, + emit_load2f_2, emit_load2f_2 }, - { emit_load3f_1, - emit_load3f_2, - emit_load3f_3, + { emit_load3f_1, + emit_load3f_2, + emit_load3f_3, emit_load3f_3 }, - { emit_load4f_1, - emit_load4f_2, - emit_load4f_3, - emit_load4f_4 } + { emit_load4f_1, + emit_load4f_2, + emit_load4f_3, + emit_load4f_4 } }; static void emit_load( struct x86_program *p, @@ -205,14 +205,14 @@ static void emit_load( struct x86_program *p, load[sz-1][src_sz-1](p, dest, src); } -static void emit_store4f( struct x86_program *p, +static void emit_store4f( struct x86_program *p, struct x86_reg dest, struct x86_reg arg0 ) { sse_movups(&p->func, dest, arg0); } -static void emit_store3f( struct x86_program *p, +static void emit_store3f( struct x86_program *p, struct x86_reg dest, struct x86_reg arg0 ) { @@ -231,14 +231,14 @@ static void emit_store3f( struct x86_program *p, } } -static void emit_store2f( struct x86_program *p, +static void emit_store2f( struct x86_program *p, struct x86_reg dest, struct x86_reg arg0 ) { sse_movlps(&p->func, dest, arg0); } -static void emit_store1f( struct x86_program *p, +static void emit_store1f( struct x86_program *p, struct x86_reg dest, struct x86_reg arg0 ) { @@ -246,14 +246,14 @@ static void emit_store1f( struct x86_program *p, } -static void (*store[4])( struct x86_program *p, +static void (*store[4])( struct x86_program *p, struct x86_reg dest, - struct x86_reg arg0 ) = + struct x86_reg arg0 ) = { - emit_store1f, - emit_store2f, - emit_store3f, - emit_store4f + emit_store1f, + emit_store2f, + emit_store3f, + emit_store4f }; static void emit_store( struct x86_program *p, @@ -326,8 +326,8 @@ static void update_src_ptr( struct x86_program *p, * pull the stride value from memory each time). */ x86_lea(&p->func, srcREG, x86_make_disp(srcREG, a->inputstride)); - - /* save new value of a[j].inputptr + + /* save new value of a[j].inputptr */ x86_mov(&p->func, ptr_to_src, srcREG); } @@ -337,8 +337,8 @@ static void update_src_ptr( struct x86_program *p, /* Lots of hardcoding * * EAX -- pointer to current output vertex - * ECX -- pointer to current attribute - * + * ECX -- pointer to current attribute + * */ static GLboolean build_vertex_emit( struct x86_program *p ) { @@ -370,7 +370,7 @@ static GLboolean build_vertex_emit( struct x86_program *p ) x86_cmp(&p->func, countEBP, srcECX); fixup = x86_jcc_forward(&p->func, cc_E); - /* Initialize destination register. + /* Initialize destination register. */ x86_mov(&p->func, vertexEAX, x86_fn_arg(&p->func, 3)); @@ -380,7 +380,7 @@ static GLboolean build_vertex_emit( struct x86_program *p ) x86_mov(&p->func, vtxESI, x86_make_disp(vtxESI, get_offset(ctx, &ctx->swtnl_context))); vtxESI = x86_make_disp(vtxESI, get_offset(tnl, &tnl->clipspace)); - + /* Possibly load vp0, vp1 for viewport calcs: */ if (vtx->need_viewport) { @@ -451,7 +451,7 @@ static GLboolean build_vertex_emit( struct x86_program *p ) emit_store(p, dest, 4, temp); update_src_ptr(p, srcECX, vtxESI, a); break; - case EMIT_2F_VIEWPORT: + case EMIT_2F_VIEWPORT: get_src_ptr(p, srcECX, vtxESI, a); emit_load(p, temp, 2, x86_deref(srcECX), a->inputsize); sse_mulps(&p->func, temp, vp0); @@ -459,7 +459,7 @@ static GLboolean build_vertex_emit( struct x86_program *p ) emit_store(p, dest, 2, temp); update_src_ptr(p, srcECX, vtxESI, a); break; - case EMIT_3F_VIEWPORT: + case EMIT_3F_VIEWPORT: get_src_ptr(p, srcECX, vtxESI, a); emit_load(p, temp, 3, x86_deref(srcECX), a->inputsize); sse_mulps(&p->func, temp, vp0); @@ -467,7 +467,7 @@ static GLboolean build_vertex_emit( struct x86_program *p ) emit_store(p, dest, 3, temp); update_src_ptr(p, srcECX, vtxESI, a); break; - case EMIT_4F_VIEWPORT: + case EMIT_4F_VIEWPORT: get_src_ptr(p, srcECX, vtxESI, a); emit_load(p, temp, 4, x86_deref(srcECX), a->inputsize); sse_mulps(&p->func, temp, vp0); @@ -483,7 +483,7 @@ static GLboolean build_vertex_emit( struct x86_program *p ) update_src_ptr(p, srcECX, vtxESI, a); break; - case EMIT_1UB_1F: + case EMIT_1UB_1F: /* Test for PAD3 + 1UB: */ if (j > 0 && @@ -598,7 +598,7 @@ static GLboolean build_vertex_emit( struct x86_program *p ) printf("unknown a[%d].format %d\n", j, a->format); return GL_FALSE; /* catch any new opcodes */ } - + /* Increment j by at least 1 - may have been incremented above also: */ j++; @@ -611,7 +611,7 @@ static GLboolean build_vertex_emit( struct x86_program *p ) /* decr count, loop if not zero */ x86_dec(&p->func, countEBP); - x86_test(&p->func, countEBP, countEBP); + x86_test(&p->func, countEBP, countEBP); x86_jcc(&p->func, cc_NZ, label); /* Exit mmx state? @@ -641,7 +641,7 @@ static GLboolean build_vertex_emit( struct x86_program *p ) void _tnl_generate_sse_emit( struct gl_context *ctx ) { struct tnl_clipspace *vtx = GET_VERTEX_STATE(ctx); - struct x86_program p; + struct x86_program p; if (!cpu_has_xmm) { vtx->codegen_emit = NULL; diff --git a/src/mesa/tnl_dd/imm/NOTES.imm b/src/mesa/tnl_dd/imm/NOTES.imm index 9b2bd65..3c6fbca 100644 --- a/src/mesa/tnl_dd/imm/NOTES.imm +++ b/src/mesa/tnl_dd/imm/NOTES.imm @@ -32,15 +32,15 @@ A crude diagram: \ / \ / --------- -------- - | | - v v - +--------+ +--------+ +--------+ +--------+ - | vert-0 | | vert-1 | | vert-2 | | vert-3 | - +--------+ +--------+ +--------+ +--------+ + | | + v v + +--------+ +--------+ +--------+ +--------+ + | vert-0 | | vert-1 | | vert-2 | | vert-3 | + +--------+ +--------+ +--------+ +--------+ | | v - + DMA @@ -55,7 +55,7 @@ the hardware (window) coordinates. This information allows clipping to take place directly on these vertices, if need be. t_dd_imm_capi.h - + Color{34}{fub}{v}() implementations. These update both ctx->Current (unclamped float colors) and current-HW-vertex with hardware-specific color values (typically unsigned diff --git a/src/mesa/tnl_dd/imm/t_dd_imm_primtmp.h b/src/mesa/tnl_dd/imm/t_dd_imm_primtmp.h index 7103db5..c1afdcf 100644 --- a/src/mesa/tnl_dd/imm/t_dd_imm_primtmp.h +++ b/src/mesa/tnl_dd/imm/t_dd_imm_primtmp.h @@ -27,7 +27,7 @@ * Gareth Hughes */ -/* Template for immediate mode vertices. +/* Template for immediate mode vertices. * * Probably instantiate once for each vertex format used: * - TINY_VERTICES @@ -74,10 +74,10 @@ static void TAG(flush_line_1)( struct gl_context *ctx, TNL_VERTEX *v0 ) TNL_VERTEX *v1 = v0 - 1; ACTIVE_VERTEX = IMM_VERTICES( 0 ); FLUSH_VERTEX = TAG(flush_line_0); - if (FALLBACK_OR_CLIPPING) - CLIP_OR_DRAW_LINE( ctx, v1, v0 ); + if (FALLBACK_OR_CLIPPING) + CLIP_OR_DRAW_LINE( ctx, v1, v0 ); else - DRAW_LINE( ctx, v1, v0 ); + DRAW_LINE( ctx, v1, v0 ); } @@ -167,10 +167,10 @@ static void TAG(flush_line_strip_1)( struct gl_context *ctx, TNL_VERTEX *v0 ) else if (EXTEND_PRIM( 1 )) { EMIT_VERTEX( v0 ); } else { - BEGIN_PRIM( GL_LINE_STRIP, 2 ); + BEGIN_PRIM( GL_LINE_STRIP, 2 ); EMIT_VERTEX( v1 ); - EMIT_VERTEX( v0 ); - } + EMIT_VERTEX( v0 ); + } } static void TAG(flush_line_strip_2)( struct gl_context *ctx, TNL_VERTEX *v0 ) @@ -186,10 +186,10 @@ static void TAG(flush_line_strip_2)( struct gl_context *ctx, TNL_VERTEX *v0 ) else if (EXTEND_PRIM( 1 )) { EMIT_VERTEX( v0 ); } else { - BEGIN_PRIM( GL_LINE_STRIP, 2 ); + BEGIN_PRIM( GL_LINE_STRIP, 2 ); EMIT_VERTEX( v1 ); - EMIT_VERTEX( v0 ); - } + EMIT_VERTEX( v0 ); + } } @@ -234,7 +234,7 @@ static void TAG(flush_triangle_2)( struct gl_context *ctx, TNL_VERTEX *v0 ) FLUSH_VERTEX = TAG(flush_triangle_0); /* nothing gained by trying to emit as hw primitives -- that - * happens normally in this case. + * happens normally in this case. */ if (FALLBACK_OR_CLIPPING) CLIP_OR_DRAW_TRI( ctx, v2, v1, v0 ); @@ -281,7 +281,7 @@ static void TAG(flush_tri_strip_1)( struct gl_context *ctx, TNL_VERTEX *v0 ) EMIT_VERTEX( v2 ); \ EMIT_VERTEX( v1 ); \ EMIT_VERTEX( v0 ); \ - } + } static void TAG(flush_tri_strip_2)( struct gl_context *ctx, TNL_VERTEX *v0 ) { @@ -354,7 +354,7 @@ static void TAG(flush_tri_fan_1)( struct gl_context *ctx, TNL_VERTEX *v0 ) EMIT_VERTEX( v2 ); \ EMIT_VERTEX( v1 ); \ EMIT_VERTEX( v0 ); \ - } + } static void TAG(flush_tri_fan_2)( struct gl_context *ctx, TNL_VERTEX *v0 ) { @@ -420,8 +420,8 @@ static void TAG(flush_quad_3)( struct gl_context *ctx, TNL_VERTEX *v0 ) EXTEND_PRIM_NF( GL_QUADS, 4 ); EMIT_VERTEX( v3 ); EMIT_VERTEX( v2 ); - EMIT_VERTEX( v1 ); - EMIT_VERTEX( v0 ); + EMIT_VERTEX( v1 ); + EMIT_VERTEX( v0 ); } } @@ -520,7 +520,7 @@ static void TAG(flush_poly_1)( struct gl_context *ctx, TNL_VERTEX *v0 ) EMIT_VERTEX( v2 ); \ EMIT_VERTEX( v1 ); \ EMIT_VERTEX( v0 ); \ - } + } static void TAG(flush_poly_2)( struct gl_context *ctx, TNL_VERTEX *v0 ) { diff --git a/src/mesa/tnl_dd/imm/t_dd_imm_vapi.h b/src/mesa/tnl_dd/imm/t_dd_imm_vapi.h index 95e93b1..796f262 100644 --- a/src/mesa/tnl_dd/imm/t_dd_imm_vapi.h +++ b/src/mesa/tnl_dd/imm/t_dd_imm_vapi.h @@ -52,7 +52,7 @@ do { VERTEX_CLIP(2) = m[10] * oz + m[14] * ow; VERTEX_CLIP(3) = ow; w = ow; - } + } else { ASSERT (DO_IDENTITY_MATRIX); VERTEX_CLIP(0) = ox; diff --git a/src/mesa/tnl_dd/imm/t_dd_imm_vb.c b/src/mesa/tnl_dd/imm/t_dd_imm_vb.c index 5081d92..efd7dbf 100644 --- a/src/mesa/tnl_dd/imm/t_dd_imm_vb.c +++ b/src/mesa/tnl_dd/imm/t_dd_imm_vb.c @@ -165,7 +165,7 @@ static void TAG(clip_draw_triangle)( struct gl_context *ctx, POLY_CLIP( CLIP_FAR_BIT, 0, 0, -1, 1 ); POLY_CLIP( CLIP_NEAR_BIT, 0, 0, 1, 1 ); - if ((ctx->_TriangleCaps & DD_FLATSHADE) && v2 != inlist[0]) + if ((ctx->_TriangleCaps & DD_FLATSHADE) && v2 != inlist[0]) COPY_PV( ctx, inlist[0], v2 ); out = inlist[in]; diff --git a/src/mesa/tnl_dd/imm/t_dd_imm_vbtmp.h b/src/mesa/tnl_dd/imm/t_dd_imm_vbtmp.h index bb39462..4e407d6 100644 --- a/src/mesa/tnl_dd/imm/t_dd_imm_vbtmp.h +++ b/src/mesa/tnl_dd/imm/t_dd_imm_vbtmp.h @@ -79,14 +79,14 @@ static void TAG(emit_vfmt)( struct gl_context *ctx, VERTEX *v ) if (DO_PTEX) { if (HAVE_PTEX_VERTICES) { v->pv.q0 = tc[3]; - } + } else { float rhw = 1.0 / tc[3]; v->v.w *= tc[3]; v->v.u0 *= rhw; v->v.v0 *= rhw; - } - } + } + } } if (DO_TEX1) { GLfloat *tc = ctx->Current.Texture[1]; @@ -94,12 +94,12 @@ static void TAG(emit_vfmt)( struct gl_context *ctx, VERTEX *v ) v->pv.u1 = tc[0]; v->pv.v1 = tc[1]; v->pv.q1 = tc[3]; - } + } else { v->v.u1 = tc[0]; v->v.v1 = tc[1]; } - } + } else if (DO_PTEX) { *(GLuint *)&v->pv.q1 = 0; /* avoid culling on radeon */ } @@ -109,24 +109,24 @@ static void TAG(emit_vfmt)( struct gl_context *ctx, VERTEX *v ) v->pv.u2 = tc[0]; v->pv.v2 = tc[1]; v->pv.q2 = tc[3]; - } + } else { v->v.u2 = tc[0]; v->v.v2 = tc[1]; } - } + } if (DO_TEX3) { GLfloat *tc = ctx->Current.Texture[3]; if (DO_PTEX) { v->pv.u3 = tc[0]; v->pv.v3 = tc[1]; v->pv.q3 = tc[3]; - } + } else { v->v.u3 = tc[0]; v->v.v3 = tc[1]; } - } + } } @@ -241,7 +241,7 @@ static void TAG(interp)( struct gl_context *ctx, static __inline void TAG(copy_pv)( struct gl_context *ctx, - TNL_VERTEX *dst, + TNL_VERTEX *dst, TNL_VERTEX *src ) { if (DO_TEX0 || DO_TEX1 || !HAVE_TINY_VERTICES) { diff --git a/src/mesa/tnl_dd/t_dd_dmatmp.h b/src/mesa/tnl_dd/t_dd_dmatmp.h index 997fc0b..018ad27 100644 --- a/src/mesa/tnl_dd/t_dd_dmatmp.h +++ b/src/mesa/tnl_dd/t_dd_dmatmp.h @@ -84,7 +84,7 @@ static void *TAG(emit_elts)( struct gl_context *ctx, GLuint *elts, GLuint nr, EMIT_TWO_ELTS( 0, elts[0], elts[1] ); INCR_ELTS( 2 ); } - + if (i < nr) { EMIT_ELT( 0, elts[0] ); INCR_ELTS( 1 ); @@ -94,7 +94,7 @@ static void *TAG(emit_elts)( struct gl_context *ctx, GLuint *elts, GLuint nr, } #endif -static __inline void *TAG(emit_verts)( struct gl_context *ctx, GLuint start, +static __inline void *TAG(emit_verts)( struct gl_context *ctx, GLuint start, GLuint count, void *buf ) { return EMIT_VERTS(ctx, start, count, buf); @@ -191,7 +191,7 @@ static void TAG(render_line_strip_verts)( struct gl_context *ctx, TAG(emit_verts)( ctx, j, nr, ALLOC_VERTS(nr) ); currentsz = dmasz; } - + FLUSH(); } else { @@ -234,8 +234,8 @@ static void TAG(render_line_loop_verts)( struct gl_context *ctx, nr = MIN2( currentsz, count - j ); if (j + nr >= count && - start < count - 1 && - (flags & PRIM_END)) + start < count - 1 && + (flags & PRIM_END)) { void *tmp; tmp = ALLOC_VERTS(nr+1); @@ -445,7 +445,7 @@ static void TAG(render_quad_strip_verts)( struct gl_context *ctx, FLUSH(); - } else if (HAVE_TRI_STRIPS && + } else if (HAVE_TRI_STRIPS && ctx->Light.ShadeModel == GL_FLAT && TNL_CONTEXT(ctx)->vb.AttribPtr[_TNL_ATTRIB_COLOR0]->stride) { if (HAVE_ELTS) { @@ -818,8 +818,8 @@ static void TAG(render_line_loop_elts)( struct gl_context *ctx, nr = MIN2( currentsz, count - j ); if (j + nr >= count && - start < count - 1 && - (flags & PRIM_END)) + start < count - 1 && + (flags & PRIM_END)) { void *tmp; tmp = ALLOC_ELTS(nr+1); @@ -1228,7 +1228,7 @@ static GLboolean TAG(validate_render)( struct gl_context *ctx, } else if (HAVE_QUAD_STRIPS) { ok = GL_TRUE; - } else if (HAVE_TRI_STRIPS && + } else if (HAVE_TRI_STRIPS && ctx->Light.ShadeModel == GL_FLAT && VB->AttribPtr[_TNL_ATTRIB_COLOR0]->stride != 0) { if (HAVE_ELTS) { @@ -1238,7 +1238,7 @@ static GLboolean TAG(validate_render)( struct gl_context *ctx, ok = GL_FALSE; } } - else + else ok = HAVE_TRI_STRIPS; break; case GL_QUADS: @@ -1254,7 +1254,7 @@ static GLboolean TAG(validate_render)( struct gl_context *ctx, default: break; } - + if (!ok) { /* fprintf(stderr, "not ok %s\n", _mesa_lookup_enum_by_nr(prim & PRIM_MODE_MASK)); */ return GL_FALSE; diff --git a/src/mesa/tnl_dd/t_dd_dmatmp2.h b/src/mesa/tnl_dd/t_dd_dmatmp2.h index 8836bde..183bc48 100644 --- a/src/mesa/tnl_dd/t_dd_dmatmp2.h +++ b/src/mesa/tnl_dd/t_dd_dmatmp2.h @@ -70,7 +70,7 @@ do { \ /**********************************************************************/ -static ELT_TYPE *TAG(emit_elts)( struct gl_context *ctx, +static ELT_TYPE *TAG(emit_elts)( struct gl_context *ctx, ELT_TYPE *dest, GLuint *elts, GLuint nr ) { @@ -85,11 +85,11 @@ static ELT_TYPE *TAG(emit_elts)( struct gl_context *ctx, EMIT_ELT( dest, 0, elts[0] ); dest += 1; } - + return dest; } -static ELT_TYPE *TAG(emit_consecutive_elts)( struct gl_context *ctx, +static ELT_TYPE *TAG(emit_consecutive_elts)( struct gl_context *ctx, ELT_TYPE *dest, GLuint start, GLuint nr ) { @@ -142,7 +142,7 @@ static void TAG(render_lines_verts)( struct gl_context *ctx, RESET_STIPPLE(); AUTO_STIPPLE( GL_TRUE ); } - + EMIT_PRIM( ctx, GL_LINES, HW_LINES, start, count ); if ((flags & PRIM_END) && ctx->Line.StippleFlag) @@ -166,7 +166,7 @@ static void TAG(render_line_strip_verts)( struct gl_context *ctx, if (PREFER_DISCRETE_ELT_PRIM( count-start, HW_LINES )) - { + { int dmasz = GET_MAX_HW_ELTS(); GLuint j, nr; @@ -183,7 +183,7 @@ static void TAG(render_line_strip_verts)( struct gl_context *ctx, nr = MIN2( dmasz, count - j ); dest = ALLOC_ELTS( (nr-1)*2 ); - + for ( i = j ; i+1 < j+nr ; i+=1 ) { EMIT_TWO_ELTS( dest, 0, (i+0), (i+1) ); dest += 2; @@ -248,10 +248,10 @@ static void TAG(render_line_loop_verts)( struct gl_context *ctx, /* Emit 1 more line into space alloced above */ if (j + 1 >= count) { - EMIT_TWO_ELTS( dest, 0, (j), (start) ); - dest += 2; + EMIT_TWO_ELTS( dest, 0, (j), (start) ); + dest += 2; } - + CLOSE_ELTS(); } } @@ -278,7 +278,7 @@ static void TAG(render_line_loop_verts)( struct gl_context *ctx, j += nr; CLOSE_ELTS(); } - } + } } } else { TAG(render_line_strip_verts)( ctx, j, count, flags ); @@ -319,7 +319,7 @@ static void TAG(render_tri_strip_verts)( struct gl_context *ctx, return; if (PREFER_DISCRETE_ELT_PRIM( count-start, HW_TRIANGLES )) - { + { int dmasz = GET_MAX_HW_ELTS(); int parity = 0; GLuint j, nr; @@ -337,7 +337,7 @@ static void TAG(render_tri_strip_verts)( struct gl_context *ctx, nr = MIN2( dmasz, count - j ); dest = ALLOC_ELTS( (nr-2)*3 ); - + for ( i = j ; i+2 < j+nr ; i++, parity^=1 ) { EMIT_ELT( dest, 0, (i+0+parity) ); EMIT_ELT( dest, 1, (i+1-parity) ); @@ -360,11 +360,11 @@ static void TAG(render_tri_fan_verts)( struct gl_context *ctx, LOCAL_VARS; if (0) fprintf(stderr, "%s\n", __FUNCTION__); - if (start+2 >= count) + if (start+2 >= count) return; if (PREFER_DISCRETE_ELT_PRIM( count-start, HW_TRIANGLES )) - { + { int dmasz = GET_MAX_HW_ELTS(); GLuint j, nr; @@ -378,14 +378,14 @@ static void TAG(render_tri_fan_verts)( struct gl_context *ctx, nr = MIN2( dmasz, count - j ); dest = ALLOC_ELTS( (nr-1)*3 ); - + for ( i = j ; i+1 < j+nr ; i++ ) { EMIT_ELT( dest, 0, (start) ); EMIT_ELT( dest, 1, (i) ); EMIT_ELT( dest, 2, (i+1) ); dest += 3; } - + CLOSE_ELTS(); } } @@ -403,7 +403,7 @@ static void TAG(render_poly_verts)( struct gl_context *ctx, LOCAL_VARS; if (0) fprintf(stderr, "%s\n", __FUNCTION__); - if (start+2 >= count) + if (start+2 >= count) return; EMIT_PRIM( ctx, GL_POLYGON, HW_POLYGON, start, count ); @@ -419,12 +419,12 @@ static void TAG(render_quad_strip_verts)( struct gl_context *ctx, count -= (count-start) & 1; - if (start+3 >= count) + if (start+3 >= count) return; if (HAVE_QUAD_STRIPS) { EMIT_PRIM( ctx, GL_QUAD_STRIP, HW_QUAD_STRIP, start, count ); - } + } else if (ctx->Light.ShadeModel == GL_FLAT) { LOCAL_VARS; int dmasz = GET_MAX_HW_ELTS(); @@ -443,7 +443,7 @@ static void TAG(render_quad_strip_verts)( struct gl_context *ctx, nr = MIN2( dmasz, count - j ); quads = (nr/2)-1; dest = ALLOC_ELTS( quads*6 ); - + for ( i = j ; i < j+quads*2 ; i+=2 ) { EMIT_TWO_ELTS( dest, 0, (i+0), (i+1) ); EMIT_TWO_ELTS( dest, 2, (i+2), (i+1) ); @@ -469,15 +469,15 @@ static void TAG(render_quads_verts)( struct gl_context *ctx, if (0) fprintf(stderr, "%s\n", __FUNCTION__); count -= (count-start)%4; - if (start+3 >= count) + if (start+3 >= count) return; if (HAVE_QUADS) { EMIT_PRIM( ctx, GL_QUADS, HW_QUADS, start, count ); - } + } else { /* Hardware doesn't have a quad primitive type -- simulate it - * using indexed vertices and the triangle primitive: + * using indexed vertices and the triangle primitive: */ LOCAL_VARS; int dmasz = GET_MAX_HW_ELTS(); @@ -649,11 +649,11 @@ static void TAG(render_line_loop_elts)( struct gl_context *ctx, else j = start + 1; - + if (flags & PRIM_END) { if (start+1 >= count) return; - } + } else { if (j+1 >= count) return; @@ -664,7 +664,7 @@ static void TAG(render_line_loop_elts)( struct gl_context *ctx, if ((flags & PRIM_BEGIN) && ctx->Line.StippleFlag) RESET_STIPPLE(); - + /* Ensure last vertex doesn't wrap: */ dmasz--; diff --git a/src/mesa/tnl_dd/t_dd_triemit.h b/src/mesa/tnl_dd/t_dd_triemit.h index 39c9d26..f2bc102 100644 --- a/src/mesa/tnl_dd/t_dd_triemit.h +++ b/src/mesa/tnl_dd/t_dd_triemit.h @@ -1,9 +1,9 @@ #ifndef DO_DEBUG_VERTS #define DO_DEBUG_VERTS 0 -#endif +#endif #ifndef PRINT_VERTEX -#define PRINT_VERTEX(x) +#define PRINT_VERTEX(x) #endif #if defined(USE_X86_ASM) @@ -52,7 +52,7 @@ static __inline void TAG(quad)( CTX_ARG, PRINT_VERTEX(v2); PRINT_VERTEX(v3); } - + COPY_DWORDS( j, vb, vertsize, v0 ); COPY_DWORDS( j, vb, vertsize, v1 ); COPY_DWORDS( j, vb, vertsize, v2 ); @@ -76,7 +76,7 @@ static __inline void TAG(quad)( CTX_ARG, PRINT_VERTEX(v2); PRINT_VERTEX(v3); } - + COPY_DWORDS( j, vb, vertsize, v0 ); COPY_DWORDS( j, vb, vertsize, v1 ); COPY_DWORDS( j, vb, vertsize, v3 ); diff --git a/src/mesa/tnl_dd/t_dd_vb.c b/src/mesa/tnl_dd/t_dd_vb.c index 543b0a5..7e793d3 100644 --- a/src/mesa/tnl_dd/t_dd_vb.c +++ b/src/mesa/tnl_dd/t_dd_vb.c @@ -48,7 +48,7 @@ */ static void copy_pv_rgba4_spec5( struct gl_context *ctx, GLuint edst, GLuint esrc ) { - LOCALVARS + LOCALVARS GLubyte *verts = GET_VERTEX_STORE(); GLuint size = GET_VERTEX_SIZE(); GLuint *dst = (GLuint *)(verts + (edst * size)); @@ -265,7 +265,7 @@ void TAG(print_vertex)( struct gl_context *ctx, const VERTEX *v ) v->pv.v1, v->pv.q1); break; -#endif +#endif default: fprintf(stderr, "???\n"); break; @@ -277,12 +277,12 @@ void TAG(print_vertex)( struct gl_context *ctx, const VERTEX *v ) /* Interpolate the elements of the VB not included in typical hardware - * vertices. + * vertices. * * NOTE: All these arrays are guarenteed by tnl to be writeable and * have good stride. */ -#ifndef INTERP_QUALIFIER +#ifndef INTERP_QUALIFIER #define INTERP_QUALIFIER static #endif @@ -320,7 +320,7 @@ INTERP_QUALIFIER void TAG(interp_extras)( struct gl_context *ctx, INTERP_VERTEX(ctx, t, dst, out, in, force_boundary); } -INTERP_QUALIFIER void TAG(copy_pv_extras)( struct gl_context *ctx, +INTERP_QUALIFIER void TAG(copy_pv_extras)( struct gl_context *ctx, GLuint dst, GLuint src ) { LOCALVARS diff --git a/src/mesa/tnl_dd/t_dd_vbtmp.h b/src/mesa/tnl_dd/t_dd_vbtmp.h index d19137b..af7f7ae 100644 --- a/src/mesa/tnl_dd/t_dd_vbtmp.h +++ b/src/mesa/tnl_dd/t_dd_vbtmp.h @@ -60,7 +60,7 @@ * unsigned char ub4[4][16]; * } * - + * VERTEX: hw vertex type as above * VERTEX_COLOR: hw color struct type in VERTEX * @@ -104,8 +104,8 @@ #endif #if (HAVE_HW_DIVIDE && !HAVE_PTEX_VERTICES) -#error "can't cope with this combination" -#endif +#error "can't cope with this combination" +#endif #ifndef LOCALVARS #define LOCALVARS @@ -179,7 +179,7 @@ static void TAG(emit)( struct gl_context *ctx, const GLuint t0 = GET_TEXSOURCE(0); tc0_stride = VB->AttribPtr[_TNL_ATTRIB_TEX0 + t0]->stride; tc0 = VB->AttribPtr[_TNL_ATTRIB_TEX0 + t0]->data; - if (DO_PTEX) + if (DO_PTEX) tc0_size = VB->AttribPtr[_TNL_ATTRIB_TEX0 + t0]->size; } @@ -217,13 +217,13 @@ static void TAG(emit)( struct gl_context *ctx, STRIDE_4F(coord, start * coord_stride); if (DO_TEX0) STRIDE_4F(tc0, start * tc0_stride); - if (DO_TEX1) + if (DO_TEX1) STRIDE_4F(tc1, start * tc1_stride); - if (DO_TEX2) + if (DO_TEX2) STRIDE_4F(tc2, start * tc2_stride); - if (DO_TEX3) + if (DO_TEX3) STRIDE_4F(tc3, start * tc3_stride); - if (DO_RGBA) + if (DO_RGBA) STRIDE_4F(col, start * col_stride); if (DO_SPEC) STRIDE_4F(spec, start * spec_stride); @@ -267,35 +267,35 @@ static void TAG(emit)( struct gl_context *ctx, v->v.v0 = tc0[0][1]; if (DO_PTEX) { if (HAVE_PTEX_VERTICES) { - if (tc0_size == 4) + if (tc0_size == 4) v->pv.q0 = tc0[0][3]; else v->pv.q0 = 1.0; - } + } else if (tc0_size == 4) { float rhw = 1.0 / tc0[0][3]; v->v.w *= tc0[0][3]; v->v.u0 *= rhw; v->v.v0 *= rhw; - } - } + } + } STRIDE_4F(tc0, tc0_stride); } if (DO_TEX1) { if (DO_PTEX) { v->pv.u1 = tc1[0][0]; v->pv.v1 = tc1[0][1]; - if (tc1_size == 4) + if (tc1_size == 4) v->pv.q1 = tc1[0][3]; else v->pv.q1 = 1.0; - } + } else { v->v.u1 = tc1[0][0]; v->v.v1 = tc1[0][1]; } STRIDE_4F(tc1, tc1_stride); - } + } else if (DO_PTEX) { *(GLuint *)&v->pv.q1 = 0; /* avoid culling on radeon */ } @@ -303,32 +303,32 @@ static void TAG(emit)( struct gl_context *ctx, if (DO_PTEX) { v->pv.u2 = tc2[0][0]; v->pv.v2 = tc2[0][1]; - if (tc2_size == 4) + if (tc2_size == 4) v->pv.q2 = tc2[0][3]; else v->pv.q2 = 1.0; - } + } else { v->v.u2 = tc2[0][0]; v->v.v2 = tc2[0][1]; } STRIDE_4F(tc2, tc2_stride); - } + } if (DO_TEX3) { if (DO_PTEX) { v->pv.u3 = tc3[0][0]; v->pv.v3 = tc3[0][1]; - if (tc3_size == 4) + if (tc3_size == 4) v->pv.q3 = tc3[0][3]; else v->pv.q3 = 1.0; - } + } else { v->v.u3 = tc3[0][0]; v->v.v3 = tc3[0][1]; } STRIDE_4F(tc3, tc3_stride); - } + } } } @@ -421,7 +421,7 @@ static GLboolean TAG(check_tex_sizes)( struct gl_context *ctx ) if (DO_PTEX) return GL_TRUE; - + if ((DO_TEX3 && VB->AttribPtr[_TNL_ATTRIB_TEX0 + GET_TEXSOURCE(3)]->size == 4) || (DO_TEX2 && VB->AttribPtr[_TNL_ATTRIB_TEX0 + GET_TEXSOURCE(2)]->size == 4) || (DO_TEX1 && VB->AttribPtr[_TNL_ATTRIB_TEX0 + GET_TEXSOURCE(1)]->size == 4) || @@ -504,7 +504,7 @@ static void TAG(interp)( struct gl_context *ctx, VIEWPORT_Z( dst->v.z, dstclip[2] * w ); } - if ((HAVE_HW_DIVIDE && CHECK_HW_DIVIDE) || + if ((HAVE_HW_DIVIDE && CHECK_HW_DIVIDE) || DO_FOG || DO_SPEC || DO_TEX0 || DO_TEX1 || DO_TEX2 || DO_TEX3 || !HAVE_TINY_VERTICES) { diff --git a/src/mesa/vbo/vbo_attrib.h b/src/mesa/vbo/vbo_attrib.h index 0ae928f..03fcb65 100644 --- a/src/mesa/vbo/vbo_attrib.h +++ b/src/mesa/vbo/vbo_attrib.h @@ -2,7 +2,7 @@ Copyright (C) Intel Corp. 2006. All Rights Reserved. Intel funded Tungsten Graphics (http://www.tungstengraphics.com) to develop this 3D driver. - + 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, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - + The above copyright notice and this permission notice (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 NONINFRINGEMENT. @@ -22,7 +22,7 @@ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - + **********************************************************************/ /* * Authors: @@ -50,8 +50,8 @@ enum { VBO_ATTRIB_COLOR0 = 3, VBO_ATTRIB_COLOR1 = 4, VBO_ATTRIB_FOG = 5, - VBO_ATTRIB_INDEX = 6, - VBO_ATTRIB_EDGEFLAG = 7, + VBO_ATTRIB_INDEX = 6, + VBO_ATTRIB_EDGEFLAG = 7, VBO_ATTRIB_TEX0 = 8, VBO_ATTRIB_TEX1 = 9, VBO_ATTRIB_TEX2 = 10, @@ -83,7 +83,7 @@ enum { * (whether it is a fixed-function emulation) to * differentiate. Here we must keep them apart instead. */ - VBO_ATTRIB_MAT_FRONT_AMBIENT = 32, + VBO_ATTRIB_MAT_FRONT_AMBIENT = 32, VBO_ATTRIB_MAT_BACK_AMBIENT = 33, VBO_ATTRIB_MAT_FRONT_DIFFUSE = 34, VBO_ATTRIB_MAT_BACK_DIFFUSE = 35, @@ -94,7 +94,7 @@ enum { VBO_ATTRIB_MAT_FRONT_SHININESS = 40, VBO_ATTRIB_MAT_BACK_SHININESS = 41, VBO_ATTRIB_MAT_FRONT_INDEXES = 42, - VBO_ATTRIB_MAT_BACK_INDEXES = 43, + VBO_ATTRIB_MAT_BACK_INDEXES = 43, VBO_ATTRIB_MAX = 44 }; diff --git a/src/mesa/vbo/vbo_context.c b/src/mesa/vbo/vbo_context.c index 9992cc3..b5307fd 100644 --- a/src/mesa/vbo/vbo_context.c +++ b/src/mesa/vbo/vbo_context.c @@ -45,7 +45,7 @@ static GLuint check_size( const GLfloat *attr ) if (attr[3] != 1.0) return 4; if (attr[2] != 0.0) return 3; if (attr[1] != 0.0) return 2; - return 1; + return 1; } @@ -181,13 +181,13 @@ GLboolean _vbo_CreateContext( struct gl_context *ctx ) /* When no vertex program, pull in the material attributes in * the 16..32 generic range. */ - for (i = 0; i < 16; i++) + for (i = 0; i < 16; i++) vbo->map_vp_none[i] = i; - for (i = 0; i < 12; i++) + for (i = 0; i < 12; i++) vbo->map_vp_none[16+i] = VBO_ATTRIB_MAT_FRONT_AMBIENT + i; for (i = 0; i < 4; i++) - vbo->map_vp_none[28+i] = i; - + vbo->map_vp_none[28+i] = i; + for (i = 0; i < Elements(vbo->map_vp_arb); i++) vbo->map_vp_arb[i] = i; } diff --git a/src/mesa/vbo/vbo_context.h b/src/mesa/vbo/vbo_context.h index 8d6f2a7..3dfb1eb 100644 --- a/src/mesa/vbo/vbo_context.h +++ b/src/mesa/vbo/vbo_context.h @@ -41,7 +41,7 @@ * The module captures both immediate mode and display list drawing, * and manages the allocation, reference counting and deallocation of * vertex buffer objects itself. - * + * * The DrawPrimitives() callback can be either implemented by the * driver itself or hooked to the tnl module's _tnl_draw_primitives() * function for hardware without tnl capablilties or during fallbacks. @@ -59,8 +59,8 @@ struct vbo_context { struct gl_client_array currval[VBO_ATTRIB_MAX]; - - /* These point into the above. TODO: remove. + + /* These point into the above. TODO: remove. */ struct gl_client_array *legacy_currval; struct gl_client_array *generic_currval; @@ -85,7 +85,7 @@ struct vbo_context { }; -static INLINE struct vbo_context *vbo_context(struct gl_context *ctx) +static INLINE struct vbo_context *vbo_context(struct gl_context *ctx) { return (struct vbo_context *)(ctx->swtnl_im); } diff --git a/src/mesa/vbo/vbo_exec.c b/src/mesa/vbo/vbo_exec.c index e8d5b39..cb52dbe 100644 --- a/src/mesa/vbo/vbo_exec.c +++ b/src/mesa/vbo/vbo_exec.c @@ -43,7 +43,7 @@ void vbo_exec_init( struct gl_context *ctx ) /* Initialize the arrayelt helper */ if (!ctx->aelt_context && - !_ae_create_context( ctx )) + !_ae_create_context( ctx )) return; vbo_exec_vtx_init( exec ); @@ -80,7 +80,7 @@ void vbo_exec_destroy( struct gl_context *ctx ) * Really want to install these callbacks to a central facility to be * invoked according to the state flags. That will have to wait for a * mesa rework: - */ + */ void vbo_exec_invalidate_state( struct gl_context *ctx, GLuint new_state ) { struct vbo_exec_context *exec = &vbo_context(ctx)->exec; diff --git a/src/mesa/vbo/vbo_exec.h b/src/mesa/vbo/vbo_exec.h index 47e51f0..144ca03 100644 --- a/src/mesa/vbo/vbo_exec.h +++ b/src/mesa/vbo/vbo_exec.h @@ -44,7 +44,7 @@ USE OR OTHER DEALINGS IN THE SOFTWARE. /* Wierd implementation stuff: */ #define VBO_VERT_BUFFER_SIZE (1024*64) /* bytes */ -#define VBO_MAX_ATTR_CODEGEN 16 +#define VBO_MAX_ATTR_CODEGEN 16 #define ERROR_ATTRIB 16 @@ -79,7 +79,7 @@ typedef void (*vbo_attrfv_func)( const GLfloat * ); struct vbo_exec_context { - struct gl_context *ctx; + struct gl_context *ctx; GLvertexformat vtxfmt; struct { @@ -102,7 +102,7 @@ struct vbo_exec_context GLubyte attrsz[VBO_ATTRIB_MAX]; GLubyte active_sz[VBO_ATTRIB_MAX]; - GLfloat *attrptr[VBO_ATTRIB_MAX]; + GLfloat *attrptr[VBO_ATTRIB_MAX]; struct gl_client_array arrays[VERT_ATTRIB_MAX]; /* According to program mode, the values above plus current @@ -114,7 +114,7 @@ struct vbo_exec_context const struct gl_client_array *inputs[VERT_ATTRIB_MAX]; } vtx; - + struct { GLboolean recalculate_maps; struct vbo_exec_eval1_map map1[VERT_ATTRIB_MAX]; @@ -189,7 +189,7 @@ void vbo_exec_vtx_wrap( struct vbo_exec_context *exec ); void vbo_exec_eval_update( struct vbo_exec_context *exec ); -void vbo_exec_do_EvalCoord2f( struct vbo_exec_context *exec, +void vbo_exec_do_EvalCoord2f( struct vbo_exec_context *exec, GLfloat u, GLfloat v ); void vbo_exec_do_EvalCoord1f( struct vbo_exec_context *exec, diff --git a/src/mesa/vbo/vbo_exec_api.c b/src/mesa/vbo/vbo_exec_api.c index fb981cc..7d3dc54 100644 --- a/src/mesa/vbo/vbo_exec_api.c +++ b/src/mesa/vbo/vbo_exec_api.c @@ -59,7 +59,7 @@ static void reset_attrfv( struct vbo_exec_context *exec ); /** * Close off the last primitive, execute the buffer, restart the - * primitive. + * primitive. */ static void vbo_exec_wrap_buffers( struct vbo_exec_context *exec ) { @@ -75,7 +75,7 @@ static void vbo_exec_wrap_buffers( struct vbo_exec_context *exec ) if (exec->ctx->Driver.CurrentExecPrimitive != PRIM_OUTSIDE_BEGIN_END) { GLint i = exec->vtx.prim_count - 1; assert(i >= 0); - exec->vtx.prim[i].count = (exec->vtx.vert_count - + exec->vtx.prim[i].count = (exec->vtx.vert_count - exec->vtx.prim[i].start); } @@ -99,7 +99,7 @@ static void vbo_exec_wrap_buffers( struct vbo_exec_context *exec ) exec->vtx.prim[0].start = 0; exec->vtx.prim[0].count = 0; exec->vtx.prim_count++; - + if (exec->vtx.copied.nr == last_count) exec->vtx.prim[0].begin = last_begin; } @@ -120,13 +120,13 @@ void vbo_exec_vtx_wrap( struct vbo_exec_context *exec ) * to exec->vtx.copied. */ vbo_exec_wrap_buffers( exec ); - - /* Copy stored stored vertices to start of new list. + + /* Copy stored stored vertices to start of new list. */ assert(exec->vtx.max_vert - exec->vtx.vert_count > exec->vtx.copied.nr); for (i = 0 ; i < exec->vtx.copied.nr ; i++) { - memcpy( exec->vtx.buffer_ptr, data, + memcpy( exec->vtx.buffer_ptr, data, exec->vtx.vertex_size * sizeof(GLfloat)); exec->vtx.buffer_ptr += exec->vtx.vertex_size; data += exec->vtx.vertex_size; @@ -154,14 +154,14 @@ static void vbo_exec_copy_to_current( struct vbo_exec_context *exec ) GLfloat *current = (GLfloat *)vbo->currval[i].Ptr; GLfloat tmp[4]; - COPY_CLEAN_4V(tmp, - exec->vtx.attrsz[i], + COPY_CLEAN_4V(tmp, + exec->vtx.attrsz[i], exec->vtx.attrptr[i]); - + if (memcmp(current, tmp, sizeof(tmp)) != 0) - { + { memcpy(current, tmp, sizeof(tmp)); - + /* Given that we explicitly state size here, there is no need * for the COPY_CLEAN above, could just copy 16 bytes and be * done. The only problem is when Mesa accesses ctx->Current @@ -175,7 +175,7 @@ static void vbo_exec_copy_to_current( struct vbo_exec_context *exec ) if (i >= VBO_ATTRIB_MAT_FRONT_AMBIENT && i <= VBO_ATTRIB_MAT_BACK_INDEXES) ctx->NewState |= _NEW_LIGHT; - + ctx->NewState |= _NEW_CURRENT_ATTRIB; } } @@ -185,7 +185,7 @@ static void vbo_exec_copy_to_current( struct vbo_exec_context *exec ) */ if (ctx->Light.ColorMaterialEnabled && exec->vtx.attrsz[VBO_ATTRIB_COLOR0]) { - _mesa_update_color_material(ctx, + _mesa_update_color_material(ctx, ctx->Current.Attrib[VBO_ATTRIB_COLOR0]); } } @@ -212,7 +212,7 @@ static void vbo_exec_copy_from_current( struct vbo_exec_context *exec ) /** * Flush existing data, set new attrib size, replay copied vertices. - */ + */ static void vbo_exec_wrap_upgrade_vertex( struct vbo_exec_context *exec, GLuint attr, GLuint newsz ) @@ -259,7 +259,7 @@ static void vbo_exec_wrap_upgrade_vertex( struct vbo_exec_context *exec, */ exec->vtx.attrsz[attr] = newsz; exec->vtx.vertex_size += newsz - oldsz; - exec->vtx.max_vert = ((VBO_VERT_BUFFER_SIZE - exec->vtx.buffer_used) / + exec->vtx.max_vert = ((VBO_VERT_BUFFER_SIZE - exec->vtx.buffer_used) / (exec->vtx.vertex_size * sizeof(GLfloat))); exec->vtx.vert_count = 0; exec->vtx.buffer_ptr = exec->vtx.buffer_map; @@ -364,12 +364,12 @@ static void vbo_exec_fixup_vertex( struct gl_context *ctx, * vtxfmt on each flush (otherwise flags won't get reset * afterwards). */ - if (attr == 0) + if (attr == 0) exec->ctx->Driver.NeedFlush |= FLUSH_STORED_VERTICES; } -/* +/* */ #define ATTR( A, N, V0, V1, V2, V3 ) \ do { \ @@ -421,18 +421,18 @@ static void GLAPIENTRY vbo_exec_EvalCoord1f( GLfloat u ) { GLint i; - if (exec->eval.recalculate_maps) + if (exec->eval.recalculate_maps) vbo_exec_eval_update( exec ); for (i = 0; i <= VBO_ATTRIB_TEX7; i++) { - if (exec->eval.map1[i].map) + if (exec->eval.map1[i].map) if (exec->vtx.active_sz[i] != exec->eval.map1[i].sz) vbo_exec_fixup_vertex( ctx, i, exec->eval.map1[i].sz ); } } - memcpy( exec->vtx.copied.buffer, exec->vtx.vertex, + memcpy( exec->vtx.copied.buffer, exec->vtx.vertex, exec->vtx.vertex_size * sizeof(GLfloat)); vbo_exec_do_EvalCoord1f( exec, u ); @@ -448,26 +448,26 @@ static void GLAPIENTRY vbo_exec_EvalCoord2f( GLfloat u, GLfloat v ) { GLint i; - if (exec->eval.recalculate_maps) + if (exec->eval.recalculate_maps) vbo_exec_eval_update( exec ); for (i = 0; i <= VBO_ATTRIB_TEX7; i++) { - if (exec->eval.map2[i].map) + if (exec->eval.map2[i].map) if (exec->vtx.active_sz[i] != exec->eval.map2[i].sz) vbo_exec_fixup_vertex( ctx, i, exec->eval.map2[i].sz ); } - if (ctx->Eval.AutoNormal) + if (ctx->Eval.AutoNormal) if (exec->vtx.active_sz[VBO_ATTRIB_NORMAL] != 3) vbo_exec_fixup_vertex( ctx, VBO_ATTRIB_NORMAL, 3 ); } - memcpy( exec->vtx.copied.buffer, exec->vtx.vertex, + memcpy( exec->vtx.copied.buffer, exec->vtx.vertex, exec->vtx.vertex_size * sizeof(GLfloat)); vbo_exec_do_EvalCoord2f( exec, u, v ); - memcpy( exec->vtx.vertex, exec->vtx.copied.buffer, + memcpy( exec->vtx.vertex, exec->vtx.copied.buffer, exec->vtx.vertex_size * sizeof(GLfloat)); } @@ -495,9 +495,9 @@ static void GLAPIENTRY vbo_exec_EvalPoint1( GLint i ) static void GLAPIENTRY vbo_exec_EvalPoint2( GLint i, GLint j ) { GET_CURRENT_CONTEXT( ctx ); - GLfloat du = ((ctx->Eval.MapGrid2u2 - ctx->Eval.MapGrid2u1) / + GLfloat du = ((ctx->Eval.MapGrid2u2 - ctx->Eval.MapGrid2u1) / (GLfloat) ctx->Eval.MapGrid2un); - GLfloat dv = ((ctx->Eval.MapGrid2v2 - ctx->Eval.MapGrid2v1) / + GLfloat dv = ((ctx->Eval.MapGrid2v2 - ctx->Eval.MapGrid2v1) / (GLfloat) ctx->Eval.MapGrid2vn); GLfloat u = i * du + ctx->Eval.MapGrid2u1; GLfloat v = j * dv + ctx->Eval.MapGrid2v1; @@ -517,7 +517,7 @@ static void GLAPIENTRY vbo_exec_EvalPoint2( GLint i, GLint j ) */ static void GLAPIENTRY vbo_exec_Begin( GLenum mode ) { - GET_CURRENT_CONTEXT( ctx ); + GET_CURRENT_CONTEXT( ctx ); if (ctx->Driver.CurrentExecPrimitive == PRIM_OUTSIDE_BEGIN_END) { struct vbo_exec_context *exec = &vbo_context(ctx)->exec; @@ -537,7 +537,7 @@ static void GLAPIENTRY vbo_exec_Begin( GLenum mode ) /* Heuristic: attempt to isolate attributes occuring outside * begin/end pairs. */ - if (exec->vtx.vertex_size && !exec->vtx.attrsz[0]) + if (exec->vtx.vertex_size && !exec->vtx.attrsz[0]) vbo_exec_FlushVertices_internal( ctx, GL_FALSE ); i = exec->vtx.prim_count++; @@ -553,9 +553,9 @@ static void GLAPIENTRY vbo_exec_Begin( GLenum mode ) ctx->Driver.CurrentExecPrimitive = mode; } - else + else _mesa_error( ctx, GL_INVALID_OPERATION, "glBegin" ); - + } @@ -564,14 +564,14 @@ static void GLAPIENTRY vbo_exec_Begin( GLenum mode ) */ static void GLAPIENTRY vbo_exec_End( void ) { - GET_CURRENT_CONTEXT( ctx ); + GET_CURRENT_CONTEXT( ctx ); if (ctx->Driver.CurrentExecPrimitive != PRIM_OUTSIDE_BEGIN_END) { struct vbo_exec_context *exec = &vbo_context(ctx)->exec; int idx = exec->vtx.vert_count; int i = exec->vtx.prim_count - 1; - exec->vtx.prim[i].end = 1; + exec->vtx.prim[i].end = 1; exec->vtx.prim[i].count = idx - exec->vtx.prim[i].start; ctx->Driver.CurrentExecPrimitive = PRIM_OUTSIDE_BEGIN_END; @@ -579,7 +579,7 @@ static void GLAPIENTRY vbo_exec_End( void ) if (exec->vtx.prim_count == VBO_MAX_PRIM) vbo_exec_vtx_flush( exec, GL_FALSE ); } - else + else _mesa_error( ctx, GL_INVALID_OPERATION, "glEnd" ); } @@ -591,7 +591,7 @@ static void GLAPIENTRY vbo_exec_PrimitiveRestartNV(void) { GLenum curPrim; - GET_CURRENT_CONTEXT( ctx ); + GET_CURRENT_CONTEXT( ctx ); curPrim = ctx->Driver.CurrentExecPrimitive; @@ -655,7 +655,7 @@ static void vbo_exec_vtxfmt_init( struct vbo_exec_context *exec ) vfmt->Vertex3fv = vbo_Vertex3fv; vfmt->Vertex4f = vbo_Vertex4f; vfmt->Vertex4fv = vbo_Vertex4fv; - + vfmt->VertexAttrib1fARB = vbo_VertexAttrib1fARB; vfmt->VertexAttrib1fvARB = vbo_VertexAttrib1fvARB; vfmt->VertexAttrib2fARB = vbo_VertexAttrib2fARB; @@ -837,7 +837,7 @@ void vbo_exec_vtx_init( struct vbo_exec_context *exec ) ASSERT(i < Elements(exec->vtx.arrays)); exec->vtx.inputs[i] = &exec->vtx.arrays[i]; } - + { struct gl_client_array *arrays = exec->vtx.arrays; unsigned i; @@ -959,7 +959,7 @@ void vbo_exec_FlushVertices( struct gl_context *ctx, GLuint flags ) static void reset_attrfv( struct vbo_exec_context *exec ) -{ +{ GLuint i; for (i = 0 ; i < VBO_ATTRIB_MAX ; i++) { @@ -969,7 +969,7 @@ static void reset_attrfv( struct vbo_exec_context *exec ) exec->vtx.vertex_size = 0; } - + void GLAPIENTRY _es_Color4f(GLfloat r, GLfloat g, GLfloat b, GLfloat a) diff --git a/src/mesa/vbo/vbo_exec_array.c b/src/mesa/vbo/vbo_exec_array.c index dd36cc3..265b421 100644 --- a/src/mesa/vbo/vbo_exec_array.c +++ b/src/mesa/vbo/vbo_exec_array.c @@ -1,9 +1,9 @@ /************************************************************************** - * + * * Copyright 2003 Tungsten Graphics, Inc., Cedar Park, Texas. * Copyright 2009 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 @@ -11,11 +11,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. @@ -23,7 +23,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. - * + * **************************************************************************/ #include "main/glheader.h" @@ -370,7 +370,7 @@ bind_array_obj(struct gl_context *ctx) assert(i < Elements(exec->array.generic_array)); exec->array.generic_array[i] = &arrayObj->VertexAttrib[i]; } - + exec->array.array_obj = arrayObj->Name; } @@ -452,7 +452,7 @@ recalculate_input_bindings(struct gl_context *ctx) case VP_ARB: /* GL_ARB_vertex_program or GLSL vertex shader - Only the generic[0] - * attribute array aliases and overrides the legacy position array. + * attribute array aliases and overrides the legacy position array. * * Otherwise, legacy attributes available in the legacy slots, * generic attributes in the generic slots and materials are not @@ -765,7 +765,7 @@ vbo_validated_drawrangeelements(struct gl_context *ctx, GLenum mode, * successive primitives layed out linearly in the vertex arrays. * Unless the vertex arrays are all in a VBO (or locked as with * CVA), the OpenGL semantics imply that we need to re-read or - * re-upload the vertex data on each draw call. + * re-upload the vertex data on each draw call. * * In the case of hardware tnl, we want to avoid starting the * upload at zero, as it will mean every draw call uploads an diff --git a/src/mesa/vbo/vbo_exec_draw.c b/src/mesa/vbo/vbo_exec_draw.c index 94aa021..8a57973 100644 --- a/src/mesa/vbo/vbo_exec_draw.c +++ b/src/mesa/vbo/vbo_exec_draw.c @@ -52,10 +52,10 @@ vbo_exec_debug_verts( struct vbo_exec_context *exec ) for (i = 0 ; i < exec->vtx.prim_count ; i++) { struct _mesa_prim *prim = &exec->vtx.prim[i]; printf(" prim %d: %s%s %d..%d %s %s\n", - i, + i, _mesa_lookup_prim_by_nr(prim->mode), prim->weak ? " (weak)" : "", - prim->start, + prim->start, prim->start + prim->count, prim->begin ? "BEGIN" : "(wrap)", prim->end ? "END" : "(wrap)"); @@ -74,8 +74,8 @@ vbo_copy_vertices( struct vbo_exec_context *exec ) GLuint ovf, i; GLuint sz = exec->vtx.vertex_size; GLfloat *dst = exec->vtx.copied.buffer; - const GLfloat *src = (exec->vtx.buffer_map + - exec->vtx.prim[exec->vtx.prim_count-1].start * + const GLfloat *src = (exec->vtx.buffer_map + + exec->vtx.prim[exec->vtx.prim_count-1].start * exec->vtx.vertex_size); @@ -182,7 +182,7 @@ vbo_exec_bind_arrays( struct gl_context *ctx ) case VP_ARB: /* The aliasing of attributes for NV vertex programs has already * occurred. NV vertex programs cannot access material values, - * nor attributes greater than VERT_ATTRIB_TEX7. + * nor attributes greater than VERT_ATTRIB_TEX7. */ for (attr = 0; attr < 16; attr++) { exec->vtx.inputs[attr] = &vbo->legacy_currval[attr]; @@ -258,7 +258,7 @@ vbo_exec_vtx_unmap( struct vbo_exec_context *exec ) if (_mesa_is_bufferobj(exec->vtx.bufferobj)) { struct gl_context *ctx = exec->ctx; - + if (ctx->Driver.FlushMappedBufferRange) { GLintptr offset = exec->vtx.buffer_used - exec->vtx.bufferobj->Offset; GLsizeiptr length = (exec->vtx.buffer_ptr - exec->vtx.buffer_map) * sizeof(float); @@ -274,7 +274,7 @@ vbo_exec_vtx_unmap( struct vbo_exec_context *exec ) assert(exec->vtx.buffer_used <= VBO_VERT_BUFFER_SIZE); assert(exec->vtx.buffer_ptr != NULL); - + ctx->Driver.UnmapBuffer(ctx, target, exec->vtx.bufferobj); exec->vtx.buffer_map = NULL; exec->vtx.buffer_ptr = NULL; @@ -295,7 +295,7 @@ vbo_exec_vtx_map( struct vbo_exec_context *exec ) GL_MAP_FLUSH_EXPLICIT_BIT | MESA_MAP_NOWAIT_BIT; const GLenum usage = GL_STREAM_DRAW_ARB; - + if (!_mesa_is_bufferobj(exec->vtx.bufferobj)) return; @@ -307,27 +307,27 @@ vbo_exec_vtx_map( struct vbo_exec_context *exec ) if (VBO_VERT_BUFFER_SIZE > exec->vtx.buffer_used + 1024 && ctx->Driver.MapBufferRange) { - exec->vtx.buffer_map = - (GLfloat *)ctx->Driver.MapBufferRange(ctx, - target, + exec->vtx.buffer_map = + (GLfloat *)ctx->Driver.MapBufferRange(ctx, + target, exec->vtx.buffer_used, - (VBO_VERT_BUFFER_SIZE - + (VBO_VERT_BUFFER_SIZE - exec->vtx.buffer_used), accessRange, exec->vtx.bufferobj); exec->vtx.buffer_ptr = exec->vtx.buffer_map; } - + if (!exec->vtx.buffer_map) { exec->vtx.buffer_used = 0; - ctx->Driver.BufferData(ctx, target, - VBO_VERT_BUFFER_SIZE, + ctx->Driver.BufferData(ctx, target, + VBO_VERT_BUFFER_SIZE, NULL, usage, exec->vtx.bufferobj); if (ctx->Driver.MapBufferRange) - exec->vtx.buffer_map = + exec->vtx.buffer_map = (GLfloat *)ctx->Driver.MapBufferRange(ctx, target, 0, VBO_VERT_BUFFER_SIZE, accessRange, @@ -354,14 +354,14 @@ vbo_exec_vtx_flush( struct vbo_exec_context *exec, GLboolean unmap ) if (0) vbo_exec_debug_verts( exec ); - if (exec->vtx.prim_count && + if (exec->vtx.prim_count && exec->vtx.vert_count) { - exec->vtx.copied.nr = vbo_copy_vertices( exec ); + exec->vtx.copied.nr = vbo_copy_vertices( exec ); if (exec->vtx.copied.nr != exec->vtx.vert_count) { struct gl_context *ctx = exec->ctx; - + /* Before the update_state() as this may raise _NEW_ARRAY * from _mesa_set_varying_vp_inputs(). */ @@ -378,9 +378,9 @@ vbo_exec_vtx_flush( struct vbo_exec_context *exec, GLboolean unmap ) printf("%s %d %d\n", __FUNCTION__, exec->vtx.prim_count, exec->vtx.vert_count); - vbo_context(ctx)->draw_prims( ctx, - exec->vtx.inputs, - exec->vtx.prim, + vbo_context(ctx)->draw_prims( ctx, + exec->vtx.inputs, + exec->vtx.prim, exec->vtx.prim_count, NULL, GL_TRUE, @@ -397,7 +397,7 @@ vbo_exec_vtx_flush( struct vbo_exec_context *exec, GLboolean unmap ) /* May have to unmap explicitly if we didn't draw: */ - if (unmap && + if (unmap && _mesa_is_bufferobj(exec->vtx.bufferobj) && exec->vtx.buffer_map) { vbo_exec_vtx_unmap( exec ); @@ -407,7 +407,7 @@ vbo_exec_vtx_flush( struct vbo_exec_context *exec, GLboolean unmap ) if (unmap || exec->vtx.vertex_size == 0) exec->vtx.max_vert = 0; else - exec->vtx.max_vert = ((VBO_VERT_BUFFER_SIZE - exec->vtx.buffer_used) / + exec->vtx.max_vert = ((VBO_VERT_BUFFER_SIZE - exec->vtx.buffer_used) / (exec->vtx.vertex_size * sizeof(GLfloat))); exec->vtx.buffer_ptr = exec->vtx.buffer_map; diff --git a/src/mesa/vbo/vbo_exec_eval.c b/src/mesa/vbo/vbo_exec_eval.c index 1e8c3c4..cda40c8 100644 --- a/src/mesa/vbo/vbo_exec_eval.c +++ b/src/mesa/vbo/vbo_exec_eval.c @@ -33,19 +33,19 @@ #include "vbo_exec.h" -static void clear_active_eval1( struct vbo_exec_context *exec, GLuint attr ) +static void clear_active_eval1( struct vbo_exec_context *exec, GLuint attr ) { assert(attr < Elements(exec->eval.map1)); exec->eval.map1[attr].map = NULL; } -static void clear_active_eval2( struct vbo_exec_context *exec, GLuint attr ) +static void clear_active_eval2( struct vbo_exec_context *exec, GLuint attr ) { assert(attr < Elements(exec->eval.map2)); exec->eval.map2[attr].map = NULL; } -static void set_active_eval1( struct vbo_exec_context *exec, GLuint attr, GLuint dim, +static void set_active_eval1( struct vbo_exec_context *exec, GLuint attr, GLuint dim, struct gl_1d_map *map ) { assert(attr < Elements(exec->eval.map1)); @@ -53,9 +53,9 @@ static void set_active_eval1( struct vbo_exec_context *exec, GLuint attr, GLuint exec->eval.map1[attr].map = map; exec->eval.map1[attr].sz = dim; } -} +} -static void set_active_eval2( struct vbo_exec_context *exec, GLuint attr, GLuint dim, +static void set_active_eval2( struct vbo_exec_context *exec, GLuint attr, GLuint dim, struct gl_2d_map *map ) { assert(attr < Elements(exec->eval.map2)); @@ -63,7 +63,7 @@ static void set_active_eval2( struct vbo_exec_context *exec, GLuint attr, GLuint exec->eval.map2[attr].map = map; exec->eval.map2[attr].sz = dim; } -} +} void vbo_exec_eval_update( struct vbo_exec_context *exec ) { @@ -77,44 +77,44 @@ void vbo_exec_eval_update( struct vbo_exec_context *exec ) clear_active_eval2( exec, attr ); } - if (ctx->Eval.Map1Color4) + if (ctx->Eval.Map1Color4) set_active_eval1( exec, VBO_ATTRIB_COLOR0, 4, &ctx->EvalMap.Map1Color4 ); - - if (ctx->Eval.Map2Color4) + + if (ctx->Eval.Map2Color4) set_active_eval2( exec, VBO_ATTRIB_COLOR0, 4, &ctx->EvalMap.Map2Color4 ); - if (ctx->Eval.Map1TextureCoord4) + if (ctx->Eval.Map1TextureCoord4) set_active_eval1( exec, VBO_ATTRIB_TEX0, 4, &ctx->EvalMap.Map1Texture4 ); - else if (ctx->Eval.Map1TextureCoord3) + else if (ctx->Eval.Map1TextureCoord3) set_active_eval1( exec, VBO_ATTRIB_TEX0, 3, &ctx->EvalMap.Map1Texture3 ); - else if (ctx->Eval.Map1TextureCoord2) + else if (ctx->Eval.Map1TextureCoord2) set_active_eval1( exec, VBO_ATTRIB_TEX0, 2, &ctx->EvalMap.Map1Texture2 ); - else if (ctx->Eval.Map1TextureCoord1) + else if (ctx->Eval.Map1TextureCoord1) set_active_eval1( exec, VBO_ATTRIB_TEX0, 1, &ctx->EvalMap.Map1Texture1 ); - if (ctx->Eval.Map2TextureCoord4) + if (ctx->Eval.Map2TextureCoord4) set_active_eval2( exec, VBO_ATTRIB_TEX0, 4, &ctx->EvalMap.Map2Texture4 ); - else if (ctx->Eval.Map2TextureCoord3) + else if (ctx->Eval.Map2TextureCoord3) set_active_eval2( exec, VBO_ATTRIB_TEX0, 3, &ctx->EvalMap.Map2Texture3 ); - else if (ctx->Eval.Map2TextureCoord2) + else if (ctx->Eval.Map2TextureCoord2) set_active_eval2( exec, VBO_ATTRIB_TEX0, 2, &ctx->EvalMap.Map2Texture2 ); - else if (ctx->Eval.Map2TextureCoord1) + else if (ctx->Eval.Map2TextureCoord1) set_active_eval2( exec, VBO_ATTRIB_TEX0, 1, &ctx->EvalMap.Map2Texture1 ); - if (ctx->Eval.Map1Normal) + if (ctx->Eval.Map1Normal) set_active_eval1( exec, VBO_ATTRIB_NORMAL, 3, &ctx->EvalMap.Map1Normal ); - if (ctx->Eval.Map2Normal) + if (ctx->Eval.Map2Normal) set_active_eval2( exec, VBO_ATTRIB_NORMAL, 3, &ctx->EvalMap.Map2Normal ); - if (ctx->Eval.Map1Vertex4) + if (ctx->Eval.Map1Vertex4) set_active_eval1( exec, VBO_ATTRIB_POS, 4, &ctx->EvalMap.Map1Vertex4 ); - else if (ctx->Eval.Map1Vertex3) + else if (ctx->Eval.Map1Vertex3) set_active_eval1( exec, VBO_ATTRIB_POS, 3, &ctx->EvalMap.Map1Vertex3 ); - if (ctx->Eval.Map2Vertex4) + if (ctx->Eval.Map2Vertex4) set_active_eval2( exec, VBO_ATTRIB_POS, 4, &ctx->EvalMap.Map2Vertex4 ); - else if (ctx->Eval.Map2Vertex3) + else if (ctx->Eval.Map2Vertex3) set_active_eval2( exec, VBO_ATTRIB_POS, 3, &ctx->EvalMap.Map2Vertex3 ); /* _NEW_PROGRAM */ @@ -125,11 +125,11 @@ void vbo_exec_eval_update( struct vbo_exec_context *exec ) for (attr = 0; attr < 16; attr++) { /* _NEW_EVAL */ assert(attr < Elements(ctx->Eval.Map1Attrib)); - if (ctx->Eval.Map1Attrib[attr]) + if (ctx->Eval.Map1Attrib[attr]) set_active_eval1( exec, attr, 4, &ctx->EvalMap.Map1Attrib[attr] ); assert(attr < Elements(ctx->Eval.Map2Attrib)); - if (ctx->Eval.Map2Attrib[attr]) + if (ctx->Eval.Map2Attrib[attr]) set_active_eval2( exec, attr, 4, &ctx->EvalMap.Map2Attrib[attr] ); } } @@ -151,8 +151,8 @@ void vbo_exec_do_EvalCoord1f(struct vbo_exec_context *exec, GLfloat u) ASSIGN_4V(data, 0, 0, 0, 1); - _math_horner_bezier_curve(map->Points, data, uu, - exec->eval.map1[attr].sz, + _math_horner_bezier_curve(map->Points, data, uu, + exec->eval.map1[attr].sz, map->Order); COPY_SZ_4V( exec->vtx.attrptr[attr], @@ -170,22 +170,22 @@ void vbo_exec_do_EvalCoord1f(struct vbo_exec_context *exec, GLfloat u) ASSIGN_4V(vertex, 0, 0, 0, 1); - _math_horner_bezier_curve(map->Points, vertex, uu, - exec->eval.map1[0].sz, + _math_horner_bezier_curve(map->Points, vertex, uu, + exec->eval.map1[0].sz, map->Order); - if (exec->eval.map1[0].sz == 4) + if (exec->eval.map1[0].sz == 4) CALL_Vertex4fv(GET_DISPATCH(), ( vertex )); else - CALL_Vertex3fv(GET_DISPATCH(), ( vertex )); + CALL_Vertex3fv(GET_DISPATCH(), ( vertex )); } } -void vbo_exec_do_EvalCoord2f( struct vbo_exec_context *exec, +void vbo_exec_do_EvalCoord2f( struct vbo_exec_context *exec, GLfloat u, GLfloat v ) -{ +{ GLuint attr; for (attr = 1; attr <= VBO_ATTRIB_TEX7; attr++) { @@ -197,10 +197,10 @@ void vbo_exec_do_EvalCoord2f( struct vbo_exec_context *exec, ASSIGN_4V(data, 0, 0, 0, 1); - _math_horner_bezier_surf(map->Points, - data, - uu, vv, - exec->eval.map2[attr].sz, + _math_horner_bezier_surf(map->Points, + data, + uu, vv, + exec->eval.map2[attr].sz, map->Uorder, map->Vorder); COPY_SZ_4V( exec->vtx.attrptr[attr], @@ -223,7 +223,7 @@ void vbo_exec_do_EvalCoord2f( struct vbo_exec_context *exec, GLfloat normal[4]; GLfloat du[4], dv[4]; - _math_de_casteljau_surf(map->Points, vertex, du, dv, uu, vv, + _math_de_casteljau_surf(map->Points, vertex, du, dv, uu, vv, exec->eval.map2[0].sz, map->Uorder, map->Vorder); @@ -231,7 +231,7 @@ void vbo_exec_do_EvalCoord2f( struct vbo_exec_context *exec, du[0] = du[0]*vertex[3] - du[3]*vertex[0]; du[1] = du[1]*vertex[3] - du[3]*vertex[1]; du[2] = du[2]*vertex[3] - du[3]*vertex[2]; - + dv[0] = dv[0]*vertex[3] - dv[3]*vertex[0]; dv[1] = dv[1]*vertex[3] - dv[3]*vertex[1]; dv[2] = dv[2]*vertex[3] - dv[3]*vertex[2]; @@ -248,15 +248,15 @@ void vbo_exec_do_EvalCoord2f( struct vbo_exec_context *exec, } else { - _math_horner_bezier_surf(map->Points, vertex, uu, vv, + _math_horner_bezier_surf(map->Points, vertex, uu, vv, exec->eval.map2[0].sz, map->Uorder, map->Vorder); } - if (exec->vtx.attrsz[0] == 4) + if (exec->vtx.attrsz[0] == 4) CALL_Vertex4fv(GET_DISPATCH(), ( vertex )); else - CALL_Vertex3fv(GET_DISPATCH(), ( vertex )); + CALL_Vertex3fv(GET_DISPATCH(), ( vertex )); } } diff --git a/src/mesa/vbo/vbo_rebase.c b/src/mesa/vbo/vbo_rebase.c index 9068ae2..bcd5963 100644 --- a/src/mesa/vbo/vbo_rebase.c +++ b/src/mesa/vbo/vbo_rebase.c @@ -39,7 +39,7 @@ * * If we just upload the new data, however, the indices will be * incorrect as we tend to upload each set of vertex data to a new - * region. + * region. * * This file provides a helper to adjust the arrays, primitives and * indices of a draw call so that it can be re-issued with a min_index @@ -76,7 +76,7 @@ REBASE(GLubyte) GLboolean vbo_all_varyings_in_vbos( const struct gl_client_array *arrays[] ) { GLuint i; - + for (i = 0; i < VERT_ATTRIB_MAX; i++) if (arrays[i]->StrideB && arrays[i]->BufferObj->Name == 0) @@ -105,7 +105,7 @@ GLboolean vbo_any_varyings_in_vbos( const struct gl_client_array *arrays[] ) * min_index will be transformed. * * Hardware tnl: - * - if ib != NULL and min_index != 0, otherwise vertices lower than + * - if ib != NULL and min_index != 0, otherwise vertices lower than * min_index will be uploaded. Requires adjusting index values. * * - if ib == NULL and min_index != 0, just for convenience so this doesn't @@ -160,8 +160,8 @@ void vbo_rebase_prims( struct gl_context *ctx, GLboolean map_ib = ib->obj->Name && !ib->obj->Pointer; void *ptr; - if (map_ib) - ctx->Driver.MapBuffer(ctx, + if (map_ib) + ctx->Driver.MapBuffer(ctx, GL_ELEMENT_ARRAY_BUFFER, GL_READ_ONLY_ARB, ib->obj); @@ -173,19 +173,19 @@ void vbo_rebase_prims( struct gl_context *ctx, * GLuints here. Others wouldn't... */ switch (ib->type) { - case GL_UNSIGNED_INT: + case GL_UNSIGNED_INT: tmp_indices = rebase_GLuint( ptr, ib->count, min_index ); break; - case GL_UNSIGNED_SHORT: + case GL_UNSIGNED_SHORT: tmp_indices = rebase_GLushort( ptr, ib->count, min_index ); break; - case GL_UNSIGNED_BYTE: + case GL_UNSIGNED_BYTE: tmp_indices = rebase_GLubyte( ptr, ib->count, min_index ); break; - } + } - if (map_ib) - ctx->Driver.UnmapBuffer(ctx, + if (map_ib) + ctx->Driver.UnmapBuffer(ctx, GL_ELEMENT_ARRAY_BUFFER, ib->obj); @@ -228,21 +228,21 @@ void vbo_rebase_prims( struct gl_context *ctx, tmp_arrays[i].Ptr += min_index * tmp_arrays[i].StrideB; tmp_array_pointers[i] = &tmp_arrays[i]; } - + /* Re-issue the draw call. */ - draw( ctx, - tmp_array_pointers, - prim, - nr_prims, - ib, + draw( ctx, + tmp_array_pointers, + prim, + nr_prims, + ib, GL_TRUE, - 0, + 0, max_index - min_index ); - + if (tmp_indices) free(tmp_indices); - + if (tmp_prims) free(tmp_prims); } diff --git a/src/mesa/vbo/vbo_save.c b/src/mesa/vbo/vbo_save.c index 4e7bcdd..049f079 100644 --- a/src/mesa/vbo/vbo_save.c +++ b/src/mesa/vbo/vbo_save.c @@ -68,7 +68,7 @@ void vbo_save_init( struct gl_context *ctx ) for (i = 0; i < 16; ++i) { arrays[i ].BufferObj = NULL; arrays[i + 16].BufferObj = NULL; - _mesa_reference_buffer_object(ctx, &arrays[i ].BufferObj, + _mesa_reference_buffer_object(ctx, &arrays[i ].BufferObj, vbo->legacy_currval[i].BufferObj); _mesa_reference_buffer_object(ctx, &arrays[i + 16].BufferObj, vbo->generic_currval[i].BufferObj); diff --git a/src/mesa/vbo/vbo_save.h b/src/mesa/vbo/vbo_save.h index f5a407c..6b86b78 100644 --- a/src/mesa/vbo/vbo_save.h +++ b/src/mesa/vbo/vbo_save.h @@ -74,7 +74,7 @@ struct vbo_save_vertex_list { GLuint buffer_offset; GLuint count; GLuint wrap_count; /* number of copied vertices at start */ - GLboolean dangling_attr_ref; /* current attr implicitly referenced + GLboolean dangling_attr_ref; /* current attr implicitly referenced outside the list */ struct _mesa_prim *prim; @@ -148,7 +148,7 @@ struct vbo_save_context { GLuint opcode_vertex_list; struct vbo_save_copied_vtx copied; - + GLfloat *current[VBO_ATTRIB_MAX]; /* points into ctx->ListState */ GLubyte *currentsz[VBO_ATTRIB_MAX]; }; diff --git a/src/mesa/vbo/vbo_save_api.c b/src/mesa/vbo/vbo_save_api.c index 817d478..0f56ced 100644 --- a/src/mesa/vbo/vbo_save_api.c +++ b/src/mesa/vbo/vbo_save_api.c @@ -41,7 +41,7 @@ USE OR OTHER DEALINGS IN THE SOFTWARE. * example by building a list that consists of one very long primitive * (eg Begin(Triangles), 1000 vertices, End), and calling that list * from inside a different begin/end object (Begin(Lines), CallList, - * End). + * End). * * In that case the code will have to replay the list as individual * commands through the Exec dispatch table, or fix up the copied @@ -60,7 +60,7 @@ USE OR OTHER DEALINGS IN THE SOFTWARE. * * The list compiler currently doesn't attempt to compile lists * containing EvalCoord or EvalPoint commands. On encountering one of - * these, compilation falls back to opcodes. + * these, compilation falls back to opcodes. * * This could be improved to fallback only when a mix of EvalCoord and * Vertex commands are issued within a single primitive. @@ -99,7 +99,7 @@ USE OR OTHER DEALINGS IN THE SOFTWARE. * NOTE: Old 'parity' issue is gone, but copying can still be * wrong-footed on replay. */ -static GLuint _save_copy_vertices( struct gl_context *ctx, +static GLuint _save_copy_vertices( struct gl_context *ctx, const struct vbo_save_vertex_list *node, const GLfloat *src_buffer) { @@ -113,7 +113,7 @@ static GLuint _save_copy_vertices( struct gl_context *ctx, if (prim->end) return 0; - + switch( prim->mode ) { case GL_POINTS: @@ -134,7 +134,7 @@ static GLuint _save_copy_vertices( struct gl_context *ctx, memcpy( dst+i*sz, src+(nr-ovf+i)*sz, sz*sizeof(GLfloat) ); return i; case GL_LINE_STRIP: - if (nr == 0) + if (nr == 0) return 0; else { memcpy( dst, src+(nr-1)*sz, sz*sizeof(GLfloat) ); @@ -143,7 +143,7 @@ static GLuint _save_copy_vertices( struct gl_context *ctx, case GL_LINE_LOOP: case GL_TRIANGLE_FAN: case GL_POLYGON: - if (nr == 0) + if (nr == 0) return 0; else if (nr == 1) { memcpy( dst, src+0, sz*sizeof(GLfloat) ); @@ -184,8 +184,8 @@ static struct vbo_save_vertex_store *alloc_vertex_store( struct gl_context *ctx VBO_BUF_ID, GL_ARRAY_BUFFER_ARB); - ctx->Driver.BufferData( ctx, - GL_ARRAY_BUFFER_ARB, + ctx->Driver.BufferData( ctx, + GL_ARRAY_BUFFER_ARB, VBO_SAVE_BUFFER_SIZE * sizeof(GLfloat), NULL, GL_STATIC_DRAW_ARB, @@ -213,10 +213,10 @@ static GLfloat *map_vertex_store( struct gl_context *ctx, struct vbo_save_vertex { assert(vertex_store->bufferobj); assert(!vertex_store->buffer); - vertex_store->buffer = (GLfloat *)ctx->Driver.MapBuffer(ctx, + vertex_store->buffer = (GLfloat *)ctx->Driver.MapBuffer(ctx, GL_ARRAY_BUFFER_ARB, /* not used */ GL_WRITE_ONLY, /* not used */ - vertex_store->bufferobj); + vertex_store->bufferobj); assert(vertex_store->buffer); return vertex_store->buffer + vertex_store->used; @@ -243,13 +243,13 @@ static void _save_reset_counters( struct gl_context *ctx ) struct vbo_save_context *save = &vbo_context(ctx)->save; save->prim = save->prim_store->buffer + save->prim_store->used; - save->buffer = (save->vertex_store->buffer + + save->buffer = (save->vertex_store->buffer + save->vertex_store->used); assert(save->buffer == save->buffer_ptr); if (save->vertex_size) - save->max_vert = ((VBO_SAVE_BUFFER_SIZE - save->vertex_store->used) / + save->max_vert = ((VBO_SAVE_BUFFER_SIZE - save->vertex_store->used) / save->vertex_size); else save->max_vert = 0; @@ -282,7 +282,7 @@ static void _save_compile_vertex_list( struct gl_context *ctx ) */ memcpy(node->attrsz, save->attrsz, sizeof(node->attrsz)); node->vertex_size = save->vertex_size; - node->buffer_offset = (save->buffer - save->vertex_store->buffer) * sizeof(GLfloat); + node->buffer_offset = (save->buffer - save->vertex_store->buffer) * sizeof(GLfloat); node->count = save->vert_count; node->wrap_count = save->copied.nr; node->dangling_attr_ref = save->dangling_attr_ref; @@ -329,7 +329,7 @@ static void _save_compile_vertex_list( struct gl_context *ctx ) save->prim_store->used += node->prim_count; - /* Copy duplicated vertices + /* Copy duplicated vertices */ save->copied.nr = _save_copy_vertices( ctx, node, save->buffer ); @@ -342,7 +342,7 @@ static void _save_compile_vertex_list( struct gl_context *ctx ) _glapi_set_dispatch(ctx->Exec); vbo_loopback_vertex_list( ctx, - (const GLfloat *)((const char *)save->vertex_store->buffer + + (const GLfloat *)((const char *)save->vertex_store->buffer + node->buffer_offset), node->attrsz, node->prim, @@ -357,7 +357,7 @@ static void _save_compile_vertex_list( struct gl_context *ctx ) /* Decide whether the storage structs are full, or can be used for * the next vertex lists as well. */ - if (save->vertex_store->used > + if (save->vertex_store->used > VBO_SAVE_BUFFER_SIZE - 16 * (save->vertex_size + 4)) { /* Unmap old store: @@ -366,7 +366,7 @@ static void _save_compile_vertex_list( struct gl_context *ctx ) /* Release old reference: */ - save->vertex_store->refcount--; + save->vertex_store->refcount--; assert(save->vertex_store->refcount != 0); save->vertex_store = NULL; @@ -374,13 +374,13 @@ static void _save_compile_vertex_list( struct gl_context *ctx ) */ save->vertex_store = alloc_vertex_store( ctx ); save->buffer_ptr = map_vertex_store( ctx, save->vertex_store ); - } + } if (save->prim_store->used > VBO_SAVE_PRIM_SIZE - 6) { - save->prim_store->refcount--; + save->prim_store->refcount--; assert(save->prim_store->refcount != 0); save->prim_store = alloc_prim_store( ctx ); - } + } /* Reset our structures for the next run of vertices: */ @@ -403,11 +403,11 @@ static void _save_wrap_buffers( struct gl_context *ctx ) /* Close off in-progress primitive. */ - save->prim[i].count = (save->vert_count - + save->prim[i].count = (save->vert_count - save->prim[i].start); mode = save->prim[i].mode; weak = save->prim[i].weak; - + /* store the copied vertices, and allocate a new list. */ _save_compile_vertex_list( ctx ); @@ -428,7 +428,7 @@ static void _save_wrap_buffers( struct gl_context *ctx ) /* Called only when buffers are wrapped as the result of filling the - * vertex_store struct. + * vertex_store struct. */ static void _save_wrap_filled_vertex( struct gl_context *ctx ) { @@ -439,7 +439,7 @@ static void _save_wrap_filled_vertex( struct gl_context *ctx ) /* Emit a glEnd to close off the last vertex list. */ _save_wrap_buffers( ctx ); - + /* Copy stored stored vertices to start of new list. */ assert(save->max_vert - save->vert_count > save->copied.nr); @@ -455,14 +455,14 @@ static void _save_wrap_filled_vertex( struct gl_context *ctx ) static void _save_copy_to_current( struct gl_context *ctx ) { - struct vbo_save_context *save = &vbo_context(ctx)->save; + struct vbo_save_context *save = &vbo_context(ctx)->save; GLuint i; for (i = VBO_ATTRIB_POS+1 ; i < VBO_ATTRIB_MAX ; i++) { if (save->attrsz[i]) { save->currentsz[i][0] = save->attrsz[i]; - COPY_CLEAN_4V(save->current[i], - save->attrsz[i], + COPY_CLEAN_4V(save->current[i], + save->attrsz[i], save->attrptr[i]); } } @@ -471,7 +471,7 @@ static void _save_copy_to_current( struct gl_context *ctx ) static void _save_copy_from_current( struct gl_context *ctx ) { - struct vbo_save_context *save = &vbo_context(ctx)->save; + struct vbo_save_context *save = &vbo_context(ctx)->save; GLint i; for (i = VBO_ATTRIB_POS+1 ; i < VBO_ATTRIB_MAX ; i++) { @@ -489,8 +489,8 @@ static void _save_copy_from_current( struct gl_context *ctx ) /* Flush existing data, set new attrib size, replay copied vertices. - */ -static void _save_upgrade_vertex( struct gl_context *ctx, + */ +static void _save_upgrade_vertex( struct gl_context *ctx, GLuint attr, GLuint newsz ) { @@ -502,14 +502,14 @@ static void _save_upgrade_vertex( struct gl_context *ctx, /* Store the current run of vertices, and emit a GL_END. Emit a * BEGIN in the new buffer. */ - if (save->vert_count) + if (save->vert_count) _save_wrap_buffers( ctx ); else assert( save->copied.nr == 0 ); /* Do a COPY_TO_CURRENT to ensure back-copying works for the case * when the attribute already exists in the vertex and is having - * its size increased. + * its size increased. */ _save_copy_to_current( ctx ); @@ -519,7 +519,7 @@ static void _save_upgrade_vertex( struct gl_context *ctx, save->attrsz[attr] = newsz; save->vertex_size += newsz - oldsz; - save->max_vert = ((VBO_SAVE_BUFFER_SIZE - save->vertex_store->used) / + save->max_vert = ((VBO_SAVE_BUFFER_SIZE - save->vertex_store->used) / save->vertex_size); save->vert_count = 0; @@ -530,7 +530,7 @@ static void _save_upgrade_vertex( struct gl_context *ctx, save->attrptr[i] = tmp; tmp += save->attrsz[i]; } - else + else save->attrptr[i] = NULL; /* will not be dereferenced. */ } @@ -588,7 +588,7 @@ static void _save_upgrade_vertex( struct gl_context *ctx, static void save_fixup_vertex( struct gl_context *ctx, GLuint attr, GLuint sz ) { - struct vbo_save_context *save = &vbo_context(ctx)->save; + struct vbo_save_context *save = &vbo_context(ctx)->save; if (sz > save->attrsz[attr]) { /* New size is larger. Need to flush existing vertices and get @@ -619,7 +619,7 @@ static void _save_reset_vertex( struct gl_context *ctx ) save->attrsz[i] = 0; save->active_sz[i] = 0; } - + save->vertex_size = 0; } @@ -682,7 +682,7 @@ static void DO_FALLBACK( struct gl_context *ctx ) /* Close off in-progress primitive. */ - save->prim[i].count = (save->vert_count - + save->prim[i].count = (save->vert_count - save->prim[i].start); /* Need to replay this display list with loopback, @@ -690,7 +690,7 @@ static void DO_FALLBACK( struct gl_context *ctx ) * properly: */ save->dangling_attr_ref = 1; - + _save_compile_vertex_list( ctx ); } @@ -765,7 +765,7 @@ static void GLAPIENTRY _save_CallLists( GLsizei n, GLenum type, const GLvoid *v */ GLboolean vbo_save_NotifyBegin( struct gl_context *ctx, GLenum mode ) { - struct vbo_save_context *save = &vbo_context(ctx)->save; + struct vbo_save_context *save = &vbo_context(ctx)->save; GLuint i = save->prim_count++; @@ -776,10 +776,10 @@ GLboolean vbo_save_NotifyBegin( struct gl_context *ctx, GLenum mode ) save->prim[i].weak = (mode & VBO_SAVE_PRIM_WEAK) ? 1 : 0; save->prim[i].pad = 0; save->prim[i].start = save->vert_count; - save->prim[i].count = 0; - save->prim[i].num_instances = 1; + save->prim[i].count = 0; + save->prim[i].num_instances = 1; - _mesa_install_save_vtxfmt( ctx, &save->vtxfmt ); + _mesa_install_save_vtxfmt( ctx, &save->vtxfmt ); ctx->Driver.SaveNeedFlush = 1; return GL_TRUE; } @@ -788,13 +788,13 @@ GLboolean vbo_save_NotifyBegin( struct gl_context *ctx, GLenum mode ) static void GLAPIENTRY _save_End( void ) { - GET_CURRENT_CONTEXT( ctx ); - struct vbo_save_context *save = &vbo_context(ctx)->save; + GET_CURRENT_CONTEXT( ctx ); + struct vbo_save_context *save = &vbo_context(ctx)->save; GLint i = save->prim_count - 1; ctx->Driver.CurrentSavePrimitive = PRIM_OUTSIDE_BEGIN_END; save->prim[i].end = 1; - save->prim[i].count = (save->vert_count - + save->prim[i].count = (save->vert_count - save->prim[i].start); if (i == (GLint) save->prim_max - 1) { @@ -805,7 +805,7 @@ static void GLAPIENTRY _save_End( void ) /* Swap out this vertex format while outside begin/end. Any color, * etc. received between here and the next begin will be compiled * as opcodes. - */ + */ _mesa_install_save_vtxfmt( ctx, &ctx->ListState.ListVtxfmt ); } @@ -899,7 +899,7 @@ static void GLAPIENTRY _save_Begin( GLenum mode ) static void GLAPIENTRY _save_PrimitiveRestartNV( void ) { GLenum curPrim; - GET_CURRENT_CONTEXT( ctx ); + GET_CURRENT_CONTEXT( ctx ); curPrim = ctx->Driver.CurrentSavePrimitive; @@ -1064,7 +1064,7 @@ static void _save_vtxfmt_init( struct gl_context *ctx ) vfmt->VertexAttrib3fvNV = _save_VertexAttrib3fvNV; vfmt->VertexAttrib4fNV = _save_VertexAttrib4fNV; vfmt->VertexAttrib4fvNV = _save_VertexAttrib4fvNV; - + /* integer-valued */ vfmt->VertexAttribI1i = _save_VertexAttribI1i; vfmt->VertexAttribI2i = _save_VertexAttribI2i; @@ -1084,7 +1084,7 @@ static void _save_vtxfmt_init( struct gl_context *ctx ) vfmt->VertexAttribI4uiv = _save_VertexAttribI4uiv; /* This will all require us to fallback to saving the list as opcodes: - */ + */ _MESA_INIT_DLIST_VTXFMT(vfmt, _save_); /* inside begin/end */ _MESA_INIT_EVAL_VTXFMT(vfmt, _save_); @@ -1116,12 +1116,12 @@ void vbo_save_SaveFlushVertices( struct gl_context *ctx ) return; if (save->vert_count || - save->prim_count) + save->prim_count) _save_compile_vertex_list( ctx ); - + _save_copy_to_current( ctx ); _save_reset_vertex( ctx ); - _save_reset_counters( ctx ); + _save_reset_counters( ctx ); ctx->Driver.SaveNeedFlush = 0; } @@ -1134,13 +1134,13 @@ void vbo_save_NewList( struct gl_context *ctx, GLuint list, GLenum mode ) if (!save->prim_store) save->prim_store = alloc_prim_store( ctx ); - if (!save->vertex_store) + if (!save->vertex_store) save->vertex_store = alloc_vertex_store( ctx ); - + save->buffer_ptr = map_vertex_store( ctx, save->vertex_store ); - + _save_reset_vertex( ctx ); - _save_reset_counters( ctx ); + _save_reset_counters( ctx ); ctx->Driver.SaveNeedFlush = 0; } @@ -1156,7 +1156,7 @@ void vbo_save_EndList( struct gl_context *ctx ) GLint i = save->prim_count - 1; ctx->Driver.CurrentSavePrimitive = PRIM_OUTSIDE_BEGIN_END; save->prim[i].end = 0; - save->prim[i].count = (save->vert_count - + save->prim[i].count = (save->vert_count - save->prim[i].start); } @@ -1169,7 +1169,7 @@ void vbo_save_EndList( struct gl_context *ctx ) /* Swap out this vertex format while outside begin/end. Any color, * etc. received between here and the next begin will be compiled * as opcodes. - */ + */ _mesa_install_save_vtxfmt( ctx, &ctx->ListState.ListVtxfmt ); } @@ -1177,7 +1177,7 @@ void vbo_save_EndList( struct gl_context *ctx ) assert(save->vertex_size == 0); } - + void vbo_save_BeginCallList( struct gl_context *ctx, struct gl_display_list *dlist ) { struct vbo_save_context *save = &vbo_context(ctx)->save; @@ -1187,7 +1187,7 @@ void vbo_save_BeginCallList( struct gl_context *ctx, struct gl_display_list *dli void vbo_save_EndCallList( struct gl_context *ctx ) { struct vbo_save_context *save = &vbo_context(ctx)->save; - + if (ctx->ListState.CallDepth == 1) { /* This is correct: want to keep only the VBO_SAVE_FALLBACK * flag, if it is set: @@ -1202,7 +1202,7 @@ static void vbo_destroy_vertex_list( struct gl_context *ctx, void *data ) struct vbo_save_vertex_list *node = (struct vbo_save_vertex_list *)data; (void) ctx; - if ( --node->vertex_store->refcount == 0 ) + if ( --node->vertex_store->refcount == 0 ) free_vertex_store( ctx, node->vertex_store ); if ( --node->prim_store->refcount == 0 ) @@ -1229,10 +1229,10 @@ static void vbo_print_vertex_list( struct gl_context *ctx, void *data ) for (i = 0 ; i < node->prim_count ; i++) { struct _mesa_prim *prim = &node->prim[i]; _mesa_debug(NULL, " prim %d: %s%s %d..%d %s %s\n", - i, + i, _mesa_lookup_prim_by_nr(prim->mode), prim->weak ? " (weak)" : "", - prim->start, + prim->start, prim->start + prim->count, (prim->begin) ? "BEGIN" : "(wrap)", (prim->end) ? "END" : "(wrap)"); @@ -1240,7 +1240,7 @@ static void vbo_print_vertex_list( struct gl_context *ctx, void *data ) } -static void _save_current_init( struct gl_context *ctx ) +static void _save_current_init( struct gl_context *ctx ) { struct vbo_save_context *save = &vbo_context(ctx)->save; GLint i; @@ -1284,7 +1284,7 @@ void vbo_save_api_init( struct vbo_save_context *save ) for (i = 0; i < VBO_ATTRIB_MAX; i++) save->inputs[i] = &save->arrays[i]; - /* Hook our array functions into the outside-begin-end vtxfmt in + /* Hook our array functions into the outside-begin-end vtxfmt in * ctx->ListState. */ ctx->ListState.ListVtxfmt.Rectf = _save_OBE_Rectf; diff --git a/src/mesa/vbo/vbo_save_draw.c b/src/mesa/vbo/vbo_save_draw.c index 533c150..47d8d1c 100644 --- a/src/mesa/vbo/vbo_save_draw.c +++ b/src/mesa/vbo/vbo_save_draw.c @@ -64,13 +64,13 @@ _playback_copy_to_current(struct gl_context *ctx, data = vertex; if (node->count) - offset = (node->buffer_offset + + offset = (node->buffer_offset + (node->count-1) * node->vertex_size * sizeof(GLfloat)); else offset = node->buffer_offset; - ctx->Driver.GetBufferSubData( ctx, 0, offset, - node->vertex_size * sizeof(GLfloat), + ctx->Driver.GetBufferSubData( ctx, 0, offset, + node->vertex_size * sizeof(GLfloat), data, node->vertex_store->bufferobj ); data += node->attrsz[0]; /* skip vertex position */ @@ -81,10 +81,10 @@ _playback_copy_to_current(struct gl_context *ctx, GLfloat *current = (GLfloat *)vbo->currval[i].Ptr; GLfloat tmp[4]; - COPY_CLEAN_4V(tmp, - node->attrsz[i], + COPY_CLEAN_4V(tmp, + node->attrsz[i], data); - + if (memcmp(current, tmp, 4 * sizeof(GLfloat)) != 0) { memcpy(current, tmp, 4 * sizeof(GLfloat)); @@ -155,7 +155,7 @@ static void vbo_bind_vertex_list(struct gl_context *ctx, case VP_ARB: /* The aliasing of attributes for NV vertex programs has already * occurred. NV vertex programs cannot access material values, - * nor attributes greater than VERT_ATTRIB_TEX7. + * nor attributes greater than VERT_ATTRIB_TEX7. */ for (attr = 0; attr < 16; attr++) { save->inputs[attr] = &vbo->legacy_currval[attr]; @@ -196,7 +196,7 @@ static void vbo_bind_vertex_list(struct gl_context *ctx, &arrays[attr].BufferObj, node->vertex_store->bufferobj); arrays[attr]._MaxElement = node->count; /* ??? */ - + assert(arrays[attr].BufferObj->Name); buffer_offset += node->attrsz[src] * sizeof(GLfloat); @@ -212,8 +212,8 @@ static void vbo_save_loopback_vertex_list(struct gl_context *ctx, const struct vbo_save_vertex_list *list) { - const char *buffer = ctx->Driver.MapBuffer(ctx, - GL_ARRAY_BUFFER_ARB, + const char *buffer = ctx->Driver.MapBuffer(ctx, + GL_ARRAY_BUFFER_ARB, GL_READ_ONLY, /* ? */ list->vertex_store->bufferobj); @@ -225,7 +225,7 @@ vbo_save_loopback_vertex_list(struct gl_context *ctx, list->wrap_count, list->vertex_size); - ctx->Driver.UnmapBuffer(ctx, GL_ARRAY_BUFFER_ARB, + ctx->Driver.UnmapBuffer(ctx, GL_ARRAY_BUFFER_ARB, list->vertex_store->bufferobj); } @@ -265,7 +265,7 @@ vbo_save_playback_vertex_list(struct gl_context *ctx, void *data) vbo_save_loopback_vertex_list( ctx, node ); return; } - + if (ctx->NewState) _mesa_update_state( ctx ); @@ -284,9 +284,9 @@ vbo_save_playback_vertex_list(struct gl_context *ctx, void *data) if (ctx->NewState) _mesa_update_state( ctx ); - vbo_context(ctx)->draw_prims(ctx, - save->inputs, - node->prim, + vbo_context(ctx)->draw_prims(ctx, + save->inputs, + node->prim, node->prim_count, NULL, GL_TRUE, diff --git a/src/mesa/vbo/vbo_save_loopback.c b/src/mesa/vbo/vbo_save_loopback.c index b1cfa9c..aff40ba 100644 --- a/src/mesa/vbo/vbo_save_loopback.c +++ b/src/mesa/vbo/vbo_save_loopback.c @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2005 Tungsten Graphics, Inc., Cedar Park, Texas. * 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. - * + * **************************************************************************/ #include "main/context.h" @@ -101,7 +101,7 @@ static void loopback_prim( struct gl_context *ctx, _mesa_lookup_prim_by_nr(prim->mode), prim->begin ? "begin" : "..", prim->end ? "end" : "..", - start, + start, end); if (prim->begin) { @@ -121,7 +121,7 @@ static void loopback_prim( struct gl_context *ctx, la[k].func( ctx, la[k].target, tmp ); tmp += la[k].sz; } - + /* Fire the vertex */ la[0].func( ctx, VBO_ATTRIB_POS, data ); diff --git a/src/mesa/vbo/vbo_split.c b/src/mesa/vbo/vbo_split.c index 54b2539..330a2d5 100644 --- a/src/mesa/vbo/vbo_split.c +++ b/src/mesa/vbo/vbo_split.c @@ -36,7 +36,7 @@ * * We want buffer splitting to be a convenience function for the code * actually drawing the primitives rather than a system-wide maximum, - * otherwise it is hard to avoid pessimism. + * otherwise it is hard to avoid pessimism. * * For instance, if a driver has no hardware limits on vertex buffer * dimensions, it would not ordinarily want to split vbos. But if diff --git a/src/mesa/vbo/vbo_split_copy.c b/src/mesa/vbo/vbo_split_copy.c index 26d0046..56fe9e1 100644 --- a/src/mesa/vbo/vbo_split_copy.c +++ b/src/mesa/vbo/vbo_split_copy.c @@ -78,7 +78,7 @@ struct copy_context { /** A baby hash table to avoid re-emitting (some) duplicate * vertices when splitting indexed primitives. */ - struct { + struct { GLuint in; GLuint out; } vert_cache[ELT_TABLE_SIZE]; @@ -116,7 +116,7 @@ static GLuint attr_size( const struct gl_client_array *array ) static GLboolean check_flush( struct copy_context *copy ) { - GLenum mode = copy->dstprim[copy->dstprim_nr].mode; + GLenum mode = copy->dstprim[copy->dstprim_nr].mode; if (GL_TRIANGLE_STRIP == mode && copy->dstelt_nr & 1) { /* see bug9962 */ @@ -173,7 +173,7 @@ flush( struct copy_context *copy ) { GLuint i; - /* Set some counters: + /* Set some counters: */ copy->dstib.count = copy->dstelt_nr; @@ -198,7 +198,7 @@ flush( struct copy_context *copy ) 0, copy->dstbuf_nr - 1 ); - /* Reset all pointers: + /* Reset all pointers: */ copy->dstprim_nr = 0; copy->dstelt_nr = 0; @@ -238,7 +238,7 @@ elt(struct copy_context *copy, GLuint elt_idx) /* printf("elt %d\n", elt); */ /* Look up the incoming element in the vertex cache. Re-emit if - * necessary. + * necessary. */ if (copy->vert_cache[slot].in != elt) { GLubyte *csr = copy->dstptr; @@ -264,7 +264,7 @@ elt(struct copy_context *copy, GLuint elt_idx) } #endif - if (0) + if (0) { const GLuint *f = (const GLuint *)srcptr; GLuint j; @@ -285,7 +285,7 @@ elt(struct copy_context *copy, GLuint elt_idx) } /* else */ /* printf(" --> reuse vertex\n"); */ - + /* printf(" --> emit %d\n", copy->vert_cache[slot].out); */ copy->dstelt[copy->dstelt_nr++] = copy->vert_cache[slot].out; return check_flush(copy); @@ -306,7 +306,7 @@ end( struct copy_context *copy, GLboolean end_flag ) prim->count = copy->dstelt_nr - prim->start; if (++copy->dstprim_nr == MAX_PRIM || - check_flush(copy)) + check_flush(copy)) flush(copy); } @@ -323,7 +323,7 @@ replay_elts( struct copy_context *copy ) GLuint first, incr; switch (prim->mode) { - + case GL_LINE_LOOP: /* Convert to linestrip and emit the final vertex explicitly, * but only in the resultant strip that requires it. @@ -340,7 +340,7 @@ replay_elts( struct copy_context *copy ) * it is always raised a bit early so we can emit * the last verts if necessary! */ - if (prim->end) + if (prim->end) (void)elt(copy, start + 0); end(copy, prim->end); @@ -361,10 +361,10 @@ replay_elts( struct copy_context *copy ) while (j != prim->count) { begin(copy, prim->mode, prim->begin && j == 0); - split = elt(copy, start+0); + split = elt(copy, start+0); assert(!split); - split = elt(copy, start+j-1); + split = elt(copy, start+j-1); assert(!split); for (; j != prim->count && !split; j++) @@ -382,7 +382,7 @@ replay_elts( struct copy_context *copy ) default: (void)split_prim_inplace(prim->mode, &first, &incr); - + j = 0; while (j != prim->count) { @@ -436,13 +436,13 @@ replay_init( struct copy_context *copy ) } else { GLuint j = copy->nr_varying++; - + copy->varying[j].attr = i; copy->varying[j].array = copy->array[i]; copy->varying[j].size = attr_size(copy->array[i]); copy->vertex_size += attr_size(copy->array[i]); - - if (_mesa_is_bufferobj(vbo) && !_mesa_bufferobj_mapped(vbo)) + + if (_mesa_is_bufferobj(vbo) && !_mesa_bufferobj_mapped(vbo)) ctx->Driver.MapBuffer(ctx, GL_ARRAY_BUFFER, GL_READ_ONLY, vbo); copy->varying[j].src_ptr = ADD_POINTERS(vbo->Pointer, @@ -457,7 +457,7 @@ replay_init( struct copy_context *copy ) * do it internally. */ if (_mesa_is_bufferobj(copy->ib->obj) && - !_mesa_bufferobj_mapped(copy->ib->obj)) + !_mesa_bufferobj_mapped(copy->ib->obj)) ctx->Driver.MapBuffer(ctx, GL_ELEMENT_ARRAY_BUFFER, GL_READ_ONLY, copy->ib->obj); @@ -500,10 +500,10 @@ replay_init( struct copy_context *copy ) * * XXX: This should be a VBO! */ - copy->dstbuf = malloc(copy->dstbuf_size * copy->vertex_size); + copy->dstbuf = malloc(copy->dstbuf_size * copy->vertex_size); copy->dstptr = copy->dstbuf; - /* Setup new vertex arrays to point into the output buffer: + /* Setup new vertex arrays to point into the output buffer: */ for (offset = 0, i = 0; i < copy->nr_varying; i++) { const struct gl_client_array *src = copy->varying[i].array; @@ -516,7 +516,7 @@ replay_init( struct copy_context *copy ) dst->StrideB = copy->vertex_size; dst->Ptr = copy->dstbuf + offset; dst->Enabled = GL_TRUE; - dst->Normalized = src->Normalized; + dst->Normalized = src->Normalized; dst->BufferObj = ctx->Shared->NullBufferObj; dst->_MaxElement = copy->dstbuf_size; /* may be less! */ @@ -551,17 +551,17 @@ replay_finish( struct copy_context *copy ) struct gl_context *ctx = copy->ctx; GLuint i; - /* Free our vertex and index buffers: + /* Free our vertex and index buffers: */ free(copy->translated_elt_buf); free(copy->dstbuf); free(copy->dstelt); - /* Unmap VBO's + /* Unmap VBO's */ for (i = 0; i < copy->nr_varying; i++) { struct gl_buffer_object *vbo = copy->varying[i].array->BufferObj; - if (_mesa_is_bufferobj(vbo) && _mesa_bufferobj_mapped(vbo)) + if (_mesa_is_bufferobj(vbo) && _mesa_bufferobj_mapped(vbo)) ctx->Driver.UnmapBuffer(ctx, GL_ARRAY_BUFFER, vbo); } diff --git a/src/mesa/vbo/vbo_split_inplace.c b/src/mesa/vbo/vbo_split_inplace.c index 789cf31..46394ff 100644 --- a/src/mesa/vbo/vbo_split_inplace.c +++ b/src/mesa/vbo/vbo_split_inplace.c @@ -65,14 +65,14 @@ static void flush_vertex( struct split_context *split ) struct _mesa_index_buffer ib; GLuint i; - if (!split->dstprim_nr) + if (!split->dstprim_nr) return; if (split->ib) { ib = *split->ib; ib.count = split->max_index - split->min_index + 1; - ib.ptr = (const void *)((const char *)ib.ptr + + ib.ptr = (const void *)((const char *)ib.ptr + split->min_index * _mesa_sizeof_type(ib.type)); /* Rebase the primitives to save index buffer entries. */ @@ -137,7 +137,7 @@ static GLuint get_max_vertices(struct split_context *split, /* Break large primitives into smaller ones. If not possible, convert * the primitive to indexed and pass to split_elts(). */ -static void split_prims( struct split_context *split) +static void split_prims( struct split_context *split) { GLuint i; @@ -156,7 +156,7 @@ static void split_prims( struct split_context *split) flush_vertex(split); available = get_max_vertices(split, prim); } - + if (available >= count) { struct _mesa_prim *outprim = next_outprim(split); @@ -172,7 +172,7 @@ static void split_prims( struct split_context *split) nr = MIN2( available, remaining ); nr -= (nr - first) % incr; - + outprim->mode = prim->mode; outprim->begin = (j == 0 && prim->begin); outprim->end = (nr == remaining && prim->end); @@ -182,12 +182,12 @@ static void split_prims( struct split_context *split) update_index_bounds(split, outprim); if (nr == remaining) { - /* Finished. + /* Finished. */ j += nr; } else { - /* Wrapped the primitive: + /* Wrapped the primitive: */ j += nr - (first - incr); flush_vertex(split); @@ -208,7 +208,7 @@ static void split_prims( struct split_context *split) struct _mesa_prim tmpprim; GLuint *elts = malloc(count * sizeof(GLuint)); GLuint j; - + for (j = 0; j < count; j++) elts[j] = prim->start + j; @@ -216,7 +216,7 @@ static void split_prims( struct split_context *split) ib.type = GL_UNSIGNED_INT; ib.obj = split->ctx->Shared->NullBufferObj; ib.ptr = elts; - + tmpprim = *prim; tmpprim.indexed = 1; tmpprim.start = 0; @@ -226,11 +226,11 @@ static void split_prims( struct split_context *split) vbo_split_copy(split->ctx, split->array, - &tmpprim, 1, + &tmpprim, 1, &ib, split->draw, split->limits); - + free(elts); } else { @@ -238,7 +238,7 @@ static void split_prims( struct split_context *split) vbo_split_copy(split->ctx, split->array, - prim, 1, + prim, 1, split->ib, split->draw, split->limits); diff --git a/src/mesa/x86-64/x86-64.c b/src/mesa/x86-64/x86-64.c index ac176ef..5327561 100644 --- a/src/mesa/x86-64/x86-64.c +++ b/src/mesa/x86-64/x86-64.c @@ -118,7 +118,7 @@ void _mesa_init_all_x86_64_transform_asm(void) } - + #ifdef DEBUG_MATH _math_test_all_transform_functions("x86_64"); _math_test_all_cliptest_functions("x86_64"); diff --git a/src/mesa/x86-64/xform4.S b/src/mesa/x86-64/xform4.S index 6141e43..7eea06b 100644 --- a/src/mesa/x86-64/xform4.S +++ b/src/mesa/x86-64/xform4.S @@ -61,7 +61,7 @@ _mesa_x86_64_transform_points4_general: movl $4, V4F_SIZE(%rdi) /* set dest size */ .byte 0x66, 0x66, 0x66, 0x90 /* manual align += 3 */ orl $VEC_SIZE_4, V4F_FLAGS(%rdi)/* set dest flags */ - + testl %ecx, %ecx /* verify non-zero count */ prefetchnta 64(%rsi) jz p4_general_done @@ -105,7 +105,7 @@ p4_general_loop: p4_general_done: .byte 0xf3 ret - + .section .rodata .align 16 @@ -133,7 +133,7 @@ _mesa_x86_64_transform_points4_3d: leaq p4_constants(%rip), %rax prefetchnta 64(%rsi) - + movaps (%rax), %xmm9 movaps 16(%rax), %xmm10 @@ -143,7 +143,7 @@ _mesa_x86_64_transform_points4_3d: movl %ecx, V4F_COUNT(%rdi) /* set dest count */ movl $4, V4F_SIZE(%rdi) /* set dest size */ orl $VEC_SIZE_4, V4F_FLAGS(%rdi)/* set dest flags */ - + testl %ecx, %ecx /* verify non-zero count */ jz p4_3d_done @@ -204,7 +204,7 @@ _mesa_x86_64_transform_points4_identity: movl %ecx, V4F_COUNT(%rdi) /* set dest count */ movl $4, V4F_SIZE(%rdi) /* set dest size */ orl $VEC_SIZE_4, V4F_FLAGS(%rdi)/* set dest flags */ - + test %ecx, %ecx jz p4_identity_done @@ -221,7 +221,7 @@ p4_identity_done: .byte 0xf3 ret - + .align 16 .globl _mesa_3dnow_transform_points4_3d_no_rot .hidden _mesa_3dnow_transform_points4_3d_no_rot @@ -234,7 +234,7 @@ _mesa_3dnow_transform_points4_3d_no_rot: movl $4, V4F_SIZE(%rdi) /* set dest size */ .byte 0x66, 0x66, 0x90 /* manual align += 3 */ orl $VEC_SIZE_4, V4F_FLAGS(%rdi)/* set dest flags */ - + test %ecx, %ecx .byte 0x66, 0x66, 0x90 /* manual align += 3 */ jz p4_3d_no_rot_done @@ -243,7 +243,7 @@ _mesa_3dnow_transform_points4_3d_no_rot: movq V4F_START(%rdi), %rdi /* ptr to first dest vertex */ prefetch (%rdx) - + movd (%rsi), %mm0 /* | m00 */ .byte 0x66, 0x66, 0x90 /* manual align += 3 */ punpckldq 20(%rsi), %mm0 /* m11 | m00 */ @@ -256,7 +256,7 @@ _mesa_3dnow_transform_points4_3d_no_rot: p4_3d_no_rot_loop: prefetchw 32(%rdi) - + movq (%rdx), %mm4 /* x1 | x0 */ movq 8(%rdx), %mm5 /* x3 | x2 */ movd 12(%rdx), %mm7 /* | x3 */ @@ -277,7 +277,7 @@ p4_3d_no_rot_loop: movq %mm5, 8(%rdi) /* write r2, r3 */ addq $16, %rdi - + decl %ecx prefetch 32(%rdx) jnz p4_3d_no_rot_loop @@ -286,7 +286,7 @@ p4_3d_no_rot_done: femms ret - + .align 16 .globl _mesa_3dnow_transform_points4_perspective .hidden _mesa_3dnow_transform_points4_perspective @@ -298,7 +298,7 @@ _mesa_3dnow_transform_points4_perspective: movl %ecx, V4F_COUNT(%rdi) /* set dest count */ movl $4, V4F_SIZE(%rdi) /* set dest size */ orl $VEC_SIZE_4, V4F_FLAGS(%rdi)/* set dest flags */ - + test %ecx, %ecx .byte 0x66, 0x66, 0x90 /* manual align += 3 */ jz p4_perspective_done @@ -309,10 +309,10 @@ _mesa_3dnow_transform_points4_perspective: movd (%rsi), %mm0 /* | m00 */ pxor %mm7, %mm7 /* 0 | 0 */ punpckldq 20(%rsi), %mm0 /* m11 | m00 */ - + movq 32(%rsi), %mm2 /* m21 | m20 */ prefetch (%rdx) - + movd 40(%rsi), %mm1 /* | m22 */ .byte 0x66, 0x66, 0x90 /* manual align += 3 */ @@ -341,7 +341,7 @@ p4_perspective_loop: pfacc %mm3, %mm6 /* -x2 | x2*m22+x3*m32 */ movq %mm5, (%rdi) /* write r0, r1 */ - addq %rax, %rdx + addq %rax, %rdx movq %mm6, 8(%rdi) /* write r2, r3 */ addq $16, %rdi @@ -365,7 +365,7 @@ _mesa_3dnow_transform_points4_2d_no_rot: movl %ecx, V4F_COUNT(%rdi) /* set dest count */ movl $4, V4F_SIZE(%rdi) /* set dest size */ orl $VEC_SIZE_4, V4F_FLAGS(%rdi)/* set dest flags */ - + test %ecx, %ecx .byte 0x90 /* manual align += 1 */ jz p4_2d_no_rot_done @@ -376,7 +376,7 @@ _mesa_3dnow_transform_points4_2d_no_rot: movd (%rsi), %mm0 /* | m00 */ prefetch (%rdx) punpckldq 20(%rsi), %mm0 /* m11 | m00 */ - + movq 48(%rsi), %mm1 /* m31 | m30 */ p4_2d_no_rot_loop: @@ -391,7 +391,7 @@ p4_2d_no_rot_loop: punpckhdq %mm6, %mm6 /* x3 | x3 */ - addq %rax, %rdx + addq %rax, %rdx pfmul %mm1, %mm6 /* x3*m31 | x3*m30 */ prefetch 32(%rdx) /* hopefully stride is zero */ @@ -409,7 +409,7 @@ p4_2d_no_rot_done: femms ret - + .align 16 .globl _mesa_3dnow_transform_points4_2d .hidden _mesa_3dnow_transform_points4_2d @@ -422,7 +422,7 @@ _mesa_3dnow_transform_points4_2d: movl $4, V4F_SIZE(%rdi) /* set dest size */ .byte 0x66, 0x66, 0x90 /* manual align += 4 */ orl $VEC_SIZE_4, V4F_FLAGS(%rdi)/* set dest flags */ - + test %ecx, %ecx .byte 0x66, 0x66, 0x90 /* manual align += 4 */ jz p4_2d_done @@ -456,7 +456,7 @@ p4_2d_loop: pfmul %mm0, %mm3 /* x1*m10 | x0*m00 */ - addq %rax, %rdx + addq %rax, %rdx pfacc %mm4, %mm3 /* x0*m01+x1*m11 | x0*m00+x1*m10 */ pfmul %mm2, %mm6 /* x3*m31 | x3*m30 */ @@ -475,9 +475,9 @@ p4_2d_loop: p4_2d_done: femms ret - + #endif - + #if defined (__ELF__) && defined (__linux__) .section .note.GNU-stack,"",%progbits #endif diff --git a/src/mesa/x86/3dnow_normal.S b/src/mesa/x86/3dnow_normal.S index 7f5f6b3..1af041a 100644 --- a/src/mesa/x86/3dnow_normal.S +++ b/src/mesa/x86/3dnow_normal.S @@ -399,10 +399,10 @@ ALIGNTEXT32 LLBL (G3TRNR_rescale): PREFETCHW ( REGIND(EAX) ) - + MOVQ ( REGIND(EDX), MM4 ) /* x1 | x0 */ MOVD ( REGOFF(8, EDX), MM5 ) /* | x2 */ - + PFMUL ( MM0, MM4 ) /* x1*m5 | x0*m0 */ ADD_L ( STRIDE, EDX ) /* next normal */ @@ -846,7 +846,7 @@ LLBL (G3R_end): RET #endif - + #if defined (__ELF__) && defined (__linux__) .section .note.GNU-stack,"",%progbits #endif diff --git a/src/mesa/x86/3dnow_xform1.S b/src/mesa/x86/3dnow_xform1.S index a73301a..c9259d8 100644 --- a/src/mesa/x86/3dnow_xform1.S +++ b/src/mesa/x86/3dnow_xform1.S @@ -431,7 +431,7 @@ LLBL( G3TP3R_3 ): RET #endif - + #if defined (__ELF__) && defined (__linux__) .section .note.GNU-stack,"",%progbits #endif diff --git a/src/mesa/x86/3dnow_xform2.S b/src/mesa/x86/3dnow_xform2.S index 2988fb7..4d34c84 100644 --- a/src/mesa/x86/3dnow_xform2.S +++ b/src/mesa/x86/3dnow_xform2.S @@ -471,7 +471,7 @@ LLBL( G3TPIR_4 ): POP_L ( ESI ) RET #endif - + #if defined (__ELF__) && defined (__linux__) .section .note.GNU-stack,"",%progbits #endif diff --git a/src/mesa/x86/3dnow_xform3.S b/src/mesa/x86/3dnow_xform3.S index a356aae..7b086f3 100644 --- a/src/mesa/x86/3dnow_xform3.S +++ b/src/mesa/x86/3dnow_xform3.S @@ -338,7 +338,7 @@ LLBL( G3TP3NRR_1 ): ADD_L ( EDI, EAX ) /* next vertex */ PREFETCHW ( REGIND(EAX) ) - + PFMUL ( MM0, MM4 ) /* x1*m11 | x0*m00 */ PFADD ( MM1, MM4 ) /* x1*m11+m31 | x0*m00+m30 */ @@ -555,7 +555,7 @@ LLBL( G3TPIR_2 ): POP_L ( ESI ) RET #endif - + #if defined (__ELF__) && defined (__linux__) .section .note.GNU-stack,"",%progbits #endif diff --git a/src/mesa/x86/3dnow_xform4.S b/src/mesa/x86/3dnow_xform4.S index b2b7c64..4f33cb6 100644 --- a/src/mesa/x86/3dnow_xform4.S +++ b/src/mesa/x86/3dnow_xform4.S @@ -68,10 +68,10 @@ LLBL( G3TPGR_1 ): MOVQ ( REGIND(EAX), MM0 ) /* x1 | x0 */ MOVQ ( REGOFF(8, EAX), MM4 ) /* x3 | x2 */ - + ADD_L ( EDI, EAX ) /* next vertex */ PREFETCH ( REGIND(EAX) ) - + MOVQ ( MM0, MM2 ) /* x1 | x0 */ MOVQ ( MM4, MM6 ) /* x3 | x2 */ @@ -542,7 +542,7 @@ ALIGNTEXT16 LLBL( G3TPIR_1 ): PREFETCHW ( REGOFF(32, EDX) ) /* prefetch 2 vertices ahead */ - + MOVQ ( REGIND(EAX), MM0 ) /* x1 | x0 */ MOVQ ( REGOFF(8, EAX), MM1 ) /* x3 | x2 */ @@ -564,7 +564,7 @@ LLBL( G3TPIR_2 ): POP_L ( ESI ) RET #endif - + #if defined (__ELF__) && defined (__linux__) .section .note.GNU-stack,"",%progbits #endif diff --git a/src/mesa/x86/common_x86.c b/src/mesa/x86/common_x86.c index b70ee50..6c20e59 100644 --- a/src/mesa/x86/common_x86.c +++ b/src/mesa/x86/common_x86.c @@ -151,10 +151,10 @@ void _mesa_check_os_sse_support( void ) } #elif defined(WIN32) LPTOP_LEVEL_EXCEPTION_FILTER oldFilter; - + /* Install our ExceptionFilter */ oldFilter = SetUnhandledExceptionFilter( ExceptionFilter ); - + if ( cpu_has_xmm ) { _mesa_debug(NULL, "Testing OS support for SSE...\n"); diff --git a/src/mesa/x86/common_x86_asm.S b/src/mesa/x86/common_x86_asm.S index ea4047a..5f2b9f9 100644 --- a/src/mesa/x86/common_x86_asm.S +++ b/src/mesa/x86/common_x86_asm.S @@ -214,7 +214,7 @@ GLNAME( _mesa_test_os_sse_exception_support ): #endif - + #if defined (__ELF__) && defined (__linux__) .section .note.GNU-stack,"",%progbits #endif diff --git a/src/mesa/x86/mmx_blend.S b/src/mesa/x86/mmx_blend.S index eeaf43e..8ff73d9 100644 --- a/src/mesa/x86/mmx_blend.S +++ b/src/mesa/x86/mmx_blend.S @@ -30,7 +30,7 @@ TWO(PSUBW ( MX1, MA2 )) /* a2 + 1 | a2 + 1 | a2 + 1 | a2 + 1 TWO(PMULLW ( MP2, MA2 )) /* t2 = p2*a2 */ ;\ ;\ PSRLW ( CONST(8), MA1 ) /* t1 >> 8 ~= t1/255 */ ;\ -TWO(PSRLW ( CONST(8), MA2 )) /* t2 >> 8 ~= t2/255 */ +TWO(PSRLW ( CONST(8), MA2 )) /* t2 >> 8 ~= t2/255 */ /* integer multiplication - geometric series @@ -43,7 +43,7 @@ TWO(PSRLW ( CONST(8), MA2 )) /* t2 >> 8 ~= t2/255 * * t/255 ~= (t + (t >> 8)) >> 8 * - * note that just by itself it doesn't satisfies the OpenGL criteria, as 255*255 = 254, + * note that just by itself it doesn't satisfies the OpenGL criteria, as 255*255 = 254, * so the special case a = 255 must be accounted or roundoff must be used */ #define GMB_MULT_GS( MP1, MA1, MP2, MA2 ) \ @@ -65,7 +65,7 @@ TWO(PSRLW ( CONST(8), MA2 )) /* sa2 | sb2 | sg2 | sr2 /* integer multiplication - geometric series plus rounding * - * when using a geometric series division instead of truncating the result + * when using a geometric series division instead of truncating the result * use roundoff in the approximation (Jim Blinn) * * t = rgb*a + 0x80 @@ -94,7 +94,7 @@ TWO(PADDW ( MP2, MA2 )) /* t2 + (t2 >> 8) ~= (t2/255) << 8 TWO(PSRLW ( CONST(8), MA2 )) /* sa2 | sb2 | sg2 | sr2 */ -/* linear interpolation - geometric series +/* linear interpolation - geometric series */ #define GMB_LERP_GS( MP1, MQ1, MA1, MP2, MQ2, MA2) \ PSUBW ( MQ1, MP1 ) /* pa1 - qa1 | pb1 - qb1 | pg1 - qg1 | pr1 - qr1 */ ;\ @@ -396,7 +396,7 @@ TWO(MOVQ ( MM1, REGIND(rgba) )) #include "mmx_blendtmp.h" #endif - + #if defined (__ELF__) && defined (__linux__) .section .note.GNU-stack,"",%progbits #endif diff --git a/src/mesa/x86/mmx_blendtmp.h b/src/mesa/x86/mmx_blendtmp.h index 8534792..8981b6c 100644 --- a/src/mesa/x86/mmx_blendtmp.h +++ b/src/mesa/x86/mmx_blendtmp.h @@ -5,11 +5,11 @@ /* * void _mesa_mmx_blend( struct gl_context *ctx, - * GLuint n, + * GLuint n, * const GLubyte mask[], - * GLchan rgba[][4], + * GLchan rgba[][4], * CONST GLchan dest[][4] ) - * + * */ ALIGNTEXT16 GLOBL GLNAME( TAG(_mesa_mmx_blend) ) @@ -31,7 +31,7 @@ GLNAME( TAG(_mesa_mmx_blend) ): MOV_L ( REGOFF(24, EBP), ESI ) /* dest */ INIT - + TEST_L ( CONST(4), EDI ) /* align rgba on an 8-byte boundary */ JZ ( LLTAG(GMB_align_end) ) @@ -40,7 +40,7 @@ GLNAME( TAG(_mesa_mmx_blend) ): /* runin */ #define ONE(x) x -#define TWO(x) +#define TWO(x) MAIN ( EDI, ESI ) #undef ONE #undef TWO @@ -50,7 +50,7 @@ LLTAG(GMB_align_continue): DEC_L ( ECX ) /* n -= 1 */ INC_L ( EBX ) /* mask += 1 */ ADD_L ( CONST(4), EDI ) /* rgba += 1 */ - ADD_L ( CONST(4), ESI ) /* dest += 1 */ + ADD_L ( CONST(4), ESI ) /* dest += 1 */ LLTAG(GMB_align_end): @@ -76,7 +76,7 @@ LLTAG(GMB_loop_continue): DEC_L ( ECX ) /* n -= 2 */ ADD_L ( CONST(2), EBX ) /* mask += 2 */ ADD_L ( CONST(8), EDI ) /* rgba += 2 */ - ADD_L ( CONST(8), ESI ) /* dest += 2 */ + ADD_L ( CONST(8), ESI ) /* dest += 2 */ CMP_L ( CONST(2), ECX ) JAE ( LLTAG(GMB_loop_begin) ) diff --git a/src/mesa/x86/read_rgba_span_x86.S b/src/mesa/x86/read_rgba_span_x86.S index 8177299..1ca040d 100644 --- a/src/mesa/x86/read_rgba_span_x86.S +++ b/src/mesa/x86/read_rgba_span_x86.S @@ -21,7 +21,7 @@ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE * USE OR OTHER DEALINGS IN THE SOFTWARE. */ - + /** * \file read_rgba_span_x86.S * Optimized routines to transfer pixel data from the framebuffer to a @@ -70,7 +70,7 @@ /** * MMX optimized version of the BGRA8888_REV to RGBA copy routine. - * + * * \warning * This function assumes that the caller will issue the EMMS instruction * at the correct places. @@ -221,7 +221,7 @@ _generic_read_RGBA_span_BGRA8888_REV_SSE: movq %mm0, %mm3 movq %mm0, %mm4 - + pand %mm2, %mm3 psllq $16, %mm4 psrlq $16, %mm3 @@ -303,7 +303,7 @@ _generic_read_RGBA_span_BGRA8888_REV_SSE: movq %mm0, %mm3 movq %mm0, %mm4 - + pand %mm2, %mm3 psllq $16, %mm4 psrlq $16, %mm3 @@ -369,7 +369,7 @@ _generic_read_RGBA_span_BGRA8888_REV_SSE2: testl $1, %esi je .L41 - DO_ONE_PIXEL() + DO_ONE_PIXEL() .L41: testl $2, %esi je .L40 @@ -435,7 +435,7 @@ _generic_read_RGBA_span_BGRA8888_REV_SSE2: movq (%ebx), %xmm0 addl $8, %ebx - + movdqa %xmm0, %xmm3 movdqa %xmm0, %xmm4 andps %xmm1, %xmm0 @@ -449,13 +449,13 @@ _generic_read_RGBA_span_BGRA8888_REV_SSE2: orps %xmm3, %xmm0 movq %xmm0, (%ecx) - addl $8, %ecx + addl $8, %ecx .L47: testl $1, %edx je .L46 - DO_ONE_LAST_PIXEL() + DO_ONE_LAST_PIXEL() .L46: popl %ebx @@ -672,7 +672,7 @@ _generic_read_RGBA_span_RGB565_MMX: #endif ret #endif /* !defined(__DJGPP__) && !defined(__MINGW32__) && !defined(__APPLE__) */ - + #if defined (__ELF__) && defined (__linux__) .section .note.GNU-stack,"",%progbits #endif diff --git a/src/mesa/x86/read_rgba_span_x86.h b/src/mesa/x86/read_rgba_span_x86.h index 564b1bb..3b9d5fb 100644 --- a/src/mesa/x86/read_rgba_span_x86.h +++ b/src/mesa/x86/read_rgba_span_x86.h @@ -21,7 +21,7 @@ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE * USE OR OTHER DEALINGS IN THE SOFTWARE. */ - + /** * \file read_rgba_span_x86.h * diff --git a/src/mesa/x86/rtasm/x86sse.c b/src/mesa/x86/rtasm/x86sse.c index c93faba..79242e9 100644 --- a/src/mesa/x86/rtasm/x86sse.c +++ b/src/mesa/x86/rtasm/x86sse.c @@ -86,18 +86,18 @@ static void emit_3ub( struct x86_function *p, unsigned char b0, unsigned char b1 /* Build a modRM byte + possible displacement. No treatment of SIB * indexing. BZZT - no way to encode an absolute address. */ -static void emit_modrm( struct x86_function *p, - struct x86_reg reg, +static void emit_modrm( struct x86_function *p, + struct x86_reg reg, struct x86_reg regmem ) { unsigned char val = 0; - + assert(reg.mod == mod_REG); - + val |= regmem.mod << 6; /* mod field */ val |= reg.idx << 3; /* reg field */ val |= regmem.idx; /* r/m field */ - + emit_1ub(p, val); /* Oh-oh we've stumbled into the SIB thing. @@ -138,11 +138,11 @@ static void emit_modrm_noreg( struct x86_function *p, * the arguments presented. */ static void emit_op_modrm( struct x86_function *p, - unsigned char op_dst_is_reg, + unsigned char op_dst_is_reg, unsigned char op_dst_is_mem, struct x86_reg dst, struct x86_reg src ) -{ +{ switch (dst.mod) { case mod_REG: emit_1ub(p, op_dst_is_reg); @@ -229,7 +229,7 @@ void x86_jcc( struct x86_function *p, unsigned char *label ) { int offset = label - (x86_get_label(p) + 2); - + if (offset <= 127 && offset >= -128) { emit_1ub(p, 0x70 + cc); emit_1b(p, (char) offset); @@ -613,7 +613,7 @@ void sse_cvtps2pi( struct x86_function *p, struct x86_reg dst, struct x86_reg src ) { - assert(dst.file == file_MMX && + assert(dst.file == file_MMX && (src.file == file_XMM || src.mod != mod_REG)); p->need_emms = 1; @@ -629,21 +629,21 @@ void sse_cvtps2pi( struct x86_function *p, void sse_shufps( struct x86_function *p, struct x86_reg dest, struct x86_reg arg0, - unsigned char shuf) + unsigned char shuf) { emit_2ub(p, X86_TWOB, 0xC6); emit_modrm(p, dest, arg0); - emit_1ub(p, shuf); + emit_1ub(p, shuf); } void sse_cmpps( struct x86_function *p, struct x86_reg dest, struct x86_reg arg0, - unsigned char cc) + unsigned char cc) { emit_2ub(p, X86_TWOB, 0xC2); emit_modrm(p, dest, arg0); - emit_1ub(p, cc); + emit_1ub(p, cc); } void sse_pmovmskb( struct x86_function *p, @@ -664,11 +664,11 @@ void sse_pmovmskb( struct x86_function *p, void sse2_pshufd( struct x86_function *p, struct x86_reg dest, struct x86_reg arg0, - unsigned char shuf) + unsigned char shuf) { emit_3ub(p, 0x66, X86_TWOB, 0x70); emit_modrm(p, dest, arg0); - emit_1ub(p, shuf); + emit_1ub(p, shuf); } void sse2_cvttps2dq( struct x86_function *p, @@ -815,9 +815,9 @@ static void x87_arith_op( struct x86_function *p, struct x86_reg dst, struct x86 assert(dst.file == file_x87); if (arg.file == file_x87) { - if (dst.idx == 0) + if (dst.idx == 0) emit_2ub(p, dst0ub0, dst0ub1+arg.idx); - else if (arg.idx == 0) + else if (arg.idx == 0) emit_2ub(p, arg0ub0, arg0ub1+arg.idx); else assert(0); @@ -833,7 +833,7 @@ static void x87_arith_op( struct x86_function *p, struct x86_reg dst, struct x86 void x87_fmul( struct x86_function *p, struct x86_reg dst, struct x86_reg arg ) { - x87_arith_op(p, dst, arg, + x87_arith_op(p, dst, arg, 0xd8, 0xc8, 0xdc, 0xc8, 4); @@ -841,7 +841,7 @@ void x87_fmul( struct x86_function *p, struct x86_reg dst, struct x86_reg arg ) void x87_fsub( struct x86_function *p, struct x86_reg dst, struct x86_reg arg ) { - x87_arith_op(p, dst, arg, + x87_arith_op(p, dst, arg, 0xd8, 0xe0, 0xdc, 0xe8, 4); @@ -849,7 +849,7 @@ void x87_fsub( struct x86_function *p, struct x86_reg dst, struct x86_reg arg ) void x87_fsubr( struct x86_function *p, struct x86_reg dst, struct x86_reg arg ) { - x87_arith_op(p, dst, arg, + x87_arith_op(p, dst, arg, 0xd8, 0xe8, 0xdc, 0xe0, 5); @@ -857,7 +857,7 @@ void x87_fsubr( struct x86_function *p, struct x86_reg dst, struct x86_reg arg ) void x87_fadd( struct x86_function *p, struct x86_reg dst, struct x86_reg arg ) { - x87_arith_op(p, dst, arg, + x87_arith_op(p, dst, arg, 0xd8, 0xc0, 0xdc, 0xc0, 0); @@ -865,7 +865,7 @@ void x87_fadd( struct x86_function *p, struct x86_reg dst, struct x86_reg arg ) void x87_fdiv( struct x86_function *p, struct x86_reg dst, struct x86_reg arg ) { - x87_arith_op(p, dst, arg, + x87_arith_op(p, dst, arg, 0xd8, 0xf0, 0xdc, 0xf8, 6); @@ -873,7 +873,7 @@ void x87_fdiv( struct x86_function *p, struct x86_reg dst, struct x86_reg arg ) void x87_fdivr( struct x86_function *p, struct x86_reg dst, struct x86_reg arg ) { - x87_arith_op(p, dst, arg, + x87_arith_op(p, dst, arg, 0xd8, 0xf8, 0xdc, 0xf0, 7); @@ -1010,7 +1010,7 @@ void x87_fyl2x( struct x86_function *p ) /* st1 = st1 * log2(st0 + 1.0); * pop_stack; * - * A fast operation, with restrictions: -.29 < st0 < .29 + * A fast operation, with restrictions: -.29 < st0 < .29 */ void x87_fyl2xp1( struct x86_function *p ) { @@ -1020,7 +1020,7 @@ void x87_fyl2xp1( struct x86_function *p ) void x87_fld( struct x86_function *p, struct x86_reg arg ) { - if (arg.file == file_x87) + if (arg.file == file_x87) emit_2ub(p, 0xd9, 0xc0 + arg.idx); else { emit_1ub(p, 0xd9); @@ -1030,7 +1030,7 @@ void x87_fld( struct x86_function *p, struct x86_reg arg ) void x87_fst( struct x86_function *p, struct x86_reg dst ) { - if (dst.file == file_x87) + if (dst.file == file_x87) emit_2ub(p, 0xdd, 0xd0 + dst.idx); else { emit_1ub(p, 0xd9); @@ -1040,7 +1040,7 @@ void x87_fst( struct x86_function *p, struct x86_reg dst ) void x87_fstp( struct x86_function *p, struct x86_reg dst ) { - if (dst.file == file_x87) + if (dst.file == file_x87) emit_2ub(p, 0xdd, 0xd8 + dst.idx); else { emit_1ub(p, 0xd9); @@ -1050,7 +1050,7 @@ void x87_fstp( struct x86_function *p, struct x86_reg dst ) void x87_fcom( struct x86_function *p, struct x86_reg dst ) { - if (dst.file == file_x87) + if (dst.file == file_x87) emit_2ub(p, 0xd8, 0xd0 + dst.idx); else { emit_1ub(p, 0xd8); @@ -1060,7 +1060,7 @@ void x87_fcom( struct x86_function *p, struct x86_reg dst ) void x87_fcomp( struct x86_function *p, struct x86_reg dst ) { - if (dst.file == file_x87) + if (dst.file == file_x87) emit_2ub(p, 0xd8, 0xd8 + dst.idx); else { emit_1ub(p, 0xd8); @@ -1074,7 +1074,7 @@ void x87_fnstsw( struct x86_function *p, struct x86_reg dst ) assert(dst.file == file_REG32); if (dst.idx == reg_AX && - dst.mod == mod_REG) + dst.mod == mod_REG) emit_2ub(p, 0xdf, 0xe0); else { emit_1ub(p, 0xdd); @@ -1100,7 +1100,7 @@ void mmx_packssdw( struct x86_function *p, struct x86_reg dst, struct x86_reg src ) { - assert(dst.file == file_MMX && + assert(dst.file == file_MMX && (src.file == file_MMX || src.mod != mod_REG)); p->need_emms = 1; @@ -1113,7 +1113,7 @@ void mmx_packuswb( struct x86_function *p, struct x86_reg dst, struct x86_reg src ) { - assert(dst.file == file_MMX && + assert(dst.file == file_MMX && (src.file == file_MMX || src.mod != mod_REG)); p->need_emms = 1; @@ -1152,7 +1152,7 @@ void mmx_movq( struct x86_function *p, struct x86_reg x86_fn_arg( struct x86_function *p, unsigned arg ) { - return x86_make_disp(x86_make_reg(file_REG32, reg_SP), + return x86_make_disp(x86_make_reg(file_REG32, reg_SP), p->stack_offset + arg * 4); /* ??? */ } diff --git a/src/mesa/x86/sse_normal.S b/src/mesa/x86/sse_normal.S index a8c0d38..9dc30e8 100644 --- a/src/mesa/x86/sse_normal.S +++ b/src/mesa/x86/sse_normal.S @@ -255,7 +255,7 @@ LLBL(K_G3TNNRR_finish): RET #undef FRAME_OFFSET #endif - + #if defined (__ELF__) && defined (__linux__) .section .note.GNU-stack,"",%progbits #endif diff --git a/src/mesa/x86/sse_xform1.S b/src/mesa/x86/sse_xform1.S index 4aa9de6..14afc1a 100644 --- a/src/mesa/x86/sse_xform1.S +++ b/src/mesa/x86/sse_xform1.S @@ -440,7 +440,7 @@ LLBL(K_GTP13P3DR_finish): RET #undef FRAME_OFFSET #endif - + #if defined (__ELF__) && defined (__linux__) .section .note.GNU-stack,"",%progbits #endif diff --git a/src/mesa/x86/sse_xform2.S b/src/mesa/x86/sse_xform2.S index a443dad..b598137 100644 --- a/src/mesa/x86/sse_xform2.S +++ b/src/mesa/x86/sse_xform2.S @@ -460,7 +460,7 @@ LLBL(K_GTP23P3DR_finish): RET #undef FRAME_OFFSET #endif - + #if defined (__ELF__) && defined (__linux__) .section .note.GNU-stack,"",%progbits #endif diff --git a/src/mesa/x86/sse_xform3.S b/src/mesa/x86/sse_xform3.S index 4bc22d8..3a6a129 100644 --- a/src/mesa/x86/sse_xform3.S +++ b/src/mesa/x86/sse_xform3.S @@ -506,7 +506,7 @@ LLBL(K_GTP3P3DR_finish): RET #undef FRAME_OFFSET #endif - + #if defined (__ELF__) && defined (__linux__) .section .note.GNU-stack,"",%progbits #endif diff --git a/src/mesa/x86/sse_xform4.S b/src/mesa/x86/sse_xform4.S index fb1fa74..d790718 100644 --- a/src/mesa/x86/sse_xform4.S +++ b/src/mesa/x86/sse_xform4.S @@ -229,7 +229,7 @@ LLBL( sse_identity_done ): POP_L( ESI ) RET #endif - + #if defined (__ELF__) && defined (__linux__) .section .note.GNU-stack,"",%progbits #endif diff --git a/src/mesa/x86/x86_cliptest.S b/src/mesa/x86/x86_cliptest.S index e413aee..52ef546 100644 --- a/src/mesa/x86/x86_cliptest.S +++ b/src/mesa/x86/x86_cliptest.S @@ -401,7 +401,7 @@ LLBL(ctp4_np_finish): POP_L( ESI ) RET - + #if defined (__ELF__) && defined (__linux__) .section .note.GNU-stack,"",%progbits #endif diff --git a/src/mesa/x86/x86_xform2.S b/src/mesa/x86/x86_xform2.S index 980725e..0548bc9 100644 --- a/src/mesa/x86/x86_xform2.S +++ b/src/mesa/x86/x86_xform2.S @@ -568,7 +568,7 @@ LLBL(x86_p2_ir_done): POP_L( ESI ) RET #undef FRAME_OFFSET - + #if defined (__ELF__) && defined (__linux__) .section .note.GNU-stack,"",%progbits #endif diff --git a/src/mesa/x86/x86_xform3.S b/src/mesa/x86/x86_xform3.S index 1c782f1..d6237b0 100644 --- a/src/mesa/x86/x86_xform3.S +++ b/src/mesa/x86/x86_xform3.S @@ -638,7 +638,7 @@ LLBL(x86_p3_ir_done): POP_L( EDI ) POP_L( ESI ) RET - + #if defined (__ELF__) && defined (__linux__) .section .note.GNU-stack,"",%progbits #endif diff --git a/src/mesa/x86/x86_xform4.S b/src/mesa/x86/x86_xform4.S index 97a8411..ff28b3c 100644 --- a/src/mesa/x86/x86_xform4.S +++ b/src/mesa/x86/x86_xform4.S @@ -671,7 +671,7 @@ LLBL(x86_p4_ir_done): POP_L( EDI ) POP_L( ESI ) RET - + #if defined (__ELF__) && defined (__linux__) .section .note.GNU-stack,"",%progbits #endif