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

Handling Multiple resource views per mip per layer #390

Open
Pikachuxxxx opened this issue Dec 18, 2024 · 0 comments
Open

Handling Multiple resource views per mip per layer #390

Pikachuxxxx opened this issue Dec 18, 2024 · 0 comments

Comments

@Pikachuxxxx
Copy link
Owner

problem

Cubemap and 2D array textures will need different image views and handling per face per mip and native views will get complicated

Thoughts dump

what If I have 2 of ImageResourceView
ex.
ImageResourceView m_NativeResourceView this will contain the UAV/SRV for the entire resource as intended
and another
ImageResourceView m_ResourceViews[RAZIX_MAX_TEXTURE_LAYERS][RAZIX_MAX_TEXTURE_MIPS] = {};
This is will always store the 2D image view per layer/mip, since such a image view is almost always just a 2D image? not sure If I want to generalize this...

I think if someone wants a image view for bunch of layers and mips, we can have explicit API for that?

hmm makes sense, right
yeah it'll probably search for 6 faces from that base index and cause issues hmmm

struct ImageResourceView
{
    VkImageView uav = VK_NULL_HANDLE;
    VkImageView srv = VK_NULL_HANDLE;
    VkImageView rtv = VK_NULL_HANDLE;    // for swapchain
    VkImageView dsv = VK_NULL_HANDLE;
}


ImageResourceView m_ResourceViews[RAZIX_MAX_TEXTURE_LAYERS][RAZIX_MAX_TEXTURE_MIPS] = {};

I'm using this setup to store my image views per face/per mip, now the issues is with a RWTextureCube, since HLSL doesn't have it I need to stores a Cubemap SRV, Texture2DArray UAV and a Texture2D UAV for each layer per mip, which is getting very non-intuitive, any suggestions on how to store image views in a better way?

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

No branches or pull requests

1 participant