1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2025-01-19 05:52:11 +01:00

[dxvk] Zero-Initialize SpecConstantData

Ensure that specialization constant data passed into the driver is
zero-initialized.

Having the pData field in VkSpecializationInfo be zero-initialized helps
to create more deterministic input to the driver, which is particularly
useful when debugging shader issues.
This commit is contained in:
Liam Middlebrook 2019-04-01 13:51:08 -07:00 committed by Philip Rebohle
parent cd93ba570e
commit 9d26031dcb
2 changed files with 3 additions and 3 deletions

View File

@ -101,7 +101,7 @@ namespace dxvk {
auto csm = m_cs->createShaderModule(m_vkd, m_slotMapping, moduleInfo);
DxvkSpecConstantData specData;
DxvkSpecConstantData specData = { };
for (uint32_t i = 0; i < MaxNumActiveBindings; i++)
specData.activeBindings[i] = state.bsBindingMask.isBound(i) ? VK_TRUE : VK_FALSE;

View File

@ -184,7 +184,7 @@ namespace dxvk {
sampleCount = VkSampleCountFlagBits(state.rsSampleCount);
// Set up some specialization constants
DxvkSpecConstantData specData;
DxvkSpecConstantData specData = { };
specData.rasterizerSampleCount = uint32_t(sampleCount);
specData.alphaTestEnable = state.xsAlphaCompareOp != VK_COMPARE_OP_ALWAYS;
specData.alphaCompareOp = state.xsAlphaCompareOp;