mesa.git
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

16 years agogallium: remove dead code from draw_vf*
Keith Whitwell [Mon, 28 Jan 2008 10:14:13 +0000 (10:14 +0000)]
gallium: remove dead code from draw_vf*

16 years agoFirst stab at hooking draw_vbuf & vf.
José Fonseca [Mon, 28 Jan 2008 09:46:21 +0000 (18:46 +0900)]
First stab at hooking draw_vbuf & vf.

Emit disabled for now. Tested with softpipe. Only one vertex at a time for now (slow).

16 years agoClone vf module.
José Fonseca [Mon, 28 Jan 2008 06:48:51 +0000 (15:48 +0900)]
Clone vf module.

16 years agoSimplify prototypes of draw_vbuf's internal functions.
José Fonseca [Mon, 28 Jan 2008 06:00:08 +0000 (15:00 +0900)]
Simplify prototypes of draw_vbuf's internal functions.

16 years agoCache the vinfo in vbuf_stage.
José Fonseca [Mon, 28 Jan 2008 05:51:14 +0000 (14:51 +0900)]
Cache the vinfo in vbuf_stage.

16 years agoDo refcounting trhoughout all buffer objects, since it is now a base requirement.
José Fonseca [Sun, 27 Jan 2008 10:22:25 +0000 (19:22 +0900)]
Do refcounting trhoughout all buffer objects, since it is now a base requirement.

16 years agoFullfill pipe_winsys->user_buffer_create. Aggregate winsys functions.
José Fonseca [Sun, 27 Jan 2008 10:20:48 +0000 (19:20 +0900)]
Fullfill pipe_winsys->user_buffer_create. Aggregate winsys functions.

16 years agoCell: added support for inlined vertex buffers.
Brian [Sun, 27 Jan 2008 02:38:16 +0000 (19:38 -0700)]
Cell: added support for inlined vertex buffers.

Small prims are now self-contained in batch buffers when space allows.

16 years agoCell: added ROUNUP4
Brian [Sun, 27 Jan 2008 02:31:20 +0000 (19:31 -0700)]
Cell: added ROUNUP4

16 years agoCell: added support for inlined indexes
Brian [Sun, 27 Jan 2008 01:30:44 +0000 (18:30 -0700)]
Cell: added support for inlined indexes

If there's room in the batch buffer after the rendering command to accomodate
the indexes, put them there rather than in a separate buffer.

16 years agoCell: added cell_batch_free_space()
Brian [Sun, 27 Jan 2008 01:27:37 +0000 (18:27 -0700)]
Cell: added cell_batch_free_space()

16 years agogallium: disable unnecessary point/line/tri re-validation in vbuf_flush_indices()
Brian [Sat, 26 Jan 2008 23:46:52 +0000 (16:46 -0700)]
gallium: disable unnecessary point/line/tri re-validation in vbuf_flush_indices()

16 years agoCell: remove some old tile code
Brian [Sat, 26 Jan 2008 23:06:26 +0000 (16:06 -0700)]
Cell: remove some old tile code

16 years agogallium: s/GLuint/unsigned/ to work with gallium when THREADS not defined
Brian [Sat, 26 Jan 2008 23:05:35 +0000 (16:05 -0700)]
gallium: s/GLuint/unsigned/ to work with gallium when THREADS not defined

16 years agogallium: fix a few segfaults/assertions that can happen during context init
Brian [Sat, 26 Jan 2008 23:04:47 +0000 (16:04 -0700)]
gallium: fix a few segfaults/assertions that can happen during context init

16 years agoCell: fix a recursive flushing bug
Brian [Sat, 26 Jan 2008 21:14:56 +0000 (14:14 -0700)]
Cell: fix a recursive flushing bug

16 years agoCell: add check to catch recursive batch flushing
Brian [Sat, 26 Jan 2008 21:12:33 +0000 (14:12 -0700)]
Cell: add check to catch recursive batch flushing

16 years agoCell: move ASSERT macro into common.h
Brian [Sat, 26 Jan 2008 21:11:50 +0000 (14:11 -0700)]
Cell: move ASSERT macro into common.h

16 years agogallium: Aggregate all buffer allocation info into a single struct. Obey requested...
José Fonseca [Thu, 17 Jan 2008 08:06:16 +0000 (17:06 +0900)]
gallium: Aggregate all buffer allocation info into a single struct. Obey requested alignment.

16 years agogallium: Make mm buffer manager more portable.
José Fonseca [Fri, 25 Jan 2008 09:38:25 +0000 (18:38 +0900)]
gallium: Make mm buffer manager more portable.

16 years agogallium: Remove unneeded headers.
José Fonseca [Fri, 25 Jan 2008 09:37:41 +0000 (18:37 +0900)]
gallium: Remove unneeded headers.

16 years agogallium: fix linux build
Keith Whitwell [Thu, 24 Jan 2008 11:09:07 +0000 (11:09 +0000)]
gallium: fix linux build

16 years agogallium: Fix build on Windows.
Michal Krol [Wed, 23 Jan 2008 14:47:10 +0000 (15:47 +0100)]
gallium: Fix build on Windows.

16 years agod3d: Fix build on Windows.
Michal Krol [Wed, 23 Jan 2008 14:47:10 +0000 (15:47 +0100)]
d3d: Fix build on Windows.

16 years agogallium: Fix build on WinXP.
Michal Krol [Sun, 20 Jan 2008 20:33:35 +0000 (21:33 +0100)]
gallium: Fix build on WinXP.

16 years agogallium: Use directory name in include.
José Fonseca [Mon, 21 Jan 2008 15:13:50 +0000 (00:13 +0900)]
gallium: Use directory name in include.

16 years agogallium: Fix build for WinXP.
Michal Krol [Sun, 20 Jan 2008 18:36:23 +0000 (19:36 +0100)]
gallium: Fix build for WinXP.

16 years agogallium: Define MALLOC_STRUCT.
José Fonseca [Fri, 25 Jan 2008 10:33:58 +0000 (19:33 +0900)]
gallium: Define MALLOC_STRUCT.

16 years agogallium: Fix build on Windows.
Michal Krol [Thu, 24 Jan 2008 17:15:30 +0000 (18:15 +0100)]
gallium: Fix build on Windows.

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

16 years agogallium: restructure vertex fetch code slightly
Keith Whitwell [Thu, 24 Jan 2008 11:19:06 +0000 (11:19 +0000)]
gallium: restructure vertex fetch code slightly

16 years agogallium: Fix MSVC float/double conversion warning.
José Fonseca [Thu, 24 Jan 2008 10:40:14 +0000 (19:40 +0900)]
gallium: Fix MSVC float/double conversion warning.

16 years agogallium: Complete integer types.
José Fonseca [Thu, 24 Jan 2008 10:37:37 +0000 (19:37 +0900)]
gallium: Complete integer types.

16 years agogallium: minor cleanups to pipe interface
Keith Whitwell [Tue, 22 Jan 2008 14:38:36 +0000 (14:38 +0000)]
gallium: minor cleanups to pipe interface

- Remove put/get tile, just have users call put_tile_raw, etc directly.
- Remove surface_data call, just map it locally.

16 years agogallium: add PIPE_FLUSH_SWAPBUFFERS flag
Keith Whitwell [Mon, 21 Jan 2008 20:25:19 +0000 (20:25 +0000)]
gallium: add PIPE_FLUSH_SWAPBUFFERS flag

16 years agogallium: add notify_swapbuffers_complete, use it to set surfaces to undefined state
Keith Whitwell [Mon, 21 Jan 2008 20:23:32 +0000 (20:23 +0000)]
gallium: add notify_swapbuffers_complete, use it to set surfaces to undefined state

16 years agogallium: specialize glFlush vs other flush semantics
Keith Whitwell [Mon, 21 Jan 2008 20:22:49 +0000 (20:22 +0000)]
gallium: specialize glFlush vs other flush semantics

16 years agogallium: remove makefile whitespace
Keith Whitwell [Fri, 18 Jan 2008 17:30:21 +0000 (17:30 +0000)]
gallium: remove makefile whitespace

16 years agoCell: updates to match pipe_buffer changes
Brian [Sat, 26 Jan 2008 00:34:22 +0000 (17:34 -0700)]
Cell: updates to match pipe_buffer changes

16 years agoCell: typedefs need semicolons, Ian :)
Brian [Sat, 26 Jan 2008 00:34:04 +0000 (17:34 -0700)]
Cell: typedefs need semicolons, Ian :)

16 years agoCell: emit framebuffer state like other state
Brian [Fri, 25 Jan 2008 16:01:36 +0000 (09:01 -0700)]
Cell: emit framebuffer state like other state

Plus misc clean-up.  Window resize sometimes works now.

16 years agogallium: replace loop w/ memset in draw_vertex_cache_invalidate()
Brian [Sat, 26 Jan 2008 00:22:02 +0000 (17:22 -0700)]
gallium: replace loop w/ memset in draw_vertex_cache_invalidate()

16 years agogallium: better flush logic in draw module
Brian [Sat, 26 Jan 2008 00:21:05 +0000 (17:21 -0700)]
gallium: better flush logic in draw module

This is the other half of Keith's draw/flush patch.

There are now 5 flush flags to control what's flushed (post-xform vertex
cache, prim cache, vbuf, etc).

The gears slow-down in this part of the patch was due to the cull stage not
getting invoked.  It was unconditional before, but is now gated by 'need_det'.
But it also needs to be gated by draw->rasterizer->cull_mode.  Gears uses
back-face culling.

16 years agogallium: replace prim pipeline begin/end() functions with flush()
Brian [Fri, 25 Jan 2008 22:59:27 +0000 (15:59 -0700)]
gallium: replace prim pipeline begin/end() functions with flush()

This is basically half of Keith's draw/flush patch.

The stage->point/line/tri() functions are now self-validating, the validator
functions are installed by the flush() function.

There were excessive calls to validate_pipeline(), however.  This was caused
by draw_prim_queue_flush() keeping a local 'first' variable that always pointed
to the validate functions.  Replaced 'first' with 'draw->pipeline.first'.

Performance in gears is up just slightly with this patch.

16 years agoWork around parameter differences for main in different SDK versions
Ian Romanick [Fri, 25 Jan 2008 22:46:43 +0000 (14:46 -0800)]
Work around parameter differences for main in different SDK versions

16 years agogallium: rename pipe_buffer_handle to pipe_buffer, rework pipebuffer/ code
Keith Whitwell [Fri, 25 Jan 2008 20:53:31 +0000 (20:53 +0000)]
gallium:  rename pipe_buffer_handle to pipe_buffer, rework pipebuffer/ code

Provide an actual definition of the pipe_buffer struct,  containing
the parameters used to create the buffer, and its refcount.

Shift refcounting buffers out of the winsys interface, similar to
surfaces & textures.

Rework pipebuffer/ to reflect the fact these changes, and also Michel's
reworking of the buffer interface.

16 years agogallium: Simplify winsys buffer interface.
Michel Dänzer [Fri, 25 Jan 2008 16:01:01 +0000 (17:01 +0100)]
gallium: Simplify winsys buffer interface.

The properties of a buffer represented by struct pipe_buffer_handle are now
basically constant over its lifetime. The state tracker gets to deal with any
more complex buffer semantics it may need to provide.

16 years ago965: add asserts to catch batch overrun
Keith Whitwell [Thu, 10 Jan 2008 14:57:55 +0000 (14:57 +0000)]
965: add asserts to catch batch overrun

16 years ago965: cope better with range decls for temps, immediates, etc
Keith Whitwell [Thu, 10 Jan 2008 14:57:07 +0000 (14:57 +0000)]
965: cope better with range decls for temps, immediates, etc

