Commit graph

11767 commits

Author SHA1 Message Date
Eric Anholt
4e5b3626a1 [intel] Remove a gratuitous flush at the end of ClearWithTris. 2008-01-10 13:46:49 -08:00
Eric Anholt
ab2933df65 [intel] Only flush batch when changing draw buffers, not every cliprect update.
The previous code would reference freed memory on window moves.
2008-01-10 13:24:14 -08:00
Eric Anholt
a04b632350 [intel] Add more cliprect modes to cover other meanings for batch emits.
The previous change gave us only two modes, one which looped over the batch
per cliprect (3d drawing) and one that didn't (state updeast).
However, we really want 4:

- Batch doesn't care about cliprects (state updates)
- Batch needs DRAWING_RECTANGLE looping per cliprect (3d drawing)
- Batch needs to be executed just once (region fills, copies, etc.)
- Batch already includes cliprect handling, and must be flushed by unlock time
  (copybuffers, clears).

All callers should now be fixed to use one of these states for any batchbuffer
emits.  Thanks to Keith Whitwell for pointing out the failure.
2008-01-10 12:34:08 -08:00
Xiang, Haihao
7086df5868 i965: fix bug #14002 2008-01-10 16:48:33 +08:00
Xiang, Haihao
c30392f187 i965: fix segfault caused by commit e131c46b20. 2008-01-10 16:45:35 +08:00
Kristian Høgsberg
e131c46b20 [intel] Simplify intelCreateBuffer() a bit.
Drop a bunch of unused arguments from intel_create_renderbuffer() and
introduce intel_renderbuffer_set_region() to set the region for
a renderbuffer.
2008-01-09 20:43:18 -05:00
Kristian Høgsberg
33c42c1262 [intel] Prepare intelCopyBuffer() for private back buffers. 2008-01-09 20:43:18 -05:00
Kristian Høgsberg
24e7e45768 Factor out code to do the DRM_I830_GETPARAM ioctl. 2008-01-09 19:08:55 -05:00
Kristian Høgsberg
f1139e4c66 Fold DoBindContext() helper function into driBindContext(). 2008-01-09 19:08:55 -05:00
Eric Anholt
4225876bf0 [intel] Re-allocate backing buffer objects on BufferData.
This may allow better concurrency (noop in openarena performance now), but is
also important for the previous commit -- otherwise, we may end up with
BufferData, draw_prims, BufferData and the draw_prims would use the new VBO
data instead of old.  This could still occur with user-supplied VBOs and poor
use of MapBuffer without BufferData.
2008-01-09 14:41:55 -08:00
Eric Anholt
7da98d7eba [965] Allow more than one draw_prims per batchbuffer.
The comment about (vbo)_exec_api.c appeared to be stale, as the VBO code seems
to only use non-named VBOs (not actual VBOs) or freshly-allocated VBO data.

This brings a 2x speedup to openarena, because we can submit nearly-full
batchbuffers instead of many 450-byte ones.
2008-01-09 14:41:54 -08:00
Eric Anholt
dc1608ae9d [965] Replace the always_update dirty flag with BRW_NEW_BATCH.
This allows us to avoid re-emitting some state when validate_state happens
multiple times per batchbuffer.  Even though we flush batch per primitive
currently, that may still happen already if the primitive changed (this should
probably be fixed as well).
2008-01-09 14:41:53 -08:00
Eric Anholt
5f86ae057a [intel] Rename lost_hardware vtbl entry to new_batch.
Both drivers have ended up relying on lost_hardware being called after each
batch buffer, so update the name.  This removes one of the calls on 965 whic
h was outside of the batchbuffer handling code and just duplicating what had
already happened through batchbuffer handling.
2008-01-09 14:41:42 -08:00
Eric Anholt
d9edd8e905 [965] Remove drawing rect upload, which is handled (better) by the kernel. 2008-01-09 14:41:41 -08:00
Eric Anholt
beddf653a9 [intel] Clean up cliprect handling in intel drivers.
In particular, batch buffers are no longer flushed when switching from
CLIPRECTS to NO_CLIPRECTS or vice versa, and 965 just uses DRM cliprect
handling for primitives instead of trying to sneak in its own to avoid the
DRM stuff. The disadvantage is that we will re-execute state updates per
cliprect, but the advantage is that we will be able to accumulate larger
batch buffers, which were proving to be a major overhead.
2008-01-09 14:41:40 -08:00
Eric Anholt
7ce12b0863 [intel] Remove the dead intel->need_flush member. 2008-01-09 14:41:39 -08:00
Eric Anholt
5a49e84fcd [965] Clarify a bit of index buffer upload code. 2008-01-09 14:41:38 -08:00
Brian
8c4806ccc4 fix bug 13978: glDrawBuffersARB() didn't set all necessary state 2008-01-09 14:20:51 -07:00
Eric Anholt
c0fd6a0903 [intel] Add TTM bufmgr debug for type or offset migration of buffers. 2008-01-08 10:08:54 -08:00
Xiang, Haihao
3369cd9a6f i915: Keith Whitwell's swizzling TEX patch. fix #8283 2008-01-07 14:08:36 +08:00
Brian
601a6b872c Replace gl_framebuffer's _ColorDrawBufferMask with _ColorDrawBufferIndexes
Each array element is now a BUFFER_x token rather than a BUFFER_BIT_x bitmask.
The number of active color buffers is specified by _NumColorDrawBuffers.
This builds on the previous DrawBuffer changes and will help with drivers
implementing GL_ARB_draw_buffers.
2008-01-06 18:07:26 -07:00
Brian
ff73c783cc Simplify ctx->_NumColorDrawBuffers, _ColorDrawBuffers and fix bug 13835.
These fields are no longer indexed by shader output.  Now, we just have
a simple array of renderbuffer pointers.

If the shader writes to gl_FragData[i], send those colors to the N
_ColorDrawBuffers.  Otherwise, replicate the single gl_FragColor (or
the fixed-function color) to the N _ColorDrawBuffers.

A few more changes and simplifications can follow from this...
2008-01-06 10:43:20 -07:00
Brian
9f6022d056 fix depth/1 typo in glTexImage3D proxy code 2008-01-05 15:45:55 -07:00
Brian
48aa35a8b2 check if span length > 0 before calling _swrast_write_rgba_span() 2008-01-05 15:45:55 -07:00
Xiang, Haihao
e7044d552c i915: don't validate PS program when falling back to software
rendering. fix #12786
2008-01-04 17:11:39 +08:00
Xiang, Haihao
15356376bd intel: some initialization for dri_bufmgr_ttm 2008-01-04 14:22:23 +08:00
Eric Anholt
62842e7145 [intel] Add a single-entry relocation buffer cache.
By avoiding the repeated relocation buffer creation/map/unmap/destroy for each
new batch buffer, this improves OpenArena framerates by 30%.  Caching batch
buffers themselves doesn't appear to be a significant performance win over
this change.
2008-01-03 16:53:23 -08:00
Eric Anholt
8abffada70 [intel] Convert relocations to not be cleared out on buffer submit.
We have two consumers of relocations.  One is static state buffers, which
want the same relocation every time.  The other is the batchbuffer, which gets
thrown out immediately after submit.  This lets us reduce repeated computation
for static state buffers, and clean up the code by moving relocations nearer
to where the state buffer is computed.
2008-01-03 15:46:16 -08:00
Eric Anholt
0ff3eb637b [965] Fix some missing initialization in WM keys. 2008-01-03 14:49:33 -08:00
Zou Nan hai
15653b5d88 fix fd.o bug #13761
MRD computation is now changed in mesa core
2008-01-03 16:05:27 +08:00
Eric Anholt
9e9f6f105c [965] Convert WM unit to use a cache key instead of brw_cache_data. 2008-01-02 15:51:49 -08:00
Eric Anholt
03b59edbb5 [965] Convert VS unit to use a cache key instead of brw_cache_data. 2008-01-02 15:51:48 -08:00
Eric Anholt
77e6cf8c17 [965] Convert SF unit to use a cache key instead of brw_cache_data. 2008-01-02 15:51:47 -08:00
Eric Anholt
3149119cad [965] Convert GS unit to use a cache key instead of brw_cache_data. 2008-01-02 15:51:46 -08:00
Eric Anholt
114b802e87 [965] Convert clip unit to use a cache key instead of brw_cache_data. 2008-01-02 15:51:46 -08:00
Eric Anholt
b35811e1b3 [965] Convert CC unit to use a cache key instead of brw_cache_data. 2008-01-02 15:51:45 -08:00
Eric Anholt
a95b48d55b [965] Convert surface state to use a cache key instead of brw_cache_data. 2008-01-02 15:51:44 -08:00
Eric Anholt
3e3644c6e8 [965] Convert sampler state to use a cache key instead of brw_cache_data. 2008-01-02 15:51:43 -08:00
Eric Anholt
a099461fa3 Revert "[intel] Use the memory type mask containing the caching flags."
This reverts commit 8bb9ae3693.

Validating our kernel buffers with the caching off in flags but on in mask
means that the kernel migrates the buffer to be uncached, which is undesired.
2008-01-02 15:51:27 -08:00
Eric Anholt
8bb9ae3693 [intel] Use the memory type mask containing the caching flags. 2008-01-02 09:47:07 -08:00
Keith Packard
a3c435b342 Set correct flags mask when validating buffers.
The 'mask' value used in the validation operation specifies which of the
'flags' bits are being modified. Buffer validation wants to pass the memory
type and access mode (rwx) to the kernel so that the buffer will be placed
correctly, and so that the right kind of fence will be created (read vs
write). That means we actually want a constant mask for these operations,
and not something computed from the bits coming in. The constant we want is
DRM_BO_MASK_MEM | DRM_BO_FLAG_READ | DRM_BO_FLAG_WRITE | DRM_BO_FLAG_EXE.
2008-01-02 09:47:06 -08:00
Eric Anholt
4cc02fb938 [965] Improve performance by including reloc target buffer pointers in keys.
Without this, the WM binding tables would all collide, for example.  Improves
openarena performance by around 2%.
2008-01-02 09:47:05 -08:00
Brian
de427742b8 additional stub functions 2008-01-02 07:24:07 -07:00
Brian
7d6d6652d5 additional GL_COLOR_ATTACHMENTx_EXT cases (bug 13767) 2008-01-02 07:19:31 -07:00
Xiang, Haihao
60d762aa62 i915: Needn't adjust pixel centers. fix #12944 2008-01-02 11:38:51 +08:00
Dave Airlie
524304c9b8 Revert "r300: fix bug with maniadrive rendering"
this is correct, there is another issue with sw fallbacks

This reverts commit cc50edbca2.
2008-01-02 06:19:47 +10:00
Brian
a5c84de3a7 remove unneeded conditional 2008-01-01 10:20:56 -07:00
Brian
f0676cc422 fix vbo display list memleak upon context destruction 2008-01-01 10:20:56 -07:00
Brian
6c0fc07d71 fix glUniform4f typo 2008-01-01 10:20:56 -07:00
Brian
9b3162b1d2 additional GL_COLOR_ATTACHMENTx_EXT cases (bug 13767) 2008-01-01 10:10:04 -07:00