On Fri, 12 Dec 2025 08:18:14 GMT, Jayathirth D V <[email protected]> wrote:

> Currently we don't set any texture filtering & addressing modes for 3D 
> textures in Metal pipeline.
> Default 3D texture filtering is "nearest" for Metal textures, but we use 
> "linear" filtering by default for 3D textures in case of OpenGL.
> Default addressing mode is "clamp_to_edge" in Metal textures, but we use 
> "repeat" addressing mode for 3D textures in OpenGL.
> 
> Metal should use same default filtering & addressing modes for 3D textures as 
> in OpenGL pipeline.
> Under this issue we are trying only to match defaults of Metal to OpenGL 
> pipeline.
> 
> We don't update the filters/addressing modes for 3D textures once created.
> We have open enhancements like https://bugs.openjdk.org/browse/JDK-8324594 
> where we might provide API's to set sampler states for 3D textures in future.
> 
> Functional and performance testing is green with this update.

Thanks for responding. I found one thing that could be improved, will run some 
tests on this later on.

modules/javafx.graphics/src/main/native-prism-mtl/MetalContext.m line 239:

> 237: 
> 238: - (void) create3DSamplerStates
> 239: {

I think we could add something here to skip re-creating the sampler 
descriptors. This can be called every time we switch to 3D (from 
`nSetDeviceParametersFor3D`) and that way we could optimize this transition a 
bit.

-------------

PR Review: https://git.openjdk.org/jfx/pull/2005#pullrequestreview-3582050397
PR Review Comment: https://git.openjdk.org/jfx/pull/2005#discussion_r2622408565

Reply via email to