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

VulkanContext::swap_buffers error or Windows crash with specific project settings #70946

Closed
Tracked by #71929
Lemonymous opened this issue Jan 5, 2023 · 3 comments
Closed
Tracked by #71929

Comments

@Lemonymous
Copy link

Godot version

v4.0.beta.custom_build [f382a2b]

System information

Windows 10, Forward+, NVIDIA GeForce GTX 1050 Ti (31.0.15.1694)

Issue description

Possibly linked to #59699, but I am making a new issue because I have a minimal reproduction project, and steps to create a fresh project that will trigger the error.

With specific project settings, a draw call in _draw as well as a shader with specific uniforms; the project will either throw lots of errors, or outright crash Windows and corrupting the project in the process.

Errors when Windows does not crash:

E 0:00:01:0015   VulkanContext::swap_buffers: Condition "err" is true. Returning: ERR_CANT_CREATE
  <C++ Source>   drivers\vulkan\vulkan_context.cpp:2299 @ VulkanContext::swap_buffers()
E 0:00:01:0016   VulkanContext::prepare_buffers: Vulkan: Did not create swapchain successfully.
  <C++ Error>    Condition "err != VK_SUCCESS" is true. Breaking.
  <C++ Source>   drivers\vulkan\vulkan_context.cpp:2222 @ VulkanContext::prepare_buffers()

Windows stop code when crashing (I have not noted down which file was mentioned in the crash, but can probably get it if requested):
DRIVER_IRQL_NOT_LESS_OR_EQUAL

Steps to reproduce

  • Main Scene
extends Node2D

func _draw():
	# any draw function will produce errors
	draw_circle(Vector2.ZERO, 100, Color.WHITE)
  • Attach a Sprite2D to Main Scene
  • Give it the Godot icon texture
  • Give it a ShaderMaterial with the following shader (no need to set the uniforms):
shader_type canvas_item;

uniform vec2 vec;
uniform sampler2D sampler;
  • Open project settings, toggle advanced settings and make the following edits (These changes are just my example of what will trigger the error, but I don't know the range of values that will trigger it)
display/window/size/viewport_width = 320
display/window/size/viewport_height = 180
display/window/size/window_width_override = 1024
display/window/size/window_height_override = 768
display/window/stretch/mode = canvas_items
  • Save the project and make a backup of it somewhere safe. If Windows crashes, files in the project may become corrupt and lose data.
  • Run project and observe either errors, or Windows crashing.

Minimal reproduction project

Project built in the same way as mentioned in steps-to-reproduce, which if run, will throw errors or crash Windows on my pc.
buffer_error.zip

@lmsonic
Copy link

lmsonic commented Jul 22, 2023

I cannot reproduce this in 4.1.1, either by following the instructions or by opening the MRP
I don't see any errors or crashes.
image

@Lemonymous
Copy link
Author

I did some new test on v4.1.1.stable.mono.official [bd6af8e]
Both a new project following the instructions, as well as the MRP did not cause any errors or crashes.

I then retested on the build I used in the OP: v4.0.beta.custom_build [f382a2b]
This time around the MRP did not cause any errors or crashes. I don't know why.

The only thing that I know is different on my computer compared to the time of the OP, would be a newer graphics driver (NVIDIA GeForce GTX 1050 Ti (31.0.15.3179)), and Windows patches I suppose; but that is harder to compare, as nothing was logged at the time of the OP.

@clayjohn
Copy link
Member

This issue is highly dependent on GPU and drivers. I'll go ahead and close this report as the underlying issue is still tracked in #71929

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants