forked from MethanePowered/MethaneKit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathShadowCubeApp.cpp
463 lines (376 loc) · 21.5 KB
/
ShadowCubeApp.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
/******************************************************************************
Copyright 2019-2020 Evgeny Gorodetskiy
Licensed under the Apache License, Version 2.0 (the "License"),
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*******************************************************************************
FILE: ShadowCubeApp.cpp
Tutorial demonstrating shadow-pass rendering with Methane graphics API
******************************************************************************/
#include "ShadowCubeApp.h"
#include <Methane/Tutorials/AppSettings.h>
#include <Methane/Graphics/CubeMesh.hpp>
#include <Methane/Data/TimeAnimation.h>
namespace Methane::Tutorials
{
struct Vertex
{
gfx::Mesh::Position position;
gfx::Mesh::Normal normal;
gfx::Mesh::TexCoord texcoord;
inline static const gfx::Mesh::VertexLayout layout{
gfx::Mesh::VertexField::Position,
gfx::Mesh::VertexField::Normal,
gfx::Mesh::VertexField::TexCoord,
};
};
static const gfx::FrameSize g_shadow_map_size(1024, 1024);
ShadowCubeApp::ShadowCubeApp()
: UserInterfaceApp(
GetGraphicsTutorialAppSettings("Methane Shadow Cube", AppOptions::GetDefaultWithColorDepthAndAnim()),
GetUserInterfaceTutorialAppSettings(AppOptions::GetDefaultWithColorDepthAndAnim()),
"Methane tutorial of shadow pass rendering")
{
m_view_camera.ResetOrientation({ { 15.0F, 22.5F, -15.0F }, { 0.0F, 7.5F, 0.0F }, { 0.0F, 1.0F, 0.0F } });
m_light_camera.ResetOrientation({ { 0.0F, 25.0F, -25.0F }, { 0.0F, 7.5F, 0.0F }, { 0.0F, 1.0F, 0.0F } });
m_light_camera.SetProjection(gfx::Camera::Projection::Orthogonal);
m_light_camera.SetParameters({ -300, 300.F, 90.F });
m_light_camera.Resize(Data::FloatSize(80.F, 80.F));
// Setup animations
GetAnimations().emplace_back(std::make_shared<Data::TimeAnimation>(std::bind(&ShadowCubeApp::Animate, this, std::placeholders::_1, std::placeholders::_2)));
}
ShadowCubeApp::~ShadowCubeApp()
{
// Wait for GPU rendering is completed to release resources
WaitForRenderComplete();
}
void ShadowCubeApp::Init()
{
UserInterfaceApp::Init();
const rhi::RenderContext& render_context = GetRenderContext();
const rhi::CommandQueue render_cmd_queue = render_context.GetRenderCommandKit().GetQueue();
const rhi::RenderContextSettings& context_settings = render_context.GetSettings();
m_view_camera.Resize(context_settings.frame_size);
const gfx::Mesh::VertexLayout mesh_layout(Vertex::layout);
const gfx::CubeMesh<Vertex> cube_mesh(mesh_layout, 1.F, 1.F, 1.F);
const gfx::QuadMesh<Vertex> floor_mesh(mesh_layout, 7.F, 7.F, 0.F, 0, gfx::QuadMesh<Vertex>::FaceType::XZ);
// Load textures, vertex and index buffers for cube and floor meshes
constexpr gfx::ImageOptionMask image_options({ gfx::ImageOption::Mipmapped, gfx::ImageOption::SrgbColorSpace });
m_cube_buffers_ptr = std::make_unique<TexturedMeshBuffers>(render_cmd_queue, cube_mesh, "Cube");
m_cube_buffers_ptr->SetTexture(GetImageLoader().LoadImageToTexture2D(render_cmd_queue, "MethaneBubbles.jpg", image_options, "Cube Face Texture"));
m_floor_buffers_ptr = std::make_unique<TexturedMeshBuffers>(render_cmd_queue, floor_mesh, "Floor");
m_floor_buffers_ptr->SetTexture(GetImageLoader().LoadImageToTexture2D(render_cmd_queue, "MarbleWhite.jpg", image_options, "Floor Texture"));
const auto constants_data_size = static_cast<Data::Size>(sizeof(hlslpp::Constants));
const auto scene_uniforms_data_size = static_cast<Data::Size>(sizeof(hlslpp::SceneUniforms));
const auto mesh_uniforms_data_size = static_cast<Data::Size>(sizeof(hlslpp::MeshUniforms));
// Create constants buffer for frame rendering
m_const_buffer = render_context.CreateBuffer(rhi::BufferSettings::ForConstantBuffer(constants_data_size));
m_const_buffer.SetName("Constants Buffer");
m_const_buffer.SetData(
{ { reinterpret_cast<Data::ConstRawPtr>(&m_scene_constants), sizeof(m_scene_constants) } }, // NOSONAR
render_cmd_queue
);
// Create sampler for cube and floor textures sampling
m_texture_sampler = render_context.CreateSampler(
rhi::Sampler::Settings
{
rhi::Sampler::Filter { rhi::Sampler::Filter::MinMag::Linear },
rhi::Sampler::Address { rhi::Sampler::Address::Mode::ClampToEdge }
}
);
m_texture_sampler.SetName("Texture Sampler");
// Create sampler for shadow-map texture
m_shadow_sampler = render_context.CreateSampler(
rhi::Sampler::Settings
{
rhi::Sampler::Filter { rhi::Sampler::Filter::MinMag::Linear },
rhi::Sampler::Address { rhi::Sampler::Address::Mode::ClampToEdge }
}
);
m_shadow_sampler.SetName("Shadow Map Sampler");
// ========= Final Pass Render & View States =========
const rhi::Shader::EntryFunction vs_main{ "ShadowCube", "CubeVS" };
const rhi::Shader::EntryFunction ps_main{ "ShadowCube", "CubePS" };
const rhi::Shader::MacroDefinitions textured_shadows_definitions{ { "ENABLE_SHADOWS", "" }, { "ENABLE_TEXTURING", "" } };
// Create final pass rendering state with program
rhi::RenderState::Settings final_state_settings
{
render_context.CreateProgram(
rhi::Program::Settings
{
rhi::Program::ShaderSet
{
{ rhi::ShaderType::Vertex, { Data::ShaderProvider::Get(), vs_main, textured_shadows_definitions } },
{ rhi::ShaderType::Pixel, { Data::ShaderProvider::Get(), ps_main, textured_shadows_definitions } },
},
rhi::ProgramInputBufferLayouts
{
rhi::Program::InputBufferLayout
{
rhi::Program::InputBufferLayout::ArgumentSemantics { cube_mesh.GetVertexLayout().GetSemantics() }
}
},
rhi::ProgramArgumentAccessors
{
{ { rhi::ShaderType::Vertex, "g_mesh_uniforms" }, rhi::ProgramArgumentAccessor::Type::Mutable },
{ { rhi::ShaderType::Pixel, "g_scene_uniforms" }, rhi::ProgramArgumentAccessor::Type::FrameConstant },
{ { rhi::ShaderType::Pixel, "g_constants" }, rhi::ProgramArgumentAccessor::Type::Constant },
{ { rhi::ShaderType::Pixel, "g_shadow_map" }, rhi::ProgramArgumentAccessor::Type::FrameConstant },
{ { rhi::ShaderType::Pixel, "g_shadow_sampler" }, rhi::ProgramArgumentAccessor::Type::Constant },
{ { rhi::ShaderType::Pixel, "g_texture" }, rhi::ProgramArgumentAccessor::Type::Mutable },
{ { rhi::ShaderType::Pixel, "g_texture_sampler"}, rhi::ProgramArgumentAccessor::Type::Constant },
},
GetScreenRenderPattern().GetAttachmentFormats()
}
),
GetScreenRenderPattern()
};
final_state_settings.program.SetName("Textured, Shadows & Lighting");
final_state_settings.depth.enabled = true;
m_final_pass.render_state = render_context.CreateRenderState( final_state_settings);
m_final_pass.render_state.SetName("Final pass render state");
m_final_pass.view_state = GetViewState();
// ========= Shadow Pass Render & View States =========
// Create shadow-pass render pattern
m_shadow_pass_pattern = render_context.CreateRenderPattern({
{ }, // No color attachments
rhi::RenderPattern::DepthAttachment(
0U, context_settings.depth_stencil_format, 1U,
rhi::RenderPassAttachment::LoadAction::Clear,
rhi::RenderPassAttachment::StoreAction::Store,
context_settings.clear_depth_stencil->first
),
std::nullopt, // No stencil attachment
rhi::RenderPassAccessMask(rhi::RenderPassAccess::ShaderResources),
false // intermediate render pass
});
// Create shadow-pass rendering state with program
const rhi::Shader::MacroDefinitions textured_definitions{ { "ENABLE_TEXTURING", "" } };
rhi::RenderState::Settings shadow_state_settings
{
render_context.CreateProgram(
rhi::Program::Settings
{
rhi::Program::ShaderSet
{
{ rhi::ShaderType::Vertex, { Data::ShaderProvider::Get(), vs_main, textured_definitions } },
},
final_state_settings.program.GetSettings().input_buffer_layouts,
rhi::ProgramArgumentAccessors
{
{ { rhi::ShaderType::All, "g_mesh_uniforms" }, rhi::ProgramArgumentAccessor::Type::Mutable },
},
m_shadow_pass_pattern.GetAttachmentFormats()
}
),
m_shadow_pass_pattern
};
shadow_state_settings.program.SetName("Vertex Only: Textured, Lighting");
shadow_state_settings.depth.enabled = true;
m_shadow_pass.render_state = render_context.CreateRenderState( shadow_state_settings);
m_shadow_pass.render_state.SetName("Shadow-map render state");
m_shadow_pass.view_state = rhi::ViewState({
{ gfx::GetFrameViewport(g_shadow_map_size) },
{ gfx::GetFrameScissorRect(g_shadow_map_size) }
});
// ========= Per-Frame Data =========
const rhi::Texture::Settings shadow_texture_settings = rhi::Texture::Settings::ForDepthStencil(
gfx::Dimensions(g_shadow_map_size),
context_settings.depth_stencil_format, context_settings.clear_depth_stencil,
rhi::ResourceUsageMask({ rhi::ResourceUsage::RenderTarget, rhi::ResourceUsage::ShaderRead })
);
for(ShadowCubeFrame& frame : GetFrames())
{
// Create uniforms buffer with volatile parameters for the whole scene rendering
frame.scene_uniforms_buffer = render_context.CreateBuffer(rhi::BufferSettings::ForConstantBuffer(scene_uniforms_data_size, false, true));
frame.scene_uniforms_buffer.SetName(IndexedName("Scene Uniforms Buffer", frame.index));
// ========= Shadow Pass Resources =========
// Create uniforms buffer for Cube rendering in Shadow pass
frame.shadow_pass.cube.uniforms_buffer = render_context.CreateBuffer(rhi::BufferSettings::ForConstantBuffer(mesh_uniforms_data_size, false, true));
frame.shadow_pass.cube.uniforms_buffer.SetName(IndexedName("Cube Uniforms Buffer for Shadow Pass", frame.index));
// Create uniforms buffer for Floor rendering in Shadow pass
frame.shadow_pass.floor.uniforms_buffer = render_context.CreateBuffer(rhi::BufferSettings::ForConstantBuffer(mesh_uniforms_data_size, false, true));
frame.shadow_pass.floor.uniforms_buffer.SetName(IndexedName("Floor Uniforms Buffer for Shadow Pass", frame.index));
// Shadow-pass resource bindings for cube rendering
frame.shadow_pass.cube.program_bindings = shadow_state_settings.program.CreateBindings({
{ { rhi::ShaderType::All, "g_mesh_uniforms" }, { { frame.shadow_pass.cube.uniforms_buffer.GetInterface() } } },
}, frame.index);
frame.shadow_pass.cube.program_bindings.SetName(IndexedName("Cube Shadow-Pass Bindings {}", frame.index));
// Shadow-pass resource bindings for floor rendering
frame.shadow_pass.floor.program_bindings = shadow_state_settings.program.CreateBindings({
{ { rhi::ShaderType::All, "g_mesh_uniforms" }, { { frame.shadow_pass.floor.uniforms_buffer.GetInterface() } } },
}, frame.index);
frame.shadow_pass.floor.program_bindings.SetName(IndexedName("Floor Shadow-Pass Bindings {}", frame.index));
// Create depth texture for shadow map rendering
frame.shadow_pass.rt_texture = render_context.CreateTexture(shadow_texture_settings);
frame.shadow_pass.rt_texture.SetName(IndexedName("Shadow Map", frame.index));
// Create shadow pass configuration with depth attachment
frame.shadow_pass.render_pass = m_shadow_pass_pattern.CreateRenderPass({
{ frame.shadow_pass.rt_texture.GetInterface() },
shadow_texture_settings.dimensions.AsRectSize()
});
// Create render pass and command list for shadow pass rendering
frame.shadow_pass.cmd_list = render_cmd_queue.CreateRenderCommandList(frame.shadow_pass.render_pass);
frame.shadow_pass.cmd_list.SetName(IndexedName("Shadow-Map Rendering", frame.index));
// ========= Final Pass Resources =========
// Create uniforms buffer for Cube rendering in Final pass
frame.final_pass.cube.uniforms_buffer = render_context.CreateBuffer(rhi::BufferSettings::ForConstantBuffer(mesh_uniforms_data_size, false, true));
frame.final_pass.cube.uniforms_buffer.SetName(IndexedName("Cube Uniforms Buffer for Final Pass", frame.index));
// Create uniforms buffer for Floor rendering in Final pass
frame.final_pass.floor.uniforms_buffer = render_context.CreateBuffer(rhi::BufferSettings::ForConstantBuffer(mesh_uniforms_data_size, false, true));
frame.final_pass.floor.uniforms_buffer.SetName(IndexedName("Floor Uniforms Buffer for Final Pass", frame.index));
// Final-pass resource bindings for cube rendering
frame.final_pass.cube.program_bindings = final_state_settings.program.CreateBindings({
{ { rhi::ShaderType::Vertex, "g_mesh_uniforms" }, { { frame.final_pass.cube.uniforms_buffer.GetInterface() } } },
{ { rhi::ShaderType::Pixel, "g_scene_uniforms" }, { { frame.scene_uniforms_buffer.GetInterface() } } },
{ { rhi::ShaderType::Pixel, "g_constants" }, { { m_const_buffer.GetInterface() } } },
{ { rhi::ShaderType::Pixel, "g_shadow_map" }, { { frame.shadow_pass.rt_texture.GetInterface() } } },
{ { rhi::ShaderType::Pixel, "g_shadow_sampler" }, { { m_shadow_sampler.GetInterface() } } },
{ { rhi::ShaderType::Pixel, "g_texture" }, { { m_cube_buffers_ptr->GetTexture().GetInterface() } } },
{ { rhi::ShaderType::Pixel, "g_texture_sampler"}, { { m_texture_sampler.GetInterface() } } },
}, frame.index);
frame.final_pass.cube.program_bindings.SetName(IndexedName("Cube Final-Pass Bindings {}", frame.index));
// Final-pass resource bindings for floor rendering - patched a copy of cube bindings
frame.final_pass.floor.program_bindings = rhi::ProgramBindings(frame.final_pass.cube.program_bindings, {
{ { rhi::ShaderType::Vertex, "g_mesh_uniforms" }, { { frame.final_pass.floor.uniforms_buffer.GetInterface() } } },
{ { rhi::ShaderType::Pixel, "g_texture" }, { { m_floor_buffers_ptr->GetTexture().GetInterface() } } },
}, frame.index);
frame.final_pass.floor.program_bindings.SetName(IndexedName("Floor Final-Pass Bindings {}", frame.index));
// Bind final pass RT texture and pass to the frame buffer texture and final pass.
frame.final_pass.rt_texture = frame.screen_texture;
frame.final_pass.render_pass = frame.screen_pass;
// Create render pass and command list for final pass rendering
frame.final_pass.cmd_list = render_cmd_queue.CreateRenderCommandList(frame.final_pass.render_pass);
frame.final_pass.cmd_list.SetName(IndexedName("Final Scene Rendering", frame.index));
// Rendering command lists sequence
frame.execute_cmd_list_set = rhi::CommandListSet({
frame.shadow_pass.cmd_list.GetInterface(),
frame.final_pass.cmd_list.GetInterface()
}, frame.index);
}
UserInterfaceApp::CompleteInitialization();
}
bool ShadowCubeApp::Resize(const gfx::FrameSize& frame_size, bool is_minimized)
{
// Resize screen color and depth textures
for (ShadowCubeFrame& frame : GetFrames())
frame.final_pass.rt_texture = {};
const bool is_resized = UserInterfaceApp::Resize(frame_size, is_minimized);
for (ShadowCubeFrame& frame : GetFrames())
frame.final_pass.rt_texture = frame.screen_texture;
if (!is_resized)
return false;
m_view_camera.Resize(frame_size);
return true;
}
bool ShadowCubeApp::Animate(double, double delta_seconds)
{
m_view_camera.Rotate(m_view_camera.GetOrientation().up, static_cast<float>(delta_seconds * 360.F / 8.F));
m_light_camera.Rotate(m_light_camera.GetOrientation().up, static_cast<float>(delta_seconds * 360.F / 4.F));
return true;
}
bool ShadowCubeApp::Update()
{
if (!UserInterfaceApp::Update())
return false;
// Prepare homogenous [-1,1] to texture [0,1] coordinates transformation matrix
static const hlslpp::float4x4 s_homogen_to_texture_coords_matrix = hlslpp::mul(hlslpp::float4x4::scale(0.5F, -0.5F, 1.F), hlslpp::float4x4::translation(0.5F, 0.5F, 0.F));
// Update scene uniforms
m_scene_uniforms.eye_position = hlslpp::float4(m_view_camera.GetOrientation().eye, 1.F);
m_scene_uniforms.light_position = m_light_camera.GetOrientation().eye;
hlslpp::float4x4 scale_matrix = hlslpp::float4x4::scale(m_scene_scale);
// Cube model matrix
hlslpp::float4x4 cube_model_matrix = hlslpp::mul(hlslpp::float4x4::translation(0.F, 0.5F, 0.F), scale_matrix); // move up by half of cube model height
// Update Cube uniforms
m_cube_buffers_ptr->SetFinalPassUniforms(hlslpp::MeshUniforms{
hlslpp::transpose(cube_model_matrix),
hlslpp::transpose(hlslpp::mul(cube_model_matrix, m_view_camera.GetViewProjMatrix())),
hlslpp::transpose(hlslpp::mul(hlslpp::mul(cube_model_matrix, m_light_camera.GetViewProjMatrix()), s_homogen_to_texture_coords_matrix))
});
m_cube_buffers_ptr->SetShadowPassUniforms(hlslpp::MeshUniforms{
hlslpp::transpose(cube_model_matrix),
hlslpp::transpose(hlslpp::mul(cube_model_matrix, m_light_camera.GetViewProjMatrix())),
hlslpp::float4x4()
});
// Update Floor uniforms
m_floor_buffers_ptr->SetFinalPassUniforms(hlslpp::MeshUniforms{
hlslpp::transpose(scale_matrix),
hlslpp::transpose(hlslpp::mul(scale_matrix, m_view_camera.GetViewProjMatrix())),
hlslpp::transpose(hlslpp::mul(hlslpp::mul(scale_matrix, m_light_camera.GetViewProjMatrix()), s_homogen_to_texture_coords_matrix))
});
m_floor_buffers_ptr->SetShadowPassUniforms(hlslpp::MeshUniforms{
hlslpp::transpose(scale_matrix),
hlslpp::transpose(hlslpp::mul(scale_matrix, m_light_camera.GetViewProjMatrix())),
hlslpp::float4x4()
});
return true;
}
bool ShadowCubeApp::Render()
{
if (!UserInterfaceApp::Render())
return false;
// Upload uniform buffers to GPU
const ShadowCubeFrame& frame = GetCurrentFrame();
const rhi::CommandQueue render_cmd_queue = GetRenderContext().GetRenderCommandKit().GetQueue();
frame.scene_uniforms_buffer.SetData(m_scene_uniforms_subresources, render_cmd_queue);
frame.shadow_pass.floor.uniforms_buffer.SetData(m_floor_buffers_ptr->GetShadowPassUniformsSubresources(), render_cmd_queue);
frame.shadow_pass.cube.uniforms_buffer.SetData(m_cube_buffers_ptr->GetShadowPassUniformsSubresources(), render_cmd_queue);
frame.final_pass.floor.uniforms_buffer.SetData(m_floor_buffers_ptr->GetFinalPassUniformsSubresources(), render_cmd_queue);
frame.final_pass.cube.uniforms_buffer.SetData(m_cube_buffers_ptr->GetFinalPassUniformsSubresources(), render_cmd_queue);
// Record commands for shadow & final render passes
RenderScene(m_shadow_pass, frame.shadow_pass);
RenderScene(m_final_pass, frame.final_pass);
// Execute rendering commands and present frame to screen
GetRenderContext().GetRenderCommandKit().GetQueue().Execute(frame.execute_cmd_list_set);
GetRenderContext().Present();
return true;
}
void ShadowCubeApp::RenderScene(const RenderPassState& render_pass, const ShadowCubeFrame::PassResources& render_pass_resources) const
{
const rhi::RenderCommandList& cmd_list = render_pass_resources.cmd_list;
// Reset command list with initial rendering state
cmd_list.ResetWithState(render_pass.render_state, &render_pass.debug_group);
cmd_list.SetViewState(render_pass.view_state);
// Draw scene with cube and floor
m_cube_buffers_ptr->Draw(cmd_list, render_pass_resources.cube.program_bindings);
m_floor_buffers_ptr->Draw(cmd_list, render_pass_resources.floor.program_bindings);
if (render_pass.is_final_pass)
{
RenderOverlay(cmd_list);
}
cmd_list.Commit();
}
void ShadowCubeApp::OnContextReleased(rhi::IContext& context)
{
m_final_pass.Release();
m_shadow_pass.Release();
m_floor_buffers_ptr.reset();
m_cube_buffers_ptr.reset();
m_shadow_sampler = {};
m_texture_sampler = {};
m_const_buffer = {};
m_shadow_pass_pattern = {};
UserInterfaceApp::OnContextReleased(context);
}
ShadowCubeApp::RenderPassState::RenderPassState(bool is_final_pass, const std::string& debug_group_name)
: is_final_pass(is_final_pass)
, debug_group(META_DEBUG_GROUP_CREATE(debug_group_name)) // NOSONAR
{
META_UNUSED(debug_group_name);
}
void ShadowCubeApp::RenderPassState::Release()
{
render_state = {};
view_state = {};
}
} // namespace Methane::Tutorials
int main(int argc, const char* argv[])
{
return Methane::Tutorials::ShadowCubeApp().Run({ argc, argv });
}