Godot v4.4.1
The Run Project Window crashes when I hit run on this project. I’m trying to edit an image with compute shaders following this tutorial: Everything About Textures in Compute Shaders! . I thought I got everything working, but the crashes have stopped any forward movement.
The debugger and output aren’t giving any errors.
Here’s the gd code:
extends Sprite2D
@export_category(“dimensions”)
@export var widthRatio : int = 1
@export var heightRatio : int = 1
@export var fluidResolution : int = 100
func _ready():
var rd := RenderingServer.create_local_rendering_device()
var shader_file := load(“res://imageintake.glsl”)
var shader_spirv: RDShaderSPIRV = shader_file.get_spirv()
var shader := rd.shader_create_from_spirv(shader_spirv)
var img := makeimage()
var img_pba = img.get_data()
var fmt = RDTextureFormat.new()
fmt.width = img.get_width()
fmt.height = img.get_height()
fmt.format = RenderingDevice.DATA_FORMAT_R32G32B32A32_SFLOAT
fmt.usage_bits = RenderingDevice.TEXTURE_USAGE_CAN_UPDATE_BIT | RenderingDevice.TEXTURE_USAGE_STORAGE_BIT | RenderingDevice.TEXTURE_USAGE_CAN_COPY_FROM_BIT
print(type_string(typeof(img_pba)))
var view := RDTextureView.new()
var output_tex = rd.texture_create(fmt, view, [img_pba])
# You should store "output_tex" as a global variable so you can retrieve its output data later
var output_tex_uniform := RDUniform.new()
output_tex_uniform.uniform_type = RenderingDevice.UNIFORM_TYPE_IMAGE
output_tex_uniform.binding = 0
output_tex_uniform.add_id(output_tex)
var uniform_set1 := rd.uniform_set_create([output_tex_uniform], shader, 0)
# Create a compute pipeline
var pipeline := rd.compute_pipeline_create(shader)
var compute_list := rd.compute_list_begin()
rd.compute_list_bind_compute_pipeline(compute_list, pipeline)
rd.compute_list_bind_uniform_set(compute_list, uniform_set1, 0)
rd.compute_list_dispatch(compute_list, 1, 1, 1)
rd.compute_list_end()
rd.submit()
rd.sync()
var result_data = rd.buffer_get_data(output_tex)
func process(_delta):
print(“working”)
func makeimage() → Image:
var ratioTotal := heightRatio+widthRatio
@warning_ignore(“integer_division”)
var imageWidth := fluidResolutionwidthRatio/ratioTotal
@warning_ignore(“integer_division”)
var imageHeight := fluidResolutionheightRatio/ratioTotal
return Image.create_empty(imageWidth, imageHeight, false, Image.FORMAT_RGBAF)
Here’s the shader code (this is mostly placeholder):
#[compute]
#version 450
// Invocations in the (x, y, z) dimension
layout(local_size_x = 200, local_size_y = 200, local_size_z = 1) in;
layout(set = 0, binding = 0, rgba32f) uniform image2D fluidSim;
// The code we want to execute in each invocation
void main() {
vec4 color;
ivec2 texel = ivec2(gl_GlobalInvocationID.xy);
imageStore(fluidSim, texel, color);
}
Here’s the log from the crash:
Godot Engine v4.4.1.stable.official.49a5bc7b6 - https://godotengine.org
Vulkan 1.3.289 - Forward+ - Using Device #0: NVIDIA - NVIDIA GeForce RTX 3060
ERROR: Buffer is either invalid or this type of buffer can’t be retrieved.
at: buffer_get_data (servers/rendering/rendering_device.cpp:664)
ERROR: Printing last known breadcrumbs in reverse order (last executed first).
Some of them might be inaccurate. Try running with --accurate-breadcrumbs for precise information.
at: print_lost_device_info (drivers/vulkan/rendering_device_driver_vulkan.cpp:5613)
ERROR: Searching last breadcrumb. We’ve sent up to ID: 0
ERROR: Last breadcrumb ID found: 0
ERROR: Last known breadcrumb: BLIT_PASS
ERROR: Last known breadcrumb: UNKNOWN_BREADCRUMB(0)
ERROR: Last known breadcrumb: UNKNOWN_BREADCRUMB(0)
ERROR: Last known breadcrumb: UNKNOWN_BREADCRUMB(0)
ERROR: Last known breadcrumb: UNKNOWN_BREADCRUMB(0)
ERROR: Last known breadcrumb: UNKNOWN_BREADCRUMB(0)
ERROR: Last known breadcrumb: UNKNOWN_BREADCRUMB(0)
ERROR: Last known breadcrumb: UNKNOWN_BREADCRUMB(0)
================================================================
CrashHandlerException: Program crashed with signal 11
Engine version: Godot Engine v4.4.1.stable.official (49a5bc7b616bd04689a2c89e89bda41f50241464)
Dumping the backtrace. Please include this when reporting the bug to the project developer.
[1] error(-1): no debug info in PE/COFF executable
[2] error(-1): no debug info in PE/COFF executable
[3] error(-1): no debug info in PE/COFF executable
[4] error(-1): no debug info in PE/COFF executable
[5] error(-1): no debug info in PE/COFF executable
[6] error(-1): no debug info in PE/COFF executable
[7] error(-1): no debug info in PE/COFF executable
[8] error(-1): no debug info in PE/COFF executable
[9] error(-1): no debug info in PE/COFF executable
[10] error(-1): no debug info in PE/COFF executable
[11] error(-1): no debug info in PE/COFF executable
[12] error(-1): no debug info in PE/COFF executable
[13] error(-1): no debug info in PE/COFF executable
[14] error(-1): no debug info in PE/COFF executable
[15] error(-1): no debug info in PE/COFF executable
[16] error(-1): no debug info in PE/COFF executable
[17] error(-1): no debug info in PE/COFF executable
[18] error(-1): no debug info in PE/COFF executable
[19] error(-1): no debug info in PE/COFF executable
[20] error(-1): no debug info in PE/COFF executable
[21] error(-1): no debug info in PE/COFF executable
– END OF BACKTRACE –
I’ve seen “Buffer is either invalid or this type of buffer can’t be retrieved.” before, but I was never able to resolve it, no matter how I compare it to the online resources that I could find.