Commit graph

41734 commits

Author SHA1 Message Date
Kenneth Graunke
33d0c44910 glsl: Autogenerate builtin_functions.cpp as part of the build process.
Python is already necessary for other parts of Mesa, so there's no
reason we can't just generate it.  This patch updates both make and
SCons to do so.
2011-01-10 19:03:27 -08:00
Ian Romanick
469ea695bb glsl: Disallow 'in' and 'out' on globals in GLSL 1.20
Fixes piglit tests glsl-1.20/compiler/qualifiers/in-01.vert and
glsl-1.20/compiler/qualifiers/out-01.vert and bugzilla #32910.

NOTE: This is a candidate for the 7.9 and 7.10 branches.  This patch
also depends on the previous two commits.
2011-01-10 17:39:16 -08:00
Ian Romanick
a0c2ec8e2d glsl: Refresh autogenerated parser file.
For the previous commit.
2011-01-10 17:39:16 -08:00
Ian Romanick
eebdfdfbcf glsl: Add version_string containing properly formatted GLSL version 2011-01-10 17:39:16 -08:00
Ian Romanick
a302d740bd glcpp: Refresh autogenerated lexer and parser files.
For the previous commit.
2011-01-10 17:38:56 -08:00
Ian Romanick
9ca5300b6e glcpp: Generate an error for division by zero
When GCC encounters a division by zero in a preprocessor directive, it
generates an error.  Since the GLSL spec says that the GLSL
preprocessor behaves like the C preprocessor, we should generate that
same error.

It's worth noting that I cannot find any text in the C99 spec that
says this should be an error.  The only text that I can find is line 5
on page 82 (section 6.5.5 Multiplicative Opertors), which says,

    "The result of the / operator is the quotient from the division of
    the first operand by the second; the result of the % operator is
    the remainder. In both operations, if the value of the second
    operand is zero, the behavior is undefined."

Fixes 093-divide-by-zero.c test and bugzilla #32831.

NOTE: This is a candidate for the 7.9 and 7.10 branches.
2011-01-10 17:37:51 -08:00
Chad Versace
4e09a786d2 glcpp: Regenerate glcpp-parse.c 2011-01-10 17:28:24 -08:00
Chad Versace
4fff52f1c9 glcpp: Fix segfault when validating macro redefinitions
In _token_list_equal_ignoring_space(token_list_t*, token_list_t*), add
a guard that prevents dereferncing a null token list.

This fixes test src/glsl/glcpp/tests/092-redefine-macro-error-2.c and
Bugzilla #32695.
2011-01-10 17:28:24 -08:00
Eric Anholt
c0cdae0368 i965: Use a new miptree to avoid software fallbacks due to drawing offset.
When attaching a small mipmap level to an FBO, the original gen4
didn't have the bits to support rendering to it.  Instead of falling
back, just blit it to a new little miptree just for it, and let it get
revalidated into the stack later just like any other new teximage.

Bug #30365.
2011-01-10 17:21:54 -08:00
Eric Anholt
6bdc319421 intel: Drop the speculatively-use-firstImage-mt in validation.
It's been replaced by just setting texObj->mt to image->mt at TexImage
time.
2011-01-10 17:21:11 -08:00
Eric Anholt
bdc6dc1d7e intel: Don't relayout the texture on maxlevel change.
This avoids relayouts in the common case of glGenerateMipmap() or
people doing similar things.

Bug #30366.
2011-01-10 17:21:11 -08:00
Eric Anholt
48024fb44c intel: When making a new teximage miptree, make a full one.
If we hit this path, we're level 1+ and the base level got allocated
as a single level instead of a full tree (so we don't match
intelObj->mt).  This tries to recover from that so that we end up with
2 allocations and 1 validation blit (old -> new) instead of
allocations equal to number of levels and levels - 1 blits.
2011-01-10 17:21:11 -08:00
Eric Anholt
bd4a2e9209 meta: Don't tweak BaseLevel when doing glGenerateMipmap().
We don't need to worry about levels other than MaxLevel because we're
minifying -- the lower levels (higher detail) won't contribute to the
result.  By changing BaseLevel, we forced hardware that doesn't
support BaseLevel != 0 to relayout the texture object.
2011-01-10 17:21:11 -08:00
Eric Anholt
5b3eb7538c Revert "intel: Always allocate miptrees from level 0, not tObj->BaseLevel."
This reverts commit 7ce6517f3a.
This reverts commit d60145d06d.

I was wrong about which generations supported baselevel adjustment --
it's just gen4, nothing earlier.  This meant that i915 would have
never used the mag filter when baselevel != 0.  Not a severe bug, but
not an intentional regression.  I think we can fix the performance
issue another way.
2011-01-10 17:21:10 -08:00
Kenneth Graunke
da0c0dbab0 i965: Add #defines for HiZ and separate stencil buffer commands. 2011-01-10 15:44:32 -08:00
Kenneth Graunke
4b929c75e2 i965: Add new HiZ related bits to WM_STATE. 2011-01-10 15:44:32 -08:00
Kenneth Graunke
1feee7b1b3 i965: Rename more #defines to 3DSTATE rather than CMD or CMD_3D.
Again, this makes it match the documentation.
2011-01-10 15:44:32 -08:00
Kenneth Graunke
6c5e6cd130 i965: Remove unused #defines which only contain the sub-opcode.
Most _3DSTATE defines contain the command type, sub-type, opcode, and
sub-opcode (i.e. 0x7905).  These, however, contain only the sub-opcode
(i.e. 0x05).  Since they are inconsistent with the rest of the code and
nothing uses them, simply delete them.

The _3DOP and _3DCONTROL defines seemed similar, and were also unused.
2011-01-10 15:44:32 -08:00
Chad Versace
61428dd2ab glsl: At link-time, check that globals have matching centroid qualifiers
Fixes bug 31923: http://bugs.freedesktop.org/show_bug.cgi?id=31923
2011-01-10 15:29:30 -08:00
Tom Fogal
0e3ff159f9 Add GLX_TLS setting to configs/default.
Should have gone in with 31351dc029,
thanks to Dan Nicholson for noticing.
2011-01-10 15:39:21 -07:00
Dave Airlie
a988ddf379 mesa/swrast: handle sRGB FBOs correctly (v2)
From reading EXT_texture_sRGB and EXT_framebuffer_sRGB and interactions
with FBO I've found that swrast is converting the sRGB values to linear for
blending when an sRGB texture is bound as an FBO. According to the spec
and further explained in the framebuffer_sRGB spec this behaviour is not
required unless the GL_FRAMEBUFFER_SRGB is enabled and the Visual/config
exposes GL_FRAMEBUFFER_SRGB_CAPABLE_EXT.

This patch fixes swrast to use a separate Fetch call for FBOs bound to
SRGB and avoid the conversions.

v2: export _mesa_get_texture_dimensions as per Brian's comments.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-01-11 08:32:33 +10:00
Tom Fogal
31351dc029 Export TLS support in gl.pc. 2011-01-10 12:34:02 -07:00
Marek Olšák
9d33e4e16c r300g: add debug option for buffer upload logging 2011-01-10 05:45:10 +01:00
Chia-I Wu
97e9a0e23f st/egl: Fix a void pointer arithmetic warning. 2011-01-10 11:51:13 +08:00
Chia-I Wu
12583174c5 mesa: Remove GLES overlay.
With core mesa doing runtime API checks, GLES overlay is no longer
needed.  Make --enable-gles-overlay equivalent to --enable-gles[12].
There may still be places where compile-time checks are done.  They
could be fixed case by case.
2011-01-10 11:50:35 +08:00
Chia-I Wu
c98ea26e16 egl: Make egl_dri2 and egl_glx built-in drivers.
These two drivers are small in size.  Making them built-in should
simplify packaging.
2011-01-10 11:50:34 +08:00
Chia-I Wu
15f0223931 egl_glx: Load libGL dynamically.
This is a step forward for compatibility with really old GLX.  But the
real reason for making this change now is so that we can make egl_glx a
built-in driver without having to link to libGL.
2011-01-10 11:25:31 +08:00
Chia-I Wu
fef5d14494 egl_dri2: Look up _glapi_get_proc_address dynamically.
In preparation for making egl_dri2 built-in.  It also handles

  symbol lookup error: /usr/local/lib/egl/egl_dri2.so: undefined symbol:
  _glapi_get_proc_address

more gracefully.
2011-01-10 11:23:24 +08:00
Vinson Lee
231ca0ec85 r600: Include mfeatures.h in files that perform feature tests. 2011-01-09 18:29:02 -08:00
Vinson Lee
c45814d6d3 r300: Include mfeatures.h in files that perform feature tests. 2011-01-09 18:25:36 -08:00
Vinson Lee
7a1cdef6c4 r200: Include mfeatures.h in files that perform feature tests. 2011-01-09 18:22:07 -08:00
Jerome Glisse
3349517351 noop: make noop useable like trace or rbug
If you want to enable noop set GALLIUM_NOOP=1 as an env variable.
You need first to enable noop wrapping for your driver see change
to src/gallium/targets/dri-r600/ in this commit as an example.

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2011-01-09 21:04:41 -05:00
Marek Olšák
ac6306e9ca r300g: do not upload the same user buffer several times
Performance++.
2011-01-09 22:43:41 +01:00
Christoph Bumiller
b3d8e1fb3b nvc0: implement queries 2011-01-09 21:50:06 +01:00
Juan Zhao
e59fa4c46c dri2: release texture image.
Add release function for texture_from_pixmap extension.
Some platform need to release texture image for texture_from_pixmap
extension, add this interface for those platforms.
2011-01-09 14:55:16 -05:00
Vinson Lee
fb9c6e681f radeon: Include mfeatures.h in files that perform feature tests. 2011-01-09 01:45:04 -08:00
Vinson Lee
1933e97034 dri/nouveau: Include mfeatures.h in files that perform feature tests. 2011-01-09 01:33:14 -08:00
Vinson Lee
45a56e4730 intel: Include mfeatures.h in files that perform feature tests. 2011-01-09 01:25:54 -08:00
Vinson Lee
14b36cd568 vbo: Include mfeatures.h in files that perform feature tests. 2011-01-09 01:18:23 -08:00
Vinson Lee
edc09358f7 st/mesa: Include mfeatures.h in files that perform feature tests. 2011-01-09 01:04:19 -08:00
Vinson Lee
21750a2d9d mesa: Include mfeatures.h in program.c.
Include mfeatures.h for feature tests.
2011-01-09 00:47:33 -08:00
Dave Airlie
97195d04fd i965g: fix warnings 2011-01-09 17:25:12 +10:00
Dave Airlie
5e044e3900 i965g: update intel_decode from upstream. 2011-01-09 17:21:52 +10:00
Dave Airlie
3ee8d13c00 i965g: update disassembler code from classic.
still a bit of work to do, the winsys gen setting is a bit of a hack.
2011-01-09 17:21:10 +10:00
Dave Airlie
9562284114 i965g: update brw_defines.h from classic driver 2011-01-09 17:21:10 +10:00
Dave Airlie
571b317d02 i965g: update brw_structs.h from classic driver. 2011-01-09 17:21:10 +10:00
Dave Airlie
5826967d2e i965g: update to similiar gen stuff as i965 2011-01-09 17:21:10 +10:00
Marek Olšák
3332229b3b r300g: fix crash when flushing ZMASK
https://bugs.freedesktop.org/show_bug.cgi?id=32912

The fix is to call update_derived_state before user buffer uploads.
I've also moved some code around.

Unfortunately, there are still some ZMASK-related bugs which cause
misrendering, i.e. flushing doesn't always work and glean/fbo fails.
2011-01-09 06:14:23 +01:00
Marcin Slusarz
69191d4123 targets/egl: add libnvc0.a to nouveau libs 2011-01-09 00:46:35 +01:00
Christoph Bumiller
90e29afcb6 nvfx,nv50: pipe_reference the constant buffers 2011-01-08 15:40:14 +01:00