1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2024-11-30 22:24:15 +01:00

[dxbc] Do not emit depth type for non-sampled resources

Fixes a crash in the Nvidia driver. These type
declarations were never used in the first place.
This commit is contained in:
Philip Rebohle 2018-02-02 21:42:04 +01:00
parent 14d5054893
commit a567f6a5a5
No known key found for this signature in database
GPG Key ID: C8CC613427A31C99

View File

@ -757,11 +757,18 @@ namespace dxvk {
res.sampledTypeId = sampledTypeId;
res.imageTypeId = imageTypeId;
res.colorTypeId = imageTypeId;
res.depthTypeId = m_module.defImageType(sampledTypeId,
typeInfo.dim, 1, typeInfo.array, typeInfo.ms, typeInfo.sampled,
spv::ImageFormatUnknown);
m_textures.at(registerId) = res;
res.depthTypeId = 0;
res.structStride = 0;
if (resourceType != DxbcResourceDim::Buffer
&& resourceType != DxbcResourceDim::Texture2DMs
&& resourceType != DxbcResourceDim::Texture2DMsArr) {
res.depthTypeId = m_module.defImageType(sampledTypeId,
typeInfo.dim, 1, typeInfo.array, typeInfo.ms, typeInfo.sampled,
spv::ImageFormatUnknown);
}
m_textures.at(registerId) = res;
}
// Store descriptor info for the shader interface
@ -866,7 +873,7 @@ namespace dxvk {
res.sampledTypeId = sampledTypeId;
res.imageTypeId = resTypeId;
res.colorTypeId = resTypeId;
res.depthTypeId = resTypeId;
res.depthTypeId = 0;
res.structStride = resStride;
m_textures.at(registerId) = res;
}