Changeset View
Changeset View
Standalone View
Standalone View
source/blender/gpu/intern/gpu_viewport.c
| Show First 20 Lines • Show All 141 Lines • ▼ Show 20 Lines | if (GPU_clear_viewport_workaround()) { | ||||
| GPU_texture_clear(viewport->color_overlay_tx[1], GPU_DATA_FLOAT, empty_pixel); | GPU_texture_clear(viewport->color_overlay_tx[1], GPU_DATA_FLOAT, empty_pixel); | ||||
| } | } | ||||
| } | } | ||||
| /* Can be shared with GPUOffscreen. */ | /* Can be shared with GPUOffscreen. */ | ||||
| if (viewport->depth_tx == NULL) { | if (viewport->depth_tx == NULL) { | ||||
| viewport->depth_tx = GPU_texture_create_2d( | viewport->depth_tx = GPU_texture_create_2d( | ||||
| "dtxl_depth", UNPACK2(size), 1, GPU_DEPTH24_STENCIL8, NULL); | "dtxl_depth", UNPACK2(size), 1, GPU_DEPTH24_STENCIL8, NULL); | ||||
| if (GPU_clear_viewport_workaround()) { | |||||
| static int depth_clear = 0; | |||||
| GPU_texture_clear(viewport->depth_tx, GPU_DATA_UINT_24_8, &depth_clear); | |||||
| } | |||||
| } | } | ||||
| if (!viewport->depth_tx || !viewport->color_render_tx[0] || !viewport->color_overlay_tx[0]) { | if (!viewport->depth_tx || !viewport->color_render_tx[0] || !viewport->color_overlay_tx[0]) { | ||||
| GPU_viewport_free(viewport); | GPU_viewport_free(viewport); | ||||
| } | } | ||||
| } | } | ||||
| static void gpu_viewport_textures_free(GPUViewport *viewport) | static void gpu_viewport_textures_free(GPUViewport *viewport) | ||||
| ▲ Show 20 Lines • Show All 440 Lines • Show Last 20 Lines | |||||