Now I’ve got a block of 2D texture raw data loaded from file (which has already been compiled and encoded with BC3/S3TC format). The CUDA runtime API cudaCreateTextureObject() require 3 descriptive struct, and the cudaResourceViewDesc seems to support BC3 format.
My questions are:
- What should be the width/height/channelDesc when I cudaMallocArray()? What should be noted to fill those desc struct?
- How to sample this 2D texture object of compressed format in CUDA program? Is Tex2D() ok?
BC3 format encodes 4x4 pixel block with 16 bytes, so the concept ‘pixel’ became useless (seems to me). Now I am allocating BlockWidth * BlockHeight with 4 uint32 channels for my resource and the texture can’t be sampled properly.
Optix SDK 7.0, Win10, CUDA 10.2, GTX 1060