Update samples to process events.
This CL updates the `dawn/sample` programs to call the `dawn::native::InstanceProcessEvents` which allows things like shader validation errors to be emitted. Without this change the errors are never displayed. Change-Id: I054bb4f7177c5d0c110e97409852143b2bef1e02 Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/126760 Reviewed-by: Corentin Wallez <cwallez@chromium.org> Kokoro: Kokoro <noreply+kokoro@google.com> Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
This commit is contained in:
parent
b04e622eea
commit
0b3fc055d3
|
@ -186,6 +186,7 @@ int main(int argc, const char* argv[]) {
|
|||
timer->Start();
|
||||
while (!ShouldQuit()) {
|
||||
utils::ScopedAutoreleasePool pool;
|
||||
ProcessEvents();
|
||||
frameCount++;
|
||||
frame();
|
||||
if (frameCount % 60 == 0) {
|
||||
|
|
|
@ -143,6 +143,7 @@ int main(int argc, const char* argv[]) {
|
|||
|
||||
while (!ShouldQuit()) {
|
||||
utils::ScopedAutoreleasePool pool;
|
||||
ProcessEvents();
|
||||
frame();
|
||||
utils::USleep(16000);
|
||||
}
|
||||
|
|
|
@ -323,6 +323,7 @@ int main(int argc, const char* argv[]) {
|
|||
|
||||
while (!ShouldQuit()) {
|
||||
utils::ScopedAutoreleasePool pool;
|
||||
ProcessEvents();
|
||||
frame();
|
||||
utils::USleep(16000);
|
||||
}
|
||||
|
|
|
@ -176,6 +176,7 @@ int main(int argc, const char* argv[]) {
|
|||
|
||||
while (!ShouldQuit()) {
|
||||
utils::ScopedAutoreleasePool pool;
|
||||
ProcessEvents();
|
||||
frame();
|
||||
utils::USleep(16000);
|
||||
}
|
||||
|
|
|
@ -339,6 +339,7 @@ int main(int argc, const char* argv[]) {
|
|||
while (windows.size() != 0) {
|
||||
utils::ScopedAutoreleasePool pool;
|
||||
glfwPollEvents();
|
||||
wgpuInstanceProcessEvents(instance->Get());
|
||||
|
||||
for (auto it = windows.begin(); it != windows.end();) {
|
||||
GLFWwindow* window = it->first;
|
||||
|
|
|
@ -391,3 +391,7 @@ bool ShouldQuit() {
|
|||
GLFWwindow* GetGLFWWindow() {
|
||||
return window;
|
||||
}
|
||||
|
||||
void ProcessEvents() {
|
||||
dawn::native::InstanceProcessEvents(instance->Get());
|
||||
}
|
||||
|
|
|
@ -28,5 +28,6 @@ wgpu::Device CreateCppDawnDevice();
|
|||
wgpu::TextureFormat GetPreferredSwapChainTextureFormat();
|
||||
wgpu::SwapChain GetSwapChain();
|
||||
wgpu::TextureView CreateDefaultDepthStencilView(const wgpu::Device& device);
|
||||
void ProcessEvents();
|
||||
|
||||
#endif // SRC_DAWN_SAMPLES_SAMPLEUTILS_H_
|
||||
|
|
Loading…
Reference in New Issue