Load operations (#105)

* load ops: design + implementation (all backends)

* Animometer/glTFViewer: use just one subpass per frame
This commit is contained in:
Kai Ninomiya
2017-08-11 14:36:20 -07:00
committed by GitHub
parent 3d1154786f
commit b985431c82
18 changed files with 380 additions and 102 deletions

View File

@@ -138,17 +138,15 @@ void frame() {
size_t i = 0;
std::vector<nxt::CommandBuffer> commands(50);
for (size_t j = 0; j < 50; j++) {
nxt::CommandBuffer commands;
{
nxt::CommandBufferBuilder builder = device.CreateCommandBufferBuilder()
.BeginRenderPass(renderpass, framebuffer)
.BeginRenderSubpass()
.SetRenderPipeline(pipeline)
.Clone();
for (int k = 0; k < 200; k++) {
for (int k = 0; k < 10000; k++) {
shaderData[i].time = f / 60.0f;
builder.SetPushConstants(nxt::ShaderStageBit::Vertex, 0, 6, reinterpret_cast<uint32_t*>(&shaderData[i]))
.DrawArrays(3, 1, 0, 0);
@@ -157,10 +155,10 @@ void frame() {
builder.EndRenderSubpass();
builder.EndRenderPass();
commands[j] = builder.GetResult();
commands = builder.GetResult();
}
queue.Submit(50, commands.data());
queue.Submit(1, &commands);
backbuffer.TransitionUsage(nxt::TextureUsageBit::Present);
swapchain.Present(backbuffer);
DoFlush();