From 4da512dc3f2f49d109a97ac89e6635c4384693ac Mon Sep 17 00:00:00 2001 From: connan Date: Fri, 20 Dec 2024 16:15:43 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B5=8B=E8=AF=95=20unity=20CurrentCommandBuff?= =?UTF-8?q?er?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- NativeRenderPlugin/RenderAPI_Metal.mm | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/NativeRenderPlugin/RenderAPI_Metal.mm b/NativeRenderPlugin/RenderAPI_Metal.mm index e8d4acf..629e250 100644 --- a/NativeRenderPlugin/RenderAPI_Metal.mm +++ b/NativeRenderPlugin/RenderAPI_Metal.mm @@ -133,10 +133,10 @@ void RenderAPI_Metal::spatialUpScale(void* data) // mfx_spatial_scaler.inputContentHeight = [srctex height]; // if(!cmd) // { - id upscaleCommandBuffer = [commandQueue commandBuffer]; - upscaleCommandBuffer.label = @"Upscale Command Buffer"; - [mfx_spatial_scaler encodeToCommandBuffer:upscaleCommandBuffer]; - [upscaleCommandBuffer commit]; + // id upscaleCommandBuffer = [commandQueue commandBuffer]; + // upscaleCommandBuffer.label = @"Upscale Command Buffer"; + // [mfx_spatial_scaler encodeToCommandBuffer:upscaleCommandBuffer]; + // [upscaleCommandBuffer commit]; // id textureCommandBuffer = [commandQueue commandBuffer]; // id _mfxSpatialEncoder =[textureCommandBuffer blitCommandEncoder]; @@ -147,9 +147,10 @@ void RenderAPI_Metal::spatialUpScale(void* data) // } // else { - // [mfx_spatial_scaler encodeToCommandBuffer:cmd]; - // [cmd commit]; + [mfx_spatial_scaler encodeToCommandBuffer:cmd]; + // [cmd commit]; 后处理用 unity CurrentCommandBuffer 不能 提交,不自定义 Encoder 不用 metal_graphics->EndCurrentCommandEncoder(); + // 不开启验证层 貌似不用保证 outputTexture 是 gpuonly的 // id textureCommandBuffer = [commandQueue commandBuffer]; // id _mfxSpatialEncoder =[textureCommandBuffer blitCommandEncoder];