17 D3D11_TEXTURE1D_DESC desc;
21 desc.Format =
static_cast<DXGI_FORMAT
>(texture->
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<DX11Texture1>(
101 reinterpret_cast<ID3D11Device*
>(device),
102 static_cast<Texture1 const*>(
object));
111 D3D11_TEXTURE1D_DESC desc;
112 desc.Width = tx.Width;
113 desc.MipLevels = tx.MipLevels;
114 desc.ArraySize = tx.ArraySize;
115 desc.Format = tx.Format;
116 desc.Usage = D3D11_USAGE_STAGING;
121 HRESULT hr = device->CreateTexture1D(&desc,
nullptr,
122 reinterpret_cast<ID3D11Texture1D**>(&
mStaging));
128 D3D11_SHADER_RESOURCE_VIEW_DESC desc;
129 desc.Format = tx.Format;
130 desc.ViewDimension = D3D11_SRV_DIMENSION_TEXTURE1D;
131 desc.Texture1D.MostDetailedMip = 0;
132 desc.Texture1D.MipLevels = tx.MipLevels;
139 D3D11_UNORDERED_ACCESS_VIEW_DESC desc;
140 desc.Format = tx.Format;
141 desc.ViewDimension = D3D11_UAV_DIMENSION_TEXTURE1D;
142 desc.Texture1D.MipSlice = 0;
Texture1 * GetTexture() const
#define D3D11_RESOURCE_MISC_NONE
#define CHECK_HR_RETURN_NONE(msg)
unsigned int GetLength() const
void CreateSRView(ID3D11Device *device, D3D11_TEXTURE1D_DESC const &tx)
GraphicsObjectType GetType() const
ID3D11UnorderedAccessView * mUAView
ID3D11Resource * mStaging
#define LogError(message)
void CreateUAView(ID3D11Device *device, D3D11_TEXTURE1D_DESC const &tx)
ID3D11DeviceChild * mDXObject
char const * GetData() const
void CreateStaging(ID3D11Device *device, D3D11_TEXTURE1D_DESC const &tx)
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[]
CopyType GetCopyType() const
ID3D11Texture1D * GetDXTexture() const
bool WantAutogenerateMipmaps() const
ID3D11ShaderResourceView * mSRView
DX11Texture1(ID3D11Device *device, Texture1 const *texture)
unsigned int GetNumSubresources() const
static std::shared_ptr< GEObject > Create(void *device, GraphicsObject const *object)