Commit Graph

86851 Commits

Author SHA1 Message Date
Brian Paul cd724208d3 mesa: if MESA_DEBUG=context, create a debug context
A number of drivers report useful debug/perf information accessible
through GL_ARB_debug_output and with debug contexts (i.e. setting the
GLX_CONTEXT_DEBUG_BIT_ARB flag).  But few applications actually use
the GL_ARB_debug_output extension.

This change lets one set the MESA_DEBUG env var to "context" to force-set
a debug context and report debug/perf messages to stderr (or whatever
file MESA_LOG_FILE is set to).  This is a useful debugging tool.

The small change in st_api_create_context() is needed so that
st_update_debug_callback() gets called to hook up the driver debug
callbacks when ST_CONTEXT_FLAG_DEBUG was not set, but MESA_DEBUG=context.

v2: use %.*s format string instead of allocating temporary buffer.

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
2016-11-16 09:34:10 -07:00
Nicolai Hähnle fb17b7f99d u_simple_shaders: try to un-break the Windows build
Acked-by: Edward O'Callaghan <funfunctor@folklore1984.net>
2016-11-16 13:25:35 +01:00
Nicolai Hähnle 6403a9e074 radeonsi: fix a subtle bounds checking corner case with 3-component attributes
I'm also sending out a piglit test, gl-2.0/vertexattribpointer-size-3,
which exposes this corner case.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Edward O'Callaghan <funfunctor@folklore1984.net>
2016-11-16 10:31:42 +01:00
Nicolai Hähnle 50c95d0c54 radeonsi: reject some 3-component formats as buffer textures
Fixes parts of GL45-CTS.gtf32.GL3Tests.packed_pixels.packed_pixels_pbo.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Edward O'Callaghan <funfunctor@folklore1984.net>
2016-11-16 10:31:39 +01:00
Nicolai Hähnle 78314c57cb st/mesa: swap bytes in the fallback format translation path of GetTexImage
Fixes parts of GL45-CTS.gtf32.GL3Tests.packed_pixels.packed_pixels_pixelstore.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Edward O'Callaghan <funfunctor@folklore1984.net>
2016-11-16 10:31:36 +01:00
Nicolai Hähnle 22360406f7 st/mesa: simplify and fix st_GetTexSubImage
By using _mesa_image_address, the code becomes simpler _and_ fixes the bug
that GL_PACK_SKIP_IMAGES was applied even on non-3D textures.

Also, converting a whole slice at a time simplifies the format translation
fallback path.

Fixes parts of GL45-CTS.gtf32.GL3Tests.packed_pixels.packed_pixels_pixelstore.

v2: fix a silly mistake during code movement

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Edward O'Callaghan <funfunctor@folklore1984.net>
2016-11-16 10:31:34 +01:00
Nicolai Hähnle 7cdf292dc3 st/mesa: fix SINT <-> UINT conversion during PBO upload / download
This fixes use cases like glReadPixels from an RGBA8I framebuffer into
a PBO with type GL_INT by clamping values appropriately when they fall
outside the range of the destination format.

Fixes parts of GL45-CTS.gtf32.GL3Tests.packed_pixels.packed_pixels_pbo.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Edward O'Callaghan <funfunctor@folklore1984.net>
2016-11-16 10:31:31 +01:00
Nicolai Hähnle 5e10a3d6e5 st/mesa: change st_pbo_create_upload_fs to st_pbo_get_upload_fs
For consistency with st_pbo_get_download_fs.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Edward O'Callaghan <funfunctor@folklore1984.net>
2016-11-16 10:31:28 +01:00
Nicolai Hähnle 2fb4b5bdf6 st/mesa: fix ReadPixels into packed formats with PBO
When using the GPU download path, we bind the PBO as a buffer texture,
so call is_format_supported accordingly. On radeonsi, this means that
GPU downloads aren't used for UNSIGNED_SHORT_5_6_5 destinations, for
example.

Fixes parts of GL45-CTS.gtf32.GL3Tests.packed_pixels.packed_pixels_pbo.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Edward O'Callaghan <funfunctor@folklore1984.net>
2016-11-16 10:31:25 +01:00
Nicolai Hähnle 3817a7a1d7 util/blitter: add clamping during SINT <-> UINT blits
Even though glBlitFramebuffer cannot be used for SINT <-> UINT blits, we
still need to handle this type of blit here because it can happen as part
of texture uploads / downloads, e.g. uploading a GL_RGBA8I texture from
GL_UNSIGNED_INT data.

Fixes parts of GL45-CTS.gtf32.GL3Tests.packed_pixels.packed_pixels.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Edward O'Callaghan <funfunctor@folklore1984.net>
2016-11-16 10:31:21 +01:00
Nicolai Hähnle ab5fd10eaa util/blitter: index texfetch_col shaders by type
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Edward O'Callaghan <funfunctor@folklore1984.net>
2016-11-16 10:31:07 +01:00
Lionel Landwerlin 25a8e8bbd5 i965: miptree: prevent potential NULL pointer access
If the mcs buffer allocation fails we might get a NULL pointer. This
was reported by Coverity and should only happen if we run out of
memory.

v2: return failure at the point of allocation (Chris)

CID: 1394290
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
2016-11-16 08:56:08 +00:00
Jordan Justen 615ccf44cf intel/blorp: Use designated initializers in surf_convert_to_single_slice
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
2016-11-15 22:51:19 -08:00
Liu Zhiquan b663753f3b EGL/android: pbuffer implementation
Android path didn't support pbuffer, so add pbuffer support to fix
most failing dEQP and CTS pbuffer test cases.

Patch adds a single buffer config to support pbuffer, and creates
image in getBuffers for pbuffer when surface type is front surface.

The EGL 1.5 spec states that pbuffers have a back buffer but no front
buffer, single-buffered surfaces with no front buffer confuse Mesa;
so we deviate from the spec, following the precedent of Mesa's EGL
X11 platform.

V3: update commit message and code review changes.

Signed-off-by: Liu Zhiquan <zhiquan.liu@intel.com>
Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
2016-11-16 08:15:59 +02:00
Eric Engestrom 25c60fa6a2 egl: add missing error-checking to eglReleaseTexImage()
Signed-off-by: Eric Engestrom <eric@engestrom.ch>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
2016-11-16 08:02:16 +02:00
Ben Widawsky 19a01f8139 i965: Fix KBL typo in string
Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2016-11-15 17:34:37 -08:00
Ben Widawsky 37370f6bfc i965: Consolidate GEN9 LP definition
Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2016-11-15 17:34:37 -08:00
Ben Widawsky 2193fb0e1f i965/glk: Add basic Geminilake support
v2: s/bdw/gen; Add the 2x6 config
v3: Add min_ds_entries

Cc: "13.0" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2016-11-15 17:34:37 -08:00
Vinson Lee ed6694d511 util: Fix Clang trivial destructor check.
Check for Clang before GCC.

Clang defines __GNUC__ == 4 and __GNUC_MINOR__ == 2 and matches the GCC
check but not the GCC version for trivial destructor.

