Commit graph

16926 commits

Author SHA1 Message Date
ameerj c797a0c5a5 glsl: Fix bindings, add some CC ops 2021-07-22 21:51:36 -04:00
ameerj e6a0f0f384 glsl: remove unused headers 2021-07-22 21:51:36 -04:00
ameerj b96d76fa7e glsl: Implement derivatives and YDirection
plus some other misc additions/changed
2021-07-22 21:51:36 -04:00
ameerj ac6135774f glsl: Fix non-immediate buffer access
and many other misc implementations
2021-07-22 21:51:36 -04:00
ameerj 2328b0b2a8 glsl: textures wip 2021-07-22 21:51:36 -04:00
ameerj 32328acc39 glsl: Implement some attribute getters and setters 2021-07-22 21:51:36 -04:00
ameerj c8b2a5a4f3 glsl: Track S32 atomics 2021-07-22 21:51:36 -04:00
ameerj ee45d46f9e glsl: Update phi node management 2021-07-22 21:51:36 -04:00
ameerj 4eb02b106f glsl: Fix floating point compare ops
Logic for ordered/unordered ops was wrong.
2021-07-22 21:51:36 -04:00
ameerj ce2ddb7d69 glsl: Query GL Device for FP16 extension support 2021-07-22 21:51:36 -04:00
ameerj 1d88049eaf glsl: Simply FP storage atomics 2021-07-22 21:51:36 -04:00
ameerj 0adc9d2fc1 glsl: F16x2 storage atomics 2021-07-22 21:51:36 -04:00
ameerj 5fa21197b9 glsl: Revert ssbo aliasing. Storage Atomics impl 2021-07-22 21:51:36 -04:00
ameerj 3d950a8d18 glsl: implement phi nodes 2021-07-22 21:51:36 -04:00
ameerj 659eecb295 glsl: Wip storage atomic ops 2021-07-22 21:51:36 -04:00
ameerj b3fce08191 glsl: Implement FCMP 2021-07-22 21:51:36 -04:00
ameerj 7febd59ce1 glsl: Add a more robust fp formatter 2021-07-22 21:51:36 -04:00
ameerj bf40d10805 glsl: More FP fixes 2021-07-22 21:51:36 -04:00
ameerj d7656077bf glsl: FP function fixes 2021-07-22 21:51:36 -04:00
ameerj 30f47ec831 glsl: More FP instructions/fixes 2021-07-22 21:51:36 -04:00
ameerj 1dae770c9d glsl: Add many FP32/64 instructions 2021-07-22 21:51:36 -04:00
ReinUsesLisp fc7cb28bc7 glsl: Fixup build issues 2021-07-22 21:51:36 -04:00
ameerj 1df4541247 glsl: Implement more Integer ops 2021-07-22 21:51:36 -04:00
ameerj fc36d45a97 glsl: Implement BF* 2021-07-22 21:51:36 -04:00
ameerj eea0726cd5 glsl: Implement a few Integer instructions 2021-07-22 21:51:36 -04:00
ameerj 0c315dae67 glsl: Use std::string_view for Emit function args. 2021-07-22 21:51:35 -04:00
ameerj b2cd8e4588 glsl: Pass IR::Inst& to Emit functions 2021-07-22 21:51:35 -04:00
ameerj c01220d25a glsl: INeg and IAdd negate tests 2021-07-22 21:51:35 -04:00
ameerj 6ee142d3e4 glsl: Reusable typed variables. IADD32 2021-07-22 21:51:35 -04:00
ameerj 690e6a79c7 glsl: Fix program linking and cbuf 2021-07-22 21:51:35 -04:00
ameerj 3355c467e0 glsl: Fix "reg" allocing
based on glasm with some tweaks
2021-07-22 21:51:35 -04:00
ameerj fda83fe3c5 glsl: Initial backend 2021-07-22 21:51:35 -04:00
ReinUsesLisp 04fed81921 spirv: Reduce log severity of mismatching denorm rules 2021-07-22 21:51:35 -04:00
ReinUsesLisp 574a99b9b3 shader: Fix loop safety to SSA pass 2021-07-22 21:51:35 -04:00
ReinUsesLisp eb7925b421 vk_rasterizer: Exit render passes on fragment barriers 2021-07-22 21:51:35 -04:00
Rodrigo Locatti 0ce45868ca vk_graphics_pipeline: Fix path with no VK_EXT_extended_dynamic_state 2021-07-22 21:51:35 -04:00
ReinUsesLisp ee69b7aa59 buffer_cache: Invalidate fast buffers on compute 2021-07-22 21:51:35 -04:00
ReinUsesLisp f40daa777e shader: Add logging 2021-07-22 21:51:35 -04:00
lat9nq 3a70b6c79b shader: Add shader loop safety check settings
Also add a setting for enable Nsight Aftermath.
2021-07-22 21:51:35 -04:00
ReinUsesLisp a56f9f4322 shader: Comment why the array component is not read in TMML 2021-07-22 21:51:35 -04:00
ReinUsesLisp 59a989f149 vulkan_device: Enable VK_EXT_vertex_input_dynamic_state 2021-07-22 21:51:35 -04:00
ReinUsesLisp cefa403eba vk_pipeline_cache: Skip cached pipelines with different dynamic state 2021-07-22 21:51:35 -04:00
ameerj 87a78640d7 main: Fix Open Transferable Shader Cache context item
Opens the new shader cache directory location for the specified title, if it exists.
2021-07-22 21:51:35 -04:00
ameerj 4c1067ef1c tmml: Remove index component from coords vec
The lod query functions exposed by the rendering API's do not make use of the texturearray layer indexing.
2021-07-22 21:51:35 -04:00
ReinUsesLisp 1805ba1763 vulkan: Add VK_EXT_vertex_input_dynamic_state support
Reduces the number of total pipelines generated on Vulkan.
Tested on Super Smash Bros. Ultimate.
2021-07-22 21:51:35 -04:00
ReinUsesLisp 8fae35f767 shader: Reorder shader cache directories 2021-07-22 21:51:35 -04:00
ReinUsesLisp 2e99f9ce1b vk_rasterizer: Implement first index 2021-07-22 21:51:35 -04:00
ReinUsesLisp 969f76707c vulkan: Use VK_EXT_provoking_vertex when available 2021-07-22 21:51:35 -04:00
ameerj 60b33bdc9f spirv/convert: Catch more signed operations oversights
The sign bit on integers of size < 32 was not properly preserved in casts
2021-07-22 21:51:35 -04:00
ReinUsesLisp 4fedf2c20a spirv/convert: Catch more broken signed operations on Nvidia OpenGL
BitCast U32 to S32 before converting to float on drivers with broken
signed operations.
2021-07-22 21:51:35 -04:00
ameerj 6e65f16895 gl_buffer_cache: Use unorm internal formats for snorm texture buffer views
Fixes black textures in UE4 games
2021-07-22 21:51:35 -04:00
ReinUsesLisp 09c4a71dd4 shader_environment: Fix local memory size calculations 2021-07-22 21:51:35 -04:00
ReinUsesLisp 5292190c8d buffer_cache: Fix copy based uniform bindings tracking 2021-07-22 21:51:35 -04:00
ameerj 1bbecac1d2 shader_environment: Add shader_local_memory_crs_size to local memory size
Fixes DOOM 2016 missing local memory
2021-07-22 21:51:35 -04:00
ReinUsesLisp 8393ea343f gl_texture_cache: Create image storage views
Fixes SULD.D tests.
2021-07-22 21:51:35 -04:00
ReinUsesLisp 0b6f8eea5a gl_shader_util: Move shader utility code to a separate file 2021-07-22 21:51:35 -04:00
ReinUsesLisp ca6dbc7c49 gl_shader_cache: Store workers in shader cache object 2021-07-22 21:51:35 -04:00
ReinUsesLisp b420b97025 vk_pipeline_cache,shader_notify: Add shader notifications 2021-07-22 21:51:35 -04:00
ReinUsesLisp 1dccf005e1 vk_pipeline_cache: Add asynchronous shaders 2021-07-22 21:51:35 -04:00
ReinUsesLisp 420ec60284 vk_rasterizer: Flush work on clear and dispatches 2021-07-22 21:51:34 -04:00
FernandoS27 72c3d368cf DMA: Restrict optimised path for BlockToLinear further. 2021-07-22 21:51:34 -04:00
ReinUsesLisp 41737ccae4 vk_swapchain: Handle outdated swapchains
Fixes pixelated presentation on Intel devices.
2021-07-22 21:51:34 -04:00
FernandoS27 be4d1c9b95 shader: Fix VertexA Shaders. 2021-07-22 21:51:34 -04:00
ReinUsesLisp 64dfb4220f shader: Add 2D and 3D variants to SUATOM and SURED
Used by Claybook.
2021-07-22 21:51:34 -04:00
ReinUsesLisp 73fb56fe7e vk_buffer_cache: Handle null texture buffers
Fixes a crash on Age of Calamity cutscenes.
2021-07-22 21:51:34 -04:00
ReinUsesLisp 11fab60557 nsight_aftermath_tracker: Fix SPIR-V module writes 2021-07-22 21:51:34 -04:00
ReinUsesLisp 99e3490f64 vk_pipeline_cache: Set support_derivative_control to true 2021-07-22 21:51:34 -04:00
ReinUsesLisp 1dd4302fac shader: Avoid CPU side undefined behavior on I2F 2021-07-22 21:51:34 -04:00
ReinUsesLisp 5fa6d7a3b9 glasm: Use ARB_derivative_control conditionally 2021-07-22 21:51:34 -04:00
ReinUsesLisp 535fb4e6b5 buffer_cache: Reduce uniform buffer size from shader usage
Increases performance significantly on certain titles.
2021-07-22 21:51:34 -04:00
ReinUsesLisp 914bc0deb9 transform_feedback: Read buffer stride from index instead of layout 2021-07-22 21:51:34 -04:00
ReinUsesLisp bbc537fec0 fixed_pipeline_state: Use regular for loop instead of ranges for perf
MSVC generates better code for it.
2021-07-22 21:51:34 -04:00
ReinUsesLisp 5593b029d4 vk_swapchain: Avoid recreating the swapchain on each frame
Recreate only when requested (or sRGB is changed) instead of tracking
the frontend's size. That size is still used as a hint.
2021-07-22 21:51:34 -04:00
lat9nq 6e9eab2c32 emit_glasm_context_get_set: Remove unused variable 2021-07-22 21:51:34 -04:00
ReinUsesLisp 34d1a2ffe5 shader,glasm: Implement legacy texcoord loads 2021-07-22 21:51:34 -04:00
ReinUsesLisp b9a0a742fa glasm: Implement legacy varyings 2021-07-22 21:51:34 -04:00
ReinUsesLisp bebebf3fa8 shader: Track legacy varyings 2021-07-22 21:51:34 -04:00
ReinUsesLisp 4744a21bd4 shader: Add support for "negative" and unaligned offsets
"Negative" offsets don't exist. They are shown as such due to a bug in
nvdisasm.

Unaligned offsets have been proved to read the aligned offset. For
example, when reading an U32, if the offset is 6, the offset read will
be 4.
2021-07-22 21:51:34 -04:00
ReinUsesLisp e3aedea124 shader: Implement ISCADD32I 2021-07-22 21:51:34 -04:00
ReinUsesLisp d27dbec3e6 spirv: Fix output generics with components 2021-07-22 21:51:34 -04:00
ReinUsesLisp ccea376e34 vulkan: Conditionally use shaderInt16
Add support for Polaris AMD devices.
2021-07-22 21:51:34 -04:00
ReinUsesLisp 7207ef07f4 vulkan: Enable depth bounds and use it conditionally
Intel devices pre-Xe don't support this.
2021-07-22 21:51:34 -04:00
ReinUsesLisp e7bf692f9e vk_buffer_cache: Add transform feedback usage to buffers 2021-07-22 21:51:34 -04:00
ReinUsesLisp 9750e0410b opengl: Declare fragment outputs even if they are not used
Fixes Ori and the Blind Forest's menu on GLASM. For some reason
(probably high level optimizations) it is not sanitized on SPIR-V for
OpenGL. Vulkan is unaffected by this change.
2021-07-22 21:51:34 -04:00
ReinUsesLisp ebfbb5e09f buffer_cache: Mark uniform buffers as dirty if any enable bit changes 2021-07-22 21:51:34 -04:00
ReinUsesLisp 142d4f3f6e shader: Always initialize up reference in structure control flow
Fixes ubsan issue.
2021-07-22 21:51:34 -04:00
ReinUsesLisp ae786ee784 vulkan_device: Enable float64 and int64 conditionally
Add Intel Xe support.
2021-07-22 21:51:34 -04:00
ReinUsesLisp 6e475617d5 shader: Fix ImageWrite indexing 2021-07-22 21:51:34 -04:00
ReinUsesLisp f7508aa014 spirv: Fix image and image buffer descriptor index usage 2021-07-22 21:51:34 -04:00
ReinUsesLisp bd96e0a436 glasm: Fix immediate texture coordinate 2021-07-22 21:51:34 -04:00
ReinUsesLisp 74df00415a shader: Clang-format secondary textures 2021-07-22 21:51:34 -04:00
ReinUsesLisp f19403bafa shader: Fix secondary textures 2021-07-22 21:51:34 -04:00
ameerj 6bb1f54fbb shader: Adhere to disk shader cache setting 2021-07-22 21:51:34 -04:00
ReinUsesLisp 8ea552e64e shader: Fix TMML queries 2021-07-22 21:51:34 -04:00
ReinUsesLisp ca3e927e35 shader: Fix FSwizzleAdd folding when going through phi nodes 2021-07-22 21:51:34 -04:00
ReinUsesLisp 7ad72d78dd shader/exception: Fix compilation errors on gcc 2021-07-22 21:51:34 -04:00
ReinUsesLisp 1a02dee23a glasm: Reduce reg allocation leaks from an exception to a log 2021-07-22 21:51:34 -04:00
ReinUsesLisp 60e44af24d texture_cache: Reduce invalid image/sampler error severity 2021-07-22 21:51:34 -04:00
ReinUsesLisp 672930b6c8 shader: Handle host exceptions 2021-07-22 21:51:34 -04:00
ReinUsesLisp 50e491f101 glasm: Use integer lod for TXQ 2021-07-22 21:51:33 -04:00
ReinUsesLisp e3d10ba821 glasm: Prepare XFB from state instead of global registers 2021-07-22 21:51:33 -04:00
ReinUsesLisp 5339775f96 glasm: Fix global memory fallbacks 2021-07-22 21:51:33 -04:00
ReinUsesLisp 0ca75be20a Revert "glasm: Skip phi moves on undefined instructions"
Causes regressions on Bowser's Fury.
2021-07-22 21:51:33 -04:00
ReinUsesLisp e607d856c2 glasm: Remove unintentional '\n' on Undef32 2021-07-22 21:51:33 -04:00
ReinUsesLisp df14567fcc glasm: Use storage buffers instead of global memory when possible 2021-07-22 21:51:33 -04:00
ReinUsesLisp ec19b0d7eb glasm: Implement Y direction 2021-07-22 21:51:33 -04:00
ReinUsesLisp 459e3b17e6 glasm: Skip phi moves on undefined instructions 2021-07-22 21:51:33 -04:00
ReinUsesLisp 91a375b557 glasm: Implement undef instructions 2021-07-22 21:51:33 -04:00
ReinUsesLisp 93b8943fae glasm: Fix global memory callbacks 2021-07-22 21:51:33 -04:00
ReinUsesLisp 58b5083052 gl_shader_cache: Add disk shader cache 2021-07-22 21:51:33 -04:00
ReinUsesLisp 205bf15e71 video_core,shader: Clang-format fixes 2021-07-22 21:51:33 -04:00
ReinUsesLisp ddb24146b6 gl_shader_cache: Rename Program abstractions into Pipeline 2021-07-22 21:51:33 -04:00
ReinUsesLisp 3e5b0c116d glasm: Release phi node registers after they are no longer needed 2021-07-22 21:51:33 -04:00
ReinUsesLisp d284ce48e2 glasm: Remove unintentionally committed fmt::prints 2021-07-22 21:51:33 -04:00
ReinUsesLisp 8d77a943cc glasm: Fix INeg32 on negative immediates 2021-07-22 21:51:33 -04:00
ReinUsesLisp 42a91d4366 glasm: Remove unnecessary value types 2021-07-22 21:51:33 -04:00
ReinUsesLisp 6bf6015548 glasm: Throw when there are register leaks 2021-07-22 21:51:33 -04:00
ReinUsesLisp 143db4b112 glasm: Catch more register leaks
Add support for null registers. These are used when an instruction has
no usages.

This comes handy when an instruction is only used for its CC value, with
the caveat of having to invalidate all pseudo-instructions before
defining the instruction itself in the register allocator. This commits
changes this.

Workaround a bug on Nvidia's condition codes conditional execution using
branches.
2021-07-22 21:51:33 -04:00
ReinUsesLisp a5ce5f4a65 glasm: Fix usage counting on phi nodes 2021-07-22 21:51:33 -04:00
ReinUsesLisp 921b6b48be gl_shader_cache: Do not flip tessellation on OpenGL 2021-07-22 21:51:33 -04:00
ReinUsesLisp 548871e127 gl_graphics_program: Fix texture buffer bindings 2021-07-22 21:51:33 -04:00
ReinUsesLisp 09ad2b5994 glasm: Implement global memory fallbacks 2021-07-22 21:51:33 -04:00
ReinUsesLisp 46edc93371 glasm: Implement int64 add and subtract 2021-07-22 21:51:33 -04:00
lat9nq 90e2710052 emit_glasm_context_get_set: Remove unused variable 2021-07-22 21:51:33 -04:00
ReinUsesLisp e9a5390a92 glasm: Implement indirect attribute loads 2021-07-22 21:51:33 -04:00
ReinUsesLisp 2e2d1986b1 glasm: Implement image atomics 2021-07-22 21:51:33 -04:00
ReinUsesLisp 9a2176f883 glasm: Reorder unreachable image atomic insts
Reorder them to the bottom of the file for readability.
2021-07-22 21:51:33 -04:00
ReinUsesLisp 26ba81b9bf glasm: Implement gl_Layer stores 2021-07-22 21:51:33 -04:00
ReinUsesLisp dd41025472 glasm: Implement SampleId 2021-07-22 21:51:33 -04:00
ReinUsesLisp 5f9dd18113 glasm: Implement IsHelperInvocation 2021-07-22 21:51:33 -04:00
ReinUsesLisp b0b43d2a66 glasm: Fix EmitVertex's optimization 2021-07-22 21:51:33 -04:00
ReinUsesLisp 712afb51d4 gl_shader_cache: Conditionally use viewport mask 2021-07-22 21:51:33 -04:00
ReinUsesLisp 94d3b4d7e3 gl_shader_cache,glasm: Conditionally use typeless image reads extension 2021-07-22 21:51:33 -04:00
ReinUsesLisp 8aa7240b7f gl_shader_cache: Improve GLASM error print logic 2021-07-22 21:51:33 -04:00
ReinUsesLisp 16c95ab56d glasm: Implement forced early Z 2021-07-22 21:51:33 -04:00
ReinUsesLisp 220e679fdf glasm: Set transform feedback state 2021-07-22 21:51:33 -04:00
ReinUsesLisp 06ae1bff4b video_core: Abstract transform feedback translation utility 2021-07-22 21:51:33 -04:00
ReinUsesLisp 9960abf482 glasm: Simplify patch reads 2021-07-22 21:51:33 -04:00
ReinUsesLisp 8499797b68 glasm: Fix output patch reads
With this, Luigi's Mansion's sand renders properly.
2021-07-22 21:51:33 -04:00
ReinUsesLisp c45503bcb7 gl_shader_cache: Pass shader runtime information 2021-07-22 21:51:33 -04:00
ReinUsesLisp 9452fe2dc6 shader: Split profile and runtime information in separate structs 2021-07-22 21:51:33 -04:00
ameerj 22f261e954 emit_glasm_context_get_and_set.cpp: Add missing semicolons 2021-07-22 21:51:33 -04:00
ReinUsesLisp 83ff44531b glasm: Fix patch attribute declarations 2021-07-22 21:51:33 -04:00
ameerj 68fb25a223 glasm: Implement FSWZADD 2021-07-22 21:51:33 -04:00
ReinUsesLisp 8fa82725d1 glasm: Implement PrimitiveId attribute read 2021-07-22 21:51:33 -04:00
ReinUsesLisp 62f0368ce4 glasm: Implement clip distance stores 2021-07-22 21:51:32 -04:00
ReinUsesLisp 7d0baaa1c9 glasm: Fix tessellation input attributes 2021-07-22 21:51:32 -04:00
ReinUsesLisp 35db68e859 glasm: Add missing semicolon on tesscoord reading 2021-07-22 21:51:32 -04:00
ReinUsesLisp 53705226c6 glasm: Fix tessellation headers 2021-07-22 21:51:32 -04:00
ReinUsesLisp e8289a4e5f glasm: Add tessellation shader declarations 2021-07-22 21:51:32 -04:00