Commit graph

46992 commits

Author SHA1 Message Date
Brian Paul
241b3e4bbe mesa: remove redundant buffer checks in copytexsubimage_error_check2()
Again, there was already a call to _mesa_source_buffer_exists() earlier in
the function.

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-10-13 07:38:24 -06:00
Brian Paul
63aa53bf34 mesa: remove redundant buffer checks in copytexture_error_check()
There was already a call to _mesa_source_buffer_exists() earlier in
the function.

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-10-13 07:38:03 -06:00
Brian Paul
504d0add12 mesa: check attachment Type field in renderbuffer_exists()
Instead of the renderbuffer pointer.  In the future, attaching a texture
may not mean the renderbuffer pointer gets set too.
Plus, remove some commented-out assertions.
2011-10-13 07:37:43 -06:00
Brian Paul
e5fef34c21 mesa: consolidate _mesa_source/dest_buffer_exists()
v2: add a 'reading' parameter to distinguish between reading and writing
to the renderbuffer (we don't want to check if _ColorReadBuffer is null
when we're about to draw).  Eric found this mistake.
2011-10-13 07:37:43 -06:00
Christoph Bumiller
f1f7645f23 d3d1x: fix check for PIPE_CAP_CONDITIONAL_RENDER 2011-10-13 11:04:08 +02:00
José Fonseca
983fa4ad52 scons: Use -fno-builtin-memcmp.
ipers framerate on llmvpipe improves 60%.

Issue spotted by Adam Jackson <ajax at redhat.com>.

http://lists.freedesktop.org/archives/mesa-dev/2011-June/009077.html
2011-10-12 20:43:01 +01:00
Dave Airlie
ae1153c4ac softpipe: fix regression with tex tile cache since integer support.
Don't use the uint/int paths for ZS formats for tex tile cache.

fixes: https://bugs.freedesktop.org/show_bug.cgi?id=41695

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-10-12 08:25:28 +01:00
Brian Paul
7aab0fbaa6 mesa: make _mesa_update_depth/stencil_buffer() static
These functions were only called in framebuffer.c where they were defined.
Remove the unneeded attIndex parameter too.

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-10-11 18:43:36 -06:00
Chad Versace
e9adfa2ba1 intel: Assert that no batch is emitted if a region is mapped
What I would prefer to assert is that, for each region that is currently
mapped, no batch is emitted that uses that region's bo. However, it's much
easier to implement this big hammer.

Observe that this requires that the batch flush in intel_region_map() be
moved to within the map_refcount guard.

v2: Add comments (borrowed from anholt's reply) explaining why the
assertion is a good idea.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-10-11 17:16:31 -07:00
Paul Berry
d06cc42c3c i965: Fix computation of abs(-x) in FS
When updating a register reference to reflect the fact that we were
taking its absolute value, the fragment shader back-end failed to
clear the negate flag, resulting in abs(-x) getting computed as
-abs(x).

I also found (and fixed) a similar problem in brw_eu.h, but I'm not
aware of an actual manifestation of that problem.

Fixes piglit test glsl-fs-abs-neg-with-intermediate.
2011-10-11 11:08:13 -07:00
Marcin Slusarz
7f3de70c3c nv50: don't crash on TXD opcode
It doesn't implement full TXD, but at least it does not crash.
Fixes arb_shader_texture_lod-texgrad and glsl-fs-shadow2DGradARB-*
piglit tests.
2011-10-11 19:35:04 +02:00
Kenneth Graunke
3f5e938a9d i965: Replace incorrect use of GLboolean with enum brw_compression.
brw_set_compression_control took a GLboolean as an argument, then
promptly used a switch statement to compare it with various enumeration
values.  Clearly it's not actually a boolean.

Introduce a new enumeration type, enum brw_compression, and use that.

Found by converting GLboolean to bool; clang then gave warnings about
switching on a boolean and ultimately duplicated case errors.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Chad Versace <chad@chad-versace.us>
2011-10-11 10:26:52 -07:00
Ian Romanick
da2e41cd88 mesa: Only allow queries of window system FBO on desktop GL w/ARB_fbo
Neither OES_framebuffer_object nor EXT_framebuffer_object allow
querying the window system FBO.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2011-10-11 09:01:09 -07:00
Ian Romanick
a8328cc132 mesa: Accept GL_DEPTH and GL_STENCIL for window system FBO only
Previously GL_DEPTH_BUFFER and GL_STENCIL_BUFFER were (incorrectly)
allowed for both.  Those enums don't even really exist!  Now GL_DEPTH
and GL_STENCIL are only allowed for the window system FBO.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2011-10-11 09:00:54 -07:00
Brian Paul
b875838ec3 svga: remove old, unused sincos code for SM2.0 2011-10-11 09:55:48 -06:00
Brian Paul
94b219b9e2 svga: remove support for shader model 2.0
We've been requiring SM 3.0 all along so this just removes unused code.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2011-10-11 09:30:09 -06:00
Dave Airlie
396ac41fc2 softpipe: add integer support
This adds support to the clear and tile caches for integer storage
and clearing, avoiding any floating paths.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-10-11 16:13:29 +01:00
Dave Airlie
866f9b18c6 gallium: rename ZS stencil type to UINT (v2)
these are never USCALED, always UINT in reality.

taken from some work by Christoph Bumiller

v2: fixup formatting of table + tabs

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-10-11 16:13:29 +01:00
Brian Paul
6b3e75de7c llvmpipe: don't support rendering to sRGB surfaces
Fixes https://bugs.freedesktop.org/show_bug.cgi?id=34199
2011-10-11 07:47:25 -06:00
Brian Paul
11938c87a3 draw/llvm: set draw->pt.user.planes field in draw_set_clip_state()
Previously it was getting set in draw_set_mapped_constant_buffer() but
if there were no shader constants, that function wasn't called.  So the
pt.user.planes field was null and we died when we tried to access the
clip planes in the LLVM-generated code.

Fixes https://bugs.freedesktop.org/show_bug.cgi?id=41663

Note: This is a candidate for the 7.11 branch.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2011-10-11 07:41:36 -06:00
Brian Paul
e6c237cfd6 draw/llvm: fix hard-coded number of total clip planes
Instead of 12 use DRAW_TOTAL_CLIP_PLANES.  The max number of user-defined
clip planes was increased to 8 so the total number of planes is 14.
This doesn't fix any specific bug, but clearly the old code was wrong.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2011-10-11 07:41:22 -06:00
Brian Paul
f0c036536f i915g: fix warning about void pointer arithmetic 2011-10-11 07:40:11 -06:00
Stéphane Marchesin
a13eed4b82 i915g: Remove duplicated comment. 2011-10-10 18:18:37 -07:00
Stéphane Marchesin
4855522678 i915g: Update TODO once more. 2011-10-10 16:56:49 -07:00
Chad Versace
f378e8fea0 i965: Change type of brw_context.primitive from GLenum to hardware primitive
For example, GL_TRIANLGES is converted to _3DPRIM_TRILIST.

The conversion is necessary because HiZ and MSAA resolve operations emit
a 3DPRIM_RECTLIST, which cannot be conveyed by GLenum.

As a consequence, brw_gs_prog_key.primitive is also converted.

v2
----
- [anholt] Split brw_set_prim into brw/gen6 variants in previous commit,
  since not much code is really shared between the two.
- [anholt] Replace switch statements with table lookups, since this is
  a hot path.

Reviewed-by: Eric Anholt <eric@anho.net>
Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-10-10 13:24:11 -07:00
Chad Versace
9559ca600d i965: Split brw_set_prim into brw/gen6 variants
The "slight optimization to avoid the GS program" in brw_set_prim() is not
used by Gen 6, since Gen 6 doesn't use a GS program. Also, Gen 6 doesn't use
reduced primitives.

Also, document that intel_context.reduced_primitive is only used for Gen < 6

Reviewed-by: Eric Anholt <eric@anho.net>
Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-10-10 13:23:41 -07:00
Dave Airlie
95fd5e5aba r600g: drop force int type workaround
now that we have integer texture types I can drop this workaround so that
copies of values is done properly (as floats would fail on some corner cases).

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-10-10 20:53:26 +01:00
Dave Airlie
8d3e505ed6 r600g: add integer texture/render integer formats for r600/700.
with these I can drop the force int type hack.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-10-10 20:52:35 +01:00
Eric Anholt
d950a778b7 mesa: Prevent repeated glDeleteProgram() from blowing away our refcounts.
glDeleteProgram should only be able to remove the one refcount for the
user's reference to the program from the hash table (even though that
ref does live on in the hash table until the last other ref is
removed).

Fixes piglit ARB_shader_objects/delete-repeat.

Reviewed-by: Chad Versace <chad@chad-versace.us>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-10-10 11:38:52 -07:00
Zou Nan hai
7457da5edd i965: Fix timer query on gen6+
PIPE_CONTROL reported time stamp are 64 bits value incrementing every
80 ns, and only the low 32 bits are active (high 32 are always 0).

v2: Cleaned up whitespace, function arguments (anholt).

Fixes piglit EXT_timer_query/time-elapsed

Signed-off-by: Zou Nan hai <nanhai.zou@intel.com>
Signed-off-by: Eric Anholt <eric@anholt.net>
2011-10-10 11:38:52 -07:00
Ian Romanick
9f0e98d1df linker: Fix a slightly incorrect comment
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-10-10 10:23:53 -07:00
Ian Romanick
f3650b05cf hash_table: Make string_to_uint_map make a copy of the name
The hash table needs a copy of the key that it can keep for
comparisons during searches.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=41499
Cc: Stéphane Marchesin <stephane.marchesin@gmail.com>
Tested-by: Luzipher <luziphermcleod@yahoo.ie>
Tested-by: Michał Lipski <tallica@o2.pl>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-10-10 10:21:20 -07:00
Dave Airlie
9e66b25880 u_blitter: clean up velem setup
as per Brian's suggestion, drop the pointless loops.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-10-10 17:22:17 +01:00
Stéphane Marchesin
6bf8c7c010 i915g: Update the TODO with another idea. 2011-10-10 00:15:06 -07:00
Stéphane Marchesin
9977fb42ac i915g: Enable instanced drawing. 2011-10-10 00:15:05 -07:00
Stéphane Marchesin
ddba509c16 mesa/st: Check for a NULL _LinkedShader[i] before using it.
The rest of the linker/glsl translation code checks for NULL, so I suppose we should check here too. Fixes crash on exit with i915g instanced drawing.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-10-10 00:15:05 -07:00
Marek Olšák
0f55f133f1 u_blitter: query vertex shader caps instead of geometry for int vertices 2011-10-09 18:19:58 +02:00
Dave Airlie
9b34cea7e9 r600g: uarl fixes.
Not 100% sure these are correct yet
2011-10-09 16:48:45 +01:00
Dave Airlie
ddcdd6137b r600g: enable integer shader cap for evergreen.
Will get to adding r600/r700/cayman support, have it mostly written on
another PC.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-10-09 16:48:45 +01:00
Dave Airlie
dd20256a1c u_blitter: don't create integer vertex elements unless shader supports them
Should fix https://bugs.freedesktop.org/show_bug.cgi?id=41613

We don't want to create these vertex elements unless the pipe driver
vertex stage can handle integers.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-10-09 16:36:41 +01:00
José Fonseca
ee1487953b st/glx/xlib: Advertise GLX_ARB_create_context(_profile)
They were already implemented, but not advertised.
2011-10-09 16:11:26 +01:00
Marcin Slusarz
90dcd6c89a nouveau: hide some debugging messages behind environment variable
They spam console, but are not very useful - hide them behind
NOUVEAU_MESA_DEBUG environment variable.
2011-10-09 14:49:30 +02:00
Marcin Slusarz
f03810fbdd nv50,nvc0: avoid unnecessary flushes
Relocations don't consume pushbuffer space, so there is no need to
ensure there is any space in pushbuffer.
2011-10-09 14:49:30 +02:00
Marcin Slusarz
9849f366cb nouveau: fix fence hang
If there is not enough space in pushbuffer for fence emission
(nouveau_fence_emit -> nv50_screen_fence_emit -> MARK_RING),
the pushbuffer is flushed, which through flush_notify ->
nv50_default_flush_notify -> nouveau_fence_update marks currently
emitting fence as flushed. But actual emission is done after this mark.
So later when there is a need to wait on this fence and pushbuffer
was not flushed in between, fence wait will never finish causing
application to hang.

To fix this, introduce new fence state between AVAILABLE and EMITTED,
set it before emission and handle it everywhere.

Additionally obtain fence sequence numbers after possible flush in
MARK_RING, because we want to emit fences in correct order.

Reviewed-by: Christoph Bumiller <e0425955@student.tuwien.ac.at>

Note: This is a candidate for the 7.11 branch.
2011-10-09 14:49:30 +02:00
Dave Airlie
0110aa09e5 r600g/eg: add integer types support
adds handling for int texture/vertices to evergreen.

TODO r600/700 support.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-10-09 10:06:18 +01:00
Dave Airlie
4e28e6f6c7 u_blitter: add integer clear support
We need add a new set of fragment shader variants, along with new vertex
elements for signed and unsigned clears.

The new fragment shader variants are due to the integers values requiring
CONSTANT interpolation. The new vertex element descriptions are for passing
the clear color as an unsigned or signed integer value.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-10-09 10:01:08 +01:00
Stéphane Marchesin
06415d3fab i915g: Remove another TODO item which was done a while ago. 2011-10-08 23:58:46 -07:00
Stéphane Marchesin
5dfeab71cf i915g: Remove a TODO item. 2011-10-08 23:58:06 -07:00
Stéphane Marchesin
03cd54dc60 i915g: Fix comment. 2011-10-08 23:57:27 -07:00
Stéphane Marchesin
8a22064d31 i915g: Implement vertex textures. 2011-10-08 23:54:53 -07:00