Compare commits

..

60 Commits

Author SHA1 Message Date
Dylan Baker
8440307a61 version: bump version to 20.2.3 2020-11-23 11:03:03 -08:00
Dylan Baker
0cf22886be docs: add release notes for 20.2.3 2020-11-23 11:02:26 -08:00
Kenneth Graunke
b603373448 intel/fs: Fix sampler message headers on Gen11+ when using scratch
Icelake's sampler message header introduces a field in m0.3 bit 0
which controls whether the sampler state pointer should be relative
to bindless sampler state base address or dynamic state base address.

g0.3 bit 0 is part of the per-thread scratch space field.  On older
hardware, we were able to copy that along because the sampler ignored
bits 4:0.  Now, however, we need to mask them out.

Fixes various textureGatherOffsets piglit tests when forcing the FS
to run with 2048 bytes of per-thread scratch space (which is a
per-thread scratch space encoding of 1, meaning bit 0 will be set).

Cc: mesa-stable
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6735>
(cherry picked from commit 31290f9806)
2020-11-19 11:04:48 -08:00
Marek Olšák
6b6f850afd radeonsi: fix scan_instruction for bindless inc_wrap/dec_wrap atomics
Fixes: 25fff591c1 - radeonsi: add support for nir atomic_inc_wrap/atomic_dec_wrap

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7542>
(cherry picked from commit ff22fcf450)
2020-11-19 11:04:48 -08:00
Marek Olšák
5c7eb3da12 radeonsi: only do VGT_FLUSH for fast launch if previous draw was normal launch
Fixes: 3da91b3327 - radeonsi/ngg: add VGT_FLUSH when enabling fast launch

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7542>
(cherry picked from commit 8d2876a343)
2020-11-19 11:04:48 -08:00
Marek Olšák
547332b50f radeonsi: do VGT_FLUSH when switching NGG -> legacy on Sienna Cichlid
Other chips don't need this.

Fixes: 9538b9a68e - radeonsi: add support for Sienna Cichlid

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7542>
(cherry picked from commit c4ebdf9ee7)
2020-11-19 11:04:48 -08:00
Chad Versace
6a6f94e9ec anv/image: Fix isl_surf_usage_flags for stencil images
Respect VkImageStencilUsageCreateInfoEXT.

CC: mesa-stable@lists.freedesktop.org
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
(cherry picked from commit b50275a4b6)
2020-11-19 11:04:48 -08:00
Chad Versace
8d5be4e02e anv/image: Check DISJOINT in vkGetPhysicalDeviceImageFormatProperties2 (v2)
The code did not return error when VK_IMAGE_CREATE_DISJOINT_BIT was
incompatible with the other input params.

If the Vulkan spec forbids a set of input params for vkCreateImage,
but permits them for vkGetPhysicalDeviceImageFormatProperties2,
then vkGetPhysicalDeviceImageFormatProperties2 must reject those input
params with failure.

- v2: Clearer commit message.

CC: <mesa-stable@lists.freedesktop.org>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> (v2)
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
(cherry picked from commit 51a19c83b0)
2020-11-19 11:04:48 -08:00
Eric Anholt
9020df131f freedreno: Fix leak of shader binary on disk cache hits.
It's supposed to be ralloced -- there's not even a shader variant destroy
function for freeing, just ralloc_free() on the ir3_shader_variant or the
parent ir3_shader when you're done!

Fixes: f97acb4bb4 ("freedreno/ir3: disk-cache support")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5810>
(cherry picked from commit 433841d9eb)
2020-11-19 11:04:48 -08:00
Tapani Pälli
6f379548a9 egl/dri2: fix race between image create and egl_image_target_texture
All other functions calling _eglLookupImage hold the display lock.

 ==16659== Possible data race during write of size 8 at 0x5D1BCF0 by thread #2668
 ==16659== Locks held: 1, at address 0x5D1B6F8
 ==16659==    at 0x5405DDF: _eglLinkResource (egldisplay.c:454)
 ==16659==    by 0x53F9189: _eglLinkImage (eglimage.h:138)
 ==16659==    by 0x53FE2CA: _eglCreateImageCommon (eglapi.c:1740)
 ==16659==    by 0x53FE39A: eglCreateImageKHR (eglapi.c:1751)
 ==16659==
 ==16659== This conflicts with a previous read of size 8 by thread #2664
 ==16659== Locks held: 1, at address 0x5308D00
 ==16659==    at 0x5405C06: _eglCheckResource (egldisplay.c:387)
 ==16659==    by 0x5408C92: _eglLookupImage (eglimage.h:162)
 ==16659==    by 0x5409E96: dri2_lookup_egl_image (egl_dri2.c:688)
 ==16659==    by 0x6210AAF: dri2_lookup_egl_image (dri_helpers.c:250)
 ==16659==    by 0x6212843: dri_get_egl_image (dri_screen.c:470)
 ==16659==    by 0x625F7CC: st_get_egl_image (st_cb_eglimage.c:152)
 ==16659==    by 0x625FE7D: st_egl_image_target_texture_2d (st_cb_eglimage.c:354)
 ==16659==    by 0x6501C05: egl_image_target_texture (teximage.c:3446)

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7544>
(cherry picked from commit 959c2d1edb)
2020-11-19 11:04:48 -08:00
Dave Airlie
8e081088a2 draw: fix tess eval pipeline statistics.
The number of invocations wasn't getting incremented correctly.

Fixes: 202bc38ce9 ("draw: collect tessellation invocations statistics")
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7597>
(cherry picked from commit ce07c52b82)
2020-11-19 11:04:48 -08:00
Christian Gmeiner
b14fd0d92d etnaviv: nir: do not run opt loop after nir_lower_bool_xxx(..)
Running the optimizations after bool to float/int lowering is not going
to work. Large portions of NIR are likely to blow up if they see
floats/ints in weird places. Most of the bool->float/int conversions
are direct instruction substitutions and it's not going to leave a lot
of garbage around to optimize.

