ncannasse пре 7 година
родитељ
комит
60e226e91e
2 измењених фајлова са 5 додато и 3 уклоњено
  1. 2 1
      h3d/impl/DirectXDriver.hx
  2. 3 2
      h3d/impl/GlDriver.hx

+ 2 - 1
h3d/impl/DirectXDriver.hx

@@ -342,7 +342,7 @@ class DirectXDriver extends h3d.impl.Driver {
 
 	override function isSupportedFormat( fmt : hxd.PixelFormat ) {
 		return switch( fmt ) {
-		case RGB8, RGB16F: false;
+		case RGB8, RGB16F, ARGB, BGRA, SRGB: false;
 		default: true;
 		}
 	}
@@ -361,6 +361,7 @@ class DirectXDriver extends h3d.impl.Driver {
 		case RGB32F: R32G32B32_FLOAT;
 		case RGB10A2: R10G10B10A2_UNORM;
 		case RG11B10UF: R11G11B10_FLOAT;
+		case SRGB_ALPHA: R8G8B8A8_UNORM_SRGB;
 		default: throw "Unsupported texture format " + t.format;
 		}
 	}

+ 3 - 2
h3d/impl/GlDriver.hx

@@ -44,6 +44,7 @@ private extern class GL2 extends js.html.webgl.GL {
 	static inline var UNIFORM_BUFFER = 0x8A11;
 	static inline var TEXTURE_2D_ARRAY = 0x8C1A;
 	static inline var UNSIGNED_INT_2_10_10_10_REV = 0x8368;
+	static inline var UNSIGNED_INT_10F_11F_11F_REV = 0x8C3B;
 }
 private typedef Uniform = js.html.webgl.UniformLocation;
 private typedef Program = js.html.webgl.Program;
@@ -800,10 +801,10 @@ class GlDriver extends Driver {
 		case RGB10A2:
 			tt.internalFmt = GL2.RGB10_A2;
 			tt.pixelFmt = GL2.UNSIGNED_INT_2_10_10_10_REV;
-		#end
 		case RG11B10UF:
 			tt.internalFmt = GL2.R11F_G11F_B10F;
-			tt.pixelFmt = GL.FLOAT;
+			tt.pixelFmt = GL.UNSIGNED_INT_10F_11F_11F_REV;
+		#end
 		default:
 			throw "Unsupported texture format "+t.format;
 		}