Commit Graph

94682 Commits

Author SHA1 Message Date
Nicolai Hähnle 78476cfe07 radeonsi: enable ARB_transform_feedback_overflow_query
v2: update for new cap name

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2017-08-02 09:49:09 +02:00
Nicolai Hähnle 1c5b7d5235 radeonsi: avoid redundant SET_PREDICATION packet with QBO workaround
The QBO workaround compute grid launch emits the render condition atom
when dirty, so install the render condition in the context only after
launching the compute grid. This avoids a redundant SET_PREDICATION.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2017-08-02 09:49:06 +02:00
Nicolai Hähnle dfc1502c84 radeonsi: fix streamout overflow predication on VI+
There is a firmware regression that causes failures. Work around it by
using the compute shader for query_buffer_objects to summarize the query
results.

v2: rename to PREDICATION_OP_BOOL64 (consistent with sid.h)

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2017-08-02 09:48:53 +02:00
Nicolai Hähnle aff93fd60e gallium/radeon: implement qbo for SO_OVERFLOW_PREDICATE
v2: use R600_MAX_STREAMS instead of 4 (Marek)

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2017-08-02 09:48:03 +02:00
Nicolai Hähnle 653316fb06 gallium/radeon: implement basic parts of PIPE_QUERY_SO_OVERFLOW_ANY_PREDICATE
v2: use R600_MAX_STREAMS instead of 4 (Marek)

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2017-08-02 09:47:52 +02:00
Nicolai Hähnle c8a5053252 gallium/radeon: fix render predication by SO overflow predicate
The predication bits are "visible or no overflow" and "not visible or
overflow", so we need to invert the check relative to the GL and Gallium
interface semantics.

Also, predication by the other streamout-related queries is not allowed.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2017-08-02 09:46:47 +02:00
Nicolai Hähnle da83687c4b gallium/radeon: fix ARB_query_buffer_object conversion to boolean
The issue here is that the immediate is treated as a 64-bit value,
and fetching it does not work reliably with swizzles that are different
from xy and zw.

Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2017-08-02 09:46:41 +02:00
Nicolai Hähnle d8b78bb0ee st/mesa: implement ARB_transform_feedback_overflow_query
v2: update for new cap name

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2017-08-02 09:46:38 +02:00
Nicolai Hähnle 877d800d60 ddebug: handle get_query_result_resource as a GPU call
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2017-08-02 09:46:36 +02:00
Nicolai Hähnle f402fa371e gallium/util: add util_{str,dump}_query_value_type
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2017-08-02 09:46:34 +02:00
Nicolai Hähnle aff9c54125 gallium: add util_dump_query_type and use it in ddebug
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2017-08-02 09:46:32 +02:00
Nicolai Hähnle 16923e42a4 gallium: rename util_dump_* to util_str_* for enum-to-string conversion
This is mostly mechanical search-and-replace, plus touching up the
macros in u_dump_defines.c manually a bit.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2017-08-02 09:46:24 +02:00
Nicolai Hähnle a677799e51 gallium: add PIPE_QUERY_SO_OVERFLOW_ANY_PREDICATE and corresponding cap
v2: rename cap to PIPE_CAP_QUERY_SO_OVERFLOW and be a bit more explicit
    in the documentation

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2017-08-02 09:37:10 +02:00
Tapani Pälli f444ac5e60 android: export intermediates from libmesa_util
Fixes following build issues:

   In file included from vendor/intel/external/android_ia/mesa/src/mesa/drivers/dri/common/dri_util.c:45:
   vendor/intel/external/android_ia/mesa/src/util/xmlpool.h:103:10: fatal error: 'xmlpool/options.h' file not found
   ...
   In file included from vendor/intel/external/android_ia/mesa/src/mesa/drivers/dri/i965/intel_screen.c:44:
   vendor/intel/external/android_ia/mesa/src/util/xmlpool.h:103:10: fatal error: 'xmlpool/options.h' file not found

