Skip to content

Address post-merge review comments on #1020 and use LLVM-style RTTI#1094

Open
EmilioLaiso wants to merge 8 commits intollvm:mainfrom
Traverse-Research:texture-and-buffers-as-unique-ptr
Open

Address post-merge review comments on #1020 and use LLVM-style RTTI#1094
EmilioLaiso wants to merge 8 commits intollvm:mainfrom
Traverse-Research:texture-and-buffers-as-unique-ptr

Conversation

@EmilioLaiso
Copy link
Copy Markdown
Contributor

@EmilioLaiso EmilioLaiso commented Apr 16, 2026

Follow-up on the discussions at: #1020 (comment) & #1020 (comment)

This PR does the following:

  • Use offloadtest::Texture and offloadtest::Buffer types in backends InvocationState
  • Switch the usage of shared_ptr for those types to unique_ptr
  • Add LLVM-style RTTI on Buffer and Texture

@EmilioLaiso
Copy link
Copy Markdown
Contributor Author

Comment thread lib/API/DX/Device.cpp
Comment on lines +493 to +495
std::unique_ptr<offloadtest::Texture> RT;
std::unique_ptr<offloadtest::Buffer> RTReadback;
std::unique_ptr<offloadtest::Texture> DS;
Copy link
Copy Markdown
Contributor

@manon-traverse manon-traverse Apr 16, 2026

Choose a reason for hiding this comment

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

Fantastic, using the abstract types brings InvocationState closer to being identical between render backends. The downcasting is needed for now, as we don't have a complete interface yet, but the places where we do cast act as TODO items for what has highest priority to be added to the interface.

Comment thread lib/API/DX/Device.cpp Outdated
Copy link
Copy Markdown
Collaborator

@MarijnS95 MarijnS95 left a comment

Choose a reason for hiding this comment

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

LGTM

Comment thread include/API/Buffer.h Outdated
@EmilioLaiso EmilioLaiso requested a review from s-perron April 17, 2026 07:21
Comment thread include/API/Buffer.h Outdated
@EmilioLaiso EmilioLaiso requested a review from MarijnS95 April 17, 2026 14:31
Comment thread include/API/Device.h
createFence(llvm::StringRef Name) = 0;

virtual llvm::Expected<std::shared_ptr<Buffer>>
virtual llvm::Expected<std::unique_ptr<Buffer>>
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Just want to make a note that I still think we should go down the shared_ptr route. However that is currently being discussed in issue #1099.
I am okay with going unique_ptr for now because the keep alive system is not place yet. However, we are close to implementing and PRing that and will probably need to switch back to shared_ptr there.

Comment thread include/API/Texture.h
@EmilioLaiso EmilioLaiso force-pushed the texture-and-buffers-as-unique-ptr branch from 5957622 to 61afed6 Compare April 20, 2026 11:44
@EmilioLaiso EmilioLaiso force-pushed the texture-and-buffers-as-unique-ptr branch from 61afed6 to 5f9a83c Compare April 21, 2026 08:09
Copy link
Copy Markdown
Contributor

@bogner bogner left a comment

Choose a reason for hiding this comment

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

Generally looks good, just a style comment that applies throughout.

Comment thread lib/API/DX/Device.cpp Outdated
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.

5 participants