Commit graph

42973 commits

Author SHA1 Message Date
Brian Paul
d7db14ab7d mesa: test against MaxUniformComponents in check_resources()
Since we're compiling/linking GLSL shaders we should check against
the shader uniform limits, not the legacy vertex/fragment program
parameter limits which are usually lower.
2011-03-11 10:04:17 -07:00
Brian Paul
e0e94026a0 mesa: move location of some geometry program limits
The gl_program_constants struct is for limits that are applicable to
any/all shader stages.  Move the geometry shader-only fields into the
gl_constants struct.
Remove redundant MaxGeometryUniformComponents field too.
2011-03-11 09:25:22 -07:00
Brian Paul
8cc84b3e45 mesa: use check_resources() to check program against limits
Without these checks we could create shaders with more samplers,
constants than the driver could handle.  Fail linking rather than
dying later.
2011-03-11 09:25:22 -07:00
Brian Paul
decc6e2a32 mesa: replace NEED_SECONDARY_COLOR(), RGBA_LOGICOP_ENABLED() with inlines
and rename them.
2011-03-11 09:25:21 -07:00
Brian Paul
4293a12c7f mesa: call FLUSH_VERTICES() before deleting shaders, buffers, query objects
Need to flush rendering (or at least indicate that the rug might be getting
pulled out from underneath us) when a shader, buffer object or query object
is about to be deleted.

Also, this helps to tell the VBO module to unmap its current vertex buffer.
2011-03-11 09:25:21 -07:00
Brian Paul
a4a5d7e0dd vega: remove unused pipe var 2011-03-11 09:25:21 -07:00
José Fonseca
530ad1ff6f svga: Propagate discard/unsynchronized flags to the host when doing texture DMAs. 2011-03-11 15:03:21 +00:00
José Fonseca
f0ea6395b6 util: Fix typo in u_upload_flush().
upload->offset is how much we used. upload->size is the whole buffer size.
2011-03-11 11:54:26 +00:00
Nicolas Peninguy
b6c9c78bff r300g: fix alignement for NPOT values in hyperz setup
With 3 pipes cards we need to align with NPOT values. This fixes:
https://bugs.freedesktop.org/show_bug.cgi?id=32945

Signed-off-by: Nicolas Peninguy <nico@lostgeeks.org>
2011-03-11 04:36:37 +01:00
Marek Olšák
8a01cb8793 draw: remove unnecessary flush 2011-03-11 02:02:16 +01:00
Marek Olšák
cb06f180e3 st/vega: remove unnecessary flushes
I don't see a reason we need them.
2011-03-11 02:02:16 +01:00
Marek Olšák
bdf1038940 st/mesa: remove unnecessary flushes
The framebuffer cache flush should be implicit when calling
set_framebuffer_state.

There is no need to flush the command stream either.
2011-03-11 02:02:16 +01:00
Thomas Hellstrom
ded1e315a4 Revert "gallium/svga: Only upload parts of vertexarrays that are actually used"
This reverts commit 6d4e337f38.

The commit is incorrect. I'll rework it. Revert for now.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
2011-03-10 23:31:42 +01:00
Daniel Vetter
fb3b712b84 i915g: implement surface clear functions using hw-clear
Tested by temporarily using util_clear even when not using the blitter.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2011-03-10 23:04:20 +01:00
Daniel Vetter
6ad4a11b3e i915g: make set_framebuffer_state more robust
u_blitter is lazy and doesn't fully clear it's stack-allocated fb.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2011-03-10 23:04:19 +01:00
Daniel Vetter
6358e6371b i915g: implement hw clear
Benefits:
- spares us a relocation.
- needed for zone rendering (if that ever happens).
- just awesome.

v2: Rename the debug option. Completely disabling the blitter is
required for Y tiling to work, so this option will cover other
code paths in the future.

v3: Implement suggestions by Jakob Bornecrantz.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2011-03-10 23:04:10 +01:00
Daniel Vetter
8c420db1c4 i915g: blitter handles overlapping blits
No need to assert.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2011-03-10 22:47:50 +01:00
Daniel Vetter
55d2d7fb3a i915g: enable separate depth/stencil clears
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2011-03-10 22:47:49 +01:00
Daniel Vetter
9070879a79 i915g: streamline derived state updates of the driver pipeline
Flushing the batch/hw backend doesn't invalidate the derived state.
So kill the unnecessary function calls and add an assert in
emit_hardware_state for paranoia.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2011-03-10 22:47:48 +01:00
Daniel Vetter
b0dd74aaf7 i915g: don't validate a NULL vbo
With the new clear code this is possible (if the app call glClear
before drawing the first primitive).

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2011-03-10 22:47:47 +01:00
Brian Paul
7dcf019af2 gallium/util: new polygon stipple utility helper
The polygon stipple fallback does not have to be implemented in the
draw module (it doesn't need window coords, etc).  Drivers can use
this utility and avoid sw vertex fallbacks if pstipple is enabled.
Note: this is WIP and not used by any driver yet.
2011-03-10 09:44:32 -07:00
Brian Paul
0eab3a8a97 glsl: silence warning in printf() with a cast 2011-03-10 09:29:00 -07:00
Brian Paul
76a43c5fba glx: fix null pointer deref in __glXGenerateError()
The gc var would be NULL if called from line 238.  Instead, get
the opcode from __glXSetupForCommand(dpy) as done in other places.
And remove the unused gc parameter.

Fixes a bug reported by "John Doe" on 3/9/2011.

NOTE: This is a candidate for the 7.10 branch.
2011-03-10 08:50:52 -07:00
Thomas Hellstrom
6d4e337f38 gallium/svga: Only upload parts of vertexarrays that are actually used
Make sure we only upload parts of vertex arrays that are actually used
by a draw command.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
2011-03-10 14:30:50 +01:00
Dave Airlie
9b7f377635 r600: don't close fd on failed load
This fd gets passed in from outside, closing it causes the X.org server
to crap out when the driver doesn't identify the chipset.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-03-10 12:01:43 +10:00
Eric Anholt
f6ca4a304b intel: Don't complain when getparam fails due to a missing param.
This is an expected behavior when we're testing for the presence of
new kernel features.
2011-03-09 12:54:47 -08:00
Chris Wilson
ea004a3aed i965: Pack the tracked state atoms into separate arrays for prepare/emit.
Improves performance of a hacked-up scissor-many (to reuse a small set
of scissors instead of blowing out the cache, and then to run 100x
more iterations so it actually took some time) by 3.6% +/- 1.2% (n=10)
2011-03-09 10:18:29 -08:00
Christoph Bumiller
caaa7fdd6f nv50: add back initialization of redefine_user_buffer
Got lost in f80c03e187.
2011-03-09 17:26:33 +01:00
Christian König
bb4f2a0f35 r600g: remove some now unneeded code from r600_bc_vtx_build 2011-03-09 14:49:03 +01:00
Christian König
2ed56d3170 r600g: R700+ can do more than 8 tex and vtx clause in one CF inst
Reviewed-by: Henri Verbeet <hverbeet@gmail.com>
2011-03-09 14:49:03 +01:00
Christian König
8dc1dfc9f0 r600g: split R600 and R700 CF generation for VTX and TEX
Reviewed-by: Henri Verbeet <hverbeet@gmail.com>
2011-03-09 14:49:03 +01:00
José Fonseca
8308272291 svga: Add a new winsys entry point to query the hw version. 2011-03-09 13:34:21 +00:00
José Fonseca
d5249b7d89 util: Use PIPE_TRANSFER_DISCARD_WHOLE_RESOURCE in pipe_buffer_write. 2011-03-09 11:17:45 +00:00
Keith Whitwell
05efcee46e util: add ensure_sanity checks, fix a bug
Add ensure_sanity checks.
Fix a bug which caused us to misplace entries adding to a full cache.
2011-03-09 11:17:14 +00:00
Keith Whitwell
20962bf547 util: improve cache collision behaviour
Add linear probing on collisions.

Expand entry array by a fixed scale (currently 2) to help avoid
collisions.

Use a LRU approach to ensure that the number of entries stored in the
cache doesn't exceed the requested size.
2011-03-09 11:16:53 +00:00
Alex Corscadden
d00cbf46cd util: Add remove to util_cache
I need to be able to remove entries from util_cache caches.  This change
enables that functionality.
2011-03-09 11:16:49 +00:00
Alex Corscadden
eb2e8167fa util: Allow util_draw_texquad to draw quads with non-integer coordinates. 2011-03-09 11:16:49 +00:00
José Fonseca
0ffd603e17 wgl: Force framebuffer validation on glViewport. 2011-03-09 09:58:35 +00:00
Thomas Hellstrom
52e598d200 gallium/svga: Don't replace user vertex buffer with uploaded copy
Do that later on when we set up the hwtnl state instead.
This addresses a problem when we drop the uploaded copy due to a vb
size change, it will remain referenced in svga->curr.vb[], and the
new contents of the vb will never be uploaded.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
2011-03-09 08:49:33 +01:00
Vinson Lee
c0d3fb4b6c scons: Fix immediate Python exceptions with SCons on SunOS.
The build still fails.
2011-03-08 17:59:57 -08:00
Vinson Lee
67f61199c2 st/python: Add timeout parameter to fence_finish.
This is a follow-up to commit b39bccbd4e.

Fixes Linux SCons build.
2011-03-08 16:18:16 -08:00
Marek Olšák
ac8821ffe2 r300g: handle timeout parameter in fence_finish 2011-03-08 23:52:37 +01:00
Marek Olšák
b39bccbd4e gallium: add timeout parameter to fence_finish
This is a follow-up to the ARB_sync patch for st/mesa and completes
the ARB_sync implementation.
2011-03-08 23:52:37 +01:00
Marek Olšák
5257a6dbc6 st/mesa: implement ARB_sync
The ServerWaitSync implementation matches Intel's driver.

The extension is advertised when pipe_screen::fence_finish is set.
2011-03-08 23:52:37 +01:00
Marek Olšák
5ef807c036 r300g: add LATC support 2011-03-08 23:52:37 +01:00
Marek Olšák
b0ec461954 st/mesa: cleanup checking for signed compressed formats in generate_mipmaps 2011-03-08 23:52:37 +01:00
Marek Olšák
384845f335 st/mesa: add LATC and 3DC support
softpipe passes all tests.
2011-03-08 23:52:37 +01:00
Marek Olšák
23f92c20d7 gallium/util: add LATC support
Again, a lot of code is shared with RGTC.

The layout is UTIL_FORMAT_LAYOUT_RGTC, because LATC is just swizzled RGTC.
2011-03-08 23:52:37 +01:00
Marek Olšák
69f16accd0 mesa: add ATI_texture_compression_3dc
LUMINANCE_ALPHA_LATC2 = LUMINANCE_ALPHA_3DC, so this is easy.

Note that there is no specification for 3DC, just a few white papers
from ATI.
2011-03-08 23:52:37 +01:00
Marek Olšák
7d16e2c0cd mesa: add EXT_texture_compression_latc
The encoding/decoding algorithms are shared with RGTC.
Thanks to some magic with the base format, the RGTC texstore functions work
for LATC too.

swrast passes the related piglit tests besides two things:
- The alpha channel is wrong (it's always 1), however the incorrect alpha
  channel makes some other tests fail too, so I guess it's unrelated to LATC.
- Signed LATC fetches aren't correct yet (signed values are clamped to [0,1]),
  however RGTC has the same problem.

Further testing (with other of my patches) shows that hardware drivers
and softpipe work.

BTW, ETQW uses this extension.
2011-03-08 23:52:37 +01:00