Commit Graph

486 Commits

Author SHA1 Message Date
Michal Krol fc98880144 draw: Fix bypass_vs semantic misuse. 2008-03-30 22:48:49 +02:00
Brian Paul a52c0416d1 gallium: Set vertex state/buffers en-mass. 2008-03-29 14:41:03 +01:00
José Fonseca f10016b9a0 gallium: Fix some MSVC warnings. 2008-03-29 11:32:29 +09:00
Brian cbfe6ee5d5 gallium: Fix computation of Z values when not using early Z.
This fixes the missing bitmaps in the engine and fogcoord demos.
2008-03-28 15:22:34 -06:00
Roland Scheidegger 5615ab78b0 gallium: remove redundant compare bit in sampler state 2008-03-28 15:43:00 +01:00
Michal Krol 4e7bcaa4c2 gallium: Bump PIPE_MAX_SAMPLERS to 16.
We need it to fulfil D3D minimum requirements.
2008-03-28 12:31:35 +01:00
Brian 5935b16ff5 If visual is 32bpp, set visual->alphaBits = 8.
This works since we always use XImages for color buffers.  It wouldn't always
work for Windows/Pixmaps.
2008-03-27 21:11:45 -06:00
Brian 39038c1169 gallium: replace PIPE_ATTRIB_MAX with PIPE_MAX_ATTRIBS
The later follows the naming scheme of other limits.
Keep the old definition until all possible usage is updated.
2008-03-27 17:41:55 -06:00
Brian Paul 37da2d6851 gallium: updated/improved comments, minor re-formatting 2008-03-27 17:18:25 -06:00
Brian dccbfd8bf0 gallium: return pipe_shader_state from the simple shader functions
Allows us to fix a mem leak (tokens array).
2008-03-27 15:43:32 -06:00
Brian ba49fa39f3 gallium: fix incorrect types for shaders 2008-03-27 15:43:32 -06:00
Brian df1744c043 gallium: remove temporary static var 2008-03-27 15:43:32 -06:00
Brian d355eee5ca gallium: silence unused var warning 2008-03-27 15:27:31 -06:00
Brian 132df5ebce cell: include cell_state_per_fragment.h to silence warning 2008-03-27 15:27:14 -06:00
Brian 8b8a947111 cell: added (uint64_t) cast to silence warning 2008-03-27 15:26:54 -06:00
Brian 979358c471 cell: fix unclosed comment 2008-03-27 15:26:22 -06:00
Ian Romanick 70659e8ec8 xlib: Fix build error from recent fence changes 2008-03-26 10:52:08 -07:00
Ian Romanick 92126cea84 cell: Implement code-gen for logic op
This also implements code-gen for the float-to-packed color
conversion.  It's currently hardcoded for A8R8G8B8, but that can
easily be fixed as soon as other color depths are supported by the
Cell driver.
2008-03-26 10:47:17 -07:00
Brian Paul 8cb85807d3 gallium: as for aapoints, make the extra texcoord per-shader state 2008-03-26 08:21:17 -06:00
Michel Dänzer 4abe1eb980 gallium: Change pipe->flush() interface to optionally return a fence.
The cell driver still uses an internal CELL_FLUSH_WAIT flag, in the long run
proper fencing should be implemented for it.
2008-03-26 09:36:40 +00:00
Brian e55dccd0bf gallium: the generic attrib we use for computing coverage is per-shader
Fixes a very tricky conformance failure.
2008-03-25 19:21:36 -06:00
Brian 9f7cd571e0 gallium: added fragment emit/write debug counters 2008-03-25 19:21:36 -06:00
Ian Romanick b09de96a17 xlib: Add support for MIT-SHM in xlib winsys driver
Gives about a 3% performance increase in gears on x86-64 (non-tiled)
and about 10% performance increase in gears on Cell (tiled).  I
actually expected more of a boost. :(
2008-03-25 18:15:58 -07:00
Ian Romanick 84d8030735 cell: Float convert-to and convert-from instructions use different shift bias 2008-03-25 18:15:58 -07:00
Michal Krol e1543fa55c draw: Take flatshade_first rasterizer bit into account. 2008-03-25 23:51:52 +01:00
Michal Krol dc9757e1a8 gallium: Introduce flatshade_first field to rasterizer_state.
This bit tells us which vertex of the primitive is used to
propagate color for the remaining vertices if flatshade mode.
2008-03-25 23:51:51 +01:00
Keith Whitwell 05a4ecdec2 draw: vertex fetch can be validated too early leading to an assertion... disable 2008-03-25 18:15:58 +00:00
Keith Whitwell cbec008491 draw: don't use fetch_and_store for bypass_vs mode, it's not quite right 2008-03-25 18:09:53 +00:00
José Fonseca 331a56136e Fix typo 2008-03-25 17:47:39 +00:00
Keith Whitwell 4505acf3b2 draw: take primitive into account when deciding if the pipeline is active 2008-03-25 15:22:32 +00:00
José Fonseca aacfc326cc gallium: Use debug_get_option for GETENV 2008-03-25 11:37:54 +00:00
José Fonseca 6fa0bd0671 gallium: Fix default option on Windows. 2008-03-25 11:37:24 +00:00
Brian 6579440ea9 gallium: be smarter about picking the sampler unit for pstipple, aaalines
Also, if the app really uses all available sampler/texture units, don't just
die.  Just use the last sampler for the pstipple or aaline texture.
2008-03-24 19:36:44 -06:00
Brian 4654803e25 gallium: fix a few bugs, warnings in the p_debug code
added missing _ to a _debug_printf() call.
2008-03-24 18:49:56 -06:00
Brian d6af8fc51d gallium: move sampler_unit field to pstip_fragment_shader since it's per-shader
Also, fix another texture refcounting bug.
2008-03-24 18:34:03 -06:00
Brian ae146e4bc8 gallium: make a copy of the vertex shader's token array.
This solves problems when the state tracker frees the token array when the
draw module still needs it.
2008-03-24 16:35:25 -06:00
Brian 7f43029377 gallium: use pipe_texture_reference() in a few places (fixes refcounting bugs) 2008-03-24 16:35:25 -06:00
Brian 648e26aa95 gallium: added tgsi_num_tokens() function to return number of tokens in token array.
Maybe move to a different file someday.
2008-03-24 16:35:24 -06:00
José Fonseca e8c6ea4f60 gallium: Simple cross platform get-opt system.
Uses getenv on Linux, and a memory mapped text file on Windows.

It supports boolean options, flags, and plain strings.
2008-03-24 22:31:36 +00:00
José Fonseca dd51365acd gallium: cleanup p_debug
Now debug_printf is disabled on release builds. Use debug_error or
_debug_printf to output messages on release versions.
2008-03-24 22:31:36 +00:00
Brian d83e75c759 gallium: move filter assignment out of loop 2008-03-24 12:51:50 -06:00
Brian 4e398df682 gallium: fix REALLOC() to copy smaller of old/new sizes 2008-03-24 12:51:18 -06:00
José Fonseca 48726e129a gallium: Protect operator precedence in macro. 2008-03-24 18:25:59 +00:00
Michal Krol bf8de6d4dc gallium: Remove util_gen_mipmap_filter(). 2008-03-24 16:50:39 +01:00
Brian 110b63d00f gallium: pass the filter mode to util_gen_mipmap().
Remove util_gen_mipmap_filter() when no longer used.
2008-03-24 08:53:16 -06:00
Michal Krol c8c373514a gallium: tweak coords in u_gen_mipmap code 2008-03-24 08:09:34 -06:00
Keith Whitwell e0a9ce10f4 draw: pre-declare referenced structs 2008-03-24 10:53:26 +00:00
Keith Whitwell f4588c1752 Revert "draw: Fix #include order to fix Linux build."
This reverts commit a6d17bf671.
2008-03-24 10:52:20 +00:00
Michel Dänzer a6d17bf671 draw: Fix #include order to fix Linux build. 2008-03-24 09:56:12 +00:00
Keith Whitwell 3b217c7fa7 draw: check need_pipeline() in passthrough 2008-03-23 21:55:19 +00:00
Keith Whitwell 3e9b1bc100 draw: tweak the definition of draw_need_pipeline, fix minor bug 2008-03-23 21:54:44 +00:00
Keith Whitwell e6ea786c00 draw: fix crlf 2008-03-23 21:31:52 +00:00
Keith Whitwell 743e990831 draw: rename emit functions to match pipe_format names 2008-03-23 21:31:52 +00:00
Keith Whitwell 899fcde366 draw: restructure fetch/emit as a pair of function calls 2008-03-23 21:31:52 +00:00
Michal Krol 6edaef5318 gallium: Add util_gen_mipmap_filter().
We need a way to specify the type of minification filter
used to downsample mipmap levels.
The old util_gen_mipmap() retains its behaviour and uses
LINEAR filter.
2008-03-23 20:40:56 +01:00
José Fonseca 38dc0f809d gallium: Fix memory leak.
pipe cso's were being destroyed, but the hash elements themselves not.

proper fix is IMHO add a destructor callback to cso_hash.
2008-03-23 19:38:11 +00:00
José Fonseca 48ef11d308 gallium: Remove the debug_mask_* stuff.
Overcomplex and not much different from using a global variable...
2008-03-23 18:57:35 +00:00
José Fonseca d09b92d7e4 gallium: Fix typo. 2008-03-23 18:52:37 +00:00
José Fonseca 732422f670 gallium: Memory debugging utilities.
There are no known tools for windows kernel memory debugging, so this is a
simple set of malloc etc wrappers.

Enabled by default on win32 debug builds
2008-03-23 18:38:31 +00:00
José Fonseca 312cbc5a5c gallium: wrap decls in extern "C" 2008-03-23 18:38:31 +00:00
Keith Whitwell 301b187ca9 draw: fix some unsigned vs ushort confusion
Middle-end elements are ushort, but prior to that have to treat all
elements as unsigned to avoid wrapping and/or overruns.
2008-03-23 18:21:00 +00:00
Keith Whitwell f40357e25c gallium: beginnings of draw module vertex rework
Trying to put a structure in place that we can actually optimize.
Initially just implementing a passthrough mode, this will fairly soon
replace all the vertex_cache/prim_queue/shader_queue stuff that's so
hard to understand...

Split the vertex processing into a couple of distinct stages:
- Frontend
    - Prepares two lists of elements (fetch and draw) to be processed
      by the next stage.  This stage doesn't fetch or draw vertices, but
      makes the decision which to draw.  Multiple implementations of this
      will implement different strategies, currently just a vcache
      implementation.
- MiddleEnd
    - Takes the list of fetch elements, fetches them, runs the vertex
      shader, cliptest, viewport transform on them to produce a
      linear array of vertex_header vertices.
    - Passes that list of vertices, plus the draw_elements (which index
      into that list) onto the backend
- Backend
    - Either the existing primitive/clipping pipeline, or the vbuf_render
      hardware backend provided by the driver.

Currently, the middle-end is the old passthrough code, and it build hardware
vertices, not vertex_header vertices as above.  It may be that passthrough
is a special case in this respect.
2008-03-23 17:36:49 +00:00
Brian dae7993afc gallium: free samplers, textures in destroy() 2008-03-22 09:42:59 -06:00
Brian 2f8f6c2918 gallium: remove temporary _screen suffix from function names 2008-03-22 09:15:23 -06:00
Brian 28b3b07895 gallium: fix mem leak (fee pstipple stage) 2008-03-22 09:12:27 -06:00
José Fonseca 4e977fb35b gallium: Remove pedantic asserts.
Move these to a higher level instead.
2008-03-22 10:59:52 +00:00
Ian Romanick 47531442e9 cell: Generate blend / depth test code when state atom is created
Code generation should be performed when the device-specific state
atom is created, not when it is bound.
2008-03-21 15:57:01 -07:00
Ian Romanick 600499cf88 cell: Change code-gen for CONST_COLOR blend factor
Previously the constant color blend factor was compiled into the
generated code.  This meant that the code had to be regenerated each
time the constant color was changed.  This doesn't fit with the model
used in Gallium.

As-is, the code could be better.  The constant color is loaded for
every quad processed, even if it is not used.  Also, if a lot of (1-x)
blend factors are used, 1.0 will be loaded and reloaded into registers
many times.
2008-03-21 15:57:01 -07:00
Ian Romanick f140062b72 Tabs to spaces 2008-03-21 15:57:01 -07:00
Ian Romanick 2902c164a2 cell: Remove unnecessary default_blend work-around
I suspect that there was some other bug in the blend code-gen that
made this work-around necessary.
2008-03-21 15:57:01 -07:00
Brian b70a6babfb i915: added to-do note about setting the max_lod register to get proper min/mag filter selection 2008-03-21 11:10:42 -06:00
Brian Paul 4394736252 gallium: added DXT formats (preliminary, will probably change) 2008-03-21 11:06:52 -06:00
Brian Paul 419248b528 gallium: document is_format_supported()'s type param 2008-03-21 11:06:52 -06:00
Brian Paul a472e3558e gallium: PIPE_FORMAT_TYPE_ comments 2008-03-21 11:06:52 -06:00
Brian Paul ad62644290 gallium: added sRGB formats 2008-03-21 11:06:51 -06:00
Brian Paul 403c7ba91a gallium: additional comments, fix typos, etc 2008-03-21 11:06:51 -06:00
Ian Romanick cab68957c7 cell: Fix several bugs in blend code-gen
- Alpha factor set to a _COLOR mode was mishandled
- Cases when either dst factor or src factor was ZERO were mishandled
- MIN and MAX cases were backwards
- Case when blend was disabled was mishandled
- Incorrect comments about number of instructions generated

The tests blendminmax and blendsquare run correctly.
2008-03-20 18:17:48 -07:00
Ian Romanick 4b9520fc05 cell: Call the correct function to generate blending code
Cut-and-paste for the lose. :(
2008-03-20 17:37:26 -07:00
Ian Romanick df1d6e2410 cell: Fix bus error when there is no depth buffer 2008-03-20 17:37:26 -07:00
Ian Romanick 2b21bde3b1 cell: Use code-gen for alpha blend
So far this is only tested when GL_BLEND is disabled.
2008-03-20 17:37:26 -07:00
Brian 0565e6888a gallium: set fb.width/height 2008-03-20 15:22:20 -06:00
Brian 00cf178d93 gallium: enable vp input semantic info 2008-03-20 15:21:55 -06:00
Brian 09f67990ab gallium: use new framebuffer width, height fields 2008-03-20 15:04:08 -06:00
Brian 2fb30b77ad cell: use pipe_framebuffer_state.width, height 2008-03-20 15:04:08 -06:00
Brian 80567f9c9f gallium: added width, height to pipe_framebuffer_state 2008-03-20 15:04:08 -06:00
Brian b028d32af4 gallium: create one vertex buffer and re-use 2008-03-20 15:04:08 -06:00
Brian 18be9a588a gallium: use sizeof(vertex buffer) 2008-03-20 15:04:08 -06:00
José Fonseca 9fa88fb3c5 gallium: Give some chance for the table to actually grow. 2008-03-20 20:40:50 +00:00
Michal Krol 400b12b4ce gallium: Fix build on Windows. 2008-03-20 20:34:03 +01:00
Michal Krol 482f499525 gallium: Fix build on Windows. 2008-03-20 20:28:06 +01:00
Keith Whitwell f259ea0347 gallium: remove unused local var 2008-03-20 19:25:44 +00:00
Brian 309d6e52c5 gallium: create vertex buffer once and re-use. 2008-03-20 10:44:51 -06:00
Brian 8c71406c74 gallium: added util_draw_vertex_buffer() 2008-03-20 10:44:27 -06:00
Brian 8dd90ee19d gallium: temporarily disable the memcmp() in cso_set_framebuffer()
The memcmp() fails to detect buffer size changes...
2008-03-20 09:15:24 -06:00
Brian 6a9a3afcf9 gallium: added util_make_fragment_passthrough_shader() 2008-03-20 09:11:27 -06:00
Keith Whitwell a88202d3b0 gallium: add debug facility to dump random blobs as hex 2008-03-20 13:10:32 +00:00
Brian Paul 122ed506f4 gallium: added fb_width/height fields to softpipe context
These are convenience fields.  Otherwise, we have to check cbuf[0] or zsbuf
in various places.
2008-03-19 18:10:09 -06:00
Brian Paul 4984487bc3 gallium: add face, dirtyLevels params to pipe->texture_update()
This provides better information about which images in texture object have changed.
Also, call texture_update() from more places previously missed.
2008-03-19 17:15:14 -06:00
Brian Paul b45669283f gallium: fix bug in cso_single_sampler_done() in computation of nr_samplers
Need to find highest used sampler so search from end toward beginning.
2008-03-19 17:15:14 -06:00
José Fonseca df5ba799fa gallium: Fix broken logic. 2008-03-19 20:46:08 +00:00