Commit graph

41557 commits

Author SHA1 Message Date
Jian Zhao
2a7380e9c3 mesa: fix an error in uniform arrays in row calculating.
Fix the error in uniform row calculating, it may alloc one line
more which may cause out of range on memory usage, sometimes program
aborted when free the memory.

NOTE: This is a candidate for 7.9 and 7.10 branches.

Signed-off-by: Brian Paul <brianp@vmware.com>
2011-01-07 07:22:18 -07:00
Vinson Lee
db61b9ce39 mesa: Directly include mfeatures.h in files that perform feature tests. 2011-01-07 00:13:00 -08:00
Alex Deucher
7c320a869b r600c: fix up SQ setup in blit code for Ontario/NI 2011-01-07 03:10:50 -05:00
Dave Airlie
6d9ca78ef7 r600g: allow constant buffers to be user buffers.
This provides an upload facility for the constant buffers since Marek's
constants in user buffers changes.

gears at least work on my evergreen now.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-01-07 10:35:41 +10:00
Alex Deucher
7b97bdba40 r600c: add support for NI asics 2011-01-06 18:40:17 -05:00
Alex Deucher
f54366bcf6 r600g: add support for NI (Northern Islands) GPUs
This adds support for Barts, Turks, and Caicos asics.
2011-01-06 18:05:16 -05:00
Kenneth Graunke
e31defc825 i965: Rename various gen6 #defines to match the documentation.
This should make it easier to cross-reference the code and hardware
documentation, as well as clear up any confusion on whether constants
like CMD_3D_WM_STATE mean WM_STATE (pre-gen6) or 3DSTATE_WM (gen6+).

This does not rename any pre-gen6 defines.
2011-01-06 13:56:26 -08:00
Jakob Bornecrantz
ff0f087513 svga: Ensure that the wrong vdecls don't get used in swtnl path
The draw module set new state that didn't require swtnl which caused need_swtnl to
be unset. This caused the call from to svga_update_state(svga, SVGA_STATE_SWTNL_DRAW)
from the vbuf backend to overwrite the vdecls we setup there to be overwritten with
the real buffers vdecls.
2011-01-06 20:09:07 +00:00
Ian Romanick
f2d0f776b1 glsl: Refresh autogenerated lexer and parser files.
For the previous commit.
2011-01-06 10:53:38 -08:00
Ian Romanick
86b4398cd1 glsl: Support the 'invariant(all)' pragma
Previously the 'STDGL invariant(all)' pragma added in GLSL 1.20 was
simply ignored by the compiler.  This adds support for setting all
variable invariant.

In GLSL 1.10 and GLSL ES 1.00 the pragma is ignored, per the specs,
but a warning is generated.

Fixes piglit test glsl-invariant-pragma and bugzilla #31925.

NOTE: This is a candidate for the 7.9 and 7.10 branches.
2011-01-06 10:49:56 -08:00
Ian Romanick
e942f32836 glsl: Allow less restrictive uses of sampler array indexing in GLSL <= 1.20
GLSL 1.10 and 1.20 allow any sort of sampler array indexing.
Restrictions were added in GLSL 1.30.  Commit f0f2ec4d added support
for the 1.30 restrictions, but it broke some valid 1.10/1.20 shaders.
This changes the error to a warning in GLSL 1.10, GLSL 1.20, and GLSL
ES 1.00.

There are some spurious whitespace changes in this commit.  I changed
the layout (and wording) of the error message so that all three cases
would be similar.  The 1.10/1.20 and 1.30 text is the same.  The only
difference is that one is an error, and the other is a warning.  The
GLSL ES 1.00 wording is similar but not quite the same.

