Fix UWP build

This commit is contained in:
Wojtek Figat
2022-09-06 19:35:11 +02:00
parent 450eedda02
commit 73d0fc4973
3 changed files with 8 additions and 11 deletions

View File

@@ -277,7 +277,9 @@ bool GPUDeviceDX11::Init()
&& GetModuleHandleA("renderdoc.dll") == nullptr // Disable tearing with RenderDoc (prevents crashing) && GetModuleHandleA("renderdoc.dll") == nullptr // Disable tearing with RenderDoc (prevents crashing)
#endif #endif
) )
AllowTearing = true; {
_allowTearing = true;
}
} }
// Get flags and device type base on current configuration // Get flags and device type base on current configuration

View File

@@ -20,7 +20,6 @@ class GPUDeviceDX11 : public GPUDeviceDX
{ {
friend GPUContextDX11; friend GPUContextDX11;
friend GPUSwapChainDX11; friend GPUSwapChainDX11;
private: private:
// Private Stuff // Private Stuff
@@ -29,6 +28,7 @@ private:
IDXGIFactory* _factoryDXGI; IDXGIFactory* _factoryDXGI;
GPUContextDX11* _mainContext; GPUContextDX11* _mainContext;
bool _allowTearing = false;
// Static Samplers // Static Samplers
ID3D11SamplerState* _samplerLinearClamp; ID3D11SamplerState* _samplerLinearClamp;
@@ -45,15 +45,10 @@ private:
ID3D11DepthStencilState* DepthStencilStates[9 * 2 * 2]; // Index = ComparisonFunc[0-8] + DepthTestEnable[0?9] + DepthWriteEnable[0?18] ID3D11DepthStencilState* DepthStencilStates[9 * 2 * 2]; // Index = ComparisonFunc[0-8] + DepthTestEnable[0?9] + DepthWriteEnable[0?18]
public: public:
static GPUDevice* Create(); static GPUDevice* Create();
GPUDeviceDX11(IDXGIFactory* dxgiFactory, GPUAdapterDX* adapter); GPUDeviceDX11(IDXGIFactory* dxgiFactory, GPUAdapterDX* adapter);
~GPUDeviceDX11(); ~GPUDeviceDX11();
public:
bool AllowTearing = false;
public: public:
// Gets DX11 device // Gets DX11 device
@@ -79,8 +74,6 @@ public:
return _mainContext; return _mainContext;
} }
public:
ID3D11BlendState* GetBlendState(const BlendingMode& blending); ID3D11BlendState* GetBlendState(const BlendingMode& blending);
public: public:

View File

@@ -16,9 +16,11 @@ GPUSwapChainDX11::GPUSwapChainDX11(GPUDeviceDX11* device, Window* window)
, _windowHandle(static_cast<IUnknown*>(window->GetNativePtr())) , _windowHandle(static_cast<IUnknown*>(window->GetNativePtr()))
#endif #endif
, _swapChain(nullptr) , _swapChain(nullptr)
, _backBuffer(nullptr) #if PLATFORM_WINDOWS
, _allowTearing(false) , _allowTearing(false)
, _isFullscreen(false) , _isFullscreen(false)
#endif
, _backBuffer(nullptr)
{ {
ASSERT(_windowHandle); ASSERT(_windowHandle);
_window = window; _window = window;
@@ -162,7 +164,7 @@ bool GPUSwapChainDX11::Resize(int32 width, int32 height)
_device->WaitForGPU(); _device->WaitForGPU();
GPUDeviceLock lock(_device); GPUDeviceLock lock(_device);
#if PLATFORM_WINDOWS #if PLATFORM_WINDOWS
_allowTearing = _device->AllowTearing; _allowTearing = _device->_allowTearing;
#endif #endif
_format = GPU_BACK_BUFFER_PIXEL_FORMAT; _format = GPU_BACK_BUFFER_PIXEL_FORMAT;