Fixes: 601093f9 (xmlconfig: move into src/util)
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Chih-Wei Huang <cwhuang@linux.org.tw>
2017-08-02 10:32:48 +03:00
Tapani Pälli 99c764b647 intel: move gen_decoder.* back to COMMON_FILES
this change reverts commit 4f695731, we want to be able to build
with -DDEBUG and gen_decoder on Android.

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
2017-08-02 10:31:13 +03:00
Tapani Pälli 9bd15da85d android: link libmesa_intel_common with zlib and expat
Makes it possible to build Mesa on Android with -DDEBUG with
the next patch that reverts 4f695731.

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
2017-08-02 10:30:50 +03:00
Bas Nieuwenhuizen 341578a6ae ac/nir: Add float cast before shadow comparator clamp.
LLVM complained about passing an i32 to a float clamp.

Signed-off-by: Bas Nieuwenhuizen <basni@google.com>
Fixes: 0f9e32519b "ac/nir: clamp shadow texture comparison value on VI"
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2017-08-02 08:43:13 +02:00
Chris Wilson f28c2e2256 i965: Check result of make_surface() for intel_miptree_create_for_bo
Since make_surface() can fail, if the format isn't support by hw or
simlar error, we need to check the result before dereferencing it.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2017-08-01 21:28:09 -07:00
Dave Airlie 246690b683 virgl: add BPTC support.
This just adds the guest checks for BPTC, the host renderer
also needs code to support these.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2017-08-02 13:54:38 +10:00
Timothy Arceri 06237fc9e1 mesa/st: fix conditional jump depends on uninitialised value
Reported by valgrind at:
glsl_to_tgsi_visitor::visit(ir_expression*) (st_glsl_to_tgsi.cpp:1560)

When compiling the Deus Ex shaders.

Fixes: 28a5e7104 ("st/glsl_to_tgsi: handle precise modifier")
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Reviewed-by: Karol Herbst <karolherbst@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2017-08-02 12:55:42 +10:00
Dave Airlie cb6f16dce9 radeon/ac: use ds_swizzle for derivs on si/cik.
This looks like it's supported since llvm 3.9 at least,
so switch over radeonsi and radv to using it, -pro also
uses this. We can now drop creating lds for these operations
as the ds_swizzle operation doesn't actually write to lds at all.

Acked-by: Marek Olšák <marek.olsak@amd.com>
(stable requested due to fixing radv CIK conformance tests)
Cc: mesa-stable@lists.freedesktop.org
Signed-off-by: Dave Airlie <airlied@redhat.com>
2017-08-02 00:12:01 +01:00
Jason Ekstrand 35338a242b vulkan: Import in the latest 1.0.57 header and XML from Khronos
Acked-by: Dave Airlie <airlied@redhat.com>
2017-08-01 13:27:12 -07:00
Connor Abbott ddd9e11795 ac/nir: fix nir_op_unpack_64_2x32_split_y emission
This was broken thanks to a typo in b2367cf.

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
2017-08-01 12:20:49 -07:00
Connor Abbott 6d731c5651 ac/nir: fix lsb emission
This makes it match radeonsi. The LLVM backend itself will emit the
correct instruction, but LLVM might do incorrect optimizations since it
thinks the output is undefined when the input is 0, even though it's not
supposed to be. We really need a new intrinsic, or for the backend to
become smarter and recognize this pattern.

Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Bas Nieuwenhuizen <basni@google.com>
2017-08-01 12:20:49 -07:00
Connor Abbott de91461575 nir: fix algebraic optimizations
The optimizations are only valid for 32-bit integers. They were
mistakenly firing for 64-bit integers as well.

Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Matt Turner <mattst88@gmail.com>
2017-08-01 12:20:49 -07:00
Jason Ekstrand d62063ce31 anv: Autogenerate extension query and lookup
As time goes on, extension advertising is going to get more complex.
Today, we either implement an extension or we don't.  However, in the
future, whether or not we advertise an extension will depend on kernel
or hardware features.  This commit introduces a python codegen framework
that generates the anv_EnumerateFooExtensionProperties functions as well
as a pair of anv_foo_extension_supported functions for querying for the
support of a given extension string.  Each extension has an "enable"
predicate that is any valid C expression.  For device extensions, the
physical device is available as "device" so the expression could be
something such as "device->has_kernel_feature".  For instance
extensions, the only option is VK_USE_PLATFORM defines.

This mechanism also means that we have a single one-line-per-entry table
for all extension declarations instead of the two tables we had in
anv_device.c and the one we had in anv_entrypoints_gen.py.  The Python
code is smart and uses the XML to determine whether an extension is an
instance extension or device extension.

Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
2017-08-01 11:12:41 -07:00
Jason Ekstrand ddc86c1d0e anv: Add a new centralized extensions file
This will allow us to keep everything in one place when it comes to
declaring what extensions are supported.

Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
2017-08-01 11:12:41 -07:00
Gwan-gyeong Mun fe2a6281b3 egl/drm: Fix misused x and y offsets in swrast_get_image()
It fixes misused x and y variables on the calculation of the memory copy regions.

Cc: Giovanni Campagna <gcampagna@src.gnome.org>
Fixes: 8430af5ebe "Add support for swrast to the DRM EGL platform"
Signed-off-by: Mun Gwan-gyeong <elongbug@gmail.com>
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>

[Eric: use gbm_bo_get_bpp() instead of local function, split clamp patch]
Signed-off-by: Eric Engestrom <eric.engestrom@imgtec.com>
2017-08-01 18:37:58 +01:00
Gwan-gyeong Mun 3a5e3aa5a5 egl/drm: Fix misused x and y offsets in swrast_put_image2()
It fixes misused x and y variables on the calculation of the memory copy regions.

Cc: Giovanni Campagna <gcampagna@src.gnome.org>
Fixes: 8430af5ebe "Add support for swrast to the DRM EGL platform"
Signed-off-by: Mun Gwan-gyeong <elongbug@gmail.com>
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>

[Eric: use gbm_bo_get_bpp() instead of local function, split clamp patch]
Signed-off-by: Eric Engestrom <eric.engestrom@imgtec.com>
2017-08-01 18:37:58 +01:00
Eric Engestrom 04a40f7d2a gbm: add gbm_bo_get_bpp()
Signed-off-by: Eric Engestrom <eric@engestrom.ch>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
2017-08-01 18:36:23 +01:00
Scott D Phillips 3db05ed1d1 gles: Restore some lost typedefs
GLES/gl.h has historically provided some typedefs that are not
used in the API itself. Restore these typedefs that were lost to
avoid breaking applications.

These seem to be the only typedefs removed in the update.

Fixes: 7fd0817 "Update Khronos-supplied headers"

[Eric: added a big warning to revert this patch when pulling the updated header]
Signed-off-by: Eric Engestrom <eric.engestrom@imgtec.com>
2017-08-01 18:26:15 +01:00
Eric Engestrom e7fb7fd4ea egl: remove unnecessary empty array element
Signed-off-by: Eric Engestrom <eric@engestrom.ch>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
2017-08-01 17:43:15 +01:00
Eric Engestrom c3b223f48f egl: split enums to make use of -Wswitch
Signed-off-by: Eric Engestrom <eric@engestrom.ch>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
2017-08-01 17:43:11 +01:00
Eric Engestrom 270a1c7110 egl: use designated initaliser for _eglGlobal
Turn comments into actual code, that the compiler can check for us :)
(Speaking of, one of the comments had a typo. Challenge: find it)

Signed-off-by: Eric Engestrom <eric@engestrom.ch>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
2017-08-01 17:43:06 +01:00
Eric Engestrom 991ec1b81a egl: make platform's SwapInterval() optional
Signed-off-by: Eric Engestrom <eric.engestrom@imgtec.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
2017-08-01 17:36:57 +01:00
Eric Engestrom 97eadb07e7 loader: remove clamp_swap_interval()
As of last commit, no invalid swap interval can be stored, so there's
no need to sanitize the values when reading them anymore.

Signed-off-by: Eric Engestrom <eric.engestrom@imgtec.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
2017-08-01 17:36:57 +01:00
Eric Engestrom 2714a8f3e9 egl: deduplicate swap interval clamping logic
Signed-off-by: Eric Engestrom <eric.engestrom@imgtec.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
2017-08-01 17:36:57 +01:00
Juan A. Suarez Romero 54826331b3 glsl: xfb_stride applies to buffers, not block members
When we have an interface block like:

layout (xfb_buffer = 0, xfb_offset = 0) out Block {
                             vec4 var1;
    layout (xfb_stride = 48) vec4 var2;
                             vec4 var3;
};

According to ARB_enhanced_layouts spec:

   "The *xfb_stride* qualifier specifies how many bytes are consumed by
    each captured vertex.  It applies to the transform feedback buffer
    for that declaration, whether it is inherited or explicitly
    declared. It can be applied to variables, blocks, block members, or
    just the qualifier out. [ ...] While *xfb_stride* can be declared
    multiple times for the same buffer, it is a compile-time or
    link-time error to have different values specified for the stride
    for the same buffer."

This means xfb_stride actually applies to the buffer, and not to the
individual components.

In the above example, it means that var2 consumes 16 bytes, and var3 is
at offset 32.

This has been confirmed also by John Kessenich, the main contact for the
ARB_enhanced_layouts specs, and also because this commit fixes:

GL45.enhanced_layouts.xfb_block_member_stride

This commit is in practice a revert of 598790e856 (glsl: apply
xfb_stride to implicit offsets for ifc block members).

Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
2017-08-01 15:58:24 +00:00
Jose Fonseca d4b4478390 build: Convert git_sha1_gen script to Python (part2).
Things pointed out by Emil.

Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
2017-08-01 16:33:55 +01:00
Marek Olšák 39608761cd st/dri: don't set PIPE_BIND_SHARED for privately-allocated renderbuffers
which are MSAA and depth/stencil buffers.

Reviewed-by: Eric Anholt <eric@anholt.net>
2017-08-01 17:06:38 +02:00
Marek Olšák cb8ecb2f36 radeonsi: don't print AMD twice in the renderer string with the marketing name
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
2017-08-01 17:06:38 +02:00
Marek Olšák 1aeafb59e6 radeonsi: print CE IBs into ddebug reports
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
2017-08-01 17:06:38 +02:00
Marek Olšák 1482861abe radeonsi: fix printing vertex buffer descriptors into ddebug reports
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
2017-08-01 17:06:38 +02:00
Marek Olšák 404f524fe2 radeonsi: don't flush sL1 conditionally in WAIT_ON_CE_COUNTER
I don't know the condition for the flush, but we better turn this off.
The sL1 flush is used when CE dumps stuff into a ring buffer and the ring
buffer wraps.

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
2017-08-01 17:06:38 +02:00
Marek Olšák 94965b8219 radeonsi: set up HTILE in descriptors only when level 0 is accessible
Compression isn't enabled with non-zero levels.

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
2017-08-01 17:06:38 +02:00
Marek Olšák b9fc9d3f24 radeonsi: fix various CLEAR_STATE issues
Fixes: 064550238e ("radeonsi: use CLEAR_STATE to initialize some
                      registers")
Bugzilla: https://bugs.freedesktop.org/101969
Tested-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
2017-08-01 17:06:38 +02:00
Jose Fonseca b99dcbfeb3 build: Convert git_sha1_gen script to Python.
Python is the scripting language we've been using for scripts that need
to run across all supported platforms.

Shell is *not* a portable language for scripts.

Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
2017-08-01 15:24:39 +01:00
Nicolai Hähnle 1bc8b2c0eb Fix SCons build
Fixes: 601093f95d ("xmlconfig: move into src/util")
Tested-by: Eric Engestrom <eric.engestrom@imgtec.com>
Tested-by: Roland Scheidegger <sroland@vmware.com>
2017-08-01 13:52:59 +02:00
Samuel Pitoiset af45b8159c mesa: fix bad cast conversions in viewport()
Fixes: ddc32537d6 ("mesa: clamp viewport values only once when using glViewport()")
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=101981
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=101989
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2017-08-01 09:50:14 +02:00
Kenneth Graunke 5281e4ed3b i965/drm: Inline brw_bo_references.
It's a single atomic add, so it makes sense to inline it.

Improves performance in Piglit's drawoverhead microbenchmark's
"DrawArrays ( 1 VBO, 0 UBO,  0    ) w/ no state change" subtest by
0.400922% +/- 0.310389% (n=350) on my i7-7700HQ.

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
2017-07-31 23:19:34 -07:00