Commit graph

4639 commits

Author SHA1 Message Date
Alyssa Rosenzweig
ee671cf4f7 intel/nir_blockify_uniform_loads: use helpers
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37753>
2025-10-09 09:50:20 -04:00
Alyssa Rosenzweig
6b006db492 brw/nir_lower_storage_image: use helper
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37753>
2025-10-09 09:50:20 -04:00
Alyssa Rosenzweig
e3b6440b39 brw/nir_lower_shader_calls: use helpers
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37753>
2025-10-09 09:50:20 -04:00
Alyssa Rosenzweig
ec8ed69131 brw/nir_lower_sample_index_in_coord: use helpers
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37753>
2025-10-09 09:50:20 -04:00
Alyssa Rosenzweig
544a739abc brw/nir_lower_fs_barycentrics: avoid nir_def_rewrite_uses_after
replace is preferred when appropriate & should be faster. after is when
you use the result in your lowering itself.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37753>
2025-10-09 09:50:19 -04:00
Alyssa Rosenzweig
4fe8c19862 brw/nir_lower_alpha_to_coverage: eliminate goto
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37753>
2025-10-09 09:50:19 -04:00
Kenneth Graunke
73cbb35442 brw: Move into a new src/intel/compiler/brw subdirectory
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
This keeps the directory structure a bit more organized:
- brw specific code
- elk specific code
- common NIR passes that could be used in both places

It also means that you can now 'git grep' in the brw directory without
finding a bunch of elk code, or having to "grep thing b*".

Reviewed-by: Dylan Baker <dylan.c.baker@intel.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37755>
2025-10-09 07:01:47 +00:00
Kenneth Graunke
d1b0597213 brw: Drop compiler/ from brw includes
They're in the current directory/module, just include them.

Reviewed-by: Dylan Baker <dylan.c.baker@intel.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37755>
2025-10-09 07:01:46 +00:00
Kenneth Graunke
af93215b7a intel: Re-unify brw_prim.h and elk_prim.h
These are identical and are just hardware enum values, not related to
the structure of the backend compiler.

Reviewed-by: Dylan Baker <dylan.c.baker@intel.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37755>
2025-10-09 07:01:46 +00:00
Kenneth Graunke
d4c8ca43ef intel: Make a libintel_compiler_nir internal static library
We were compiling these twice, one for brw, one for elk.  There's no
reason to do that, just compile the common code once and link against it
in both backends.

Reviewed-by: Dylan Baker <dylan.c.baker@intel.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37755>
2025-10-09 07:01:46 +00:00
Kenneth Graunke
86aa241c66 brw: Rename brw_nir_trig build target to brw_nir_workarounds
Matches the recent file rename.

Reviewed-by: Dylan Baker <dylan.c.baker@intel.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37755>
2025-10-09 07:01:46 +00:00
Kenneth Graunke
b15b83f43f brw: Drop ir_expression_operation_h from build system
This is from the pre-NIR era where we used GLSL IR expression opcodes
directly.  We haven't done that in years.

Reviewed-by: Dylan Baker <dylan.c.baker@intel.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37755>
2025-10-09 07:01:46 +00:00
Kenneth Graunke
a7c2b87874 intel: Move intel_shader_reloc to common code and drop elk_shader_reloc
We want to be able to emit load_reloc_const_intel intrinsics from common
NIR passes (such as printf lowering).  In order to do that, we need to
have the enum with the meaning of values in common code.  Once you have
that, it's easy to see the (identical) data structures as a way for the
driver to communicate about relocations, rather than a compiler backend
specific thing.  So we move it all up to common code, and re-unify.

Reviewed-by: Dylan Baker <dylan.c.baker@intel.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37755>
2025-10-09 07:01:46 +00:00
Kenneth Graunke
116c65cd3d brw: Rename brw_shader_reloc to intel_shader_reloc
In preparation for moving out of brw to common code.

Reviewed-by: Dylan Baker <dylan.c.baker@intel.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37755>
2025-10-09 07:01:46 +00:00
Kenneth Graunke
b458140b75 elk: Delete ELK_SHADER_RELOC_DESCRIPTORS_ADDR_HIGH
This is leftover brw code that nobody uses.

