Bug 246376 - devel/vulkan-validation-layers: throws error with valid GLFW usage
Summary: devel/vulkan-validation-layers: throws error with valid GLFW usage
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Jan Beich
URL:
Keywords: patch
Depends on:
Blocks:
 
Reported: 2020-05-11 16:53 UTC by beldin
Modified: 2021-01-06 18:56 UTC (History)
2 users (show)

See Also:
jbeich: maintainer-feedback+
jbeich: merge-quarterly+


Attachments
Patch (1.25 KB, patch)
2020-05-11 16:54 UTC, beldin
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description beldin 2020-05-11 16:53:48 UTC
Using validation layers produces erros (and potentially segfaults) for valid usage when using GLFW. 

Error that results:

VUID_Undefined(ERROR / SPEC): msgNum: 0 - Instance Extension VK_KHR_xcb_surface is not supported by this layer.  Using this extension may adversely affect validation results and/or produce undefined behavior.
    Objects: 1
        [0] 0, type: 0, name: NULL
VUID-vkGetPhysicalDeviceSurfaceSupportKHR-surface-parameter(ERROR / SPEC): msgNum: 0 - Invalid SurfaceKHR Object 0x80098b020. The Vulkan spec states: surface must be a valid VkSurfaceKHR handle (https://www.khronos.org/registry/vulkan/specs/1.1-extensions/html/vkspec.html#VUID-vkGetPhysicalDeviceSurfaceSupportKHR-surface-parameter)

Removing the CMAKE_OFF settings got X11 and XCB and providing options copied from the graphics/vulkan-loader seems to provide a least suprising solution (defaulting these 2 options to off leaves behaviour as before).

This has been tested for compiling for all 4 option combinations also.

(I'm sure the wayland option could also be transferred but testing that is outside my configuration)
Comment 1 beldin 2020-05-11 16:54:28 UTC
Created attachment 214380 [details]
Patch
Comment 2 commit-hook freebsd_committer freebsd_triage 2021-01-06 18:45:42 UTC
A commit references this bug:

Author: jbeich
Date: Wed Jan  6 18:45:35 UTC 2021
New revision: 560551
URL: https://svnweb.freebsd.org/changeset/ports/560551

Log:
  graphics/vulkan-validation-layers: minor cleanup

  - Expose WSI support[1]
  - Update description
  - Convert to USES=xorg
  - Prefer standard _DESC
  - Simplify _DEPENDS
  - Drop excessive newlines

  PR:		246376 [1]
  Submitted by:	beldin@beldin.org (based on) [1]

Changes:
  head/graphics/vulkan-validation-layers/Makefile
  head/graphics/vulkan-validation-layers/pkg-descr
Comment 3 commit-hook freebsd_committer freebsd_triage 2021-01-06 18:49:44 UTC
A commit references this bug:

Author: jbeich
Date: Wed Jan  6 18:49:26 UTC 2021
New revision: 560555
URL: https://svnweb.freebsd.org/changeset/ports/560555

Log:
  MFH: r560551

  graphics/vulkan-validation-layers: minor cleanup

  - Expose WSI support[1]
  - Update description
  - Convert to USES=xorg
  - Prefer standard _DESC
  - Simplify _DEPENDS
  - Drop excessive newlines

  PR:		246376 [1]
  Submitted by:	beldin@beldin.org (based on) [1]

Changes:
_U  branches/2021Q1/
  branches/2021Q1/graphics/vulkan-validation-layers/Makefile
  branches/2021Q1/graphics/vulkan-validation-layers/pkg-descr
Comment 4 Jan Beich freebsd_committer freebsd_triage 2021-01-06 18:56:31 UTC
Thanks for the patch. I could reproduce (see below) but was confused by "WSI_* in here are leftover ..." comment.

$ VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation vkcube-wayland
VUID-vkGetPhysicalDeviceSurfaceSupportKHR-surface-parameter(ERROR / SPEC): msgNum: -2145442690 - Validation Error: [ VUID-vkGetPhysicalDeviceSurfaceSupportKHR-surface-parameter ] Object 0: VK_NULL_HANDLE, type = VK_OBJECT_TYPE_INSTANCE; | MessageID = 0x801f247e | Invalid VkSurfaceKHR Object 0x800a22360. The Vulkan spec states: surface must be a valid VkSurfaceKHR handle (https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VUID-vkGetPhysicalDeviceSurfaceSupportKHR-surface-parameter)
    Objects: 1
        [0] 0, type: 1, name: NULL
Assertion failed: (object_table.contains(object)), function FindObject, file Vulkan-ValidationLayers-1.2.165/layers/generated/thread_safety.h, line 144.