Commit graph

48729 commits

Author SHA1 Message Date
Brian Paul
d69d287068 mesa: remove the dstX/Y/Zoffset params to _mesa_texstore() functions
The were always zero.  When doing a sub-texture replacement we account
for the dstX/Y/Zoffsets when we map the texture image.  So no need to
pass them into the texstore code anymore.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-01-02 11:55:39 -07:00
Brian Paul
e833b98182 intel: pass xoffset, yoffset = 0 to _mesa_texstore()
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-01-02 11:55:39 -07:00
Eric Anholt
c82c24b18b i965: Silence gcc warning about uninitialized "inst" in assert() case. 2012-01-02 10:38:47 -08:00
Eric Anholt
bf2c7469fb i965: Silence gcc warning from resizing EU store changes. 2012-01-02 10:38:47 -08:00
Christian König
bce506ffc0 vl: seperate shader buffers from components
Buffers for shader based decoding can now be
released without its component still being around.

Signed-off-by: Christian König <deathsimple@vodafone.de>
Acked-by: Maarten Lankhorst <m.b.lankhorst@gmail.com>
2012-01-02 12:47:15 +01:00
Marek Olšák
2cd7e5b737 r300g: inline r300_resource_set_properties 2012-01-01 11:47:06 +01:00
Marek Olšák
ce9d61fec6 r300g: rework resource_copy_region, not changing pipe_resource
Changing pipe_resource was wrong, because it can be used by other contexts
at the same time. This fixes the last possible race condition in r300g
that I know of.

This also fixes blitting NPOT compressed textures. Random pixels sometimes
appeared at the right-hand edge of the texture.

Finally, this removes r300_texture_desc::stride_in_pixels. It makes little
sense with sampler views and surfaces being able to override width0, height0,
and the format entirely.
2012-01-01 11:47:05 +01:00
Marek Olšák
ce31970af1 u_blitter: expose functions for setting default views and surfaces for copying
And more importantly, don't call u_sampler_view_default_template etc.
it was a source of bugs.
2012-01-01 11:47:05 +01:00
Dave Airlie
b5fd0e04a7 st_glsl_to_tgsi: translate interp mode for front/back color
this fixes a bunch of interpolation tests on softpipe at least.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-12-31 13:48:19 +00:00
Dave Airlie
c44f6e0489 softpipe: reorder LIT to fix fp-lit-src-equals-dst
This reorders the LIT operation like the r600 one to fix the
fp-lit-src-equals-dst piglit test.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-12-31 13:17:23 +00:00
Dave Airlie
24668a38d1 llvmpipe: fix blending for intensity formats
This fixes the piglit fbo-blending-formats test for standard, ARB_texture_float
and EXT_texture_snorm.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-12-31 12:37:48 +00:00
Brian Paul
99fbf7ce34 st/mesa: remove stImage->base.Face/Level assignments in st_TexImage()
This fixes a regresssion (broken cube maps) caused by the
ctx->Driver.TexImage parameter simplification commit.  The target var
is always GL_TEXTURE_CUBE_MAP at this point so the Face field was always
getting set to zero.

These field assignments aren't needed anyway since core Mesa sets them.
2011-12-30 16:42:27 -07:00
Dave Airlie
bed4c7ea5e u_format: fix latc fetches.
This fixes the latc fetches for llvmpipe, fixes
fbo-generatemipmap-formats GL_ARB_texture_compression
fbo-generatemipmap-formats GL_ATI_texture_compression_3dc
fbo-generatemipmap-formats GL_EXT_texture_compression_latc

Signed-off-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Dave Airlie <airlied@gmail.com>
2011-12-30 21:20:18 +00:00
Dave Airlie
0c6ee788f2 u_format/rgtc: fix alpha values in returned texels.
This fixes fbo-generatemipmap-formats GL_EXT_texture_compression_rgtc
on llvmpipe.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-12-30 20:31:34 +00:00
Alexander von Gluck
141d961d84 glsl: fix usage of potentially undefined data_end union
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-12-30 08:48:51 -07:00
Brian Paul
797960dbec st/glx/xlib: check for null attrib_list in glXCreateContextAttribsARB()
Fixes https://bugs.freedesktop.org/show_bug.cgi?id=44234
2011-12-30 08:38:58 -07:00
Brian Paul
bec2ea8ef4 mesa: simplify Driver.GetCompressedTexImage() parameters
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-12-30 08:24:56 -07:00
Brian Paul
94a0c518dc mesa: simplify Driver.CompressedTex[Sub]Image function parameters
As with previous commits, the target, level and texObj info can be
obtained through the texImage pointer.

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-12-30 08:24:56 -07:00
Brian Paul
92c64624cd mesa: simplify Driver.TexImage() parameters
As with TexSubImage(), the target, level and texObj values can be obtained
through the texImage pointer.

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-12-30 08:24:55 -07:00
Brian Paul
da0cc82a09 mesa: simplify Driver.TexSubImage() parameters
There's no need to pass the target, level and texObj parameters since
they can be easily obtained from the texImage pointer.

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-12-30 08:24:55 -07:00
Brian Paul
c22a95c4f2 st/mesa: remove TexSubImage code, use core mesa routines instead.
Since the move to Map/UnmapTextureImage, the core mesa routines are
equivalent to what the state tracker was doing.

The TexImage functions can be replaced too, but there's a few differences
that will need to be handled.
2011-12-30 08:24:55 -07:00
Dave Airlie
4ca624f8e0 u_format: fix inv_swizzles generation
inv_swizzles is used in lp_tile_soa.py to create lp_tile_soa.c, we overwrite swizzles if they are already set.

This results in the i8 format getting alpha instead of red, and the l8 format
getting blue instead of red.

Fixes fbo-alphatest-formats, fbo-alphatest-formats ARB_texture_float,
and fbo-alphatest-formats EXT_texture_snorm on llvmpipe.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-12-30 13:43:52 +00:00
Michel Dänzer
7dd2d29a56 r600g: Manage fences per screen rather than per context.
A fence is a screen object and can outlive the context it was created from.
The previous code would access freed memory in that case, resulting in
various problems.

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

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

NOTE: This is a candidate for the 7.11 branch.

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Mathias Fröhlich <Mathias.Froehlich@web.de>
2011-12-30 10:45:31 +01:00
Stéphane Marchesin
0e57b66fa1 i915g: Allocate tmp for KILP
This fixes https://bugs.freedesktop.org/show_bug.cgi?id=44297
2011-12-30 01:33:26 -08:00
Yuanhan Liu
efa1fac215 vbo: introduce vbo_sizeof_ib_type() function
introduce vbo_sizeof_ib_type() function to return the index data type
size. I see some place use switch(ib->type) to get the index data type,
which is sort of duplicate.

Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-12-30 13:53:40 +08:00
Stéphane Marchesin
ded02bd54b llvmpipe: Remove useless draw_install_pstipple_stage call.
It is #ifdef'd out, and is already called unconditionnaly a couple lines above.

