Removed deprecated CreateRenderPipeline path

Renames all the RenderPipeline*2 stuff to simple RenderPipeline* but
keeps *2 definitionas around as typedefs and wrappers so that users can
migrate away from it.

Bug: dawn:22
Change-Id: If301d81a829bba0646c3a61068f2279932b191e0
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/51764
Commit-Queue: Brandon Jones <bajones@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
This commit is contained in:
Brandon Jones
2021-05-21 05:01:38 +00:00
committed by Dawn LUCI CQ
parent 4589de61a0
commit 41c87d973a
110 changed files with 609 additions and 927 deletions

View File

@@ -119,13 +119,13 @@ void init() {
wgpu::BindGroupLayout bgl = utils::MakeBindGroupLayout(
device, {{0, wgpu::ShaderStage::Vertex, wgpu::BufferBindingType::Uniform, true}});
utils::ComboRenderPipelineDescriptor2 descriptor;
utils::ComboRenderPipelineDescriptor descriptor;
descriptor.layout = utils::MakeBasicPipelineLayout(device, &bgl);
descriptor.vertex.module = vsModule;
descriptor.cFragment.module = fsModule;
descriptor.cTargets[0].format = GetPreferredSwapChainTextureFormat();
pipeline = device.CreateRenderPipeline2(&descriptor);
pipeline = device.CreateRenderPipeline(&descriptor);
shaderData.resize(kNumTriangles);
for (auto& data : shaderData) {

View File

@@ -56,7 +56,7 @@ void init() {
WGPUShaderModule fsModule = utils::CreateShaderModule(device, fs).Release();
{
WGPURenderPipelineDescriptor2 descriptor = {};
WGPURenderPipelineDescriptor descriptor = {};
// Fragment state
WGPUBlendState blend = {};
@@ -97,7 +97,7 @@ void init() {
descriptor.primitive.topology = WGPUPrimitiveTopology_TriangleList;
descriptor.primitive.stripIndexFormat = WGPUIndexFormat_Undefined;
pipeline = wgpuDeviceCreateRenderPipeline2(device, &descriptor);
pipeline = wgpuDeviceCreateRenderPipeline(device, &descriptor);
}
wgpuShaderModuleRelease(vsModule);

View File

@@ -121,7 +121,7 @@ void initRender() {
depthStencilView = CreateDefaultDepthStencilView(device);
utils::ComboRenderPipelineDescriptor2 descriptor;
utils::ComboRenderPipelineDescriptor descriptor;
descriptor.vertex.module = vsModule;
descriptor.vertex.bufferCount = 2;
@@ -143,7 +143,7 @@ void initRender() {
descriptor.EnableDepthStencil(wgpu::TextureFormat::Depth24PlusStencil8);
descriptor.cTargets[0].format = GetPreferredSwapChainTextureFormat();
renderPipeline = device.CreateRenderPipeline2(&descriptor);
renderPipeline = device.CreateRenderPipeline(&descriptor);
}
void initSim() {

View File

@@ -120,7 +120,7 @@ void init() {
depthStencilView = CreateDefaultDepthStencilView(device);
utils::ComboRenderPipelineDescriptor2 descriptor;
utils::ComboRenderPipelineDescriptor descriptor;
descriptor.layout = utils::MakeBasicPipelineLayout(device, &bgl);
descriptor.vertex.module = vsModule;
descriptor.vertex.bufferCount = 1;
@@ -131,7 +131,7 @@ void init() {
descriptor.cTargets[0].format = GetPreferredSwapChainTextureFormat();
descriptor.EnableDepthStencil(wgpu::TextureFormat::Depth24PlusStencil8);
pipeline = device.CreateRenderPipeline2(&descriptor);
pipeline = device.CreateRenderPipeline(&descriptor);
wgpu::TextureView view = texture.CreateView();

View File

@@ -184,7 +184,7 @@ void init() {
depthStencilView = CreateDefaultDepthStencilView(device);
{
utils::ComboRenderPipelineDescriptor2 descriptor;
utils::ComboRenderPipelineDescriptor descriptor;
descriptor.vertex.module = vsModule;
descriptor.vertex.bufferCount = 1;
descriptor.vertex.buffers = &vertexBufferLayout;
@@ -198,11 +198,11 @@ void init() {
depthStencil->depthWriteEnabled = true;
depthStencil->depthCompare = wgpu::CompareFunction::Less;
pipeline = device.CreateRenderPipeline2(&descriptor);
pipeline = device.CreateRenderPipeline(&descriptor);
}
{
utils::ComboRenderPipelineDescriptor2 descriptor;
utils::ComboRenderPipelineDescriptor descriptor;
descriptor.vertex.module = vsModule;
descriptor.vertex.bufferCount = 1;
descriptor.vertex.buffers = &vertexBufferLayout;
@@ -217,11 +217,11 @@ void init() {
depthStencil->stencilBack.passOp = wgpu::StencilOperation::Replace;
depthStencil->depthCompare = wgpu::CompareFunction::Less;
planePipeline = device.CreateRenderPipeline2(&descriptor);
planePipeline = device.CreateRenderPipeline(&descriptor);
}
{
utils::ComboRenderPipelineDescriptor2 descriptor;
utils::ComboRenderPipelineDescriptor descriptor;
descriptor.vertex.module = vsModule;
descriptor.vertex.bufferCount = 1;
descriptor.vertex.buffers = &vertexBufferLayout;
@@ -239,7 +239,7 @@ void init() {
depthStencil->depthWriteEnabled = true;
depthStencil->depthCompare = wgpu::CompareFunction::Less;
reflectionPipeline = device.CreateRenderPipeline2(&descriptor);
reflectionPipeline = device.CreateRenderPipeline(&descriptor);
}
cameraData.proj = glm::perspective(glm::radians(45.0f), 1.f, 1.0f, 100.0f);

View File

@@ -311,7 +311,7 @@ int main(int argc, const char* argv[]) {
queue = device.GetQueue();
// The hacky pipeline to render a triangle.
utils::ComboRenderPipelineDescriptor2 pipelineDesc;
utils::ComboRenderPipelineDescriptor pipelineDesc;
pipelineDesc.vertex.module = utils::CreateShaderModule(device, R"(
let pos : array<vec2<f32>, 3> = array<vec2<f32>, 3>(
vec2<f32>( 0.0, 0.5),
@@ -328,7 +328,7 @@ int main(int argc, const char* argv[]) {
})");
// BGRA shouldn't be hardcoded. Consider having a map[format -> pipeline].
pipelineDesc.cTargets[0].format = wgpu::TextureFormat::BGRA8Unorm;
trianglePipeline = device.CreateRenderPipeline2(&pipelineDesc);
trianglePipeline = device.CreateRenderPipeline(&pipelineDesc);
// Craete the first window, since the example exits when there are no windows.
AddWindow();