Skip to content

Commit

Permalink
Hydrogent: set array size to 1 in default atlas desc
Browse files Browse the repository at this point in the history
  • Loading branch information
TheMostDiligent committed Oct 15, 2024
1 parent 2f35855 commit 5f46655
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Hydrogent/src/HnMaterial.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -952,7 +952,7 @@ bool HnMaterial::UpdateSRB(HnRenderDelegate& RendererDelegate)
{
TEXTURE_FORMAT AtlasFmt = AtlasFormats[AtlasId];
VERIFY_EXPR(AtlasFormatIds.find(AtlasFmt)->second == AtlasId);
auto* pAtlasTexture = RendererDelegate.GetResourceManager().GetTexture(AtlasFmt);
ITexture* pAtlasTexture = RendererDelegate.GetResourceManager().GetTexture(AtlasFmt);
VERIFY_EXPR(pAtlasTexture != nullptr);
TexArray[AtlasId] = pAtlasTexture;
}
Expand Down
5 changes: 5 additions & 0 deletions Hydrogent/src/HnRenderDelegate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,11 @@ static RefCntAutoPtr<GLTF::ResourceManager> CreateResourceManager(const HnRender
ResMgrCI.DefaultAtlasDesc.Desc.BindFlags = BIND_SHADER_RESOURCE;
ResMgrCI.DefaultAtlasDesc.Desc.Width = TextureAtlasDim;
ResMgrCI.DefaultAtlasDesc.Desc.Height = TextureAtlasDim;
// Ensure that the atlas will have at least one slice the first time it is updated.
// Since textures are loaded asynchronously, no texture may be loaded during the first update
// and RendererDelegate.GetResourceManager().GetTexture(AtlasFmt) in HnMaterial::UpdateSRB() will
// return null.
ResMgrCI.DefaultAtlasDesc.Desc.ArraySize = 1;
ResMgrCI.DefaultAtlasDesc.Desc.MipLevels = 6;
ResMgrCI.DefaultAtlasDesc.GrowthFactor = 1.25f;
ResMgrCI.DefaultAtlasDesc.MinAlignment = 64;
Expand Down

0 comments on commit 5f46655

Please sign in to comment.