VisuTwin Canvas
C++ 3D Engine — Metal Backend
Loading...
Searching...
No Matches
vulkanUniformBinder.h
Go to the documentation of this file.
1// SPDX-License-Identifier: Apache-2.0
2// Copyright 2025-2026 Arnis Lektauers
3//
4// Vulkan uniform binder — descriptor sets + push constants.
5//
6#pragma once
7
8#ifdef VISUTWIN_HAS_VULKAN
9
10#include <vulkan/vulkan.h>
11
13
14namespace visutwin::canvas
15{
16 class VulkanUniformBinder : public UniformBinder
17 {
18 public:
19 VulkanUniformBinder() = default;
20 ~VulkanUniformBinder() override = default;
21
22 void resetPassState() override;
23
24 [[nodiscard]] bool isMaterialChanged(const Material* mat) const override;
25
26 [[nodiscard]] Texture* envAtlasTexture() const override { return _envAtlasTexture; }
27 [[nodiscard]] Texture* skyboxCubeMapTexture() const override { return _skyboxCubeMapTexture; }
28 [[nodiscard]] Texture* shadowTexture() const override { return _shadowTexture; }
29 [[nodiscard]] Texture* localShadowTexture0() const override { return _localShadowTexture0; }
30 [[nodiscard]] Texture* localShadowTexture1() const override { return _localShadowTexture1; }
31 [[nodiscard]] Texture* omniShadowCube0() const override { return _omniShadowCube0; }
32 [[nodiscard]] Texture* omniShadowCube1() const override { return _omniShadowCube1; }
33
34 private:
35 Texture* _envAtlasTexture = nullptr;
36 Texture* _skyboxCubeMapTexture = nullptr;
37 Texture* _shadowTexture = nullptr;
38 Texture* _localShadowTexture0 = nullptr;
39 Texture* _localShadowTexture1 = nullptr;
40 Texture* _omniShadowCube0 = nullptr;
41 Texture* _omniShadowCube1 = nullptr;
42
43 bool _materialBoundThisPass = false;
44 const Material* _lastBoundMaterial = nullptr;
45 };
46}
47
48#endif // VISUTWIN_HAS_VULKAN