Skip to content

Commit d12429a

Browse files
TextureBaseGL: don't use auto where unnecessary
1 parent bb5614a commit d12429a

File tree

1 file changed

+18
-18
lines changed

1 file changed

+18
-18
lines changed

Graphics/GraphicsEngineOpenGL/src/TextureBaseGL.cpp

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -401,11 +401,11 @@ void TextureBaseGL::CreateViewInternal(const TextureViewDesc& OrigViewDesc, ITex
401401

402402
try
403403
{
404-
auto ViewDesc = OrigViewDesc;
404+
TextureViewDesc ViewDesc = OrigViewDesc;
405405
ValidatedAndCorrectTextureViewDesc(m_Desc, ViewDesc);
406406

407-
auto* pDeviceGLImpl = GetDevice();
408-
auto& TexViewAllocator = pDeviceGLImpl->GetTexViewObjAllocator();
407+
RenderDeviceGLImpl* pDeviceGLImpl = GetDevice();
408+
FixedBlockMemoryAllocator& TexViewAllocator = pDeviceGLImpl->GetTexViewObjAllocator();
409409
VERIFY(&TexViewAllocator == &m_dbgTexViewObjAllocator, "Texture view allocator does not match allocator provided during texture initialization");
410410

411411
// http://www.opengl.org/wiki/Texture_Storage#Texture_views
@@ -495,9 +495,9 @@ void TextureBaseGL::CreateViewInternal(const TextureViewDesc& OrigViewDesc, ITex
495495

496496
if (!IsIdentityComponentMapping(ViewDesc.Swizzle))
497497
{
498-
auto pDeviceContext = pDeviceGLImpl->GetImmediateContext(0);
498+
RefCntAutoPtr<DeviceContextGLImpl> pDeviceContext = pDeviceGLImpl->GetImmediateContext(0);
499499
VERIFY(pDeviceContext, "Immediate device context has been destroyed");
500-
auto& GLState = pDeviceContext->GetContextState();
500+
GLContextState& GLState = pDeviceContext->GetContextState();
501501

502502
GLState.BindTexture(-1, GLViewTarget, pViewOGL->GetHandle());
503503
glTexParameteri(GLViewTarget, GL_TEXTURE_SWIZZLE_R, TextureComponentSwizzleToGLTextureSwizzle(ViewDesc.Swizzle.R, GL_RED));
@@ -555,7 +555,7 @@ void TextureBaseGL::CreateViewInternal(const TextureViewDesc& OrigViewDesc, ITex
555555
}
556556
catch (const std::runtime_error&)
557557
{
558-
const auto* ViewTypeName = GetTexViewTypeLiteralName(OrigViewDesc.ViewType);
558+
const char* ViewTypeName = GetTexViewTypeLiteralName(OrigViewDesc.ViewType);
559559
LOG_ERROR("Failed to create view '", (OrigViewDesc.Name ? OrigViewDesc.Name : ""), "' (", ViewTypeName, ") for texture '", (m_Desc.Name ? m_Desc.Name : ""), "'");
560560
}
561561
}
@@ -584,7 +584,7 @@ void TextureBaseGL::UpdateData(GLContextState& CtxState, Uint32 MipLevel, Uint32
584584

585585
inline GLbitfield GetFramebufferCopyMask(TEXTURE_FORMAT Format)
586586
{
587-
const auto& FmtAttribs = GetTextureFormatAttribs(Format);
587+
const TextureFormatAttribs& FmtAttribs = GetTextureFormatAttribs(Format);
588588
switch (FmtAttribs.ComponentType)
589589
{
590590
case COMPONENT_TYPE_DEPTH:
@@ -607,7 +607,7 @@ void TextureBaseGL::CopyData(DeviceContextGLImpl* pDeviceCtxGL,
607607
Uint32 DstY,
608608
Uint32 DstZ)
609609
{
610-
const auto& SrcTexDesc = pSrcTextureGL->GetDesc();
610+
const TextureDesc& SrcTexDesc = pSrcTextureGL->GetDesc();
611611

612612
Box SrcBox;
613613
if (pSrcBox == nullptr)
@@ -665,7 +665,7 @@ void TextureBaseGL::CopyData(DeviceContextGLImpl* pDeviceCtxGL,
665665
bool UseBlitFramebuffer = IsDefaultBackBuffer;
666666
if (!UseBlitFramebuffer && m_pDevice->GetDeviceInfo().Type == RENDER_DEVICE_TYPE_GLES)
667667
{
668-
const auto& FmtAttribs = GetTextureFormatAttribs(m_Desc.Format);
668+
const TextureFormatAttribs& FmtAttribs = GetTextureFormatAttribs(m_Desc.Format);
669669
if (FmtAttribs.ComponentType == COMPONENT_TYPE_DEPTH ||
670670
FmtAttribs.ComponentType == COMPONENT_TYPE_DEPTH_STENCIL)
671671
{
@@ -675,10 +675,10 @@ void TextureBaseGL::CopyData(DeviceContextGLImpl* pDeviceCtxGL,
675675
}
676676
#endif
677677

678-
auto& GLState = pDeviceCtxGL->GetContextState();
678+
GLContextState& GLState = pDeviceCtxGL->GetContextState();
679679

680680
// Copy operations (glCopyTexSubImage* and glBindFramebuffer) are affected by scissor test!
681-
auto ScissorEnabled = GLState.GetScissorTestEnabled();
681+
bool ScissorEnabled = GLState.GetScissorTestEnabled();
682682
if (ScissorEnabled)
683683
GLState.EnableScissorTest(false);
684684

@@ -689,12 +689,12 @@ void TextureBaseGL::CopyData(DeviceContextGLImpl* pDeviceCtxGL,
689689
{
690690
// Get read framebuffer for the source subimage
691691

692-
auto& FBOCache = m_pDevice->GetFBOCache(GLState.GetCurrentGLContext());
692+
FBOCache& FboCache = m_pDevice->GetFBOCache(GLState.GetCurrentGLContext());
693693
VERIFY_EXPR(SrcSlice == 0 || SrcTexDesc.IsArray());
694694
VERIFY_EXPR((pSrcBox->MinZ == 0 && DepthSlice == 0) || SrcTexDesc.Is3D());
695-
const auto SrcFramebufferSlice = SrcSlice + pSrcBox->MinZ + DepthSlice;
695+
const Uint32 SrcFramebufferSlice = SrcSlice + pSrcBox->MinZ + DepthSlice;
696696
// NOTE: GetFBO may bind a framebuffer, so we need to invalidate it in the GL context state.
697-
const auto& ReadFBO = FBOCache.GetFBO(pSrcTextureGL, SrcFramebufferSlice, SrcMipLevel, TextureBaseGL::FRAMEBUFFER_TARGET_FLAG_READ);
697+
const GLObjectWrappers::GLFrameBufferObj& ReadFBO = FboCache.GetFBO(pSrcTextureGL, SrcFramebufferSlice, SrcMipLevel, TextureBaseGL::FRAMEBUFFER_TARGET_FLAG_READ);
698698

699699
SrcFboHandle = ReadFBO;
700700
}
@@ -728,12 +728,12 @@ void TextureBaseGL::CopyData(DeviceContextGLImpl* pDeviceCtxGL,
728728
{
729729
// Get draw framebuffer for the destination subimage
730730

731-
auto& FBOCache = m_pDevice->GetFBOCache(GLState.GetCurrentGLContext());
731+
FBOCache& FboCache = m_pDevice->GetFBOCache(GLState.GetCurrentGLContext());
732732
VERIFY_EXPR(DstSlice == 0 || m_Desc.IsArray());
733733
VERIFY_EXPR((DstZ == 0 && DepthSlice == 0) || m_Desc.Is3D());
734-
const auto DstFramebufferSlice = DstSlice + DstZ + DepthSlice;
734+
const Uint32 DstFramebufferSlice = DstSlice + DstZ + DepthSlice;
735735
// NOTE: GetFBO may bind a framebuffer, so we need to invalidate it in the GL context state.
736-
const auto& DrawFBO = FBOCache.GetFBO(this, DstFramebufferSlice, DstMipLevel, TextureBaseGL::FRAMEBUFFER_TARGET_FLAG_DRAW);
736+
const GLObjectWrappers::GLFrameBufferObj& DrawFBO = FboCache.GetFBO(this, DstFramebufferSlice, DstMipLevel, TextureBaseGL::FRAMEBUFFER_TARGET_FLAG_DRAW);
737737

738738
DstFboHandle = DrawFBO;
739739
}
@@ -743,7 +743,7 @@ void TextureBaseGL::CopyData(DeviceContextGLImpl* pDeviceCtxGL,
743743
DEV_CHECK_ERR(glCheckFramebufferStatus(GL_DRAW_FRAMEBUFFER) == GL_FRAMEBUFFER_COMPLETE,
744744
"Draw framebuffer is incomplete: ", GetFramebufferStatusString(glCheckFramebufferStatus(GL_DRAW_FRAMEBUFFER)));
745745

746-
const auto CopyMask = GetFramebufferCopyMask(SrcTexDesc.Format);
746+
const GLbitfield CopyMask = GetFramebufferCopyMask(SrcTexDesc.Format);
747747
DEV_CHECK_ERR(CopyMask == GetFramebufferCopyMask(m_Desc.Format),
748748
"Src and dst framebuffer copy masks must be the same");
749749
glBlitFramebuffer(pSrcBox->MinX,

0 commit comments

Comments
 (0)