summaryrefslogtreecommitdiff
path: root/chromium/third_party/dawn/examples
diff options
context:
space:
mode:
Diffstat (limited to 'chromium/third_party/dawn/examples')
-rw-r--r--chromium/third_party/dawn/examples/Animometer.cpp2
-rw-r--r--chromium/third_party/dawn/examples/ComputeBoids.cpp6
-rw-r--r--chromium/third_party/dawn/examples/CppHelloTriangle.cpp6
-rw-r--r--chromium/third_party/dawn/examples/CubeReflection.cpp2
-rw-r--r--chromium/third_party/dawn/examples/SampleUtils.cpp1
5 files changed, 8 insertions, 9 deletions
diff --git a/chromium/third_party/dawn/examples/Animometer.cpp b/chromium/third_party/dawn/examples/Animometer.cpp
index 04b2ac62746..dfd041cabe0 100644
--- a/chromium/third_party/dawn/examples/Animometer.cpp
+++ b/chromium/third_party/dawn/examples/Animometer.cpp
@@ -150,7 +150,7 @@ void frame() {
for (auto& data : shaderData) {
data.time = f / 60.0f;
}
- ubo.SetSubData(0, kNumTriangles * sizeof(ShaderData), shaderData.data());
+ queue.WriteBuffer(ubo, 0, shaderData.data(), kNumTriangles * sizeof(ShaderData));
utils::ComboRenderPassDescriptor renderPass({backbufferView});
wgpu::CommandEncoder encoder = device.CreateCommandEncoder();
diff --git a/chromium/third_party/dawn/examples/ComputeBoids.cpp b/chromium/third_party/dawn/examples/ComputeBoids.cpp
index 37bd5940d86..59538dfa651 100644
--- a/chromium/third_party/dawn/examples/ComputeBoids.cpp
+++ b/chromium/third_party/dawn/examples/ComputeBoids.cpp
@@ -89,9 +89,9 @@ void initBuffers() {
wgpu::BufferUsage::CopyDst | wgpu::BufferUsage::Vertex | wgpu::BufferUsage::Storage;
particleBuffers[i] = device.CreateBuffer(&descriptor);
- particleBuffers[i].SetSubData(0,
- sizeof(Particle) * kNumParticles,
- reinterpret_cast<uint8_t*>(initialParticles.data()));
+ queue.WriteBuffer(particleBuffers[i], 0,
+ reinterpret_cast<uint8_t*>(initialParticles.data()),
+ sizeof(Particle) * kNumParticles);
}
}
diff --git a/chromium/third_party/dawn/examples/CppHelloTriangle.cpp b/chromium/third_party/dawn/examples/CppHelloTriangle.cpp
index a7c24204ffe..fbc598daa0e 100644
--- a/chromium/third_party/dawn/examples/CppHelloTriangle.cpp
+++ b/chromium/third_party/dawn/examples/CppHelloTriangle.cpp
@@ -56,7 +56,6 @@ void initTextures() {
descriptor.size.width = 1024;
descriptor.size.height = 1024;
descriptor.size.depth = 1;
- descriptor.arrayLayerCount = 1;
descriptor.sampleCount = 1;
descriptor.format = wgpu::TextureFormat::RGBA8Unorm;
descriptor.mipLevelCount = 1;
@@ -74,8 +73,9 @@ void initTextures() {
wgpu::Buffer stagingBuffer = utils::CreateBufferFromData(
device, data.data(), static_cast<uint32_t>(data.size()), wgpu::BufferUsage::CopySrc);
- wgpu::BufferCopyView bufferCopyView = utils::CreateBufferCopyView(stagingBuffer, 0, 0, 0);
- wgpu::TextureCopyView textureCopyView = utils::CreateTextureCopyView(texture, 0, 0, {0, 0, 0});
+ wgpu::BufferCopyView bufferCopyView =
+ utils::CreateBufferCopyView(stagingBuffer, 0, 4 * 1024, 0);
+ wgpu::TextureCopyView textureCopyView = utils::CreateTextureCopyView(texture, 0, {0, 0, 0});
wgpu::Extent3D copySize = {1024, 1024, 1};
wgpu::CommandEncoder encoder = device.CreateCommandEncoder();
diff --git a/chromium/third_party/dawn/examples/CubeReflection.cpp b/chromium/third_party/dawn/examples/CubeReflection.cpp
index 61e363c3661..becec8728b4 100644
--- a/chromium/third_party/dawn/examples/CubeReflection.cpp
+++ b/chromium/third_party/dawn/examples/CubeReflection.cpp
@@ -262,7 +262,7 @@ void frame() {
glm::vec3(0.0f, 1.0f, 0.0f)
);
- cameraBuffer.SetSubData(0, sizeof(CameraData), &cameraData);
+ queue.WriteBuffer(cameraBuffer, 0, &cameraData, sizeof(CameraData));
wgpu::TextureView backbufferView = swapchain.GetCurrentTextureView();
utils::ComboRenderPassDescriptor renderPass({backbufferView}, depthStencilView);
diff --git a/chromium/third_party/dawn/examples/SampleUtils.cpp b/chromium/third_party/dawn/examples/SampleUtils.cpp
index 0e38786344d..17b7c9e7c57 100644
--- a/chromium/third_party/dawn/examples/SampleUtils.cpp
+++ b/chromium/third_party/dawn/examples/SampleUtils.cpp
@@ -189,7 +189,6 @@ wgpu::TextureView CreateDefaultDepthStencilView(const wgpu::Device& device) {
descriptor.size.width = 640;
descriptor.size.height = 480;
descriptor.size.depth = 1;
- descriptor.arrayLayerCount = 1;
descriptor.sampleCount = 1;
descriptor.format = wgpu::TextureFormat::Depth24PlusStencil8;
descriptor.mipLevelCount = 1;