16 years agogallium: include p_state.h, replace PIPE_MAX_SHADER_OUTPUTS with PIPE_MAX_SHADER_INPUTS
Brian [Fri, 25 Jan 2008 15:19:45 +0000 (08:19 -0700)]
gallium: include p_state.h, replace PIPE_MAX_SHADER_OUTPUTS with PIPE_MAX_SHADER_INPUTS

16 years agoCell: propogate vertex info to SPUs, use it for attrib interpolation
Brian [Fri, 25 Jan 2008 15:17:52 +0000 (08:17 -0700)]
Cell: propogate vertex info to SPUs, use it for attrib interpolation

16 years agoCell: batch_buffer_size should be uint, not ubyte
Brian [Fri, 25 Jan 2008 15:17:04 +0000 (08:17 -0700)]
Cell: batch_buffer_size should be uint, not ubyte

16 years agoCell: new ROUNDUP16() macro
Brian [Fri, 25 Jan 2008 01:26:37 +0000 (18:26 -0700)]
Cell: new ROUNDUP16() macro

16 years agogallium: optimizations to flatshade, two-side prim stages
Brian [Fri, 25 Jan 2008 15:15:04 +0000 (08:15 -0700)]
gallium: optimizations to flatshade, two-side prim stages

16 years agogallium: added rastpos_destroy()
Brian [Thu, 24 Jan 2008 22:23:27 +0000 (15:23 -0700)]
gallium: added rastpos_destroy()

16 years agoCell: insert dummy field into cell_command_render struct to work around apparent...
Brian [Fri, 25 Jan 2008 01:20:07 +0000 (18:20 -0700)]
Cell: insert dummy field into cell_command_render struct to work around apparent compiler bug

Without this dummy field, it seems the SPU code in cmd_render() gets a bogus
value when dereferencing render->num_indices, sometimes.
This showed up as missing tries in gears.c in the first frame rendered.
Using spu-gcc version 4.1.1, Cell SDK 2.1

16 years agoCell: s/-W/-Wall/ in linux-cell
Brian [Fri, 25 Jan 2008 00:04:54 +0000 (17:04 -0700)]
Cell: s/-W/-Wall/ in linux-cell

16 years agoCell: send actual vertex size in the render command
Brian [Thu, 24 Jan 2008 23:47:23 +0000 (16:47 -0700)]
Cell: send actual vertex size in the render command

16 years agoCell: rewrite compute_vertex_layout()
Brian [Thu, 24 Jan 2008 23:41:03 +0000 (16:41 -0700)]
Cell: rewrite compute_vertex_layout()

16 years agoCell: fix asst. warnings
Brian [Thu, 24 Jan 2008 23:39:34 +0000 (16:39 -0700)]
Cell: fix asst. warnings

16 years agogallium: added rastpos_destroy()
Brian [Thu, 24 Jan 2008 23:05:33 +0000 (16:05 -0700)]
gallium: added rastpos_destroy()

16 years agoi915: add case for TGSI_FILE_IMMEDIATE to avoid error, but still needs proper handling...
Brian [Thu, 24 Jan 2008 16:59:39 +0000 (09:59 -0700)]
i915: add case for TGSI_FILE_IMMEDIATE to avoid error, but still needs proper handling...

16 years agoCell: use Cell driver by default if linux-cell is built
Brian [Thu, 24 Jan 2008 16:18:15 +0000 (09:18 -0700)]
Cell: use Cell driver by default if linux-cell is built

To disable the Cell driver and use softpipe instead, export GALLIUM_NOCELL=1

16 years agodisable usage of llvm in fragment shaders
Zack Rusin [Thu, 24 Jan 2008 13:29:19 +0000 (08:29 -0500)]
disable usage of llvm in fragment shaders

it produces wrong results because it hasn't been adjusted to some
new changes and it will just be in the way while changing llvm
code to a different vector layout

