-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathDX12Texture2D.h
More file actions
39 lines (37 loc) · 1.31 KB
/
DX12Texture2D.h
File metadata and controls
39 lines (37 loc) · 1.31 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#pragma once
class DX12Texture2D:public DX12UnorderedAccess,public BearRHI::BearRHITexture2D
{
public:
DX12Texture2D(bsize width, bsize height, bsize mips, bsize count, BearTexturePixelFormat pixel_format, BearTextureUsage type_usage, void* data = 0);
DX12Texture2D(bsize width, bsize height,BearRenderTargetFormat format);
DX12Texture2D(bsize width, bsize height, BearDepthStencilFormat format);
ComPtr<ID3D12Resource> TextureBuffer;
virtual bool SetAsSRV(D3D12_CPU_DESCRIPTOR_HANDLE& heap);
virtual bool SetAsUAV(D3D12_CPU_DESCRIPTOR_HANDLE& heap, bsize offset);
virtual void* QueryInterface(int type);
virtual ~DX12Texture2D();
public:
virtual void* Lock(bsize mip, bsize depth);
virtual void Unlock();
virtual BearTextureType GetType();
private:
uint8* m_LockBuffer;
bsize m_LockMip;
bsize m_LockDepth;
public:
BearRenderTargetFormat RTVFormat;
BearDepthStencilFormat DSVFormat;
D3D12_RESOURCE_DESC TextureDesc;
private:
BearTextureType m_TextureType;
BearTextureUsage m_TextureUsage;
void AllocBuffer();
void FreeBuffer();
ComPtr<ID3D12Resource> m_Buffer;
BearTexturePixelFormat m_Format;
private:
D3D12_RESOURCE_STATES m_CurrentStates;
virtual void LockUAV(ID3D12GraphicsCommandListX* command_list);
virtual void UnlockUAV(ID3D12GraphicsCommandListX* command_list);
DX12AllocatorHeapItem m_ShaderResource;
};