Jason Ekstrand
a61be312e2
panfrost: Use nir_foreach_variable_with_modes in pan_compile
...
Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5966 >
2020-07-29 17:38:58 +00:00
Jason Ekstrand
94f0bae4de
panfrost/midgard: Make search_var take a nir_shader and mode
...
Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5966 >
2020-07-29 17:38:58 +00:00
Jason Ekstrand
568022be75
r600/sfn: Use nir_foreach_variable_with_modes in IO vectorization
...
Reviewed-by: Gert Wollny <gert.wollny@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5966 >
2020-07-29 17:38:58 +00:00
Jason Ekstrand
cc51cec9c0
r600/sfn/lower_tex: Get rid of the lower_sampler vector
...
We can get the result type information easily from nir_tex_instr itself
by looking at dest_type. There's no reason to construct a vector and
try to index into it.
Reviewed-by: Gert Wollny <gert.wollny@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5966 >
2020-07-29 17:38:58 +00:00
Jason Ekstrand
929673077c
r600/sfn/lower_tess_io: Rework get_tcs_varying_offset
...
Reviewed-by: Gert Wollny <gert.wollny@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5966 >
2020-07-29 17:38:58 +00:00
Jason Ekstrand
e4d812db10
freedreno/ir3_cmdline: Rework i/o variable fixup
...
Reviewed-by: Rob Clark <robdclark@chromium.org >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5966 >
2020-07-29 17:38:58 +00:00
Jason Ekstrand
ce6e59b3d3
lima/standalone: Rework i/o variable fixup
...
Reviewed-by: Vasily Khoruzhick <anarsoul@gmail.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5966 >
2020-07-29 17:38:58 +00:00
Jason Ekstrand
52dd84a12e
freedreno/ir3_lower_tess: Rework var list helpers
...
They now take a nir_shader and a nir_variable_mode
Reviewed-by: Rob Clark <robdclark@chromium.org >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5966 >
2020-07-29 17:38:58 +00:00
Jason Ekstrand
77c41ce04b
nir/gl_nir_linker: Use nir_foreach_variable_with_modes
...
Reviewed-by: Dave Airlie <airlied@redhat.com >
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5966 >
2020-07-29 17:38:58 +00:00
Jason Ekstrand
c256cd900e
nir/lower_variable_initializers: Restrict the modes we lower
...
This is not a functional change because these are the only modes we
handle. All others get silently ignored.
Reviewed-by: Dave Airlie <airlied@redhat.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5966 >
2020-07-29 17:38:58 +00:00
Jason Ekstrand
4d7e064623
nir/split_per_member_structs: Use nir_variable_with_modes_safe
...
Reviewed-by: Dave Airlie <airlied@redhat.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5966 >
2020-07-29 17:38:58 +00:00
Jason Ekstrand
90cf4709d9
nir/lower_uniforms_to_ubo: Use nir_foreach_variable_with_modes
...
Reviewed-by: Dave Airlie <airlied@redhat.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5966 >
2020-07-29 17:38:58 +00:00
Jason Ekstrand
d0d5ef6139
nir/lower_two_sided_color: Use nir_variable_create
...
Reviewed-by: Dave Airlie <airlied@redhat.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5966 >
2020-07-29 17:38:58 +00:00
Jason Ekstrand
bb3994cfe7
nir/io_to_vector: Use nir_foreach_variable_with_modes
...
Reviewed-by: Dave Airlie <airlied@redhat.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5966 >
2020-07-29 17:38:58 +00:00
Jason Ekstrand
0a77c67442
nir/lower_io_to_temporaries: Use a separate list for new inputs
...
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5966 >
2020-07-29 17:38:58 +00:00
Jason Ekstrand
cd66005b23
nir: Use a nir_shader and mode in lower_clip_cull_distance_arrays
...
Reviewed-by: Gert Wollny <gert.wollny@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5966 >
2020-07-29 17:38:58 +00:00
Jason Ekstrand
d5d15c301e
nir/lower_amul: Add a variable mode check
...
This loop should only apply to UBOs and SSBOs because max_slot is never
used for normal uniforms.
Reviewed-by: Gert Wollny <gert.wollny@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5966 >
2020-07-29 17:38:58 +00:00
Jason Ekstrand
3be0be7d54
nir: Split nir_index_vars into two functions
...
We also very slightly change the semantics. It no longer is one index
per list for global variables and is a single index over-all.
Reviewed-by: Gert Wollny <gert.wollny@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5966 >
2020-07-29 17:38:58 +00:00
Jason Ekstrand
86c9303814
nir/split_vars: Add mode checks to list walks
...
Reviewed-by: Gert Wollny <gert.wollny@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5966 >
2020-07-29 17:38:58 +00:00
Jason Ekstrand
2f6c263cc3
st/nir: Rework fixup_varying_slots
...
Reviewed-by: Gert Wollny <gert.wollny@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5966 >
2020-07-29 17:38:58 +00:00
Jason Ekstrand
4c3a30393d
nir/linking: Rework some internal helpers
...
Instead of taking a variable list, take a nir_shader and mode.
Reviewed-by: Gert Wollny <gert.wollny@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5966 >
2020-07-29 17:38:58 +00:00
Jason Ekstrand
caab46c1e9
nir: Take a shader and variable mode in nir_assign_io_var_locations
...
Reviewed-by: Gert Wollny <gert.wollny@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5966 >
2020-07-29 17:38:58 +00:00
Jason Ekstrand
964c1c4b87
nir: Take a nir_shader and variable mode in assign_var_locations
...
Reviewed-by: Gert Wollny <gert.wollny@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5966 >
2020-07-29 17:38:58 +00:00
Jason Ekstrand
6f6f7a34c5
nir: Add and use a nir_variable_list_for_mode helper
...
We also add a new list iterator which takes a modes bitfield and
automatically figures out which list to use. In the future, this
iterator will work for multiple modes but today it assumes a single mode
thanks to the behavior of nir_variable_list_for_mode. This also doesn't
work for function_temp variables.
Reviewed-by: Gert Wollny <gert.wollny@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5966 >
2020-07-29 17:38:58 +00:00
Jason Ekstrand
e3e1c50067
nir: Add a nir_foreach_gl_uniform_variable helper for GL linking
...
There are a bunch of cases where we really do want to walk the list that
is nir->uniforms because we want all things declared "uniform" in the
GLSL. Add a helper for this but restrict it to the GL linking code.
Reviewed-by: Gert Wollny <gert.wollny@collabora.com >
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5966 >
2020-07-29 17:38:58 +00:00
Jason Ekstrand
feb32f898c
nir: Add a nir_foreach_uniform_variable helper
...
This one's a bit more complex because it filters off only those
variables with mode == nir_var_uniform. As such, it's not exactly a
drop-in replacement for nir_foreach_variable(var, &nir->uniforms).
Reviewed-by: Gert Wollny <gert.wollny@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5966 >
2020-07-29 17:38:58 +00:00
Jason Ekstrand
92dcda5ce9
nir: Add a nir_foreach_function_temp_variable helper
...
Reviewed-by: Gert Wollny <gert.wollny@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5966 >
2020-07-29 17:38:58 +00:00
Jason Ekstrand
2956d53400
nir: Add nir_foreach_shader_in/out_variable helpers
...
Reviewed-by: Jose Maria Casanova Crespo <jmcasanova@igalia.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5966 >
2020-07-29 17:38:57 +00:00
Jason Ekstrand
9bf8572222
nir/dead_variables: Respect the modes passed to remove_dead_vars
...
For the most part, this doesn't actually matter today. We already only
call remove_dead_vars on the lists that are specified in the modes. The
only functional change here is for the uniform, mem_ubo, and mem_ssbo
modes because they share a list. If nir_remove_dead_variables is called
with a mode of nir_var_uniform, it will no longer remove UBOs or SSBOs,
for instance.
Reviewed-by: Gert Wollny <gert.wollny@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5966 >
2020-07-29 17:38:57 +00:00
Jason Ekstrand
5746af4446
nir: Take a mode in remove_unused_io_vars
...
Reviewed-by: Jose Maria Casanova Crespo <jmcasanova@igalia.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5966 >
2020-07-29 17:38:57 +00:00
Frank Binns
fd91744bd4
docs: change "Fixes:" tag example to match git fixes output
...
The "Fixes:" tag example has the commit title in double quotes, whereas the
suggested git fixes alias, a couple of lines below, also adds some outer
parenthesis.
Although there doesn't appear to be a consistent format for the "Fixes:" tag,
other than it should be a git commit sha followed by the commit title, the
information in the docs should at least be consistent. As the "Fixes:" tag was
inspired by the Linux kernel, which does have parenthesis, update the example to
match the git fixes output.
Signed-off-by: Frank Binns <frank.binns@imgtec.com >
Reviewed-by: Emil Velikov <emil.velikov@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6106 >
2020-07-29 15:25:24 +00:00
Rob Clark
aa89693c02
freedreno/rnn: add schema validation
...
Now that all the schema validation issues are fixed, enable xml
validation according to stylesheet in rnn.
Signed-off-by: Rob Clark <robdclark@chromium.org >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6107 >
2020-07-29 14:30:35 +00:00
Rob Clark
3169b8c645
freedreno/rnn: schema updates for dynamic/irregular offsets
...
Really we want to require one-of offset/offsets/doffsets.
Signed-off-by: Rob Clark <robdclark@chromium.org >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6107 >
2020-07-29 14:30:35 +00:00
Rob Clark
c537947145
freedreno/registers/mdp5: fix validation error
...
Empty enums are not allowed.
Signed-off-by: Rob Clark <robdclark@chromium.org >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6107 >
2020-07-29 14:30:35 +00:00
Rob Clark
0586238036
freedreno/rnn: fix use-group
...
The schema describes the attribute as "ref" rather than "name". Which
makes more sense.
Signed-off-by: Rob Clark <robdclark@chromium.org >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6107 >
2020-07-29 14:30:35 +00:00
Rob Clark
14a7ca577f
freedreno/rnn: allow name to be optional in arrays
...
We are using unnamed arrays to describe repeating portions of a pm4
packet. So allow the name to be optional. Instead of just using
the empty-string hack, drop the attribute.
Signed-off-by: Rob Clark <robdclark@chromium.org >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6107 >
2020-07-29 14:30:35 +00:00
Rob Clark
e801069c1e
freedreno/rnn: add "addvariant" to schema
...
Signed-off-by: Rob Clark <robdclark@chromium.org >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6107 >
2020-07-29 14:30:35 +00:00
Rob Clark
b0e3ef5a25
freedreno/rnn: describe copyright element in schema
...
Signed-off-by: Rob Clark <robdclark@chromium.org >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6107 >
2020-07-29 14:30:35 +00:00
Rob Clark
09a3a2cfe9
freedreno/registers/adreno_pm4: fix validation errors
...
Signed-off-by: Rob Clark <robdclark@chromium.org >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6107 >
2020-07-29 14:30:35 +00:00
Rob Clark
c61ad1f542
freedreno/registers/a4xx: fix validation error
...
Signed-off-by: Rob Clark <robdclark@chromium.org >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6107 >
2020-07-29 14:30:35 +00:00
Rob Clark
17997d5c5a
freedreno/registers/a2xx: fix validation error
...
And bonus whitespace fix.
Signed-off-by: Rob Clark <robdclark@chromium.org >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6107 >
2020-07-29 14:30:35 +00:00
Rob Clark
64f1122168
freedreno/rnn: add variants/varset to domain
...
We have already been using this to describe pm4 packets that are
specific to certain generations.
Maybe we should introduce a new "packet" element type instead. But
first lets just get validation working with what we already use.
Signed-off-by: Rob Clark <robdclark@chromium.org >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6107 >
2020-07-29 14:30:35 +00:00
Rob Clark
7b76e5f3a4
freedreno/rnn: relax Hexadecimal to HexOrNumber
...
We are already using non-hex offsets to describe pm4 packet payloads.
Let's just permit this in the schema, rather than updating all the xml
to use hex.
Signed-off-by: Rob Clark <robdclark@chromium.org >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6107 >
2020-07-29 14:30:35 +00:00
Rob Clark
cb3ed4600e
freedreno/rnn: add radix/align
...
Signed-off-by: Rob Clark <robdclark@chromium.org >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6107 >
2020-07-29 14:30:35 +00:00
Rob Clark
83bc96b555
freedreno/rnn: add high/low/pos to registers
...
This was added recently in rnn, but the schema was not updated.
Signed-off-by: Rob Clark <robdclark@chromium.org >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6107 >
2020-07-29 14:30:35 +00:00
Rob Clark
61ae65a73d
freedreno/rnn: add relaxed boolean type
...
In the schema, boolean means strictly "true" or "false". But rnn
parsing code was looking for "yes"/"1"/"no"/"0". So split the
difference, and add a relaxed boolean type, and update rnn to also
accept "true" or "false".
Signed-off-by: Rob Clark <robdclark@chromium.org >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6107 >
2020-07-29 14:30:35 +00:00
Rob Clark
e3958ef83a
freedreno/rnn: update schema for 'pos'
...
Ideally we'd like to express that *either* 'high' + 'low' OR 'pos' is
required, but it doesn't appear that this is possible. But the rnn
parsing code should still enforce this.
Signed-off-by: Rob Clark <robdclark@chromium.org >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6107 >
2020-07-29 14:30:35 +00:00
Rob Clark
dfe9746be0
freedreno/rnn: rename schema file
...
All of the xml references rules-ng.xsd, not rules-ng-ng.xsd
Signed-off-by: Rob Clark <robdclark@chromium.org >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6107 >
2020-07-29 14:30:35 +00:00
Rob Clark
5a8d19ca14
freedreno/rnn: add error helper
...
Signed-off-by: Rob Clark <robdclark@chromium.org >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6107 >
2020-07-29 14:30:35 +00:00
Rob Clark
3a910839ba
freedreno/rnn: split out helper to find files
...
So we can re-use it to locate the schema file.
Signed-off-by: Rob Clark <robdclark@chromium.org >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6107 >
2020-07-29 14:30:35 +00:00