Commit graph

22853 commits

Author SHA1 Message Date
Eric Anholt
3d048e5750 i965: Remove bad constant buffer constant-reg-already-loaded optimization.
Thanks to branching, the state of c->current_const[i].index at the point
of emitting constant loads for this instruction may not match the actual
constant currently loaded in the reg at runtime.  Fixes a regression in my
GLSL program for idr's class since b58b3a786a.
2009-05-06 21:44:13 -07:00
Eric Anholt
156a79f5bd intel: Unmap buffers if needed at DeleteBuffer time.
This fixes a crash in glean's pbo test, which tripped over the assert when a
context was destroyed while a buffer was still mapped (Mesa doesn't call
UnmapBuffer in that case).  Regression in
c6bde8873f
2009-05-06 20:44:34 -07:00
Brian Paul
58544a28ad mesa: remove unnecessary buffer size check 2009-05-06 12:38:35 -06:00
Brian Paul
bb1fb2a544 mesa: code consolidation in glDraw[Range]Elements() validation 2009-05-06 12:38:35 -06:00
Brian Paul
88af3f8783 mesa: new comments, minor reformatting 2009-05-06 12:38:35 -06:00
Brian Paul
a13df193c2 mesa: use elementBuf local var instead of ctx->Array.ElementArrayBufferObj
Makes no real difference, but more consistant.
2009-05-06 12:38:35 -06:00
Eric Anholt
f831d2d41b i965: Remove the forced lack of caching for renderbuffer surface state.
This snuck in with the multi-draw-buffers commit, and is a major penalty
to performance.  It doesn't appear to be required, as the only dependency
the surface BO has is on the state key (and if there's some other dependency,
it should just be in the key).

This brings openarena performance up to almost 2% faster than Mesa 7.4.
2009-05-06 10:54:32 -07:00
Eric Anholt
4cb87840ff i965: Remove _NEW_PROGRAM from brw_wm_surfaces setup dependencies.
This was a leftover from the brw_wm_constant_buffer change.
2009-05-06 10:54:32 -07:00
Brian Paul
9b678af796 mesa: be smarter about allocating vert/frag program constants
Try to re-use constants/literals more often to make best use of the
constant buffer space.

See bug 21354.
2009-05-06 08:53:41 -06:00
Eric Anholt
71fb9d62ec i965: Split WM constant buffer update from other WM surfaces.
This can avoid re-uploading constant data when it isn't necessary, and is
a step towards not updating other surfaces just because constants change.
It also brings the upload of the constant buffer next to the creation.

This brings openarena performance up another 4%, to 91% of the Mesa 7.4 branch.
2009-05-06 06:44:14 -07:00
Eric Anholt
9490d86808 i965: Disentangle VS constant surface state from WM surface state.
Also, only create VS surface state if there's a VS constant buffer to be
uploaded, and set the contents of the buffer at the same time as creation.
2009-05-06 06:44:14 -07:00
Eric Anholt
d277547dc6 i965: Don't create constant buffers if they won't be used.
Really, the creation and upload of constants should be in the same place,
since they should only happen together, and a state flag should be
triggered by them so that we don't thrash state around so much for just
updating constants.  But this still recovers openarena performance by
another 19%, leaving us 16% behind Mesa 7.4 branch.
2009-05-06 06:44:13 -07:00
Brian Paul
51325f44d1 mesa: only use fallback texture when using shaders, not fixed-function (take two)
The semantics are a little different for shaders vs. fixed-function when
trying to use an incomplete texture.  The fallback texture returning
(0,0,0,1) should only be used with shaders.  For fixed function, the texture
unit is truly disabled/ignored.

Fixes glean fbo test regression.
2009-05-05 16:31:44 -06:00
Brian Paul
823815a485 Revert "mesa: only use fallback texture when using shaders, not fixed-function"
This reverts commit a0edbfb28f.

