Skip to content

Commit 8c5aebb

Browse files
committed
[Impeller] Use the canonical texture creation failure message
The Flutter GPU Texture constructor now throws 'Texture creation failed', matching GpuContext.createTexture and the gpu_test.dart expectation, instead of a divergent message. The now-redundant isValid check in createTexture is removed since the constructor throws on failure.
1 parent 3b7c85c commit 8c5aebb

2 files changed

Lines changed: 2 additions & 4 deletions

File tree

engine/src/flutter/lib/gpu/lib/src/context.dart

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -158,9 +158,7 @@ base class GpuContext extends NativeFieldWrapperClass1 {
158158
enableShaderWriteUsage,
159159
mipLevelCount,
160160
);
161-
if (!result.isValid) {
162-
throw Exception('Texture creation failed');
163-
}
161+
// `Texture._initialize` throws on failure, so `result` is always valid here.
164162
return result;
165163
}
166164

engine/src/flutter/lib/gpu/lib/src/texture.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ base class Texture extends NativeFieldWrapperClass1 {
6868
if (!_valid) {
6969
// The engine logs the specific reason (for example, a compressed format
7070
// used with render target or shader write usage, which is sample-only).
71-
throw Exception('Failed to create texture.');
71+
throw Exception('Texture creation failed');
7272
}
7373
}
7474

0 commit comments

Comments
 (0)