mesa.git
16 years agoCell: choose bilinear vs. nearest filtering according to sampler state
Brian [Mon, 4 Feb 2008 20:23:07 +0000 (13:23 -0700)]
Cell: choose bilinear vs. nearest filtering according to sampler state

16 years agoCell: improved bilinear filtering
Brian [Mon, 4 Feb 2008 20:16:10 +0000 (13:16 -0700)]
Cell: improved bilinear filtering

avoid calling get_tex_tile() if all texels are in same tile

16 years agoCell: implement basic bilinear texture sampler
Brian [Mon, 4 Feb 2008 19:50:42 +0000 (12:50 -0700)]
Cell: implement basic bilinear texture sampler

16 years agoCell: added spu_unpack_color(), spu_pack_R8G8B8A8()
Brian [Mon, 4 Feb 2008 19:50:16 +0000 (12:50 -0700)]
Cell: added spu_unpack_color(), spu_pack_R8G8B8A8()

16 years agoCell: SIMD-ize more of texture sampling
Brian [Mon, 4 Feb 2008 18:02:47 +0000 (11:02 -0700)]
Cell: SIMD-ize more of texture sampling

16 years agoCell: checkpoint: start to SIMD-ize texture sampling
Brian [Mon, 4 Feb 2008 16:54:21 +0000 (09:54 -0700)]
Cell: checkpoint: start to SIMD-ize texture sampling

16 years agoCell: move tile clear code to flush_spans()
Brian [Mon, 4 Feb 2008 15:53:18 +0000 (08:53 -0700)]
Cell: move tile clear code to flush_spans()

16 years agoCell: clamp txmax, tymax in tile_bounding_box()
Brian [Mon, 4 Feb 2008 15:46:44 +0000 (08:46 -0700)]
Cell: clamp txmax, tymax in tile_bounding_box()

Also, added some debug printfs

16 years agoCell: insert some draw_flush() calls
Brian [Mon, 4 Feb 2008 15:45:33 +0000 (08:45 -0700)]
Cell: insert some draw_flush() calls

16 years agoCell: comment about emit_quad() mask
Brian [Fri, 1 Feb 2008 23:54:46 +0000 (16:54 -0700)]
Cell: comment about emit_quad() mask

16 years agoCell: move some tile get/clear code
Brian [Fri, 1 Feb 2008 23:42:09 +0000 (16:42 -0700)]
Cell: move some tile get/clear code

Also, we weren't marking the ztile as dirty after ztesting, fixes gears glitches.

16 years agoCell: use global color_shuffle to remove a switch stmnt
Brian [Fri, 1 Feb 2008 23:25:42 +0000 (16:25 -0700)]
Cell: use global color_shuffle to remove a switch stmnt

16 years agoCell: New color packing functions (A8R8G8B8 and B8G8R8A8)
Brian [Fri, 1 Feb 2008 22:45:02 +0000 (15:45 -0700)]
Cell: New color packing functions (A8R8G8B8 and B8G8R8A8)

16 years agoCell: rename/move global vars
Brian [Fri, 1 Feb 2008 22:33:53 +0000 (15:33 -0700)]
Cell: rename/move global vars

Put tile-related globals into spu_global struct.
Rename c/ztile fields to be more consistant.

16 years agoCell: deprecate some use of struct cell_command - it should go away completely
Brian [Fri, 1 Feb 2008 22:24:00 +0000 (15:24 -0700)]
Cell: deprecate some use of struct cell_command - it should go away completely

Also, remove ALIGN16_ATTRIB from structs that no longer need it.

16 years agoCell: remove commands from top-level while loop which should only appear in batch...
Brian [Fri, 1 Feb 2008 22:20:07 +0000 (15:20 -0700)]
Cell: remove commands from top-level while loop which should only appear in batch buffers

16 years agoCell: move ztest before color interp/packing
Brian [Fri, 1 Feb 2008 21:02:22 +0000 (14:02 -0700)]
Cell: move ztest before color interp/packing

16 years agoCell: rename fields of the tile_t union
Brian [Fri, 1 Feb 2008 20:49:51 +0000 (13:49 -0700)]
Cell: rename fields of the tile_t union

