/** * Looking Glass * Copyright © 2017-2026 The Looking Glass Authors * https://looking-glass.io * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the Free * Software Foundation; either version 2 of the License, or (at your option) * any later version. */ #pragma once #include "../CPostProcessor.h" #define POST_PROCESS_THREADS_STR "8" namespace PostProcessUtil { static constexpr unsigned Threads = 8; template static constexpr T AlignTo(T value, T align) { return (value + (align - 1)) & ~(align - 1); } bool CreateDefaultTexture(const ComPtr& device, const D3D12_RESOURCE_DESC& desc, ComPtr& resource); } class CComputeEffect : public CPostProcessEffect { protected: ComPtr m_rootSignature; ComPtr m_pso; ComPtr m_descHeap; ComPtr m_dst; unsigned m_threadsX = 0; unsigned m_threadsY = 0; bool InitCompute(const ComPtr& device, const D3D12_DESCRIPTOR_RANGE * ranges, UINT rangeCount, const D3D12_STATIC_SAMPLER_DESC * samplers, UINT samplerCount, const char * shader); void Bind(const ComPtr& commandList); void TransitionDst(const ComPtr& commandList, D3D12_RESOURCE_STATES before, D3D12_RESOURCE_STATES after); };