Rendering statistics view (#3322)
Co-authored-by: Bart Louwers <bart@emeel.net>
This commit is contained in:
@@ -44,9 +44,6 @@ Texture2D::Texture2D(Context& context_)
|
||||
Texture2D::~Texture2D() {
|
||||
destroyTexture();
|
||||
destroySampler();
|
||||
|
||||
context.renderingStats().numActiveTextures--;
|
||||
context.renderingStats().memTextures -= Texture2D::getDataSize();
|
||||
}
|
||||
|
||||
gfx::Texture2D& Texture2D::setSamplerConfiguration(const SamplerState& samplerState_) noexcept {
|
||||
@@ -209,6 +206,7 @@ void Texture2D::uploadSubRegion(const void* pixelData,
|
||||
context.enqueueDeletion([buffAlloc = std::move(bufferAllocation)](auto&) mutable { buffAlloc.reset(); });
|
||||
|
||||
context.renderingStats().numTextureUpdates++;
|
||||
context.renderingStats().textureUpdateBytes += bufferInfo.size;
|
||||
}
|
||||
|
||||
vk::Format Texture2D::vulkanFormat(const gfx::TexturePixelType pixel, gfx::TextureChannelDataType channel) {
|
||||
@@ -402,6 +400,9 @@ void Texture2D::destroyTexture() {
|
||||
context.enqueueDeletion([allocation = std::move(imageAllocation)](auto&) mutable { allocation.reset(); });
|
||||
|
||||
imageLayout = vk::ImageLayout::eUndefined;
|
||||
|
||||
context.renderingStats().numActiveTextures--;
|
||||
context.renderingStats().memTextures -= Texture2D::getDataSize();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user