0
我在应用程序中使用模板缓冲区实现了鼠标拾取功能。某些英特尔GPU上的多采样纹理加载失败
这里的像素着色器鼠标下的读取值:
Texture2DMS<uint2> depthStencilTexture : register(t0);
cbuffer ReadDepthInput : register(b2)
{
int2 readPosition;
}
// Produces vector3(x, y, stencilValue)
float4 main() : SV_Target0
{
uint2 res = depthStencilTexture.Load(readPosition, 1);
float stencil = res.y;
// Scale the result from integers to 0..1
stencil /= 255.0f;
return float4(float(readPosition.x)/65535.0f, float(readPosition.y)/65535.0f, stencil, 0);
}
代码工作在NVIDIA和AMD的GPU,适用于英特尔虹膜英特尔的Haswell的GPU 550
代码失败(英特尔HD 5000,Intel HD 4600)。 Texture2DMS.Load只返回0.任何想法可能是错误的?
更新:只有8x MSAA才会发生。即使在受影响的英特尔GPU上,将其降至4倍也可以。
您是否确认该驱动程序使用“CheckFormatSupport”和8x MSAA对该格式使用“CheckMultisampleQualityLevels”支持“D3D11_FORMAT_SUPPORT_MULTISAMPLE_LOAD”? –
@ChuckWalbourn是的,我的应用程序在启动时调用它们,并禁用MSAA /降低级别。 – Soonts