11 minutes ago, joeblack said:What is format of texture ?
R32G32B32A32_FLOAT
11 minutes ago, joeblack said:did you checked shader that is writing to it ?
They are correct. It works without scaling, i.e. if I don't use this shader and just use the full resolution position texture directly.
...
SamplerState Sampler
{
Filter = MIN_MAG_MIP_POINT;
AddressU = Clamp;
AddressV = Clamp;
};
...
float2 TextureSize = float2(0, 0);
positionTexture.GetDimensions(TextureSize.x, TextureSize.y);
const uint Max = (1 << ScalingFlag) << ScalingFlag;
uint UsedIndex = 0xFFFFFFFF;
for (uint i = 0; i < Max && i < 16; ++i) {
const uint3 CurrentTexCoords = TexCoords + uint3(i & ((1 << ScalingFlag) - 1), i >> ScalingFlag, 0);
output.position = positionTexture.Sample(Sampler, (float2(CurrentTexCoords.xy)+0.5f)/ TextureSize);
if (output.position.w >= 0.0f) {
UsedIndex = i;
break;
}
}
...
With this change it works?!?
Edit: Adding [unroll] to the loop also fixes the problem. But why?