From 69a327144059b58e9a195696a68f5ace9803f9e9 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sat, 14 Jul 2018 12:10:41 +0200 Subject: [PATCH] - removed the unused feature to allow animated material layers. This was a relic from trying to support ZDoomGL's texture shader system but would make texture management with Vulkan significantly more complicated because it would require dynamic descriptor set management for textures which can cause a lot of overhead. --- src/hwrenderer/textures/hw_material.cpp | 20 +++++--------------- src/hwrenderer/textures/hw_material.h | 11 ++--------- 2 files changed, 7 insertions(+), 24 deletions(-) diff --git a/src/hwrenderer/textures/hw_material.cpp b/src/hwrenderer/textures/hw_material.cpp index 6e31226a43..cca6c9b2a8 100644 --- a/src/hwrenderer/textures/hw_material.cpp +++ b/src/hwrenderer/textures/hw_material.cpp @@ -158,7 +158,7 @@ FMaterial::FMaterial(FTexture * tx, bool expanded) { if(texture == nullptr) continue; ValidateSysTexture(texture, expanded); - mTextureLayers.Push({ texture, false }); + mTextureLayers.Push(texture); } mShaderIndex = tx->shaderindex; } @@ -169,7 +169,7 @@ FMaterial::FMaterial(FTexture * tx, bool expanded) for (auto &texture : { tx->Normal, tx->Specular }) { ValidateSysTexture(texture, expanded); - mTextureLayers.Push({ texture, false }); + mTextureLayers.Push(texture); } mShaderIndex = SHADER_Specular; } @@ -178,7 +178,7 @@ FMaterial::FMaterial(FTexture * tx, bool expanded) for (auto &texture : { tx->Normal, tx->Metallic, tx->Roughness, tx->AmbientOcclusion }) { ValidateSysTexture(texture, expanded); - mTextureLayers.Push({ texture, false }); + mTextureLayers.Push(texture); } mShaderIndex = SHADER_PBR; } @@ -187,8 +187,7 @@ FMaterial::FMaterial(FTexture * tx, bool expanded) if (tx->Brightmap != NULL) { ValidateSysTexture(tx->Brightmap, expanded); - FTextureLayer layer = {tx->Brightmap, false}; - mTextureLayers.Push(layer); + mTextureLayers.Push(tx->Brightmap); if (mShaderIndex == SHADER_Specular) mShaderIndex = SHADER_SpecularBrightmap; else if (mShaderIndex == SHADER_PBR) @@ -448,16 +447,7 @@ void FMaterial::Bind(int clampmode, int translation) { for(unsigned i=0;iid; - layer = TexMan(id); - } - else - { - layer = mTextureLayers[i].texture; - } + FTexture *layer = mTextureLayers[i]; auto systex = ValidateSysTexture(layer, mExpanded); systex->BindOrCreate(layer, i+1, clampmode, 0, mExpanded ? CTF_Expand : 0); maxbound = i+1; diff --git a/src/hwrenderer/textures/hw_material.h b/src/hwrenderer/textures/hw_material.h index 3ee1d935ce..7a3b2f391c 100644 --- a/src/hwrenderer/textures/hw_material.h +++ b/src/hwrenderer/textures/hw_material.h @@ -52,12 +52,6 @@ class FMaterial { friend class FRenderState; - struct FTextureLayer - { - FTexture *texture; - bool animated; - }; - // This array is needed because not all textures are managed by the texture manager // but some code needs to discard all hardware dependent data attached to any created texture. // Font characters are not, for example. @@ -65,7 +59,7 @@ class FMaterial static int mMaxBound; IHardwareTexture *mBaseLayer; - TArray mTextureLayers; + TArray mTextureLayers; int mShaderIndex; short mLeftOffset; @@ -95,9 +89,8 @@ public: void PrecacheList(SpriteHits &translations); void AddTextureLayer(FTexture *tex) { - FTextureLayer layer = { tex, false }; ValidateTexture(tex, false); - mTextureLayers.Push(layer); + mTextureLayers.Push(tex); } bool isMasked() const {