Fixes: 98ab905af0 ("mesa: Define introspection macro to determine
whether a type is trivially destructible.")
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=98526
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Edward O'Callaghan <funfunctor@folklore1984.net>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
2016-11-15 17:35:56 -08:00
Ilia Mirkin dafffd2f11 swr: mark color clamping as unsupported
There is no functionality in swr to clamp either vertex or frag colors.
This could be added in swr_shader, at which point these could be
re-enabled.

Fixes arb_color_buffer_float-render

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Tim Rowley <timothy.o.rowley@intel.com>
2016-11-15 20:26:32 -05:00
Ilia Mirkin 2b6b15ab3f swr: always enable adding start/base vertex to gl_VertexId
Fixes gl-3.2-basevertex-vertexid

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Tim Rowley <timothy.o.rowley@intel.com>
2016-11-15 20:26:29 -05:00
Ilia Mirkin 6364491a0b swr: add support for upper-left fragcoord position
Fixes glsl-arb-fragment-coord-conventions.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Tim Rowley <timothy.o.rowley@intel.com>
2016-11-15 20:26:11 -05:00
Ilia Mirkin a2c1d58ddb swr: make sure that all rendering is finished on shader destroy
Rendering could still be ongoing (or have yet to start) when the shader
is deleted. There's no refcounting on the shader text, so insert a
pipeline stall unconditionally when this happens.

[Note, we should instead introduce a way to attach work to
fences, so that the freeing can be done in the current fence.]

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Bruce Cherniak <bruce.cherniak@intel.com>
2016-11-15 20:25:48 -05:00
Ilia Mirkin 7caed50ff4 swr: disable blending for integer formats
The EXT_texture_integer test says that blending and alphatest should
all be disabled. st/mesa takes care of alphatest already.

Fixes the ext_texture_integer-fbo-blending piglit test.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Bruce Cherniak <bruce.cherniak@intel.com>
2016-11-15 20:25:43 -05:00
Ilia Mirkin 2f19a974a5 swr: mark rgb9_e5 as unrenderable
The support in swr requires shaders to output the components as UINTs.
This is not how GL or Gallium work, and since this is not a
required-renderable format, just leave it out.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Bruce Cherniak <bruce.cherniak@intel.com>
2016-11-15 20:25:35 -05:00
Ilia Mirkin 6fd398f48e swr: no support for shader stencil export
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Bruce Cherniak <bruce.cherniak@intel.com>
2016-11-15 20:25:28 -05:00
Ilia Mirkin 96291478ea swr: mark both frag and vert textures read, don't forget about cbs
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Bruce Cherniak <bruce.cherniak@intel.com>
2016-11-15 20:25:22 -05:00
Ilia Mirkin 8c0f76e961 swr: fix texture layout for compressed formats
Fixes the texsubimage piglit and lets the copyteximage one get further.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Bruce Cherniak <bruce.cherniak@intel.com>
2016-11-15 20:25:15 -05:00
Ilia Mirkin 00efbbc38c swr: add archrast generated files to gitignore
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Bruce Cherniak <bruce.cherniak@intel.com>
2016-11-15 20:25:08 -05:00
Ilia Mirkin b53a33feef swr: [rasterizer jitter] don't bother quantizing unused channels
In a BGR10X2 or BGR5X1 situation, there's no need to try to quantize the
X channel - the default will have the proper quantization required.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Bruce Cherniak <bruce.cherniak@intel.com>
2016-11-15 20:24:50 -05:00
Ilia Mirkin 5dd0b8d3c6 swr: [rasterizer memory] fix store tile for 128-bit ymajor tiling
Noticed by inspection.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Bruce Cherniak <bruce.cherniak@intel.com>
2016-11-15 20:24:41 -05:00
Ilia Mirkin 45d9cd36fe swr: [rasterizer memory] add support for R32_FLOAT_X8X24 formats
This is the format used for the primary surface of a
PIPE_FORMAT_Z32_FLOAT_S8X24_UINT resource.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Bruce Cherniak <bruce.cherniak@intel.com>
2016-11-15 20:24:18 -05:00
Dave Airlie 713522fb8d ac/nir/llvm: fix channel in texture gather lowering code.
This fixes a number of CTS tests like:
dEQP-VK.glsl.texture_gather.basic.2d.rgba8ui.size_npot.clamp_to_edge_repeat

Cc: "13.0" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2016-11-16 09:18:15 +10:00
Dave Airlie 38ab625c5f radv: don't crash on null swapchain destroy.
Just return if the passed in swapchain is NULL.

Fixes: dEQP-VK.wsi.xlib.swapchain.destroy.null_handle

Cc: "13.0" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2016-11-16 09:18:03 +10:00
Dave Airlie 253fa25d09 wsi: fix VK_INCOMPLETE for vkGetSwapchainImagesKHR
This fixes the x11 and wayland backends to not assert:
dEQP-VK.wsi.xcb.swapchain.get_images.incomplete

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Cc: "13.0" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2016-11-16 09:17:34 +10:00
Jordan Justen 0ac57afa6f isl: Fix height calculation in isl_msaa_interleaved_scale_px_to_sa
No known fixed tests, but it looks like a typo from:

commit 8ac99eabb6

    intel/isl: Add a helper for getting the size of an interleaved pixel

Cc: "13.0" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
2016-11-15 14:27:27 -08:00
Emil Velikov 75a39cca8d amd: automake: android: rename sources lists to foo_FILES
Autotools goes smart on us warning that foo_SOURCES variable is present
yet a target with name foo is missing. Rename things (like we do
throughout the build) to silence the warnings.

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
2016-11-15 20:04:37 +00:00
Mauro Rossi 95ed2d9d2c amd: flatten amd/common makefile structure
This pulls amd/common build rules into upper level makefile,
along with amd/addlib which is already there.

v2: [Emil Velikov]
 - Move NEED_RADEON_LLVM conditional, drop amd/common from SUBDIRS
 - Drop AM_ from common_libamd_common_la*

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
2016-11-15 20:04:37 +00:00
Marek Olšák 74e39de932 radeonsi: set IF_THRESHOLD to 3
Piglit regressions (radeonsi or LLVM bugs, they pass on softpipe):
- glsl-1.10/execution/variable-indexing/vs-output-array-vec3-index-wr
- glsl-1.10/execution/variable-indexing/vs-output-array-vec4-index-wr
- glsl-110/execution/variable-indexing/vs-temp-array-mat2-index-col-row-wr
- glsl-110/execution/variable-indexing/vs-temp-array-mat2-index-row-wr

Totals:
SGPRS: 1132185 -> 1168801 (3.23 %)
VGPRS: 907856 -> 906204 (-0.18 %)
Spilled SGPRs: 2011 -> 2425 (20.59 %)
Spilled VGPRs: 368 -> 96 (-73.91 %)
Scratch VGPRs: 1344 -> 1060 (-21.13 %) dwords per thread
Code Size: 35916164 -> 35705372 (-0.59 %) bytes
LDS: 767 -> 767 (0.00 %) blocks
Max Waves: 194010 -> 194921 (0.47 %)
Wait states: 0 -> 0 (0.00 %)

Before:
 VGPR SPILLING APPS   Shaders SpillVGPR ScratchVGPR
 alien_isolation         2938        38        40
 bioshock-infinite       1769       245       732
 dirt-showdown            548        85        72
 f1-2015                  776         0       320
 ue4_lightroom_inter..     74         0       180

After:
 VGPR SPILLING APPS   Shaders SpillVGPR ScratchVGPR
 alien_isolation         2938        38        40
 bioshock-infinite       1769         0       480
 dirt-showdown            548        58        40
 f1-2015                  776         0       320
 ue4_lightroom_inter..     74         0       180

Bioshock and DiRT benefit.

If I set IF_THRESHOLD=4, tesseract starts spilling VGPRs

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
2016-11-15 20:23:40 +01:00
Marek Olšák 537b897f51 glsl_to_tgsi: lower small branches based on the CAP
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
2016-11-15 20:23:40 +01:00
Marek Olšák 72217d4335 gallium: add PIPE_SHADER_CAP_LOWER_IF_THRESHOLD
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
2016-11-15 20:23:40 +01:00
Marek Olšák e33440070a glsl/lower_if: conditionally lower if-branches based on their size
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
2016-11-15 20:23:39 +01:00
Marek Olšák 83d9b8a6f6 glsl/lower_if: don't lower branches touching tess control outputs
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
2016-11-15 20:23:35 +01:00
Marek Olšák 654e9466b5 glsl/lower_if: check more node types in check_control_flow -> check_ir_node
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
2016-11-15 20:22:52 +01:00
Marek Olšák 68f35005ed glsl/lower_if: move and rename found_control_flow
I'll want to update more variables in check_control_flow, so using
the visitor is convenient.

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
2016-11-15 20:22:52 +01:00
Marek Olšák a6ff2a3378 util/disk_cache: use unambiguous naming
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
2016-11-15 20:22:28 +01:00
Marek Olšák 31727300e1 util: import cache.c/h from glsl
It's not dependent on GLSL and it can be useful for shader caches that don't
deal with GLSL.

v2: address review comments
v3: keep the other 3 lines in configure.ac

Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
2016-11-15 20:22:28 +01:00
Marek Olšák 5b8876609e gallivm: limit use of setFastMathFlags to LLVM 3.8 and later
Reviewed-by: Brian Paul <brianp@vmware.com>
2016-11-15 20:22:28 +01:00
Kenneth Graunke 341fc0073a intel: Set min_ds_entries on Broxton.
This was missing.

Cc: mesa-stable@lists.freedesktop.org
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ben Widawsky <benjamin.widawsky@intel.com>
2016-11-15 10:45:47 -08:00
Christian Gmeiner 0c73a3b7d0 dri: make use of loader_get_extensions_name(..) helper
Changes since v1:
 - removed not needed includes
 - use the loader version of the helper

v2 [Emil Velikov]
 - Keep the includes - they are required.

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
2016-11-15 18:15:16 +00:00