Skip to content

Commit

Permalink
D3D11: drop superfluous ColourValue mapping
Browse files Browse the repository at this point in the history
  • Loading branch information
paroj committed Oct 14, 2021
1 parent 77a06b1 commit 8a5d4db
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 15 deletions.
2 changes: 0 additions & 2 deletions RenderSystems/Direct3D11/include/OgreD3D11Mappings.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,6 @@ namespace Ogre
/// Get vertex semantic
static LPCSTR get(VertexElementSemantic sem);
static VertexElementSemantic get(LPCSTR sem);
/// Get dx11 color
static void get(const ColourValue& inColour, float * outColour );

/// utility method, generates Ogre PixelBox using usual parameters and dataPtr/rowPitch/slicePitch from D3D11_MAPPED_SUBRESOURCE
static PixelBox getPixelBoxWithMapping(D3D11_BOX extents, DXGI_FORMAT pixelFormat, const D3D11_MAPPED_SUBRESOURCE& mapping);
Expand Down
8 changes: 0 additions & 8 deletions RenderSystems/Direct3D11/src/OgreD3D11Mappings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -402,14 +402,6 @@ namespace Ogre
return "";
}
//---------------------------------------------------------------------
void D3D11Mappings::get(const ColourValue& inColour, float * outColour )
{
outColour[0] = inColour.r;
outColour[1] = inColour.g;
outColour[2] = inColour.b;
outColour[3] = inColour.a;
}
//---------------------------------------------------------------------
PixelFormat D3D11Mappings::_getPF(DXGI_FORMAT d3dPF)
{
switch(d3dPF)
Expand Down
5 changes: 1 addition & 4 deletions RenderSystems/Direct3D11/src/OgreD3D11RenderSystem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2583,14 +2583,11 @@ namespace Ogre

if (buffers & FBT_COLOUR)
{
float ClearColor[4];
D3D11Mappings::get(colour, ClearColor);

// Clear all views
uint numberOfViews = d3d11RenderTarget->getNumberOfViews();
for (uint i = 0; i < numberOfViews; ++i)
{
mDevice.GetImmediateContext()->ClearRenderTargetView(pRTView[i], ClearColor);
mDevice.GetImmediateContext()->ClearRenderTargetView(pRTView[i], colour.ptr());
}

}
Expand Down
2 changes: 1 addition & 1 deletion RenderSystems/Direct3D11/src/OgreD3D11TextureManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ namespace Ogre
{
auto borderColour =
(reversedZ && mCompareEnabled) ? ColourValue::White - mBorderColour : mBorderColour;
D3D11Mappings::get(borderColour, desc.BorderColor);
memcpy(desc.BorderColor, borderColour.ptr(), sizeof(float)*4);
}

OGRE_CHECK_DX_ERROR(mDevice->CreateSamplerState(&desc, mState.ReleaseAndGetAddressOf()));
Expand Down

0 comments on commit 8a5d4db

Please sign in to comment.