aboutsummaryrefslogtreecommitdiff
path: root/src/video_core/renderer_opengl
AgeCommit message (Collapse)Author
2021-02-07renderer_opengl: Update OpenGL backend version requirement to 4.6Morph
2021-01-27Merge pull request #5786 from ReinUsesLisp/glsl-cbufbunnei
gl_shader_decompiler: Fix constant buffer size calculation
2021-01-21gl_shader_decompiler: Fix constant buffer size calculationReinUsesLisp
The divide logic was wrong and can cause an uniform buffer size overflow.
2021-01-21renderer_opengl: Avoid precompiled cache and force NV GL cache directoryReinUsesLisp
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-04gl_texture_cache: Avoid format views on Intel and AMDReinUsesLisp
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-04gl_texture_cache: Create base images with sRGBReinUsesLisp
This breaks accelerated decoders trying to imageStore into images with sRGB. The decoders are currently disabled so this won't cause issues at runtime.
2020-12-30video_core: Rewrite the texture cacheReinUsesLisp
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-10Merge pull request #5162 from lioncash/copy-shaderbunnei
gl_shader_decompiler: Elide unnecessary copies within DeclareConstantBuffers()
2020-12-07video_core: Make use of ordered container contains() where applicableLioncash
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-07gl_shader_decompiler: Elide unnecessary copies within DeclareConstantBuffers()Lioncash
Resolves a -Wrange-loop-analysis warning.
2020-12-07video_core: Remove unnecessary enum class casting in logging messagesLioncash
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-07Merge pull request #5136 from lioncash/video-shadow3LC
video_core: Resolve more variable shadowing scenarios pt.3
2020-12-06video_core: Adjust `NUM` macro to avoid Clang warningcomex
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-05video_core: Resolve more variable shadowing scenarios pt.3Lioncash
Cleans out the rest of the occurrences of variable shadowing and makes any further occurrences of shadowing compiler errors.
2020-12-05Merge pull request #5124 from lioncash/video-shadowbunnei
video_core: Resolve more variable shadowing scenarios
2020-12-05Fix telemetry-related exit crash from use-after-freeFearlessTobi
Co-Authored-By: xperia64 <xperia64@users.noreply.github.com>
2020-12-04video_core: Resolve more variable shadowing scenariosLioncash
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-11-23Overhaul EmuWindow::PollEvents to fix yuzu-cmd calling SDL_PollEvents off ↵comex
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-22Merge pull request #4954 from lioncash/compareMorph
gl_rasterizer: Make floating-point literal a float
2020-11-20gl_rasterizer: Remove warning of untested alpha testReinUsesLisp
Alpha test has been proven to only affect the first render target.
2020-11-20gl_rasterizer: Make floating-point literal a floatLioncash
Gets rid of an unnecessary expansion from float to double.
2020-10-28shader: Partially implement texture cube array shadowReinUsesLisp
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-28video_core: Enforce -Wredundant-move and -Wpessimizing-moveReinUsesLisp
Silence three warnings and make them errors to avoid introducing more in the future.
2020-10-20gl_arb_decompiler: Implement robust buffer operationsReinUsesLisp
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-02video_core: Enforce -Wunused-variable and -Wunused-but-set-variableReinUsesLisp
2020-09-23Merge pull request #4674 from ReinUsesLisp/timeline-semaphoresbunnei
renderer_vulkan: Make unconditional use of VK_KHR_timeline_semaphore
2020-09-22General: Make use of std::nullopt where applicableLioncash
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-20renderer_opengl: Remove emulated mailbox presentationReinUsesLisp
Emulated mailbox presentation was causing performance issues on Nvidia's OpenGL driver. Remove it.
2020-09-19renderer_vulkan: Make unconditional use of VK_KHR_timeline_semaphoreReinUsesLisp
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-16video_core: Enforce -Werror=switchReinUsesLisp
This forces us to fix all -Wswitch warnings in video_core.
2020-09-06video_core: Remove all Core::System references in rendererReinUsesLisp
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-08-26Merge pull request #4569 from ReinUsesLisp/glsl-cmakebunnei
video_core/host_shaders: Add CMake integration for string shaders
2020-08-24Merge pull request #4542 from ReinUsesLisp/gpu-init-basebunnei
video_core: Initialize renderer with a GPU
2020-08-23gl_texture_cache: Take std::string by reference in DecorateViewName()Lioncash
LabelGLObject takes a string_view, so we don't need to make copies of the std::string.
2020-08-23video_core/fence_manager: Remove unnecessary includesLioncash
Avoids pulling in unnecessary things that can cause rebuilds when they aren't required.
2020-08-23video_core/host_shaders: Add CMake integration for string shadersReinUsesLisp
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-23gl_shader_util: Use std::string_view instead of star pointerReinUsesLisp
This allows us passing any type of string and hinting the length of the string to the OpenGL driver.
2020-08-22video_core: Initialize renderer with a GPUReinUsesLisp
Add an extra step in GPU initialization to be able to initialize render backends with a valid GPU instance.
2020-08-21Merge pull request #4521 from lioncash/optionalcachebunnei
gl_shader_disk_cache: Make use of std::nullopt where applicable
2020-08-18common/telemetry: Migrate namespace into the Common namespaceLioncash
Migrates the Telemetry namespace into the Common namespace to make the code consistent with the rest of our common code.
2020-08-17Merge pull request #4535 from lioncash/fileutilbunnei
common/fileutil: Convert namespace to Common::FS
2020-08-16move thread 1/4 count computation into allocate workers methodameerj
2020-08-16common/fileutil: Convert namespace to Common::FSLioncash
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-15common/compression: Roll back std::span changesLioncash
Seems like all compilers don't support std::span yet.
2020-08-15Merge pull request #4416 from lioncash/spanbunnei
lz4_compression/zstd_compression: Make use of std::span in interfaces
2020-08-14gl_shader_disk_cache: Make use of std::nullopt where applicableLioncash
Allows the compiler to avoid unnecessarily zeroing out the internal buffer of std::optional on some implementations.
2020-08-12gl_shader_cache: Use std::max() for determining num_workersMorph
Does not allocate more threads than available in the host system for boot-time shader compilation and always allocates at least 1 thread if hardware_concurrency() returns 0.
2020-07-28renderer_opengl: Use 1/4 of all threads for async shader compilationMorph
2020-07-25zstd_compression: Make use of std::span in interfacesLioncash
Allows condensing the data and size parameters into a single argument.
2020-07-24Merge pull request #4391 from lioncash/nrvobunnei
video_core: Allow copy elision to take place where applicable