GithubHelp home page GithubHelp logo

Comments (29)

robertosfield avatar robertosfield commented on September 27, 2024

from vsgexamples.

rainergericke avatar rainergericke commented on September 27, 2024

Hi Robert,

thank you for the hints, I will try it.

Appened is the message from the windows version with '-d' flag.
win_message.txt

Best
Rainer

from vsgexamples.

robertosfield avatar robertosfield commented on September 27, 2024

from vsgexamples.

rainergericke avatar rainergericke commented on September 27, 2024

Hi Robert,

here come the Mac results. I user the '-d' flag here also. Switching off the blitter code, the program still works but changes the background color.

The CAMetalLayer related message always occurs, but does hopefully no harm.

Best

Rainer
mac_blitter_message.txt
mac_noblitter_message.txt
screenimage_mac_blitter
screenimage_mac_noblitter
screenshot_mac_blitter.vsgt.zip
screenshot_mac_noblitter.vsgt.zip

from vsgexamples.

rainergericke avatar rainergericke commented on September 27, 2024

...the color seems to be switched, when no blitter is active.

from vsgexamples.

rainergericke avatar rainergericke commented on September 27, 2024

Hi Robert,

I found a screenshot example, which works on Mac and on Windows. It is part of Sascha Willems vulkan examples.
[(https://github.com/SaschaWillems/Vulkan.git)]
I looked at the save_screenshot() code and compared it to the code in the vsgscreenshot example. I see some differences regarding parameters like 'VK_QUEUE_FAMILY_IGNORED', but I am not an expert to say what is wrong. Maybe this example can help you?

from vsgexamples.

robertosfield avatar robertosfield commented on September 27, 2024

from vsgexamples.

rainergericke avatar rainergericke commented on September 27, 2024

Hi Robert,

this is a Windows issue, but I know, your answer will be the same for the same reasons. I will try what is possible. I am excited to see the new core features yet!

from vsgexamples.

robertosfield avatar robertosfield commented on September 27, 2024

@rainergericke Did you uncover what is happening with the screenshot issue under Windows?

from vsgexamples.

rainergericke avatar rainergericke commented on September 27, 2024

No, I pushed it behind several times. It would be good to have this problem resolved yet. Do you have time to help?

from vsgexamples.

rainergericke avatar rainergericke commented on September 27, 2024

I have a prelaminary solution for Windows:

  1. Ignore Blitting support
  2. Consider color swizzle and non contiguity

As attachment you find my screenshot function for Windows. The output code was taken from Sascha Willems screenshot example, only meant as a demo, but working
exportScreenshotNoBlit.cpp.zip
.

from vsgexamples.

robertosfield avatar robertosfield commented on September 27, 2024

from vsgexamples.

rainergericke avatar rainergericke commented on September 27, 2024

I didn't change the Vulkan code, it should be identical.

Using your code on the Mac with blitting switched off, you can see the image but in wrong colors, so it is necessary to retrieve information about color swizzle. Using the code on Windows seems to have right colors, but the image is scrambled because the data is not contiguous. So it is better to consider both.

PPM expects RGB, also stb want RGBA.

from vsgexamples.

robertosfield avatar robertosfield commented on September 27, 2024

from vsgexamples.

robertosfield avatar robertosfield commented on September 27, 2024

To make it easier to write images I've created a stbi_write branch of vsgXchange, and have add stb_image_write.h as a first step to adding support for writing image formats:

[https://github.com/vsg-dev/vsgXchange/tree/stbi_write](https://github.com/vsg-dev/vsgXchange/tree/stbi_write)

I will now figure out how to use the stbi_image_write API, I don't expect it'll be too hard.

from vsgexamples.

robertosfield avatar robertosfield commented on September 27, 2024

from vsgexamples.

robertosfield avatar robertosfield commented on September 27, 2024

I have added swizzling from BGR and BGRA to RGB and RGBA respectively:

Added support for swizzling image format to handle BGR and BGRA formats

I will do a code review and then if it looks OK merge with vsgXchange master.

from vsgexamples.

robertosfield avatar robertosfield commented on September 27, 2024

The png, jpeg, bmp and tga write support for RGB, RGBA, BGR and BGRA, the later with a locally implemented swizzle is now merged into vsgXchange master.

from vsgexamples.

rainergericke avatar rainergericke commented on September 27, 2024

Great! It is easy to use. It works well on the Mac. On Windows there is still a bug with blit support enabled, which leads to an one-colored graphic file (all formats, vsg* included). Disabling the blitter makes it run well. I will use this function in my software.

from vsgexamples.

robertosfield avatar robertosfield commented on September 27, 2024

Could you try running vsgscreeenshot with debug layer enabled i.e.

vsgscreenshot models/lz.vsgt --cf screenshot.png -d

On Windows and macOS? I'd like to get to bottom of the issue with the blitting.

from vsgexamples.

robertosfield avatar robertosfield commented on September 27, 2024

I have just run vsgscreenshot with debugging on and see errors, so I have something to look into at my end.

$ vsgscreenshot models/lz.vsgt -d
depthStencilResolve_properites.supportedDepthResolveModes = 15
depthStencilResolve_properites.supportedStencilResolveModes = 13
depthStencilResolve_properites.independentResolveNone = 1
depthStencilResolve_properites.independentResolve = 1
info: supportsBlit = 1
VUID-vkCmdBlitImage-srcImage-00247(ERROR / SPEC): msgNum: 1607722825 - Validation Error: [ VUID-vkCmdBlitImage-srcImage-00247 ] Object 0: handle = 0x556b8b9b4130, type = VK_OBJECT_TYPE_COMMAND_BUFFER; | MessageID = 0x5fd3e749 | vkCmdBlitImage: region [0], source image of type VK_IMAGE_TYPE_1D or VK_IMAGE_TYPE_2D with srcOffset[].z values of (0, 0). These must be (0, 1). The Vulkan spec states: If srcImage is of type VK_IMAGE_TYPE_1D or VK_IMAGE_TYPE_2D, then for each element of pRegions, srcOffsets[0].z must be 0 and srcOffsets[1].z must be 1 (https://vulkan.lunarg.com/doc/view/1.3.216.0/linux/1.3-extensions/vkspec.html#VUID-vkCmdBlitImage-srcImage-00247)
Objects: 1
[0] 0x556b8b9b4130, type: 6, name: NULL
VUID-vkCmdBlitImage-dstImage-00252(ERROR / SPEC): msgNum: -657803409 - Validation Error: [ VUID-vkCmdBlitImage-dstImage-00252 ] Object 0: handle = 0x556b8b9b4130, type = VK_OBJECT_TYPE_COMMAND_BUFFER; | MessageID = 0xd8cab76f | vkCmdBlitImage: region [0], dest image of type VK_IMAGE_TYPE_1D or VK_IMAGE_TYPE_2D with dstOffset[].z values of (0, 0). These must be (0, 1). The Vulkan spec states: If dstImage is of type VK_IMAGE_TYPE_1D or VK_IMAGE_TYPE_2D, then for each element of pRegions, dstOffsets[0].z must be 0 and dstOffsets[1].z must be 1 (https://vulkan.lunarg.com/doc/view/1.3.216.0/linux/1.3-extensions/vkspec.html#VUID-vkCmdBlitImage-dstImage-00252)
Objects: 1
[0] 0x556b8b9b4130, type: 6, name: NULL
Written color buffer to screenshot.vsgt
num_unset_depth = 1276732
num_set_depth = 33988
Written depth buffer to depth.vsgt

from vsgexamples.

rainergericke avatar rainergericke commented on September 27, 2024

This is the Mac answer (Windows will follow soon):
rainerge@RainersacStudio VSG2 % vsgscreenshot models/lz.vsgt -d
depthStencilResolve_properites.supportedDepthResolveModes = 13
depthStencilResolve_properites.supportedStencilResolveModes = 1
depthStencilResolve_properites.independentResolveNone = 1
depthStencilResolve_properites.independentResolve = 1
VUID-vkCreateEvent-events-04468(ERROR / SPEC): msgNum: 2064270843 - Validation Error: [ VUID-vkCreateEvent-events-04468 ] Object 0: handle = 0x143045e18, type = VK_OBJECT_TYPE_DEVICE; | MessageID = 0x7b0a45fb | vkCreateEvent: events are not supported via VK_KHR_portability_subset The Vulkan spec states: If the VK_KHR_portability_subset extension is enabled, and VkPhysicalDevicePortabilitySubsetFeaturesKHR::events is VK_FALSE, then the implementation does not support events, and vkCreateEvent must not be used (https://vulkan.lunarg.com/doc/view/1.3.216.0/mac/1.3-extensions/vkspec.html#VUID-vkCreateEvent-events-04468)
Objects: 1
[0] 0x143045e18, type: 3, name: NULL

from vsgexamples.

robertosfield avatar robertosfield commented on September 27, 2024

from vsgexamples.

rainergericke avatar rainergericke commented on September 27, 2024

It's Vulkan 1.3.216.0.

Windows doesn't tell us to much:
windows_scrshot.txt

from vsgexamples.

robertosfield avatar robertosfield commented on September 27, 2024

from vsgexamples.

robertosfield avatar robertosfield commented on September 27, 2024

from vsgexamples.

rainergericke avatar rainergericke commented on September 27, 2024

Looks good!
screenshot_mac.vsgt.zip
screenshot_win.vsgt.zip

from vsgexamples.

robertosfield avatar robertosfield commented on September 27, 2024

from vsgexamples.

rainergericke avatar rainergericke commented on September 27, 2024

Yes, we can close it. Thanks!

from vsgexamples.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.