Add RHI texture upload and descriptor set fixes
This commit is contained in:
@@ -82,6 +82,7 @@ bool OpenGLResourceView::IsValid() const {
|
||||
case ResourceViewType::DepthStencil:
|
||||
return m_framebufferID != 0;
|
||||
case ResourceViewType::ShaderResource:
|
||||
return m_texture != nullptr && m_texture->GetID() != 0;
|
||||
case ResourceViewType::UnorderedAccess:
|
||||
return m_texture != nullptr && m_textureUnit >= 0;
|
||||
case ResourceViewType::ConstantBuffer:
|
||||
@@ -129,12 +130,7 @@ bool OpenGLResourceView::InitializeAsShaderResource(
|
||||
OpenGLTexture* texture,
|
||||
const ResourceViewDesc& desc,
|
||||
OpenGLTextureUnitAllocator* allocator) {
|
||||
if (!texture || !allocator) {
|
||||
return false;
|
||||
}
|
||||
|
||||
int32_t unit = allocator->Allocate();
|
||||
if (unit < 0) {
|
||||
if (!texture) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -142,9 +138,8 @@ bool OpenGLResourceView::InitializeAsShaderResource(
|
||||
m_format = static_cast<Format>(desc.format);
|
||||
m_dimension = desc.dimension;
|
||||
m_texture = texture;
|
||||
m_textureUnit = unit;
|
||||
m_textureUnit = -1;
|
||||
m_textureUnitAllocator = allocator;
|
||||
allocator->BindTexture(unit, texture);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user