Fixes GLES compilation.

This commit is contained in:
Vladislav Belov 2025-01-04 15:13:10 +01:00 committed by Vladislav Belov
parent 88df5ec95f
commit 54701868da
3 changed files with 13 additions and 1 deletions

View file

@ -46,9 +46,11 @@ GLenum GetTargetFromBufferType(const IBuffer::Type type)
case IBuffer::Type::INDEX:
target = GL_ELEMENT_ARRAY_BUFFER;
break;
#if !CONFIG2_GLES
case IBuffer::Type::UNIFORM:
target = GL_UNIFORM_BUFFER;
break;
#endif
default:
target = GL_ARRAY_BUFFER;
break;

View file

@ -104,7 +104,11 @@ GLenum BufferTypeToGLTarget(const CBuffer::Type type)
target = GL_ELEMENT_ARRAY_BUFFER;
break;
case CBuffer::Type::UNIFORM:
#if !CONFIG2_GLES
target = GL_UNIFORM_BUFFER;
#else
debug_warn("Unsupported buffer type.");
#endif
break;
case CBuffer::Type::UPLOAD:
debug_warn("Unsupported buffer type.");
@ -1304,6 +1308,10 @@ void CDeviceCommandContext::InsertMemoryBarrier(
}
if (barriers)
glMemoryBarrier(barriers);
#else
UNUSED2(dstStageMask);
UNUSED2(srcAccessMask);
UNUSED2(dstAccessMask);
#endif
}

View file

@ -1039,8 +1039,10 @@ public:
ENSURE(this != previousShaderProgramGLSL);
glUseProgram(m_Program);
#if !CONFIG2_GLES
if (m_UniformBuffer)
glBindBufferBase(GL_UNIFORM_BUFFER, m_UniformBufferLocation, m_UniformBuffer->As<CBuffer>()->GetHandle());
#endif
if (previousShaderProgramGLSL)
{
@ -1485,7 +1487,7 @@ std::unique_ptr<CShaderProgram> CShaderProgram::Create(CDevice* device, const CS
const PS::StaticVector<std::tuple<VfsPath, GLenum>, 2> shaderStages{computeFile.empty()
? PS::StaticVector<std::tuple<VfsPath, GLenum>, 2>{{vertexFile, GL_VERTEX_SHADER}, {fragmentFile, GL_FRAGMENT_SHADER}}
: PS::StaticVector<std::tuple<VfsPath, GLenum>, 2>{{computeFile, GL_COMPUTE_SHADER}}};
#else
#else
const PS::StaticVector<std::tuple<VfsPath, GLenum>, 2> shaderStages{{{vertexFile, GL_VERTEX_SHADER}, {fragmentFile, GL_FRAGMENT_SHADER}}};
#endif