mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-20 18:29:23 +00:00
Fix more compilation warnings.
Add -Wconditional-uninitialized -Wc++11-narrowing. Bug: chromium:1064305 Change-Id: I1c1503cafaa2e58e990fc18998200af1f2c00d06 Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/19341 Commit-Queue: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org>
This commit is contained in:
committed by
Commit Bot service account
parent
5b7292c8f8
commit
4fbd14badb
@@ -19,7 +19,7 @@
|
||||
#include "utils/ComboRenderPipelineDescriptor.h"
|
||||
#include "utils/WGPUHelpers.h"
|
||||
|
||||
constexpr static unsigned int kRTSize = 8;
|
||||
constexpr static uint32_t kRTSize = 8;
|
||||
|
||||
class BindGroupTests : public DawnTest {
|
||||
protected:
|
||||
@@ -218,7 +218,7 @@ TEST_P(BindGroupTests, ReusedUBO) {
|
||||
|
||||
RGBA8 filled(0, 255, 0, 255);
|
||||
RGBA8 notFilled(0, 0, 0, 0);
|
||||
int min = 1, max = kRTSize - 3;
|
||||
uint32_t min = 1, max = kRTSize - 3;
|
||||
EXPECT_PIXEL_RGBA8_EQ(filled, renderPass.color, min, min);
|
||||
EXPECT_PIXEL_RGBA8_EQ(filled, renderPass.color, max, min);
|
||||
EXPECT_PIXEL_RGBA8_EQ(filled, renderPass.color, min, max);
|
||||
@@ -290,13 +290,13 @@ TEST_P(BindGroupTests, UBOSamplerAndTexture) {
|
||||
wgpu::Texture texture = device.CreateTexture(&descriptor);
|
||||
wgpu::TextureView textureView = texture.CreateView();
|
||||
|
||||
int width = kRTSize, height = kRTSize;
|
||||
int widthInBytes = width * sizeof(RGBA8);
|
||||
uint32_t width = kRTSize, height = kRTSize;
|
||||
uint32_t widthInBytes = width * sizeof(RGBA8);
|
||||
widthInBytes = (widthInBytes + 255) & ~255;
|
||||
int sizeInBytes = widthInBytes * height;
|
||||
int size = sizeInBytes / sizeof(RGBA8);
|
||||
uint32_t sizeInBytes = widthInBytes * height;
|
||||
uint32_t size = sizeInBytes / sizeof(RGBA8);
|
||||
std::vector<RGBA8> data = std::vector<RGBA8>(size);
|
||||
for (int i = 0; i < size; i++) {
|
||||
for (uint32_t i = 0; i < size; i++) {
|
||||
data[i] = RGBA8(0, 255, 0, 255);
|
||||
}
|
||||
wgpu::Buffer stagingBuffer =
|
||||
@@ -323,7 +323,7 @@ TEST_P(BindGroupTests, UBOSamplerAndTexture) {
|
||||
|
||||
RGBA8 filled(0, 255, 0, 255);
|
||||
RGBA8 notFilled(0, 0, 0, 0);
|
||||
int min = 1, max = kRTSize - 3;
|
||||
uint32_t min = 1, max = kRTSize - 3;
|
||||
EXPECT_PIXEL_RGBA8_EQ(filled, renderPass.color, min, min);
|
||||
EXPECT_PIXEL_RGBA8_EQ(filled, renderPass.color, max, min);
|
||||
EXPECT_PIXEL_RGBA8_EQ(filled, renderPass.color, min, max);
|
||||
@@ -407,7 +407,7 @@ TEST_P(BindGroupTests, MultipleBindLayouts) {
|
||||
|
||||
RGBA8 filled(255, 255, 0, 255);
|
||||
RGBA8 notFilled(0, 0, 0, 0);
|
||||
int min = 1, max = kRTSize - 3;
|
||||
uint32_t min = 1, max = kRTSize - 3;
|
||||
EXPECT_PIXEL_RGBA8_EQ(filled, renderPass.color, min, min);
|
||||
EXPECT_PIXEL_RGBA8_EQ(filled, renderPass.color, max, min);
|
||||
EXPECT_PIXEL_RGBA8_EQ(filled, renderPass.color, min, max);
|
||||
@@ -456,7 +456,7 @@ TEST_P(BindGroupTests, DrawTwiceInSamePipelineWithFourBindGroupSets) {
|
||||
|
||||
RGBA8 filled(255, 0, 0, 255);
|
||||
RGBA8 notFilled(0, 0, 0, 0);
|
||||
int min = 1, max = kRTSize - 3;
|
||||
uint32_t min = 1, max = kRTSize - 3;
|
||||
EXPECT_PIXEL_RGBA8_EQ(filled, renderPass.color, min, min);
|
||||
EXPECT_PIXEL_RGBA8_EQ(filled, renderPass.color, max, min);
|
||||
EXPECT_PIXEL_RGBA8_EQ(filled, renderPass.color, min, max);
|
||||
@@ -498,7 +498,7 @@ TEST_P(BindGroupTests, SetBindGroupBeforePipeline) {
|
||||
// The result should be red.
|
||||
RGBA8 filled(255, 0, 0, 255);
|
||||
RGBA8 notFilled(0, 0, 0, 0);
|
||||
int min = 1, max = kRTSize - 3;
|
||||
uint32_t min = 1, max = kRTSize - 3;
|
||||
EXPECT_PIXEL_RGBA8_EQ(filled, renderPass.color, min, min);
|
||||
EXPECT_PIXEL_RGBA8_EQ(filled, renderPass.color, max, min);
|
||||
EXPECT_PIXEL_RGBA8_EQ(filled, renderPass.color, min, max);
|
||||
@@ -559,7 +559,7 @@ TEST_P(BindGroupTests, SetDynamicBindGroupBeforePipeline) {
|
||||
// The result should be RGBAunorm(1, 0, 0, 0.5) + RGBAunorm(0, 1, 0, 0.5)
|
||||
RGBA8 filled(255, 255, 0, 255);
|
||||
RGBA8 notFilled(0, 0, 0, 0);
|
||||
int min = 1, max = kRTSize - 3;
|
||||
uint32_t min = 1, max = kRTSize - 3;
|
||||
EXPECT_PIXEL_RGBA8_EQ(filled, renderPass.color, min, min);
|
||||
EXPECT_PIXEL_RGBA8_EQ(filled, renderPass.color, max, min);
|
||||
EXPECT_PIXEL_RGBA8_EQ(filled, renderPass.color, min, max);
|
||||
@@ -636,7 +636,7 @@ TEST_P(BindGroupTests, BindGroupsPersistAfterPipelineChange) {
|
||||
// The result should be RGBAunorm(1, 0, 0, 0.5) + RGBAunorm(0, 1, 0, 0.5)
|
||||
RGBA8 filled(255, 255, 0, 255);
|
||||
RGBA8 notFilled(0, 0, 0, 0);
|
||||
int min = 1, max = kRTSize - 3;
|
||||
uint32_t min = 1, max = kRTSize - 3;
|
||||
EXPECT_PIXEL_RGBA8_EQ(filled, renderPass.color, min, min);
|
||||
EXPECT_PIXEL_RGBA8_EQ(filled, renderPass.color, max, min);
|
||||
EXPECT_PIXEL_RGBA8_EQ(filled, renderPass.color, min, max);
|
||||
@@ -741,7 +741,7 @@ TEST_P(BindGroupTests, DrawThenChangePipelineAndBindGroup) {
|
||||
|
||||
RGBA8 filled(255, 255, 255, 255);
|
||||
RGBA8 notFilled(0, 0, 0, 0);
|
||||
int min = 1, max = kRTSize - 3;
|
||||
uint32_t min = 1, max = kRTSize - 3;
|
||||
EXPECT_PIXEL_RGBA8_EQ(filled, renderPass.color, min, min);
|
||||
EXPECT_PIXEL_RGBA8_EQ(filled, renderPass.color, max, min);
|
||||
EXPECT_PIXEL_RGBA8_EQ(filled, renderPass.color, min, max);
|
||||
|
||||
@@ -104,9 +104,9 @@ namespace {
|
||||
std::tuple<Pipeline, VertexBuffer, BindGroup, UniformData, RenderBundle>;
|
||||
|
||||
template <typename T>
|
||||
int AssignParam(T& lhs, T rhs) {
|
||||
unsigned int AssignParam(T& lhs, T rhs) {
|
||||
lhs = rhs;
|
||||
return 0;
|
||||
return 0u;
|
||||
}
|
||||
|
||||
// This helper function allows creating a DrawCallParam from a list of arguments
|
||||
|
||||
@@ -960,12 +960,12 @@ namespace dawn_native { namespace vulkan {
|
||||
allocationSizeA, memoryTypeIndexA, {});
|
||||
|
||||
// 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;
|
||||
|
||||
Reference in New Issue
Block a user