16 years agoCell: implement Z16 and Z32 testing with SIMD instructions.
Brian [Fri, 1 Feb 2008 20:45:58 +0000 (13:45 -0700)]
Cell: implement Z16 and Z32 testing with SIMD instructions.

16 years agoCell: store current tile status in cur_tile_status_c/z, add TILE_STATUS_GETTING
Brian [Fri, 1 Feb 2008 16:27:57 +0000 (09:27 -0700)]
Cell: store current tile status in cur_tile_status_c/z, add TILE_STATUS_GETTING

16 years agoFix using "ccache ppu-gcc" for CC and fix parallel builds
Ian Romanick [Fri, 1 Feb 2008 01:22:07 +0000 (17:22 -0800)]
Fix using "ccache ppu-gcc" for CC and fix parallel builds

CC wasn't quoted in a couple places in src/mesa/Makefile.  Also, the
OSMesa link was missing a dependency.

16 years agofix typo
Brian [Fri, 1 Feb 2008 00:05:43 +0000 (17:05 -0700)]
fix typo

16 years agogallium: fix problem in which texcoords and varying vars got mapped to the same slot
Brian [Thu, 31 Jan 2008 21:35:25 +0000 (14:35 -0700)]
gallium: fix problem in which texcoords and varying vars got mapped to the same slot

This fixes the glsl/bump.c and glsl/texdemo1.c programs

16 years agoFix problem in mapping vertex program outputs (found with "spring" game engine)
Brian [Thu, 31 Jan 2008 21:05:04 +0000 (14:05 -0700)]
Fix problem in mapping vertex program outputs (found with "spring" game engine)

If the vertex program writes to an output that's not consumed by the
fragment program, map the vp output to an unused slot.

16 years agogallium: comments about fragment Z computation
Brian [Thu, 31 Jan 2008 20:37:01 +0000 (13:37 -0700)]
gallium: comments about fragment Z computation

16 years agogallium: Fix z clear bug when TILE_CLEAR_OPTIMIZATION==0
Brian [Thu, 31 Jan 2008 20:36:00 +0000 (13:36 -0700)]
gallium: Fix z clear bug when TILE_CLEAR_OPTIMIZATION==0

16 years agogallium: fix get/put typo regression
Brian [Thu, 31 Jan 2008 20:32:29 +0000 (13:32 -0700)]
gallium: fix get/put typo regression

This came from commit f3aa4de034b0d791ce2e38e8aeb3b3abdb4e3b50 on 1/22/08.
Fixes strange Z buffer glitches seen in progs/glsl/texdemo1.c

16 years agoCell: SIMD-ize const_coeff()
Brian [Thu, 31 Jan 2008 15:21:38 +0000 (08:21 -0700)]
Cell: SIMD-ize const_coeff()

16 years agoCell: set GALLIUM_CELL_VS env var to enable SPU-based vertex transformation
Brian [Thu, 31 Jan 2008 15:12:47 +0000 (08:12 -0700)]
Cell: set GALLIUM_CELL_VS env var to enable SPU-based vertex transformation

16 years agotgsi: Use ESI instead of EBX as temp reg on non-win32
Keith Whitwell [Thu, 31 Jan 2008 11:57:15 +0000 (11:57 +0000)]
tgsi: Use ESI instead of EBX as temp reg on non-win32

16 years agogallium: Portability fixes.
José Fonseca [Thu, 31 Jan 2008 05:26:39 +0000 (14:26 +0900)]
gallium: Portability fixes.

16 years agogallium: Make the build output dir depend on the configuration.
José Fonseca [Thu, 31 Jan 2008 05:21:49 +0000 (14:21 +0900)]
gallium: Make the build output dir depend on the configuration.

The build output dirs mimics the old config names:

  build/linux
  build/linux-dri
  build/linux-dri-x86
  build/linux-dri-x86-debug
  ...

16 years agogallium: Add SCons as alternative build system for Gallium.
José Fonseca [Thu, 31 Jan 2008 04:14:35 +0000 (13:14 +0900)]
gallium: Add SCons as alternative build system for Gallium.

