diff options
| author | Egor Yusov <egor.yusov@gmail.com> | 2018-04-01 21:29:40 +0000 |
|---|---|---|
| committer | Egor Yusov <egor.yusov@gmail.com> | 2018-04-01 21:29:40 +0000 |
| commit | 6438621293a4dc5b12def1954375aa41e661bba4 (patch) | |
| tree | 39660542c2d1d63fb1d2db26cb911f88b759b2fc /Graphics/GraphicsEngine | |
| parent | Implementing texture views in Vulkan (diff) | |
| parent | Added comment (diff) | |
| download | DiligentCore-6438621293a4dc5b12def1954375aa41e661bba4.tar.gz DiligentCore-6438621293a4dc5b12def1954375aa41e661bba4.zip | |
Merge branch 'master'
Diffstat (limited to 'Graphics/GraphicsEngine')
| -rw-r--r-- | Graphics/GraphicsEngine/interface/GraphicsTypes.h | 128 | ||||
| -rw-r--r-- | Graphics/GraphicsEngine/interface/Shader.h | 7 | ||||
| -rw-r--r-- | Graphics/GraphicsEngine/interface/SwapChain.h | 10 |
3 files changed, 136 insertions, 9 deletions
diff --git a/Graphics/GraphicsEngine/interface/GraphicsTypes.h b/Graphics/GraphicsEngine/interface/GraphicsTypes.h index aac116ad..57d591ee 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 @@ -908,6 +909,96 @@ 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 <a href = "https://msdn.microsoft.com/en-us/library/windows/desktop/bb173066(v=vs.85).aspx">DXGI_MODE_SCALING enumeration on MSDN</a>, + 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 <a href = "https://msdn.microsoft.com/en-us/library/windows/desktop/bb173067">DXGI_MODE_SCANLINE_ORDER enumeration on MSDN</a>, + 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; + + /// Refresh rate numerator + Uint32 RefreshRateNumerator = 0; + + /// Refresh rate denominator + Uint32 RefreshRateDenominator = 0; + + /// The scanline drawing mode. + SCALING Scaling = SCALING_UNSPECIFIED; + + /// The scaling mode. + SCANLINE_ORDER ScanlineOrder = SCANLINE_ORDER_UNSPECIFIED; + }; + /// Swap chain description struct SwapChainDesc { @@ -948,22 +1039,45 @@ namespace Diligent {} }; + /// Full screen mode description + /// \sa <a href = "https://msdn.microsoft.com/en-us/library/windows/desktop/hh404531(v=vs.85).aspx">DXGI_SWAP_CHAIN_FULLSCREEN_DESC structure on MSDN</a>, + 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 { - 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 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] = { 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; }; diff --git a/Graphics/GraphicsEngine/interface/SwapChain.h b/Graphics/GraphicsEngine/interface/SwapChain.h index 0cdde1ef..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; @@ -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; }; } |
