Skip to content

Commit

Permalink
gbm: prefer linear modifiers
Browse files Browse the repository at this point in the history
  • Loading branch information
vaxerski committed Feb 22, 2024
1 parent f411d9d commit 9ba88d0
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/renderer/DMAFrame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,11 @@ bool CDMAFrame::onBufferDone() {
goodMods.push_back(mods[i]);
}

bo = gbm_bo_create_with_modifiers2(g_pHyprlock->dma.gbmDevice, scdata.w, scdata.h, scdata.fmt, goodMods.data(), goodMods.size(), flags);
uint64_t zero = 0;
bool hasLinear = std::find(goodMods.begin(), goodMods.end(), 0) != goodMods.end();

bo = gbm_bo_create_with_modifiers2(g_pHyprlock->dma.gbmDevice, scdata.w, scdata.h, scdata.fmt, hasLinear ? &zero : goodMods.data(), hasLinear ? 1 : goodMods.size(),
flags);
}
}

Expand Down

0 comments on commit 9ba88d0

Please sign in to comment.