swap:false

This commit is contained in:
Mark.lin
2026-08-14 16:39:04 +08:00
parent d7500ed9fd
commit 743acfb792
2 changed files with 12 additions and 9 deletions
+1
View File
@@ -24,3 +24,4 @@ CaptureDemo/CaptureDemo/release/
CaptureDemo/CaptureDemo/*.yuv
CaptureDemo/CaptureDemo/*.raw
CaptureDemo/CaptureDemo/*.rgb
CaptureDemo
+5 -3
View File
@@ -170,7 +170,7 @@ Texture2D<uint4> texP : register(t0);
// true: interpret the raw chroma words as Y0,V,Y1,U.
// false: interpret them as standard Y210 Y0,U,Y1,V.
static const bool kSwapUV = true;
static const bool kSwapUV = false;
cbuffer ProcAmp : register(b0)
{
@@ -826,7 +826,8 @@ bool D3DPreviewPipeline::readback_nv12_to_buffer(void *destination,
return false;
auto ensureStaging = [this](ComPtr<ID3D11Texture2D> &texture, UINT width, UINT height,
DXGI_FORMAT format) {
DXGI_FORMAT format)
{
if (texture)
{
D3D11_TEXTURE2D_DESC current{};
@@ -856,7 +857,8 @@ bool D3DPreviewPipeline::readback_nv12_to_buffer(void *destination,
auto copyPlane = [this, dst, destination_row_bytes](ID3D11Texture2D *source,
ID3D11Texture2D *staging,
int rows, int copyBytes,
size_t destinationOffset) {
size_t destinationOffset)
{
ctx_->CopyResource(staging, source);
D3D11_MAPPED_SUBRESOURCE mapped{};
if (FAILED(ctx_->Map(staging, 0, D3D11_MAP_READ, 0, &mapped)))