@@ -83,7 +83,7 @@ void InitializeDiligentEngine(HWND NativeWindowHandle)
83
83
// RefCntAutoPtr<ISwapChain > m_pSwapChain;
84
84
switch (m_DeviceType)
85
85
{
86
- case DeviceType::D3D11 :
86
+ case RENDER_DEVICE_TYPE_D3D11 :
87
87
{
88
88
EngineD3D11CreateInfo EngineCI;
89
89
# if ENGINE_DLL
@@ -98,7 +98,7 @@ void InitializeDiligentEngine(HWND NativeWindowHandle)
98
98
}
99
99
break;
100
100
101
- case DeviceType::D3D12 :
101
+ case RENDER_DEVICE_TYPE_D3D12 :
102
102
{
103
103
# if ENGINE_DLL
104
104
// Load the dll and import GetEngineFactoryD3D12() function
@@ -114,7 +114,7 @@ void InitializeDiligentEngine(HWND NativeWindowHandle)
114
114
}
115
115
break;
116
116
117
- case DeviceType::OpenGL :
117
+ case RENDER_DEVICE_TYPE_GL :
118
118
{
119
119
# if EXPLICITLY_LOAD_ENGINE_GL_DLL
120
120
// Load the dll and import GetEngineFactoryOpenGL() function
@@ -130,7 +130,7 @@ void InitializeDiligentEngine(HWND NativeWindowHandle)
130
130
}
131
131
break;
132
132
133
- case DeviceType::Vulkan :
133
+ case RENDER_DEVICE_TYPE_VULKAN :
134
134
{
135
135
# if EXPLICITLY_LOAD_ENGINE_VK_DLL
136
136
// Load the dll and import GetEngineFactoryVk() function
@@ -151,9 +151,9 @@ void InitializeDiligentEngine(HWND NativeWindowHandle)
151
151
}
152
152
```
153
153
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,
155
155
factory 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()`,
157
157
`LoadGraphicsEngineD3D11()`, `LoadGraphicsEngineD3D12()`, or `LoadGraphicsEngineVk()` function. Each function loads appropriate
158
158
dynamic library and imports the functions required to initialize the engine. You need to include the following headers:
159
159
@@ -232,7 +232,7 @@ pFactoryOpenGL->CreateDeviceAndSwapChainGL(
232
232
EngineCI, &m_pDevice, &m_pContext, SCDesc, &m_pSwapChain);
233
233
```
234
234
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:
236
236
237
237
```java
238
238
static
@@ -301,7 +301,7 @@ TexDesc.Height = 1024;
301
301
TexDesc.Format = TEX_FORMAT_RGBA8_UNORM;
302
302
TexDesc.Usage = USAGE_DEFAULT;
303
303
TexDesc.BindFlags = BIND_SHADER_RESOURCE | BIND_RENDER_TARGET | BIND_UNORDERED_ACCESS;
304
- TexDesc.Name = " Sample 2D Texture" ;
304
+ TexDesc.Name = " Sample 2D Texture" ;
305
305
m_pRenderDevice->CreateTexture (TexDesc, nullptr, &m_pTestTex);
306
306
```
307
307
@@ -312,7 +312,7 @@ For every bind flag specified during the texture creation time, the texture obje
312
312
Default shader resource view addresses the entire texture, default render target and depth stencil views reference
313
313
all array slices in the most detailed mip level, and unordered access view references the entire texture. To get a
314
314
default 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()`.
316
316
Use `IBuffer::CreateView()` to create additional views of a buffer.
317
317
318
318
<a name="creating_shaders"></a>
@@ -324,8 +324,9 @@ To create a shader, populate `ShaderCreateInfo` structure:
324
324
ShaderCreateInfo ShaderCI;
325
325
```
326
326
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
329
330
from the platform. Since the host file system is platform-dependent, the structure exposes
330
331
` ShaderCreateInfo::pShaderSourceStreamFactory ` member that is intended to give the engine access to the file system.
331
332
If 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
339
340
* ` SHADER_SOURCE_LANGUAGE_HLSL ` - The shader source is in HLSL. For OpenGL and OpenGLES modes, the source code will be
340
341
converted to GLSL. In Vulkan back-end, the code will be compiled to SPIRV directly.
341
342
* ` 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
342
345
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,
344
347
shader entry point and other parameters.
345
348
346
349
``` cpp
@@ -505,6 +508,9 @@ PSODesc.ResourceLayout.NumImmutableSamplers = 1;
505
508
PSODesc.ResourceLayout.ImmutableSamplers = &ImtblSampler;
506
509
```
507
510
511
+ [ This document] ( https://github.com/DiligentGraphics/DiligentCore/blob/master/doc/TextureSamplers.md ) provides a detailed
512
+ information about working with texture samplers.
513
+
508
514
When all required fields of PSO description structure are set, call ` IRenderDevice::CreateGraphicsPipelineState() `
509
515
to create the PSO object:
510
516
@@ -720,7 +726,7 @@ In submitting any content to this repository,
720
726
and you agree that the content is free of any Intellectual Property claims and you have the right to license it under those terms.
721
727
722
728
Diligent 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
724
730
for each commit and pull request, and the build will fail if any code formatting issue is found. Please refer
725
731
to [ this page] ( https://github.com/DiligentGraphics/DiligentCore/blob/master/doc/code_formatting.md ) for instructions
726
732
on how to set up clang-format and automatic code formatting.
0 commit comments