diff options
| author | JMC47 <JMC4789@gmail.com> | 2022-07-08 15:29:58 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-07-08 15:29:58 -0400 |
| commit | 828afc67356c2299c6056d618eb6b7afe4c843b9 (patch) | |
| tree | cb7809cf9aad689968ec209e8d886b5457ca68dc /Source/Core/VideoBackends/D3D/D3DBoundingBox.cpp | |
| parent | 7cc89f5642cab3b91aef1c8255af857a1607ddf6 (diff) | |
| parent | a8b52663479effc0f404f7c0f8b52bc0ee37b742 (diff) | |
Merge pull request #10673 from iwubcode/spirv-backends
D3D: Generate HLSL from SPIRV*
Diffstat (limited to 'Source/Core/VideoBackends/D3D/D3DBoundingBox.cpp')
| -rw-r--r-- | Source/Core/VideoBackends/D3D/D3DBoundingBox.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/Source/Core/VideoBackends/D3D/D3DBoundingBox.cpp b/Source/Core/VideoBackends/D3D/D3DBoundingBox.cpp index 2eb6da73df..7a6fe64d80 100644 --- a/Source/Core/VideoBackends/D3D/D3DBoundingBox.cpp +++ b/Source/Core/VideoBackends/D3D/D3DBoundingBox.cpp @@ -27,7 +27,8 @@ bool D3DBoundingBox::Initialize() // Create 2 buffers here. // First for unordered access on default pool. auto desc = CD3D11_BUFFER_DESC(NUM_BBOX_VALUES * sizeof(BBoxType), D3D11_BIND_UNORDERED_ACCESS, - D3D11_USAGE_DEFAULT, 0, 0, sizeof(BBoxType)); + D3D11_USAGE_DEFAULT, 0, D3D11_RESOURCE_MISC_BUFFER_ALLOW_RAW_VIEWS, + sizeof(BBoxType)); const BBoxType initial_values[NUM_BBOX_VALUES] = {0, 0, 0, 0}; D3D11_SUBRESOURCE_DATA data; data.pSysMem = initial_values; @@ -44,6 +45,7 @@ bool D3DBoundingBox::Initialize() desc.Usage = D3D11_USAGE_STAGING; desc.CPUAccessFlags = D3D11_CPU_ACCESS_READ; desc.BindFlags = 0; + desc.MiscFlags = 0; hr = D3D::device->CreateBuffer(&desc, nullptr, &m_staging_buffer); ASSERT_MSG(VIDEO, SUCCEEDED(hr), "Failed to create BoundingBox Staging Buffer: {}", DX11HRWrap(hr)); @@ -53,10 +55,10 @@ bool D3DBoundingBox::Initialize() // UAV is required to allow concurrent access. D3D11_UNORDERED_ACCESS_VIEW_DESC UAVdesc = {}; - UAVdesc.Format = DXGI_FORMAT_R32_SINT; + UAVdesc.Format = DXGI_FORMAT_R32_TYPELESS; UAVdesc.ViewDimension = D3D11_UAV_DIMENSION_BUFFER; UAVdesc.Buffer.FirstElement = 0; - UAVdesc.Buffer.Flags = 0; + UAVdesc.Buffer.Flags = D3D11_BUFFER_UAV_FLAG_RAW; UAVdesc.Buffer.NumElements = NUM_BBOX_VALUES; hr = D3D::device->CreateUnorderedAccessView(m_buffer.Get(), &UAVdesc, &m_uav); ASSERT_MSG(VIDEO, SUCCEEDED(hr), "Failed to create BoundingBox UAV: {}", DX11HRWrap(hr)); |
