Michel Zou
badb85edb8
util: reinstate ENUM_PACKED
...
gets rid of warning: 'gcc_struct' attribute ignored [-Wattributes] introduced by !23338
Fixes: 86532fa21d
("util: Use the gcc_struct attribute for packed structures in mingw")
Reviewed-by: Yonggang Luo <luoyonggang@gmail.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23478 >
2023-06-21 21:51:59 +00:00
Caio Oliveira
45bd6cfe28
compiler: Add mesa_scope_name() function
...
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io >
Acked-by: Yonggang Luo <luoyonggang@gmail.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23328 >
2023-06-19 23:29:26 +00:00
Caio Oliveira
59cc77f0fa
compiler: Move from nir_scope to mesa_scope
...
Just moving the enum and performing renames, no behavior change.
Acked-by: Alyssa Rosenzweig <alyssa@rosenzweig.io >
Acked-by: Yonggang Luo <luoyonggang@gmail.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23328 >
2023-06-19 23:29:26 +00:00
Yonggang Luo
1b836a52ea
mesa, compiler: Move gl_texture_index to glsl_types.h
...
This move is done for decouple glsl_types.h from src/mesa/*
This is achieved by move gl_texture_index from src/mesa/main/menums.h to src/compiler/shader_enums.h
And move ATOMIC_COUNTER_SIZE,MAX_VERTEX_STREAMS from src/mesa/main/config.h to src/compiler/shader_enums.h
Move include main/[config|menums].h into glsl/glsl_parser_extras.h from glsl_types.h
As now glsl_types.h should not include headers from src/mesa/*
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com >
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23420 >
2023-06-07 00:33:33 +00:00
Yonggang Luo
12256136e0
compiler: Rename shader_prim to mesa_prim and replace all usage of pipe_prim_type with mesa_prim
...
This is a prepare step to remove depends on p_defines.h in src/util/*
This is done by:
replace pipe_prim_type with mesa_prim
replace shader_prim with mesa_prim
replace PIPE_PRIM_MAX with MESA_PRIM_COUNT
replace SHADER_PRIM_ with MESA_PRIM_
replace PIPE_PRIM_ with MESA_PRIM_
This patch only replace code only
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com >
Acked-by: Marek Olšák <marek.olsak@amd.com >
Acked-by: Jesse Natalie <jenatali@microsoft.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23369 >
2023-06-03 03:29:03 +00:00
Yonggang Luo
5393156da4
compiler: Add SHADER_PRIM_COUNT to be SHADER_PRIM_MAX + 1
...
This is a prepare step for replace all usage of pipe_prim_type and shader_prim with mesa_prim
And the newly added MESA_PRIM_COUNT in latter patch will equal to SHADER_PRIM_COUNT
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com >
Acked-by: Marek Olšák <marek.olsak@amd.com >
Acked-by: Jesse Natalie <jenatali@microsoft.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23369 >
2023-06-03 03:29:03 +00:00
Yonggang Luo
e4b6a0a824
compiler: Getting shader_prim to be PACKED that consistence with pipe_prim_type
...
This is a prepare step for replace all usage of pipe_prim_type and shader_prim with mesa_prim
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com >
Acked-by: Marek Olšák <marek.olsak@amd.com >
Acked-by: Jesse Natalie <jenatali@microsoft.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23369 >
2023-06-03 03:29:03 +00:00
Samuel Pitoiset
c2ec23ab84
spirv,nir: add support for BaryCoord{NoPersp}KHR builtins
...
This introduces new intrinsics nir_intrinsic_load_barycentric_coord_xxx
with 3-components instead of expanding the existing ones that are
supposed to interpolate input varyings, while BaryCoord is a sysval
on most hardware.
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com >
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23254 >
2023-06-02 13:25:43 +00:00
Dave Airlie
564094b3ce
gallium: add a new PIPE_SHADER_MESH_TYPES
...
This adds a new limit, changing PIPE_SHADER_TYPES seems frought
with danger and very tricky. Currently only lava/llvmpipe plan to
offer task/mesh in GL land, so let's limit the fallout for now.
Reviewed-by: Marek Olšák <marek.olsak@amd.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23291 >
2023-06-01 21:50:56 +00:00
Emma Anholt
e31b7a3f9e
compiler: Update reference to name_for_stage func.
...
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22809 >
2023-05-16 18:57:28 +00:00
Lionel Landwerlin
1e0e4657f9
spirv/nir: wire ray interection triangle position fetch
...
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com >
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com >
Part-of: <f{merge_request.web_url}>
2023-05-04 11:25:41 +00:00
Marek Olšák
eb0307107d
nir: add/update comments for gl_access_qualifier
...
Reviewed-by: Rob Clark <robdclark@chromium.org >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22769 >
2023-05-04 01:55:22 +00:00
Marek Olšák
820c50ada3
nir: rename ACCESS_STREAM_CACHE_POLICY -> ACCESS_NON_TEMPORAL and document
...
Reviewed-by: Rob Clark <robdclark@chromium.org >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22769 >
2023-05-04 01:55:22 +00:00
Connor Abbott
0977925c53
nir, spirv: Add support for VK_EXT_fragment_density_map
...
This involves two new system values.
Reviewed-by: Faith Ekstrand <faith@gfxstrand.net >
Reviewed-by: Emma Anholt <emma@anholt.net >
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20303 >
2023-04-04 13:14:35 +00:00
Samuel Pitoiset
bb7e0c4280
spirv,nir: add support for SpvBuiltInFullyCoveredEXT
...
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com >
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21497 >
2023-03-21 08:44:09 +00:00
Daniel Schürmann
5ede3b1c6b
mesa: add gl_shader_stage_is_rt()
...
to indicate raytracing shader stages.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21780 >
2023-03-16 01:40:29 +00:00
Qiang Yu
194add2c23
nir: lower image add lower_to_fragment_mask_load_amd option
...
Like lower_to_fragment_fetch_amd option in lower tex,
this is for radeonsi to lower MS image ops.
Reviewed-by: Marek Olšák <marek.olsak@amd.com >
Signed-off-by: Qiang Yu <yuq825@gmail.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18666 >
2022-12-19 09:22:16 +08:00
Samuel Pitoiset
877c10efd1
spirv: add support for AMD_shader_early_and_late_fragment_tests
...
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com >
Reviewed-by: Tatsuyuki Ishi <ishitatsuyuki@gmail.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19738 >
2022-12-14 08:16:27 +00:00
Marek Olšák
150c2cec63
nir: add ACCESS_USES_FORMAT_AMD for typed buffer opcodes
...
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com >
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19422 >
2022-12-13 20:33:05 +00:00
Marek Olšák
716ac4a55d
nir: replace IS_SWIZZLED flag with ACCESS_IS_SWIZZLED_AMD
...
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com >
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19422 >
2022-12-13 20:33:05 +00:00
Dave Airlie
0bb03ffc76
gallium: use gl shader types as the basis for the gallium ones
...
This should enable a rename transistion.
Trace needs to swap over to a non-generated version, but that should be fine.
Reviewed-by: Marek Olšák <marek.olsak@amd.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17747 >
2022-08-04 08:17:39 +00:00
Emma Anholt
0e1fb2d984
nir+ir3: Rename load_size_ir3 to load_center_rhw_ir3.
...
Now that we know what it does, it also explains what it's doing in
interpolateAtOffset in ir3.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17322 >
2022-07-11 16:56:05 +00:00
Jason Ekstrand
b2ab6d10e4
mesa,glsl,ttn: Set subgroup_size to UNIFORM
...
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17337 >
2022-07-08 22:47:22 +00:00
Jason Ekstrand
8851f50753
spirv,vulkan: Set shader_info::subgroup_size
...
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17337 >
2022-07-08 22:47:22 +00:00
Jason Ekstrand
e1ee201722
shader_info: Move subgroup_size out of cs and make it an enum
...
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17337 >
2022-07-08 22:47:22 +00:00
Konstantin Seurer
2e0e150e69
spirv: Add plumbing for ray_cull_mask
...
Add a new cull_mask system value that is exposed
by the ray_cull_mask capability of
SPV_KHR_ray_cull_mask.
Signed-off-by: Konstantin Seurer <konstantin.seurer@gmail.com >
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16430 >
2022-06-08 20:20:21 +00:00
Qiang Yu
19f3737262
mesa: pass select result buffer offset as attribute/varying
...
Will be used by geometry shader to store hit result.
Reviewed-by: Marek Olšák <marek.olsak@amd.com >
Signed-off-by: Qiang Yu <yuq825@gmail.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15765 >
2022-06-06 18:23:49 +00:00
Marcin Ślusarz
7446acf4b4
compiler: add VARYING_SLOT_CULL_PRIMITIVE
...
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16493 >
2022-05-13 09:43:02 +00:00
Konstantin Seurer
938c9d9615
nir: Add a ray launch size addr intrinsic
...
Signed-off-by: Konstantin Seurer <konstantin.seurer@gmail.com >
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15712 >
2022-05-12 15:04:31 +00:00
Timur Kristóf
4b99b528f5
nir: Introduce workgroup_index and ability to lower workgroup_id to it.
...
The workgroup_index is intended for situations when a 3 dimensional
workgroup_id is not available on the HW, but a 1 dimensional index is.
In this case, we can use lower the 3D ID to use this.
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com >
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15103 >
2022-03-08 17:36:31 +00:00
Emma Anholt
3f4bfecee6
nir: Add some notes about const/uniform array access rules in GL.
...
I was doing some RE on freedreno and we had some questions about when the
hardware might need non-uniform or non-constant array access for various
descriptor types, so let's leave some notes for the next person.
Reviewed-by: Connor Abbott <cwabbott0@gmail.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13621 >
2022-02-16 20:06:21 +00:00
Timur Kristóf
0445802ab2
compiler: Extract num_mesh_vertices_per_primitive function.
...
Prevent code duplication.
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com >
Reviewed-by: Marcin Ślusarz <marcin.slusarz@intel.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15005 >
2022-02-14 11:13:42 +01:00
Lionel Landwerlin
cebf284ac1
intel/compiler: add a new pass to lower shading rate into HW format
...
Rework:
* Jason: Modernize brw_nir_lower_shading_rate_output:
1. Use nir_shader_instructions_pass()
2. Use *_imm builder helpers.
3. Use nir_intrinsic_base() instead of ->const_index[0]
v2: Also lower loads (Caio)
v3: Update stage check to trigger lowering (Caio)
v4: Assert on != MESH (Caio)
v5: Fixup instruction insertion (Caio)
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com >
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13739 >
2022-02-02 17:09:46 +00:00
Lionel Landwerlin
7d8884800e
compiler: add VARYING bit for primitive shading rate
...
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com >
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13739 >
2022-02-02 17:09:46 +00:00
Caio Oliveira
8bab8f6422
compiler, intel: Add gl_shader_stage_is_mesh()
...
And replace the previous Intel-specific function.
Reviewed-by: Marcin Ślusarz <marcin.slusarz@intel.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14823 >
2022-02-01 17:41:25 +00:00
Dave Airlie
02bab148f9
mesa/mtypes: move matrix enums to shader_enums.h
...
These are used in the compiler backend also.
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14437 >
2022-01-20 00:20:06 +00:00
Dave Airlie
1352e0ba0c
mesa/*: add a shader primitive type to get away from GL types.
...
This creates an internal shader_prim enum, I've fixed up most
users to use it instead of GL types.
don't store the enum in shader_info as it changes size, and confuses
other things.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14605 >
2022-01-19 21:54:58 +00:00
Dave Airlie
d54c07b4c4
mesa/*: use an internal enum for tessellation primitive types.
...
To avoid dragging gl.h into places it has no business being,
defined tessellation primitive mode to an enum.
This has a lot of fallout all over the place.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14605 >
2022-01-19 21:54:58 +00:00
Marcin Ślusarz
561de760fd
compiler: add new MESH_VIEW_COUNT/MESH_VIEW_INDICES system values
...
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net >
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com >
Acked-by: Timur Kristóf <timur.kristof@gmail.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14263 >
2022-01-11 22:45:23 +00:00
Jason Ekstrand
e8acc5a7ea
nir: Add a new sample_pos_or_center system value
...
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14198 >
2021-12-17 16:02:16 +00:00
Dave Airlie
244fa81c13
mesa: move _mesa_varying_slot_in_fs to shader_enums
...
This doesn't need anything from mtypes.h, just changes types
to non GL equivalents
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com >
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net >
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14104 >
2021-12-07 23:59:58 +00:00
Lionel Landwerlin
0800ec2c77
nir: add a new access flag to allow access in helper invocations
...
v2: Add nir_print support
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com >
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13718 >
2021-12-04 20:46:35 +00:00
Caio Marcelo de Oliveira Filho
813d41829d
compiler: Add new non-Multiview Task/Mesh builtins
...
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org >
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10600 >
2021-08-28 03:56:42 +00:00
Connor Abbott
8115cde3ba
tu, freedreno/a6xx, ir3: Rewrite tess PrimID handling
...
The previous handling conflated RelPatchID and PrimID, which would
result in incorrect gl_PrimitiveID when doing draw splitting and didn't
work with PrimID passthrough which fills the VPC slot with the "correct"
PrimID value from the tess factor BO which we left 0. Replace PrimID in
the tess lowering pass with a new RelPatchID sysval, and relace PrimID
with RelPatchID in the VS input code in turnip/freedreno at the same
time so that there is no net change in the tess lowering code. However,
now we have to add new mechanisms for getting the user-level PrimID:
- In the TCS it comes from the VS, just like gl_PrimitiveIDIn in the GS.
This means we have to add another register to our VS->TCS ABI. I
decided to put PrimID in r0.z, after the TCS header and RelPatchID,
because it might not be read in the TCS.
- If any stage after the TCS uses PrimID, the TCS stores it in the first
dword of the tess factor BO, and it is read by the fixed-function
tessellator and accessed in the TES via the newly-uncovered DSPRIMID
field. If we have tess and GS, the TES passes this value through to
the GS in the same way as the VS does. PrimID passthrough for reading
it in the FS when there's tess but no GS also "just works" once we
start storing it in the TCS. In particular this fixes
dEQP-VK.pipeline.misc.primitive_id_from_tess which tests exactly that.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12166 >
2021-08-05 16:35:41 +00:00
Marek Olšák
df5a2bbb41
shader_enums,mesa: move VERT_ATTRIB_EDGEFLAG to slot 31 for st/mesa
...
A future commit will replace st_vertex_program::input_to_index with
a prefix bitcount of inputs_read, but it needs vertex inputs to be
in the same order as vertex attribs.
Some of the FF definitions don't make sense with this ordering and are
removed.
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11370 >
2021-08-02 19:58:28 +00:00
Marek Olšák
d0d2108425
shader_enums: change VERT_BIT back to the 32-bit shift
...
This reverts 0e2566a8
. The warning is fixed differently.
Reviewed-by: Jesse Natalie <jenatali@microsoft.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10993 >
2021-06-16 21:45:57 +00:00
Caio Marcelo de Oliveira Filho
8af6766062
nir: Move workgroup_size and workgroup_variable_size into common shader_info
...
Move it out the "cs" sub-struct, since these will be used for other
shader stages in the future.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11225 >
2021-06-08 09:23:55 -07:00
Caio Marcelo de Oliveira Filho
c8a7bd0dc8
nir: Rename WORK_GROUP (and similar) to WORKGROUP
...
Be consistent with other usages in Vulkan and SPIR-V, and the recently
added workgroup_size field.
Acked-by: Emma Anholt <emma@anholt.net >
Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com >
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net >
Acked-by: Timur Kristóf <timur.kristof@gmail.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11190 >
2021-06-07 22:34:42 +00:00
Caio Marcelo de Oliveira Filho
43a6a2151b
compiler: Rename SYSTEM_VALUE_LOCAL_GROUP_SIZE to SYSTEM_VALUE_WORKGROUP_SIZE
...
Acked-by: Emma Anholt <emma@anholt.net >
Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com >
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net >
Acked-by: Timur Kristóf <timur.kristof@gmail.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11190 >
2021-06-07 22:34:42 +00:00
Jesse Natalie
0e2566a8a7
shader_enums: Fix MSVC warning C4334 (32bit shift cast to 64bit)
...
The warning is triggered when assigning into inputs_read, which is 64bit.
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net >
Reviewed-By: Bill Kristiansen <billkris@microsoft.com >
Cc: mesa-stable@lists.freedesktop.org
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10331 >
2021-04-20 00:28:35 +00:00