-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Reinterpret framebuffer formats as needed. Outrun reflections partial fix #13636
Merged
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
19b4feb
More reinterpret shader gen and test work.
hrydgard f2e315b
More shadergen work
hrydgard 1ccc8c1
Reinterpret code runs, no idea if it works
hrydgard 981d0a2
Reinterpret the data when binding a framebuffer with a different 16-b…
hrydgard 96c36d5
More work on reinterpret. Get Vulkan running
hrydgard 28f8578
Cleanup reinterpret shader resources in FramebufferManagerCommon::Dev…
hrydgard 4e16fca
Fix reinterpret shader for D3D11
hrydgard 9105249
Add compat flag for reinterpret shader, also disable on platforms tha…
hrydgard d81522a
Address feedback.
hrydgard File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
#pragma once | ||
|
||
#include <vector> | ||
|
||
// Like a const begin/end pair, just more convenient to use (and can only be used for linear array data). | ||
// Inspired by Rust's slices and Google's StringPiece. | ||
template <class T> | ||
struct Slice { | ||
// View some memory as a slice. | ||
Slice(const T *data, size_t size) : data_(data), size_(size) {} | ||
|
||
// Intentionally non-explicit. | ||
// View a const array as a slice. | ||
template<size_t N> | ||
Slice(const T(&data)[N]) : data_(data), size_(N) {} | ||
|
||
// Intentionally non-explicit. | ||
// View a const array as a slice. | ||
Slice(const std::vector<T> &data) : data_(data.data()), size_(data.size()) {} | ||
|
||
const T &operator[](size_t index) const { | ||
return data_[index]; | ||
} | ||
|
||
size_t size() const { | ||
return size_; | ||
} | ||
|
||
// "Iterators" | ||
const T *begin() const { | ||
return data_; | ||
} | ||
const T *end() const { | ||
return data_ + size_; | ||
} | ||
|
||
static Slice empty() { | ||
return Slice<T>(nullptr, 0); | ||
} | ||
|
||
bool is_empty() const { | ||
return size_ == 0; | ||
} | ||
|
||
private: | ||
const T *data_; | ||
size_t size_; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Hmm, seems like we'd need a Release() for this in the destructor of the pipeline?
-[Unknown]
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 is right! Thanks for the catch!