BarnacleJunior

Double precision in DirectCompute fails with literals

Discussion created by BarnacleJunior on Feb 14, 2010
Latest reply on Feb 15, 2010 by BarnacleJunior

In a cs_5_0 profile, the following code fails when I perform a literal multiply.  The UAV gets filled with zeroes.  I'm on HD5850.  I did check the D3D11_FEATURE_DATA_DOUBLES; it's true.  Also, it works on REF.  I'm on Catalyst 10.1 and the Feb2010 DXSDK.

StructuredBuffer<double> source : register(t0);
RWStructuredBuffer<double> target : register(u0);

cbuffer cb0 {
    double multiplier;
    double padding;
};

[numthreads(64, 1, 1)]
void DoubleShader(uint tid : SV_GroupIndex, uint3 gid : SV_GroupID) {
       
    double x = source[tid];
    
    // fiddle with x
    
    // when multiplying by a literal, as below, the UAV gets filled with 0s.
    // x *= 2.0;
    
    // when multiplying by a cbuffer value, the multiplication works
    // x *= multiplier;
    
    // when mulitplying by a variable, the multiplication works
    x *= x;
    
    target[tid] = x;
}

Outcomes