Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/api/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Windows phone 8 为什么可以';我是否在WP8中使用DXGI_格式_R8_UNORM格式创建渲染目标?_Windows Phone 8_Directx - Fatal编程技术网

Windows phone 8 为什么可以';我是否在WP8中使用DXGI_格式_R8_UNORM格式创建渲染目标?

Windows phone 8 为什么可以';我是否在WP8中使用DXGI_格式_R8_UNORM格式创建渲染目标?,windows-phone-8,directx,Windows Phone 8,Directx,渲染目标描述如下,调用CreateTexture2D时我的应用程序崩溃,但着色器资源没有问题 CD3D11_TEXTURE2D_DESC renderTargetDesc( DXGI_FORMAT_R8_UNORM, static_cast<UINT>(m_renderTargetSize.Width), static_cast<UINT>(m_renderTargetSize.Height), 1, 1, D3D11_BI

渲染目标描述如下,调用CreateTexture2D时我的应用程序崩溃,但着色器资源没有问题

CD3D11_TEXTURE2D_DESC renderTargetDesc(
    DXGI_FORMAT_R8_UNORM,
    static_cast<UINT>(m_renderTargetSize.Width),
    static_cast<UINT>(m_renderTargetSize.Height),
    1,
    1,
    D3D11_BIND_RENDER_TARGET
    );

m_d3dDevice->CreateTexture2D(
    &renderTargetDesc,
    nullptr,
    &m_renderTarget
);
CD3D11\u TEXTURE2D\u DESC renderTargetDesc(
DXGI_格式_R8_UNORM,
静态投影(m_renderTargetSize.Width),
静态投影(m_renderTargetSize.Height),
1.
1.
D3D11_绑定_渲染_目标
);
m_d3dDevice->CreateTexture2D(
&renderTargetDesc,
nullptr,
&m_渲染目标
);
但我发现渲染目标支持DXGI_格式_R8_UNORM格式:


有人能告诉我问题出在哪里吗?非常感谢

并非所有硬件都相等,您应该首先使用文档中的
ID3D11Device::CheckFormatSupport
检查使用情况

现代GPU不支持在低于32位/像素的情况下进行渲染。Windows驱动程序也更有可能提供引擎盖后面缺少的功能的仿真,而不是在性能和电池消耗都需要仔细检查的手机上

您应该在设备创建时添加调试层标志,并查看控制台日志,您将看到与调用无效参数相关的错误消息