Skip to content

Commit

Permalink
[Graphite] Fix Dawn NMOF compressed texture GM.
Browse files Browse the repository at this point in the history
This fixes crash caused by disabling dawn validation.

Change-Id: I88fee4e4682bebb34de49dc54e90d484f74507e2
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/944096
Reviewed-by: Robert Phillips <[email protected]>
Commit-Queue: Greg Daniel <[email protected]>
  • Loading branch information
egdaniel authored and SkCQ committed Jan 29, 2025
1 parent 19819ab commit a5ed95e
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions gm/compressed_textures.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -266,10 +266,20 @@ class CompressedTexturesGM : public skiagm::GM {
return DrawResult::kSkip;
}

if (dContext &&
dContext->backend() == GrBackendApi::kDirect3D && fType == Type::kNonMultipleOfFour) {
// skbug.com/10541 - Are non-multiple-of-four BC1 textures supported in D3D?
return DrawResult::kSkip;
if (fType == Type::kNonMultipleOfFour) {
if (dContext && dContext->backend() == GrBackendApi::kDirect3D) {
// skbug.com/10541 - Are non-multiple-of-four BC1 textures supported in D3D?
return DrawResult::kSkip;
}
#if defined(SK_GRAPHITE)
skgpu::graphite::Recorder* recorder = canvas->recorder();
if (recorder && recorder->backend() == skgpu::BackendApi::kDawn) {
// Dawn does not support non-multiple-of-four textures at all. For the same reason
// we can't support it on older D3D devices above, neither can Dawn. However, Dawn
// disables support for all devices to keep functionality uniform.
return DrawResult::kSkip;
}
#endif
}

fOpaqueETC2Image = make_compressed_image(canvas, fImgDimensions,
Expand Down

0 comments on commit a5ed95e

Please sign in to comment.