Fixes piglit test
spec/glsl-1.10/compiler/constant-expressions/sampler-array-index-02.frag
and bugzilla #32374.
2011-01-06 10:06:59 -08:00
Marek Olšák
c60f1d8b00 r300g: fix corruption when nr_cbufs==0 and multiwrites enabled
https://bugs.freedesktop.org/show_bug.cgi?id=32634
2011-01-06 19:05:31 +01:00
Marek Olšák
6125cbe983 r300g: remove the buffer range checking
It's no longer needed because the upload buffer remains mapped while the CS
is being filled (openarena, ut2004 and others that this code was for do not
use VBOs by default).
2011-01-06 16:59:32 +01:00
Marek Olšák
31afa7616e r300g: skip buffer validation of upload buffers when appropriate
because the upload buffers are reused for subsequent draw operations.
2011-01-06 16:51:54 +01:00
Marek Olšák
45b51a9e70 util: add comments to u_upload_mgr and u_inlines 2011-01-06 16:16:30 +01:00
Marek Olšák
984d64881f vbo: remove a redundant call to _ae_invalidate_state
It's called in vbo_exec_invalidate_state too.
2011-01-06 16:16:30 +01:00
Marek Olšák
009cecf246 st/mesa: remove unused members in st_context
What were these for?
2011-01-06 16:16:30 +01:00
Marek Olšák
92209314df tgsi: remove redundant name tables from tgsi_text, use those from tgsi_dump
I also specified the array sizes in the header so that one can use
the Elements macro on it.
2011-01-06 16:16:30 +01:00
Marek Olšák
3c9aa3a7b1 gallium: drivers should reference vertex buffers
So that a state tracker can unreference them after set_vertex_buffers.
2011-01-06 16:16:29 +01:00
Marek Olšák
58c5e782e3 st/mesa: optimize constant buffer uploads
The overhead of resource_create, transfer_inline_write, and resource_destroy
to upload constant data is very visible with some apps in sysprof, and
as such should be eliminated.

My approach uses a user buffer to pass a pointer to a driver. This gives
the driver the freedom it needs to take the fast path, which may differ
for each driver.

This commit addresses the same issue as Jakob's one that suballocates out
of a big constant buffer, but it also eliminates the copy to the buffer.
2011-01-06 16:16:29 +01:00
Marek Olšák
5adcd9c911 st/mesa: do sanity checks on states only in debug builds 2011-01-06 16:16:29 +01:00
Marek Olšák
06286110b4 u_upload_mgr: new features
- Added a parameter to specify a minimum offset that should be returned.
  r300g needs this to better implement user buffer uploads. This weird
  requirement comes from the fact that the Radeon DRM doesn't support negative
  offsets.

- Added a parameter to notify a driver that the upload flush occured.
  A driver may skip buffer validation if there was no flush, resulting
  in a better performance.

- Added a new upload function that returns a pointer to the upload buffer
  directly, so that the buffer can be filled e.g. by the translate module.
2011-01-06 16:16:29 +01:00
Marek Olšák
8b7bd3ce88 u_upload_mgr: keep the upload buffer mapped until it is flushed
The map/unmap overhead can be significant even though there is no waiting on busy
buffers. There is simply a huge number of uploads.

This is a performance optimization for Torcs, a car racing game.
2011-01-06 16:16:29 +01:00
Pierre Allegraud
8fd8de3995 mesa: fix build for NetBSD
See http://bugs.freedesktop.org/show_bug.cgi?id=32859

NOTE: This is a candidate for the 7.9 and 7.10 branches.

Signed-off-by: Brian Paul <brianp@vmware.com>
2011-01-06 08:00:01 -07:00
Brian Paul
1384aea50f glext: upgrade to version 67 2011-01-06 07:56:00 -07:00
Vinson Lee
ab564b516e mesa: Clean up header file inclusion in version.c.
Include imports.h directly instead of indirectly through context.h.
version.c does use any symbols that are added by context.h.
2011-01-06 00:45:08 -08:00
Vinson Lee
84ebd8e2d7 nvc0: Fix typo of nvc0_mm.c in SConscript. 2011-01-06 00:06:38 -08:00
Vinson Lee
becd98018b mesa: bump version to 7.11 2011-01-05 23:27:30 -08:00
Vinson Lee
0117da40cd mesa: Include mtypes.h in files that use gl_context struct.
Directly include mtypes.h if a file uses a gl_context struct. This
allows future removal of headers that are not strictly necessary but
indirectly include mtypes.h for a file.
2011-01-05 23:11:54 -08:00
Zou Nan hai
a728646fb5 i965: skip too small size mipmap
this fixes doom3 crash.
2011-01-06 11:36:23 +08:00
Eric Anholt
d60145d06d i915: Fix build for previous commit. 2011-01-05 18:28:13 -08:00
Eric Anholt
7ce6517f3a intel: Always allocate miptrees from level 0, not tObj->BaseLevel.
BaseLevel/MaxLevel are mostly used for two things: clamping texture
access for FBO rendering, and limiting the used mipmap levels when
incrementally loading textures.  By restricting our mipmap trees to
just the current BaseLevel/MaxLevel, we caused reallocation thrashing
in the common case, for a theoretical win if someone really did want
just levels 2..4 or whatever of their texture object.

