当我尝试创建顶点缓冲区时,它失败并且HRESULT
值为INVALID_ARGUMENT
。源代码如下:
D3D11_BUFFER_DESC bufferDesc;
D3D11_SUBRESOURCE_DATA bufferData;
bufferData.pSysMem = NULL;
bufferData.SysMemPitch = NULL;
bufferData.SysMemSlicePitch = NULL;
bufferDesc.ByteWidth = 1024 * sizeof(SpriteVertex);
bufferDesc.Usage = D3D11_USAGE_DEFAULT;
bufferDesc.BindFlags = D3D11_BIND_VERTEX_BUFFER;
bufferDesc.CPUAccessFlags = NULL;
bufferDesc.MiscFlags = NULL;
bufferDesc.StructureByteStride = sizeof(SpriteVertex);
pDevice->CreateBuffer(&bufferDesc, &bufferData, &m_pVertexBuffer);
有人知道为什么会出现此错误吗?