Skip to content

Conversation

null77
Copy link

@null77 null77 commented May 7, 2025

  • Basic support for texSubImage3D.
  • Code support for Renderdoc, which is enabled via a define.
  • Fix for nodejs issue with detecting instances of buffer types.
  • Simple conversion for RGBA->RED pixel formats on texture upload.

@dhritzkiv another small set of fixes/changes. If the RenderDoc stuff isn't welcome I can remove it, but it's useful to have locally.

data instanceof Int32Array ||
data instanceof Float32Array ||
data instanceof Float64Array
return isInstanceOfType(data, 'Uint8Array') ||
Copy link
Member

@dhritzkiv dhritzkiv May 13, 2025

Choose a reason for hiding this comment

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

Could you briefly describe the issues in node with checking if it's a typed array with instanceof ? Something to do with tests / use in a vm module?

This looks fine, I'm more curious for myself – and perhaps there's a another, simpler yet still foolproof version.

Copy link
Author

Choose a reason for hiding this comment

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

I added a comment to "isInstanceOfType". The issue I think was coming from Webpack, which was supplying some kind of polyfill that broke instanceof. I didn't 100% root cause the issue to the point where I know who was responsible, but I am certain that instanceof was failing in this case and comparing the type string did work properly for our case.

}

if (
typeof pixels === 'object' &&
Copy link
Member

Choose a reason for hiding this comment

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

Likely don't need this line, as it's checked for in the previous if statement

Copy link
Author

Choose a reason for hiding this comment

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

Done.

@dhritzkiv
Copy link
Member

Overall, looks good.

I think RenderDoc support is a good addition, especially since it's optional, and doesn't look too substantial to maintain.

Would you mind adding a few lines to the README about RenderDoc support in headless-gl? Anything that might be useful to other devs looking to debug their program (unless there's nothing else to be done other than defining RENDERDOC_ENABLED and running RenderDoc)

- Basic support for texSubImage3D.
- Code support for Renderdoc, which is enabled via a define.
- Fix for nodejs issue with detecting instances of buffer types.
- Simple conversion for RGBA->RED pixel formats on texture upload.
@null77
Copy link
Author

null77 commented Sep 29, 2025

Overall, looks good.

I think RenderDoc support is a good addition, especially since it's optional, and doesn't look too substantial to maintain.

Would you mind adding a few lines to the README about RenderDoc support in headless-gl? Anything that might be useful to other devs looking to debug their program (unless there's nothing else to be done other than defining RENDERDOC_ENABLED and running RenderDoc)

Wow, it's been a while since I responded! Thanks for your patience here and giving me the time to address your comments. I added a blurb about RenderDoc in the README, added the RDoc header to the repo, and made some minor improvements to its usability. I did use it to debug some issues we were having. @dhritzkiv PTAL.

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.

2 participants