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-08-30 20:07:49 +0300
committerClément Foucault <foucault.clem@gmail.com>2020-08-30 20:07:49 +0300
commitade8d84fe3f744e751e14904df7183343aa4c0ed (patch)
treed580148d8721660cb05e701beb0081669db707b2
parent0299817e0ec5749f557304a49b76a281309464e7 (diff)
GPUFrameBuffer: Fix build error on MSVC
This also gets rid of the macro.
-rw-r--r--source/blender/gpu/GPU_framebuffer.h14
-rw-r--r--source/blender/gpu/intern/gpu_framebuffer.cc20
2 files changed, 25 insertions, 9 deletions
diff --git a/source/blender/gpu/GPU_framebuffer.h b/source/blender/gpu/GPU_framebuffer.h
index a52cdea5167..e6648c69de7 100644
--- a/source/blender/gpu/GPU_framebuffer.h
+++ b/source/blender/gpu/GPU_framebuffer.h
@@ -150,15 +150,11 @@ void GPU_framebuffer_config_array(GPUFrameBuffer *fb, const GPUAttachment *confi
_tex, _face, _mip, \
}
-#define GPU_framebuffer_texture_attach(_fb, _texture, _slot, _mip) \
- GPU_framebuffer_texture_attach_ex( \
- _fb, (GPUAttachment)GPU_ATTACHMENT_TEXTURE_MIP(_texture, _mip), _slot)
-#define GPU_framebuffer_texture_layer_attach(_fb, _texture, _slot, layer, _mip) \
- GPU_framebuffer_texture_attach_ex( \
- _fb, (GPUAttachment)GPU_ATTACHMENT_TEXTURE_LAYER_MIP(_texture, layer, _mip), _slot)
-#define GPU_framebuffer_texture_cubeface_attach(_fb, _texture, _slot, face, _mip) \
- GPU_framebuffer_texture_attach_ex( \
- _fb, (GPUAttachment)GPU_ATTACHMENT_TEXTURE_CUBEFACE_MIP(_texture, face, _mip), _slot)
+void GPU_framebuffer_texture_attach(GPUFrameBuffer *fb, GPUTexture *tex, int slot, int mip);
+void GPU_framebuffer_texture_layer_attach(
+ GPUFrameBuffer *fb, GPUTexture *tex, int slot, int layer, int mip);
+void GPU_framebuffer_texture_cubeface_attach(
+ GPUFrameBuffer *fb, GPUTexture *tex, int slot, int face, int mip);
/* Framebuffer operations */
diff --git a/source/blender/gpu/intern/gpu_framebuffer.cc b/source/blender/gpu/intern/gpu_framebuffer.cc
index 3a125fe92b0..ead72bbd0c5 100644
--- a/source/blender/gpu/intern/gpu_framebuffer.cc
+++ b/source/blender/gpu/intern/gpu_framebuffer.cc
@@ -292,6 +292,26 @@ void GPU_framebuffer_texture_attach_ex(GPUFrameBuffer *gpu_fb, GPUAttachment att
reinterpret_cast<FrameBuffer *>(gpu_fb)->attachment_set(type, attachement);
}
+void GPU_framebuffer_texture_attach(GPUFrameBuffer *fb, GPUTexture *tex, int slot, int mip)
+{
+ GPUAttachment attachement = GPU_ATTACHMENT_TEXTURE_MIP(tex, mip);
+ GPU_framebuffer_texture_attach_ex(fb, attachement, slot);
+}
+
+void GPU_framebuffer_texture_layer_attach(
+ GPUFrameBuffer *fb, GPUTexture *tex, int slot, int layer, int mip)
+{
+ GPUAttachment attachement = GPU_ATTACHMENT_TEXTURE_LAYER_MIP(tex, layer, mip);
+ GPU_framebuffer_texture_attach_ex(fb, attachement, slot);
+}
+
+void GPU_framebuffer_texture_cubeface_attach(
+ GPUFrameBuffer *fb, GPUTexture *tex, int slot, int face, int mip)
+{
+ GPUAttachment attachement = GPU_ATTACHMENT_TEXTURE_CUBEFACE_MIP(tex, face, mip);
+ GPU_framebuffer_texture_attach_ex(fb, attachement, slot);
+}
+
void GPU_framebuffer_texture_detach(GPUFrameBuffer *gpu_fb, GPUTexture *tex)
{
GPUAttachment attachement = GPU_ATTACHMENT_NONE;