-
Notifications
You must be signed in to change notification settings - Fork 3
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
Improve clarity of TextureCreateInfo #67
Comments
I moved this to Ship but probably shouldn't have since it could possibly change the ABI. With the texture rework and the blit stuff it may not be as scary as it was when we first filed it? |
I'm not thrilled about unions in the header in the first place, and I think that our recent texture creation rework reduced the need for this a lot. I think once we consolidate layer and depth into one field I would be pretty happy with where this is. Willing to discuss if others feel strongly about it. |
I agree, once layer and depth are consolidated I think that's sufficient. |
Resolved by #205 |
While the current SDL_GpuTextureCreateInfo struct design gets the job done, I think it could be improved for usability and clarity. What we have currently is this:
This is a collection of texture properties that covers all possible scenarios (depth, 2D, arrays, etc.), but it's not clear which properties are compatible with one another, or what the "default" values should be. It raises questions like:
Having this many individual, incompatible settings all presented in one grab-bag is clearly less than ideal. A potentially better option would be to follow the D3D11_VIEW_DESC approach, where we have a tagged union of texture types that only contain the options actually applicable for that type. Something like:
This isn't 100% perfect since you can still have incompatible type/format/usage pairings, but I think it substantially lightens the mental load of having to remember all the rules about which properties work with which types.
The text was updated successfully, but these errors were encountered: