mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-16 00:17:03 +00:00
D3D12: Skip dynamic buffer bindings with None visibility
This was hitting an ASSERT because D3D12 doesn't have an option to set None as the shader visibility. Bug: dawn:448 Change-Id: I3e056e531e7d1bb89da1736bc609bfe97a2fa194 Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/22324 Reviewed-by: Bryan Bernhart <bryan.bernhart@intel.com> Commit-Queue: Austin Eng <enga@chromium.org>
This commit is contained in:
committed by
Commit Bot service account
parent
0e3c27de6a
commit
3b7d0858bf
@@ -863,6 +863,38 @@ TEST_P(BindGroupTests, BindGroupLayoutVisibilityCanBeNone) {
|
||||
queue.Submit(1, &commands);
|
||||
}
|
||||
|
||||
// Regression test for crbug.com/dawn/448 that dynamic buffer bindings can have None visibility.
|
||||
TEST_P(BindGroupTests, DynamicBindingNoneVisibility) {
|
||||
utils::BasicRenderPass renderPass = utils::CreateBasicRenderPass(device, kRTSize, kRTSize);
|
||||
|
||||
wgpu::BindGroupLayoutEntry entry = {0, wgpu::ShaderStage::None,
|
||||
wgpu::BindingType::UniformBuffer, true};
|
||||
wgpu::BindGroupLayoutDescriptor descriptor;
|
||||
descriptor.entryCount = 1;
|
||||
descriptor.entries = &entry;
|
||||
wgpu::BindGroupLayout layout = device.CreateBindGroupLayout(&descriptor);
|
||||
|
||||
wgpu::RenderPipeline pipeline = MakeTestPipeline(renderPass, {}, {layout});
|
||||
|
||||
std::array<float, 4> color = {1, 0, 0, 1};
|
||||
wgpu::Buffer uniformBuffer =
|
||||
utils::CreateBufferFromData(device, &color, sizeof(color), wgpu::BufferUsage::Uniform);
|
||||
wgpu::BindGroup bindGroup =
|
||||
utils::MakeBindGroup(device, layout, {{0, uniformBuffer, 0, sizeof(color)}});
|
||||
|
||||
uint32_t dynamicOffset = 0;
|
||||
|
||||
wgpu::CommandEncoder encoder = device.CreateCommandEncoder();
|
||||
wgpu::RenderPassEncoder pass = encoder.BeginRenderPass(&renderPass.renderPassInfo);
|
||||
pass.SetPipeline(pipeline);
|
||||
pass.SetBindGroup(0, bindGroup, 1, &dynamicOffset);
|
||||
pass.Draw(3);
|
||||
pass.EndPass();
|
||||
|
||||
wgpu::CommandBuffer commands = encoder.Finish();
|
||||
queue.Submit(1, &commands);
|
||||
}
|
||||
|
||||
// Test that bind group bindings may have unbounded and arbitrary binding numbers
|
||||
TEST_P(BindGroupTests, ArbitraryBindingNumbers) {
|
||||
utils::BasicRenderPass renderPass = utils::CreateBasicRenderPass(device, kRTSize, kRTSize);
|
||||
|
||||
Reference in New Issue
Block a user