upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/runtime/shims/d3d12_com.cpp
diff options
context:
space:
mode:
authorAlxcBTW <187763517+AlxcBTW@users.noreply.github.com>2026-11-22 21:03:29 +0100
committerAlxcBTW <187763517+AlxcBTW@users.noreply.github.com>2026-11-22 21:03:29 +0100
commit5efe4afddd0f3da687835027e69f0e6983a7d283 (patch)
tree9eb48efe56fe8c4b3b20684238c2faba00b9dc7b /runtime/shims/d3d12_com.cpp
parentf8007dda67f9c45757b63df5c5fd8377647da4ae (diff)
parentf847748cc76bd3777f9c070c4034eb2fc1c04e64 (diff)
Merge origin/main into queue-wait-before-signal
Diffstat (limited to 'runtime/shims/d3d12_com.cpp')
-rw-r--r--runtime/shims/d3d12_com.cpp15
1 files changed, 9 insertions, 6 deletions
diff --git a/runtime/shims/d3d12_com.cpp b/runtime/shims/d3d12_com.cpp
index 6240a02a1..91535a389 100644
--- a/runtime/shims/d3d12_com.cpp
+++ b/runtime/shims/d3d12_com.cpp
@@ -360,7 +360,8 @@ public:
360 void STDMETHODCALLTYPE OMSetRenderTargets(UINT count, const D3D12_CPU_DESCRIPTOR_HANDLE* targets, BOOL single_range, 360 void STDMETHODCALLTYPE OMSetRenderTargets(UINT count, const D3D12_CPU_DESCRIPTOR_HANDLE* targets, BOOL single_range,
361 const D3D12_CPU_DESCRIPTOR_HANDLE* depth) override { 361 const D3D12_CPU_DESCRIPTOR_HANDLE* depth) override {
362 if (count > D3D12_SIMULTANEOUS_RENDER_TARGET_COUNT) return check(false); 362 if (count > D3D12_SIMULTANEOUS_RENDER_TARGET_COUNT) return check(false);
363 render_targets_.assign(count, {}); 363 render_targets_.fill({});
364 render_target_count_ = count;
364 for (UINT i = 0; i < count && targets; ++i) { 365 for (UINT i = 0; i < count && targets; ++i) {
365 const SIZE_T handle = single_range ? targets[0].ptr + SIZE_T(i) * descriptor_size : targets[i].ptr; 366 const SIZE_T handle = single_range ? targets[0].ptr + SIZE_T(i) * descriptor_size : targets[i].ptr;
366 if (handle) render_targets_[i] = *reinterpret_cast<const leonida::TargetView*>(handle); 367 if (handle) render_targets_[i] = *reinterpret_cast<const leonida::TargetView*>(handle);
@@ -980,7 +981,8 @@ private:
980 leonida::IndexBufferView index_{}; 981 leonida::IndexBufferView index_{};
981 leonida::Viewport viewport_{}; 982 leonida::Viewport viewport_{};
982 leonida::Rect scissor_{}; 983 leonida::Rect scissor_{};
983 std::vector<leonida::TargetView> render_targets_; 984 std::array<leonida::TargetView, D3D12_SIMULTANEOUS_RENDER_TARGET_COUNT> render_targets_{};
985 UINT render_target_count_ = 0;
984 leonida::TargetView depth_{}; 986 leonida::TargetView depth_{};
985 std::array<float, 4> blend_factor_{1, 1, 1, 1}; 987 std::array<float, 4> blend_factor_{1, 1, 1, 1};
986 988
@@ -1043,7 +1045,8 @@ private:
1043 index_ = {}; 1045 index_ = {};
1044 viewport_ = {}; 1046 viewport_ = {};
1045 scissor_ = {}; 1047 scissor_ = {};
1046 render_targets_.clear(); 1048 render_targets_.fill({});
1049 render_target_count_ = 0;
1047 depth_ = {}; 1050 depth_ = {};
1048 blend_factor_ = {1, 1, 1, 1}; 1051 blend_factor_ = {1, 1, 1, 1};
1049 set_pipeline(state); 1052 set_pipeline(state);
@@ -1073,10 +1076,10 @@ private:
1073 // and Vulkan forbids a 0x0 viewport, so the draw is not recorded. 1076 // and Vulkan forbids a 0x0 viewport, so the draw is not recorded.
1074 if (!(viewport_.width > 0) || !(viewport_.height > 0)) return; 1077 if (!(viewport_.width > 0) || !(viewport_.height > 0)) return;
1075 leonida::Draw draw{graphics_pipeline_, graphics_.data, render_targets_, depth_, 1078 leonida::Draw draw{graphics_pipeline_, graphics_.data, render_targets_, depth_,
1076 {vertex_buffers_.begin(), vertex_buffers_.end()}, index_, topology_, viewport_, scissor_, 1079 vertex_buffers_, index_, topology_, viewport_, scissor_,
1077 blend_factor_, front_stencil_ref_, back_stencil_ref_, indexed, count, instances, first, 1080 blend_factor_, front_stencil_ref_, back_stencil_ref_, indexed, count, instances, first,
1078 base_vertex, first_instance}; 1081 base_vertex, first_instance, render_target_count_};
1079 check(list_.draw(draw)); 1082 check(list_.draw(std::move(draw)));
1080 } 1083 }
1081}; 1084};
1082 1085