I’m attempting to use mipmapped block compressed textures in Optix 7.2, specifically the BC7 and BC5 formats.
The issue is that I’m unable to use enable linear filtering when using block compressed textures, due to an error from the cudaCreateTextureObject function: “linear filtering not supported for non-float type.”
The issue seems to be the cudaChannelFormatDesc the underlying cudaArray_t / cudaMipmappedArray_t is created with. Specifically, the cudaResourceViewDesc documentation indicates that for block compressed formats the cudaChannelFormatDesc should be configured as 32 bits per channel, of unsigned format (so uint4, for BC5 and BC7). The 32 bit uint type seems to be incompatible with linear filtering, hence the error message.
Is there any workaround for this issue besides implementing bilinear / trilinear filtering myself in software? It makes block compressed textures essentially unusable by default in an optix based renderer.
Another issue I’ve encountered is that the mip tail for block compressed textures doesn’t seem to work correctly - specifically, mip levels smaller than 4x4 seem to be impossible to create, because the cudaMipmappedArray_t needs to be created with dimensions divided by 4.
None of these issues should be hardware limitations, as it all works properly in D3D12 / Vulkan.