Commit Graph

46335 Commits

Author SHA1 Message Date
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
Eric Anholt 29361e14df i965/vs: Allow copy propagation on GRFs.
Further reduces instruction count by 4.0% in 40.7% of the vertex
shaders.
2011-09-08 21:40:39 -07:00
Eric Anholt 6d0c018776 i965/vs: Clear tracked copy propagation values whose source gets overwritten.
This only occurs for GRFs, and hasn't mattered until now because we
only copy propagated non-GRFs.
2011-09-08 21:40:39 -07:00
Eric Anholt cc9eb936c2 i965/vs: Add support for copy propagation of the UNIFORM and ATTR files.
Removes 2.0% of the instructions from 35.7% of vertex shaders in shader-db.
2011-09-08 21:40:39 -07:00
Eric Anholt 42ce13195b i965/vs: Add constant propagation to a few opcodes.
This differs from the FS in that we track constants in each
destination channel, and we we have to look at all the swizzled source
channels.  Also, the instruction stream walk is done in an O(n) manner
instead of O(n^2).

Across shader-db, this reduces 8.0% of the instructions from 60.0% of
the vertex shaders, leaving us now behind the old backend by 11.1%
overall.
2011-09-08 21:40:39 -07:00
Eric Anholt 87b51fc4a8 i965/vs: Keep track of indices into a per-register array for virtual GRFs.
Tracking virtual GRFs has tension between using a packed array per
virtual GRF (which is good for register allocation), and sparse arrays
where there's an element per actual register (so the first and second
column of a mat2 can be distinguished inside of an optimization pass).

The FS mostly avoided the need for this second sparse array by doing
virtual GRF splitting, but that meant that instances where virtual GRF
splitting didn't work, instructions using those registers got much
less optimized.
2011-09-08 21:40:39 -07:00
Eric Anholt d7c6c8428c i965/vs: Switch to the new VS backend by default.
Now instead of env INTEL_NEW_VS=1 to get it, you need INTEL_OLD_VS=1
to not get it.  While it's not quite to the same codegen efficiency as
the old backend, it is not regressing piglit on G965 and G45, and
actually fixing bugs on gen6, and the remaining codegen quality
regressions all appear tractable.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-09-08 21:34:03 -07:00
Eric Anholt df35d69180 i965/vs: Add support for overflowing the number of available push constants.
Fixes glsl-vs-uniform-array-4.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=33742

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
2011-09-08 21:34:03 -07:00
Eric Anholt f3ed973f53 i965/vs: Pack uniform registers before optimization
We don't expect uniform accesses to generally go away from being dead
code at this point, and we will want to have uniforms packed before
spilling them out to pull constants when we are forced to do that.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
2011-09-08 21:34:03 -07:00
Eric Anholt 1408169513 i965/vs: When failing due to lack of spilling, don't continue on.
Fixes assertion failure from double-free in oglc
glsl-arrayobject constructor.declaration.structure

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-09-08 21:34:03 -07:00
Eric Anholt 27c03cb86a i965/vs: Fix variable indexed array access with more than one array.
The offset to the arrays after the first was mis-scaled, so we'd go
access off the end of the surface and read 0s.  Fixes
glsl-vs-uniform-array-3.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
2011-09-08 21:34:03 -07:00