Commit graph

2819 commits

Author SHA1 Message Date
ameerj
29710f3250 gl_texture_cache: fix scaling on upload 2021-11-16 22:11:29 +01:00
Fernando Sahmkow
a6b88e85bf Renderer: Implement Bicubic and ScaleForce filters. 2021-11-16 22:11:29 +01:00
ameerj
68e038404c shader, video_core: Fix GCC build errors 2021-11-16 22:11:29 +01:00
ReinUsesLisp
e66d5b88a6 shader: Properly scale image reads and add GL SPIR-V support
Thanks for everything!
2021-11-16 22:11:29 +01:00
ReinUsesLisp
fc9bb3c3fe shader: Properly blacklist and scale image loads 2021-11-16 22:11:29 +01:00
ReinUsesLisp
c7a1cbad44 texture_cache: Add getter to query if image view is rescaled 2021-11-16 22:11:29 +01:00
ReinUsesLisp
c9238555f7 gl_texture_cache: Fix scaling blits 2021-11-16 22:11:29 +01:00
ReinUsesLisp
cfeb161c7e glsl/glasm: Pass and use scaling parameters in shaders 2021-11-16 22:11:29 +01:00
ReinUsesLisp
4a512d6827 gl_rasterizer: Properly scale viewports and scissors 2021-11-16 22:11:29 +01:00
ameerj
05d98d9bbf gl_texture_cache: Fix multi layered texture Scale 2021-11-16 22:11:29 +01:00
ameerj
b6060873ce gl_compute_pipeline: Add downscale factor to shader uniforms 2021-11-16 22:11:29 +01:00
ameerj
9bc7b04ca5 gl_rasterizer: Fix rescale dirty state checking 2021-11-16 22:11:29 +01:00
ameerj
f086c82e1f gl_graphics_pipeline: Add downscale factor to shader uniforms 2021-11-16 22:11:28 +01:00
ReinUsesLisp
56ccda1d99 texture_cache: Simplify image view queries and blacklisting 2021-11-16 22:11:28 +01:00
Fernando Sahmkow
cee7eba64e OpenGL: set linear mag filter when blitting a downscaled image. 2021-11-16 22:11:28 +01:00
ReinUsesLisp
6f3a41abe2 opengl: Use Shader::NumDescriptors when possible 2021-11-16 22:11:28 +01:00
ameerj
fad2c92a39 gl_texture_cache: Simplify rescaling 2021-11-16 22:11:28 +01:00
ameerj
fddf372c68 gl_texture_cache: Implement ScaleDown 2021-11-16 22:11:27 +01:00
ameerj
0a6c895af7 gl_texture_cache: Rescale fixes for multi-layered textures 2021-11-16 22:11:27 +01:00
ameerj
de66a69ed4 renderer_gl: Resolution scaling fixes 2021-11-16 22:11:27 +01:00
Fernando Sahmkow
84f2aea896 Texture Cache: More rescaling fixes. 2021-11-16 22:11:27 +01:00
ameerj
10e5065a5c gl_texture_cache: WIP texture rescale 2021-11-16 22:11:27 +01:00
Fernando Sahmkow
ba18047e8d Texture Cache: Implement Vulkan UpScaling & DownScaling 2021-11-16 22:11:27 +01:00
Fernando Sahmkow
22f4b290b6 VideoCore: Initial Setup for the Resolution Scaler. 2021-11-16 22:11:27 +01:00
Morph
d607ceacf4 gl_rasterizer: Remove unused includes
This removes unused includes, especially the core includes which were causing this file to be recompiled every time files included by those headers are modified.
2021-10-31 23:57:51 -04:00
lat9nq
61121d1b22 gl_device: Force GLASM on NVIDIA drivers 495-496
GLSL shaders currently do not render correctly on the recent NVIDIA
drivers. This adds a check that forces assembly shaders for these
drivers since they seem unaffected and adds a warning informing of the
decision.

Developers can disable the check by enabling graphics debugging.
2021-10-28 19:38:49 -04:00
ameerj
ef811c6425 settings: Remove std::chrono usage
Alleviates the dependency on chrono for all files that include settings.h
2021-10-17 00:37:49 -04:00
ameerj
427bf76e62 gpu: Migrate implementation to the cpp file 2021-10-03 00:35:57 -04:00
bunnei
8bd5742349
Merge pull request #7061 from ameerj/dma-buffer-misc
buffer_cache, maxwell_dma: Minor refactoring and code fixes
2021-09-30 12:34:28 -07:00
bunnei
91341b421d
Merge pull request #7036 from ameerj/ogl-bgr-v2
gl_texture_cache: Unify BGR copy passes using PBOs
2021-09-29 16:10:56 -07:00
ameerj
1ea8073783 buffer_cache: Minor fixes
Loop through the tmp_intervals by reference, rather than by copy, and fix gl clear buffer size calculation.
2021-09-19 20:35:07 -04:00
ameerj
22162f906b host_shaders: Remove opengl_copy_bgra.comp 2021-09-16 19:49:13 -04:00
ameerj
ab808fe7cf gl_texture_cache: Migrate BGRCopyPass from util_shaders
The BGR copies no longer use shaders.
2021-09-16 19:49:12 -04:00
ameerj
7f737b022a util_shaders: Unify BGRA copy passes 2021-09-15 21:10:52 -04:00
Morph
2df2b3719a renderers: Log total pipeline count 2021-09-14 13:18:26 -04:00
ameerj
4fda7f1c82 structured_control_flow: Conditionally invoke demote reorder pass
This is only needed on select drivers when a fragment shader discards/demotes.
2021-08-30 11:46:24 -04:00
Fernando S
6a082df427
Merge pull request #6820 from yzct12345/split-cache
texture_cache: Split out template definitions
2021-08-10 12:23:05 +02:00
bunnei
268b5764c7
Merge pull request #6791 from ameerj/astc-opt
astc_decoder: Various performance and memory optimizations
2021-08-06 21:45:24 -07:00
yzct12345
e80323b8b0
texture_cache: Address ameerj's review 2021-08-07 01:27:47 +00:00
yzct12345
02e98f6c93
texture_cache: Don't change copyright year 2021-08-05 20:52:12 +00:00
yzct12345
5566f3dbc0
texture_cache: Address ameerj's review 2021-08-05 20:46:24 +00:00
yzct12345
f9563c8f24
texture_cache: Split templates out 2021-08-05 13:52:30 +00:00
ameerj
c439fc9be9 astc_decoder: Reduce workgroup size
This reduces the amount of over dispatching when there are odd dimensions (i.e. ASTC 8x5), which rarely evenly divide into 32x32.
2021-08-01 01:22:27 -04:00
ameerj
5ab8053511 astc_decoder: Compute offset swizzles in-shader
Alleviates the dependency on the swizzle table and a uniform which is constant for all ASTC texture sizes.
2021-08-01 01:22:26 -04:00
ameerj
5665d05547 astc_decoder: Optimize the use EncodingData
This buffer was a list of EncodingData structures sorted by their bit length, with some duplication from the cpu decoder implementation.
We can take advantage of its sorted property to optimize its usage in the shader.

Thanks to wwylele for the optimization idea.
2021-07-31 21:36:26 -04:00
ameerj
7ac99bb127 renderers: Add explicit invert_y bool to screenshot callback
OpenGL and Vulkan images render in different coordinate systems. This allows us to specify the coordinate system of the screenshot within each renderer
2021-07-28 21:46:08 -04:00
Lioncash
075a744e38 gl_shader_cache: Remove unused variable 2021-07-27 06:23:49 -04:00
bunnei
d6c799494c
Merge pull request #6696 from ameerj/speed-limit-rename
general: Rename "Frame Limit" references to "Speed Limit"
2021-07-26 18:51:00 -07:00
bunnei
98b26b6e12
Merge pull request #6585 from ameerj/hades
Shader Decompiler Rewrite
2021-07-25 11:39:04 -07:00
ameerj
c80ae87b4e renderer_base: Removed redundant settings
use_framelimiter was not being used internally by the renderers.
set_background_color was always set to true as there is no toggle for the renderer background color, instead users directly choose the color of their choice.
2021-07-23 22:10:01 -04:00
ReinUsesLisp
3c6d440015 Revert "renderers: Disable async shader compilation"
This reverts commit 4a152767286717fa69bfc94846a124a366f70065.
2021-07-22 21:51:40 -04:00
ReinUsesLisp
8381490a04 opengl: Fix asynchronous shaders
Wait for shader to build before configuring it, and wait for the shader
to build before sharing it with other contexts.
2021-07-22 21:51:40 -04:00
ReinUsesLisp
258f35515d shader_environment: Receive cache version from outside
This allows us invalidating OpenGL and Vulkan separately in the future.
2021-07-22 21:51:40 -04:00
ameerj
56478bc9ac shader: Fix disabled attribute default values 2021-07-22 21:51:40 -04:00
ameerj
c9528282d9 gl_device: Simplify GLASM setting logic 2021-07-22 21:51:40 -04:00
ReinUsesLisp
e1ed218b41 renderer_opengl: Use ARB_separate_shader_objects
Ensures that states set for a particular stage are not attached to other
stages which may not need them.
2021-07-22 21:51:40 -04:00
ameerj
94af0a00f6 glsl: Clamp shared mem size to GL_MAX_COMPUTE_SHARED_MEMORY_SIZE 2021-07-22 21:51:40 -04:00
ReinUsesLisp
8c166c68d4 gl_shader_cache: Properly implement asynchronous shaders 2021-07-22 21:51:40 -04:00
ameerj
41493fbe89 renderers: Fix clang formatting 2021-07-22 21:51:40 -04:00
ameerj
8390286a89 renderers: Disable async shader compilation
The current implementation is prone to causing graphical issues. Disable until a better solution is implemented.
2021-07-22 21:51:40 -04:00
ameerj
11f04f1022 shader: Ignore global memory ops on devices lacking int64 support 2021-07-22 21:51:40 -04:00
ameerj
dbee32d302 gl_shader_cache: Fixes for async shaders 2021-07-22 21:51:40 -04:00
ReinUsesLisp
8722668b3c emit_spirv: Workaround VK_KHR_shader_float_controls on fp16 Nvidia
Fix regression on Fire Emblem: Three Houses when using native fp16.
2021-07-22 21:51:40 -04:00
ReinUsesLisp
fba6bd92d4 vk_rasterizer: Workaround bug in VK_EXT_vertex_input_dynamic_state
Workaround potential bug on Nvidia's driver where only updating high
attributes leaves low attributes out dated.
2021-07-22 21:51:39 -04:00
ReinUsesLisp
5643a909bc shader: Fix disabled and unwritten attributes and varyings 2021-07-22 21:51:39 -04:00
lat9nq
fb9b1787f8 video_core: Enable GL SPIR-V shaders 2021-07-22 21:51:39 -04:00
lat9nq
1152d66ddd general: Add setting shader_backend
GLASM is getting good enough that we can move it out of advanced
graphics settings. This removes the setting `use_assembly_shaders`,
opting for a enum class `shader_backend`. This comes with the benefits
that it is extensible for additional shader backends besides GLSL and
GLASM, and this will work better with a QComboBox.

Qt removes the related assembly shader setting from the Advanced
Graphics section and places it as a new QComboBox in the API Settings
group. This will replace the Vulkan device selector when OpenGL is
selected.

Additionally, mark all of the custom anisotropic filtering settings as
"WILL BREAK THINGS", as that is the case with a select few games.
2021-07-22 21:51:39 -04:00
ReinUsesLisp
8a3427a4c8 glasm: Add passthrough geometry shader support 2021-07-22 21:51:39 -04:00
ReinUsesLisp
7dafa96ab5 shader: Rework varyings and implement passthrough geometry shaders
Put all varyings into a single std::bitset with helpers to access it.

