Commit Graph

94806 Commits

Author SHA1 Message Date
Samuel Pitoiset 9a0b203382 mesa: add KHR_no_error support to glBeginConditionalRender()
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
2017-08-02 12:54:31 +02:00
Samuel Pitoiset e1750e0a17 mesa: add begin_conditional_render() helper
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
2017-08-02 12:54:31 +02:00
Samuel Pitoiset 3f05193734 mesa: add KHR_no_error support to glNamedBufferData() and glBufferData()
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
2017-08-02 12:54:31 +02:00
Samuel Pitoiset 7f19018cc3 mesa: add buffer_data() and buffer_data_error() helpers
And call buffer_data_error() from _mesa_buffer_data().

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
2017-08-02 12:54:31 +02:00
Samuel Pitoiset 5c27de1ae1 mesa: add KHR_no_error support to glLineWidth()
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
2017-08-02 12:54:31 +02:00
Samuel Pitoiset 7327cb0602 mesa: add line_width() helper
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
2017-08-02 12:54:31 +02:00
Nicolai Hähnle f45efb8129 pipe-loader: fix driinfo for software and non-radeonsi drivers
Fixes: 678dadf123 ("gallium: move driinfo XML to pipe_loader")
Reviewed-by: Thomas Hellström <thellstrom@vmware.com>
2017-08-02 12:15:04 +02:00
Thomas Hellstrom eceb671002 mesa/st: Reduce the number of frontbuffer flush calls
The mesa state tracker was needlessly flushing the front buffer even if it
hadn't been drawn to since the last flush. This was happening during
glXSwapBuffers if we at some point previously had set that frontbuffer as
a read- or draw renderbuffer, or at glFlush() or glFinish() if we at some
point previously had rendered to the front buffer. Since the frontbuffer
flush typically means a full drawable copy, it's a pretty big waste.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Sinclair Yeh <syeh@vmware.com>
2017-08-02 11:55:35 +02:00
Nicolai Hähnle eb88ece9e3 Fix gallium SCons build 2017-08-02 11:48:56 +02:00
Juan A. Suarez Romero c4210dec8a glsl: look up for transform feedback varyings after linking
Check if shaders have transform feedback varyings also after the
post-link step.

This fixes:
KHR-GL45.enhanced_layouts.xfb_vertex_streams
piglit/spec/arb_enhanced_layouts/gs-stream-location-aliasing

v2: add claryfing comments (Timothy)

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
2017-08-02 10:04:12 +02:00
Nicolai Hähnle 53485c2d0e radeonsi: add enable_sisched driconf option
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2017-08-02 09:50:59 +02:00
Nicolai Hähnle 0f8c5de869 radeonsi: prepare for driver-specific driconf options
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2017-08-02 09:50:58 +02:00
Nicolai Hähnle 1e334a396c pipe-loader: move configuration_query into drm_helper
Having it inline is pointless anyway, since it's only called via a
function pointer.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2017-08-02 09:50:58 +02:00
Nicolai Hähnle b4ff5e90e9 st/dri: implement v2 of DRI_ConfigOptions
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2017-08-02 09:50:58 +02:00
Nicolai Hähnle aa222e21c2 pipe-loader: extract a standalone get_driver_descriptor helper function
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2017-08-02 09:50:58 +02:00
Nicolai Hähnle 0d7d60b7ea pipe-loader: pass only the driver_name to pipe_loader_find_module
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2017-08-02 09:50:58 +02:00
Nicolai Hähnle a35a9e7c6f gallium: add driconf options to pipe_screen_config
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2017-08-02 09:50:57 +02:00
Nicolai Hähnle e794f8bf8b gallium: move loading of drirc to pipe-loader
v2: rebase compile fix: addition of mesa_no_error

Reviewed-by: Marek Olšák <marek.olsak@amd.com> (v1)
2017-08-02 09:50:57 +02:00
Nicolai Hähnle 678dadf123 gallium: move driinfo XML to pipe_loader
We will switch to the pipe_loader loading the configuration options,
so that they can be passed to the driver independently of the state
tracker.

Put the description into its own file so that it can be merged easily
with driver-specific options in future commits.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2017-08-02 09:50:57 +02:00
Nicolai Hähnle bc7f41e11d gallium: add pipe_screen_config to screen_create functions
This allows a more generic mechanism for passing user configurations
into drivers by accessing the dri options directly.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2017-08-02 09:50:57 +02:00
Nicolai Hähnle 781375ac6f st/drm: add DRM_CONF_XML_OPTIONS
Allow drivers to return the XML that describes the available config
options.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2017-08-02 09:50:57 +02:00
Nicolai Hähnle bfc26c4120 util: add merge_driinfo.py
This tool merges driinfo XML that is built using DRI_CONF_xxx macros.
The intention is to merge together state-tracker options with
driver-specific options.

Acked-by: Marek Olšák <marek.olsak@amd.com>
2017-08-02 09:50:57 +02:00
Nicolai Hähnle ddd5f2a979 glx: use v2 of DRI_ConfigOptions
Most of the change is concerned with avoiding memory leaks, since v2 of
the DRI extension returns a malloc'ed string. This also allows us to
resolve the long-standing issue of keeping drivers loaded when returning
from glXGetDriverConfig.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2017-08-02 09:50:56 +02:00
Nicolai Hähnle 9435b9c544 dri: define a version 2 of the DRI_ConfigOptions extension
The new function is defined to return a malloc'ed pointer. In the
following patches, this helps avoid leaking library handles when pipe
drivers are linked dynamically.

It also allows us to generate the XML string on the fly in the future.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2017-08-02 09:50:56 +02:00
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