Skip to content
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

Merged
merged 13 commits into from
Jul 25, 2017
Merged

PIX: Pixel count/cost pass #457

merged 13 commits into from
Jul 25, 2017

Conversation

jeffnn
Copy link
Collaborator

@jeffnn jeffnn commented Jul 24, 2017

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.

@jeffnn jeffnn requested review from tex3d and python3kgae July 24, 2017 21:36
@msftclas
Copy link

@jeffnn,
Thanks for your contribution as a Microsoft full-time employee or intern. You do not need to sign a CLA.
Thanks,
Microsoft Pull Request Bot

MDTuple *pEntry = m_pMDHelper->EmitDxilEntryPointTuple(pEntryFunc, EntryName, pMDSig, pNewResource, pMDProperties);
MDTuple *pMDSignatures = m_pMDHelper->EmitDxilSignatures(*m_EntrySignature);
MDTuple *pMDProperties = EmitDxilShaderProperties();
EmitLLVMUsed(); // necessary?
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not necessary.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks

MDTuple *pMDSignatures = m_pMDHelper->EmitDxilSignatures(*m_EntrySignature);
MDTuple *pMDProperties = EmitDxilShaderProperties();
EmitLLVMUsed(); // necessary?
// todo: what about type system?
Copy link
Contributor

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.

Copy link
Collaborator Author

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,{
Copy link
Contributor

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?

Copy link
Collaborator Author

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.

@AppVeyorBot
Copy link

@AppVeyorBot
Copy link

@jeffnn jeffnn merged commit 47226d0 into microsoft:master Jul 25, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants