6.6.1 patched files

This commit is contained in:
kleuter
2023-12-06 14:39:10 +01:00
parent b752f623ec
commit 161231b111
22 changed files with 736 additions and 302 deletions

View File

@ -10,6 +10,8 @@
#include <QtCore/private/qsystemerror_p.h>
#include "qrhid3dhelpers_p.h"
#include <VersionHelpers.h>
QT_BEGIN_NAMESPACE
using namespace Qt::StringLiterals;
@ -155,13 +157,22 @@ inline Int aligned(Int v, Int byteAlign)
static IDXGIFactory1 *createDXGIFactory2()
{
typedef HRESULT(WINAPI* CreateDXGIFactory2Func) (UINT flags, REFIID riid, void** factory);
static CreateDXGIFactory2Func myCreateDXGIFactory2 =
(CreateDXGIFactory2Func)::GetProcAddress(::GetModuleHandle(L"dxgi"), "CreateDXGIFactory2");
IDXGIFactory1 *result = nullptr;
const HRESULT hr = CreateDXGIFactory2(0, __uuidof(IDXGIFactory2), reinterpret_cast<void **>(&result));
if (FAILED(hr)) {
qWarning("CreateDXGIFactory2() failed to create DXGI factory: %s",
qPrintable(QSystemError::windowsComString(hr)));
result = nullptr;
if (myCreateDXGIFactory2)
{
const HRESULT hr = myCreateDXGIFactory2(0, __uuidof(IDXGIFactory2), reinterpret_cast<void **>(&result));
if (FAILED(hr)) {
qWarning("CreateDXGIFactory2() failed to create DXGI factory: %s",
qPrintable(QSystemError::windowsComString(hr)));
result = nullptr;
}
}
return result;
}
@ -4999,6 +5010,14 @@ static const DXGI_FORMAT DEFAULT_SRGB_FORMAT = DXGI_FORMAT_R8G8B8A8_UNORM_SRGB;
bool QD3D11SwapChain::createOrResize()
{
if (IsWindows10OrGreater())
{
// continue
}
else
{
return createOrResizeWin7();
}
// Can be called multiple times due to window resizes - that is not the
// same as a simple destroy+create (as with other resources). Just need to
// resize the buffers then.
@ -5267,4 +5286,9 @@ bool QD3D11SwapChain::createOrResize()
return true;
}
bool QD3D11SwapChain::createOrResizeWin7()
{
return false; // not implemented yet ;(
}
QT_END_NAMESPACE