Now that this function does not block RegisterFile entries anymore,
the temporary copy is only needed upon reaching the collect_vars call.
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8261>
need to check both arrays here since we only want to use an injected shader
if we don't have a real one, not just if the real one isn't being updated
Fixes: 334759d850 ("zink: implement passthrough tcs shader injection")
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8271>
Clear is done with one instanced draw call, where the layer
to clear is controlled by gl_Layer.
Same as how util_blitter_clear does this.
Fixes test:
gl-3.2-layered-rendering-clear-color-all-types 2d_multisample_array single_level
Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7919>
Passes amd_vertex_shader_layer-layered-2d-texture-render
Don't enable GL_AMD_vertex_shader_layer because we do not pass
amd_vertex_shader_layer-layered-depth-texture-render due to
the assert:
emit_blit: Assertion `psurf->u.tex.first_layer == psurf->u.tex.last_layer'
However, in current state it is still useful for clearing
of arrayed framebuffers.
Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7919>
Fix defect reported by Coverity Scan.
Uninitialized scalar field (UNINIT_CTOR)
uninit_member: Non-static class member mapped is not initialized in this
constructor nor in any functions that it calls.
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8193>
If the shader does not specify "core" or "compatibility" in shaders
above 1.40 we were defaulting these shaders to core shaders when
in a compat profile. Instead default to compat shaders.
This brings us inline with the behaviour of the binary drivers and
fixes a crash on start-up for the game Foundation.
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3594
Fixes: c7e3d31b0b ("glsl: fix compat shaders in GLSL 1.40")
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Zoltán Böszörményi <zboszor@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6993>
We have been advertising 3.1, which waffle has issues creating contexts
for, causing coverage (and performance!) issues in piglit. We should
support all the necessary features already.
Some new failures are caught by the 3.2 CTS, but they look like they're
existing issues simply not covered by the minimal GL 3.0 CTS.
Fixes: #3037
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8255>
With dual source blending only 1 draw buffer could be used.
For zink fixes tests:
arb_blend_func_extended-fbo-extended-blend-pattern_gles2
Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8247>
ACO attempts to store the output of an instruction in the same register
occupied by its operands where possible. Importantly this only works if
the operands are large enough to store the result register size. The code
failed to consider subdword operands when checking for this, causing
entire register slots to be freed up even though subdword parts were still
used.
In Mafia 3, this affected the following code:
v2b: %363:v[2][0:16], v2b: %362:v[2][16:32] = p_split_vector %360:v[2]
v1: %116:v[2] = v_cvt_f32_f16 %362:v[2][16:32]
v1: %117:v[2] = v_cvt_f32_f16 %363:v[2][0:16]
where v[2] is allocated to %116 even though its original lower 16 bits are
still used in the instruction after.
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3717
Fixes: 031edbc4a5
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7461>
The write() to the communication pipe shared with check_output.py would block
for large test output streams since the pipe's consumer wouldn't be launched
until the write already completed.
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7461>
This new policy parameter allows disabling the optimistic path of get_reg
(i.e. get_reg_simple) to improve test coverage of the pessimistic path
provided by get_reg_impl.
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7461>
the previous commit handling this forced geometry shader usage for all cases,
but this is not ideal, so instead there are now fragment shader variants for
both depth==1 and depth!=1, corresponding to the existence of gl_Layer in the
shader
Fixes: 614c77772a ("st/pbo: fix pbo uploads without PIPE_CAP_TGSI_VS_LAYER_VIEWPORT")
Acked-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8089>
On some devices, window resizing results in flashes of blue- and
orange-tinted versions of the current frame until resizing is
finished.
This fix ensures that the emubgra tweak used for GLES virgl hosts
has its enabled state flag set properly during resize events.
v2: removed unrelated whitespace change
Fixes: 6f68cacf61 ("virgl: Always enable emulated BGRA and swizzling unless specifically told not to")
Signed-off-by: Ryan Neph <ryanneph@google.com>
Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8119>
Rewrites the original lowering pass to use the one shared with Clover,
instead only handling the new load_printf_buffer_address intrinsic.
Exports the new metadata to the runtime containing strings and arg sizes.
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8254>
This connects printf up for NIR drivers, it lowers using the NIR
pass where it places the idx to the strings into the output buffer.
It also sets the global buffer header to the nir paths.
v2: remove dead function temps after lowering
v3: move to single string
Acked-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8254>
As part of this series, it removes the need for float->double conversion,
just to be able to print a single float.
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8254>
This pass creates a SSBO var for the printf buffer. It does an atomic increment
at the beginning of the buffer to determine where to write, then dumps
the args after that.
v2: [airlied]
Enhanced to use an index into a set of format info that is passed
back to the caller. The format info contains the number of args,
argument sizes and the format string.
v3: move format string lowering to vtn
v4: Jason reworked it.
v5: assume buffer has initial offset prebaked in and work from there.
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8254>
[airlied: rebase fixup types]
v2: add support for storing strings in a sideband storage,
just store the index in print buffer.
v3: move the format strings into the nir shader as well
v4: simplify the write constant string + explicit sizes
move printf cap definition.
v5: just parse the format string to find string specifiers
using util code.
add vtn_fail_if if we can't get the correct type.
v6: use ralloc + avoid instr handler for srcs > 5
v7: use a packed struct 4 bytes align all of it
v8: simplify constant copy
v9: rework to use a single string and common string
extract code, (Jason)
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8254>
This just adds the basic nir support for printf,
intrinsic, and support for storing the printf info.
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8254>
"The implementation is based on what LLVM AMD target expect.
The compiler provided an id link to argument desc and format used.
The runtime need to store them to be able to parse the buffer filled by
the device during the kernel execution, ie, an id value to find the
format and followed by the arguments values"
v2: airlied
Split out the core code to a separate patch, add support for the
different global buffer formats, and move the LLVM specific code
as much as possible to the backend.
v3: handle strings differences better
llvm backend stores strings to the printf buffer
nir backend stores them to a sideband storage in NIR and stores
an index in the buffer.
v4: move specifier parsing to util code.
v5: rename buffer fmt + make printf code work
v6: handle args/specifier number mismatch support
v7: move to single string + struct
v8: use "%s" to print strings to avoid bad specifier, fix str
calcs.
v9: move to the same global buffer format as llvm, just strings
are different now. This requires changes to nir lowering.
buffer format:
[0] contains offset into buffer at start contains 8
[1] contains length of buffer
v10: printf const clean, add warning, endian assert, print %%
at end, fix specifiers to vector
v11: minor cleanups, make sure the format string never contains
an n.
v12: validate format string
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8254>
This adds storage for printf formats encoded as number of
argument sizes + the printf format string, and storage
for sideband printf strings if the backend wants them.
It adds a flag that decides if the backend wants AMD (LLVM)
behaviour or NIR wrt the format of the global buffer and
how to decode strings.
Based on work by EdB in his printf support, but made useful
to be generic.
I'm not a huge fan of the buffer format flag, but this was
the easiest way to denote the llvm abi buffer format.
v3: rename buffer fmt
v4: use a single strings storage and one struct
v5: move printf_info into module, cleanup serialisation struct
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8254>
clover needs to walk valid specifiers in C++, vtn needs
to find string specifiers in C, let's do both.
This writes the format walker in C++, and wraps it with C.
Acked-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8254>
Set zs_update_operation to FORCE_LATE, as we don't want to update
depth if the fragment is discarded.
Set pixel_kill_operation to WEAK_EARLY to match the blob.
Reviewed-and-tested-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8235>
gl_SecondaryFragColorEXT is mapped to FRAG_RESULT_COLOR and just
have a different io.dual_source_blend_index. We don't need to replicate
the color to other render targets in case of dual source blending, so
we could just remap it to FRAG_RESULT_DATA0 + index.
Fixes piglit test:
arb_blend_func_extended-fbo-extended-blend-pattern_gles2
Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8245>
When set, we want to summary-limit 0, but the meaning was inverted. Sigh,
coding in bash.
Fixes: bf29daa1b5 ("ci/deqp: Switch to a new dEQP runner written in Rust.")
Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8164>
Porting of commits 25c9946883 and f9084b6c3f to Android makefile
Fixes the following building error:
In file included from external/mesa/src/panfrost/bifrost/bifrost_compile.c:36:
external/mesa/src/panfrost/bifrost/compiler.h:31:10: fatal error: 'bi_opcodes.h' file not found
^~~~~~~~~~~~~~
1 error generated.
Fixes: 25c9946883 ("pan/bi: Generate bi_opcodes.c")
Fixes: f9084b6c3f ("pan/bi: Generate bi_opcodes.h")
Signed-off-by: Mauro Rossi <issor.oruam@gmail.com>
Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8239>
virgl_object_assign_handle will be called by multiple threads,
if you do not use atomic operations, there may be duplicate handle.
Signed-off-by: cheyang <cheyang@bytedance.com>
Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8078>
The cf list will always be non-empty, with at least a block in it.
Noticed while checking codegen of a piglit test that was really slow on
softpipe.
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8068>
It's been regressed a couple of times recently, so let's try to make sure
it doesn't happen again. The setup here is mostly like llvmpipe-quick-gl,
but using quick_gl+quick_shader together, and a few more spectacularly
long-running tests dropped. I also excluded a bunch of unsupported
extensions, to minimize the size of the skip list checked into the tree
(it's still 200k, though).
The unfortunate exclusions in here are fp64 and int64 -- most of the
piglit tests for them don't run because softpipe is still GL3.3, and it's
an egregious number of skips to add to the checked in list.
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8068>
This bumps the compat profile supported from 3.1 to 3.3, matching our GL
core profile. Motivated by getting the piglit skip list cut down.
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8068>
index is of type uint32_t.
Fix defect reported by Coverity Scan.
Macro compares unsigned to 0 (NO_EFFECT)
unsigned_compare: This greater-than-or-equal-to-zero comparison of
an unsigned value is always true. index >= 0U.
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8231>
Fix defect reported by Coverity Scan.
Uninitialized scalar field (UNINIT_CTOR)
uninit_member: Non-static class member m_SupportsSimultaneousAccess is
not initialized in this constructor nor in any functions that it calls.
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8192>
Fix defect reported by Coverity Scan.
Resource leak (RESOURCE_LEAK)
leaked_storage: Variable ss going out of scope leaks the storage it points to.
Fixes: 2ea15cd661 ("d3d12: introduce d3d12 gallium driver")
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8179>
Fix defect reported by Coverity Scan.
Uninitialized pointer field (UNINIT_CTOR)
uninit_member: Non-static class member dup is not initialized in
this constructor nor in any functions that it calls.
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8168>