From c65123bbbe8bbf7cf07a1a521eb485f794d59f36 Mon Sep 17 00:00:00 2001 From: Samuliak Date: Mon, 30 Sep 2024 19:36:13 +0200 Subject: [PATCH] use logging instead of printing --- src/Cafe/HW/Latte/Renderer/Metal/LatteToMtl.cpp | 2 +- .../HW/Latte/Renderer/Metal/MetalHybridComputePipeline.cpp | 2 +- src/Cafe/HW/Latte/Renderer/Metal/MetalRenderer.cpp | 7 +------ src/Cafe/HW/Latte/Renderer/Metal/RendererShaderMtl.cpp | 2 +- 4 files changed, 4 insertions(+), 9 deletions(-) diff --git a/src/Cafe/HW/Latte/Renderer/Metal/LatteToMtl.cpp b/src/Cafe/HW/Latte/Renderer/Metal/LatteToMtl.cpp index d3a5850c..8a73da2b 100644 --- a/src/Cafe/HW/Latte/Renderer/Metal/LatteToMtl.cpp +++ b/src/Cafe/HW/Latte/Renderer/Metal/LatteToMtl.cpp @@ -310,7 +310,7 @@ MTL::VertexFormat GetMtlVertexFormat(uint8 format) case FMT_2_10_10_10: return MTL::VertexFormatUInt; // verified to match OpenGL default: - printf("unsupported vertex format %u\n", (uint32)format); + cemuLog_log(LogType::Force, "unsupported vertex format {}", (uint32)format); assert_dbg(); return MTL::VertexFormatInvalid; } diff --git a/src/Cafe/HW/Latte/Renderer/Metal/MetalHybridComputePipeline.cpp b/src/Cafe/HW/Latte/Renderer/Metal/MetalHybridComputePipeline.cpp index f822fb13..7043b99f 100644 --- a/src/Cafe/HW/Latte/Renderer/Metal/MetalHybridComputePipeline.cpp +++ b/src/Cafe/HW/Latte/Renderer/Metal/MetalHybridComputePipeline.cpp @@ -15,7 +15,7 @@ MetalHybridComputePipeline::MetalHybridComputePipeline(class MetalRenderer* mtlR vertexFunction->release(); if (error) { - printf("error creating hybrid render pipeline state: %s\n", error->localizedDescription()->utf8String()); + cemuLog_log(LogType::Force, "error creating hybrid render pipeline state: {}", error->localizedDescription()->utf8String()); error->release(); } diff --git a/src/Cafe/HW/Latte/Renderer/Metal/MetalRenderer.cpp b/src/Cafe/HW/Latte/Renderer/Metal/MetalRenderer.cpp index 8bd90661..cfe45fb8 100644 --- a/src/Cafe/HW/Latte/Renderer/Metal/MetalRenderer.cpp +++ b/src/Cafe/HW/Latte/Renderer/Metal/MetalRenderer.cpp @@ -17,6 +17,7 @@ #include "Cafe/HW/Latte/Core/LatteShader.h" #include "Cafe/HW/Latte/Core/LatteIndices.h" #include "Cemu/Logging/CemuDebugLogging.h" +#include "Cemu/Logging/CemuLogging.h" #include "HW/Latte/Core/LatteConst.h" #include "HW/Latte/Renderer/Metal/MetalCommon.h" #include "HW/Latte/Renderer/Metal/MetalLayerHandle.h" @@ -938,12 +939,6 @@ void MetalRenderer::draw_execute(uint32 baseVertex, uint32 baseInstance, uint32 LatteDecompilerShader* vertexShader = LatteSHRC_GetActiveVertexShader(); LatteDecompilerShader* geometryShader = LatteSHRC_GetActiveGeometryShader(); LatteDecompilerShader* pixelShader = LatteSHRC_GetActivePixelShader(); - // TODO: is this even needed? Also, should go to draw_beginSequence - if (!vertexShader || !static_cast(vertexShader->shader)->GetFunction()) - { - printf("no vertex function, skipping draw\n"); - return; - } const auto fetchShader = LatteSHRC_GetActiveFetchShader(); bool neverSkipAccurateBarrier = false; diff --git a/src/Cafe/HW/Latte/Renderer/Metal/RendererShaderMtl.cpp b/src/Cafe/HW/Latte/Renderer/Metal/RendererShaderMtl.cpp index d343ef45..84751eee 100644 --- a/src/Cafe/HW/Latte/Renderer/Metal/RendererShaderMtl.cpp +++ b/src/Cafe/HW/Latte/Renderer/Metal/RendererShaderMtl.cpp @@ -20,7 +20,7 @@ RendererShaderMtl::RendererShaderMtl(MetalRenderer* mtlRenderer, ShaderType type MTL::Library* library = m_mtlr->GetDevice()->newLibrary(ToNSString(mslCode), nullptr, &error); if (error) { - printf("failed to create library (error: %s) -> source:\n%s\n", error->localizedDescription()->utf8String(), mslCode.c_str()); + cemuLog_log(LogType::Force, "failed to create library: {}", error->localizedDescription()->utf8String()); error->release(); return; }