[Bf-blender-cvs] [51a4af4eb56] temp-eeveelightcache: GPUTexture: Add GPU_texture_layers

Clément Foucault noreply at git.blender.org
Fri Jun 22 17:46:10 CEST 2018


Commit: 51a4af4eb56a86914dbc9b686d7eb212d434ca35
Author: Clément Foucault
Date:   Mon Jun 18 19:21:29 2018 +0200
Branches: temp-eeveelightcache
https://developer.blender.org/rB51a4af4eb56a86914dbc9b686d7eb212d434ca35

GPUTexture: Add GPU_texture_layers

It's actually used to get the depth size of the texture.
This is because GPU_texture_depth is already taken.

We need to clean up this API at some point.

===================================================================

M	source/blender/gpu/GPU_texture.h
M	source/blender/gpu/intern/gpu_texture.c

===================================================================

diff --git a/source/blender/gpu/GPU_texture.h b/source/blender/gpu/GPU_texture.h
index e53693e7b40..efe720d5d55 100644
--- a/source/blender/gpu/GPU_texture.h
+++ b/source/blender/gpu/GPU_texture.h
@@ -196,6 +196,7 @@ int GPU_texture_detach_framebuffer(GPUTexture *tex, struct GPUFrameBuffer *fb);
 int GPU_texture_target(const GPUTexture *tex);
 int GPU_texture_width(const GPUTexture *tex);
 int GPU_texture_height(const GPUTexture *tex);
+int GPU_texture_layers(const GPUTexture *tex);
 GPUTextureFormat GPU_texture_format(const GPUTexture *tex);
 int GPU_texture_samples(const GPUTexture *tex);
 bool GPU_texture_cube(const GPUTexture *tex);
diff --git a/source/blender/gpu/intern/gpu_texture.c b/source/blender/gpu/intern/gpu_texture.c
index 54a08bb484a..cebfe7920bc 100644
--- a/source/blender/gpu/intern/gpu_texture.c
+++ b/source/blender/gpu/intern/gpu_texture.c
@@ -1146,6 +1146,11 @@ int GPU_texture_height(const GPUTexture *tex)
 	return tex->h;
 }
 
+int GPU_texture_layers(const GPUTexture *tex)
+{
+	return tex->d;
+}
+
 GPUTextureFormat GPU_texture_format(const GPUTexture *tex)
 {
 	return tex->format;



More information about the Bf-blender-cvs mailing list