Commit graph

48156 commits

Author SHA1 Message Date
Marek Olšák
d26b49f87f r600g: do not loop in radeon_family_from_device
Also move that function to r600_drm.c
2011-09-12 22:03:02 +02:00
Marek Olšák
85f5d7ceee r600g: cleanup build include dirs and dependencies
The scons build still depended on libdrm_radeon.
2011-09-12 22:03:02 +02:00
José Fonseca
fb5995cf53 scons: Don't use gstabs on mingw-64. 2011-09-12 17:23:47 +01:00
Marek Olšák
f37a5081b2 st/mesa: clamp Max program param limits
Setting just MAX_PROGRAM_ENV_PARAMS to 4096 breaks everything,
so let's do this instead.

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

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-09-12 16:55:21 +02:00
Marek Olšák
4682e70601 pb_buffer: inline 'base' sub-struct 2011-09-11 18:29:27 +02:00
Marek Olšák
2154c672b3 r300g: handle the new CAPs 2011-09-11 15:47:23 +02:00
Emil Velikov
f0bfc0daa8 tgsi: fix typo in commit 324ac982d8
Reviewed-by: Bryan Cain <bryancain3@gmail.com>
2011-09-10 14:09:29 -05:00
Maarten Lankhorst
1465dc26a5 nouveau: Add support for XvMC acceleration
Try to use the PMPEG where available

Signed-off-by: Maarten Lankhorst <m.b.lankhorst@gmail.com>
2011-09-10 14:22:11 -04:00
Bryan Cain
10dbd02927 glsl_to_tgsi: use UARL instead of I2F and ARL
Since TGSI now has a UARL opcode that takes an integer as the source, it is
no longer necessary to hack around the lack of an integer ARL opcode using I2F.
UARL is only emitted when native integers are enabled; ARL is still used
otherwise.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-09-10 12:46:47 -05:00
Bryan Cain
324ac982d8 gallium: add TGSI opcodes UARL and UCMP
They are needed by glsl_to_tgsi for an efficient implementation using native
integers.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-09-10 12:46:41 -05:00
Marek Olšák
9222c497f9 mesa: fix more valgrind warnings
==27540== Invalid read of size 4
==27540==    at 0x96277B7: _mesa_make_extension_string (string3.h:144)
==27540==    by 0x9604E78: _mesa_make_current (context.c:1514)
==27540==    by 0x9602A8B: st_api_make_current (st_manager.c:789)
==27540==    by 0x45406E7: ???
==27540==  Address 0xad35b30 is 3,688 bytes inside a block of size 3,691 alloc'd
==27540==    at 0x4025315: calloc (vg_replace_malloc.c:467)
==27540==    by 0x9627641: _mesa_make_extension_string (extensions.c:910)
==27540==    by 0x9604E78: _mesa_make_current (context.c:1514)
==27540==    by 0x9602A8B: st_api_make_current (st_manager.c:789)
==27540==    by 0x45406E7: ???

And:

==28351== Invalid write of size 2
==28351==    at 0x4C087CC: _mesa_make_extension_string (string3.h:144)
==28351==    by 0x4BE6198: _mesa_make_current (context.c:1514)
==28351==    by 0x4BD4CAB: st_api_make_current (st_manager.c:789)
==28351==  Address 0x48dd1f3 is 19 bytes inside a block of size 20 alloc'd
==28351==    at 0x4025315: calloc (vg_replace_malloc.c:467)
==28351==    by 0x4C08711: _mesa_make_extension_string (extensions.c:778)
==28351==    by 0x4BE6198: _mesa_make_current (context.c:1514)
==28351==    by 0x4BD4CAB: st_api_make_current (st_manager.c:789)
==28351==
==28351== Invalid read of size 4
==28351==    at 0x4C087EC: _mesa_make_extension_string (extensions.c:806)
==28351==    by 0x4BE6198: _mesa_make_current (context.c:1514)
==28351==    by 0x4BD4CAB: st_api_make_current (st_manager.c:789)
==28351==  Address 0x48dd1f4 is 0 bytes after a block of size 20 alloc'd
==28351==    at 0x4025315: calloc (vg_replace_malloc.c:467)
==28351==    by 0x4C08711: _mesa_make_extension_string (extensions.c:778)
==28351==    by 0x4BE6198: _mesa_make_current (context.c:1514)
==28351==    by 0x4BD4CAB: st_api_make_current (st_manager.c:789)

The first part adds 2, because ' ' and '\0' may be written at the end
of the buffer.
2011-09-10 19:40:36 +02:00
Brian Paul
aa77df1355 draw/llvm: combine draw_llvm_generate() and draw_llvm_generate_elts()
These two functions were nearly the same with lots of duplicated code.
Now pass in a boolean 'elts' flag and use a few conditionals to implement
the linear vs. indexed cases.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2011-09-10 10:34:44 -06:00
Tom Stellard
3d32e58987 r300/compiler: Implement ROUND
According to the GLSL spec, the implementor can decide which way to round
when the fraction is .5.  The r300 compiler will round down.
2011-09-10 06:36:53 -07:00
Marek Olšák
2a5cbc5306 mesa: fix a valgrind warning
==5715== Invalid read of size 4
==5715==    at 0x4AA590B: _mesa_make_extension_string (extensions.c:908)
==5715==    by 0x4A83198: _mesa_make_current (context.c:1514)
==5715==    by 0x4A71CAB: st_api_make_current (st_manager.c:789)
==5715==  Address 0x4795730 is 0 bytes inside a block of size 1 alloc'd
==5715==    at 0x4025315: calloc (vg_replace_malloc.c:467)
==5715==    by 0x4AA5B4C: _mesa_make_extension_string (extensions.c:772)
==5715==    by 0x4A83198: _mesa_make_current (context.c:1514)
==5715==    by 0x4A71CAB: st_api_make_current (st_manager.c:789)
2011-09-10 15:12:54 +02:00
Marek Olšák
7e30216879 st/dri: remove the call to driInitExtensions
The function no longer exists. This fixes Gallium build.
2011-09-10 12:33:02 +02:00
Marek Olšák
6b9a36cc3f r600g: fix shadow rect samplers 2011-09-10 08:53:29 +02:00
Marek Olšák
c8b0b13d40 r600g: use SAMPLE_LB for OPCODE_TXB 2011-09-10 08:53:29 +02:00
Marek Olšák
b37931f69b r600g: enable texture arrays 2011-09-10 08:53:29 +02:00
Marek Olšák
929ad43b11 r600g: add support for shadow array samplers
I had to guess & verify how some of the SAMPLE instructions work.
2011-09-10 08:53:29 +02:00
Marek Olšák
23b4ad4626 r600g: implement texture arrays for evergreen 2011-09-10 08:53:29 +02:00
Marek Olšák
840ad139af r600g: always decompress all mipmaps and layers, slices, or faces of zbuffers
This fixes piglit/fbo-depth-array.

Reviewed-by: Dave Airlie <airlied@redhat.com>
2011-09-10 08:53:29 +02:00
Marek Olšák
c4519c3aec r600g: fix texture array filtering
This fixes piglit/fbo-generatemipmap-array.

It looks like SQ_TEX_SAMPLER_WORD0_0.TEX_ARRAY_OVERRIDE should be set
for array textures in order to disable filtering between slices,
which adds a dependency between sampler views and sampler states.

This patch reworks sampler state updates such that they are postponed until
draw time. TEX_ARRAY_OVERRIDE is updated according to bound sampler views.

This also consolidates setting the texture state between vertex and
pixel shaders.
2011-09-10 08:53:29 +02:00
Marek Olšák
9edd0b5ddf glsl_to_tgsi: fix shadow2DArray comparison
v2: adjust the assertion, add a comment
2011-09-10 08:53:29 +02:00
Marek Olšák
da7233840f ir_to_mesa: fix shadow2DArray comparison
The depth should be in W.

v2: adjust the assertion, add a comment
2011-09-10 08:53:29 +02:00
Marek Olšák
274768856d u_blitter: add texture array support
Reviewed-by: Dave Airlie <airlied@redhat.com>
2011-09-10 08:53:29 +02:00
Marek Olšák
19ff7666f3 st/mesa: convert shadow array samplers to TGSI 2011-09-10 08:53:29 +02:00
Marek Olšák
d8452a0be8 gallium: add shadow 1D and 2D array samplers to TGSI
And filling in all the switch statements in auxiliary. Mostly untested.
2011-09-10 08:53:29 +02:00
Marek Olšák
3794291372 gallium: add PIPE_CAP_MAX_TEXTURE_ARRAY_LAYERS
v2: remove PIPE_CAP_ARRAY_TEXTURES in favor of the new CAP.
2011-09-10 08:53:29 +02:00
Ian Romanick
5a175127f3 dri: Remove all extension enabling utility functions
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-09-09 14:02:20 -07:00
Ian Romanick
67d9063492 swrast-dri: Remove call to driInitExtensions
The only purpose this call served in the DRI swrast driver was to
initialize the remap table.  Core Mesa already does the dispatch
offset remapping for every function that could possibly ever be
supported.  There's no need to continue using that cruft in the
driver.
2011-09-09 14:02:20 -07:00
Ian Romanick
6fb32b4a5f radeon: Enable extensions by just setting the flags
Core Mesa already does the dispatch offset remapping for every
function that could possibly ever be supported.  There's no need to
continue using that cruft in the driver.

Since the call to _mesa_enable_imaging_extensions (via
driInitExtensions) is removed, EXT_blend_color, EXT_blend_logic_op,
and EXT_blend_minmax are no longer advertised.  These all resulted in
software fallbacks, so their loss will not be mourned.
EXT_blend_subtract is, however, explicitly added to the list.
GL_FUNC_SUBTRACT is fully accelerated, but GL_FUNC_REVERSE_SUBTRACT
(still) results in a software fallback.

Cc: Alex Deucher <alexdeucher@gmail.com>
Cc: Dave Airlie <airlied@redhat.com>
2011-09-09 14:02:20 -07:00
Ian Romanick
4b43eea1b3 r600: Enable extensions by just setting the flags
Core Mesa already does the dispatch offset remapping for every
function that could possibly ever be supported.  There's no need to
continue using that cruft in the driver.

Since the call to _mesa_enable_imaging_extensions (via
driInitExtensions) is removed, EXT_blend_color is explicitly added to
the list.

EXT_blend_logic_op is removed from the list of extensions because
blend factors and separate blend equations are not handled correctly.

Cc: Alex Deucher <alexdeucher@gmail.com>
Cc: Dave Airlie <airlied@redhat.com>
2011-09-09 14:02:20 -07:00
Ian Romanick
2b7848b79f r300: Enable extensions by just setting the flags
Core Mesa already does the dispatch offset remapping for every
function that could possibly ever be supported.  There's no need to
continue using that cruft in the driver.

Since the call to _mesa_enable_imaging_extensions (via
driInitExtensions) is removed, EXT_blend_color is explicitly added to
the list.

EXT_blend_logic_op is removed from the list of extensions because
blend factors and separate blend equations are not handled correctly.
Based on feedback from Roland Scheidegger.

Cc: Dave Airlie <airlied@redhat.com>
Cc: Alex Deucher <alexdeucher@gmail.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Reviewed-by: Corbin Simpson <MostAwesomeDude@gmail.com>
2011-09-09 14:02:20 -07:00
Ian Romanick
bd67f8617d r200: Enable extensions by just setting the flags
Core Mesa already does the dispatch offset remapping for every
function that could possibly ever be supported.  There's no need to
continue using that cruft in the driver.

Since the call to _mesa_enable_imaging_extensions (via
driInitExtensions) is removed, EXT_blend_color is explicitly added
with a dependency on the drmSupportsBlendColor flag.

EXT_blend_logic_op is removed from the list of extensions because
blend factors and separate blend equations are not handled correctly.
Based on feedback from Roland Scheidegger.

Cc: Alex Deucher <alexdeucher@gmail.com>
Cc: Dave Airlie <airlied@redhat.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2011-09-09 14:02:20 -07:00
Ian Romanick
8a99ec8e05 nouveau: Enable extensions by just setting the flags
Core Mesa already does the dispatch offset remapping for every
function that could possibly ever be supported.  There's no need to
continue using that cruft in the driver.

Since the call to _mesa_enable_imaging_extensions (via
driInitExtensions) is removed, EXT_blend_color, EXT_blend_minmax, and
EXT_blend_subtract are explicitly added to the list.

EXT_blend_logic_op is removed from the list of extensions because
blend factors and separate blend equations are not handled correctly.

Cc: Ben Skeggs <bskeggs@redhat.com>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Cc: Viktor Novotný <noviktor@seznam.cz>
2011-09-09 14:02:20 -07:00
Ian Romanick
0a5478c1d9 intel: Move S3TC extension enable bits to intel_extensions.c
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-09-09 14:02:20 -07:00
Ian Romanick
71ceccad7e intel: Enable extensions by just setting the flags
Core Mesa already does the dispatch offset remapping for every
function that could possibly ever be supported.  There's no need to
continue using that cruft in the driver.

EXT_blend_logic_op is removed from the list of extensions because
blend factors and separate blend equations are not handled correctly.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-09-09 14:02:19 -07:00
Brian Paul
023ca40d80 llvmpipe: add some null pointer checks
It's not clear if these are acceptable cases so issue a one-time warning
in debug builds when we hit them.

Fixes segfault in piglit fbo-mipmap-copypix test.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2011-09-09 14:00:55 -06:00
Ian Romanick
e12b4752ef nvprogram: Silence "warning: unused parameter ‘ctx’" 2011-09-09 12:01:52 -07:00
Ian Romanick
8b3096cfa4 swrast: Silence many "warning: unused parameter ‘ctx’"
Not all drivers use ctx in LOCAL_VARS, so '(void) ctx;' is added to
all the function templates to make GCC happy.
2011-09-09 12:01:52 -07:00
Ian Romanick
076d609aa3 tnl_dd: Silence "tnl_dd/t_dd_tritmp.h:292:3: warning: suggest braces around empty body in an ‘if’ statement" 2011-09-09 12:01:52 -07:00
Ian Romanick
0075510400 spantmp2: Silence many "warning: unused parameter ‘ctx’"
Not all drivers use ctx in LOCAL_VARS, so '(void) ctx;' is added to
all the function templates to make GCC happy.
2011-09-09 12:01:51 -07:00
Ian Romanick
aaa305215c mesa: Silence "main/teximage.h:148:72: warning: unused parameter ‘texObj’" 2011-09-09 12:01:51 -07:00
Ian Romanick
2d4b8e296f swrast-dri: Silence several "warning: unused parameter" 2011-09-09 12:01:51 -07:00
Ian Romanick
559ed1a41d dri: Silence several "warning: unused parameter" 2011-09-09 12:01:51 -07:00
Ian Romanick
17d898d5b9 dri_util: Silence several "warning: unused parameter"
The parameters can't be removed because they are part of the DRI ABI.
2011-09-09 12:01:51 -07:00
Ian Romanick
1a8111aea4 intel: Silence "intel/intel_fbo.h:105:4: warning: comparison of unsigned expression < 0 is always false"
The test was of an enum, attIndex, which should be unsigned.  The
explicit check for < 0 was replaced with a cast to unsigned in an
assertion that attIndex is less than the size of the array it will be
used to index.

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-09-09 12:01:51 -07:00
Ian Romanick
ed3040f3ba intel: Silence several "warning: unused parameter"
Trivially silence the compiler by adding '(void) foo;' for each unused
parameter.  These parameters could not be removed.  They are part of
interface used elsewhere in Mesa, and some of the other customers
actually use these parameters.
2011-09-09 12:01:51 -07:00
Ian Romanick
4d5c820b4f intel: Silence several "warning: unused parameter"
The internalFormat, format, and type parameters were not used by
either try_pbo_upload or try_pbo_zcopy, so remove them.  The width
parameter was also not used by try_pbo_zcopy (because it doesn't
actually copy anything), so remove it too.

Eric Anholt notes:

    The current structure of this code is so hateful I can't bring
    myself to say anything about whether changing the current code is
    good or bad.

    I have a dream that one call would try to make a surface
    (miptree/region) out of the PBO, then we'd see about whether it
    matches up nicely and zero-copy/blit using that.  That would be
    reusable for texsubimage, which is currently awful in this
    respect.

At some point we should revisit this code with pitchforks and torches.
2011-09-09 12:01:51 -07:00
Ian Romanick
6f23d9b637 intel: Silence "warning: unused parameter ‘depth0’"
The depth0 parameter was not used in intel_miptree_create_for_region,
so remove it.  All of the places that call this function, pass 1 for
that parameter, and the place where it looks like it should have been
used (the call to intel_miptree_create_internal) also had 1 hard
coded.

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-09-09 12:01:51 -07:00