0
votes

in a voxel raytracer, written as a pixel shader in DirectX11, I'm using a 3d texture to store the light information per voxel.

However, when I switch from this SamplerState (Image)

SamplerState sam3DPoint
{
    Filter = MIN_MAG_MIP_POINT;
    AddressU = Border;
    AddressV = Border;
    AddressW = Border;
    BorderColor = float4(0, 0, 0, 0);
};

to this one (Image)

SamplerState sam3DLinear
{
    Filter = MIN_MAG_MIP_LINEAR;
    AddressU = Border;
    AddressV = Border;
    AddressW = Border;
    BorderColor = float4(0, 0, 0, 0);
};

The light data is not correctly sampled.

I'm using DXGI_FORMAT_R32G32B32_FLOAT as the format for the 3d texture.

Strangely, this error only occurs since I changed from an Nvidia graphics card to an AMD FirePro.

2

2 Answers

0
votes

I found the error: the AMD card does not support interpolation of the R32G32B32_FLOAT texture format. I had to convert it to a R32G32B32A32_FLOAT texture.

0
votes

Depending on your Direct3D Feature Level, you need to check a few formats to see if they are actually supported by your hardware for particular use cases. Unlike Direct3D 9, you don't have to check every format because most of them are required based on your feature level. If it is required at feature level x, then it is available at feature level x + n.

The full support charts can be found on MSDN in the DXGI documentation.

Generally speaking R32G32B32_FLOAT is a bit of an odd-ball format. A number of hardware designs require that data be 8-bits, 16-bits, 32-bits, 64-bits, or 128-bits. As such a 96-bit format sometimes is implemented as a planar format when used as a texture so has some limitations. It can always be used as a vertex buffer format (which has extremely common use of float3 data).

For 10level9 feature levels (i.e. D3D_FEATURE_LEVEL_9_1, D3D_FEATURE_LEVEL_9_2, or D3D_FEATURE_LEVEL_9_3), R32G32B32_FLOAT can only be used in vertex buffers.

With D3D_FEATURE_LEVEL_10_0 or greater hardware, various uses of R32G32B32_FLOAT beyond a vertex buffer is optional and have to be explicitly checked via the method CheckFormatSupport.

D3D_FEATURE_LEVEL_11_0 or greater has a few more required support cases for this format, but there are still optional ones that have to be explicitly checked, particularly sampling as a texture with any filter combination, using it as a render target, auto-gen mipmaps, or using it as a blendable render target. Full support for this format is not required even for D3D_FEATURE_LEVEL_12_1.