Estella 0.113.0
A fast 2D and 3D game engine powered by WebAssembly and ECS
Loading...
Searching...
No Matches
InstanceConstants.hpp
Go to the documentation of this file.
1// SPDX-License-Identifier: Apache-2.0
2// SPDX-FileCopyrightText: Copyright (c) 2024-present ESEngine Team
26#pragma once
27
28#include "../../core/Types.hpp"
29
30namespace esengine {
31
36inline constexpr u32 INSTANCE_CONSTANTS_BINDING = 8;
37
39inline constexpr const char* INSTANCE_CONSTANTS_BLOCK = "InstanceConstants";
40
42inline constexpr const char* INSTANCE_DATA_SAMPLER = "u_instanceData";
43
49 u32 pad[3]{};
50};
51
52static_assert(sizeof(InstanceConstants) == 16,
53 "InstanceConstants must be one vec4 to match std140");
54
56inline constexpr u32 MULTI_DRAW_MAX = 64;
57
64inline bool& glslMultiDraw() {
65 static bool on = false;
66 return on;
67}
68
69} // namespace esengine
Core type definitions and utilities for ESEngine.
bool & glslMultiDraw()
Whether this process's GLSL mesh programs count through a run's entries by gl_DrawID.
constexpr u32 MULTI_DRAW_MAX
The most draws one call may carry where the device draws runs (WEBGL_multi_draw).
constexpr const char * INSTANCE_DATA_SAMPLER
GLSL name of the record texture; pinned to its unit by Shader::compile.
std::uint32_t u32
Unsigned 32-bit integer.
Definition Types.hpp:45
constexpr const char * INSTANCE_CONSTANTS_BLOCK
GLSL block name; must match the injected mesh header + Shader::compile lookup.
constexpr u32 INSTANCE_CONSTANTS_BINDING
Indexed UBO binding point for the per-draw InstanceConstants block. Nine and not four: slot 4 is DRAW...
Where one draw's entry is: a texel of the record texture.