16 years agochange the name of the shaders to reflect what they do.
Zack Rusin [Thu, 24 Jan 2008 12:49:36 +0000 (07:49 -0500)]
change the name of the shaders to reflect what they do.
remove stale code and do some general cleanups.

16 years agoCell: s/FORMAT/EMIT/
Brian [Thu, 24 Jan 2008 06:33:35 +0000 (23:33 -0700)]
Cell: s/FORMAT/EMIT/

16 years agogallium: rename FORMAT_x to EMIT_x and use EMIT_ALL to emit whole vertex as-is in...
Brian [Thu, 24 Jan 2008 06:27:31 +0000 (23:27 -0700)]
gallium: rename FORMAT_x to EMIT_x and use EMIT_ALL to emit whole vertex as-is in vbuf code

16 years agogallium: improved vertex layout and interpolant setup in softpipe
Brian [Thu, 24 Jan 2008 06:08:59 +0000 (23:08 -0700)]
gallium: improved vertex layout and interpolant setup in softpipe

16 years agoSpecify linker instead of letting mklib use gcc
Ian Romanick [Thu, 3 Jan 2008 23:11:02 +0000 (15:11 -0800)]
Specify linker instead of letting mklib use gcc

This is the final bit required to get Cell builds on x86 working.
Without this, mklib tries to link using the x86 gcc instead of
ppu32-gcc.

16 years agoUse HOST_CC for programs that will run on the build host
Ian Romanick [Thu, 3 Jan 2008 23:08:53 +0000 (15:08 -0800)]
Use HOST_CC for programs that will run on the build host

16 years agoUse EXTRA_LIB_PATH with *_LIB_DEPS
Ian Romanick [Thu, 3 Jan 2008 22:59:14 +0000 (14:59 -0800)]
Use EXTRA_LIB_PATH with *_LIB_DEPS

Make sure EXTRA_LIB_PATH is used with all the LIB_DEPS.  Re-order some
of the options and tweak the whitespace to make the various LIB_DEPS
more readable.  This makes building for Cell on x86 a bit easier and
doesn't seem to effect other builds.

16 years agoRemove unnecessary paths
Ian Romanick [Thu, 3 Jan 2008 22:57:07 +0000 (14:57 -0800)]
Remove unnecessary paths

Removing the paths on certain commands (e.g., ppu32-gcc) and removing
-I/usr/include makes it possible to build for Cell on both PowerPC and
x86 hosts.

16 years agoCell: remove old test code
Brian [Wed, 23 Jan 2008 23:19:40 +0000 (16:19 -0700)]
Cell: remove old test code

16 years agoCell: asst. updates to sync up with today's earlier gallium changes
Brian [Wed, 23 Jan 2008 23:17:49 +0000 (16:17 -0700)]
Cell: asst. updates to sync up with today's earlier gallium changes

16 years agogallium: remove support for separate depth/stencil buffers. Always combined now.
Brian [Wed, 23 Jan 2008 22:45:52 +0000 (15:45 -0700)]
gallium: remove support for separate depth/stencil buffers.  Always combined now.

16 years agogallium: in sp_tile_cache_clear() mark all cache slots as empty/free. Fixes progs...
Brian [Wed, 23 Jan 2008 22:39:34 +0000 (15:39 -0700)]
gallium: in sp_tile_cache_clear() mark all cache slots as empty/free.  Fixes progs/redbook/stencil.c

16 years agogallium: rework compute_vertex_layout() to intelligently map vs outputs to fs inputs
Brian [Wed, 23 Jan 2008 21:23:49 +0000 (14:23 -0700)]
gallium: rework compute_vertex_layout() to intelligently map vs outputs to fs inputs

Some follow-on simplification in prim setup is possible...

16 years agogallium: restore/rewrite vbuf code for softpipe
Brian [Wed, 23 Jan 2008 20:17:50 +0000 (13:17 -0700)]
gallium: restore/rewrite vbuf code for softpipe