16 years agoI don't know why using uint64_t for "base" doesn't work. Ugh.
Ian Romanick [Thu, 31 Jan 2008 04:14:14 +0000 (20:14 -0800)]
I don't know why using uint64_t for "base" doesn't work.  Ugh.

16 years agoUse SPUs for vertex shader processing
Ian Romanick [Thu, 31 Jan 2008 04:12:00 +0000 (20:12 -0800)]
Use SPUs for vertex shader processing

16 years agoAdd driver_private field for drivers that hook shader_queue_flush.
Ian Romanick [Thu, 31 Jan 2008 04:10:45 +0000 (20:10 -0800)]
Add driver_private field for drivers that hook shader_queue_flush.

16 years agoNumerous small fixed to PPU-SPU vertex shader protocol
Ian Romanick [Thu, 31 Jan 2008 03:40:24 +0000 (19:40 -0800)]
Numerous small fixed to PPU-SPU vertex shader protocol

16 years agocell_array_info should not be 16-byte aligned
Ian Romanick [Thu, 31 Jan 2008 03:34:22 +0000 (19:34 -0800)]
cell_array_info should not be 16-byte aligned

Forcing cell_array_info to be 16-byte aligned makes it more difficult
to stuff that state in batch commands.

16 years agoCorrectly read / write vertex header from / to main memory
Ian Romanick [Thu, 31 Jan 2008 03:33:30 +0000 (19:33 -0800)]
Correctly read / write vertex header from / to main memory

16 years agoHandle CELL_CMD_VS_EXECUTE *only* outside batch commands.
Ian Romanick [Thu, 31 Jan 2008 03:30:15 +0000 (19:30 -0800)]
Handle CELL_CMD_VS_EXECUTE *only* outside batch commands.

16 years agoSet machine->Processor
Ian Romanick [Thu, 31 Jan 2008 03:25:47 +0000 (19:25 -0800)]
Set machine->Processor

The default value is 0, which is TGSI_PROCESSOR_FRAGMENT...not correct
for a vertex shader!

16 years agoElts are always ints, pass vOut pointers in-line in command
Ian Romanick [Thu, 31 Jan 2008 03:24:40 +0000 (19:24 -0800)]
Elts are always ints, pass vOut pointers in-line in command

16 years agoImplement micro_pow and micro_sqrt
Ian Romanick [Thu, 31 Jan 2008 01:28:48 +0000 (17:28 -0800)]
Implement micro_pow and micro_sqrt

Unimplemented micro ops get assertions for now.

16 years agoFix size calculation in attribute fetch.
Ian Romanick [Thu, 31 Jan 2008 01:26:22 +0000 (17:26 -0800)]
Fix size calculation in attribute fetch.

16 years agoFetch uniforms from main memory.
Ian Romanick [Wed, 30 Jan 2008 20:59:09 +0000 (12:59 -0800)]
Fetch uniforms from main memory.

16 years agoMissing amperstand in previous commit. Oops.
Ian Romanick [Wed, 30 Jan 2008 18:46:55 +0000 (10:46 -0800)]
Missing amperstand in previous commit.  Oops.

16 years agoPass ptr to local memory copy instead of main memory to exec_instruction
Ian Romanick [Wed, 30 Jan 2008 18:43:23 +0000 (10:43 -0800)]
Pass ptr to local memory copy instead of main memory to exec_instruction

This was essentially a cut-and-paste bug when the instruction fetcher
was added.  Also, the test for TGSI_PROCESSOR_FRAGMENT was moved
outside the loop for exec_declaration.

16 years agoProvide mechanism to hook in custom vertex shader cache flush function
Ian Romanick [Tue, 29 Jan 2008 19:43:04 +0000 (11:43 -0800)]
Provide mechanism to hook in custom vertex shader cache flush function

16 years agoImplement vertex fetch / vertex shader output write-back
Ian Romanick [Tue, 29 Jan 2008 19:28:06 +0000 (11:28 -0800)]
Implement vertex fetch / vertex shader output write-back

16 years agoInitial pass at instruction / declaration fetch
Ian Romanick [Tue, 29 Jan 2008 18:56:53 +0000 (10:56 -0800)]
Initial pass at instruction / declaration fetch

