Changeset View
Changeset View
Standalone View
Standalone View
source/blender/gpu/opengl/gl_backend.cc
| Show First 20 Lines • Show All 406 Lines • ▼ Show 20 Lines | static void detect_workarounds() | ||||
| /* Disable multi-draw if the base instance cannot be read. */ | /* Disable multi-draw if the base instance cannot be read. */ | ||||
| if (GLContext::shader_draw_parameters_support == false) { | if (GLContext::shader_draw_parameters_support == false) { | ||||
| GLContext::multi_draw_indirect_support = false; | GLContext::multi_draw_indirect_support = false; | ||||
| } | } | ||||
| /* Enable our own incomplete debug layer if no other is available. */ | /* Enable our own incomplete debug layer if no other is available. */ | ||||
| if (GLContext::debug_layer_support == false) { | if (GLContext::debug_layer_support == false) { | ||||
| GLContext::debug_layer_workaround = true; | GLContext::debug_layer_workaround = true; | ||||
| } | } | ||||
| /* Broken glGenerateMipmap on macOS 10.15.7 security update. */ | |||||
| if (GPU_type_matches(GPU_DEVICE_INTEL, GPU_OS_MAC, GPU_DRIVER_ANY) && | |||||
| strstr(renderer, "HD Graphics 4000")) { | |||||
| GLContext::generate_mipmap_workaround = true; | |||||
| } | |||||
| } // namespace blender::gpu | } // namespace blender::gpu | ||||
| /** Internal capabilities. */ | /** Internal capabilities. */ | ||||
| GLint GLContext::max_cubemap_size = 0; | GLint GLContext::max_cubemap_size = 0; | ||||
| GLint GLContext::max_texture_3d_size = 0; | GLint GLContext::max_texture_3d_size = 0; | ||||
| GLint GLContext::max_ubo_binds = 0; | GLint GLContext::max_ubo_binds = 0; | ||||
| GLint GLContext::max_ubo_size = 0; | GLint GLContext::max_ubo_size = 0; | ||||
| /** Extensions. */ | /** Extensions. */ | ||||
| bool GLContext::base_instance_support = false; | bool GLContext::base_instance_support = false; | ||||
| bool GLContext::clear_texture_support = false; | bool GLContext::clear_texture_support = false; | ||||
| bool GLContext::copy_image_support = false; | bool GLContext::copy_image_support = false; | ||||
| bool GLContext::debug_layer_support = false; | bool GLContext::debug_layer_support = false; | ||||
| bool GLContext::direct_state_access_support = false; | bool GLContext::direct_state_access_support = false; | ||||
| bool GLContext::fixed_restart_index_support = false; | bool GLContext::fixed_restart_index_support = false; | ||||
| bool GLContext::multi_bind_support = false; | bool GLContext::multi_bind_support = false; | ||||
| bool GLContext::multi_draw_indirect_support = false; | bool GLContext::multi_draw_indirect_support = false; | ||||
| bool GLContext::shader_draw_parameters_support = false; | bool GLContext::shader_draw_parameters_support = false; | ||||
| bool GLContext::texture_cube_map_array_support = false; | bool GLContext::texture_cube_map_array_support = false; | ||||
| bool GLContext::texture_filter_anisotropic_support = false; | bool GLContext::texture_filter_anisotropic_support = false; | ||||
| bool GLContext::texture_gather_support = false; | bool GLContext::texture_gather_support = false; | ||||
| bool GLContext::vertex_attrib_binding_support = false; | bool GLContext::vertex_attrib_binding_support = false; | ||||
| /** Workarounds. */ | /** Workarounds. */ | ||||
| bool GLContext::debug_layer_workaround = false; | bool GLContext::debug_layer_workaround = false; | ||||
| bool GLContext::unused_fb_slot_workaround = false; | bool GLContext::unused_fb_slot_workaround = false; | ||||
| bool GLContext::generate_mipmap_workaround = false; | |||||
| float GLContext::derivative_signs[2] = {1.0f, 1.0f}; | float GLContext::derivative_signs[2] = {1.0f, 1.0f}; | ||||
| void GLBackend::capabilities_init() | void GLBackend::capabilities_init() | ||||
| { | { | ||||
| BLI_assert(GLEW_VERSION_3_3); | BLI_assert(GLEW_VERSION_3_3); | ||||
| /* Common Capabilities. */ | /* Common Capabilities. */ | ||||
| glGetIntegerv(GL_MAX_TEXTURE_SIZE, &GCaps.max_texture_size); | glGetIntegerv(GL_MAX_TEXTURE_SIZE, &GCaps.max_texture_size); | ||||
| glGetIntegerv(GL_MAX_ARRAY_TEXTURE_LAYERS, &GCaps.max_texture_layers); | glGetIntegerv(GL_MAX_ARRAY_TEXTURE_LAYERS, &GCaps.max_texture_layers); | ||||
| ▲ Show 20 Lines • Show All 57 Lines • Show Last 20 Lines | |||||