Compare commits

...

49 Commits

Author SHA1 Message Date
Dylan Baker
40e3de32e1 bump VERSION for 20.3.0-rc2 release 2020-11-19 10:13:15 -08:00
Matt Turner
0201fc95e7 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:11:06 -08:00
Dylan Baker
827c0cc14f .pick_status.json: Update to bac6cc586f 2020-11-19 10:11:01 -08:00
Chad Versace
654376faad 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-17 10:57:32 -08:00
Chad Versace
c9d10b391c 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-17 10:57:32 -08:00
Erik Faye-Lund
1534e28669 zink: more accurately track supported blits
We don't care if blits need to respect render-conditions if there's no
active one. So let's hit the potentially faster native blit-paths
instead.

Fixes: 5743fa6e70 ("zink: enable conditional rendering if available")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3792
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7606>
(cherry picked from commit 19906022e2)
2020-11-17 10:57:32 -08:00
Vinson Lee
f076b4d3ab turnip: Close sync_fd only if it is a valid file descriptor.
Fix defects reported by Coverity Scan.

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

Fixes: cec0bc73e5 ("turnip: rework fences to use syncobjs")
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7647>
(cherry picked from commit 69cad1f96e)
2020-11-17 10:57:32 -08:00
Vinson Lee
f6a73228a4 clover/spirv: Add missing break for SpvOpExecutionMode case.
Fix defect reported by Coverity Scan.

Missing break in switch (MISSING_BREAK)
unterminated_case: The case for value SpvOpExecutionMode is not
terminated by a 'break' statement.

Fixes: ee5b46fcfd ("clover/spirv: support CL_KERNEL_COMPILE_WORK_GROUP_SIZE")
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7519>
(cherry picked from commit 71ee4e2853)
2020-11-17 10:57:32 -08:00
Vinson Lee
5953d04aec 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-17 10:57:32 -08:00
Eric Anholt
94f202c6bc 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-17 10:57:32 -08:00
Lucas Stach
d7366262d2 etnaviv: fix disabling of INT filter for real
Missing a copy of the pipe_sampler_state into the etna_sampler_state object
lead to the texture_use_int_filter() to always see a max_anisotropy of 0, so
the INT filter wasn't disabled when necessary. Also state emission should
never change the state objects, as this might also lead to stale information
being kept around the in the state object.

Fixes: 89a41dae77 (etnaviv: do not use int filter when
                     anisotropic filtering is used)

Cc: <mesa-stable@lists.freedesktop.org>
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7638>
(cherry picked from commit b479a1f03c)
2020-11-17 10:57:32 -08:00
Erik Faye-Lund
ce29a107f4 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-17 10:57:32 -08:00
Rhys Perry
9d399939e0 aco: fix fp16 *0.5 omod
We were testing for -0.5 instead.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Fixes: 1210e0bd62 ("aco: create 16-bit input and output modifiers")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7605>
(cherry picked from commit 0c522d3aa7)
2020-11-17 10:57:32 -08:00
Rhys Perry
dc0580d344 aco: disable omod if the sign of zeros should be preserved
The RDNA ISA doc says that omod doesn't preserve -0.0 in 6.2.2. LLVM
appears to always disable omod in this situation, but clamp is unaffected.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Fixes: df645fa369 ("aco: implement VK_KHR_shader_float_controls")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7605>
(cherry picked from commit 558daa73f9)
2020-11-17 10:57:32 -08:00
Tapani Pälli
ded5cd528a iris: initialize shared screen->vtbl only once
Screen is shared among contexts, other context might be already using
vtbl while another initializes it again.

 ==45872== Possible data race during write of size 8 at 0x5DDAE78 by thread #549
 ==45872== Locks held: 1, at address 0x5D1B6F8
 ==45872==    at 0x6D66D91: gen9_init_state (iris_state.c:7816)
 ==45872==    by 0x6BA0A31: iris_create_context (iris_context.c:342)
 ==45872==    by 0x621F390: st_api_create_context (st_manager.c:917)
 ==45872==    by 0x620E6F9: dri_create_context (dri_context.c:163)
 ==45872==    by 0x6A40DB1: driCreateContextAttribs (dri_util.c:480)
 ==45872==    by 0x540B963: dri2_create_context (egl_dri2.c:1583)
 ==45872==    by 0x53FB84E: eglCreateContext (eglapi.c:821)
 ==45872==
 ==45872== This conflicts with a previous read of size 8 by thread #544
 ==45872== Locks held: 1, at address 0x5F6E0E0
 ==45872==    at 0x6CB779E: blorp_alloc_binding_table (iris_blorp.c:167)
 ==45872==    by 0x6CAEF70: blorp_emit_surface_states (blorp_genX_exec.h:1540)
 ==45872==    by 0x6CB67F9: blorp_exec (blorp_genX_exec.h:2016)
 ==45872==    by 0x6CB7AFE: iris_blorp_exec (iris_blorp.c:307)
 ==45872==    by 0x70F5916: try_blorp_blit (blorp_blit.c:2145)
 ==45872==    by 0x70F5FCA: do_blorp_blit (blorp_blit.c:2273)
 ==45872==    by 0x70F778F: blorp_copy (blorp_blit.c:2803)
 ==45872==    by 0x6BB9EB6: iris_copy_region (iris_blit.c:725)

v2: move as genX(init_screen_state) (Lionel)

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 460287adca)
2020-11-17 10:57:32 -08:00
Tapani Pälli
15367d2969 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-17 10:57:32 -08:00
Dave Airlie
ee3ed20f3d 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-17 10:57:32 -08:00
Christian Gmeiner
e5327be5ac 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-17 10:57:32 -08:00
Vinson Lee
b8ddfc0bb7 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-17 10:57:31 -08:00
Rob Clark
159ded9481 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-17 10:57:31 -08:00
Icecream95
4de41dea58 panfrost: Fix stack shift calculation
Fixes flickering in Neverwinter Nights.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3789
Fixes: e6152091ca ("panfrost: Use canonical characterization of tls_size")
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7613>
(cherry picked from commit 12dec2004e)
2020-11-17 10:57:31 -08:00
Nanley Chery
b37d613da5 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-17 10:57:31 -08:00
Nanley Chery
d47cb4124a 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-17 10:57:31 -08:00
Nanley Chery
5b83eb0b09 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-17 10:57:31 -08:00
Dylan Baker
14167715cc .pick_status.json: Update to 87dc3106b0 2020-11-17 10:55:38 -08:00
Rhys Perry
004b8b105f aco: disallow various v_add_u32 opts if modifiers are used
Check for clamp, SDWA or DPP. The optimization isn't possible with SDWA
and DPP, so it would have been skipped anyway. Doing any of these with a
clamp modifier present would be incorrect.

No fossil-db changes.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7045>
(cherry picked from commit 966732e8ca)
2020-11-13 10:06:58 -08:00
Rhys Perry
46ab4f9171 aco: fix combine_constant_comparison_ordering() NaN check with 16/64-bit
No fossil-db changes.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7045>
(cherry picked from commit 91ffeed88a)
2020-11-13 10:05:42 -08:00
Rhys Perry
afe279ad86 aco: don't combine precise max(min()) to med3
fossil-db (Navi):
Totals from 241 (0.18% of 137413) affected shaders:
CodeSize: 856280 -> 856308 (+0.00%); split: -0.00%, +0.00%
Instrs: 164220 -> 164514 (+0.18%); split: -0.00%, +0.18%
Cycles: 1031916 -> 1033092 (+0.11%); split: -0.00%, +0.11%
VMEM: 77855 -> 78514 (+0.85%); split: +0.85%, -0.01%
SMEM: 20501 -> 20593 (+0.45%); split: +0.46%, -0.01%
Copies: 9791 -> 9790 (-0.01%); split: -0.03%, +0.02%

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7045>
(cherry picked from commit d4c821da0e)
2020-11-13 10:05:41 -08:00
Vinson Lee
cdb5bcc059 turnip: Fix file descriptor return.
Fix defect reported by Coverity Scan.

Logically dead code (DEADCODE)
dead_error_line: Execution cannot reach the expression -1 inside this statement: return ret ? -1 : handle.fd;

Fixes: cec0bc73e5 ("turnip: rework fences to use syncobjs")
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Jonathan Marek <jonathan@marek.ca>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7498>
(cherry picked from commit dad6b62576)
2020-11-13 10:05:41 -08:00
Eric Anholt
0724abde7a gallium/draw: Fix rasterizer_discard for wide points/lines.
Fixes the rasterizer_discard failures for softpipe, because the wide paths
(which we hit for points in the CTS) were dropping the discard state when
making the no_cull shadow state.

Cc: mesa-stable
Reviewed-by: Brian Paul <brianp@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7558>
(cherry picked from commit 0b4825c872)
2020-11-13 10:05:40 -08:00
Brendan Dougherty
0e3bb4aa91 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-13 10:05:40 -08:00
Marcin Ślusarz
7762b3cda4 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-13 10:05:39 -08:00
Jason Ekstrand
fe8c524c82 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-13 10:05:39 -08:00
Eric Anholt
51d4d91f7d ci: Only install kernel modules for LAVA devices.
The recent change to install kernel modules for AMD included a sed job to
disable kernel modules in the defconfig.  This somehow broke booting on
a307, except the commit failed to bump the arm64_test tag so it wasn't
noticed until the next uprev. (I didn't notice when landing the next
change to that container to add the deqp runner, because I didn't get a
git conflict on rebasing my tag bump so I didn't bump the tag again to
pull in the kernel changes and catch the fail).

I've spent a while trying to debug what's happened (including what
*should* be a replication of the kernel build on my local db410c) and come
up empty.  Just punt and disable the AMD kernel module changes on
baremetal to fix it.  Bump every container using lava_build.sh to make
sure we don't screw anything up with the script changes.

