Commit Graph

131143 Commits

Author SHA1 Message Date
Eric Anholt 433841d9eb freedreno: Fix leak of shader binary on disk cache hits.
It's supposed to be ralloced -- there's not even a shader variant destroy
function for freeing, just ralloc_free() on the ir3_shader_variant or the
parent ir3_shader when you're done!

Fixes: f97acb4bb4 ("freedreno/ir3: disk-cache support")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5810>
2020-11-16 13:54:22 -08:00
Caio Marcelo de Oliveira Filho b3daf341d4 intel/fs: Add assert on the brw_STAGE_prog_data downcasts
Motivation is to detect earlier certain bugs that can occur when
missing a check for the stage before using the downcast.

Reviewed-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7540>
2020-11-16 12:40:59 -09:00
Dave Airlie 671c850310 spirv/cl: add enqueued workgroup size.
Unless the non uniform work group extension is supported, this
just aliases workgroupsize, so just do that for now.

Fixes:
CL CTS basic enqueued_local_size

Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7642>
2020-11-17 05:15:10 +10:00
Dave Airlie 2dd3fde56d clover/image: handle MEM_KERNEL_READ_AND_WRITE flag.
fixes CTS 3.0 test_computeinfo

Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7642>
2020-11-17 05:15:09 +10:00
Dave Airlie c5a33ed8c2 clover: add CL 3.0 event/queue queries
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7642>
2020-11-17 05:15:09 +10:00
Dave Airlie a8bad2b71a clover: add 3.0 program properties
the real IL code will rewrite this

Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7642>
2020-11-17 05:15:09 +10:00
Dave Airlie bd804c074f clover: add device/platform info for CL 3.0
This just adds all the dummy 2.x/3.0 device and platform
info queries that return fixed not supported values.

As these are supported they will have to be migrated into the core.

Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7642>
2020-11-17 05:15:09 +10:00
Dave Airlie 39940ee8d6 clover: add cl 3.0 SVM invalid support
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7642>
2020-11-17 05:15:09 +10:00
Dave Airlie a144dd6917 clover: add all CL 3.0 API with invalid functions
These CL 2.x APIs are all part of CL3.0 but have to return
specific values to show they aren't supported.

Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7642>
2020-11-17 05:15:08 +10:00
Dave Airlie e42a7fa037 clover: add support command queue properties
Fixes api queue_properties_queries

Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7642>
2020-11-17 05:13:25 +10:00
Dave Airlie 0272b6b1ba clover: handle memory object properties properly.
This adds proper support for the buffer/image property APIs.

Fixes:
CL CTS api buffer_properties_queries

v1.1: use a helper for properties parsing.

Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7642>
2020-11-17 05:12:53 +10:00
Christian Gmeiner 6fd20a0281 etnaviv: drop nir_print_shader(..) call
It makes no sense to print the shader in the middle of some NIR passes.
Instead someone could use NIR_PRINT=1 and call it a day. Also there
is a nir_print_shader(..) before calling emit_shader(..).

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Lucas Stach <l.stach@pengutronix.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7625>
2020-11-16 19:38:59 +01:00
Lucas Stach b479a1f03c etnaviv: fix disabling of INT filter for real
Missing a copy of the pipe_sampler_state into the etna_sampler_state object
lead to the texture_use_int_filter() to always see a max_anisotropy of 0, so
the INT filter wasn't disabled when necessary. Also state emission should
never change the state objects, as this might also lead to stale information
being kept around the in the state object.

Fixes: 89a41dae77 (etnaviv: do not use int filter when
                     anisotropic filtering is used)

Cc: <mesa-stable@lists.freedesktop.org>
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7638>
2020-11-16 18:11:56 +00:00
Erik Faye-Lund ad6365f656 docs/features: document d3d12 features
Now that the d3d12 driver has landed, we should document it's features,
like we do with other drivers.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7583>
2020-11-16 18:03:44 +00:00
Rhys Perry 867323379e aco: don't use SMEM for SSBO stores
fossil-db (Navi):
Totals from 70 (0.05% of 138791) affected shaders:
SGPRs: 2324 -> 2097 (-9.77%)
VGPRs: 1344 -> 1480 (+10.12%)
CodeSize: 157872 -> 154836 (-1.92%); split: -1.93%, +0.01%
MaxWaves: 1288 -> 1260 (-2.17%)
Instrs: 29730 -> 29108 (-2.09%); split: -2.13%, +0.04%
Cycles: 394944 -> 391280 (-0.93%); split: -0.94%, +0.01%
VMEM: 5288 -> 5695 (+7.70%); split: +11.97%, -4.27%
SMEM: 2680 -> 2444 (-8.81%); split: +1.34%, -10.15%
VClause: 291 -> 502 (+72.51%)
SClause: 1176 -> 918 (-21.94%)
Copies: 3549 -> 3517 (-0.90%); split: -1.80%, +0.90%
Branches: 1230 -> 1228 (-0.16%)
PreSGPRs: 1675 -> 1491 (-10.99%)
PreVGPRs: 1101 -> 1223 (+11.08%)

Totals from 70 (0.05% of 139517) affected shaders (RAVEN):
SGPRs: 2368 -> 2121 (-10.43%)
VGPRs: 1344 -> 1480 (+10.12%)
CodeSize: 156664 -> 153252 (-2.18%)
MaxWaves: 636 -> 622 (-2.20%)
Instrs: 29968 -> 29226 (-2.48%)
Cycles: 398284 -> 393492 (-1.20%)
VMEM: 5544 -> 5930 (+6.96%); split: +11.72%, -4.76%
SMEM: 2752 -> 2502 (-9.08%); split: +1.20%, -10.28%
VClause: 292 -> 504 (+72.60%)
SClause: 1236 -> 940 (-23.95%)
Copies: 3907 -> 3852 (-1.41%); split: -2.20%, +0.79%
Branches: 1230 -> 1228 (-0.16%)
PreSGPRs: 1671 -> 1487 (-11.01%)
PreVGPRs: 1102 -> 1225 (+11.16%)

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6143>
2020-11-16 15:52:22 +00:00
Erik Faye-Lund 2410def98f mesa/main: add missing include in glformats.h
This header uses uint32_t without including stdint.h. This worked fine
by accident until a new c-source started including it.

Fixes: 1bf539b3a2 ("mesa: Clamp some depth values in glClearBufferfv")
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7637>
2020-11-16 14:01:58 +00:00
Rhys Perry 2736f97496 aco/tests: add output modifier tests
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7605>
2020-11-16 12:58:44 +00:00
Rhys Perry 0c522d3aa7 aco: fix fp16 *0.5 omod
We were testing for -0.5 instead.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Fixes: 1210e0bd62 ("aco: create 16-bit input and output modifiers")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7605>
2020-11-16 12:58:44 +00:00
Rhys Perry 558daa73f9 aco: disable omod if the sign of zeros should be preserved
The RDNA ISA doc says that omod doesn't preserve -0.0 in 6.2.2. LLVM
appears to always disable omod in this situation, but clamp is unaffected.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Fixes: df645fa369 ("aco: implement VK_KHR_shader_float_controls")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7605>
2020-11-16 12:58:44 +00:00
Tomeu Vizoso 5c8fc0b1f4 Revert "ci: Temporarily disable jobs on the Collabora lab"
Lab is back online now.

This reverts commit 902ac3d7c5.

Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7630>
2020-11-16 12:38:36 +00:00
Lionel Landwerlin 3f91f4e2ab nir: don't consider txf_ms_mcs a query instruction
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6172>
2020-11-16 12:13:53 +00:00
Erik Faye-Lund ff3b4f6683 util: fix unknown pragma warning on msvc
MSVC has no idea about these pragmas, and spews warnings about them,
making it hard to spot real problems. So let's only use these macros on
GCC.

Fixes: 2ec290cd92 ("util: Fix/silence variable shadowing warnings")
Reviewed-by: Tony Wasserka <tony.wasserka@gmx.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7633>
2020-11-16 11:09:57 +00:00
Samuel Pitoiset 2f5b3ac2f8 aco: remove v_{add,sub,subrev}_u32 on GFX8
These opcodes are never used and they always write the carry-out
according to the GCN3 ISA documentation.

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/7569>
2020-11-16 10:56:13 +00:00
Jesse Natalie e7f8c195d8 microsoft/compiler: Fix reference to renamed intrinsic getter
Fixes: b9c61379 ("microsoft/compiler: translate nir to dxil")
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7609>
2020-11-16 10:31:49 +00:00
Tony Wasserka 2ec290cd92 util: Fix/silence variable shadowing warnings
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7552>
2020-11-16 08:49:18 +00:00
Tony Wasserka 4e87e7863f glsl: Fix -Wshadow warning
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7552>
2020-11-16 08:49:18 +00:00
Tomeu Vizoso 902ac3d7c5 ci: Temporarily disable jobs on the Collabora lab
There's a maintenance window of 4 hours to improve the lab
infrastructure.

Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7629>
2020-11-16 08:32:10 +01:00
Tapani Pälli 460287adca iris: initialize shared screen->vtbl only once
Screen is shared among contexts, other context might be already using
vtbl while another initializes it again.

 ==45872== Possible data race during write of size 8 at 0x5DDAE78 by thread #549
 ==45872== Locks held: 1, at address 0x5D1B6F8
 ==45872==    at 0x6D66D91: gen9_init_state (iris_state.c:7816)
 ==45872==    by 0x6BA0A31: iris_create_context (iris_context.c:342)
 ==45872==    by 0x621F390: st_api_create_context (st_manager.c:917)
 ==45872==    by 0x620E6F9: dri_create_context (dri_context.c:163)
 ==45872==    by 0x6A40DB1: driCreateContextAttribs (dri_util.c:480)
 ==45872==    by 0x540B963: dri2_create_context (egl_dri2.c:1583)
 ==45872==    by 0x53FB84E: eglCreateContext (eglapi.c:821)
 ==45872==
 ==45872== This conflicts with a previous read of size 8 by thread #544
 ==45872== Locks held: 1, at address 0x5F6E0E0
 ==45872==    at 0x6CB779E: blorp_alloc_binding_table (iris_blorp.c:167)
 ==45872==    by 0x6CAEF70: blorp_emit_surface_states (blorp_genX_exec.h:1540)
 ==45872==    by 0x6CB67F9: blorp_exec (blorp_genX_exec.h:2016)
 ==45872==    by 0x6CB7AFE: iris_blorp_exec (iris_blorp.c:307)
 ==45872==    by 0x70F5916: try_blorp_blit (blorp_blit.c:2145)
 ==45872==    by 0x70F5FCA: do_blorp_blit (blorp_blit.c:2273)
 ==45872==    by 0x70F778F: blorp_copy (blorp_blit.c:2803)
 ==45872==    by 0x6BB9EB6: iris_copy_region (iris_blit.c:725)

v2: move as genX(init_screen_state) (Lionel)

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7544>
2020-11-16 05:53:20 +00:00
Tapani Pälli 959c2d1edb egl/dri2: fix race between image create and egl_image_target_texture
All other functions calling _eglLookupImage hold the display lock.

 ==16659== Possible data race during write of size 8 at 0x5D1BCF0 by thread #2668
 ==16659== Locks held: 1, at address 0x5D1B6F8
 ==16659==    at 0x5405DDF: _eglLinkResource (egldisplay.c:454)
 ==16659==    by 0x53F9189: _eglLinkImage (eglimage.h:138)
 ==16659==    by 0x53FE2CA: _eglCreateImageCommon (eglapi.c:1740)
 ==16659==    by 0x53FE39A: eglCreateImageKHR (eglapi.c:1751)
 ==16659==
 ==16659== This conflicts with a previous read of size 8 by thread #2664
 ==16659== Locks held: 1, at address 0x5308D00
 ==16659==    at 0x5405C06: _eglCheckResource (egldisplay.c:387)
 ==16659==    by 0x5408C92: _eglLookupImage (eglimage.h:162)
 ==16659==    by 0x5409E96: dri2_lookup_egl_image (egl_dri2.c:688)
 ==16659==    by 0x6210AAF: dri2_lookup_egl_image (dri_helpers.c:250)
 ==16659==    by 0x6212843: dri_get_egl_image (dri_screen.c:470)
 ==16659==    by 0x625F7CC: st_get_egl_image (st_cb_eglimage.c:152)
 ==16659==    by 0x625FE7D: st_egl_image_target_texture_2d (st_cb_eglimage.c:354)
 ==16659==    by 0x6501C05: egl_image_target_texture (teximage.c:3446)

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7544>
2020-11-16 05:53:20 +00:00
Erico Nunes da9fbbac42 lima: define set_clip_state implementation
In applications using clip planes, set_clip_state is expected to be
implemented in the backend. If it is not defined, it may cause the
application to segfault.

glClipPlane it is not part of GLES 2, so it is not trivial to reverse
engineer if something needs to be done in lima.
Other drivers just define a placeholder implementation for
set_clip_state, so for now let's just define one for lima too.

Signed-off-by: Erico Nunes <nunes.erico@gmail.com>
Reviewed-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7088>
2020-11-15 21:14:01 +00:00
Dave Airlie f586a8efb7 gallivm: fix float atomic exchange.
for atomic exchange floats are valid.

Fixes CL CTS test_atomic fails

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7595>
2020-11-16 06:53:20 +10:00
Dave Airlie 0a6f5ebe28 gallivm: lower vector compares
This lowers the any/all stuff.

Fixes unknown opcode in
./relationals/test_relationals

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7595>
2020-11-16 06:53:16 +10:00
Dave Airlie 3502bf47b2 gallivm/nir: lower dot products.
The nir lowering should suffice

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7595>
2020-11-16 06:53:12 +10:00
Dave Airlie 2a3fd242b0 gallivm/nir: add fsum support
This is needed for lowered dot products, this opcode just
sums all the vector elements.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7595>
2020-11-16 06:53:09 +10:00
Dave Airlie 53064ce6b5 gallivm: add float to 8/16 int
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7595>
2020-11-16 06:52:59 +10:00
Dave Airlie ce07c52b82 draw: fix tess eval pipeline statistics.
The number of invocations wasn't getting incremented correctly.

Fixes: 202bc38ce9 ("draw: collect tessellation invocations statistics")
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7597>
2020-11-16 06:29:17 +10:00
Samuel Pitoiset 6925c031e0 ci: update the list of expected failures for RADV
Against vulkan-cts-1.2.4.1.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Acked-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7626>
2020-11-15 16:49:47 +00:00
Samuel Pitoiset 2ad0142db2 ci: update the list of skipped tests for RAVEN
The list of default skipped tests should also be included.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Acked-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7626>
2020-11-15 16:49:47 +00:00
Bas Nieuwenhuizen a4dc4ece63 radv: Use internal drm_fourcc.h
Fixes: 0833dd7d12 "amd/common: Add support for modifiers."
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3794
̀Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7619>
2020-11-15 15:30:43 +00:00
Christian Gmeiner 9b6516ac24 etnaviv: nir: do not run opt loop after nir_lower_bool_xxx(..)
Running the optimizations after bool to float/int lowering is not going
to work. Large portions of NIR are likely to blow up if they see
floats/ints in weird places. Most of the bool->float/int conversions
are direct instruction substitutions and it's not going to leave a lot
of garbage around to optimize.