Reviewed-by: Dylan Baker <dylan.c.baker@intel.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37755>
2025-10-09 07:01:46 +00:00
Romaric Jodin
cb86341829 meson: remove '--outdir' argument in script
Usage of '--outdir' argument in python scripts makes it very
complicated for tools like ninja-to-soong to generate the Android
equivalent build file.
This is because the option is less clear on what will be generated.

Instead, change it for '--out' where we give the full path of the file
to generate. This has the good point of deduplicating the locations of
the file name to have it only in 'meson.build'.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37741>
2025-10-08 20:51:20 +00:00
Lionel Landwerlin
acf953757e brw: prevent LOAD_REG modifications on MOV_INDIRECT/BROADCAST
Due to those opcode reading variable amount of data in src0, it's not
possible to easily figure out what builder SIMD size should be used to
produce the LOAD_REG replacement.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: 2d13acf9d9 ("brw: Add passes to generate and lower load_reg")
Fixes: 93996c07e2 ("brw: fix broadcast opcode")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/14054
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37756>
2025-10-08 20:17:22 +00:00
Lionel Landwerlin
9cefd2ddf8 brw: avoid looking at variables to get image formats
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Alyssa Anne Rosenzweig <alyssa.rosenzweig@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36773>
2025-10-07 08:54:26 +00:00
Ian Romanick
911f033058 elk: Set lower_txd_data to devinfo
Otherwise data will be NULL, and there will be an instant segfault.

Closes: #14035
Fixes: a49cf90e14 ("elk: use the new lower_txd_cb")
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37698>
2025-10-06 19:24:34 +00:00
Lionel Landwerlin
69771e4bfe brw: fix render target indexing in FS output reads
I forgot that the base indice is actually a more complex value that
encodes the render target index and other things.

Also fix the 1d-layered accesses by checking the size of the
framebuffer.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/14008
Fixes: d4ab2087cf ("brw: lower non coherent FS load_output in NIR")
Reviewed-by: Alyssa Anne Rosenzweig <alyssa.rosenzweig@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37653>
2025-10-06 13:24:16 +00:00
Lionel Landwerlin
a49cf90e14 elk: use the new lower_txd_cb
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Alyssa Anne Rosenzweig <alyssa.rosenzweig@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37692>
2025-10-03 20:19:03 +00:00
Lionel Landwerlin
a14fee571b elk: remove txd bindless sampler lowering
The bindless sampler heap was introduced in Gfx11 which ELK doesn't
support.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Alyssa Anne Rosenzweig <alyssa.rosenzweig@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37692>
2025-10-03 20:19:03 +00:00
Lionel Landwerlin
bc8251673d brw: use the new lower_txd_cb
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Alyssa Anne Rosenzweig <alyssa.rosenzweig@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37692>
2025-10-03 20:19:03 +00:00
Iván Briano
ac182d6045 brw/mesh: drop brw_tue_map::per_task_data_start_dw
It's always set to a fixed value and not used in many places. Use the
value directly where it's needed.

Suggested-by: Lucas Fryzek <lfryzek@igalia.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37648>
2025-10-03 17:36:43 +00:00
Iván Briano
e624174134 anv: handle compiling of mesh shader separately from task shader
With EXT_shader_object, it became possible to compile shaders
independently and then use them together later, so we cannot rely on the
lack of task shader data to decide that no task shader will be used. The
flag VK_SHADER_CREATE_NO_TASK_SHADER_BIT_EXT exists for that purpose,
but it doesn't really make any difference for us. Always assume that if
the mesh shader is reading the task payload, it's going to be used with
one, as otherwise the application is doing it wrong.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/13983
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37648>
2025-10-03 17:36:43 +00:00
Kenneth Graunke
29d30c6f3d brw: Only skip SIMD widths based on pressure if an smaller one compiled
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
Sometimes the compute shader workgroup size requires a larger SIMD width
than the minimum in order to fit in the available threads.  In that case
we'll skip the SIMD8 shader, and need to try SIMD16 regardless of how
the register pressure estimate looks.

