mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-09 13:38:00 +00:00
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:
committed by
Commit Bot service account
parent
931311700c
commit
991ab98f11
@@ -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));
|
||||
|
||||
Reference in New Issue
Block a user