@@ -561,11 +561,8 @@ auto reshade::opengl::convert_format(GLenum format, GLenum type) -> api::format
561
561
case GL_RGB_INTEGER:
562
562
switch (type)
563
563
{
564
- case GL_UNSIGNED_SHORT_5_6_5:
565
- return api::format::b5g6r5_unorm;
566
- case GL_UNSIGNED_SHORT_5_6_5_REV:
567
- assert (false );
568
- return api::format::unknown;
564
+ case GL_UNSIGNED_INT_10F_11F_11F_REV:
565
+ return api::format::r11g11b10_float;
569
566
case GL_FLOAT:
570
567
return api::format::r32g32b32_float;
571
568
default :
@@ -576,11 +573,10 @@ auto reshade::opengl::convert_format(GLenum format, GLenum type) -> api::format
576
573
case GL_BGR_INTEGER:
577
574
switch (type)
578
575
{
579
- case GL_UNSIGNED_SHORT_5_6_5:
580
- assert (false );
581
- return api::format::unknown;
582
576
case GL_UNSIGNED_SHORT_5_6_5_REV:
583
577
return api::format::b5g6r5_unorm;
578
+ case GL_UNSIGNED_SHORT_1_5_5_5_REV:
579
+ return api::format::b5g5r5x1_unorm;
584
580
case GL_FLOAT:
585
581
default :
586
582
assert (false );
@@ -597,30 +593,18 @@ auto reshade::opengl::convert_format(GLenum format, GLenum type) -> api::format
597
593
return api::format::r16g16b16a16_snorm;
598
594
case GL_UNSIGNED_SHORT:
599
595
return api::format::r16g16b16a16_unorm;
600
- case GL_UNSIGNED_SHORT_4_4_4_4:
601
- return api::format::b4g4r4a4_unorm;
602
- case GL_UNSIGNED_SHORT_4_4_4_4_REV:
603
- assert (false );
604
- return api::format::unknown;
605
- case GL_UNSIGNED_SHORT_5_5_5_1:
606
- return api::format::b5g5r5a1_unorm;
607
- case GL_UNSIGNED_SHORT_1_5_5_5_REV:
608
- assert (false );
609
- return api::format::unknown;
610
596
case GL_HALF_FLOAT:
611
597
return api::format::r16g16b16a16_float;
612
598
case GL_INT:
613
599
return api::format::r32g32b32a32_sint;
614
600
case GL_UNSIGNED_INT:
615
601
return api::format::r32g32b32a32_uint;
616
- case GL_UNSIGNED_INT_8_8_8_8:
617
- return api::format::b8g8r8a8_unorm;
618
- case GL_UNSIGNED_INT_8_8_8_8_REV:
602
+ case GL_UNSIGNED_INT_8_8_8_8_REV: // On a little endian machine the least-significant byte is stored first
619
603
return api::format::r8g8b8a8_unorm;
620
- case GL_UNSIGNED_INT_10_10_10_2:
621
- return api::format::b10g10r10a2_unorm;
622
604
case GL_UNSIGNED_INT_2_10_10_10_REV:
623
605
return api::format::r10g10b10a2_unorm;
606
+ case GL_UNSIGNED_INT_5_9_9_9_REV:
607
+ return api::format::r9g9b9e5;
624
608
case GL_FLOAT:
625
609
return api::format::r32g32b32a32_float;
626
610
default :
@@ -637,26 +621,18 @@ auto reshade::opengl::convert_format(GLenum format, GLenum type) -> api::format
637
621
return api::format::b8g8r8a8_unorm;
638
622
case GL_SHORT:
639
623
case GL_UNSIGNED_SHORT:
640
- case GL_UNSIGNED_SHORT_4_4_4_4:
641
624
assert (false );
642
625
return api::format::unknown;
643
626
case GL_UNSIGNED_SHORT_4_4_4_4_REV:
644
627
return api::format::b4g4r4a4_unorm;
645
- case GL_UNSIGNED_SHORT_5_5_5_1:
646
- assert (false );
647
- return api::format::unknown;
648
628
case GL_UNSIGNED_SHORT_1_5_5_5_REV:
649
629
return api::format::b5g5r5a1_unorm;
650
630
case GL_INT:
651
631
case GL_UNSIGNED_INT:
652
632
assert (false );
653
633
return api::format::unknown;
654
- case GL_UNSIGNED_INT_8_8_8_8:
655
- return api::format::r8g8b8a8_unorm;
656
634
case GL_UNSIGNED_INT_8_8_8_8_REV:
657
635
return api::format::b8g8r8a8_unorm;
658
- case GL_UNSIGNED_INT_10_10_10_2:
659
- return api::format::r10g10b10a2_unorm;
660
636
case GL_UNSIGNED_INT_2_10_10_10_REV:
661
637
return api::format::b10g10r10a2_unorm;
662
638
case GL_FLOAT:
@@ -754,6 +730,10 @@ auto reshade::opengl::convert_attrib_format(api::format format, GLint &size, GLb
754
730
case api::format::r10g10b10a2_uint:
755
731
size = 4 ;
756
732
return GL_UNSIGNED_INT_2_10_10_10_REV;
733
+ case api::format::b10g10r10a2_unorm:
734
+ normalized = GL_TRUE;
735
+ size = GL_BGRA;
736
+ return GL_UNSIGNED_INT_2_10_10_10_REV;
757
737
case api::format::r16_unorm:
758
738
normalized = GL_TRUE;
759
739
[[fallthrough]];
@@ -952,17 +932,17 @@ auto reshade::opengl::convert_upload_format(GLenum internal_format, GLenum &type
952
932
type = GL_UNSIGNED_INT_10F_11F_11F_REV;
953
933
return GL_RGB;
954
934
case GL_RGB565:
955
- type = GL_UNSIGNED_SHORT_5_6_5 ;
956
- return GL_RGB ;
935
+ type = GL_UNSIGNED_SHORT_5_6_5_REV ;
936
+ return GL_BGR ;
957
937
case GL_RGB5_A1:
958
- type = GL_UNSIGNED_SHORT_5_5_5_1 ;
959
- return GL_RGBA ;
938
+ type = GL_UNSIGNED_SHORT_1_5_5_5_REV ;
939
+ return GL_BGRA ;
960
940
case GL_RGB5:
961
- type = GL_UNSIGNED_SHORT_5_5_5_1 ;
962
- return GL_RGB ;
941
+ type = GL_UNSIGNED_SHORT_1_5_5_5_REV ;
942
+ return GL_BGR ;
963
943
case GL_RGBA4:
964
- type = GL_UNSIGNED_SHORT_4_4_4_4 ;
965
- return GL_RGBA ;
944
+ type = GL_UNSIGNED_SHORT_4_4_4_4_REV ;
945
+ return GL_BGRA ;
966
946
case GL_STENCIL_INDEX:
967
947
case GL_STENCIL_INDEX8:
968
948
type = GL_UNSIGNED_BYTE;
0 commit comments