Archived
1
Fork 0

Protect against buffers that actually don't have their contents mapped

This commit is contained in:
Joshua Goins 2022-02-18 17:38:27 -05:00
parent 71fb011bd0
commit da45d16388
2 changed files with 6 additions and 0 deletions

View file

@ -216,6 +216,9 @@ void ImGuiPass::update_buffers(RenderTarget& target, const ImDrawData& draw_data
auto vtx_map = engine->get_gfx()->get_buffer_contents(target.vertex_buffer[target.current_frame]); auto vtx_map = engine->get_gfx()->get_buffer_contents(target.vertex_buffer[target.current_frame]);
auto idx_map = engine->get_gfx()->get_buffer_contents(target.index_buffer[target.current_frame]); auto idx_map = engine->get_gfx()->get_buffer_contents(target.index_buffer[target.current_frame]);
if(vtx_map == nullptr || idx_map == nullptr)
return;
auto vtx_dst = (ImDrawVert*)vtx_map; auto vtx_dst = (ImDrawVert*)vtx_map;
auto idx_dst = (ImDrawIdx*)idx_map; auto idx_dst = (ImDrawIdx*)idx_map;

View file

@ -265,6 +265,9 @@ void ShadowPass::render_point(GFXCommandBuffer* command_buffer, Scene& scene, pr
if((last_point_light + 1) == max_point_shadows) if((last_point_light + 1) == max_point_shadows)
return; return;
if(point_location_map == nullptr)
return;
if(scene.point_light_dirty[last_point_light] || light.use_dynamic_shadows) { if(scene.point_light_dirty[last_point_light] || light.use_dynamic_shadows) {
const prism::float3 lightPos = scene.get<Transform>(light_object).get_world_position(); const prism::float3 lightPos = scene.get<Transform>(light_object).get_world_position();