citra/src/video_core
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
..
debug_utils general: Use deducation guides for std::lock_guard and std::unique_lock 2019-04-07 15:14:29 +02:00
renderer_opengl gl_shader_disk: Make use of std::nullopt where applicable (#5293) 2020-04-30 22:42:32 -05:00
shader Apply suggestions from code review 2020-03-28 16:28:07 +00:00
swrasterizer Merge pull request #5247 from lioncash/copy3 2020-04-24 22:07:03 +08:00
texture common/vector_math: Move Vec[x] types into the Common namespace 2019-03-02 15:04:13 +01:00
CMakeLists.txt Merge branch 'master' into feature/savestates-2 2020-04-17 00:01:43 +01:00
command_processor.cpp command_processor: Resolve undefined behavior type punning 2020-04-27 15:35:21 -04:00
command_processor.h video_core serialization 2020-02-13 17:34:16 +08:00
generate_shaders.cmake video_core: add texture filtering (#5017) 2020-03-16 09:42:05 -05:00
geometry_pipeline.cpp geometry_pipeline: std::move vertex handler in SetVertexHandler() 2020-04-18 21:26:47 -04:00
geometry_pipeline.h Fixed setting the right DSP service on deserialization 2020-02-13 17:42:10 +08:00
gpu_debugger.h log: replace all NGLOG with LOG 2018-06-29 14:18:07 +03:00
pica.cpp pica_state: Make use of std::array 2020-04-27 15:35:18 -04:00
pica.h Update the entire application to use the new clang format style 2018-03-09 10:54:43 -07:00
pica_state.h pica_state: Make use of std::array 2020-04-27 15:35:18 -04:00
pica_types.h clang-format fixes 2020-02-13 17:39:15 +08:00
primitive_assembly.cpp primitive_assembly: Take triangle_handler by reference 2020-04-18 20:40:45 -04:00
primitive_assembly.h Fix savestates compatibility (#5256) 2020-04-20 16:21:37 +02:00
rasterizer_interface.h Sync GPU state after loading (fix FE terrain bug) 2020-04-11 10:28:52 +01:00
regs.cpp Pica/Regs: Use binary search to look up reg names 2017-02-09 00:04:24 -08:00
regs.h remove ugly msvc hack 2019-09-15 22:35:21 -05:00
regs_framebuffer.h log: replace all NGLOG with LOG 2018-06-29 14:18:07 +03:00
regs_lighting.h common/vector_math: Move Vec[x] types into the Common namespace 2019-03-02 15:04:13 +01:00
regs_pipeline.h Use the correct register length for index_array 2019-12-13 18:08:07 -07:00
regs_rasterizer.h common/vector_math: Move Vec[x] types into the Common namespace 2019-03-02 15:04:13 +01:00
regs_shader.h pica/regs: layout geometry shader configuration regs 2017-08-10 01:53:08 +03:00
regs_texturing.h gl_rasterizer: implement mipmap 2019-03-08 09:37:24 -05:00
renderer_base.cpp Sync GPU state after loading (fix FE terrain bug) 2020-04-11 10:28:52 +01:00
renderer_base.h video_core: Amend misplaced forward declarations 2020-04-18 20:12:22 -04:00
utils.h Update the entire application to use the new clang format style 2018-03-09 10:54:43 -07:00
vertex_loader.cpp Memory: move GetPhysicalPointer and IsValidPhysicalAddress into class 2018-12-05 20:21:14 -05:00
vertex_loader.h VideoCore: Move Regs to its own file 2017-02-04 13:59:12 -08:00
video_core.cpp Merge branch 'master' into feature/savestates-2 2020-04-12 11:24:06 +01:00
video_core.h Merge branch 'master' into feature/savestates-2 2020-04-12 11:24:06 +01:00