34 std::shared_ptr<Texture> destination,
35 std::optional<IRect> source_region,
39 VALIDATION_LOG <<
"Attempted to add a texture blit with no source.";
43 VALIDATION_LOG <<
"Attempted to add a texture blit with no destination.";
47 if (source->GetTextureDescriptor().sample_count !=
48 destination->GetTextureDescriptor().sample_count) {
50 "The source sample count (%d) must match the destination sample count "
52 static_cast<int>(source->GetTextureDescriptor().sample_count),
53 static_cast<int>(destination->GetTextureDescriptor().sample_count));
56 if (source->GetTextureDescriptor().format !=
57 destination->GetTextureDescriptor().format) {
59 "The source pixel format (%s) must match the destination pixel format "
67 if (!source_region.has_value()) {
74 if (!source_region.has_value()) {
79 source_region = source_region->Intersection(
81 if (!source_region.has_value()) {
86 std::move(source), std::move(destination), source_region.value(),
87 destination_origin, std::move(label));
91 std::shared_ptr<DeviceBuffer> destination,
92 std::optional<IRect> source_region,
93 size_t destination_offset,
96 VALIDATION_LOG <<
"Attempted to add a texture blit with no source.";
100 VALIDATION_LOG <<
"Attempted to add a texture blit with no destination.";
104 if (!source_region.has_value()) {
108 auto bytes_per_pixel =
110 auto bytes_per_image = source_region->Area() * bytes_per_pixel;
111 if (destination_offset + bytes_per_image >
112 destination->GetDeviceBufferDescriptor().size) {
114 <<
"Attempted to add a texture blit with out of bounds access.";
121 if (!source_region.has_value()) {
126 source_region.value(), destination_offset,
131 std::shared_ptr<Texture> destination,
132 IPoint destination_origin,
135 VALIDATION_LOG <<
"Attempted to add a texture blit with no destination.";
139 auto bytes_per_pixel =
141 auto bytes_per_image =
142 destination->GetTextureDescriptor().size.Area() * bytes_per_pixel;
146 <<
"Attempted to add a texture blit with out of bounds access.";
151 destination_origin, std::move(label));
157 VALIDATION_LOG <<
"Attempted to add an invalid mipmap generation command "