Fix another -Wc++11-narrowing on ChromeOS

Bug: chromium:1064305
Change-Id: Id2650dd3dd4f6ec0baf97ab1d061eb908739940e
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/19284
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
This commit is contained in:
Corentin Wallez 2020-04-13 18:04:11 +00:00 committed by Commit Bot service account
parent 518c8e77ab
commit 871651d999
1 changed files with 3 additions and 3 deletions

View File

@ -786,12 +786,12 @@ namespace dawn_native { namespace vulkan {
WrapVulkanImage(secondDevice, &descriptor, fd, stride, modifier, {});
// Draw a non-trivial picture
int width = 640, height = 480, pixelSize = 4;
uint32_t width = 640, height = 480, pixelSize = 4;
uint32_t rowPitch = Align(width * pixelSize, kTextureRowPitchAlignment);
uint32_t size = rowPitch * (height - 1) + width * pixelSize;
unsigned char data[size];
for (int row = 0; row < height; row++) {
for (int col = 0; col < width; col++) {
for (uint32_t row = 0; row < height; row++) {
for (uint32_t col = 0; col < width; col++) {
float normRow = static_cast<float>(row) / height;
float normCol = static_cast<float>(col) / width;
float dist = sqrt(normRow * normRow + normCol * normCol) * 3;