mirror of
https://github.com/love2d/love.git
synced 2026-08-17 19:23:38 +02:00
vulkan: fix gammacorrect in Graphics::clear
This commit is contained in:
@@ -159,10 +159,14 @@ void Graphics::clear(OptionalColorD color, OptionalInt stencil, OptionalDouble d
|
|||||||
if (color.hasValue)
|
if (color.hasValue)
|
||||||
{
|
{
|
||||||
renderPassState.renderPassConfiguration.colorAttachments[0].loadOp = VK_ATTACHMENT_LOAD_OP_CLEAR;
|
renderPassState.renderPassConfiguration.colorAttachments[0].loadOp = VK_ATTACHMENT_LOAD_OP_CLEAR;
|
||||||
renderPassState.clearColors[0].color.float32[0] = static_cast<float>(color.value.r);
|
|
||||||
renderPassState.clearColors[0].color.float32[1] = static_cast<float>(color.value.g);
|
Colorf cf((float)color.value.r, (float)color.value.g, (float)color.value.b, (float)color.value.a);
|
||||||
renderPassState.clearColors[0].color.float32[2] = static_cast<float>(color.value.b);
|
gammaCorrectColor(cf);
|
||||||
renderPassState.clearColors[0].color.float32[3] = static_cast<float>(color.value.a);
|
|
||||||
|
renderPassState.clearColors[0].color.float32[0] = static_cast<float>(cf.r);
|
||||||
|
renderPassState.clearColors[0].color.float32[1] = static_cast<float>(cf.g);
|
||||||
|
renderPassState.clearColors[0].color.float32[2] = static_cast<float>(cf.b);
|
||||||
|
renderPassState.clearColors[0].color.float32[3] = static_cast<float>(cf.a);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (depth.hasValue)
|
if (depth.hasValue)
|
||||||
@@ -248,10 +252,15 @@ void Graphics::clear(const std::vector<OptionalColorD> &colors, OptionalInt sten
|
|||||||
if (colors[i].hasValue)
|
if (colors[i].hasValue)
|
||||||
{
|
{
|
||||||
renderPassState.renderPassConfiguration.colorAttachments[i].loadOp = VK_ATTACHMENT_LOAD_OP_CLEAR;
|
renderPassState.renderPassConfiguration.colorAttachments[i].loadOp = VK_ATTACHMENT_LOAD_OP_CLEAR;
|
||||||
renderPassState.clearColors[i].color.float32[0] = static_cast<float>(colors[i].value.r);
|
|
||||||
renderPassState.clearColors[i].color.float32[1] = static_cast<float>(colors[i].value.g);
|
auto &color = colors[i];
|
||||||
renderPassState.clearColors[i].color.float32[2] = static_cast<float>(colors[i].value.b);
|
Colorf cf((float)color.value.r, (float)color.value.g, (float)color.value.b, (float)color.value.a);
|
||||||
renderPassState.clearColors[i].color.float32[3] = static_cast<float>(colors[i].value.a);
|
gammaCorrectColor(cf);
|
||||||
|
|
||||||
|
renderPassState.clearColors[i].color.float32[0] = static_cast<float>(cf.r);
|
||||||
|
renderPassState.clearColors[i].color.float32[1] = static_cast<float>(cf.g);
|
||||||
|
renderPassState.clearColors[i].color.float32[2] = static_cast<float>(cf.b);
|
||||||
|
renderPassState.clearColors[i].color.float32[3] = static_cast<float>(cf.a);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user