diff options
| author | 2021-06-13 00:05:19 -0400 | |
|---|---|---|
| committer | 2021-07-22 21:51:38 -0400 | |
| commit | 5e7b2b9661bf685c3950d7c4065d0d35b488f95c (patch) | |
| tree | 957dc64090b0e376604322e7d801fff4fa46abf5 /src/video_core | |
| parent | glsl: Implement legacy varyings (diff) | |
| download | yuzu-5e7b2b9661bf685c3950d7c4065d0d35b488f95c.tar.gz yuzu-5e7b2b9661bf685c3950d7c4065d0d35b488f95c.tar.xz yuzu-5e7b2b9661bf685c3950d7c4065d0d35b488f95c.zip | |
glsl: Add stubs for sparse queries and variable aoffi when not supported
Diffstat (limited to 'src/video_core')
| -rw-r--r-- | src/video_core/renderer_opengl/gl_device.cpp | 1 | ||||
| -rw-r--r-- | src/video_core/renderer_opengl/gl_device.h | 5 | ||||
| -rw-r--r-- | src/video_core/renderer_opengl/gl_shader_cache.cpp | 2 |
3 files changed, 8 insertions, 0 deletions
diff --git a/src/video_core/renderer_opengl/gl_device.cpp b/src/video_core/renderer_opengl/gl_device.cpp index 20ea42cff..bf08a6d93 100644 --- a/src/video_core/renderer_opengl/gl_device.cpp +++ b/src/video_core/renderer_opengl/gl_device.cpp | |||
| @@ -160,6 +160,7 @@ Device::Device() { | |||
| 160 | has_depth_buffer_float = HasExtension(extensions, "GL_NV_depth_buffer_float"); | 160 | has_depth_buffer_float = HasExtension(extensions, "GL_NV_depth_buffer_float"); |
| 161 | has_nv_gpu_shader_5 = GLAD_GL_NV_gpu_shader5; | 161 | has_nv_gpu_shader_5 = GLAD_GL_NV_gpu_shader5; |
| 162 | has_amd_shader_half_float = GLAD_GL_AMD_gpu_shader_half_float; | 162 | has_amd_shader_half_float = GLAD_GL_AMD_gpu_shader_half_float; |
| 163 | has_sparse_texture_2 = GLAD_GL_ARB_sparse_texture2; | ||
| 163 | warp_size_potentially_larger_than_guest = !is_nvidia && !is_intel; | 164 | warp_size_potentially_larger_than_guest = !is_nvidia && !is_intel; |
| 164 | 165 | ||
| 165 | // At the moment of writing this, only Nvidia's driver optimizes BufferSubData on exclusive | 166 | // At the moment of writing this, only Nvidia's driver optimizes BufferSubData on exclusive |
diff --git a/src/video_core/renderer_opengl/gl_device.h b/src/video_core/renderer_opengl/gl_device.h index ff0ff2b08..0b59c9df0 100644 --- a/src/video_core/renderer_opengl/gl_device.h +++ b/src/video_core/renderer_opengl/gl_device.h | |||
| @@ -128,6 +128,10 @@ public: | |||
| 128 | return has_amd_shader_half_float; | 128 | return has_amd_shader_half_float; |
| 129 | } | 129 | } |
| 130 | 130 | ||
| 131 | bool HasSparseTexture2() const { | ||
| 132 | return has_sparse_texture_2; | ||
| 133 | } | ||
| 134 | |||
| 131 | bool IsWarpSizePotentiallyLargerThanGuest() const { | 135 | bool IsWarpSizePotentiallyLargerThanGuest() const { |
| 132 | return warp_size_potentially_larger_than_guest; | 136 | return warp_size_potentially_larger_than_guest; |
| 133 | } | 137 | } |
| @@ -165,6 +169,7 @@ private: | |||
| 165 | bool has_depth_buffer_float{}; | 169 | bool has_depth_buffer_float{}; |
| 166 | bool has_nv_gpu_shader_5{}; | 170 | bool has_nv_gpu_shader_5{}; |
| 167 | bool has_amd_shader_half_float{}; | 171 | bool has_amd_shader_half_float{}; |
| 172 | bool has_sparse_texture_2{}; | ||
| 168 | bool warp_size_potentially_larger_than_guest{}; | 173 | bool warp_size_potentially_larger_than_guest{}; |
| 169 | }; | 174 | }; |
| 170 | 175 | ||
diff --git a/src/video_core/renderer_opengl/gl_shader_cache.cpp b/src/video_core/renderer_opengl/gl_shader_cache.cpp index 884739aec..3d59d34d7 100644 --- a/src/video_core/renderer_opengl/gl_shader_cache.cpp +++ b/src/video_core/renderer_opengl/gl_shader_cache.cpp | |||
| @@ -193,6 +193,8 @@ ShaderCache::ShaderCache(RasterizerOpenGL& rasterizer_, Core::Frontend::EmuWindo | |||
| 193 | .support_gl_amd_gpu_shader_half_float = device.HasAmdShaderHalfFloat(), | 193 | .support_gl_amd_gpu_shader_half_float = device.HasAmdShaderHalfFloat(), |
| 194 | .support_gl_texture_shadow_lod = device.HasTextureShadowLod(), | 194 | .support_gl_texture_shadow_lod = device.HasTextureShadowLod(), |
| 195 | .support_gl_warp_intrinsics = false, | 195 | .support_gl_warp_intrinsics = false, |
| 196 | .support_gl_variable_aoffi = device.HasVariableAoffi(), | ||
| 197 | .support_gl_sparse_textures = device.HasSparseTexture2(), | ||
| 196 | 198 | ||
| 197 | .warp_size_potentially_larger_than_guest = device.IsWarpSizePotentiallyLargerThanGuest(), | 199 | .warp_size_potentially_larger_than_guest = device.IsWarpSizePotentiallyLargerThanGuest(), |
| 198 | 200 | ||