1
0
Fork 0
forked from suyu/suyu
suyu/src/video_core/renderer_opengl
Lioncash 3350c0a779 renderer_opengl/gl_global_cache: Replace indexing for assignment with insert_or_assign
The previous code had some minor issues with it, really not a big deal,
but amending it is basically 'free', so I figured, "why not?".

With the standard container maps, when:

map[key] = thing;

is done, this can cause potentially undesirable behavior in certain
scenarios. In particular, if there's no value associated with the key,
then the map constructs a default initialized instance of the value
type.

In this case, since it's a std::shared_ptr (as a type alias) that is
the value type, this will construct a std::shared_pointer, and then
assign over it (with objects that are quite large, or actively heap
allocate this can be extremely undesirable).

We also make the function take the region by value, as we can avoid a
copy (and by extension with std::shared_ptr, a copy causes an atomic
reference count increment), in certain scenarios when ownership isn't a
concern (i.e. when ReserveGlobalRegion is called with an rvalue
reference, then no copy at all occurs). So, it's more-or-less a "free"
gain without many downsides.
2019-03-11 12:20:35 -04:00
..
gl_buffer_cache.cpp video_core: Assert on invalid GPU to CPU address queries 2019-02-03 04:58:40 -03:00
gl_buffer_cache.h gl_rasterizer: Skip VB upload if the state is clean. 2018-11-17 14:28:54 +01:00
gl_global_cache.cpp renderer_opengl/gl_global_cache: Replace indexing for assignment with insert_or_assign 2019-03-11 12:20:35 -04:00
gl_global_cache.h renderer_opengl/gl_global_cache: Replace indexing for assignment with insert_or_assign 2019-03-11 12:20:35 -04:00
gl_primitive_assembler.cpp video_core: Assert on invalid GPU to CPU address queries 2019-02-03 04:58:40 -03:00
gl_primitive_assembler.h gl_rasterizer: Implement quads topology 2018-10-04 00:03:44 -03:00
gl_rasterizer.cpp Merge pull request #2143 from ReinUsesLisp/texview 2019-03-10 17:27:49 -04:00
gl_rasterizer.h common/math_util: Move contents into the Common namespace 2019-02-27 03:38:39 -05:00
gl_rasterizer_cache.cpp Merge pull request #2143 from ReinUsesLisp/texview 2019-03-10 17:27:49 -04:00
gl_rasterizer_cache.h Merge pull request #2143 from ReinUsesLisp/texview 2019-03-10 17:27:49 -04:00
gl_resource_manager.cpp gl_shader_util: Add parameter to handle retrievable programs 2019-02-06 22:20:57 -03:00
gl_resource_manager.h gl_shader_util: Add parameter to handle retrievable programs 2019-02-06 22:20:57 -03:00
gl_shader_cache.cpp gl_shader_disk_cache: Use unordered containers 2019-02-06 22:23:41 -03:00
gl_shader_cache.h gl_shader_disk_cache: Use unordered containers 2019-02-06 22:23:41 -03:00
gl_shader_decompiler.cpp shader/decode: Remove extras from MetaTexture 2019-02-26 00:11:30 -03:00
gl_shader_decompiler.h gl_shader_disk_cache: Address miscellaneous feedback 2019-02-06 22:23:40 -03:00
gl_shader_disk_cache.cpp gl_shader_disk_cache: Remove #pragma once from cpp file 2019-02-27 11:02:49 -05:00
gl_shader_disk_cache.h gl_shader_disk_cache: Use unordered containers 2019-02-06 22:23:41 -03:00
gl_shader_gen.cpp shader_decompiler: Improve Accuracy of Attribute Interpolation. 2019-02-14 03:25:07 -04:00
gl_shader_gen.h gl_shader_cache: Fixup GLSL unique identifiers 2019-02-06 22:23:40 -03:00
gl_shader_manager.cpp gl_shader_decompiler: Implement S2R's Y_DIRECTION 2018-11-25 04:37:29 -03:00
gl_shader_manager.h gl_shader_manager: Update pipeline when programs have changed 2018-11-29 16:26:42 -03:00
gl_shader_util.cpp video_core: fixed arithmetic overflow warnings & improved code style 2018-09-09 17:51:43 +02:00
gl_shader_util.h gl_shader_util: Add parameter to handle retrievable programs 2019-02-06 22:20:57 -03:00
gl_state.cpp gl_state: Fixup multibind bug 2019-02-28 00:17:03 -03:00
gl_state.h gl_state: Remove texture target tracking 2019-01-30 19:10:35 -03:00
gl_stream_buffer.cpp gl_stream_buffer: Use DSA for buffer management 2019-01-06 16:49:24 -03:00
gl_stream_buffer.h gl_stream_buffer: Use DSA for buffer management 2019-01-06 16:49:24 -03:00
maxwell_to_gl.h maxwell_3d: Implement alternate blend equations. 2018-11-22 00:51:01 -05:00
renderer_opengl.cpp video_core/renderer_opengl: Replace direct usage of global system object accessors 2019-03-04 10:24:09 -05:00
renderer_opengl.h video_core/renderer_opengl: Replace direct usage of global system object accessors 2019-03-04 10:24:09 -05:00
utils.cpp video_core: Move OpenGL specific utils to its renderer 2018-10-28 22:22:30 -03:00
utils.h video_core: Move OpenGL specific utils to its renderer 2018-10-28 22:22:30 -03:00