| 9 | using namespace reshade::api; |
| 10 | |
| 11 | void state_block::apply(command_list *cmd_list) const |
| 12 | { |
| 13 | if (!render_targets.empty() || depth_stencil != 0) |
| 14 | cmd_list->bind_render_targets_and_depth_stencil(static_cast<uint32_t>(render_targets.size()), render_targets.data(), depth_stencil); |
| 15 | |
| 16 | for (const auto &[stages, pipeline] : pipelines) |
| 17 | cmd_list->bind_pipeline(stages, pipeline); |
| 18 | |
| 19 | if (primitive_topology != primitive_topology::undefined) |
| 20 | cmd_list->bind_pipeline_state(dynamic_state::primitive_topology, static_cast<uint32_t>(primitive_topology)); |
| 21 | if (blend_constant != 0) |
| 22 | cmd_list->bind_pipeline_state(dynamic_state::blend_constant, blend_constant); |
| 23 | if (sample_mask != 0xFFFFFFFF) |
| 24 | cmd_list->bind_pipeline_state(dynamic_state::sample_mask, sample_mask); |
| 25 | if (front_stencil_reference_value != 0) |
| 26 | cmd_list->bind_pipeline_state(dynamic_state::front_stencil_reference_value, front_stencil_reference_value); |
| 27 | if (back_stencil_reference_value != 0) |
| 28 | cmd_list->bind_pipeline_state(dynamic_state::back_stencil_reference_value, back_stencil_reference_value); |
| 29 | |
| 30 | if (!viewports.empty()) |
| 31 | cmd_list->bind_viewports(0, static_cast<uint32_t>(viewports.size()), viewports.data()); |
| 32 | if (!scissor_rects.empty()) |
| 33 | cmd_list->bind_scissor_rects(0, static_cast<uint32_t>(scissor_rects.size()), scissor_rects.data()); |
| 34 | |
| 35 | for (const auto &[stages, descriptor_state] : descriptor_tables) |
| 36 | cmd_list->bind_descriptor_tables(stages, descriptor_state.first, 0, static_cast<uint32_t>(descriptor_state.second.size()), descriptor_state.second.data()); |
| 37 | } |
| 38 | |
| 39 | void state_block::clear() |
| 40 | { |
no test coverage detected