17 D3D11_TEXTURE1D_DESC desc;
21 desc.Format =
static_cast<DXGI_FORMAT
>(textureArray->
GetFormat());
22 desc.BindFlags = D3D11_BIND_SHADER_RESOURCE;
27 desc.Usage = D3D11_USAGE_IMMUTABLE;
32 desc.Usage = D3D11_USAGE_DYNAMIC;
33 desc.CPUAccessFlags = D3D11_CPU_ACCESS_WRITE;
37 desc.Usage = D3D11_USAGE_DEFAULT;
38 desc.BindFlags |= D3D11_BIND_UNORDERED_ACCESS;
44 desc.Usage = D3D11_USAGE_DEFAULT;
45 desc.BindFlags |= D3D11_BIND_RENDER_TARGET;
47 desc.MiscFlags |= D3D11_RESOURCE_MISC_GENERATE_MIPS;
51 ID3D11Texture1D* dxTexture =
nullptr;
56 std::vector<D3D11_SUBRESOURCE_DATA>
data(numSubresources);
61 data[
index].SysMemPitch = 0;
62 data[
index].SysMemSlicePitch = 0;
64 hr = device->CreateTexture1D(&desc, &data[0], &dxTexture);
68 hr = device->CreateTexture1D(&desc,
nullptr, &dxTexture);
75 if (usage == Resource::SHADER_OUTPUT)
89 ID3D11DeviceContext* context;
90 device->GetImmediateContext(&context);
100 return std::make_shared<DX11Texture1Array>(
reinterpret_cast<ID3D11Device*
>(device),
101 static_cast<Texture1Array const*>(
object));
110 D3D11_TEXTURE1D_DESC desc;
111 desc.Width = tx.Width;
112 desc.MipLevels = tx.MipLevels;
113 desc.ArraySize = tx.ArraySize;
114 desc.Format = tx.Format;
115 desc.Usage = D3D11_USAGE_STAGING;
120 HRESULT hr = device->CreateTexture1D(&desc,
nullptr,
121 reinterpret_cast<ID3D11Texture1D**>(&
mStaging));
127 D3D11_SHADER_RESOURCE_VIEW_DESC desc;
128 desc.Format = tx.Format;
129 desc.ViewDimension = D3D11_SRV_DIMENSION_TEXTURE1DARRAY;
130 desc.Texture1DArray.MostDetailedMip = 0;
131 desc.Texture1DArray.MipLevels = tx.MipLevels;
132 desc.Texture1DArray.FirstArraySlice = 0;
133 desc.Texture1DArray.ArraySize = tx.ArraySize;
141 D3D11_UNORDERED_ACCESS_VIEW_DESC desc;
142 desc.Format = tx.Format;
143 desc.ViewDimension = D3D11_UAV_DIMENSION_TEXTURE1DARRAY;
144 desc.Texture1DArray.MipSlice = 0;
145 desc.Texture1DArray.FirstArraySlice = 0;
146 desc.Texture1DArray.ArraySize = tx.ArraySize;
#define D3D11_RESOURCE_MISC_NONE
unsigned int GetLength() const
#define CHECK_HR_RETURN_NONE(msg)
void CreateSRView(ID3D11Device *device, D3D11_TEXTURE1D_DESC const &tx)
DX11Texture1Array(ID3D11Device *device, Texture1Array const *textureArray)
GraphicsObjectType GetType() const
ID3D11UnorderedAccessView * mUAView
static std::shared_ptr< GEObject > Create(void *device, GraphicsObject const *object)
Texture1Array * GetTextureArray() const
ID3D11Resource * mStaging
#define LogError(message)
ID3D11DeviceChild * mDXObject
char const * GetData() const
void CreateStaging(ID3D11Device *device, D3D11_TEXTURE1D_DESC const &tx)
unsigned int GetNumItems() const
unsigned int GetNumLevels() const
GLsizeiptr const void GLenum usage
Subresource GetSubresource(unsigned int index) const
#define D3D11_CPU_ACCESS_NONE
static UINT const msStagingAccess[]
CopyType GetCopyType() const
ID3D11Texture1D * GetDXTextureArray() const
bool WantAutogenerateMipmaps() const
ID3D11ShaderResourceView * mSRView
unsigned int GetNumSubresources() const
void CreateUAView(ID3D11Device *device, D3D11_TEXTURE1D_DESC const &tx)