vsg-dev / vsgExamples

Example programs that test and illustrate how to use the VSG and optional add-on libraries
MIT License
148 stars 67 forks source link

vsginput doesn't draw anything #27

Closed sbrkopac closed 4 years ago

sbrkopac commented 5 years ago

When running vsginput there is nothing drawing. If I attempt to type some text, I can see the the dispatch firing. When running with --debug flag I get the following:

layer=VK_LAYER_NV_optimus
layer=VK_LAYER_RENDERDOC_Capture
layer=VK_LAYER_VALVE_steam_overlay
layer=VK_LAYER_VALVE_steam_fossilize
layer=VK_LAYER_LUNARG_api_dump
layer=VK_LAYER_LUNARG_assistant_layer
layer=VK_LAYER_LUNARG_core_validation
layer=VK_LAYER_LUNARG_device_simulation
layer=VK_LAYER_KHRONOS_validation
layer=VK_LAYER_LUNARG_monitor
layer=VK_LAYER_LUNARG_object_tracker
layer=VK_LAYER_LUNARG_screenshot
layer=VK_LAYER_LUNARG_standard_validation
layer=VK_LAYER_LUNARG_parameter_validation
layer=VK_LAYER_GOOGLE_threading
layer=VK_LAYER_GOOGLE_unique_objects
layer=VK_LAYER_LUNARG_vktrace
valid requested layer : VK_LAYER_LUNARG_standard_validation
layer=VK_LAYER_NV_optimus
layer=VK_LAYER_RENDERDOC_Capture
layer=VK_LAYER_VALVE_steam_overlay
layer=VK_LAYER_VALVE_steam_fossilize
layer=VK_LAYER_LUNARG_api_dump
layer=VK_LAYER_LUNARG_assistant_layer
layer=VK_LAYER_LUNARG_core_validation
layer=VK_LAYER_LUNARG_device_simulation
layer=VK_LAYER_KHRONOS_validation
layer=VK_LAYER_LUNARG_monitor
layer=VK_LAYER_LUNARG_object_tracker
layer=VK_LAYER_LUNARG_screenshot
layer=VK_LAYER_LUNARG_standard_validation
layer=VK_LAYER_LUNARG_parameter_validation
layer=VK_LAYER_GOOGLE_threading
layer=VK_LAYER_GOOGLE_unique_objects
layer=VK_LAYER_LUNARG_vktrace
valid requested layer : VK_LAYER_LUNARG_standard_validation
UNASSIGNED-CoreValidation-MemTrack-InvalidMap(ERROR / SPEC): msgNum: 0 - VkMapMemory: Attempting to map memory range of size zero
    Objects: 1
        [0] 0x25, type: 8, name: NULL
VUID-vkUnmapMemory-memory-00689(ERROR / SPEC): msgNum: 0 - Unmapping Memory without memory being mapped: mem obj 0x25. The Vulkan spec states: memory must be currently host mapped (https://www.khronos.org/registry/vulkan/specs/1.1-extensions/html/vkspec.html#VUID-vkUnmapMemory-memory-00689)
    Objects: 1
        [0] 0x25, type: 8, name: NULL
VUID-VkImageCreateInfo-extent-00945(ERROR / SPEC): msgNum: 0 - vkCreateImage: parameter pCreateInfo->extent.height (= 0) is greater than 0 The Vulkan spec states: extent::height must be greater than 0. (https://www.khronos.org/registry/vulkan/specs/1.1-extensions/html/vkspec.html#VUID-VkImageCreateInfo-extent-00945)
    Objects: 1
        [0] 0, type: 10, name: NULL
VUID-VkImageCreateInfo-extent-00946(ERROR / SPEC): msgNum: 0 - vkCreateImage: parameter pCreateInfo->extent.depth (= 0) is greater than 0 The Vulkan spec states: extent::depth must be greater than 0. (https://www.khronos.org/registry/vulkan/specs/1.1-extensions/html/vkspec.html#VUID-VkImageCreateInfo-extent-00946)
    Objects: 1
        [0] 0, type: 10, name: NULL
VUID-VkImageCreateInfo-imageType-00957(ERROR / SPEC): msgNum: 0 - vkCreateImage(): if pCreateInfo->imageType is VK_IMAGE_TYPE_2D, pCreateInfo->extent.depth must be 1. The Vulkan spec states: If imageType is VK_IMAGE_TYPE_2D, extent.depth must be 1 (https://www.khronos.org/registry/vulkan/specs/1.1-extensions/html/vkspec.html#VUID-VkImageCreateInfo-imageType-00957)
    Objects: 1
        [0] 0, type: 0, name: NULL
VUID-VkBufferImageCopy-srcImage-00201(ERROR / SPEC): msgNum: 0 - vkCmdCopyBufferToImage(): pRegion[0] imageOffset.z is 0 and imageExtent.depth is 0. For 1D and 2D images these must be 0 and 1, respectively. The Vulkan spec states: If the calling command's srcImage (vkCmdCopyImageToBuffer) or dstImage (vkCmdCopyBufferToImage) is of type VK_IMAGE_TYPE_1D or VK_IMAGE_TYPE_2D, then imageOffset.z must be 0 and imageExtent.depth must be 1 (https://www.khronos.org/registry/vulkan/specs/1.1-extensions/html/vkspec.html#VUID-VkBufferImageCopy-srcImage-00201)
    Objects: 1
        [0] 0x2d, type: 10, name: NULL

I'm using VulkanSceneGraph master.

rainergericke commented 4 years ago

I have the same problem on the Mac and on Windows10. On both systems I get the message after startup: Could not read font texture file : fonts/roboto.vsgb The robot.vsgb exists yet. The environment variable VSG_FILE_PATH is also set correctly on both machines. It looks for me that VSG_FILE_PATH is actually not considered by the examples. While I could call: osgviewer cessna.osg I have to set the complete path for the model when using vsgviewer like: vsgviewer data/models/teapot.vsgb

robertosfield commented 4 years ago

vsginput has been rendering blank for a while now, but as I'm not the author of this particular example I haven't been able to just dive in know what to tweak and get it working again. In principle it's meant to render text adding new text to the scene in response to keyboard input - hence the vsginput name.

The core VSG itself has moved on quite a bit since this example was written, so it's likely there are now better ways of doing things that this example utilizes. My plan has been to write a new vsginput from scratch using the latest VSG classes and refactor parts of the VSG to make the dynamic update side that vsginput explores more seamless.

It may even be appropriate to integrate text support in the core VSG or in a companion library. It may also make sense to just remove the existing non functioning vsginput from master so others don't get confused by it.

robertosfield commented 4 years ago

I'm closing this PR as vsginput has been removed. The text part of this example is now done in the core VSG's new vsg::Text class.

rainergericke commented 4 years ago

Right. The new text output looks pretty good!