Commit Graph

17183 Commits

Author SHA1 Message Date
ameerj 1d2c13fd7b glsl: Address rest of feedback 2021-07-22 21:51:38 -04:00
ameerj 52bd1d7788 glsl: Move gl_Position/generic attribute initialization to EmitProlgue 2021-07-22 21:51:38 -04:00
ameerj bc50a9ef20 glsl: Conditionally use fine/coarse derivatives based on device support 2021-07-22 21:51:38 -04:00
ameerj 4e73fdbd0f glsl: Cleanup/Address feedback 2021-07-22 21:51:38 -04:00
ameerj 7e661303d5 gl_shader_cache: Implement async shaders 2021-07-22 21:51:38 -04:00
ameerj d344489b5b glsl: Add Shader_GLSL logging 2021-07-22 21:51:38 -04:00
ameerj c44b3f664d glsl: Add LoopSafety instructions 2021-07-22 21:51:38 -04:00
ameerj 50e1ced397 glsl: Conditionally add EXT_texture_shadow_lod 2021-07-22 21:51:38 -04:00
ameerj b33af69513 glsl: Add stubs for sparse queries and variable aoffi when not supported 2021-07-22 21:51:38 -04:00
ameerj 3e6f89f964 glsl: Implement legacy varyings 2021-07-22 21:51:38 -04:00
ameerj 18aae22ad2 gl_shader_cache: Remove const from pipeline source arguments 2021-07-22 21:51:38 -04:00
ameerj 07a59e1404 gl_shader_cache: Move OGL shader compilation to the respective Pipeline constructor 2021-07-22 21:51:38 -04:00
ameerj 67cc50be47 glsl: Minor cleanup 2021-07-22 21:51:38 -04:00
ameerj 5e9b073176 glsl: Fix Cbuf getters for F32 type 2021-07-22 21:51:38 -04:00
ameerj 152f718017 glsl: Add immediate index oob checking for Cbuf getters 2021-07-22 21:51:38 -04:00
ameerj 163ce47cb1 glsl: Refactor GetCbuf functions to reduce code duplication 2021-07-22 21:51:38 -04:00
ameerj 7bf5c1164e glsl: Address more feedback. Implement indexed texture reads 2021-07-22 21:51:38 -04:00
ameerj 73278ba985 glsl: Remove Signed Integer variables 2021-07-22 21:51:38 -04:00
ameerj 5d2cd1551f glsl: Address Rodrigo's feedback 2021-07-22 21:51:38 -04:00
ameerj 8ab7780015 glsl: Reorganize backend code, remove unneeded [[maybe_unused]] 2021-07-22 21:51:37 -04:00
ameerj b247baab26 glsl: Implement SampleId and SetSampleMask
plus some minor refactoring of implementations
2021-07-22 21:51:37 -04:00
ameerj a2f864493b glsl: Add gl_PerVertex in for GS 2021-07-22 21:51:37 -04:00
ameerj 5eb36b0913 glsl: Use existing tracking for enabling EXT_shader_image_load_formatted 2021-07-22 21:51:37 -04:00
ameerj 42ac60591e glsl: Enable early fragment tests 2021-07-22 21:51:37 -04:00
ameerj 3ad05ecd4e gl_rasterizer: Add texture fetch barrier for fragments
Fixes flicker seen in XC2
2021-07-22 21:51:37 -04:00
ameerj 95aedb5258 glsl: Implement more attribute getters and setters 2021-07-22 21:51:37 -04:00
ameerj 656de6639c glsl: Implement fswzadd
and wip nv thread shuffle impl
2021-07-22 21:51:37 -04:00
ameerj ccd4becb79 glsl: Implement indexed attribute loads 2021-07-22 21:51:37 -04:00
ameerj 819ae85298 glsl: Conditionally add GL_ARB_sparse_texture2 2021-07-22 21:51:37 -04:00
ameerj c800b9bf92 glsl: Rebase fixes 2021-07-22 21:51:37 -04:00
ameerj 5292962d7e glsl: Conditionally use GL_EXT_shader_image_load_formatted
Fix for SULD.D
2021-07-22 21:51:37 -04:00
ameerj 6e4ed00e8d glsl: Remove output generic indexing for geometry stage 2021-07-22 21:51:37 -04:00
ameerj 3319879b23 glsl: Allow dynamic tracking of variable allocation 2021-07-22 21:51:37 -04:00
ameerj 1017c12427 glsl: Implement barriers 2021-07-22 21:51:37 -04:00
ameerj b3a46a3746 glsl: Implement image atomics and set layer
along with some more cleanup/oversight fixes
2021-07-22 21:51:37 -04:00
ameerj d01344c008 glsl: Fix image gather logic 2021-07-22 21:51:37 -04:00
ameerj fd55ca9828 glsl: Add cbuf access workaround for devices with component indexing bug 2021-07-22 21:51:37 -04:00
ameerj 8c9d420fa5 glsl: Use textureGrad fallback when EXT_texture_shadow_lod is unsupported 2021-07-22 21:51:37 -04:00
ameerj f56a276e79 emit_glsl_image: Use immediate offsets when possible 2021-07-22 21:51:37 -04:00
ameerj 8894af7c06 glsl: Fix <32-bit SSBO writes
and more cleanup
2021-07-22 21:51:37 -04:00
ameerj 4534294b7b glsl: Cleanup and address feedback 2021-07-22 21:51:37 -04:00
ameerj bef3820fb0 glsl: Refactor Global memory functions 2021-07-22 21:51:37 -04:00
ameerj dfa7abe1e7 glsl: Increase NUM_VARS that can be allocated
needed for HW:AoC.
2021-07-22 21:51:37 -04:00
ameerj 2e8da9d3be glsl: Implement Load/WriteGlobal
along with some other misc changes and fixes
2021-07-22 21:51:37 -04:00
ameerj d19a49485a glsl: Implement Images 2021-07-22 21:51:37 -04:00
ameerj 0c162d8b17 glsl: skip gl_ViewportIndex write if device does not support it 2021-07-22 21:51:37 -04:00
ameerj f54240823c glsl: Implement transform feedback 2021-07-22 21:51:37 -04:00
ameerj 922ea01123 glsl: Yet another gl_ViewportIndex fix attempt 2021-07-22 21:51:37 -04:00
ameerj 1736a7e162 glsl: Add gl_ViewportIndex out attribute 2021-07-22 21:51:37 -04:00
lat9nq 503159f29b emit_glsl_context_get_set: Remove unused function 2021-07-22 21:51:37 -04:00
ameerj 363e228778 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
ameerj e866cece98 glsl: Implement tessellation shaders 2021-07-22 21:51:37 -04:00
ameerj 5c73bf453c glsl: Implement ImageGradient and other texture function variants 2021-07-22 21:51:37 -04:00
ameerj 8d8c104d4f glsl: Fix atomic SSBO offsets
and implement misc getters
2021-07-22 21:51:37 -04:00
ameerj 7374a8bf1d glsl: Implement geometry shaders 2021-07-22 21:51:37 -04:00
ameerj 43426d170c glsl: Use NotImplemented macro with function name output 2021-07-22 21:51:37 -04:00
ameerj aa06d8fa05 glsl: Implement gl_ViewportIndex
SSBU now working
2021-07-22 21:51:37 -04:00
ameerj badacf0a7e glsl: SHFL fix and prefer shift operations over divide in glsl shader 2021-07-22 21:51:37 -04:00
ameerj 00105f0615 glsl: Implement precise fp variable allocation 2021-07-22 21:51:37 -04:00
ameerj 1cc3be2135 HACK glsl: Write defaults to unused generic attributes 2021-07-22 21:51:37 -04:00
ameerj 12b9b923e1 glsl: Fix ssbo indexing and name shadowing between shader stages 2021-07-22 21:51:37 -04:00
ameerj c6615e9d05 glsl: implement set clip distance
and missed a diff in emit_glsl relating to var alloc ref counting
2021-07-22 21:51:37 -04:00
ameerj 33f63cdc22 glsl: Rework var alloc to not assign unused results 2021-07-22 21:51:37 -04:00
ameerj 8185a5ab34 glsl: Rework variable allocator to allow for variable reuse 2021-07-22 21:51:37 -04:00
ameerj 748e56e8a2 glsl: Fix ATOM and implement ATOMS 2021-07-22 21:51:37 -04:00
ameerj f91616b31a glsl: Use gl_SubGroupInvocationARB 2021-07-22 21:51:36 -04:00
ameerj ee44e94932 glsl: Implement VOTE for subgroup size potentially larger 2021-07-22 21:51:36 -04:00
ameerj 5a3864d8c4 glsl: Implement VOTE 2021-07-22 21:51:36 -04:00
ameerj 1e59e72a48 glsl: Implement ST{LS} 2021-07-22 21:51:36 -04:00
ameerj d7213c862e glsl: Implement more instructions used by SMO 2021-07-22 21:51:36 -04:00
ameerj 3795c56db6 glsl: Implement more instructions used by SMO 2021-07-22 21:51:36 -04:00
ameerj 26649eb889 glsl: Fix GetAttribute return values
fixes font rendering issues as these were used to index into the ssbos
2021-07-22 21:51:36 -04:00
ameerj 8a7d7d16c8 glsl: minor cleanup 2021-07-22 21:51:36 -04:00
ameerj 0ac1a68a36 glsl: Fix and implement rest of cbuf access 2021-07-22 21:51:36 -04:00
ameerj 0b8e65125a glsl: Implement TXQ and other misc changes 2021-07-22 21:51:36 -04:00
ameerj 5a4af6cf14 glsl: TLD4 implementation 2021-07-22 21:51:36 -04:00
ameerj 81c2595a33 glsl: Implement TLD instruction 2021-07-22 21:51:36 -04:00
ameerj db039e6271 glsl: Implement TEXS 2021-07-22 21:51:36 -04:00
ameerj b3253f6f44 glsl: Cleanup texture functions 2021-07-22 21:51:36 -04:00
lat9nq fc7edccbc1 shader_recompiler: GCC fixes 2021-07-22 21:51:36 -04:00
ameerj 08935e289f glsl: Implement TEX depth functions 2021-07-22 21:51:36 -04:00
ameerj b055e4a91e glsl: Implement TEX ImageSample functions 2021-07-22 21:51:36 -04:00
ameerj 8c9c79a8c6 glsl: Rework Shuffle emit instructions to align with SPIR-V 2021-07-22 21:51:36 -04:00
ameerj a68609b4f8 glsl: Better Storage access and wip warps 2021-07-22 21:51:36 -04:00
ameerj a28096cb70 glsl: Fix integer conversions, implement clamp CC 2021-07-22 21:51:36 -04:00
ameerj fa06331601 glsl: Implement IADD CC 2021-07-22 21:51:36 -04:00
ameerj 54778aa10a glsl: SSBO access fixes and wip SampleExplicitLod implementation. 2021-07-22 21:51:36 -04:00
ameerj 72974388fb glsl: WIP var forward declaration
to fix Loop control flow.
2021-07-22 21:51:36 -04:00
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
ReinUsesLisp 539a4ef59c glasm: Implement TessellationEvaluationPoint 2021-07-22 21:51:32 -04:00
ReinUsesLisp d4bc962012 gl_shader_manager: Zero initialize current assembly programs 2021-07-22 21:51:32 -04:00
ReinUsesLisp bde1749606 gl_shader_manager: Remove unintentionally committed #pragma 2021-07-22 21:51:32 -04:00
ReinUsesLisp 2e5002f0bf glasm: Implement patch memory 2021-07-22 21:51:32 -04:00
ReinUsesLisp deb47706e9 glasm: Fix InvocationId declaration 2021-07-22 21:51:32 -04:00
ReinUsesLisp 24e3128420 glasm: Implement InvocationId 2021-07-22 21:51:32 -04:00
ReinUsesLisp 8db0554dc6 glasm: Optimize EmitVertex into EMIT 2021-07-22 21:51:32 -04:00
ReinUsesLisp 2268a150ce glasm: Implement geometry shader attribute reads 2021-07-22 21:51:32 -04:00
ReinUsesLisp 2c0780b9fa glasm: Properly declare attributes on geometry programs 2021-07-22 21:51:32 -04:00
ReinUsesLisp 1efc77e510 glasm: Declare geometry program headers 2021-07-22 21:51:32 -04:00
ReinUsesLisp 1ec230efae renderer_opengl: State track compute assembly programs 2021-07-22 21:51:32 -04:00
ReinUsesLisp e21983ce24 renderer_opengl: State track assembly programs 2021-07-22 21:51:32 -04:00
ReinUsesLisp bbc4c8e6b6 glasm: Fix potential aliasing bug on cube array samples 2021-07-22 21:51:32 -04:00
ReinUsesLisp ea029df649 glasm: Implement ImageWrite 2021-07-22 21:51:32 -04:00
ReinUsesLisp 96d2dd78b0 glasm: Implement ImageRead 2021-07-22 21:51:32 -04:00
ReinUsesLisp 1426ed05b0 glasm: Implement EmitVertex and EndPrimitive 2021-07-22 21:51:32 -04:00
ReinUsesLisp 9c318fe58b glasm: Implement ImageGradient 2021-07-22 21:51:32 -04:00
ReinUsesLisp d95e33ac44 glasm: Implement 64-bit shifts 2021-07-22 21:51:32 -04:00
ReinUsesLisp 65e81c75e9 glasm: Implement barriers 2021-07-22 21:51:32 -04:00
ReinUsesLisp e63efa1b56 glasm: Fix compute stage name 2021-07-22 21:51:32 -04:00
ReinUsesLisp e59778c5e5 glasm: Fix phi instruction types 2021-07-22 21:51:32 -04:00
ReinUsesLisp 6493d900ce glasm: Implement PREC on relevant instructions 2021-07-22 21:51:32 -04:00
ReinUsesLisp 601f7bfd00 glasm: Implement stores to gl_ViewportIndex 2021-07-22 21:51:32 -04:00
ReinUsesLisp 0f180aaaa8 glasm: Implement gl_PointSize stores 2021-07-22 21:51:32 -04:00
ReinUsesLisp 05bd52b119 glasm: Implement gl_PointCoord 2021-07-22 21:51:32 -04:00
ReinUsesLisp 9dfad89884 glasm: Implement ImageQueryLod 2021-07-22 21:51:32 -04:00
ReinUsesLisp 1e64cbd23a glasm: Implement ImageFetch 2021-07-22 21:51:32 -04:00
ameerj a9a9dddd34 glasm: Implement IADD.CC 2021-07-22 21:51:32 -04:00
ReinUsesLisp abcdcde851 glasm: Implement BFE.CC 2021-07-22 21:51:32 -04:00
ReinUsesLisp cfa232a5a5 glasm: Implement SelectU1 2021-07-22 21:51:32 -04:00
ReinUsesLisp 5d24aadff0 HACK: Bind stages before and after bindings
Works around a bug where program parameters are only applied to the
current stage, and this one wasn't bound at the moment.

Affects all SSBO usages on GLASM.
2021-07-22 21:51:32 -04:00
ReinUsesLisp 089e3a82b3 glasm: Implement gl_WorkGroupID 2021-07-22 21:51:32 -04:00
ReinUsesLisp 50dda4164a glasm: Implement TXQ and improve texture info reads 2021-07-22 21:51:32 -04:00
ReinUsesLisp bf1ad74e8a glasm: Implement gl_FrongFacing attribute 2021-07-22 21:51:32 -04:00
ReinUsesLisp 0c82ee3444 glasm: Support textures used in more than one stage 2021-07-22 21:51:32 -04:00
ReinUsesLisp e4835094aa glasm: Implement textureGather instructions 2021-07-22 21:51:32 -04:00
ReinUsesLisp 98b4463dbb glasm: Implement gl_FragDepth and gl_SampleMask stores 2021-07-22 21:51:32 -04:00
ReinUsesLisp c455c92d76 glasm: Do not alias ConditionRef for now
Immediate condition refs where not handled correctly. Just move the
value for now.
2021-07-22 21:51:32 -04:00
ReinUsesLisp 5c6dc51c69 shader: Read branch conditions from an instruction
Fixes the identity removal pass.
2021-07-22 21:51:32 -04:00
ReinUsesLisp 43bca14217 glasm: Implement InstanceId and VertexId 2021-07-22 21:51:31 -04:00
ReinUsesLisp 7c24546332 glasm: Add missing return value on move assignment 2021-07-22 21:51:31 -04:00
ReinUsesLisp 64039f6f4b glasm: Fix aliased bitcasts ref counting 2021-07-22 21:51:31 -04:00
ReinUsesLisp 03fc0f42c6 glasm: Remove unintentional comma on vector insert 2021-07-22 21:51:31 -04:00
ReinUsesLisp 0b3a3f35e8 glasm: Implement TEX and TEXS instructions
Remove lod clamp from texture instructions with lod, as this is not
needed (nor supported).
2021-07-22 21:51:31 -04:00
ReinUsesLisp 3d82b30141 glasm: Add support for non-2D texture samples 2021-07-22 21:51:31 -04:00
ReinUsesLisp 9ddbdd90e1 glasm: Reorder unreachable image instructions to the bottom 2021-07-22 21:51:31 -04:00
ReinUsesLisp 771490ebac glasm: Add support for texture offsets 2021-07-22 21:51:31 -04:00
ReinUsesLisp 009721f477 glasm: Improve texture sampling instructions 2021-07-22 21:51:31 -04:00
ReinUsesLisp 22fb9cc538 emit_glasm: Enable ARB_draw_buffers when needed 2021-07-22 21:51:31 -04:00
ReinUsesLisp 059e91d5da emit_glasm: Add support for reading position attributes 2021-07-22 21:51:31 -04:00
lat9nq 69210028b4 shader_recompiler: GCC fixes
Fixes members of unnamed union not being accessible, and one function
without a declaration.
2021-07-22 21:51:31 -04:00
ameerj be403ea956 glasm: Implement rest of shared mem 2021-07-22 21:51:31 -04:00
ReinUsesLisp e45e4d02d3 opengl: Initial (broken) support to GLASM shaders 2021-07-22 21:51:31 -04:00
ReinUsesLisp f2ab3993eb shader: Use a non-trivial dummy to construct ASL node union 2021-07-22 21:51:31 -04:00
ReinUsesLisp 6be1db8873 emit_spirv: Jump to loop body with local variable
Silence unused variable warning
2021-07-22 21:51:31 -04:00
ReinUsesLisp 87c847ddc3 glasm: Implement derivative instructions on GLASM 2021-07-22 21:51:31 -04:00
ReinUsesLisp 6a524ebac6 glasm: Initial (broken) implementation of TEX on GLASM 2021-07-22 21:51:31 -04:00
ReinUsesLisp b31edad7a9 glasm: Implement some graphics instructions on GLASM 2021-07-22 21:51:31 -04:00
ReinUsesLisp 58cf7baaea glasm: Add Void type to GLASM values 2021-07-22 21:51:31 -04:00
ReinUsesLisp 6758e3d946 glasm: Add graphics specific shader declarations to GLASM 2021-07-22 21:51:31 -04:00
ameerj d0c4cca02d glasm: Implement local memory for glasm 2021-07-22 21:51:31 -04:00
ReinUsesLisp cb344497a7 emit_spirv: Add missing block in case 2021-07-22 21:51:31 -04:00