Unbind the SRVs an ore D3D11 pass bound when it finishes
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 61/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- cpp
- Lĩnh vực
- backend-api-design
Hướng nghiên cứu
The change belongs in source/renderer/ore/d3d11/ore_render_pass_d3d11.cpp, in RenderPassD3D11::finish(). Read how the pass tracks its bound groups and pipeline slots, then check how finish releases bound resources. Done means the pass unbinds the SRVs it bound so the next pass can render to a sampled texture without D3D11 debug layer hazard warnings.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Unbind the SRVs an ore D3D11 pass bound when it finishes.
- source/renderer/ore/d3d11/ore_render_pass_d3d11.cpp: Ore D3D11 pass finish: unbind the shader resource views the pass bound, so the next pass can render into a texture this one sampled without tripping the D3D11 debug layer hazards (STATE_SETTING WARNING #9 and #7)
diff --git a/source/renderer/ore/d3d11/ore_render_pass_d3d11.cpp b/source/renderer/ore/d3d11/ore_render_pass_d3d11.cpp
index be997baaf1a3ae6485d7c51d3a0b7dc23de078b7..247a668fb3b783ec58c6b17ae4f05f22db963110 100644
--- a/source/renderer/ore/d3d11/ore_render_pass_d3d11.cpp
+++ b/source/renderer/ore/d3d11/ore_render_pass_d3d11.cpp
@@ -484,7 +484,37 @@ void RenderPassD3D11::finish()
if (m_finished)
return;
m_finished = true;
+
+ if (m_d3d11Context != nullptr && m_currentPipeline != nullptr)
+ {
+ ID3D11ShaderResourceView* nullView = nullptr;
+ const Pipeline* pipeline = m_currentPipeline.get();
+ const auto unbindView =
+ [&](uint32_t groupIndex, uint32_t binding, SlotSpace space)
+ {
+ const Pipeline::StageSlots slots =
+ pipeline->slots(groupIndex, binding, space);
+ if (slots.vs != BindingMap::kAbsent)
+ m_d3d11Context->VSSetShaderResources(slots.vs, 1, &nullView);
+ if (slots.fs != BindingMap::kAbsent)
+ m_d3d11Context->PSSetShaderResources(slots.fs, 1, &nullView);
+ };
+
+ for (uint32_t g = 0; g < kMaxBindGroups; ++g)
+ {
+ const auto* bg = static_cast<const BindGroupD3D11*>(m_boundGroups[g].get());
+ if (bg == nullptr)
+ continue;
+
+ for (const auto& texture : bg->m_d3d11Textures)
+ unbindView(g, texture.binding, SlotSpace::texture);
+ for (const auto& storage : bg->m_d3d11StorageBuffers)
+ unbindView(g, storage.binding, SlotSpace::buffer);
+ }
+ }
+
releaseBoundResources();
+
if (m_d3d11Context != nullptr)
{
// Unbind render targets so attached textures can be used as SRVs.
- Ngôn ngữ chính
- C++
- Star
- 1.2k
- Fork
- 133
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Chuẩn bị môi trường
- Có Dockerfile hoặc tệp Docker Compose
- Không có mẫu pull request
- Không có hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của rive-app/rive-runtime
-
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 83/100
rive-app/rive-runtime#143 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
rive-app/rive-runtime#141 ·
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 78/100
rive-app/rive-runtime#140 ·
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 91/100
rive-app/rive-runtime#137 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
rive-app/rive-runtime#134 ·
Tất cả issue của rive-app/rive-runtime
Issue tương tự
-
zq prints a raw SQL 'no such table: index_default' error when the index has no default indexĐang mởbug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 73/100
mattgodbolt/zindex#67 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 67/100
NKI-AI/fastslide#105 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 3 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
DarkCastleMUD/DarkCastle#283 ·
-
Toggle state is unclearĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100