Fixes: 3af4e63061 ("brw: Skip compilation of larger SIMDs when pressure is too high")
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Tested-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37649>
2025-10-02 16:17:26 -07:00
Alyssa Rosenzweig
c2ae207e80 brw,anv: use XML-based stats
I didn't bother switching either iris or elk/hasvk but one could.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37517>
2025-10-02 20:22:00 +00:00
José Roberto de Souza
c008d21947 intel/brw: Move brw_s0() to brw_reg.h
It remove a duplication and also it will be used in a future patch
from other file.

Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37670>
2025-10-02 10:46:10 -07:00
Kenneth Graunke
3af4e63061 brw: Skip compilation of larger SIMDs when pressure is too high
This allows us to skip the entire backend compilation process for
large SIMD widths when register pressure is high enough that we'd
likely decide to prefer a smaller one in the end anyway.  The hope
is to make the same decisions as before, but with less CPU overhead.

We are making mostly the same decisions as before:

   | API / Platform | Total Shaders | Changed | % Identical
   --------------------------------------------------
   | VK / Arc A770 |       905,525 |   1,157 |   99.872% |
   | VK / Arc B580 |       788,127 |      53 |   99.993% |
   | VK / Panther  |       786,333 |      13 |   99.998% |
   | GL / Arc A770 |       308,618 |     269 |   99.913% |
   | GL / Arc B580 |       264,066 |      13 |   99.995% |
   | GL / Panther  |       273,212 |       0 |  100.000% |

Improves compile times on my i7-12700K:

   | Game                      | Arc B580 | Arc A770 |
   ---------------------------------------------------
   | Assassins Creed: Odyssey  |  -13.47% |  -10.98% |
   | Borderlands 3 (DX12)      |  -10.05% |  -11.31% |
   | Dark Souls 3              |  -21.06% |  -21.08% |
   | Oblivion Remastered       |  -11.10% |   -9.82% |
   | Phasmophobia              |  -32.73% |  -31.00% |
   | Red Dead Redemption 2     |  -20.10% |  -14.38% |
   | Total War: Warhammer III  |  -10.11% |  -14.44% |
   | Wolfenstein Youngblood    |  -15.91% |  -13.47% |
   | Shadow of the Tomb Raider |  -30.23% |  -25.86% |

It seems to have nearly no effect on compile times on Xe3 unfortunately,
as only 1,014 shaders in fossil-db even fail SIMD32 compilation in the
first place, and we want to let most of the "might succeed" cases
through to the backend for throughput analysis.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36750>
2025-09-30 19:44:03 +00:00
Kenneth Graunke
248050b6d0 brw: Add a quick NIR-based register pressure estimate pass
This tries to calculate an underestimate (lower bound) for the register
pressure at various SIMD widths, by counting live values in the NIR
shader.  This fundamentally won't be accurate, but it can give us an
idea of whether it's even worth trying a certain SIMD-width compile.

Doing this at the NIR level means we:
- Can use SSA structure rather than fuzzy liveness intervals
- Can avoid the backend scheduler aggressively trying to hide latency,
  presenting an overinflated view of the register pressure
- Have divergence information on-hand, making it easier to "scale up"
- Can skip cloning and optimizing NIR for compute shader SIMD widths

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36750>
2025-09-30 19:44:03 +00:00
Kenneth Graunke
5ebd766156 brw: Do most of NIR postprocessing before cloning for SIMD variants
We were doing a lot of NIR work repeatedly for each SIMD variant of
compute and mesh shaders.  Instead, do it once before cloning, and
just do one final optimization loop and out-of-SSA for each.

fossil-db results on Arc B580:

   Totals:
   Instrs: 233771096 -> 233794024 (+0.01%); split: -0.01%, +0.02%
   Subgroup size: 15922768 -> 15922736 (-0.00%); split: +0.00%, -0.00%
   Send messages: 12095619 -> 12098234 (+0.02%); split: -0.00%, +0.02%
   Loop count: 137562 -> 137523 (-0.03%)
   Cycle count: 32600323744 -> 32667411252 (+0.21%); split: -0.06%, +0.27%
   Spill count: 540908 -> 542027 (+0.21%); split: -0.07%, +0.28%
   Fill count: 700938 -> 698983 (-0.28%); split: -0.73%, +0.45%
   Scratch Memory Size: 37266432 -> 37304320 (+0.10%); split: -0.10%, +0.20%
   Max live registers: 72691728 -> 72692987 (+0.00%); split: -0.00%, +0.00%
   Non SSA regs after NIR: 67690309 -> 67688352 (-0.00%); split: -0.01%, +0.00%

   Totals from 3576 (0.45% of 789301) affected shaders:
   Instrs: 6932956 -> 6955884 (+0.33%); split: -0.41%, +0.74%
   Subgroup size: 88816 -> 88784 (-0.04%); split: +0.09%, -0.13%
   Send messages: 329168 -> 331783 (+0.79%); split: -0.02%, +0.81%
   Loop count: 8753 -> 8714 (-0.45%)
   Cycle count: 15153678820 -> 15220766328 (+0.44%); split: -0.14%, +0.58%
   Spill count: 213751 -> 214870 (+0.52%); split: -0.18%, +0.71%
   Fill count: 282616 -> 280661 (-0.69%); split: -1.82%, +1.13%
   Scratch Memory Size: 13056000 -> 13093888 (+0.29%); split: -0.27%, +0.56%
   Max live registers: 834757 -> 836016 (+0.15%); split: -0.11%, +0.26%
   Non SSA regs after NIR: 995033 -> 993076 (-0.20%); split: -0.48%, +0.28%

Looking at a few of the shaders with substantial instruction count
increases, it appears that it is largely due to more loops being
unrolled, which is probably actually a good thing.

The compile time impact of this patch appears to be negligable.
However, doing postprocessing before SIMD cloning allows us to
examine the postprocessed SSA-form NIR for improvements in an
upcoming patch.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36750>
2025-09-30 19:44:02 +00:00
Kenneth Graunke
0712c220ab brw: Split brw_postprocess_nir() into two pieces
brw_postprocess_nir contains a lot of stuff these days.  The first part
does a bunch of lowering and cleanup optimizations in SSA form.  The
second part does some post-optimization lowering and the out-of-SSA
conversion.

We may want to do additional work before the post-optimization/post-SSA
phase.  Splitting this allows us to insert such tasks in the "middle".

For convenience, brw_postprocess_nir() becomes a wrapper which invokes
both parts, so callers can continue working as they did until they have
a reason to do otherwise.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36750>
2025-09-30 19:44:02 +00:00
Kenneth Graunke
71b513a1e9 brw: Lower certain subgroup size modes in brw_preprocess_nir
This allows us to lower known subgroup size cases earlier, giving us
some earlier optimization opportunities.  We would need to know the
actual SIMD width to handle certain cases, but we can just pass 0 here,
which will lead to get_subgroup_size returning 0 - the same as leaving
this unset.  We can come back to that later during the per-SIMD-width
postprocessing.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36750>
2025-09-30 19:44:02 +00:00
Kenneth Graunke
3e493e03cc brw: Move "SSA form" printing to after divergence analysis is run
We were printing the SSA form, then immediately running divergence
analysis.  This patch flips those, so we can see con/div in INTEL_DEBUG
output for SSA form, which is really useful.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36750>
2025-09-30 19:44:02 +00:00
Kenneth Graunke
1b0808adf3 intel/nir: Make ffma peephole optimization preserve fp_fast_math flags
float_controls2 may have marked these as needing to preserve NaN or
other values.  If so, our newly contracted ffma needs to as well.

Fixes dEQP-VK.spirv_assembly.instruction.compute.float_controls2.*.input_args.mat_det_testedWithout_NotNan*
when nir_opt_algebraic is run after this pass.

Cc: mesa-stable
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36750>
2025-09-30 19:44:02 +00:00
Ian Romanick
23bd356b42 brw/nir: nir_intrinsic_load_reloc_const_intel may not be scalar [v3]
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
If the (NIR) destination is a register (i.e., not an SSA value), the
destination of the BRW instruction will not be is_scalar. This occurs in
some shaders in Final Fantasy XVI (and
finalfantasytype0_1.rdc.2826e29da3722a83.1.foz).

