出于某种原因,下面的代码会给我一个内存不足的错误。我错过了什么?
for(int n = 0; n < 512; ++n)
{
D3D11_TEXTURE2D_DESC texture_desc = {};
texture_desc.Width = 1920;
texture_desc.Height = 1080;
texture_desc.MipLevels = 1;
texture_desc.ArraySize = 1;
texture_desc.Format = DXGI_FORMAT_R8G8B8A8_UNORM;
texture_desc.SampleDesc.Count = 1;
texture_desc.Usage = D3D11_USAGE_DEFAULT;
texture_desc.BindFlags = D3D11_BIND_RENDER_TARGET | D3D11_BIND_SHADER_RESOURCE;
ID3D11Texture2D* target_d3d_ptr;
HRESULT hr = this->device_ptr->CreateTexture2D(&texture_desc, nullptr, &target_d3d_ptr);
if(FAILED(hr))
throw runtime_error(_com_error(hr).ErrorMessage());
target_d3d_ptr->Release();
}