Now based on the draw_vbuf code, instead being a custom one-off.
Disabled by default, enable with SP_VBUF env var.

16 years agogallium: overhaul usage of vertex_info in draw module.
Brian [Wed, 23 Jan 2008 19:48:41 +0000 (12:48 -0700)]
gallium: overhaul usage of vertex_info in draw module.

Remove all dependencies on vertex_info, except for draw_vbuf.
Drawing stages now strictly operate on post-transformed vertices and don't
know anything about hw vertices.
Use vertex program output info for two-side/flat/etc stages.
Temporarily disable vbuf module in softpipe driver.

16 years agogallium: s/INTERP_NONE/INTERP_LINEAR/ to fix assertion with progs/samples/select.c
Brian [Wed, 23 Jan 2008 16:27:39 +0000 (09:27 -0700)]
gallium: s/INTERP_NONE/INTERP_LINEAR/ to fix assertion with progs/samples/select.c

16 years agogallium: fix computation of raster.point_size_per_vertex flag
Brian [Wed, 23 Jan 2008 15:24:30 +0000 (08:24 -0700)]
gallium: fix computation of raster.point_size_per_vertex flag

16 years agogallium: multiply vertex point size by 0.5
Brian [Wed, 23 Jan 2008 15:24:08 +0000 (08:24 -0700)]
gallium: multiply vertex point size by 0.5

16 years agogallium: use temp reg for storing color to avoid reading 'result.color'
Brian [Wed, 23 Jan 2008 03:52:48 +0000 (20:52 -0700)]
gallium: use temp reg for storing color to avoid reading 'result.color'

16 years agogallium: Don't allocate a vertex buffer until after setting the prim type.
Brian [Tue, 22 Jan 2008 23:37:19 +0000 (16:37 -0700)]
gallium: Don't allocate a vertex buffer until after setting the prim type.

The vertex size may depend on whether we're drawing points, lines or triangles.

16 years agoadded stipple_destroy()
José Fonseca [Tue, 22 Jan 2008 23:35:50 +0000 (16:35 -0700)]
added stipple_destroy()

16 years agogallium: Added FORMAT_1F_PSIZE to insert constant point size into vertices
Brian [Tue, 22 Jan 2008 17:16:30 +0000 (10:16 -0700)]
gallium: Added FORMAT_1F_PSIZE to insert constant point size into vertices

Also, added draw_convert_wide_points/lines() so a driver can tell the draw
module whether to convert wide points/lines into triangles, or just pass
them through.

16 years agogallium: silence warnings
Brian [Tue, 22 Jan 2008 04:19:24 +0000 (21:19 -0700)]
gallium: silence warnings

16 years agoCell: initial support for sampler state
Brian [Tue, 22 Jan 2008 04:15:43 +0000 (21:15 -0700)]
Cell: initial support for sampler state

16 years agoCell: s/cell_init_surface_funcs/cell_init_surface_functions/
Brian [Tue, 22 Jan 2008 03:54:38 +0000 (20:54 -0700)]
Cell: s/cell_init_surface_funcs/cell_init_surface_functions/

16 years agoCell: Added cell_surface.[ch] files
Brian [Tue, 22 Jan 2008 03:53:23 +0000 (20:53 -0700)]
Cell: Added cell_surface.[ch] files

16 years agogallium: remove unneeded protos, #includes, etc
Brian [Tue, 22 Jan 2008 03:51:03 +0000 (20:51 -0700)]
gallium: remove unneeded protos, #includes, etc

16 years agogallium: include sp_headers.h
Brian [Tue, 22 Jan 2008 03:50:39 +0000 (20:50 -0700)]
gallium: include sp_headers.h

16 years agoCell: renamed cell_surface.[ch] to cell_clear.[ch]
Brian [Tue, 22 Jan 2008 03:31:36 +0000 (20:31 -0700)]
Cell: renamed cell_surface.[ch] to cell_clear.[ch]