Erik Faye-Lund
6ffa0e9254
mesa: do not use bitfields for advanced-blend state
...
Signed-off-by: Elie Tournier <elie.tournier@collabora.com >
Reviewed-by: Gert Wollny <gert.wollny@collabora.com >
Reviewed-by: Dave Airlie <airlied@redhat.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5516 >
2020-07-17 06:19:16 +00:00
Roman Stratiienko
29849aca0f
Android: Fixes for Q and R
...
Fix Android-Q build:
- Use AOSP prebuilt bison by specifying $(BISON) variable
- Use AOSP prebuilt flex by specifying $(LEX) variable
Fix Android-R build:
- Add M4 environmet variable for Android R and higher (See [1])
[1] - 2bfffb9f48
:Changes.md;dlc=997661002af1282d938e88c3c723037e42e5d283
Signed-off-by: Roman Stratiienko <r.stratiienko@gmail.com >
Reviewed-by: Eric Engestrom <eric@engestrom.ch >
Tested-by: Mauro Rossi <issor.oruam@gmail.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5894 >
2020-07-15 20:49:24 +00:00
Icecream95
bedd4b44de
compiler: Add dual-source factors to blend_factor
...
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5620 >
2020-07-15 01:30:00 +00:00
Jesse Natalie
0e90b3d0c4
nir: Support load/store of temps as scratch in nir_lower_explicit_io
...
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5889 >
2020-07-14 18:15:40 +00:00
Jesse Natalie
99aaf0ec18
nir: When nir_lower_vars_to_explicit_types is run on temps, update scratch_size
...
To allow interop with other scratch ops, append any remaining temp vars
to the end of any already-allocated scratch space.
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5889 >
2020-07-14 18:15:40 +00:00
Jesse Natalie
bf138c1fd4
nir_lower_io: Add addr_format_is_offset helper
...
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5889 >
2020-07-14 18:15:40 +00:00
Rhys Perry
7ba645d5cb
nir/lower_subgroups: add lower_shuffle_to_swizzle_amd
...
masked_swizzle_amd can be much faster than shuffle.
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com >
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5695 >
2020-07-13 14:11:50 +00:00
Rhys Perry
9c317cb278
nir/lower_subgroups: pass options struct to lower_shuffle
...
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com >
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5695 >
2020-07-13 14:11:50 +00:00
Icecream95
2e3a589e6c
nir: Add a base value to load_raw_output_pan
...
This is the render target the read instruction uses.
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5755 >
2020-07-13 13:35:10 +00:00
Jason Ekstrand
351b5137d7
spirv: Allow block-decorated struct types for constants
...
Whenever a struct type is decorated Block or BufferBlock we turn that
into a GLSL_TYPE_INTERFACE. Since these decorations can end up random
places, we should allow them for constants.
Closes : #3252
Fixes: 9d0ae777dd
"spirv: Use interface type for block and buffer..."
Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5855 >
2020-07-12 00:02:45 +00:00
Jason Ekstrand
81773b4b44
spirv: Skip phis in unreachable blocks in the second phi pass
...
Closes : #3253
Fixes: 22fdb2f855
"nir/spirv: Update to the latest revision"
Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5855 >
2020-07-12 00:02:45 +00:00
Mike Blumenkrantz
b8df1c43d2
nir: allow nir_lower_clip_halfz to run in geometry shaders
...
the final output of gl_Position needs this transform, and geometry shaders
must write this value for stream 0 if rasterization is enabled
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5851 >
2020-07-11 07:32:25 +00:00
Mike Blumenkrantz
3fe87a5836
nir: allow nir_lower_point_size_mov to run in geometry shader
...
geometry shaders may need to emit PSIZ as well
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5851 >
2020-07-11 07:32:24 +00:00
Pierre-Eric Pelloux-Prayer
49d35f3d88
glsl: declare gl_Layer/gl_ViewportIndex/gl_ViewportMask as vs builtins
...
Otherwise a VS doing the following:
out gl_PerVertex {
vec4 gl_Position;
int gl_ViewportIndex;
};
cannot be compiled because of the following error:
"redeclaration of gl_PerVertex must be a subset of the built-in
members of gl_PerVertex"
v2: add GLSL_PRECISION_HIGH param to add_varying() for "gl_Layer" in
generate_fs_special_vars.
v3: add GLSL_PRECISION_HIGH param to add_varying() for "gl_Layer" in
generate_varyings.
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/2946
Tested-by: John Galt <johngalt@fake.mail >
Reviewed-by: Marek Olšák <marek.olsak@amd.com > (v3)
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com > (v3)
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5167 >
2020-07-09 11:59:09 +00:00
Pierre-Eric Pelloux-Prayer
1e3aeda528
glsl: only allow 32 bits atomic operations on images
...
EXT_shader_image_load_store says:
The format of the image unit must be in the "1x32" equivalence class
otherwise the atomic operation is invalid.
ARB_shader_image_load_store says:
We will only support 32-bit atomic operations on images
Fixes: fc0a2e5d01
("glsl: add EXT_shader_image_load_store new image functions")
Reviewed-by: Marek Olšák <marek.olsak@amd.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5688 >
2020-07-09 09:58:01 +02:00
Pierre-Eric Pelloux-Prayer
233af4a412
glsl: don't expose imageAtomicIncWrap for signed image
...
The spec says that it's only allowed for unsigned ones.
Same from imageAtomicDecWrap.
Fixes: fc0a2e5d01
("glsl: add EXT_shader_image_load_store new image functions")
Reviewed-by: Marek Olšák <marek.olsak@amd.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5688 >
2020-07-09 09:58:01 +02:00
Pierre-Eric Pelloux-Prayer
0c8873d85d
glsl: reject size1x8 for image variable with floating-point data types
...
Fixes: 8d07d66180
("glsl,nir: Switch the enum representing shader image formats to PIPE_FORMAT.")
Reviewed-by: Marek Olšák <marek.olsak@amd.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5688 >
2020-07-09 09:58:01 +02:00
Marek Olšák
d2bd77eae4
glsl: don't validate array types in ir_dereference_variable
...
Fixes: 8d62969cfe
- glsl: validate more stuff
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3245
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5813 >
2020-07-08 23:22:17 +00:00
Jason Ekstrand
29cba3b695
nir/validate: Don't abort() until after the shader has printed
...
In the case where SSA use/def chains are broken, NIR prints out a very
cryptic error and then aborts. This abort happens during validation
rather than after the print is complete, hiding any other errors that
may have been found. One might think, "So what? Fix your use/def issue
first." However, what makes this especially bad is that, when use/def
chains are broken, there's usually a much nicer error inline in the
shader that would have been printed had we not aborted early so the
current behavior simply ensures you get the most cryptic error possible
in an already difficult-to-debug case.
While we're at it, we remove the one other case of abort() which is in
the validation of phi instruction sources.
Reviewed-by: Rob Clark <robclark@freedesktop.org >
Tested-by: Marcin Ślusarz <marcin.slusarz@intel.com >
Reviewed-by: Marcin Ślusarz <marcin.slusarz@intel.com >
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5809 >
2020-07-08 19:51:58 +00:00
Mike Blumenkrantz
1fd3563025
nir: add lowering pass for fragcolor -> fragdata
...
this is needed for zink and other drivers which can support fragcolor but
not fragdata and want to correctly handle EXT_multiview_draw_buffers
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5687 >
2020-07-08 14:51:34 +00:00
Marek Olšák
6aea39641a
glsl: lower mediump temporaries to 16 bits except structures (v2)
...
Without this, NIR contains non-lowerable 32-bit phis for mediump variables.
Structures are not lowered yet.
v2: add the LowerPrecisionTemporaries option
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com > (v1)
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5746 >
2020-07-07 22:02:06 -04:00
Alyssa Rosenzweig
7f00d4dac8
glsl: Handle 16-bit types in loop analysis
...
Fixes crash with mediump lowering in:
dEQP-GLES2.functional.shaders.loops.do_while_constant_iterations.basic_mediump_float_fragment
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com >
Reviewed-by: Marek Olšák <marek.olsak@amd.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5746 >
2020-07-07 22:02:06 -04:00
Marek Olšák
63ab8d41d1
glsl: add capability to lower mediump array types
...
This is not needed for lowering expressions, because they always work with
basic types, but it will be needed for lowering variables.
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5746 >
2020-07-07 22:02:06 -04:00
Marek Olšák
38cadd8b46
glsl: lower builtins to mediump that always return mediump or lowp
...
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5746 >
2020-07-07 22:02:06 -04:00
Marek Olšák
8fcf8e7fd4
glsl: lower builtins to mediump that ignore precision of certain parameters
...
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5746 >
2020-07-07 22:02:06 -04:00
Marek Olšák
3781697c23
glsl: don't lower builtins to mediump that don't allow it
...
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5746 >
2020-07-07 22:02:06 -04:00
Marek Olšák
69f7a3dac6
glsl: don't lower precision of textureSize
...
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5746 >
2020-07-07 22:02:06 -04:00
Marek Olšák
977b84652a
glsl: flatten a tautological conditional in lower_precision
...
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5746 >
2020-07-07 22:02:06 -04:00
Marek Olšák
9fccae80be
glsl: cleanups in lower_precision
...
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5746 >
2020-07-07 22:02:06 -04:00
Marek Olšák
8a93d2f128
glsl: remove the return type from lower_precision
...
It's unused.
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5746 >
2020-07-07 22:02:06 -04:00
Marek Olšák
161105d732
glsl: convert reusable lower_precision util code into helper functions
...
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5746 >
2020-07-07 22:02:06 -04:00
Marek Olšák
8d62969cfe
glsl: validate more stuff
...
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5746 >
2020-07-07 22:02:06 -04:00
Marek Olšák
8773d58b05
glsl: run validate_ir_tree if GLSL_VALIDATE=1 regardless of the build config
...
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5746 >
2020-07-07 22:02:06 -04:00
Marek Olšák
82caff5bc3
glsl: fix evaluating float16 constant expression matrices
...
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5746 >
2020-07-07 22:02:06 -04:00
Marek Olšák
50c27a0a17
glsl: fix the type of ir_constant_data::u16
...
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5746 >
2020-07-07 22:02:06 -04:00
Marek Olšák
3e47cb185e
glsl: print constant initializers
...
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5746 >
2020-07-07 22:02:06 -04:00
Marek Olšák
42be975aa2
glsl: print precision qualifiers in IR dumps
...
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5746 >
2020-07-07 22:02:06 -04:00
Marek Olšák
a038863ba0
glsl: make print_type non-static for debugging
...
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5746 >
2020-07-07 22:02:06 -04:00
Daniel Schürmann
9300a14ffb
nir: refactor nir_can_move_instr
...
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5622 >
2020-07-07 19:24:28 +02:00
Daniel Schürmann
09d0e06c5c
nir: also move vecN in case of nir_move_copies
...
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5622 >
2020-07-07 19:24:28 +02:00
Neil Roberts
121b82f638
nir: Add intrinsics for the line width
...
The first intrinsic is intended to expose the value set by glLineWidth
to shaders internally. The second intrinsic exposes the value actually
sent to the hardware. This may be wider than the first one in order to
implement anti-aliasing. These will be used in later patches to
implement a line smoothing lowering pass.
v2: Add a second intrinsic for the expanded line width for
anti-aliasing.
Reviewed-by: Eric Anholt <eric@anholt.net >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5624 >
2020-07-06 21:59:16 +00:00
Neil Roberts
14dd65bb5b
compiler: Add a system value for the line coord
...
The line coord is a coordinate along the axis perpendicular to the line.
It is in the range [0,1] between the two edges of the line. It is
available at least on Broadcom hardware.
Reviewed-by: Eric Anholt <eric@anholt.net >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5624 >
2020-07-06 21:59:15 +00:00
Jason Ekstrand
a6ed1d7fa5
nir: Add docs to nir_lower[_explicit]_io
...
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com >
Reviewed-by: Eric Anholt <eric@anholt.net >
Reviewed-by: Connor Abbott <cwabbott0@gmail.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5418 >
2020-07-06 19:54:30 +00:00
Jason Ekstrand
0bc5a829dd
nir: Remove shared support from lower_io
...
No drivers are using this anymore so we can delete it and not keep
maintaining this legacy code-path. If any drivers want this in the
future, they should use nir_lower_varst_to_explicit_types followed by
nir_lower_explicit_io.
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com >
Reviewed-by: Eric Anholt <eric@anholt.net >
Reviewed-by: Connor Abbott <cwabbott0@gmail.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5418 >
2020-07-06 19:54:30 +00:00
Jason Ekstrand
be96b069ad
nir: Assert that nir_lower_io is only called with allowed modes
...
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com >
Reviewed-by: Eric Anholt <eric@anholt.net >
Reviewed-by: Connor Abbott <cwabbott0@gmail.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5418 >
2020-07-06 19:54:30 +00:00
Connor Abbott
12e18d9e7a
nir: add vec2_index_32bit_offset address format
...
For turnip, we use the "bindless" model on a6xx. Loads and stores with
the bindless model require a bindless base, which is an immediate field
in the instruction that selects between 5 different 64-bit "bindless
base registers", a 32-bit descriptor index that's added to the base, and
the usual 32-bit offset. The bindless base usually, but not always,
corresponds to the Vulkan descriptor set. We can handle the case where
the base is non-constant by using a bunch of if-statements, to make it a
little easier in core NIR, and this seems to be what Qualcomm's driver
does too. Therefore, the pointer format we need to use in NIR has a vec2
index, for the bindless base and descriptor index. Plumb this format
through core NIR.
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net >
Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5683 >
2020-07-06 16:44:15 +00:00
Connor Abbott
7ab7316003
nir: Refactor load/store intrinsic helper
...
Add the possibility to specify the source components. This is necessary
to let the UBO/SSBO index have more than one component, and it also lets
us remove a few hand-rolled load intrinsic definitions.
Acked-by: Jason Ekstrand <jason@jlekstrand.net >
Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5683 >
2020-07-06 16:44:15 +00:00
Jonathan Marek
8453d2941a
Revert "nir: Support sysval tess levels in SPIR-V to NIR"
...
This reverts commit d2d4677b56
.
The option is not used by any driver.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5744 >
2020-07-06 08:48:10 -04:00
Jonathan Marek
2044bdac4f
Revert "nir: Add an option for lowering TessLevelInner/Outer to vecs"
...
This reverts commit d2df076120
.
The option is not used by any driver.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5744 >
2020-07-06 08:48:10 -04:00
Vinson Lee
395511d169
nir: Add nir_lower_clip_disable.c to SCons build.
...
Fixes: fb2fe802f6
("nir: add lowering pass for clip plane enabling")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3217
Signed-off-by: Vinson Lee <vlee@freedesktop.org >
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5741 >
2020-07-04 01:04:54 +00:00