Skip to content

Conversation

1hue
Copy link
Contributor

@1hue 1hue commented Sep 13, 2025

Fix uniform sets that were hardcoded as 0, which seems to work with v4.4 but has broken this demo in v4.5.

Still works with v4.4.1

Also removed the unnecessary texture usage bits.


  ERROR: Uniforms supplied for set (2):
  ERROR: Set: 0 Binding: 0 Type: Image Writable: N Length: 1
  ERROR: are not the same format as required by the pipeline shader. Pipeline shader requires the following bindings:
  ERROR: Set: 0 Binding: 0 Type: Image Writable: N Length: 1
  ERROR: Set: 1 Binding: 0 Type: Image Writable: N Length: 1
  ERROR: Set: 2 Binding: 0 Type: Image Writable: Y Length: 1

@Calinou Calinou added the bug label Sep 13, 2025
Copy link
Member

@Calinou Calinou left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested locally on 4.4.1.stable and 4.5.rc2, it works as expected. Code looks good to me.

@Calinou Calinou merged commit b45ef54 into godotengine:master Sep 13, 2025
1 check passed
@1hue 1hue deleted the fix/compute-texture-uniform-sets branch September 14, 2025 01:28
@clayjohn
Copy link
Member

I think this supersedes #1241 and #1174

@1hue 1hue restored the fix/compute-texture-uniform-sets branch September 14, 2025 08:34
@Calinou
Copy link
Member

Calinou commented Sep 14, 2025

I think this supersedes #1241 and #1174

I can confirm this, so I went and closed the other PRs.

@@ -143,13 +143,13 @@ var pipeline: RID
var texture_rds: Array[RID] = [RID(), RID(), RID()]
var texture_sets: Array[RID] = [RID(), RID(), RID()]

func _create_uniform_set(texture_rd: RID) -> RID:
func _create_uniform_set(texture_rd: RID, uniform_set: int) -> RID:
var uniform := RDUniform.new()
uniform.uniform_type = RenderingDevice.UNIFORM_TYPE_IMAGE
uniform.binding = 0
uniform.add_id(texture_rd)
# Even though we're using 3 sets, they are identical, so we're kinda cheating.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The comment can be removed

# Create our uniform sets so we can use these textures in our shader.
var current_set := _create_uniform_set(current_texture_rd, 0)
var previous_set := _create_uniform_set(previous_texture_rd, 1)
var next_set := _create_uniform_set(next_texture_rd, 2)
Copy link

@beicause beicause Sep 15, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems to create uniforms every frame, no? I think we just need 9 uniforms and should cache them. Or use UniformSetCacheRD

Copy link
Member

@Calinou Calinou Sep 15, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Feel free to open a PR for this 🙂

Same for the above comment.

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

Successfully merging this pull request may close these issues.

4 participants