Skip to content

Conversation

almarklein
Copy link
Member

@almarklein almarklein commented Aug 7, 2023

Closes #579, and some general improvements, ref #19.

This fixes that 64-bit data could be passed to a buffer without pygfx complaining about it, resulting in a broken visualization.

  • Data passed to Geometry(...) is simply passed to the buffer constructor, so any checks happen in one place.
  • The format is now derived in the Buffer and Texture constructor, instead of lazily. Fail early.
  • Fix the detection of float64 arrays and also detect int64 arrays (The original issue).
  • Buffer.format is now None for e.g. uniform buffers (instead of raising an error).
  • Added some unit tests for buffer, texture and geometry.

@almarklein almarklein requested a review from Korijn as a code owner August 7, 2023 11:36
@almarklein almarklein changed the title Buffer Buffer dtype validation Aug 7, 2023
@almarklein almarklein changed the title Buffer dtype validation Buffer and texture dtype validation Aug 7, 2023
@almarklein almarklein merged commit 78280bc into main Aug 8, 2023
@almarklein almarklein deleted the buffer branch August 8, 2023 11:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Check dtype of buffer and texture data
2 participants