diff --git a/source/blender/compositor/realtime_compositor/algorithms/intern/algorithm_parallel_reduction.cc b/source/blender/compositor/realtime_compositor/algorithms/intern/algorithm_parallel_reduction.cc index ba0e7eb21ac..b45b3e100e8 100644 --- a/source/blender/compositor/realtime_compositor/algorithms/intern/algorithm_parallel_reduction.cc +++ b/source/blender/compositor/realtime_compositor/algorithms/intern/algorithm_parallel_reduction.cc @@ -41,10 +41,10 @@ static float *parallel_reduction_dispatch(Context &context, GPUTexture *reduced_texture = context.texture_pool().acquire(reduced_size, format); GPU_memory_barrier(GPU_BARRIER_TEXTURE_FETCH); - const int texture_image_unit = GPU_shader_get_texture_binding(shader, "input_tx"); + const int texture_image_unit = GPU_shader_get_sampler_binding(shader, "input_tx"); GPU_texture_bind(texture_to_reduce, texture_image_unit); - const int image_unit = GPU_shader_get_texture_binding(shader, "output_img"); + const int image_unit = GPU_shader_get_sampler_binding(shader, "output_img"); GPU_texture_image_bind(reduced_texture, image_unit); GPU_compute_dispatch(shader, reduced_size.x, reduced_size.y, 1); diff --git a/source/blender/compositor/realtime_compositor/cached_resources/intern/morphological_distance_feather_weights.cc b/source/blender/compositor/realtime_compositor/cached_resources/intern/morphological_distance_feather_weights.cc index eac88b907b8..98e7b67dca7 100644 --- a/source/blender/compositor/realtime_compositor/cached_resources/intern/morphological_distance_feather_weights.cc +++ b/source/blender/compositor/realtime_compositor/cached_resources/intern/morphological_distance_feather_weights.cc @@ -135,7 +135,7 @@ void MorphologicalDistanceFeatherWeights::compute_distance_falloffs(int type, in void MorphologicalDistanceFeatherWeights::bind_weights_as_texture(GPUShader *shader, const char *texture_name) const { - const int texture_image_unit = GPU_shader_get_texture_binding(shader, texture_name); + const int texture_image_unit = GPU_shader_get_sampler_binding(shader, texture_name); GPU_texture_bind(weights_texture_, texture_image_unit); } @@ -147,7 +147,7 @@ void MorphologicalDistanceFeatherWeights::unbind_weights_as_texture() const void MorphologicalDistanceFeatherWeights::bind_distance_falloffs_as_texture( GPUShader *shader, const char *texture_name) const { - const int texture_image_unit = GPU_shader_get_texture_binding(shader, texture_name); + const int texture_image_unit = GPU_shader_get_sampler_binding(shader, texture_name); GPU_texture_bind(distance_falloffs_texture_, texture_image_unit); } diff --git a/source/blender/compositor/realtime_compositor/cached_resources/intern/symmetric_blur_weights.cc b/source/blender/compositor/realtime_compositor/cached_resources/intern/symmetric_blur_weights.cc index b3200d468c9..db4c0f777f2 100644 --- a/source/blender/compositor/realtime_compositor/cached_resources/intern/symmetric_blur_weights.cc +++ b/source/blender/compositor/realtime_compositor/cached_resources/intern/symmetric_blur_weights.cc @@ -103,7 +103,7 @@ SymmetricBlurWeights::~SymmetricBlurWeights() void SymmetricBlurWeights::bind_as_texture(GPUShader *shader, const char *texture_name) const { - const int texture_image_unit = GPU_shader_get_texture_binding(shader, texture_name); + const int texture_image_unit = GPU_shader_get_sampler_binding(shader, texture_name); GPU_texture_bind(texture_, texture_image_unit); } diff --git a/source/blender/compositor/realtime_compositor/cached_resources/intern/symmetric_separable_blur_weights.cc b/source/blender/compositor/realtime_compositor/cached_resources/intern/symmetric_separable_blur_weights.cc index b8c47d5a5d0..07d45531921 100644 --- a/source/blender/compositor/realtime_compositor/cached_resources/intern/symmetric_separable_blur_weights.cc +++ b/source/blender/compositor/realtime_compositor/cached_resources/intern/symmetric_separable_blur_weights.cc @@ -81,7 +81,7 @@ SymmetricSeparableBlurWeights::~SymmetricSeparableBlurWeights() void SymmetricSeparableBlurWeights::bind_as_texture(GPUShader *shader, const char *texture_name) const { - const int texture_image_unit = GPU_shader_get_texture_binding(shader, texture_name); + const int texture_image_unit = GPU_shader_get_sampler_binding(shader, texture_name); GPU_texture_bind(texture_, texture_image_unit); } diff --git a/source/blender/compositor/realtime_compositor/intern/result.cc b/source/blender/compositor/realtime_compositor/intern/result.cc index e301aa6e0ed..902eede7dd7 100644 --- a/source/blender/compositor/realtime_compositor/intern/result.cc +++ b/source/blender/compositor/realtime_compositor/intern/result.cc @@ -82,7 +82,7 @@ void Result::bind_as_texture(GPUShader *shader, const char *texture_name) const /* Make sure any prior writes to the texture are reflected before reading from it. */ GPU_memory_barrier(GPU_BARRIER_TEXTURE_FETCH); - const int texture_image_unit = GPU_shader_get_texture_binding(shader, texture_name); + const int texture_image_unit = GPU_shader_get_sampler_binding(shader, texture_name); GPU_texture_bind(texture_, texture_image_unit); } @@ -93,7 +93,7 @@ void Result::bind_as_image(GPUShader *shader, const char *image_name, bool read) GPU_memory_barrier(GPU_BARRIER_SHADER_IMAGE_ACCESS); } - const int image_unit = GPU_shader_get_texture_binding(shader, image_name); + const int image_unit = GPU_shader_get_sampler_binding(shader, image_name); GPU_texture_image_bind(texture_, image_unit); } diff --git a/source/blender/compositor/realtime_compositor/intern/shader_operation.cc b/source/blender/compositor/realtime_compositor/intern/shader_operation.cc index 4ac997db42b..b4976e5eff0 100644 --- a/source/blender/compositor/realtime_compositor/intern/shader_operation.cc +++ b/source/blender/compositor/realtime_compositor/intern/shader_operation.cc @@ -95,14 +95,14 @@ void ShaderOperation::bind_material_resources(GPUShader *shader) * no uniforms. */ GPUUniformBuf *ubo = GPU_material_uniform_buffer_get(material_); if (ubo) { - GPU_uniformbuf_bind(ubo, GPU_shader_get_uniform_block_binding(shader, GPU_UBO_BLOCK_NAME)); + GPU_uniformbuf_bind(ubo, GPU_shader_get_ubo_binding(shader, GPU_UBO_BLOCK_NAME)); } /* Bind color band textures needed by curve and ramp nodes. */ ListBase textures = GPU_material_textures(material_); LISTBASE_FOREACH (GPUMaterialTexture *, texture, &textures) { if (texture->colorband) { - const int texture_image_unit = GPU_shader_get_texture_binding(shader, texture->sampler_name); + const int texture_image_unit = GPU_shader_get_sampler_binding(shader, texture->sampler_name); GPU_texture_bind(*texture->colorband, texture_image_unit); } } diff --git a/source/blender/draw/engines/workbench/workbench_shadow.cc b/source/blender/draw/engines/workbench/workbench_shadow.cc index 2bc5584abe7..ff50fd3732c 100644 --- a/source/blender/draw/engines/workbench/workbench_shadow.cc +++ b/source/blender/draw/engines/workbench/workbench_shadow.cc @@ -259,17 +259,16 @@ void ShadowPass::ShadowView::compute_visibility(ObjectBoundsBuf &bounds, GPU_shader_uniform_1i(shader, "visibility_word_per_draw", word_per_draw); GPU_shader_uniform_1b(shader, "force_fail_method", force_fail_method_); GPU_shader_uniform_3fv(shader, "shadow_direction", light_direction_); - GPU_uniformbuf_bind(extruded_frustum_, - GPU_shader_get_uniform_block_binding(shader, "extruded_frustum")); - GPU_storagebuf_bind(bounds, GPU_shader_get_ssbo(shader, "bounds_buf")); + GPU_uniformbuf_bind(extruded_frustum_, GPU_shader_get_ubo_binding(shader, "extruded_frustum")); + GPU_storagebuf_bind(bounds, GPU_shader_get_ssbo_binding(shader, "bounds_buf")); if (current_pass_type_ == ShadowPass::FORCED_FAIL) { - GPU_storagebuf_bind(visibility_buf_, GPU_shader_get_ssbo(shader, "visibility_buf")); + GPU_storagebuf_bind(visibility_buf_, GPU_shader_get_ssbo_binding(shader, "visibility_buf")); } else { GPU_storagebuf_bind(pass_visibility_buf_, - GPU_shader_get_ssbo(shader, "pass_visibility_buf")); + GPU_shader_get_ssbo_binding(shader, "pass_visibility_buf")); GPU_storagebuf_bind(fail_visibility_buf_, - GPU_shader_get_ssbo(shader, "fail_visibility_buf")); + GPU_shader_get_ssbo_binding(shader, "fail_visibility_buf")); } GPU_uniformbuf_bind(data_, DRW_VIEW_UBO_SLOT); GPU_compute_dispatch(shader, divide_ceil_u(resource_len, DRW_VISIBILITY_GROUP_SIZE), 1, 1); diff --git a/source/blender/draw/intern/draw_cache_impl_subdivision.cc b/source/blender/draw/intern/draw_cache_impl_subdivision.cc index fb21e58d527..0fe5eba26f4 100644 --- a/source/blender/draw/intern/draw_cache_impl_subdivision.cc +++ b/source/blender/draw/intern/draw_cache_impl_subdivision.cc @@ -1350,7 +1350,7 @@ static void draw_subdiv_ubo_update_and_bind(const DRWSubdivCache *cache, GPU_uniformbuf_update(cache->ubo, &storage); - const int binding = GPU_shader_get_uniform_block_binding(shader, "shader_data"); + const int binding = GPU_shader_get_ubo_binding(shader, "shader_data"); GPU_uniformbuf_bind(cache->ubo, binding); } diff --git a/source/blender/draw/intern/draw_command.cc b/source/blender/draw/intern/draw_command.cc index 775ee9f695b..c06ff88537a 100644 --- a/source/blender/draw/intern/draw_command.cc +++ b/source/blender/draw/intern/draw_command.cc @@ -646,10 +646,10 @@ void DrawMultiBuf::bind(RecordingState &state, GPU_shader_uniform_1i(shader, "prototype_len", prototype_count_); GPU_shader_uniform_1i(shader, "visibility_word_per_draw", visibility_word_per_draw); GPU_shader_uniform_1i(shader, "view_shift", log2_ceil_u(view_len)); - GPU_storagebuf_bind(group_buf_, GPU_shader_get_ssbo(shader, "group_buf")); - GPU_storagebuf_bind(visibility_buf, GPU_shader_get_ssbo(shader, "visibility_buf")); - GPU_storagebuf_bind(prototype_buf_, GPU_shader_get_ssbo(shader, "prototype_buf")); - GPU_storagebuf_bind(command_buf_, GPU_shader_get_ssbo(shader, "command_buf")); + GPU_storagebuf_bind(group_buf_, GPU_shader_get_ssbo_binding(shader, "group_buf")); + GPU_storagebuf_bind(visibility_buf, GPU_shader_get_ssbo_binding(shader, "visibility_buf")); + GPU_storagebuf_bind(prototype_buf_, GPU_shader_get_ssbo_binding(shader, "prototype_buf")); + GPU_storagebuf_bind(command_buf_, GPU_shader_get_ssbo_binding(shader, "command_buf")); GPU_storagebuf_bind(resource_id_buf_, DRW_RESOURCE_ID_SLOT); GPU_compute_dispatch(shader, divide_ceil_u(prototype_count_, DRW_COMMAND_GROUP_SIZE), 1, 1); if (GPU_shader_draw_parameters_support() == false) { diff --git a/source/blender/draw/intern/draw_manager.cc b/source/blender/draw/intern/draw_manager.cc index 74108ab2f7c..f34650255a5 100644 --- a/source/blender/draw/intern/draw_manager.cc +++ b/source/blender/draw/intern/draw_manager.cc @@ -114,9 +114,9 @@ void Manager::end_sync() GPUShader *shader = DRW_shader_draw_resource_finalize_get(); GPU_shader_bind(shader); GPU_shader_uniform_1i(shader, "resource_len", resource_len_); - GPU_storagebuf_bind(matrix_buf.current(), GPU_shader_get_ssbo(shader, "matrix_buf")); - GPU_storagebuf_bind(bounds_buf.current(), GPU_shader_get_ssbo(shader, "bounds_buf")); - GPU_storagebuf_bind(infos_buf.current(), GPU_shader_get_ssbo(shader, "infos_buf")); + GPU_storagebuf_bind(matrix_buf.current(), GPU_shader_get_ssbo_binding(shader, "matrix_buf")); + GPU_storagebuf_bind(bounds_buf.current(), GPU_shader_get_ssbo_binding(shader, "bounds_buf")); + GPU_storagebuf_bind(infos_buf.current(), GPU_shader_get_ssbo_binding(shader, "infos_buf")); GPU_compute_dispatch(shader, thread_groups, 1, 1); GPU_memory_barrier(GPU_BARRIER_SHADER_STORAGE); diff --git a/source/blender/draw/intern/draw_manager_data.cc b/source/blender/draw/intern/draw_manager_data.cc index a88d59fbd28..2079baf53a2 100644 --- a/source/blender/draw/intern/draw_manager_data.cc +++ b/source/blender/draw/intern/draw_manager_data.cc @@ -256,7 +256,7 @@ void DRW_shgroup_uniform_texture_ex(DRWShadingGroup *shgroup, eGPUSamplerState sampler_state) { BLI_assert(tex != nullptr); - int loc = GPU_shader_get_texture_binding(shgroup->shader, name); + int loc = GPU_shader_get_sampler_binding(shgroup->shader, name); drw_shgroup_uniform_create_ex(shgroup, loc, DRW_UNIFORM_TEXTURE, tex, sampler_state, 0, 1); } @@ -271,7 +271,7 @@ void DRW_shgroup_uniform_texture_ref_ex(DRWShadingGroup *shgroup, eGPUSamplerState sampler_state) { BLI_assert(tex != nullptr); - int loc = GPU_shader_get_texture_binding(shgroup->shader, name); + int loc = GPU_shader_get_sampler_binding(shgroup->shader, name); drw_shgroup_uniform_create_ex(shgroup, loc, DRW_UNIFORM_TEXTURE_REF, tex, sampler_state, 0, 1); } @@ -283,14 +283,14 @@ void DRW_shgroup_uniform_texture_ref(DRWShadingGroup *shgroup, const char *name, void DRW_shgroup_uniform_image(DRWShadingGroup *shgroup, const char *name, const GPUTexture *tex) { BLI_assert(tex != nullptr); - int loc = GPU_shader_get_texture_binding(shgroup->shader, name); + int loc = GPU_shader_get_sampler_binding(shgroup->shader, name); drw_shgroup_uniform_create_ex(shgroup, loc, DRW_UNIFORM_IMAGE, tex, GPU_SAMPLER_DEFAULT, 0, 1); } void DRW_shgroup_uniform_image_ref(DRWShadingGroup *shgroup, const char *name, GPUTexture **tex) { BLI_assert(tex != nullptr); - int loc = GPU_shader_get_texture_binding(shgroup->shader, name); + int loc = GPU_shader_get_sampler_binding(shgroup->shader, name); drw_shgroup_uniform_create_ex( shgroup, loc, DRW_UNIFORM_IMAGE_REF, tex, GPU_SAMPLER_DEFAULT, 0, 1); } @@ -300,7 +300,7 @@ void DRW_shgroup_uniform_block_ex(DRWShadingGroup *shgroup, const GPUUniformBuf *ubo DRW_DEBUG_FILE_LINE_ARGS) { BLI_assert(ubo != nullptr); - int loc = GPU_shader_get_uniform_block_binding(shgroup->shader, name); + int loc = GPU_shader_get_ubo_binding(shgroup->shader, name); if (loc == -1) { #ifdef DRW_UNUSED_RESOURCE_TRACKING printf("%s:%d: Unable to locate binding of shader uniform buffer object: %s.\n", @@ -321,7 +321,7 @@ void DRW_shgroup_uniform_block_ref_ex(DRWShadingGroup *shgroup, GPUUniformBuf **ubo DRW_DEBUG_FILE_LINE_ARGS) { BLI_assert(ubo != nullptr); - int loc = GPU_shader_get_uniform_block_binding(shgroup->shader, name); + int loc = GPU_shader_get_ubo_binding(shgroup->shader, name); if (loc == -1) { #ifdef DRW_UNUSED_RESOURCE_TRACKING printf("%s:%d: Unable to locate binding of shader uniform buffer object: %s.\n", @@ -344,7 +344,7 @@ void DRW_shgroup_storage_block_ex(DRWShadingGroup *shgroup, { BLI_assert(ssbo != nullptr); /* TODO(@fclem): Fix naming inconsistency. */ - int loc = GPU_shader_get_ssbo(shgroup->shader, name); + int loc = GPU_shader_get_ssbo_binding(shgroup->shader, name); if (loc == -1) { #ifdef DRW_UNUSED_RESOURCE_TRACKING printf("%s:%d: Unable to locate binding of shader storage buffer object: %s.\n", @@ -367,7 +367,7 @@ void DRW_shgroup_storage_block_ref_ex(DRWShadingGroup *shgroup, { BLI_assert(ssbo != nullptr); /* TODO(@fclem): Fix naming inconsistency. */ - int loc = GPU_shader_get_ssbo(shgroup->shader, name); + int loc = GPU_shader_get_ssbo_binding(shgroup->shader, name); if (loc == -1) { #ifdef DRW_UNUSED_RESOURCE_TRACKING printf("%s:%d: Unable to locate binding of shader storage buffer object: %s.\n", @@ -539,7 +539,7 @@ void DRW_shgroup_vertex_buffer_ex(DRWShadingGroup *shgroup, const char *name, GPUVertBuf *vertex_buffer DRW_DEBUG_FILE_LINE_ARGS) { - int location = GPU_shader_get_ssbo(shgroup->shader, name); + int location = GPU_shader_get_ssbo_binding(shgroup->shader, name); if (location == -1) { #ifdef DRW_UNUSED_RESOURCE_TRACKING printf("%s:%d: Unable to locate binding of shader storage buffer object: %s.\n", @@ -564,7 +564,7 @@ void DRW_shgroup_vertex_buffer_ref_ex(DRWShadingGroup *shgroup, const char *name, GPUVertBuf **vertex_buffer DRW_DEBUG_FILE_LINE_ARGS) { - int location = GPU_shader_get_ssbo(shgroup->shader, name); + int location = GPU_shader_get_ssbo_binding(shgroup->shader, name); if (location == -1) { #ifdef DRW_UNUSED_RESOURCE_TRACKING printf("%s:%d: Unable to locate binding of shader storage buffer object: %s.\n", @@ -589,7 +589,7 @@ void DRW_shgroup_buffer_texture(DRWShadingGroup *shgroup, const char *name, GPUVertBuf *vertex_buffer) { - int location = GPU_shader_get_texture_binding(shgroup->shader, name); + int location = GPU_shader_get_sampler_binding(shgroup->shader, name); if (location == -1) { return; } @@ -606,7 +606,7 @@ void DRW_shgroup_buffer_texture_ref(DRWShadingGroup *shgroup, const char *name, GPUVertBuf **vertex_buffer) { - int location = GPU_shader_get_texture_binding(shgroup->shader, name); + int location = GPU_shader_get_sampler_binding(shgroup->shader, name); if (location == -1) { return; } @@ -698,7 +698,7 @@ static void drw_call_obinfos_init(DRWObjectInfos *ob_infos, Object *ob) drw_call_calc_orco(ob, ob_infos->orcotexfac); /* Random float value. */ uint random = (DST.dupli_source) ? - DST.dupli_source->random_id : + DST.dupli_source->random_id : /* TODO(fclem): this is rather costly to do at runtime. Maybe we can * put it in ob->runtime and make depsgraph ensure it is up to date. */ BLI_hash_int_2d(BLI_hash_string(ob->id.name + 2), 0); @@ -1850,15 +1850,14 @@ void DRW_shgroup_add_material_resources(DRWShadingGroup *grp, GPUMaterial *mater const GPUUniformAttrList *uattrs = GPU_material_uniform_attributes(material); if (uattrs != nullptr) { - int loc = GPU_shader_get_uniform_block_binding(grp->shader, GPU_ATTRIBUTE_UBO_BLOCK_NAME); + int loc = GPU_shader_get_ubo_binding(grp->shader, GPU_ATTRIBUTE_UBO_BLOCK_NAME); drw_shgroup_uniform_create_ex( grp, loc, DRW_UNIFORM_BLOCK_OBATTRS, uattrs, GPU_SAMPLER_DEFAULT, 0, 1); grp->uniform_attrs = uattrs; } if (GPU_material_layer_attributes(material) != nullptr) { - int loc = GPU_shader_get_uniform_block_binding(grp->shader, - GPU_LAYER_ATTRIBUTE_UBO_BLOCK_NAME); + int loc = GPU_shader_get_ubo_binding(grp->shader, GPU_LAYER_ATTRIBUTE_UBO_BLOCK_NAME); drw_shgroup_uniform_create_ex( grp, loc, DRW_UNIFORM_BLOCK_VLATTRS, nullptr, GPU_SAMPLER_DEFAULT, 0, 1); } diff --git a/source/blender/draw/intern/draw_pass.hh b/source/blender/draw/intern/draw_pass.hh index 8fc8298491e..d05564c415a 100644 --- a/source/blender/draw/intern/draw_pass.hh +++ b/source/blender/draw/intern/draw_pass.hh @@ -861,42 +861,42 @@ template inline int PassBase::push_constant_offset(const char *name) template inline void PassBase::bind_ssbo(const char *name, GPUStorageBuf *buffer) { - this->bind_ssbo(GPU_shader_get_ssbo(shader_, name), buffer); + this->bind_ssbo(GPU_shader_get_ssbo_binding(shader_, name), buffer); } template inline void PassBase::bind_ssbo(const char *name, GPUUniformBuf *buffer) { - this->bind_ssbo(GPU_shader_get_ssbo(shader_, name), buffer); + this->bind_ssbo(GPU_shader_get_ssbo_binding(shader_, name), buffer); } template inline void PassBase::bind_ssbo(const char *name, GPUUniformBuf **buffer) { - this->bind_ssbo(GPU_shader_get_ssbo(shader_, name), buffer); + this->bind_ssbo(GPU_shader_get_ssbo_binding(shader_, name), buffer); } template inline void PassBase::bind_ssbo(const char *name, GPUVertBuf *buffer) { - this->bind_ssbo(GPU_shader_get_ssbo(shader_, name), buffer); + this->bind_ssbo(GPU_shader_get_ssbo_binding(shader_, name), buffer); } template inline void PassBase::bind_ssbo(const char *name, GPUVertBuf **buffer) { - this->bind_ssbo(GPU_shader_get_ssbo(shader_, name), buffer); + this->bind_ssbo(GPU_shader_get_ssbo_binding(shader_, name), buffer); } template inline void PassBase::bind_ssbo(const char *name, GPUIndexBuf *buffer) { - this->bind_ssbo(GPU_shader_get_ssbo(shader_, name), buffer); + this->bind_ssbo(GPU_shader_get_ssbo_binding(shader_, name), buffer); } template inline void PassBase::bind_ssbo(const char *name, GPUIndexBuf **buffer) { - this->bind_ssbo(GPU_shader_get_ssbo(shader_, name), buffer); + this->bind_ssbo(GPU_shader_get_ssbo_binding(shader_, name), buffer); } template inline void PassBase::bind_ubo(const char *name, GPUUniformBuf *buffer) { - this->bind_ubo(GPU_shader_get_uniform_block_binding(shader_, name), buffer); + this->bind_ubo(GPU_shader_get_ubo_binding(shader_, name), buffer); } template @@ -904,22 +904,22 @@ inline void PassBase::bind_texture(const char *name, GPUTexture *texture, eGPUSamplerState state) { - this->bind_texture(GPU_shader_get_texture_binding(shader_, name), texture, state); + this->bind_texture(GPU_shader_get_sampler_binding(shader_, name), texture, state); } template inline void PassBase::bind_texture(const char *name, GPUVertBuf *buffer) { - this->bind_texture(GPU_shader_get_texture_binding(shader_, name), buffer); + this->bind_texture(GPU_shader_get_sampler_binding(shader_, name), buffer); } template inline void PassBase::bind_texture(const char *name, GPUVertBuf **buffer) { - this->bind_texture(GPU_shader_get_texture_binding(shader_, name), buffer); + this->bind_texture(GPU_shader_get_sampler_binding(shader_, name), buffer); } template inline void PassBase::bind_image(const char *name, GPUTexture *image) { - this->bind_image(GPU_shader_get_texture_binding(shader_, name), image); + this->bind_image(GPU_shader_get_sampler_binding(shader_, name), image); } template inline void PassBase::bind_ssbo(int slot, GPUStorageBuf *buffer) @@ -991,12 +991,12 @@ template inline void PassBase::bind_image(int slot, GPUTexture *imag template inline void PassBase::bind_ssbo(const char *name, GPUStorageBuf **buffer) { - this->bind_ssbo(GPU_shader_get_ssbo(shader_, name), buffer); + this->bind_ssbo(GPU_shader_get_ssbo_binding(shader_, name), buffer); } template inline void PassBase::bind_ubo(const char *name, GPUUniformBuf **buffer) { - this->bind_ubo(GPU_shader_get_uniform_block_binding(shader_, name), buffer); + this->bind_ubo(GPU_shader_get_ubo_binding(shader_, name), buffer); } template @@ -1004,12 +1004,12 @@ inline void PassBase::bind_texture(const char *name, GPUTexture **texture, eGPUSamplerState state) { - this->bind_texture(GPU_shader_get_texture_binding(shader_, name), texture, state); + this->bind_texture(GPU_shader_get_sampler_binding(shader_, name), texture, state); } template inline void PassBase::bind_image(const char *name, GPUTexture **image) { - this->bind_image(GPU_shader_get_texture_binding(shader_, name), image); + this->bind_image(GPU_shader_get_sampler_binding(shader_, name), image); } template inline void PassBase::bind_ssbo(int slot, GPUStorageBuf **buffer) diff --git a/source/blender/draw/intern/draw_view.cc b/source/blender/draw/intern/draw_view.cc index 670b0c5ecf5..46fd82a239e 100644 --- a/source/blender/draw/intern/draw_view.cc +++ b/source/blender/draw/intern/draw_view.cc @@ -244,7 +244,7 @@ void View::compute_procedural_bounds() GPUShader *shader = DRW_shader_draw_view_finalize_get(); GPU_shader_bind(shader); - GPU_uniformbuf_bind_as_ssbo(culling_, GPU_shader_get_ssbo(shader, "view_culling_buf")); + GPU_uniformbuf_bind_as_ssbo(culling_, GPU_shader_get_ssbo_binding(shader, "view_culling_buf")); GPU_uniformbuf_bind(data_, DRW_VIEW_UBO_SLOT); GPU_compute_dispatch(shader, 1, 1, 1); GPU_memory_barrier(GPU_BARRIER_UNIFORM); @@ -289,8 +289,8 @@ void View::compute_visibility(ObjectBoundsBuf &bounds, uint resource_len, bool d GPU_shader_uniform_1i(shader, "resource_len", resource_len); GPU_shader_uniform_1i(shader, "view_len", view_len_); GPU_shader_uniform_1i(shader, "visibility_word_per_draw", word_per_draw); - GPU_storagebuf_bind(bounds, GPU_shader_get_ssbo(shader, "bounds_buf")); - GPU_storagebuf_bind(visibility_buf_, GPU_shader_get_ssbo(shader, "visibility_buf")); + GPU_storagebuf_bind(bounds, GPU_shader_get_ssbo_binding(shader, "bounds_buf")); + GPU_storagebuf_bind(visibility_buf_, GPU_shader_get_ssbo_binding(shader, "visibility_buf")); GPU_uniformbuf_bind(frozen_ ? data_freeze_ : data_, DRW_VIEW_UBO_SLOT); GPU_uniformbuf_bind(frozen_ ? culling_freeze_ : culling_, DRW_VIEW_CULLING_UBO_SLOT); GPU_compute_dispatch(shader, divide_ceil_u(resource_len, DRW_VISIBILITY_GROUP_SIZE), 1, 1); diff --git a/source/blender/editors/interface/interface_icons.cc b/source/blender/editors/interface/interface_icons.cc index 7959339980a..634f45283f6 100644 --- a/source/blender/editors/interface/interface_icons.cc +++ b/source/blender/editors/interface/interface_icons.cc @@ -1620,12 +1620,12 @@ static void icon_draw_cache_texture_flush_ex(GPUTexture *texture, GPUShader *shader = GPU_shader_get_builtin_shader(GPU_SHADER_2D_IMAGE_MULTI_RECT_COLOR); GPU_shader_bind(shader); - const int data_binding = GPU_shader_get_uniform_block_binding(shader, "multi_rect_data"); + const int data_binding = GPU_shader_get_ubo_binding(shader, "multi_rect_data"); GPUUniformBuf *ubo = GPU_uniformbuf_create_ex( sizeof(MultiRectCallData), texture_draw_calls->drawcall_cache, __func__); GPU_uniformbuf_bind(ubo, data_binding); - const int img_binding = GPU_shader_get_texture_binding(shader, "image"); + const int img_binding = GPU_shader_get_sampler_binding(shader, "image"); GPU_texture_bind_ex(texture, GPU_SAMPLER_ICON, img_binding, false); GPUBatch *quad = GPU_batch_preset_quad(); @@ -1797,7 +1797,7 @@ static void icon_draw_texture(float x, GPUShader *shader = GPU_shader_get_builtin_shader(GPU_SHADER_ICON); GPU_shader_bind(shader); - const int img_binding = GPU_shader_get_texture_binding(shader, "image"); + const int img_binding = GPU_shader_get_sampler_binding(shader, "image"); const int color_loc = GPU_shader_get_builtin_uniform(shader, GPU_UNIFORM_COLOR); const int rect_tex_loc = GPU_shader_get_uniform(shader, "rect_icon"); const int rect_geom_loc = GPU_shader_get_uniform(shader, "rect_geom"); diff --git a/source/blender/gpu/GPU_batch.h b/source/blender/gpu/GPU_batch.h index 1e5adab15d4..35d2d3f6e1a 100644 --- a/source/blender/gpu/GPU_batch.h +++ b/source/blender/gpu/GPU_batch.h @@ -263,9 +263,9 @@ void GPU_batch_program_set_imm_shader(GPUBatch *batch); #define GPU_batch_uniform_mat4(batch, name, val) \ GPU_shader_uniform_mat4((batch)->shader, name, val); #define GPU_batch_uniformbuf_bind(batch, name, ubo) \ - GPU_uniformbuf_bind(ubo, GPU_shader_get_uniform_block_binding((batch)->shader, name)); + GPU_uniformbuf_bind(ubo, GPU_shader_get_ubo_binding((batch)->shader, name)); #define GPU_batch_texture_bind(batch, name, tex) \ - GPU_texture_bind(tex, GPU_shader_get_texture_binding((batch)->shader, name)); + GPU_texture_bind(tex, GPU_shader_get_sampler_binding((batch)->shader, name)); /** \} */ diff --git a/source/blender/gpu/GPU_shader.h b/source/blender/gpu/GPU_shader.h index d1824de62ed..bbb74f1970e 100644 --- a/source/blender/gpu/GPU_shader.h +++ b/source/blender/gpu/GPU_shader.h @@ -112,12 +112,11 @@ const char *GPU_shader_get_name(GPUShader *shader); /** * Returns binding point location. - * Binding location are given to be set at compile time and immutable. + * Binding location are given to be set at shader compile time and immutable. */ -/* TODO(fclem): Make naming consistent. ubo_binding, ssbo_binding */ -int GPU_shader_get_uniform_block_binding(GPUShader *shader, const char *name); -int GPU_shader_get_texture_binding(GPUShader *shader, const char *name); -int GPU_shader_get_ssbo(GPUShader *shader, const char *name); +int GPU_shader_get_ubo_binding(GPUShader *shader, const char *name); +int GPU_shader_get_ssbo_binding(GPUShader *shader, const char *name); +int GPU_shader_get_sampler_binding(GPUShader *shader, const char *name); /** * Returns uniform location. diff --git a/source/blender/gpu/intern/gpu_immediate.cc b/source/blender/gpu/intern/gpu_immediate.cc index a983d1da6ca..ada34fdaeee 100644 --- a/source/blender/gpu/intern/gpu_immediate.cc +++ b/source/blender/gpu/intern/gpu_immediate.cc @@ -602,19 +602,19 @@ void immUniform1i(const char *name, int x) void immBindTexture(const char *name, GPUTexture *tex) { - int binding = GPU_shader_get_texture_binding(imm->shader, name); + int binding = GPU_shader_get_sampler_binding(imm->shader, name); GPU_texture_bind(tex, binding); } void immBindTextureSampler(const char *name, GPUTexture *tex, eGPUSamplerState state) { - int binding = GPU_shader_get_texture_binding(imm->shader, name); + int binding = GPU_shader_get_sampler_binding(imm->shader, name); GPU_texture_bind_ex(tex, state, binding, true); } void immBindUniformBuf(const char *name, GPUUniformBuf *ubo) { - int binding = GPU_shader_get_uniform_block_binding(imm->shader, name); + int binding = GPU_shader_get_ubo_binding(imm->shader, name); GPU_uniformbuf_bind(ubo, binding); } diff --git a/source/blender/gpu/intern/gpu_shader.cc b/source/blender/gpu/intern/gpu_shader.cc index b073f993919..8d845b36d5b 100644 --- a/source/blender/gpu/intern/gpu_shader.cc +++ b/source/blender/gpu/intern/gpu_shader.cc @@ -549,7 +549,7 @@ int GPU_shader_get_builtin_ssbo(GPUShader *shader, int builtin) return interface->ssbo_builtin((GPUStorageBufferBuiltin)builtin); } -int GPU_shader_get_ssbo(GPUShader *shader, const char *name) +int GPU_shader_get_ssbo_binding(GPUShader *shader, const char *name) { const ShaderInterface *interface = unwrap(shader)->interface; const ShaderInput *ssbo = interface->ssbo_get(name); @@ -563,14 +563,14 @@ int GPU_shader_get_uniform_block(GPUShader *shader, const char *name) return ubo ? ubo->location : -1; } -int GPU_shader_get_uniform_block_binding(GPUShader *shader, const char *name) +int GPU_shader_get_ubo_binding(GPUShader *shader, const char *name) { const ShaderInterface *interface = unwrap(shader)->interface; const ShaderInput *ubo = interface->ubo_get(name); return ubo ? ubo->binding : -1; } -int GPU_shader_get_texture_binding(GPUShader *shader, const char *name) +int GPU_shader_get_sampler_binding(GPUShader *shader, const char *name) { const ShaderInterface *interface = unwrap(shader)->interface; const ShaderInput *tex = interface->uniform_get(name); diff --git a/source/blender/gpu/tests/gpu_shader_test.cc b/source/blender/gpu/tests/gpu_shader_test.cc index c07fda843c7..ce1397f3327 100644 --- a/source/blender/gpu/tests/gpu_shader_test.cc +++ b/source/blender/gpu/tests/gpu_shader_test.cc @@ -47,7 +47,7 @@ static void test_gpu_shader_compute_2d() EXPECT_NE(texture, nullptr); GPU_shader_bind(shader); - GPU_texture_image_bind(texture, GPU_shader_get_texture_binding(shader, "img_output")); + GPU_texture_image_bind(texture, GPU_shader_get_sampler_binding(shader, "img_output")); /* Dispatch compute task. */ GPU_compute_dispatch(shader, SIZE, SIZE, 1); @@ -93,7 +93,7 @@ static void test_gpu_shader_compute_1d() EXPECT_NE(texture, nullptr); GPU_shader_bind(shader); - GPU_texture_image_bind(texture, GPU_shader_get_texture_binding(shader, "img_output")); + GPU_texture_image_bind(texture, GPU_shader_get_sampler_binding(shader, "img_output")); /* Dispatch compute task. */ GPU_compute_dispatch(shader, SIZE, 1, 1); @@ -142,7 +142,7 @@ static void test_gpu_shader_compute_vbo() GPU_vertformat_attr_add(&format, "pos", GPU_COMP_F32, 4, GPU_FETCH_FLOAT); GPUVertBuf *vbo = GPU_vertbuf_create_with_format_ex(&format, GPU_USAGE_DEVICE_ONLY); GPU_vertbuf_data_alloc(vbo, SIZE); - GPU_vertbuf_bind_as_ssbo(vbo, GPU_shader_get_ssbo(shader, "out_positions")); + GPU_vertbuf_bind_as_ssbo(vbo, GPU_shader_get_ssbo_binding(shader, "out_positions")); /* Dispatch compute task. */ GPU_compute_dispatch(shader, SIZE, 1, 1); @@ -186,7 +186,7 @@ static void test_gpu_shader_compute_ibo() /* Construct IBO. */ GPUIndexBuf *ibo = GPU_indexbuf_build_on_device(SIZE); - GPU_indexbuf_bind_as_ssbo(ibo, GPU_shader_get_ssbo(shader, "out_indices")); + GPU_indexbuf_bind_as_ssbo(ibo, GPU_shader_get_ssbo_binding(shader, "out_indices")); /* Dispatch compute task. */ GPU_compute_dispatch(shader, SIZE, 1, 1); @@ -228,7 +228,7 @@ static void test_gpu_shader_compute_ssbo() /* Construct IBO. */ GPUStorageBuf *ssbo = GPU_storagebuf_create_ex( SIZE * sizeof(uint32_t), nullptr, GPU_USAGE_DEVICE_ONLY, __func__); - GPU_storagebuf_bind(ssbo, GPU_shader_get_ssbo(shader, "out_indices")); + GPU_storagebuf_bind(ssbo, GPU_shader_get_ssbo_binding(shader, "out_indices")); /* Dispatch compute task. */ GPU_compute_dispatch(shader, SIZE, 1, 1); @@ -264,8 +264,8 @@ static void test_gpu_shader_ssbo_binding() EXPECT_NE(shader, nullptr); GPU_shader_bind(shader); - EXPECT_EQ(0, GPU_shader_get_ssbo(shader, "data0")); - EXPECT_EQ(1, GPU_shader_get_ssbo(shader, "data1")); + EXPECT_EQ(0, GPU_shader_get_ssbo_binding(shader, "data0")); + EXPECT_EQ(1, GPU_shader_get_ssbo_binding(shader, "data1")); /* Cleanup. */ GPU_shader_unbind(); diff --git a/source/blender/nodes/composite/nodes/node_composite_composite.cc b/source/blender/nodes/composite/nodes/node_composite_composite.cc index 70e4c2b5d3b..dafa87f93f0 100644 --- a/source/blender/nodes/composite/nodes/node_composite_composite.cc +++ b/source/blender/nodes/composite/nodes/node_composite_composite.cc @@ -94,7 +94,7 @@ class CompositeOperation : public NodeOperation { image.bind_as_texture(shader, "input_tx"); GPUTexture *output_texture = context().get_output_texture(); - const int image_unit = GPU_shader_get_texture_binding(shader, "output_img"); + const int image_unit = GPU_shader_get_sampler_binding(shader, "output_img"); GPU_texture_image_bind(output_texture, image_unit); const int2 compositing_region_size = context().get_compositing_region_size(); @@ -122,7 +122,7 @@ class CompositeOperation : public NodeOperation { image.bind_as_texture(shader, "input_tx"); GPUTexture *output_texture = context().get_output_texture(); - const int image_unit = GPU_shader_get_texture_binding(shader, "output_img"); + const int image_unit = GPU_shader_get_sampler_binding(shader, "output_img"); GPU_texture_image_bind(output_texture, image_unit); const int2 compositing_region_size = context().get_compositing_region_size(); @@ -152,7 +152,7 @@ class CompositeOperation : public NodeOperation { alpha.bind_as_texture(shader, "alpha_tx"); GPUTexture *output_texture = context().get_output_texture(); - const int image_unit = GPU_shader_get_texture_binding(shader, "output_img"); + const int image_unit = GPU_shader_get_sampler_binding(shader, "output_img"); GPU_texture_image_bind(output_texture, image_unit); const int2 compositing_region_size = context().get_compositing_region_size(); diff --git a/source/blender/nodes/composite/nodes/node_composite_dilate.cc b/source/blender/nodes/composite/nodes/node_composite_dilate.cc index 07063c1a06b..b34a7bd6646 100644 --- a/source/blender/nodes/composite/nodes/node_composite_dilate.cc +++ b/source/blender/nodes/composite/nodes/node_composite_dilate.cc @@ -122,7 +122,7 @@ class DilateErodeOperation : public NodeOperation { const int2 transposed_domain = int2(domain.size.y, domain.size.x); GPUTexture *horizontal_pass_result = texture_pool().acquire_color(transposed_domain); - const int image_unit = GPU_shader_get_texture_binding(shader, "output_img"); + const int image_unit = GPU_shader_get_sampler_binding(shader, "output_img"); GPU_texture_image_bind(horizontal_pass_result, image_unit); compute_dispatch_threads_at_least(shader, domain.size); @@ -143,7 +143,7 @@ class DilateErodeOperation : public NodeOperation { GPU_shader_uniform_1i(shader, "radius", math::abs(get_distance())); GPU_memory_barrier(GPU_BARRIER_TEXTURE_FETCH); - const int texture_image_unit = GPU_shader_get_texture_binding(shader, "input_tx"); + const int texture_image_unit = GPU_shader_get_sampler_binding(shader, "input_tx"); GPU_texture_bind(horizontal_pass_result, texture_image_unit); const Domain domain = compute_domain(); @@ -273,7 +273,7 @@ class DilateErodeOperation : public NodeOperation { const int2 transposed_domain = int2(domain.size.y, domain.size.x); GPUTexture *horizontal_pass_result = texture_pool().acquire_color(transposed_domain); - const int image_unit = GPU_shader_get_texture_binding(shader, "output_img"); + const int image_unit = GPU_shader_get_sampler_binding(shader, "output_img"); GPU_texture_image_bind(horizontal_pass_result, image_unit); compute_dispatch_threads_at_least(shader, domain.size); @@ -293,7 +293,7 @@ class DilateErodeOperation : public NodeOperation { GPU_shader_bind(shader); GPU_memory_barrier(GPU_BARRIER_TEXTURE_FETCH); - const int texture_image_unit = GPU_shader_get_texture_binding(shader, "input_tx"); + const int texture_image_unit = GPU_shader_get_sampler_binding(shader, "input_tx"); GPU_texture_bind(horizontal_pass_result, texture_image_unit); const MorphologicalDistanceFeatherWeights &weights = diff --git a/source/blender/nodes/composite/nodes/node_composite_image.cc b/source/blender/nodes/composite/nodes/node_composite_image.cc index ad49d687220..27b864f9856 100644 --- a/source/blender/nodes/composite/nodes/node_composite_image.cc +++ b/source/blender/nodes/composite/nodes/node_composite_image.cc @@ -525,7 +525,7 @@ class ImageOperation : public NodeOperation { GPUShader *shader = shader_manager().get(get_shader_name(identifier)); GPU_shader_bind(shader); - const int input_unit = GPU_shader_get_texture_binding(shader, "input_tx"); + const int input_unit = GPU_shader_get_sampler_binding(shader, "input_tx"); GPU_texture_bind(image_texture, input_unit); result.bind_as_image(shader, "output_img"); @@ -859,7 +859,7 @@ class RenderLayerOperation : public NodeOperation { const int2 lower_bound = int2(compositing_region.xmin, compositing_region.ymin); GPU_shader_uniform_2iv(shader, "compositing_region_lower_bound", lower_bound); - const int input_unit = GPU_shader_get_texture_binding(shader, "input_tx"); + const int input_unit = GPU_shader_get_sampler_binding(shader, "input_tx"); GPU_texture_bind(pass_texture, input_unit); const int2 compositing_region_size = context().get_compositing_region_size(); @@ -889,7 +889,7 @@ class RenderLayerOperation : public NodeOperation { const int2 lower_bound = int2(compositing_region.xmin, compositing_region.ymin); GPU_shader_uniform_2iv(shader, "compositing_region_lower_bound", lower_bound); - const int input_unit = GPU_shader_get_texture_binding(shader, "input_tx"); + const int input_unit = GPU_shader_get_sampler_binding(shader, "input_tx"); GPU_texture_bind(pass_texture, input_unit); const int2 compositing_region_size = context().get_compositing_region_size(); diff --git a/source/blender/nodes/composite/nodes/node_composite_movieclip.cc b/source/blender/nodes/composite/nodes/node_composite_movieclip.cc index c55df061873..a3fa99d8356 100644 --- a/source/blender/nodes/composite/nodes/node_composite_movieclip.cc +++ b/source/blender/nodes/composite/nodes/node_composite_movieclip.cc @@ -128,7 +128,7 @@ class MovieClipOperation : public NodeOperation { GPUShader *shader = shader_manager().get("compositor_convert_color_to_half_color"); GPU_shader_bind(shader); - const int input_unit = GPU_shader_get_texture_binding(shader, "input_tx"); + const int input_unit = GPU_shader_get_sampler_binding(shader, "input_tx"); GPU_texture_bind(movie_clip_texture, input_unit); result.bind_as_image(shader, "output_img"); @@ -162,7 +162,7 @@ class MovieClipOperation : public NodeOperation { GPUShader *shader = shader_manager().get("compositor_extract_alpha_from_color"); GPU_shader_bind(shader); - const int input_unit = GPU_shader_get_texture_binding(shader, "input_tx"); + const int input_unit = GPU_shader_get_sampler_binding(shader, "input_tx"); GPU_texture_bind(movie_clip_texture, input_unit); result.bind_as_image(shader, "output_img"); diff --git a/source/blender/nodes/composite/nodes/node_composite_split_viewer.cc b/source/blender/nodes/composite/nodes/node_composite_split_viewer.cc index 73dcf42904c..c03a3a42dc9 100644 --- a/source/blender/nodes/composite/nodes/node_composite_split_viewer.cc +++ b/source/blender/nodes/composite/nodes/node_composite_split_viewer.cc @@ -77,7 +77,7 @@ class ViewerOperation : public NodeOperation { second_image.bind_as_texture(shader, "second_image_tx"); GPUTexture *output_texture = context().get_output_texture(); - const int image_unit = GPU_shader_get_texture_binding(shader, "output_img"); + const int image_unit = GPU_shader_get_sampler_binding(shader, "output_img"); GPU_texture_image_bind(output_texture, image_unit); compute_dispatch_threads_at_least(shader, compositing_region_size); diff --git a/source/blender/nodes/composite/nodes/node_composite_viewer.cc b/source/blender/nodes/composite/nodes/node_composite_viewer.cc index 66a16905d67..0beee8621ac 100644 --- a/source/blender/nodes/composite/nodes/node_composite_viewer.cc +++ b/source/blender/nodes/composite/nodes/node_composite_viewer.cc @@ -123,7 +123,7 @@ class ViewerOperation : public NodeOperation { image.bind_as_texture(shader, "input_tx"); GPUTexture *output_texture = context().get_output_texture(); - const int image_unit = GPU_shader_get_texture_binding(shader, "output_img"); + const int image_unit = GPU_shader_get_sampler_binding(shader, "output_img"); GPU_texture_image_bind(output_texture, image_unit); const int2 compositing_region_size = context().get_compositing_region_size(); @@ -151,7 +151,7 @@ class ViewerOperation : public NodeOperation { image.bind_as_texture(shader, "input_tx"); GPUTexture *output_texture = context().get_output_texture(); - const int image_unit = GPU_shader_get_texture_binding(shader, "output_img"); + const int image_unit = GPU_shader_get_sampler_binding(shader, "output_img"); GPU_texture_image_bind(output_texture, image_unit); const int2 compositing_region_size = context().get_compositing_region_size(); @@ -181,7 +181,7 @@ class ViewerOperation : public NodeOperation { alpha.bind_as_texture(shader, "alpha_tx"); GPUTexture *output_texture = context().get_output_texture(); - const int image_unit = GPU_shader_get_texture_binding(shader, "output_img"); + const int image_unit = GPU_shader_get_sampler_binding(shader, "output_img"); GPU_texture_image_bind(output_texture, image_unit); const int2 compositing_region_size = context().get_compositing_region_size(); diff --git a/source/blender/python/gpu/gpu_py_shader.c b/source/blender/python/gpu/gpu_py_shader.c index 9352e7cc9b1..2c13e271e36 100644 --- a/source/blender/python/gpu/gpu_py_shader.c +++ b/source/blender/python/gpu/gpu_py_shader.c @@ -533,7 +533,7 @@ static PyObject *pygpu_shader_uniform_sampler(BPyGPUShader *self, PyObject *args } GPU_shader_bind(self->shader); - int slot = GPU_shader_get_texture_binding(self->shader, name); + int slot = GPU_shader_get_sampler_binding(self->shader, name); GPU_texture_bind(py_texture->tex, slot); GPU_shader_uniform_1i(self->shader, name, slot); @@ -559,7 +559,7 @@ static PyObject *pygpu_shader_uniform_block(BPyGPUShader *self, PyObject *args) return NULL; } - int binding = GPU_shader_get_uniform_block_binding(self->shader, name); + int binding = GPU_shader_get_ubo_binding(self->shader, name); if (binding == -1) { PyErr_SetString( PyExc_BufferError, diff --git a/source/blender/windowmanager/intern/wm_draw.c b/source/blender/windowmanager/intern/wm_draw.c index 290fd602dfa..5ce080e575a 100644 --- a/source/blender/windowmanager/intern/wm_draw.c +++ b/source/blender/windowmanager/intern/wm_draw.c @@ -842,7 +842,7 @@ void wm_draw_region_blend(ARegion *region, int view, bool blend) int color_loc = GPU_shader_get_builtin_uniform(shader, GPU_UNIFORM_COLOR); int rect_tex_loc = GPU_shader_get_uniform(shader, "rect_icon"); int rect_geo_loc = GPU_shader_get_uniform(shader, "rect_geom"); - int texture_bind_loc = GPU_shader_get_texture_binding(shader, "image"); + int texture_bind_loc = GPU_shader_get_sampler_binding(shader, "image"); GPU_texture_bind(texture, texture_bind_loc);