27 std::shared_ptr<Texture> destination,
28 std::optional<IRect> source_region,
32 VALIDATION_LOG <<
"Attempted to add a texture blit with no source.";
36 VALIDATION_LOG <<
"Attempted to add a texture blit with no destination.";
40 if (source->GetTextureDescriptor().sample_count !=
41 destination->GetTextureDescriptor().sample_count) {
43 "The source sample count (%d) must match the destination sample count "
45 static_cast<int>(source->GetTextureDescriptor().sample_count),
46 static_cast<int>(destination->GetTextureDescriptor().sample_count));
49 if (source->GetTextureDescriptor().format !=
50 destination->GetTextureDescriptor().format) {
52 "The source pixel format (%s) must match the destination pixel format "
60 if (!source_region.has_value()) {
67 if (!source_region.has_value()) {
72 source_region = source_region->Intersection(
74 if (!source_region.has_value()) {
79 std::move(source), std::move(destination), source_region.value(),
80 destination_origin, std::move(label));
84 std::shared_ptr<DeviceBuffer> destination,
85 std::optional<IRect> source_region,
86 size_t destination_offset,
89 VALIDATION_LOG <<
"Attempted to add a texture blit with no source.";
93 VALIDATION_LOG <<
"Attempted to add a texture blit with no destination.";
97 if (!source_region.has_value()) {
101 auto bytes_per_pixel =
103 auto bytes_per_image = source_region->Area() * bytes_per_pixel;
104 if (destination_offset + bytes_per_image >
105 destination->GetDeviceBufferDescriptor().size) {
107 <<
"Attempted to add a texture blit with out of bounds access.";
114 if (!source_region.has_value()) {
119 source_region.value(), destination_offset,
124 std::shared_ptr<Texture> destination,
125 IPoint destination_origin,
128 VALIDATION_LOG <<
"Attempted to add a texture blit with no destination.";
132 auto bytes_per_pixel =
134 auto bytes_per_image =
135 destination->GetTextureDescriptor().size.Area() * bytes_per_pixel;
139 <<
"Attempted to add a texture blit with out of bounds access.";
144 destination_origin, std::move(label));
150 VALIDATION_LOG <<
"Attempted to add an invalid mipmap generation command "