Fix MSVC build

(Manual)?SwapChainTests had a narrowing conversions from double to float

Bug: dawn:269
Change-Id: I5b07f53556fa5461877631904fa2c1ab6c8e6596
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/17540
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Kai Ninomiya <kainino@chromium.org>
This commit is contained in:
Austin Eng 2020-03-23 20:10:53 +00:00 committed by Commit Bot service account
parent eb7eb909c8
commit 80a1868f33
2 changed files with 4 additions and 4 deletions

View File

@ -150,7 +150,7 @@ void DoRender(WindowData* data) {
utils::ComboRenderPassDescriptor desc({view});
desc.cColorAttachments[0].loadOp = wgpu::LoadOp::Clear;
desc.cColorAttachments[0].clearColor = {data->clearCycle, 1.0 - data->clearCycle, 0.0, 1.0};
desc.cColorAttachments[0].clearColor = {data->clearCycle, 1.0f - data->clearCycle, 0.0f, 1.0f};
wgpu::RenderPassEncoder pass = encoder.BeginRenderPass(&desc);
pass.EndPass();

View File

@ -160,7 +160,7 @@ TEST_P(SwapChainTests, ResizingSwapChainOnly) {
desc.height -= i * 10;
wgpu::SwapChain swapchain = device.CreateSwapChain(surface, &desc);
ClearTexture(swapchain.GetCurrentTextureView(), {0.05 * i, 0.0, 0.0, 1.0});
ClearTexture(swapchain.GetCurrentTextureView(), {0.05f * i, 0.0f, 0.0f, 1.0f});
swapchain.Present();
}
}
@ -173,7 +173,7 @@ TEST_P(SwapChainTests, ResizingWindowOnly) {
glfwSetWindowSize(window, 400 - 10 * i, 400 + 10 * i);
glfwPollEvents();
ClearTexture(swapchain.GetCurrentTextureView(), {0.05 * i, 0.0, 0.0, 1.0});
ClearTexture(swapchain.GetCurrentTextureView(), {0.05f * i, 0.0f, 0.0f, 1.0f});
swapchain.Present();
}
}
@ -193,7 +193,7 @@ TEST_P(SwapChainTests, ResizingWindowAndSwapChain) {
desc.height = height;
wgpu::SwapChain swapchain = device.CreateSwapChain(surface, &desc);
ClearTexture(swapchain.GetCurrentTextureView(), {0.05 * i, 0.0, 0.0, 1.0});
ClearTexture(swapchain.GetCurrentTextureView(), {0.05f * i, 0.0f, 0.0f, 1.0f});
swapchain.Present();
}
}