Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClément Foucault <foucault.clem@gmail.com>2020-09-05 18:31:53 +0300
committerClément Foucault <foucault.clem@gmail.com>2020-09-05 18:49:14 +0300
commit31c77a14af7cac2bc52ecaffde1bae9775dc47ae (patch)
tree08f6704e927bd7cb1d7ca2b6f30ee3b941d2ffff /source/blender/gpu/intern/gpu_texture.cc
parentc766d9b9dc5661693a58e01a3637f15197c2fe59 (diff)
GPUTexture: Add support for samplers
This just add back the support. This commit also includes a bit of cleanup. # Conflicts: # source/blender/gpu/GPU_texture.h
Diffstat (limited to 'source/blender/gpu/intern/gpu_texture.cc')
-rw-r--r--source/blender/gpu/intern/gpu_texture.cc16
1 files changed, 4 insertions, 12 deletions
diff --git a/source/blender/gpu/intern/gpu_texture.cc b/source/blender/gpu/intern/gpu_texture.cc
index 9d431ef4648..d75dc9b728a 100644
--- a/source/blender/gpu/intern/gpu_texture.cc
+++ b/source/blender/gpu/intern/gpu_texture.cc
@@ -482,6 +482,7 @@ void GPU_texture_bind_ex(GPUTexture *tex_,
const bool UNUSED(set_number))
{
Texture *tex = reinterpret_cast<Texture *>(tex_);
+ state = (state >= GPU_SAMPLER_MAX) ? tex->sampler_state : state;
GPU_context_active_get()->state_manager->texture_bind(tex, state, unit);
}
@@ -717,19 +718,10 @@ void GPU_texture_get_mipmap_size(GPUTexture *tex, int lvl, int *r_size)
* Override texture sampler state for one sampler unit only.
* \{ */
-void GPU_samplers_init(void)
+/* Update user defined sampler states. */
+void GPU_samplers_update(void)
{
- /* TODO(fclem) port samplers to GLTextures. */
-}
-
-void GPU_sampler_icon_bind(int UNUSED(unit))
-{
- /* TODO(fclem) port samplers to GLTextures. */
-}
-
-void GPU_samplers_free(void)
-{
- /* TODO(fclem) port samplers to GLTextures. */
+ GPUBackend::get()->samplers_update();
}
/** \} */