If the destination is not is_scalar, revert most of this code to the
state previous to f3593df877. This means

- Allocate a SIMD1 register and UNDEF it.
- Emit a SIMD1 MOV_RELOC_IMM to that register.
- Emit an additional MOV to expand the SIMD1 result.

Closes: #12520
Fixes: f3593df877 ("brw/nir: Treat load_reloc_const_intel as convergent")
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37384>
2025-09-29 16:48:07 +00:00
José Roberto de Souza
141a225ca1 intel/brw: Use ASR over SHR for SHADER_OPCODE_ISUB_SAT
src[1]/src0 is signed and Xe2+ SHR don't support operations over signed
data types so lets switch this over ASR that supports signed data
types.

Cc: mesa-stable
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37557>
2025-09-26 16:44:24 +00:00
Tim Van Patten
f90e0f0797 intel: Convert getenv() to os_get_option()
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
os_get_option() is a wrapper for getenv() that checks properties in
Android. It should be a no-op for other OS but will allow full use of
env vars in Android.

The environment variable names are automatically renamed by
os_get_option() and the order of precedence thus becomes:

1. getenv (non-Android)
2. debug.mesa.* (Android)
3. vendor.mesa.* (Android)
4. mesa.* (Android, as a fallback for older versions)

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37587>
2025-09-25 17:01:18 -06:00
Caio Oliveira
f011e5707d brw: Identify if/break/endif special case before emission
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37147>
2025-09-25 06:36:10 +00:00
Caio Oliveira
9f6155e47d brw: Also include the final disassembly in the debug archive
This doesn't replace existing support for INTEL_DEBUG=shaders -- so both
`shaders` and `mda` can be used.

Acked-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29146>
2025-09-24 23:08:45 -07:00
Caio Oliveira
cdef824b7a brw: Include some NIR states in the debug archive
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29146>
2025-09-24 23:08:45 -07:00
Caio Oliveira
f82d85a685 brw: Use debug archive file with INTEL_DEBUG=mda
Instead of dumping multiple files with the optimizer passes, write a single
archive file with all the contents.  The actual file is created
by the drivers, so later commits will actually enable the feature in
anv and iris.

This removes the use of INTEL_DEBUG=optimizer (and the corresponding
enum value) in brw.  That environment variable is still used by ELK --
which currently doesn't support mda.

Acked-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29146>
2025-09-24 23:08:45 -07:00
Sushma Venkatesh Reddy
a1c5f1ccf6 intel/compiler: Validation for SRND instructions
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36529>
2025-09-24 17:18:37 +00:00
Sushma Venkatesh Reddy
fe6d364ca8 brw: Add assembler support for SRND
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36529>
2025-09-24 17:18:37 +00:00
Sushma Venkatesh Reddy
51f4a2572a intel/compiler: Initial bits for SRND instruction
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36529>
2025-09-24 17:18:37 +00:00
Eric Engestrom
2f9fd1768a intel/meson: generate spirv_info.h before compiling brw_spirv.c
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37544>
2025-09-24 10:23:18 +00:00
Lionel Landwerlin
e9910fa955 brw: fix type conversion in tex operation params
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
Fix a bunch of tests in dEQP-VK.glsl.texture_gather.* on Xe2+

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: bddfbe7fb1 ("brw/blorp: lower MCS fetching in NIR")
Reviewed-by: Sagar Ghuge <sagar.ghuge@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37532>
2025-09-24 08:47:03 +00:00
Lionel Landwerlin
8e93e7cd72 brw: layout patch in VUE in position independent way
Only if required. I somehow misunderstood that those would need to be
independent too, not just the vertex slots.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: 8dee4813b0 ("brw: add ability to compute VUE map for separate tcs/tes")
Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37251>
2025-09-23 16:01:30 +00:00
Lionel Landwerlin
73383fe7ef brw: fix split_sends with txf combining
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37527>
2025-09-23 15:37:40 +00:00
Lionel Landwerlin
6dbcc81c85 brw: simplify texture surface/sampler handle sources
We had twice surface/sampler sources for no good reason, just add a
boolean to tell whether they are bindless or not.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37527>
2025-09-23 15:37:40 +00:00