Skip to content

Added Uniform descriptor type#42

Closed
tomhog wants to merge 23 commits into
vsg-dev:masterfrom
tomhog:topic-multitexturing-ii
Closed

Added Uniform descriptor type#42
tomhog wants to merge 23 commits into
vsg-dev:masterfrom
tomhog:topic-multitexturing-ii

Conversation

@tomhog
Copy link
Copy Markdown
Contributor

@tomhog tomhog commented Mar 7, 2019

Pull Request Template

Description

The Uniform implements a DescriptorBuffer using a DataList of values and the bindingIndex etc. I've also added a UniformValue for convince. This is basically the same as Value only it allows structs as it doesn't implement the serialization of the value it stores. I've also added BasicUniformValue which does implement serialization and macroed all the basic types.

  • [x ] Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?

  • osg2vsg has been updated to use a Uniform to represent material data. The material struct is usable in the shader.

robertosfield and others added 23 commits February 28, 2019 10:39
…ateSet to be a vector of StateAttribute, with StaeAttribute generating the Descriptor
…data container that has a nested Implementation class to uses this data to create the appropriate the Vulkan object from this.
… and Descriptor classes to the new Inteface::Implementation paradigm.

Removed the StateAttribute/StateSet classes as these are no longer required with DescriptorSet/Descriptor taking on this role directly.
… PipelineLayout, ShadeerModule and related classes to work with the new Interface::Implemntation approach
…on of Context. Fixed conversion warning setting descriptorSetCount.
…eclaration of Context. Fixed conversion warning setting descriptorSetCount."

This reverts commit 4994377.
@vsg-dev
Copy link
Copy Markdown
Owner

vsg-dev commented Mar 7, 2019

@tomhog could you regenerate this PR related to the InterfaceImplementation branch as currently this PR is pulling in all my changes in the InterfaceImplementation branch,

@vsg-dev
Copy link
Copy Markdown
Owner

vsg-dev commented Mar 7, 2019

I have manually merged this PR into my local InterfaceImplementation branch and get just the changes made. I can potentially check in from there. I am getting compile errors though:
[ 33%] Building CXX object src/vsg/CMakeFiles/vsg.dir/platform/unix/Xcb_Window.cpp.o
In file included from /home/robert/Vulkan/VulkanSceneGraphPrototype/src/vsg/vk/Uniform.cpp:14:0:
/home/robert/Vulkan/VulkanSceneGraphPrototype/include/vsg/vk/Uniform.h: In member function ‘void vsg::BasicUniformValue::read(vsg::Input&)’:
/home/robert/Vulkan/VulkanSceneGraphPrototype/include/vsg/vk/Uniform.h:98:33: error: there are no arguments to ‘value’ that depend on a template parameter, so a declaration of ‘value’ must be available [-fpermissive]
input.read("Value", value());
^~~~~
/home/robert/Vulkan/VulkanSceneGraphPrototype/include/vsg/vk/Uniform.h:98:33: note: (if you use ‘-fpermissive’, G++ will accept your code, but allowing the use of an undeclared name is deprecated)
/home/robert/Vulkan/VulkanSceneGraphPrototype/include/vsg/vk/Uniform.h: In member function ‘void vsg::BasicUniformValue::write(vsg::Output&) const’:
/home/robert/Vulkan/VulkanSceneGraphPrototype/include/vsg/vk/Uniform.h:104:35: error: there are no arguments to ‘value’ that depend on a template parameter, so a declaration of ‘value’ must be available [-fpermissive]
output.write("Value", value());
^~~~~
src/vsg/CMakeFiles/vsg.dir/build.make:1622: recipe for target 'src/vsg/CMakeFiles/vsg.dir/vk/Uniform.cpp.o' failed
make[2]: *** [src/vsg/CMakeFiles/vsg.dir/vk/Uniform.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs....
CMakeFiles/Makefile2:277: recipe for target 'src/vsg/CMakeFiles/vsg.dir/all' failed
make[1]: *** [src/vsg/CMakeFiles/vsg.dir/all] Error 2
Makefile:129: recipe for target 'all' failed
make: *** [all] Error 2

@vsg-dev
Copy link
Copy Markdown
Owner

vsg-dev commented Mar 7, 2019

I have got it compiling with the follow change:
diff --git a/include/vsg/vk/Uniform.h b/include/vsg/vk/Uniform.h
index 503d125..91ee51d 100644
--- a/include/vsg/vk/Uniform.h
+++ b/include/vsg/vk/Uniform.h
@@ -95,13 +95,13 @@ namespace vsg
void read(Input& input) override
{
base_type::read(input);

  •        input.read("Value", value());
    
  •        input.read("Value", base_type::value());
       }
    
       void write(Output& output) const override
       {
           base_type::write(output);
    
  •        output.write("Value", value());
    
  •        output.write("Value", base_type::value());
       }
    
    };

I'll do a manual merge into new branch for the osg2vsg changes and play around with the new functionality.

@vsg-dev
Copy link
Copy Markdown
Owner

vsg-dev commented Mar 7, 2019

I have merged this PR and my change to the branch:

 https://github.com/vsg-dev/VulkanSceneGraphPrototype/tree/tomhog-topic-multitexturing-ii

I'll close this PR and work with the branch above.

@vsg-dev vsg-dev closed this Mar 7, 2019
@rainergericke rainergericke mentioned this pull request Nov 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants