Allow shader to define the depth compare operator

This commit is contained in:
Georg Hagen
2024-07-30 22:16:00 +02:00
parent ce1b52c130
commit b079221322
4 changed files with 16 additions and 3 deletions

View File

@@ -40,6 +40,18 @@ namespace OpenVulkano::Scene
PATCH_LIST
};
enum class CompareOp : uint32_t
{
NEVER = 0,
LESS = 1,
EQUAL = 2,
LESS_OR_EQUAL = 3,
GREATER = 4,
NOT_EQUAL = 5,
GREATER_OR_EQUAL = 6,
ALWAYS = 7
};
struct ShaderProgram
{
ShaderProgramType type;
@@ -77,6 +89,7 @@ namespace OpenVulkano::Scene
Topology topology = Topology::TRIANGLE_LIST;
CullMode cullMode = CullMode::BACK;
ICloseable* renderShader = nullptr;
CompareOp depthCompareOp = CompareOp::LESS;
bool alphaBlend = false; // TODO allow fine control over blending
bool depthTest = true;
bool depthWrite = true;