Commit Graph

155013 Commits

Author SHA1 Message Date
Mike Blumenkrantz de63ccfc1e zink: remove buffer valid range tracking from blit
I copy/pasted too hard. this code could never be reached

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16877>
2022-06-06 00:36:20 +00:00
Mike Blumenkrantz 79685199f4 zink: invalidate blit dsts if fully covered
tiling perf++ since there's no need to load

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16877>
2022-06-06 00:36:20 +00:00
Mike Blumenkrantz de1e67b39d zink: hook up surface invalidation to LOAD_OP_DONT_CARE
this should improve perf for tilers

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16877>
2022-06-06 00:36:20 +00:00
Mike Blumenkrantz c7ad86b40f zink: split out a dynamic render ternary
this is going to get bigger

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16877>
2022-06-06 00:36:20 +00:00
Mike Blumenkrantz e6ec9ca0ab zink: rename renderpass attrib value
this never really meant "swapchain", it just meant that load isn't needed

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16877>
2022-06-06 00:36:20 +00:00
Mike Blumenkrantz 5897ade22d zink: flag renderpass for change if image resource changes valid state
the next renderpass instance will need to use different load ops,
so flag it here to ensure that gets picked up

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16877>
2022-06-06 00:36:20 +00:00
Mike Blumenkrantz 3e2c65281d zink: track invalidation for image resources
an image only has valid data if:
* it's imported
* it's written to
* it's mapped for write

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16877>
2022-06-06 00:36:20 +00:00
Mike Blumenkrantz 8575080990 zink: disable EXT_primitives_generated_query on turnip
this is broken

Acked-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16861>
2022-06-06 00:21:02 +00:00
Mike Blumenkrantz 9683de9bc4 zink: remove ANV depth clip control workaround
this was fixed a while ago and I forgot

Acked-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16861>
2022-06-06 00:21:02 +00:00
Mike Blumenkrantz 06859ba69c mesa: handle atomic counter lowering for drivers with big ssbo offset aligns
according to the spec, atomic counters can be bound at any offset divisible by 4,
which means that any driver that uses the ssbo lowering pass and doesn't have
a min offset align of 4 is potentially broken

to handle this, use a statevar to inject the misaligned remainder of the offset
into the shader as a uniform. for well-aligned counter binds, the uniform offset
will be 0

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16749>
2022-06-05 23:16:36 +00:00
Mike Blumenkrantz 5b5eb77a87 st/glsl_to_nir: call st_set_prog_affected_state_flags() as late as possible
this function should be called late to allow for other passes potentially
making changes which affect the states in use by shaders

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16749>
2022-06-05 23:16:36 +00:00
Mike Blumenkrantz 93d9f086a3 mesa: conditionally set constants dirty for atomic counter binds
this is necessary for updating the offset uniforms

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16749>
2022-06-05 23:16:36 +00:00
Mike Blumenkrantz b3fbd498e0 mesa: add statevar for atomic counter offsets
some hardware can't do a ssbo offset=4, as required by the atomic->ssbo
lowering pass, so for these cases an offset can be passed for the counter
as a uniform, and the shaders can be adjusted accordingly

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16749>
2022-06-05 23:16:36 +00:00
Pavel Ondračka 6c2959c025 r300: merge simple movs with constant swizzles together
This pass will merge instructions like these

MOV output[0].x, temp[5].x___;
MOV output[0].yzw, none._001;

into

MOV output[0].xyzw, temp[5].x001;

It is currently very careful with control flow and dependency
tracking, so there is still room for improvements.

Shader-db stats with RV530:
total instructions in shared programs: 132486 -> 132256 (-0.17%)
instructions in affected programs: 6186 -> 5956 (-3.72%)
helped: 65
HURT: 0
total temps in shared programs: 18035 -> 18014 (-0.12%)
temps in affected programs: 295 -> 274 (-7.12%)
helped: 22
HURT: 1

Signed-off-by: Pavel Ondračka <pavel.ondracka@gmail.com>
Reviewed-by: Filip Gawin <filip@gawin.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16657>
2022-06-05 21:38:36 +00:00
Filip Gawin 0fcd423a6a r300: don't check for unitialized reads when rewriting register
This fixes the "Rewrite of inst X failed Can't allocate source
for Inst X src_type=X new_index=X new_mask=X" errors.

The compiler is quite strict when rewriting registers during
the pair allocation and checks that all of the reads of it are
initialized. However the spec doesn't enfore that, and
specifically with control flow depending on user input we can't
really know...

In the following example temp[4].x is written only in one branch,
that might or might not be taken, but this is enough to keep the
compiler happy:

IF aluresult.x___;
   MAD temp[4].x, src0.1__, src0.111, src0.000
ENDIF;
src0.xyz = temp[4], src0.w = temp[4]
MAD color[0].xyz, src0.xyz, src0.111, src0.000
MAD color[0].w, src0.w, src0.1, src0.0

After switch to ntt, more IFs are converted to CMP, and the color
write looks like this. Please note that the CMP here is not TGSI
opcode but rather our US_OP_RGB_CMP: src2 >= 0 ? src0 : src1

src0.xyz = temp[4], src0.w = temp[4], src1.xyz = temp[3], src1.w = temp[12], src2.xyz = temp[2]
CMP color[0].xyz, src0.xyz, src1.xyz, -src2.xxx
CMP color[0].w, src0.w, src1.w, -src2.x

At this point temp[4].x is undefined. Now when compiler tries to
allocate register for temp[4] at some previous instruction, it will
find out that it is used as a source in the final CMP and bail out.
Instead of increasing the complexitty even more trying to account for
this, just get rid of the check completelly.

Fixes:
dEQP-GLES2.functional.shaders.indexing.vector_subscript.vec2_dynamic_subscript_write_component_read_fragment,Fail
dEQP-GLES2.functional.shaders.indexing.vector_subscript.vec2_dynamic_subscript_write_direct_read_fragment,Fail
dEQP-GLES2.functional.shaders.indexing.vector_subscript.vec2_dynamic_subscript_write_dynamic_subscript_read_fragment,Fail
dEQP-GLES2.functional.shaders.indexing.vector_subscript.vec2_dynamic_subscript_write_static_loop_subscript_read_fragment,Fail
dEQP-GLES2.functional.shaders.indexing.vector_subscript.vec2_dynamic_subscript_write_static_subscript_read_fragment,Fail
dEQP-GLES2.functional.shaders.indexing.vector_subscript.vec3_dynamic_subscript_write_component_read_fragment,Fail
dEQP-GLES2.functional.shaders.indexing.vector_subscript.vec3_dynamic_subscript_write_direct_read_fragment,Fail
dEQP-GLES2.functional.shaders.indexing.vector_subscript.vec3_dynamic_subscript_write_dynamic_subscript_read_fragment,Fail
dEQP-GLES2.functional.shaders.indexing.vector_subscript.vec3_dynamic_subscript_write_static_loop_subscript_read_fragment,Fail
dEQP-GLES2.functional.shaders.indexing.vector_subscript.vec3_dynamic_subscript_write_static_subscript_read_fragment,Fail
dEQP-GLES2.functional.shaders.indexing.vector_subscript.vec4_dynamic_subscript_write_component_read_fragment,Fail
dEQP-GLES2.functional.shaders.indexing.vector_subscript.vec4_dynamic_subscript_write_direct_read_fragment,Fail
dEQP-GLES2.functional.shaders.indexing.vector_subscript.vec4_dynamic_subscript_write_dynamic_subscript_read_fragment,Fail
dEQP-GLES2.functional.shaders.indexing.vector_subscript.vec4_dynamic_subscript_write_static_loop_subscript_read_fragment,Fail
dEQP-GLES2.functional.shaders.indexing.vector_subscript.vec4_dynamic_subscript_write_static_subscript_read_fragment,Fail

Reviewed-by: Pavel Ondračka <pavel.ondracka@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16657>
2022-06-05 21:38:36 +00:00
Pavel Ondračka a7f3584d1e r300: Update list of RV515 dEQP failures and add some flakes
The fixes are mostly from 23dfae4c81

dEQP-GLES2.functional.fragment_ops.depth_stencil tests show random
flakes. The ones in failures are showing unexpected pass, however other
random test failures from the same group keep showing so just mark it
all as flakes.

Signed-off-by: Pavel Ondračka <pavel.ondracka@gmail.com>
Reviewed-by: Filip Gawin <filip@gawin.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16657>
2022-06-05 21:38:36 +00:00
Pavel Ondračka bc9b2f3781 r300: don't try to use inline constants instead of constant swizzles
It doesn't make sense and was not working anyway. This was spotted
by Filip Gawin in https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13978
however the fix there was IMO just papering over the problem.

I don't believe that this could manifest as a real issues, because
when all of the swizzles were constant the file would be set to
RC_FILE_NONE already. So in theory this could lead to an issue only
in the close to impossible circumstance that the out of bounds memory
read by constant->u.Immediate[swz] would end with the same exact value
as another inlineable constant in different channel. However in some
circumstances it would lead to following valgrind warnings:

 Conditional jump or move depends on uninitialised value(s)
    at 0x5D4E690: ieee_754_to_r300_float (radeon_inline_literals.c:61)
    by 0x5D4E690: rc_inline_literals (radeon_inline_literals.c:133)
    by 0x5D3877A: rc_run_compiler_passes (radeon_compiler.c:436)
    by 0x5D38821: rc_run_compiler (radeon_compiler.c:458)
    by 0x5D4AF63: r3xx_compile_fragment_program (r3xx_fragprog.c:139)
    by 0x5D48377: r300_translate_fragment_shader (r300_fs.c:499)
    by 0x5D491B0: r300_pick_fragment_shader (r300_fs.c:601)
    by 0x5D2BFEE: r300_create_fs_state (r300_state.c:1072)
    by 0x57DDC36: st_create_nir_shader (st_program.c:538)
    by 0x57DF10E: st_create_fp_variant (st_program.c:1056)
    by 0x57E057C: st_get_fp_variant (st_program.c:1102)
    by 0x57E0AB1: st_precompile_shader_variant (st_program.c:1287)
    by 0x57E0AB1: st_finalize_program (st_program.c:1333)
    by 0x57CB6F3: st_link_nir (st_glsl_to_nir.cpp:958)

Signed-off-by: Pavel Ondračka <pavel.ondracka@gmail.com>
Reviewed-by: Filip Gawin <filip@gawin.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16657>
2022-06-05 21:38:36 +00:00
Pavel Ondračka 2bdffe7eb2 r300: be less agresive with copy propagate in loops
When there are multiple MOVs with the same destination in loop
in different branches and some readers after the loop, we would
now errorneously copy propagate the last MOV, like in the following
snippet:

BGNLOOP;
  ...
  IF temp[3].x___;
    MOV temp[2], const[1].yxxy;
    BRK;
  ENDIF;
  IF temp[4].x___;
    MOV temp[2], const[1].xyxy;
    BRK;
  ENDIF;
  ...
  MOV temp[2], const[1].xyxy;
ENDLOOP;
ADD_SAT temp[0], temp[2], temp[1];

into:

BGNLOOP;
  ...
  IF temp[3].x___;
    MOV temp[2], const[1].yxxy;
    BRK;
  ENDIF;
  IF temp[3].y___;
    MOV temp[2], const[1].xyxy;
    BRK;
  ENDIF;
  ...
ENDLOOP;
ADD_SAT temp[0], const[1].xyxy, temp[1];

We need the copy propagate just for simple cleanups after ttn,
anything more complex should have been handled already in NIR.
So just bail out if any of the readers is after the loop.

No changes in shader-db.

Fixes few piglit tests when loop unrolling is disabled:
spec@glsl-1.10@execution@vs-loop-complex-unroll
spec@glsl-1.10@execution@vs-loop-complex-unroll-nested-break
spec@glsl-1.10@execution@vs-loop-complex-unroll-with-else-break

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6467
Signed-off-by: Pavel Ondračka <pavel.ondracka@gmail.com>
Reviewed-by: Filip Gawin <filip@gawin.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16657>
2022-06-05 21:38:36 +00:00
Pavel Ondračka 5a3be2db24 r300: deduplicate common NIR options
Signed-off-by: Pavel Ondračka <pavel.ondracka@gmail.com>
Reviewed-by: Filip Gawin <filip@gawin.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16657>
2022-06-05 21:38:36 +00:00
Mike Blumenkrantz 5c37320eb6 mesa/st: bump param reservation to 28
now d3d12 is hitting it, so here we go

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16872>
2022-06-05 13:20:25 +00:00
Mike Blumenkrantz f160a3b2d6 virgl: add some ci flakes
issue #6614

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16876>
2022-06-05 13:07:14 +00:00
Vinson Lee 3e679219a1 clc: Fix build with llvm-15.
opencl_c_h is defined only for llvm < 15.

Fixes: bcc2df4890 ("clc: speed up compilation by not relying on opencl-c.h")
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16808>
2022-06-04 22:27:55 -07:00
Mike Blumenkrantz 4b3afed35a d3d12: skip time-elapsed piglit tests in ci
flaky

Acked-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16866>
2022-06-04 17:12:58 +00:00
Timothy Arceri 5aec67a1e1 glsl: remove the now unused GLSL IR loop unrolling code
This code was slow, buggy and hard to understand. All drivers
have now switched to using the NIR unrolling code \o/

Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16366>
2022-06-04 16:11:49 +00:00
Timothy Arceri 26ff49038c gallium: remove PIPE_SHADER_CAP_MAX_UNROLL_ITERATIONS_HINT CAP
This is used for the old, buggy and slow GLSL IR loop unrolling
code. All drivers have now switched to the NIR unrolling code so
here we remove the CAP.

Reviewed-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16366>
2022-06-04 16:11:49 +00:00
Timothy Arceri 8c79616984 svga: disable GLSL IR loop unrolling
NIR loop unrolling is already enabled so just let it do its job.

Here we also fix up the force unroll settings.

Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16366>
2022-06-04 16:11:49 +00:00
Timothy Arceri bc0f8455e5 nouveau/nvc0: disable GLSL IR loop unrolling
NIR loop unrolling is already enabled so just let it do its job.

Shader-db results (nv120):

total gpr in shared programs: 893490 -> 893898 (0.05%)
gpr in affected programs: 15338 -> 15746 (2.66%)
total instructions in shared programs: 6243205 -> 6237068 (-0.10%)
instructions in affected programs: 71160 -> 65023 (-8.62%)
total bytes in shared programs: 66729616 -> 66664760 (-0.10%)
bytes in affected programs: 759328 -> 694472 (-8.54%)

Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16366>
2022-06-04 16:11:49 +00:00
Timothy Arceri e5181c2e23 nouveau/nv50: disable GLSL IR loop unrolling
NIR loop unrolling is already enabled so just let it do its job.

Shader-db results (nv92):

total gpr in shared programs: 734638 -> 735037 (0.05%)
gpr in affected programs: 11058 -> 11457 (3.61%)
total instructions in shared programs: 6073415 -> 6073398 (<.01%)
instructions in affected programs: 10079 -> 10062 (-0.17%)
total bytes in shared programs: 41837432 -> 41838872 (<.01%)
bytes in affected programs: 252504 -> 253944 (0.57%)

Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16366>
2022-06-04 16:11:49 +00:00
Timothy Arceri fa3b6a3d32 nouveau/nv30: disable GLSL IR loop unrolling
NIR loop unrolling is already enabled so just let it do its job.

Shader-db results (nv40):

total instructions in shared programs: 17446532 -> 17446068 (<.01%)
instructions in affected programs: 15532 -> 15068 (-2.99%)
total gpr in shared programs: 82658 -> 82801 (0.17%)
gpr in affected programs: 1680 -> 1823 (8.51%)

Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16366>
2022-06-04 16:11:49 +00:00
Timothy Arceri bb2f97eb27 lima: switch to NIR loop unrolling
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16366>
2022-06-04 16:11:49 +00:00
Timothy Arceri 9e1ce5de40 lima: fixup nir indirect unroll options to match gallium CAP
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16366>
2022-06-04 16:11:49 +00:00
Timothy Arceri 53df6dfb5b lima: lower all undefs to zero in vs
Otherwise we will later hit:

gpir_error("nir_ssa_undef_instr is not supported\n");

Unfortunatly this causes a piglit failure due to increased register
pressure in an unrealistic shader but since not doing this can
result in hitting the not supported error in more relistic shaders
this seems the right thing to do for now.

Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16366>
2022-06-04 16:11:49 +00:00
Timothy Arceri 57dee95b85 freedreno: switch to NIR loop unrolling
Force unroll setting based on GLSL IR settings:

   case PIPE_SHADER_CAP_INDIRECT_INPUT_ADDR:
   case PIPE_SHADER_CAP_INDIRECT_OUTPUT_ADDR:
   case PIPE_SHADER_CAP_INDIRECT_TEMP_ADDR:
   case PIPE_SHADER_CAP_INDIRECT_CONST_ADDR:
      /* a2xx compiler doesn't handle indirect: */
      return is_ir3(screen) ? 1 : 0;

Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16366>
2022-06-04 16:11:49 +00:00
Timothy Arceri 34e868d882 freedreno/ir3: tidy up duplication of common nir options
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16366>
2022-06-04 16:11:49 +00:00
Timothy Arceri 0f1cbcd6a7 gallivm: disable GLSL IR loop unrolling in LLVMPIPE
The NIR unroller is already enabled so just allow it to do its job.

We add a new failure here because llvmpipe fails to handle a
shader that is no longer unrolled.

Previously GLSL IR could unroll the loop because it only had a
single break. However once lower_returns passes over the shader
it ends up with more than 2 breaks making it no longer possible
to unroll. This is a disadvantage of doing the unrolling in NIR
however in practice we don't see shaders in the wild with multiple
returns inside loops.

Being unable to handle this loop is an existing bug with llvmpipe
exposed by the loop no longer being unrolled.

Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16366>
2022-06-04 16:11:49 +00:00
Alyssa Rosenzweig 3b3cd59fb8 panfrost: Launch transform feedback shaders
We now have infrastructure in place to generate variants of vertex shaders
specialized for transform feedback. All that's left is launching these
compute-like kernels before the IDVS job, implementing both the
transform feedback and the regular rasterization pipeline. This implements
transform feedback on Valhall, passing the relevant GLES3.1 tests.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15720>
2022-06-04 14:35:56 +00:00
Alyssa Rosenzweig a510a94b02 panfrost: Create transform feedback shaders
Valhall has no architectural support for transform feedback. So if a vertex
shader uses transform feedback, we need to split the shader into two: a pure
vertex stage and a compute-like transform feedback stage. This splitting
resembles the splitting we do for IDVS.

When compiling a vertex shader that uses transform feedback on Bifrost, also
compile the transform feedback variant. That variant (marked by internal=true)
will get its stores lowered by the NIR pass introduced earlier in this series.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15720>
2022-06-04 14:35:56 +00:00
Alyssa Rosenzweig ed5a5a9d6d panfrost: Wire up transfrom feedback sysvals
Wire the Gallium interface for transform feedback up to the system values that
will be fed into our lowering code. This is based on our existing transform
feedback implementation for Midgard.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15720>
2022-06-04 14:35:56 +00:00
Alyssa Rosenzweig 45dc15d07b panfrost: Don't allow vertex shaders to have side effects
In both GL and VK, the driver may choose not to support vertex shaders with side
effects (SSBOs, atomics, images). Supporting this opens a can of worms for IDVS.
Neither freedreno nor the (Vulkan?) DDK advertise support, for this reason.
Apps should not be using this anti-feature anyway.

Stop advertising support.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15720>
2022-06-04 14:35:56 +00:00
Alyssa Rosenzweig 4e341e70d8 pan/bi: Handle transform feedback intrinsics
Translate the intrinsics we introduced to lower away transform feedback into
Panfrost system values which the GL driver can handle.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15720>
2022-06-04 14:35:56 +00:00
Alyssa Rosenzweig ae3fa6cc1d pan/bi: Add transform feedback lowering pass
Add a simple NIR-based implementation of transform feedback, appropriate for
OpenGL ES 3.1 class hardware (compute but no geometry or tessellation shaders).
Stores to varyings that will be captured are replaced by stores to transform
feedback buffers and some addressing math. This allows implementing the semantic
of transform feedback in a compute-like stage.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15720>
2022-06-04 14:35:56 +00:00
Alyssa Rosenzweig dc2d8a643f nir: Export nir_io_add_intrinsic_xfb_info
This is useful for drivers which wish to consume XFB information. These
hopefully-uncontroversial hunks are extracted from the much more controversial
"st,nir,radeons: Move nir_lower_io_passes to si_nir_lower_io" by Jason.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15720>
2022-06-04 14:35:56 +00:00
Alyssa Rosenzweig 5c79d649af nir: Add transform feedback system values
These will be used to facilitate transform feedback lowering for Panfrost,
although other backends could use the sysvals in the future.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15720>
2022-06-04 14:35:56 +00:00
Mike Blumenkrantz ba09a00a5c format_utils: properly parenthesize macro params
this otherwise breaks evaluation of the parameters on arm64

cc: mesa-stable

fixes #6496

Reviewed-by: Rob Clark <robdclark@chromium.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16860>
2022-06-04 13:15:57 +00:00
Alyssa Rosenzweig 2ee6206751 panfrost: Use C11 static_assert for enums
Rather than asserting everything in an unused function, just do it in global
context with C11 static_asserts. This is a bit neater now that we depend on C11
projectwide.

Obvious follow-on from !16670.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16856>
2022-06-04 12:19:54 +00:00
Mike Blumenkrantz 20a57f8a05 mesa/st: bump param reservation to 20
I was hitting the realloc assert, so increase this again

