Commit graph

47027 commits

Author SHA1 Message Date
Tom Fogal
c0573fb29d Add an autoconf option for mangling Mesa.
In addition to setting up the flags correctly, this renames the
generated libraries to ensure they get 'Mangled' in the name.
This is very useful for distros and the like, where mangled Mesa
and non-mangled GL libraries typically need to be installed
side-by-side.

Reviewed-by: Dan Nicholson <dbn.lists@gmail.com>
2011-10-17 10:14:26 -06:00
Tom Stellard
53d32600cc r300/compiler: Try to eliminate REPL_ALPHA instructions
Scalar instruction that need to write to the xyz components of a
register must reserve the RGB instruction slot for a REPL_ALPHA
instruction.  With this commit, the scheduler will attempt to free
the RGB slot by moving the write to the w component of a register.
2011-10-16 19:54:48 -07:00
Tom Stellard
8327fd18c9 r300/compiler: More agressive RGB to Alpha conversions 2011-10-16 19:54:48 -07:00
Tom Stellard
653c7af3d6 r300/compiler: Only convert RGB->Alpha when optimizations are enabled 2011-10-16 19:54:48 -07:00
Yuanhan Liu
e9edcf8b1d mesa: add a function to do the image data copy stuff for save_CompressedTex(Sub)Image
Introuduce a simple function called copy_data to do the image data copy
stuff for all the save_CompressedTex*Image function. The function check
the NULL data case to avoid some potential segfault. This also would
make the code a bit simpler and less redundance.

Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-10-17 09:41:58 +08:00
José Fonseca
1448bdf1c0 configure: Use -fno-builtin-memcmp.
Issue spotted by Adam Jackson <ajax at redhat.com>.

http://lists.freedesktop.org/archives/mesa-dev/2011-June/009077.html
2011-10-16 16:11:46 +01:00
José Fonseca
e1e03ce492 gallivm: Eliminate tgsi_util_get_full_src_register_sign_mode call.
It complicates more than it simplifies, now that there's only one negate
bit on TGSI registers.
2011-10-16 14:18:42 +01:00
José Fonseca
e9c1d87ce7 llvmpipe: Use lp_build_ifloor_fract for exp2 calculation.
Instead of separate ifloor / fract calls.

No change for SSE4.1 code, but less FP<->SI conversions on non SSE4.1
systems.
2011-10-16 14:18:41 +01:00
Marek Olšák
1350882e49 Revert "r300g: fix rendering with a non-zero index bias in draw_elements_immediate"
This reverts commit 5506f6ef96.

It breaks more things than it fixes.
2011-10-16 03:19:11 +02:00
Chad Versace
4bcda85698 swrast: Remove redundant term in logic expression
Fix is in {read,draw}_depth_stencil_pixels().  If depthRb == stencilRb,
then it is redundant to check depthRb->x *and* stencilRb->x.

Reviewed-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-10-15 15:49:03 -07:00
Chad Versace
244a02c47d swrast: Fix fastpaths in glRead/WritePixels(GL_DEPTH_STENCIL)
For glReadPixels, the user supplied pixels have format
GL_UNSIGNED_INT_24_8.  But, when the depthstencil buffer's format was
MESA_FORMAT_S8_Z24, the fastpath read from the buffer without reordering
the depth and stencil bits. To fix this, this patch just skips the
fastpath when the format is not MESA_FORMAT_Z24_S8.

The problem and fix for glWritePixels is analagous.

Fixes the Piglit tests below on i965/gen6 and causes no regressions.
   general/depthstencil-default_fb-drawpixels-24_8
   general/depthstencil-default_fb-readpixels-24_8
   EXT_packed_depth_stencil/fbo-depthstencil-GL_DEPTH24_STENCIL8-drawpixels-24_8
   EXT_packed_depth_stencil/fbo-depthstencil-GL_DEPTH24_STENCIL8-readpixels-24_8

Note: This is a candidate for the stable branches.
Reviewed-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-10-15 15:45:07 -07:00
Christoph Bumiller
9934bfe28d nv50,nvc0: extend formats table for integer formats 2011-10-15 14:12:31 +02:00
Christoph Bumiller
a4f26f2bea gallium: add PIPE_BIND_BLENDABLE flag
This is required for an accurate implementation of d3d1x's
CheckFormatSupport query.

It also seems generally useful for state trackers, which could
choose alternative rendering paths or formats if blending would
come at a significant performance loss.
2011-10-15 14:12:31 +02:00
Tom Stellard
0dc97e7fd4 r300/compiler: Enable reg rename pass on r500 and run it before optimizations
The scheduler and the register allocator are now smart enough to handle
it.
2011-10-14 18:30:14 -07:00
Tom Stellard
163629fd05 r300/compiler: Implement the texture semaphore
The texture semaphore allows for prefetching of texture data.  On my
RV515, this increases the FPS of Lightsmark by 33% (This is with the
reg_rename pass enabled, which is enabled in the next commit).

There is a new env variable now called RADEON_TEX_GROUP, which allows
you to specify the maximum number of texture lookups to do at once.
The default is 8, but different values could produce better results
for various application / card combinations.
2011-10-14 18:30:14 -07:00
Tom Stellard
51fe9994bd r300/compiler: Don't pair output writes with GPR writes in the scheduler 2011-10-14 18:30:14 -07:00
Tom Stellard
6fafb6beb7 r300/compiler: Prevent regalloc from creating non-native swizzles 2011-10-14 18:30:14 -07:00
Tom Stellard
47c7512846 r300/compiler: Allow merged instructions to be scheduled on demand
We no longer emit full instructions immediately after they have been
merged.  Instead merged instructions are added to the ready list and
the scheduler can commit them whenever it wants.
2011-10-14 18:30:14 -07:00
Ian Romanick
c19f8ab279 mesa/vbo: Treat attribute 0 and vertex as the same
This is supported by the pseudo-code on pages 27 and 28 (pages 41 and
42 of the PDF) of the OpenGL 2.1 spec.  The last part of the
implementation of ArrayElement is:

    if (generic attribute array 0 enabled) {
      if (generic vertex attribute 0 array normalization flag is set, and
	  type is not FLOAT or DOUBLE)
	VertexAttrib[size]N[type]v(0, generic vertex attribute 0 array element i);
      else
	VertexAttrib[size][type]v(0, generic vertex attribute 0 array element i);
    } else if (vertex array enabled) {
      Vertex[size][type]v(vertex array element i);
    }

Page 23 (page 37 of the PDF) of the same spec says:

    "Setting generic vertex attribute zero specifies a vertex; the
    four vertex coordinates are taken from the values of attribute
    zero. A Vertex2, Vertex3, or Vertex4 command is completely
    equivalent to the corresponding VertexAttrib* command with an
    index of zero."

Fixes piglit test attribute0.

NOTE: This is a candidate for stable branches.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-10-14 09:40:31 -07:00
Marek Olšák
ae272a92a1 r300g: set max vertex samplers to 0 on swtcl chipsets
This should fix a bug added by f5bfe54a.

Might also fix:
https://bugs.freedesktop.org/show_bug.cgi?id=41715
2011-10-14 15:06:01 +02:00
Thomas Hellstrom
5dddeb7776 winsys/svga: Rework buffer allocation to make it more robust v2.
Don't allow any "CPU" buffers to be allocated by the pb_fenced
buffer manager, since we can't protect against failures during
buffer validation.
Also, add an extra slab buffer manager to allocate buffers from
the kernel if there is a failure to allocate from our big buffer pool.
The reason we use a slab manager for this, is to avoid allocating
many very small buffers from the kernel.

v2: Increased VMW_MAX_BUFFER_SIZE and fixed some comments.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: José Fonseca <jfonseca@vmware.com>
Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
2011-10-14 09:53:19 +02:00
Thomas Hellstrom
83d57635bc dri-vmwgfx: Hook up a drm_descriptor configuration function
Returns a configuration that makes the dri state-tracker-manager
throttle.
Also disable kernel-based throttling.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
2011-10-14 09:53:15 +02:00
Thomas Hellstrom
bde2fc5a71 st/dri: Hook up throttling based on the drm driver_descriptor configuration
Hooks up throttling if there is a configuration function present and
it indicates that throttling is desired.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
2011-10-14 09:53:11 +02:00
Thomas Hellstrom
ec7d5b8c02 drm_driver: Add a configuration function to the driver descriptor.
Adds a possibility for the state tracker manager to query the
target for a specific configuration.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
2011-10-14 09:53:05 +02:00
Thomas Hellstrom
5a6ca7e9f2 svga/winsys: Make sure a flush always inserts and returns a fence if requested
Needed for throttling.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Jakob Bornecrant <jakob@vmware.com>
2011-10-14 09:53:01 +02:00
Thomas Hellstrom
23c41233ce st/dri: Implement the new dri2 throttling extension
But don't hook it up just yet until we figure out a good way to do that.
Also, we should, in the future, add driconf options to control what
throttling reasons should be honored, and the number of outstanding
swaps allowed.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
2011-10-14 09:52:57 +02:00
Thomas Hellstrom
511dc295f8 dri2: Implement a throttle dri extension.
The X server has limited throttle support on the server side,
but doing this in the client has some benefits:

1) X server throttling is per client. Client side throttling can be done
per drawable.

2) It's easier to control the throttling based on what client is run,
for example using "driconf".

3) X server throttling requires drm swap complete events.

So implement a dri2 throttling extension intended to be used by direct
rendering clients.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
Reviewed-by: Michel Dänzer <michel@daenzer.net>
2011-10-14 09:52:53 +02:00
Brian Paul
718cbe4ba9 swrast: be a bit smarter in clip_span()
If no pixels pass the clip test, return false.
2011-10-13 17:16:19 -06:00
Brian Paul
bc4ef33108 mesa: remove unused gl_sampler_object::_CompleteTexture field 2011-10-13 17:14:24 -06:00
Brian Paul
6fc6d5a09e meta: fix redBits size test in get_temp_image_type()
Fixes https://bugs.freedesktop.org/show_bug.cgi?id=41768
2011-10-13 17:12:44 -06:00
Mathias Froehlich
7b09a94282 st/wgl: Release stw_framebuffer::mutex after pbuffer creation.
This change releases the stw_framebuffer::mutex past creation of
the pbuffer stw_framebuffer. Without this change the pbuffers
lock is never released. Since on win32 mutexes are recursive, this
does not hurt as long as all actions on a context are done from
the same thread. But if, for example, context creation happens in
a different thread than usage, every access to the context will
block for ever.

Signed-off-by: José Fonseca <jfonseca@vmware.com>
2011-10-13 19:53:13 +01:00
Marcin Slusarz
349e4db99e st/xorg: fix build without LLVM 2011-10-13 19:02:20 +02:00
Paul Berry
7a4fee71aa i965 Gen6+: De-compact clip plane constants for old VS backend.
In commit 018ea68d87, when I
de-compacted clip planes on Gen6+, I updated both the old and new VS
back-ends to reflect the change in how clip planes are stored, but I
failed to change the code in gen6_vs_state.c that uploads clip plane
constants when using the old VS back-end.

As a result, if the set of enabled clip planes wasn't contiguous
starting with 0, then clipping would not occur properly.  This patch
corrects gen6_vs_state.c to upload clip plane constants in the new
de-compacted form.

This only affects the old VS back-end (which is used for
fixed-function and ARB vertex programs, not for GLSL vertex shaders).

Fixes Piglit test fixed-clip-enables.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=41603

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-10-13 08:41:16 -07:00
Brian Paul
a9e5528f09 st/mesa: kill instruction if writemask=0 in eliminate_dead_code_advanced()
This fixes a bug where we'd wind up emitting an invalid instruction like
MOVE R[0]., R[1];  - note the empty/zero writemask.  If we don't write to
any dest register channels, cull the instruction.

v2: simply change/fix the existing test for instruction culling.
2011-10-13 08:35:19 -06:00
Brian Paul
e06277bd88 s/format/baseFormat/ to be more explicit
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-10-13 07:38:28 -06:00
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