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

Attempted to use the same texture in framebuffer attachment error #44473

Closed
UltraWelfare opened this issue Dec 17, 2020 · 7 comments · Fixed by #44517 or #44530
Closed

Attempted to use the same texture in framebuffer attachment error #44473

UltraWelfare opened this issue Dec 17, 2020 · 7 comments · Fixed by #44517 or #44530

Comments

@UltraWelfare
Copy link

Godot version:
v4.0.dev.custom_build.2c0d1c3b9

OS/device including version:
OS: EndeavourOS (5.9.13-zen1-1-zen)
GPU: Intel UHD 620 (with integrated: Radeon 530)
Backend: X11 / Vulkan

Issue description:
Upon opening any new project (either creating one or loading one), the Output tab (and the terminal, if launching godot from there) continuously shows this message:
ERROR: Attempted to use the same texture in framebuffer attachment and a uniform set, this is not allowed.

The terminal outputs an extra line:
at: draw_list_bind_uniform_set (drivers/vulkan/rendering_device_vulkan.cpp:6176)

Steps to reproduce:

  1. Create a new project.
  2. Look at the output tab (or the terminal)

Minimal reproduction project:
Not needed as it happens with the creation of any new project.

@clayjohn
Copy link
Member

I spent some time tracking this down tonight, but haven't gotten anywhere yet. I'm recording notes below to help myself later or someone else.

The issue stems from binding the depth and normal textures for reading during any of the three main passes (prepass, opaque, alpha).

All three passes share the same uniform set which is declared here

RID rp_uniform_set = _setup_render_pass_uniform_set(p_render_buffer, radiance_texture, p_shadow_atlas, p_reflection_atlas, p_gi_probe_cull_result, p_gi_probe_cull_count);

Specifically it comes from binding the depth and normal_roughness textures in _setup_render_pass_uniform_set:

RID RendererSceneRenderForward::_setup_render_pass_uniform_set(RID p_render_buffers, RID p_radiance_texture, RID p_shadow_atlas, RID p_reflection_atlas, RID *p_gi_probe_cull_result, int p_gi_probe_cull_count) {

{
RD::Uniform u;
u.binding = 4;
u.uniform_type = RD::UNIFORM_TYPE_TEXTURE;
RID texture = rb && rb->depth.is_valid() ? rb->depth : storage->texture_rd_get_default(RendererStorageRD::DEFAULT_RD_TEXTURE_WHITE);
u.ids.push_back(texture);
uniforms.push_back(u);
}

{
RD::Uniform u;
u.binding = 6;
u.uniform_type = RD::UNIFORM_TYPE_TEXTURE;
RID texture = rb && rb->normal_roughness_buffer.is_valid() ? rb->normal_roughness_buffer : storage->texture_rd_get_default(RendererStorageRD::DEFAULT_RD_TEXTURE_NORMAL);
u.ids.push_back(texture);
uniforms.push_back(u);
}

The depth prepass binds the depth and the normal_roughness textures as framebuffers, so the issue makes sense. But the error occurs on the opaque and alpha pass as well. It is on this point that I need to investigate further.

@jure
Copy link

jure commented Dec 19, 2020

Just a data point over here: the error, still spammed, now says

ERROR: Attempted to use the same texture in framebuffer attachment and a uniform (set: 1, binding: 6), this is not allowed.
   at: (drivers\vulkan\rendering_device_vulkan.cpp:6183)

@Calinou Calinou reopened this Dec 19, 2020
@Calinou
Copy link
Member

Calinou commented Dec 19, 2020

See also #44523.

@reduz
Copy link
Member

reduz commented Dec 19, 2020

@Calinou #44523 seems completely unrelated, so feel free to keep this closed

@akien-mga
Copy link
Member

@reduz Read again, there's still very closely related error spam: #44473 (comment)

@Drachenbauer
Copy link

when i apply the texture, that a SubViewport outputs as the texture of a Sprite2d, it spams an error in the debugger:
draw_list_bind_uniform_set: Attempted to use the same texture in framebuffer attachment and a uniform (set: 3, binding: 0), this is not allowed.

@clayjohn
Copy link
Member

clayjohn commented Feb 9, 2024

when i apply the texture, that a SubViewport outputs as the texture of a Sprite2d, it spams an error in the debugger: draw_list_bind_uniform_set: Attempted to use the same texture in framebuffer attachment and a uniform (set: 3, binding: 0), this is not allowed.

Yes, that isn't allowed. You can't read from the texture that you are writing to

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