fixes (zink+tu):
KHR-GL46.geometry_shader.api.max_atomic_counter_buffers

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16851>
2022-06-04 03:58:21 +00:00
Mike Blumenkrantz 3ec74cd1c7 mesa: improve relocation problem message
make it easier to immediately know what the problem is

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16851>
2022-06-04 03:58:21 +00:00
Timothy Arceri 87aaa0f915 glsl: remove now unused lower_const_arrays_to_uniforms()
We now use a NIR version instead.

Acked-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16770>
2022-06-04 03:13:36 +00:00
Timothy Arceri c573260c9b glsl: switch to NIR based implementation of lower_const_arrays_to_uniforms()
Shader-db results iris (BDW):

total instructions in shared programs: 17523543 -> 17513909 (-0.05%)
instructions in affected programs: 218091 -> 208457 (-4.42%)
helped: 69
HURT: 327
helped stats (abs) min: 2 max: 2919 x̄: 160.84 x̃: 12
helped stats (rel) min: 0.21% max: 96.88% x̄: 14.87% x̃: 6.40%
HURT stats (abs)   min: 1 max: 47 x̄: 4.48 x̃: 1
HURT stats (rel)   min: 0.10% max: 22.02% x̄: 3.33% x̃: 0.18%
95% mean confidence interval for instructions value: -45.02 -3.63
95% mean confidence interval for instructions %-change: -1.16% 1.47%
Inconclusive result (%-change mean confidence interval includes 0).

total loops in shared programs: 4875 -> 4868 (-0.14%)
loops in affected programs: 7 -> 0
helped: 7
HURT: 0
helped stats (abs) min: 1 max: 1 x̄: 1.00 x̃: 1
helped stats (rel) min: 100.00% max: 100.00% x̄: 100.00% x̃: 100.00%
95% mean confidence interval for loops value: -1.00 -1.00
95% mean confidence interval for loops %-change: -100.00% -100.00%
Loops are helped.

total cycles in shared programs: 858032406 -> 857984712 (<.01%)
cycles in affected programs: 22940290 -> 22892596 (-0.21%)
helped: 155
HURT: 312
helped stats (abs) min: 1 max: 49696 x̄: 1697.70 x̃: 62
helped stats (rel) min: <.01% max: 70.84% x̄: 5.60% x̃: 0.82%
HURT stats (abs)   min: 1 max: 19640 x̄: 690.54 x̃: 100
HURT stats (rel)   min: <.01% max: 217.23% x̄: 33.57% x̃: 0.92%
95% mean confidence interval for cycles value: -436.09 231.84
95% mean confidence interval for cycles %-change: 15.39% 25.75%
Inconclusive result (value mean confidence interval includes 0).

total spills in shared programs: 16289 -> 15205 (-6.65%)
spills in affected programs: 2753 -> 1669 (-39.38%)
helped: 9
HURT: 1

total fills in shared programs: 20347 -> 20324 (-0.11%)
fills in affected programs: 1642 -> 1619 (-1.40%)
helped: 9
HURT: 1

total sends in shared programs: 972151 -> 971960 (-0.02%)
sends in affected programs: 1910 -> 1719 (-10.00%)
helped: 25
HURT: 20
helped stats (abs) min: 1 max: 50 x̄: 9.00 x̃: 2
helped stats (rel) min: 0.87% max: 53.76% x̄: 13.89% x̃: 6.25%
HURT stats (abs)   min: 1 max: 8 x̄: 1.70 x̃: 1
HURT stats (rel)   min: 8.33% max: 200.00% x̄: 52.36% x̃: 33.33%
95% mean confidence interval for sends value: -8.19 -0.29
95% mean confidence interval for sends %-change: -1.07% 32.18%
Inconclusive result (%-change mean confidence interval includes 0).

LOST:   3
GAINED: 27

Note a small number of tests fail on lima and r300 after this patch.
However since we are doing the correct thing here and they only
fail due to a slight increase in instruction count pushing them
over their instruction count limit, we are defering that issue
to a different bug report for further discussion.

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

Acked-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16770>
2022-06-04 03:13:36 +00:00
Timothy Arceri 1805ee8d7b glsl: move gl_nir_link_opts() call out of the st code
Calling this directly in the linker code allows us to place it between
the varying linker and uniform linker calls which allows for better
optimisation/removal of uniforms.

Also in a later patch it allows us to insert a new nir based
lower_const_arrays_to_uniforms() call after the gl_nir_link_opts()
call. This is important because it allows the linking opts to
move constant arrays to later stages if possible before
lower_const_arrays_to_uniforms() turns them into uniforms.

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

Acked-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16770>
2022-06-04 03:13:36 +00:00