Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion impeller/renderer/backend/vulkan/texture_vk.cc
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,19 @@ TextureVK::TextureVK(std::weak_ptr<Context> context,
std::shared_ptr<TextureSourceVK> source)
: Texture(source->GetTextureDescriptor()),
context_(std::move(context)),
source_(std::move(source)) {}
source_(std::move(source)) {
#ifdef IMPELLER_DEBUG
has_validation_layers_ = HasValidationLayers();
#endif // IMPELLER_DEBUG
}

TextureVK::~TextureVK() = default;

void TextureVK::SetLabel(std::string_view label) {
#ifdef IMPELLER_DEBUG
if (!has_validation_layers_) {
return;
}
auto context = context_.lock();
if (!context) {
// The context may have died.
Expand Down
1 change: 1 addition & 0 deletions impeller/renderer/backend/vulkan/texture_vk.h
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ class TextureVK final : public Texture, public BackendCast<TextureVK, Texture> {
private:
std::weak_ptr<Context> context_;
std::shared_ptr<TextureSourceVK> source_;
bool has_validation_layers_ = false;

// |Texture|
void SetLabel(std::string_view label) override;
Expand Down
Loading