Refactor: GPU: Remove unnecessary C wrappers for textures

This is the first step into merging `DRW_gpu_wrapper.hh` into
the GPU module.

This is very similar to #119825.

Pull Request: https://projects.blender.org/blender/blender/pulls/142732
This commit is contained in:
Clément Foucault
2025-07-22 09:48:10 +02:00
parent 748958f084
commit f0254c2dcf
145 changed files with 1114 additions and 1009 deletions

View File

@@ -35,19 +35,19 @@ namespace blender::compositor {
* to be derived from the compositor_parallel_reduction.glsl shader, see that file for more
* information. Also see the compositor_parallel_reduction_info.hh file for example shader
* definitions. */
static float *parallel_reduction_dispatch(GPUTexture *texture,
static float *parallel_reduction_dispatch(blender::gpu::Texture *texture,
GPUShader *shader,
eGPUTextureFormat format)
{
GPU_shader_uniform_1b(shader, "is_initial_reduction", true);
GPUTexture *texture_to_reduce = texture;
blender::gpu::Texture *texture_to_reduce = texture;
int2 size_to_reduce = int2(GPU_texture_width(texture), GPU_texture_height(texture));
/* Dispatch the reduction shader until the texture reduces to a single pixel. */
while (size_to_reduce != int2(1)) {
const int2 reduced_size = math::divide_ceil(size_to_reduce, int2(16));
GPUTexture *reduced_texture = gpu::TexturePool::get().acquire_texture(
blender::gpu::Texture *reduced_texture = gpu::TexturePool::get().acquire_texture(
reduced_size.x, reduced_size.y, format, GPU_TEXTURE_USAGE_GENERAL);
GPU_memory_barrier(GPU_BARRIER_TEXTURE_FETCH);