Implement passthrough geometry shaders using host's.
2021-07-22 21:51:39 -04:00
ReinUsesLisp
395bed3a0a shader: Unify shader stage types 2021-07-22 21:51:39 -04:00
ReinUsesLisp
fb166b5ff4 shader: Emulate 64-bit integers when not supported
Useful for mobile and Intel Xe devices.
2021-07-22 21:51:39 -04:00
ReinUsesLisp
3877918e96 gl_graphics_pipeline: Fix assembly shaders check for transform feedbacks 2021-07-22 21:51:39 -04:00
ReinUsesLisp
9bd0531384 gl_graphics_pipeline: Inline hash and operator== key functions 2021-07-22 21:51:39 -04:00
ReinUsesLisp
f5db8c7440 gl_shader_cache: Check previous pipeline before checking hash map
Port optimization from Vulkan.
2021-07-22 21:51:39 -04:00
ReinUsesLisp
218dedca1f gl_graphics_pipeline: Port optimizations from Vulkan pipelines 2021-07-22 21:51:39 -04:00
ameerj
fcff19e0fa shaders: Allow shader notify when async shaders is disabled 2021-07-22 21:51:38 -04:00
ReinUsesLisp
374eeda1a3 shader: Properly manage attributes not written from previous stages 2021-07-22 21:51:38 -04:00
ReinUsesLisp
0ffea97e2e shader: Split profile and runtime info headers 2021-07-22 21:51:38 -04:00
ReinUsesLisp
cbbca26d18 shader: Add support for native 16-bit floats 2021-07-22 21:51:38 -04:00
ReinUsesLisp
376aa94819 shader: Rename maxwell/program.h to translate_program.h 2021-07-22 21:51:38 -04:00
ameerj
d36f667bc0 glsl: Address rest of feedback 2021-07-22 21:51:38 -04:00
ameerj
3b339fbbf6 glsl: Conditionally use fine/coarse derivatives based on device support 2021-07-22 21:51:38 -04:00
ameerj
6eea88d614 glsl: Cleanup/Address feedback 2021-07-22 21:51:38 -04:00
ameerj
74f683787e gl_shader_cache: Implement async shaders 2021-07-22 21:51:38 -04:00
ameerj
5e7b2b9661 glsl: Add stubs for sparse queries and variable aoffi when not supported 2021-07-22 21:51:38 -04:00
ameerj
ff3de0fb6b gl_shader_cache: Remove const from pipeline source arguments 2021-07-22 21:51:38 -04:00
ameerj
413eb6983f gl_shader_cache: Move OGL shader compilation to the respective Pipeline constructor 2021-07-22 21:51:38 -04:00
ameerj
e81c73a874 glsl: Address more feedback. Implement indexed texture reads 2021-07-22 21:51:38 -04:00
ameerj
6650c4799d gl_rasterizer: Add texture fetch barrier for fragments
Fixes flicker seen in XC2
2021-07-22 21:51:37 -04:00
ameerj
8bb8bbf4ae glsl: Implement fswzadd
and wip nv thread shuffle impl
2021-07-22 21:51:37 -04:00
ameerj
970fc39d98 glsl: Rebase fixes 2021-07-22 21:51:37 -04:00
ameerj
747b8556a4 glsl: Use textureGrad fallback when EXT_texture_shadow_lod is unsupported 2021-07-22 21:51:37 -04:00
ameerj
6577a63d36 glsl: skip gl_ViewportIndex write if device does not support it 2021-07-22 21:51:37 -04:00
ameerj
f4799e8fa1 glsl: Implement transform feedback 2021-07-22 21:51:37 -04:00
ameerj
e35ffbbeb0 glsl: Implement VOTE for subgroup size potentially larger 2021-07-22 21:51:36 -04:00
ameerj
3d086e6130 glsl: Implement some attribute getters and setters 2021-07-22 21:51:36 -04:00
ameerj
bd24fa9713 glsl: Query GL Device for FP16 extension support 2021-07-22 21:51:36 -04:00
ReinUsesLisp
53667ddd4e glsl: Fixup build issues 2021-07-22 21:51:36 -04:00
ameerj
eaff1030de glsl: Initial backend 2021-07-22 21:51:35 -04:00
ReinUsesLisp
cb78a1b494 shader: Reorder shader cache directories 2021-07-22 21:51:35 -04:00
ameerj
cd8427367e 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
60a96c49e5 buffer_cache: Fix copy based uniform bindings tracking 2021-07-22 21:51:35 -04:00
ReinUsesLisp
7eaa74ad23 gl_texture_cache: Create image storage views
Fixes SULD.D tests.
2021-07-22 21:51:35 -04:00
ReinUsesLisp
b1ed64ac18 gl_shader_util: Move shader utility code to a separate file 2021-07-22 21:51:35 -04:00
ReinUsesLisp
12fe7210d2 gl_shader_cache: Store workers in shader cache object 2021-07-22 21:51:35 -04:00
FernandoS27
562af30181 shader: Fix VertexA Shaders. 2021-07-22 21:51:34 -04:00
ReinUsesLisp
79f2fe1a39 glasm: Use ARB_derivative_control conditionally 2021-07-22 21:51:34 -04:00
ReinUsesLisp
4a2361a1e2 buffer_cache: Reduce uniform buffer size from shader usage
Increases performance significantly on certain titles.
2021-07-22 21:51:34 -04:00
ReinUsesLisp
916ca74324 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
a7e9756671 buffer_cache: Mark uniform buffers as dirty if any enable bit changes 2021-07-22 21:51:34 -04:00
ReinUsesLisp
b7764c3a79 shader: Handle host exceptions 2021-07-22 21:51:34 -04:00
ReinUsesLisp
3b595fe8b2 glasm: Prepare XFB from state instead of global registers 2021-07-22 21:51:33 -04:00
ReinUsesLisp
adb591a757 glasm: Use storage buffers instead of global memory when possible 2021-07-22 21:51:33 -04:00
ReinUsesLisp
a41b2ed391 gl_shader_cache: Add disk shader cache 2021-07-22 21:51:33 -04:00
ReinUsesLisp
eacf18cce9 gl_shader_cache: Rename Program abstractions into Pipeline 2021-07-22 21:51:33 -04:00
ReinUsesLisp
4017928213 gl_shader_cache: Do not flip tessellation on OpenGL 2021-07-22 21:51:33 -04:00
ReinUsesLisp
80884e3270 gl_graphics_program: Fix texture buffer bindings 2021-07-22 21:51:33 -04:00
ReinUsesLisp
1bccb43cbe gl_shader_cache: Conditionally use viewport mask 2021-07-22 21:51:33 -04:00
ReinUsesLisp
c31521512f gl_shader_cache,glasm: Conditionally use typeless image reads extension 2021-07-22 21:51:33 -04:00
ReinUsesLisp
df406246d9 gl_shader_cache: Improve GLASM error print logic 2021-07-22 21:51:33 -04:00
ReinUsesLisp
84feabac88 glasm: Implement forced early Z 2021-07-22 21:51:33 -04:00
ReinUsesLisp
6bc54e12a0 glasm: Set transform feedback state 2021-07-22 21:51:33 -04:00
ReinUsesLisp
c07cc9d6a5 gl_shader_cache: Pass shader runtime information 2021-07-22 21:51:33 -04:00
ReinUsesLisp
9e7b6622c2 shader: Split profile and runtime information in separate structs 2021-07-22 21:51:33 -04:00
ReinUsesLisp
54decced92 gl_shader_manager: Zero initialize current assembly programs 2021-07-22 21:51:32 -04:00
ReinUsesLisp
c0e4074721 gl_shader_manager: Remove unintentionally committed #pragma 2021-07-22 21:51:32 -04:00
ReinUsesLisp
690b1841e6 renderer_opengl: State track compute assembly programs 2021-07-22 21:51:32 -04:00
ReinUsesLisp
c5ca4fe451 renderer_opengl: State track assembly programs 2021-07-22 21:51:32 -04:00
ReinUsesLisp
85fc7e584e 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
8b7d5912d6 glasm: Support textures used in more than one stage 2021-07-22 21:51:32 -04:00
ReinUsesLisp
258f2dec1b opengl: Initial (broken) support to GLASM shaders 2021-07-22 21:51:31 -04:00
ReinUsesLisp
dc02cb92e4 gl_rasterizer: Flush L2 caches before glFlush on GLASM 2021-07-22 21:51:30 -04:00
ReinUsesLisp
2c81ad8311 glasm: Initial GLASM compute implementation for testing 2021-07-22 21:51:30 -04:00
ReinUsesLisp
bfa47539f6 gl_shader_cache: Remove code unintentionally committed 2021-07-22 21:51:30 -04:00
ReinUsesLisp
bed090807a Move SPIR-V emission functions to their own header 2021-07-22 21:51:30 -04:00
ReinUsesLisp
d621e96d0d shader: Initial OpenGL implementation 2021-07-22 21:51:30 -04:00
ReinUsesLisp
025b20f96a shader: Move pipeline cache logic to separate files
Move code to separate files to be able to reuse it from OpenGL. This
greatly simplifies the pipeline cache logic on Vulkan.

