From 9904aa3d09458098541fdce0114785d6bce1777f Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Wed, 15 Sep 2021 20:17:38 +0300 Subject: [PATCH] Nudge the FrameFormat floating-point flag one bit to the left This puts it in the same position as the corresponding flag in VertexAttribute. --- source/core/frameformat.cpp | 4 ++-- source/core/frameformat.h | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/source/core/frameformat.cpp b/source/core/frameformat.cpp index 30d7a47f..f023aba7 100644 --- a/source/core/frameformat.cpp +++ b/source/core/frameformat.cpp @@ -89,7 +89,7 @@ FrameAttachment make_typed_attachment(FrameAttachment fa, PixelFormat pf) } DataType type = get_component_type(pf); - return static_cast((fa&0xFC00) | (is_float(type)*0x80) | get_type_size(type)<<4 | get_component_count(comp)); + return static_cast((fa&0xFC00) | (is_float(type)*0x100) | get_type_size(type)<<4 | get_component_count(comp)); } FrameAttachment make_indexed_attachment(FrameAttachment fa, unsigned i) @@ -115,7 +115,7 @@ PixelFormat get_attachment_pixelformat(UInt16 fa) comp = static_cast(fa&7); DataType type; - if(fa&0x80) + if(fa&0x100) type = static_cast((fa&0x70)>>4 | 0x300); else type = static_cast((fa&0x70)>>4); diff --git a/source/core/frameformat.h b/source/core/frameformat.h index 45ea9198..c67586a9 100644 --- a/source/core/frameformat.h +++ b/source/core/frameformat.h @@ -11,10 +11,10 @@ namespace GL { Describes a single attachment of a framebuffer. The values are bitfields laid as follows: -nnnn nn__ fsss _ccc - │ │ │ └╴Number of components - │ │ └─────╴Size of one component - │ └────────╴Floating-point flag +nnnn nn_f _sss _ccc + │ │ │ └╴Number of components + │ │ └─────╴Size of one component + │ └──────────╴Floating-point flag └────────────╴Attachment index This information is presented for internal documentation purposes only; it is @@ -23,7 +23,7 @@ inadvisable for programs to rely on it. enum FrameAttachment { COLOR_ATTACHMENT = 0x0014, - DEPTH_ATTACHMENT = 0xF8C1, + DEPTH_ATTACHMENT = 0xF941, STENCIL_ATTACHMENT = 0xFC11 }; -- 2.43.0