mirror of
https://gitea.wildfiregames.com/0ad/0ad.git
synced 2026-09-21 20:06:40 +00:00
Fixes GL internal format of textures in compute
In compute shaders load/store operations requires sized formats.
This commit is contained in:
@@ -215,7 +215,7 @@ void CPostprocManager::InitializePBR()
|
||||
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);
|
||||
if (m_ResolvePBRComputeTech)
|
||||
|
||||
@@ -174,6 +174,12 @@ std::unique_ptr<CTexture> CTexture::Create(
|
||||
// pixel format.
|
||||
GLenum pixelFormat = GL_RGBA;
|
||||
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)
|
||||
{
|
||||
case Format::UNDEFINED:
|
||||
|
||||
Reference in New Issue
Block a user