16 years agoInitial pass at vertex shader on SPU using TGSI VM
Ian Romanick [Tue, 29 Jan 2008 18:37:18 +0000 (10:37 -0800)]
Initial pass at vertex shader on SPU using TGSI VM

All of the code is wired in on the SPU side, but it is not called from
the PPU yet.  Instruction / declaration fetch still needs to be
implemented in spu_exec.c.

16 years agoCell: prototype SIMD code for z testing
Brian [Thu, 31 Jan 2008 03:40:26 +0000 (20:40 -0700)]
Cell: prototype SIMD code for z testing

16 years agoCell: start to SIMD-ize triangle attribute interpolation
Brian [Wed, 30 Jan 2008 22:26:51 +0000 (15:26 -0700)]
Cell: start to SIMD-ize triangle attribute interpolation

Using the spu_add(), etc intrinsics.
About a 15% speed-up with some tests.

16 years agoCell: fold setup_tri() into tri_draw()
Brian [Wed, 30 Jan 2008 19:13:04 +0000 (12:13 -0700)]
Cell: fold setup_tri() into tri_draw()

16 years agoCell: make 'setup' a regular var instead of passing around a pointer everywhere
Brian [Wed, 30 Jan 2008 19:08:23 +0000 (12:08 -0700)]
Cell: make 'setup' a regular var instead of passing around a pointer everywhere

We'll never have more than one of these objects.
Avoiding pointer deref improves performance a bit.

16 years agoCell: minor code refactoring, movement
Brian [Wed, 30 Jan 2008 18:56:41 +0000 (11:56 -0700)]
Cell: minor code refactoring, movement

16 years agoCell: check tile status before wait_on_mask()
Brian [Wed, 30 Jan 2008 18:56:14 +0000 (11:56 -0700)]
Cell: check tile status before wait_on_mask()

16 years agoCell: make wait_on_mask() static/inlined
Brian [Wed, 30 Jan 2008 18:49:51 +0000 (11:49 -0700)]
Cell: make wait_on_mask() static/inlined

16 years agoCell: move CELL_MAX_SPUS
Brian [Wed, 30 Jan 2008 18:49:26 +0000 (11:49 -0700)]
Cell: move CELL_MAX_SPUS

16 years agogallium: Teach draw_vf about draw vertices.
José Fonseca [Wed, 30 Jan 2008 07:46:41 +0000 (16:46 +0900)]
gallium: Teach draw_vf about draw vertices.

This reduces the emit overhead, which is significant since we're
emiting one vertex at a time.

16 years agogallium: Remove draw_vertex_fetch::lookup.
José Fonseca [Wed, 30 Jan 2008 06:24:56 +0000 (15:24 +0900)]
gallium: Remove draw_vertex_fetch::lookup.

It is not being used, and would be dangerous to use given the possibility of constants.

16 years agogallium: Fix build on WinXP.
Michal Krol [Tue, 29 Jan 2008 15:41:10 +0000 (16:41 +0100)]
gallium: Fix build on WinXP.

16 years agoCell: use _pack_rgba8() from pack_rgba8.h to do float[4]->uint color conversion
Brian [Tue, 29 Jan 2008 18:22:57 +0000 (11:22 -0700)]
Cell: use _pack_rgba8() from pack_rgba8.h to do float[4]->uint color conversion

texcyl.c is twice as fast now in non-texture mode

16 years agogallium: weaken assert slightly
Keith Whitwell [Tue, 29 Jan 2008 15:17:56 +0000 (15:17 +0000)]
gallium: weaken assert slightly

16 years agogallium: streamline various unfilled & stippled paths
Keith Whitwell [Tue, 29 Jan 2008 12:37:47 +0000 (12:37 +0000)]
gallium: streamline various unfilled & stippled paths

16 years agogallium: don't rely on assert(0) for error handling - may be disabled
Keith Whitwell [Tue, 29 Jan 2008 12:37:07 +0000 (12:37 +0000)]
gallium: don't rely on assert(0) for error handling - may be disabled

16 years agogallium: Emit point size as a constant.
José Fonseca [Tue, 29 Jan 2008 11:47:30 +0000 (20:47 +0900)]
gallium: Emit point size as a constant.

16 years agogallium: Emit constants.
José Fonseca [Tue, 29 Jan 2008 11:46:48 +0000 (20:46 +0900)]
gallium: Emit constants.

16 years agogallium: Allow draw_vf usage to be controlled at runtime.
José Fonseca [Tue, 29 Jan 2008 09:01:17 +0000 (18:01 +0900)]
gallium: Allow draw_vf usage to be controlled at runtime.

16 years agogallium: Add extern keyword to global.
José Fonseca [Tue, 29 Jan 2008 02:21:29 +0000 (11:21 +0900)]
gallium: Add extern keyword to global.

16 years agoCell: add OPT_FLAGS var
Brian [Tue, 29 Jan 2008 01:17:55 +0000 (18:17 -0700)]
Cell: add OPT_FLAGS var

16 years agoCell: move cmd_render() into new spu_render.c file
Brian [Tue, 29 Jan 2008 01:17:30 +0000 (18:17 -0700)]
Cell: move cmd_render() into new spu_render.c file

16 years agoCell: add a few null texture tests
Brian [Tue, 29 Jan 2008 01:09:16 +0000 (18:09 -0700)]
Cell: add a few null texture tests

16 years agoCell: compute min index referenced in draw command, use it to reduce size of vertex...
Brian [Tue, 29 Jan 2008 01:03:45 +0000 (18:03 -0700)]
Cell: compute min index referenced in draw command, use it to reduce size of vertex data payload

16 years agoCell: minor optimization for flat shading
Brian [Tue, 29 Jan 2008 00:32:23 +0000 (17:32 -0700)]
Cell: minor optimization for flat shading

16 years agoCell: basic texture mapping
Brian [Tue, 29 Jan 2008 00:23:44 +0000 (17:23 -0700)]
Cell: basic texture mapping

Texture images are tiled in PPU code.  SPUs use a texture cache for getting
texels from textures.
This is very rough code, but demos/texcyl.c works.

16 years agoCell: initial texture cache/sampling code
Brian [Tue, 29 Jan 2008 00:22:12 +0000 (17:22 -0700)]
Cell: initial texture cache/sampling code

16 years agoCell: emit state in cell_clear_surface() if dirty.
Brian [Mon, 28 Jan 2008 20:02:11 +0000 (13:02 -0700)]
Cell: emit state in cell_clear_surface() if dirty.

Without this a program that does nothing but glClear() doesn't work.  We need
the framebuffer state.

16 years agoCell: re-enable bounding boxes
Brian [Mon, 28 Jan 2008 19:46:05 +0000 (12:46 -0700)]
Cell: re-enable bounding boxes

The geometry bounding box is used to restrict rasterization to just those
tiles that are relevant.
Note another dummy field had to be added to the cell_command_render struct.
Apparently, every 4th word in a struct is susceptible to corruption in some
circumstances.  Might be a compiler bug.

16 years agogallium: Use GALLIUM_ prefix for env vars.
José Fonseca [Tue, 29 Jan 2008 00:42:03 +0000 (09:42 +0900)]
gallium: Use GALLIUM_ prefix for env vars.

16 years agogallium: Use CALLOC for pb_buffer to ensure that all fields of pipe_buffer are initia...
José Fonseca [Tue, 29 Jan 2008 00:41:21 +0000 (09:41 +0900)]
gallium: Use CALLOC for pb_buffer to ensure that all fields of pipe_buffer are initiallized.

16 years agogallium: Remove direct dependencies to mesa internals.
José Fonseca [Tue, 29 Jan 2008 00:34:09 +0000 (09:34 +0900)]
gallium: Remove direct dependencies to mesa internals.

_mesa_exec_free is still being called. More invasive refactoring is necessary to clean it out.

16 years agogallium: remove dead vars, code
Keith Whitwell [Mon, 28 Jan 2008 20:57:58 +0000 (20:57 +0000)]
gallium: remove dead vars, code

16 years agogallium: fix typos in hardwired fetch path
Keith Whitwell [Mon, 28 Jan 2008 20:57:16 +0000 (20:57 +0000)]
gallium: fix typos in hardwired fetch path

16 years agopush out far clip plane to 200
Brian [Mon, 28 Jan 2008 19:41:47 +0000 (12:41 -0700)]
push out far clip plane to 200

16 years agoAdded d/D keys to change viewing distance, 'a' to toggle animation
Brian [Mon, 28 Jan 2008 19:35:20 +0000 (12:35 -0700)]
Added d/D keys to change viewing distance, 'a' to toggle animation

16 years agoCell: additional assertions
Brian [Mon, 28 Jan 2008 18:21:25 +0000 (11:21 -0700)]
Cell: additional assertions

16 years agoCell: make sure state commands aren't split across batches
Brian [Mon, 28 Jan 2008 18:20:47 +0000 (11:20 -0700)]
Cell: make sure state commands aren't split across batches

16 years agoCell: remove unneeded flush(), dead code
Brian [Mon, 28 Jan 2008 17:41:51 +0000 (10:41 -0700)]
Cell: remove unneeded flush(), dead code

16 years agoCell: clean-up of render path
Brian [Mon, 28 Jan 2008 17:41:27 +0000 (10:41 -0700)]
Cell: clean-up of render path

Finally removed a number of unneeded flush commands.  Vertex buffers are
allocated from the general buffer pool, freed by SPUs when done.
Still an occasional failed assertion (invalid batch buffer command)...

16 years agoCell: checkpoint commit: always inline prim indexes into batch buffer
Brian [Mon, 28 Jan 2008 17:00:27 +0000 (10:00 -0700)]
Cell: checkpoint commit: always inline prim indexes into batch buffer

Also, explicit release-vertex-buffer command.
Lots of debug/stale code still in place...

16 years agoCell: If flushing for swapbuffers, wait for frame completion
Brian [Mon, 28 Jan 2008 16:57:51 +0000 (09:57 -0700)]
Cell: If flushing for swapbuffers, wait for frame completion

16 years agoCell: additional debug code, misc clean-up
Brian [Mon, 28 Jan 2008 16:57:13 +0000 (09:57 -0700)]
Cell: additional debug code, misc clean-up

16 years agoCell: generalize the batch buffer code for vertex buffers...
Brian [Sun, 27 Jan 2008 19:01:47 +0000 (12:01 -0700)]
Cell: generalize the batch buffer code for vertex buffers...

16 years agogallium: check if surface has defined status in check_clear_depth_with_quad()
Brian [Mon, 28 Jan 2008 16:23:29 +0000 (09:23 -0700)]
gallium: check if surface has defined status in check_clear_depth_with_quad()

This was part of Keith's patch from Friday.

16 years agogallium: handle flatshading explicitly in clipper stage
Keith Whitwell [Mon, 28 Jan 2008 15:50:02 +0000 (15:50 +0000)]
gallium: handle flatshading explicitly in clipper stage

We can do a better job in the clip stage than just relying on the
brute-force approach of copying colors to all incoming vertices applied
in the flatshade stage.

At very least, it is only necessary to do this in the clipper when a
primitive is actually being clipped.

16 years agogallium: add a couple of hardwired vertex fetch functions
Keith Whitwell [Mon, 28 Jan 2008 12:40:29 +0000 (12:40 +0000)]
gallium: add a couple of hardwired vertex fetch functions

16 years agogallium: only call vertex/prim queue flush when there is something to flush
Keith Whitwell [Mon, 28 Jan 2008 11:12:11 +0000 (11:12 +0000)]
gallium: only call vertex/prim queue flush when there is something to flush

16 years agogallium: explictly cast double to float in vertex fetch
Keith Whitwell [Mon, 28 Jan 2008 10:48:22 +0000 (10:48 +0000)]
gallium: explictly cast double to float in vertex fetch

16 years agogallium: fill in missing formats for vertex_fetch
Keith Whitwell [Mon, 28 Jan 2008 10:46:52 +0000 (10:46 +0000)]
gallium: fill in missing formats for vertex_fetch