Skip to content

add an example showing how to capture shader compilation and pipeline compilation failures #57

Description

@dneto0

It's tricky because C++ coders expect the errors to be returned synchronously.

But shader and pipeline compilation is asynchronous.

The API is designed that way because the calls to create a shader module, and later to create a pipeline are asynchronous. They occur on the "device timeline" which can be on another thread, in another process or on another machine. If these activities occurred synchronously, returning the error codes at call return time, then your application thread ("content timeline") would run in lockstep with the device timeline, leading to terrible performance.

To catch compilation errors, wrap the batch of calls with push-scope /pop-scope, and then wait on the future returned by the popscope.
That will wait for actions on the device timeline to complete, and return the error status results to your main thread.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions