mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-18 17:35:30 +00:00
ComputePipelineDescriptor.computeStage->compute
Deprecates the computeStage member of the descriptor in favor of compute as described by the spec. In order to support both variants without breaking backwards compatibility some code had to be manually added to the wire client to copy from the deprecated member to the new one and visa versa. Change-Id: I9d5c2fc9c446c927c5792c9af9ed56c90060b65b Bug: dawn:800 Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/53884 Commit-Queue: Brandon Jones <bajones@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org>
This commit is contained in:
committed by
Dawn LUCI CQ
parent
e5b9903cc1
commit
0d50a2c770
@@ -1312,8 +1312,8 @@ class SetBindGroupValidationTest : public ValidationTest {
|
||||
|
||||
wgpu::ComputePipelineDescriptor csDesc;
|
||||
csDesc.layout = pipelineLayout;
|
||||
csDesc.computeStage.module = csModule;
|
||||
csDesc.computeStage.entryPoint = "main";
|
||||
csDesc.compute.module = csModule;
|
||||
csDesc.compute.entryPoint = "main";
|
||||
|
||||
return device.CreateComputePipeline(&csDesc);
|
||||
}
|
||||
@@ -1918,8 +1918,8 @@ class BindGroupLayoutCompatibilityTest : public ValidationTest {
|
||||
|
||||
wgpu::ComputePipelineDescriptor csDesc;
|
||||
csDesc.layout = pipelineLayout;
|
||||
csDesc.computeStage.module = csModule;
|
||||
csDesc.computeStage.entryPoint = "main";
|
||||
csDesc.compute.module = csModule;
|
||||
csDesc.compute.entryPoint = "main";
|
||||
|
||||
return device.CreateComputePipeline(&csDesc);
|
||||
}
|
||||
|
||||
@@ -31,8 +31,8 @@ class ComputeIndirectValidationTest : public ValidationTest {
|
||||
|
||||
wgpu::ComputePipelineDescriptor csDesc;
|
||||
csDesc.layout = pl;
|
||||
csDesc.computeStage.module = computeModule;
|
||||
csDesc.computeStage.entryPoint = "main";
|
||||
csDesc.compute.module = computeModule;
|
||||
csDesc.compute.entryPoint = "main";
|
||||
pipeline = device.CreateComputePipeline(&csDesc);
|
||||
}
|
||||
|
||||
|
||||
@@ -158,8 +158,8 @@ TEST_F(GetBindGroupLayoutTests, ComputePipeline) {
|
||||
|
||||
wgpu::ComputePipelineDescriptor descriptor;
|
||||
descriptor.layout = nullptr;
|
||||
descriptor.computeStage.module = csModule;
|
||||
descriptor.computeStage.entryPoint = "main";
|
||||
descriptor.compute.module = csModule;
|
||||
descriptor.compute.entryPoint = "main";
|
||||
|
||||
wgpu::ComputePipeline pipeline = device.CreateComputePipeline(&descriptor);
|
||||
|
||||
@@ -925,14 +925,14 @@ TEST_F(GetBindGroupLayoutTests, FromCorrectEntryPoint) {
|
||||
)");
|
||||
|
||||
wgpu::ComputePipelineDescriptor pipelineDesc;
|
||||
pipelineDesc.computeStage.module = module;
|
||||
pipelineDesc.compute.module = module;
|
||||
|
||||
// Get each entryPoint's BGL.
|
||||
pipelineDesc.computeStage.entryPoint = "compute0";
|
||||
pipelineDesc.compute.entryPoint = "compute0";
|
||||
wgpu::ComputePipeline pipeline0 = device.CreateComputePipeline(&pipelineDesc);
|
||||
wgpu::BindGroupLayout bgl0 = pipeline0.GetBindGroupLayout(0);
|
||||
|
||||
pipelineDesc.computeStage.entryPoint = "compute1";
|
||||
pipelineDesc.compute.entryPoint = "compute1";
|
||||
wgpu::ComputePipeline pipeline1 = device.CreateComputePipeline(&pipelineDesc);
|
||||
wgpu::BindGroupLayout bgl1 = pipeline1.GetBindGroupLayout(0);
|
||||
|
||||
|
||||
@@ -171,8 +171,8 @@ class MinBufferSizeTestsBase : public ValidationTest {
|
||||
descriptor.bindGroupLayouts = layouts.data();
|
||||
csDesc.layout = device.CreatePipelineLayout(&descriptor);
|
||||
}
|
||||
csDesc.computeStage.module = csModule;
|
||||
csDesc.computeStage.entryPoint = "main";
|
||||
csDesc.compute.module = csModule;
|
||||
csDesc.compute.entryPoint = "main";
|
||||
|
||||
return device.CreateComputePipeline(&csDesc);
|
||||
}
|
||||
|
||||
@@ -45,8 +45,8 @@ TEST_F(MultipleDeviceTest, ValidatesSameDeviceCreatePipelineAsync) {
|
||||
wgpu::ShaderModule shaderModule = device.CreateShaderModule(&shaderModuleDesc);
|
||||
|
||||
wgpu::ComputePipelineDescriptor pipelineDesc = {};
|
||||
pipelineDesc.computeStage.module = shaderModule;
|
||||
pipelineDesc.computeStage.entryPoint = "main";
|
||||
pipelineDesc.compute.module = shaderModule;
|
||||
pipelineDesc.compute.entryPoint = "main";
|
||||
|
||||
StrictMock<MockCallback<WGPUCreateComputePipelineAsyncCallback>> creationCallback;
|
||||
EXPECT_CALL(creationCallback,
|
||||
@@ -65,8 +65,8 @@ TEST_F(MultipleDeviceTest, ValidatesSameDeviceCreatePipelineAsync) {
|
||||
wgpu::ShaderModule shaderModule = device2.CreateShaderModule(&shaderModuleDesc);
|
||||
|
||||
wgpu::ComputePipelineDescriptor pipelineDesc = {};
|
||||
pipelineDesc.computeStage.module = shaderModule;
|
||||
pipelineDesc.computeStage.entryPoint = "main";
|
||||
pipelineDesc.compute.module = shaderModule;
|
||||
pipelineDesc.compute.entryPoint = "main";
|
||||
|
||||
StrictMock<MockCallback<WGPUCreateComputePipelineAsyncCallback>> creationCallback;
|
||||
EXPECT_CALL(creationCallback,
|
||||
|
||||
@@ -210,10 +210,10 @@ namespace {
|
||||
};
|
||||
|
||||
wgpu::ComputePipelineDescriptor descriptor;
|
||||
descriptor.computeStage.module = utils::CreateShaderModule(device, R"(
|
||||
descriptor.compute.module = utils::CreateShaderModule(device, R"(
|
||||
[[stage(compute)]] fn main() {
|
||||
})");
|
||||
descriptor.computeStage.entryPoint = "main";
|
||||
descriptor.compute.entryPoint = "main";
|
||||
device.CreateComputePipelineAsync(&descriptor, callback, &callbackData);
|
||||
|
||||
WaitForAllOperations(device);
|
||||
@@ -234,8 +234,8 @@ namespace {
|
||||
// BindGroup 2. This is to provide coverage of for loops in validation code.
|
||||
wgpu::ComputePipelineDescriptor cpDesc;
|
||||
cpDesc.layout = utils::MakePipelineLayout(device, {emptyBGL, testBGL});
|
||||
cpDesc.computeStage.entryPoint = "main";
|
||||
cpDesc.computeStage.module =
|
||||
cpDesc.compute.entryPoint = "main";
|
||||
cpDesc.compute.module =
|
||||
utils::CreateShaderModule(device, "[[stage(compute)]] fn main() {}");
|
||||
wgpu::ComputePipeline pipeline = device.CreateComputePipeline(&cpDesc);
|
||||
|
||||
@@ -302,8 +302,8 @@ namespace {
|
||||
|
||||
wgpu::ComputePipelineDescriptor cpDesc;
|
||||
cpDesc.layout = utils::MakePipelineLayout(device, {emptyBGL, emptyBGL, testBGL});
|
||||
cpDesc.computeStage.entryPoint = "main";
|
||||
cpDesc.computeStage.module =
|
||||
cpDesc.compute.entryPoint = "main";
|
||||
cpDesc.compute.module =
|
||||
utils::CreateShaderModule(device, "[[stage(compute)]] fn main() {}");
|
||||
wgpu::ComputePipeline pipeline = device.CreateComputePipeline(&cpDesc);
|
||||
|
||||
|
||||
@@ -67,8 +67,8 @@ namespace {
|
||||
})");
|
||||
wgpu::ComputePipelineDescriptor pipelineDescriptor;
|
||||
pipelineDescriptor.layout = utils::MakePipelineLayout(device, std::move(bgls));
|
||||
pipelineDescriptor.computeStage.module = csModule;
|
||||
pipelineDescriptor.computeStage.entryPoint = "main";
|
||||
pipelineDescriptor.compute.module = csModule;
|
||||
pipelineDescriptor.compute.entryPoint = "main";
|
||||
return device.CreateComputePipeline(&pipelineDescriptor);
|
||||
}
|
||||
|
||||
|
||||
@@ -200,8 +200,8 @@ TEST_F(StorageTextureValidationTests, ComputePipeline) {
|
||||
|
||||
wgpu::ComputePipelineDescriptor descriptor;
|
||||
descriptor.layout = nullptr;
|
||||
descriptor.computeStage.module = csModule;
|
||||
descriptor.computeStage.entryPoint = "main";
|
||||
descriptor.compute.module = csModule;
|
||||
descriptor.compute.entryPoint = "main";
|
||||
|
||||
device.CreateComputePipeline(&descriptor);
|
||||
}
|
||||
@@ -217,8 +217,8 @@ TEST_F(StorageTextureValidationTests, ComputePipeline) {
|
||||
|
||||
wgpu::ComputePipelineDescriptor descriptor;
|
||||
descriptor.layout = nullptr;
|
||||
descriptor.computeStage.module = csModule;
|
||||
descriptor.computeStage.entryPoint = "main";
|
||||
descriptor.compute.module = csModule;
|
||||
descriptor.compute.entryPoint = "main";
|
||||
|
||||
device.CreateComputePipeline(&descriptor);
|
||||
}
|
||||
@@ -402,8 +402,8 @@ TEST_F(StorageTextureValidationTests, BindGroupLayoutEntryTypeMatchesShaderDecla
|
||||
|
||||
// Set common fields of compute pipeline descriptor.
|
||||
wgpu::ComputePipelineDescriptor defaultComputePipelineDescriptor;
|
||||
defaultComputePipelineDescriptor.computeStage.module = csModule;
|
||||
defaultComputePipelineDescriptor.computeStage.entryPoint = "main";
|
||||
defaultComputePipelineDescriptor.compute.module = csModule;
|
||||
defaultComputePipelineDescriptor.compute.entryPoint = "main";
|
||||
|
||||
for (utils::BindingLayoutEntryInitializationHelper bindingLayoutEntry :
|
||||
kSupportedBindingTypes) {
|
||||
@@ -478,8 +478,8 @@ TEST_F(StorageTextureValidationTests, BindGroupLayoutStorageTextureFormatMatches
|
||||
|
||||
// Set common fields of compute pipeline descriptor.
|
||||
wgpu::ComputePipelineDescriptor defaultComputePipelineDescriptor;
|
||||
defaultComputePipelineDescriptor.computeStage.module = csModule;
|
||||
defaultComputePipelineDescriptor.computeStage.entryPoint = "main";
|
||||
defaultComputePipelineDescriptor.compute.module = csModule;
|
||||
defaultComputePipelineDescriptor.compute.entryPoint = "main";
|
||||
|
||||
// Set common fileds of bind group layout binding.
|
||||
utils::BindingLayoutEntryInitializationHelper defaultBindGroupLayoutEntry = {
|
||||
@@ -534,8 +534,8 @@ TEST_F(StorageTextureValidationTests, BindGroupLayoutViewDimensionMatchesShaderD
|
||||
|
||||
// Set common fields of compute pipeline descriptor.
|
||||
wgpu::ComputePipelineDescriptor defaultComputePipelineDescriptor;
|
||||
defaultComputePipelineDescriptor.computeStage.module = csModule;
|
||||
defaultComputePipelineDescriptor.computeStage.entryPoint = "main";
|
||||
defaultComputePipelineDescriptor.compute.module = csModule;
|
||||
defaultComputePipelineDescriptor.compute.entryPoint = "main";
|
||||
|
||||
// Set common fields of bind group layout binding.
|
||||
utils::BindingLayoutEntryInitializationHelper defaultBindGroupLayoutEntry = {
|
||||
|
||||
@@ -134,8 +134,8 @@ TEST_F(UnsafeAPIValidationTest, DispatchIndirectDisallowed) {
|
||||
|
||||
// Create the dummy compute pipeline.
|
||||
wgpu::ComputePipelineDescriptor pipelineDesc;
|
||||
pipelineDesc.computeStage.entryPoint = "main";
|
||||
pipelineDesc.computeStage.module =
|
||||
pipelineDesc.compute.entryPoint = "main";
|
||||
pipelineDesc.compute.module =
|
||||
utils::CreateShaderModule(device, "[[stage(compute)]] fn main() {}");
|
||||
wgpu::ComputePipeline pipeline = device.CreateComputePipeline(&pipelineDesc);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user