}
DataType type = get_component_type(pf);
- return static_cast<FrameAttachment>((fa&0xFC00) | (is_float(type)*0x100) | get_type_size(type)<<4 | get_component_count(comp));
+ return static_cast<FrameAttachment>((fa&0xFC00) | (is_float(type)*0x100) | get_type_size(type)<<4 | ((comp&0x20)>>2) | get_component_count(comp));
}
FrameAttachment make_indexed_attachment(FrameAttachment fa, unsigned i)
else if(get_attach_point(fa)==get_attach_point(STENCIL_ATTACHMENT))
comp = STENCIL_INDEX;
else
- comp = static_cast<PixelComponents>(fa&7);
+ comp = static_cast<PixelComponents>((fa&7) | (fa&8)<<2);
DataType type;
if(fa&0x100)
The values are bitfields laid as follows:
-nnnn nn_f _sss _ccc
- │ │ │ └╴Number of components
+nnnn nn_f _sss rccc
+ │ │ │ │ └╴Number of components
+ │ │ │ └───╴Reverse order flag
│ │ └─────╴Size of one component
│ └──────────╴Floating-point flag
└────────────╴Attachment index