Commit Graph

65618 Commits

Author SHA1 Message Date
Eric Anholt a04605a8ca vc4: Compute max_index instead of trusting the rest of userspace.
max_index was coming from either the user telling us as part of
glDrawRangeElements, or from an incidental calculation as part of some
sort of primitive conversion fallback.  Sometimes, it was just set to the
default "I don't know" ~0 value.

If it wasn't set to the actual max index, then the kernel would reject the
draw call for allowing out-of-bounds VBO reads.  So, compute the max index
from the sizes of the VBOs, which isn't too expensive (unlike mapping and
reading the index buffer) and is reliable.

Fixes piglit vao-element-array-buffer.
2014-09-24 20:51:15 -07:00
Eric Anholt 61cb08ab4f vc4: Move shader record setup before the draw call.
The flush only happens after both are written, so we can do them in either
order.  This will let me compute max_index during the shader record setup.
2014-09-24 20:49:08 -07:00
Matt Turner ba0c0a186d i965/vec4: Call calculate_cfg() in test programs to avoid crashing.
Reported-by: Mark Janes <mark.a.janes@intel.com>
2014-09-24 16:06:41 -07:00
Eric Anholt 52476b35c1 vc4: Add support for gl_PointCoord.
Fixes piglit glsl-fs-pointcoord, point-sprite, and fbo-gl_pointcoord.
2014-09-24 15:59:03 -07:00
Eric Anholt 66b7bd60e0 vc4: Add support for point size setting.
This is the support for both the global and per-vertex modes.
2014-09-24 15:56:39 -07:00
Eric Anholt f24588d64e vc4: Add support for line width setting.
I don't see piglit tests for it, but this should be better than not
emitting it at all.
2014-09-24 15:56:39 -07:00
Eric Anholt 7fa399f93a vc4: Actually add support for polygon offset.
Setting the bit without setting the offset values is kind of useless.
Fixes piglit polygon-offset (but not polygon-mode-offset).
2014-09-24 15:56:39 -07:00
Eric Anholt 6abbdfe3db vc4: Fix swapped 565 dithering versus no-dithering render configs.
Fixes many 565 piglit tests (like fbo-generatemipmap-formats) that weren't
expecting dithering.
2014-09-24 15:56:39 -07:00
Eric Anholt 8cd165051b vc4: Add support for alpha test.
Fixes most of piglit fbo-alphatest-formats (but not RGB565/332).
2014-09-24 15:56:39 -07:00
Rob Clark a87e44da3a freedreno/a3xx: initial texture border-color
Still some open questions.. and at any rate, no additional piglit passes
due to various wrap modes that we need to emulate in at least some
cases :-(

But it does fix some mystery page-faults.. So add some comments in the
code where there are things that we need to emulate or do more r/e, and
push as-is.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-09-24 18:52:58 -04:00
Brian Paul 9f47220450 util: use linear formats in util_blit_pixels()
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2014-09-24 15:35:11 -06:00
Brian Paul b6947e02de util: simplify writemask parameters for util_blit_pixels()
Instead of separate color and Z/S writemasks, just have one writemask
parameter that takes a mask of the PIPE_MASK_[RGBAZS] flags.

Reviewed-by: Charmaine Lee <charmainel@vmware.com>
2014-09-24 15:35:11 -06:00
Brian Paul b32f05e153 util: s/PIPE_TEX_MIPFILTER/PIPE_TEX_FILTER/ in u_blit code
PIPE_TEX_MIPFILTER_x is not legal for the pipe_sampler_state::
min/mag_img_filter fields.  But PIPE_TEX_MIPFILTER_x == PIPE_TEX_FILTER_x
so we were getting lucky.

This also makes the code consistent with u_blitter.c.

Reviewed-by: Charmaine Lee <charmainel@vmware.com>
2014-09-24 15:35:10 -06:00
Brian Paul f5e8b30472 mesa: remove EXT suffix from FBO error messages
And use pass caller="" for _mesa_FramebufferTexture().

Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-09-24 15:35:10 -06:00
Matt Turner 5980fc35c9 mesa: Drop _mesa_getenv() wrapper.
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-09-24 09:58:43 -07:00
Matt Turner 209eba42eb mesa: Drop _mesa_bsearch() wrapper.
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-09-24 09:58:43 -07:00
Matt Turner 9499d6e358 mesa: Unifdef _WIN32_WCE.
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-09-24 09:58:43 -07:00
Matt Turner d20015a576 mesa: Unifdef _XBOX.
Inexplicably added in commit 36940429.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-09-24 09:58:43 -07:00
Matt Turner b133b84733 configure.ac: Remove duplicate -DHAVE_PTHREAD.
It's also defined by the AX_PTHREAD macro.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-09-24 09:58:43 -07:00
Matt Turner d1022529fe configure.ac: Stop checking for perl.
Added by commit a75c6163, but no longer used.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-09-24 09:58:43 -07:00
Matt Turner 585e250dd2 configure.ac: Use test -a, rather than another test.
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-09-24 09:58:43 -07:00
Matt Turner 452926a5ec mesa: Use realloc() instead of _mesa_realloc() and remove the latter.
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-09-24 09:58:42 -07:00
Matt Turner e5162defc8 mesa: Remove duplicate _mesa_{init,free}_shader_state prototypes.
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
2014-09-24 09:58:42 -07:00
Tom Stellard 180b152b24 gallivm: Wrap deleted inlcude in if HAVE_LLVM < 0x0306
This was missed in 8f4ee56.
2014-09-24 11:54:44 -04:00
Matt Turner ef75f60822 i965: Add and use functions to get next/prev blocks.
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
2014-09-24 09:42:46 -07:00
Matt Turner 444fc0b4a8 i965: Call insert and remove functions from exec_node directly.
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
2014-09-24 09:42:46 -07:00
Matt Turner 49374fab5d i965: Make instruction lists local to the bblocks.
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
2014-09-24 09:42:46 -07:00
Matt Turner 3fe1a84bbe i965/cfg: Add note about double-loop macros and break behavior.
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
2014-09-24 09:42:46 -07:00
Matt Turner 153d148e9e i965: Replace initialization loops with memset().
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
2014-09-24 09:42:46 -07:00
Matt Turner 72bb3f81c6 i965/vec4: Don't iterate between blocks with inst->next/prev.
The register coalescing portion of this patch hurts three shaders in
Guacamelee by one instruction each, but examining the diff makes me
believe that what we were generating was (perhaps harmlessly) incorrect.
2014-09-24 09:42:46 -07:00
Matt Turner f0598d413b i965/fs: Don't iterate between blocks with inst->next/prev.
When instruction lists are per-basic block, this won't work.

Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
2014-09-24 09:42:46 -07:00
Matt Turner 7119712f45 i965/cfg: Add macros to iterate through a block given a starting point.
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
2014-09-24 09:42:46 -07:00
Matt Turner 235f451f7a i965/fs: Make count_to_loop_end() use basic blocks.
When the instructions aren't in a flat list, this wouldn't have worked.
Also, this should be faster.

Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
2014-09-24 09:42:46 -07:00
Matt Turner 90bfeb2244 i965/vec4: Don't use instruction list after calculating the cfg.
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
2014-09-24 09:42:46 -07:00
Matt Turner 2ff0ff880c i965/fs: Don't use instruction list after calculating the cfg.
The only trick is changing a break into a return true in register
coalescing, since the macro is actually a double loop, and break will do
something different than you expect. (Wish I'd realized that earlier!)

Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
2014-09-24 09:42:46 -07:00
Matt Turner a4fb8897a2 i965: Remove now unneeded calls to calculate_cfg().
Now that nothing invalidates the CFG, we can calculate_cfg() immediately
after emit_fb_writes()/emit_thread_end() and never again.

Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
2014-09-24 09:42:46 -07:00
Matt Turner 072ea414d0 i965: Remove cfg-invalidating parameter from invalidate_live_intervals.
Everything has been converted to preserve the CFG.

Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
2014-09-24 09:42:46 -07:00
Matt Turner 9e28bb863c i965: Preserve the CFG in instruction scheduling.
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
2014-09-24 09:42:46 -07:00
Matt Turner 269b6e24d6 i965/vec4: Preserve CFG in spill_reg().
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
2014-09-24 09:42:46 -07:00
Matt Turner b0b64c85e4 i965/vec4: Preserve the CFG in a few more places.
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
2014-09-24 09:42:46 -07:00
Matt Turner a9f8296dbb i965/fs: Preserve the CFG in a few more places.
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
2014-09-24 09:42:46 -07:00
Kristian Høgsberg 9b75663866 i965: Restructure debug flags
This cleans up the debug flags to be consistently indented, use bit
shifting instead of hex-values and fixes a bug where the new DEBUG_NO8 flag
used the same value as the DEBUG_VUE flag.  This was hidden by the numbers not
being aligned.  Also removes gaps in the range where DEBUG_IOCTL (0x4) and
DEBUG_REGION (0x400) used to be.

Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
2014-09-24 09:15:09 -07:00
Tom Stellard 8f4ee56e49 gallivm: Disable gallivm to fix build with LLVM 3.6
LLVM commit r218316 removes the JITMemoryManager class, which is
the parent for a seemingly important class in gallivm.  In order to
fix the build, I've wrapped most of lp_bld_misc.cpp in
if HAVE_LLVM < 0x0306 and modifyed the
lp_build_create_jit_compiler_for_module() function to return false
for 3.6 and newer which effectively disables the gallivm functionality.

I realize this is overkill, but I could not come up with a simple
solution to fix the build.  Also, since 3.6 will be the first release
without the old JIT, it would be really great if we could
move gallivm to use the C API only for accessing MCJIT.  There
is still time before the 3.6 release to extend the C API in
case it is missing some functionality that is required by gallivm.
2014-09-24 10:34:19 -04:00
Marek Olšák 2f7714e071 gallium/rbug: correctly unreference a sampler view
This fixes heap corruption. The sampler view can be bound in the context,
so we cannot call destroy directly.

Reviewed-by: Brian Paul <brianp@vmware.com>
2014-09-24 14:48:02 +02:00
Marek Olšák 91ddf49c87 gallium/rbug: unlock a mutex in rbug_create_query
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-09-24 14:48:02 +02:00
Marek Olšák c944866708 radeonsi: remove old cache flushing code
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2014-09-24 14:48:02 +02:00
Marek Olšák dd53d53dc6 radeonsi/compute: do CS partial flush with si_emit_cache_flush
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2014-09-24 14:48:02 +02:00
Marek Olšák 604b58b554 radeonsi/compute: flush caches with si_emit_cache_flush
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2014-09-24 14:48:02 +02:00
Marek Olšák 628f8ee1d9 radeonsi/compute: directly emit CONTEXT_CONTROL
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2014-09-24 14:48:02 +02:00
Marek Olšák dc05a9e4e0 radeonsi: properly destroy the GS copy shader and scratch_bo for compute
Cc: 10.2 10.3 <mesa-stable@lists.freedesktop.org>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2014-09-24 14:48:02 +02:00