gbm: Default to forcing linear blit for multigpu (#197)

This commit is contained in:
Lee Bousfield 2025-07-22 15:26:59 -05:00 committed by GitHub
parent f0db9b7eed
commit be166e11d8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 7 additions and 1 deletions

View file

@ -140,7 +140,7 @@ Aquamarine::CGBMBuffer::CGBMBuffer(const SAllocatorBufferParams& params, Hypruti
return;
}
static const auto forceLinearBlit = envEnabled("AQ_FORCE_LINEAR_BLIT");
static const auto forceLinearBlit = !envExplicitlyDisabled("AQ_FORCE_LINEAR_BLIT");
auto const oldMods = explicitModifiers; // used in FORCE_LINEAR_BLIT case.
if (MULTIGPU && !forceLinearBlit) {
// Try to use the linear format if available for cross-GPU compatibility.

View file

@ -6,6 +6,7 @@
namespace Aquamarine {
bool envEnabled(const std::string& env);
bool envExplicitlyDisabled(const std::string& env);
bool isTrace();
};

View file

@ -6,6 +6,11 @@ bool Aquamarine::envEnabled(const std::string& env) {
return e && e == std::string{"1"};
}
bool Aquamarine::envExplicitlyDisabled(const std::string& env) {
auto e = getenv(env.c_str());
return e && e == std::string{"0"};
}
static bool trace = []() -> bool { return Aquamarine::envEnabled("AQ_TRACE"); }();
bool Aquamarine::isTrace() {