Page MenuHome

GPU: Texture: Replace internal sampler state by explicit state object
ClosedPublic

Authored by Clément Foucault (fclem) on May 25 2020, 11:32 AM.

Details

Summary

This makes it easier to track as well as allowing us to sample the same texture with different sampling parameters (which should fix the related T73942 in the long run).
This also makes us more aligned with vulkan spec, because the sampler state is not part of the texture.

This patch only modifies the GPU module implementation. The draw manager still expect one GPUTexture per sampler unit so that will have to be refactored in another patch.

Minor good side effect, changing anisotropic filtering does not free all textures anymore.

Diff Detail

Repository
rB Blender

Event Timeline

Clément Foucault (fclem) requested review of this revision.May 25 2020, 11:32 AM
Clément Foucault (fclem) created this revision.
  • Fix GL_TEXTURE_MAX_ANISOTROPY_EXT not being optional
  • Remove uneeded binds
Brecht Van Lommel (brecht) requested changes to this revision.May 27 2020, 7:23 PM
Brecht Van Lommel (brecht) added inline comments.
source/blender/gpu/intern/gpu_texture.c
1774

Assert and print an error when no free texture unit is found?

1777–1788

This early return could be replaced by else { break; } inside the loop below.

This revision now requires changes to proceed.May 27 2020, 7:23 PM
Clément Foucault (fclem) marked 2 inline comments as done.
  • Address reviewer comments
  • Merge branch 'master' into tmp-texture-sampler
This revision is now accepted and ready to land.Jun 2 2020, 7:18 AM