Skip to content

Commit

Permalink
Rename D3D11On12::D3D11On12RenderTargetView to D3D11On12::RenderTarge…
Browse files Browse the repository at this point in the history
…tView
  • Loading branch information
fredemmott committed Aug 28, 2022
1 parent 2587c5c commit f653941
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 18 deletions.
2 changes: 1 addition & 1 deletion src/injectables/OculusD3D12Kneeboard.cpp
Expand Up @@ -97,7 +97,7 @@ ovrTextureSwapChain OculusD3D12Kneeboard::CreateSwapChain(

layerRenderTargets.at(i)
= std::static_pointer_cast<D3D11::IRenderTargetViewFactory>(
std::make_shared<D3D11On12::D3D11On12RenderTargetViewFactory>(
std::make_shared<D3D11On12::RenderTargetViewFactory>(
mDeviceResources, texture12));
}

Expand Down
2 changes: 1 addition & 1 deletion src/injectables/OpenXRD3D12Kneeboard.cpp
Expand Up @@ -148,7 +148,7 @@ XrSwapchain OpenXRD3D12Kneeboard::CreateSwapChain(
texture12.copy_from(images.at(i).texture);
mRenderTargetViews.at(layerIndex).at(i)
= std::static_pointer_cast<D3D11::IRenderTargetViewFactory>(
std::make_shared<D3D11On12::D3D11On12RenderTargetViewFactory>(
std::make_shared<D3D11On12::RenderTargetViewFactory>(
mDeviceResources,
texture12,
mDoubleBufferForVarjoQuirk ? D3D11On12::Flags::DoubleBuffer
Expand Down
15 changes: 7 additions & 8 deletions src/lib/D3D11On12.cpp
Expand Up @@ -25,7 +25,7 @@

namespace OpenKneeboard::D3D11On12 {

D3D11On12RenderTargetView::D3D11On12RenderTargetView(
RenderTargetView::RenderTargetView(
const DeviceResources& deviceResources,
const winrt::com_ptr<ID3D12Resource>& texture12,
const winrt::com_ptr<ID3D11Texture2D>& texture11,
Expand All @@ -42,7 +42,7 @@ D3D11On12RenderTargetView::D3D11On12RenderTargetView(
}
}

D3D11On12RenderTargetView::~D3D11On12RenderTargetView() {
RenderTargetView::~RenderTargetView() {
if (!mBufferTexture11) {
auto resources = static_cast<ID3D11Resource*>(mTexture11.get());
mDeviceResources.m11on12->ReleaseWrappedResources(&resources, 1);
Expand Down Expand Up @@ -98,11 +98,11 @@ D3D11On12RenderTargetView::~D3D11On12RenderTargetView() {
mDeviceResources.mCommandQueue12->ExecuteCommandLists(1, &commandLists);
}

ID3D11RenderTargetView* D3D11On12RenderTargetView::Get() const {
ID3D11RenderTargetView* RenderTargetView::Get() const {
return mRenderTargetView.get();
}

D3D11On12RenderTargetViewFactory::D3D11On12RenderTargetViewFactory(
RenderTargetViewFactory::RenderTargetViewFactory(
const DeviceResources& deviceResources,
const winrt::com_ptr<ID3D12Resource>& texture12,
Flags flags)
Expand Down Expand Up @@ -144,11 +144,10 @@ D3D11On12RenderTargetViewFactory::D3D11On12RenderTargetViewFactory(
mRenderTargetView.put()));
}

D3D11On12RenderTargetViewFactory::~D3D11On12RenderTargetViewFactory() = default;
RenderTargetViewFactory::~RenderTargetViewFactory() = default;

std::unique_ptr<D3D11::IRenderTargetView>
D3D11On12RenderTargetViewFactory::Get() const {
return std::make_unique<D3D11On12RenderTargetView>(
std::unique_ptr<D3D11::IRenderTargetView> RenderTargetViewFactory::Get() const {
return std::make_unique<RenderTargetView>(
mDeviceResources,
mTexture12,
mTexture11,
Expand Down
15 changes: 7 additions & 8 deletions src/lib/include/OpenKneeboard/D3D11On12.h
Expand Up @@ -39,16 +39,16 @@ enum class Flags : uint16_t {
DoubleBuffer = 1,// For Varjo
};

class D3D11On12RenderTargetView final : public D3D11::IRenderTargetView {
class RenderTargetView final : public D3D11::IRenderTargetView {
public:
D3D11On12RenderTargetView() = delete;
D3D11On12RenderTargetView(
RenderTargetView() = delete;
RenderTargetView(
const DeviceResources&,
const winrt::com_ptr<ID3D12Resource>& texture12,
const winrt::com_ptr<ID3D11Texture2D>& texture11,
const winrt::com_ptr<ID3D11Texture2D>& bufferTexture11,
const winrt::com_ptr<ID3D11RenderTargetView>&);
~D3D11On12RenderTargetView();
~RenderTargetView();

virtual ID3D11RenderTargetView* Get() const override;

Expand All @@ -60,14 +60,13 @@ class D3D11On12RenderTargetView final : public D3D11::IRenderTargetView {
winrt::com_ptr<ID3D11RenderTargetView> mRenderTargetView;
};

class D3D11On12RenderTargetViewFactory final
: public D3D11::IRenderTargetViewFactory {
class RenderTargetViewFactory final : public D3D11::IRenderTargetViewFactory {
public:
D3D11On12RenderTargetViewFactory(
RenderTargetViewFactory(
const DeviceResources&,
const winrt::com_ptr<ID3D12Resource>& texture12,
Flags flags = Flags::None);
virtual ~D3D11On12RenderTargetViewFactory();
virtual ~RenderTargetViewFactory();

virtual std::unique_ptr<D3D11::IRenderTargetView> Get() const override;

Expand Down

0 comments on commit f653941

Please sign in to comment.