diff --git a/src/tests/end2end/ComputeStorageBufferBarrierTests.cpp b/src/tests/end2end/ComputeStorageBufferBarrierTests.cpp index d521ac07f1..63c523de64 100644 --- a/src/tests/end2end/ComputeStorageBufferBarrierTests.cpp +++ b/src/tests/end2end/ComputeStorageBufferBarrierTests.cpp @@ -41,19 +41,14 @@ TEST_P(ComputeStorageBufferBarrierTests, AddIncrement) { } )"); - wgpu::BindGroupLayout bgl = utils::MakeBindGroupLayout( - device, {{0, wgpu::ShaderStage::Compute, wgpu::BindingType::StorageBuffer}}); - - wgpu::BindGroup bindGroup = utils::MakeBindGroup(device, bgl, {{0, buffer, 0, bufferSize}}); - - wgpu::PipelineLayout layout = utils::MakeBasicPipelineLayout(device, &bgl); - wgpu::ComputePipelineDescriptor pipelineDesc = {}; - pipelineDesc.layout = layout; pipelineDesc.computeStage.module = module; pipelineDesc.computeStage.entryPoint = "main"; wgpu::ComputePipeline pipeline = device.CreateComputePipeline(&pipelineDesc); + wgpu::BindGroup bindGroup = + utils::MakeBindGroup(device, pipeline.GetBindGroupLayout(0), {{0, buffer, 0, bufferSize}}); + wgpu::CommandEncoder encoder = device.CreateCommandEncoder(); wgpu::ComputePassEncoder pass = encoder.BeginComputePass(); pass.SetPipeline(pipeline); @@ -95,17 +90,18 @@ TEST_P(ComputeStorageBufferBarrierTests, AddPingPong) { } )"); - wgpu::BindGroupLayout bgl = utils::MakeBindGroupLayout( - device, {{0, wgpu::ShaderStage::Compute, wgpu::BindingType::StorageBuffer}, - {1, wgpu::ShaderStage::Compute, wgpu::BindingType::StorageBuffer}}); + wgpu::ComputePipelineDescriptor pipelineDesc = {}; + pipelineDesc.computeStage.module = module; + pipelineDesc.computeStage.entryPoint = "main"; + wgpu::ComputePipeline pipeline = device.CreateComputePipeline(&pipelineDesc); - wgpu::BindGroup bindGroupA = utils::MakeBindGroup(device, bgl, + wgpu::BindGroup bindGroupA = utils::MakeBindGroup(device, pipeline.GetBindGroupLayout(0), { {0, bufferA, 0, bufferSize}, {1, bufferB, 0, bufferSize}, }); - wgpu::BindGroup bindGroupB = utils::MakeBindGroup(device, bgl, + wgpu::BindGroup bindGroupB = utils::MakeBindGroup(device, pipeline.GetBindGroupLayout(0), { {0, bufferB, 0, bufferSize}, {1, bufferA, 0, bufferSize}, @@ -113,14 +109,6 @@ TEST_P(ComputeStorageBufferBarrierTests, AddPingPong) { wgpu::BindGroup bindGroups[2] = {bindGroupA, bindGroupB}; - wgpu::PipelineLayout layout = utils::MakeBasicPipelineLayout(device, &bgl); - - wgpu::ComputePipelineDescriptor pipelineDesc = {}; - pipelineDesc.layout = layout; - pipelineDesc.computeStage.module = module; - pipelineDesc.computeStage.entryPoint = "main"; - wgpu::ComputePipeline pipeline = device.CreateComputePipeline(&pipelineDesc); - wgpu::CommandEncoder encoder = device.CreateCommandEncoder(); wgpu::ComputePassEncoder pass = encoder.BeginComputePass(); pass.SetPipeline(pipeline); @@ -168,17 +156,18 @@ TEST_P(ComputeStorageBufferBarrierTests, UniformToStorageAddPingPong) { } )"); - wgpu::BindGroupLayout bgl = utils::MakeBindGroupLayout( - device, {{0, wgpu::ShaderStage::Compute, wgpu::BindingType::UniformBuffer}, - {1, wgpu::ShaderStage::Compute, wgpu::BindingType::StorageBuffer}}); + wgpu::ComputePipelineDescriptor pipelineDesc = {}; + pipelineDesc.computeStage.module = module; + pipelineDesc.computeStage.entryPoint = "main"; + wgpu::ComputePipeline pipeline = device.CreateComputePipeline(&pipelineDesc); - wgpu::BindGroup bindGroupA = utils::MakeBindGroup(device, bgl, + wgpu::BindGroup bindGroupA = utils::MakeBindGroup(device, pipeline.GetBindGroupLayout(0), { {0, bufferA, 0, bufferSize}, {1, bufferB, 0, bufferSize}, }); - wgpu::BindGroup bindGroupB = utils::MakeBindGroup(device, bgl, + wgpu::BindGroup bindGroupB = utils::MakeBindGroup(device, pipeline.GetBindGroupLayout(0), { {0, bufferB, 0, bufferSize}, {1, bufferA, 0, bufferSize}, @@ -186,14 +175,6 @@ TEST_P(ComputeStorageBufferBarrierTests, UniformToStorageAddPingPong) { wgpu::BindGroup bindGroups[2] = {bindGroupA, bindGroupB}; - wgpu::PipelineLayout layout = utils::MakeBasicPipelineLayout(device, &bgl); - - wgpu::ComputePipelineDescriptor pipelineDesc = {}; - pipelineDesc.layout = layout; - pipelineDesc.computeStage.module = module; - pipelineDesc.computeStage.entryPoint = "main"; - wgpu::ComputePipeline pipeline = device.CreateComputePipeline(&pipelineDesc); - wgpu::CommandEncoder encoder = device.CreateCommandEncoder(); for (uint32_t i = 0, b = 0; i < kIterations; ++i, b = 1 - b) {