summaryrefslogtreecommitdiffstats
path: root/src/shader_recompiler/ir_opt (unfollow)
Commit message (Collapse)AuthorFilesLines
2024-01-08Fix "Propietary" typo elsewhereViktor Szépe1-1/+1
2023-12-22shader_recompiler: ensure derivatives for textureGrad are f32Liam1-1/+11
2023-12-21shader_recompiler: use float image operations on load/store when requiredLiam1-1/+24
2023-12-19shader_recompiler: use minimal clip distance arrayLiam1-1/+5
2023-11-18shader_recompiler: Fix spelling of "derivate" (#12067)Ameer J1-5/+5
2023-11-18shader_recompiler: add byteswap pattern workaround for NvidiaAmeer J2-0/+80
2023-11-01shader_recompiler: Align SSBO offsets to meet host requirementsAmeer J2-5/+10
Co-Authored-By: Billy Laws <blaws05@gmail.com>
2023-08-19Shader Recomnpiler: implement textuzreGrad 3D emulation constant propagationFernando Sahmkow1-1/+226
2023-07-23ssa_rewrite_pass: use proper mapsLiam1-6/+5
2023-06-26shaders: Track local memory usageameerj1-0/+4
2023-06-10shader_recompiler: translate f64 to f32 when unsupported on hostLiam2-0/+186
2023-06-10shader_recompiler: remove barriers in conditional control flow when device lacks supportLiam2-0/+45
2023-02-25buffer_cache: Add logic for non-NVN storage buffer trackingameerj1-1/+7
2023-01-29texture_pass: Fix texture descriptors comparisonsameerj1-2/+9
2023-01-29texture_pass: Refactor texture handle retrievalameerj1-7/+7
2023-01-28shader_recompiler: TXQ: Skip QueryLevels when possibleameerj1-1/+2
2023-01-26shader_recompiler: Remove S32 IR typeameerj1-4/+4
The frontend IR opcodes do not distinguish between signed and unsigned integer types. Fixes broken shaders when IR validation/graphics debugging is enabled for shaders that used BitCastS32F32
2023-01-23spirv: fix multisampled image fetchLiam1-0/+8
2023-01-07Revert "shader_recompiler: Align SSBO offsets to meet host requirements"Liam2-10/+5
This reverts commit 8804a4eb23e0c4f3e4bab03dee7c204bd38bf21e.
2023-01-05Run clang-formatBilly Laws1-1/+2
2023-01-05shader_recompiler: Align SSBO offsets to meet host requirementsBilly Laws2-5/+9
We can take advantage of SSBO addresses being passed in a constant bufer to account for the extra alignment requirements in the shader itself.
2023-01-04Video_core: Address feedbackFernando Sahmkow1-0/+3
2023-01-03ShaderCompiler: Inline driver specific constants.Fernando Sahmkow1-1/+29
2023-01-01MacroHLE: Add HLE replacement for base vertex and base instance.Fernando Sahmkow2-4/+43
2022-12-01shader_recompiler: add gl_Layer translation GS for older hardwareLiam2-0/+69
2022-11-11ir/texture_pass: Use host_info instead of querying Settings::values (#9176)Morph2-7/+11
2022-11-07video_core: Fix few issues in Tess stageFengChen1-0/+3
2022-11-04video_core: Fix SNORM texture buffer emulating error (#9001)Feng Chen1-0/+49
2022-10-25Revert "shader_recompiler/dead_code_elimination: Add DeadBranchElimination pass"Feng Chen1-89/+9
2022-10-06General: Fix compilation for GCCLiam White1-1/+1
2022-10-06Shader Decompiler: implement better tracking for Vulkan samplers.Fernando Sahmkow1-9/+59
2022-10-06Shader Decompiler: Check for shift when deriving composite samplers.Fernando Sahmkow1-3/+31
2022-09-20video_core: Generate mipmap texture by drawingFengChen2-0/+78
2022-08-31style: General style changes to match with the rest of the codebaseMorph1-5/+5
2022-08-25video_code: support rectangle textureFengChen2-1/+29
2022-04-28GCC 12 fixesLiam1-1/+1
2022-04-23general: Convert source file copyright comments over to SPDXMorph13-39/+26
This formats all copyright comments according to SPDX formatting guidelines. Additionally, this resolves the remaining GPLv2 only licensed files by relicensing them to GPLv2.0-or-later.
2022-04-01shader_recompiler: support const buffer indirect addressing on OpenGL SPIR-VLiam1-7/+2
2022-03-23dead_code_elimination_pass: Remove unreachable Phi argumentsameerj1-0/+27
2022-03-22shader_recompiler/dead_code_elimination: Add DeadBranchElimination passameerj1-9/+62
This adds a pass to eliminate if(false) branches within the shader code
2022-03-20shader_recompiler: Reduce unused includesameerj6-12/+0
2022-03-17Address review commentsLiam1-33/+28
2022-03-17shader_recompiler: Use functions for indirect const buffer accessesLiam1-0/+2
2022-03-15shader: add support for const buffer indirect addressingLiam1-8/+27
2022-03-13Shader decompiler: Fix storage tracking in deko3d.Fernando Sahmkow1-1/+2
2022-03-12rescaling_pass: Fix rescaling Color2DArray ImageFetch offsetsameerj1-2/+27
ImageFetch offsets for 2D array coordinates have a different composite size than the coordinates. The rescaling pass was not taking this into account. Fixes broken shaders when scaling is enabled in Astral Chain, and likely other titles.
2022-01-30lower_int64_to_int32: Add 64-bit atomic fallbacksameerj2-2/+67
2022-01-30shaders: Add U64->U32x2 Atomic fallback functionsameerj1-0/+18
2022-01-29spirv_atomic: Define U32x2 storage buffers for 64-bit storage atomicsameerj1-1/+1
Some drivers do not support 64-bit atomics, and fallback to atomically modifying U32x2 vectors. This change ensures that U32x2 storage vectors are defined in the spir-v shader when 64-bit atomics are used. Fixes a hang on some devices, notably Intel GPUs, when booting Pokemon Legends Arceus
2021-12-30shader: Add integer attribute get optimization passameerj2-0/+24
Works around an nvidia driver bug, where casting the integer attributes to float and back to an integer always returned 0.
2021-11-16ShaderCache: Better fix for Shuffling gl_FragCoordFernando Sahmkow1-2/+13
2021-11-16Texture Cahe/Shader decompiler: Resize PointSize on rescaling, refactor and make reaper more agressive on 4Gb GPUs.FernandoS271-0/+21
2021-11-16rescaling_pass: Fix IR errors when unscalable texture types are encounteredameerj1-0/+28
2021-11-16rescaling_pass: Logic simplification and minor style cleanupameerj1-32/+17
2021-11-16rescaling_pass: Scale ImageFetch offset if it existsameerj1-59/+37
Plus some code deduplication
2021-11-16rescaling_pass: Enable PatchImageQueryDimensions on fragment stagesameerj1-5/+4
2021-11-16gl_texture_cache/rescaling_pass: minor cleanupameerj1-12/+8
2021-11-16rescaling_pass: Fix and simplify shuffle/fragcoord passameerj1-26/+20
2021-11-16Shader: Don't rescale FragCoord if used by ShuffleFernando Sahmkow1-1/+52
2021-11-16RescalingPass: Agregate pixels on texelFetch while on Fragment ShaderFernando Sahmkow1-3/+97
2021-11-16shader: Fix TextureSize check on rescaling.Fernando Sahmkow1-27/+21
2021-11-16shader: Properly scale image reads and add GL SPIR-V supportReinUsesLisp2-2/+2
Thanks for everything!
2021-11-16shader: Properly blacklist and scale image loadsReinUsesLisp1-3/+19
2021-11-16shader/rescaling_pass: Patch more instructionsReinUsesLisp1-4/+101
2021-11-16shader: Add IsTextureScaled opcodeReinUsesLisp1-0/+1
2021-11-16shader: Fix rescaling passReinUsesLisp1-1/+1
2021-11-16shader: Fix resolution scaling passReinUsesLisp3-34/+30
2021-11-16ShaderDecompiler: Add initial support for rescaling.Fernando Sahmkow1-0/+72
2021-11-01ShaderCache: Fix Phi Nodes Type on OGL.Fernando Sahmkow1-0/+24
2021-10-31ShaderCache: Order Phi Arguments from farthest away to nearest.Fernando Sahmkow1-0/+7
2021-10-24TexturePass: Fix clamping of images as this allowed negative indices.Fernando Sahmkow1-1/+1
2021-10-17Shader Compiler: avoid overflowed indices on indixed samplers.Fernando Sahmkow1-1/+2
2021-07-30shader: Fold UnpackFloat2x16 and PackFloat2x16ReinUsesLisp1-0/+4
Simplifies the code a bit when possible. These instructions should be no-ops codegen wise.
2021-07-28shader: Mark ConvertF16F32 and ConvertF32F16 as fp16 instructionsReinUsesLisp1-0/+2
Fixes instances where fp16 types are not declared on SPIR-V but they are used. This shouldn't happen on master, as it's been uncovered by an additional optimization pass.
2021-07-26shader: Fold integer FMA from Nvidia's patternReinUsesLisp1-0/+175
Fold shaders doing "a * b + c" on integers from the pattern generated by Nvidia's GL compiler. On a somewhat complex compute shader it reduces the code size by 16 instructions from 2 matches on Turing GPUs. On Intel as extracted from KHR_pipeline_executable_properties: Before the optimization: ``` Instruction Count: 2057 Basic Block Count: 45 Scratch Memory Size: 14752 Spill Count: 232 Fill Count: 261 SEND Count: 610 Cycle Count: 11325 ``` After the optimization: ``` Instruction Count: 2046 Basic Block Count: 44 Scratch Memory Size: 13728 Spill Count: 219 Fill Count: 268 SEND Count: 604 Cycle Count: 11367 ```
2021-07-26shader: Use TryInstRecursive on XMAD multiply foldingReinUsesLisp1-14/+12
Simplify a bit the logic.
2021-07-23shader: Avoid usage of C++20 ranges to build in clangReinUsesLisp6-17/+12
2021-07-23shader_recompiler, video_core: Resolve clang errorslat9nq1-3/+3
Silences the following warnings-turned-errors: -Wsign-conversion -Wunused-private-field -Wbraced-scalar-init -Wunused-variable And some other errors
2021-07-23glsl: Fix tracking of info.uses_shadow_lodameerj1-4/+4
2021-07-23dual_vertex_pass: Clang formatameerj1-14/+14
2021-07-23shader: Rework varyings and implement passthrough geometry shadersReinUsesLisp1-137/+65
Put all varyings into a single std::bitset with helpers to access it. Implement passthrough geometry shaders using host's.
2021-07-23lower_int64_to_int32: Add missing includelat9nq1-0/+1
2021-07-23shader: Add int64 to int32 lowering passReinUsesLisp2-0/+217
2021-07-23shader: Teach global memory base tracker to follow vectorsReinUsesLisp1-15/+14
2021-07-23shader: Add constant propagation to integer vectorsReinUsesLisp1-0/+9
2021-07-23shader: Move loop safety tests to code emissionReinUsesLisp1-30/+2
2021-07-23texture_pass: Fix is_read image qualificationameerj1-1/+1
Atomic operations are considered to have both read and write access. This was not being accounted for.
2021-07-23shader: Align constant buffer sizes to 16 bytesReinUsesLisp1-1/+2
WAR for AMD reading zeroes on uniform buffers of size 2.
2021-07-23shader: Properly manage attributes not written from previous stagesReinUsesLisp1-2/+4
2021-07-23glsl: Address rest of feedbackameerj1-2/+9
2021-07-23glsl: Conditionally add EXT_texture_shadow_lodameerj1-1/+9
2021-07-23glsl: Implement legacy varyingsameerj1-1/+8
2021-07-23glsl: Fix ATOM and implement ATOMSameerj1-0/+6
2021-07-23glsl: Track S32 atomicsameerj1-2/+8
2021-07-23glsl: Revert ssbo aliasing. Storage Atomics implameerj1-7/+2
2021-07-23glsl: Wip storage atomic opsameerj1-2/+7
2021-07-23shader: Fix loop safety to SSA passReinUsesLisp1-1/+1
2021-07-23shader: Add shader loop safety check settingslat9nq1-19/+47
Also add a setting for enable Nsight Aftermath.
2021-07-23shader: Fix VertexA Shaders.FernandoS272-9/+16
2021-07-23buffer_cache: Reduce uniform buffer size from shader usageReinUsesLisp1-3/+16
Increases performance significantly on certain titles.
2021-07-23shader,glasm: Implement legacy texcoord loadsReinUsesLisp1-52/+18
2021-07-23shader: Track legacy varyingsReinUsesLisp1-13/+88
2021-07-23shader: Clang-format secondary texturesReinUsesLisp1-2/+2
2021-07-23shader: Fix secondary texturesReinUsesLisp1-2/+2
2021-07-23shader: Fix FSwizzleAdd folding when going through phi nodesReinUsesLisp1-2/+2
2021-07-23glasm: Remove unintentionally committed fmt::printsReinUsesLisp1-2/+0
2021-07-23glasm: Initial implementation of phi nodes on GLASMReinUsesLisp1-5/+1
2021-07-23glasm: Rework control flow introducing a syntax listReinUsesLisp4-73/+8
This commit regresses VertexA shaders, their transformation pass has to be adapted to the new control flow.
2021-07-23glasm: Implement shuffle and vote instructions on GLASMReinUsesLisp1-1/+3
2021-07-23shader: Optimize NVN FallthroughFernandoS271-7/+71
2021-07-23shader: Implement Int32 SUATOM/SUREDameerj2-1/+103
2021-07-23shader: Address feedbackFernandoS271-11/+9
2021-07-23shader: Implement VertexA stageFernandoS274-0/+128
2021-07-23shader: Fix BFE s32 undefined checkameerj1-1/+1
Our unit tests were hitting this exception.
2021-07-23shader: Fix error checking in bitfieldExtract and implement bitfieldInsert foldingReinUsesLisp1-5/+14
2021-07-23shader: Add more strict validation the passReinUsesLisp1-0/+42
2021-07-23shader: Fix forward referencing identity instructions when inserting phiReinUsesLisp1-11/+13
2021-07-23shader: Remove invalidated blocks in dead code elimination passReinUsesLisp1-3/+6
2021-07-23shader: Implement indexed texturesReinUsesLisp1-17/+72
2021-07-23shader: Intrusively store in a block if it's sealed or notReinUsesLisp1-3/+2
2021-07-23shader: Move microinstruction header to the value headerReinUsesLisp8-8/+8
2021-07-23shader: Intrusively store register values in block for SSA passReinUsesLisp1-21/+43
2021-07-23shader: Implement D3D samplersReinUsesLisp1-11/+69
2021-07-23shader: Add constant propagation for arithmetic right shiftsReinUsesLisp1-0/+3
2021-07-23shader: Add NVN storage buffer fallbacksReinUsesLisp2-38/+61
When we can't track the SSBO origin of a global memory instruction, leave it as a global memory operation and assume these pointers are in the NVN storage buffer slots, then apply a linear search in the shader's runtime.
2021-07-23shader: Address feedbackFernandoS271-1/+1
2021-07-23shader: Add coarse derivativesFernandoS272-8/+2
2021-07-23shader: Implement fine derivates constant propagationFernandoS272-0/+71
2021-07-23shader: Fix Phi node typesReinUsesLisp1-0/+4
2021-07-23shader: Implement SampleMaskReinUsesLisp1-0/+3
2021-07-23shader: Implement PIXLD.MY_INDEXReinUsesLisp1-0/+3
2021-07-23spirv: Implement ViewportMask with NV_viewport_array2ReinUsesLisp1-0/+3
2021-07-23shader: Implement PrimitiveIdReinUsesLisp1-0/+3
2021-07-23shader: Implement tessellation shaders, polygon mode and invocation idReinUsesLisp1-0/+41
2021-07-23shader: Mark atomic instructions as writesReinUsesLisp1-0/+27
2021-07-23spirv: Implement image buffersReinUsesLisp1-1/+18
2021-07-23spirv: Implement Layer storesReinUsesLisp1-0/+3
2021-07-23spirv: Rework storage buffers and shader memoryReinUsesLisp1-5/+64
2021-07-23shader: Add constant propagation for *&^| binary operationsReinUsesLisp1-0/+12
2021-07-23spirv: Define StorageImageWriteWithoutFormat capability when usedReinUsesLisp1-0/+5
2021-07-23shader: Implement SR_THREAD_KILLReinUsesLisp1-0/+3
2021-07-23shader: Implement ATOM/S and REDameerj3-2/+201
2021-07-23spirv: Guard against typeless image reads on unsupported devicesReinUsesLisp1-0/+7
2021-07-23shader: Move LaneId to the warp emission file and fix AMDReinUsesLisp1-1/+1
2021-07-23shader: Implement SULD and SUSTReinUsesLisp2-25/+69
2021-07-23shader: Address feedback + clang formatlat9nq1-1/+2
2021-07-23shader_recompiler,video_core: Cleanup some GCC and Clang errorslat9nq8-76/+80
Mostly fixing unused *, implicit conversion, braced scalar init, fpermissive, and some others. Some Clang errors likely remain in video_core, and std::ranges is still a pertinent issue in shader_recompiler shader_recompiler: cmake: Force bracket depth to 1024 on Clang Increases the maximum fold expression depth thread_worker: Include condition_variable Don't use list initializers in control flow Co-authored-by: ReinUsesLisp <reinuseslisp@airmail.cc>
2021-07-23shader: Implement texture buffersReinUsesLisp1-18/+62
2021-07-23shader: Address feedbackFernandoS271-13/+9
2021-07-23shader: Implement indexed Position and ClipDistancesFernandoS271-8/+18
2021-07-23shader: Implement indexed attributesFernandoS272-2/+36
2021-07-23shader: Move recursive SSA rewrite to the heapReinUsesLisp1-29/+89
2021-07-23shader: Add subgroup masksReinUsesLisp1-0/+7
2021-07-23shader: Abstract breadth searches and use the abstractionReinUsesLisp2-104/+48
2021-07-23shader: Reimplement GetCbufU64 as GetCbufU32x2ReinUsesLisp1-4/+3
It may generate better code on some compilers and it's easier to handle.
2021-07-23shader: Rework global memory tracking to use breadth-first searchReinUsesLisp1-69/+80
2021-07-23shader: Address feedbackFernandoS272-12/+9
2021-07-23shader: Address FeedbackFernandoS273-60/+9
2021-07-23shader: Implement SR_LaneIdFernandoS271-0/+1
2021-07-23shader: Improve VOTE.VTG stubFernandoS271-1/+50
2021-07-23shader: Mark SSBOs as written when they areFernandoS271-2/+29
2021-07-23shader: Implement ViewportIndexFernandoS271-0/+3
2021-07-23shader: Fold composite extractFernandoS271-0/+62
2021-07-23shader: Fold comparisons and Pack/Unpack16FernandoS271-1/+41
2021-07-23shader: Fix constant propagation to use reverse post orderReinUsesLisp1-1/+2
2021-07-23shader: Implement ClipDistanceFernandoS271-0/+10
2021-07-23shader: Implement ImageGradientFernandoS272-1/+15
2021-07-23shader,spirv: Implement ImageQueryLod.FernandoS272-1/+7
2021-07-23shader: Implement TLDFernandoS271-0/+1
2021-07-23shader: Add PointCoord attributeFernandoS271-0/+4
2021-07-23shader: Add PointSize attributeameerj1-0/+3
2021-07-23shader: Implement FSWZADDameerj1-0/+3
2021-07-23shader: Implement BRXFernandoS271-1/+20
2021-07-23shader: Implement LDS, STS, LDL, and STS and use SPIR-V 1.4 when availableReinUsesLisp1-0/+6
2021-07-23shader: Better interpolation and disabled attributes supportReinUsesLisp1-1/+1
2021-07-23shader: Implement front faceReinUsesLisp1-0/+3
2021-07-23shader: Implement TXQ and fix FragDepthReinUsesLisp2-5/+18
2021-07-23shader: Refactor PTP and other minor changesReinUsesLisp1-20/+2
2021-07-23shader: Add IR opcode for ImageFetchFernandoS271-0/+5
2021-07-23shader: Implement TLD4.PTPFernandoS271-0/+18
2021-07-23shader: Implement TLD4 and TLD4_BFernandoS273-1/+29
2021-07-23shader: Implement SHFLameerj1-0/+6
2021-07-23shader: Track first bindless argument instead of the instruction itselfReinUsesLisp1-1/+1
2021-07-23shader: Fix F2IFernandoS272-0/+4
2021-07-23shader: Implement VOTEameerj1-0/+6
2021-07-23shader: Fold interpolation multiplicationsReinUsesLisp1-0/+34
2021-07-23shader: Implement DMNMX, DSET, DSETPameerj2-2/+9
2021-07-23shader: Implement F2FFernandoS271-1/+3
2021-07-23shader: Add missing fp64 usage flagsReinUsesLisp1-0/+34
2021-07-23shader: Add support for fp16 comparisons and misc fixesReinUsesLisp2-0/+18
2021-07-23shader: Fix floating point comparison for FP16FernandoS271-0/+24
2021-07-23spirv: Implement VertexId and InstanceId, refactor codeReinUsesLisp1-0/+6
2021-07-23shader: Implement I2FReinUsesLisp2-0/+44
2021-07-23shader: Add partial rasterizer integrationReinUsesLisp2-5/+57
2021-07-23shader: Reorder phi nodes when redefined as undefined opcodesReinUsesLisp1-1/+9
2021-07-23shader: Implement CAL inlining function callsReinUsesLisp10-57/+44
2021-07-23shader: Implement FCMPameerj1-1/+13
still need to configure some settings for NV denorm flush and intel NaN
2021-07-23shader: Partial implementation of LDCReinUsesLisp4-15/+146
2021-07-23shader: Initial support for textures and TEXReinUsesLisp4-9/+226
2021-07-23shader: Implement HADD2ReinUsesLisp2-1/+11
2021-07-23shader: Implement SELameerj1-4/+8
2021-07-23shader: Avoid infinite recursion when tracking global memoryReinUsesLisp1-5/+26
2021-07-23shader: FMUL, select, RRO, and MUFU fixesReinUsesLisp1-1/+1
2021-07-23shader: Add denorm flush supportReinUsesLisp2-7/+65
2021-07-23spirv: Add lower fp16 to fp32 passReinUsesLisp4-7/+103
2021-07-23shader: Add XMAD multiplication folding optimizationReinUsesLisp1-5/+77
2021-07-23spirv: Initial bindings supportReinUsesLisp4-61/+210
2021-07-23shader: Fix trackingReinUsesLisp1-50/+72
2021-07-23shader: Add support for forward declarationsReinUsesLisp1-2/+2
2021-07-23shader: Support SSA loops on IRReinUsesLisp3-17/+55
2021-07-23shader: Misc fixesReinUsesLisp2-70/+70
2021-07-23shader: Initial implementation of an ASTReinUsesLisp3-3/+75
2021-07-23spirv: Initial SPIR-V supportReinUsesLisp1-1/+1
2021-07-23shader: Better constant foldingReinUsesLisp1-12/+47
2021-07-23shader: Properly store phi on InstReinUsesLisp1-10/+12
2021-07-23shader: Add pools and rename filesReinUsesLisp1-14/+14
2021-07-23shader: Make typed IRReinUsesLisp2-10/+31
2021-07-23shader: Remove illegal character in SSA passReinUsesLisp1-1/+1
2021-07-23shader: Constant propagation and global memory to storage bufferReinUsesLisp6-36/+573
2021-07-23shader: Initial instruction supportReinUsesLisp2-88/+0
2021-07-23shader: SSA and dominanceReinUsesLisp3-1/+164
2021-07-23shader: Initial recompiler workReinUsesLisp5-0/+213