mirror of
https://github.com/hyprwm/aquamarine.git
synced 2024-11-17 00:15:59 +01:00
gbm: fix gbm buffer creation (#9)
This commit is contained in:
parent
ef43e5174b
commit
0ce4b193cf
1 changed files with 5 additions and 4 deletions
|
@ -53,7 +53,8 @@ static SDRMFormat guessFormatFrom(std::vector<SDRMFormat> formats, bool cursor)
|
|||
}
|
||||
|
||||
Aquamarine::CGBMBuffer::CGBMBuffer(const SAllocatorBufferParams& params, Hyprutils::Memory::CWeakPointer<CGBMAllocator> allocator_,
|
||||
Hyprutils::Memory::CSharedPointer<CSwapchain> swapchain) : allocator(allocator_) {
|
||||
Hyprutils::Memory::CSharedPointer<CSwapchain> swapchain) :
|
||||
allocator(allocator_) {
|
||||
if (!allocator)
|
||||
return;
|
||||
|
||||
|
@ -104,17 +105,17 @@ Aquamarine::CGBMBuffer::CGBMBuffer(const SAllocatorBufferParams& params, Hypruti
|
|||
|
||||
if (explicitModifiers.empty()) {
|
||||
allocator->backend->log(AQ_LOG_WARNING, "GBM: Using modifier-less allocation");
|
||||
bo = gbm_bo_create(allocator->gbmDevice, params.size.x, params.size.y, params.format, flags);
|
||||
bo = gbm_bo_create(allocator->gbmDevice, attrs.size.x, attrs.size.y, attrs.format, flags);
|
||||
} else {
|
||||
TRACE(allocator->backend->log(AQ_LOG_TRACE, std::format("GBM: Using modifier-based allocation, modifiers: {}", explicitModifiers.size())));
|
||||
for (auto& mod : explicitModifiers) {
|
||||
TRACE(allocator->backend->log(AQ_LOG_TRACE, std::format("GBM: | mod 0x{:x}", mod)));
|
||||
}
|
||||
bo = gbm_bo_create_with_modifiers(allocator->gbmDevice, params.size.x, params.size.y, params.format, explicitModifiers.data(), explicitModifiers.size());
|
||||
bo = gbm_bo_create_with_modifiers(allocator->gbmDevice, attrs.size.x, attrs.size.y, attrs.format, explicitModifiers.data(), explicitModifiers.size());
|
||||
|
||||
if (!bo) {
|
||||
allocator->backend->log(AQ_LOG_ERROR, "GBM: Allocating with modifiers failed, falling back to implicit");
|
||||
bo = gbm_bo_create(allocator->gbmDevice, params.size.x, params.size.y, params.format, flags);
|
||||
bo = gbm_bo_create(allocator->gbmDevice, attrs.size.x, attrs.size.y, attrs.format, flags);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue