diff --git a/RenderSystems/Direct3D11/src/OgreD3D11HLSLProgram.cpp b/RenderSystems/Direct3D11/src/OgreD3D11HLSLProgram.cpp index 9151805dfb..828cad4df7 100644 --- a/RenderSystems/Direct3D11/src/OgreD3D11HLSLProgram.cpp +++ b/RenderSystems/Direct3D11/src/OgreD3D11HLSLProgram.cpp @@ -848,7 +848,7 @@ namespace Ogre GET_SIZE_OF_NAMES( memberTypeNameSize, mMemberTypeName, Name ); // clang-format off - int sizeOfData = sizeof(uint32) + mMicroCode.size() + size_t sizeOfData = sizeof(uint32) + mMicroCode.size() + sizeof(uint32) // mConstantBufferSize + sizeof(uint32) // mConstantBufferNr + sizeof(uint32) // mNumSlots @@ -973,7 +973,7 @@ namespace Ogre // create microcode GpuProgramManager::Microcode newMicrocode = - GpuProgramManager::getSingleton().createMicrocode( sizeOfData ); + GpuProgramManager::getSingleton().createMicrocode( (uint32)sizeOfData ); # define WRITE_START( curlist, memberType ) \ { \ diff --git a/RenderSystems/Direct3D11/src/Windowing/WIN32/OgreD3D11WindowWinRT.cpp b/RenderSystems/Direct3D11/src/Windowing/WIN32/OgreD3D11WindowWinRT.cpp index 3fb39a468b..461d9a1dda 100644 --- a/RenderSystems/Direct3D11/src/Windowing/WIN32/OgreD3D11WindowWinRT.cpp +++ b/RenderSystems/Direct3D11/src/Windowing/WIN32/OgreD3D11WindowWinRT.cpp @@ -86,8 +86,8 @@ namespace Ogre Windows::Foundation::Rect rc = mCoreWindow->Bounds; mLeft = (int)floorf( rc.X * scale + 0.5f ); mTop = (int)floorf( rc.Y * scale + 0.5f ); - mRequestedWidth = rc.Width; - mRequestedHeight = rc.Height; + mRequestedWidth = (int)floorf( rc.Width + 0.5f ); + mRequestedHeight = (int)floorf( rc.Height + 0.5f ); } //----------------------------------------------------------------------------------- D3D11WindowCoreWindow::~D3D11WindowCoreWindow() { destroy(); } @@ -176,8 +176,8 @@ namespace Ogre Windows::Foundation::Rect rc = mCoreWindow->Bounds; mLeft = (int)floorf( rc.X * scale + 0.5f ); mTop = (int)floorf( rc.Y * scale + 0.5f ); - mRequestedWidth = rc.Width; - mRequestedHeight = rc.Height; + mRequestedWidth = (int)floorf( rc.Width + 0.5f ); + mRequestedHeight = (int)floorf( rc.Height + 0.5f ); resizeSwapChainBuffers( 0, 0 ); // pass zero to autodetect size } @@ -245,8 +245,8 @@ namespace Ogre static_cast( mSwapChainPanel->ActualHeight ) ); mCompositionScale = Windows::Foundation::Size( mSwapChainPanel->CompositionScaleX, mSwapChainPanel->CompositionScaleY ); - mRequestedWidth = sz.Width; - mRequestedHeight = sz.Height; + mRequestedWidth = (int)floorf( sz.Width + 0.5f ); + mRequestedHeight = (int)floorf( sz.Height + 0.5f ); } //----------------------------------------------------------------------------------- D3D11WindowSwapChainPanel::~D3D11WindowSwapChainPanel() { destroy(); } @@ -363,8 +363,8 @@ namespace Ogre static_cast( mSwapChainPanel->ActualHeight ) ); mCompositionScale = Windows::Foundation::Size( mSwapChainPanel->CompositionScaleX, mSwapChainPanel->CompositionScaleY ); - mRequestedWidth = sz.Width; - mRequestedHeight = sz.Height; + mRequestedWidth = (int)floorf( sz.Width + 0.5f ); + mRequestedHeight = (int)floorf( sz.Height + 0.5f ); int widthPx = std::max( 1, (int)floorf( mRequestedWidth * mCompositionScale.Width + 0.5f ) ); int heightPx = std::max( 1, (int)floorf( mRequestedHeight * mCompositionScale.Height + 0.5f ) );