void thread::capture_frame(const std::string &name) { frame_capture_data::draw_state draw_state = {}; int clip_w = rsx::method_registers[NV4097_SET_SURFACE_CLIP_HORIZONTAL] >> 16; int clip_h = rsx::method_registers[NV4097_SET_SURFACE_CLIP_VERTICAL] >> 16; rsx::surface_info surface = {}; surface.unpack(rsx::method_registers[NV4097_SET_SURFACE_FORMAT]); draw_state.width = clip_w; draw_state.height = clip_h; draw_state.color_format = surface.color_format; draw_state.color_buffer = std::move(copy_render_targets_to_memory()); draw_state.depth_format = surface.depth_format; draw_state.depth_stencil = std::move(copy_depth_stencil_buffer_to_memory()); if (draw_command == rsx::draw_command::indexed) { draw_state.vertex_count = 0; for (const auto &range : first_count_commands) { draw_state.vertex_count += range.second; } draw_state.index_type = rsx::to_index_array_type(rsx::method_registers[NV4097_SET_INDEX_ARRAY_DMA] >> 4); if (draw_state.index_type == rsx::index_array_type::u16) { draw_state.index.resize(2 * draw_state.vertex_count); } if (draw_state.index_type == rsx::index_array_type::u32) { draw_state.index.resize(4 * draw_state.vertex_count); } gsl::span<gsl::byte> dst = { (gsl::byte*)draw_state.index.data(), gsl::narrow<int>(draw_state.index.size()) }; write_index_array_data_to_buffer(dst, draw_state.index_type, draw_mode, first_count_commands); }
void thread::capture_frame(const std::string &name) { frame_capture_data::draw_state draw_state = {}; int clip_w = rsx::method_registers[NV4097_SET_SURFACE_CLIP_HORIZONTAL] >> 16; int clip_h = rsx::method_registers[NV4097_SET_SURFACE_CLIP_VERTICAL] >> 16; rsx::surface_info surface = {}; surface.unpack(rsx::method_registers[NV4097_SET_SURFACE_FORMAT]); draw_state.width = clip_w; draw_state.height = clip_h; draw_state.color_format = surface.color_format; draw_state.color_buffer = std::move(copy_render_targets_to_memory()); draw_state.depth_format = surface.depth_format; draw_state.depth_stencil = std::move(copy_depth_stencil_buffer_to_memory()); draw_state.programs = get_programs(); draw_state.name = name; frame_debug.draw_calls.push_back(draw_state); }
void thread::capture_frame(const std::string &name) { frame_capture_data::draw_state draw_state = {}; int clip_w = rsx::method_registers.surface_clip_width(); int clip_h = rsx::method_registers.surface_clip_height(); draw_state.width = clip_w; draw_state.height = clip_h; draw_state.color_format = rsx::method_registers.surface_color(); draw_state.color_buffer = std::move(copy_render_targets_to_memory()); draw_state.depth_format = rsx::method_registers.surface_depth_fmt(); draw_state.depth_stencil = std::move(copy_depth_stencil_buffer_to_memory()); if (draw_command == rsx::draw_command::indexed) { draw_state.vertex_count = 0; for (const auto &range : first_count_commands) { draw_state.vertex_count += range.second; } draw_state.index_type = rsx::method_registers.index_type(); if (draw_state.index_type == rsx::index_array_type::u16) { draw_state.index.resize(2 * draw_state.vertex_count); } if (draw_state.index_type == rsx::index_array_type::u32) { draw_state.index.resize(4 * draw_state.vertex_count); } gsl::span<gsl::byte> dst = { (gsl::byte*)draw_state.index.data(), gsl::narrow<int>(draw_state.index.size()) }; write_index_array_data_to_buffer(dst, draw_state.index_type, draw_mode, first_count_commands); } draw_state.programs = get_programs(); draw_state.name = name; frame_debug.draw_calls.push_back(draw_state); }