Commit Graph

16 Commits

Author SHA1 Message Date
SachinVin b5ac9e4946
Backport non-seperable disk shader from android (#5976)
* VideoCore: Backport Shader cache for non separable shaders

android: disk_shader_cache: remove redundant lookup

* disk_shader_cache: dont compile dumped shaders

* cleanup Seperable shader loading

* gl_shader_disk_cache.cpp: remove redundant checks

* Skip compiling non seperable raws

* gl_shader_manager.cpp: Skip `GLAD_GL_ARB_get_program_binary` check on GLES
2022-04-02 11:57:14 +05:30
SachinVin d4e85e2bb5
video_core: Disable disk shader cache when GL_ARB_get_program_binary is unsupported (#5785) 2021-10-03 18:57:34 +05:30
SachinVin 842031a2eb
Fix Disk shader cache when accurate multiplication is off (#5711)
* renderer_opengl.cpp: fix sanitize_mul check for disk shader cache

* Partially revert "Band-aid solution for 'Disk Shader Cache' (#5188)"

This reverts commit 2e0ce86c9e.

* Disable `disk_shader_cache` checkbox when `hw_renderer` is off
2021-05-16 10:45:02 +02:00
Vitor Kiguchi 981ffb5090 shader_disk_cache: warn the user when ARB_get_program_binary is not supported. 2021-04-06 00:19:59 -03:00
FearlessTobi 20139141f7 video_core: Remove unnecessary enum class casting in logging messages
fmt now automatically prints the numeric value of an enum class member by default, so we don't need to use casts any more.

Reduces the line noise in our code a bit.

Co-Authored-By: LC <712067+lioncash@users.noreply.github.com>
2020-12-28 16:50:23 +01:00
tywald 2e0ce86c9e
Band-aid solution for 'Disk Shader Cache' (#5188)
* Enable 'Accurate Multiplication' by default.

* Move 'Disk Shader Cache' to the 'Advanced' tab

* Prevent enabling 'Disk Shader Cache' when 'Enable Hardware Shader' or 'Accurate Multiplication' is disabled.

* Do not load 'Disk Shader Cache' when 'Accurate Multiplication' is disabled.

* Add a tooltip for 'Disk Shader Cache'.
2020-11-06 10:07:59 -08:00
Mat M 85d37c9994
gl_shader_disk: Make use of std::nullopt where applicable (#5293)
Some implementations can use the std::nullopt_t constructor of
std::optional to avoid needing to completely zero out the internal
buffer of the optional and instead only set the validity byte within it.

e.g. Consider the following function:

std::optional<std::vector<ShaderDiskCacheRaw>> fn() {
    return {};
}

With libc++ this will result in the following code generation on x86-64:

Fn():
  mov     rax, rdi
  vxorps  xmm0, xmm0, xmm0
  vmovups ymmword ptr [rdi], ymm0
  vzeroupper
  ret

With libstdc++, we also get the similar equivalent:

Fn():
  vpxor   xmm0, xmm0, xmm0
  mov     rax, rdi
  vmovdqu XMMWORD PTR [rdi], xmm0
  vmovdqu XMMWORD PTR [rdi+16], xmm0
  ret

If we change this function to return std::nullopt instead, then this
simplifies both the code gen from libc++ and libstdc++ down to:

Fn():
  mov     BYTE PTR [rdi+24], 0
  mov     rax, rdi
  ret

Given how little of a change is necessary to result in better code
generation, this is essentially a "free" very minor optimization.
2020-04-30 22:42:32 -05:00
Mat M bc14f485c4
gl_shader_disk_cache: std::move entries in LoadTransferable() (#5249) 2020-04-24 17:49:54 +02:00
James Rowe bd29261e0a Frontend: Only load disk resources if hw shader is enabled 2020-01-22 09:47:53 -07:00
James Rowe e95bc52b3d Only check for sanitize_mul if theres a shader in the cache 2020-01-16 08:35:52 -07:00
James Rowe cf4125a6a5 Only load precompiled shaders if their sanitize_mul setting matches 2020-01-15 21:10:37 -07:00
James Rowe 6945b6539f Address review and update zstd 2020-01-15 19:58:34 -07:00
James Rowe 936094dd27 Log the number of entries in each cache 2020-01-15 19:58:34 -07:00
James Rowe 2d86bc6db5 Rename InvalidateTransferable to InvalidateAll to match what it does 2020-01-15 19:58:34 -07:00
James Rowe a20c81d593 Change VFS vector to regular vector 2020-01-15 19:58:34 -07:00
James Rowe 4e9ec4efd0 Add shader disk caching 2020-01-15 19:58:33 -07:00