Transform feedback state is not yet abstracted and it's still
intrusively stored inside vk_pipeline_cache. It will be moved when
needed on OpenGL.
2021-07-22 21:51:29 -04:00
ReinUsesLisp
f4ace63957 shader: Accelerate pipeline transitions and use dirty flags for shaders 2021-07-22 21:51:29 -04:00
ReinUsesLisp
e9a91bc5cc shader: Interact texture buffers with buffer cache 2021-07-22 21:51:26 -04:00
ReinUsesLisp
c67d64365a shader: Remove old shader management 2021-07-22 21:51:22 -04:00
ReinUsesLisp
a0c4557557 gl_buffer_cache: Use glClearNamedBufferSubData:GL_RED instead of GL_RGBA
Avoids reading out of bounds from the stack.
2021-07-20 18:51:45 -03:00
bunnei
c53b688411
Merge pull request #6629 from FernandoS27/accel-dma-2
DMAEngine: Accelerate BufferClear [accelerateDMA Part 2]
2021-07-20 17:35:05 -04:00
ReinUsesLisp
2e2d6cf5e5 gl_texture_cache: Workaround slow PBO downloads on radeonsi
There's an optimization bug on non-git mesa versions where not
specifying GL_CLIENT_STORAGE_BIT causes very slow reads on the CPU
side.

Add this bit for all vendors.
2021-07-20 14:02:11 -03:00
bunnei
3cd3230295
Merge pull request #6579 from ameerj/float-settings
settings: Eliminate usage of float-point setting values
2021-07-15 18:03:11 -04:00
Fernando Sahmkow
b780d5b5c5 DMAEngine: Accelerate BufferClear 2021-07-13 03:49:47 +02:00
Fernando Sahmkow
be1a3f7a0f accelerateDMA: Accelerate Buffer Copies. 2021-07-11 01:33:17 +02:00
Fernando Sahmkow
4a09517336 Fence Manager: remove reference fencing. 2021-07-09 22:20:36 +02:00
Fernando Sahmkow
cf38faee9b Fence Manager: Force ordering on WFI. 2021-07-09 22:20:36 +02:00
Fernando Sahmkow
63915bf2de Fence Manager: Add fences on Reference Count. 2021-07-09 22:20:36 +02:00
ameerj
8284658bac configure_graphics: Use u8 for bg_color values 2021-07-08 21:45:01 -04:00
lat9nq
2f0e1f5d02 util_shaders: Fix BindImageTexture
According to
https://gitlab.freedesktop.org/mesa/mesa/-/issues/3820#note_753371 we
need to set these to true for use with 3D textures.

Fixes BOTW teleporting on RadeonSI and iris.
2021-07-07 14:09:55 -04:00
bunnei
eb3cb3af35
Merge pull request #6497 from FernandoS27/scotty-doesnt-know
GPU Memory Manager - Correct handling of non continuous backing memory.
2021-07-06 17:26:21 -07:00
bunnei
bf50345d4c
Merge pull request #6537 from Morph1984/warnings
general: Enforce multiple warnings in MSVC
2021-07-05 17:09:23 -07:00
Fernando Sahmkow
38165fb7e3 Texture Cache: Initial Implementation of Sparse Textures. 2021-07-04 22:32:03 +02:00
Fernando Sahmkow
0aab55d26a TextureCacheOGL: Implement Image Copies for 1D and 1D Array. 2021-07-03 14:40:29 +02:00
Morph
ec68cba440
Merge pull request #6502 from ameerj/vendor-title
main: Add GPU Vendor name to running title bar
2021-06-28 14:51:49 -04:00
Morph
d3d6613d33 video_core: Silence signed/unsigned mismatch warnings 2021-06-28 09:21:42 -04:00
bunnei
c805c0b395
Merge pull request #6496 from ameerj/astc-fixes
astc: Various robustness enhancements for the gpu decoder
2021-06-24 21:47:05 -07:00
bunnei
b9c2732121
Merge pull request #6519 from Wunkolo/mem-size-literal
common: Replace common_sizes into user-literals
2021-06-24 19:09:12 -07:00
Wunkolo
4569f39c7c common: Replace common_sizes into user-literals
Removes common_sizes.h in favor of having `_KiB`, `_MiB`, `_GiB`, etc
user-literals within literals.h.

To keep the global namespace clean, users will have to use:

```
using namespace Common::Literals;
```

to access these literals.
2021-06-24 09:27:40 -07:00
bunnei
1b09d6628b
Merge pull request #6517 from lioncash/fmtlib
externals: Update fmt to 8.0.0
2021-06-23 15:31:04 -07:00
Lioncash
d0b1f2bd05 General: Resolve fmt specifiers to adhere to 8.0.0 API where applicable
Also removes some deprecated API usages.
2021-06-23 13:48:21 -04:00
Mai M
17fff10e06
Merge pull request #6465 from FernandoS27/sex-on-the-beach
GPU: Implement a garbage collector for GPU Caches (project Reaper+)
2021-06-23 08:03:01 -04:00
ReinUsesLisp
4009ae1da2 bootmanager: Use std::stop_source for stopping emulation
Use its std::stop_token to abort shader cache loading.