Fixes nir.h:261: nir_const_value_as_bool: Assertion `i == 0 || i == -1' failed
dEQP-GLES2.functional.shaders.loops.while_constant_iterations.no_iterations_vertex

Here are shader-db results for GC2000:

instructions HURT:   shaders/tesseract/488.shader_test FRAG:           516 -> 524 (1.55%)
instructions HURT:   shaders/tesseract/491.shader_test FRAG:           248 -> 260 (4.84%)
instructions HURT:   shaders/tesseract/494.shader_test FRAG:           244 -> 256 (4.92%)
instructions HURT:   shaders/tesseract/238.shader_test FRAG:           232 -> 244 (5.17%)
instructions HURT:   shaders/tesseract/241.shader_test FRAG:           232 -> 244 (5.17%)
instructions HURT:   shaders/tesseract/127.shader_test FRAG:           76 -> 80 (5.26%)
instructions HURT:   shaders/tesseract/130.shader_test FRAG:           148 -> 156 (5.41%)
instructions HURT:   shaders/tesseract/226.shader_test FRAG:           192 -> 204 (6.25%)
instructions HURT:   shaders/tesseract/229.shader_test FRAG:           192 -> 204 (6.25%)
instructions HURT:   shaders/tesseract/217.shader_test FRAG:           152 -> 164 (7.89%)
instructions HURT:   shaders/tesseract/214.shader_test FRAG:           152 -> 164 (7.89%)
instructions HURT:   shaders/tesseract/205.shader_test FRAG:           112 -> 124 (10.71%)
instructions HURT:   shaders/tesseract/202.shader_test FRAG:           112 -> 124 (10.71%)
instructions HURT:   shaders/tesseract/169.shader_test FRAG:           32 -> 36 (12.50%)
instructions HURT:   shaders/tesseract/166.shader_test FRAG:           32 -> 36 (12.50%)
instructions HURT:   shaders/deqp_gles3/61312.shader_test FRAG:        448 -> 508 (13.39%)
instructions HURT:   shaders/deqp_gles3/61309.shader_test FRAG:        448 -> 508 (13.39%)
instructions HURT:   shaders/deqp_gles3/61324.shader_test FRAG:        448 -> 508 (13.39%)
instructions HURT:   shaders/tesseract/118.shader_test FRAG:           28 -> 32 (14.29%)
instructions HURT:   shaders/tesseract/181.shader_test FRAG:           52 -> 60 (15.38%)
instructions HURT:   shaders/tesseract/178.shader_test FRAG:           52 -> 60 (15.38%)
instructions HURT:   shaders/tesseract/121.shader_test FRAG:           52 -> 60 (15.38%)
instructions HURT:   shaders/tesseract/193.shader_test FRAG:           72 -> 84 (16.67%)
instructions HURT:   shaders/tesseract/190.shader_test FRAG:           72 -> 84 (16.67%)

total instructions in shared programs: 64220 -> 64572 (0.55%)
instructions in affected programs: 4924 -> 5276 (7.15%)
helped: 5
HURT: 24
helped stats (abs) min: 4 max: 8 x̄: 5.60 x̃: 4
helped stats (rel) min: 4.35% max: 5.41% x̄: 4.72% x̃: 4.35%
HURT stats (abs)   min: 4 max: 60 x̄: 15.83 x̃: 12
HURT stats (rel)   min: 1.55% max: 16.67% x̄: 10.04% x̃: 10.71%
95% mean confidence interval for instructions value: 5.39 18.89
95% mean confidence interval for instructions %-change: 4.81% 10.18%
Instructions are HURT.

total temps in shared programs: 2514 -> 2512 (-0.08%)
temps in affected programs: 9 -> 7 (-22.22%)
helped: 2
HURT: 0

Cc: <mesa-stable@lists.freedesktop.org>
Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Lucas Stach <l.stach@pengutronix.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7624>
2020-11-15 13:14:15 +00:00
Alejandro Piñeiro 035e21e780 v3dv/pipeline: take into account precision for the output_type
By default we are using 32bit output type for texture operations,
16bit for shadow.

With this commit we also use the precision info from the sampler (that
is assigned if SPIR-V uses RelaxedPrecision decorator), in order to
use 16bit.

This is a first step as only take into account the precision of the
deref_vars used on the texture operation.

But the decoration can be also applied to other cases, like the result
of the operation. That means that there are ways to infer that the
texture operation can operate at relaxed precision. Those cases would
be handled on following patches.

v2:
    * Add directly the return_size on the descriptor_map, instead of
      shadow/relaxed_precision.
    * Check relaxed precision for images too (Iago)
    * Handle the return size for the default sampler

v3:
    * Handle different output size for the case of not having a sampler.
    * Comment fixes (Iago)

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7545>
2020-11-14 15:59:02 +00:00
Alejandro Piñeiro 7da854e186 v3dv: remove combined_idx support
Now that the v3d compiler has support for separated texture and
sampler indices, we can stop to combine them. Again, that's what
Vulkan allows after all.

As we are doing this we can't use anymore the texture format (coming
from the texture) to chose the return size (that is a sampling
parameter). We default for 32, and just go to 16 for shadow. We plan
to use SPIR-V RelaxedPrecision to use in more cases 16 bit. We would
do that on following patches.

v2 (from Iago feedback):
   * Fix typos/bad grammar on comments.
   * Move tex/sampler number assert to before the loop that fills
     tex/sampler info.

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7545>
2020-11-14 15:59:02 +00:00
Alejandro Piñeiro 429c336412 broadcom/compiler: separate texture/sampler info from v3d_key
So far the v3d compiler has them combined, as for OpenGL both are the
same. This change is intended to fit the v3d compiler better with
Vulkan, where they are separate concepts.

Note that NIR has them separate for a long time, both on nir_variable
and on some NIR lowerings.

v2: (from Iago feedback)
    * Use key->num_tex/sampler_used to iterate through the array
    * Fill up num_samplers_used on v3d, assert that is the same that
      num_tex_used if possible.

v3: (Iago)
    * Assert num_tex/samplers_used is smaller that tex/sampler array size.

v4: Update assert mentioned on v3 to use <= instead of < (detected by CI)

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>

squash! broadcom/compiler: separate texture/sampler info from v3d_key

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7545>
2020-11-14 15:59:02 +00:00
Alejandro Piñeiro 1fe52af61a v3dv: cleanup/remove support for pre-generated variants
In preparation to the changes that would allow to not need them.

It is worth to note that it is likely (we have some ideas in mind)
that we would need to bring back pre-generate variants on the
future. The approach is slightly different on v3dv_pipeline vs
v3dv_cmd_buffer:

  * v3dv_pipeline: even after the clean-up, we had code for all the
    functions they have, even if they were doing less things
    (specifically, a second shader variant), so they still make sense
    on their own, and serve as template for adding support of multiple
    pre-generated shader variants in the future.

  * v3dv_cmd_buffer: as we really don't need to fill up the key with
    some after-pipeline data, we would end with some functions empty
    (specifically cmd_buffer_populate_v3d_key). Even as a placeholder,
    that would be odd. Additionally the current code has a lot of
    boilerplate code (functions to fill up vs, cs and fs keys are
    basically the same), and we already have in mind refactor them. So
    it would be better to remove all of them, instead of keeping
    around some code we would not be happy with. If in the future we
    pregenerate more that one variant, hopefully the new code to chose
    between them would be better.

v2: clarify the commit message, and fix typos on the comments (Iago)

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7545>
2020-11-14 15:59:02 +00:00
Alejandro Piñeiro 5169dfd1fd nir/lower_tex: clarify nir_lower_tex_options indexing
This doesn't matter too much on OpenGL as texture id and sampler id
are the same, but become relevant if using the lowering for Vulkan.

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7545>
2020-11-14 15:59:02 +00:00
Bas Nieuwenhuizen f7b122728d drm/uapi: Fix modifier field mask for AMD modifiers.
The DCC_MAX_COMPRESSED_BLOCK has to contain one of
AMD_FMT_MOD_DCC_BLOCK_* and with 3 values this doesn't
fit in 1 bit.

Fix this cleanly while it is only in drm-next.

Fixes: 2cc2b45688 "drm-uapi: Add AMD modifiers."
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7607>
2020-11-14 12:38:51 +00:00
Vinson Lee f0c8645cb9 v3dv: Remove unsigned comparison to zero.
index is of type uint32_t.

Fix defects reported by Coverity Scan.

Macro compares unsigned to 0 (NO_EFFECT)
unsigned_compare: This greater-than-or-equal-to-zero comparison of
an unsigned value is always true. index >= 0U.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7518>
2020-11-13 16:54:09 -08:00
Vinson Lee 3fe5c13d71 vdpau: Add missing printf format specifier.
Fix defect reported by Coverity Scan.

Extra argument to printf format specifier (PRINTF_ARGS)
extra_argument: This argument was not used by the format string: vmixer->max_layers.

Fixes: 89b9863252 ("vdpau: Add support for parameters")
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Leo Liu <leo.liu@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7200>
2020-11-13 15:34:58 -08:00
Vinson Lee 5adba503dd nvir/gm107: Initialize SchedDataCalculatorGM107 member score.
Fix defect reported by Coverity Scan.

Uninitialized pointer field (UNINIT_CTOR)
uninit_member: Non-static class member score is not initialized in
this constructor nor in any functions that it calls.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7324>
2020-11-13 23:27:12 +00:00
Rob Clark 4b65c09d86 freedreno/ir3: Fix crash in shader compile fail path
Fixes: 74140c2e85 ("freedreno/ir3: convert over to ralloc")
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7612>
2020-11-13 22:44:04 +00:00