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-07-27 14:37:14 +0300
committerClément Foucault <foucault.clem@gmail.com>2020-07-27 14:37:22 +0300
commit0b04f0e4e63ff88e493bedb6bd9ea4fe5b3557ca (patch)
treebe7c2a550cdd64c8d4c27ce030df7d75b13320d0 /source/blender/gpu/GPU_texture.h
parentbfeb94ecccbf9222ef46294db88ca678e3c529fc (diff)
GPU: Fix crash and missing texture due to recent C++ port
Fix T79306 DRW: small issues with yesterday commits modifying TEXTARGET Fix T79303 Image texture node crashes EEVEE when connected to a shader output
Diffstat (limited to 'source/blender/gpu/GPU_texture.h')
-rw-r--r--source/blender/gpu/GPU_texture.h15
1 files changed, 12 insertions, 3 deletions
diff --git a/source/blender/gpu/GPU_texture.h b/source/blender/gpu/GPU_texture.h
index 813ee71eb22..d7f5d6272f4 100644
--- a/source/blender/gpu/GPU_texture.h
+++ b/source/blender/gpu/GPU_texture.h
@@ -41,6 +41,15 @@ struct PreviewImage;
struct GPUFrameBuffer;
typedef struct GPUTexture GPUTexture;
+/* Used to get the correct gpu texture from an Image datablock. */
+typedef enum eGPUTextureTarget {
+ TEXTARGET_2D = 0,
+ TEXTARGET_CUBE_MAP,
+ TEXTARGET_2D_ARRAY,
+ TEXTARGET_TILE_MAPPING,
+ TEXTARGET_COUNT,
+} eGPUTextureTarget;
+
/* GPU Samplers state
* - Specify the sampler state to bind a texture with.
* - Internally used by textures.
@@ -222,16 +231,16 @@ GPUTexture *GPU_texture_create_cube_array(
GPUTexture *GPU_texture_create_from_vertbuf(struct GPUVertBuf *vert);
GPUTexture *GPU_texture_create_buffer(eGPUTextureFormat data_type, const uint buffer);
-GPUTexture *GPU_texture_from_bindcode(int textarget, int bindcode);
+GPUTexture *GPU_texture_from_bindcode(eGPUTextureTarget target, int bindcode);
GPUTexture *GPU_texture_from_blender(struct Image *ima,
struct ImageUser *iuser,
struct ImBuf *ibuf,
- int textarget);
+ eGPUTextureTarget target);
/* movie clip drawing */
GPUTexture *GPU_texture_from_movieclip(struct MovieClip *clip,
struct MovieClipUser *cuser,
- int textarget);
+ eGPUTextureTarget target);
void GPU_free_texture_movieclip(struct MovieClip *clip);
void GPU_texture_add_mipmap(GPUTexture *tex,