33 std::shared_ptr<Texture> destination,
34 std::optional<IRect> source_region,
38 VALIDATION_LOG <<
"Attempted to add a texture blit with no source.";
42 VALIDATION_LOG <<
"Attempted to add a texture blit with no destination.";
46 if (source->GetTextureDescriptor().sample_count !=
47 destination->GetTextureDescriptor().sample_count) {
49 "The source sample count (%d) must match the destination sample count "
51 static_cast<int>(source->GetTextureDescriptor().sample_count),
52 static_cast<int>(destination->GetTextureDescriptor().sample_count));
56 if (!source_region.has_value()) {
63 if (!source_region.has_value()) {
68 source_region = source_region->Intersection(
69 IRect(-destination_origin, destination->GetSize()));
70 if (!source_region.has_value()) {
75 std::move(source), std::move(destination), source_region.value(),
76 destination_origin, std::move(label));
80 std::shared_ptr<DeviceBuffer> destination,
81 std::optional<IRect> source_region,
82 size_t destination_offset,
85 VALIDATION_LOG <<
"Attempted to add a texture blit with no source.";
89 VALIDATION_LOG <<
"Attempted to add a texture blit with no destination.";
93 if (!source_region.has_value()) {
97 auto bytes_per_pixel =
99 auto bytes_per_image = source_region->size.Area() * bytes_per_pixel;
100 if (destination_offset + bytes_per_image >
101 destination->GetDeviceBufferDescriptor().size) {
103 <<
"Attempted to add a texture blit with out of bounds access.";
110 if (!source_region.has_value()) {
115 source_region.value(), destination_offset,
120 std::shared_ptr<Texture> destination,
121 IPoint destination_origin,
124 VALIDATION_LOG <<
"Attempted to add a texture blit with no destination.";
128 auto bytes_per_pixel =
130 auto bytes_per_image =
131 destination->GetTextureDescriptor().size.Area() * bytes_per_pixel;
135 <<
"Attempted to add a texture blit with out of bounds access.";
140 destination_origin, std::move(label));
146 VALIDATION_LOG <<
"Attempted to add an invalid mipmap generation command "