-
Notifications
You must be signed in to change notification settings - Fork 677
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
PIX: Pixel count/cost pass #457
Conversation
@jeffnn, |
lib/HLSL/DxilModule.cpp
Outdated
MDTuple *pEntry = m_pMDHelper->EmitDxilEntryPointTuple(pEntryFunc, EntryName, pMDSig, pNewResource, pMDProperties); | ||
MDTuple *pMDSignatures = m_pMDHelper->EmitDxilSignatures(*m_EntrySignature); | ||
MDTuple *pMDProperties = EmitDxilShaderProperties(); | ||
EmitLLVMUsed(); // necessary? |
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.
Not necessary.
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.
Thanks
lib/HLSL/DxilModule.cpp
Outdated
MDTuple *pMDSignatures = m_pMDHelper->EmitDxilSignatures(*m_EntrySignature); | ||
MDTuple *pMDProperties = EmitDxilShaderProperties(); | ||
EmitLLVMUsed(); // necessary? | ||
// todo: what about type system? |
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.
If new structure type is added, need to re-emit type system.
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.
I think I am adding a new type, since I'm declaring a UAV with type struct{int32}...
auto OffsetIndex = Builder.CreateAdd(ClampedIndex, NumPixelsArg); | ||
|
||
// Step 3: Increment UAV value by the weight | ||
(void)Builder.CreateCall(AtomicOpFunc,{ |
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.
What's the (void) here for?
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.
It's just explicitly telling the reader that I don't care about the return value.
✅ Build DirectXShaderCompiler 1.0.544 completed (commit 45691d702d by @) |
✅ Build DirectXShaderCompiler 1.0.554 completed (commit fc5b5591f7 by @) |
I'm pretty sure this is not quite right yet, so I'd appreciate feedback.
Xiang, in particular, I am not confident about my changes to DxilModule. The goal is to re-emit the input signature. These are my questions:
-I'm not sure about the type system: Is it feasible, if unlikely, that I might introduce a new type with the new UAVs and CBs I'm adding?
-Do we need to call EmitLLVMUsed? It seems like not, since I'm not touching any global variables?
The actual pass is intended to echo what we already do for DXBC in PIX for the "pixel cost", "depth complexity" and "overdraw" visualizers. You can probably infer what the pass does from the names "overdraw" and "depth complexity": For each pixel rendered it increments a corresponding counter in a UAV of a buffer that is the same size as the render target. The "pixel cost" pass does the same thing, only the increment is a weight value calculated from the total cost of the draw call, as derived from PIX's GPU-side profiling system.