summaryrefslogtreecommitdiffstats
path: root/src/video_core/renderer_opengl/gl_device.cpp (follow)
Commit message (Collapse)AuthorAgeFilesLines
* gl_device: Remove AMD blacklists that are no longer applicableAmeer J2023-12-211-5/+6
|
* gl_buffer_cache: Reintroduce NV_vertex_buffer_unified_memoryAmeer J2023-12-191-0/+1
| | | | Workaround Nvidia drivers complaining when a buffer is bound as both a vertex buffer and transform feedback buffer
* Merge pull request #12094 from ameerj/gl-buffer-cache-batch-vtxliamwhite2023-12-031-1/+0
|\ | | | | gl_buffer_cache: Batch vertex/tfb buffer binding
| * gl_buffer_cache: Batch vertex/tfb buffer bindingAmeer J2023-11-191-1/+0
| |
* | vulkan_device: add names for more driverID enumeration valuesLiam2023-11-241-9/+9
|/
* gl_device: Filter more specifically for slow ASTClat9nq2023-08-051-1/+42
| | | | | | | | | | | | | | | Adds a check to find if the renderer is Intel DG (i.e. DG2). gl_device: Detect Mesa to disable their ASTC In our testing, our own ASTC decoder has shown itself to perform faster than the included one from the driver. Disable theirs when Mesa is detected. Mesa detection depends on the vendor string. Some drivers never appear outside of *nix contexts, so only check those in the *nix context. gl_device: Internalize Intel DG detection
* settings,general: Rename non-confirming enumslat9nq2023-07-211-4/+4
|
* OpenGL: Limit lmem warmup to NVIDIAameerj2023-06-261-0/+1
| | | | :frog:
* shader_recompiler: remove barriers in conditional control flow when device lacks supportLiam2023-06-101-0/+1
|
* Log object names with debug renderer, add a GPU address to ImageViewsKelebek12023-05-061-1/+2
|
* video_core: Implement opengl/vulkan draw_textureFeng Chen2023-01-051-0/+1
|
* gl_device: Use a more robust way to use strict context modeAlexander Orzechowski2022-12-131-5/+3
| | | | | | Instead of checking a environment variable which may not actually exist or is just wrong, ask QT if it's running on the wayland platform.
* renderer_opengl: refactor context acquireLiam2022-12-131-3/+7
|
* general: fix compile for Apple ClangLiam2022-11-231-0/+1
|
* general: Convert source file copyright comments over to SPDXMorph2022-04-231-3/+2
| | | | | This formats all copyright comments according to SPDX formatting guidelines. Additionally, this resolves the remaining GPLv2 only licensed files by relicensing them to GPLv2.0-or-later.
* GPU Garbage Collection: Fix regressions.Fernando Sahmkow2022-04-011-1/+1
|
* GC: Address Feedback.Fernando Sahmkow2022-03-251-0/+10
|
* video_core: Reduce unused includesameerj2022-03-191-3/+0
|
* glsl: Add boolean reference workaroundameerj2021-12-301-0/+1
|
* glsl_context_get_set: Add alternative cbuf type for broken driversameerj2021-12-301-7/+2
| | | | some drivers have a bug bitwise converting floating point cbuf values to uint variables. This adds a workaround for these drivers to make all cbufs uint and convert to floating point as needed.
* gl_device: Force GLASM on NVIDIA drivers 495-496lat9nq2021-10-291-0/+15
| | | | | | | | | 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.
* settings: Remove std::chrono usageameerj2021-10-171-0/+1
| | | | Alleviates the dependency on chrono for all files that include settings.h
* Revert "renderers: Disable async shader compilation"ReinUsesLisp2021-07-231-4/+2
| | | | This reverts commit 4a152767286717fa69bfc94846a124a366f70065.
* gl_device: Simplify GLASM setting logicameerj2021-07-231-15/+8
|
* renderers: Disable async shader compilationameerj2021-07-231-2/+4
| | | | The current implementation is prone to causing graphical issues. Disable until a better solution is implemented.
* video_core: Enable GL SPIR-V shaderslat9nq2021-07-231-2/+6
|
* general: Add setting shader_backendlat9nq2021-07-231-4/+6
| | | | | | | | | | | | | | | | 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.
* glasm: Add passthrough geometry shader supportReinUsesLisp2021-07-231-0/+1
|
* shader: Unify shader stage typesReinUsesLisp2021-07-231-8/+10
|
* shader: Emulate 64-bit integers when not supportedReinUsesLisp2021-07-231-0/+1
| | | | Useful for mobile and Intel Xe devices.
* glsl: Address rest of feedbackameerj2021-07-231-0/+1
|
* glsl: Add stubs for sparse queries and variable aoffi when not supportedameerj2021-07-231-0/+1
|
* glsl: Implement VOTE for subgroup size potentially largerameerj2021-07-231-0/+1
|
* glsl: Query GL Device for FP16 extension supportameerj2021-07-231-0/+2
|
* glasm: Use ARB_derivative_control conditionallyReinUsesLisp2021-07-231-0/+1
|
* glasm: Use storage buffers instead of global memory when possibleReinUsesLisp2021-07-231-17/+1
|
* shader: Initial OpenGL implementationReinUsesLisp2021-07-231-89/+0
|
* gl_device: Expand on Mesa driver nameslat9nq2021-06-211-3/+28
| | | | | | 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.
* video_core: Add GPU vendor name to window title barameerj2021-06-211-4/+29
|
* gl_device: Intel: Disable texture view formats workaround on mesaA-w-x2021-04-261-1/+1
|
* common: Move settings to common from core.bunnei2021-04-151-1/+1
| | | | - Removes a dependency on core and input_common from common.
* gl_device: unblock async shaders on other Unix systemsJan Beich2021-03-241-1/+1
| | | | | Mesa is the primary OpenGL provider on all FreeDesktop systems. For example, iris is used on Intel GPU + FreeBSD by default.
* gl_device: Block async shaders on AMD and Intellat9nq2021-03-211-1/+13
| | | | | | | | 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.
* Implement glDepthRangeIndexeddNVKelebek12021-02-241-0/+2
|
* renderer_opengl: Remove interopReinUsesLisp2021-02-131-3/+2
| | | | Remove unused interop code from the OpenGL backend.
* video_core: Reimplement the buffer cacheReinUsesLisp2021-02-131-6/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* renderer_opengl: Avoid precompiled cache and force NV GL cache directoryReinUsesLisp2021-01-211-0/+1
| | | | | | | | | | | | | | 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.
* gl_texture_cache: Avoid format views on Intel and AMDReinUsesLisp2021-01-041-0/+4
| | | | | | | 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.
* video_core: Rewrite the texture cacheReinUsesLisp2020-12-301-27/+37
| | | | | | | | | | | | | | 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.
* video_core: Enforce -Wunused-variable and -Wunused-but-set-variableReinUsesLisp2020-10-031-1/+0
|
* Merge pull request #4359 from ReinUsesLisp/clamp-sharedRodrigo Locatti2020-07-211-0/+2
|\ | | | | renderer_{opengl,vulkan}: Clamp shared memory to host's limit
| * renderer_{opengl,vulkan}: Clamp shared memory to host's limitReinUsesLisp2020-07-161-0/+2
| | | | | | | | | | This stops shaders from failing to build when the exceed host's shared memory size limit. An error is logged.
* | Rebase for per game settingsDavid Marcec2020-07-171-1/+1
| |
* | async shadersDavid Marcec2020-07-171-0/+2
|/
* configuration: implement per-game configurations (#4098)lat9nq2020-07-101-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Switch game settings to use a pointer In order to add full per-game settings, we need to be able to tell yuzu to switch to using either the global or game configuration. Using a pointer makes it easier to switch. * configuration: add new UI without changing existing funcitonality The new UI also adds General, System, Graphics, Advanced Graphics, and Audio tabs, but as yet they do nothing. This commit keeps yuzu to the same functionality as originally branched. * configuration: Rename files These weren't included in the last commit. Now they are. * configuration: setup global configuration checkbox Global config checkbox now enables/disables the appropriate tabs in the game properties dialog. The use global configuration setting is now saved to the config, defaulting to true. This also addresses some changes requested in the PR. * configuration: swap to per-game config memory for properties dialog Does not set memory going in-game. Swaps to game values when opening the properties dialog, then swaps back when closing it. Uses a `memcpy` to swap. Also implements saving config files, limited to certain groups of configurations so as to not risk setting unsafe configurations. * configuration: change config interfaces to use config-specific pointers When a game is booted, we need to be able to open the configuration dialogs without changing the settings pointer in the game's emualtion. A new pointer specific to just the configuration dialogs can be used to separate changes to just those config dialogs without affecting the emulation. * configuration: boot a game using per-game settings Swaps values where needed to boot a game. * configuration: user correct config during emulation Creates a new pointer specifically for modifying the configuration while emulation is in progress. Both the regular configuration dialog and the game properties dialog now use the pointer Settings::config_values to focus edits to the correct struct. * settings: split Settings::values into two different structs By splitting the settings into two mutually exclusive structs, it becomes easier, as a developer, to determine how to use the Settings structs after per-game configurations is merged. Other benefits include only duplicating the required settings in memory. * settings: move use_docked_mode to Controls group `use_docked_mode` is set in the input settings and cannot be accessed from the system settings. Grouping it with system settings causes it to be saved with per-game settings, which may make transferring configs more difficult later on, especially since docked mode cannot be set from within the game properties dialog. * configuration: Fix the other yuzu executables and a regression In main.cpp, we have to get the title ID before the ROM is loaded, else the renderer will reflect only the global settings and now the user's game specific settings. * settings: use a template to duplicate memory for each setting Replaces the type of each variable in the Settings::Values struct with a new class that allows basic data reading and writing. The new struct Settings::Setting duplicates the data in memory and can manage global overrides per each setting. * configuration: correct add-ons config and swap settings when apropriate Any add-ons interaction happens directly through the global values struct. Swapping bewteen structs now also includes copying the necessary global configs that cannot be changed nor saved in per-game settings. General and System config menus now update based on whether it is viewing the global or per-game settings. * settings: restore old values struct No longer needed with the Settings::Setting class template. * configuration: implement hierarchical game properties dialog This sets the apropriate global or local data in each setting. * clang format * clang format take 2 can the docker container save this? * address comments and style issues * config: read and write settings with global awareness Adds new functions to read and write settings while keeping the global state in focus. Files now generated per-game are much smaller since often they only need address the global state. * settings: restore global state when necessary Upon closing a game or the game properties dialog, we need to restore all global settings to the original global state so that we can properly open the configuration dialog or boot a different game. * configuration: guard setting values incorrectly This disables setting values while a game is running if the setting is overwritten by a per game setting. * config: don't write local settings in the global config Simple guards to prevent writing the wrong settings in the wrong files. * configuration: add comments, assume less, and clang format No longer assumes that a disabled UI element means the global state is turned off, instead opting to directly answer that question. Still however assumes a game is running if it is in that state. * configuration: fix a logic error Should not be negated * restore settings' global state regardless of accept/cancel Fixes loading a properties dialog and causing the global config dialog to show local settings. * fix more logic errors Fixed the frame limit would set the global setting from the game properties dialog. Also strengthened the Settings::Setting member variables and simplified the logic in config reading (ReadSettingGlobal). * fix another logic error In my efforts to guard RestoreGlobalState, I accidentally negated the IsPowered condition. * configure_audio: set toggle_stretched_audio to tristate * fixed custom rtc and rng seed overwriting the global value * clang format * rebased * clang format take 4 * address my own review Basically revert unintended changes * settings: literal instead of casting "No need to cast, use 1U instead" Thanks, Morph! Co-authored-by: Morph <39850852+Morph1984@users.noreply.github.com> * Revert "settings: literal instead of casting " This reverts commit 95e992a87c898f3e882ffdb415bb0ef9f80f613f. * main: fix status buttons reporting wrong settings after stop emulation * settings: Log UseDockedMode in the Controls group This should have happened when use_docked_mode was moved over to the controls group internally. This just reflects this in the log. * main: load settings if the file has a title id In other words, don't exit if the loader has trouble getting a title id. * use a zero * settings: initalize resolution factor with constructor instead of casting * Revert "settings: initalize resolution factor with constructor instead of casting" This reverts commit 54c35ecb46a29953842614620f9b7de1aa9d5dc8. * configure_graphics: guard device selector when Vulkan is global Prevents the user from editing the device selector if Vulkan is the global renderer backend. Also resets the vulkan_device variable when the users switches back-and-forth between global and Vulkan. * address reviewer concerns Changes function variables to const wherever they don't need to be changed. Sets Settings::Setting to final as it should not be inherited from. Sets ConfigurationShared::use_global_text to static. Co-Authored-By: VolcaEM <volcaem@users.noreply.github.com> * main: load per-game settings after LoadROM This prevents `Restart Emulation` from restoring the global settings *after* the per-game settings were applied. Thanks to BSoDGamingYT for finding this bug. * Revert "main: load per-game settings after LoadROM" This reverts commit 9d0d48c52d2dcf3bfb1806cc8fa7d5a271a8a804. * main: only restore global settings when necessary Loading the per-game settings cannot happen after the ROM is loaded, so we have to specify when to restore the global state. Again thanks to BSoD for finding the bug. * configuration_shared: address reviewer concerns except operator overrides Dropping operator override usage in next commit. Co-Authored-By: LC <lioncash@users.noreply.github.com> * settings: Drop operator overrides from Setting template Requires using GetValue and SetValue explicitly. Also reverts a change that broke title ID formatting in the game properties dialog. * complete rebase * configuration_shared: translate "Use global configuration" Uses ConfigurePerGame to do so, since its usage, at least as of now, corresponds with ConfigurationShared. * configure_per_game: address reviewer concern As far as I understand, it prevents the program from unnecessarily copying strings. Co-Authored-By: LC <lioncash@users.noreply.github.com> Co-authored-by: Morph <39850852+Morph1984@users.noreply.github.com> Co-authored-by: VolcaEM <volcaem@users.noreply.github.com> Co-authored-by: LC <lioncash@users.noreply.github.com>
* Merge pull request #4157 from ReinUsesLisp/unified-turingFernando Sahmkow2020-06-301-19/+1
|\ | | | | gl_device: Enable NV_vertex_buffer_unified_memory on Turing devices
| * gl_device: Enable NV_vertex_buffer_unified_memory on Turing devicesReinUsesLisp2020-06-251-19/+1
| | | | | | | | | | | | | | Once we make sure not to corrupt Nvidia's driver, we can safely use resident buffers on Turing devices. See GitHub pull request #4156
* | gl_device: Fix IsASTCSupportedDavid Marcec2020-06-251-1/+1
|/ | | | Other targets were never actually checked
* gl_device: Expose NV_vertex_buffer_unified_memory except on TuringReinUsesLisp2020-06-241-1/+25
| | | | | | | | | | Expose NV_vertex_buffer_unified_memory when the driver supports it. This commit adds a function the determine if a GL_RENDERER is a Turing GPU. This is required because on Turing GPUs Nvidia's driver crashes when the buffer is marked as resident or on DeleteBuffers. Without a synchronous debug output (single threaded driver), it's likely that the driver will crash in the first blocking call.
* gl_device: Check for GL_EXT_texture_shadow_lodMorph2020-06-211-0/+2
|
* Merge pull request #4092 from Morph1984/image-bindingsRodrigo Locatti2020-06-181-6/+14
|\ | | | | gl_device: Reserve 4 image bindings for fragment stage
| * gl_device: Reserve at least 4 image bindings for fragment stageMorph2020-06-161-6/+14
| | | | | | | | | | | | Due to the limitation of GL_MAX_IMAGE_UNITS being low (8) on Intel's and Nvidia's proprietary drivers, we have to reserve an appropriate amount of image bindings for each of the stages. So far games have been observed to use 4 image bindings on the fragment stage (Kirby Star Allies) and 1 on the vertex stage (TWD series). No games thus far in my limited testing used more than 4 images concurrently and across all currently active programs. This fixes shader compilation errors on Kirby Star Allies on OpenGL (GLSL/GLASM)
* | gl_arb_decompiler: Implement an assembly shader decompilerReinUsesLisp2020-06-121-0/+1
|/ | | | | | Emit code compatible with NV_gpu_program5. This should emit code compatible with Fermi, but it wasn't tested on that architecture. Pascal has some issues not present on Turing GPUs.
* Merge pull request #4040 from ReinUsesLisp/nv-transform-feedbackbunnei2020-06-081-1/+2
|\ | | | | gl_rasterizer: Use NV_transform_feedback for XFB on assembly shaders
| * gl_rasterizer: Use NV_transform_feedback for XFB on assembly shadersReinUsesLisp2020-06-041-1/+2
| | | | | | | | | | | | | | | | | | | | | | NV_transform_feedback, NV_transform_feedback2 and ARB_transform_feedback3 with NV_transform_feedback interactions allows implementing transform feedbacks as dynamic state. Maxwell implements transform feedbacks as dynamic state, so using these extensions with TransformFeedbackStreamAttribsNV allows us to properly emulate transform feedbacks without having to recompile shaders when the state changes.
* | gl_device: Black list NVIDIA 443.24 for fast buffer uploadsReinUsesLisp2020-06-061-2/+10
|/ | | | | | | | | | | | | | | | Skip fast buffer uploads on Nvidia 443.24 Vulkan beta driver on OpenGL. This driver throws the following error when calling BufferSubData or BufferData on buffers that are candidates for fast constant buffer uploads. This is the equivalens to push constants on Vulkan, except that they can access the full buffer. The error: Unknown internal debug message. The NVIDIA OpenGL driver has encountered an out of memory error. This application might behave inconsistently and fail. If this error persists on future drivers, we might have to look deeper into this issue. For now, we can black list it and log it as a temporary solution.
* Merge pull request #4014 from ReinUsesLisp/astc-nvidiabunnei2020-06-021-6/+18
|\ | | | | gl_device: Avoid devices with CAVEAT_SUPPORT on ASTC
| * gl_device: Avoid devices with CAVEAT_SUPPORT on ASTCReinUsesLisp2020-06-011-6/+18
| | | | | | | | | | | | | | | | This avoids using Nvidia's ASTC decoder on OpenGL. The last time it was profiled, it was slower than yuzu's decoder. While we are at it, fix a bug in the texture cache when native ASTC is not supported.
* | glsl: Squash constant buffers into a single SSBO when we hit the limitReinUsesLisp2020-06-011-17/+29
| | | | | | | | | | Avoids compilation errors at the cost of shader build times and runtime performance when a game hits the limit of uniform buffers we can use.
* | gl_device: Enable compute shaders for Intel proprietary driversMorph2020-05-311-4/+0
|/ | | | Previously we were disabling compute shaders on Intel's proprietary driver due to broken compute. This has been fixed in the latest Intel drivers. Re-enable compute for Intel proprietary drivers and remove the check for broken compute.
* renderer_opengl: Add assembly program code pathsReinUsesLisp2020-05-191-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add code required to use OpenGL assembly programs based on NV_gpu_program5. Decompilation for ARB programs is intended to be added in a follow up commit. This does **not** include ARB decompilation and it's not in an usable state. The intention behind assembly programs is to reduce shader stutter significantly on drivers supporting NV_gpu_program5 (and other required extensions). Currently only Nvidia's proprietary driver supports these extensions. Add a UI option hidden for now to avoid people enabling this option accidentally. This code path has some limitations that OpenGL compatibility doesn't have: - NV_shader_storage_buffer_object is limited to 16 entries for a single OpenGL context state (I don't know if this is an intended limitation, an specification issue or I am missing something). Currently causes issues on The Legend of Zelda: Link's Awakening. - NV_parameter_buffer_object can't bind buffers using an offset different to zero. The used workaround is to copy to a temporary buffer (this doesn't happen often so it's not an issue). On the other hand, it has the following advantages: - Shaders build a lot faster. - We have control over how floating point rounding is done over individual instructions (SPIR-V on Vulkan can't do this). - Operations on shared memory can be unsigned and signed. - Transform feedbacks are dynamic state (not yet implemented). - Parameter buffers (uniform buffers) are per stage, matching NVN and hardware's behavior. - The API to bind and create assembly programs makes sense, unlike ARB_separate_shader_objects.
* gl_device: Mark stage_swizzle as constexprLioncash2020-04-161-1/+1
| | | | Previously this was mutable even though it shouldn't be.
* gl_device: Detect if ASTC is reported and expose itReinUsesLisp2020-04-011-0/+26
|
* renderer_opengl: Detect Nvidia Nsight as a debugging toolReinUsesLisp2020-03-161-1/+0
| | | | Use getenv to detect Nsight.
* gl_device: Add option to check GL_EXT_debug_tool.bunnei2020-03-141-0/+1
|
* gl_device: Enable compute shaders for Intel Mesa driversReinUsesLisp2019-12-111-1/+4
| | | | | | Previously we naively checked for "Intel" in GL_VENDOR, but this includes both Intel's proprietary driver and the mesa driver. Re-enable compute shaders for mesa.
* gl_device: Deduce indexing bug from device instead of heuristicReinUsesLisp2019-11-251-47/+2
| | | | | | The heuristic to detect AMD's driver was not working properly since it also included Intel. Instead of using heuristics to detect it, compare the GL_VENDOR string.
* gl_device: Reserve base bindings on limited devicesReinUsesLisp2019-11-231-36/+76
| | | | | | SSBOs and other resources are limited per pipeline on Intel and AMD. Heuristically reserve resources per stage having in mind the reported OpenGL limits.
* gl_rasterizer: Disable compute shaders on IntelReinUsesLisp2019-11-231-0/+3
| | | | | Intel's proprietary driver enters in a corrupt state when compute shaders are executed. For now, disable these.
* gl_shader_cache: Remove dynamic BaseBinding specializationReinUsesLisp2019-11-231-0/+42
|
* gl_shader_decompiler: Add safe fallbacks when ARB_shader_ballot is not availableReinUsesLisp2019-11-081-0/+2
|
* gl_rasterizer: Upload constant buffers with glNamedBufferSubDataReinUsesLisp2019-11-021-0/+4
| | | | | | | | | | | | | | | | Nvidia's OpenGL driver maps gl(Named)BufferSubData with some requirements to a fast. This path has an extra memcpy but updates the buffer without orphaning or waiting for previous calls. It can be seen as a better model for "push constants" that can upload a whole UBO instead of 256 bytes. This path has some requirements established here: http://on-demand.gputechconf.com/gtc/2014/presentations/S4379-opengl-44-scene-rendering-techniques.pdf#page=24 Instead of using the stream buffer, this commits moves constant buffers uploads to calls of glNamedBufferSubData and from my testing it brings a performance improvement. This is disabled when the vendor is not Nvidia since it brings performance regressions.
* shader/image: Implement SULD and remove irrelevant codeReinUsesLisp2019-09-211-0/+22
| | | | | * Implement SULD as float. * Remove conditional declaration of GL_ARB_shader_viewport_layer_array.
* gl_device: Disable precise in fragment shaders on bugged driversReinUsesLisp2019-09-041-14/+29
|
* shader_ir: Implement VOTEReinUsesLisp2019-08-211-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Implement VOTE using Nvidia's intrinsics. Documentation about these can be found here https://developer.nvidia.com/reading-between-threads-shader-intrinsics Instead of using portable ARB instructions I opted to use Nvidia intrinsics because these are the closest we have to how Tegra X1 hardware renders. To stub VOTE on non-Nvidia drivers (including nouveau) this commit simulates a GPU with a warp size of one, returning what is meaningful for the instruction being emulated: * anyThreadNV(value) -> value * allThreadsNV(value) -> value * allThreadsEqualNV(value) -> true ballotARB, also known as "uint64_t(activeThreadsNV())", emits VOTE.ANY Rd, PT, PT; on nouveau's compiler. This doesn't match exactly to Nvidia's code VOTE.ALL Rd, PT, PT; Which is emulated with activeThreadsNV() by this commit. In theory this shouldn't really matter since .ANY, .ALL and .EQ affect the predicates (set to PT on those cases) and not the registers.
* Merge pull request #2695 from ReinUsesLisp/layer-viewportFernando Sahmkow2019-07-151-0/+2
|\ | | | | gl_shader_decompiler: Implement gl_ViewportIndex and gl_Layer in vertex shaders
| * gl_shader_decompiler: Implement gl_ViewportIndex and gl_Layer in vertex shadersReinUsesLisp2019-07-081-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | This commit implements gl_ViewportIndex and gl_Layer in vertex and geometry shaders. In the case it's used in a vertex shader, it requires ARB_shader_viewport_layer_array. This extension is available on AMD and Nvidia devices (mesa and proprietary drivers), but not available on Intel on any platform. At the moment of writing this description I don't know if this is a hardware limitation or a driver limitation. In the case that ARB_shader_viewport_layer_array is not available, writes to these registers on a vertex shader are ignored, with the appropriate logging.
* | gl_device: Query SSBO alignmentReinUsesLisp2019-07-061-0/+1
|/
* gl_device: Fix TestVariableAoffi testReinUsesLisp2019-06-121-1/+2
| | | | | | | | | | | | This test is intended to be invalid GLSL, but it was being invalid in two points instead of one. The intention is to use a non-immediate parameter in a textureOffset like function. The problem is that this shader was being compiled as a separable shader object and the text was writting to gl_Position without a redeclaration, being invalid GLSL. Address that issue by using a user-defined output attribute.
* Merge pull request #2512 from ReinUsesLisp/comp-indexingbunnei2019-06-061-0/+54
|\ | | | | gl_shader_decompiler: Pessimize uniform buffer access on AMD's prorpietary driver
| * gl_device: Add test to detect broken component indexingReinUsesLisp2019-05-241-0/+54
| | | | | | | | | | | | | | | | | | | | Component indexing on AMD's proprietary driver is broken. This commit adds a test to detect when we are on a driver that can't successfully manage component indexing. It dispatches a dummy draw with just one vertex shader that writes to an indexed SSBO from the GPU with data sent through uniforms, it then reads that data from the CPU and compares the expected output.
* | gl_device: Add commentary to AOFFI unit test source codeReinUsesLisp2019-05-271-0/+1
|/ | | | | The intention behind this commit is to hint someone inspecting an apitrace dump to ignore this ill-formed GLSL code.
* gl_shader_decompiler: Declare all possible varyings on physical attribute usageReinUsesLisp2019-05-031-0/+9
|
* gl_shader_decompiler: Use variable AOFFI on supported hardwareReinUsesLisp2019-04-141-3/+21
|
* gl_device: Implement interface and add uniform offset alignmentReinUsesLisp2019-04-101-0/+27