diff --git a/source/renderer/backend/gl/DeviceCommandContext.cpp b/source/renderer/backend/gl/DeviceCommandContext.cpp index 7e8157ca6b..3d13256c38 100644 --- a/source/renderer/backend/gl/DeviceCommandContext.cpp +++ b/source/renderer/backend/gl/DeviceCommandContext.cpp @@ -1257,11 +1257,17 @@ void CDeviceCommandContext::Dispatch( const uint32_t groupCountY, const uint32_t groupCountZ) { +#if !CONFIG2_GLES ENSURE(m_InsideComputePass); glDispatchCompute(groupCountX, groupCountY, groupCountZ); // TODO: we might want to do binding tracking to avoid redundant barriers. glMemoryBarrier( GL_SHADER_IMAGE_ACCESS_BARRIER_BIT | GL_TEXTURE_FETCH_BARRIER_BIT | GL_TEXTURE_UPDATE_BARRIER_BIT | GL_FRAMEBUFFER_BARRIER_BIT); +#else + UNUSED2(groupCountX); + UNUSED2(groupCountY); + UNUSED2(groupCountZ); +#endif } void CDeviceCommandContext::SetTexture(const int32_t bindingSlot, ITexture* texture) @@ -1308,6 +1314,7 @@ void CDeviceCommandContext::SetTexture(const int32_t bindingSlot, ITexture* text void CDeviceCommandContext::SetStorageTexture(const int32_t bindingSlot, ITexture* texture) { +#if !CONFIG2_GLES ENSURE(m_ShaderProgram); ENSURE(texture); ENSURE(texture->GetUsage() & Renderer::Backend::ITexture::Usage::STORAGE); @@ -1319,6 +1326,10 @@ void CDeviceCommandContext::SetStorageTexture(const int32_t bindingSlot, ITextur ENSURE(textureUnit.type == GL_IMAGE_2D); ENSURE(texture->GetFormat() == Format::R8G8B8A8_UNORM); glBindImageTexture(textureUnit.unit, texture->As()->GetHandle(), 0, GL_FALSE, 0, GL_READ_WRITE, GL_RGBA8); +#else + UNUSED2(bindingSlot); + UNUSED2(texture); +#endif } void CDeviceCommandContext::SetUniform( diff --git a/source/renderer/backend/gl/ShaderProgram.cpp b/source/renderer/backend/gl/ShaderProgram.cpp index 5c7f2731fd..67806d70b2 100644 --- a/source/renderer/backend/gl/ShaderProgram.cpp +++ b/source/renderer/backend/gl/ShaderProgram.cpp @@ -675,9 +675,11 @@ public: case GL_FRAGMENT_SHADER: stageDefine = "STAGE_FRAGMENT"; break; +#if !CONFIG2_GLES case GL_COMPUTE_SHADER: stageDefine = "STAGE_COMPUTE"; break; +#endif default: break; } @@ -1341,6 +1343,7 @@ std::unique_ptr CShaderProgram::Create(CDevice* device, const CS if (isGLSL) { +#if !CONFIG2_GLES if (!computeFile.empty()) { ENSURE(streamFlags == 0); @@ -1349,6 +1352,10 @@ std::unique_ptr CShaderProgram::Create(CDevice* device, const CS const PS::StaticVector, 2> shaderStages{computeFile.empty() ? PS::StaticVector, 2>{{vertexFile, GL_VERTEX_SHADER}, {fragmentFile, GL_FRAGMENT_SHADER}} : PS::StaticVector, 2>{{computeFile, GL_COMPUTE_SHADER}}}; +#else + const PS::StaticVector, 2> shaderStages{{{vertexFile, GL_VERTEX_SHADER}, {fragmentFile, GL_FRAGMENT_SHADER}}}; +#endif + return std::make_unique( device, name, xmlFilename, shaderStages, defines, vertexAttribs, streamFlags);