FNA-XNA / FNA3D

FNA3D - 3D Graphics Library for FNA
http://fna-xna.github.io/
Other
287 stars 48 forks source link

Vulkan: textures fall back to host memory if out of device memory #94

Closed thatcosmonaut closed 3 years ago

thatcosmonaut commented 3 years ago

Right now we have absurd device texture memory requirements because we crash on failing to allocate device local memory. This patch allows the renderer to fall back on host memory for most allocation cases. The exceptions are render targets, which should always be on device memory, and depth formats or BC* compression formats, which must be stored in optimal tiling and therefore cannot be stored in host memory.

DadSchoorse commented 3 years ago

@thatcosmonaut @flibitijibibo Just for your information: it's possible have optimal images in normal host memory on amd. Nvidia has special memory types that use host memory which isn't host visible VkMemoryType::propertyFlags == 0 (memory types 0 - 6 on my nvidia card). So afaik it should always be possible to fallback to host memory with optimal layout.

thatcosmonaut commented 3 years ago

@DadSchoorse Looks like you're right, thanks for the tip-off.