mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-07-28 18:31:40 +00:00
Fix detection of semantic arrays to not falsely merge separated elements
* It's impossible to distinguish a separate TEXCOORD0 and TEXCOORD1 from an array at TEXCOORD0. However making this an array by that same logic is fine. We can't make an array though if there is another element in between they must be contiguous.
This commit is contained in:
@@ -221,13 +221,15 @@ void GatherInputDataForInitialValues(const DXBC::DXBCContainer *dxbc, InputFetch
|
||||
if(included && numCols <= 3 && (sig.regChannelMask & 0x1))
|
||||
{
|
||||
uint32_t nextIdx = sig.semanticIndex + 1;
|
||||
uint32_t nextReg = sig.regIndex + 1;
|
||||
|
||||
for(size_t j = i + 1; j < numInputs; j++)
|
||||
{
|
||||
const SigParameter &jSig = stageInputSig[j];
|
||||
|
||||
// if we've found the 'next' semantic
|
||||
if(sig.semanticName == jSig.semanticName && nextIdx == jSig.semanticIndex)
|
||||
if(sig.semanticName == jSig.semanticName && nextIdx == jSig.semanticIndex &&
|
||||
nextReg == jSig.regIndex)
|
||||
{
|
||||
int jNumCols = (jSig.regChannelMask & 0x1 ? 1 : 0) + (jSig.regChannelMask & 0x2 ? 1 : 0) +
|
||||
(jSig.regChannelMask & 0x4 ? 1 : 0) + (jSig.regChannelMask & 0x8 ? 1 : 0);
|
||||
@@ -247,6 +249,7 @@ void GatherInputDataForInitialValues(const DXBC::DXBCContainer *dxbc, InputFetch
|
||||
|
||||
// continue searching now
|
||||
nextIdx++;
|
||||
nextReg++;
|
||||
j = i + 1;
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -258,6 +258,13 @@ float4 main(v2f IN) : SV_Target0
|
||||
tests.push_back(BuildTestCase({{false, VarType::UInt, 3, 1, "TEXCOORD0", true}}));
|
||||
tests.push_back(BuildTestCase({{false, VarType::UInt, 4, 1, "TEXCOORD0", true}}));
|
||||
|
||||
// something that looks like an array but isn't
|
||||
tests.push_back(BuildTestCase({
|
||||
{false, VarType::Float, 2, 1, "TEXCOORD0", true},
|
||||
{false, VarType::Float, 2, 1, "OTHER", true},
|
||||
{false, VarType::Float, 2, 1, "TEXCOORD1", true},
|
||||
}));
|
||||
|
||||
// float2 array with an extra float2
|
||||
tests.push_back(BuildTestCase({{false, VarType::Float, 2, 5, "TEXCOORD0", true},
|
||||
{false, VarType::Float, 2, 0, "OTHER", true}}));
|
||||
|
||||
Reference in New Issue
Block a user