summaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)AuthorFilesLines
2017-10-10mesa: move _mesa_half_is_negative() to half_float.hBrian Paul2-6/+8
v2: use !! in the function to be explicit about type conversion. Though, gcc generates the same code with or without the logical !!. Reviewed-by: Roland Scheidegger <sroland@vmware.com> Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
2017-10-10mesa: move _mesa_exec_malloc/free() prototypes to their own headerBrian Paul6-7/+41
Try to start removing things from the cluttered imports.h file. v2: add new header to Makefile.sources Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2017-10-10i965: minor whitespace fixKenneth Graunke1-1/+1
2017-10-10mesa: Set new renderbuffers to RGBA4 on all GLES contexts.Eric Anholt1-1/+1
Before we were doing RGBA4 on GLES3 only, but as of GLES2 2.0.22 it should be RGBA4 as well. Fixes DEQP functional.state_query.rbo.renderbuffer_internal_format. Tested-by: Matt Turner <mattst88@gmail.com> Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
2017-10-10mesa: Expose GL_OES_required_internalformat on GLES contexts.Eric Anholt4-38/+74
This extension is effectively a backport of GLES3's internalformat handling to GLES 1/2. It guarantees that sized internalformats specified for textures and renderbuffers have at least the specified size stored. That's a pretty minimal requirement, so I think it can be dummy_true and exposed as a standard in Mesa. As a side effect, it also allows GL_RGB565 to be specified as a texture format, not just as a renderbuffer. Mesa had previously been allowing 565 textures, which angered DEQP in the absence of this extension being exposed. v2: Allow 2101010rev with sized internalformats even on GLES3, citing the extension spec. Extend extension checks for GLES2 contexts exposing with texture_float, texture_half_float, and texture_rg. v3: Fix ALPHA/LUMINANCE/LUMINANCE_ALPHA error checking (GLES3 CTS failures) v4: Mark GL_RGB10 non-color-renderable on ES, fix A/L/LA errors on GLES2 with float formats. Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
2017-10-10mesa: Only expose GLES's EXT_texture_type_2_10_10_10_REV if supported in HW.Eric Anholt5-2/+10
Previously, we were downconverting to 8888 automatically if the hardware didn't suport it. However, with the advent of GL_OES_required_internalformat, we have to actually store the internalformats we advertise support for. And, it seems rather disingenuous to advertise the extension if we don't actually support it. v2: Throw an error when using the format on ES2 without the extension present. Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
2017-10-10vc4: Add support for 5551 textures.Eric Anholt2-3/+3
This keeps us from promoting them up to 8888, at the cost of not being color-renderable.
2017-10-10gallium: Add support for 5551 with the 1-bit field in the low bit.Eric Anholt4-2/+18
This is how VC4 stores 5551 textures, which we need to support for GL_OES_required_internalformat. v2: Extend commit message, fix svga driver build, add BE ordering from Roland. v3: Rebase on PIPE_FORMAT_R10G10B10X2_UNORM addition. Reviewed-by: Marek Olšák <marek.olsak@amd.com> (v2) Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com> (v2)
2017-10-10mesa: Add X1B5G5R5 along with A1B5G5R5.Eric Anholt5-0/+9
For supporting RGB5 in hardware with A in the low bit (vc4), we need this format as well. v2: Add proper _mesa_format_matches_format_and_type() support (from Nicolai). Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com> (v1)
2017-10-10st_api: remove unused get_resource_for_egl_imageNicolai Hähnle1-37/+0
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
2017-10-10st/dri: implement createImageFromRenderbuffer(2)Nicolai Hähnle4-7/+76
Tested with dEQP-EGL.functional.image.*renderbuffer* tests. Reviewed-by: Eric Anholt <eric@anholt.net>
2017-10-10egl/dri: remove old left-oversNicolai Hähnle1-2/+0
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
2017-10-10egl/dri: use createImageFromRenderbuffer2 when availableNicolai Hähnle1-3/+20
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
2017-10-10egl/dri: factor out egl_error_from_dri_image_errorNicolai Hähnle1-28/+26
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
2017-10-10st/mesa: don't clobber glGetInternalformat* buffer for GL_NUM_SAMPLE_COUNTSNicolai Hähnle1-1/+2
Applications might pass in a buffer that is sized too large and rely on the extra space of the buffer not being overwritten. Fixes dEQP-GLES31.functional.state_query.internal_format.partial_query.num_sample_counts Cc: mesa-stable@lists.freedesktop.org Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2017-10-10u_threaded_context: fix a memory leakNicolai Hähnle1-7/+8
The uploaders can own transfers which need to be unmapped. Destroy them before the final sync (they're not used from the driver thread anyway) so that the transfer_unmap call is processed by the driver. Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2017-10-10disk_cache: remove unnecessary NULL-pointer guardsNicolai Hähnle1-4/+2
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2017-10-10disk_cache: fix a memory leakNicolai Hähnle1-0/+1
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2017-10-10st/mesa: whitespace fixNicolai Hähnle1-1/+1
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2017-10-10st/mesa: fix import of EGL images with non-zero level or layerNicolai Hähnle5-10/+28
In GL state, textures created from EGL images look like plain 2D textures with a single level, so we use the existing layer_override facility and add an analogous level_override one. Fixes dEQP-EGL.functional.image.create.gles2_cubemap_{positive,negative}_{x,y,z}_rgba_texture Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2017-10-10st/mesa: fix switching from surface-based to non-surface-based texturesNicolai Hähnle6-9/+14
This can happen with surface-based texture objects derived from EGL images, since those aren't immutable. Fixes tests in dEQP-EGL.functional.sharing.gles2.multithread.random.images.teximage2d.* and others Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2017-10-10glsl/linker: add check for compute shared memory sizeNicolai Hähnle3-6/+23
Unlike uniforms, the limit on shared memory size is not called out explicitly in the list of things that cause linker errors, but presumably that's just an oversight in the spec. Fixes dEQP-GLES31.functional.debug.negative_coverage.{callbacks,get_error,log}.compute.exceed_shared_memory_size_limit Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
2017-10-10etnaviv: update HW headers and fix provoking vertexLucas Stach6-47/+67
Now that the real meaning of the 2 bits in PA_SYSTEM_MODE is known, we can set them according to the rasterizer state, which fixes uses that are setting provoking vertex first. Signed-off-by: Lucas Stach <l.stach@pengutronix.de> Reviewed-by: Wladimir J. van der Laan <laanwj@gmail.com> Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
2017-10-10etnaviv: remove flat shading workaroundLucas Stach1-5/+1
It turned out not to be a hardware bug, but the shader compiler emitting wrong varying component use information. With that fixed we can turn flat shading back on. Signed-off-by: Lucas Stach <l.stach@pengutronix.de> Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de> Reviewed-by: Wladimir J. van der Laan <laanwj@gmail.com>
2017-10-10etnaviv: fix varying interpolationLucas Stach1-12/+10
It seems that newer cores don't use the PA_ATTRIBUTES to decide if the varying should bypass the flat shading, but derive this from the component use. This fixes flat shading on GC880+. VARYING_COMPONENT_USE_POINTCOORD is a bit of a misnomer now, as it isn't only used for pointcoords, but missing a better name I left it as-is. Signed-off-by: Lucas Stach <l.stach@pengutronix.de> Reviewed-by: Wladimir J. van der Laan <laanwj@gmail.com>
2017-10-10etnaviv: fix bogus flush requests in transfer handlingLucas Stach1-5/+10
The logic to decide if we need to flush the GPU command stream was broken and hard to reason about. Fix and clarify this. Fixes the data sync subtests from piglit arb_vertex_buffer_object. Signed-off-by: Lucas Stach <l.stach@pengutronix.de> Reviewed-by: Wladimir J. van der Laan <laanwj@gmail.com>
2017-10-10i965/tes: account for the fact that dvec3/4 inputs take two slotsIago Toral Quiroga1-2/+7
When computing the total size of the URB for tessellation evaluation inputs we were not accounting for this, and instead we were always assuming that each input would take a single vec4 slot, which could lead to computing a smaller read size than required. Specifically, this is a problem when the last input is a dvec3/4 such that its XY components are stored in the the second half of a payload register (which can happen if the offset for the input in the URB is not 64-bit aligned because there are 32-bit inputs mixed in) and the ZW components in the first half of the next, as in this case we would fail to account for the extra slot required for the ZW components. Fixes (requires another fix in CTS currently in review): KHR-GL45.enhanced_layouts.varying_locations KHR-GL45.enhanced_layouts.varying_array_locations Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2017-10-10anv: fix null pointer dereferenceTapani Pälli1-0/+1
CID: 1419033 Signed-off-by: Tapani Pälli <tapani.palli@intel.com> Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
2017-10-10radv: export KHR_relaxed_block_layoutDave Airlie1-0/+4
This seems to pass all the cts tests it enables. Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl> Acked-by: Jason Ekstrand <jason@jlekstrand.net> Signed-off-by: Dave Airlie <airlied@redhat.com>
2017-10-09nv50/ir: fix 64-bit integer shiftsIlia Mirkin1-1/+3
TGSI was adjusted to always pass in 64-bit integers but nouveau was left with the old semantics. Update to the new thing. Fixes: d10fbe5159 (st/glsl_to_tgsi: fix 64-bit integer bit shifts) Reported-by: Karol Herbst <karolherbst@gmail.com> Cc: mesa-stable@lists.freedesktop.org
2017-10-10i965: silence coverity warningLionel Landwerlin1-1/+1
Also makes this statement a bit clearer. CID: 1418920 Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Reviewed-by: Jason Ekstrand <jason@jlekstrand.net> Reviewed-by: Antia Puentes <apuentes@igalia.com>
2017-10-09anv: Do not assert() on VK_ATTACHMENT_UNUSEDJózef Kucia1-1/+2
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net> Reviewed-by: Nanley Chery <nanley.g.chery@intel.com> Cc: mesa-stable@lists.freedesktop.org
2017-10-09spirv: Fix SpvOpAtomicISubJózef Kucia1-0/+1
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net> Cc: mesa-stable@lists.freedesktop.org
2017-10-10glsl: tidy up IR after loop unrollingTimothy Arceri1-1/+7
c7affbf6875622a enabled GLSLOptimizeConservatively on some drivers. The idea was to speed up compile times by running the GLSL IR passes only once each time do_common_optimization() is called. However loop unrolling can create a big mess and with large loops can actually case compile times to increase significantly due to a bunch of redundant if statements being propagated to other IRs. Here we make sure to clean things up before moving on. There was no measureable difference in shader-db compile times, but it makes compile times of some piglit tests go from a couple of seconds to basically instant. The shader-db results seemed positive also: Totals: SGPRS: 2829456 -> 2828376 (-0.04 %) VGPRS: 1720793 -> 1721457 (0.04 %) Spilled SGPRs: 7707 -> 7707 (0.00 %) Spilled VGPRs: 33 -> 33 (0.00 %) Private memory VGPRs: 3140 -> 2060 (-34.39 %) Scratch size: 3308 -> 2180 (-34.10 %) dwords per thread Code Size: 79441464 -> 79214616 (-0.29 %) bytes LDS: 436 -> 436 (0.00 %) blocks Max Waves: 558670 -> 558571 (-0.02 %) Wait states: 0 -> 0 (0.00 %) Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com> Reviewed-by: Marek Olšák <marek.olsak@amd.com> Tested-by: Dieter Nützel <Dieter@nuetzel-hh.de>
2017-10-10glsl: make loop unrolling more like the nir unrolling pathTimothy Arceri3-67/+163
The old code assumed that loop terminators will always be at the start of the loop, resulting in otherwise unrollable loops not being unrolled at all. For example the current code would unroll: int j = 0; do { if (j > 5) break; ... do stuff ... j++; } while (j < 4); But would fail to unroll the following as no iteration limit was calculated because it failed to find the terminator: int j = 0; do { ... do stuff ... j++; } while (j < 4); Also we would fail to unroll the following as we ended up calculating the iteration limit as 6 rather than 4. The unroll code then assumed we had 3 terminators rather the 2 as it wasn't able to determine that "if (j > 5)" was redundant. int j = 0; do { if (j > 5) break; ... do stuff ... if (bool(i)) break; j++; } while (j < 4); This patch changes this pass to be more like the NIR unrolling pass. With this change we handle loop terminators correctly and also handle cases where the terminators have instructions in their branches other than a break. V2: - fixed regression where loops with a break in else were never unrolled in v1. - fixed confusing/wrong naming of bools in complex unrolling. Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com> Tested-by: Dieter Nützel <Dieter@nuetzel-hh.de>
2017-10-10glsl: check if induction var incremented before use in terminatorTimothy Arceri1-0/+38
do-while loops can increment the starting value before the condition is checked. e.g. do { ndx++; } while (ndx < 3); This commit changes the code to detect this and reduces the iteration count by 1 if found. V2: fix terminator spelling Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com> Reviewed-by: Elie Tournier <elie.tournier@collabora.com> Tested-by: Dieter Nützel <Dieter@nuetzel-hh.de>
2017-10-10glsl: don't drop instructions from unreachable terminators continue branchTimothy Arceri2-8/+27
These instructions will be executed on every iteration of the loop we cannot drop them. V2: - move removal of unreachable terminators from the terminator list to the same place they are removed from the IR as suggested by Nicolai. Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com> Tested-by: Dieter Nützel <Dieter@nuetzel-hh.de>
2017-10-09meson: build classic swrastDylan Baker2-0/+33
This adds support for building the classic swrast implementation. This driver has been tested with glxinfo and glxgears. Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com> Reviewed-by: Eric Anholt <eric@anholt.net>
2017-10-09meson: build gbmDylan Baker2-1/+70
This doesn't include egl support, just dri support. v2: - when gbm is set to 'auto', only build if a dri driver is also enabled - Fix conditional to check for x11 modules with vulkan as well as with dri drivers v3: - Set pkgconfig libraries.private value Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com> Reviewed-by: Eric Anholt <eric@anholt.net>
2017-10-09meson: Add support for configuring dri drivers directory.Dylan Baker2-2/+2
v2: - drop with_ from dri_drivers_path variable (Eric A) v3: - Move HAVE_X11_PLATFORM to the proper patch (Eric A) Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com> Reviewed-by: Eric Anholt <eric@anholt.net>
2017-10-09meson: build glxDylan Baker5-3/+304
This gets GLX and the loader building. The resulting GLX and i965 have been tested on piglit and seem to work fine. This patch leaves a lot of todo's in it's wake, GLX is quite complicated, and the build options involved are many, and the goal at the moment is to get dri and gallium drivers building. v2: - fix typo "vaule" -> "value" - put the not on the correct element of the conditional - Put correct description of dri3 option in this patch not the next one (Eric A) - fix non glvnd version (Eric A) - build glx tests - move loader include variables to this patch (Eric A) v3: - set the version correctly for GL_LIB_NAME in libglx v4: - set pkgconfig private fields Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com> Reviewed-by: Eric Anholt <eric@anholt.net>
2017-10-09meson: Build i965 and dri stackDylan Baker20-15/+1886
This gets pretty much the entire classic tree building, as well as i965, including the various glapis. There are some workarounds for bugs that are fixed in meson 0.43.0, which is due out on October 8th. I have tested this with piglit using glx. v2: - fix typo "vaule" -> "value" - use gtest dep instead of linking to libgtest (rebase error) - use gtest dep instead of linking against libgtest (rebase error) - copy the megadriver, then create hard links from that, then delete the megadriver. This matches the behavior of the autotools build. (Eric A) - Use host_machine instead of target_machine (Eric A) - Put a comment in the right place (Eric A) - Don't have two variables for the same information (Eric A) - Put pre_args at top of file in this patch (Eric A) - Fix glx generators in this patch instead of next (Eric A) - Remove -DMESON hack (Eric A) - add sha1_h to mesa in this patch (Eric A) - Put generators in loops when possible to reduce code in mapi/glapi/gen (Eric A) v3: - put HAVE_X11_PLATFORM in this patch Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com> Reviewed-by: Eric Anholt <eric@anholt.net>
2017-10-09meson: add nir_linking_helpers.c to libnirDylan Baker1-0/+1
This was missed in a rebase, and doesn't affect radv or anv, only i965. Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com> Reviewed-by: Eric Anholt <eric@anholt.net>
2017-10-09make: Fix test to be meson compatibleDylan Baker2-1/+3
This has the same problem as the previous commit, generated headers and hardcoded paths. Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com> Reviewed-by: Eric Anholt <eric@anholt.net>
2017-10-09make: Don't traverse backwards through include directories.Dylan Baker2-1/+2
Traversing back through includes is bad idea and should be avoided. In the case here - indirect_size.h is located in the build directory $(top_builddir)/src/glx/. v3: - Update commit message with message provided by Emil Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com> Reviewed-by: Emil Velikov <emil.velikov@collabora.com> Reviewed-by: Eric Anholt <eric@anholt.net>
2017-10-09etnaviv: call util_query_clear_result(..) in the generic layerChristian Gmeiner2-2/+3
Saves us from calling util_query_clear_result(..) in every query type implementation. Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com> Reviewed-by: Wladimir J. van der Laan <laanwj@gmail.com>
2017-10-09etnaviv: push query active handling into generic layerChristian Gmeiner2-6/+16
We want the same active handling for every query type. So lets handle it in the generic layer. Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com> Reviewed-By: Wladimir J. van der Laan <laanwj@gmail.com>
2017-10-10r600: drop a bunch of post-cayman code. (v2)Dave Airlie12-1251/+199
Now that Marek has split the two drivers apart, drop a bunch of unnecessary code from the r600 half. There is probably a bunch more hiding in the video code. No piglit regressions on caicos. v2: fix HAVE_LLVM protected code Acked-by: Nicolai Hähnle <nicolai.haehnle@amd.com> Acked-by: Marek Olšák <marek.olsak@amd.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
2017-10-09amd: move r600d_common.h into r600gMarek Olšák12-30/+27
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
2017-10-09radeonsi: shrink r600d_common.h and stop using itMarek Olšák19-261/+252
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>