Make CreateRenderPipelineAsync use Descriptor2

Since it isn't used by anyone yet we can make a breaking change to
CreateRenderPipelineAsync to immediately start using
RenderPipelineDescriptor2.

Bug: dawn:1177501
Change-Id: I9f88c6fc1b325b7a9356536e2a071d4f17abd6ea
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/45280
Commit-Queue: Brandon Jones <bajones@chromium.org>
Auto-Submit: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Brandon Jones <bajones@chromium.org>
This commit is contained in:
Corentin Wallez
2021-03-21 23:13:04 +00:00
committed by Commit Bot service account
parent 6b80743d3f
commit 8ac6a481a3
10 changed files with 66 additions and 65 deletions

View File

@@ -235,21 +235,21 @@ TEST_F(UnsafeAPIValidationTest, CreateComputePipelineAsyncDisallowed) {
// Check that CreateRenderPipelineAsync is disallowed as part of unsafe APIs
TEST_F(UnsafeAPIValidationTest, CreateRenderPipelineAsyncDisallowed) {
utils::ComboRenderPipelineDescriptor desc(device);
desc.vertexStage.module = utils::CreateShaderModuleFromWGSL(device, R"(
utils::ComboRenderPipelineDescriptor2 desc;
desc.vertex.module = utils::CreateShaderModuleFromWGSL(device, R"(
[[builtin(position)]] var<out> Position : vec4<f32>;
[[stage(vertex)]] fn main() -> void {
Position = vec4<f32>(0.0, 0.0, 0.0, 1.0);
})");
desc.cFragmentStage.module = utils::CreateShaderModuleFromWGSL(device, R"(
desc.cFragment.module = utils::CreateShaderModuleFromWGSL(device, R"(
[[location(0)]] var<out> o_color : vec4<f32>;
[[stage(fragment)]] fn main() -> void {
o_color = vec4<f32>(0.0, 1.0, 0.0, 1.0);
})");
desc.cColorStates[0].format = wgpu::TextureFormat::RGBA8Unorm;
desc.cTargets[0].format = wgpu::TextureFormat::RGBA8Unorm;
// Control case: CreateRenderPipeline is allowed.
device.CreateRenderPipeline(&desc);
device.CreateRenderPipeline2(&desc);
// TODO(bajones): Enable this when the deprecation warning is re-enabled in Device.cpp.
// EXPECT_DEPRECATION_WARNING(device.CreateRenderPipeline(&desc));