-
Notifications
You must be signed in to change notification settings - Fork 855
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
Surface configuration Validation Error #5823
Comments
have you tried glfw.window_hint(WindowHint::ClientApi(ClientApiHint::NoApi)); just before creating the windows. This fixed some issues on some platforms. |
I put it right before creating the window, but it returns a new error:
|
That's probably todo with state.window.make_current(); only some calls can be done without an api (typically because the other api can do this). For example: window.swap_buffers(); does basically the same thing as surface_texture.present(); though on the internal API (in this case OpenGL). Also this conversation should probably be moved to glfw-rs as this is mostly a glfw issue. Questions I have:
|
Copying the code onto my machine and making this the run function let mut glfw = glfw::init(fail_on_errors!())
.unwrap();
glfw.window_hint(WindowHint::ClientApi(ClientApiHint::NoApi));
let (mut window, events) =
glfw.create_window(
800, 600, "It's SNA time.",
glfw::WindowMode::Windowed).unwrap();
let mut state = State::new(&mut window).await;
//state.window.set_all_polling(true);
//state.window.make_current();
//glfw.set_swap_interval(glfw::SwapInterval::Sync(1));
while !state.window.should_close() {
glfw.poll_events();
for (_, event) in glfw::flush_messages(&events) {
match event {
glfw::WindowEvent::Key(Key::Escape, _, Action::Press, _) => {
state.window.set_should_close(true)
}
_ => {}
}
}
match state.render() {
Ok(_) => {},
Err(e) => eprintln!("{:?}", e),
}
//state.window.swap_buffers();
} seems to fix the issue (commented out code is both not required and unsupported). This is definitely a GLFW documentation issue. I'm working on a pull request to fix the docs. |
OMG, it works now! Thank you so much!!! |
Thank you! By the way, there is a safe way of creating a surface: instance.create_surface(window.render_context()).unwrap(); |
Description
I am using glfw and wgpu(following this tutorial: https://www.youtube.com/watch?v=DGPrn5qCI_c), for some reason when I run the code I get a validation error:
The code:
Platform
Windows 10, Vulkan Instance Version: 1.3.255
The text was updated successfully, but these errors were encountered: