From 2dd5e75ba87936f2681557286b6fc83b95451cf4 Mon Sep 17 00:00:00 2001 From: Sheil Kumar Date: Fri, 28 Jan 2022 08:45:57 -0800 Subject: [PATCH] Incorrect output after GPU to GPU inference via VideoFrame and Gray8 models (#10425) * If the tensor is of gray8 format, we should call the gray8 shader * other check (which resolves to unknown in this case) is incorrectly being compared to constant and not DXGI_FORMAT Co-authored-by: Sheil Kumar --- winml/lib/Api.Image/TensorToVideoFrameConverter.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/winml/lib/Api.Image/TensorToVideoFrameConverter.cpp b/winml/lib/Api.Image/TensorToVideoFrameConverter.cpp index aea1addccc..b5d0becf63 100644 --- a/winml/lib/Api.Image/TensorToVideoFrameConverter.cpp +++ b/winml/lib/Api.Image/TensorToVideoFrameConverter.cpp @@ -483,7 +483,8 @@ void TensorToVideoFrameConverter::ConvertGPUTensorToDX12Texture( PipelineStateCacheFormat formatFrom = PipelineStateCacheFormat::kBGR8; if (tensorDesc.channelType == kImageTensorChannelTypeRGB8) { formatFrom = PipelineStateCacheFormat::kRGB8; - } else if (inputDesc.Format == kImageTensorChannelTypeGRAY8) { + } else if (inputDesc.Format == DXGI_FORMAT_R8_UNORM || + tensorDesc.channelType == kImageTensorChannelTypeGRAY8) { formatFrom = PipelineStateCacheFormat::kGRAY8; }