Fixes GL internal format of textures in compute

In compute shaders load/store operations requires sized formats.
This commit is contained in:
Vladislav Belov 2026-07-28 23:32:23 +02:00
parent b3165505b6
commit e2f5b20922
No known key found for this signature in database
GPG key ID: 353545E45DB9CCB3
2 changed files with 7 additions and 1 deletions

View file

@ -215,7 +215,7 @@ void CPostprocManager::InitializePBR()
LOGWARNING("%s is unsupported", framebufferFormatName); LOGWARNING("%s is unsupported", framebufferFormatName);
} }
if (m_Device->GetCapabilities().computeShaders && m_Device->GetCapabilities().storage) if (m_Device->GetCapabilities().computeShaders)
{ {
m_ResolvePBRComputeTech = g_Renderer.GetShaderManager().LoadEffect(str_compute_resolve_pbr); m_ResolvePBRComputeTech = g_Renderer.GetShaderManager().LoadEffect(str_compute_resolve_pbr);
if (m_ResolvePBRComputeTech) if (m_ResolvePBRComputeTech)

View file

@ -174,6 +174,12 @@ std::unique_ptr<CTexture> CTexture::Create(
// pixel format. // pixel format.
GLenum pixelFormat = GL_RGBA; GLenum pixelFormat = GL_RGBA;
GLenum pixelType = GL_UNSIGNED_BYTE; GLenum pixelType = GL_UNSIGNED_BYTE;
#if !CONFIG2_GLES
// load/store operation requires sized formats. See Table 8.25:
// https://registry.khronos.org/OpenGL/specs/gl/glspec43.core.pdf
if (usage & ITexture::Usage::STORAGE)
internalFormat = GL_RGBA8;
#endif
switch (format) switch (format)
{ {
case Format::UNDEFINED: case Format::UNDEFINED: