diff options
author | Campbell Barton <ideasman42@gmail.com> | 2020-09-02 03:04:50 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2020-09-02 03:04:50 +0300 |
commit | 957346694d49736408abea13cf9b33fa531b1ea2 (patch) | |
tree | 5da23cf433f3c28426856b76a0a6679e2fcc3f4d /source/blender/gpu/intern | |
parent | 71aa3c864d20fb577c7c2aa94e756fcd88aaa795 (diff) |
Cleanup: spelling, rename attachement -> attachment
Diffstat (limited to 'source/blender/gpu/intern')
-rw-r--r-- | source/blender/gpu/intern/gpu_framebuffer.cc | 44 | ||||
-rw-r--r-- | source/blender/gpu/intern/gpu_framebuffer_private.hh | 6 | ||||
-rw-r--r-- | source/blender/gpu/intern/gpu_texture.cc | 2 |
3 files changed, 26 insertions, 26 deletions
diff --git a/source/blender/gpu/intern/gpu_framebuffer.cc b/source/blender/gpu/intern/gpu_framebuffer.cc index 766b3348451..6af34a60ffb 100644 --- a/source/blender/gpu/intern/gpu_framebuffer.cc +++ b/source/blender/gpu/intern/gpu_framebuffer.cc @@ -86,7 +86,7 @@ void FrameBuffer::attachment_set(GPUAttachmentType type, const GPUAttachment &ne return; /* GPU_ATTACHMENT_LEAVE */ } - if (type >= GPU_FB_MAX_ATTACHEMENT) { + if (type >= GPU_FB_MAX_ATTACHMENT) { fprintf(stderr, "GPUFramebuffer: Error: Trying to attach texture to type %d but maximum slot is %d.\n", type - GPU_FB_COLOR_ATTACHMENT0, @@ -290,38 +290,38 @@ bool GPU_framebuffer_check_valid(GPUFrameBuffer *gpu_fb, char err_out[256]) return reinterpret_cast<FrameBuffer *>(gpu_fb)->check(err_out); } -void GPU_framebuffer_texture_attach_ex(GPUFrameBuffer *gpu_fb, GPUAttachment attachement, int slot) +void GPU_framebuffer_texture_attach_ex(GPUFrameBuffer *gpu_fb, GPUAttachment attachment, int slot) { - GPUAttachmentType type = blender::gpu::Texture::attachment_type(attachement.tex, slot); - reinterpret_cast<FrameBuffer *>(gpu_fb)->attachment_set(type, attachement); + GPUAttachmentType type = blender::gpu::Texture::attachment_type(attachment.tex, slot); + reinterpret_cast<FrameBuffer *>(gpu_fb)->attachment_set(type, attachment); } 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); + GPUAttachment attachment = GPU_ATTACHMENT_TEXTURE_MIP(tex, mip); + GPU_framebuffer_texture_attach_ex(fb, attachment, 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); + GPUAttachment attachment = GPU_ATTACHMENT_TEXTURE_LAYER_MIP(tex, layer, mip); + GPU_framebuffer_texture_attach_ex(fb, attachment, 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); + GPUAttachment attachment = GPU_ATTACHMENT_TEXTURE_CUBEFACE_MIP(tex, face, mip); + GPU_framebuffer_texture_attach_ex(fb, attachment, slot); } void GPU_framebuffer_texture_detach(GPUFrameBuffer *gpu_fb, GPUTexture *tex) { - GPUAttachment attachement = GPU_ATTACHMENT_NONE; - int type = GPU_texture_framebuffer_attachement_get(tex, gpu_fb); + GPUAttachment attachment = GPU_ATTACHMENT_NONE; + int type = GPU_texture_framebuffer_attachment_get(tex, gpu_fb); if (type != -1) { - reinterpret_cast<FrameBuffer *>(gpu_fb)->attachment_set((GPUAttachmentType)type, attachement); + reinterpret_cast<FrameBuffer *>(gpu_fb)->attachment_set((GPUAttachmentType)type, attachment); } else { BLI_assert(!"Error: Texture: Framebuffer is not attached"); @@ -340,27 +340,27 @@ void GPU_framebuffer_config_array(GPUFrameBuffer *gpu_fb, { FrameBuffer *fb = reinterpret_cast<FrameBuffer *>(gpu_fb); - const GPUAttachment &depth_attachement = config[0]; + const GPUAttachment &depth_attachment = config[0]; Span<GPUAttachment> color_attachments(config + 1, config_len - 1); - if (depth_attachement.mip == -1) { + if (depth_attachment.mip == -1) { /* GPU_ATTACHMENT_LEAVE */ } - else if (depth_attachement.tex == NULL) { + else if (depth_attachment.tex == NULL) { /* GPU_ATTACHMENT_NONE: Need to clear both targets. */ - fb->attachment_set(GPU_FB_DEPTH_STENCIL_ATTACHMENT, depth_attachement); - fb->attachment_set(GPU_FB_DEPTH_ATTACHMENT, depth_attachement); + fb->attachment_set(GPU_FB_DEPTH_STENCIL_ATTACHMENT, depth_attachment); + fb->attachment_set(GPU_FB_DEPTH_ATTACHMENT, depth_attachment); } else { - GPUAttachmentType type = GPU_texture_stencil(depth_attachement.tex) ? + GPUAttachmentType type = GPU_texture_stencil(depth_attachment.tex) ? GPU_FB_DEPTH_STENCIL_ATTACHMENT : GPU_FB_DEPTH_ATTACHMENT; - fb->attachment_set(type, depth_attachement); + fb->attachment_set(type, depth_attachment); } GPUAttachmentType type = GPU_FB_COLOR_ATTACHMENT0; - for (const GPUAttachment &attachement : color_attachments) { - fb->attachment_set(type, attachement); + for (const GPUAttachment &attachment : color_attachments) { + fb->attachment_set(type, attachment); ++type; } } diff --git a/source/blender/gpu/intern/gpu_framebuffer_private.hh b/source/blender/gpu/intern/gpu_framebuffer_private.hh index 1add3cd9b0f..0f442ff2b34 100644 --- a/source/blender/gpu/intern/gpu_framebuffer_private.hh +++ b/source/blender/gpu/intern/gpu_framebuffer_private.hh @@ -52,9 +52,9 @@ typedef enum GPUAttachmentType : int { * We support 6 outputs for now (usually we wouldn't need more to preserve fill rate). */ /* Keep in mind that GL max is GL_MAX_DRAW_BUFFERS and is at least 8, corresponding to * the maximum number of COLOR attachments specified by glDrawBuffers. */ - GPU_FB_MAX_ATTACHEMENT, + GPU_FB_MAX_ATTACHMENT, - GPU_FB_MAX_COLOR_ATTACHMENT = (GPU_FB_MAX_ATTACHEMENT - GPU_FB_COLOR_ATTACHMENT0), + GPU_FB_MAX_COLOR_ATTACHMENT = (GPU_FB_MAX_ATTACHMENT - GPU_FB_COLOR_ATTACHMENT0), } GPUAttachmentType; inline constexpr GPUAttachmentType operator-(GPUAttachmentType a, int b) @@ -91,7 +91,7 @@ namespace gpu { class FrameBuffer { protected: /** Set of texture attachments to render to. DEPTH and DEPTH_STENCIL are mutually exclusive. */ - GPUAttachment attachments_[GPU_FB_MAX_ATTACHEMENT]; + GPUAttachment attachments_[GPU_FB_MAX_ATTACHMENT]; /** Is true if internal representation need to be updated. */ bool dirty_attachments_; /** Size of attachment textures. */ diff --git a/source/blender/gpu/intern/gpu_texture.cc b/source/blender/gpu/intern/gpu_texture.cc index 1b7e1d4fd6a..3dedfcf763a 100644 --- a/source/blender/gpu/intern/gpu_texture.cc +++ b/source/blender/gpu/intern/gpu_texture.cc @@ -2149,7 +2149,7 @@ void GPU_texture_detach_framebuffer(GPUTexture *tex, GPUFrameBuffer *fb) } /* Return attachment type for the given framebuffer or -1 if not attached. */ -int GPU_texture_framebuffer_attachement_get(GPUTexture *tex, GPUFrameBuffer *fb) +int GPU_texture_framebuffer_attachment_get(GPUTexture *tex, GPUFrameBuffer *fb) { for (int i = 0; i < GPU_TEX_MAX_FBO_ATTACHED; i++) { if (tex->fb[i] == fb) { |