This patch didn't completely fix the problem.  The next patch will.
2009-05-05 16:30:30 -06:00
Brian Paul
a0edbfb28f mesa: only use fallback texture when using shaders, not fixed-function
The semantics are a little different for shaders vs. fixed-function when
trying to use an incomplete texture.  The fallback texture returning
(0,0,0,1) should only be used with shaders.

Fixes glean fbo test regression.
2009-05-05 16:29:04 -06:00
Brian Paul
01e16befd4 mesa: only use fallback texture when using shaders, not fixed-function
The semantics are a little different for shaders vs. fixed-function when
trying to use an incomplete texture.  The fallback texture returning
(0,0,0,1) should only be used with shaders.

Fixes glean fbo test regression.
2009-05-05 16:21:20 -06:00
Brian Paul
c0d3761c16 mesa: minor simplification in enable_texture(), updated comments 2009-05-05 16:17:55 -06:00
Brian Paul
b3fc832ac7 Merge branch 'mesa_7_5_branch' 2009-05-05 10:13:13 -06:00
Brian Paul
95b7771ea7 gallium: remove redundant cube face #defines 2009-05-05 10:13:11 -06:00
Brian Paul
79ada8c633 gallium: fix texcoords for cubemap mipmap generation
We need to use (s,t,r) cubemap coords when sampling from the cubemap texture
so the rendered quad gets texture samples from the correct cube face.
2009-05-05 10:11:51 -06:00
Keith Whitwell
077c904b76 progs/trivial: add test for vertex program invarient transform 2009-05-05 13:14:54 +01:00
Keith Whitwell
113403ef51 mesa: more complete fix for transform_invarient glitches
Add a new flag mvp_with_dp4 in the context, and use that to switch
both ffvertex.c and programopt.c vertex transformation code to
either DP4 or MUL/MAD implementations.
2009-05-05 13:14:53 +01:00
Keith Whitwell
22b417b75c mesa/main: set PREFER_DP4 to match position_invarient code
This is a quick fix for z fighting in quake4 caused by the mismatch
between vertex transformation here and in the position_invarient code.
Full fix would be to make this driver-tunable and adjust both
position_invarient and ffvertex_prog.c code to respect driver
preferences.
2009-05-05 13:14:52 +01:00
José Fonseca
c6bfb4c559 wgl: Implemente SwapLayerBuffers. 2009-05-05 13:14:51 +01:00
José Fonseca
e9fb90ab88 scons: Don't use deprecated Options. 2009-05-05 13:14:51 +01:00
José Fonseca
3537c3420d util: Limit the stack walk to avoid referencing undefined memory. 2009-05-05 13:14:50 +01:00
Keith Whitwell
b865501bda gallium/tgsi: hack around linker/archiver breakage
Add a dummy function which exists only so that tgsi_text_translate()
doesn't get magic-ed out of the libtgsi.a archive by the build system.
Don't remove unless you know this has been fixed - check on
mingw/scons builds as well.
2009-05-05 13:14:49 +01:00
Keith Whitwell
5f2569a1b9 progs/trivial: add vbo-noninterleaved test 2009-05-05 13:14:48 +01:00
José Fonseca
6b89c35c9f wgl: Include alpha bits in pixel format's cColorBits field. 2009-05-05 13:14:47 +01:00
Keith Whitwell
c6b3c2f34b gallium/draw: cope with unused vertex_elements 2009-05-05 13:14:46 +01:00
Keith Whitwell
4d548bd069 trivial: add line-flat.c 2009-05-05 13:14:45 +01:00
José Fonseca
ccec9f76d5 wgl: UINT_PTR null value is an integral type, so return 0 instead of NULL. 2009-05-05 13:14:44 +01:00
José Fonseca
a47f15ba1d pb: Save the stack backtrace when creating/mapping a debug buffer. 2009-05-05 13:14:42 +01:00
José Fonseca
4fd6f296f8 pb: Dump the fenced buffer sizes. 2009-05-05 13:14:38 +01:00
Stephane Marchesin
8edb50ff1e nv04: small fix again 2009-05-05 12:03:38 +02:00
Stephane Marchesin
39ebeead56 Fix an nv04 bug (thanks Mhopf). 2009-05-05 11:29:58 +02:00
Brian Paul
f95c0c06c0 mesa: also print program params/constants when dumping shaders to disk 2009-05-04 11:14:35 -06:00
Brian Paul
27dbdb1684 mesa: remove some unfinished/devel code 2009-05-04 11:13:35 -06:00
Brian Paul
dd4c142e90 glx: replace Xmalloc() calls with Xcalloc()
Fixes a bug where psp->WaitX was uninitialized.  Reported by Chris Clayton.
2009-05-04 07:52:55 -06:00
Brian Paul
986d4a9ec6 draw: added some inf/nan debug code (disabled) 2009-05-01 18:35:59 -06:00
Brian Paul
08bc3d1750 gallium/glx: say we're direct rendering 2009-05-01 18:35:59 -06:00
Brian Paul
62043b2757 mesa: in glReadBufer() set _NEW_BUFFERS, not _NEW_PIXEL
Since GL_READ_BUFFER is historically part of the gl_pixel_attrib group
it made sense to signal changes with _NEW_PIXEL.  But now with FBOs it's
also part of the framebuffer state.

