Procházet zdrojové kódy

Ignore sRGB from image container, use only flag passed.

Branimir Karadžić před 8 roky
rodič
revize
dccd1cb00c
3 změnil soubory, kde provedl 14 přidání a 19 odebrání
  1. 1 1
      src/renderer_d3d11.cpp
  2. 0 5
      src/renderer_d3d9.cpp
  3. 13 13
      src/renderer_mtl.mm

+ 1 - 1
src/renderer_d3d11.cpp

@@ -4532,7 +4532,7 @@ BX_PRAGMA_DIAGNOSTIC_POP();
 			const bool writeOnly    = 0 != (m_flags&(BGFX_TEXTURE_RT_WRITE_ONLY|BGFX_TEXTURE_READ_BACK) );
 			const bool computeWrite = 0 != (m_flags&BGFX_TEXTURE_COMPUTE_WRITE);
 			const bool renderTarget = 0 != (m_flags&BGFX_TEXTURE_RT_MASK);
-			const bool srgb         = 0 != (m_flags&BGFX_TEXTURE_SRGB) || imageContainer.m_srgb;
+			const bool srgb         = 0 != (m_flags&BGFX_TEXTURE_SRGB);
 			const bool blit         = 0 != (m_flags&BGFX_TEXTURE_BLIT_DST);
 			const bool readBack     = 0 != (m_flags&BGFX_TEXTURE_READ_BACK);
 			const uint32_t msaaQuality = bx::uint32_satsub( (m_flags&BGFX_TEXTURE_RT_MSAA_MASK)>>BGFX_TEXTURE_RT_MSAA_SHIFT, 1);

+ 0 - 5
src/renderer_d3d9.cpp

@@ -2933,11 +2933,6 @@ namespace bgfx { namespace d3d9
 				createTexture(textureWidth, textureHeight, numMips);
 			}
 
-			if (imageContainer.m_srgb)
-			{
-				m_flags |= BGFX_TEXTURE_SRGB;
-			}
-
 			BX_TRACE("Texture %3d: %s (requested: %s), %dx%d%s%s."
 				, this - s_renderD3D9->m_textures
 				, getName( (TextureFormat::Enum)m_textureFormat)

+ 13 - 13
src/renderer_mtl.mm

@@ -2503,21 +2503,21 @@ namespace bgfx { namespace mtl
 			const bool writeOnly    = 0 != (_flags&BGFX_TEXTURE_RT_WRITE_ONLY);
 			const bool computeWrite = 0 != (_flags&BGFX_TEXTURE_COMPUTE_WRITE);
 			const bool renderTarget = 0 != (_flags&BGFX_TEXTURE_RT_MASK);
-			const bool srgb			= 0 != (_flags&BGFX_TEXTURE_SRGB) || imageContainer.m_srgb;
+			const bool srgb         = 0 != (_flags&BGFX_TEXTURE_SRGB);
 
 			BX_TRACE("Texture %3d: %s (requested: %s), layers %d, %dx%d%s RT[%c], WO[%c], CW[%c], sRGB[%c]"
-					 , this - s_renderMtl->m_textures
-					 , getName( (TextureFormat::Enum)m_textureFormat)
-					 , getName( (TextureFormat::Enum)m_requestedFormat)
-					 , numLayers
-					 , textureWidth
-					 , textureHeight
-					 , imageContainer.m_cubeMap ? "x6" : ""
-					 , renderTarget ? 'x' : '.'
-					 , writeOnly ? 'x' : '.'
-					 , computeWrite ? 'x' : '.'
-					 , srgb ? 'x' : '.'
-					 );
+					, this - s_renderMtl->m_textures
+					, getName( (TextureFormat::Enum)m_textureFormat)
+					, getName( (TextureFormat::Enum)m_requestedFormat)
+					, numLayers
+					, textureWidth
+					, textureHeight
+					, imageContainer.m_cubeMap ? "x6" : ""
+					, renderTarget ? 'x' : '.'
+					, writeOnly ? 'x' : '.'
+					, computeWrite ? 'x' : '.'
+					, srgb ? 'x' : '.'
+					);
 
 			const uint32_t msaaQuality = bx::uint32_satsub( (_flags&BGFX_TEXTURE_RT_MSAA_MASK)>>BGFX_TEXTURE_RT_MSAA_SHIFT, 1);
 			int sampleCount = s_msaa[msaaQuality];