question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Potential Marshaling issue in ImageBlit

See original GitHub issue

I’ve believe I’ve found the source of the problem at https://github.com/FacticiusVir/SharpVk/blob/73ede8512f3f58c07524b054e09f3a6877995396/src/SharpVk/ImageBlit.gen.cs#L77

While writing an app I got this error;

[Warning]       vkCmdBlitImage: pRegions[0].srcOffsets specify a zero-volume area.


[Warning]       vkCmdBlitImage: pRegions[0].dstOffsets specify a zero-volume area.


[Error] 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 spec valid usage text states 'If the calling command's srcImage is of type VK_IMAGE_TYPE_1D or VK_IMAGE_TYPE_2D, then srcOffset[0].z must be 0 and srcOffset[1].z must be 1.'
(https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageBlit-srcImage-00247)


[Error] 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 spec valid usage text states 'If the calling command's dstImage is of type VK_IMAGE_TYPE_1D or VK_IMAGE_TYPE_2D, then dstOffset[0].z must be 0 and dstOffset[1].z must be 1.'
(https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageBlit-dstImage-00252)

Using the debugger I have determined that this is not in fact true, as the values are {{0, 0, 0}, {401, 377, 1}} and {{0, 0, 0}, {401, 377, 1}} respectively. Perhaps I am misinterpreting things, but the code at https://github.com/FacticiusVir/SharpVk/blob/73ede8512f3f58c07524b054e09f3a6877995396/src/SharpVk/ImageBlit.gen.cs#L77 does not appear to marshal the srcOffset or dstOffset values.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:14 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
FacticiusVircommented, Jan 19, 2018

Hey, thanks for spotting this; looks like the MarshalTo actions for fixed-length non-primitive (e.g. not int, float, etc) array fields was missing.

And it’s fair about the generator, I need to sit down and write out some proper documentation for it 😄 For issues like this (around the marshalling of fields or method parameters) the behaviour is typically under https://github.com/FacticiusVir/SharpVk/tree/master/src/SharpVk.Generator/Generation/Marshalling - in this case, under the FixedLengthMemberPattern.

0reactions
SinnersSumitcommented, Apr 7, 2018

I can confirm it is working now.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Untitled
Marshal.Alloc (allocaBytes) import GHC.IO (throwIO) import GHC. ... Copy regions of an image, potentially performing -- format conversion, ...
Read more >
Load average inexplicably high with 5.0 kernel on rpi
I've seen this on rpi2, as well as rpi3 with both armhf and arm64 using the disco release candidate. After booting, the load...
Read more >
Linux GPU Driver Developer's Guide
Developers interested in helping out with the DRM subsystem are very welcome. Often people will resort to sending in patches for various issues...
Read more >
Linux Gpu Documentation
The Linux DRM layer contains code intended to support the needs of complex graphics devices, usually containing programmable pipelines well ...
Read more >
Untitled
Nintendo gameboy advance sp unboxing, John o'malley us marshal, Lavender chalcedony properties ... Cigognes d'alsace, Ge logiq s7 manual, Pyglet image blit, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found