Skip to content

Commit 83fa05c

Browse files
committed
Fix, which delets valid layer if CreateInstace returned bad result
1 parent 5bcd235 commit 83fa05c

4 files changed

Lines changed: 215 additions & 204 deletions

File tree

327 KB
Binary file not shown.

lib/Release/glfw3.lib

637 KB
Binary file not shown.

samples/src/12_SimpleGeometryShader.cpp

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ VKAPI_ATTR VkBool32 VKAPI_CALL vulkan_debug(
120120
//LOG("[PERF]" << "[" << pLayerPrefix << "] : " << pMessage << " (" << messageCode << ")");
121121
}
122122
else if( flags & VK_DEBUG_REPORT_ERROR_BIT_EXT ) {
123-
LOG("[ERROR]" << "[" << pLayerPrefix << "] : " << pMessage << " (" << messageCode << ")");
123+
LOG("[ERROR]" << "[" << pLayerPrefix << "] : " << pMessage << " (" << messageCode << ")");
124124
}
125125
else if( flags & VK_DEBUG_REPORT_DEBUG_BIT_EXT ) {
126126
LOG("[DEBUG]" << "[" << pLayerPrefix << "] : " << pMessage << " (" << messageCode << ")");
@@ -188,29 +188,29 @@ void init_tiny_renderer(GLFWwindow* window)
188188

189189
tr_create_cmd_pool(m_renderer, m_renderer->graphics_queue, false, &m_cmd_pool);
190190
tr_create_cmd_n(m_cmd_pool, false, k_image_count, &m_cmds);
191-
191+
192192
#if defined(TINY_RENDERER_VK)
193193
auto vert = load_file(k_asset_dir + "triangle_wireframe.vs.spv");
194194
auto geom = load_file(k_asset_dir + "triangle_wireframe.gs.spv");
195195
auto frag = load_file(k_asset_dir + "triangle_wireframe.ps.spv");
196-
tr_create_shader_program_n(m_renderer,
196+
tr_create_shader_program_n(m_renderer,
197197
(uint32_t)vert.size(), (uint32_t*)(vert.data()), "VSMain",
198198
0, nullptr, nullptr,
199199
0, nullptr, nullptr,
200-
(uint32_t)geom.size(), (uint32_t*)(geom.data()), "GSMain",
200+
(uint32_t)geom.size(), (uint32_t*)(geom.data()), "GSMain",
201201
(uint32_t)frag.size(), (uint32_t*)(frag.data()), "PSMain",
202202
0, nullptr, nullptr,
203203
&m_shader);
204204
#elif defined(TINY_RENDERER_DX)
205205
auto hlsl = load_file(k_asset_dir + "triangle_wireframe.hlsl");
206206
tr_create_shader_program_n(m_renderer,
207-
(uint32_t)hlsl.size(), hlsl.data(), "VSMain",
207+
(uint32_t)hlsl.size(), hlsl.data(), "VSMain",
208208
0, nullptr, nullptr,
209209
0, nullptr, nullptr,
210-
(uint32_t)hlsl.size(), hlsl.data(), "GSMain",
211-
(uint32_t)hlsl.size(), hlsl.data(), "PSMain",
210+
(uint32_t)hlsl.size(), hlsl.data(), "GSMain",
211+
(uint32_t)hlsl.size(), hlsl.data(), "PSMain",
212212
0, nullptr, nullptr,
213-
&m_shader);
213+
&m_shader);
214214
#endif
215215

216216
std::vector<tr_descriptor> descriptors(1);
@@ -361,15 +361,15 @@ void draw_frame()
361361
//float t = (float)glfwGetTime();
362362
//std::vector<float> mvp(16);
363363
//std::fill(std::begin(mvp), std::end(mvp), 0.0f);
364-
//mvp[ 0] = cos(t);
364+
//mvp[ 0] = cos(t);
365365
//mvp[ 1] = sin(t);
366366
//mvp[ 4] = -sin(t);
367367
//mvp[ 5] = cos(t);
368368
//mvp[10] = 1.0f;
369369
//mvp[15] = 1.0f;
370370
//memcpy(m_uniform_buffer->cpu_mapped_address, mvp.data(), mvp.size() * sizeof(float));
371371
float t = (float)glfwGetTime();
372-
float4x4 view = glm::lookAt(float3(0, 0, 2), float3(0, 0, 0), float3(0, 1, 0));
372+
float4x4 view = glm::lookAt(float3(0, 0, 2), float3(0, 0, 0), float3(0, 1, 0));
373373
float4x4 proj = glm::perspective(glm::radians(60.0f), (float)s_window_width / (float)s_window_height, 0.1f, 10000.0f);
374374
float4x4 rot_x = glm::rotate(t, float3(1, 0, 0));
375375
float4x4 rot_y = glm::rotate(t / 2.0f, float3(0, 1, 0));
@@ -381,7 +381,7 @@ void draw_frame()
381381
tr_cmd* cmd = m_cmds[frameIdx];
382382

383383
tr_begin_cmd(cmd);
384-
tr_cmd_render_target_transition(cmd, render_target, tr_texture_usage_present, tr_texture_usage_color_attachment);
384+
tr_cmd_render_target_transition(cmd, render_target, tr_texture_usage_present, tr_texture_usage_color_attachment);
385385
tr_cmd_depth_stencil_transition(cmd, render_target, tr_texture_usage_sampled_image, tr_texture_usage_depth_stencil_attachment);
386386
tr_cmd_set_viewport(cmd, 0, 0, (float)s_window_width, (float)s_window_height, 0.0f, 1.0f);
387387
tr_cmd_set_scissor(cmd, 0, 0, s_window_width, s_window_height);
@@ -398,7 +398,7 @@ void draw_frame()
398398
tr_cmd_bind_descriptor_sets(cmd, m_pipeline, m_desc_set);
399399
tr_cmd_draw(cmd, 36, 0);
400400
tr_cmd_end_render(cmd);
401-
tr_cmd_render_target_transition(cmd, render_target, tr_texture_usage_color_attachment, tr_texture_usage_present);
401+
tr_cmd_render_target_transition(cmd, render_target, tr_texture_usage_color_attachment, tr_texture_usage_present);
402402
tr_cmd_depth_stencil_transition(cmd, render_target, tr_texture_usage_depth_stencil_attachment, tr_texture_usage_sampled_image);
403403
tr_end_cmd(cmd);
404404

@@ -423,7 +423,7 @@ int main(int argc, char **argv)
423423
draw_frame();
424424
glfwPollEvents();
425425
}
426-
426+
427427
destroy_tiny_renderer();
428428

429429
glfwDestroyWindow(window);

0 commit comments

Comments
 (0)