Changeset View
Changeset View
Standalone View
Standalone View
source/blender/draw/intern/draw_hair.cc
| Show First 20 Lines • Show All 380 Lines • ▼ Show 20 Lines | void DRW_hair_update() | ||||
| else { | else { | ||||
| /* NOTE(Metal): If compute is not supported, bind a temporary frame-buffer to avoid | /* NOTE(Metal): If compute is not supported, bind a temporary frame-buffer to avoid | ||||
| * side-effects from rendering in the active buffer. | * side-effects from rendering in the active buffer. | ||||
| * We also need to guarantee that a frame-buffer is active to perform any rendering work, | * We also need to guarantee that a frame-buffer is active to perform any rendering work, | ||||
| * even if there is no output. */ | * even if there is no output. */ | ||||
| GPUFrameBuffer *temp_fb = nullptr; | GPUFrameBuffer *temp_fb = nullptr; | ||||
| GPUFrameBuffer *prev_fb = nullptr; | GPUFrameBuffer *prev_fb = nullptr; | ||||
| if (GPU_type_matches_ex(GPU_DEVICE_ANY, GPU_OS_MAC, GPU_DRIVER_ANY, GPU_BACKEND_METAL)) { | if (GPU_type_matches_ex(GPU_DEVICE_ANY, GPU_OS_MAC, GPU_DRIVER_ANY, GPU_BACKEND_METAL)) { | ||||
| if (!GPU_compute_shader_support()) { | if (!(GPU_compute_shader_support() && GPU_shader_storage_buffer_objects_support())) { | ||||
| prev_fb = GPU_framebuffer_active_get(); | prev_fb = GPU_framebuffer_active_get(); | ||||
| char errorOut[256]; | char errorOut[256]; | ||||
| /* if the frame-buffer is invalid we need a dummy frame-buffer to be bound. */ | /* if the frame-buffer is invalid we need a dummy frame-buffer to be bound. */ | ||||
| if (!GPU_framebuffer_check_valid(prev_fb, errorOut)) { | if (!GPU_framebuffer_check_valid(prev_fb, errorOut)) { | ||||
| int width = 64; | int width = 64; | ||||
| int height = 64; | int height = 64; | ||||
| eGPUTextureUsage usage = GPU_TEXTURE_USAGE_SHADER_READ | GPU_TEXTURE_USAGE_ATTACHMENT | | eGPUTextureUsage usage = GPU_TEXTURE_USAGE_SHADER_READ | GPU_TEXTURE_USAGE_ATTACHMENT | | ||||
| GPU_TEXTURE_USAGE_SHADER_WRITE; | GPU_TEXTURE_USAGE_SHADER_WRITE; | ||||
| Show All 35 Lines | |||||