2222#include < utils/BitmaskEnum.h>
2323#include < utils/unwindows.h> // Because we define ERROR in the FenceStatus enum.
2424
25+ #include < backend/Platform.h>
2526#include < backend/PresentCallable.h>
2627
28+ #include < utils/Invocable.h>
2729#include < utils/ostream.h>
2830
2931#include < math/vec4.h>
3032
3133#include < array> // FIXME: STL headers are not allowed in public headers
3234#include < type_traits> // FIXME: STL headers are not allowed in public headers
35+ #include < variant> // FIXME: STL headers are not allowed in public headers
3336
3437#include < stddef.h>
3538#include < stdint.h>
@@ -90,12 +93,15 @@ static constexpr uint64_t SWAP_CHAIN_HAS_STENCIL_BUFFER = SWAP_CHAIN_CON
9093 */
9194static constexpr uint64_t SWAP_CHAIN_CONFIG_PROTECTED_CONTENT = 0x40 ;
9295
93-
9496static constexpr size_t MAX_VERTEX_ATTRIBUTE_COUNT = 16 ; // This is guaranteed by OpenGL ES.
9597static constexpr size_t MAX_SAMPLER_COUNT = 62 ; // Maximum needed at feature level 3.
9698static constexpr size_t MAX_VERTEX_BUFFER_COUNT = 16 ; // Max number of bound buffer objects.
9799static constexpr size_t MAX_SSBO_COUNT = 4 ; // This is guaranteed by OpenGL ES.
98100
101+ static constexpr size_t MAX_PUSH_CONSTANT_COUNT = 32 ; // Vulkan 1.1 spec allows for 128-byte
102+ // of push constant (we assume 4-byte
103+ // types).
104+
99105// Per feature level caps
100106// Use (int)FeatureLevel to index this array
101107static constexpr struct {
@@ -112,7 +118,7 @@ static_assert(MAX_VERTEX_BUFFER_COUNT <= MAX_VERTEX_ATTRIBUTE_COUNT,
112118 " The number of buffer objects that can be attached to a VertexBuffer must be "
113119 " less than or equal to the maximum number of vertex attributes." );
114120
115- static constexpr size_t CONFIG_UNIFORM_BINDING_COUNT = 10 ; // This is guaranteed by OpenGL ES.
121+ static constexpr size_t CONFIG_UNIFORM_BINDING_COUNT = 9 ; // This is guaranteed by OpenGL ES.
116122static constexpr size_t CONFIG_SAMPLER_BINDING_COUNT = 4 ; // This is guaranteed by OpenGL ES.
117123
118124/* *
@@ -331,7 +337,7 @@ enum class UniformType : uint8_t {
331337/* *
332338 * Supported constant parameter types
333339 */
334- enum class ConstantType : uint8_t {
340+ enum class ConstantType : uint8_t {
335341 INT,
336342 FLOAT,
337343 BOOL
@@ -686,7 +692,7 @@ enum class TextureUsage : uint16_t {
686692 SUBPASS_INPUT = 0x0020 , // !< Texture can be used as a subpass input
687693 BLIT_SRC = 0x0040 , // !< Texture can be used the source of a blit()
688694 BLIT_DST = 0x0080 , // !< Texture can be used the destination of a blit()
689- PROTECTED = 0x0100 , // !< Texture can be used the destination of a blit()
695+ PROTECTED = 0x0100 , // !< Texture can be used for protected content
690696 DEFAULT = UPLOADABLE | SAMPLEABLE // !< Default texture usage
691697};
692698
@@ -1218,13 +1224,15 @@ struct StencilState {
12181224 uint8_t padding = 0 ;
12191225};
12201226
1227+ using PushConstantVariant = std::variant<int32_t , float , bool >;
1228+
12211229static_assert (sizeof (StencilState::StencilOperations) == 5u ,
12221230 " StencilOperations size not what was intended" );
12231231
12241232static_assert (sizeof (StencilState) == 12u ,
12251233 " StencilState size not what was intended" );
12261234
1227- using FrameScheduledCallback = void (*)( PresentCallable callable, void * user) ;
1235+ using FrameScheduledCallback = utils::Invocable< void (backend:: PresentCallable)> ;
12281236
12291237enum class Workaround : uint16_t {
12301238 // The EASU pass must split because shader compiler flattens early-exit branch
@@ -1243,13 +1251,7 @@ enum class Workaround : uint16_t {
12431251 POWER_VR_SHADER_WORKAROUNDS,
12441252};
12451253
1246- // ! The type of technique for stereoscopic rendering
1247- enum class StereoscopicType : uint8_t {
1248- // Stereoscopic rendering is performed using instanced rendering technique.
1249- INSTANCED,
1250- // Stereoscopic rendering is performed using the multiview feature from the graphics backend.
1251- MULTIVIEW,
1252- };
1254+ using StereoscopicType = backend::Platform::StereoscopicType;
12531255
12541256} // namespace filament::backend
12551257
0 commit comments