Make dawn idl support dynamic buffer offset
This patch simply added dynamic buffer offset in dawn idl and modify the shape of SetBindGroup. BUG=dawn:55 Change-Id: I516e08f3ee558ba375a87d98eaea6d60e93d4514 Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/5600 Commit-Queue: Shaobo Yan <shaobo.yan@intel.com> Reviewed-by: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Kai Ninomiya <kainino@chromium.org>
This commit is contained in:
parent
931311700c
commit
991ab98f11
12
dawn.json
12
dawn.json
|
@ -73,7 +73,9 @@
|
|||
{"value": 0, "name": "uniform buffer"},
|
||||
{"value": 1, "name": "sampler"},
|
||||
{"value": 2, "name": "sampled texture"},
|
||||
{"value": 3, "name": "storage buffer"}
|
||||
{"value": 3, "name": "storage buffer"},
|
||||
{"value": 4, "name": "dynamic uniform buffer"},
|
||||
{"value": 5, "name": "dynamic storage buffer"}
|
||||
]
|
||||
},
|
||||
"blend descriptor": {
|
||||
|
@ -375,7 +377,9 @@
|
|||
"name": "set bind group",
|
||||
"args": [
|
||||
{"name": "group index", "type": "uint32_t"},
|
||||
{"name": "group", "type": "bind group"}
|
||||
{"name": "group", "type": "bind group"},
|
||||
{"name": "dynamic offset count", "type": "uint32_t"},
|
||||
{"name": "dynamic offsets", "type": "uint32_t", "annotation": "const*", "length": "dynamic offset count"}
|
||||
]
|
||||
},
|
||||
{
|
||||
|
@ -776,7 +780,9 @@
|
|||
"name": "set bind group",
|
||||
"args": [
|
||||
{"name": "group index", "type": "uint32_t"},
|
||||
{"name": "group", "type": "bind group"}
|
||||
{"name": "group", "type": "bind group"},
|
||||
{"name": "dynamic offset count", "type": "uint32_t"},
|
||||
{"name": "dynamic offsets", "type": "uint32_t", "annotation": "const*", "length": "dynamic offset count"}
|
||||
]
|
||||
},
|
||||
{
|
||||
|
|
|
@ -285,7 +285,7 @@ dawn::CommandBuffer createCommandBuffer(const dawn::Texture backbuffer, size_t i
|
|||
{
|
||||
dawn::ComputePassEncoder pass = encoder.BeginComputePass();
|
||||
pass.SetPipeline(updatePipeline);
|
||||
pass.SetBindGroup(0, updateBGs[i]);
|
||||
pass.SetBindGroup(0, updateBGs[i], 0, nullptr);
|
||||
pass.Dispatch(kNumParticles, 1, 1);
|
||||
pass.EndPass();
|
||||
}
|
||||
|
|
|
@ -169,7 +169,7 @@ void frame() {
|
|||
{
|
||||
dawn::RenderPassEncoder pass = encoder.BeginRenderPass(&renderPass);
|
||||
pass.SetPipeline(pipeline);
|
||||
pass.SetBindGroup(0, bindGroup);
|
||||
pass.SetBindGroup(0, bindGroup, 0, nullptr);
|
||||
pass.SetVertexBuffers(0, 1, &vertexBuffer, vertexBufferOffsets);
|
||||
pass.SetIndexBuffer(indexBuffer, 0);
|
||||
pass.DrawIndexed(3, 1, 0, 0, 0);
|
||||
|
|
|
@ -280,20 +280,20 @@ void frame() {
|
|||
{
|
||||
dawn::RenderPassEncoder pass = encoder.BeginRenderPass(&renderPass);
|
||||
pass.SetPipeline(pipeline);
|
||||
pass.SetBindGroup(0, bindGroup[0]);
|
||||
pass.SetBindGroup(0, bindGroup[0], 0, nullptr);
|
||||
pass.SetVertexBuffers(0, 1, &vertexBuffer, vertexBufferOffsets);
|
||||
pass.SetIndexBuffer(indexBuffer, 0);
|
||||
pass.DrawIndexed(36, 1, 0, 0, 0);
|
||||
|
||||
pass.SetStencilReference(0x1);
|
||||
pass.SetPipeline(planePipeline);
|
||||
pass.SetBindGroup(0, bindGroup[0]);
|
||||
pass.SetBindGroup(0, bindGroup[0], 0, nullptr);
|
||||
pass.SetVertexBuffers(0, 1, &planeBuffer, vertexBufferOffsets);
|
||||
pass.DrawIndexed(6, 1, 0, 0, 0);
|
||||
|
||||
pass.SetPipeline(reflectionPipeline);
|
||||
pass.SetVertexBuffers(0, 1, &vertexBuffer, vertexBufferOffsets);
|
||||
pass.SetBindGroup(0, bindGroup[1]);
|
||||
pass.SetBindGroup(0, bindGroup[1], 0, nullptr);
|
||||
pass.DrawIndexed(36, 1, 0, 0, 0);
|
||||
|
||||
pass.EndPass();
|
||||
|
|
|
@ -525,7 +525,7 @@ namespace {
|
|||
}
|
||||
const MaterialInfo& material = getMaterial(iPrim.material, strides[0], strides[1], strides[2]);
|
||||
pass.SetPipeline(material.pipeline);
|
||||
pass.SetBindGroup(0, material.bindGroup0);
|
||||
pass.SetBindGroup(0, material.bindGroup0, 0, nullptr);
|
||||
pass.SetPushConstants(dawn::ShaderStageBit::Vertex,
|
||||
0, sizeof(u_transform_block) / sizeof(uint32_t),
|
||||
reinterpret_cast<const uint32_t*>(&transforms));
|
||||
|
|
|
@ -138,6 +138,10 @@ namespace dawn_native {
|
|||
case dawn::BindingType::Sampler:
|
||||
DAWN_TRY(ValidateSamplerBinding(device, binding));
|
||||
break;
|
||||
// TODO(shaobo.yan@intel.com): Implement dynamic buffer offset.
|
||||
case dawn::BindingType::DynamicUniformBuffer:
|
||||
case dawn::BindingType::DynamicStorageBuffer:
|
||||
return DAWN_VALIDATION_ERROR("Dawn doesn't support dynamic buffer yet");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -512,6 +512,12 @@ namespace dawn_native {
|
|||
|
||||
case dawn::BindingType::Sampler:
|
||||
break;
|
||||
|
||||
// TODO(shaobo.yan@intel.com): Implement dynamic buffer offset
|
||||
case dawn::BindingType::DynamicUniformBuffer:
|
||||
case dawn::BindingType::DynamicStorageBuffer:
|
||||
UNREACHABLE();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -81,7 +81,10 @@ namespace dawn_native {
|
|||
memcpy(label, groupLabel, cmd->length + 1);
|
||||
}
|
||||
|
||||
void ProgrammablePassEncoder::SetBindGroup(uint32_t groupIndex, BindGroupBase* group) {
|
||||
void ProgrammablePassEncoder::SetBindGroup(uint32_t groupIndex,
|
||||
BindGroupBase* group,
|
||||
uint32_t dynamicOffsetCount,
|
||||
const uint32_t* dynamicOffsets) {
|
||||
if (mTopLevelEncoder->ConsumedError(ValidateCanRecordCommands()) ||
|
||||
mTopLevelEncoder->ConsumedError(GetDevice()->ValidateObject(group))) {
|
||||
return;
|
||||
|
@ -92,6 +95,12 @@ namespace dawn_native {
|
|||
return;
|
||||
}
|
||||
|
||||
// TODO(shaobo.yan@intel.com): Implement dynamic buffer offset.
|
||||
if (dynamicOffsetCount != 0) {
|
||||
mTopLevelEncoder->HandleError("Dynamic Buffer Offset not supported yet");
|
||||
return;
|
||||
}
|
||||
|
||||
SetBindGroupCmd* cmd = mAllocator->Allocate<SetBindGroupCmd>(Command::SetBindGroup);
|
||||
new (cmd) SetBindGroupCmd;
|
||||
cmd->index = groupIndex;
|
||||
|
|
|
@ -39,7 +39,10 @@ namespace dawn_native {
|
|||
void PopDebugGroup();
|
||||
void PushDebugGroup(const char* groupLabel);
|
||||
|
||||
void SetBindGroup(uint32_t groupIndex, BindGroupBase* group);
|
||||
void SetBindGroup(uint32_t groupIndex,
|
||||
BindGroupBase* group,
|
||||
uint32_t dynamicOffsetCount,
|
||||
const uint32_t* dynamicOffsets);
|
||||
void SetPushConstants(dawn::ShaderStageBit stages,
|
||||
uint32_t offset,
|
||||
uint32_t count,
|
||||
|
|
|
@ -95,6 +95,12 @@ namespace dawn_native { namespace d3d12 {
|
|||
&samplerDesc, samplerHeapStart.GetCPUHandle(*samplerHeapOffset +
|
||||
bindingOffsets[bindingIndex]));
|
||||
} break;
|
||||
|
||||
// TODO(shaobo.yan@intel.com): Implement dynamic buffer offset.
|
||||
case dawn::BindingType::DynamicUniformBuffer:
|
||||
case dawn::BindingType::DynamicStorageBuffer:
|
||||
UNREACHABLE();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -37,6 +37,11 @@ namespace dawn_native { namespace d3d12 {
|
|||
case dawn::BindingType::Sampler:
|
||||
mBindingOffsets[binding] = mDescriptorCounts[Sampler]++;
|
||||
break;
|
||||
// TODO(shaobo.yan@intel.com): Implement dynamic buffer offset.
|
||||
case dawn::BindingType::DynamicUniformBuffer:
|
||||
case dawn::BindingType::DynamicStorageBuffer:
|
||||
UNREACHABLE();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -95,6 +100,11 @@ namespace dawn_native { namespace d3d12 {
|
|||
case dawn::BindingType::Sampler:
|
||||
mBindingOffsets[binding] += descriptorOffsets[Sampler];
|
||||
break;
|
||||
// TODO(shaobo.yan@intel.com): Implement dynamic buffer offset.
|
||||
case dawn::BindingType::DynamicUniformBuffer:
|
||||
case dawn::BindingType::DynamicStorageBuffer:
|
||||
UNREACHABLE();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -199,6 +199,12 @@ namespace dawn_native { namespace metal {
|
|||
[compute setTexture:textureView->GetMTLTexture() atIndex:computeIndex];
|
||||
}
|
||||
} break;
|
||||
|
||||
// TODO(shaobo.yan@intel.com): Implement dynamic buffer offset.
|
||||
case dawn::BindingType::DynamicUniformBuffer:
|
||||
case dawn::BindingType::DynamicStorageBuffer:
|
||||
UNREACHABLE();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -53,6 +53,11 @@ namespace dawn_native { namespace metal {
|
|||
mIndexInfo[stage][group][binding] = textureIndex;
|
||||
textureIndex++;
|
||||
break;
|
||||
// TODO(shaobo.yan@intel.com): Implement dynamic buffer offset
|
||||
case dawn::BindingType::DynamicUniformBuffer:
|
||||
case dawn::BindingType::DynamicStorageBuffer:
|
||||
UNREACHABLE();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -278,6 +278,12 @@ namespace dawn_native { namespace opengl {
|
|||
glBindBufferRange(GL_SHADER_STORAGE_BUFFER, ssboIndex, buffer,
|
||||
binding.offset, binding.size);
|
||||
} break;
|
||||
|
||||
// TODO(shaobo.yan@intel.com): Implement dynamic buffer offset.
|
||||
case dawn::BindingType::DynamicUniformBuffer:
|
||||
case dawn::BindingType::DynamicStorageBuffer:
|
||||
UNREACHABLE();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -159,6 +159,12 @@ namespace dawn_native { namespace opengl {
|
|||
// These binding types are handled in the separate sampler and texture
|
||||
// emulation
|
||||
break;
|
||||
|
||||
// TODO(shaobo.yan@intel.com): Implement dynamic buffer offset.
|
||||
case dawn::BindingType::DynamicUniformBuffer:
|
||||
case dawn::BindingType::DynamicStorageBuffer:
|
||||
UNREACHABLE();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -53,6 +53,12 @@ namespace dawn_native { namespace opengl {
|
|||
mIndexInfo[group][binding] = ssboIndex;
|
||||
ssboIndex++;
|
||||
break;
|
||||
|
||||
// TODO(shaobo.yan@intel.com): Implement dynamic buffer offset
|
||||
case dawn::BindingType::DynamicUniformBuffer:
|
||||
case dawn::BindingType::DynamicStorageBuffer:
|
||||
UNREACHABLE();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -49,6 +49,9 @@ namespace dawn_native { namespace vulkan {
|
|||
return VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE;
|
||||
case dawn::BindingType::StorageBuffer:
|
||||
return VK_DESCRIPTOR_TYPE_STORAGE_BUFFER;
|
||||
case dawn::BindingType::DynamicUniformBuffer:
|
||||
case dawn::BindingType::DynamicStorageBuffer:
|
||||
UNREACHABLE();
|
||||
default:
|
||||
UNREACHABLE();
|
||||
}
|
||||
|
@ -125,6 +128,9 @@ namespace dawn_native { namespace vulkan {
|
|||
return SAMPLED_IMAGE;
|
||||
case dawn::BindingType::StorageBuffer:
|
||||
return STORAGE_BUFFER;
|
||||
case dawn::BindingType::DynamicUniformBuffer:
|
||||
case dawn::BindingType::DynamicStorageBuffer:
|
||||
UNREACHABLE();
|
||||
default:
|
||||
UNREACHABLE();
|
||||
}
|
||||
|
|
|
@ -108,6 +108,11 @@ namespace dawn_native { namespace vulkan {
|
|||
|
||||
write.pImageInfo = &writeImageInfo[numWrites];
|
||||
} break;
|
||||
|
||||
case dawn::BindingType::DynamicUniformBuffer:
|
||||
case dawn::BindingType::DynamicStorageBuffer:
|
||||
UNREACHABLE();
|
||||
break;
|
||||
default:
|
||||
UNREACHABLE();
|
||||
}
|
||||
|
|
|
@ -27,7 +27,7 @@ protected:
|
|||
dawn::CommandEncoder encoder = device.CreateCommandEncoder();
|
||||
dawn::ComputePassEncoder pass = encoder.BeginComputePass();
|
||||
pass.SetPipeline(pipeline);
|
||||
pass.SetBindGroup(0, bindGroup);
|
||||
pass.SetBindGroup(0, bindGroup, 0, nullptr);
|
||||
pass.Dispatch(1, 1, 1);
|
||||
pass.EndPass();
|
||||
return encoder.Finish();
|
||||
|
@ -155,7 +155,7 @@ TEST_P(BindGroupTests, ReusedUBO) {
|
|||
dawn::CommandEncoder encoder = device.CreateCommandEncoder();
|
||||
dawn::RenderPassEncoder pass = encoder.BeginRenderPass(&renderPass.renderPassInfo);
|
||||
pass.SetPipeline(pipeline);
|
||||
pass.SetBindGroup(0, bindGroup);
|
||||
pass.SetBindGroup(0, bindGroup, 0, nullptr);
|
||||
pass.Draw(3, 1, 0, 0);
|
||||
pass.EndPass();
|
||||
|
||||
|
@ -275,7 +275,7 @@ TEST_P(BindGroupTests, UBOSamplerAndTexture) {
|
|||
encoder.CopyBufferToTexture(&bufferCopyView, &textureCopyView, ©Size);
|
||||
dawn::RenderPassEncoder pass = encoder.BeginRenderPass(&renderPass.renderPassInfo);
|
||||
pass.SetPipeline(pipeline);
|
||||
pass.SetBindGroup(0, bindGroup);
|
||||
pass.SetBindGroup(0, bindGroup, 0, nullptr);
|
||||
pass.Draw(3, 1, 0, 0);
|
||||
pass.EndPass();
|
||||
|
||||
|
@ -370,8 +370,8 @@ TEST_P(BindGroupTests, MultipleBindLayouts) {
|
|||
dawn::CommandEncoder encoder = device.CreateCommandEncoder();
|
||||
dawn::RenderPassEncoder pass = encoder.BeginRenderPass(&renderPass.renderPassInfo);
|
||||
pass.SetPipeline(pipeline);
|
||||
pass.SetBindGroup(0, bindGroups[0]);
|
||||
pass.SetBindGroup(1, bindGroups[1]);
|
||||
pass.SetBindGroup(0, bindGroups[0], 0, nullptr);
|
||||
pass.SetBindGroup(1, bindGroups[1], 0, nullptr);
|
||||
pass.Draw(3, 1, 0, 0);
|
||||
pass.EndPass();
|
||||
|
||||
|
@ -445,10 +445,10 @@ TEST_P(BindGroupTests, DrawTwiceInSamePipelineWithFourBindGroupSets)
|
|||
dawn::BindGroup bindGroup = utils::MakeBindGroup(
|
||||
device, layout, { { 0, uniformBuffer, 0, sizeof(color) } });
|
||||
|
||||
pass.SetBindGroup(0, bindGroup);
|
||||
pass.SetBindGroup(1, bindGroup);
|
||||
pass.SetBindGroup(2, bindGroup);
|
||||
pass.SetBindGroup(3, bindGroup);
|
||||
pass.SetBindGroup(0, bindGroup, 0, nullptr);
|
||||
pass.SetBindGroup(1, bindGroup, 0, nullptr);
|
||||
pass.SetBindGroup(2, bindGroup, 0, nullptr);
|
||||
pass.SetBindGroup(3, bindGroup, 0, nullptr);
|
||||
pass.Draw(3, 1, 0, 0);
|
||||
|
||||
pass.SetPipeline(pipeline);
|
||||
|
|
|
@ -116,12 +116,12 @@ class ColorStateTest : public DawnTest {
|
|||
dawn::RenderPassEncoder pass = encoder.BeginRenderPass(&renderPass.renderPassInfo);
|
||||
// First use the base pipeline to draw a triangle with no blending
|
||||
pass.SetPipeline(basePipeline);
|
||||
pass.SetBindGroup(0, MakeBindGroupForColors(std::array<RGBA8, 1>({{base}})));
|
||||
pass.SetBindGroup(0, MakeBindGroupForColors(std::array<RGBA8, 1>({{base}})), 0, nullptr);
|
||||
pass.Draw(3, 1, 0, 0);
|
||||
|
||||
// Then use the test pipeline to draw the test triangle with blending
|
||||
pass.SetPipeline(testPipeline);
|
||||
pass.SetBindGroup(0, MakeBindGroupForColors(std::array<RGBA8, 1>({{triangle.color}})));
|
||||
pass.SetBindGroup(0, MakeBindGroupForColors(std::array<RGBA8, 1>({{triangle.color}})), 0, nullptr);
|
||||
pass.SetBlendColor(&blendColor);
|
||||
pass.Draw(3, 1, 0, 0);
|
||||
pass.EndPass();
|
||||
|
@ -735,7 +735,7 @@ TEST_P(ColorStateTest, ColorWriteMaskBlendingDisabled) {
|
|||
{
|
||||
dawn::RenderPassEncoder pass = encoder.BeginRenderPass(&renderPass.renderPassInfo);
|
||||
pass.SetPipeline(testPipeline);
|
||||
pass.SetBindGroup(0, MakeBindGroupForColors(std::array<RGBA8, 1>({{base}})));
|
||||
pass.SetBindGroup(0, MakeBindGroupForColors(std::array<RGBA8, 1>({{base}})), 0, nullptr);
|
||||
pass.Draw(3, 1, 0, 0);
|
||||
pass.EndPass();
|
||||
}
|
||||
|
@ -852,12 +852,12 @@ TEST_P(ColorStateTest, IndependentColorState) {
|
|||
dawn::RenderPassEncoder pass = encoder.BeginRenderPass(&renderPass);
|
||||
pass.SetPipeline(basePipeline);
|
||||
pass.SetBindGroup(
|
||||
0, MakeBindGroupForColors(std::array<RGBA8, 4>({{base, base, base, base}})));
|
||||
0, MakeBindGroupForColors(std::array<RGBA8, 4>({{base, base, base, base}})), 0, nullptr);
|
||||
pass.Draw(3, 1, 0, 0);
|
||||
|
||||
pass.SetPipeline(testPipeline);
|
||||
pass.SetBindGroup(0, MakeBindGroupForColors(
|
||||
std::array<RGBA8, 4>({{color0, color1, color2, color3}})));
|
||||
std::array<RGBA8, 4>({{color0, color1, color2, color3}})), 0, nullptr);
|
||||
pass.Draw(3, 1, 0, 0);
|
||||
pass.EndPass();
|
||||
}
|
||||
|
@ -926,11 +926,11 @@ TEST_P(ColorStateTest, DefaultBlendColor) {
|
|||
dawn::RenderPassEncoder pass = encoder.BeginRenderPass(&renderPass.renderPassInfo);
|
||||
pass.SetPipeline(basePipeline);
|
||||
pass.SetBindGroup(0,
|
||||
MakeBindGroupForColors(std::array<RGBA8, 1>({{RGBA8(0, 0, 0, 0)}})));
|
||||
MakeBindGroupForColors(std::array<RGBA8, 1>({{RGBA8(0, 0, 0, 0)}})), 0, nullptr);
|
||||
pass.Draw(3, 1, 0, 0);
|
||||
pass.SetPipeline(testPipeline);
|
||||
pass.SetBindGroup(
|
||||
0, MakeBindGroupForColors(std::array<RGBA8, 1>({{RGBA8(255, 255, 255, 255)}})));
|
||||
0, MakeBindGroupForColors(std::array<RGBA8, 1>({{RGBA8(255, 255, 255, 255)}})), 0, nullptr);
|
||||
pass.Draw(3, 1, 0, 0);
|
||||
pass.EndPass();
|
||||
}
|
||||
|
@ -948,12 +948,12 @@ TEST_P(ColorStateTest, DefaultBlendColor) {
|
|||
dawn::RenderPassEncoder pass = encoder.BeginRenderPass(&renderPass.renderPassInfo);
|
||||
pass.SetPipeline(basePipeline);
|
||||
pass.SetBindGroup(0,
|
||||
MakeBindGroupForColors(std::array<RGBA8, 1>({{RGBA8(0, 0, 0, 0)}})));
|
||||
MakeBindGroupForColors(std::array<RGBA8, 1>({{RGBA8(0, 0, 0, 0)}})), 0, nullptr);
|
||||
pass.Draw(3, 1, 0, 0);
|
||||
pass.SetPipeline(testPipeline);
|
||||
pass.SetBlendColor(&kWhite);
|
||||
pass.SetBindGroup(
|
||||
0, MakeBindGroupForColors(std::array<RGBA8, 1>({{RGBA8(255, 255, 255, 255)}})));
|
||||
0, MakeBindGroupForColors(std::array<RGBA8, 1>({{RGBA8(255, 255, 255, 255)}})), 0, nullptr);
|
||||
pass.Draw(3, 1, 0, 0);
|
||||
pass.EndPass();
|
||||
}
|
||||
|
@ -972,12 +972,12 @@ TEST_P(ColorStateTest, DefaultBlendColor) {
|
|||
dawn::RenderPassEncoder pass = encoder.BeginRenderPass(&renderPass.renderPassInfo);
|
||||
pass.SetPipeline(basePipeline);
|
||||
pass.SetBindGroup(0,
|
||||
MakeBindGroupForColors(std::array<RGBA8, 1>({{RGBA8(0, 0, 0, 0)}})));
|
||||
MakeBindGroupForColors(std::array<RGBA8, 1>({{RGBA8(0, 0, 0, 0)}})), 0, nullptr);
|
||||
pass.Draw(3, 1, 0, 0);
|
||||
pass.SetPipeline(testPipeline);
|
||||
pass.SetBlendColor(&kWhite);
|
||||
pass.SetBindGroup(
|
||||
0, MakeBindGroupForColors(std::array<RGBA8, 1>({{RGBA8(255, 255, 255, 255)}})));
|
||||
0, MakeBindGroupForColors(std::array<RGBA8, 1>({{RGBA8(255, 255, 255, 255)}})), 0, nullptr);
|
||||
pass.Draw(3, 1, 0, 0);
|
||||
pass.EndPass();
|
||||
}
|
||||
|
@ -985,11 +985,11 @@ TEST_P(ColorStateTest, DefaultBlendColor) {
|
|||
dawn::RenderPassEncoder pass = encoder.BeginRenderPass(&renderPass.renderPassInfo);
|
||||
pass.SetPipeline(basePipeline);
|
||||
pass.SetBindGroup(0,
|
||||
MakeBindGroupForColors(std::array<RGBA8, 1>({{RGBA8(0, 0, 0, 0)}})));
|
||||
MakeBindGroupForColors(std::array<RGBA8, 1>({{RGBA8(0, 0, 0, 0)}})), 0, nullptr);
|
||||
pass.Draw(3, 1, 0, 0);
|
||||
pass.SetPipeline(testPipeline);
|
||||
pass.SetBindGroup(
|
||||
0, MakeBindGroupForColors(std::array<RGBA8, 1>({{RGBA8(255, 255, 255, 255)}})));
|
||||
0, MakeBindGroupForColors(std::array<RGBA8, 1>({{RGBA8(255, 255, 255, 255)}})), 0, nullptr);
|
||||
pass.Draw(3, 1, 0, 0);
|
||||
pass.EndPass();
|
||||
}
|
||||
|
|
|
@ -79,7 +79,7 @@ void ComputeCopyStorageBufferTests::BasicTest(const char* shader) {
|
|||
dawn::CommandEncoder encoder = device.CreateCommandEncoder();
|
||||
dawn::ComputePassEncoder pass = encoder.BeginComputePass();
|
||||
pass.SetPipeline(pipeline);
|
||||
pass.SetBindGroup(0, bindGroup);
|
||||
pass.SetBindGroup(0, bindGroup, 0, nullptr);
|
||||
pass.Dispatch(kInstances, 1, 1);
|
||||
pass.EndPass();
|
||||
|
||||
|
|
|
@ -283,7 +283,7 @@ class DepthStencilStateTest : public DawnTest {
|
|||
|
||||
pass.SetPipeline(pipeline);
|
||||
pass.SetStencilReference(test.stencil); // Set the stencil reference
|
||||
pass.SetBindGroup(0, bindGroup); // Set the bind group which contains color and depth data
|
||||
pass.SetBindGroup(0, bindGroup, 0, nullptr); // Set the bind group which contains color and depth data
|
||||
pass.Draw(6, 1, 0, 0);
|
||||
}
|
||||
pass.EndPass();
|
||||
|
|
|
@ -304,7 +304,7 @@ class IOSurfaceUsageTests : public IOSurfaceTestBase {
|
|||
{
|
||||
dawn::RenderPassEncoder pass = encoder.BeginRenderPass(&renderPass.renderPassInfo);
|
||||
pass.SetPipeline(pipeline);
|
||||
pass.SetBindGroup(0, bindGroup);
|
||||
pass.SetBindGroup(0, bindGroup, 0, nullptr);
|
||||
pass.Draw(6, 1, 0, 0);
|
||||
pass.EndPass();
|
||||
}
|
||||
|
|
|
@ -216,7 +216,7 @@ TEST_P(PushConstantTest, ComputePassDefaultsToZero) {
|
|||
|
||||
// Test compute push constants are set to zero by default.
|
||||
pass.SetPipeline(pipeline);
|
||||
pass.SetBindGroup(0, binding.bindGroup);
|
||||
pass.SetBindGroup(0, binding.bindGroup, 0, nullptr);
|
||||
pass.Dispatch(1, 1, 1);
|
||||
// Set push constants to non-zero value to check they will be reset to zero
|
||||
// on the next BeginComputePass
|
||||
|
@ -228,7 +228,7 @@ TEST_P(PushConstantTest, ComputePassDefaultsToZero) {
|
|||
dawn::ComputePassEncoder pass = encoder.BeginComputePass();
|
||||
|
||||
pass.SetPipeline(pipeline);
|
||||
pass.SetBindGroup(0, binding.bindGroup);
|
||||
pass.SetBindGroup(0, binding.bindGroup, 0, nullptr);
|
||||
pass.Dispatch(1, 1, 1);
|
||||
|
||||
pass.EndPass();
|
||||
|
@ -285,7 +285,7 @@ TEST_P(PushConstantTest, VariousConstantTypes) {
|
|||
|
||||
pass.SetPushConstants(dawn::ShaderStageBit::Compute, 0, 3, reinterpret_cast<uint32_t*>(&values));
|
||||
pass.SetPipeline(pipeline);
|
||||
pass.SetBindGroup(0, binding.bindGroup);
|
||||
pass.SetBindGroup(0, binding.bindGroup, 0, nullptr);
|
||||
pass.Dispatch(1, 1, 1);
|
||||
|
||||
pass.EndPass();
|
||||
|
@ -316,12 +316,12 @@ TEST_P(PushConstantTest, InheritThroughPipelineLayoutChange) {
|
|||
// Set Push constant before there is a pipeline set
|
||||
pass.SetPushConstants(dawn::ShaderStageBit::Compute, 0, 1, &one);
|
||||
pass.SetPipeline(pipeline1);
|
||||
pass.SetBindGroup(0, binding1.bindGroup);
|
||||
pass.SetBindGroup(0, binding1.bindGroup, 0, nullptr);
|
||||
pass.Dispatch(1, 1, 1);
|
||||
// Change the push constant before changing pipeline layout
|
||||
pass.SetPushConstants(dawn::ShaderStageBit::Compute, 0, 1, &two);
|
||||
pass.SetPipeline(pipeline2);
|
||||
pass.SetBindGroup(0, binding2.bindGroup);
|
||||
pass.SetBindGroup(0, binding2.bindGroup, 0, nullptr);
|
||||
pass.Dispatch(1, 1, 1);
|
||||
|
||||
pass.EndPass();
|
||||
|
@ -352,7 +352,7 @@ TEST_P(PushConstantTest, SetAllConstantsToNonZero) {
|
|||
|
||||
pass.SetPushConstants(dawn::ShaderStageBit::Compute, 0, kMaxPushConstants, &values[0]);
|
||||
pass.SetPipeline(pipeline);
|
||||
pass.SetBindGroup(0, binding.bindGroup);
|
||||
pass.SetBindGroup(0, binding.bindGroup, 0, nullptr);
|
||||
pass.Dispatch(1, 1, 1);
|
||||
|
||||
pass.EndPass();
|
||||
|
|
|
@ -142,7 +142,7 @@ protected:
|
|||
{
|
||||
dawn::RenderPassEncoder pass = encoder.BeginRenderPass(&mRenderPass.renderPassInfo);
|
||||
pass.SetPipeline(mPipeline);
|
||||
pass.SetBindGroup(0, bindGroup);
|
||||
pass.SetBindGroup(0, bindGroup, 0, nullptr);
|
||||
pass.Draw(6, 1, 0, 0);
|
||||
pass.EndPass();
|
||||
}
|
||||
|
|
|
@ -180,7 +180,7 @@ protected:
|
|||
{
|
||||
dawn::RenderPassEncoder pass = encoder.BeginRenderPass(&mRenderPass.renderPassInfo);
|
||||
pass.SetPipeline(pipeline);
|
||||
pass.SetBindGroup(0, bindGroup);
|
||||
pass.SetBindGroup(0, bindGroup, 0, nullptr);
|
||||
pass.Draw(6, 1, 0, 0);
|
||||
pass.EndPass();
|
||||
}
|
||||
|
|
|
@ -193,7 +193,7 @@ TEST_F(CommandBufferValidationTest, BufferWithReadAndWriteUsage) {
|
|||
DummyRenderPass dummyRenderPass(device);
|
||||
dawn::RenderPassEncoder pass = encoder.BeginRenderPass(&dummyRenderPass);
|
||||
pass.SetIndexBuffer(buffer, 0);
|
||||
pass.SetBindGroup(0, bg);
|
||||
pass.SetBindGroup(0, bg, 0, nullptr);
|
||||
pass.EndPass();
|
||||
ASSERT_DEVICE_ERROR(encoder.Finish());
|
||||
}
|
||||
|
@ -224,7 +224,7 @@ TEST_F(CommandBufferValidationTest, TextureWithReadAndWriteUsage) {
|
|||
// Use the texture as both sampeld and output attachment in the same pass
|
||||
dawn::CommandEncoder encoder = device.CreateCommandEncoder();
|
||||
dawn::RenderPassEncoder pass = encoder.BeginRenderPass(&renderPass);
|
||||
pass.SetBindGroup(0, bg);
|
||||
pass.SetBindGroup(0, bg, 0, nullptr);
|
||||
pass.EndPass();
|
||||
ASSERT_DEVICE_ERROR(encoder.Finish());
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue