hello_world, but I don't see the Earth #1173
-
Hello, /home/mich/CLionProjects/hello_world/cmake-build-debug/hello_world
VUID-VkWriteDescriptorSet-descriptorType-00319(ERROR / SPEC): msgNum: -405619238 - Validation Error: [ VUID-VkWriteDescriptorSet-descriptorType-00319 ] Object 0: handle = 0x260000000026, type = VK_OBJECT_TYPE_DESCRIPTOR_SET; Object 1: handle = 0x1e000000001e, type = VK_OBJECT_TYPE_DESCRIPTOR_SET_LAYOUT; | MessageID = 0xe7d2bdda | vkUpdateDescriptorSets(): pDescriptorWrites[0].descriptorType (VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER) is different from pBinding[0].descriptorType (VK_DESCRIPTOR_TYPE_STORAGE_BUFFER) of VkDescriptorSet 0x260000000026[] allocated with VkDescriptorSetLayout 0x1e000000001e[]. The Vulkan spec states: descriptorType must match the type of dstBinding within dstSet (https://www.khronos.org/registry/vulkan/specs/1.3-extensions/html/vkspec.html#VUID-VkWriteDescriptorSet-descriptorType-00319)
Objects: 2
[0] 0x260000000026, type: 23, name: NULL
[1] 0x1e000000001e, type: 20, name: NULL
VUID-VkWriteDescriptorSet-descriptorType-00319(ERROR / SPEC): msgNum: -405619238 - Validation Error: [ VUID-VkWriteDescriptorSet-descriptorType-00319 ] Object 0: handle = 0x260000000026, type = VK_OBJECT_TYPE_DESCRIPTOR_SET; Object 1: handle = 0x1e000000001e, type = VK_OBJECT_TYPE_DESCRIPTOR_SET_LAYOUT; | MessageID = 0xe7d2bdda | vkUpdateDescriptorSets(): pDescriptorWrites[1].descriptorType (VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER) is different from pBinding[1].descriptorType (VK_DESCRIPTOR_TYPE_STORAGE_BUFFER) of VkDescriptorSet 0x260000000026[] allocated with VkDescriptorSetLayout 0x1e000000001e[]. The Vulkan spec states: descriptorType must match the type of dstBinding within dstSet (https://www.khronos.org/registry/vulkan/specs/1.3-extensions/html/vkspec.html#VUID-VkWriteDescriptorSet-descriptorType-00319)
Objects: 2
[0] 0x260000000026, type: 23, name: NULL
[1] 0x1e000000001e, type: 20, name: NULL
Process finished with exit code 0 I put the source code here: #include <vsg/all.h>
#include <vsgXchange/all.h>
int main( int, char** ) {
double radius = vsg::WGS_84_RADIUS_EQUATOR;
double nearFarRatio = 0.0001;
auto options = vsg::Options::create();
options->add(vsgXchange::all::create());
auto scene = vsg::TileDatabase::create();
scene->settings = vsg::createOpenStreetMapSettings(options);
scene->readDatabase(options);
auto viewer = vsg::Viewer::create();
auto windowTraits = vsg::WindowTraits::create();
windowTraits->debugLayer = true;
auto window = vsg::Window::create(windowTraits );
viewer->addWindow(window);
auto lookAt = vsg::LookAt::create( vsg::dvec3(0.0, -radius*4.5, 0.0 ), vsg::dvec3(0.0, 0.0, 0.0 ), vsg::dvec3(0.0, 0.0,0.1 ) );
auto perspective = vsg::Perspective::create( 30.0, static_cast<double>( window->extent2D().width ) / static_cast<double>( window->extent2D().height ), nearFarRatio * radius, radius * 4.5 );
auto camera = vsg::Camera::create( perspective, lookAt, vsg::ViewportState::create(window->extent2D() ) );
auto commandGraph = vsg::createCommandGraphForView( window, camera, scene );
viewer->addEventHandler(vsg::CloseHandler::create( viewer ) );
viewer->addEventHandler(vsg::Trackball::create( camera ) );
viewer->assignRecordAndSubmitTaskAndPresentation({commandGraph} );
viewer->compile();
while ( viewer->advanceToNextFrame() ) {
viewer->handleEvents();
viewer->update();
viewer->recordAndSubmit();
viewer->present();
}
return 0;
} Thanks a lot for your help! Michel Guenin |
Beta Was this translation helpful? Give feedback.
Replies: 14 comments
-
When you say hello_world do you mean the (vsgTutorial/1_SettingTheScene/01_hello_world/hello_world.cpp](https://github.com/vsg-dev/vsgTutorial/blob/master/1_SettingTheScene/01_hello_world/hello_world.cpp) from vsgTutorial? I ask this as I'm guessing it is, but others in the community that might read this post in the future might be confused. I have just compiled vsgTutorial's hello_world example on my Kubuntu 22.04 system with an AMD5700G and Mesa drivers, so this is what you should see once things are working: This example relies upon vsgXchange library and in particular the vsgXchange::curl ReaderWriter that uses libcurl to load the OpenStreetMap data over http in order to build the paged database you see above. It would be worth checking that your include/vsgXchange/Version.h includes #define vsgXchange_curl entry to say that libcurl-dev has been found and compiled into vsgXchange. This is what my include/vsgXchange/Version.h looks like: /* <editor-fold desc="MIT License">
Copyright(c) 2021 Robert Osfield
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
</editor-fold> */
#pragma once
#include <vsgXchange/Export.h>
#include <vsg/core/Version.h>
#ifdef __cplusplus
extern "C"
{
#endif
#define VSGXCHANGE_VERSION_MAJOR 1
#define VSGXCHANGE_VERSION_MINOR 1
#define VSGXCHANGE_VERSION_PATCH 1
#define VSGXCHANGE_SOVERSION 1
#define VSGXCHANGE_VERSION_STRING "1.1.1"
#define VSGXCHANGE_SOVERSION_STRING "1"
extern VSGXCHANGE_DECLSPEC struct VsgVersion vsgXchangeGetVersion();
extern VSGXCHANGE_DECLSPEC const char* vsgXchangeGetVersionString();
extern VSGXCHANGE_DECLSPEC const char* vsgXchangeGetSOVersionString();
/// return 0 if the linked vsgXchange was built as static library (default), 1 if the linked vsgXchange library was built as shared/dynamic library.
/// When building against a shared library, to ensure the correct selection of VSGXCHANGE_DECLSPEC (provided in vsgXchange/Export.h) one must compile with the define VSGXCHANGE_SHARED_LIBRARY
extern VSGXCHANGE_DECLSPEC int vsgXchangeBuiltAsSharedLibrary();
/// standard Features
#define vsgXchange_all
#define vsgXchange_images
#define vsgXchange_models
#define vsgXchange_stbi
#define vsgXchange_dds
#define vsgXchange_ktx
#define vsgXchange_spv
#define vsgXchange_cpp
/// optional Features
#define vsgXchange_curl
#define vsgXchange_openexr
#define vsgXchange_freetype
#define vsgXchange_assimp
#define vsgXchange_GDAL
#define vsgXchange_OSG
#ifdef __cplusplus
}
#endif I added enabling of the Vulkan Validation layer for debugging by adding windowTraits->debugLayer = true;: $ git diff
diff --git a/1_SettingTheScene/01_hello_world/hello_world.cpp b/1_SettingTheScene/01_hello_world/hello_world.cpp
index 94b09a5..3b58065 100644
--- a/1_SettingTheScene/01_hello_world/hello_world.cpp
+++ b/1_SettingTheScene/01_hello_world/hello_world.cpp
@@ -23,6 +23,8 @@ int main(int, char**)
// create window with default traits
auto windowTraits = vsg::WindowTraits::create();
+ windowTraits->debugLayer = true;
+
auto window = vsg::Window::create(windowTraits);
viewer->addWindow(window); And like you get an error: VUID-VkWriteDescriptorSet-descriptorType-00319(ERROR / SPEC): msgNum: -405619238 - Validation Error: [ VUID-VkWriteDescriptorSet-descriptorType-00319 ] Object 0: handle = 0xa2eb680000000026, type = VK_OBJECT_TYPE_DESCRIPTOR_SET; Object 1: handle = 0xcfcda0000000001e, type = VK_OBJECT_TYPE_DESCRIPTOR_SET_LAYOUT; | MessageID = 0xe7d2bdda | vkUpdateDescriptorSets(): pDescriptorWrites[0].descriptorType (VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER) is different from pBinding[0].descriptorType (VK_DESCRIPTOR_TYPE_STORAGE_BUFFER) of VkDescriptorSet 0xa2eb680000000026[] allocated with VkDescriptorSetLayout 0xcfcda0000000001e[]. The Vulkan spec states: descriptorType must match the type of dstBinding within dstSet (https://vulkan.lunarg.com/doc/view/1.3.268.0/linux/1.3-extensions/vkspec.html#VUID-VkWriteDescriptorSet-descriptorType-00319)
Objects: 2
[0] 0xa2eb680000000026, type: 23, name: NULL
[1] 0xcfcda0000000001e, type: 20, name: NULL
VUID-VkWriteDescriptorSet-descriptorType-00319(ERROR / SPEC): msgNum: -405619238 - Validation Error: [ VUID-VkWriteDescriptorSet-descriptorType-00319 ] Object 0: handle = 0xa2eb680000000026, type = VK_OBJECT_TYPE_DESCRIPTOR_SET; Object 1: handle = 0xcfcda0000000001e, type = VK_OBJECT_TYPE_DESCRIPTOR_SET_LAYOUT; | MessageID = 0xe7d2bdda | vkUpdateDescriptorSets(): pDescriptorWrites[1].descriptorType (VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER) is different from pBinding[1].descriptorType (VK_DESCRIPTOR_TYPE_STORAGE_BUFFER) of VkDescriptorSet 0xa2eb680000000026[] allocated with VkDescriptorSetLayout 0xcfcda0000000001e[]. The Vulkan spec states: descriptorType must match the type of dstBinding within dstSet (https://vulkan.lunarg.com/doc/view/1.3.268.0/linux/1.3-extensions/vkspec.html#VUID-VkWriteDescriptorSet-descriptorType-00319)
Objects: 2
[0] 0xa2eb680000000026, type: 23, name: NULL
[1] 0xcfcda0000000001e, type: 20, name: NULL Which looks like a regression due to some recent changes to the VSG's shadow mapping backend and the associated ShaderSets. While I get this error it doesn't appear to be causing any rendering problems on my system, so I suspect that if you aren't seeing anything then it's like an issue with not building vsgXchange against libcurl-dev. I will investigate the above regression, I suspect it's an inconsistency in the state setup. |
Beta Was this translation helpful? Give feedback.
-
As part of my investigation I tried the vsgpagedlod example from vsgExamples and it renders fine without any Vulkan debug messages being reported: vsgpagedlod --osm -d This example is not as bare bones as the hello_world in vsgTutorial but in essence does something similar. |
Beta Was this translation helpful? Give feedback.
-
Many thanks Robert. I just tried "vsgpagedlod --osm -d", but I got an error message: Warning: Could not create shaders. echo ${VSG_FILE_CACHE} = /home/mich/vsgFileCache and there are 48 files in: /home/mich/vsgExamples/data/shaders |
Beta Was this translation helpful? Give feedback.
-
I recompiled vsgXchange, and with the first example, it works great. I continue the adventure. Merci Robert. |
Beta Was this translation helpful? Give feedback.
-
I have tracked down the regression w.r.t Vulkan debug error and checked fixes into the VSG and vsgExamples. W.r.t env vars this is what I have on my system (excluding a few irrelevant ones) $ export | grep VSG
declare -x VSG_FILE_CACHE="/home/robert/Data/VsgFileCache"
declare -x VSG_FILE_PATH="/home/robert/Dev/vsgCs/data:/home/robert/Dev/vsgExamples/data:/home/robert/Dev/vsgPoints/data" I also have 48 files in vsgExampeles/data/shaders. At this point I can't spot an error in your setup. Could you try loading models with vsgviewer that is part of vsgExamples set. vsgviewer models/teapot.vsgt
vsgviewer models/openstreetmap.vsgt |
Beta Was this translation helpful? Give feedback.
-
vsgviewer models/teapot.vsgt : works well export | grep VSG no vsgFileCache directory in my home |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
Hi Robert, I have everything like you though: vsgpagedlod --osm -d Warning: Could not create shaders. Process finished with exit code 139 (interrupted by signal 11:SIGSEGV) it's blocked here: // load the root tile.
auto vsg_scene = vsg::read_cast<vsg::Node>("root.tile", options); |
Beta Was this translation helpful? Give feedback.
-
I'm on my laptop right now, which has VSG, vsgXchange and vsgExamples master. All my VSG related env vars are: $ export | grep VSG
declare -x VSG_DIR="/home/robert/Dev/VulkanSceneGraph"
declare -x VSG_EXAMPLES_DIR="/home/robert/Dev/vsgExamples"
declare -x VSG_FILE_CACHE="/home/robert/Data/VsgFileCache"
declare -x VSG_FILE_PATH="/home/robert/Dev/vsgExamples/data:" VSG_DIR and VSG_EXAMPLES_DIR are not used by the runtime, so aren't essential but can be useful for scripts. The VSG_FILE_CACHE is optional, and if present will be the directory that VSG's file cache will be placed in - as tiles are download from http they will be saved locally in this directory with their original remote paths and filenames. On subsequent loads when http calls are attempted the local file cache directory will be checked first and if locally present the local file will be loaded to cut load times. VSG_FILE_PATH is used by the examples to find example models, textures and shaders. Some examples just rely upon the Shaders/ShaderSets built-into the VSG library, but others like the vsgpagedlod which does all the scene graph creation itself use VSG_FILE_PATH to locate the shaders that it uses. With VSG_FILE_PATH set correctly then this is what I see in the console when I run vsgpagedlod: $ vsgpagedlod --osm -d
Warning: requested invalid layer : VK_LAYER_KHRONOS_validation
numOperationThreads = 0
numTilesRead = 3 I've been able to recreate the error you are reporting by invalidating the VSG_FILE_PATH so it no longer points to my vsgExamples/data directory. Then I get: $ vsgpagedlod --osm -d
Warning: Could not create shaders.
Segmentation fault (core dumped) I haven't looked into why it's segfaulting, my guess is that there is code that assuming that the shaders are there and not checking for failure. I will look into this. The vsgpagedlod is an old example, one I used as a testbed for writing the vsg::DatabasePager & vsg::PagedLOD and remains as a code example of how to create PagedLOD scene graphs. Now the VSG has vsg::TileDatabase as well that does all of what is done in vsgpagedlod example but is built into the core VSG. This provides a quick an easy way to pull in whole earth tiled imagery. In your case it's very likely the problem lies with your VSG_FILE_PATH not pointing to where your vsgExamples/data is located. Any fixes to make to vsgpagedload example to more gracefully handle failure to load the shaders won't fix the problem of loading the shaders if the VSG_FILE_PATH env var is wrong. |
Beta Was this translation helpful? Give feedback.
-
I have checked in changes to vsgpagedlod to gracefully handle the failure to find the shaders, with console output report details of what is being searched for and what VSG_FILE_PATH settings it's checked when searching. This is checked into vsgExamples master. |
Beta Was this translation helpful? Give feedback.
-
ok, thank you I'll move forward: I put in TileReader.cpp to put the shaders directory in the root of my project: vsg::ref_ptrvsg::StateGroup TileReader::createRoot() const
It seems that you have stopped placing tiles towards the poles? I will try to learn and use your excellent API. |
Beta Was this translation helpful? Give feedback.
-
This is a facet of the spherical-mercator (EPSG:3857) projection used by Google/Microsoft/OpenStreetMap etc. for this type of image/DEM data, the projection works well for most latitudes but the restriction is it doesn't extend to the poles. To create tiles at the poles for this projection we'd need to make up data that isn't provided by the source. If you are interested in whole earth databases then the vsg::TileDatabase will provide some basic capabilities but for more sophisticated support have a look a Rocky and vsgCs. |
Beta Was this translation helpful? Give feedback.
-
Hello Robert, Thanks for your help. I'm doing some research on Rocky, notably trying to install it on Ubuntu and I can't. But I copied the src/rocky source directory to put it in a CLion project called vsgTerra organized like this: vsgTerra :
the root cmake:
rocky's cmake :
I have compilation errors at 86%:
It looks like they didn't use your version of vsg. I corrected two includes which were in the wrong place. Sincerely |
Beta Was this translation helpful? Give feedback.
-
I don't have any role in the development of rocky, or experience with using it yet. For questions about building and using rocky you'll need to contact the authors. |
Beta Was this translation helpful? Give feedback.
When you say hello_world do you mean the (vsgTutorial/1_SettingTheScene/01_hello_world/hello_world.cpp](https://github.com/vsg-dev/vsgTutorial/blob/master/1_SettingTheScene/01_hello_world/hello_world.cpp) from vsgTutorial?
I ask this as I'm guessing it is, but others in the community that might read this post in the future might be confused.
I have just compiled vsgTutorial's hello_world example on my Kubuntu 22.04 system with an AMD5700G and Mesa drivers, so this is what you should see once things are working:
This example relies upon vsgXchange library and in particular the vsgXchange::curl ReaderWriter that uses libcurl to load the OpenStreetMap data over http in order to build the pa…