-
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
Vulkan: Depalettize in shaders #10911
Merged
Merged
Changes from 1 commit
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
29c41c6
Implement shader depal for Vulkan. See #10908. Bilinear filter not ye…
hrydgard 69bd427
Shader depal: Implement bilinear filtering.
hrydgard 81276c8
Fix various bugs.
hrydgard 413a204
Vulkan: Semi-gross hack that massively improves the perf of MGS2:Acid.
hrydgard 0ac6cea
Add a queue processing hack for Sonic Rivals too. Now it's fast.
hrydgard 0479255
Let's try it on SR2 as well.
hrydgard fb7a63b
Implement shader depal for GL as well, but disabled by default.
hrydgard f178906
Shader depal: fix bilinear filter coord
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
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 |
---|---|---|
|
@@ -10,6 +10,10 @@ | |
class VKRFramebuffer; | ||
struct VKRImage; | ||
|
||
enum { | ||
QUEUE_HACK_MGS2_ACID = 1, | ||
}; | ||
|
||
enum class VKRRenderCommand : uint8_t { | ||
BIND_PIPELINE, | ||
STENCIL, | ||
|
@@ -152,7 +156,9 @@ class VulkanQueueRunner { | |
backbuffer_ = fb; | ||
backbufferImage_ = img; | ||
} | ||
void RunSteps(VkCommandBuffer cmd, const std::vector<VKRStep *> &steps); | ||
|
||
// RunSteps can modify steps but will leave it in a valid state. | ||
void RunSteps(VkCommandBuffer cmd, std::vector<VKRStep *> &steps); | ||
void LogSteps(const std::vector<VKRStep *> &steps); | ||
|
||
void CreateDeviceObjects(); | ||
|
@@ -205,6 +211,10 @@ class VulkanQueueRunner { | |
return found; | ||
} | ||
|
||
void EnableHacks(uint32_t hacks) { | ||
hacksEnabled_ = hacks; | ||
} | ||
|
||
private: | ||
void InitBackbufferRenderPass(); | ||
|
||
|
@@ -223,6 +233,8 @@ class VulkanQueueRunner { | |
|
||
void ResizeReadbackBuffer(VkDeviceSize requiredSize); | ||
|
||
void ApplyMGSHack(std::vector<VKRStep *> &steps); | ||
|
||
static void SetupTransitionToTransferSrc(VKRImage &img, VkImageMemoryBarrier &barrier, VkPipelineStageFlags &stage, VkImageAspectFlags aspect); | ||
static void SetupTransitionToTransferDst(VKRImage &img, VkImageMemoryBarrier &barrier, VkPipelineStageFlags &stage, VkImageAspectFlags aspect); | ||
|
||
|
@@ -244,4 +256,7 @@ class VulkanQueueRunner { | |
VkDeviceMemory readbackMemory_ = VK_NULL_HANDLE; | ||
VkBuffer readbackBuffer_ = VK_NULL_HANDLE; | ||
VkDeviceSize readbackBufferSize_ = 0; | ||
|
||
// TODO: Enable based on compat.ini. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Outdated TODO? -[Unknown] There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Indeed. |
||
uint32_t hacksEnabled_ = 0; | ||
}; |
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.
In theory, since we render bind with UV, we may be able to detect if these copies are non-overlapping and do this in a general case, right?
-[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.
Yeah, it can definitely be done, might at some point. Not sure how many games benefit though, and it's more work :)