GPUFrameBuffer: Fix build error on MSVC

This also gets rid of the macro.
This commit is contained in:
Clément Foucault 2020-08-30 19:07:49 +02:00
parent 0299817e0e
commit ade8d84fe3
2 changed files with 25 additions and 9 deletions

View File

@ -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 */

View File

@ -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;