diff options
| author | gabrielsteglich <63128571+gabrielsteglich@users.noreply.github.com> | 2026-11-22 13:13:27 -0300 |
|---|---|---|
| committer | gabrielsteglich <63128571+gabrielsteglich@users.noreply.github.com> | 2026-11-22 13:39:08 -0300 |
| commit | f8e89767f66de8f2a375615ca96a10459a87fef7 (patch) | |
| tree | 14548229b6e2b26c68105d88de104cdf8ae37502 /runtime/src/command_list.h | |
| parent | 49475796c226c8511b9470bf97a4daf57b8af323 (diff) | |
Runtime: map sparse reserved RGBA8 texture tiles (D3D-285)
Diffstat (limited to 'runtime/src/command_list.h')
| -rw-r--r-- | runtime/src/command_list.h | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/runtime/src/command_list.h b/runtime/src/command_list.h index 47a0561b3..7b81ac75d 100644 --- a/runtime/src/command_list.h +++ b/runtime/src/command_list.h | |||
| @@ -324,6 +324,7 @@ struct CopyTexture { | |||
| 324 | CopyLocation src; | 324 | CopyLocation src; |
| 325 | bool has_box; | 325 | bool has_box; |
| 326 | CopyBox box; | 326 | CopyBox box; |
| 327 | bool tile_footprint = false; // RGBA8 CopyTiles: rows in a linear 64 KiB tile, at any byte offset | ||
| 327 | }; | 328 | }; |
| 328 | 329 | ||
| 329 | // CopyResource: every subresource, or the whole buffer. | 330 | // CopyResource: every subresource, or the whole buffer. |
| @@ -674,7 +675,9 @@ public: | |||
| 674 | } | 675 | } |
| 675 | 676 | ||
| 676 | bool copy_texture(const CopyTexture& copy) { | 677 | bool copy_texture(const CopyTexture& copy) { |
| 677 | if (!valid(copy.dst) || !valid(copy.src) || (copy.dst.footprint && copy.src.footprint)) return false; | 678 | const auto alignment = copy.tile_footprint ? 1u : texture_data_placement_alignment; |
| 679 | if (!valid(copy.dst, alignment) || !valid(copy.src, alignment) || (copy.dst.footprint && copy.src.footprint)) | ||
| 680 | return false; | ||
| 678 | if (copy.has_box && (copy.box.right <= copy.box.left || copy.box.bottom <= copy.box.top || | 681 | if (copy.has_box && (copy.box.right <= copy.box.left || copy.box.bottom <= copy.box.top || |
| 679 | copy.box.back <= copy.box.front)) | 682 | copy.box.back <= copy.box.front)) |
| 680 | return false; | 683 | return false; |
| @@ -866,11 +869,11 @@ private: | |||
| 866 | static bool valid(const TargetView& target) { return target.resource && target.layer_count; } | 869 | static bool valid(const TargetView& target) { return target.resource && target.layer_count; } |
| 867 | 870 | ||
| 868 | // A placed footprint needs aligned offsets and pitches and a non-empty size. | 871 | // A placed footprint needs aligned offsets and pitches and a non-empty size. |
| 869 | static bool valid(const CopyLocation& location) { | 872 | static bool valid(const CopyLocation& location, std::uint32_t alignment) { |
| 870 | if (!location.resource) return false; | 873 | if (!location.resource) return false; |
| 871 | if (!location.footprint) return true; | 874 | if (!location.footprint) return true; |
| 872 | return location.width && location.height && location.depth && location.row_pitch && | 875 | return location.width && location.height && location.depth && location.row_pitch && |
| 873 | location.offset % texture_data_placement_alignment == 0 && | 876 | location.offset % alignment == 0 && |
| 874 | location.row_pitch % texture_data_pitch_alignment == 0; | 877 | location.row_pitch % texture_data_pitch_alignment == 0; |
| 875 | } | 878 | } |
| 876 | 879 | ||