fix: Unset HDR enabled property entirely
Some checks are pending
(CI) lsfg-vk / build (push) Waiting to run
(CI/Flatpak) lsfg-vk / flatpak-extensions (23.08) (push) Waiting to run
(CI/Flatpak) lsfg-vk / flatpak-extensions (24.08) (push) Waiting to run
(CI/Flatpak) lsfg-vk / flatpak-extensions (25.08) (push) Waiting to run
(CI/Flatpak) lsfg-vk / flatpak-ui (push) Waiting to run

When the HDR enabled property is set, LSFG will assume the source buffer is in the Windows HDR colorspace (scRGB?). Prior to this change lsfg-vk would enabled this property whenever a 10-bit or 16-bit framebuffer is used, without respecting the swapchains actual colorspace. According to some reports, HDR games don't work anyways, so there's some other bug in here as well. This change will remove HDR entirely, which fixes SDR applications using a 10-bit or 16-bit framebuffer (such as mpv or ffplay when playing movies, etc.), but in turn this might also break some HDR games. A proper HDR implementation will be released once I find the time to.
This commit is contained in:
PancakeTAS 2026-06-27 10:05:04 +02:00
parent 218820e8dc
commit e282e243ad
No known key found for this signature in database
3 changed files with 4 additions and 10 deletions

View file

@ -13,11 +13,8 @@ using namespace lsfgvk;
using namespace lsfgvk::backend;
ConstantBuffer backend::getDefaultConstantBuffer(
size_t index, size_t total,
bool hdr, float invFlow) {
size_t index, size_t total, float invFlow) {
return ConstantBuffer {
.advancedColorKind = hdr ? 2U : 0U,
.hdrSupport = hdr ? 1U : 0U,
.resolutionInvScale = invFlow,
.timestamp = static_cast<float>(index + 1) / static_cast<float>(total + 1),
.uiThreshold = 0.5F

View file

@ -56,12 +56,10 @@ namespace lsfgvk::backend {
/// get a prefilled constant buffer
/// @param index timestamp index
/// @param total total amount of images
/// @param hdr whether HDR is enabled
/// @param invFlow inverted flow scale value
/// @return prefilled constant buffer
ConstantBuffer getDefaultConstantBuffer(
size_t index, size_t total,
bool hdr, float invFlow
size_t index, size_t total, float invFlow
);
/// round down a VkExtent2D

View file

@ -369,8 +369,7 @@ namespace {
for (size_t i = 0; i < count; ++i)
constantBuffers.emplace_back(vk,
backend::getDefaultConstantBuffer(
i, count,
hdr, flow
i, count, hdr
)
);
@ -378,7 +377,7 @@ namespace {
.vk = std::ref(vk),
.shaders = std::ref(shaders),
.pool{vk, backend::calculateDescriptorPoolLimits(count, perf)},
.constantBuffer{vk, backend::getDefaultConstantBuffer(0, 1, hdr, flow)},
.constantBuffer{vk, backend::getDefaultConstantBuffer(0, 1, flow)},
.constantBuffers{std::move(constantBuffers)},
.bnbSampler{vk, VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_BORDER, VK_COMPARE_OP_NEVER, false},
.bnwSampler{vk, VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_BORDER, VK_COMPARE_OP_NEVER, true},