Apply Patch
This commit is contained in:
+11
-1
@@ -243,11 +243,21 @@ impl SurfaceRenderer {
|
||||
fps: u32,
|
||||
) -> Result<Self> {
|
||||
let caps = surface.get_capabilities(&gpu.adapter);
|
||||
|
||||
// A surface may advertise formats that need features we never requested when
|
||||
// creating the device (see `required_features` above). Picking one of those
|
||||
// fails validation at `create_render_pipeline`. Turnip/Adreno enumerates
|
||||
// 16-bit-norm formats (needing TEXTURE_FORMAT_16BIT_NORM) before the plain
|
||||
// 8-bit ones, so filter by what the device actually supports rather than
|
||||
// relying on enumeration order.
|
||||
let supported = gpu.device.features();
|
||||
let usable = |f: &wgpu::TextureFormat| supported.contains(f.required_features());
|
||||
let format = caps
|
||||
.formats
|
||||
.iter()
|
||||
.copied()
|
||||
.find(|f| !f.is_srgb())
|
||||
.find(|f| !f.is_srgb() && usable(f))
|
||||
.or_else(|| caps.formats.iter().copied().find(usable))
|
||||
.unwrap_or(caps.formats[0]);
|
||||
|
||||
let present_mode =
|
||||
|
||||
Reference in New Issue
Block a user