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

GLES2 fix octahedral half float unpacking #71510

Merged
merged 1 commit into from
Jan 17, 2023

Conversation

lawnjelly
Copy link
Member

The strides in _unpack_half_floats() were incorrectly calculated in the case where octahedral normals and tangents were in use.

Notes

  • I discovered this while debugging a crash in my BGFX rasterizer, which copies the unpacking code from GLES2.
  • The bug occurs because the strides are incremented at the end of the loop:
		src_stride += src_size[i];
		dst_stride += dst_size[i];

Whereas the code in question modifies the size of src_size[VS::ARRAY_NORMAL] rather than the current attribute, therefore the stride is never added.

  • This could do with being independently checked by e.g. @clayjohn
  • I'm not sure altogether whether this bug occurs in the wild (maybe this combination does not occur usually in GLES2) but it seems worth closing.

The strides in _unpack_half_floats() were incorrectly calculated in the case where octahedral normals and tangents were in use.
@lawnjelly lawnjelly requested a review from a team as a code owner January 16, 2023 12:01
@lawnjelly lawnjelly added this to the 3.6 milestone Jan 16, 2023
@akien-mga akien-mga added the cherrypick:3.5 Considered for cherry-picking into a future 3.5.x release label Jan 16, 2023
@akien-mga akien-mga merged commit a0ddc59 into godotengine:3.x Jan 17, 2023
@akien-mga
Copy link
Member

Thanks!

@lawnjelly lawnjelly deleted the gles2_oct_unpack branch January 17, 2023 11:20
@norrath-hero-cn
Copy link

BGFX rasterizer? this just like a dream comes to true! you make Godot 3.x even greater!!!

@akien-mga
Copy link
Member

Cherry-picked for 3.5.2.

@akien-mga akien-mga removed the cherrypick:3.5 Considered for cherry-picking into a future 3.5.x release label Jan 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants