Hi all,
I have Texture3D initialized using R32G32_UINT data, SRV and UAV is created as well.
Here the code I use :
RWTexture3D<uint2> TestTexture3D: register(u0);
[numthreads(16, 16, 1)]
void main(uint3 dispatchThreadID : SV_DispatchThreadID)
{
TestTexture3D[dispatchThreadID] = uint2(0, 0);
}
const UInt32 ThreadGroupCountX = CMath::Ceil( static_cast< float >( m_Width ) / 16.0f );
const UInt32 ThreadGroupCountY = CMath::Ceil( static_cast< float >( m_Height ) / 16.0f );
CDirect3D11Device::GetDeviceContext()->Dispatch( ThreadGroupCountX, ThreadGroupCountY, 256);
"TestTexture3D[dispatchThreadID] = uint2(0, 0);" is changed to 0 or 1 to see the change on output texture.
But the problem is I have value set on the bad coord.The result is like one rectangle of one color and after one rectangle of other.
Is it because of the texture is uint2 format and the GPU align data to uint4 ?
What is the best solution to avoid this problem ?
Thanks for the help