Skip to content
Permalink
Browse files

D3D11: Use D3DCommon where appropriate

  • Loading branch information...
stenzek committed Mar 9, 2019
1 parent ea15080 commit 3d8014beb565d0c18d511438957cbed668da8fb2
@@ -6,6 +6,7 @@
#include "Common/CommonTypes.h"
#include "Common/MsgHandler.h"
#include "VideoBackends/D3D/D3DState.h"
#include "VideoBackends/D3DCommon/Common.h"
#include "VideoCommon/VideoConfig.h"

namespace DX11
@@ -35,15 +36,15 @@ void BBox::Init()
HRESULT hr;
hr = D3D::device->CreateBuffer(&desc, &data, &s_bbox_buffer);
CHECK(SUCCEEDED(hr), "Create BoundingBox Buffer.");
D3D::SetDebugObjectName(s_bbox_buffer, "BoundingBox Buffer");
D3DCommon::SetDebugObjectName(s_bbox_buffer, "BoundingBox Buffer");

// Second to use as a staging buffer.
desc.Usage = D3D11_USAGE_STAGING;
desc.CPUAccessFlags = D3D11_CPU_ACCESS_READ;
desc.BindFlags = 0;
hr = D3D::device->CreateBuffer(&desc, nullptr, &s_bbox_staging_buffer);
CHECK(SUCCEEDED(hr), "Create BoundingBox Staging Buffer.");
D3D::SetDebugObjectName(s_bbox_staging_buffer, "BoundingBox Staging Buffer");
D3DCommon::SetDebugObjectName(s_bbox_staging_buffer, "BoundingBox Staging Buffer");

// UAV is required to allow concurrent access.
D3D11_UNORDERED_ACCESS_VIEW_DESC UAVdesc = {};
@@ -54,7 +55,7 @@ void BBox::Init()
UAVdesc.Buffer.NumElements = 4;
hr = D3D::device->CreateUnorderedAccessView(s_bbox_buffer, &UAVdesc, &s_bbox_uav);
CHECK(SUCCEEDED(hr), "Create BoundingBox UAV.");
D3D::SetDebugObjectName(s_bbox_uav, "BoundingBox UAV");
D3DCommon::SetDebugObjectName(s_bbox_uav, "BoundingBox UAV");
D3D::stateman->SetOMUAV(s_bbox_uav);
}
}
@@ -26,4 +26,5 @@ target_link_libraries(videod3d
PUBLIC
common
videocommon
videod3dcommon
)
@@ -46,6 +46,7 @@
<ClCompile Include="NativeVertexFormat.cpp" />
<ClCompile Include="PerfQuery.cpp" />
<ClCompile Include="Render.cpp" />
<ClCompile Include="SwapChain.cpp" />
<ClCompile Include="VertexManager.cpp" />
</ItemGroup>
<ItemGroup>
@@ -57,13 +58,17 @@
<ClInclude Include="DXTexture.h" />
<ClInclude Include="PerfQuery.h" />
<ClInclude Include="Render.h" />
<ClInclude Include="SwapChain.h" />
<ClInclude Include="VertexManager.h" />
<ClInclude Include="VideoBackend.h" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="$(CoreDir)VideoCommon\VideoCommon.vcxproj">
<Project>{3de9ee35-3e91-4f27-a014-2866ad8c3fe3}</Project>
</ProjectReference>
<ProjectReference Include="..\D3DCommon\D3DCommon.vcxproj">
<Project>{dea96cf2-f237-4a1a-b32f-c916769efb50}</Project>
</ProjectReference>
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
@@ -40,6 +40,9 @@
<ClCompile Include="DXPipeline.cpp">
<Filter>Render</Filter>
</ClCompile>
<ClCompile Include="SwapChain.cpp">
<Filter>Render</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="D3DBase.h">
@@ -70,5 +73,8 @@
<ClInclude Include="DXPipeline.h">
<Filter>Render</Filter>
</ClInclude>
<ClInclude Include="SwapChain.h">
<Filter>Render</Filter>
</ClInclude>
</ItemGroup>
</Project>

0 comments on commit 3d8014b

Please sign in to comment.
You can’t perform that action at this time.