vsg: include/vsg/commands/DrawIndexedIndirectCommand.h Source File

vsg 1.1.13 VulkanSceneGraph library

Loading...
Searching...
No Matches
DrawIndexedIndirectCommand.h
1#pragma once
2
3/* <editor-fold desc="MIT License">
4
5Copyright(c) 2025 Robert Osfield
6
7Permission 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:
8
9The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
10
11THE 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.
12
13</editor-fold> */
14
15#include <vsg/commands/Command.h>
16#include <vsg/state/BufferInfo.h>
17#include <vsg/vk/CommandBuffer.h>
18
19namespace vsg
20{
22 struct DrawIndexedIndirectCommand
23 {
24 uint32_t indexCount = 0;
25 uint32_t instanceCount = 0;
26 uint32_t firstIndex = 0;
27 int32_t vertexOffset = 0;
28 uint32_t firstInstance = 0;
29
30 void read(vsg::Input& input)
31 {
32 input.read("indexCount", indexCount);
33 input.read("instanceCount", instanceCount);
34 input.read("firstIndex", firstIndex);
35 input.read("vertexOffset", vertexOffset);
36 input.read("firstInstance", firstInstance);
37 }
38
39 void write(vsg::Output& output) const
40 {
41 output.write("indexCount", indexCount);
42 output.write("instanceCount", instanceCount);
43 output.write("firstIndex", firstIndex);
44 output.write("vertexOffset", vertexOffset);
45 output.write("firstInstance", firstInstance);
46 }
47 };
48
49 template<>
50 constexpr bool has_read_write<DrawIndexedIndirectCommand>() { return true; }
51
52 VSG_array(DrawIndexedIndirectCommandArray, DrawIndexedIndirectCommand);
53
54} // namespace vsg
vsg::Input
Definition Input.h:44
vsg::Output
Definition Output.h:41
vsg::Output::write
virtual void write(size_t num, const int8_t *value)=0
write contiguous array of value(s)
vsg::DrawIndexedIndirectCommand
Equivalent to VkDrawIndexedIndirectCommand that adds read/write support.
Definition DrawIndexedIndirectCommand.h:23