Rename draw commands to match WebGPU IDL
BUG=dawn:51 Change-Id: I2a78f4e77c54aeae48d3fb78bf4701352ff40529 Reviewed-on: https://dawn-review.googlesource.com/c/3040 Reviewed-by: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Kai Ninomiya <kainino@chromium.org> Commit-Queue: Jiawei Shao <jiawei.shao@intel.com>
This commit is contained in:
parent
48a1923afb
commit
c789b84d8d
|
@ -797,7 +797,7 @@
|
|||
]
|
||||
},
|
||||
{
|
||||
"name": "draw arrays",
|
||||
"name": "draw",
|
||||
"args": [
|
||||
{"name": "vertex count", "type": "uint32_t"},
|
||||
{"name": "instance count", "type": "uint32_t"},
|
||||
|
@ -806,7 +806,7 @@
|
|||
]
|
||||
},
|
||||
{
|
||||
"name": "draw elements",
|
||||
"name": "draw indexed",
|
||||
"args": [
|
||||
{"name": "index count", "type": "uint32_t"},
|
||||
{"name": "instance count", "type": "uint32_t"},
|
||||
|
|
|
@ -145,7 +145,7 @@ void frame() {
|
|||
for (int k = 0; k < 10000; k++) {
|
||||
shaderData[i].time = f / 60.0f;
|
||||
pass.SetPushConstants(dawn::ShaderStageBit::Vertex, 0, 6, reinterpret_cast<uint32_t*>(&shaderData[i]));
|
||||
pass.DrawArrays(3, 1, 0, 0);
|
||||
pass.Draw(3, 1, 0, 0);
|
||||
i++;
|
||||
}
|
||||
|
||||
|
|
|
@ -87,7 +87,7 @@ void frame() {
|
|||
|
||||
dawnRenderPassEncoder pass = dawnCommandBufferBuilderBeginRenderPass(builder, renderpassInfo);
|
||||
dawnRenderPassEncoderSetRenderPipeline(pass, pipeline);
|
||||
dawnRenderPassEncoderDrawArrays(pass, 3, 1, 0, 0);
|
||||
dawnRenderPassEncoderDraw(pass, 3, 1, 0, 0);
|
||||
dawnRenderPassEncoderEndPass(pass);
|
||||
dawnRenderPassEncoderRelease(pass);
|
||||
|
||||
|
|
|
@ -264,7 +264,7 @@ dawn::CommandBuffer createCommandBuffer(const dawn::RenderPassDescriptor& render
|
|||
pass.SetRenderPipeline(renderPipeline);
|
||||
pass.SetVertexBuffers(0, 1, &bufferDst, zeroOffsets);
|
||||
pass.SetVertexBuffers(1, 1, &modelBuffer, zeroOffsets);
|
||||
pass.DrawArrays(3, kNumParticles, 0, 0);
|
||||
pass.Draw(3, kNumParticles, 0, 0);
|
||||
pass.EndPass();
|
||||
}
|
||||
|
||||
|
|
|
@ -161,7 +161,7 @@ void frame() {
|
|||
pass.SetBindGroup(0, bindGroup);
|
||||
pass.SetVertexBuffers(0, 1, &vertexBuffer, vertexBufferOffsets);
|
||||
pass.SetIndexBuffer(indexBuffer, 0);
|
||||
pass.DrawElements(3, 1, 0, 0);
|
||||
pass.DrawIndexed(3, 1, 0, 0);
|
||||
pass.EndPass();
|
||||
}
|
||||
|
||||
|
|
|
@ -269,18 +269,18 @@ void frame() {
|
|||
pass.SetBindGroup(0, bindGroup[0]);
|
||||
pass.SetVertexBuffers(0, 1, &vertexBuffer, vertexBufferOffsets);
|
||||
pass.SetIndexBuffer(indexBuffer, 0);
|
||||
pass.DrawElements(36, 1, 0, 0);
|
||||
pass.DrawIndexed(36, 1, 0, 0);
|
||||
|
||||
pass.SetStencilReference(0x1);
|
||||
pass.SetRenderPipeline(planePipeline);
|
||||
pass.SetBindGroup(0, bindGroup[0]);
|
||||
pass.SetVertexBuffers(0, 1, &planeBuffer, vertexBufferOffsets);
|
||||
pass.DrawElements(6, 1, 0, 0);
|
||||
pass.DrawIndexed(6, 1, 0, 0);
|
||||
|
||||
pass.SetRenderPipeline(reflectionPipeline);
|
||||
pass.SetVertexBuffers(0, 1, &vertexBuffer, vertexBufferOffsets);
|
||||
pass.SetBindGroup(0, bindGroup[1]);
|
||||
pass.DrawElements(36, 1, 0, 0);
|
||||
pass.DrawIndexed(36, 1, 0, 0);
|
||||
|
||||
pass.EndPass();
|
||||
}
|
||||
|
|
|
@ -531,10 +531,10 @@ namespace {
|
|||
}
|
||||
const auto& oIndicesBuffer = buffers.at(iIndices.bufferView);
|
||||
pass.SetIndexBuffer(oIndicesBuffer, static_cast<uint32_t>(iIndices.byteOffset));
|
||||
pass.DrawElements(static_cast<uint32_t>(iIndices.count), 1, 0, 0);
|
||||
pass.DrawIndexed(static_cast<uint32_t>(iIndices.count), 1, 0, 0);
|
||||
} else {
|
||||
// DrawArrays
|
||||
pass.DrawArrays(vertexCount, 1, 0, 0);
|
||||
pass.Draw(vertexCount, 1, 0, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -515,14 +515,14 @@ namespace dawn_native {
|
|||
return {};
|
||||
} break;
|
||||
|
||||
case Command::DrawArrays: {
|
||||
mIterator.NextCommand<DrawArraysCmd>();
|
||||
DAWN_TRY(persistentState.ValidateCanDrawArrays());
|
||||
case Command::Draw: {
|
||||
mIterator.NextCommand<DrawCmd>();
|
||||
DAWN_TRY(persistentState.ValidateCanDraw());
|
||||
} break;
|
||||
|
||||
case Command::DrawElements: {
|
||||
mIterator.NextCommand<DrawElementsCmd>();
|
||||
DAWN_TRY(persistentState.ValidateCanDrawElements());
|
||||
case Command::DrawIndexed: {
|
||||
mIterator.NextCommand<DrawIndexedCmd>();
|
||||
DAWN_TRY(persistentState.ValidateCanDrawIndexed());
|
||||
} break;
|
||||
|
||||
case Command::SetRenderPipeline: {
|
||||
|
|
|
@ -38,11 +38,11 @@ namespace dawn_native {
|
|||
static constexpr CommandBufferStateTracker::ValidationAspects kDispatchAspects =
|
||||
1 << VALIDATION_ASPECT_PIPELINE | 1 << VALIDATION_ASPECT_BIND_GROUPS;
|
||||
|
||||
static constexpr CommandBufferStateTracker::ValidationAspects kDrawArraysAspects =
|
||||
static constexpr CommandBufferStateTracker::ValidationAspects kDrawAspects =
|
||||
1 << VALIDATION_ASPECT_PIPELINE | 1 << VALIDATION_ASPECT_BIND_GROUPS |
|
||||
1 << VALIDATION_ASPECT_VERTEX_BUFFERS;
|
||||
|
||||
static constexpr CommandBufferStateTracker::ValidationAspects kDrawElementsAspects =
|
||||
static constexpr CommandBufferStateTracker::ValidationAspects kDrawIndexedAspects =
|
||||
1 << VALIDATION_ASPECT_PIPELINE | 1 << VALIDATION_ASPECT_BIND_GROUPS |
|
||||
1 << VALIDATION_ASPECT_VERTEX_BUFFERS | 1 << VALIDATION_ASPECT_INDEX_BUFFER;
|
||||
|
||||
|
@ -53,12 +53,12 @@ namespace dawn_native {
|
|||
return ValidateOperation(kDispatchAspects);
|
||||
}
|
||||
|
||||
MaybeError CommandBufferStateTracker::ValidateCanDrawArrays() {
|
||||
return ValidateOperation(kDrawArraysAspects);
|
||||
MaybeError CommandBufferStateTracker::ValidateCanDraw() {
|
||||
return ValidateOperation(kDrawAspects);
|
||||
}
|
||||
|
||||
MaybeError CommandBufferStateTracker::ValidateCanDrawElements() {
|
||||
return ValidateOperation(kDrawElementsAspects);
|
||||
MaybeError CommandBufferStateTracker::ValidateCanDrawIndexed() {
|
||||
return ValidateOperation(kDrawIndexedAspects);
|
||||
}
|
||||
|
||||
MaybeError CommandBufferStateTracker::ValidateOperation(ValidationAspects requiredAspects) {
|
||||
|
|
|
@ -29,8 +29,8 @@ namespace dawn_native {
|
|||
public:
|
||||
// Non-state-modifying validation functions
|
||||
MaybeError ValidateCanDispatch();
|
||||
MaybeError ValidateCanDrawArrays();
|
||||
MaybeError ValidateCanDrawElements();
|
||||
MaybeError ValidateCanDraw();
|
||||
MaybeError ValidateCanDrawIndexed();
|
||||
|
||||
// State-modifying methods
|
||||
void SetComputePipeline(ComputePipelineBase* pipeline);
|
||||
|
|
|
@ -53,13 +53,13 @@ namespace dawn_native {
|
|||
DispatchCmd* dispatch = commands->NextCommand<DispatchCmd>();
|
||||
dispatch->~DispatchCmd();
|
||||
} break;
|
||||
case Command::DrawArrays: {
|
||||
DrawArraysCmd* draw = commands->NextCommand<DrawArraysCmd>();
|
||||
draw->~DrawArraysCmd();
|
||||
case Command::Draw: {
|
||||
DrawCmd* draw = commands->NextCommand<DrawCmd>();
|
||||
draw->~DrawCmd();
|
||||
} break;
|
||||
case Command::DrawElements: {
|
||||
DrawElementsCmd* draw = commands->NextCommand<DrawElementsCmd>();
|
||||
draw->~DrawElementsCmd();
|
||||
case Command::DrawIndexed: {
|
||||
DrawIndexedCmd* draw = commands->NextCommand<DrawIndexedCmd>();
|
||||
draw->~DrawIndexedCmd();
|
||||
} break;
|
||||
case Command::EndComputePass: {
|
||||
EndComputePassCmd* cmd = commands->NextCommand<EndComputePassCmd>();
|
||||
|
@ -142,12 +142,12 @@ namespace dawn_native {
|
|||
commands->NextCommand<DispatchCmd>();
|
||||
break;
|
||||
|
||||
case Command::DrawArrays:
|
||||
commands->NextCommand<DrawArraysCmd>();
|
||||
case Command::Draw:
|
||||
commands->NextCommand<DrawCmd>();
|
||||
break;
|
||||
|
||||
case Command::DrawElements:
|
||||
commands->NextCommand<DrawElementsCmd>();
|
||||
case Command::DrawIndexed:
|
||||
commands->NextCommand<DrawIndexedCmd>();
|
||||
break;
|
||||
|
||||
case Command::EndComputePass:
|
||||
|
|
|
@ -33,8 +33,8 @@ namespace dawn_native {
|
|||
CopyBufferToTexture,
|
||||
CopyTextureToBuffer,
|
||||
Dispatch,
|
||||
DrawArrays,
|
||||
DrawElements,
|
||||
Draw,
|
||||
DrawIndexed,
|
||||
EndComputePass,
|
||||
EndRenderPass,
|
||||
SetComputePipeline,
|
||||
|
@ -93,14 +93,14 @@ namespace dawn_native {
|
|||
uint32_t z;
|
||||
};
|
||||
|
||||
struct DrawArraysCmd {
|
||||
struct DrawCmd {
|
||||
uint32_t vertexCount;
|
||||
uint32_t instanceCount;
|
||||
uint32_t firstVertex;
|
||||
uint32_t firstInstance;
|
||||
};
|
||||
|
||||
struct DrawElementsCmd {
|
||||
struct DrawIndexedCmd {
|
||||
uint32_t indexCount;
|
||||
uint32_t instanceCount;
|
||||
uint32_t firstIndex;
|
||||
|
|
|
@ -29,32 +29,32 @@ namespace dawn_native {
|
|||
: ProgrammablePassEncoder(device, topLevelBuilder, allocator) {
|
||||
}
|
||||
|
||||
void RenderPassEncoderBase::DrawArrays(uint32_t vertexCount,
|
||||
uint32_t instanceCount,
|
||||
uint32_t firstVertex,
|
||||
uint32_t firstInstance) {
|
||||
void RenderPassEncoderBase::Draw(uint32_t vertexCount,
|
||||
uint32_t instanceCount,
|
||||
uint32_t firstVertex,
|
||||
uint32_t firstInstance) {
|
||||
if (mTopLevelBuilder->ConsumedError(ValidateCanRecordCommands())) {
|
||||
return;
|
||||
}
|
||||
|
||||
DrawArraysCmd* draw = mAllocator->Allocate<DrawArraysCmd>(Command::DrawArrays);
|
||||
new (draw) DrawArraysCmd;
|
||||
DrawCmd* draw = mAllocator->Allocate<DrawCmd>(Command::Draw);
|
||||
new (draw) DrawCmd;
|
||||
draw->vertexCount = vertexCount;
|
||||
draw->instanceCount = instanceCount;
|
||||
draw->firstVertex = firstVertex;
|
||||
draw->firstInstance = firstInstance;
|
||||
}
|
||||
|
||||
void RenderPassEncoderBase::DrawElements(uint32_t indexCount,
|
||||
uint32_t instanceCount,
|
||||
uint32_t firstIndex,
|
||||
uint32_t firstInstance) {
|
||||
void RenderPassEncoderBase::DrawIndexed(uint32_t indexCount,
|
||||
uint32_t instanceCount,
|
||||
uint32_t firstIndex,
|
||||
uint32_t firstInstance) {
|
||||
if (mTopLevelBuilder->ConsumedError(ValidateCanRecordCommands())) {
|
||||
return;
|
||||
}
|
||||
|
||||
DrawElementsCmd* draw = mAllocator->Allocate<DrawElementsCmd>(Command::DrawElements);
|
||||
new (draw) DrawElementsCmd;
|
||||
DrawIndexedCmd* draw = mAllocator->Allocate<DrawIndexedCmd>(Command::DrawIndexed);
|
||||
new (draw) DrawIndexedCmd;
|
||||
draw->indexCount = indexCount;
|
||||
draw->instanceCount = instanceCount;
|
||||
draw->firstIndex = firstIndex;
|
||||
|
|
|
@ -30,14 +30,14 @@ namespace dawn_native {
|
|||
CommandBufferBuilder* topLevelBuilder,
|
||||
CommandAllocator* allocator);
|
||||
|
||||
void DrawArrays(uint32_t vertexCount,
|
||||
uint32_t instanceCount,
|
||||
uint32_t firstVertex,
|
||||
uint32_t firstInstance);
|
||||
void DrawElements(uint32_t vertexCount,
|
||||
uint32_t instanceCount,
|
||||
uint32_t firstIndex,
|
||||
uint32_t firstInstance);
|
||||
void Draw(uint32_t vertexCount,
|
||||
uint32_t instanceCount,
|
||||
uint32_t firstVertex,
|
||||
uint32_t firstInstance);
|
||||
void DrawIndexed(uint32_t vertexCount,
|
||||
uint32_t instanceCount,
|
||||
uint32_t firstIndex,
|
||||
uint32_t firstInstance);
|
||||
|
||||
void SetRenderPipeline(RenderPipelineBase* pipeline);
|
||||
|
||||
|
|
|
@ -540,14 +540,14 @@ namespace dawn_native { namespace d3d12 {
|
|||
return;
|
||||
} break;
|
||||
|
||||
case Command::DrawArrays: {
|
||||
DrawArraysCmd* draw = mCommands.NextCommand<DrawArraysCmd>();
|
||||
case Command::Draw: {
|
||||
DrawCmd* draw = mCommands.NextCommand<DrawCmd>();
|
||||
commandList->DrawInstanced(draw->vertexCount, draw->instanceCount,
|
||||
draw->firstVertex, draw->firstInstance);
|
||||
} break;
|
||||
|
||||
case Command::DrawElements: {
|
||||
DrawElementsCmd* draw = mCommands.NextCommand<DrawElementsCmd>();
|
||||
case Command::DrawIndexed: {
|
||||
DrawIndexedCmd* draw = mCommands.NextCommand<DrawIndexedCmd>();
|
||||
commandList->DrawIndexedInstanced(draw->indexCount, draw->instanceCount,
|
||||
draw->firstIndex, 0, draw->firstInstance);
|
||||
} break;
|
||||
|
|
|
@ -403,8 +403,8 @@ namespace dawn_native { namespace metal {
|
|||
return;
|
||||
} break;
|
||||
|
||||
case Command::DrawArrays: {
|
||||
DrawArraysCmd* draw = mCommands.NextCommand<DrawArraysCmd>();
|
||||
case Command::Draw: {
|
||||
DrawCmd* draw = mCommands.NextCommand<DrawCmd>();
|
||||
|
||||
[encoder drawPrimitives:lastPipeline->GetMTLPrimitiveTopology()
|
||||
vertexStart:draw->firstVertex
|
||||
|
@ -413,8 +413,8 @@ namespace dawn_native { namespace metal {
|
|||
baseInstance:draw->firstInstance];
|
||||
} break;
|
||||
|
||||
case Command::DrawElements: {
|
||||
DrawElementsCmd* draw = mCommands.NextCommand<DrawElementsCmd>();
|
||||
case Command::DrawIndexed: {
|
||||
DrawIndexedCmd* draw = mCommands.NextCommand<DrawIndexedCmd>();
|
||||
size_t formatSize = IndexFormatSize(lastPipeline->GetIndexFormat());
|
||||
|
||||
[encoder
|
||||
|
|
|
@ -583,8 +583,8 @@ namespace dawn_native { namespace opengl {
|
|||
return;
|
||||
} break;
|
||||
|
||||
case Command::DrawArrays: {
|
||||
DrawArraysCmd* draw = mCommands.NextCommand<DrawArraysCmd>();
|
||||
case Command::Draw: {
|
||||
DrawCmd* draw = mCommands.NextCommand<DrawCmd>();
|
||||
pushConstants.Apply(lastPipeline, lastPipeline);
|
||||
inputBuffers.Apply();
|
||||
|
||||
|
@ -600,8 +600,8 @@ namespace dawn_native { namespace opengl {
|
|||
}
|
||||
} break;
|
||||
|
||||
case Command::DrawElements: {
|
||||
DrawElementsCmd* draw = mCommands.NextCommand<DrawElementsCmd>();
|
||||
case Command::DrawIndexed: {
|
||||
DrawIndexedCmd* draw = mCommands.NextCommand<DrawIndexedCmd>();
|
||||
pushConstants.Apply(lastPipeline, lastPipeline);
|
||||
inputBuffers.Apply();
|
||||
|
||||
|
|
|
@ -320,16 +320,16 @@ namespace dawn_native { namespace vulkan {
|
|||
return;
|
||||
} break;
|
||||
|
||||
case Command::DrawArrays: {
|
||||
DrawArraysCmd* draw = mCommands.NextCommand<DrawArraysCmd>();
|
||||
case Command::Draw: {
|
||||
DrawCmd* draw = mCommands.NextCommand<DrawCmd>();
|
||||
|
||||
descriptorSets.Flush(device, commands, VK_PIPELINE_BIND_POINT_GRAPHICS);
|
||||
device->fn.CmdDraw(commands, draw->vertexCount, draw->instanceCount,
|
||||
draw->firstVertex, draw->firstInstance);
|
||||
} break;
|
||||
|
||||
case Command::DrawElements: {
|
||||
DrawElementsCmd* draw = mCommands.NextCommand<DrawElementsCmd>();
|
||||
case Command::DrawIndexed: {
|
||||
DrawIndexedCmd* draw = mCommands.NextCommand<DrawIndexedCmd>();
|
||||
|
||||
descriptorSets.Flush(device, commands, VK_PIPELINE_BIND_POINT_GRAPHICS);
|
||||
uint32_t vertexOffset = 0;
|
||||
|
|
|
@ -143,7 +143,7 @@ TEST_P(BindGroupTests, ReusedUBO) {
|
|||
dawn::RenderPassEncoder pass = builder.BeginRenderPass(renderPass.renderPassInfo);
|
||||
pass.SetRenderPipeline(pipeline);
|
||||
pass.SetBindGroup(0, bindGroup);
|
||||
pass.DrawArrays(3, 1, 0, 0);
|
||||
pass.Draw(3, 1, 0, 0);
|
||||
pass.EndPass();
|
||||
|
||||
dawn::CommandBuffer commands = builder.GetResult();
|
||||
|
@ -257,7 +257,7 @@ TEST_P(BindGroupTests, UBOSamplerAndTexture) {
|
|||
dawn::RenderPassEncoder pass = builder.BeginRenderPass(renderPass.renderPassInfo);
|
||||
pass.SetRenderPipeline(pipeline);
|
||||
pass.SetBindGroup(0, bindGroup);
|
||||
pass.DrawArrays(3, 1, 0, 0);
|
||||
pass.Draw(3, 1, 0, 0);
|
||||
pass.EndPass();
|
||||
|
||||
dawn::CommandBuffer commands = builder.GetResult();
|
||||
|
|
|
@ -107,13 +107,13 @@ class BlendStateTest : public DawnTest {
|
|||
// First use the base pipeline to draw a triangle with no blending
|
||||
pass.SetRenderPipeline(basePipeline);
|
||||
pass.SetBindGroup(0, MakeBindGroupForColors(std::array<RGBA8, 1>({ { base } })));
|
||||
pass.DrawArrays(3, 1, 0, 0);
|
||||
pass.Draw(3, 1, 0, 0);
|
||||
|
||||
// Then use the test pipeline to draw the test triangle with blending
|
||||
pass.SetRenderPipeline(testPipeline);
|
||||
pass.SetBindGroup(0, MakeBindGroupForColors(std::array<RGBA8, 1>({ { triangle.color } })));
|
||||
pass.SetBlendColor(triangle.blendFactor[0], triangle.blendFactor[1], triangle.blendFactor[2], triangle.blendFactor[3]);
|
||||
pass.DrawArrays(3, 1, 0, 0);
|
||||
pass.Draw(3, 1, 0, 0);
|
||||
pass.EndPass();
|
||||
}
|
||||
|
||||
|
@ -690,7 +690,7 @@ TEST_P(BlendStateTest, ColorWriteMaskBlendingDisabled) {
|
|||
dawn::RenderPassEncoder pass = builder.BeginRenderPass(renderPass.renderPassInfo);
|
||||
pass.SetRenderPipeline(testPipeline);
|
||||
pass.SetBindGroup(0, MakeBindGroupForColors(std::array<RGBA8, 1>({ { base } })));
|
||||
pass.DrawArrays(3, 1, 0, 0);
|
||||
pass.Draw(3, 1, 0, 0);
|
||||
pass.EndPass();
|
||||
}
|
||||
|
||||
|
@ -826,11 +826,11 @@ TEST_P(BlendStateTest, IndependentBlendState) {
|
|||
dawn::RenderPassEncoder pass = builder.BeginRenderPass(renderpass);
|
||||
pass.SetRenderPipeline(basePipeline);
|
||||
pass.SetBindGroup(0, MakeBindGroupForColors(std::array<RGBA8, 4>({ { base, base, base, base } })));
|
||||
pass.DrawArrays(3, 1, 0, 0);
|
||||
pass.Draw(3, 1, 0, 0);
|
||||
|
||||
pass.SetRenderPipeline(testPipeline);
|
||||
pass.SetBindGroup(0, MakeBindGroupForColors(std::array<RGBA8, 4>({ { color0, color1, color2, color3 } })));
|
||||
pass.DrawArrays(3, 1, 0, 0);
|
||||
pass.Draw(3, 1, 0, 0);
|
||||
pass.EndPass();
|
||||
}
|
||||
|
||||
|
@ -892,10 +892,10 @@ TEST_P(BlendStateTest, DefaultBlendColor) {
|
|||
dawn::RenderPassEncoder pass = builder.BeginRenderPass(renderPass.renderPassInfo);
|
||||
pass.SetRenderPipeline(basePipeline);
|
||||
pass.SetBindGroup(0, MakeBindGroupForColors(std::array<RGBA8, 1>({ { RGBA8(0, 0, 0, 0) } })));
|
||||
pass.DrawArrays(3, 1, 0, 0);
|
||||
pass.Draw(3, 1, 0, 0);
|
||||
pass.SetRenderPipeline(testPipeline);
|
||||
pass.SetBindGroup(0, MakeBindGroupForColors(std::array<RGBA8, 1>({ { RGBA8(255, 255, 255, 255) } })));
|
||||
pass.DrawArrays(3, 1, 0, 0);
|
||||
pass.Draw(3, 1, 0, 0);
|
||||
pass.EndPass();
|
||||
}
|
||||
|
||||
|
@ -912,11 +912,11 @@ TEST_P(BlendStateTest, DefaultBlendColor) {
|
|||
dawn::RenderPassEncoder pass = builder.BeginRenderPass(renderPass.renderPassInfo);
|
||||
pass.SetRenderPipeline(basePipeline);
|
||||
pass.SetBindGroup(0, MakeBindGroupForColors(std::array<RGBA8, 1>({ { RGBA8(0, 0, 0, 0) } })));
|
||||
pass.DrawArrays(3, 1, 0, 0);
|
||||
pass.Draw(3, 1, 0, 0);
|
||||
pass.SetRenderPipeline(testPipeline);
|
||||
pass.SetBlendColor(1, 1, 1, 1);
|
||||
pass.SetBindGroup(0, MakeBindGroupForColors(std::array<RGBA8, 1>({ { RGBA8(255, 255, 255, 255) } })));
|
||||
pass.DrawArrays(3, 1, 0, 0);
|
||||
pass.Draw(3, 1, 0, 0);
|
||||
pass.EndPass();
|
||||
}
|
||||
|
||||
|
@ -933,21 +933,21 @@ TEST_P(BlendStateTest, DefaultBlendColor) {
|
|||
dawn::RenderPassEncoder pass = builder.BeginRenderPass(renderPass.renderPassInfo);
|
||||
pass.SetRenderPipeline(basePipeline);
|
||||
pass.SetBindGroup(0, MakeBindGroupForColors(std::array<RGBA8, 1>({ { RGBA8(0, 0, 0, 0) } })));
|
||||
pass.DrawArrays(3, 1, 0, 0);
|
||||
pass.Draw(3, 1, 0, 0);
|
||||
pass.SetRenderPipeline(testPipeline);
|
||||
pass.SetBlendColor(1, 1, 1, 1);
|
||||
pass.SetBindGroup(0, MakeBindGroupForColors(std::array<RGBA8, 1>({ { RGBA8(255, 255, 255, 255) } })));
|
||||
pass.DrawArrays(3, 1, 0, 0);
|
||||
pass.Draw(3, 1, 0, 0);
|
||||
pass.EndPass();
|
||||
}
|
||||
{
|
||||
dawn::RenderPassEncoder pass = builder.BeginRenderPass(renderPass.renderPassInfo);
|
||||
pass.SetRenderPipeline(basePipeline);
|
||||
pass.SetBindGroup(0, MakeBindGroupForColors(std::array<RGBA8, 1>({ { RGBA8(0, 0, 0, 0) } })));
|
||||
pass.DrawArrays(3, 1, 0, 0);
|
||||
pass.Draw(3, 1, 0, 0);
|
||||
pass.SetRenderPipeline(testPipeline);
|
||||
pass.SetBindGroup(0, MakeBindGroupForColors(std::array<RGBA8, 1>({ { RGBA8(255, 255, 255, 255) } })));
|
||||
pass.DrawArrays(3, 1, 0, 0);
|
||||
pass.Draw(3, 1, 0, 0);
|
||||
pass.EndPass();
|
||||
}
|
||||
|
||||
|
|
|
@ -225,7 +225,7 @@ class DepthStencilStateTest : public DawnTest {
|
|||
pass.SetRenderPipeline(pipeline);
|
||||
pass.SetStencilReference(test.stencil); // Set the stencil reference
|
||||
pass.SetBindGroup(0, bindGroup); // Set the bind group which contains color and depth data
|
||||
pass.DrawArrays(6, 1, 0, 0);
|
||||
pass.Draw(6, 1, 0, 0);
|
||||
}
|
||||
pass.EndPass();
|
||||
|
||||
|
|
|
@ -80,7 +80,7 @@ class DrawElementsTest : public DawnTest {
|
|||
pass.SetRenderPipeline(pipeline);
|
||||
pass.SetVertexBuffers(0, 1, &vertexBuffer, &zeroOffset);
|
||||
pass.SetIndexBuffer(indexBuffer, 0);
|
||||
pass.DrawElements(indexCount, instanceCount, firstIndex, firstInstance);
|
||||
pass.DrawIndexed(indexCount, instanceCount, firstIndex, firstInstance);
|
||||
pass.EndPass();
|
||||
}
|
||||
|
||||
|
|
|
@ -84,7 +84,7 @@ TEST_P(IndexFormatTest, Uint32) {
|
|||
pass.SetRenderPipeline(pipeline);
|
||||
pass.SetVertexBuffers(0, 1, &vertexBuffer, &zeroOffset);
|
||||
pass.SetIndexBuffer(indexBuffer, 0);
|
||||
pass.DrawElements(3, 1, 0, 0);
|
||||
pass.DrawIndexed(3, 1, 0, 0);
|
||||
pass.EndPass();
|
||||
}
|
||||
|
||||
|
@ -115,7 +115,7 @@ TEST_P(IndexFormatTest, Uint16) {
|
|||
pass.SetRenderPipeline(pipeline);
|
||||
pass.SetVertexBuffers(0, 1, &vertexBuffer, &zeroOffset);
|
||||
pass.SetIndexBuffer(indexBuffer, 0);
|
||||
pass.DrawElements(3, 1, 0, 0);
|
||||
pass.DrawIndexed(3, 1, 0, 0);
|
||||
pass.EndPass();
|
||||
}
|
||||
|
||||
|
@ -159,7 +159,7 @@ TEST_P(IndexFormatTest, Uint32PrimitiveRestart) {
|
|||
pass.SetRenderPipeline(pipeline);
|
||||
pass.SetVertexBuffers(0, 1, &vertexBuffer, &zeroOffset);
|
||||
pass.SetIndexBuffer(indexBuffer, 0);
|
||||
pass.DrawElements(7, 1, 0, 0);
|
||||
pass.DrawIndexed(7, 1, 0, 0);
|
||||
pass.EndPass();
|
||||
}
|
||||
|
||||
|
@ -193,7 +193,7 @@ TEST_P(IndexFormatTest, Uint16PrimitiveRestart) {
|
|||
pass.SetRenderPipeline(pipeline);
|
||||
pass.SetVertexBuffers(0, 1, &vertexBuffer, &zeroOffset);
|
||||
pass.SetIndexBuffer(indexBuffer, 0);
|
||||
pass.DrawElements(7, 1, 0, 0);
|
||||
pass.DrawIndexed(7, 1, 0, 0);
|
||||
pass.EndPass();
|
||||
}
|
||||
|
||||
|
@ -233,7 +233,7 @@ TEST_P(IndexFormatTest, ChangePipelineAfterSetIndexBuffer) {
|
|||
pass.SetVertexBuffers(0, 1, &vertexBuffer, &zeroOffset);
|
||||
pass.SetIndexBuffer(indexBuffer, 0);
|
||||
pass.SetRenderPipeline(pipeline32);
|
||||
pass.DrawElements(3, 1, 0, 0);
|
||||
pass.DrawIndexed(3, 1, 0, 0);
|
||||
pass.EndPass();
|
||||
}
|
||||
|
||||
|
@ -267,7 +267,7 @@ TEST_P(IndexFormatTest, DISABLED_SetIndexBufferBeforeSetPipeline) {
|
|||
pass.SetIndexBuffer(indexBuffer, 0);
|
||||
pass.SetRenderPipeline(pipeline);
|
||||
pass.SetVertexBuffers(0, 1, &vertexBuffer, &zeroOffset);
|
||||
pass.DrawElements(3, 1, 0, 0);
|
||||
pass.DrawIndexed(3, 1, 0, 0);
|
||||
pass.EndPass();
|
||||
}
|
||||
|
||||
|
|
|
@ -176,7 +176,7 @@ class InputStateTest : public DawnTest {
|
|||
pass.SetVertexBuffers(buffer.location, 1, buffer.buffer, &zeroOffset);
|
||||
}
|
||||
|
||||
pass.DrawArrays(triangles * 3, instances, 0, 0);
|
||||
pass.Draw(triangles * 3, instances, 0, 0);
|
||||
pass.EndPass();
|
||||
|
||||
dawn::CommandBuffer commands = builder.GetResult();
|
||||
|
|
|
@ -199,7 +199,7 @@ class PrimitiveTopologyTest : public DawnTest {
|
|||
dawn::RenderPassEncoder pass = builder.BeginRenderPass(renderPass.renderPassInfo);
|
||||
pass.SetRenderPipeline(pipeline);
|
||||
pass.SetVertexBuffers(0, 1, &vertexBuffer, &zeroOffset);
|
||||
pass.DrawArrays(6, 1, 0, 0);
|
||||
pass.Draw(6, 1, 0, 0);
|
||||
pass.EndPass();
|
||||
}
|
||||
|
||||
|
|
|
@ -258,7 +258,7 @@ TEST_P(PushConstantTest, RenderPassDefaultsToZero) {
|
|||
dawn::RenderPassEncoder pass = builder.BeginRenderPass(renderPass.renderPassInfo);
|
||||
// Test render push constants are set to zero by default.
|
||||
pass.SetRenderPipeline(pipeline);
|
||||
pass.DrawArrays(1, 1, 0, 0);
|
||||
pass.Draw(1, 1, 0, 0);
|
||||
pass.EndPass();
|
||||
}
|
||||
|
||||
|
@ -386,7 +386,7 @@ TEST_P(PushConstantTest, SeparateVertexAndFragmentConstants) {
|
|||
pass.SetPushConstants(dawn::ShaderStageBit::Vertex, 0, 1, &one);
|
||||
pass.SetPushConstants(dawn::ShaderStageBit::Fragment, 0, 1, &two);
|
||||
pass.SetRenderPipeline(pipeline);
|
||||
pass.DrawArrays(1, 1, 0, 0);
|
||||
pass.Draw(1, 1, 0, 0);
|
||||
pass.EndPass();
|
||||
}
|
||||
|
||||
|
@ -411,7 +411,7 @@ TEST_P(PushConstantTest, SimultaneousVertexAndFragmentConstants) {
|
|||
dawn::RenderPassEncoder pass = builder.BeginRenderPass(renderPass.renderPassInfo);
|
||||
pass.SetPushConstants(dawn::ShaderStageBit::Vertex | dawn::ShaderStageBit::Fragment, 0, 1, &two);
|
||||
pass.SetRenderPipeline(pipeline);
|
||||
pass.DrawArrays(1, 1, 0, 0);
|
||||
pass.Draw(1, 1, 0, 0);
|
||||
pass.EndPass();
|
||||
}
|
||||
|
||||
|
|
|
@ -40,7 +40,7 @@ class DrawQuad {
|
|||
.GetResult();
|
||||
|
||||
pass->SetRenderPipeline(renderPipeline);
|
||||
pass->DrawArrays(6, 1, 0, 0);
|
||||
pass->Draw(6, 1, 0, 0);
|
||||
}
|
||||
|
||||
private:
|
||||
|
|
|
@ -136,7 +136,7 @@ protected:
|
|||
dawn::RenderPassEncoder pass = builder.BeginRenderPass(mRenderPass.renderPassInfo);
|
||||
pass.SetRenderPipeline(mPipeline);
|
||||
pass.SetBindGroup(0, bindGroup);
|
||||
pass.DrawArrays(6, 1, 0, 0);
|
||||
pass.Draw(6, 1, 0, 0);
|
||||
pass.EndPass();
|
||||
}
|
||||
|
||||
|
|
|
@ -55,7 +55,7 @@ TEST_P(ScissorTest, DefaultsToWholeRenderTarget) {
|
|||
{
|
||||
dawn::RenderPassEncoder pass = builder.BeginRenderPass(renderPass.renderPassInfo);
|
||||
pass.SetRenderPipeline(pipeline);
|
||||
pass.DrawArrays(6, 1, 0, 0);
|
||||
pass.Draw(6, 1, 0, 0);
|
||||
pass.EndPass();
|
||||
}
|
||||
|
||||
|
@ -78,7 +78,7 @@ TEST_P(ScissorTest, LargerThanAttachment) {
|
|||
dawn::RenderPassEncoder pass = builder.BeginRenderPass(renderPass.renderPassInfo);
|
||||
pass.SetRenderPipeline(pipeline);
|
||||
pass.SetScissorRect(0, 0, 200, 200);
|
||||
pass.DrawArrays(6, 1, 0, 0);
|
||||
pass.Draw(6, 1, 0, 0);
|
||||
pass.EndPass();
|
||||
}
|
||||
|
||||
|
@ -104,7 +104,7 @@ TEST_P(ScissorTest, EmptyRect) {
|
|||
dawn::RenderPassEncoder pass = builder.BeginRenderPass(renderPass.renderPassInfo);
|
||||
pass.SetRenderPipeline(pipeline);
|
||||
pass.SetScissorRect(0, 0, 0, 0);
|
||||
pass.DrawArrays(6, 1, 0, 0);
|
||||
pass.Draw(6, 1, 0, 0);
|
||||
pass.EndPass();
|
||||
}
|
||||
|
||||
|
@ -132,7 +132,7 @@ TEST_P(ScissorTest, PartialRect) {
|
|||
dawn::RenderPassEncoder pass = builder.BeginRenderPass(renderPass.renderPassInfo);
|
||||
pass.SetRenderPipeline(pipeline);
|
||||
pass.SetScissorRect(kX, kY, kW, kH);
|
||||
pass.DrawArrays(6, 1, 0, 0);
|
||||
pass.Draw(6, 1, 0, 0);
|
||||
pass.EndPass();
|
||||
}
|
||||
|
||||
|
@ -163,7 +163,7 @@ TEST_P(ScissorTest, NoInheritanceBetweenRenderPass) {
|
|||
{
|
||||
dawn::RenderPassEncoder pass = builder.BeginRenderPass(renderPass.renderPassInfo);
|
||||
pass.SetRenderPipeline(pipeline);
|
||||
pass.DrawArrays(6, 1, 0, 0);
|
||||
pass.Draw(6, 1, 0, 0);
|
||||
pass.EndPass();
|
||||
}
|
||||
|
||||
|
|
|
@ -175,7 +175,7 @@ protected:
|
|||
dawn::RenderPassEncoder pass = builder.BeginRenderPass(mRenderPass.renderPassInfo);
|
||||
pass.SetRenderPipeline(pipeline);
|
||||
pass.SetBindGroup(0, bindGroup);
|
||||
pass.DrawArrays(6, 1, 0, 0);
|
||||
pass.Draw(6, 1, 0, 0);
|
||||
pass.EndPass();
|
||||
}
|
||||
|
||||
|
@ -512,7 +512,7 @@ class TextureViewRenderingTest : public DawnTest {
|
|||
dawn::RenderPassEncoder pass =
|
||||
commandBufferBuilder.BeginRenderPass(renderPassInfo);
|
||||
pass.SetRenderPipeline(oneColorPipeline);
|
||||
pass.DrawArrays(6, 1, 0, 0);
|
||||
pass.Draw(6, 1, 0, 0);
|
||||
pass.EndPass();
|
||||
}
|
||||
|
||||
|
|
|
@ -46,7 +46,7 @@ TEST_P(ViewportOrientationTests, OriginAt0x0) {
|
|||
{
|
||||
dawn::RenderPassEncoder pass = builder.BeginRenderPass(renderPass.renderPassInfo);
|
||||
pass.SetRenderPipeline(pipeline);
|
||||
pass.DrawArrays(1, 1, 0, 0);
|
||||
pass.Draw(1, 1, 0, 0);
|
||||
pass.EndPass();
|
||||
}
|
||||
|
||||
|
|
|
@ -108,7 +108,7 @@ TEST_F(VertexBufferValidationTest, VertexInputsInheritedBetweenPipelines) {
|
|||
{
|
||||
dawn::RenderPassEncoder pass = builder.BeginRenderPass(renderpass);
|
||||
pass.SetRenderPipeline(pipeline1);
|
||||
pass.DrawArrays(3, 1, 0, 0);
|
||||
pass.Draw(3, 1, 0, 0);
|
||||
pass.EndPass();
|
||||
}
|
||||
builder.GetResult();
|
||||
|
@ -119,9 +119,9 @@ TEST_F(VertexBufferValidationTest, VertexInputsInheritedBetweenPipelines) {
|
|||
dawn::RenderPassEncoder pass = builder.BeginRenderPass(renderpass);
|
||||
pass.SetRenderPipeline(pipeline2);
|
||||
pass.SetVertexBuffers(0, 2, vertexBuffers.data(), offsets);
|
||||
pass.DrawArrays(3, 1, 0, 0);
|
||||
pass.Draw(3, 1, 0, 0);
|
||||
pass.SetRenderPipeline(pipeline1);
|
||||
pass.DrawArrays(3, 1, 0, 0);
|
||||
pass.Draw(3, 1, 0, 0);
|
||||
pass.EndPass();
|
||||
}
|
||||
builder.GetResult();
|
||||
|
@ -146,14 +146,14 @@ TEST_F(VertexBufferValidationTest, VertexInputsNotInheritedBetweenRendePasses) {
|
|||
dawn::RenderPassEncoder pass = builder.BeginRenderPass(renderpass);
|
||||
pass.SetRenderPipeline(pipeline2);
|
||||
pass.SetVertexBuffers(0, 2, vertexBuffers.data(), offsets);
|
||||
pass.DrawArrays(3, 1, 0, 0);
|
||||
pass.Draw(3, 1, 0, 0);
|
||||
pass.EndPass();
|
||||
}
|
||||
{
|
||||
dawn::RenderPassEncoder pass = builder.BeginRenderPass(renderpass);
|
||||
pass.SetRenderPipeline(pipeline1);
|
||||
pass.SetVertexBuffers(0, 1, vertexBuffers.data(), offsets);
|
||||
pass.DrawArrays(3, 1, 0, 0);
|
||||
pass.Draw(3, 1, 0, 0);
|
||||
pass.EndPass();
|
||||
}
|
||||
builder.GetResult();
|
||||
|
@ -164,13 +164,13 @@ TEST_F(VertexBufferValidationTest, VertexInputsNotInheritedBetweenRendePasses) {
|
|||
dawn::RenderPassEncoder pass = builder.BeginRenderPass(renderpass);
|
||||
pass.SetRenderPipeline(pipeline2);
|
||||
pass.SetVertexBuffers(0, 2, vertexBuffers.data(), offsets);
|
||||
pass.DrawArrays(3, 1, 0, 0);
|
||||
pass.Draw(3, 1, 0, 0);
|
||||
pass.EndPass();
|
||||
}
|
||||
{
|
||||
dawn::RenderPassEncoder pass = builder.BeginRenderPass(renderpass);
|
||||
pass.SetRenderPipeline(pipeline1);
|
||||
pass.DrawArrays(3, 1, 0, 0);
|
||||
pass.Draw(3, 1, 0, 0);
|
||||
pass.EndPass();
|
||||
}
|
||||
builder.GetResult();
|
||||
|
|
Loading…
Reference in New Issue