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

[vk] Check for BGRA8 linear image to support blitting #5092

Merged
merged 2 commits into from
Sep 7, 2018

Conversation

kvark
Copy link
Contributor

@kvark kvark commented Sep 6, 2018

The result of upload_image_simple is used as a blit source, so we need to make sure it's possible.

@@ -1043,6 +1043,11 @@ namespace vk

vk::image *upload_image_simple(vk::command_buffer& cmd, u32 address, u32 width, u32 height)
{
if (!m_formats_support.bgra8_linear_blit)
{
return NULL;
Copy link
Contributor

Choose a reason for hiding this comment

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

Return 'nullptr' for consistency. Also add a space between // and comment body. It was decided as the preferred method for new code and also makes clang-format happy

@kvark
Copy link
Contributor Author

kvark commented Sep 7, 2018

@kd-11 thanks for the review! comments are addressed now.
Also renamed the variable to just bgra8_linear since the other ones also check for blit support and the don't reflect that with _blit suffix.

@kd-11
Copy link
Contributor

kd-11 commented Sep 7, 2018

Its ok now. Its quite strange to have a GPU with the BGRA8 format not usable as a blit source, I wonder how many other formats cannot be easily copied to the backbuffer via blitting.

@kvark
Copy link
Contributor Author

kvark commented Sep 7, 2018

@kd-11
Copying is fine, it's the blitting that's not so easy. Blitting is different in that it requires a graphics queue, and can be implemented under the hood as a graphics operation.

Also, it's not BGRA8 that is problematic but the fact of placing it in HOST_VISIBLE memory (with linear tiling). Vulkan baseline requirements for HOST_VISIBLE images are super low, e.g. only 2D with a few formats, and they aren't required to support any graphics operations. Basically, they are glorified staging buffers, and that's how Metal portability backend implements them. Hence, they can only be used in transfers.

@kd-11
Copy link
Contributor

kd-11 commented Sep 7, 2018

Also, it's not BGRA8 that is problematic but the fact of placing it in HOST_VISIBLE memory.

Makes sense, otherwise it would have been strange as drivers often just implement blitting with a full-quad pass which would have made the user-side implementation of the same redundant. Thanks for that clearing up.

@kd-11 kd-11 merged commit 4e09573 into RPCS3:master Sep 7, 2018
@kvark kvark deleted the vk-bgra8-linear branch September 7, 2018 20:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants