diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2017-09-12 00:15:29 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2017-09-12 00:15:29 +0300 |
commit | d126ffbea4fc549072100022c8be15bd4e3f62ca (patch) | |
tree | 5360575e84f51c903a37ed4be28d3d4810ce3eb1 /source/blender/gpu | |
parent | 4757404eef04267880ed114823332818087e8aee (diff) |
DRW: Use static list (array) of texture/ubo to track bound textures/ubos.
This is in order to use the same texture on multiple sampler.
Also texture counter is reset after each shading group. This mimics the previous behaviour.
Diffstat (limited to 'source/blender/gpu')
-rw-r--r-- | source/blender/gpu/GPU_uniformbuffer.h | 2 | ||||
-rw-r--r-- | source/blender/gpu/intern/gpu_uniformbuffer.c | 5 |
2 files changed, 5 insertions, 2 deletions
diff --git a/source/blender/gpu/GPU_uniformbuffer.h b/source/blender/gpu/GPU_uniformbuffer.h index 57c4612c865..c2480f8ba03 100644 --- a/source/blender/gpu/GPU_uniformbuffer.h +++ b/source/blender/gpu/GPU_uniformbuffer.h @@ -46,9 +46,7 @@ void GPU_uniformbuffer_update(GPUUniformBuffer *ubo, const void *data); void GPU_uniformbuffer_dynamic_update(GPUUniformBuffer *ubo_); void GPU_uniformbuffer_bind(GPUUniformBuffer *ubo, int number); -#if 0 void GPU_uniformbuffer_unbind(GPUUniformBuffer *ubo); -#endif int GPU_uniformbuffer_bindpoint(GPUUniformBuffer *ubo); diff --git a/source/blender/gpu/intern/gpu_uniformbuffer.c b/source/blender/gpu/intern/gpu_uniformbuffer.c index 46cf9d19a47..652cd38b16b 100644 --- a/source/blender/gpu/intern/gpu_uniformbuffer.c +++ b/source/blender/gpu/intern/gpu_uniformbuffer.c @@ -356,6 +356,11 @@ void GPU_uniformbuffer_bind(GPUUniformBuffer *ubo, int number) ubo->bindpoint = number; } +void GPU_uniformbuffer_unbind(GPUUniformBuffer *ubo) +{ + ubo->bindpoint = -1; +} + int GPU_uniformbuffer_bindpoint(GPUUniformBuffer *ubo) { return ubo->bindpoint; |