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

D3D11 Frametrim Backend #872

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open

D3D11 Frametrim Backend #872

wants to merge 5 commits into from

Conversation

lfrb
Copy link
Contributor

@lfrb lfrb commented May 26, 2023

Add a D3D11 backend for frametrimmer

lfrb added 4 commits May 26, 2023 09:54
Signed-off-by: Louis-Francis Ratté-Boulianne <[email protected]>
Signed-off-by: Louis-Francis Ratté-Boulianne <[email protected]>
Signed-off-by: Louis-Francis Ratté-Boulianne <[email protected]>
@fooishbar
Copy link

@jrfonseca do you have any idea who would be good to review D3D11?

@jrfonseca
Copy link
Member

@jrfonseca do you have any idea who would be good to review D3D11?

@fooishbar , I'm familiar with the D3D11 API, so I can and will comment from that perspective. But I only have a superficial understanding of frametrim, so it's best if @gerddie looks into that too.

Copy link
Member

@jrfonseca jrfonseca left a comment

Choose a reason for hiding this comment

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

This looks pretty good overall!

The approach taken is the best.

There are a quite a few corner cases glossed over here (comments inline) but this is a good starting point.

The only suggestion I make for future is to be defensive: either err on the side of caution (ie, not trim unless sure), or, when making assumption, explcitly check for those assumptions and throw a loud warning. This way the user is more likely to get something that works, or at least guidance on what needs to be improved.

frametrim/ft_d3d11.cpp Outdated Show resolved Hide resolved
frametrim/ft_d3d11.cpp Show resolved Hide resolved
frametrim/ft_d3d11.cpp Outdated Show resolved Hide resolved
void
D3D11View::clear(const trace::Call& call)
{
m_resource->clear();
Copy link
Member

Choose a reason for hiding this comment

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

Clearing a view only clears the subresources on the view. Ideally we should be tracking resource content dependencies on a per-subresource basis.

This is quite common when rendering to mipmaps and/or cube faces.

It's fine to defer fine grained tracking, but I'd recommend emitting a warning when clearing a view which does not comprehend the whole resource, so the user can quickly diagnose what needs to be improved in frametrim.

frametrim/ft_d3d11.cpp Outdated Show resolved Hide resolved
frametrim/ft_d3d11.cpp Outdated Show resolved Hide resolved
@gerddie
Copy link
Contributor

gerddie commented Jun 15, 2023

So I've had a look at the code, but since I have zero understanding about how DX11 works I can't really comment on the implementation.

frametrim/ft_d3d11.hpp Outdated Show resolved Hide resolved
@gerddie
Copy link
Contributor

gerddie commented Jun 15, 2023

I've asked @okias whether he can give more insights, after all he might be using it the most currently.

Signed-off-by: Louis-Francis Ratté-Boulianne <[email protected]>
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