VenomEngine
Cross-Platform Modern Graphics Engine
Loading...
Searching...
No Matches
ShaderResourceTable.h
Go to the documentation of this file.
1
8#pragma once
13
14
15// @brief Means that all model matrices will be located in a packed buffer
16#define VENOM_EXTERNAL_PACKED_MODEL_MATRIX
17
18// @brief Means that all textures will be bindless, MoltenVk only allows for small amounts of bindless textures
19#ifndef __APPLE__
20#define VENOM_BINDLESS_TEXTURES
21#endif
22
23namespace venom
24{
25namespace common
26{
27
29{
30public:
32 ~ShaderResourceTable() override;
33
34 enum SetsIndex
35 {
36 SETS_INDEX_MODEL_MATRICES = 0,
37 SETS_INDEX_CAMERA = 1,
38 SETS_INDEX_TEXTURES = 2,
39 SETS_INDEX_SAMPLER = 3,
40 SETS_INDEX_MATERIAL = 4,
41 SETS_INDEX_SCENE = 5,
42 SETS_INDEX_PANORAMA = 6,
43 SETS_INDEX_LIGHT = 7,
44 };
45
47 {
48 public:
49 Descriptor();
51 };
52
53 static void UpdateDescriptor(const SetsIndex index, const int binding, const void * data, const size_t size, const size_t offset = 0);
54
55#ifdef VENOM_EXTERNAL_PACKED_MODEL_MATRIX
56 static vcm::Mat4 * GetAllModelMatrixBuffer();
57 static vcm::Mat4 * GetModelMatrixBuffer();
58 static inline size_t GetAllModelMatrixBytesSize() { return VENOM_MAX_ENTITIES * sizeof(vcm::Mat4); }
59 static void ReleaseModelMatrixBuffer(const vcm::Mat4 * mat);
60 static int GetModelMatrixBufferId(const vcm::Mat4 * mat);
61#endif
62
63 static int BindTexture();
64 static void UnbindTexture(int id);
65 static void SetMaxTextures(uint32_t maxTextures);
66 static inline int GetMaxTextures() { return __maxTextures; }
67 static bool UsingLargeBindlessTextures() { return __maxTextures == VENOM_MAX_BINDLESS_TEXTURES; }
68
69private:
70 virtual void __UpdateDescriptor(const SetsIndex index, const int binding, const void * data, const size_t size, const size_t offset = 0) = 0;
71
72private:
73 static int __maxTextures;
74};
75}
76}
Base class for graphics plugin objects.
Definition GraphicsPluginObject.h:80
Definition ShaderResourceTable.h:47
Definition ShaderResourceTable.h:29
Contains the entirety of the code of the VenomEngine project.
Definition Config.h:13