Reviewed-By: Jose Fonseca <jfonseca@vmware.com>
2011-12-29 12:28:44 -08:00
Chad Versace
747f030762 intel: Fix memory leak in intel_miptree_create()
On failure, intel_miptree_create() needs to *release* the miptree, not
just free it, so that the stencil_mt gets released too.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2011-12-29 10:47:44 -08:00
Eric Anholt
069901e2f5 i965/fs: Allow constant propagation into IF with embedded compare.
This saves a couple of instructions on most programs with control
flow.  More interestingly, 6 shaders from unigine sanctuary now fit
into 16-wide without register spilling.
2011-12-29 09:33:56 -08:00
Eric Anholt
6a1e19d0f6 intel: Drop the batchbuffer flush on glRenderbufferStorage().
There's nothing batchbuffer-related here.  State updates by the caller
will trigger re-emitting of any new hardware state.
2011-12-29 09:33:56 -08:00
Eric Anholt
2529fde36e intel: Drop the batchbuffer flush on glFramebufferRenderbuffer().
There should be nothing special about this call compared to other
callers of intel_draw_buffer().
2011-12-29 09:33:56 -08:00
Eric Anholt
b890f1090c intel: Make the batchbuffer flush debug more useful.
We were printing out the line triggering the flush, but a variety of
different causes just printed the line number for intel_flush()'s call
of intel_batchbuffer_flush().  Plumb the line numbers from the caller
of intel_flush() on through.
2011-12-29 09:33:56 -08:00
Eric Anholt
7f854a5028 intel: Fix performance regression in Lightsmark since HiZ changes.
Since the refactor in d7b33309fe, depth
in the miptree changed from 1 to 6, so we always decided it didn't
match, and we would relayout to something that would still not
"match".

Improves performance 23.8% (+/- 1.1%, n=4)

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=43329
2011-12-29 09:33:56 -08:00
Eric Anholt
ab7794cada intel: Don't consider miptrees for other texture targets to match.
We would have done a relayout at validate time, but it's senseless to
store into a miptree if it's going to force relayout.
2011-12-29 09:33:56 -08:00
Vinson Lee
0ddb759991 mesa: Use __builtin_ffsll on Mac OS X.
Fixes this GCC warning.
arrayobj.c: In function '_mesa_update_array_object_max_element':
arrayobj.c:310: warning: implicit declaration of function 'ffsll'

Signed-off-by: Vinson Lee <vlee@vmware.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-12-28 23:27:55 -08:00
Stéphane Marchesin
11cdf24d15 i915g: Add missing draw_flush call.
Fixes a bunch of corruption bugs, especially some missing clipped triangles.
2011-12-28 12:36:26 -08:00
José Fonseca
62e968d6da mesa: Re-add main/bitset.h to fix classic nouveau build failure.
bitset.h is still used by classic nouveau -- see `git grep '\<BITSET_'`
-- and the state stored is too big to fit in 64bit integers (it requires
approximately 87 bits), so there is no obvious alternative here.

This effecively reverts commit 196800d798.
2011-12-28 11:14:52 +00:00
Mathias Fröhlich
196800d798 mesa: Remove now unused main/bitset.h.
Signed-off-by: Mathias Froehlich <Mathias.Froehlich@web.de>
2011-12-28 11:05:13 +01:00
Mathias Fröhlich
1ef3a94536 mesa: Remove remaining FEATURE_ARB_vertex_buffer_object guards.
Since commit 82b9661894 and
34eae1c72a vbo support
is mandatory for all drivers. So, remove the remaining
FEATURE_ARB_vertex_buffer_object guards.

Signed-off-by: Mathias Froehlich <Mathias.Froehlich@web.de>
2011-12-28 11:05:13 +01:00
Mathias Fröhlich
ccbf192f59 mesa: Convert to use GLbitfield64 directly.
Signed-off-by: Mathias Froehlich <Mathias.Froehlich@web.de>
Reviewed-by: Brian Paul <brianp@vmare.com>
2011-12-28 07:35:24 +01:00
Mathias Fröhlich
45cd15bfae radeon: Convert to use GLbitfield64 directly.
Signed-off-by: Mathias Froehlich <Mathias.Froehlich@web.de>
Reviewed-by: Brian Paul <brianp@vmare.com>
2011-12-28 07:35:24 +01:00
Mathias Fröhlich
19c46d3d7b nouveau: Convert to use GLbitfield64 directly.
Signed-off-by: Mathias Froehlich <Mathias.Froehlich@web.de>
Reviewed-by: Brian Paul <brianp@vmare.com>
2011-12-28 07:35:23 +01:00
Mathias Fröhlich
b49b1e4642 i915: Convert to use GLbitfield64 directly.
Signed-off-by: Mathias Froehlich <Mathias.Froehlich@web.de>
Reviewed-by: Brian Paul <brianp@vmare.com>
2011-12-28 07:35:23 +01:00
Mathias Fröhlich
50e0091a9d mesa: Convert RENDERINPUTS* macros to GLbitfield64.
Signed-off-by: Mathias Froehlich <Mathias.Froehlich@web.de>
Reviewed-by: Brian Paul <brianp@vmare.com>
2011-12-28 07:35:23 +01:00
Stéphane Marchesin
b50d250e02 i915g: Only apply the optimization to output vars.
This is a bit overkill, but otherwise we need to rename subsequent uses, which is a future TODO.
Reported by CME.
2011-12-27 17:08:26 -08:00
Kenneth Graunke
07ee9f374f i965/vs: Properly clear cur_value when propagating direct copies.
Consider the following code:

MOV A.x, B.x
MOV B.x, C.x

After the first line, cur_value[A][0] == B, indicating that A.x's
current value came from register B.

When processing the second line, we update cur_value[B][0] to C.
However, for drect copies, we fail to reset cur_value[A][0] to NULL.
This is necessary because the value of A is no longer the value of B.

Fixes Counter-Strike: Source in Wine (where the menu rendered completely
black in DX9 mode), completely white textures in Civilization V, and the
new Piglit test glsl-vs-copy-propagation-1.shader_test.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=42032
Tested-by: Matt Turner <mattst88@gmail.com>
Tested-by: Christopher James Halse Rogers <christopher.halse.rogers@canonical.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2011-12-27 14:33:38 -08:00
Kenneth Graunke
443c8d1ab7 i965/vs: Fix incorrect subscript when resetting copy propagation records.
In this code, 'i' loops over the number of virtual GRFs, while 'j' loops
over the number of vector components (0 <= j <= 3).

It can't possibly be correct to see if bit 'i' is set in the destination
writemask, as it will have values much larger than 3.  Clearly this is
supposed to be 'j'.

Found by inspection.

Tested-by: Matt Turner <mattst88@gmail.com>
Tested-by: Christopher James Halse Rogers <christopher.halse.rogers@canonical.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2011-12-27 14:33:37 -08:00
Chad Versace
7420c9dab4 i965: Create mock implementation of GL_OES_EGL_image_external
In Android IceCreamSandwich, SurfaceFlinger requires GL_OES_image_external
for basic compositing tasks. Without the extension, SurfaceFlinger fails
to start.

Despite the incompleteness of the extension's implementation introduced by
this patch, it is good enough to enable SurfaceFlinger and to unblock the
people who need to begin testing Mesa on IceCreamSandwich.

To enable the extension, set the environment variable
MESA_EXTENSION_OVERRIDE="+GL_OES_EGL_image_external". Ideally, Android
should set this in init.rc.

WARNING: This implementation of GL_OES_EGL_image_external is not complete.
Some of it is even incorrect. When we begin to really implement
GL_OES_EGL_image_external, much of the patch will need reverting.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2011-12-27 10:20:25 -08:00
Chad Versace
7e5ffd9be2 meta: Disable GL_TEXTURE_EXTERNAL_OES in meta_begin()
If the meta flag MESA_META_TEXTURE is present, then disable the texture
target GL_TEXTURE_EXTERNAL_OES.

Reviewed-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2011-12-27 10:20:25 -08:00
Alexander von Gluck
ac8a933aa8 mklib: tab cleanup, no functional change
Reviewed-by: Brian Paul <brianp@vmare.com>
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-12-27 09:18:25 -07:00
Alexander von Gluck
a3752fa63b mesa: fpclassify is available on Haiku
Reviewed-by: Brian Paul <brianp@vmare.com>
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-12-27 09:16:56 -07:00