mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-27 14:22:13 +00:00
- 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.
This commit is contained in:
parent
7de9e1f097
commit
69a3271440
2 changed files with 7 additions and 24 deletions
|
@ -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;i<mTextureLayers.Size();i++)
|
||||
{
|
||||
FTexture *layer;
|
||||
if (mTextureLayers[i].animated)
|
||||
{
|
||||
FTextureID id = mTextureLayers[i].texture->id;
|
||||
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;
|
||||
|
|
|
@ -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<FTextureLayer> mTextureLayers;
|
||||
TArray<FTexture*> 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
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue