summaryrefslogtreecommitdiffstats
path: root/src/video_core/renderer_opengl/gl_device.h (follow)
Commit message (Collapse)AuthorAgeFilesLines
* 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.
* GC: Address Feedback.Fernando Sahmkow2022-03-251-0/+7
|
* glsl: Add boolean reference workaroundameerj2021-12-301-0/+5
|
* glsl_context_get_set: Add alternative cbuf type for broken driversameerj2021-12-301-0/+5
| | | | 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.
* structured_control_flow: Conditionally invoke demote reorder passameerj2021-08-301-0/+4
| | | | This is only needed on select drivers when a fragment shader discards/demotes.
* video_core: Enable GL SPIR-V shaderslat9nq2021-07-231-0/+11
|
* glasm: Add passthrough geometry shader supportReinUsesLisp2021-07-231-0/+5
|
* shader: Unify shader stage typesReinUsesLisp2021-07-231-5/+6
|
* shader: Emulate 64-bit integers when not supportedReinUsesLisp2021-07-231-0/+5
| | | | Useful for mobile and Intel Xe devices.
* glsl: Address rest of feedbackameerj2021-07-231-0/+5
|
* glsl: Add stubs for sparse queries and variable aoffi when not supportedameerj2021-07-231-0/+5
|
* glsl: Implement VOTE for subgroup size potentially largerameerj2021-07-231-0/+5
|
* glsl: Query GL Device for FP16 extension supportameerj2021-07-231-0/+10
|
* glasm: Use ARB_derivative_control conditionallyReinUsesLisp2021-07-231-0/+5
|
* glasm: Use storage buffers instead of global memory when possibleReinUsesLisp2021-07-231-1/+5
|
* shader: Initial OpenGL implementationReinUsesLisp2021-07-231-16/+0
|
* video_core: Add GPU vendor name to window title barameerj2021-06-211-0/+3
|
* Implement glDepthRangeIndexeddNVKelebek12021-02-241-0/+5
|
* renderer_opengl: Remove interopReinUsesLisp2021-02-131-1/+1
| | | | Remove unused interop code from the OpenGL backend.
* video_core: Reimplement the buffer cacheReinUsesLisp2021-02-131-5/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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/+5
| | | | | | | | | | | | | | 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/+5
| | | | | | | 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-4/+9
| | | | | | | | | | | | | | 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.
* Merge pull request #4359 from ReinUsesLisp/clamp-sharedRodrigo Locatti2020-07-211-0/+5
|\ | | | | renderer_{opengl,vulkan}: Clamp shared memory to host's limit
| * renderer_{opengl,vulkan}: Clamp shared memory to host's limitReinUsesLisp2020-07-161-0/+5
| | | | | | | | | | This stops shaders from failing to build when the exceed host's shared memory size limit. An error is logged.
* | async shadersDavid Marcec2020-07-171-0/+5
|/
* gl_device: Expose NV_vertex_buffer_unified_memory except on TuringReinUsesLisp2020-06-241-0/+5
| | | | | | | | | | 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/+5
|
* gl_arb_decompiler: Implement an assembly shader decompilerReinUsesLisp2020-06-121-0/+5
| | | | | | 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.
* glsl: Squash constant buffers into a single SSBO when we hit the limitReinUsesLisp2020-06-011-1/+6
| | | | | 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-5/+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/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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: Detect if ASTC is reported and expose itReinUsesLisp2020-04-011-0/+5
|
* renderer_opengl: Detect Nvidia Nsight as a debugging toolReinUsesLisp2020-03-161-5/+0
| | | | Use getenv to detect Nsight.
* gl_device: Add option to check GL_EXT_debug_tool.bunnei2020-03-141-0/+5
|
* gl_device: Deduce indexing bug from device instead of heuristicReinUsesLisp2019-11-251-1/+0
| | | | | | 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_rasterizer: Disable compute shaders on IntelReinUsesLisp2019-11-231-0/+5
| | | | | 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-1/+20
|
* gl_shader_decompiler: Add safe fallbacks when ARB_shader_ballot is not availableReinUsesLisp2019-11-081-0/+5
|
* gl_rasterizer: Upload constant buffers with glNamedBufferSubDataReinUsesLisp2019-11-021-0/+5
| | | | | | | | | | | | | | | | 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/+5
| | | | | * 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-0/+6
|
* shader_ir: Implement VOTEReinUsesLisp2019-08-211-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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/+5
|\ | | | | 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/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | 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/+5
|/
* gl_device: Add test to detect broken component indexingReinUsesLisp2019-05-241-0/+6
| | | | | | | | | | 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_shader_decompiler: Declare all possible varyings on physical attribute usageReinUsesLisp2019-05-031-1/+13
|
* gl_shader_decompiler: Use variable AOFFI on supported hardwareReinUsesLisp2019-04-141-2/+7
|
* gl_device: Implement interface and add uniform offset alignmentReinUsesLisp2019-04-101-0/+25