Now _NEW_PIXEL strictly indicates pixels transfer state changes.

This change avoids framebuffer state validation when any random bit of
pixel-transfer state is set.

DRI drivers updated too:  don't check _NEW_COLOR when updating framebuffer
state.  I think that was just copied from the Xlib driver because we care
about dither enable/disable state there.
2009-05-01 18:31:04 -06:00
Brian Paul
a7ef5b76d6 Merge branch 'mesa_7_5_branch' 2009-05-01 18:21:02 -06:00
Brian Paul
0a56a49687 st: create renderbuffer's pipe_surface in st_render_texture()
Previously we created the pipe_surface during framebuffer validation.
But if we did a glCopyTex[Sub]Image() before anything else we wouldn't yet
have the surface.  This fixes that.
2009-05-01 18:17:34 -06:00
Brian Paul
63f0130980 mesa: fix state validation bug for glCopyTex[Sub]Image()
We need to make sure the framebuffer state is up to date to make sure we
read pixels from the right buffer when doing a texture image copy.
2009-05-01 18:04:07 -06:00
Brian Paul
602833b107 st: if st_swapbuffers() is called for single-buffered visual don't crash
Furthermore, return pointer(s) to the front color buffer(s).
2009-05-01 16:44:04 -06:00
Brian Paul
b57b6c2d2c xlib winsys: use new st_swapbuffers() function
The front/back buffer pointers are truly swapped (when there is an actual
front buffer).

This fixes some issues seen with apps/tests that draw to both the front
and back color buffers.  The true swap allows us to avoid the (potentially)
slow surface_copy() call in update_framebuffer_state() and is cleaner
overall.
2009-05-01 12:54:20 -06:00
Brian Paul
3f52a853f7 st: when creating an on-demand front color buffer, init to back buffer image
When we create a new front color buffer (user called glDrawBuffer(GL_FRONT))
initialize it to the contents of the back buffer.  Any previous call to
SwapBuffers() would have done that in effect, so make it reality.
2009-05-01 12:54:16 -06:00
Brian Paul
b85b315ebb st: added st_renderbuffer::defined flag
Indicates whether there's defined image contents, or garbage/don't care.
This is set when we draw into a renderbuffer and cleared when we resize/
reallocate a renderbuffer or do a buffer swap (back buffer becomes undefined).

We use this to determine whether the front color buffer has been drawn to,
and whether to display its contents upon glFlush/Finish(), when the new
st_swapbuffers() function is used.
2009-05-01 12:25:42 -06:00
Brian Paul
30b3d80091 mesa: fix comment 2009-05-01 12:12:43 -06:00