mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-13 15:16:16 +00:00
WebGPU error handling 2: CommandEncoder for samples and end2end tests
CommandEncoder is the replacement for CommandBufferBuilder. This commit adds the dawn.json definition for it and an initial implementation that wraps CommandBufferBuilder. This is done so that the code can be ported to CommandEncoder gradually, otherwise the commit would be too big and would risk many merge conflicts. This converts all samples and end2end tests to use CommandEncoder. BUG=dawn:8 Change-Id: If4ce86e6fb39ba4e0c2af6328d40e63be17d18c1 Reviewed-on: https://dawn-review.googlesource.com/c/4741 Commit-Queue: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Kai Ninomiya <kainino@chromium.org>
This commit is contained in:
committed by
Commit Bot service account
parent
7be2a71f2b
commit
e1f0d4e639
@@ -131,16 +131,16 @@ void frame() {
|
||||
}
|
||||
dawnCommandBuffer commands;
|
||||
{
|
||||
dawnCommandBufferBuilder builder = dawnDeviceCreateCommandBufferBuilder(device);
|
||||
dawnCommandEncoder encoder = dawnDeviceCreateCommandEncoder(device);
|
||||
|
||||
dawnRenderPassEncoder pass = dawnCommandBufferBuilderBeginRenderPass(builder, renderpassInfo);
|
||||
dawnRenderPassEncoder pass = dawnCommandEncoderBeginRenderPass(encoder, renderpassInfo);
|
||||
dawnRenderPassEncoderSetPipeline(pass, pipeline);
|
||||
dawnRenderPassEncoderDraw(pass, 3, 1, 0, 0);
|
||||
dawnRenderPassEncoderEndPass(pass);
|
||||
dawnRenderPassEncoderRelease(pass);
|
||||
|
||||
commands = dawnCommandBufferBuilderGetResult(builder);
|
||||
dawnCommandBufferBuilderRelease(builder);
|
||||
commands = dawnCommandEncoderFinish(encoder);
|
||||
dawnCommandEncoderRelease(encoder);
|
||||
}
|
||||
|
||||
dawnQueueSubmit(queue, 1, &commands);
|
||||
|
||||
Reference in New Issue
Block a user