{"record":{"id":"233801c80adf770a","repo":"FyroxEngine/Fyrox","slug":"generate-mipmap-format-is-not-filterable-skippin","errorCode":null,"errorMessage":"generate_mipmap: format is not filterable, skipping","messagePattern":"generate_mipmap: format is not filterable, skipping","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"fyrox-graphics-wgpu/src/server.rs","lineNumber":741,"sourceCode":"    }\n    fn capabilities(&self) -> ServerCapabilities {\n        let limits = self.state.device.limits();\n        ServerCapabilities {\n            max_uniform_buffer_binding_size: limits.max_uniform_buffer_binding_size as usize,\n            uniform_buffer_offset_alignment: limits.min_uniform_buffer_offset_alignment as usize,\n            max_lod_bias: 16.0,\n        }\n    }\n    fn set_polygon_fill_mode(&self, _face: PolygonFace, mode: PolygonFillMode) {\n        self.polygon_fill_mode.set(mode);\n    }\n    fn generate_mipmap(&self, texture: &GpuTexture) {\n        let Some(wtex) = texture.as_any().downcast_ref::<WgpuTexture>() else {\n            return;\n        };\n        let format = wtex.format();\n        if !is_filterable_format(format) {\n            Log::warn(\"generate_mipmap: format is not filterable, skipping\");\n            return;\n        }\n\n        let (width, height, _depth) = texture_size(texture.kind());\n        let mip_count = wtex.wgpu_texture().mip_level_count();\n        if mip_count <= 1 || width <= 1 || height <= 1 {\n            return;\n        }\n\n        self.flush_active_pass();\n\n        let shader = self.mipmap_shader.get_or_init(|| {\n            self.state\n                .device\n                .create_shader_module(wgpu::ShaderModuleDescriptor {\n                    label: Some(\"MipmapShader\"),\n                    source: wgpu::ShaderSource::Wgsl(MIPMAP_SHADER_SRC.into()),\n                })","sourceCodeStart":723,"sourceCodeEnd":759,"githubUrl":"https://github.com/FyroxEngine/Fyrox/blob/76c91aad8eca488ce527b1af707be8b3b24ad72d/fyrox-graphics-wgpu/src/server.rs#L723-L759","documentation":"wgpu requires the texture format to be filterable to use a render-bundle-based mipmap generation (which samples with a filtering sampler). The wgpu backend checks is_filterable_format and skips mip generation for non-filterable formats, logging this warning.","triggerScenarios":"Calling Texture::generate_mipmap (server.generate_mipmap) on a texture whose wgpu format is not filterable (e.g. depth formats, pure storage formats like rgba8uint, compressed formats).","commonSituations":"Generating mips for a depth texture or an integer/unorm-snorm-unsupported format; porting GL code that assumed glGenerateMipmap works for any format.","solutions":["Create the texture with a filterable format (e.g. rgba8unorm / bgra8unorm)","Fill mip levels manually with a compute or blit path for non-filterable formats","Skip mip generation for formats where mips are unnecessary"],"exampleFix":"// before\nlet texture = server.create_texture(TextureDescriptor { pixel_format: Some(PixelFormat::R8), .. });\ntexture.generate_mipmap(server);\n// after\nlet texture = server.create_texture(TextureDescriptor { pixel_format: Some(PixelFormat::RGBA8), .. });\ntexture.generate_mipmap(server);","handlingStrategy":"validation","validationCode":"// choose a filterable format up front\nconst FILTERABLE: [PixelFormat; 3] = [PixelFormat::RGBA8, PixelFormat::RGB8, PixelFormat::RG8];\ndebug_assert!(FILTERABLE.contains(&pixel_format), \"generate_mipmap needs a filterable format\");","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Use RGBA8 or another filterable format for textures that need mips","Skip mips on depth/integer textures","Accept the warning as a no-op signal rather than a crash"],"tags":["wgpu","mipmap","texture-format"],"backgroundTag":"unsupported-dtype","analyzedSha":"76c91aad8eca488ce527b1af707be8b3b24ad72d","analyzedAt":"2026-09-10T16:04:01.633Z","contentChangedAt":"2026-09-10T16:04:01.633Z","schemaVersion":2},"datasetVersion":"2026-09-16T09:17:16.951Z"}