@@ -83,7 +83,7 @@ void InitializeDiligentEngine(HWND NativeWindowHandle)
8383 // RefCntAutoPtr<ISwapChain > m_pSwapChain;
8484 switch (m_DeviceType)
8585 {
86- case DeviceType::D3D11 :
86+ case RENDER_DEVICE_TYPE_D3D11 :
8787 {
8888 EngineD3D11CreateInfo EngineCI;
8989# if ENGINE_DLL
@@ -98,7 +98,7 @@ void InitializeDiligentEngine(HWND NativeWindowHandle)
9898 }
9999 break;
100100
101- case DeviceType::D3D12 :
101+ case RENDER_DEVICE_TYPE_D3D12 :
102102 {
103103# if ENGINE_DLL
104104 // Load the dll and import GetEngineFactoryD3D12() function
@@ -114,7 +114,7 @@ void InitializeDiligentEngine(HWND NativeWindowHandle)
114114 }
115115 break;
116116
117- case DeviceType::OpenGL :
117+ case RENDER_DEVICE_TYPE_GL :
118118 {
119119# if EXPLICITLY_LOAD_ENGINE_GL_DLL
120120 // Load the dll and import GetEngineFactoryOpenGL() function
@@ -130,7 +130,7 @@ void InitializeDiligentEngine(HWND NativeWindowHandle)
130130 }
131131 break;
132132
133- case DeviceType::Vulkan :
133+ case RENDER_DEVICE_TYPE_VULKAN :
134134 {
135135# if EXPLICITLY_LOAD_ENGINE_VK_DLL
136136 // Load the dll and import GetEngineFactoryVk() function
@@ -151,9 +151,9 @@ void InitializeDiligentEngine(HWND NativeWindowHandle)
151151}
152152```
153153
154- On Windows, the engine can be statically linked to the application or built as a separate DLL. In the former case,
154+ On Windows, the engine can be statically linked to the application or built as a separate DLL. In the first case,
155155factory functions `GetEngineFactoryOpenGL()`, `GetEngineFactoryD3D11()`, `GetEngineFactoryD3D12()`, and `GetEngineFactoryVk()`
156- can be called directly. In the latter case, you need to load the DLL into the process's address space using `LoadGraphicsEngineOpenGL()`,
156+ can be called directly. In the second case, you need to load the DLL into the process's address space using `LoadGraphicsEngineOpenGL()`,
157157`LoadGraphicsEngineD3D11()`, `LoadGraphicsEngineD3D12()`, or `LoadGraphicsEngineVk()` function. Each function loads appropriate
158158dynamic library and imports the functions required to initialize the engine. You need to include the following headers:
159159
@@ -232,7 +232,7 @@ pFactoryOpenGL->CreateDeviceAndSwapChainGL(
232232 EngineCI, &m_pDevice, &m_pContext, SCDesc, &m_pSwapChain);
233233```
234234
235- If engine is built as dynamic library, the library needs to be loaded by the native activity. The following code shows one possible way:
235+ If the engine is built as dynamic library, the library needs to be loaded by the native activity. The following code shows one possible way:
236236
237237```java
238238static
@@ -301,7 +301,7 @@ TexDesc.Height = 1024;
301301TexDesc.Format = TEX_FORMAT_RGBA8_UNORM;
302302TexDesc.Usage = USAGE_DEFAULT;
303303TexDesc.BindFlags = BIND_SHADER_RESOURCE | BIND_RENDER_TARGET | BIND_UNORDERED_ACCESS;
304- TexDesc.Name = " Sample 2D Texture" ;
304+ TexDesc.Name = " Sample 2D Texture" ;
305305m_pRenderDevice->CreateTexture (TexDesc, nullptr, &m_pTestTex);
306306```
307307
@@ -312,7 +312,7 @@ For every bind flag specified during the texture creation time, the texture obje
312312Default shader resource view addresses the entire texture, default render target and depth stencil views reference
313313all array slices in the most detailed mip level, and unordered access view references the entire texture. To get a
314314default view from the texture, use `ITexture::GetDefaultView()` function. Note that this function does not increment
315- the reference counter on the returned interface. You can create additional texture views using `ITexture::CreateView()`.
315+ the reference counter of the returned interface. You can create additional texture views using `ITexture::CreateView()`.
316316Use `IBuffer::CreateView()` to create additional views of a buffer.
317317
318318<a name="creating_shaders"></a>
@@ -324,8 +324,9 @@ To create a shader, populate `ShaderCreateInfo` structure:
324324ShaderCreateInfo ShaderCI;
325325```
326326
327- There are two ways to create a shader. The first way is to provide a pointer to the shader source code through
328- ` ShaderCreateInfo::Source ` member. The second way is to provide a file name. Graphics Engine is entirely decoupled
327+ There are three ways to create a shader. The first way is to provide a pointer to the shader source code through
328+ ` ShaderCreateInfo::Source ` member. The second way is to provide a file name. The third way is to provide a pointer
329+ to the compiled byte code through ` ShaderCreateInfo::ByteCode ` member. Graphics Engine is entirely decoupled
329330from the platform. Since the host file system is platform-dependent, the structure exposes
330331` ShaderCreateInfo::pShaderSourceStreamFactory ` member that is intended to give the engine access to the file system.
331332If you provided the source file name, you must also provide a non-null pointer to the shader source stream factory.
@@ -339,8 +340,10 @@ An important member is `ShaderCreateInfo::SourceLanguage`. The following are val
339340* ` SHADER_SOURCE_LANGUAGE_HLSL ` - The shader source is in HLSL. For OpenGL and OpenGLES modes, the source code will be
340341 converted to GLSL. In Vulkan back-end, the code will be compiled to SPIRV directly.
341342* ` SHADER_SOURCE_LANGUAGE_GLSL ` - The shader source is in GLSL.
343+ * ` SHADER_SOURCE_LANGUAGE_GLSL_VERBATIM ` - The shader source language is GLSL and should be compiled verbatim
344+ * ` SHADER_SOURCE_LANGUAGE_MSL ` - The source language is Metal Shading Language
342345
343- Other members of the ` ShaderCreateInfo ` structure define shader include search directories, shader macro definitions,
346+ Other members of the ` ShaderCreateInfo ` structure define the shader include search directories, shader macro definitions,
344347shader entry point and other parameters.
345348
346349``` cpp
@@ -505,6 +508,9 @@ PSODesc.ResourceLayout.NumImmutableSamplers = 1;
505508PSODesc.ResourceLayout.ImmutableSamplers = &ImtblSampler;
506509```
507510
511+ [ This document] ( https://github.com/DiligentGraphics/DiligentCore/blob/master/doc/TextureSamplers.md ) provides a detailed
512+ information about working with texture samplers.
513+
508514When all required fields of PSO description structure are set, call ` IRenderDevice::CreateGraphicsPipelineState() `
509515to create the PSO object:
510516
@@ -720,7 +726,7 @@ In submitting any content to this repository,
720726and you agree that the content is free of any Intellectual Property claims and you have the right to license it under those terms.
721727
722728Diligent Engine uses [ clang-format] ( https://clang.llvm.org/docs/ClangFormat.html ) to ensure
723- consistent source code style throughout the code base. The format is validated by appveyor and travis
729+ consistent source code style throughout the code base. The format is validated by CI
724730for each commit and pull request, and the build will fail if any code formatting issue is found. Please refer
725731to [ this page] ( https://github.com/DiligentGraphics/DiligentCore/blob/master/doc/code_formatting.md ) for instructions
726732on how to set up clang-format and automatic code formatting.
0 commit comments