[idd] select linear RGB24 packing automatically

Replace the texture-shaped RGB24 output with a linear raw buffer and
keep its packing, damage translation, and buffer copies inside the
RGB24 effect.

Benchmark full-frame native and packed processing and retain the faster
path for each source format. Preserve logical damage rectangles for
client updates and alternating framebuffer repair.

Return compute outputs to COMMON for COPY queue handoff and refresh
cached framebuffer sizes when switching packed and native layouts.
This commit is contained in:
Geoffrey McRae
2026-08-03 20:35:49 +10:00
parent fa2769b332
commit 6109501eed
16 changed files with 987 additions and 232 deletions

View File

@@ -27,7 +27,7 @@
namespace PostProcessUtil
{
bool CreateDefaultTexture(const ComPtr<ID3D12Device3>& device,
static bool CreateDefaultResource(const ComPtr<ID3D12Device3>& device,
const D3D12_RESOURCE_DESC& desc, ComPtr<ID3D12Resource>& resource)
{
D3D12_HEAP_PROPERTIES heapProps = {};
@@ -41,17 +41,38 @@ namespace PostProcessUtil
&heapProps,
D3D12_HEAP_FLAG_CREATE_NOT_ZEROED,
&desc,
D3D12_RESOURCE_STATE_COPY_SOURCE,
D3D12_RESOURCE_STATE_COMMON,
nullptr,
IID_PPV_ARGS(&resource));
if (FAILED(hr))
{
DEBUG_ERROR_HR(hr, "Failed to create post-processing destination texture");
DEBUG_ERROR_HR(hr, "Failed to create post-processing destination resource");
return false;
}
return true;
}
bool CreateDefaultTexture(const ComPtr<ID3D12Device3>& device,
const D3D12_RESOURCE_DESC& desc, ComPtr<ID3D12Resource>& resource)
{
return CreateDefaultResource(device, desc, resource);
}
bool CreateDefaultBuffer(const ComPtr<ID3D12Device3>& device,
UINT64 size, ComPtr<ID3D12Resource>& resource)
{
D3D12_RESOURCE_DESC desc = {};
desc.Dimension = D3D12_RESOURCE_DIMENSION_BUFFER;
desc.Width = size;
desc.Height = 1;
desc.DepthOrArraySize = 1;
desc.MipLevels = 1;
desc.SampleDesc.Count = 1;
desc.Layout = D3D12_TEXTURE_LAYOUT_ROW_MAJOR;
desc.Flags = D3D12_RESOURCE_FLAG_ALLOW_UNORDERED_ACCESS;
return CreateDefaultResource(device, desc, resource);
}
}
bool CComputeEffect::InitCompute(const ComPtr<ID3D12Device3>& device,