17 D3D11_TEXTURE3D_DESC desc;
22 desc.Format =
static_cast<DXGI_FORMAT
>(texture->
GetFormat());
23 desc.BindFlags = D3D11_BIND_SHADER_RESOURCE;
28 desc.Usage = D3D11_USAGE_IMMUTABLE;
33 desc.Usage = D3D11_USAGE_DYNAMIC;
34 desc.CPUAccessFlags = D3D11_CPU_ACCESS_WRITE;
38 desc.Usage = D3D11_USAGE_DEFAULT;
39 desc.BindFlags |= D3D11_BIND_UNORDERED_ACCESS;
45 desc.Usage = D3D11_USAGE_DEFAULT;
46 desc.BindFlags |= D3D11_BIND_RENDER_TARGET;
48 desc.MiscFlags |= D3D11_RESOURCE_MISC_GENERATE_MIPS;
52 ID3D11Texture3D* dxTexture =
nullptr;
57 std::vector<D3D11_SUBRESOURCE_DATA>
data(numSubresources);
62 data[
index].SysMemPitch = sr.rowPitch;
63 data[
index].SysMemSlicePitch = sr.slicePitch;
65 hr = device->CreateTexture3D(&desc, &data[0], &dxTexture);
69 hr = device->CreateTexture3D(&desc,
nullptr, &dxTexture);
76 if (usage == Resource::SHADER_OUTPUT)
90 ID3D11DeviceContext* context;
91 device->GetImmediateContext(&context);
101 return std::make_shared<DX11Texture3>(
reinterpret_cast<ID3D11Device*
>(device),
102 static_cast<Texture3 const*>(
object));
111 D3D11_TEXTURE3D_DESC desc;
112 desc.Width = tx.Width;
113 desc.Height = tx.Height;
114 desc.Depth = tx.Depth;
115 desc.MipLevels = tx.MipLevels;
116 desc.Format = tx.Format;
117 desc.Usage = D3D11_USAGE_STAGING;
122 HRESULT hr = device->CreateTexture3D(&desc,
nullptr,
123 reinterpret_cast<ID3D11Texture3D**>(&
mStaging));
129 D3D11_SHADER_RESOURCE_VIEW_DESC desc;
130 desc.Format = tx.Format;
131 desc.ViewDimension = D3D11_SRV_DIMENSION_TEXTURE3D;
132 desc.Texture3D.MostDetailedMip = 0;
133 desc.Texture3D.MipLevels = tx.MipLevels;
140 D3D11_UNORDERED_ACCESS_VIEW_DESC desc;
141 desc.Format = tx.Format;
142 desc.ViewDimension = D3D11_UAV_DIMENSION_TEXTURE3D;
143 desc.Texture3D.MipSlice = 0;
144 desc.Texture3D.FirstWSlice = 0;
145 desc.Texture3D.WSize = tx.Depth;
#define D3D11_RESOURCE_MISC_NONE
void CreateSRView(ID3D11Device *device, D3D11_TEXTURE3D_DESC const &tx)
#define CHECK_HR_RETURN_NONE(msg)
GraphicsObjectType GetType() const
ID3D11Texture3D * GetDXTexture() const
ID3D11UnorderedAccessView * mUAView
ID3D11Resource * mStaging
unsigned int GetHeight() const
static std::shared_ptr< GEObject > Create(void *device, GraphicsObject const *object)
void CreateStaging(ID3D11Device *device, D3D11_TEXTURE3D_DESC const &tx)
#define LogError(message)
ID3D11DeviceChild * mDXObject
void CreateUAView(ID3D11Device *device, D3D11_TEXTURE3D_DESC const &tx)
unsigned int GetThickness() const
char const * GetData() const
unsigned int GetNumLevels() const
GLsizeiptr const void GLenum usage
Subresource GetSubresource(unsigned int index) const
#define D3D11_CPU_ACCESS_NONE
#define CHECK_HR_RETURN_VOID(msg)
static UINT const msStagingAccess[]
Texture3 * GetTexture() const
CopyType GetCopyType() const
bool WantAutogenerateMipmaps() const
ID3D11ShaderResourceView * mSRView
DX11Texture3(ID3D11Device *device, Texture3 const *texture)
unsigned int GetWidth() const
unsigned int GetNumSubresources() const