/* * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ #pragma once #include "ShaderProgramType.hpp" namespace OpenVulkano { struct PushConstantRange { ShaderProgramType::Type stageFlags; uint32_t offset, size; PushConstantRange(ShaderProgramType::Type stages, uint32_t offset, uint32_t size) : stageFlags(stages), offset(offset), size(size) {} PushConstantRange(uint32_t size, uint32_t offset = 0, ShaderProgramType::Type stages = ShaderProgramType::ALL_GRAPHICS) : stageFlags(stages), offset(offset), size(size) {} }; struct PushConstant : PushConstantRange { const void* data; PushConstant(ShaderProgramType::Type stages, uint32_t offset, uint32_t size, const void* data) : PushConstantRange(stages, offset, size), data(data) {} PushConstant(const void* data, uint32_t size, uint32_t offset = 0, ShaderProgramType::Type stages = ShaderProgramType::ALL_GRAPHICS) : PushConstantRange(stages, offset, size), data(data) {} }; }