canvis de upscale i downscale en consola

This commit is contained in:
2026-03-28 00:37:52 +01:00
parent 8355c266a6
commit a7f0a18e6d
6 changed files with 69 additions and 4 deletions

View File

@@ -536,12 +536,14 @@ auto loadData(const std::string& filepath) -> std::vector<uint8_t> {
}
void Screen::setLinearUpscale(bool linear) {
Options::video.linear_upscale = linear;
if (shader_backend_ && shader_backend_->isHardwareAccelerated()) {
shader_backend_->setLinearUpscale(linear);
}
}
void Screen::setDownscaleAlgo(int algo) {
Options::video.downscale_algo = algo;
if (shader_backend_ && shader_backend_->isHardwareAccelerated()) {
shader_backend_->setDownscaleAlgo(algo);
}
@@ -580,9 +582,11 @@ void Screen::initShaders() {
shader_backend_->init(window_, tex, "", "");
gpu_driver_ = shader_backend_->getDriverName();
// Propagar flags de vsync e integer scale al backend GPU
// Propagar flags de vsync, integer scale, upscale y downscale al backend GPU
shader_backend_->setVSync(Options::video.vertical_sync);
shader_backend_->setScaleMode(Options::video.integer_scale);
shader_backend_->setLinearUpscale(Options::video.linear_upscale);
shader_backend_->setDownscaleAlgo(Options::video.downscale_algo);
if (Options::video.postfx) {
applyCurrentPostFXPreset();

View File

@@ -95,6 +95,7 @@ namespace Rendering {
* Por defecto NEAREST (false). Solo tiene efecto con supersampling activo.
*/
virtual void setLinearUpscale(bool /*linear*/) {}
[[nodiscard]] virtual auto isLinearUpscale() const -> bool { return false; }
/**
* @brief Selecciona el algoritmo de downscale tras el PostFX (SS activo).
@@ -102,6 +103,7 @@ namespace Rendering {
* 1 = Lanczos2 (ventana 2, ~25 muestras), 2 = Lanczos3 (ventana 3, ~49 muestras).
*/
virtual void setDownscaleAlgo(int /*algo*/) {}
[[nodiscard]] virtual auto getDownscaleAlgo() const -> int { return 0; }
/**
* @brief Verifica si el backend está usando aceleración por hardware