]> git.tdb.fi Git - libs/gl.git/commitdiff
Nudge the FrameFormat floating-point flag one bit to the left
authorMikko Rasa <tdb@tdb.fi>
Wed, 15 Sep 2021 17:17:38 +0000 (20:17 +0300)
committerMikko Rasa <tdb@tdb.fi>
Wed, 15 Sep 2021 18:34:11 +0000 (21:34 +0300)
This puts it in the same position as the corresponding flag in
VertexAttribute.

source/core/frameformat.cpp
source/core/frameformat.h

index 30d7a47f36500d43172e8fece217e4ebb608c1ed..f023aba799a59d19cde92ae5e09f7f4fdb9f603d 100644 (file)
@@ -89,7 +89,7 @@ FrameAttachment make_typed_attachment(FrameAttachment fa, PixelFormat pf)
        }
 
        DataType type = get_component_type(pf);
-       return static_cast<FrameAttachment>((fa&0xFC00) | (is_float(type)*0x80) | get_type_size(type)<<4 | get_component_count(comp));
+       return static_cast<FrameAttachment>((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<PixelComponents>(fa&7);
 
        DataType type;
-       if(fa&0x80)
+       if(fa&0x100)
                type = static_cast<DataType>((fa&0x70)>>4 | 0x300);
        else
                type = static_cast<DataType>((fa&0x70)>>4);
index 45ea9198cd772b1adc3f370307df1ee4a9b17971..c67586a9dd435353c5511f67967e23bd57d4ec6a 100644 (file)
@@ -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
 };