Skip to content

Commit

Permalink
Minor code review (microsoft#245)
Browse files Browse the repository at this point in the history
  • Loading branch information
walbourn authored Aug 28, 2024
1 parent 2087943 commit d43b5d3
Show file tree
Hide file tree
Showing 14 changed files with 90 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Src/AlphaTestEffect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,12 @@ class AlphaTestEffect::Impl : public EffectBase<AlphaTestEffectTraits>
Impl(_In_ ID3D12Device* device, uint32_t effectFlags, const EffectPipelineStateDescription& pipelineDescription,
D3D12_COMPARISON_FUNC alphaFunction);

Impl(const Impl&) = delete;
Impl& operator=(const Impl&) = delete;

Impl(Impl&&) = default;
Impl& operator=(Impl&&) = default;

enum RootParameterIndex
{
ConstantBuffer,
Expand Down
6 changes: 6 additions & 0 deletions Src/BasicEffect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,12 @@ class BasicEffect::Impl : public EffectBase<BasicEffectTraits>
public:
Impl(_In_ ID3D12Device* device, uint32_t effectFlags, const EffectPipelineStateDescription& pipelineDescription);

Impl(const Impl&) = delete;
Impl& operator=(const Impl&) = delete;

Impl(Impl&&) = default;
Impl& operator=(Impl&&) = default;

enum RootParameterIndex
{
ConstantBuffer,
Expand Down
6 changes: 6 additions & 0 deletions Src/CommonStates.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -464,6 +464,12 @@ class CommonStates::Impl
}
}

Impl(const Impl&) = delete;
Impl& operator=(const Impl&) = delete;

Impl(Impl&&) = default;
Impl& operator=(Impl&&) = default;

D3D12_GPU_DESCRIPTOR_HANDLE Get(SamplerIndex i) const
{
return mDescriptors.GetGpuHandle(static_cast<size_t>(i));
Expand Down
6 changes: 6 additions & 0 deletions Src/DebugEffect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,12 @@ class DebugEffect::Impl : public EffectBase<DebugEffectTraits>
Impl(_In_ ID3D12Device* device, uint32_t effectFlags, const EffectPipelineStateDescription& pipelineDescription,
DebugEffect::Mode debugMode);

Impl(const Impl&) = delete;
Impl& operator=(const Impl&) = delete;

Impl(Impl&&) = default;
Impl& operator=(Impl&&) = default;

enum RootParameterIndex
{
ConstantBuffer,
Expand Down
6 changes: 6 additions & 0 deletions Src/DualTextureEffect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,12 @@ class DualTextureEffect::Impl : public EffectBase<DualTextureEffectTraits>
public:
Impl(_In_ ID3D12Device* device, uint32_t effectFlags, const EffectPipelineStateDescription& pipelineDescription);

Impl(const Impl&) = delete;
Impl& operator=(const Impl&) = delete;

Impl(Impl&&) = default;
Impl& operator=(Impl&&) = default;

enum RootParameterIndex
{
Texture1SRV,
Expand Down
6 changes: 6 additions & 0 deletions Src/EnvironmentMapEffect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,12 @@ class EnvironmentMapEffect::Impl : public EffectBase<EnvironmentMapEffectTraits>
const EffectPipelineStateDescription& pipelineDescription,
EnvironmentMapEffect::Mapping mapping);

Impl(const Impl&) = delete;
Impl& operator=(const Impl&) = delete;

Impl(Impl&&) = default;
Impl& operator=(Impl&&) = default;

enum RootParameterIndex
{
TextureSRV,
Expand Down
6 changes: 6 additions & 0 deletions Src/GeometricPrimitive.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,12 @@ class GeometricPrimitive::Impl
public:
Impl() noexcept : mIndexCount(0), mVertexBufferView{}, mIndexBufferView{} {}

Impl(const Impl&) = delete;
Impl& operator=(const Impl&) = delete;

Impl(Impl&&) = default;
Impl& operator=(Impl&&) = default;

void Initialize(const VertexCollection& vertices, const IndexCollection& indices, _In_opt_ ID3D12Device* device);

void LoadStaticBuffers(
Expand Down
6 changes: 6 additions & 0 deletions Src/NormalMapEffect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,12 @@ class NormalMapEffect::Impl : public EffectBase<NormalMapEffectTraits>
public:
explicit Impl(_In_ ID3D12Device* device);

Impl(const Impl&) = delete;
Impl& operator=(const Impl&) = delete;

Impl(Impl&&) = default;
Impl& operator=(Impl&&) = default;

void Initialize(
_In_ ID3D12Device* device,
uint32_t effectFlags,
Expand Down
6 changes: 6 additions & 0 deletions Src/PBREffect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,12 @@ class PBREffect::Impl : public EffectBase<PBREffectTraits>
public:
explicit Impl(_In_ ID3D12Device* device);

Impl(const Impl&) = delete;
Impl& operator=(const Impl&) = delete;

Impl(Impl&&) = default;
Impl& operator=(Impl&&) = default;

void Initialize(
_In_ ID3D12Device* device,
uint32_t effectFlags,
Expand Down
6 changes: 6 additions & 0 deletions Src/PrimitiveBatch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,12 @@ class PrimitiveBatchBase::Impl
public:
Impl(_In_ ID3D12Device* device, size_t maxIndices, size_t maxVertices, size_t vertexSize);

Impl(const Impl&) = delete;
Impl& operator=(const Impl&) = delete;

Impl(Impl&&) = default;
Impl& operator=(Impl&&) = default;

void Begin(_In_ ID3D12GraphicsCommandList* cmdList);
void End();

Expand Down
12 changes: 12 additions & 0 deletions Src/ResourceUploadBatch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,12 @@ namespace
generateMipsPSO = CreateGenMipsPipelineState(device, rootSignature.Get(), GenerateMips_main, sizeof(GenerateMips_main));
}

GenerateMipsResources(const GenerateMipsResources&) = delete;
GenerateMipsResources& operator=(const GenerateMipsResources&) = delete;

GenerateMipsResources(GenerateMipsResources&&) = default;
GenerateMipsResources& operator=(GenerateMipsResources&&) = default;

private:
static ComPtr<ID3D12RootSignature> CreateGenMipsRootSignature(
_In_ ID3D12Device* device)
Expand Down Expand Up @@ -315,6 +321,12 @@ class ResourceUploadBatch::Impl
}
}

Impl(const Impl&) = delete;
Impl& operator=(const Impl&) = delete;

Impl(Impl&&) = default;
Impl& operator=(Impl&&) = default;

// Call this before your multiple calls to Upload.
void Begin(D3D12_COMMAND_LIST_TYPE commandType)
{
Expand Down
6 changes: 6 additions & 0 deletions Src/SkinnedEffect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,12 @@ class SkinnedEffect::Impl : public EffectBase<SkinnedEffectTraits>
public:
Impl(_In_ ID3D12Device* device, uint32_t effectFlags, const EffectPipelineStateDescription& pipelineDescription);

Impl(const Impl&) = delete;
Impl& operator=(const Impl&) = delete;

Impl(Impl&&) = default;
Impl& operator=(Impl&&) = default;

enum RootParameterIndex
{
ConstantBuffer,
Expand Down
6 changes: 6 additions & 0 deletions Src/SpriteBatch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,12 @@ XM_ALIGNED_STRUCT(16) SpriteBatch::Impl : public AlignedNew<SpriteBatch::Impl>
const SpriteBatchPipelineStateDescription& psoDesc,
const D3D12_VIEWPORT* viewport);

Impl(const Impl&) = delete;
Impl& operator=(const Impl&) = delete;

Impl(Impl&&) = default;
Impl& operator=(Impl&&) = default;

void XM_CALLCONV Begin(
_In_ ID3D12GraphicsCommandList* commandList,
SpriteSortMode sortMode = SpriteSortMode_Deferred,
Expand Down
6 changes: 6 additions & 0 deletions Src/SpriteFont.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,12 @@ class SpriteFont::Impl
size_t glyphCount,
float lineSpacing) noexcept(false);

Impl(const Impl&) = delete;
Impl& operator=(const Impl&) = delete;

Impl(Impl&&) = default;
Impl& operator=(Impl&&) = default;

Glyph const* FindGlyph(wchar_t character) const;

void SetDefaultCharacter(wchar_t character);
Expand Down

0 comments on commit d43b5d3

Please sign in to comment.