Fixes: 60c5729d16 ("ci: Distribute ADMGPU driver to LAVA as a module")
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6971>
(cherry picked from commit bf576b449e)
2020-11-13 10:05:38 -08:00
Dave Airlie
a442fc2955 llvmpipe: just use draw_regions in draw/line setup.
This fixes:
dEQP-VK.draw.scissor*

Cc: 20.3 <mesa-stable>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7499>
(cherry picked from commit d186766c08)
2020-11-13 10:05:38 -08:00
Dave Airlie
bc3e92a1df lavapipe: disable SNORM blending for now
dEQP-VK.pipeline.blend.dual_source.format.r16g16b16a16_snorm.states.color_1msc_1ms1a_add_alpha_1mdc_1msa_sub-color_dc_1ms1c_rsub_alpha_z_1mdc_sub-color_ca_1ms1c_min_alpha_sas_ca_rsub-color_1ms1c_s1c_add_alpha_z_1mda_add,Fail
dEQP-VK.pipeline.blend.dual_source.format.r8g8_snorm.states.color_z_sc_add_alpha_1ms1c_sa_min-color_dc_1mca_add_alpha_z_1mca_max-color_1ms1c_sa_max_alpha_1mcc_sc_sub-color_s1c_1mda_add_alpha_s1c_1mda_add,Fail
dEQP-VK.pipeline.blend.dual_source.format.r8g8b8a8_snorm.states.color_1msc_1ms1a_add_alpha_1mdc_1msa_sub-color_dc_1ms1c_rsub_alpha_z_1mdc_sub-color_ca_1ms1c_min_alpha_sas_ca_rsub-color_1ms1c_s1c_add_alpha_z_1mda_add,Fail
dEQP-VK.pipeline.blend.dual_source.format.r8g8b8a8_snorm.states.color_z_sc_add_alpha_1ms1c_sa_min-color_dc_1mca_add_alpha_z_1mca_max-color_1ms1c_sa_max_alpha_1mcc_sc_sub-color_s1c_1mda_add_alpha_s1c_1mda_add,Fail
dEQP-VK.pipeline.blend.format.r16g16b16a16_snorm.states.color_ca_1mca_rsub_alpha_1mda_z_sub-color_sc_sc_add_alpha_1mca_sa_max-color_sa_1msa_min_alpha_1msc_sa_sub-color_dc_sc_add_alpha_1mdc_1mca_add,Fail
dEQP-VK.pipeline.blend.format.r8g8b8a8_snorm.states.color_ca_1mca_rsub_alpha_1mda_z_sub-color_sc_sc_add_alpha_1mca_sa_max-color_sa_1msa_min_alpha_1msc_sa_sub-color_dc_sc_add_alpha_1mdc_1mca_add,Fail

All fail due to the 1 - mdc or 1 - mca alpha channel in the last quadrant.

Cc: 20.3 <mesa-stable>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7499>
(cherry picked from commit 01c4bac36e)
2020-11-13 10:05:37 -08:00
Dave Airlie
0e4e0a0d09 lavapipe: enable alpha to one.
CTS seems fine with this.

Cc: 20.3 <mesa-stable>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7499>
(cherry picked from commit a04a146560)
2020-11-13 10:05:37 -08:00
Dave Airlie
3ee324d4ec u_blitter: port radv 3D blit coords logic.
The current code fails a lot of VK CTS tests, this fixes them all:
dEQP-VK*blit_image*3d*

Cc: 20.3 <mesa-stable>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7499>
(cherry picked from commit ea034c981b)
2020-11-13 10:05:36 -08:00
Dave Airlie
4de4f55228 gallium: handle empty cbuf slots in framebuffer samples helper
If we have cbufs but they are all empty, default
to returning the fb->samples.

Fixes:
dEQP-VK.pipeline.multisample.mixed_count.1_4_unused
on lavapipe

v2:
drop unneeded chunk (Roland)

Cc: 20.3 <mesa-stable>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7499>
(cherry picked from commit 4b1d23b243)
2020-11-13 10:05:35 -08:00
Eric Anholt
f4d976d591 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-13 10:05:35 -08:00
Rob Clark
966b55c6da 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-13 10:05:34 -08:00
Marek Olšák
60ffcfe6a9 st/mesa: fix use-after-free when updating shader info in st_link_nir
Fixes: 549ae5f8 "st/mesa: make sure prog->info is up to date for NIR (v2)"

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3756
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3685

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7516>
(cherry picked from commit 0d007349f9)
2020-11-13 10:05:34 -08:00
Erik Faye-Lund
46c08b73de softpipe: correct signature of get_compiler_options
This gets rid of a harmless but annoying compiler warning on MSVC.

Fixes: 73bafb5ee3 ("gallium: s/unsigned/enum pipe_shader_type/ for get_compiler_options()")
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7524>
(cherry picked from commit 7a1346b26a)
2020-11-13 10:05:33 -08:00
Boris Brezillon
23f4120491 panfrost: Fix ->reads_frag_coord assignment
Let's assign ->reads_frag_coord only once to handle the sysval case
(used on Bifrost) correctly.

Fixes: f1de952b69 ("panfrost: Use shader_info harder")
Cc: 20.3 <mesa-stable>
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7527>
(cherry picked from commit f23574af2c)
2020-11-13 10:05:33 -08:00
Boris Brezillon
f3ff1265ba panfrost: Fix Bifrost blend descriptor emission
Format conversion only works if the num_comps field is set to 4,
probably because the tile buffer always store those 4 components
internally.

Fixes: edd98aac3f ("panfrost: Add support for native wallpapering on Bifrost")
Fixes: 8389976b7c ("panfrost: XML-ify the blend descriptors")
Cc: 20.3 <mesa-stable>
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7527>
(cherry picked from commit 35ae9408f2)
2020-11-13 10:05:32 -08:00
Alyssa Rosenzweig
5c167e8d92 pan/bi: Model writemasks correctly
We don't handle partial write masks in the backend yet, so for now we
can't pretend we do, else we'll have RA bugs. Fixes

dEQP-GLES2.functional.fragment_ops.blend.rgb_func_alpha_func.src.constant_color_dst_alpha

Fixes: b2c6cf2b6d ("pan/bi: Eliminate writemasks in the IR")
Cc: 20.3 <mesa-stable>
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reported-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Tested-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7527>
(cherry picked from commit 7737ca7539)
2020-11-13 10:05:32 -08:00
Icecream95
2940fb13eb panfrost: Fix AFBC blits of resources with faked RGTC
Because u_transfer_helper changes resources back from the real format
to the emulated format after creation, we need to fix the format enum
for resources with fake compression when doing blits to/from AFBC.

Fixes: acb8dcfebd ("panfrost: Choose AFBC when available")
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7400>
(cherry picked from commit 44f2de5286)
2020-11-13 10:05:31 -08:00
Dylan Baker
5634699a2c .pick_status.json: Update to bf5cea7232 2020-11-13 10:05:29 -08:00
Dylan Baker
f44896c12a bump version for 20.3-rc1 2020-11-09 16:30:12 -08:00
60 changed files with 4475 additions and 242 deletions

View File

@@ -414,7 +414,7 @@ arm64_test:
extends:
- .use-arm_test-base
variables:
FDO_DISTRIBUTION_TAG: &arm64_test "2020-11-03-deqp-runner"
FDO_DISTRIBUTION_TAG: &arm64_test "2020-11-09-kmod"
.use-arm64_test:
variables:

View File

@@ -156,8 +156,10 @@ for i in /usr/bin/*-ld /usr/bin/ld; do
done
export PATH=`pwd`/ld-links:$PATH
# Disable all modules in defconfig, so we only build the ones we want
sed -i 's/=m/=n/g' ${DEFCONFIG}
if [ -n "$INSTALL_KERNEL_MODULES" ]; then
# Disable all modules in defconfig, so we only build the ones we want
sed -i 's/=m/=n/g' ${DEFCONFIG}
fi
./scripts/kconfig/merge_config.sh ${DEFCONFIG} ../.gitlab-ci/${KERNEL_ARCH}.config
make ${KERNEL_IMAGE_NAME}
@@ -170,8 +172,10 @@ if [[ -n ${DEVICE_TREES} ]]; then
cp ${DEVICE_TREES} /lava-files/.
fi
make modules
INSTALL_MOD_PATH=/lava-files/rootfs-${DEBIAN_ARCH}/ make modules_install
if [ -n "$INSTALL_KERNEL_MODULES" ]; then
make modules
INSTALL_MOD_PATH=/lava-files/rootfs-${DEBIAN_ARCH}/ make modules_install
fi
if [[ ${DEBIAN_ARCH} = "arm64" ]] && which mkimage > /dev/null; then
make Image.lzma

View File

@@ -13,79 +13,16 @@ dEQP-GLES2.functional.fbo.completeness.renderable.texture.color0.rg8,Fail
dEQP-GLES2.functional.fbo.completeness.renderable.texture.color0.rgb10_a2,Fail
dEQP-GLES2.functional.fbo.completeness.renderable.texture.color0.rgb_half_float_oes,Fail
dEQP-GLES2.functional.fbo.completeness.size.distinct,Fail
dEQP-GLES2.functional.fbo.render.color.blend_npot_rbo_rgb565,Fail
dEQP-GLES2.functional.fbo.render.color.blend_npot_rbo_rgb565_depth_component16,Fail
dEQP-GLES2.functional.fbo.render.color.blend_npot_tex2d_rgb,Fail
dEQP-GLES2.functional.fbo.render.color.blend_npot_tex2d_rgb_depth_component16,Fail
dEQP-GLES2.functional.fbo.render.color.blend_rbo_rgb565,Fail
dEQP-GLES2.functional.fbo.render.color.blend_rbo_rgb565_depth_component16,Fail
dEQP-GLES2.functional.fbo.render.color.blend_tex2d_rgb,Fail
dEQP-GLES2.functional.fbo.render.color.blend_tex2d_rgb_depth_component16,Fail
dEQP-GLES2.functional.fbo.render.shared_colorbuffer.rbo_rgb565,Fail
dEQP-GLES2.functional.fbo.render.shared_colorbuffer.rbo_rgb565_depth_component16,Fail
dEQP-GLES2.functional.fbo.render.shared_colorbuffer.rbo_rgb565_stencil_index8,Fail
dEQP-GLES2.functional.fbo.render.shared_colorbuffer.tex2d_rgb,Fail
dEQP-GLES2.functional.fbo.render.shared_colorbuffer.tex2d_rgb_depth_component16,Fail
dEQP-GLES2.functional.fbo.render.shared_colorbuffer.tex2d_rgb_stencil_index8,Fail
dEQP-GLES2.functional.fbo.render.texsubimage.between_render_tex2d_rgb,Fail
dEQP-GLES2.functional.fragment_ops.blend.rgb_func_alpha_func.src.constant_color_dst_alpha,Fail
dEQP-GLES2.functional.fragment_ops.blend.rgb_func_alpha_func.src.constant_color_dst_color,Fail
dEQP-GLES2.functional.fragment_ops.blend.rgb_func_alpha_func.src.constant_color_one_minus_dst_alpha,Fail
dEQP-GLES2.functional.fragment_ops.blend.rgb_func_alpha_func.src.constant_color_one_minus_dst_color,Fail
dEQP-GLES2.functional.fragment_ops.blend.rgb_func_alpha_func.src.one_minus_constant_color_dst_alpha,Fail
dEQP-GLES2.functional.fragment_ops.blend.rgb_func_alpha_func.src.one_minus_constant_color_dst_color,Fail
dEQP-GLES2.functional.fragment_ops.blend.rgb_func_alpha_func.src.one_minus_constant_color_one_minus_dst_alpha,Fail
dEQP-GLES2.functional.fragment_ops.blend.rgb_func_alpha_func.src.one_minus_constant_color_one_minus_dst_color,Fail
dEQP-GLES2.functional.fragment_ops.interaction.basic_shader.14,Fail
dEQP-GLES2.functional.fragment_ops.interaction.basic_shader.22,Fail
dEQP-GLES2.functional.fragment_ops.interaction.basic_shader.31,Fail
dEQP-GLES2.functional.fragment_ops.interaction.basic_shader.32,Fail
dEQP-GLES2.functional.fragment_ops.interaction.basic_shader.42,Fail
dEQP-GLES2.functional.fragment_ops.interaction.basic_shader.43,Fail
dEQP-GLES2.functional.fragment_ops.interaction.basic_shader.61,Fail
dEQP-GLES2.functional.fragment_ops.interaction.basic_shader.67,Fail
dEQP-GLES2.functional.fragment_ops.random.11,Fail
dEQP-GLES2.functional.fragment_ops.random.24,Fail
dEQP-GLES2.functional.fragment_ops.random.41,Fail
dEQP-GLES2.functional.fragment_ops.random.45,Fail
dEQP-GLES2.functional.fragment_ops.random.48,Fail
dEQP-GLES2.functional.fragment_ops.random.5,Fail
dEQP-GLES2.functional.fragment_ops.random.51,Fail
dEQP-GLES2.functional.fragment_ops.random.67,Fail
dEQP-GLES2.functional.fragment_ops.random.98,Fail
dEQP-GLES2.functional.negative_api.shader.uniform_matrixfv_invalid_transpose,Fail
dEQP-GLES2.functional.negative_api.texture.generatemipmap_zero_level_array_compressed,Fail
dEQP-GLES2.functional.shaders.builtin_variable.fragcoord_xyz,Fail
dEQP-GLES2.functional.shaders.random.all_features.fragment.88,Fail
dEQP-GLES2.functional.shaders.texture_functions.vertex.texturecubelod,Fail
dEQP-GLES2.functional.texture.mipmap.2d.generate.a8_fastest,Fail
dEQP-GLES2.functional.texture.mipmap.2d.generate.a8_nicest,Fail
dEQP-GLES2.functional.texture.mipmap.2d.generate.a8_non_square_fastest,Fail
dEQP-GLES2.functional.texture.mipmap.2d.generate.a8_non_square_nicest,Fail
dEQP-GLES2.functional.texture.mipmap.2d.generate.l8_fastest,Fail
dEQP-GLES2.functional.texture.mipmap.2d.generate.l8_nicest,Fail
dEQP-GLES2.functional.texture.mipmap.2d.generate.l8_non_square_fastest,Fail
dEQP-GLES2.functional.texture.mipmap.2d.generate.l8_non_square_nicest,Fail
dEQP-GLES2.functional.texture.mipmap.2d.generate.la88_fastest,Fail
dEQP-GLES2.functional.texture.mipmap.2d.generate.la88_nicest,Fail
dEQP-GLES2.functional.texture.mipmap.2d.generate.la88_non_square_fastest,Fail
dEQP-GLES2.functional.texture.mipmap.2d.generate.la88_non_square_nicest,Fail
dEQP-GLES2.functional.texture.mipmap.cube.basic.linear_linear,Fail
dEQP-GLES2.functional.texture.mipmap.cube.basic.linear_nearest,Fail
dEQP-GLES2.functional.texture.mipmap.cube.bias.linear_linear,Fail
dEQP-GLES2.functional.texture.mipmap.cube.bias.linear_nearest,Fail
dEQP-GLES2.functional.texture.mipmap.cube.generate.a8_fastest,Fail
dEQP-GLES2.functional.texture.mipmap.cube.generate.a8_nicest,Fail
dEQP-GLES2.functional.texture.mipmap.cube.generate.l8_fastest,Fail
dEQP-GLES2.functional.texture.mipmap.cube.generate.l8_nicest,Fail
dEQP-GLES2.functional.texture.mipmap.cube.generate.la88_fastest,Fail
dEQP-GLES2.functional.texture.mipmap.cube.generate.la88_nicest,Fail
dEQP-GLES2.functional.texture.mipmap.cube.projected.linear_linear,Fail
dEQP-GLES2.functional.texture.mipmap.cube.projected.linear_nearest,Fail
dEQP-GLES2.functional.texture.specification.basic_copyteximage2d.2d_alpha,Fail
dEQP-GLES2.functional.texture.specification.basic_copyteximage2d.cube_alpha,Fail
dEQP-GLES2.functional.texture.specification.basic_copytexsubimage2d.2d_alpha,Fail
dEQP-GLES2.functional.texture.specification.basic_copytexsubimage2d.cube_alpha,Fail
dEQP-GLES2.functional.texture.vertex.cube.filtering.linear_mipmap_linear_linear_clamp,Fail
dEQP-GLES2.functional.texture.vertex.cube.filtering.linear_mipmap_linear_linear_mirror,Fail
dEQP-GLES2.functional.texture.vertex.cube.filtering.linear_mipmap_linear_nearest_clamp,Fail

View File

@@ -93,12 +93,6 @@ dEQP-GLES3.functional.rasterization.interpolation.basic.lines_wide,Fail
dEQP-GLES3.functional.rasterization.interpolation.projected.line_loop_wide,Fail
dEQP-GLES3.functional.rasterization.interpolation.projected.line_strip_wide,Fail
dEQP-GLES3.functional.rasterization.interpolation.projected.lines_wide,Fail
dEQP-GLES3.functional.rasterizer_discard.basic.write_depth_points,Fail
dEQP-GLES3.functional.rasterizer_discard.basic.write_stencil_points,Fail
dEQP-GLES3.functional.rasterizer_discard.fbo.write_depth_points,Fail
dEQP-GLES3.functional.rasterizer_discard.fbo.write_stencil_points,Fail
dEQP-GLES3.functional.rasterizer_discard.scissor.write_depth_points,Fail
dEQP-GLES3.functional.rasterizer_discard.scissor.write_stencil_points,Fail
dEQP-GLES3.functional.shaders.derivate.dfdx.fastest.fbo_msaa4.float_highp,Fail
dEQP-GLES3.functional.shaders.derivate.dfdx.fastest.fbo_msaa4.float_mediump,Fail
dEQP-GLES3.functional.shaders.derivate.dfdx.fastest.fbo_msaa4.vec2_highp,Fail
@@ -848,7 +842,6 @@ KHR-GL33.transform_feedback.capture_geometry_interleaved_test,Fail
KHR-GL33.transform_feedback.capture_geometry_separate_test,Fail
KHR-GL33.transform_feedback.capture_vertex_interleaved_test,Fail
KHR-GL33.transform_feedback.capture_vertex_separate_test,Fail
KHR-GL33.transform_feedback.discard_geometry_test,Fail
KHR-GL33.transform_feedback.discard_vertex_test,Fail
KHR-GL33.transform_feedback.draw_xfb_instanced_test,Crash
KHR-GL33.transform_feedback.draw_xfb_stream_instanced_test,Crash

View File

@@ -1,5 +1,5 @@
variables:
DISTRIBUTION_TAG: "2020-11-05-deqp-runner"
DISTRIBUTION_TAG: "2020-11-09-kmod-fix"
.kernel+rootfs:
stage: container-2
@@ -9,6 +9,7 @@ variables:
GIT_STRATEGY: fetch
KERNEL_URL: "https://gitlab.freedesktop.org/tomeu/linux/-/archive/v5.10-rc2-for-mesa-ci/linux-v5.10-rc2-for-mesa-ci.tar.gz"
UPLOAD_FOR_LAVA: 1
INSTALL_KERNEL_MODULES: 1
script:
- .gitlab-ci/container/lava_build.sh

3998
.pick_status.json Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -1 +1 @@
20.3.0-devel
20.3.0-rc2

View File

@@ -1286,7 +1286,7 @@ void label_instruction(opt_ctx &ctx, Block& block, aco_ptr<Instruction>& instr)
ctx.info[instr->operands[i].tempId()].set_omod2(instr.get());
} else if (instr->operands[!i].constantValue() == (fp16 ? 0x4400 : 0x40800000)) { /* 4.0 */
ctx.info[instr->operands[i].tempId()].set_omod4(instr.get());
} else if (instr->operands[!i].constantValue() == (fp16 ? 0xb800 : 0x3f000000)) { /* 0.5 */
} else if (instr->operands[!i].constantValue() == (fp16 ? 0x3800 : 0x3f000000)) { /* 0.5 */
ctx.info[instr->operands[i].tempId()].set_omod5(instr.get());
} else if (instr->operands[!i].constantValue() == (fp16 ? 0x3c00 : 0x3f800000) &&
!(fp16 ? block.fp_mode.must_flush_denorms16_64 : block.fp_mode.must_flush_denorms32)) { /* 1.0 */
@@ -1786,6 +1786,31 @@ bool combine_comparison_ordering(opt_ctx &ctx, aco_ptr<Instruction>& instr)
return true;
}
bool is_operand_constant(opt_ctx &ctx, Operand op, unsigned bit_size, uint64_t *value)
{
if (op.isConstant()) {
*value = op.constantValue64();
return true;
} else if (op.isTemp()) {
unsigned id = original_temp_id(ctx, op.getTemp());
if (!ctx.info[id].is_constant_or_literal(bit_size))
return false;
*value = get_constant_op(ctx, ctx.info[id], bit_size).constantValue64();
return true;
}
return false;
}
bool is_constant_nan(uint64_t value, unsigned bit_size)
{
if (bit_size == 16)
return ((value >> 10) & 0x1f) == 0x1f && (value & 0x3ff);
else if (bit_size == 32)
return ((value >> 23) & 0xff) == 0xff && (value & 0x7fffff);
else
return ((value >> 52) & 0x7ff) == 0x7ff && (value & 0xfffffffffffff);
}
/* s_or_b64(v_cmp_neq_f32(a, a), cmp(a, #b)) and b is not NaN -> get_unordered(cmp)(a, b)
* s_and_b64(v_cmp_eq_f32(a, a), cmp(a, #b)) and b is not NaN -> get_ordered(cmp)(a, b) */
bool combine_constant_comparison_ordering(opt_ctx &ctx, aco_ptr<Instruction>& instr)
@@ -1811,7 +1836,8 @@ bool combine_constant_comparison_ordering(opt_ctx &ctx, aco_ptr<Instruction>& in
else if (get_f32_cmp(nan_test->opcode) != expected_nan_test)
return false;
if (!is_cmp(cmp->opcode) || get_cmp_bitsize(cmp->opcode) != get_cmp_bitsize(nan_test->opcode))
unsigned bit_size = get_cmp_bitsize(cmp->opcode);
if (!is_cmp(cmp->opcode) || get_cmp_bitsize(nan_test->opcode) != bit_size)
return false;
if (!nan_test->operands[0].isTemp() || !nan_test->operands[1].isTemp())
@@ -1840,22 +1866,10 @@ bool combine_constant_comparison_ordering(opt_ctx &ctx, aco_ptr<Instruction>& in
if (constant_operand == -1)
return false;
uint32_t constant;
if (cmp->operands[constant_operand].isConstant()) {
constant = cmp->operands[constant_operand].constantValue();
} else if (cmp->operands[constant_operand].isTemp()) {
Temp tmp = cmp->operands[constant_operand].getTemp();
unsigned id = original_temp_id(ctx, tmp);
if (!ctx.info[id].is_constant_or_literal(32))
return false;
constant = ctx.info[id].val;
} else {
uint64_t constant_value;
if (!is_operand_constant(ctx, cmp->operands[constant_operand], bit_size, &constant_value))
return false;
}
float constantf;
memcpy(&constantf, &constant, 4);
if (isnan(constantf))
if (is_constant_nan(constant_value, bit_size))
return false;
if (cmp->operands[0].isTemp())
@@ -1958,7 +1972,8 @@ bool match_op3_for_vop3(opt_ctx &ctx, aco_opcode op1, aco_opcode op2,
Instruction* op1_instr, bool swap, const char *shuffle_str,
Operand operands[3], bool neg[3], bool abs[3], uint8_t *opsel,
bool *op1_clamp, uint8_t *op1_omod,
bool *inbetween_neg, bool *inbetween_abs, bool *inbetween_opsel)
bool *inbetween_neg, bool *inbetween_abs, bool *inbetween_opsel,
bool *precise)
{
/* checks */
if (op1_instr->opcode != op1)
@@ -1999,6 +2014,9 @@ bool match_op3_for_vop3(opt_ctx &ctx, aco_opcode op1, aco_opcode op2,
else if (op1_vop3 && op1_vop3->opsel & (1 << swap))
return false;
*precise = op1_instr->definitions[0].isPrecise() ||
op2_instr->definitions[0].isPrecise();
int shuffle[3];
shuffle[shuffle_str[0] - '0'] = 0;
shuffle[shuffle_str[1] - '0'] = 1;
@@ -2051,12 +2069,12 @@ bool combine_three_valu_op(opt_ctx& ctx, aco_ptr<Instruction>& instr, aco_opcode
continue;
Operand operands[3];
bool neg[3], abs[3], clamp;
bool neg[3], abs[3], clamp, precise;
uint8_t opsel = 0, omod = 0;
if (match_op3_for_vop3(ctx, instr->opcode, op2,
instr.get(), swap, shuffle,
operands, neg, abs, &opsel,
&clamp, &omod, NULL, NULL, NULL)) {
&clamp, &omod, NULL, NULL, NULL, &precise)) {
ctx.uses[instr->operands[swap].tempId()]--;
create_vop3_for_op3(ctx, new_op, instr, operands, neg, abs, opsel, clamp, omod);
return true;
@@ -2074,13 +2092,13 @@ bool combine_minmax(opt_ctx& ctx, aco_ptr<Instruction>& instr, aco_opcode opposi
* max(-min(a, b), c) -> max3(-a, -b, c) */
for (unsigned swap = 0; swap < 2; swap++) {
Operand operands[3];
bool neg[3], abs[3], clamp;
bool neg[3], abs[3], clamp, precise;
uint8_t opsel = 0, omod = 0;
bool inbetween_neg;
if (match_op3_for_vop3(ctx, instr->opcode, opposite,
instr.get(), swap, "012",
operands, neg, abs, &opsel,
&clamp, &omod, &inbetween_neg, NULL, NULL) &&
&clamp, &omod, &inbetween_neg, NULL, NULL, &precise) &&
inbetween_neg) {
ctx.uses[instr->operands[swap].tempId()]--;
neg[1] = true;
@@ -2320,11 +2338,17 @@ bool combine_clamp(opt_ctx& ctx, aco_ptr<Instruction>& instr,
for (unsigned swap = 0; swap < 2; swap++) {
Operand operands[3];
bool neg[3], abs[3], clamp;
bool neg[3], abs[3], clamp, precise;
uint8_t opsel = 0, omod = 0;
if (match_op3_for_vop3(ctx, instr->opcode, other_op, instr.get(), swap,
"012", operands, neg, abs, &opsel,
&clamp, &omod, NULL, NULL, NULL)) {
&clamp, &omod, NULL, NULL, NULL, &precise)) {
/* max(min(src, upper), lower) returns upper if src is NaN, but
* med3(src, lower, upper) returns lower.
*/
if (precise && instr->opcode != min)
continue;
int const0_idx = -1, const1_idx = -1;
uint32_t const0 = 0, const1 = 0;
for (int i = 0; i < 3; i++) {
@@ -2524,9 +2548,14 @@ bool apply_omod_clamp(opt_ctx &ctx, Block& block, aco_ptr<Instruction>& instr)
if (!instr->isSDWA() && !can_vop3)
return false;
/* omod has no effect if denormals are enabled */
bool can_use_omod = (instr->definitions[0].bytes() == 4 ? block.fp_mode.denorm32 : block.fp_mode.denorm16_64) == 0;
can_use_omod = can_use_omod && (can_vop3 || ctx.program->chip_class >= GFX9); /* SDWA omod is GFX9+ */
/* omod flushes -0 to +0 and has no effect if denormals are enabled */
bool can_use_omod = (can_vop3 || ctx.program->chip_class >= GFX9); /* SDWA omod is GFX9+ */
if (instr->definitions[0].bytes() == 4)
can_use_omod = can_use_omod && block.fp_mode.denorm32 == 0 &&
!block.fp_mode.preserve_signed_zero_inf_nan32;
else
can_use_omod = can_use_omod && block.fp_mode.denorm16_64 == 0 &&
!block.fp_mode.preserve_signed_zero_inf_nan16_64;
ssa_info& def_info = ctx.info[instr->definitions[0].tempId()];
@@ -2824,7 +2853,7 @@ void combine_instruction(opt_ctx &ctx, Block& block, aco_ptr<Instruction>& instr
else combine_three_valu_op(ctx, instr, aco_opcode::s_xor_b32, aco_opcode::v_xor3_b32, "012", 1 | 2);
} else if (instr->opcode == aco_opcode::v_add_u32) {
if (combine_add_sub_b2i(ctx, instr, aco_opcode::v_addc_co_u32, 1 | 2)) ;
else if (ctx.program->chip_class >= GFX9) {
else if (ctx.program->chip_class >= GFX9 && !instr->usesModifiers()) {
if (combine_three_valu_op(ctx, instr, aco_opcode::s_xor_b32, aco_opcode::v_xad_u32, "120", 1 | 2)) ;
else if (combine_three_valu_op(ctx, instr, aco_opcode::v_xor_b32, aco_opcode::v_xad_u32, "120", 1 | 2)) ;
else if (combine_three_valu_op(ctx, instr, aco_opcode::s_add_i32, aco_opcode::v_add3_u32, "012", 1 | 2)) ;

View File

@@ -122,3 +122,132 @@ BEGIN_TEST(optimize.cndmask)
finish_opt_test();
}
END_TEST
BEGIN_TEST(optimize.clamp)
//>> v1: %a, v1: %b, v1: %c, s2: %_:exec = p_startpgm
if (!setup_cs("v1 v1 v1", GFX9))
return;
//! v1: %res0 = v_med3_f32 4.0, 0, %a
//! p_unit_test 0, %res0
writeout(0, bld.vop2(aco_opcode::v_min_f32, bld.def(v1), Operand(0x40800000u),
bld.vop2(aco_opcode::v_max_f32, bld.def(v1), Operand(0u), inputs[0])));
//! v1: %res1 = v_med3_f32 0, 4.0, %a
//! p_unit_test 1, %res1
writeout(1, bld.vop2(aco_opcode::v_max_f32, bld.def(v1), Operand(0u),
bld.vop2(aco_opcode::v_min_f32, bld.def(v1), Operand(0x40800000u), inputs[0])));
/* correct NaN behaviour with precise */
//! v1: %res2 = v_med3_f32 4.0, 0, %a
//! p_unit_test 2, %res2
Builder::Result max = bld.vop2(aco_opcode::v_max_f32, bld.def(v1), Operand(0u), inputs[0]);
max.def(0).setPrecise(true);
Builder::Result min = bld.vop2(aco_opcode::v_min_f32, bld.def(v1), Operand(0x40800000u), max);
max.def(0).setPrecise(true);
writeout(2, min);
//! v1: (precise)%res3_tmp = v_min_f32 4.0, %a
//! v1: %res3 = v_max_f32 0, %res3_tmp
//! p_unit_test 3, %res3
min = bld.vop2(aco_opcode::v_min_f32, bld.def(v1), Operand(0x40800000u), inputs[0]);
min.def(0).setPrecise(true);
writeout(3, bld.vop2(aco_opcode::v_max_f32, bld.def(v1), Operand(0u), min));
finish_opt_test();
END_TEST
BEGIN_TEST(optimize.const_comparison_ordering)
//>> v1: %a, v1: %b, v2: %c, v1: %d, s2: %_:exec = p_startpgm
if (!setup_cs("v1 v1 v2 v1", GFX9))
return;
/* optimize to unordered comparison */
//! s2: %res0 = v_cmp_nge_f32 4.0, %a
//! p_unit_test 0, %res0
writeout(0, bld.sop2(aco_opcode::s_or_b64, bld.def(bld.lm), bld.def(s1, scc),
bld.vopc(aco_opcode::v_cmp_neq_f32, bld.def(bld.lm), inputs[0], inputs[0]),
bld.vopc(aco_opcode::v_cmp_lt_f32, bld.def(bld.lm), Operand(0x40800000u), inputs[0])));
//! s2: %res1 = v_cmp_nge_f32 4.0, %a
//! p_unit_test 1, %res1
writeout(1, bld.sop2(aco_opcode::s_or_b64, bld.def(bld.lm), bld.def(s1, scc),
bld.vopc(aco_opcode::v_cmp_neq_f32, bld.def(bld.lm), inputs[0], inputs[0]),
bld.vopc(aco_opcode::v_cmp_nge_f32, bld.def(bld.lm), Operand(0x40800000u), inputs[0])));
//! s2: %res2 = v_cmp_nge_f32 0x40a00000, %a
//! p_unit_test 2, %res2
writeout(2, bld.sop2(aco_opcode::s_or_b64, bld.def(bld.lm), bld.def(s1, scc),
bld.vopc(aco_opcode::v_cmp_neq_f32, bld.def(bld.lm), inputs[0], inputs[0]),
bld.vopc(aco_opcode::v_cmp_lt_f32, bld.def(bld.lm), bld.copy(bld.def(v1), Operand(0x40a00000u)), inputs[0])));
/* optimize to ordered comparison */
//! s2: %res3 = v_cmp_lt_f32 4.0, %a
//! p_unit_test 3, %res3
writeout(3, bld.sop2(aco_opcode::s_and_b64, bld.def(bld.lm), bld.def(s1, scc),
bld.vopc(aco_opcode::v_cmp_eq_f32, bld.def(bld.lm), inputs[0], inputs[0]),
bld.vopc(aco_opcode::v_cmp_nge_f32, bld.def(bld.lm), Operand(0x40800000u), inputs[0])));
//! s2: %res4 = v_cmp_lt_f32 4.0, %a
//! p_unit_test 4, %res4
writeout(4, bld.sop2(aco_opcode::s_and_b64, bld.def(bld.lm), bld.def(s1, scc),
bld.vopc(aco_opcode::v_cmp_eq_f32, bld.def(bld.lm), inputs[0], inputs[0]),
bld.vopc(aco_opcode::v_cmp_lt_f32, bld.def(bld.lm), Operand(0x40800000u), inputs[0])));
//! s2: %res5 = v_cmp_lt_f32 0x40a00000, %a
//! p_unit_test 5, %res5
writeout(5, bld.sop2(aco_opcode::s_and_b64, bld.def(bld.lm), bld.def(s1, scc),
bld.vopc(aco_opcode::v_cmp_eq_f32, bld.def(bld.lm), inputs[0], inputs[0]),
bld.vopc(aco_opcode::v_cmp_nge_f32, bld.def(bld.lm), bld.copy(bld.def(v1), Operand(0x40a00000u)), inputs[0])));
/* NaN */
uint16_t nan16 = 0x7e00;
uint32_t nan32 = 0x7fc00000;
//! s2: %tmp6_0 = v_cmp_lt_f16 0x7e00, %a
//! s2: %tmp6_1 = v_cmp_neq_f16 %a, %a
//! s2: %res6, s1: %_:scc = s_or_b64 %tmp6_1, %tmp6_0
//! p_unit_test 6, %res6
writeout(6, bld.sop2(aco_opcode::s_or_b64, bld.def(bld.lm), bld.def(s1, scc),
bld.vopc(aco_opcode::v_cmp_neq_f16, bld.def(bld.lm), inputs[0], inputs[0]),
bld.vopc(aco_opcode::v_cmp_lt_f16, bld.def(bld.lm), Operand(nan16), inputs[0])));
//! s2: %tmp7_0 = v_cmp_lt_f32 0x7fc00000, %a
//! s2: %tmp7_1 = v_cmp_neq_f32 %a, %a
//! s2: %res7, s1: %_:scc = s_or_b64 %tmp7_1, %tmp7_0
//! p_unit_test 7, %res7
writeout(7, bld.sop2(aco_opcode::s_or_b64, bld.def(bld.lm), bld.def(s1, scc),
bld.vopc(aco_opcode::v_cmp_neq_f32, bld.def(bld.lm), inputs[0], inputs[0]),
bld.vopc(aco_opcode::v_cmp_lt_f32, bld.def(bld.lm), Operand(nan32), inputs[0])));
finish_opt_test();
END_TEST
BEGIN_TEST(optimize.add3)
//>> v1: %a, v1: %b, v1: %c, s2: %_:exec = p_startpgm
if (!setup_cs("v1 v1 v1", GFX9))
return;
//! v1: %res0 = v_add3_u32 %a, %b, %c
//! p_unit_test 0, %res0
Builder::Result tmp = bld.vop2(aco_opcode::v_add_u32, bld.def(v1), inputs[1], inputs[2]);
writeout(0, bld.vop2(aco_opcode::v_add_u32, bld.def(v1), inputs[0], tmp));
//! v1: %tmp1 = v_add_u32 %b, %c clamp
//! v1: %res1 = v_add_u32 %a, %tmp1
//! p_unit_test 1, %res1
tmp = bld.vop2_e64(aco_opcode::v_add_u32, bld.def(v1), inputs[1], inputs[2]);
static_cast<VOP3A_instruction *>(tmp.instr)->clamp = true;
writeout(1, bld.vop2(aco_opcode::v_add_u32, bld.def(v1), inputs[0], tmp));
//! v1: %tmp2 = v_add_u32 %b, %c
//! v1: %res2 = v_add_u32 %a, %tmp2 clamp
//! p_unit_test 2, %res2
tmp = bld.vop2(aco_opcode::v_add_u32, bld.def(v1), inputs[1], inputs[2]);
tmp = bld.vop2_e64(aco_opcode::v_add_u32, bld.def(v1), inputs[0], tmp);
static_cast<VOP3A_instruction *>(tmp.instr)->clamp = true;
writeout(2, tmp);
finish_opt_test();
END_TEST

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

@@ -83,6 +83,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

@@ -218,15 +218,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:
case nir_intrinsic_memcpy_deref: {
@@ -1118,15 +1122,19 @@ copy_prop_vars_block(struct copy_prop_var_state *state,
case nir_intrinsic_memcpy_deref:
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

@@ -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

@@ -997,7 +997,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

@@ -913,8 +913,6 @@ tu_syncobj_to_fd(struct tu_device *device, struct tu_syncobj *sync)
int ret;
ret = ioctl(device->fd, DRM_IOCTL_SYNCOBJ_HANDLE_TO_FD, &handle);
if (ret)
return 0;
return ret ? -1 : handle.fd;
}

View File

@@ -282,12 +282,12 @@ tu_RegisterDeviceEventEXT(VkDevice _device,
allocator,
NULL,
sync_fd);
close(sync_fd);
} else {
ret = VK_ERROR_OUT_OF_HOST_MEMORY;
}
close(sync_fd);
if (ret != VK_SUCCESS)
tu_DestroyFence(_device, *_fence, allocator);
@@ -319,12 +319,12 @@ tu_RegisterDisplayEventEXT(VkDevice _device,
allocator,
NULL,
sync_fd);
close(sync_fd);
} else {
ret = VK_ERROR_OUT_OF_HOST_MEMORY;
}
close(sync_fd);
if (ret != VK_SUCCESS)
tu_DestroyFence(_device, *_fence, allocator);

View File

@@ -200,7 +200,7 @@ void draw_new_instance(struct draw_context *draw)
void draw_destroy( struct draw_context *draw )
{
struct pipe_context *pipe;
unsigned i, j;
unsigned i, j, k;
if (!draw)
return;
@@ -211,8 +211,10 @@ void draw_destroy( struct draw_context *draw )
*/
for (i = 0; i < 2; i++) {
for (j = 0; j < 2; j++) {
if (draw->rasterizer_no_cull[i][j]) {
pipe->delete_rasterizer_state(pipe, draw->rasterizer_no_cull[i][j]);
for (k = 0; k < 2; k++) {
if (draw->rasterizer_no_cull[i][j][k]) {
pipe->delete_rasterizer_state(pipe, draw->rasterizer_no_cull[i][j][k]);
}
}
}
}
@@ -1056,26 +1058,26 @@ draw_current_shader_num_written_culldistances(const struct draw_context *draw)
*/
void *
draw_get_rasterizer_no_cull( struct draw_context *draw,
boolean scissor,
boolean flatshade )
const struct pipe_rasterizer_state *base_rast )
{
if (!draw->rasterizer_no_cull[scissor][flatshade]) {
if (!draw->rasterizer_no_cull[base_rast->scissor][base_rast->flatshade][base_rast->rasterizer_discard]) {
/* create now */
struct pipe_context *pipe = draw->pipe;
struct pipe_rasterizer_state rast;
memset(&rast, 0, sizeof(rast));
rast.scissor = scissor;
rast.flatshade = flatshade;
rast.scissor = base_rast->scissor;
rast.flatshade = base_rast->flatshade;
rast.rasterizer_discard = base_rast->rasterizer_discard;
rast.front_ccw = 1;
rast.half_pixel_center = draw->rasterizer->half_pixel_center;
rast.bottom_edge_rule = draw->rasterizer->bottom_edge_rule;
rast.clip_halfz = draw->rasterizer->clip_halfz;
draw->rasterizer_no_cull[scissor][flatshade] =
draw->rasterizer_no_cull[base_rast->scissor][base_rast->flatshade][base_rast->rasterizer_discard] =
pipe->create_rasterizer_state(pipe, &rast);
}
return draw->rasterizer_no_cull[scissor][flatshade];
return draw->rasterizer_no_cull[base_rast->scissor][base_rast->flatshade][base_rast->rasterizer_discard];
}
void

View File

@@ -529,7 +529,7 @@ aaline_first_line(struct draw_stage *stage, struct prim_header *header)
draw->suspend_flushing = TRUE;
/* Disable triangle culling, stippling, unfilled mode etc. */
r = draw_get_rasterizer_no_cull(draw, rast->scissor, rast->flatshade);
r = draw_get_rasterizer_no_cull(draw, rast);
pipe->bind_rasterizer_state(pipe, r);
draw->suspend_flushing = FALSE;

View File

@@ -597,7 +597,7 @@ aapoint_first_point(struct draw_stage *stage, struct prim_header *header)
draw->suspend_flushing = TRUE;
/* Disable triangle culling, stippling, unfilled mode etc. */
r = draw_get_rasterizer_no_cull(draw, rast->scissor, rast->flatshade);
r = draw_get_rasterizer_no_cull(draw, rast);
pipe->bind_rasterizer_state(pipe, r);
draw->suspend_flushing = FALSE;

View File

@@ -147,7 +147,7 @@ static void wideline_first_line( struct draw_stage *stage,
void *r;
/* Disable triangle culling, stippling, unfilled mode etc. */
r = draw_get_rasterizer_no_cull(draw, rast->scissor, rast->flatshade);
r = draw_get_rasterizer_no_cull(draw, rast);
draw->suspend_flushing = TRUE;
pipe->bind_rasterizer_state(pipe, r);
draw->suspend_flushing = FALSE;

View File

@@ -213,7 +213,7 @@ widepoint_first_point(struct draw_stage *stage,
}
/* Disable triangle culling, stippling, unfilled mode etc. */
r = draw_get_rasterizer_no_cull(draw, rast->scissor, rast->flatshade);
r = draw_get_rasterizer_no_cull(draw, rast);
draw->suspend_flushing = TRUE;
pipe->bind_rasterizer_state(pipe, r);
draw->suspend_flushing = FALSE;

View File

@@ -265,7 +265,7 @@ struct draw_context
void *rast_handle;
/** Rasterizer CSOs without culling/stipple/etc */
void *rasterizer_no_cull[2][2];
void *rasterizer_no_cull[2][2][2];
struct pipe_viewport_state viewports[PIPE_MAX_VIEWPORTS];
boolean identity_viewport;
@@ -536,8 +536,7 @@ void draw_do_flush( struct draw_context *draw, unsigned flags );
void *
draw_get_rasterizer_no_cull( struct draw_context *draw,
boolean scissor,
boolean flatshade );
const struct pipe_rasterizer_state *rast );
void
draw_stats_clipper_primitives(struct draw_context *draw,

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

@@ -1819,7 +1819,10 @@ static void do_blits(struct blitter_context_priv *ctx,
int dst_z;
for (dst_z = 0; dst_z < dstbox->depth; dst_z++) {
struct pipe_surface *old;
float dst2src_scale = srcbox->depth / (float)dstbox->depth;
bool flipped = (srcbox->depth < 0);
float depth_center_offset = 0.0;
int src_depth = abs(srcbox->depth);
float src_z_step = src_depth / (float)dstbox->depth;
/* Scale Z properly if the blit is scaled.
*
@@ -1835,12 +1838,17 @@ static void do_blits(struct blitter_context_priv *ctx,
* src Z: 0 1 2 3 4 5 6 7
* dst Z: 0 1 2 3
*
* dst_offset defines the offset needed for centering the pixels and
* it works with any scaling (not just 2x).
* This calculation is taken from the radv driver.
*/
float dst_offset = ((srcbox->depth - 1) -
(dstbox->depth - 1) * dst2src_scale) * 0.5;
float src_z = (dst_z + dst_offset) * dst2src_scale;
if (src_target == PIPE_TEXTURE_3D)
depth_center_offset = 0.5 / dstbox->depth * src_depth;
if (flipped) {
src_z_step *= - 1;
depth_center_offset *= -1;
}
float src_z = dst_z * src_z_step + depth_center_offset;
/* Set framebuffer state. */
if (is_zsbuf) {

View File

@@ -244,7 +244,7 @@ util_framebuffer_get_num_samples(const struct pipe_framebuffer_state *fb)
fb->zsbuf->nr_samples);
}
return 1;
return MAX2(fb->samples, 1);
}

View File

@@ -1118,8 +1118,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

@@ -83,6 +83,8 @@ etna_create_sampler_state_desc(struct pipe_context *pipe,
if (!cs)
return NULL;
cs->base = *ss;
cs->SAMP_CTRL0 =
VIVS_NTE_DESCRIPTOR_SAMP_CTRL0_UWRAP(translate_texture_wrapmode(ss->wrap_s)) |
VIVS_NTE_DESCRIPTOR_SAMP_CTRL0_VWRAP(translate_texture_wrapmode(ss->wrap_t)) |
@@ -290,16 +292,17 @@ etna_emit_texture_desc(struct etna_context *ctx)
if ((1 << x) & active_samplers) {
struct etna_sampler_state_desc *ss = etna_sampler_state_desc(ctx->sampler[x]);
struct etna_sampler_view_desc *sv = etna_sampler_view_desc(ctx->sampler_view[x]);
uint32_t SAMP_CTRL0 = ss->SAMP_CTRL0 | sv->SAMP_CTRL0;
if (texture_use_int_filter(&sv->base, &ss->base, true))
sv->SAMP_CTRL0 |= VIVS_NTE_DESCRIPTOR_SAMP_CTRL0_INT_FILTER;
SAMP_CTRL0 |= VIVS_NTE_DESCRIPTOR_SAMP_CTRL0_INT_FILTER;
etna_set_state(stream, VIVS_NTE_DESCRIPTOR_TX_CTRL(x),
COND(sv->ts.enable, VIVS_NTE_DESCRIPTOR_TX_CTRL_TS_ENABLE) |
VIVS_NTE_DESCRIPTOR_TX_CTRL_TS_MODE(sv->ts.mode) |
VIVS_NTE_DESCRIPTOR_TX_CTRL_TS_INDEX(x)|
COND(sv->ts.comp, VIVS_NTE_DESCRIPTOR_TX_CTRL_COMPRESSION));
etna_set_state(stream, VIVS_NTE_DESCRIPTOR_SAMP_CTRL0(x), ss->SAMP_CTRL0 | sv->SAMP_CTRL0);
etna_set_state(stream, VIVS_NTE_DESCRIPTOR_SAMP_CTRL0(x), SAMP_CTRL0);
etna_set_state(stream, VIVS_NTE_DESCRIPTOR_SAMP_CTRL1(x), ss->SAMP_CTRL1 | sv->SAMP_CTRL1);
etna_set_state(stream, VIVS_NTE_DESCRIPTOR_SAMP_LOD_MINMAX(x), ss->SAMP_LOD_MINMAX);
etna_set_state(stream, VIVS_NTE_DESCRIPTOR_SAMP_LOD_BIAS(x), ss->SAMP_LOD_BIAS);

View File

@@ -93,6 +93,8 @@ etna_create_sampler_state_state(struct pipe_context *pipe,
if (!cs)
return NULL;
cs->base = *ss;
cs->TE_SAMPLER_CONFIG0 =
VIVS_TE_SAMPLER_CONFIG0_UWRAP(translate_texture_wrapmode(ss->wrap_s)) |
VIVS_TE_SAMPLER_CONFIG0_VWRAP(translate_texture_wrapmode(ss->wrap_t)) |
@@ -348,11 +350,12 @@ etna_emit_texture_state(struct etna_context *ctx)
if ((1 << x) & active_samplers) {
ss = etna_sampler_state(ctx->sampler[x]);
sv = etna_sampler_view(ctx->sampler_view[x]);
uint32_t TE_SAMPLER_LOG_SIZE = sv->TE_SAMPLER_LOG_SIZE;
if (texture_use_int_filter(&sv->base, &ss->base, false))
sv->TE_SAMPLER_LOG_SIZE |= VIVS_TE_SAMPLER_LOG_SIZE_INT_FILTER;
TE_SAMPLER_LOG_SIZE |= VIVS_TE_SAMPLER_LOG_SIZE_INT_FILTER;
/*02080*/ EMIT_STATE(TE_SAMPLER_LOG_SIZE(x), sv->TE_SAMPLER_LOG_SIZE);
/*02080*/ EMIT_STATE(TE_SAMPLER_LOG_SIZE(x), TE_SAMPLER_LOG_SIZE);
}
}
}

View File

@@ -528,11 +528,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

@@ -29,6 +29,7 @@
/* iris_state.c */
void genX(init_state)(struct iris_context *ice);
void genX(init_screen_state)(struct iris_screen *screen);
void genX(emit_hashing_mode)(struct iris_context *ice,
struct iris_batch *batch,
unsigned width, unsigned height,

View File

@@ -58,6 +58,24 @@
#include "intel/common/gen_uuid.h"
#include "iris_monitor.h"
#define genX_call(devinfo, func, ...) \
switch (devinfo.gen) { \
case 12: \
gen12_##func(__VA_ARGS__); \
break; \
case 11: \
gen11_##func(__VA_ARGS__); \
break; \
case 9: \
gen9_##func(__VA_ARGS__); \
break; \
case 8: \
gen8_##func(__VA_ARGS__); \
break; \
default: \
unreachable("Unknown hardware generation"); \
}
static void
iris_flush_frontbuffer(struct pipe_screen *_screen,
struct pipe_resource *resource,
@@ -847,6 +865,8 @@ iris_screen_create(int fd, const struct pipe_screen_config *config)
pscreen->get_driver_query_group_info = iris_get_monitor_group_info;
pscreen->get_driver_query_info = iris_get_monitor_info;
genX_call(screen->devinfo, init_screen_state, screen);
glsl_type_singleton_init_or_ref();
return pscreen;

View File

@@ -7761,6 +7761,41 @@ iris_set_frontend_noop(struct pipe_context *ctx, bool enable)
}
}
void
genX(init_screen_state)(struct iris_screen *screen)
{
screen->vtbl.destroy_state = iris_destroy_state;
screen->vtbl.init_render_context = iris_init_render_context;
screen->vtbl.init_compute_context = iris_init_compute_context;
screen->vtbl.upload_render_state = iris_upload_render_state;
screen->vtbl.update_surface_base_address = iris_update_surface_base_address;
screen->vtbl.upload_compute_state = iris_upload_compute_state;
screen->vtbl.emit_raw_pipe_control = iris_emit_raw_pipe_control;
screen->vtbl.emit_mi_report_perf_count = iris_emit_mi_report_perf_count;
screen->vtbl.rebind_buffer = iris_rebind_buffer;
screen->vtbl.load_register_reg32 = iris_load_register_reg32;
screen->vtbl.load_register_reg64 = iris_load_register_reg64;
screen->vtbl.load_register_imm32 = iris_load_register_imm32;
screen->vtbl.load_register_imm64 = iris_load_register_imm64;
screen->vtbl.load_register_mem32 = iris_load_register_mem32;
screen->vtbl.load_register_mem64 = iris_load_register_mem64;
screen->vtbl.store_register_mem32 = iris_store_register_mem32;
screen->vtbl.store_register_mem64 = iris_store_register_mem64;
screen->vtbl.store_data_imm32 = iris_store_data_imm32;
screen->vtbl.store_data_imm64 = iris_store_data_imm64;
screen->vtbl.copy_mem_mem = iris_copy_mem_mem;
screen->vtbl.derived_program_state_size = iris_derived_program_state_size;
screen->vtbl.store_derived_program_state = iris_store_derived_program_state;
screen->vtbl.create_so_decl_list = iris_create_so_decl_list;
screen->vtbl.populate_vs_key = iris_populate_vs_key;
screen->vtbl.populate_tcs_key = iris_populate_tcs_key;
screen->vtbl.populate_tes_key = iris_populate_tes_key;
screen->vtbl.populate_gs_key = iris_populate_gs_key;
screen->vtbl.populate_fs_key = iris_populate_fs_key;
screen->vtbl.populate_cs_key = iris_populate_cs_key;
screen->vtbl.lost_genx_state = iris_lost_genx_state;
}
void
genX(init_state)(struct iris_context *ice)
{
@@ -7809,37 +7844,6 @@ genX(init_state)(struct iris_context *ice)
ctx->set_stream_output_targets = iris_set_stream_output_targets;
ctx->set_frontend_noop = iris_set_frontend_noop;
screen->vtbl.destroy_state = iris_destroy_state;
screen->vtbl.init_render_context = iris_init_render_context;
screen->vtbl.init_compute_context = iris_init_compute_context;
screen->vtbl.upload_render_state = iris_upload_render_state;
screen->vtbl.update_surface_base_address = iris_update_surface_base_address;
screen->vtbl.upload_compute_state = iris_upload_compute_state;
screen->vtbl.emit_raw_pipe_control = iris_emit_raw_pipe_control;
screen->vtbl.emit_mi_report_perf_count = iris_emit_mi_report_perf_count;
screen->vtbl.rebind_buffer = iris_rebind_buffer;
screen->vtbl.load_register_reg32 = iris_load_register_reg32;
screen->vtbl.load_register_reg64 = iris_load_register_reg64;
screen->vtbl.load_register_imm32 = iris_load_register_imm32;
screen->vtbl.load_register_imm64 = iris_load_register_imm64;
screen->vtbl.load_register_mem32 = iris_load_register_mem32;
screen->vtbl.load_register_mem64 = iris_load_register_mem64;
screen->vtbl.store_register_mem32 = iris_store_register_mem32;
screen->vtbl.store_register_mem64 = iris_store_register_mem64;
screen->vtbl.store_data_imm32 = iris_store_data_imm32;
screen->vtbl.store_data_imm64 = iris_store_data_imm64;
screen->vtbl.copy_mem_mem = iris_copy_mem_mem;
screen->vtbl.derived_program_state_size = iris_derived_program_state_size;
screen->vtbl.store_derived_program_state = iris_store_derived_program_state;
screen->vtbl.create_so_decl_list = iris_create_so_decl_list;
screen->vtbl.populate_vs_key = iris_populate_vs_key;
screen->vtbl.populate_tcs_key = iris_populate_tcs_key;
screen->vtbl.populate_tes_key = iris_populate_tes_key;
screen->vtbl.populate_gs_key = iris_populate_gs_key;
screen->vtbl.populate_fs_key = iris_populate_fs_key;
screen->vtbl.populate_cs_key = iris_populate_cs_key;
screen->vtbl.lost_genx_state = iris_lost_genx_state;
ice->state.dirty = ~0ull;
ice->state.stage_dirty = ~0ull;

View File

@@ -597,16 +597,9 @@ try_setup_line( struct lp_setup_context *setup,
* Determine how many scissor planes we need, that is drop scissor
* edges if the bounding box of the tri is fully inside that edge.
*/
if (setup->scissor_test) {
/* why not just use draw_regions */
scissor = &setup->scissors[viewport_index];
scissor_planes_needed(s_planes, &bboxpos, scissor);
nr_planes += s_planes[0] + s_planes[1] + s_planes[2] + s_planes[3];
} else {
scissor = &setup->draw_regions[viewport_index];
scissor_planes_needed(s_planes, &bboxpos, scissor);
nr_planes += s_planes[0] + s_planes[1] + s_planes[2] + s_planes[3];
}
scissor = &setup->draw_regions[viewport_index];
scissor_planes_needed(s_planes, &bboxpos, scissor);
nr_planes += s_planes[0] + s_planes[1] + s_planes[2] + s_planes[3];
line = lp_setup_alloc_triangle(scene,
key->num_inputs,

View File

@@ -359,16 +359,9 @@ do_triangle_ccw(struct lp_setup_context *setup,
* Determine how many scissor planes we need, that is drop scissor
* edges if the bounding box of the tri is fully inside that edge.
*/
if (setup->scissor_test) {
/* why not just use draw_regions */
scissor = &setup->scissors[viewport_index];
scissor_planes_needed(s_planes, &bboxpos, scissor);
nr_planes += s_planes[0] + s_planes[1] + s_planes[2] + s_planes[3];
} else {
scissor = &setup->draw_regions[viewport_index];
scissor_planes_needed(s_planes, &bboxpos, scissor);
nr_planes += s_planes[0] + s_planes[1] + s_planes[2] + s_planes[3];
}
scissor = &setup->draw_regions[viewport_index];
scissor_planes_needed(s_planes, &bboxpos, scissor);
nr_planes += s_planes[0] + s_planes[1] + s_planes[2] + s_planes[3];
tri = lp_setup_alloc_triangle(scene,
key->num_inputs,

View File

@@ -284,9 +284,6 @@ panfrost_shader_compile(struct panfrost_context *ctx,
bool vertex_id = s->info.system_values_read & (1 << SYSTEM_VALUE_VERTEX_ID);
bool instance_id = s->info.system_values_read & (1 << SYSTEM_VALUE_INSTANCE_ID);
/* On Bifrost it's a sysval, on Midgard it's a varying */
state->reads_frag_coord = s->info.system_values_read & (1 << SYSTEM_VALUE_FRAG_COORD);
state->writes_global = s->info.writes_memory;
switch (stage) {
@@ -342,7 +339,8 @@ panfrost_shader_compile(struct panfrost_context *ctx,
state->helper_invocations = s->info.fs.needs_helper_invocations;
state->stack_size = program->tls_size;
state->reads_frag_coord = s->info.inputs_read & (1 << VARYING_SLOT_POS);
state->reads_frag_coord = (s->info.inputs_read & (1 << VARYING_SLOT_POS)) ||
(s->info.system_values_read & (1 << SYSTEM_VALUE_FRAG_COORD));
state->reads_point_coord = s->info.inputs_read & (1 << VARYING_SLOT_PNTC);
state->reads_face = (s->info.inputs_read & (1 << VARYING_SLOT_FACE)) ||
(s->info.system_values_read & (1 << SYSTEM_VALUE_FRONT_FACE));

View File

@@ -296,7 +296,10 @@ panfrost_emit_bifrost_blend(struct panfrost_batch *batch,
else
cfg.bifrost.internal.mode = MALI_BIFROST_BLEND_MODE_FIXED_FUNCTION;
cfg.bifrost.internal.fixed_function.num_comps = format_desc->nr_channels;
/* If we want the conversion to work properly,
* num_comps must be set to 4
*/
cfg.bifrost.internal.fixed_function.num_comps = 4;
cfg.bifrost.internal.fixed_function.conversion.memory_format.format =
panfrost_format_to_bifrost_blend(format_desc, true);
if (dev->quirks & HAS_SWIZZLES) {

View File

@@ -728,6 +728,20 @@ pan_alloc_staging(struct panfrost_context *ctx, struct panfrost_resource *rsc,
return pan_resource(pstaging);
}
static enum pipe_format
pan_blit_format(enum pipe_format fmt)
{
const struct util_format_description *desc;
desc = util_format_description(fmt);
/* This must be an emulated format (using u_transfer_helper) as if it
* was real RGTC we wouldn't have used AFBC and needed a blit. */
if (desc->layout == UTIL_FORMAT_LAYOUT_RGTC)
fmt = PIPE_FORMAT_R8G8B8A8_UNORM;
return fmt;
}
static void
pan_blit_from_staging(struct pipe_context *pctx, struct panfrost_transfer *trans)
{
@@ -735,14 +749,14 @@ pan_blit_from_staging(struct pipe_context *pctx, struct panfrost_transfer *trans
struct pipe_blit_info blit = {0};
blit.dst.resource = dst;
blit.dst.format = dst->format;
blit.dst.format = pan_blit_format(dst->format);
blit.dst.level = trans->base.level;
blit.dst.box = trans->base.box;
blit.src.resource = trans->staging.rsrc;
blit.src.format = trans->staging.rsrc->format;
blit.src.format = pan_blit_format(trans->staging.rsrc->format);
blit.src.level = 0;
blit.src.box = trans->staging.box;
blit.mask = util_format_get_mask(trans->staging.rsrc->format);
blit.mask = util_format_get_mask(blit.src.format);
blit.filter = PIPE_TEX_FILTER_NEAREST;
panfrost_blit(pctx, &blit);
@@ -755,14 +769,14 @@ pan_blit_to_staging(struct pipe_context *pctx, struct panfrost_transfer *trans)
struct pipe_blit_info blit = {0};
blit.src.resource = src;
blit.src.format = src->format;
blit.src.format = pan_blit_format(src->format);
blit.src.level = trans->base.level;
blit.src.box = trans->base.box;
blit.dst.resource = trans->staging.rsrc;
blit.dst.format = trans->staging.rsrc->format;
blit.dst.format = pan_blit_format(trans->staging.rsrc->format);
blit.dst.level = 0;
blit.dst.box = trans->staging.box;
blit.mask = util_format_get_mask(trans->staging.rsrc->format);
blit.mask = util_format_get_mask(blit.dst.format);
blit.filter = PIPE_TEX_FILTER_NEAREST;
panfrost_blit(pctx, &blit);

View File

@@ -89,7 +89,8 @@ static const nir_shader_compiler_options sp_compiler_options = {
static const void *
softpipe_get_compiler_options(struct pipe_screen *pscreen,
enum pipe_shader_ir ir, unsigned shader)
enum pipe_shader_ir ir,
enum pipe_shader_type shader)
{
assert(ir == PIPE_SHADER_IR_NIR);
return &sp_compiler_options;

View File

@@ -14,8 +14,11 @@ blit_resolve(struct zink_context *ctx, const struct pipe_blit_info *info)
util_format_get_mask(info->src.format) != info->mask ||
util_format_is_depth_or_stencil(info->dst.format) ||
info->scissor_enable ||
info->alpha_blend ||
info->render_condition_enable)
info->alpha_blend)
return false;
if (info->render_condition_enable &&
ctx->render_condition_active)
return false;
struct zink_resource *src = zink_resource(info->src.resource);
@@ -67,8 +70,11 @@ blit_native(struct zink_context *ctx, const struct pipe_blit_info *info)
if (util_format_get_mask(info->dst.format) != info->mask ||
util_format_get_mask(info->src.format) != info->mask ||
info->scissor_enable ||
info->alpha_blend ||
info->render_condition_enable)
info->alpha_blend)
return false;
if (info->render_condition_enable &&
ctx->render_condition_active)
return false;
if (util_format_is_depth_or_stencil(info->dst.format) &&

View File

@@ -130,7 +130,7 @@ struct zink_context {
struct list_head suspended_queries;
struct list_head primitives_generated_queries;
bool queries_disabled;
bool queries_disabled, render_condition_active;
struct pipe_resource *dummy_buffer;
struct pipe_resource *null_buffers[5]; /* used to create zink_framebuffer->null_surface, one buffer per samplecount */

View File

@@ -492,6 +492,7 @@ zink_render_condition(struct pipe_context *pctx,
if (query == NULL) {
screen->vk_CmdEndConditionalRenderingEXT(batch->cmdbuf);
ctx->render_condition_active = false;
return;
}
@@ -528,6 +529,7 @@ zink_render_condition(struct pipe_context *pctx,
begin_info.buffer = res->buffer;
begin_info.flags = begin_flags;
screen->vk_CmdBeginConditionalRenderingEXT(batch->cmdbuf, &begin_info);
ctx->render_condition_active = true;
zink_batch_reference_resource_rw(batch, res, true);

View File

@@ -199,6 +199,7 @@ namespace {
default:
break;
}
break;
case SpvOpDecorate: {
const auto id = get<SpvId>(inst, 1);

View File

@@ -312,7 +312,7 @@ void lvp_GetPhysicalDeviceFeatures(
.depthBounds = (pdevice->pscreen->get_param(pdevice->pscreen, PIPE_CAP_DEPTH_BOUNDS_TEST) != 0),
.wideLines = false,
.largePoints = true,
.alphaToOne = false,
.alphaToOne = true,
.multiViewport = true,
.samplerAnisotropy = false, /* FINISHME */
.textureCompressionETC2 = false,

View File

@@ -208,7 +208,9 @@ lvp_physical_device_get_format_properties(struct lvp_physical_device *physical_d
if (physical_device->pscreen->is_format_supported(physical_device->pscreen, pformat,
PIPE_TEXTURE_2D, 0, 0, PIPE_BIND_RENDER_TARGET)) {
features |= VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT;
features |= VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BLEND_BIT;
/* SNORM blending on llvmpipe fails CTS - disable for now */
if (!util_format_is_snorm(pformat))
features |= VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BLEND_BIT;
features |= VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT;
}

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

@@ -7800,7 +7800,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

@@ -563,14 +563,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

@@ -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

@@ -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

@@ -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

@@ -834,6 +834,8 @@ st_link_nir(struct gl_context *ctx,
*/
shader_info old_info = prog->info;
prog->info = prog->nir->info;
prog->info.name = old_info.name;
prog->info.label = old_info.label;
prog->info.num_ssbos = old_info.num_ssbos;
prog->info.num_ubos = old_info.num_ubos;
prog->info.num_abos = old_info.num_abos;

View File

@@ -168,6 +168,10 @@ bi_writes_component(bi_instruction *ins, unsigned comp)
return comp < bi_get_component_count(ins, -1);
}
/* Determine effective writemask for RA/DCE, noting that we currently act
* per-register hence aligning. TODO: when real write masks are handled in
* packing (not for a while), update this routine, removing the align */
unsigned
bi_writemask(bi_instruction *ins)
{
@@ -175,7 +179,7 @@ bi_writemask(bi_instruction *ins)
unsigned size = nir_alu_type_get_type_size(T);
unsigned bytes_per_comp = size / 8;
unsigned components = bi_get_component_count(ins, -1);
unsigned bytes = bytes_per_comp * components;
unsigned bytes = ALIGN_POT(bytes_per_comp * components, 4);
unsigned mask = (1 << bytes) - 1;
unsigned shift = ins->dest_offset * 4; /* 32-bit words */
return (mask << shift);

View File

@@ -569,7 +569,7 @@ bifrost_load_emit_blend_rt(struct pan_pool *pool, void *out,
cfg.bifrost.equation.alpha.b = MALI_BLEND_OPERAND_B_SRC;
cfg.bifrost.equation.alpha.c = MALI_BLEND_OPERAND_C_ZERO;
cfg.bifrost.equation.color_mask = 0xf;
cfg.bifrost.internal.fixed_function.num_comps = format_desc->nr_channels;
cfg.bifrost.internal.fixed_function.num_comps = 4;
cfg.bifrost.internal.fixed_function.conversion.memory_format.format =
panfrost_format_to_bifrost_blend(format_desc, true);
cfg.bifrost.internal.fixed_function.conversion.register_format =

View File

@@ -67,7 +67,7 @@ unsigned
panfrost_get_stack_shift(unsigned stack_size)
{
if (stack_size)
return util_logbase2(DIV_ROUND_UP(stack_size, 16));
return util_logbase2_ceil(DIV_ROUND_UP(stack_size, 16));
else
return 0;
}

View File

@@ -223,13 +223,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;
}
/**