@@ -42,21 +42,22 @@ RefCntAutoPtr<IBuffer> CreateVertexBuffer(IRenderDevice* pDevice)
4242
4343 // Cube vertices
4444
45- // (-1,+1,+1)________________(+1,+1,+1)
45+ // (-1,+1,+1)________________(+1,+1,+1)
4646 // /| /|
4747 // / | / |
4848 // / | / |
4949 // / | / |
5050 // (-1,-1,+1) /____|__________/(+1,-1,+1)
51- // | |__________|____|
51+ // | |__________|____|
5252 // | /(-1,+1,-1) | /(+1,+1,-1)
5353 // | / | /
5454 // | / | /
5555 // |/ | /
56- // /_______________|/
56+ // /_______________|/
5757 // (-1,-1,-1) (+1,-1,-1)
58- //
58+ //
5959
60+ // clang-format off
6061 Vertex CubeVerts[] =
6162 {
6263 {float3 (-1 ,-1 ,-1 ), float2 (0 ,1 )},
@@ -89,6 +90,7 @@ RefCntAutoPtr<IBuffer> CreateVertexBuffer(IRenderDevice* pDevice)
8990 {float3 (+1 ,+1 ,+1 ), float2 (0 ,0 )},
9091 {float3 (-1 ,+1 ,+1 ), float2 (1 ,0 )}
9192 };
93+ // clang-format on
9294
9395 BufferDesc VertBuffDesc;
9496 VertBuffDesc.Name = " Cube vertex buffer" ;
@@ -107,6 +109,7 @@ RefCntAutoPtr<IBuffer> CreateVertexBuffer(IRenderDevice* pDevice)
107109
108110RefCntAutoPtr<IBuffer> CreateIndexBuffer (IRenderDevice* pDevice)
109111{
112+ // clang-format off
110113 Uint32 Indices[] =
111114 {
112115 2 ,0 ,1 , 2 ,3 ,0 ,
@@ -116,6 +119,7 @@ RefCntAutoPtr<IBuffer> CreateIndexBuffer(IRenderDevice* pDevice)
116119 16 ,18 ,17 , 16 ,19 ,18 ,
117120 20 ,21 ,22 , 20 ,22 ,23
118121 };
122+ // clang-format on
119123
120124 BufferDesc IndBuffDesc;
121125 IndBuffDesc.Name = " Cube index buffer" ;
@@ -146,19 +150,20 @@ RefCntAutoPtr<IPipelineState> CreatePipelineState(IRenderDevice*
146150 IShaderSourceInputStreamFactory* pShaderSourceFactory,
147151 const char * VSFilePath,
148152 const char * PSFilePath,
149- LayoutElement* LayoutElements /* = nullptr*/ ,
150- Uint32 NumLayoutElements /* = 0*/ ,
151- Uint8 SampleCount /* = 1*/ )
153+ LayoutElement* LayoutElements /* = nullptr*/ ,
154+ Uint32 NumLayoutElements /* = 0*/ ,
155+ Uint8 SampleCount /* = 1*/ )
152156{
153157 PipelineStateDesc PSODesc;
154158
155159 // This is a graphics pipeline
156- PSODesc.IsComputePipeline = false ;
160+ PSODesc.IsComputePipeline = false ;
157161
158162 // Pipeline state name is used by the engine to report issues.
159163 // It is always a good idea to give objects descriptive names.
160- PSODesc.Name = " Cube PSO" ;
164+ PSODesc.Name = " Cube PSO" ;
161165
166+ // clang-format off
162167 // This tutorial will render to a single render target
163168 PSODesc.GraphicsPipeline .NumRenderTargets = 1 ;
164169 // Set render target format which is the format of the swap chain's color buffer
@@ -173,7 +178,7 @@ RefCntAutoPtr<IPipelineState> CreatePipelineState(IRenderDevice*
173178 PSODesc.GraphicsPipeline .RasterizerDesc .CullMode = CULL_MODE_BACK;
174179 // Enable depth testing
175180 PSODesc.GraphicsPipeline .DepthStencilDesc .DepthEnable = True;
176-
181+ // clang-format on
177182 ShaderCreateInfo ShaderCI;
178183 // Tell the system that the shader source code is in HLSL.
179184 // For OpenGL, the engine will convert this into GLSL under the hood.
@@ -205,6 +210,7 @@ RefCntAutoPtr<IPipelineState> CreatePipelineState(IRenderDevice*
205210
206211 // Define vertex shader input layout
207212 // This tutorial uses two types of input: per-vertex data and per-instance data.
213+ // clang-format off
208214 const LayoutElement DefaultLayoutElems[] =
209215 {
210216 // Per-vertex data - first buffer slot
@@ -213,25 +219,30 @@ RefCntAutoPtr<IPipelineState> CreatePipelineState(IRenderDevice*
213219 // Attribute 1 - texture coordinates
214220 LayoutElement{1 , 0 , 2 , VT_FLOAT32, False}
215221 };
222+ // clang-format on
216223
217224 PSODesc.GraphicsPipeline .pVS = pVS;
218225 PSODesc.GraphicsPipeline .pPS = pPS;
219- PSODesc.GraphicsPipeline .InputLayout .LayoutElements = LayoutElements != nullptr ? LayoutElements : DefaultLayoutElems;
226+
227+ PSODesc.GraphicsPipeline .InputLayout .LayoutElements = LayoutElements != nullptr ? LayoutElements : DefaultLayoutElems;
220228 PSODesc.GraphicsPipeline .InputLayout .NumElements = LayoutElements != nullptr ? NumLayoutElements : _countof (DefaultLayoutElems);
221229
222230 // Define variable type that will be used by default
223231 PSODesc.ResourceLayout .DefaultVariableType = SHADER_RESOURCE_VARIABLE_TYPE_STATIC;
224232
225233 // Shader variables should typically be mutable, which means they are expected
226234 // to change on a per-instance basis
235+ // clang-format off
227236 ShaderResourceVariableDesc Vars[] =
228237 {
229238 {SHADER_TYPE_PIXEL, " g_Texture" , SHADER_RESOURCE_VARIABLE_TYPE_MUTABLE}
230239 };
240+ // clang-format on
231241 PSODesc.ResourceLayout .Variables = Vars;
232242 PSODesc.ResourceLayout .NumVariables = _countof (Vars);
233243
234244 // Define static sampler for g_Texture. Static samplers should be used whenever possible
245+ // clang-format off
235246 SamplerDesc SamLinearClampDesc
236247 {
237248 FILTER_TYPE_LINEAR, FILTER_TYPE_LINEAR, FILTER_TYPE_LINEAR,
@@ -241,6 +252,7 @@ RefCntAutoPtr<IPipelineState> CreatePipelineState(IRenderDevice*
241252 {
242253 {SHADER_TYPE_PIXEL, " g_Texture" , SamLinearClampDesc}
243254 };
255+ // clang-format on
244256 PSODesc.ResourceLayout .StaticSamplers = StaticSamplers;
245257 PSODesc.ResourceLayout .NumStaticSamplers = _countof (StaticSamplers);
246258
0 commit comments