-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix DXBC pixel shader debugging with non-zero indexed semantic #3219
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As a general note, from the CONTRIBUTING documentation please ensure all commits are properly formatted and do not include any formatting-only commits.
if(sig.semanticIndex != 0) | ||
{ | ||
name += ToStr(sig.semanticIndex); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This fix does not seem correct. As in the comments on the field semanticIdxName
it already includes the index when necessary as compared to semanticName
, so this will duplicate it turning TEXCOORD1
into TEXCOORD11
.
Perhaps the logic for that needs to be re-examined? If you're not sure you can open this as a bug report and not a pull request and I can investigate it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This fix does not seem correct. As in the comments on the field
semanticIdxName
it already includes the index when necessary as compared tosemanticName
, so this will duplicate it turningTEXCOORD1
intoTEXCOORD11
.Perhaps the logic for that needs to be re-examined? If you're not sure you can open this as a bug report and not a pull request and I can investigate it.
Oh, thanks - I see where I'm wrong =)
I believe root reason for the issue goes from this code:
for(uint32_t i = 0; i < sign->numElems; i++)
{
SigParameter &a = (*sig)[i];
for(uint32_t j = 0; j < sign->numElems; j++)
{
SigParameter &b = (*sig)[j];
if(i != j && a.semanticName == b.semanticName)
{
a.needSemanticIndex = true;
break;
}
}
rdcstr semanticIdxName = a.semanticName;
if(a.needSemanticIndex)
semanticIdxName += ToStr(a.semanticIndex);
a.semanticIdxName = semanticIdxName;
}
}
Which literally means, that we use semantic index as a part of semanticIdxName field only if semantic with given name is used more than once. However if we only use single semantic with given name, but non-zero index, this doesn't work =(
Os, is it OK, if I change it here to add index to the field, when semantic index is not 0?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That seems to make more sense, it sounds quite unusual to only use a higher numbered semantic but I can see how that would break here.
If you want to update the PR that is fine, please ensure that as noted above you follow the CONTRIBUTING guidelines and remove the old commits and just have a new commit with the correct fix.
686e3a0
to
4298b7c
Compare
Description
While using DirectX 12, DXBC pixel shader debugging doesn't work, when semantic with non-zero index is used between VS and PS stages and is a single semantic with this name. I've added semantic index to generated debug shader input to fix interstage communication between original VS and generated PS, when semantic index is not zero. I kept previous logic as well to not to change behavior when more than one semantics with the same name are used and one of them is not indexed, like COLOR (turns to COLOR0) and COLOR1.
Also very simple application, that reproduces issue is added: it is from official DirectX 12 samples from Microsoft, with COLOR semantic in PS input changed to COLOR1
HelloTriangle.zip