mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-21 18:59:21 +00:00
Make unittests and fuzzers use webgpu.h
BUG=dawn:22 Change-Id: Iff5465ad7a9456f9c6b2ee380af748b3afc129b7 Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/12741 Commit-Queue: Kai Ninomiya <kainino@chromium.org> Reviewed-by: Austin Eng <enga@chromium.org> Reviewed-by: Kai Ninomiya <kainino@chromium.org>
This commit is contained in:
committed by
Commit Bot service account
parent
cab352c2f6
commit
45b51f5df7
@@ -23,14 +23,14 @@ class DrawIndirectValidationTest : public ValidationTest {
|
||||
void SetUp() override {
|
||||
ValidationTest::SetUp();
|
||||
|
||||
dawn::ShaderModule vsModule =
|
||||
wgpu::ShaderModule vsModule =
|
||||
utils::CreateShaderModule(device, utils::SingleShaderStage::Vertex, R"(
|
||||
#version 450
|
||||
void main() {
|
||||
gl_Position = vec4(0.0);
|
||||
})");
|
||||
|
||||
dawn::ShaderModule fsModule =
|
||||
wgpu::ShaderModule fsModule =
|
||||
utils::CreateShaderModule(device, utils::SingleShaderStage::Fragment, R"(
|
||||
#version 450
|
||||
layout(location = 0) out vec4 fragColor;
|
||||
@@ -39,7 +39,7 @@ class DrawIndirectValidationTest : public ValidationTest {
|
||||
})");
|
||||
|
||||
// Set up render pipeline
|
||||
dawn::PipelineLayout pipelineLayout = utils::MakeBasicPipelineLayout(device, nullptr);
|
||||
wgpu::PipelineLayout pipelineLayout = utils::MakeBasicPipelineLayout(device, nullptr);
|
||||
|
||||
utils::ComboRenderPipelineDescriptor descriptor(device);
|
||||
descriptor.layout = pipelineLayout;
|
||||
@@ -49,7 +49,7 @@ class DrawIndirectValidationTest : public ValidationTest {
|
||||
pipeline = device.CreateRenderPipeline(&descriptor);
|
||||
}
|
||||
|
||||
void ValidateExpectation(dawn::CommandEncoder encoder, utils::Expectation expectation) {
|
||||
void ValidateExpectation(wgpu::CommandEncoder encoder, utils::Expectation expectation) {
|
||||
if (expectation == utils::Expectation::Success) {
|
||||
encoder.Finish();
|
||||
} else {
|
||||
@@ -73,17 +73,17 @@ class DrawIndirectValidationTest : public ValidationTest {
|
||||
std::initializer_list<uint32_t> bufferList,
|
||||
uint64_t indirectOffset,
|
||||
bool indexed) {
|
||||
dawn::Buffer indirectBuffer =
|
||||
utils::CreateBufferFromData<uint32_t>(device, dawn::BufferUsage::Indirect, bufferList);
|
||||
wgpu::Buffer indirectBuffer =
|
||||
utils::CreateBufferFromData<uint32_t>(device, wgpu::BufferUsage::Indirect, bufferList);
|
||||
|
||||
DummyRenderPass renderPass(device);
|
||||
dawn::CommandEncoder encoder = device.CreateCommandEncoder();
|
||||
dawn::RenderPassEncoder pass = encoder.BeginRenderPass(&renderPass);
|
||||
wgpu::CommandEncoder encoder = device.CreateCommandEncoder();
|
||||
wgpu::RenderPassEncoder pass = encoder.BeginRenderPass(&renderPass);
|
||||
pass.SetPipeline(pipeline);
|
||||
if (indexed) {
|
||||
uint32_t zeros[100] = {};
|
||||
dawn::Buffer indexBuffer =
|
||||
utils::CreateBufferFromData(device, zeros, sizeof(zeros), dawn::BufferUsage::Index);
|
||||
wgpu::Buffer indexBuffer =
|
||||
utils::CreateBufferFromData(device, zeros, sizeof(zeros), wgpu::BufferUsage::Index);
|
||||
pass.SetIndexBuffer(indexBuffer);
|
||||
pass.DrawIndexedIndirect(indirectBuffer, indirectOffset);
|
||||
} else {
|
||||
@@ -94,7 +94,7 @@ class DrawIndirectValidationTest : public ValidationTest {
|
||||
ValidateExpectation(encoder, expectation);
|
||||
}
|
||||
|
||||
dawn::RenderPipeline pipeline;
|
||||
wgpu::RenderPipeline pipeline;
|
||||
};
|
||||
|
||||
// Verify out of bounds indirect draw calls are caught early
|
||||
|
||||
Reference in New Issue
Block a user