aboutsummaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* aco: use 32-bit inline constants for 16-bit integer instructionsRhys Perry2020-06-151-7/+13
| | | | | | | | See https://reviews.llvm.org/D81841 Signed-off-by: Rhys Perry <[email protected]> Reviewed-by: Daniel Schürmann <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5245>
* aco: fix half_pi constant for 16-bit fsin/fcosRhys Perry2020-06-151-1/+2
| | | | | | | | | | This worked because the optimizer didn't consider that the 16-bit instruction would interpret the inline constant differently. This will change in the next commit. Signed-off-by: Rhys Perry <[email protected]> Reviewed-by: Daniel Schürmann <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5245>
* aco: improve sub-dword check for sgpr/constant propagationRhys Perry2020-06-151-4/+9
| | | | | | | | | | p_create_vector can have sub-dword operands with a v1 definition. No fossil-db changes. Signed-off-by: Rhys Perry <[email protected]> Reviewed-by: Daniel Schürmann <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5245>
* aco: create 16-bit input and output modifiersRhys Perry2020-06-151-22/+52
| | | | | | | | | | | | | fossil-db (Navi, fp16 enabled): Totals from 1 (0.00% of 127638) affected shaders: CodeSize: 4552 -> 4540 (-0.26%) Instrs: 863 -> 861 (-0.23%) Cycles: 3452 -> 3444 (-0.23%) VMEM: 490 -> 489 (-0.20%) Signed-off-by: Rhys Perry <[email protected]> Reviewed-by: Daniel Schürmann <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5245>
* aco: update comment about preserving fp16/fp64 denormalsRhys Perry2020-06-151-1/+2
| | | | | | Signed-off-by: Rhys Perry <[email protected]> Reviewed-by: Daniel Schürmann <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5245>
* aco: create 16-bit mad/fmaRhys Perry2020-06-152-9/+43
| | | | | | | | | | | | | | | | | fossil-db (Navi, fp16 enabled): Totals from 1 (0.00% of 127638) affected shaders: CodeSize: 4868 -> 4552 (-6.49%) Instrs: 956 -> 863 (-9.73%) Cycles: 3824 -> 3452 (-9.73%) VMEM: 504 -> 490 (-2.78%) SMEM: 109 -> 107 (-1.83%) VClause: 19 -> 20 (+5.26%) Copies: 54 -> 58 (+7.41%) PreVGPRs: 43 -> 41 (-4.65%) Signed-off-by: Rhys Perry <[email protected]> Reviewed-by: Daniel Schürmann <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5245>
* aco: try to use fma instead of mad when denormals are enabledRhys Perry2020-06-154-20/+54
| | | | | | | | | | v_mad_f32 doesn't support denormals but v_fma_f32 does. No fossil-db changes. Signed-off-by: Rhys Perry <[email protected]> Reviewed-by: Daniel Schürmann <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5245>
* aco: create mads when signed zeros should be preservedRhys Perry2020-06-151-1/+1
| | | | | | | | | | | | This check was added because I thought v_mad_f32 didn't preserve the signess of zero, but I can't reproduce that and this isn't mentioned anywhere in LLVM. No fossil-db changes. Signed-off-by: Rhys Perry <[email protected]> Reviewed-by: Daniel Schürmann <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5245>
* aco: add and set precise flagRhys Perry2020-06-155-3/+29
| | | | | | | | No fossil-db changes. Signed-off-by: Rhys Perry <[email protected]> Reviewed-by: Daniel Schürmann <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5245>
* aco: use p_as_uniform in emit_vop1_instructionRhys Perry2020-06-151-41/+15
| | | | | | | | No fossil-db changes. Signed-off-by: Rhys Perry <[email protected]> Reviewed-by: Daniel Schürmann <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5245>
* aco: improve code for f2{i,u}{8,16}Rhys Perry2020-06-151-13/+11
| | | | | | | | | | Use sub-dword definitions so that the RA can use SDWA No fossil-db changes. Signed-off-by: Rhys Perry <[email protected]> Reviewed-by: Daniel Schürmann <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5245>
* aco: use num_opcodes instead of last_opcodeRhys Perry2020-06-151-4/+4
| | | | | | | | No fossil-db changes. Signed-off-by: Rhys Perry <[email protected]> Reviewed-by: Daniel Schürmann <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5245>
* nir: do not try to merge xfb-outputsErik Faye-Lund2020-06-151-0/+12
| | | | | | | | | | | | It's tricky to merge XFB-outputs correctly, because we need there to not be any overlaps when we get to `nir_gather_xfb_info_with_varyings` later on. We currently trigger an assert there if we end up merging here. So let's not even try. This is an optimization, and we can optimize this in safe cases later if needed. For now, let's play it safe. Reviewed-by: Jason Ekstrand <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5329>
* turnip: drop linking libfreedreno_drmRob Clark2020-06-151-1/+0
| | | | | | | Now that it is no longer required. Signed-off-by: Rob Clark <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5476>
* freedreno/ir3: move the libdrm dependency out of shared codeRob Clark2020-06-153-19/+45
| | | | | | | | | | | | | The only reason for this dependency was the fd_bo used for the uploaded shader. But this isn't used by turnip. Now that we've unified the cleanup path from gallium, it isn't hard to pull the fd_bo upload/free parts into ir3_gallium. This cleanup has the added benefit that the shader disk-cache will not have to deal with it. Signed-off-by: Rob Clark <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5476>
* freedreno/ir3: unify shader create/delete pathsRob Clark2020-06-155-10/+9
| | | | | | | | | In particular, to move the fd_bo create/delete (which is unneeded by turnip) out of the shared ir3 code, it is useful to have a single delete path. Signed-off-by: Rob Clark <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5476>
* zink: rework input/output location emissionMike Blumenkrantz2020-06-151-55/+107
| | | | | | | | | | | | | | | | glsl builtins that have no analog in spirv are emitted as regular varyings, which means they take up a slot. we need to ensure that there's no conflict between these regular varying slots (from user-defined varyings) and the glsl translated builtins, so we do that by "reserving" the max number of varying slots that can be used by a given stage, then remapping all glsl builtins with no spirv builtin to a packed layout location that can be consistent across stages sort of addresses mesa/mesa#3113 except now there's 10 fewer varying slots Reviewed-by: Erik Faye-Lund <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5432>
* zink: handle more glsl->spirv builtin translationMike Blumenkrantz2020-06-151-14/+22
| | | | | | | | this should be all of them, though the check for vertex shader stage needs to be changed to !fragment stage at some point Reviewed-by: Erik Faye-Lund <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5432>
* spirv: fix using OpSampledImage with OpUndef instead of OpType{Image,Sampler}Samuel Pitoiset2020-06-151-4/+22
| | | | | | | | | | | | | | This seems valid per the SPIR-V spec to use OpSampledImage with OpUndef instead of OpTypeImage or OpTypeSampler. When the image operand is undefined, SPIRV->NIR emits an undef instruction that can be removed later by the compiler. This fixes shader compilation crashes with Red Dead Redemption II. Cc: [email protected]> Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5230>
* pan/mdg: Precolour blend inputsAlyssa Rosenzweig2020-06-155-5/+26
| | | | | | | | | | | | | | | | | | | Instead of requiring an explicit unoptimized move, we can implicitly colour the blend input intrinsic to r0, where it will be preloaded; this is a simple task for RA, and does not conflict with anything. If there are multiple duplicate loads, the latter ones can just be simple moves which will be copypropped. We don't need to include a explicit synthetic load, since (scanning backwards) the read will cause the input to become live at the right time and the lack of an explicit write will keep it live from the beginning of the shader. So no need to make it more complicated than it needs to be. Saves a cycle in blend shaders. Signed-off-by: Alyssa Rosenzweig <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5449>
* nvir: don't use designated initialisers in C++ codeYevhenii Kolesnikov2020-06-151-100/+100
| | | | | | | | | | | This feature only available since C++20. Fixes: fa0a241b335 ("nvir/nir: move nir options to codegen") Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3114 Signed-off-by: Yevhenii Kolesnikov <[email protected]> Reviewed-by: Karol Herbst <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5430>
* ac: add ac_choose_spi_color_formats() to common codeSamuel Pitoiset2020-06-154-221/+147
| | | | | | | | It's similar between RADV and RadeonSI. Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5436>
* freedreno/ir3: fix ir3_nir_move_varying_inputsJonathan Marek2020-06-141-10/+5
| | | | | | | | | | | | | | ir3_nir_move_varying_inputs is broken when there a load input outside of the first block which depends on the result of a previous load input. This simplification/rework avoids the problem, and should also be faster. Fixes this dEQP-VK test: dEQP-VK.pipeline.multisample_interpolation.offset_interpolate_at_pixel_center.128_128_1.samples_2 Signed-off-by: Jonathan Marek <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5465>
* intel/tools: make test aware of the meson test wrapperEric Engestrom2020-06-131-7/+32
| | | | | | | Suggested-by: Dylan Baker <[email protected]> Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by: Dylan Baker <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5155>
* intel/tools: rewrite run-test.sh in pythonEric Engestrom2020-06-133-40/+69
| | | | | | | | | | | | | | Old script created files in the source directory, which is generally considered bad form. The rewrite to python instead of duct-taping around in the shell script goes towards the goal of only having cross-platform python scripts, which is also harder to make mistakes in than shell scripts. Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by: Sagar Ghuge <[email protected]> Reviewed-by: Dylan Baker <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5155>
* radv: update internal referenceErik Faye-Lund2020-06-131-1/+1
| | | | Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4630>
* iris: drop dead #include "config.h"Eric Engestrom2020-06-131-4/+0
| | | | | | | | | | There hasn't been a config.h in a long time (it was an artifact of the autotool build). Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Dylan Baker <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5350>
* i965: drop dead #include "config.h"Eric Engestrom2020-06-131-4/+0
| | | | | | | | | | There hasn't been a config.h in a long time (it was an artifact of the autotool build). Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Dylan Baker <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5350>
* intel/genxml: replace gen_sort_tags.py MIT licence with SPDX equivalentEric Engestrom2020-06-131-20/+1
| | | | | | | | Much more readable with the same information :) Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by: Lionel Landwerlin <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5362>
* intel/genxml: drop python 2 support for gen_sort_tags.pyEric Engestrom2020-06-131-4/+1
| | | | | | | | | Python 2 is dead and this script is only run by devs, all of which have had python3 available for basically forever. Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by: Lionel Landwerlin <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5362>
* v3d: add missing unlock() in error pathEric Engestrom2020-06-131-1/+2
| | | | | | | | | CoverityID: 1435701 Fixes: e5a81ac70431502bc592 ("broadcom/vc5: Don't forget to get the BO offset when opening a dmabuf.") Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by: Iago Toral Quiroga <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5263>
* turnip: remove some dead/redundant codeJonathan Marek2020-06-138-540/+35
| | | | | | | A bit of cleanup to reduce noise in the codebase. Signed-off-by: Jonathan Marek <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5447>
* panfrost: Tiled to linear layout conversionIcecream952020-06-122-8/+51
| | | | | | | | | | | | | | | | | | Tiling is expensive, so this patch converts textures that appear to be used for streaming to a linear layout. Performance of mpv is significantly improved, with software-decoded 1080p mp4 playback on RK3288 going from 30fps to 50fps when testing with `--untimed --no-audio`. To keep things simple, conversion only happens when updating the whole texture and no mipmapping is used. v2: Make it clear that the heuristic doesn't rely on a texture being uninitialized, since layout switching code can get confusing (Alyssa). Reviewed-by: Alyssa Rosenzweig <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4628>
* panfrost: Create a new sampler view bo when the layout changesIcecream952020-06-123-3/+21
| | | | | Reviewed-by: Alyssa Rosenzweig <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4628>
* panfrost: Move sampler view bo creation to a separate functionIcecream952020-06-122-40/+53
| | | | | Reviewed-by: Alyssa Rosenzweig <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4628>
* intel/compiler: Drop opt_sampler_eot()Matt Turner2020-06-122-101/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Gen9 and Cherryview have the ability to mark texture instructions with the End-of-thread bit under some conditions, which allows the texture result to be written to the render target directly, rather than returning to the EU. In order to handle overlapping primitives correctly, we have to use the 'sendc' instruction which stalls until other threads potentially writing to the same locations in the render target are retired. Unfortunately, this stall happens before the texture is sampled (rather than in parallel with stall), so for some literal edge cases (like the diagonal edge between two triangles forming a rectangle) there can be a performance penalty. As a result, it's probably not a good idea to use this optimization in general. I had planned to leave it enabled only for BLORP, where we use rectangle primitives and are typically clearing/blitting an entire render target without any overlapping primitives, but I noticed that the optimization wasn't applied in some normal cases anyway. For example, in the piglit test tests/shaders/glsl-fs-texture2d-bias.shader_test it is applied to one BLORP-blit shader but not another due to some kind of mishandling of register types (the destination register type of the texture operation is UD while the color source of the render target write is F). Additionally the instruction scheduler assumed that the combined texture and render target write operation took 0 cycles, leading to cycle estimates that are wildly inaccurate. Since the optimization was not implemented for SIMD32 and our decision whether to use the SIMD32 program is made by comparing the estimated performance with that of the SIMD16 shader, we wrongly threw out a bunch of SIMD32 programs that are likely profitable. total cycles in shared programs: 472807891 -> 473784245 (0.21%) cycles in affected programs: 108277 -> 1084631 (901.72%) helped: 0 HURT: 1290 total sends in shared programs: 998955 -> 1000245 (0.13%) sends in affected programs: 1400 -> 2690 (92.14%) helped: 0 HURT: 1290 LOST: 0 GAINED: 33 This patch shows no performance changes in Intel's Mesa performance CI. Given the problems, the lack of evidence that the pass improves performance, and the fact that the hardware feature was removed from subsequent GPU generations, I think that the pass is not valuable and should be removed. Reviewed-by: Jason Ekstrand <[email protected]> Reviewed-by: Francisco Jerez <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Signed-off-by: Matt Turner <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5412>
* pan/mdg: Prefer type over regmode for schedule constraintsAlyssa Rosenzweig2020-06-121-2/+2
| | | | | Signed-off-by: Alyssa Rosenzweig <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5443>
* pan/mdg: Analyze types for 64-bitness in RAAlyssa Rosenzweig2020-06-121-1/+15
| | | | | | | Instead of reg_mode. Signed-off-by: Alyssa Rosenzweig <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5443>
* pan/mdg: Explicitly type 64-bit uniform movesAlyssa Rosenzweig2020-06-121-0/+2
| | | | | | | Instead of relying on reg_mode. Signed-off-by: Alyssa Rosenzweig <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5443>
* turnip: add emit renderpass cache flushes for sysmem 3D CmdClearAttachmentsJonathan Marek2020-06-123-1/+8
| | | | | | | This clear path behaves like a draw, it needs the same flush as tu_draw. Signed-off-by: Jonathan Marek <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5426>
* turnip: add layered 3D path clear for CmdClearAttachmentsJonathan Marek2020-06-122-42/+142
| | | | | | | | | | | | | | | This fixes cases where the 3D path is used with layered rendering. Fixes dEQP-VK.renderpass.suballocation.multisample_resolve.layers* failures Note the blob's 3D fallback path behaves differently, and uses the framebuffer information to clear each layer individually (changing the MRT state each time). But that's not possible in all cases, and the blob fails to clear properly in dEQP-VK.geometry.layered.*.secondary_cmd_buffer cases. So this clear path is not based on the blob's behavior. Signed-off-by: Jonathan Marek <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5426>
* turnip: share code between 3D blit/clear path and tu_pipelineJonathan Marek2020-06-124-135/+108
| | | | | | | | Instead of filling out registers manually, fill out ir3 structs and re-use code from tu_pipeline. Signed-off-by: Jonathan Marek <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5426>
* turnip: pipeline program state refactorJonathan Marek2020-06-121-339/+217
| | | | | | | | | | | | This refactor simplifies things a bit, and will make it easier to share some logic with tu_clear_blit (see next patches). This changes the order in which some things are emitted, and emits less for disabled shader stages. There's also as extra write to SP_GS_PRIM_SIZE that is removed. Signed-off-by: Jonathan Marek <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5426>
* panfrost: Demote mediump varyings to fp16Alyssa Rosenzweig2020-06-121-2/+16
| | | | | | | Likewise lowp. Signed-off-by: Alyssa Rosenzweig <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5423>
* panfrost: Override varying format to minimal precisionAlyssa Rosenzweig2020-06-121-5/+22
| | | | | | | Spec allows this! Signed-off-by: Alyssa Rosenzweig <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5423>
* panfrost: Use shader_info harderAlyssa Rosenzweig2020-06-122-18/+5
| | | | | | | We already have this metadata.. Signed-off-by: Alyssa Rosenzweig <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5423>
* panfrost: Only store varying formatsAlyssa Rosenzweig2020-06-123-53/+10
| | | | | | | This reduces linking complexity. Signed-off-by: Alyssa Rosenzweig <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5423>
* panfrost: Allow R/RG/RGB varyingsAlyssa Rosenzweig2020-06-122-4/+15
| | | | | | | This can be a bandwidth savings. Signed-off-by: Alyssa Rosenzweig <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5423>
* panfrost: Remove unused routinesAlyssa Rosenzweig2020-06-121-51/+0
| | | | | Signed-off-by: Alyssa Rosenzweig <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5423>
* panfrost: Use new varying linkingAlyssa Rosenzweig2020-06-121-227/+54
| | | | | Signed-off-by: Alyssa Rosenzweig <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5423>