D3D12, GL: Fixed write-only color render targets. (#4099)

This commit is contained in:
Branimir Karadžić
2026-10-27 19:15:20 +00:00
committed by GitHub
parent 695330f321
commit 66f6e9780d
2 changed files with 14 additions and 11 deletions
+5 -2
View File
@@ -7271,8 +7271,11 @@ namespace bgfx { namespace d3d12
if (writeOnly)
{
resourceDesc.Flags |= D3D12_RESOURCE_FLAG_DENY_SHADER_RESOURCE;
state &= ~D3D12_RESOURCE_STATE_PIXEL_SHADER_RESOURCE;
resourceDesc.Flags |= depth
? D3D12_RESOURCE_FLAG_DENY_SHADER_RESOURCE
: D3D12_RESOURCE_FLAG_NONE
;
state &= ~D3D12_RESOURCE_STATE_PIXEL_SHADER_RESOURCE;
}
if (computeWrite)
+9 -9
View File
@@ -8151,16 +8151,16 @@ namespace bgfx { namespace gl
{
const TextureGL& texture = s_renderGL->m_textures[at.handle.idx];
GLenum attachment = attachmentFor(TextureFormat::Enum(texture.m_textureFormat) );
if (GL_COLOR_ATTACHMENT0 == attachment)
{
attachment = GL_COLOR_ATTACHMENT0 + colorIdx;
++colorIdx;
}
if (0 != texture.m_rbo && 0 != texture.m_id)
{
GLenum attachment = attachmentFor(TextureFormat::Enum(texture.m_textureFormat) );
if (GL_COLOR_ATTACHMENT0 == attachment)
{
attachment = GL_COLOR_ATTACHMENT0 + colorIdx;
++colorIdx;
}
GLenum target = texture.isCubeMap()
? GL_TEXTURE_CUBE_MAP_POSITIVE_X + at.layer
: texture.m_target
@@ -8533,7 +8533,7 @@ namespace bgfx { namespace gl
bimg::TextureFormat::Enum format = bimg::TextureFormat::Enum(texture.m_textureFormat);
if (!bimg::isDepth(format)
&& 0 == texture.m_rbo)
&& (0 == texture.m_rbo || 0 == texture.m_id) )
{
colorIdx++;
}