Last active
November 10, 2017 05:13
-
-
Save fatkas/79e401d2a44507235cee4f3ae5f0cf9a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#if GAPI_DX12 | |
typedef ID3D12Resource* NativeResource; | |
#elif GAPI_METAL | |
typedef void * NativeResource; | |
#endif | |
struct Texture | |
{ | |
NativeResource m_texture = nullptr; | |
}; | |
struct Buffer | |
{ | |
NativeResource m_buffer = nullptr; | |
}; | |
struct CommandList | |
{ | |
void SetConstantBuffer(uint32_t slot, const shared_ptr<Buffer>& buf); | |
void SetTexture(uint32_t slot, const shared_ptr<Texture>& tex) | |
{ | |
Assert(slot < MAX_TEXTURE_SLOTS); | |
m_textures[slot] = tex; | |
} | |
private: | |
shared_ptr<Texture> m_textures[MAX_TEXTURE_SLOTS]; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment