Commit graph

17032 commits

Author SHA1 Message Date
ReinUsesLisp 57a8921e01 vk_graphics_pipeline: Implement line width 2021-07-22 21:51:39 -04:00
ReinUsesLisp 5b2b0634a1 spirv: Fix code emission when descriptor aliasing is unsupported
Fixes OpenGL.
2021-07-22 21:51:39 -04:00
lat9nq fb9b1787f8 video_core: Enable GL SPIR-V shaders 2021-07-22 21:51:39 -04:00
lat9nq 1152d66ddd general: Add setting shader_backend
GLASM is getting good enough that we can move it out of advanced
graphics settings. This removes the setting `use_assembly_shaders`,
opting for a enum class `shader_backend`. This comes with the benefits
that it is extensible for additional shader backends besides GLSL and
GLASM, and this will work better with a QComboBox.

Qt removes the related assembly shader setting from the Advanced
Graphics section and places it as a new QComboBox in the API Settings
group. This will replace the Vulkan device selector when OpenGL is
selected.

Additionally, mark all of the custom anisotropic filtering settings as
"WILL BREAK THINGS", as that is the case with a select few games.
2021-07-22 21:51:39 -04:00
ameerj 00fa09dc45 glsl: Declare local memory in main 2021-07-22 21:51:39 -04:00
ameerj f7352411f0 glsl: Add passthrough geometry shader support 2021-07-22 21:51:39 -04:00
ReinUsesLisp 8612b5fec5 shader: Use std::bit_cast instead of Common::BitCast for passthrough 2021-07-22 21:51:39 -04:00
ReinUsesLisp 8a3427a4c8 glasm: Add passthrough geometry shader support 2021-07-22 21:51:39 -04:00
ReinUsesLisp 7dafa96ab5 shader: Rework varyings and implement passthrough geometry shaders
Put all varyings into a single std::bitset with helpers to access it.

Implement passthrough geometry shaders using host's.
2021-07-22 21:51:39 -04:00
ReinUsesLisp 4f052a1f39 vk_graphics_pipeline: Implement conservative rendering 2021-07-22 21:51:39 -04:00
ReinUsesLisp ecd6b4356b shader: Only verify shader when graphics debugging is enabled 2021-07-22 21:51:39 -04:00
ReinUsesLisp 395bed3a0a shader: Unify shader stage types 2021-07-22 21:51:39 -04:00
lat9nq 257d2aab74 lower_int64_to_int32: Add missing include 2021-07-22 21:51:39 -04:00
ReinUsesLisp fb166b5ff4 shader: Emulate 64-bit integers when not supported
Useful for mobile and Intel Xe devices.
2021-07-22 21:51:39 -04:00
ReinUsesLisp d8d5501459 shader: Add int64 to int32 lowering pass 2021-07-22 21:51:39 -04:00
ReinUsesLisp 04ef2160f9 shader: Teach global memory base tracker to follow vectors 2021-07-22 21:51:39 -04:00
ReinUsesLisp 97e80dda55 shader: Add constant propagation to integer vectors 2021-07-22 21:51:39 -04:00
ameerj 27ca8a0e13 glsl: Better IAdd Overflow CC fix
This ensures the original operand values are not overwritten when being used in the overflow detection.
2021-07-22 21:51:39 -04:00
ReinUsesLisp 4397053d5c shader: Remove IAbs64 2021-07-22 21:51:39 -04:00
ameerj bc6e399ae3 glsl: Fix IADD CC 2021-07-22 21:51:39 -04:00
ameerj a7536825df shader_recompiler: Fix IADD3 input partitioning 2021-07-22 21:51:39 -04:00
ReinUsesLisp 808ef97a08 shader: Move loop safety tests to code emission 2021-07-22 21:51:39 -04:00
ReinUsesLisp 3877918e96 gl_graphics_pipeline: Fix assembly shaders check for transform feedbacks 2021-07-22 21:51:39 -04:00
ameerj cbce9ddd4a glsl: Remove frag color initialization 2021-07-22 21:51:39 -04:00
ameerj 3a2dd1b483 glasm: Implement SetAttribute ViewportMask 2021-07-22 21:51:39 -04:00
ReinUsesLisp 9bd0531384 gl_graphics_pipeline: Inline hash and operator== key functions 2021-07-22 21:51:39 -04:00
ReinUsesLisp f5db8c7440 gl_shader_cache: Check previous pipeline before checking hash map
Port optimization from Vulkan.
2021-07-22 21:51:39 -04:00
ReinUsesLisp 218dedca1f gl_graphics_pipeline: Port optimizations from Vulkan pipelines 2021-07-22 21:51:39 -04:00
ameerj 1c648f176c emit_glsl_special: Skip initialization of frag_color0
Fixes rendering in Devil May Cry without regressing Ori and the Blind Forest.
2021-07-22 21:51:38 -04:00
ReinUsesLisp 1d182fc0f5 shader: Calibrate loop safety threshold 2021-07-22 21:51:38 -04:00
ReinUsesLisp df9b7e18f5 buffer_cache: Fix debugging leftover 2021-07-22 21:51:38 -04:00
Morph cfbc85839d glsl: Add missing ; in EmitSetSampleMask
Fixes shader compilation in Okami HD
2021-07-22 21:51:38 -04:00
ReinUsesLisp 838d7e4ca5 buffer_cache: Fix size reductions not having in mind bind sizes
A buffer binding can change between shaders without changing the
shaders. This lead to outdated bindings on OpenGL.
2021-07-22 21:51:38 -04:00
ameerj 9e066dcb15 glsl: Fix output varying initialization when transform feedback is used 2021-07-22 21:51:38 -04:00
ameerj fcff19e0fa shaders: Allow shader notify when async shaders is disabled 2021-07-22 21:51:38 -04:00
ameerj a0365217f5 texture_pass: Fix is_read image qualification
Atomic operations are considered to have both read and write access. This was not  being accounted for.
2021-07-22 21:51:38 -04:00
ReinUsesLisp 0cd08b3e72 shader: Align constant buffer sizes to 16 bytes
WAR for AMD reading zeroes on uniform buffers of size 2.
2021-07-22 21:51:38 -04:00
ReinUsesLisp 59fead3a47 spirv: Properly handle devices without int8 and int16 2021-07-22 21:51:38 -04:00
ReinUsesLisp b5e78607ad spirv: Handle small storage buffer loads on devices with no support 2021-07-22 21:51:38 -04:00
ReinUsesLisp ca67077ca8 vk_graphics_pipeline: Use VK_KHR_push_descriptor when available
~51% faster on Nvidia compared to previous method.
2021-07-22 21:51:38 -04:00
ameerj ccbd24fe00 glsl: Fix cbuf component indexing bug falback 2021-07-22 21:51:38 -04:00
ReinUsesLisp 1091995f8e shader: Simplify MergeDualVertexPrograms 2021-07-22 21:51:38 -04:00
ReinUsesLisp 374eeda1a3 shader: Properly manage attributes not written from previous stages 2021-07-22 21:51:38 -04:00
ReinUsesLisp 892b8aa2ad glsl: Only declare fragment outputs on fragment shaders 2021-07-22 21:51:38 -04:00
ReinUsesLisp 0ffea97e2e shader: Split profile and runtime info headers 2021-07-22 21:51:38 -04:00
ReinUsesLisp cbbca26d18 shader: Add support for native 16-bit floats 2021-07-22 21:51:38 -04:00
ReinUsesLisp 376aa94819 shader: Rename maxwell/program.h to translate_program.h 2021-07-22 21:51:38 -04:00
ReinUsesLisp 69f9b97e7e vulkan_device: Blacklist VK_EXT_vertex_input_dynamic_state on Intel 2021-07-22 21:51:38 -04:00
ameerj 12ef06ba8b glsl: Obey need_declared_frag_colors to declare and initialize all frag_color
Fixes Ori and the blind forest title screen
2021-07-22 21:51:38 -04:00
ameerj d36f667bc0 glsl: Address rest of feedback 2021-07-22 21:51:38 -04:00
ameerj c5dfa0b630 glsl: Move gl_Position/generic attribute initialization to EmitProlgue 2021-07-22 21:51:38 -04:00
ameerj 3b339fbbf6 glsl: Conditionally use fine/coarse derivatives based on device support 2021-07-22 21:51:38 -04:00
ameerj 6eea88d614 glsl: Cleanup/Address feedback 2021-07-22 21:51:38 -04:00
ameerj 74f683787e gl_shader_cache: Implement async shaders 2021-07-22 21:51:38 -04:00
ameerj ae4e452759 glsl: Add Shader_GLSL logging 2021-07-22 21:51:38 -04:00
ameerj 6c6a451d6a glsl: Add LoopSafety instructions 2021-07-22 21:51:38 -04:00
ameerj a0d0704aff glsl: Conditionally add EXT_texture_shadow_lod 2021-07-22 21:51:38 -04:00
ameerj 5e7b2b9661 glsl: Add stubs for sparse queries and variable aoffi when not supported 2021-07-22 21:51:38 -04:00
ameerj 6aa1bf7b6f glsl: Implement legacy varyings 2021-07-22 21:51:38 -04:00
ameerj ff3de0fb6b gl_shader_cache: Remove const from pipeline source arguments 2021-07-22 21:51:38 -04:00
ameerj 413eb6983f gl_shader_cache: Move OGL shader compilation to the respective Pipeline constructor 2021-07-22 21:51:38 -04:00
ameerj 39c29664f9 glsl: Minor cleanup 2021-07-22 21:51:38 -04:00
ameerj 427a2596a1 glsl: Fix Cbuf getters for F32 type 2021-07-22 21:51:38 -04:00
ameerj 7c82f20b52 glsl: Add immediate index oob checking for Cbuf getters 2021-07-22 21:51:38 -04:00
ameerj 84c86e03cd glsl: Refactor GetCbuf functions to reduce code duplication 2021-07-22 21:51:38 -04:00
ameerj e81c73a874 glsl: Address more feedback. Implement indexed texture reads 2021-07-22 21:51:38 -04:00
ameerj 7d89a82a48 glsl: Remove Signed Integer variables 2021-07-22 21:51:38 -04:00
ameerj 4759db28d0 glsl: Address Rodrigo's feedback 2021-07-22 21:51:38 -04:00
ameerj 85399e119d glsl: Reorganize backend code, remove unneeded [[maybe_unused]] 2021-07-22 21:51:37 -04:00
ameerj e7c8f8911f glsl: Implement SampleId and SetSampleMask
plus some minor refactoring of implementations
2021-07-22 21:51:37 -04:00
ameerj d1a68f7997 glsl: Add gl_PerVertex in for GS 2021-07-22 21:51:37 -04:00
ameerj a926695234 glsl: Use existing tracking for enabling EXT_shader_image_load_formatted 2021-07-22 21:51:37 -04:00
ameerj 14bd73db36 glsl: Enable early fragment tests 2021-07-22 21:51:37 -04:00
ameerj 6650c4799d gl_rasterizer: Add texture fetch barrier for fragments
Fixes flicker seen in XC2
2021-07-22 21:51:37 -04:00
ameerj 3f31a547e0 glsl: Implement more attribute getters and setters 2021-07-22 21:51:37 -04:00
ameerj 8bb8bbf4ae glsl: Implement fswzadd
and wip nv thread shuffle impl
2021-07-22 21:51:37 -04:00
ameerj c542204113 glsl: Implement indexed attribute loads 2021-07-22 21:51:37 -04:00
ameerj 2a504b4765 glsl: Conditionally add GL_ARB_sparse_texture2 2021-07-22 21:51:37 -04:00
ameerj 970fc39d98 glsl: Rebase fixes 2021-07-22 21:51:37 -04:00
ameerj fc0db612ab glsl: Conditionally use GL_EXT_shader_image_load_formatted
Fix for SULD.D
2021-07-22 21:51:37 -04:00
ameerj fb839061fb glsl: Remove output generic indexing for geometry stage 2021-07-22 21:51:37 -04:00
ameerj 258106038e glsl: Allow dynamic tracking of variable allocation 2021-07-22 21:51:37 -04:00
ameerj 465903468e glsl: Implement barriers 2021-07-22 21:51:37 -04:00
ameerj 421847cf1e glsl: Implement image atomics and set layer
along with some more cleanup/oversight fixes
2021-07-22 21:51:37 -04:00
ameerj d41aef03c7 glsl: Fix image gather logic 2021-07-22 21:51:37 -04:00
ameerj 35e78d558d glsl: Add cbuf access workaround for devices with component indexing bug 2021-07-22 21:51:37 -04:00
ameerj 747b8556a4 glsl: Use textureGrad fallback when EXT_texture_shadow_lod is unsupported 2021-07-22 21:51:37 -04:00
ameerj d12f2b8ccf emit_glsl_image: Use immediate offsets when possible 2021-07-22 21:51:37 -04:00
ameerj 0a0b0a73d8 glsl: Fix <32-bit SSBO writes
and more cleanup
2021-07-22 21:51:37 -04:00
ameerj 34fdb6471d glsl: Cleanup and address feedback 2021-07-22 21:51:37 -04:00
ameerj 5355568a2d glsl: Refactor Global memory functions 2021-07-22 21:51:37 -04:00
ameerj a68fabf6d5 glsl: Increase NUM_VARS that can be allocated
needed for HW:AoC.
2021-07-22 21:51:37 -04:00
ameerj 8d8ce24f20 glsl: Implement Load/WriteGlobal
along with some other misc changes and fixes
2021-07-22 21:51:37 -04:00
ameerj af9696059c glsl: Implement Images 2021-07-22 21:51:37 -04:00
ameerj 6577a63d36 glsl: skip gl_ViewportIndex write if device does not support it 2021-07-22 21:51:37 -04:00
ameerj f4799e8fa1 glsl: Implement transform feedback 2021-07-22 21:51:37 -04:00
ameerj 31147ffe69 glsl: Yet another gl_ViewportIndex fix attempt 2021-07-22 21:51:37 -04:00
ameerj 9f3970f837 glsl: Add gl_ViewportIndex out attribute 2021-07-22 21:51:37 -04:00
lat9nq fc29de7d5b emit_glsl_context_get_set: Remove unused function 2021-07-22 21:51:37 -04:00
ameerj 59576b82a8 glsl: Fix precise variable declaration
and add some more separation in the shader for better debugability when dumped
2021-07-22 21:51:37 -04:00