Skip to content

Commit

Permalink
Merge pull request #37 from Pentalimbed/main
Browse files Browse the repository at this point in the history
Texture3D buffer class
  • Loading branch information
doodlum authored Jul 29, 2023
2 parents f7b8cdf + ee84a75 commit b6ec9be
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions src/Buffer.h
Original file line number Diff line number Diff line change
Expand Up @@ -194,3 +194,30 @@ class Texture2D
winrt::com_ptr<ID3D11ShaderResourceView> srv;
winrt::com_ptr<ID3D11UnorderedAccessView> uav;
};

class Texture3D
{
public:
Texture3D(D3D11_TEXTURE3D_DESC const& a_desc)
{
desc = a_desc;
auto device = RE::BSGraphics::Renderer::GetSingleton()->GetRuntimeData().forwarder;
DX::ThrowIfFailed(device->CreateTexture3D(&desc, nullptr, resource.put()));
}

void CreateSRV(D3D11_SHADER_RESOURCE_VIEW_DESC const& a_desc)
{
ID3D11Device* device = RE::BSGraphics::Renderer::GetSingleton()->GetRuntimeData().forwarder;
DX::ThrowIfFailed(device->CreateShaderResourceView(resource.get(), &a_desc, srv.put()));
}
void CreateUAV(D3D11_UNORDERED_ACCESS_VIEW_DESC const& a_desc)
{
ID3D11Device* device = RE::BSGraphics::Renderer::GetSingleton()->GetRuntimeData().forwarder;
DX::ThrowIfFailed(device->CreateUnorderedAccessView(resource.get(), &a_desc, uav.put()));
}

D3D11_TEXTURE3D_DESC desc;
winrt::com_ptr<ID3D11Texture3D> resource;
winrt::com_ptr<ID3D11ShaderResourceView> srv;
winrt::com_ptr<ID3D11UnorderedAccessView> uav;
};

0 comments on commit b6ec9be

Please sign in to comment.