Jason Ekstrand
830654b7b0
glsl/nir: Set uses_sample_shading from glsl_to_nir
...
We don't really want to base this on a late nir_gather_info for two
reasons:
1) The GL spec says that any static use of a sample-qualified input,
gl_SampleID, or gl_SamplePosition causes per-sample dispatch. This
means we really should gather this information before dead-code has
a chance to delete anything.
2) We want to be able to add nir_intrinsic_load_sample_pos intrinsics
as part of lowering passes without causing per-sample interpolation.
This means nir_gather_info needs to stop gathering it.
For 1, this doesn't actually get us quite there as GLSL IR may have
deleted something already. However, it does get us closer.
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com >
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14020 >
2022-07-13 20:28:42 +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
Timothy Arceri
d09a37ef54
glsl: remove never true do_dead_code() parameter
...
Since we have now switched all drivers to using NIR and therefore
the NIR based uniform linker this param never needs to be set to
true so remove it.
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16924 >
2022-06-08 22:58:50 +00:00
Emma Anholt
0fbd1b1f4c
glsl: Move exp/log-to-exp2/log2 lowering to glsl-to-NIR.
...
It's way more concise to write as nir_builder calls.
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com >
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com >
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16823 >
2022-06-07 02:38:42 +00:00
Ian Romanick
bd665fdd7f
nir: Use nir_vector_extract to generate code for ir_binop_vector_extract
...
Tiger Lake and Ice Lake had similar results. (Ice Lake shown)
total cycles in shared programs: 861153442 -> 861153533 (<.01%)
cycles in affected programs: 14748 -> 14839 (0.62%)
helped: 5
HURT: 10
helped stats (abs) min: 1 max: 2 x̄: 1.80 x̃: 2
helped stats (rel) min: 0.09% max: 0.18% x̄: 0.16% x̃: 0.17%
HURT stats (abs) min: 2 max: 18 x̄: 10.00 x̃: 10
HURT stats (rel) min: 0.17% max: 1.54% x̄: 1.06% x̃: 1.24%
95% mean confidence interval for cycles value: 1.15 10.99
95% mean confidence interval for cycles %-change: 0.25% 1.07%
Cycles are HURT.
Skylake and Broadwell had similar results. (Skylake shown)
total cycles in shared programs: 844405063 -> 844405073 (<.01%)
cycles in affected programs: 1710 -> 1720 (0.58%)
helped: 0
HURT: 4
HURT stats (abs) min: 2 max: 4 x̄: 2.50 x̃: 2
HURT stats (rel) min: 0.35% max: 1.16% x̄: 0.88% x̃: 1.00%
95% mean confidence interval for cycles value: 0.91 4.09
95% mean confidence interval for cycles %-change: 0.30% 1.45%
Cycles are HURT.
Haswell and all earlier Intel GPUs had similar results. (Haswell shown)
total instructions in shared programs: 16710016 -> 16709769 (<.01%)
instructions in affected programs: 5842 -> 5595 (-4.23%)
helped: 64
HURT: 0
helped stats (abs) min: 3 max: 4 x̄: 3.86 x̃: 4
helped stats (rel) min: 3.36% max: 7.69% x̄: 4.52% x̃: 4.17%
95% mean confidence interval for instructions value: -3.95 -3.77
95% mean confidence interval for instructions %-change: -4.83% -4.22%
Instructions are helped.
total cycles in shared programs: 881088472 -> 881086722 (<.01%)
cycles in affected programs: 68696 -> 66946 (-2.55%)
helped: 58
HURT: 6
helped stats (abs) min: 10 max: 202 x̄: 36.41 x̃: 18
helped stats (rel) min: 0.81% max: 16.42% x̄: 4.15% x̃: 1.51%
HURT stats (abs) min: 2 max: 88 x̄: 60.33 x̃: 68
HURT stats (rel) min: 0.17% max: 7.06% x̄: 4.94% x̃: 5.60%
95% mean confidence interval for cycles value: -42.14 -12.54
95% mean confidence interval for cycles %-change: -4.66% -1.94%
Cycles are helped.
No fossil-db changes on any Intel platform.
Reviewed-by: Matt Turner <mattst88@gmail.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16440 >
2022-05-16 16:06:01 +00:00
Timothy Arceri
7647023f3b
glsl: enable the use of the nir based varying linker
...
Here as well as calling the pass we need to switch the order of
some of the information gathering and optimisation calls. We also
need to create a custom callback for the dead variables removal
pass to clean up dead builtin varying in SSO programs without
causing piglit regressions.
shader-db results IRIS (BDW):
total instructions in shared programs: 17487900 -> 17477072 (-0.06%)
instructions in affected programs: 128682 -> 117854 (-8.41%)
helped: 587
HURT: 82
helped stats (abs) min: 1 max: 145 x̄: 18.82 x̃: 20
helped stats (rel) min: 0.21% max: 77.78% x̄: 17.41% x̃: 8.85%
HURT stats (abs) min: 1 max: 6 x̄: 2.68 x̃: 2
HURT stats (rel) min: 0.25% max: 9.76% x̄: 2.94% x̃: 2.16%
95% mean confidence interval for instructions value: -17.71 -14.66
95% mean confidence interval for instructions %-change: -16.40% -13.42%
Instructions are helped.
total cycles in shared programs: 857442520 -> 857170199 (-0.03%)
cycles in affected programs: 112252720 -> 111980399 (-0.24%)
helped: 13733
HURT: 13349
helped stats (abs) min: 1 max: 7293 x̄: 81.44 x̃: 10
helped stats (rel) min: <.01% max: 90.32% x̄: 3.30% x̃: 0.62%
HURT stats (abs) min: 1 max: 7424 x̄: 63.38 x̃: 8
HURT stats (rel) min: <.01% max: 192.23% x̄: 3.28% x̃: 0.54%
95% mean confidence interval for cycles value: -14.01 -6.10
95% mean confidence interval for cycles %-change: -0.17% 0.06%
Inconclusive result (%-change mean confidence interval includes 0).
total sends in shared programs: 971443 -> 970010 (-0.15%)
sends in affected programs: 4596 -> 3163 (-31.18%)
helped: 446
HURT: 39
helped stats (abs) min: 1 max: 6 x̄: 3.40 x̃: 4
helped stats (rel) min: 3.03% max: 85.71% x̄: 46.48% x̃: 50.00%
HURT stats (abs) min: 1 max: 3 x̄: 2.15 x̃: 2
HURT stats (rel) min: 6.67% max: 25.00% x̄: 15.16% x̃: 10.53%
95% mean confidence interval for sends value: -3.13 -2.78
95% mean confidence interval for sends %-change: -44.16% -38.88%
Sends are helped.
LOST: 235
GAINED: 262
Shader-db results radeonsi (RX580):
169505 shaders in 102144 tests
Totals:
SGPRS: 7698832 -> 7696552 (-0.03 %)
VGPRS: 5547296 -> 5545280 (-0.04 %)
Spilled SGPRs: 14795 -> 14773 (-0.15 %)
Spilled VGPRs: 3782 -> 3782 (0.00 %)
Private memory VGPRs: 1152 -> 1152 (0.00 %)
Scratch size: 3872 -> 3872 (0.00 %) dwords per thread
Code Size: 162946528 -> 162895264 (-0.03 %) bytes
Max Waves: 2449334 -> 2449736 (0.02 %)
Totals from affected shaders:
SGPRS: 215024 -> 212744 (-1.06 %)
VGPRS: 151976 -> 149960 (-1.33 %)
Spilled SGPRs: 162 -> 140 (-13.58 %)
Spilled VGPRs: 0 -> 0 (0.00 %)
Private memory VGPRs: 0 -> 0 (0.00 %)
Scratch size: 0 -> 0 (0.00 %) dwords per thread
Code Size: 5249916 -> 5198652 (-0.98 %) bytes
Max Waves: 54588 -> 54990 (0.74 %)
Panfrost trace checksum is updated as per discussion in:
https://gitlab.freedesktop.org/mesa/mesa/-/issues/6343
Some virpipe tess shader piglit tests are added as failures to CI
these failures are not a regression but an uncovered existing bug
exposed due to the linker no longer sorting internally facing
shader interfaces in alphabetical order. See details in:
https://gitlab.freedesktop.org/mesa/mesa/-/issues/6481
Acked-by: Marek Olšák <marek.olsak@amd.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15731 >
2022-05-16 03:33:18 +00:00
Timothy Arceri
cba2fd51a2
nir: add variable data fields required for NIR glsl varying linking
...
These will be used in the following patches that add a NIR based
varying linker.
Reviewed-by: Marek Olšák <marek.olsak@amd.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15731 >
2022-05-16 03:33:18 +00:00
Emma Anholt
695587413b
nir: Don't assert on tg4 offset range.
...
From the GL 4.6 spec: "If the value of any non-ignored component of the
offset vector operand is outside implementation-dependent limits, the
results of the texture lookup are undefined." We shouldn't assertion
fail, then.
GLSL-to-NIR shouldn't be enforcing limits on TG4 offsets, since it doesn't
for non-TG4 tex_src_offset either. Leave it up to the driver to handle
it.
Fixes a crash in a piglit test on nouveau that supplies a negative random
number up to 10,000 as the first coordinate for some reason. Other NIR
drivers lowered TG4 explicit offsets to tex_src_offset, so they weren't
affected.
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16261 >
2022-05-03 21:45:49 +00:00
Mike Blumenkrantz
a6a4bf0f1e
glsl/nir: set new_style_shadow for sparse tex ops as necessary
...
this needs the sparse result type, which is not the ir type
Fixes: f4a972b748
("glsl/nir: convert sparse ir_texture to nir")
Reviewed-by: Marek Olšák <marek.olsak@amd.com >
Reviewed-by: Qiang Yu <yuq825@gmail.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16097 >
2022-04-24 15:56:05 +00:00
Timothy Arceri
6eec8fcbfa
glsl/nir: free GLSL IR right after we convert to NIR
...
Gives us memory back faster which is useful for pathalogical CTS
tests.
The GLSL IR was previously used after converting to NIR for things
like building the GL resource list but we have had a NIR version
for this for some time and I don't believe there are any other
use cases left for keeping the old IR hanging around this long.
Reviewed-by: Emma Anholt <emma@anholt.net >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15127 >
2022-02-24 01:10:49 +00:00
Ian Romanick
59889eb3ae
Re-indentation after the previous commit
...
Reviewed-by: Matt Turner <mattst88@gmail.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14573 >
2022-02-11 17:25:34 +00:00
Ian Romanick
912299cb39
glsl: Eliminate ir_assignment::condition
...
Reformatting is left for the next commit.
v2: Remove assignments from the contructors. :face_palm:
Reviewed-by: Matt Turner <mattst88@gmail.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14573 >
2022-02-11 17:25:33 +00:00
Ian Romanick
fb630cd783
glsl: Make ir_assignment::condition private
...
And add get_condition().
This proof that nothing remains that could possibly set ::condition to
anything other than NULL.
v2: Fix bad rebase.
Reviewed-by: Matt Turner <mattst88@gmail.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14573 >
2022-02-11 17:25:33 +00:00
Qiang Yu
95d3617909
glsl/nir: convert ir_texture->clamp to nir
...
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/14488 >
2022-02-01 10:28:05 +00:00
Dave Airlie
7b7f627600
glsl/fp64: move context.h dependent checks into main.
...
allows dropping context.h include.
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
Qiang Yu
7d4b0b7789
glsl/nir: convert is_sparse_texels_resident to nir
...
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/14362 >
2022-01-18 16:10:36 +08:00
Qiang Yu
a0b6515ec4
glsl/nir: adjust sparse texture nir_variable
...
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/14362 >
2022-01-18 16:10:36 +08:00
Qiang Yu
3dc950118c
glsl/nir: convert sparse image load to nir
...
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/14362 >
2022-01-18 16:10:36 +08:00
Qiang Yu
f4a972b748
glsl/nir: convert sparse ir_texture to nir
...
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/14362 >
2022-01-18 16:10:35 +08:00
Dave Airlie
f7bb68e499
glsl/nir: don't pass gl_context to the convertor routine.
...
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14433 >
2022-01-07 06:19:49 +00:00
Ian Romanick
04f5c543de
glsl/nir: Don't build soft float64 when it cannot be used
...
Fixes: 82d9a37a59
("glsl/nir: Add a shared helper for building float64 shaders")
Closes : #5556
Reviewed-by: Matt Turner <mattst88@gmail.com >
Reviewed-by: Tapani Pälli <tapani.palli@intel.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13828 >
2021-11-17 12:23:29 -08:00
Jason Ekstrand
b62b2fa4b9
compiler/types: Add a wrap_in_arrays helper
...
This has been copied+pasted 3 times now.
Reviewed-by: Jesse Natalie <jenatali@microsoft.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13389 >
2021-10-16 05:49:34 +00:00
Jason Ekstrand
956199e870
nir: s/nir_var_mem_image/nir_var_image/g
...
We typically use nir_var_mem_* for stuff that has an explicit byte-based
memory layout. Images are opaque.
Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13386 >
2021-10-16 03:47:10 +00:00
Jason Ekstrand
b8ee37472d
glsl: Use nir_var_mem_image for images
...
We don't use it for bindless images because the uniforms in that case
just contain a bindless handle and aren't an actual image. Bound
images, on the other hand, go in the nir_var_mem_image class.
Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4743 >
2021-10-15 14:58:56 +00:00
Emma Anholt
aed4c0b5a9
nir: Drop the unused instr arg for src/dest copy functions.
...
Now that we don't use ralloc, we don't need this arg to get at the right
ralloc ctx.
Reviewed-by: Matt Turner <mattst88@gmail.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11776 >
2021-09-14 17:53:06 +00:00
Emma Anholt
91dc863921
mesa: Move the advanced blend bitmask to shader_info.
...
For drivers that don't lower advanced blend to FBFETCH, we need the
bitmask to be in the NIR shader so that it gets carried over to TGSI
successfully.
Reviewed-by: Rob Clark <robdclark@chromium.org >
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12813 >
2021-09-13 18:36:58 +00:00
Rhys Perry
cfc4433015
nir,glsl_to_nir: use nir_fdot()
...
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com >
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8056 >
2021-08-16 17:19:45 +00:00
Jason Ekstrand
c0afb60258
nir: Set IMAGE_DIM and IMAGE_ARRAY on deref intrinsics
...
The rules here are the same as for texture instructions. The bits on
the intrinsic are the ground truth and are allowed to vary from the
deref a bit as-needed.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11849 >
2021-07-20 23:18:22 +00:00
Jason Ekstrand
ea7fcd5a97
glsl/nir: Use nir_ssa_undef() from nir_builder
...
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11849 >
2021-07-20 23:18:22 +00:00
Michel Dänzer
2928c21eb7
Convert most remaining free-form fall-through comments to FALLTHROUGH
...
One exception is src/amd/addrlib/, for which -Wimplicit-fallthrough is
explicitly disabled.
Reviewed-by: Eric Anholt <eric@anholt.net >
Reviewed-by: Alyssa Rosenzweig <alyssa@collabora.com >
Reviewed-by: Juan A. Suarez <jasuarez@igalia.com >
Reviewed-by: Gert Wollny <gert.wollny@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10220 >
2021-04-15 16:01:22 +00:00
Connor Abbott
d5e54c6edb
glsl/nir: Use sized types for nir_tex_instr::dest_type
...
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7989 >
2021-01-25 11:21:53 +01:00
Marek Olšák
1755a5a384
compiler: decrease STATE_LENGTH from 5 to 4
...
The rework of matrix state vars made the last element unused.
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6946 >
2020-12-01 11:52:11 +00:00
Rhys Perry
ddb81f5da3
glsl_to_nir: use intrinsic builders
...
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com >
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6587 >
2020-11-26 17:50:38 +00:00
Jason Ekstrand
3cc58e6470
nir: Add and use some deref mode helpers
...
NIR derefs currently have exactly one variable mode. This is about to
change so we can handle OpenCL generic pointers. In order to transition
safely, we need to audit every deref->mode check. This commit adds a
set of helpers that provide more nuanced mode checks and converts most
of NIR to use them.
For simple cases, we add nir_deref_mode_is and nir_deref_mode_is_one_of
helpers. These can be used in passes which don't have to bother with
generic pointers and just want to know what mode a thing is. If the
pass ever encounters generic pointers in a way that this check would be
unsafe, it will assert-fail to alert developers that they need to think
harder about things and fix the pass.
For more complex passes which require a more nuanced understanding of
modes, we add nir_deref_mode_may_be and nir_deref_mode_must_be helpers
which accurately describe the compiler's best knowledge about the given
deref. Unfortunately, we may not be able to exactly identify the mode
in a generic pointers scenario so we have to be very careful when we use
these. Conversion of these passes is left to later commits.
For the case of mass lowering of a particular mode (nir_lower_explicit_io
is one good example), we add nir_deref_mode_is_in_set. This is also
pretty assert-happy like nir_deref_mode_is but is for a set containment
comparison on deref modes where you expect the deref to either be all-in
or all-out.
Reviewed-by: Jesse Natalie <jenatali@microsoft.com >
Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6332 >
2020-11-03 22:18:28 +00:00
Jason Ekstrand
3f0a29fffb
nir/builder: Add a nir_ieq_imm helper
...
This shows up surprisingly often.
Reviewed-by: Jesse Natalie <jenatali@microsoft.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6332 >
2020-11-03 22:18:28 +00:00
Jason Ekstrand
0aa08ae2f6
nir: Split NIR_INTRINSIC_TYPE into separate src/dest indices
...
We're about to introduce conversion ops which are going to want two
different types. We may as well just split the one we have rather than
end up with three. There are a couple places where this is mildly
inconvenient but most of the time I find it to actually be nicer.
Reviewed-by: Jesse Natalie <jenatali@microsoft.com >
Reviewed-by: Daniel Stone <daniels@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6945 >
2020-10-01 18:36:53 +00:00
Indrajit Kumar Das
40c1f9883e
mesa,glsl: add support for GL_NV_shader_atomic_int64
...
Reviewed-by: Marek Olšák <marek.olsak@amd.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6708 >
2020-09-29 14:24:44 +00:00
Jason Ekstrand
9750164c09
nir: Rename get_buffer_size to get_ssbo_size
...
This makes it explicit that this intrinsic is only for SSBOs. For the
v3dv driver, we'll be adding a get_ubo_size intrinsic and we want to be
able to distinguish between the two.
Reviewed-by: Marek Olšák <marek.olsak@amd.com >
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com >
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6812 >
2020-09-22 13:34:12 +00:00
Marek Olšák
3d3df8dbff
nir: remove redundant opcode u2ump
...
Reviewed-by: Rob Clark <robdclark@chromium.org >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6283 >
2020-09-10 23:35:13 +00:00
Marek Olšák
4b7f93b407
glsl_to_nir: fix crashes with int16 shifts
...
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6613 >
2020-09-06 06:35:31 -04:00
Karol Herbst
24dfd798d6
nir: use nir_var_all to get rid of casting
...
Signed-off-by: Karol Herbst <kherbst@redhat.com >
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6520 >
2020-09-01 17:45:08 +00:00
Jesse Natalie
ce6f66242a
nir/vtn: Add type constant to image intrinsics
...
Since OpenCL supports untyped images, backends might need type info
to be able to support the load/store ops.
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5242 >
2020-08-31 21:17:38 +00:00
Karol Herbst
e5899c1e88
nir: rename nir_op_fne to nir_op_fneu
...
It was always fneu but naming it fne causes confusion from time to time. So
lets rename it. Later we also want to add other unordered and fne, this is
a smaller preparation for that.
Signed-off-by: Karol Herbst <kherbst@redhat.com >
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl >
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com >
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net >
Reviewed-by: Connor Abbott <cwabbott0@gmail.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6377 >
2020-08-21 17:26:21 +00:00
Jason Ekstrand
1ccd681109
nir: Add an LOD parameter to image_*_size
...
The OpenCL image_width/height/depth functions have variants which can
take an LOD parameter. More importantly, LLVM-SPIRV-Translator always
generates OpImageQuerySizeLod even if the LOD is guaranteed to be zero.
Given that over half the hardware out there has an LOD field for image
size queries (based on a rudimentary scan through their NIR -> whatever
code), we may as well just add the source to the NIR intrinsic. If this
is ever a problem for anyone, the lowering is pretty trivial.
I've also added asserts to everyone's drivers that should alert them if
they ever see an LOD other than zero. This will never happen with GL or
Vulkan so there's no need for panic.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6396 >
2020-08-20 20:48:10 +00:00
Rob Clark
5e922fbc16
glsl_to_nir: fix bitfield_extract with 16-bit operands
...
These are defined to explicitly take 32b values.
Reviewed-by: Marek Olšák <marek.olsak@amd.com >
Reviewed-by: Rob Clark <robdclark@chromium.org >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6073 >
2020-08-05 22:04:47 +00:00
Rob Clark
34499de5b3
glsl_to_nir: fix vote_any/vote_all
...
Signed-off-by: Rob Clark <robdclark@chromium.org >
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5505 >
2020-06-18 03:40:54 +00:00
Rob Clark
c9976f5e4a
glsl_to_nir: fix shader_clock
...
Signed-off-by: Rob Clark <robdclark@chromium.org >
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5505 >
2020-06-18 03:40:54 +00:00
Rob Clark
8505e6757b
glsl_to_nir: fix is_helper_invocation
...
Reported-by: Karol Herbst <kherbst@redhat.com >
Signed-off-by: Rob Clark <robdclark@chromium.org >
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5505 >
2020-06-18 03:40:54 +00:00
Danylo Piliaiev
9f1cf0e491
glsl: inline functions with unsupported return type before converting to nir
...
glsl_to_nir doesn't expect non-vector/scalar return types in functions.
Fixes: 7e60d5a501
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3058
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3060
Signed-off-by: Danylo Piliaiev <danylo.piliaiev@globallogic.com >
Tested-by: Witold Baryluk <witold.baryluk@gmail.com >
Reviewed-by: Witold Baryluk <witold.baryluk@gmail.com >
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5333 >
2020-06-08 15:01:50 +00:00
Marek Olšák
a052a9c277
glsl: handle int16 and uint16 types and add instructions for mediump
...
v2: add more changes to ir_validate.cpp
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com >
Reviewed-by: Rob Clark <robdclark@chromium.org >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5002 >
2020-06-02 20:01:18 +00:00