apply gamma correction

This commit is contained in:
Samuliak 2024-08-11 13:47:06 +02:00
parent 6d34d24322
commit caba20da4b

View File

@ -16,6 +16,7 @@
#include "Cemu/Logging/CemuDebugLogging.h" #include "Cemu/Logging/CemuDebugLogging.h"
#include "HW/Latte/Core/Latte.h" #include "HW/Latte/Core/Latte.h"
#include "HW/Latte/ISA/LatteReg.h" #include "HW/Latte/ISA/LatteReg.h"
#include "Metal/MTLPixelFormat.hpp"
#include "Metal/MTLRenderCommandEncoder.hpp" #include "Metal/MTLRenderCommandEncoder.hpp"
#include "Metal/MTLResource.hpp" #include "Metal/MTLResource.hpp"
#include "Metal/MTLTypes.hpp" #include "Metal/MTLTypes.hpp"
@ -76,6 +77,8 @@ void MetalRenderer::InitializeLayer(const Vector2i& size, bool mainWindow)
m_metalLayer = (CA::MetalLayer*)CreateMetalLayer(windowInfo.handle); m_metalLayer = (CA::MetalLayer*)CreateMetalLayer(windowInfo.handle);
m_metalLayer->setDevice(m_device); m_metalLayer->setDevice(m_device);
// TODO: shouldn't this be handled differently?
m_metalLayer->setPixelFormat(MTL::PixelFormatRGBA8Unorm_sRGB);
// Present pipeline // Present pipeline
NS::Error* error = nullptr; NS::Error* error = nullptr;
@ -84,7 +87,6 @@ void MetalRenderer::InitializeLayer(const Vector2i& size, bool mainWindow)
{ {
debug_printf("failed to create present library (error: %s)\n", error->localizedDescription()->utf8String()); debug_printf("failed to create present library (error: %s)\n", error->localizedDescription()->utf8String());
error->release(); error->release();
throw;
return; return;
} }
MTL::Function* presentVertexFunction = presentLibrary->newFunction(NS::String::string("presentVertex", NS::ASCIIStringEncoding)); MTL::Function* presentVertexFunction = presentLibrary->newFunction(NS::String::string("presentVertex", NS::ASCIIStringEncoding));