Fixes nir.h:261: nir_const_value_as_bool: Assertion `i == 0 || i == -1' failed
dEQP-GLES2.functional.shaders.loops.while_constant_iterations.no_iterations_vertex

Here are shader-db results for GC2000:

instructions HURT:   shaders/tesseract/488.shader_test FRAG:           516 -> 524 (1.55%)
instructions HURT:   shaders/tesseract/491.shader_test FRAG:           248 -> 260 (4.84%)
instructions HURT:   shaders/tesseract/494.shader_test FRAG:           244 -> 256 (4.92%)
instructions HURT:   shaders/tesseract/238.shader_test FRAG:           232 -> 244 (5.17%)
instructions HURT:   shaders/tesseract/241.shader_test FRAG:           232 -> 244 (5.17%)
instructions HURT:   shaders/tesseract/127.shader_test FRAG:           76 -> 80 (5.26%)
instructions HURT:   shaders/tesseract/130.shader_test FRAG:           148 -> 156 (5.41%)
instructions HURT:   shaders/tesseract/226.shader_test FRAG:           192 -> 204 (6.25%)
instructions HURT:   shaders/tesseract/229.shader_test FRAG:           192 -> 204 (6.25%)
instructions HURT:   shaders/tesseract/217.shader_test FRAG:           152 -> 164 (7.89%)
instructions HURT:   shaders/tesseract/214.shader_test FRAG:           152 -> 164 (7.89%)
instructions HURT:   shaders/tesseract/205.shader_test FRAG:           112 -> 124 (10.71%)
instructions HURT:   shaders/tesseract/202.shader_test FRAG:           112 -> 124 (10.71%)
instructions HURT:   shaders/tesseract/169.shader_test FRAG:           32 -> 36 (12.50%)
instructions HURT:   shaders/tesseract/166.shader_test FRAG:           32 -> 36 (12.50%)
instructions HURT:   shaders/deqp_gles3/61312.shader_test FRAG:        448 -> 508 (13.39%)
instructions HURT:   shaders/deqp_gles3/61309.shader_test FRAG:        448 -> 508 (13.39%)
instructions HURT:   shaders/deqp_gles3/61324.shader_test FRAG:        448 -> 508 (13.39%)
instructions HURT:   shaders/tesseract/118.shader_test FRAG:           28 -> 32 (14.29%)
instructions HURT:   shaders/tesseract/181.shader_test FRAG:           52 -> 60 (15.38%)
instructions HURT:   shaders/tesseract/178.shader_test FRAG:           52 -> 60 (15.38%)
instructions HURT:   shaders/tesseract/121.shader_test FRAG:           52 -> 60 (15.38%)
instructions HURT:   shaders/tesseract/193.shader_test FRAG:           72 -> 84 (16.67%)
instructions HURT:   shaders/tesseract/190.shader_test FRAG:           72 -> 84 (16.67%)

total instructions in shared programs: 64220 -> 64572 (0.55%)
instructions in affected programs: 4924 -> 5276 (7.15%)
helped: 5
HURT: 24
helped stats (abs) min: 4 max: 8 x̄: 5.60 x̃: 4
helped stats (rel) min: 4.35% max: 5.41% x̄: 4.72% x̃: 4.35%
HURT stats (abs)   min: 4 max: 60 x̄: 15.83 x̃: 12
HURT stats (rel)   min: 1.55% max: 16.67% x̄: 10.04% x̃: 10.71%
95% mean confidence interval for instructions value: 5.39 18.89
95% mean confidence interval for instructions %-change: 4.81% 10.18%
Instructions are HURT.

total temps in shared programs: 2514 -> 2512 (-0.08%)
temps in affected programs: 9 -> 7 (-22.22%)
helped: 2
HURT: 0

Cc: <mesa-stable@lists.freedesktop.org>
Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Lucas Stach <l.stach@pengutronix.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7624>
(cherry picked from commit 9b6516ac24)
2020-11-19 11:04:48 -08:00
Vinson Lee
35c46bcf0b vdpau: Add missing printf format specifier.
Fix defect reported by Coverity Scan.

Extra argument to printf format specifier (PRINTF_ARGS)
extra_argument: This argument was not used by the format string: vmixer->max_layers.

Fixes: 89b9863252 ("vdpau: Add support for parameters")
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Leo Liu <leo.liu@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7200>
(cherry picked from commit 3fe5c13d71)
2020-11-19 11:04:48 -08:00
Rob Clark
bf4a4d61a0 freedreno/ir3: Fix crash in shader compile fail path
Fixes: 74140c2e85 ("freedreno/ir3: convert over to ralloc")
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7612>
(cherry picked from commit 4b65c09d86)
2020-11-19 11:04:47 -08:00
Nanley Chery
cd8081867f mesa: Clamp some depth values in glClearBufferfi
OpenGL 3.0 spec, section 4.2.3 "Clearing the Buffers":

   depth and stencil are the values to clear the depth and stencil
   buffers to, respectively. Clamping and type conversion for
   fixed-point depth buffers are performed in the same fashion as for
   ClearDepth.

Enables iris to pass the clearbuffer-depth-stencil piglit test.

Cc: mesa-stable
Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7410>
(cherry picked from commit 2e713313a2)
2020-11-19 11:04:47 -08:00
Nanley Chery
f2d8a62116 mesa: Clamp some depth values in glClearBufferfv
OpenGL 3.0 spec, section 4.2.3 "Clearing the Buffers":

   If buffer is DEPTH, drawbuffer must be zero, and value points to the
   single depth value to clear the depth buffer to. Clamping and type
   conversion for fixed-point depth buffers are performed in the same
   fashion as for ClearDepth.

Enables iris to pass the clearbuffer-depth piglit test.

v2. Add spec citation. (Eric Anholt)
v3. Don't clamp floating point formats. (Eric Anholt)

Cc: mesa-stable
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7410>
(cherry picked from commit 1bf539b3a2)
2020-11-19 11:04:47 -08:00
Nanley Chery
4b088edc2b mesa: Add and use _mesa_has_depth_float_channel
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7410>
(cherry picked from commit fda015023a)
2020-11-19 11:04:47 -08:00
Brendan Dougherty
ce9b4296e1 mesa: Fix vertex_format_to_pipe_format index.
Corrects the index into the vertex_formats table for `integer` and
`normalized` values other than 0 or 1.

Fixes: e6448f993b ("mesa: translate into gallium vertex formats in mesa/main")
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7554>
(cherry picked from commit 9edb6e1be0)
2020-11-19 10:49:42 -08:00
Marcin Ślusarz
8770b7f426 nir: handle float atomics in copy propagation pass
Without this patch, copy propagation pass can optimize out
buffer loads out of compare & swap loop, which then leads
to infinite loop.

Triggered by a change to atomicCompSwap float test in piglit.

Fixes: 8424cd8fbd ("nir: Account for atomics in copy propagation.")
Suggested-by: Jason Ekstrand <jason@jlekstrand.net>
Signed-off-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7538>
(cherry picked from commit 6e6dab4799)
2020-11-19 10:49:41 -08:00
Jason Ekstrand
e9fe1addb7 intel/fs: Fix use of undefined value in fixup_nomask_control_flow
Fixes: a8ac0bd759 "intel/fs/gen12: Workaround unwanted SEND execution..."
Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7536>
(cherry picked from commit e9caba6ce5)
2020-11-19 10:49:40 -08:00
Eric Anholt
48a5602dd5 util/set: Fix the _mesa_set_clear function to not leave tombstones.
This implementation was broken and should have just been the same as the
hash_table_clear() one, which I copied over here.  It was setting all
formerly-present entries to deleted, yet also setting deleted_entries to
0.  This meant that all new searches or additions after clearing would
have to reprobe the whole table until a rehash happened, and that rehash
would be delayed because we violated the deleted_entries invariant.

No statistically significant performance difference on softpipe
KHR-GL33.texture_swizzle.functional runtime (n=18)

Fixes: 5c075b0855 ("util/set: add a set_clear function")
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7244>
(cherry picked from commit 2afdd94f86)
2020-11-19 10:49:38 -08:00
Rob Clark
53d03d91b8 freedreno: Protect gmem_cache ralloc allocations
Since the ralloc context for cache_key allocation is shared between all
the contexts hanging off a screen, we need to allocate the key under the
screen->lock.

Fixes: 91f9bb99c5 ("freedreno: add gmem state cache")
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7342>
(cherry picked from commit cb034ae44f)
2020-11-19 10:49:36 -08:00
Vinson Lee
28c5ca4588 frontends/va: Fix *num_entrypoints check.
Fix defect reported by Coverity Scan.

Dereference before null check (REVERSE_INULL)
check_after_deref: Null-checking num_entrypoints suggests that it
may be null, but it has already been dereferenced on all paths
leading to the check.

Fixes: 5bcaa1b9e9 ("st/va: add encode entrypoint v2")
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7360>
(cherry picked from commit 7820c8c13f)
2020-11-19 10:49:06 -08:00
Erik Faye-Lund
40f664a9e5 mesa/main: add missing include in glformats.h
This header uses uint32_t without including stdint.h. This worked fine
by accident until a new c-source started including it.

Fixes: 1bf539b3a2 ("mesa: Clamp some depth values in glClearBufferfv")
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7637>
(cherry picked from commit 2410def98f)
2020-11-19 10:48:58 -08:00
Matt Turner
323c4e957d glcpp: Handle bison-3.6 error message changes
In bison's commit 72c9fa4510eb (skeletons: use "end of file" instead of
"$end") in bison-3.6, '$end' was changed to 'end of file' in error
messages. Since our glcpp test cases contain the expected output text,
they rely on the particular messages printed by bison. The test case
084-unbalanced-parentheses fails when Mesa is built with bison-3.6 due
to this change.

To allow the test to pass on all supported versions of bison, we:

   1. Change '$end' -> 'end of file' in the .expected file, and
   2. Normalize the error generated by the test case with the same
      replacement

Cc: mesa-stable
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3181
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7659>
(cherry picked from commit df29d0a111)
2020-11-19 10:48:38 -08:00
Dylan Baker
c2fb3d3f0e .pick_status.json: Update to bac6cc586f 2020-11-19 10:48:09 -08:00
Erik Faye-Lund
0368cdd51d gallium/util: do not pass undefined sample-count
We forgot to initialize the sample_count member here, leading to it
being undefined. This causes problems on MSVC when compiling in
debug-mode, where we get a run-time error for using an undefined
variable.

To avoid similar problems in the future if more fields are added,
let's initialize the whole struct to zero to start with. This also
allows us to remove a no-longer-needed zero-initialization.

Fixes: cf170616da ("gallium: Add a util_blitter path for using a custom VS and FS.")
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7503>
(cherry picked from commit 441feda0bb)
2020-11-19 10:47:37 -08:00
Vinson Lee
08153eeb7d amd/addrlib: Add missing va_end.
Fix defect reported by Coverity Scan.

Missing varargs init or cleanup (VARARGS)
missing_va_end: va_end was not called for debugPrintInput.ap.

Fixes: 69ea473eeb ("amd/addrlib: update to the latest version")
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7299>
(cherry picked from commit c8630fd114)
2020-11-19 10:47:37 -08:00
Nanley Chery
06c593be5b iris: Flush dmabufs during context flushes
Currently, every modifier that uses CCS also lacks support for
fast-clears. On gen9+, dmabufs may gain fast-cleared blocks through
clear calls. On gen12, fast-clearing can occur during any rendering
operation. Mark when dmabufs gain fast-cleared blocks and flush them
during a context flush operation.

Cc: mesa-stable
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3425
Tested-by: Simon Ser <contact@emersion.fr>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7384>
(cherry picked from commit 5194cbc766)
2020-11-19 10:47:37 -08:00
Kenneth Graunke
151bff94c3 iris: fix source/destination layers for 3D blits
See commit ea32691257 for the
corresponding fix in anv.

Fixes Piglit's fbo-generatemipmap-3d.

Cc: mesa-stable
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7321>
(cherry picked from commit 382451ff9d)
2020-11-19 10:47:37 -08:00
Tony Wasserka
aa35378aeb aco/ra: Fix counting of subdword variables in get_reg_create_vector
The loop variable "k" shadowed another variable in the outer scope, so
this loop had no actual effect.

Fixes: 52cc1f8237 ("aco: improve p_create_vector RA for sub-dword operands")
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7427>
(cherry picked from commit 456beb40b8)
2020-11-19 10:47:37 -08:00
Jason Ekstrand
a37b964ec1 nir/opt_intrinsics: Report progress for the gl_SampleMask optimization
Fixes: d3ce8a7f6b "nir: optimize gl_SampleMaskIn to gl_HelperInvocation..."
Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7366>
(cherry picked from commit d9c0f3627d)
2020-11-19 10:47:37 -08:00
Rhys Perry
307fe5bd61 nir: skip bcsel with non-trivial swizzle in opt_simplify_bcsel_of_phi()
Fixes validation error in a Dota 2 shader.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Fixes: b031c64349 ("nir: Convert a bcsel with only phi node sources to a phi node")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7426>
(cherry picked from commit 233a820f2c)
2020-11-19 10:47:37 -08:00
Rhys Perry
db671d8687 nir: add nir_alu_src_is_trivial_ssa()
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7426>
(cherry picked from commit 1df2fc9f9c)
2020-11-19 10:47:37 -08:00
Jason Ekstrand
8564e7da36 nir: Handle incomplete derefs in split_struct_vars
In split_var_list_structs where we initalize the splitting, we already
use get_complex_used_vars to avoid splitting any variables that have a
complex use.  However, we weren't actually handling the complex uses
properly in the case where we can't actually find the variable.

Fixes: f1cb3348f1 "nir/split_vars: Properly bail in the presence of ..."
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6332>
(cherry picked from commit 5664713d7b)
2020-11-19 10:47:37 -08:00
Yevhenii Kolesnikov
194d070040 nir/large_constants: only search for constant duplicates
Fixes: b6d4753568 ("nir/large_constants: De-duplicate constants")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3706
Signed-off-by: Yevhenii Kolesnikov <yevhenii.kolesnikov@globallogic.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7350>
(cherry picked from commit ea81889ea4)
2020-11-19 10:47:37 -08:00
Igor V. Kovalenko
e21a96791c r600: amend space check for chips older than EVERGREEN
evergreen_emit_atomic_buffer_setup_count is only called if chip >= EVERGREEN
otherwise atomic_used_mask is left uninitialized when unconditionally used by
r600_need_cs_space so it might want more space than needed

fix this by always initializing atomic_used_mask

Fixes: 32529e6084 ("r600/eg: rework atomic counter emission with flushes")
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7417>
(cherry picked from commit 7ae81d65a4)
2020-11-19 10:47:37 -08:00
Jason Ekstrand
f710a35e30 mesa/spirv: Lower variable initializers for global variables
We lower variable initializers for local variables higher up in the
function but we never called nir_lower_variable_initializers for
anything else.

Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7296>
(cherry picked from commit 6b85a887ff)
2020-11-19 10:47:37 -08:00
Tapani Pälli
9c55ccd8fd mesa: do not throw _mesa_problem when invalid enum is used
Like with other getters, invalid enum is dealt in find_value by setting
error to GL_INVALID_ENUM and returning INVALID_TYPE which makes
get_value_size return 0.

Fixes false 'implementation errors' seen with Piglit test:
   ext_external_objects-memory-object-api-errors

   "Mesa 20.3.0-devel implementation error: invalid value type in GetUnsignedBytei_vEXT()
   Please report at https://gitlab.freedesktop.org/mesa/mesa/-/issues"

v2: add assert to get_value_size() (Lionel)

Fixes: e064d66020 ("mesa: implement glGetUnsignedByte{v|i_v}")
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Eleni Maria Stea <estea@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7403>
(cherry picked from commit 29fc115d58)
2020-11-19 10:47:37 -08:00
Tapani Pälli
3ed72705b3 mesa/st: call memobj_destroy only if there is memory imported
Something may go wrong during import which leaves pointer to null and
when ctx and it's shared state gets destroyed we will attempt to call
memobj_destroy. Instead of forcing every driver to handle it, add check
here.

Fixes crashes with Piglit test:
   ext_external_objects_fd-memory-object-api-errors

Fixes: 99cf910834 ("mesa/st: Actually free the driver part of memory objects on destruction.")
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Eleni Maria Stea <estea@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7403>
(cherry picked from commit e02e1ccbee)
2020-11-19 10:47:37 -08:00
Dylan Baker
18a9762691 .pick_status.json: Mark ea32691257 as backported 2020-11-19 10:47:37 -08:00
Dylan Baker
b017db8350 .pick_status.json: Mark 87934f02f9 as backported 2020-11-19 10:47:37 -08:00
Rhys Perry
d0d0c3abc4 radv: fix shader caching with NaN fixup workaround
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Fixes: 6f21995f98 ("radv: add new drirc option radv_enable_mrt_output_nan_fixup")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7423>
(cherry picked from commit ac65d3b6b8)
2020-11-19 10:47:37 -08:00
Rhys Perry
f00bce0ee4 radv: fix shader caching with discard->demote workaround
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Fixes: bdd7587414 ("radv: use nir_lower_discard_to_demote to work around game bugs")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7423>
(cherry picked from commit 36f62494ec)
2020-11-19 10:47:37 -08:00
Marcin Ślusarz
5e5060324b anv: always annotate memory returned from anv_gem_mmap
anv_bo_pool_alloc expects that the memory returned by and_gem_mmap
was annotated using VALGRIND_MALLOCLIKE_BLOCK, but anv_gem_mmap_offset
didn't do that. Move annotation from anv_gem_mmap_legacy to common
code.

Fixes: 4abf0837cd ("anv: Add support for new MMAP_OFFSET ioctl.")

Signed-off-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7381>
(cherry picked from commit b5e2c58ad8)
2020-11-19 10:47:37 -08:00
Vinson Lee
8f766d37eb os: Fix open result check.
Fix defect reported by Coverity Scan.

Argument cannot be negative (NEGATIVE_RETURNS)
negative_returns: f is passed to a parameter that cannot be negative.

CID: 1364709
Fixes: 13fa051356 ("auxiliary/os: add new os_get_command_line() function")
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7344>
(cherry picked from commit b2a21febe0)
2020-11-19 10:47:37 -08:00
Michel Dänzer
9f3d7d54d8 iris/bufmgr: Handle NULL bufmgr in iris_bufmgr_get_for_fd
iris_bufmgr_create can return NULL, in which case we'd crash in
list_addtail.

Reported by Coverity/clang (for i965, but iris code looks the same).

Fixes: 7557f16059 ("iris: share buffer managers accross screens")
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7335>
(cherry picked from commit 1eda842318)
2020-11-19 10:47:37 -08:00
Michel Dänzer
436592d1f4 i965/bufmgr: Handle NULL bufmgr in brw_bufmgr_get_for_fd
brw_bufmgr_create can return NULL, in which case we'd crash in
list_addtail.

Reported by Coverity/clang.

Fixes: 4094558e86 ("i965: share buffer managers across screens")
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7335>
(cherry picked from commit eb61f8959e)
2020-11-19 10:47:37 -08:00
Timothy Arceri
f06c466895 glsl: add extra pp tokens workaround and enable for CoR
The CTS now tests to make sure these are not allowed. However, previously
drivers (including Mesa) would allow them to exist and just issue a
warning. Some old applications such as Champions of Regnum seem to
depend on this.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/422

Fixes: 43047384c3 ("glsl/glcpp: Promote "extra token at end of directive" from warning to error")

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7361>
(cherry picked from commit a09717c4de)

Conflicts:
	src/gallium/auxiliary/pipe-loader/driinfo_gallium.h
	src/mesa/drivers/dri/i965/intel_screen.c
2020-11-19 10:47:37 -08:00
Dylan Baker
889f43c3f1 .pick_status.json: Update to 87dc3106b0 2020-11-19 10:47:37 -08:00
Krunal Patel
46415c169d radeon/vcn: Bitrate not updated when changing framerate
Issue: Encoding parameters not updated after changing FrameRate

Root Cause:
In radeon_enc_begin_frame, there is a parameter need_rate_control
which was enabled only if the bitrate is changed. Due to this the
radeon_enc_rc_layer_init was not updating the encoder parameters with new
framerate, peak_bits_per_picture_integer and avg_target_bits_per_picture

Fix:
Added the condition where we will check if there is a change in
other parameters and enable rate control. Eventually updating the
encoder parameters with new framerate and bitrate.

Signed-off-by: Krunal Patel <krunalkumarmukeshkumar.patel@amd.corp-partner.google.com>
Reviewed-by: Boyuan Zhang boyuan.zhang@amd.com
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7363>
(cherry picked from commit 4143572f93)
2020-11-19 10:47:37 -08:00
Krunal Patel
cef988c3cf gallium/auxiliary/vl: Odd Dimensions are failing
Issue: While running the tast for odd resolutions there are green lines
observed in the dumped image. The resolution is 321x241, the extra 1 pixel
data is missing in the image. The reason for this is in the post
processing when we adjust the size of height and width we are
dividing it by 2.

Fix: To resolve this issue we first need to align it to 2 and then divide
by 2 to get the required values. Once we do this we will have proper data
in the dumped image and missing pixel data will be available.

Signed-off-by: Krunal Patel <krunalkumarmukeshkumar.patel@amd.corp-partner.google.com>
Reviewed-by: Leo Liu <leo.liu@amd.com>
(cherry picked from commit d78e7b7aee)

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7282>
2020-11-19 10:47:37 -08:00
Bas Nieuwenhuizen
fa905a29d0 radv: Add ETC2 support on RAVEN2.
I did a whole bunch of validation and it essentially works.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
(cherry picked from commit 8531830038)

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7282>
2020-11-19 10:47:37 -08:00
Louis Li
8b6ef5568a radeon/radeon_vce: fix out of target bitrate in CBR mode (H.264)
StoneyRidge may not comply to required target bitrate
when generating H.264 stream in CBR mode.

Signed-off-by: Louis Li <Ching-shih.Li@amd.com>
Reviewed-by: Leo Liu <leo.liu@amd.com>
(cherry picked from commit f7e7cf637e)

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7282>
2020-11-19 10:47:37 -08:00
Woody Chow
bb6f48a54c st/mesa: Fix EGLImageTargetTexture2D for GL_TEXTURE_2D
Before this change, internalFormat was defaulted to GL_RGBA (
unsized internal format). Therefore, subsequent glTexSubImage2D
call with type != GL_UNSIGNED_BYTE, GL_UNSIGNED_SHORT_4_4_4_4 or
GL_UNSIGNED_SHORT_5_5_5_1 would give GL_INVALID_OPERATION.

This fixes

android.graphics.cts.BitmapColorSpaceTest#test16bitHardware
android.graphics.cts.ImageDecoderTest#testDecodeBitmap*
android.graphics.cts.BitmapTest#testNdkFormatsHardware

in CtsGraphicsTestCases

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6382>
(cherry picked from commit 5e4d69ec78)
2020-11-19 10:47:37 -08:00
Gert Wollny
1c40db5dc4 r600: revert disabling llvm draw
Now that llvm supports NIR and lowers uniforms to UBO in draw
calls when this hasn't be done before this can be used again.

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6706>
2020-11-19 10:47:37 -08:00
Raven
288d33d3f4 winsys/svga: fix display corruption after surface_init
Cherry-pick of commit f41848a9 to fix display corruption in KDE
Fixes: ba37d408 ("svga: Performance fixes")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3599
2020-11-19 10:47:37 -08:00
Eric Anholt
6111de07d1 freedreno/cffdec: When .mergedregs is set, don't count half regs.
This matches what ir3.c does in the mergedregs case: just count max full
reg used.  This flag is unset so far, but will be soon and keeps our
output comparable between blob and freedreno.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6323>
(cherry picked from commit ce335dcb19)
2020-11-19 10:47:37 -08:00
Dylan Baker
0ff10e6be4 .pick_status.json: Update to bf5cea7232 2020-11-19 10:47:37 -08:00
Dylan Baker
b09d6e2bfe dcs: Add sha256 sums for 20.2.2 2020-11-06 20:45:47 -08:00
71 changed files with 7500 additions and 108 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -1 +1 @@
20.2.2
20.2.3

View File

@@ -19,7 +19,7 @@ SHA256 checksum
::
TBD.
1f93eb1090cf71490cd0e204e04f8427a82b6ed534b7f49ca50cea7dcc89b861 mesa-20.2.2.tar.xz
New features

184
docs/relnotes/20.2.3.rst Normal file
View File

@@ -0,0 +1,184 @@
Mesa 20.2.3 Release Notes / 2020-11-23
======================================
Mesa 20.2.3 is a bug fix release which fixes bugs found since the 20.2.2 release.
Mesa 20.2.3 implements the OpenGL 4.6 API, but the version reported by
glGetString(GL_VERSION) or glGetIntegerv(GL_MAJOR_VERSION) /
glGetIntegerv(GL_MINOR_VERSION) depends on the particular driver being used.
Some drivers don't support all the features required in OpenGL 4.6. OpenGL
4.6 is **only** available if requested at context creation.
Compatibility contexts may report a lower version depending on each driver.
Mesa 20.2.3 implements the Vulkan 1.2 API, but the version reported by
the apiVersion property of the VkPhysicalDeviceProperties struct
depends on the particular driver being used.
SHA256 checksum
---------------
::
TBD.
New features
------------
- None
Bug fixes
---------
- glcpp test 084-unbalanced-parentheses fails with bison 3.6.y
- iris: glClear with FBO imported from DMA-BUF doesn't work
- [spirv-fuzz] Shader causes an assertion failure in nir_opt_large_constants
- Regnum Online UBO break after game update
- Random corruption in KDE with Mesa 20.2 in VMware
Changes
-------
Bas Nieuwenhuizen (1):
- radv: Add ETC2 support on RAVEN2.
Brendan Dougherty (1):
- mesa: Fix vertex_format_to_pipe_format index.
Chad Versace (2):
- anv/image: Check DISJOINT in vkGetPhysicalDeviceImageFormatProperties2 (v2)
- anv/image: Fix isl_surf_usage_flags for stencil images
Christian Gmeiner (1):
- etnaviv: nir: do not run opt loop after nir_lower_bool_xxx(..)
Dave Airlie (1):
- draw: fix tess eval pipeline statistics.
Dylan Baker (6):
- dcs: Add sha256 sums for 20.2.2
- .pick_status.json: Update to bf5cea7232f9ee2934c212211ebefb6fe766526d
- .pick_status.json: Update to 87dc3106b077199b829a082e32ec33d0c6d400ab
- .pick_status.json: Mark 87934f02f9da94f1a493096049c229b973e4785c as backported
- .pick_status.json: Mark ea326912575fad09af59486ad62d126c4ea0ede7 as backported
- .pick_status.json: Update to bac6cc586fe4c1b24351e0574d3a961eb631f6ae
Eric Anholt (3):
- freedreno/cffdec: When .mergedregs is set, don't count half regs.
- util/set: Fix the _mesa_set_clear function to not leave tombstones.
- freedreno: Fix leak of shader binary on disk cache hits.
Erik Faye-Lund (2):
- gallium/util: do not pass undefined sample-count
- mesa/main: add missing include in glformats.h
Gert Wollny (1):
- r600: revert disabling llvm draw
Igor V. Kovalenko (1):
- r600: amend space check for chips older than EVERGREEN
Jason Ekstrand (4):
- mesa/spirv: Lower variable initializers for global variables
- nir: Handle incomplete derefs in split_struct_vars
- nir/opt_intrinsics: Report progress for the gl_SampleMask optimization
- intel/fs: Fix use of undefined value in fixup_nomask_control_flow
Kenneth Graunke (2):
- iris: fix source/destination layers for 3D blits
- intel/fs: Fix sampler message headers on Gen11+ when using scratch
Krunal Patel (2):
- gallium/auxiliary/vl: Odd Dimensions are failing
- radeon/vcn: Bitrate not updated when changing framerate
Louis Li (1):
- radeon/radeon_vce: fix out of target bitrate in CBR mode (H.264)
Marcin Ślusarz (2):
- anv: always annotate memory returned from anv_gem_mmap
- nir: handle float atomics in copy propagation pass
Marek Olšák (3):
- radeonsi: do VGT_FLUSH when switching NGG -> legacy on Sienna Cichlid
- radeonsi: only do VGT_FLUSH for fast launch if previous draw was normal launch
- radeonsi: fix scan_instruction for bindless inc_wrap/dec_wrap atomics
Matt Turner (1):
- glcpp: Handle bison-3.6 error message changes
Michel Dänzer (2):
- i965/bufmgr: Handle NULL bufmgr in brw_bufmgr_get_for_fd
- iris/bufmgr: Handle NULL bufmgr in iris_bufmgr_get_for_fd
Nanley Chery (4):
- iris: Flush dmabufs during context flushes
- mesa: Add and use _mesa_has_depth_float_channel
- mesa: Clamp some depth values in glClearBufferfv
- mesa: Clamp some depth values in glClearBufferfi
Raven (1):
- winsys/svga: fix display corruption after surface_init
Rhys Perry (4):
- radv: fix shader caching with discard->demote workaround
- radv: fix shader caching with NaN fixup workaround
- nir: add nir_alu_src_is_trivial_ssa()
- nir: skip bcsel with non-trivial swizzle in opt_simplify_bcsel_of_phi()
Rob Clark (2):
- freedreno: Protect gmem_cache ralloc allocations
- freedreno/ir3: Fix crash in shader compile fail path
Tapani Pälli (3):
- mesa/st: call memobj_destroy only if there is memory imported
- mesa: do not throw _mesa_problem when invalid enum is used
- egl/dri2: fix race between image create and egl_image_target_texture
Timothy Arceri (1):
- glsl: add extra pp tokens workaround and enable for CoR
Tony Wasserka (1):
- aco/ra: Fix counting of subdword variables in get_reg_create_vector
Vinson Lee (4):
- os: Fix open result check.
- amd/addrlib: Add missing va_end.
- frontends/va: Fix *num_entrypoints check.
- vdpau: Add missing printf format specifier.
Woody Chow (1):
- st/mesa: Fix EGLImageTargetTexture2D for GL_TEXTURE_2D
Yevhenii Kolesnikov (1):
- nir/large_constants: only search for constant duplicates

View File

@@ -230,6 +230,7 @@ VOID Object::DebugPrint(
m_client.callbacks.debugPrint(&debugPrintInput);
va_end(ap);
va_end(debugPrintInput.ap);
}
#endif
}

View File

@@ -1349,7 +1349,7 @@ PhysReg get_reg_create_vector(ra_ctx& ctx,
PhysReg reg;
reg.reg_b = j * 4;
unsigned bytes_left = bytes - (j - reg_lo) * 4;
for (unsigned k = 0; k < MIN2(bytes_left, 4); k++, reg.reg_b++)
for (unsigned byte_idx = 0; byte_idx < MIN2(bytes_left, 4); byte_idx++, reg.reg_b++)
k += reg_file.test(reg, 1);
} else {
k += 4;

View File

@@ -624,6 +624,7 @@ radv_device_supports_etc(struct radv_physical_device *physical_device)
{
return physical_device->rad_info.family == CHIP_VEGA10 ||
physical_device->rad_info.family == CHIP_RAVEN ||
physical_device->rad_info.family == CHIP_RAVEN2 ||
physical_device->rad_info.family == CHIP_STONEY;
}

View File

@@ -219,6 +219,10 @@ static uint32_t get_hash_flags(struct radv_device *device)
hash_flags |= RADV_HASH_SHADER_GE_WAVE32;
if (device->physical_device->use_llvm)
hash_flags |= RADV_HASH_SHADER_LLVM;
if (device->instance->debug_flags & RADV_DEBUG_DISCARD_TO_DEMOTE)
hash_flags |= RADV_HASH_SHADER_DISCARD_TO_DEMOTE;
if (device->instance->enable_mrt_output_nan_fixup)
hash_flags |= RADV_HASH_SHADER_MRT_NAN_FIXUP;
return hash_flags;
}

View File

@@ -1589,6 +1589,8 @@ struct radv_shader_module;
#define RADV_HASH_SHADER_PS_WAVE32 (1 << 2)
#define RADV_HASH_SHADER_GE_WAVE32 (1 << 3)
#define RADV_HASH_SHADER_LLVM (1 << 4)
#define RADV_HASH_SHADER_DISCARD_TO_DEMOTE (1 << 5)
#define RADV_HASH_SHADER_MRT_NAN_FIXUP (1 << 6)
void
radv_hash_shaders(unsigned char *hash,

View File

@@ -781,7 +781,10 @@ replacement_list:
junk:
/* empty */
| pp_tokens {
glcpp_error(&@1, parser, "extra tokens at end of directive");
if (parser->gl_ctx->Const.AllowExtraPPTokens)
glcpp_warning(&@1, parser, "extra tokens at end of directive");
else
glcpp_error(&@1, parser, "extra tokens at end of directive");
}
;

View File

@@ -1,2 +1,2 @@
0:2(8): preprocessor error: syntax error, unexpected $end
0:2(8): preprocessor error: syntax error, unexpected end of file

View File

@@ -79,6 +79,10 @@ def test_output(glcpp, filename, expfile, nl_format='\n'):
with open(expfile, 'r') as f:
expected = f.read()
# Bison 3.6 changed '$end' to 'end of file' in its error messages
# See: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3181
actual = actual.replace('$end', 'end of file')
if actual == expected:
return (True, [])
return (False, difflib.unified_diff(actual.splitlines(), expected.splitlines()))

View File

@@ -271,6 +271,20 @@ nir_alu_dest_copy(nir_alu_dest *dest, const nir_alu_dest *src,
dest->saturate = src->saturate;
}
bool
nir_alu_src_is_trivial_ssa(const nir_alu_instr *alu, unsigned srcn)
{
static uint8_t trivial_swizzle[] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 };
STATIC_ASSERT(ARRAY_SIZE(trivial_swizzle) == NIR_MAX_VEC_COMPONENTS);
const nir_alu_src *src = &alu->src[srcn];
unsigned num_components = nir_ssa_alu_instr_src_components(alu, srcn);
return src->src.is_ssa && (src->src.ssa->num_components == num_components) &&
!src->abs && !src->negate &&
(memcmp(src->swizzle, trivial_swizzle, num_components) == 0);
}
static void
cf_init(nir_cf_node *node, nir_cf_node_type type)

View File

@@ -1406,6 +1406,8 @@ bool nir_alu_srcs_negative_equal(const nir_alu_instr *alu1,
const nir_alu_instr *alu2,
unsigned src1, unsigned src2);
bool nir_alu_src_is_trivial_ssa(const nir_alu_instr *alu, unsigned srcn);
typedef enum {
nir_deref_type_var,
nir_deref_type_array,

View File

@@ -185,15 +185,19 @@ gather_vars_written(struct copy_prop_var_state *state,
break;
case nir_intrinsic_deref_atomic_add:
case nir_intrinsic_deref_atomic_fadd:
case nir_intrinsic_deref_atomic_imin:
case nir_intrinsic_deref_atomic_umin:
case nir_intrinsic_deref_atomic_fmin:
case nir_intrinsic_deref_atomic_imax:
case nir_intrinsic_deref_atomic_umax:
case nir_intrinsic_deref_atomic_fmax:
case nir_intrinsic_deref_atomic_and:
case nir_intrinsic_deref_atomic_or:
case nir_intrinsic_deref_atomic_xor:
case nir_intrinsic_deref_atomic_exchange:
case nir_intrinsic_deref_atomic_comp_swap:
case nir_intrinsic_deref_atomic_fcomp_swap:
case nir_intrinsic_store_deref:
case nir_intrinsic_copy_deref: {
/* Destination in all of store_deref, copy_deref and the atomics is src[0]. */
@@ -1057,15 +1061,19 @@ copy_prop_vars_block(struct copy_prop_var_state *state,
}
case nir_intrinsic_deref_atomic_add:
case nir_intrinsic_deref_atomic_fadd:
case nir_intrinsic_deref_atomic_imin:
case nir_intrinsic_deref_atomic_umin:
case nir_intrinsic_deref_atomic_fmin:
case nir_intrinsic_deref_atomic_imax:
case nir_intrinsic_deref_atomic_umax:
case nir_intrinsic_deref_atomic_fmax:
case nir_intrinsic_deref_atomic_and:
case nir_intrinsic_deref_atomic_or:
case nir_intrinsic_deref_atomic_xor:
case nir_intrinsic_deref_atomic_exchange:
case nir_intrinsic_deref_atomic_comp_swap:
case nir_intrinsic_deref_atomic_fcomp_swap:
if (debug) dump_instr(instr);
nir_deref_instr *dst = nir_src_as_deref(intrin->src[0]);

View File

@@ -644,14 +644,13 @@ opt_simplify_bcsel_of_phi(nir_builder *b, nir_loop *loop)
bool match = true;
for (unsigned i = 0; i < 3; i++) {
/* FINISHME: The abs and negate cases could be handled by adding
* move instructions at the bottom of the continue block and more
* phi nodes in the header_block.
/* FINISHME: The abs, negate and swizzled cases could be handled by
* adding move instructions at the bottom of the continue block and
* more phi nodes in the header_block.
*/
if (!bcsel->src[i].src.is_ssa ||
if (!nir_alu_src_is_trivial_ssa(bcsel, i) ||
bcsel->src[i].src.ssa->parent_instr->type != nir_instr_type_phi ||
bcsel->src[i].src.ssa->parent_instr->block != header_block ||
bcsel->src[i].negate || bcsel->src[i].abs) {
bcsel->src[i].src.ssa->parent_instr->block != header_block) {
match = false;
break;
}

View File

@@ -86,6 +86,7 @@ opt_intrinsics_impl(nir_function_impl *impl,
nir_ssa_def_rewrite_uses(&alu->dest.dest.ssa,
nir_src_for_ssa(new_expr));
nir_instr_remove(&alu->instr);
progress = true;
continue;
}
}

View File

@@ -50,7 +50,9 @@ var_info_cmp(const void *_a, const void *_b)
uint32_t a_size = a->constant_data_size;
uint32_t b_size = b->constant_data_size;
if (a_size < b_size) {
if (a->is_constant != b->is_constant) {
return (int)a->is_constant - (int)b->is_constant;
} else if (a_size < b_size) {
return -1;
} else if (a_size > b_size) {
return 1;

View File

@@ -232,6 +232,14 @@ split_struct_derefs_impl(nir_function_impl *impl,
continue;
nir_variable *base_var = nir_deref_instr_get_variable(deref);
/* If we can't chase back to the variable, then we're a complex use.
* This should have been detected by get_complex_used_vars() and the
* variable should not have been split. However, we have no way of
* knowing that here, so we just have to trust it.
*/
if (base_var == NULL)
continue;
struct hash_entry *entry =
_mesa_hash_table_search(var_field_map, base_var);
if (!entry)

View File

@@ -685,7 +685,10 @@ dri2_lookup_egl_image(__DRIscreen *screen, void *image, void *data)
(void) screen;
mtx_lock(&disp->Mutex);
img = _eglLookupImage(image, disp);
mtx_unlock(&disp->Mutex);
if (img == NULL) {
_eglError(EGL_BAD_PARAMETER, "dri2_lookup_egl_image");
return NULL;

View File

@@ -266,7 +266,7 @@ static void print_reg_stats(struct disasm_ctx *ctx)
* assigned to shader:
*/
fullreg = (fullreg + 3) / 4;
halfreg = (halfreg + 3) / 4;
halfreg = ctx->regs.used.mergedregs ? 0 : (halfreg + 3) / 4;
// Note this count of instructions includes rptN, which matches
// up to how mesa prints this:

View File

@@ -986,7 +986,7 @@ void * ir3_assemble(struct ir3_shader_variant *v)
return ptr;
fail:
free(ptr);
ralloc_free(ptr);
return NULL;
}

View File

@@ -126,7 +126,7 @@ retrieve_variant(struct blob_reader *blob, struct ir3_shader_variant *v)
* pointers need special handling:
*/
v->bin = malloc(4 * v->info.sizedwords);
v->bin = rzalloc_size(v, 4 * v->info.sizedwords);
blob_copy_bytes(blob, v->bin, 4 * v->info.sizedwords);
if (!v->binning_pass) {

View File

@@ -350,9 +350,6 @@ int draw_tess_eval_shader_run(struct draw_tess_eval_shader *shader,
shader->input_vertex_stride = input_stride;
shader->input_info = input_info;
if (shader->draw->collect_statistics) {
shader->draw->statistics.ds_invocations += input_prim->primitive_count;
}
#ifdef LLVM_AVAILABLE
struct pipe_tessellation_factors factors;
struct pipe_tessellator_data data = { 0 };
@@ -394,6 +391,10 @@ int draw_tess_eval_shader_run(struct draw_tess_eval_shader *shader,
output += vert_start * vertex_size;
llvm_tes_run(shader, i, num_input_vertices_per_patch, &data, &factors, (struct vertex_header *)output);
if (shader->draw->collect_statistics) {
shader->draw->statistics.ds_invocations += data.num_domain_points;
}
uint32_t prim_len = u_prim_vertex_count(output_prims->prim)->min;
output_prims->primitive_count += data.num_indices / prim_len;
output_prims->primitive_lengths = REALLOC(output_prims->primitive_lengths, prim_start * sizeof(uint32_t),

View File

@@ -122,7 +122,7 @@ os_get_command_line(char *cmdline, size_t size)
}
#elif defined(PIPE_OS_LINUX)
int f = open("/proc/self/cmdline", O_RDONLY);
if (f) {
if (f != -1) {
const int n = read(f, cmdline, size - 1);
int i;
assert(n < size);

View File

@@ -22,6 +22,7 @@ DRI_CONF_SECTION_DEBUG
DRI_CONF_DISABLE_BLEND_FUNC_EXTENDED("false")
DRI_CONF_DISABLE_ARB_GPU_SHADER5("false")
DRI_CONF_FORCE_GLSL_VERSION(0)
DRI_CONF_ALLOW_EXTRA_PP_TOKENS("false")
DRI_CONF_ALLOW_GLSL_EXTENSION_DIRECTIVE_MIDSHADER("false")
DRI_CONF_ALLOW_GLSL_120_SUBSET_IN_110("false")
DRI_CONF_ALLOW_GLSL_BUILTIN_CONST_EXPRESSION("false")

View File

@@ -2721,7 +2721,7 @@ void util_blitter_custom_shader(struct blitter_context *blitter,
{
struct blitter_context_priv *ctx = (struct blitter_context_priv*)blitter;
struct pipe_context *pipe = ctx->base.pipe;
struct pipe_framebuffer_state fb_state;
struct pipe_framebuffer_state fb_state = { 0 };
ctx->custom_vs = custom_vs;
@@ -2747,7 +2747,6 @@ void util_blitter_custom_shader(struct blitter_context *blitter,
fb_state.height = dstsurf->height;
fb_state.nr_cbufs = 1;
fb_state.cbufs[0] = dstsurf;
fb_state.zsbuf = 0;
pipe->set_framebuffer_state(pipe, &fb_state);
pipe->set_sample_mask(pipe, ~0);

View File

@@ -54,14 +54,14 @@ vl_video_buffer_adjust_size(unsigned *width, unsigned *height, unsigned plane,
bool interlaced)
{
if (interlaced) {
*height /= 2;
*height = align(*height, 2) / 2;
}
if (plane > 0) {
if (chroma_format == PIPE_VIDEO_CHROMA_FORMAT_420) {
*width /= 2;
*height /= 2;
*width = align(*width, 2) / 2;
*height = align(*height, 2) / 2;
} else if (chroma_format == PIPE_VIDEO_CHROMA_FORMAT_422) {
*width /= 2;
*width = align(*width, 2) / 2;
}
}
}

View File

@@ -1117,8 +1117,6 @@ etna_compile_shader_nir(struct etna_shader_variant *v)
NIR_PASS_V(s, nir_lower_bool_to_int32);
}
etna_optimize_loop(s);
if (DBG_ENABLED(ETNA_DBG_DUMP_SHADERS))
nir_print_shader(s, stdout);

View File

@@ -521,11 +521,15 @@ lookup_gmem_state(struct fd_batch *batch, bool assume_zs, bool no_scis_opt)
struct fd_screen *screen = batch->ctx->screen;
struct fd_gmem_cache *cache = &screen->gmem_cache;
struct fd_gmem_stateobj *gmem = NULL;
/* Lock before allocating gmem_key, since that a screen-wide
* ralloc pool and ralloc itself is not thread-safe.
*/
fd_screen_lock(screen);
struct gmem_key *key = gmem_key_init(batch, assume_zs, no_scis_opt);
uint32_t hash = gmem_key_hash(key);
fd_screen_lock(screen);
struct hash_entry *entry =
_mesa_hash_table_search_pre_hashed(cache->ht, hash, key);
if (entry) {

View File

@@ -485,15 +485,28 @@ iris_blit(struct pipe_context *ctx, const struct pipe_blit_info *info)
else
main_mask = PIPE_MASK_RGBA;
float src_z_step = (float)info->src.box.depth / (float)info->dst.box.depth;
/* There is no interpolation to the pixel center during rendering, so
* add the 0.5 offset ourselves here.
*/
float depth_center_offset = 0;
if (src_res->surf.dim == ISL_SURF_DIM_3D)
depth_center_offset = 0.5 / info->dst.box.depth * info->src.box.depth;
if (info->mask & main_mask) {
for (int slice = 0; slice < info->dst.box.depth; slice++) {
unsigned dst_z = info->dst.box.z + slice;
float src_z = info->src.box.z + slice * src_z_step +
depth_center_offset;
iris_batch_maybe_flush(batch, 1500);
iris_batch_sync_region_start(batch);
blorp_blit(&blorp_batch,
&src_surf, info->src.level, info->src.box.z + slice,
&src_surf, info->src.level, src_z,
src_fmt.fmt, src_fmt.swizzle,
&dst_surf, info->dst.level, info->dst.box.z + slice,
&dst_surf, info->dst.level, dst_z,
dst_fmt.fmt, dst_fmt.swizzle,
src_x0, src_y0, src_x1, src_y1,
dst_x0, dst_y0, dst_x1, dst_y1,

View File

@@ -1940,7 +1940,8 @@ iris_bufmgr_get_for_fd(struct gen_device_info *devinfo, int fd, bool bo_reuse)
}
bufmgr = iris_bufmgr_create(devinfo, fd, bo_reuse);
list_addtail(&bufmgr->link, &global_bufmgr_list);
if (bufmgr)
list_addtail(&bufmgr->link, &global_bufmgr_list);
unlock:
mtx_unlock(&global_bufmgr_list_mutex);

View File

@@ -107,10 +107,6 @@ can_fast_clear_color(struct iris_context *ice,
return false;
}
/* XXX: if (irb->mt->supports_fast_clear)
* see intel_miptree_create_for_dri_image()
*/
if (!iris_is_color_fast_clear_compatible(ice, res->surf.format, color))
return false;

View File

@@ -185,6 +185,49 @@ iris_get_sample_position(struct pipe_context *ctx,
out_value[1] = u.a.y[sample_index];
}
static bool
create_dirty_dmabuf_set(struct iris_context *ice)
{
assert(ice->dirty_dmabufs == NULL);
ice->dirty_dmabufs = _mesa_pointer_set_create(ice);
return ice->dirty_dmabufs != NULL;
}
void
iris_mark_dirty_dmabuf(struct iris_context *ice,
struct pipe_resource *res)
{
if (!_mesa_set_search(ice->dirty_dmabufs, res)) {
_mesa_set_add(ice->dirty_dmabufs, res);
pipe_reference(NULL, &res->reference);
}
}
static void
clear_dirty_dmabuf_set(struct iris_context *ice)
{
set_foreach(ice->dirty_dmabufs, entry) {
struct pipe_resource *res = (struct pipe_resource *)entry->key;
if (pipe_reference(&res->reference, NULL))
res->screen->resource_destroy(res->screen, res);
}
_mesa_set_clear(ice->dirty_dmabufs, NULL);
}
void
iris_flush_dirty_dmabufs(struct iris_context *ice)
{
set_foreach(ice->dirty_dmabufs, entry) {
struct pipe_resource *res = (struct pipe_resource *)entry->key;
ice->ctx.flush_resource(&ice->ctx, res);
}
clear_dirty_dmabuf_set(ice);
}
/**
* Destroy a context, freeing any associated memory.
*/
@@ -197,6 +240,8 @@ iris_destroy_context(struct pipe_context *ctx)
if (ctx->stream_uploader)
u_upload_destroy(ctx->stream_uploader);
clear_dirty_dmabuf_set(ice);
screen->vtbl.destroy_state(ice);
iris_destroy_program_cache(ice);
iris_destroy_border_color_pool(ice);
@@ -261,6 +306,11 @@ iris_create_context(struct pipe_screen *pscreen, void *priv, unsigned flags)
}
ctx->const_uploader = ctx->stream_uploader;
if (!create_dirty_dmabuf_set(ice)) {
ralloc_free(ice);
return NULL;
}
ctx->destroy = iris_destroy_context;
ctx->set_debug_callback = iris_set_debug_callback;
ctx->set_device_reset_callback = iris_set_device_reset_callback;

View File

@@ -25,6 +25,7 @@
#include "pipe/p_context.h"
#include "pipe/p_state.h"
#include "util/set.h"
#include "util/slab.h"
#include "util/u_debug.h"
#include "intel/blorp/blorp.h"
@@ -536,6 +537,9 @@ struct iris_context {
/** A device reset status callback for notifying that the GPU is hosed. */
struct pipe_device_reset_callback reset;
/** A set of dmabuf resources dirtied beyond their default aux-states. */
struct set *dirty_dmabufs;
/** Slab allocator for iris_transfer_map objects. */
struct slab_child_pool transfer_pool;
@@ -772,6 +776,10 @@ iris_create_context(struct pipe_screen *screen, void *priv, unsigned flags);
void iris_lost_context_state(struct iris_batch *batch);
void iris_mark_dirty_dmabuf(struct iris_context *ice,
struct pipe_resource *res);
void iris_flush_dirty_dmabufs(struct iris_context *ice);
void iris_init_blit_functions(struct pipe_context *ctx);
void iris_init_clear_functions(struct pipe_context *ctx);
void iris_init_program_functions(struct pipe_context *ctx);

View File

@@ -241,6 +241,8 @@ iris_fence_flush(struct pipe_context *ctx,
}
}
iris_flush_dirty_dmabufs(ice);
if (!deferred) {
for (unsigned i = 0; i < IRIS_BATCH_COUNT; i++)
iris_batch_flush(&ice->batches[i]);

View File

@@ -808,6 +808,15 @@ iris_resource_set_aux_state(struct iris_context *ice,
ice->state.stage_dirty |= IRIS_ALL_STAGE_DIRTY_BINDINGS;
}
}
if (res->mod_info && !res->mod_info->supports_clear_color) {
assert(res->mod_info->aux_usage != ISL_AUX_USAGE_NONE);
if (aux_state == ISL_AUX_STATE_CLEAR ||
aux_state == ISL_AUX_STATE_COMPRESSED_CLEAR ||
aux_state == ISL_AUX_STATE_PARTIAL_CLEAR) {
iris_mark_dirty_dmabuf(ice, &res->base);
}
}
}
enum isl_aux_usage

View File

@@ -1286,10 +1286,6 @@ bool r600_common_screen_init(struct r600_common_screen *rscreen,
rscreen->family = rscreen->info.family;
rscreen->chip_class = rscreen->info.chip_class;
rscreen->debug_flags |= debug_get_flags_option("R600_DEBUG", common_debug_options, 0);
int has_draw_use_llvm = debug_get_bool_option("DRAW_USE_LLVM", FALSE);
if (!has_draw_use_llvm)
setenv("DRAW_USE_LLVM", "no", 0);
r600_disk_cache_create(rscreen);

View File

@@ -2062,7 +2062,7 @@ static void r600_draw_vbo(struct pipe_context *ctx, const struct pipe_draw_info
unsigned index_size = info->index_size;
int index_bias;
struct r600_shader_atomic combined_atomics[8];
uint8_t atomic_used_mask;
uint8_t atomic_used_mask = 0;
if (!info->indirect && !info->count && (index_size || !info->count_from_stream_output)) {
return;

View File

@@ -47,7 +47,17 @@ static void get_rate_control_param(struct rvce_encoder *enc, struct pipe_h264_en
enc->enc_pic.rc.frame_rate_num = pic->rate_ctrl.frame_rate_num;
enc->enc_pic.rc.frame_rate_den = pic->rate_ctrl.frame_rate_den;
enc->enc_pic.rc.max_qp = 51;
enc->enc_pic.rc.vbv_buffer_size = pic->rate_ctrl.vbv_buffer_size;
/* For CBR mode, to guarantee bitrate of generated stream complies with
* target bitrate (e.g. no over +/-10%), vbv_buffer_size should be same
* as target bitrate.
*/
if (enc->enc_pic.rc.rc_method == PIPE_H264_ENC_RATE_CONTROL_METHOD_CONSTANT) {
enc->enc_pic.rc.vbv_buffer_size = pic->rate_ctrl.target_bitrate;
} else {
enc->enc_pic.rc.vbv_buffer_size = pic->rate_ctrl.vbv_buffer_size;
}
enc->enc_pic.rc.vbv_buf_lv = pic->rate_ctrl.vbv_buf_lv;
enc->enc_pic.rc.fill_data_enable = pic->rate_ctrl.fill_data_enable;
enc->enc_pic.rc.enforce_hrd = pic->rate_ctrl.enforce_hrd;

View File

@@ -271,7 +271,9 @@ static void radeon_enc_begin_frame(struct pipe_video_codec *encoder,
if (u_reduce_video_profile(enc->base.profile) == PIPE_VIDEO_FORMAT_MPEG4_AVC) {
struct pipe_h264_enc_picture_desc *pic = (struct pipe_h264_enc_picture_desc *)picture;
need_rate_control =
enc->enc_pic.rc_layer_init.target_bit_rate != pic->rate_ctrl.target_bitrate;
(enc->enc_pic.rc_layer_init.target_bit_rate != pic->rate_ctrl.target_bitrate) ||
(enc->enc_pic.rc_layer_init.frame_rate_num != pic->rate_ctrl.frame_rate_num) ||
(enc->enc_pic.rc_layer_init.frame_rate_den != pic->rate_ctrl.frame_rate_den);
} else if (u_reduce_video_profile(picture->profile) == PIPE_VIDEO_FORMAT_HEVC) {
struct pipe_h265_enc_picture_desc *pic = (struct pipe_h265_enc_picture_desc *)picture;
need_rate_control = enc->enc_pic.rc_layer_init.target_bit_rate != pic->rc.target_bitrate;

View File

@@ -403,6 +403,10 @@ void si_begin_new_gfx_cs(struct si_context *ctx, bool first_cs)
ctx->flags |= SI_CONTEXT_INV_ICACHE | SI_CONTEXT_INV_SCACHE | SI_CONTEXT_INV_VCACHE |
SI_CONTEXT_INV_L2 | SI_CONTEXT_START_PIPELINE_STATS;
/* We don't know if the last draw call used GS fast launch, so assume it didn't. */
if (ctx->ngg_culling & SI_NGG_CULL_GS_FAST_LAUNCH_ALL)
ctx->flags |= SI_CONTEXT_VGT_FLUSH;
radeon_add_to_buffer_list(ctx, ctx->gfx_cs, ctx->border_color_buffer,
RADEON_USAGE_READ, RADEON_PRIO_BORDER_COLORS);
if (ctx->shadowed_regs) {

View File

@@ -288,6 +288,8 @@ static void scan_instruction(const struct nir_shader *nir, struct si_shader_info
case nir_intrinsic_bindless_image_atomic_xor:
case nir_intrinsic_bindless_image_atomic_exchange:
case nir_intrinsic_bindless_image_atomic_comp_swap:
case nir_intrinsic_bindless_image_atomic_inc_wrap:
case nir_intrinsic_bindless_image_atomic_dec_wrap:
info->uses_bindless_images = true;
info->writes_memory = true;
info->num_memory_instructions++; /* we only care about stores */

View File

@@ -1911,7 +1911,8 @@ static void si_draw_vbo(struct pipe_context *ctx, const struct pipe_draw_info *i
/* Insert a VGT_FLUSH when enabling fast launch changes to prevent hangs.
* See issues #2418, #2426, #2434
*/
if (ngg_culling & SI_NGG_CULL_GS_FAST_LAUNCH_ALL)
if (ngg_culling & SI_NGG_CULL_GS_FAST_LAUNCH_ALL &&
!(sctx->ngg_culling & SI_NGG_CULL_GS_FAST_LAUNCH_ALL))
sctx->flags |= SI_CONTEXT_VGT_FLUSH;
sctx->ngg_culling = ngg_culling;
sctx->do_update_shaders = true;

View File

@@ -2954,7 +2954,7 @@ bool si_update_ngg(struct si_context *sctx)
* VGT_FLUSH is also emitted at the beginning of IBs when legacy GS ring
* pointers are set.
*/
if (sctx->chip_class == GFX10 && !new_ngg)
if ((sctx->chip_class == GFX10 || sctx->family == CHIP_SIENNA_CICHLID) && !new_ngg)
sctx->flags |= SI_CONTEXT_VGT_FLUSH;
sctx->ngg = new_ngg;

View File

@@ -229,12 +229,12 @@ svga_buffer_create_host_surface(struct svga_screen *ss,
/* Add the new surface to the buffer surface list */
ret = svga_buffer_add_host_surface(sbuf, sbuf->handle, &sbuf->key,
bind_flags);
}
if (ss->sws->have_gb_objects) {
/* Initialize the surface with zero */
ss->sws->surface_init(ss->sws, sbuf->handle, svga_surface_size(&sbuf->key),
sbuf->key.flags);
if (ss->sws->have_gb_objects) {
/* Initialize the surface with zero */
ss->sws->surface_init(ss->sws, sbuf->handle, svga_surface_size(&sbuf->key),
sbuf->key.flags);
}
}
return ret;

View File

@@ -73,6 +73,8 @@ dri_fill_st_options(struct dri_screen *screen)
driQueryOptionb(optionCache, "force_glsl_extensions_warn");
options->force_glsl_version =
driQueryOptioni(optionCache, "force_glsl_version");
options->allow_extra_pp_tokens =
driQueryOptionb(optionCache, "allow_extra_pp_tokens");
options->allow_glsl_extension_directive_midshader =
driQueryOptionb(optionCache, "allow_glsl_extension_directive_midshader");
options->allow_glsl_120_subset_in_110 =

View File

@@ -99,7 +99,7 @@ vlVaQueryConfigEntrypoints(VADriverContextP ctx, VAProfile profile,
PIPE_VIDEO_CAP_SUPPORTED))
entrypoint_list[(*num_entrypoints)++] = VAEntrypointEncSlice;
if (num_entrypoints == 0)
if (*num_entrypoints == 0)
return VA_STATUS_ERROR_UNSUPPORTED_PROFILE;
assert(*num_entrypoints <= ctx->max_entrypoints);

View File

@@ -143,7 +143,7 @@ vlVdpVideoMixerCreate(VdpDevice device,
}
ret = VDP_STATUS_INVALID_VALUE;
if (vmixer->max_layers > 4) {
VDPAU_MSG(VDPAU_WARN, "[VDPAU] Max layers > 4 not supported\n", vmixer->max_layers);
VDPAU_MSG(VDPAU_WARN, "[VDPAU] Max layers %u > 4 not supported\n", vmixer->max_layers);
goto no_params;
}

View File

@@ -220,6 +220,7 @@ struct st_config_options
bool disable_arb_gpu_shader5;
bool force_glsl_extensions_warn;
unsigned force_glsl_version;
bool allow_extra_pp_tokens;
bool allow_glsl_extension_directive_midshader;
bool allow_glsl_120_subset_in_110;
bool allow_glsl_builtin_const_expression;

View File

@@ -44,15 +44,15 @@ vmw_svga_winsys_surface_init(struct svga_winsys_screen *sws,
struct pb_buffer *pb_buf;
uint32_t pb_flags;
struct vmw_winsys_screen *vws = vsrf->screen;
pb_flags = PIPE_TRANSFER_READ_WRITE | PIPE_TRANSFER_DISCARD_WHOLE_RESOURCE;
pb_flags = PIPE_TRANSFER_WRITE | PIPE_TRANSFER_DISCARD_WHOLE_RESOURCE;
struct pb_manager *provider;
struct pb_desc desc;
data = vmw_svga_winsys_buffer_map(&vws->base, vsrf->buf,
PIPE_TRANSFER_DONTBLOCK | pb_flags);
mtx_lock(&vsrf->mutex);
data = vmw_svga_winsys_buffer_map(&vws->base, vsrf->buf, pb_flags);
if (data)
goto out_unlock;
goto out_mapped;
provider = vws->pools.mob_fenced;
memset(&desc, 0, sizeof(desc));
@@ -64,24 +64,25 @@ vmw_svga_winsys_surface_init(struct svga_winsys_screen *sws,
data = vmw_svga_winsys_buffer_map(&vws->base, vbuf, pb_flags);
if (data) {
if (vsrf->buf) {
vsrf->rebind = TRUE;
if (vsrf->buf)
vmw_svga_winsys_buffer_destroy(&vws->base, vsrf->buf);
vsrf->buf = vbuf;
goto out_unlock;
} else
vmw_svga_winsys_buffer_destroy(&vws->base, vbuf);
vsrf->buf = vbuf;
goto out_mapped;
} else {
vmw_svga_winsys_buffer_destroy(&vws->base, vbuf);
goto out_unlock;
}
}
data = vmw_svga_winsys_buffer_map(&vws->base, vsrf->buf, pb_flags);
if (data == NULL)
else {
/* Cannot create a buffer, just unlock */
goto out_unlock;
}
out_unlock:
out_mapped:
mtx_unlock(&vsrf->mutex);
if (data)
{
if (data) {
if (flags & SVGA3D_SURFACE_BIND_STREAM_OUTPUT) {
memset(data, 0, surf_size + sizeof(SVGA3dDXSOState));
}
@@ -89,8 +90,10 @@ out_unlock:
memset(data, 0, surf_size);
}
}
mtx_lock(&vsrf->mutex);
vmw_svga_winsys_buffer_unmap(&vsrf->screen->base, vsrf->buf);
out_unlock:
mtx_unlock(&vsrf->mutex);
}

View File

@@ -4987,21 +4987,38 @@ lower_sampler_logical_send_gen7(const fs_builder &bld, fs_inst *inst, opcode op,
*/
ubld1.MOV(component(header, 3), sampler_handle);
} else if (is_high_sampler(devinfo, sampler)) {
fs_reg sampler_state_ptr =
retype(brw_vec1_grf(0, 3), BRW_REGISTER_TYPE_UD);
/* Gen11+ sampler message headers include bits in 4:0 which conflict
* with the ones included in g0.3 bits 4:0. Mask them out.
*/
if (devinfo->gen >= 11) {
sampler_state_ptr = ubld1.vgrf(BRW_REGISTER_TYPE_UD);
ubld1.AND(sampler_state_ptr,
retype(brw_vec1_grf(0, 3), BRW_REGISTER_TYPE_UD),
brw_imm_ud(INTEL_MASK(31, 5)));
}
if (sampler.file == BRW_IMMEDIATE_VALUE) {
assert(sampler.ud >= 16);
const int sampler_state_size = 16; /* 16 bytes */
ubld1.ADD(component(header, 3),
retype(brw_vec1_grf(0, 3), BRW_REGISTER_TYPE_UD),
ubld1.ADD(component(header, 3), sampler_state_ptr,
brw_imm_ud(16 * (sampler.ud / 16) * sampler_state_size));
} else {
fs_reg tmp = ubld1.vgrf(BRW_REGISTER_TYPE_UD);
ubld1.AND(tmp, sampler, brw_imm_ud(0x0f0));
ubld1.SHL(tmp, tmp, brw_imm_ud(4));
ubld1.ADD(component(header, 3),
retype(brw_vec1_grf(0, 3), BRW_REGISTER_TYPE_UD),
tmp);
ubld1.ADD(component(header, 3), sampler_state_ptr, tmp);
}
} else if (devinfo->gen >= 11) {
/* Gen11+ sampler message headers include bits in 4:0 which conflict
* with the ones included in g0.3 bits 4:0. Mask them out.
*/
ubld1.AND(component(header, 3),
retype(brw_vec1_grf(0, 3), BRW_REGISTER_TYPE_UD),
brw_imm_ud(INTEL_MASK(31, 5)));
}
}
@@ -7606,7 +7623,8 @@ fs_visitor::fixup_3src_null_dest()
static const fs_inst *
find_halt_control_flow_region_start(const fs_visitor *v)
{
if (brw_wm_prog_data(v->prog_data)->uses_kill) {
if (v->stage == MESA_SHADER_FRAGMENT &&
brw_wm_prog_data(v->prog_data)->uses_kill) {
foreach_block_and_inst(block, fs_inst, inst, v->cfg) {
if (inst->opcode == FS_OPCODE_DISCARD_JUMP ||
inst->opcode == FS_OPCODE_PLACEHOLDER_HALT)

View File

@@ -923,6 +923,31 @@ anv_get_image_format_properties(
}
}
if (info->flags & VK_IMAGE_CREATE_DISJOINT_BIT) {
/* From the Vulkan 1.2.149 spec, VkImageCreateInfo:
*
* If format is a multi-planar format, and if imageCreateFormatFeatures
* (as defined in Image Creation Limits) does not contain
* VK_FORMAT_FEATURE_DISJOINT_BIT, then flags must not contain
* VK_IMAGE_CREATE_DISJOINT_BIT.
*/
if (format->n_planes > 1 &&
!(format_feature_flags & VK_FORMAT_FEATURE_DISJOINT_BIT)) {
goto unsupported;
}
/* From the Vulkan 1.2.149 spec, VkImageCreateInfo:
*
* If format is not a multi-planar format, and flags does not include
* VK_IMAGE_CREATE_ALIAS_BIT, flags must not contain
* VK_IMAGE_CREATE_DISJOINT_BIT.
*/
if (format->n_planes == 1 &&
!(info->flags & VK_IMAGE_CREATE_ALIAS_BIT)) {
goto unsupported;
}
}
if (info->usage & VK_IMAGE_USAGE_TRANSIENT_ATTACHMENT_BIT) {
/* Nothing to check. */
}

View File

@@ -105,7 +105,6 @@ anv_gem_mmap_legacy(struct anv_device *device, uint32_t gem_handle,
if (ret != 0)
return MAP_FAILED;
VG(VALGRIND_MALLOCLIKE_BLOCK(gem_mmap.addr_ptr, gem_mmap.size, 0, 1));
return (void *)(uintptr_t) gem_mmap.addr_ptr;
}
@@ -116,10 +115,16 @@ void*
anv_gem_mmap(struct anv_device *device, uint32_t gem_handle,
uint64_t offset, uint64_t size, uint32_t flags)
{
void *map;
if (device->physical->has_mmap_offset)
return anv_gem_mmap_offset(device, gem_handle, offset, size, flags);
map = anv_gem_mmap_offset(device, gem_handle, offset, size, flags);
else
return anv_gem_mmap_legacy(device, gem_handle, offset, size, flags);
map = anv_gem_mmap_legacy(device, gem_handle, offset, size, flags);
if (map != MAP_FAILED)
VG(VALGRIND_MALLOCLIKE_BLOCK(map, size, 0, 1));
return map;
}
/* This is just a wrapper around munmap, but it also notifies valgrind that
@@ -128,8 +133,7 @@ anv_gem_mmap(struct anv_device *device, uint32_t gem_handle,
void
anv_gem_munmap(struct anv_device *device, void *p, uint64_t size)
{
if (!device->physical->has_mmap_offset)
VG(VALGRIND_FREELIKE_BLOCK(p, 0));
VG(VALGRIND_FREELIKE_BLOCK(p, 0));
munmap(p, size);
}

View File

@@ -540,14 +540,14 @@ make_surface(struct anv_device *device,
anv_get_format_plane(&device->info, image->vk_format, aspect, image->tiling);
struct anv_surface *anv_surf = &image->planes[plane].surface;
const isl_surf_usage_flags_t usage =
choose_isl_surf_usage(image->create_flags, image->usage,
isl_extra_usage_flags, aspect);
VkImageUsageFlags plane_vk_usage =
aspect == VK_IMAGE_ASPECT_STENCIL_BIT ?
image->stencil_usage : image->usage;
const isl_surf_usage_flags_t usage =
choose_isl_surf_usage(image->create_flags, plane_vk_usage,
isl_extra_usage_flags, aspect);
bool needs_shadow =
anv_image_plane_needs_shadow_surface(&device->info,
plane_format,

View File

@@ -1947,7 +1947,8 @@ brw_bufmgr_get_for_fd(struct gen_device_info *devinfo, int fd, bool bo_reuse)
}
bufmgr = brw_bufmgr_create(devinfo, fd, bo_reuse);
list_addtail(&bufmgr->link, &global_bufmgr_list);
if (bufmgr)
list_addtail(&bufmgr->link, &global_bufmgr_list);
unlock:
mtx_unlock(&global_bufmgr_list_mutex);

View File

@@ -84,6 +84,7 @@ DRI_CONF_BEGIN
DRI_CONF_FORCE_GLSL_VERSION(0)
DRI_CONF_DISABLE_GLSL_LINE_CONTINUATIONS("false")
DRI_CONF_DISABLE_BLEND_FUNC_EXTENDED("false")
DRI_CONF_ALLOW_EXTRA_PP_TOKENS("false")
DRI_CONF_DUAL_COLOR_BLEND_BY_LOCATION("false")
DRI_CONF_ALLOW_GLSL_EXTENSION_DIRECTIVE_MIDSHADER("false")
DRI_CONF_ALLOW_GLSL_BUILTIN_VARIABLE_REDECLARATION("false")

View File

@@ -30,6 +30,7 @@
#include "glformats.h"
#include "glheader.h"
#include "clear.h"
#include "context.h"
@@ -589,7 +590,20 @@ clear_bufferfv(struct gl_context *ctx, GLenum buffer, GLint drawbuffer,
* hook instead.
*/
const GLclampd clearSave = ctx->Depth.Clear;
ctx->Depth.Clear = *value;
/* Page 263 (page 279 of the PDF) of the OpenGL 3.0 spec says:
*
* "If buffer is DEPTH, drawbuffer must be zero, and value points
* to the single depth value to clear the depth buffer to.
* Clamping and type conversion for fixed-point depth buffers are
* performed in the same fashion as for ClearDepth."
*/
const struct gl_renderbuffer *rb =
ctx->DrawBuffer->Attachment[BUFFER_DEPTH].Renderbuffer;
const bool is_float_depth =
_mesa_has_depth_float_channel(rb->InternalFormat);
ctx->Depth.Clear = is_float_depth ? *value : SATURATE(*value);
ctx->Driver.Clear(ctx, BUFFER_BIT_DEPTH);
ctx->Depth.Clear = clearSave;
}
@@ -724,8 +738,20 @@ clear_bufferfi(struct gl_context *ctx, GLenum buffer, GLint drawbuffer,
const GLclampd clearDepthSave = ctx->Depth.Clear;
const GLuint clearStencilSave = ctx->Stencil.Clear;
/* set new clear values */
ctx->Depth.Clear = depth;
/* set new clear values
*
* Page 263 (page 279 of the PDF) of the OpenGL 3.0 spec says:
*
* "depth and stencil are the values to clear the depth and stencil
* buffers to, respectively. Clamping and type conversion for
* fixed-point depth buffers are performed in the same fashion as
* for ClearDepth."
*/
const struct gl_renderbuffer *rb =
ctx->DrawBuffer->Attachment[BUFFER_DEPTH].Renderbuffer;
const bool has_float_depth = rb &&
_mesa_has_depth_float_channel(rb->InternalFormat);
ctx->Depth.Clear = has_float_depth ? depth : SATURATE(depth);
ctx->Stencil.Clear = stencil;
/* clear buffers */

View File

@@ -1704,6 +1704,7 @@ get_value_size(enum value_type type, const union value *v)
case TYPE_MATRIX_T:
return sizeof (GLfloat) * 16;
default:
assert(!"invalid value_type given for get_value_size()");
return -1;
}
}
@@ -2349,9 +2350,6 @@ _mesa_GetUnsignedBytevEXT(GLenum pname, GLubyte *data)
d = find_value(func, pname, &p, &v);
size = get_value_size(d->type, &v);
if (size <= 0) {
_mesa_problem(ctx, "invalid value type in GetUnsignedBytevEXT()");
}
switch (d->type) {
case TYPE_BIT_0:
@@ -3262,9 +3260,6 @@ _mesa_GetUnsignedBytei_vEXT(GLenum target, GLuint index, GLubyte *data)
type = find_value_indexed(func, target, index, &v);
size = get_value_size(type, &v);
if (size <= 0) {
_mesa_problem(ctx, "invalid value type in GetUnsignedBytei_vEXT()");
}
switch (type) {
case TYPE_UINT:

View File

@@ -1335,6 +1335,15 @@ _mesa_is_depth_or_stencil_format(GLenum format)
}
}
/**
* Test if the given image format has a floating-point depth component.
*/
GLboolean
_mesa_has_depth_float_channel(GLenum internalFormat)
{
return internalFormat == GL_DEPTH32F_STENCIL8 ||
internalFormat == GL_DEPTH_COMPONENT32F;
}
/**
* Test if an image format is a supported compressed format.

View File

@@ -29,6 +29,7 @@
#include <stdbool.h>
#include <stdint.h>
#include <GL/gl.h>
@@ -104,6 +105,9 @@ _mesa_is_depthstencil_format(GLenum format);
extern GLboolean
_mesa_is_depth_or_stencil_format(GLenum format);
extern GLboolean
_mesa_has_depth_float_channel(GLenum internalFormat);
extern GLboolean
_mesa_is_compressed_format(const struct gl_context *ctx, GLenum format);

View File

@@ -295,6 +295,13 @@ _mesa_spirv_to_nir(struct gl_context *ctx,
}
assert(exec_list_length(&nir->functions) == 1);
/* Now that we've deleted all but the main function, we can go ahead and
* lower the rest of the constant initializers. We do this here so that
* nir_remove_dead_variables and split_per_member_structs below see the
* corresponding stores.
*/
NIR_PASS_V(nir, nir_lower_variable_initializers, ~0);
/* Split member structs. We do this before lower_io_to_temporaries so that
* it doesn't lower system values to temporaries by accident.
*/

View File

@@ -3875,6 +3875,14 @@ struct gl_constants
*/
GLboolean AllowLayoutQualifiersOnFunctionParameters;
/**
* Allow extra tokens at end of preprocessor directives. The CTS now tests
* to make sure these are not allowed. However, previously drivers would
* allow them to exist and just issue a warning so some old applications
* depend on this.
*/
GLboolean AllowExtraPPTokens;
/**
* Force computing the absolute value for sqrt() and inversesqrt() to follow
* D3D9 when apps rely on this behaviour.

View File

@@ -910,8 +910,7 @@ read_pixels_es3_error_check(struct gl_context *ctx, GLenum format, GLenum type,
const GLenum data_type = _mesa_get_format_datatype(rb->Format);
GLboolean is_unsigned_int = GL_FALSE;
GLboolean is_signed_int = GL_FALSE;
GLboolean is_float_depth = (internalFormat == GL_DEPTH_COMPONENT32F) ||
(internalFormat == GL_DEPTH32F_STENCIL8);
GLboolean is_float_depth = _mesa_has_depth_float_channel(internalFormat);
is_unsigned_int = _mesa_is_enum_format_unsigned_int(internalFormat);
if (!is_unsigned_int) {

View File

@@ -459,8 +459,7 @@ static const uint16_t vertex_formats[][4][4] = {
*/
static enum pipe_format
vertex_format_to_pipe_format(GLubyte size, GLenum16 type, GLenum16 format,
GLboolean normalized, GLboolean integer,
GLboolean doubles)
bool normalized, bool integer, bool doubles)
{
assert(size >= 1 && size <= 4);
assert(format == GL_RGBA || format == GL_BGRA);
@@ -674,8 +673,8 @@ validate_array_format(struct gl_context *ctx, const char *func,
struct gl_vertex_array_object *vao,
GLuint attrib, GLbitfield legalTypesMask,
GLint sizeMin, GLint sizeMax,
GLint size, GLenum type, GLboolean normalized,
GLboolean integer, GLboolean doubles,
GLint size, GLenum type, bool normalized,
bool integer, bool doubles,
GLuint relativeOffset, GLenum format)
{
GLbitfield typeBit;

View File

@@ -327,7 +327,9 @@ st_egl_image_target_texture_2d(struct gl_context *ctx, GLenum target,
&native_supported))
return;
st_bind_egl_image(ctx, texObj, texImage, &stimg, false, native_supported);
st_bind_egl_image(ctx, texObj, texImage, &stimg,
target != GL_TEXTURE_EXTERNAL_OES,
native_supported);
pipe_resource_reference(&stimg.texture, NULL);
}

View File

@@ -59,7 +59,8 @@ st_memoryobj_free(struct gl_context *ctx,
struct pipe_context *pipe = st->pipe;
struct pipe_screen *screen = pipe->screen;
screen->memobj_destroy(screen, st_obj->memory);
if (st_obj->memory)
screen->memobj_destroy(screen, st_obj->memory);
_mesa_delete_memory_object(ctx, obj);
}

View File

@@ -1124,6 +1124,8 @@ void st_init_extensions(struct pipe_screen *screen,
consts->ForceGLSLVersion = options->force_glsl_version;
}
consts->AllowExtraPPTokens = options->allow_extra_pp_tokens;
consts->AllowHigherCompatVersion = options->allow_higher_compat_version;
consts->ForceGLSLAbsSqrt = options->force_glsl_abs_sqrt;

View File

@@ -246,6 +246,10 @@ TODO: document the other workarounds.
<option name="allow_glsl_layout_qualifier_on_function_parameters" value="true" />
</application>
<application name="Champions of Regnum" executable="game">
<option name="allow_extra_pp_tokens" value="true" />
</application>
<application name="Wolfenstein The Old Blood" executable="WolfOldBlood_x64.exe">
<option name="force_compat_profile" value="true" />
</application>

View File

@@ -157,6 +157,11 @@ DRI_CONF_OPT_BEGIN_V(force_glsl_version, int, def, "0:999") \
DRI_CONF_DESC("Force a default GLSL version for shaders that lack an explicit #version line") \
DRI_CONF_OPT_END
#define DRI_CONF_ALLOW_EXTRA_PP_TOKENS(def) \
DRI_CONF_OPT_BEGIN_B(allow_extra_pp_tokens, def) \
DRI_CONF_DESC("Allow extra tokens at end of preprocessor directives.") \
DRI_CONF_OPT_END
#define DRI_CONF_ALLOW_GLSL_EXTENSION_DIRECTIVE_MIDSHADER(def) \
DRI_CONF_OPT_BEGIN_B(allow_glsl_extension_directive_midshader, def) \
DRI_CONF_DESC("Allow GLSL #extension directives in the middle of shaders") \

View File

@@ -203,13 +203,17 @@ _mesa_set_clear(struct set *set, void (*delete_function)(struct set_entry *entry
if (!set)
return;
set_foreach (set, entry) {
if (delete_function)
struct set_entry *entry;
for (entry = set->table; entry != set->table + set->size; entry++) {
if (entry_is_present(entry) && delete_function != NULL)
delete_function(entry);
entry->key = deleted_key;
entry->key = NULL;
}
set->entries = set->deleted_entries = 0;
set->entries = 0;
set->deleted_entries = 0;
}
/**