Commit graph

11 commits

Author SHA1 Message Date
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