Commit graph

46345 commits

Author SHA1 Message Date
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
Ian Romanick
bd817215c8 intel: Silence "warning: unused parameter ‘target’"
The GLenum target parameter was not used in intel_copy_texsubimage, so
remove it.  Also remove the GLenum internalFormat parameter.  Each
caller just copied this out of the intel_texture_image that is already
passed to intel_copy_texsubimage.

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-09-09 12:01:51 -07:00
Ian Romanick
36a91e45f7 intel: Silence several "warning: unused parameter"
The intel_context and tiling parameters were not used by any if the
i9[14]5_miptree_layout or the functions they call, and the tiling parameter was
not used by brw_miptree_layout.  Remove the unnecessary parameters.
2011-09-09 12:01:51 -07:00
Ian Romanick
17fa6772d7 intel: Silence "warning: unused parameter ‘fb’"
The gl_framebuffer was not used in intel_draw_buffer, so remove it.

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-09-09 12:01:50 -07:00
Ian Romanick
5b6264b42e intel: Silence "warning: unused parameter ‘intel’"
The intel_context was not used in any of these functions, so remove it.
2011-09-09 12:01:50 -07:00
Ian Romanick
fccbcb5ceb intel: Silence several "warning: unused parameter"
Also clean-up some of the naming, etc. in
intel_buffer_object_purgeable.  'intel' is usually used as the name of
an intel_context pointer, and intel_obj is usually used as the name of
an intel_*_obj pointer.  These changes were suggested by Eric Anholt.

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-09-09 12:01:50 -07:00
Ian Romanick
2a6a1c4bc2 intel: Silence many "intel_batchbuffer.h:97:39: warning: comparison between signed and unsigned integer expressions"
v2: Remove the assertion in intel_batchbuffer_space:

   assert((intel->batch.state_batch_offset - intel->batch.reserved_space)
	  >= intel->batch.used*4);

After reviewing all the places where this is called, I'm (fairly)
comfortable that this assertion was redundant.  Having the assertion
adds ~20KiB to a driver build:

   text	   data	    bss	    dec	    hex	filename
 903173	  26392	   1552	 931117	  e352d	i965_dri.so
 924093	  26392	   1552	 952037	  e86e5	i965_dri.so

Based on feedback from Eric Anholt.

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-09-09 12:01:50 -07:00
Ian Romanick
f0dd21ac88 glsl: Silence "ast_to_hir.cpp:1984:25: warning: comparison of unsigned expression >= 0 is always true"
ast_type_qualifier::location should have been a signed integer from
the beginning, and the giant comment in
apply_type_qualifier_to_variable explains why.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=40207
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-09-09 12:01:50 -07:00
Ian Romanick
9a3bd5e045 glsl: Silence several "warning: unused parameter" 2011-09-09 12:01:50 -07:00
Brian Paul
681d432f81 nouveau: remove target parameter from nouveau_bufferobj_map_range()
This was missed back when the target parameter was removed from all
the buffer-related driver hooks.
2011-09-09 12:19:11 -06:00
Brian Paul
b94a926f39 st/mesa: init program MaxLocalParams, MaxEnvParams limits
Use the same limit for all parameter classes.
2011-09-09 08:10:50 -06:00
Chia-I Wu
8adaed9347 d3d1x: fix a build error
Fix for the st/egl interface change since
08e1076fd2.
2011-09-09 15:48:10 +08:00