[Flutter GPU] GLES should guard linear sampling of fp32 float textures
- Dominant language
- Dart
- Stars
- 179k
- Forks
- 31.1k
- PR merge metrics
- PR metrics pending
Description
### Steps to reproduce
1. On Android OpenGL ES Impeller, create a `PixelFormat::kR32G32B32A32Float` texture.
2. Render into it or upload valid data to it.
3. Bind it in a later draw with a sampler whose min or mag filter is linear.
4. Run on a GLES device that supports float textures but not float linear filtering.
### Expected results
Flutter GPU should avoid creating an incomplete GLES texture and sampler combination by default.
For GLES, Impeller should detect when a texture format is not linearly filterable on the current device. If a caller requests linear filtering for that texture, the backend should either degrade the filter to nearest or fail with a clear validation message. Degrading to nearest is likely friendlier for Flutter GPU callers.
### Actual results
`SamplerGLES::ConfigureBoundTexture` currently applies `GL_LINEAR` whenever the sampler requests it. On GLES, fp32 textures require `GL_OES_texture_float_linear` for linear filtering. Devices can support `GL_OES_texture_float` and `GL_EXT_color_buffer_float` without supporting `GL_OES_texture_float_linear`.
In that case, the texture becomes incomplete for sampling and shaders can receive invalid results instead of a useful fallback or diagnostic.
Example device capability shape:
```text
Has GL_EXT_color_buffer_float
Has GL_OES_texture_float
Does not have GL_OES_texture_float_linear
```
Contributor guide
Research direction
Start at SamplerGLES::ConfigureBoundTexture and trace how GLES texture formats, sampler filters, and device capabilities are handled for fp32 textures. Reproduce on a device with GL_OES_texture_float and GL_EXT_color_buffer_float but without GL_OES_texture_float_linear; done means linear filtering no longer creates an incomplete combination and instead uses the requested fallback or a clear validation failure.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- android, cpp
- Domain
- computer-graphics, mobile-dev
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 52/100