Using std::stop_token instead of std::atomic_bool allows the usage of
other utilities like std::stop_callback.
2021-06-22 00:04:57 -03:00
lat9nq
a01459df3d gl_device: Expand on Mesa driver names
Makes this list a bit more capable at identifying Mesa drivers. Tries to
deal with two of the overloaded vendor strings in a more generic
fashion.
2021-06-20 23:04:07 -04:00
ameerj
fb16cbb17e video_core: Add GPU vendor name to window title bar 2021-06-20 23:04:07 -04:00
Fernando Sahmkow
569a1962c0 Reaper: Guarantee correct deletion. 2021-06-20 19:11:41 +02:00
ameerj
851c76233d util_shaders: Specify ASTC decoder memory barrier bits 2021-06-19 11:16:25 -04:00
ameerj
ace20ba4a4 astc_decoder.comp: Remove unnecessary LUT SSBOs
We can move them to instead be compile time constants within the shader.
2021-06-19 10:56:13 -04:00
ameerj
31b125ef57 astc: Various robustness enhancements for the gpu decoder
These changes should help in reducing crashes/drivers panics that may
occur due to synchronization issues between the shader completion and
later access of the decoded texture.
2021-06-19 09:00:33 -04:00
Fernando Sahmkow
ca6f47c686 Reaper: Change memory restrictions on TC depending on host memory on VK. 2021-06-17 00:29:48 +02:00
ameerj
b2955479e5 configure_graphics: Add Accelerate ASTC decoding setting 2021-06-15 20:19:00 -04:00
ameerj
859ba21f6d buffer_cache: Simplify uniform disabling logic 2021-06-01 13:26:58 -04:00
Morph
065867e2c2
common: fs: Rework the Common Filesystem interface to make use of std::filesystem (#6270)
* common: fs: fs_types: Create filesystem types

Contains various filesystem types used by the Common::FS library

* common: fs: fs_util: Add std::string to std::u8string conversion utility

* common: fs: path_util: Add utlity functions for paths

Contains various utility functions for getting or manipulating filesystem paths used by the Common::FS library

* common: fs: file: Rewrite the IOFile implementation

* common: fs: Reimplement Common::FS library using std::filesystem

* common: fs: fs_paths: Add fs_paths to replace common_paths

* common: fs: path_util: Add the rest of the path functions

* common: Remove the previous Common::FS implementation

* general: Remove unused fs includes

* string_util: Remove unused function and include

* nvidia_flags: Migrate to the new Common::FS library

* settings: Migrate to the new Common::FS library

* logging: backend: Migrate to the new Common::FS library

* core: Migrate to the new Common::FS library

* perf_stats: Migrate to the new Common::FS library

* reporter: Migrate to the new Common::FS library

* telemetry_session: Migrate to the new Common::FS library

* key_manager: Migrate to the new Common::FS library

* bis_factory: Migrate to the new Common::FS library

* registered_cache: Migrate to the new Common::FS library

* xts_archive: Migrate to the new Common::FS library

* service: acc: Migrate to the new Common::FS library

* applets/profile: Migrate to the new Common::FS library

* applets/web: Migrate to the new Common::FS library

* service: filesystem: Migrate to the new Common::FS library

* loader: Migrate to the new Common::FS library

* gl_shader_disk_cache: Migrate to the new Common::FS library

* nsight_aftermath_tracker: Migrate to the new Common::FS library

* vulkan_library: Migrate to the new Common::FS library

* configure_debug: Migrate to the new Common::FS library

* game_list_worker: Migrate to the new Common::FS library

* config: Migrate to the new Common::FS library

* configure_filesystem: Migrate to the new Common::FS library

* configure_per_game_addons: Migrate to the new Common::FS library

* configure_profile_manager: Migrate to the new Common::FS library

* configure_ui: Migrate to the new Common::FS library

* input_profiles: Migrate to the new Common::FS library

* yuzu_cmd: config: Migrate to the new Common::FS library

* yuzu_cmd: Migrate to the new Common::FS library

* vfs_real: Migrate to the new Common::FS library

* vfs: Migrate to the new Common::FS library

* vfs_libzip: Migrate to the new Common::FS library

* service: bcat: Migrate to the new Common::FS library

* yuzu: main: Migrate to the new Common::FS library

* vfs_real: Delete the contents of an existing file in CreateFile

Current usages of CreateFile expect to delete the contents of an existing file, retain this behavior for now.

* input_profiles: Don't iterate the input profile dir if it does not exist

Silences an error produced in the log if the directory does not exist.

* game_list_worker: Skip parsing file if the returned VfsFile is nullptr

Prevents crashes in GetLoader when the virtual file is nullptr

* common: fs: Validate paths for path length

* service: filesystem: Open the mod load directory as read only
2021-05-25 19:32:56 -04:00
bunnei
5068279f23
Merge pull request #6248 from A-w-x/intelmesa
gl_device: Intel: Disable texture view formats workaround on mesa
2021-05-20 23:47:14 -07:00
bunnei
7d86a6ff02
Merge pull request #6317 from ameerj/fps-fix
perf_stats: Rework FPS counter to be more accurate
2021-05-18 19:56:29 -07:00
bunnei
a1138028a8
Merge pull request #6289 from ameerj/oob-blit
texture_cache: Handle out of bound texture blits
2021-05-15 21:32:37 -07:00
ameerj
5bef54618a perf_stats: Rework FPS counter to be more accurate
The FPS counter was based on metrics in the nvdisp swapbuffers call. This metric would be accurate if the gpu thread/renderer were synchronous with the nvdisp service, but that's no longer the case.

This commit moves the frame counting responsibility onto the concrete renderers after their frame draw calls. Resulting in more meaningful metrics.
The displayed FPS is now made up of the average framerate between the previous and most recent update, in order to avoid distracting FPS counter updates when framerate is oscillating between close values.

The status bar update frequency was also changed from 2 seconds to 500ms.
2021-05-15 20:34:20 -04:00
ameerj
3671fd0a97 texture_cache: Handle out of bound texture blits
Some games interleave a texture blit using regions which are out-of-bounds. This addresses the interleaving to avoid oob reads from the src texture.
2021-05-07 22:14:21 -04:00
bunnei
2a7eff57a8 hle: kernel: Rename Process to KProcess. 2021-05-05 16:40:52 -07:00
A-w-x
6a2084a204 gl_device: Intel: Disable texture view formats workaround on mesa 2021-04-26 18:14:10 +02:00
bunnei
a4c6712a4b common: Move settings to common from core.
- Removes a dependency on core and input_common from common.
2021-04-14 16:24:03 -07:00
Rodrigo Locatti
5ee669466f
Merge pull request #5927 from ameerj/astc-compute
video_core: Accelerate ASTC texture decoding using compute shaders
2021-03-30 19:31:52 -03:00
ameerj
2f83d9a61b astc_decoder: Refactor for style and more efficient memory use 2021-03-25 16:53:51 -04:00
Jan Beich
8c016b02e7 gl_device: unblock async shaders on other Unix systems
Mesa is the primary OpenGL provider on all FreeDesktop systems.
For example, iris is used on Intel GPU + FreeBSD by default.
2021-03-24 19:59:20 +00:00
lat9nq
538f097f97 gl_device: Block async shaders on AMD and Intel
Currently, the Windows versions of the Intel OpenGL driver and the AMD
proprietary OpenGL driver do not properly support (or in fact degrade)
when asynchronous shader compilation is enabled. This blocks
specifically those drivers from using this feature. This affects
AMDGPU-PRO on Linux, and AMD's and Intel's OpenGL drivers on Windows.
2021-03-21 01:25:45 -04:00
Rodrigo Locatti
2f30c10584 astc_decoder: Reimplement Layers
Reimplements the approach to decoding layers in the compute shader. Fixes multilayer astc decoding when using Vulkan.
2021-03-13 12:16:03 -05:00
ameerj
f6566338eb host_shaders: Modify shader cmake integration to allow for larger shaders
using a raw string to encapsulate the entire shader code limits us to shaders of size less than 2KB. This change overcomes this limitation.
2021-03-13 12:16:03 -05:00
ameerj
2985e5e94c renderer_opengl: Accelerate ASTC texture decoding with a compute shader
ASTC texture decoding is currently handled by a CPU decoder for GPU's without native ASTC decoding support (most desktop GPUs). This is the cause for noticeable performance degradation in titles which use the format extensively.

This commit adds support to accelerate ASTC decoding using a compute shader on OpenGL for GPUs without native support.
2021-03-13 12:16:03 -05:00
Rodrigo Locatti
daf5c5060b
Merge pull request #5891 from ameerj/bgra-ogl
renderer_opengl: Use compute shaders to swizzle BGR textures on copy
2021-03-09 02:47:51 -03:00
ameerj
5213f70230 texture_cache: Blacklist BGRA8 copies and views on OpenGL
In order to force the BGRA8 conversion on Nvidia using OpenGL, we need to forbid texture copies and views with other formats.

This commit also adds a boolean relating to this, as this needs to be done only for the OpenGL api, Vulkan must remain unchanged.
2021-03-04 14:14:49 -05:00
ameerj
0639244d85 renderer_opengl: Swizzle BGR textures on copy
OpenGL does not natively support BGR internal formats, which causes many BGR textures to render incorrectly, with Red and Blue channels swapped.

This commit aims to address this by swizzling the blue and red channels on texture copies when a BGR format is encountered.
2021-03-04 14:14:19 -05:00
ReinUsesLisp
5ad62e7bfc buffer_cache: Heuristically decide to skip cache on uniform buffers
Some games benefit from skipping caches (Pokémon Sword), and others
don't (Animal Crossing: New Horizons). Add an heuristic to decide this
at runtime.

The cache hit ratio has to be ~98% or better to not skip the cache.
There are 16 frames of buffer.
2021-03-02 02:44:19 -03:00
Kelebek1
d31dbb1bc1 Implement glDepthRangeIndexeddNV 2021-02-24 22:26:53 +00:00
Morph
1a5d4d7840 gl_disk_shader_cache: Log total shader entries count on game load 2021-02-20 11:08:19 -05:00
ameerj
c7325c6a4c gl_texture_cache: Lazily create non-sRGB texture views for sRGB formats
This creates non-sRGB texture views for sRGB texture formats to allow for interfacing with these views in compute shaders using imageLoad and imageStore.

Co-Authored-By: Rodrigo Locatti <reinuseslisp@airmail.cc>
2021-02-13 13:27:50 -05:00
Morph
83227ad981
Merge pull request #5919 from ReinUsesLisp/stream-buffer-tragic
gl_stream_buffer/vk_staging_buffer_pool: Fix size check
2021-02-13 21:25:45 +08:00
ReinUsesLisp
682d82faf3 gl_stream_buffer/vk_staging_buffer_pool: Fix size check
Fix a tragic off-by-one condition that causes Vulkan's stream buffer to
think it's always full, using fallback memory. The OpenGL was also
affected by this bug to a lesser extent.
2021-02-13 05:11:48 -03:00
LC
6f1ad6aa9f
Merge pull request #5916 from ameerj/maxwell-gl-unused
maxwell_to_gl: Remove unused code
2021-02-13 02:55:59 -05:00
ReinUsesLisp
5b35b01070 video_core: Fix clang build issues 2021-02-13 02:26:47 -03:00
ReinUsesLisp
0b631f22fc renderer_opengl: Remove interop
Remove unused interop code from the OpenGL backend.
2021-02-13 02:18:04 -03:00
ReinUsesLisp
3da87d3f12 gl_buffer_cache: Drop interop based parameter buffer workarounds
Sacrify runtime performance to avoid generating kernel exceptions on
Windows due to our abusive aliasing of interop buffer objects.
2021-02-13 02:17:24 -03:00
ReinUsesLisp
35df1d1864 vk_staging_buffer_pool: Add stream buffer for small uploads
This uses a ring buffer similar to OpenGL's stream buffer for small
uploads. This stops us from allocating several small buffers, reducing
memory fragmentation and cache locality.

It uses dedicated allocations when possible.
2021-02-13 02:17:24 -03:00
ReinUsesLisp
82c2601555 video_core: Reimplement the buffer cache
Reimplement the buffer cache using cached bindings and page level
granularity for modification tracking. This also drops the usage of
shared pointers and virtual functions from the cache.

- Bindings are cached, allowing to skip work when the game changes few
  bits between draws.
- OpenGL Assembly shaders no longer copy when a region has been modified
  from the GPU to emulate constant buffers, instead GL_EXT_memory_object
  is used to alias sub-buffers within the same allocation.
- OpenGL Assembly shaders stream constant buffer data using
  glProgramBufferParametersIuivNV, from NV_parameter_buffer_object. In
  theory this should save one hash table resolve inside the driver
  compared to glBufferSubData.
- A new OpenGL stream buffer is implemented based on fences for drivers
  that are not Nvidia's proprietary, due to their low performance on
  partial glBufferSubData calls synchronized with 3D rendering (that
  some games use a lot).
- Most optimizations are shared between APIs now, allowing Vulkan to
  cache more bindings than before, skipping unnecesarry work.

This commit adds the necessary infrastructure to use Vulkan object from
OpenGL. Overall, it improves performance and fixes some bugs present on
the old cache. There are still some edge cases hit by some games that
harm performance on some vendors, this are planned to be fixed in later
commits.
2021-02-13 02:17:22 -03:00
ReinUsesLisp
75ccd9959c gpu: Report renderer errors with exceptions
Instead of using a two step initialization to report errors, initialize
the GPU renderer and rasterizer on the constructor and report errors
through std::runtime_error.
2021-02-13 02:16:19 -03:00
ameerj
069afcc633 maxwell_to_gl: Remove unused code
Removes unused declarations in maxwell_to_gl.h
2021-02-12 23:01:09 -05:00
Lioncash
10636d2494 gl_rasterizer: Remove unused variables
Resolves warnings on clang 12
2021-02-09 17:31:37 -05:00
Morph
6e5cc977ad renderer_opengl: Update OpenGL backend version requirement to 4.6 2021-02-07 16:32:35 -05:00
bunnei
45b13c3037
Merge pull request #5786 from ReinUsesLisp/glsl-cbuf
gl_shader_decompiler: Fix constant buffer size calculation
2021-01-27 15:27:53 -08:00
ReinUsesLisp
436457b6e7 gl_shader_decompiler: Fix constant buffer size calculation
The divide logic was wrong and can cause an uniform buffer size
overflow.
2021-01-21 19:47:41 -03:00
ReinUsesLisp
51512d01d8 renderer_opengl: Avoid precompiled cache and force NV GL cache directory
Setting __GL_SHADER_DISK_CACHE_PATH we can force the cache directory to
be in yuzu's user directory to stop commonly distributed malware from
deleting our driver shader cache. And by setting
__GL_SHADER_DISK_CACHE_SKIP_CLEANUP we can have an unbounded shader
cache size.

This has only been implemented on Windows, mostly because previous tests
didn't seem to work on Linux.

Disable the precompiled cache on Nvidia's driver. There's no need to
hide information the driver already has in its own cache.
2021-01-21 00:41:03 -03:00
ReinUsesLisp
7d904fef2e gl_texture_cache: Avoid format views on Intel and AMD
Intel and AMD proprietary drivers are incapable of rendering to texture
views of different formats than the original texture. Avoid creating
these at a cache level. This will consume more memory, emulating them
with copies.
2021-01-04 02:06:40 -03:00
ReinUsesLisp
3a49c1a691 gl_texture_cache: Create base images with sRGB
This breaks accelerated decoders trying to imageStore into images with
sRGB. The decoders are currently disabled so this won't cause issues at
runtime.
2021-01-04 01:54:54 -03:00
ReinUsesLisp
9764c13d6d video_core: Rewrite the texture cache
The current texture cache has several points that hurt maintainability
and performance. It's easy to break unrelated parts of the cache
when doing minor changes. The cache can easily forget valuable
information about the cached textures by CPU writes or simply by its
normal usage.The current texture cache has several points that hurt
maintainability and performance. It's easy to break unrelated parts
of the cache when doing minor changes. The cache can easily forget
valuable information about the cached textures by CPU writes or simply
by its normal usage.

This commit aims to address those issues.
2020-12-30 03:38:50 -03:00
bunnei
d1a2b3fb18
Merge pull request #5162 from lioncash/copy-shader
gl_shader_decompiler: Elide unnecessary copies within DeclareConstantBuffers()
2020-12-10 00:11:11 -08:00
Lioncash
09fa1d6a73 video_core: Make use of ordered container contains() where applicable
With C++20, we can use the more concise contains() member function
instead of comparing the result of the find() call with the end
iterator.
2020-12-07 16:30:39 -05:00
Lioncash
edcbd47800 gl_shader_decompiler: Elide unnecessary copies within DeclareConstantBuffers()
Resolves a -Wrange-loop-analysis warning.
2020-12-07 14:01:52 -05:00
Lioncash
4c5f5c9bf3 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 a bit.
2020-12-07 00:41:50 -05:00
LC
69af6ada2f
Merge pull request #5136 from lioncash/video-shadow3
video_core: Resolve more variable shadowing scenarios pt.3
2020-12-07 00:06:53 -05:00
comex
d637114c17 video_core: Adjust NUM macro to avoid Clang warning
The previous definition was:

    #define NUM(field_name) (sizeof(Maxwell3D::Regs::field_name) / sizeof(u32))

In cases where `field_name` happens to refer to an array, Clang thinks
`sizeof(an array value) / sizeof(a type)` is an instance of the idiom
where `sizeof` is used to compute an array length.  So it thinks the
type in the denominator ought to be the array element type, and warns if
it isn't, assuming this is a mistake.

In reality, `NUM` is not used to get array lengths at all, so there is no
mistake.  Silence the warning by applying Clang's suggested workaround
of parenthesizing the denominator.
2020-12-06 18:24:16 -05:00
Lioncash
f95602f152 video_core: Resolve more variable shadowing scenarios pt.3
Cleans out the rest of the occurrences of variable shadowing and makes
any further occurrences of shadowing compiler errors.
2020-12-05 16:02:23 -05:00
bunnei
e6a896c4bd
Merge pull request #5124 from lioncash/video-shadow
video_core: Resolve more variable shadowing scenarios
2020-12-05 00:48:08 -08:00
FearlessTobi
37d672bf08 Fix telemetry-related exit crash from use-after-free
Co-Authored-By: xperia64 <xperia64@users.noreply.github.com>
2020-12-05 02:42:50 +01:00
Lioncash
677a8b208d video_core: Resolve more variable shadowing scenarios
Resolves variable shadowing scenarios up to the end of the OpenGL code
to make it nicer to review. The rest will be resolved in a following
commit.
2020-12-04 16:19:09 -05:00
comex
994f497781 Overhaul EmuWindow::PollEvents to fix yuzu-cmd calling SDL_PollEvents off main thread
EmuWindow::PollEvents was called from the GPU thread (or the CPU thread
in sync-GPU mode) when swapping buffers.  It had three implementations:

- In GRenderWindow, it didn't actually poll events, just set a flag and
  emit a signal to indicate that a frame was displayed.

- In EmuWindow_SDL2_Hide, it did nothing.

- In EmuWindow_SDL2, it did call SDL_PollEvents, but this is wrong
  because SDL_PollEvents is supposed to be called on the thread that set
  up video - in this case, the main thread, which was sleeping in a
  busyloop (regardless of whether sync-GPU was enabled).  On macOS this
  causes a crash.

To fix this:

- Rename EmuWindow::PollEvents to OnFrameDisplayed, and give it a
  default implementation that does nothing.

- In EmuWindow_SDL2, do not override OnFrameDisplayed, but instead have
  the main thread call SDL_WaitEvent in a loop.
2020-11-23 17:58:49 -05:00
Morph
e13a91fa9b
Merge pull request #4954 from lioncash/compare
gl_rasterizer: Make floating-point literal a float
2020-11-22 09:55:23 +08:00
ReinUsesLisp
acc14d233f gl_rasterizer: Remove warning of untested alpha test
Alpha test has been proven to only affect the first render target.
2020-11-20 23:17:40 -03:00
Lioncash
8469b76630 gl_rasterizer: Make floating-point literal a float
Gets rid of an unnecessary expansion from float to double.
2020-11-20 04:24:33 -05:00
ReinUsesLisp
657771bdcb shader: Partially implement texture cube array shadow
This implements texture cube arrays with shadow comparisons but doesn't
fix the asserts related to it.

Fixes out of bounds reads on swizzle constructors and makes them use
bounds checked ::at instead of the unsafe operator[].
2020-10-28 17:12:40 -03:00
ReinUsesLisp
79da90cea8 video_core: Enforce -Wredundant-move and -Wpessimizing-move
Silence three warnings and make them errors to avoid introducing more in the future.
2020-10-28 02:44:50 -03:00
ReinUsesLisp
f21a189148 gl_arb_decompiler: Implement robust buffer operations
This emulates the behavior we get on GLSL with regular SSBOs with a
pointer + length pair. It aims to be consistent with the crashes we
might get.

Out of bounds stores are ignored. Atomics are ignored and return zero.
Reads return zero.
2020-10-20 03:34:32 -03:00
ReinUsesLisp
2a24b1c973 video_core: Enforce -Wunused-variable and -Wunused-but-set-variable 2020-10-02 21:19:35 -03:00
bunnei
d66b897a6d
Merge pull request #4674 from ReinUsesLisp/timeline-semaphores
renderer_vulkan: Make unconditional use of VK_KHR_timeline_semaphore
2020-09-23 18:24:27 -07:00
Lioncash
ff45c39578 General: Make use of std::nullopt where applicable
Allows some implementations to avoid completely zeroing out the internal
buffer of the optional, and instead only set the validity byte within
the structure.

This also makes it consistent how we return empty optionals.
2020-09-22 17:32:33 -04:00
ReinUsesLisp
7003090187 renderer_opengl: Remove emulated mailbox presentation
Emulated mailbox presentation was causing performance issues on
Nvidia's OpenGL driver. Remove it.
2020-09-20 16:29:41 -03:00
ReinUsesLisp
58b0ae84b5 renderer_vulkan: Make unconditional use of VK_KHR_timeline_semaphore
This reworks how host<->device synchronization works on the Vulkan
backend. Instead of "protecting" resources with a fence and signalling
these as free when the fence is known to be signalled by the host GPU,
use timeline semaphores.

Vulkan timeline semaphores allow use to work on a subset of D3D12
fences. As far as we are concerned, timeline semaphores are a value set
by the host or the device that can be waited by either of them.

Taking advantange of this, we can have a monolithically increasing
atomic value for each submission to the graphics queue. Instead of
protecting resources with a fence, we simply store the current logical
tick (the atomic value stored in CPU memory). When we want to know if a
resource is free, it can be compared to the current GPU tick.

This greatly simplifies resource management code and the free status of
resources should have less false negatives.

To workaround bugs in validation layers, when these are attached there's
a thread waiting for timeline semaphores.
2020-09-19 01:46:37 -03:00
ReinUsesLisp
eb914b6c50 video_core: Enforce -Werror=switch
This forces us to fix all -Wswitch warnings in video_core.
2020-09-16 17:48:01 -03:00
ReinUsesLisp
9e87193725 video_core: Remove all Core::System references in renderer
Now that the GPU is initialized when video backends are initialized,
it's no longer needed to query components once the game is running: it
can be done when yuzu is booting.

This allows us to pass components between constructors and in the
process remove all Core::System references in the video backend.
2020-09-06 05:28:48 -03:00
bunnei
1bb8c27a70
Merge pull request #4569 from ReinUsesLisp/glsl-cmake
video_core/host_shaders: Add CMake integration for string shaders
2020-08-26 22:57:39 -04:00
bunnei
bb752df736
Merge pull request #4542 from ReinUsesLisp/gpu-init-base
video_core: Initialize renderer with a GPU
2020-08-24 22:56:11 -04:00
Lioncash
bae4e6c2f5 gl_texture_cache: Take std::string by reference in DecorateViewName()
LabelGLObject takes a string_view, so we don't need to make copies of
the std::string.
2020-08-23 23:36:33 -04:00
Lioncash
f3bb52c0a9 video_core/fence_manager: Remove unnecessary includes
Avoids pulling in unnecessary things that can cause rebuilds when they
aren't required.
2020-08-23 21:44:50 -04:00
ReinUsesLisp
91df2beee3 video_core/host_shaders: Add CMake integration for string shaders
Add the necessary CMake code to copy the contents in a string source
shader (GLSL or GLASM) to a header file then consumed by video_core
files.

This allows editting GLSL in its own files without having to maintain
them in source files.

For now, only OpenGL presentation shaders are moved, but we can add
GLASM presentation shaders and static SPIR-V generation through
glslangValidator in the future.
2020-08-23 21:37:20 -03:00
ReinUsesLisp
0eaf7e1daa gl_shader_util: Use std::string_view instead of star pointer
This allows us passing any type of string and hinting the length of the
string to the OpenGL driver.
2020-08-23 21:23:54 -03:00
ReinUsesLisp
da53bcee60 video_core: Initialize renderer with a GPU
Add an extra step in GPU initialization to be able to initialize render
backends with a valid GPU instance.
2020-08-22 01:51:45 -03:00
bunnei
baff9ffcac
Merge pull request #4521 from lioncash/optionalcache
gl_shader_disk_cache: Make use of std::nullopt where applicable
2020-08-21 23:56:55 -04:00
Lioncash
f6bb905182 common/telemetry: Migrate namespace into the Common namespace
Migrates the Telemetry namespace into the Common namespace to make the
code consistent with the rest of our common code.
2020-08-18 15:08:32 -04:00
bunnei
56c6a5def8
Merge pull request #4535 from lioncash/fileutil
common/fileutil: Convert namespace to Common::FS
2020-08-17 22:35:30 -04:00
ameerj
1b829fbd7a move thread 1/4 count computation into allocate workers method 2020-08-16 12:02:22 -04:00
Lioncash
c4ed791164 common/fileutil: Convert namespace to Common::FS
Migrates a remaining common file over to the Common namespace, making it
consistent with the rest of common files.

This also allows for high-traffic FS related code to alias the
filesystem function namespace as

namespace FS = Common::FS;

for more concise typing.
2020-08-16 06:52:40 -04:00