Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve error handling for gfxCreateGraphicsPipelines #129

Closed
zeux opened this issue Aug 14, 2018 · 5 comments
Closed

Improve error handling for gfxCreateGraphicsPipelines #129

zeux opened this issue Aug 14, 2018 · 5 comments
Labels

Comments

@zeux
Copy link

zeux commented Aug 14, 2018

We are getting VK_ERROR_INCOMPATIBLE_DRIVER when calling CreateGraphicsPipelines for any pipelines in our application; looks like it's coming from here:

if pipelines.iter().any(|p| p.is_err()) {
for op in out_pipelines {
*op = Handle::null();
}
VkResult::VK_ERROR_INCOMPATIBLE_DRIVER

There's no error logs so I'm not sure what the problem is. Would it be possible to communicate the reason for the error via a TTY or something along these lines? These are most likely bugs in portability/gfx/etc. but it's unclear why they happen.

@kvark kvark added the bug label Aug 15, 2018
@kvark
Copy link
Member

kvark commented Aug 15, 2018

The backend often spews out errors/warning and other messages via rust standard logging mechanisms. They are hooked up to the console output in our debug builds and can be enabled when running with RUST_LOG=gfx_backend_metal=debug. This includes SPIRV-Cross produced shader code/errors.

But in this case, we first need to make sure the errors returned by the backend are not ignored. So minor changes to the portability lib are needed.

@zeux
Copy link
Author

zeux commented Aug 15, 2018

I'll check RUST_LOG output tomorrow, thanks. It would be great to mention this in the error message, similarly to how panic says that you can enable backtraces to see more output.

@zeux
Copy link
Author

zeux commented Aug 15, 2018

Ok - RUST_LOG didn't work in release builds but it did work in the debug build:

ERROR 2018-08-15T21:03:22Z: gfx_backend_metal::device: PSO creation failed: Vertex attribute TEXCOORD0(4) is missing from the vertex descriptor
1534367001.83030,a824380,6 VULKAN ERROR: vkCreateGraphicsPipelines(device, cache, 1, &createInfo, nullptr, &result) returned -9
1534367001.83034,a824380,6 ERROR: Pipeline state object creation failed with code -9
1534367001.83035,a824380,6 Program: SkyVS,SkyFS,

@zeux
Copy link
Author

zeux commented Aug 15, 2018

Ok - I see - this is a bug in gfx (filed here gfx-rs/gfx#2324):

https://github.com/gfx-rs/gfx/blob/a571ae5a15b2fd7bdd457c9d2d6189167ccfbf54/src/backend/metal/src/device.rs#L1011-L1014

This code doesn't handle location in attribute descriptors properly, instead assuming that all attributes have linear locations 0-count-1.

@zeux
Copy link
Author

zeux commented Sep 7, 2019

Closing this since the issue is stale and probably doesn't need addressing anymore.

@zeux zeux closed this as completed Sep 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants