Examples: Reworked setup of clear color to be compatible with transparent values. (#2693, #2764, #2766, #2873, #3447, #3813, #3816)

This commit is contained in:
ocornut
2021-02-17 19:29:39 +01:00
parent bda12e5fdd
commit 6a161b8789
20 changed files with 36 additions and 23 deletions

View File

@ -205,7 +205,7 @@ static void main_loop(void* window)
WGPURenderPassColorAttachmentDescriptor color_attachments = {};
color_attachments.loadOp = WGPULoadOp_Clear;
color_attachments.storeOp = WGPUStoreOp_Store;
color_attachments.clearColor = { clear_color.x, clear_color.y, clear_color.z, clear_color.w };
color_attachments.clearColor = { clear_color.x * clear_color.w, clear_color.y * clear_color.w, clear_color.z * clear_color.w, clear_color.w };
color_attachments.attachment = wgpuSwapChainGetCurrentTextureView(wgpu_swap_chain);
WGPURenderPassDescriptor render_pass_desc = {};
render_pass_desc.colorAttachmentCount = 1;