Add initial support for compute pipelines

This commit is contained in:
SirLynix
2022-12-24 11:54:55 +01:00
committed by Jérôme Leclercq
parent e4064997d8
commit 9578ba3ef5
57 changed files with 915 additions and 182 deletions

View File

@@ -229,6 +229,7 @@ namespace Nz
{
switch (stageType)
{
case nzsl::ShaderStageType::Compute: return GL_COMPUTE_SHADER;
case nzsl::ShaderStageType::Fragment: return GL_FRAGMENT_SHADER;
case nzsl::ShaderStageType::Vertex: return GL_VERTEX_SHADER;
}
@@ -255,6 +256,19 @@ namespace Nz
return {};
}
inline GLenum ToOpenGL(TextureAccess textureAccess)
{
switch (textureAccess)
{
case TextureAccess::ReadOnly: return GL_READ_ONLY;
case TextureAccess::ReadWrite: return GL_READ_WRITE;
case TextureAccess::WriteOnly: return GL_WRITE_ONLY;
}
NazaraError("Unhandled TextureAccess 0x" + NumberToString(UnderlyingCast(textureAccess), 16));
return {};
}
inline GLenum ToOpenGL(GL::BufferTarget bufferTarget)
{
switch (bufferTarget)