From 87382bcca0ea984274477af3af1ff8d8c9495ced Mon Sep 17 00:00:00 2001 From: Egor Yusov Date: Tue, 27 Mar 2018 08:58:06 -0700 Subject: Added DebugMessageCallback to EngineCreation attribs --- Graphics/GraphicsEngine/interface/GraphicsTypes.h | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'Graphics/GraphicsEngine') diff --git a/Graphics/GraphicsEngine/interface/GraphicsTypes.h b/Graphics/GraphicsEngine/interface/GraphicsTypes.h index e742f927..c8ee913a 100644 --- a/Graphics/GraphicsEngine/interface/GraphicsTypes.h +++ b/Graphics/GraphicsEngine/interface/GraphicsTypes.h @@ -27,6 +27,7 @@ /// Contains basic graphics engine type defintions #include "../../../Primitives/interface/BasicTypes.h" +#include "../../../Primitives/interface/DebugOutput.h" /// Graphics engine namespace namespace Diligent @@ -951,14 +952,12 @@ namespace Diligent /// Engine creation attibutes struct EngineCreationAttribs { - const Char* strShaderCachePath; /// Pointer to the raw memory allocator that will be used for all memory allocation/deallocation - /// operations in an engine - class IMemoryAllocator *pRawMemAllocator; - EngineCreationAttribs() : - strShaderCachePath(nullptr), - pRawMemAllocator(nullptr) - {} + /// operations in the engine + class IMemoryAllocator *pRawMemAllocator = nullptr; + + /// Pointer to the user-specified debug message callback function + DebugMessageCallbackType DebugMessageCallback = nullptr; }; /// Attributes specific to D3D12 engine -- cgit v1.2.3 From cf7ef96b20bf3f91a9ee623f94800d617bc6ff3c Mon Sep 17 00:00:00 2001 From: Egor Yusov Date: Tue, 27 Mar 2018 18:46:47 -0700 Subject: Added shader compiler log output --- Graphics/GraphicsEngine/interface/Shader.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'Graphics/GraphicsEngine') diff --git a/Graphics/GraphicsEngine/interface/Shader.h b/Graphics/GraphicsEngine/interface/Shader.h index 15df194d..4cac8e82 100644 --- a/Graphics/GraphicsEngine/interface/Shader.h +++ b/Graphics/GraphicsEngine/interface/Shader.h @@ -258,6 +258,13 @@ struct ShaderCreationAttribs /// Shader source language. See Diligent::SHADER_SOURCE_LANGUAGE. SHADER_SOURCE_LANGUAGE SourceLanguage = SHADER_SOURCE_LANGUAGE_DEFAULT; + + /// Memory address where pointer to the compiler messages data blob will be written + + /// The buffer contains two null-terminated strings. The first one is the compiler + /// output message. The second one is the full shader source code including definitions added + /// by the engine. Data blob object must be released by the client. + IDataBlob **ppCompilerOutput = nullptr; }; -- cgit v1.2.3 From f3a224a1f19e9d67cb683a965d1fb88636eabf6c Mon Sep 17 00:00:00 2001 From: Egor Yusov Date: Thu, 29 Mar 2018 18:47:48 -0700 Subject: Implemented hardware adapter and display mode enumeration --- Graphics/GraphicsEngine/interface/GraphicsTypes.h | 87 +++++++++++++++++++++++ 1 file changed, 87 insertions(+) (limited to 'Graphics/GraphicsEngine') diff --git a/Graphics/GraphicsEngine/interface/GraphicsTypes.h b/Graphics/GraphicsEngine/interface/GraphicsTypes.h index c8ee913a..2a223e43 100644 --- a/Graphics/GraphicsEngine/interface/GraphicsTypes.h +++ b/Graphics/GraphicsEngine/interface/GraphicsTypes.h @@ -909,6 +909,93 @@ namespace Diligent {} }; + /// Hardware adapter attributes + struct HardwareAdapterAttribs + { + /// A string that contains the adapter description + char Description[128]; + + /// Dedicated video memory, in bytes + size_t DedicatedVideoMemory; + + /// Dedicated system memory, in bytes + size_t DedicatedSystemMemory; + + /// Dedicated shared memory, in bytes + size_t SharedSystemMemory; + + /// The PCI ID of the hardware vendor + Uint32 VendorId; + + /// The PCI ID of the hardware device + Uint32 DeviceId; + + /// Number of outputs this device has + Uint32 NumOutputs; + }; + + + /// Display mode attributes + struct DisplayModeAttribs + { + /// Flags indicating how an image is stretched to fit a given monitor's resolution. + /// \sa DXGI_MODE_SCALING enumeration on MSDN, + enum SCALING + { + /// Unspecified scaling. + /// D3D Counterpart: DXGI_MODE_SCALING_UNSPECIFIED. + SCALING_UNSPECIFIED = 0, + + /// Specifies no scaling. The image is centered on the display. + /// This flag is typically used for a fixed-dot-pitch display (such as an LED display). + /// D3D Counterpart: DXGI_MODE_SCALING_CENTERED. + SCALING_CENTERED = 1, + + /// Specifies stretched scaling. + /// D3D Counterpart: DXGI_MODE_SCALING_STRETCHED. + SCALING_STRETCHED = 2 + }; + + /// Flags indicating the method the raster uses to create an image on a surface. + /// \sa DXGI_MODE_SCANLINE_ORDER enumeration on MSDN, + enum SCANLINE_ORDER + { + /// Scanline order is unspecified + /// D3D Counterpart: DXGI_MODE_SCANLINE_ORDER_UNSPECIFIED. + SCANLINE_ORDER_UNSPECIFIED = 0, + + /// The image is created from the first scanline to the last without skipping any + /// D3D Counterpart: DXGI_MODE_SCANLINE_ORDER_PROGRESSIVE. + SCANLINE_ORDER_PROGRESSIVE = 1, + + /// The image is created beginning with the upper field + /// D3D Counterpart: DXGI_MODE_SCANLINE_ORDER_UPPER_FIELD_FIRST. + SCANLINE_ORDER_UPPER_FIELD_FIRST = 2, + + /// The image is created beginning with the lower field + /// D3D Counterpart: DXGI_MODE_SCANLINE_ORDER_LOWER_FIELD_FIRST. + SCANLINE_ORDER_LOWER_FIELD_FIRST = 3 + }; + + /// Display resolution width + Uint32 Width = 0; + + /// Display resolution height + Uint32 Height = 0; + + /// Display format + TEXTURE_FORMAT Format = TEX_FORMAT_UNKNOWN; + + /// Display refresh rate + double RefreshRate = 0.0; + + /// The scanline drawing mode. + SCALING Scaling = SCALING_UNSPECIFIED; + + /// The scaling mode. + SCANLINE_ORDER ScanlineOrder = SCANLINE_ORDER_UNSPECIFIED; + }; + /// Swap chain description struct SwapChainDesc { -- cgit v1.2.3 From b0b568e32e854a720e97e1085151f54c7e62f047 Mon Sep 17 00:00:00 2001 From: Egor Yusov Date: Thu, 29 Mar 2018 20:05:30 -0700 Subject: Implemented option to specify hardware adapter when initializing the engine in d3d mode --- Graphics/GraphicsEngine/interface/GraphicsTypes.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'Graphics/GraphicsEngine') diff --git a/Graphics/GraphicsEngine/interface/GraphicsTypes.h b/Graphics/GraphicsEngine/interface/GraphicsTypes.h index 2a223e43..574e4c12 100644 --- a/Graphics/GraphicsEngine/interface/GraphicsTypes.h +++ b/Graphics/GraphicsEngine/interface/GraphicsTypes.h @@ -1050,6 +1050,11 @@ namespace Diligent /// Attributes specific to D3D12 engine struct EngineD3D12Attribs : public EngineCreationAttribs { + static constexpr Uint32 DefaultAdapterId = 0xFFFFFFFF; + + /// Id of the hardware adapter the engine should be initialized on + Uint32 AdapterId = DefaultAdapterId; + /// Size of the CPU descriptor heap allocations for different heap types. Uint32 CPUDescriptorHeapAllocationSize[4] = { -- cgit v1.2.3 From 5677bdafc48e6231a67c01e5d894ed657aa0ecf6 Mon Sep 17 00:00:00 2001 From: Egor Yusov Date: Fri, 30 Mar 2018 09:52:13 -0700 Subject: Implemented initialization in fullscreen mode on Win32 --- Graphics/GraphicsEngine/interface/GraphicsTypes.h | 27 +++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) (limited to 'Graphics/GraphicsEngine') diff --git a/Graphics/GraphicsEngine/interface/GraphicsTypes.h b/Graphics/GraphicsEngine/interface/GraphicsTypes.h index 574e4c12..59bd356c 100644 --- a/Graphics/GraphicsEngine/interface/GraphicsTypes.h +++ b/Graphics/GraphicsEngine/interface/GraphicsTypes.h @@ -986,8 +986,11 @@ namespace Diligent /// Display format TEXTURE_FORMAT Format = TEX_FORMAT_UNKNOWN; - /// Display refresh rate - double RefreshRate = 0.0; + /// Refresh rate numerator + Uint32 RefreshRateNumerator = 0; + + /// Refresh rate denominator + Uint32 RefreshRateDenominator = 0; /// The scanline drawing mode. SCALING Scaling = SCALING_UNSPECIFIED; @@ -1036,6 +1039,26 @@ namespace Diligent {} }; + /// Full screen mode description + /// \sa DXGI_SWAP_CHAIN_FULLSCREEN_DESC structure on MSDN, + struct FullScreenModeDesc + { + /// A Boolean value that specifies whether the swap chain is in fullscreen mode. + Bool Fullscreen = False; + + /// Refresh rate numerator + Uint32 RefreshRateNumerator = 0; + + /// Refresh rate denominator + Uint32 RefreshRateDenominator = 0; + + /// The scanline drawing mode. + DisplayModeAttribs::SCALING Scaling = DisplayModeAttribs::SCALING_UNSPECIFIED; + + /// The scaling mode. + DisplayModeAttribs::SCANLINE_ORDER ScanlineOrder = DisplayModeAttribs::SCANLINE_ORDER_UNSPECIFIED; + }; + /// Engine creation attibutes struct EngineCreationAttribs { -- cgit v1.2.3 From f88358621a3a2ffa1a9b7a87baa84695075337bd Mon Sep 17 00:00:00 2001 From: Egor Yusov Date: Sat, 31 Mar 2018 11:55:55 -0700 Subject: Implemented switching to a fullscreen mode in d3d on Win32 --- Graphics/GraphicsEngine/interface/SwapChain.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'Graphics/GraphicsEngine') diff --git a/Graphics/GraphicsEngine/interface/SwapChain.h b/Graphics/GraphicsEngine/interface/SwapChain.h index 0cdde1ef..87830be0 100644 --- a/Graphics/GraphicsEngine/interface/SwapChain.h +++ b/Graphics/GraphicsEngine/interface/SwapChain.h @@ -54,6 +54,12 @@ public: /// \param [in] NewWidth - New swap chain width, in pixels /// \param [in] NewHeight - New swap chain height, in pixels virtual void Resize( Uint32 NewWidth, Uint32 NewHeight ) = 0; + + /// Sets fullscreen mode (only supported on Win32 platform) + virtual void SetFullscreenMode(const DisplayModeAttribs &DisplayMode) = 0; + + /// Sets windowed mode (only supported on Win32 platform) + virtual void SetWindowedMode() = 0; }; } -- cgit v1.2.3 From a8a3940fa4491963048ade02dcb035eaca4b6eb5 Mon Sep 17 00:00:00 2001 From: Egor Yusov Date: Sat, 31 Mar 2018 16:43:02 -0700 Subject: Added sync interval parameter to ISwapChain::Present() --- Graphics/GraphicsEngine/interface/SwapChain.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'Graphics/GraphicsEngine') diff --git a/Graphics/GraphicsEngine/interface/SwapChain.h b/Graphics/GraphicsEngine/interface/SwapChain.h index 87830be0..578d4fdb 100644 --- a/Graphics/GraphicsEngine/interface/SwapChain.h +++ b/Graphics/GraphicsEngine/interface/SwapChain.h @@ -43,8 +43,8 @@ class ISwapChain : public IObject { public: - /// Presents a rendered image to the user. - virtual void Present() = 0; + /// Presents a rendered image to the user + virtual void Present(Uint32 SyncInterval = 1) = 0; /// Returns the swap chain desctription virtual const SwapChainDesc& GetDesc()const = 0; -- cgit v1.2.3