Bug #30366
2011-01-05 18:23:54 -08:00
Eric Anholt
01b70c0628 intel: Drop unused first/lastlevel args to miptree_create_for_region.
We're always making a single-level, 0-baselevel miptree.
2011-01-05 18:11:31 -08:00
Vinson Lee
f84573d039 swrast: Include mtypes.h in s_triangle.c.
Include mtypes.h for gl_context symbol.
2011-01-05 17:46:39 -08:00
Vinson Lee
20d85865ec st/mesa: Include mtypes.h in st_cb_drawpixels.c.
Include mtypes.h for gl_context symbol.
2011-01-05 16:34:29 -08:00
Eric Anholt
1b18b45d79 intel: Clarify first_level/last_level vs baselevel/maxlevel by deletion.
This has always been ugly about our texture code -- object base/max
level vs intel object first/last level vs image level vs miptree
first/last level.  We now get rid of intelObj->first_level which is
just tObj->BaseLevel, and make intelObj->_MaxLevel clearly based off
of tObj->_MaxLevel instead of duplicating its code (incorrectly, as
image->MaxLog2 only considers width/height and not depth!)
2011-01-05 16:11:30 -08:00
Eric Anholt
9b7f57b18e mesa: Consider textures incomplete when maxlevel < baselevel.
See section 3.8.10 of the GL 2.1 specification.  There's no way to do
anything sane with that, and drivers would get all sorts of angry.
2011-01-05 15:51:37 -08:00
Eric Anholt
39cc0ee3ea i915: Enable LOD preclamping on 8xx like on 915/965.
Fixes lodclamp-between and lodclamp-between-max.
2011-01-05 14:50:27 -08:00
Eric Anholt
973e821a63 i915: Implement min/max lod clamping in hardware on 8xx.
This avoids 8xx-specific texture relayout for min/max lod changes.
One step closer to avoiding relayout for base/maxlevel changes!
2011-01-05 14:50:24 -08:00
Eric Anholt
6f31da584f intel: Drop TEXTURE_RECTANGLE check in miptree layout setup.
It's already handled by our non-mipmapped MinFilter, since
TEXTURE_RECTANGLE is always NEAREST or LINEAR.
2011-01-05 14:45:16 -08:00
Eric Anholt
8f0005bfd5 intel: Clean up redundant setup of firstLevel.
It's always BaseLevel (since TEXTURE_RECTANGLE's baselevel can't be
changed from 0), except for 8xx minlod hilarity.
2011-01-05 14:45:16 -08:00
Eric Anholt
e2ee0c55d3 intel: Drop a check for GL_TEXTURE_4D_SGIS.
The SGIS_texture4D extension was thankfully never completed, so we
couldn't implement it if we wanted to.
2011-01-05 14:45:16 -08:00
Vinson Lee
d5435b3f0c swrast: Remove unnecessary headers. 2011-01-05 13:47:02 -08:00
Eric Anholt
332a90e101 i965: Simplify the renderbuffer setup code.
It was quite a mess by trying to do NULL renderbuffers and real
renderbuffers in the same function.  This clarifies the common case of
real renderbuffers.
2011-01-05 10:28:10 -08:00
Michel Dänzer
c7c1e5338c st/xorg: Flesh out colour map support and support depth 8. 2011-01-05 11:41:56 +01:00
Xiang, Haihao
266d8eed69 i965: use BLT to clear buffer if possible on Sandybridge
This fixes https://bugs.freedesktop.org/show_bug.cgi?id=32713
2011-01-05 14:12:40 +08:00
Eric Anholt
06cb1a6a5b i965: Add support for SRGB DXT1 formats.
This makes
fbo-generatemipmap-formats GL_EXT_texture_sRGB-s3tc
match
fbo-generatemipmap-formats GL_EXT_texture_compression_s3tc

and swrast in bad DXT1_RGBA alpha=0 handling, but it means we won't
unpack and repack someone's textures into uncompressed SARGB8 format.
2011-01-04 16:43:35 -08:00
Vinson Lee
5a3f31575b glcpp: Add test for recursive #define. 2011-01-04 16:39:19 -08:00
Eric Anholt
3488b14a04 mesa: Fix the baseFormat for GL_COMPRESSED_SLUMINANCE_EXT.
It's just LUMINANCE, not LUMINANCE_ALPHA.  Fixes
fbo-generatemipmap-formats GL_EXT_texture_sRGB-s3tc assertion failure
when it tries to pack the L8 channels into LUMINANCE_ALPHA and wonders
why it's trying to do that.
2011-01-04 15:25:35 -08:00
Eric Anholt
5dbb856e96 intel: Merge our choosetexformat fallbacks into core.
We now share the type/format -> MESA_FORMAT_* mappings with software
mesa, and the core supports most of the fallbacks hardware drivers
will want.
2011-01-04 14:42:54 -08:00