diff options
Diffstat (limited to 'runtime/shims/d3d12_com.cpp')
| -rw-r--r-- | runtime/shims/d3d12_com.cpp | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/runtime/shims/d3d12_com.cpp b/runtime/shims/d3d12_com.cpp index 4f4904e96..f67254bc5 100644 --- a/runtime/shims/d3d12_com.cpp +++ b/runtime/shims/d3d12_com.cpp | |||
| @@ -486,6 +486,11 @@ public: | |||
| 486 | d3d12_trace::record("ID3D12GraphicsCommandList6::DispatchMesh"); | 486 | d3d12_trace::record("ID3D12GraphicsCommandList6::DispatchMesh"); |
| 487 | if (x > 65535 || y > 65535 || z > 65535 || std::uint64_t(x) * y * z > (1u << 22)) return check(false); | 487 | if (x > 65535 || y > 65535 || z > 65535 || std::uint64_t(x) * y * z > (1u << 22)) return check(false); |
| 488 | if (!graphics_pipeline_ || !graphics_.layout) return check(false); | 488 | if (!graphics_pipeline_ || !graphics_.layout) return check(false); |
| 489 | // A mesh shader reads the root arguments from s16 through a 16-dword window (RootArgumentLayout::mesh_ok). | ||
| 490 | if (!graphics_.layout->mesh_ok) { | ||
| 491 | stub("DispatchMesh(root signature larger than a mesh shader's root window)"); | ||
| 492 | return check(false); | ||
| 493 | } | ||
| 489 | if (!(viewport_.width > 0) || !(viewport_.height > 0)) return; // as record_draw: nothing is rasterized | 494 | if (!(viewport_.width > 0) || !(viewport_.height > 0)) return; // as record_draw: nothing is rasterized |
| 490 | leonida::Draw draw{graphics_pipeline_, graphics_.data, draw_views(), depth_, {}, 0, viewport_, | 495 | leonida::Draw draw{graphics_pipeline_, graphics_.data, draw_views(), depth_, {}, 0, viewport_, |
| 491 | scissor_, blend_factor_, front_stencil_ref_, back_stencil_ref_, false, x, y, z, 0, 0}; | 496 | scissor_, blend_factor_, front_stencil_ref_, back_stencil_ref_, false, x, y, z, 0, 0}; |
| @@ -1242,9 +1247,9 @@ private: | |||
| 1242 | if (!p) return; | 1247 | if (!p) return; |
| 1243 | const std::uint32_t first = first_dword(state, *p); | 1248 | const std::uint32_t first = first_dword(state, *p); |
| 1244 | write(state, first, std::uint32_t(va)); | 1249 | write(state, first, std::uint32_t(va)); |
| 1245 | // In the compute layout a descriptor table is one dword, the 32-bit VA of its first descriptor (the heaps | 1250 | // In the console layout of both bind points a descriptor table is one dword, the 32-bit VA of its first |
| 1246 | // live below 4 GiB); a root view keeps both halves. The graphics layout gives every address two dwords. | 1251 | // descriptor (the heaps live below 4 GiB); a root view keeps both halves (D3D-448). |
| 1247 | if (!(is_compute(state) && type == rt::rootsig::ParamType::Table)) write(state, first + 1, std::uint32_t(va >> 32)); | 1252 | if (type != rt::rootsig::ParamType::Table) write(state, first + 1, std::uint32_t(va >> 32)); |
| 1248 | } | 1253 | } |
| 1249 | 1254 | ||
| 1250 | D3D12_COMMAND_LIST_TYPE type_; | 1255 | D3D12_COMMAND_LIST_TYPE type_; |