mirror of
https://github.com/bkaradzic/bgfx.git
synced 2026-10-29 12:15:30 +00:00
D3D12, GL: Fixed write-only color render targets. (#4099)
This commit is contained in:
@@ -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
@@ -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++;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user