greggman / webgpu-utils

Some helpers for webgpu
https://greggman.github.io/webgpu-utils/
MIT License
200 stars 10 forks source link

Type ShaderDataDefinitions does not have export symbols #8

Closed BlackdBlook closed 8 months ago

BlackdBlook commented 8 months ago

Hello! I noticed that the type ShaderDataDefinitions in this library does not have an export symbol. Is this an oversight or intentional? image

Can this be fixed? Thank you.

greggman commented 8 months ago

at the moment it's intentional. It's meant to be opaque to pass to other functions. What are you trying to do?

BlackdBlook commented 8 months ago

I am learning to use this library to implement the Material encapsulation of my engine, trying to make setting Uniform variables as simple as OpenGL glUniform1i(). Therefore, I have considered caching this part of the content as an attribute in a certain type or passing it as a parameter, but Typescript will consider this type as undefined, which can be a bit troublesome.To achieve this functionality, I had to declare an identical type in my file and add an export symbol ,there might be a better way, as I am not a skilled JavaScript programmer,If there is a better solution, please let me know. I would greatly appreciate it..

greggman commented 8 months ago

ok, I exported it in v1.6.0

BlackdBlook commented 8 months ago

looks good, thank you