Skip to content

Instantly share code, notes, and snippets.

@fatkas
Last active November 10, 2017 05:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fatkas/79e401d2a44507235cee4f3ae5f0cf9a to your computer and use it in GitHub Desktop.
Save fatkas/79e401d2a44507235cee4f3ae5f0cf9a to your computer and use it in GitHub Desktop.
#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