Postprocessing/FX: Expose 'viewportoffset' uniform
This commit is contained in:
parent
eb80a82ce5
commit
54097fc14e
|
@ -936,6 +936,18 @@ bool PostProcessing::ReShadeFXShader::GetSourceOption(const reshadefx::uniform_i
|
|||
*si = SourceOptionType::ViewportHeight;
|
||||
return true;
|
||||
}
|
||||
else if (source == "viewportoffset")
|
||||
{
|
||||
if (!ui.type.is_floating_point() || ui.type.components() != 2)
|
||||
{
|
||||
Error::SetString(error, fmt::format("Unexpected type '{}' for {} source in uniform '{}'", ui.type.description(),
|
||||
source, ui.name));
|
||||
return false;
|
||||
}
|
||||
|
||||
*si = SourceOptionType::ViewportOffset;
|
||||
return true;
|
||||
}
|
||||
else if (source == "viewportsize")
|
||||
{
|
||||
if (!ui.type.is_floating_point() || ui.type.components() != 2)
|
||||
|
@ -1666,6 +1678,13 @@ bool PostProcessing::ReShadeFXShader::Apply(GPUTexture* input, GPUTexture* final
|
|||
}
|
||||
break;
|
||||
|
||||
case SourceOptionType::ViewportOffset:
|
||||
{
|
||||
const float value[2] = {static_cast<float>(final_left), static_cast<float>(final_top)};
|
||||
std::memcpy(dst, &value, sizeof(value));
|
||||
}
|
||||
break;
|
||||
|
||||
case SourceOptionType::ViewportSize:
|
||||
{
|
||||
const float value[2] = {static_cast<float>(final_width), static_cast<float>(final_height)};
|
||||
|
|
|
@ -70,6 +70,7 @@ private:
|
|||
ViewportY,
|
||||
ViewportWidth,
|
||||
ViewportHeight,
|
||||
ViewportOffset,
|
||||
ViewportSize,
|
||||
InternalPixelSize,
|
||||
InternalNormPixelSize,
|
||||
|
|
Loading…
Reference in New Issue