mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-20 10:25:28 +00:00
Rename CreateReady*Pipeline to Create*PipelineAsync
This follows the name change in the upstream WebGPU specification. Bug: dawn:529 Change-Id: I6d940dcc89f6b75136c642b578cb01bb8e40d681 Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/41720 Reviewed-by: Corentin Wallez <cwallez@chromium.org> Commit-Queue: Corentin Wallez <cwallez@chromium.org> Auto-Submit: Corentin Wallez <cwallez@chromium.org>
This commit is contained in:
committed by
Commit Bot service account
parent
1258e245a9
commit
2d3c2e3553
@@ -28,9 +28,9 @@ TEST_F(MultipleDeviceTest, ValidatesSameDevice) {
|
||||
ASSERT_DEVICE_ERROR(device.GetQueue().Submit(1, &commandBuffer));
|
||||
}
|
||||
|
||||
// Test that CreateReadyPipeline fails creation with an Error status if it uses
|
||||
// Test that CreatePipelineAsync fails creation with an Error status if it uses
|
||||
// objects from a different device.
|
||||
TEST_F(MultipleDeviceTest, ValidatesSameDeviceCreateReadyPipeline) {
|
||||
TEST_F(MultipleDeviceTest, ValidatesSameDeviceCreatePipelineAsync) {
|
||||
wgpu::ShaderModuleWGSLDescriptor wgslDesc = {};
|
||||
wgslDesc.source = R"(
|
||||
[[stage(compute)]] fn main() -> void {
|
||||
@@ -40,7 +40,7 @@ TEST_F(MultipleDeviceTest, ValidatesSameDeviceCreateReadyPipeline) {
|
||||
wgpu::ShaderModuleDescriptor shaderModuleDesc = {};
|
||||
shaderModuleDesc.nextInChain = &wgslDesc;
|
||||
|
||||
// Base case: CreateReadyComputePipeline succeeds.
|
||||
// Base case: CreateComputePipelineAsync succeeds.
|
||||
{
|
||||
wgpu::ShaderModule shaderModule = device.CreateShaderModule(&shaderModuleDesc);
|
||||
|
||||
@@ -48,18 +48,18 @@ TEST_F(MultipleDeviceTest, ValidatesSameDeviceCreateReadyPipeline) {
|
||||
pipelineDesc.computeStage.module = shaderModule;
|
||||
pipelineDesc.computeStage.entryPoint = "main";
|
||||
|
||||
StrictMock<MockCallback<WGPUCreateReadyComputePipelineCallback>> creationCallback;
|
||||
StrictMock<MockCallback<WGPUCreateComputePipelineAsyncCallback>> creationCallback;
|
||||
EXPECT_CALL(creationCallback,
|
||||
Call(WGPUCreateReadyPipelineStatus_Success, NotNull(), _, this))
|
||||
Call(WGPUCreatePipelineAsyncStatus_Success, NotNull(), _, this))
|
||||
.WillOnce(WithArg<1>(Invoke(
|
||||
[](WGPUComputePipeline pipeline) { wgpu::ComputePipeline::Acquire(pipeline); })));
|
||||
device.CreateReadyComputePipeline(&pipelineDesc, creationCallback.Callback(),
|
||||
device.CreateComputePipelineAsync(&pipelineDesc, creationCallback.Callback(),
|
||||
creationCallback.MakeUserdata(this));
|
||||
|
||||
WaitForAllOperations(device);
|
||||
}
|
||||
|
||||
// CreateReadyComputePipeline errors if the shader module is created on a different device.
|
||||
// CreateComputePipelineAsync errors if the shader module is created on a different device.
|
||||
{
|
||||
wgpu::Device device2 = RegisterDevice(CreateTestDevice());
|
||||
wgpu::ShaderModule shaderModule = device2.CreateShaderModule(&shaderModuleDesc);
|
||||
@@ -68,11 +68,11 @@ TEST_F(MultipleDeviceTest, ValidatesSameDeviceCreateReadyPipeline) {
|
||||
pipelineDesc.computeStage.module = shaderModule;
|
||||
pipelineDesc.computeStage.entryPoint = "main";
|
||||
|
||||
StrictMock<MockCallback<WGPUCreateReadyComputePipelineCallback>> creationCallback;
|
||||
StrictMock<MockCallback<WGPUCreateComputePipelineAsyncCallback>> creationCallback;
|
||||
EXPECT_CALL(creationCallback,
|
||||
Call(WGPUCreateReadyPipelineStatus_Error, nullptr, _, this + 1))
|
||||
Call(WGPUCreatePipelineAsyncStatus_Error, nullptr, _, this + 1))
|
||||
.Times(1);
|
||||
device.CreateReadyComputePipeline(&pipelineDesc, creationCallback.Callback(),
|
||||
device.CreateComputePipelineAsync(&pipelineDesc, creationCallback.Callback(),
|
||||
creationCallback.MakeUserdata(this + 1));
|
||||
|
||||
WaitForAllOperations(device);
|
||||
|
||||
Reference in New Issue
Block a user