bkaradzic 12 năm trước cách đây
mục cha
commit
1aced4d4ec
5 tập tin đã thay đổi với 46 bổ sung47 xóa
  1. 3 5
      README.md
  2. 0 1
      include/bgfx.h
  3. 0 1
      src/bgfx_p.h
  4. 40 40
      src/image.cpp
  5. 3 0
      src/image.h

+ 3 - 5
README.md

@@ -106,9 +106,6 @@ Dependencies
 
 [https://github.com/bkaradzic/bx](https://github.com/bkaradzic/bx)
 
-Optional:  
-[https://github.com/mendsley/tinystl](https://github.com/mendsley/tinystl)
-
 Building
 --------
 
@@ -274,10 +271,11 @@ cross-platform shaders.
 
 ### Texture Compiler (texturec)
 
-This tool doesn't currently exist. To produce DDS or KTX textures use:
+This tool doesn't currently exist. To produce DDS, KTX or PVR textures use:
 
 [.dds - nVidia Texture Tools - DDS Utilities](https://developer.nvidia.com/legacy-texture-tools)  
-[.ktx - Mali GPU Texture Compression Tool](http://malideveloper.arm.com/develop-for-mali/mali-gpu-texture-compression-tool/)
+[.ktx - Mali GPU Texture Compression Tool](http://malideveloper.arm.com/develop-for-mali/mali-gpu-texture-compression-tool/)  
+[.pvr - PowerVR Insider SDK](http://www.imgtec.com/powervr/insider/sdkdownloads/index.asp)
 
 ### Geometry Compiler (geometryc)
 

+ 0 - 1
include/bgfx.h

@@ -525,7 +525,6 @@ namespace bgfx
 	///
 	/// @param _width Width of input image (pixels).
 	/// @param _height Height of input image (pixels).
-	/// @param _pitch Pitch of input image (bytes).
 	/// @param _src Source image.
 	/// @param _dst Destination image. Must be the same size as input image.
 	///   _dst might be pointer to the same memory as _src.

+ 0 - 1
src/bgfx_p.h

@@ -230,7 +230,6 @@ namespace bgfx
 	extern FreeFn g_free;
 
 	void release(const Memory* _mem);
-	uint32_t getBitsPerPixel(TextureFormat::Enum _format);
 	const char* getAttribName(Attrib::Enum _attr);
 	bool renderFrame();
 

+ 40 - 40
src/image.cpp

@@ -792,22 +792,22 @@ namespace bgfx
 
 	} s_translateDdsFormat[] =
 	{
-		{ DDS_DXT1,                                       TextureFormat::BC1     },
-		{ DDS_DXT2,                                       TextureFormat::BC2     },
-		{ DDS_DXT3,                                       TextureFormat::BC2     },
-		{ DDS_DXT4,                                       TextureFormat::BC3     },
-		{ DDS_DXT5,                                       TextureFormat::BC3     },
-		{ DDS_ATI1,                                       TextureFormat::BC4     },
-		{ DDS_BC4U,                                       TextureFormat::BC4     },
-		{ DDS_ATI2,                                       TextureFormat::BC5     },
-		{ DDS_BC5U,                                       TextureFormat::BC5     },
-		{ D3DFMT_A16B16G16R16,                            TextureFormat::RGBA16  },
-		{ D3DFMT_A16B16G16R16F,                           TextureFormat::RGBA16F },
-		{ DDPF_RGB,                                       TextureFormat::BGRX8   },
-		{ DDPF_RGB|DDPF_ALPHAPIXELS,                      TextureFormat::BGRA8   },
-		{ DDPF_INDEXED,                                   TextureFormat::L8      },
-		{ DDPF_LUMINANCE,                                 TextureFormat::L8      },
-		{ DDPF_ALPHA,                                     TextureFormat::L8      },
+		{ DDS_DXT1,                  TextureFormat::BC1     },
+		{ DDS_DXT2,                  TextureFormat::BC2     },
+		{ DDS_DXT3,                  TextureFormat::BC2     },
+		{ DDS_DXT4,                  TextureFormat::BC3     },
+		{ DDS_DXT5,                  TextureFormat::BC3     },
+		{ DDS_ATI1,                  TextureFormat::BC4     },
+		{ DDS_BC4U,                  TextureFormat::BC4     },
+		{ DDS_ATI2,                  TextureFormat::BC5     },
+		{ DDS_BC5U,                  TextureFormat::BC5     },
+		{ D3DFMT_A16B16G16R16,       TextureFormat::RGBA16  },
+		{ D3DFMT_A16B16G16R16F,      TextureFormat::RGBA16F },
+		{ DDPF_RGB,                  TextureFormat::BGRX8   },
+		{ DDPF_RGB|DDPF_ALPHAPIXELS, TextureFormat::BGRA8   },
+		{ DDPF_INDEXED,              TextureFormat::L8      },
+		{ DDPF_LUMINANCE,            TextureFormat::L8      },
+		{ DDPF_ALPHA,                TextureFormat::L8      },
 	};
 
 	bool imageParseDds(ImageContainer& _imageContainer, bx::ReaderSeekerI* _reader)
@@ -960,30 +960,30 @@ namespace bgfx
 
 	} s_translateKtxFormat[] =
 	{
-		{ KTX_COMPRESSED_RGBA_S3TC_DXT1_EXT,              TextureFormat::BC1     },
-		{ KTX_COMPRESSED_RGBA_S3TC_DXT3_EXT,              TextureFormat::BC2     },
-		{ KTX_COMPRESSED_RGBA_S3TC_DXT5_EXT,              TextureFormat::BC3     },
-		{ KTX_COMPRESSED_LUMINANCE_LATC1_EXT,             TextureFormat::BC4     },
-		{ KTX_COMPRESSED_LUMINANCE_ALPHA_LATC2_EXT,       TextureFormat::BC5     },
-		{ KTX_ETC1_RGB8_OES,                              TextureFormat::ETC1    },
-		{ KTX_COMPRESSED_RGB8_ETC2,                       TextureFormat::ETC2    },
-		{ KTX_COMPRESSED_RGBA8_ETC2_EAC,                  TextureFormat::ETC2A   },
-		{ KTX_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2,   TextureFormat::ETC2A1  },
-		{ KTX_COMPRESSED_RGB_PVRTC_2BPPV1_IMG,            TextureFormat::PTC12   },
-		{ KTX_COMPRESSED_RGBA_PVRTC_2BPPV1_IMG,           TextureFormat::PTC12A  },
-		{ KTX_COMPRESSED_RGB_PVRTC_4BPPV1_IMG,            TextureFormat::PTC14   },
-		{ KTX_COMPRESSED_RGBA_PVRTC_4BPPV1_IMG,           TextureFormat::PTC14A  },
-		{ KTX_COMPRESSED_RGBA_PVRTC_2BPPV2_IMG,           TextureFormat::PTC22   },
-		{ KTX_COMPRESSED_RGBA_PVRTC_4BPPV2_IMG,           TextureFormat::PTC24   },
-		{ KTX_RGBA16,                                     TextureFormat::RGBA16  },
-		{ KTX_RGBA16F,                                    TextureFormat::RGBA16F },
-		{ KTX_COMPRESSED_R11_EAC,                         TextureFormat::Unknown },
-		{ KTX_COMPRESSED_SIGNED_R11_EAC,                  TextureFormat::Unknown },
-		{ KTX_COMPRESSED_RG11_EAC,                        TextureFormat::Unknown },
-		{ KTX_COMPRESSED_SIGNED_RG11_EAC,                 TextureFormat::Unknown },
-		{ KTX_COMPRESSED_SRGB8_ETC2,                      TextureFormat::Unknown },
-		{ KTX_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2,  TextureFormat::Unknown },
-		{ KTX_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC,           TextureFormat::Unknown },
+		{ KTX_COMPRESSED_RGBA_S3TC_DXT1_EXT,             TextureFormat::BC1     },
+		{ KTX_COMPRESSED_RGBA_S3TC_DXT3_EXT,             TextureFormat::BC2     },
+		{ KTX_COMPRESSED_RGBA_S3TC_DXT5_EXT,             TextureFormat::BC3     },
+		{ KTX_COMPRESSED_LUMINANCE_LATC1_EXT,            TextureFormat::BC4     },
+		{ KTX_COMPRESSED_LUMINANCE_ALPHA_LATC2_EXT,      TextureFormat::BC5     },
+		{ KTX_ETC1_RGB8_OES,                             TextureFormat::ETC1    },
+		{ KTX_COMPRESSED_RGB8_ETC2,                      TextureFormat::ETC2    },
+		{ KTX_COMPRESSED_RGBA8_ETC2_EAC,                 TextureFormat::ETC2A   },
+		{ KTX_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2,  TextureFormat::ETC2A1  },
+		{ KTX_COMPRESSED_RGB_PVRTC_2BPPV1_IMG,           TextureFormat::PTC12   },
+		{ KTX_COMPRESSED_RGBA_PVRTC_2BPPV1_IMG,          TextureFormat::PTC12A  },
+		{ KTX_COMPRESSED_RGB_PVRTC_4BPPV1_IMG,           TextureFormat::PTC14   },
+		{ KTX_COMPRESSED_RGBA_PVRTC_4BPPV1_IMG,          TextureFormat::PTC14A  },
+		{ KTX_COMPRESSED_RGBA_PVRTC_2BPPV2_IMG,          TextureFormat::PTC22   },
+		{ KTX_COMPRESSED_RGBA_PVRTC_4BPPV2_IMG,          TextureFormat::PTC24   },
+		{ KTX_RGBA16,                                    TextureFormat::RGBA16  },
+		{ KTX_RGBA16F,                                   TextureFormat::RGBA16F },
+		{ KTX_COMPRESSED_R11_EAC,                        TextureFormat::Unknown },
+		{ KTX_COMPRESSED_SIGNED_R11_EAC,                 TextureFormat::Unknown },
+		{ KTX_COMPRESSED_RG11_EAC,                       TextureFormat::Unknown },
+		{ KTX_COMPRESSED_SIGNED_RG11_EAC,                TextureFormat::Unknown },
+		{ KTX_COMPRESSED_SRGB8_ETC2,                     TextureFormat::Unknown },
+		{ KTX_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2, TextureFormat::Unknown },
+		{ KTX_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC,          TextureFormat::Unknown },
 	};
 
 	bool imageParseKtx(ImageContainer& _imageContainer, bx::ReaderSeekerI* _reader)

+ 3 - 0
src/image.h

@@ -39,6 +39,9 @@ namespace bgfx
 		void decode(uint8_t* _dst);
 	};
 
+	///
+	uint32_t getBitsPerPixel(TextureFormat::Enum _format);
+
 	///
 	void imageSolid(uint32_t _width, uint32_t _height, uint32_t _solid, void* _dst);