LookingGlass/idd/LGIdd/CFrameBufferResource.h
Geoffrey McRae 9ffb800e93 [idd] driver: use the frameSize instead of the resource size
As the resource size can be larger then the actual frame data, we
need to track this seperately so that we don't waste cycles copying
data the client will never use.
2025-03-28 14:35:19 +00:00

35 lines
851 B
C++

#pragma once
#include <Windows.h>
#include <wdf.h>
#include <wrl.h>
#include <d3d12.h>
#include <stdint.h>
class CSwapChainProcessor;
using namespace Microsoft::WRL;
class CFrameBufferResource
{
private:
bool m_valid;
uint8_t * m_base;
size_t m_size;
size_t m_frameSize;
ComPtr<ID3D12Resource> m_res;
void * m_map;
public:
bool Init(CSwapChainProcessor * swapChain, uint8_t * base, size_t size);
void Reset();
bool IsValid() { return m_valid; }
uint8_t * GetBase() { return m_base; }
size_t GetSize() { return m_size; }
size_t GetFrameSize() { return m_frameSize; }
void * GetMap() { return m_map; }
ComPtr<ID3D12Resource> Get() { return m_res; }
};