2
0
Branimir Karadzic 11 жил өмнө
parent
commit
38f340b540

+ 0 - 1
examples/common/imgui/imgui.cpp

@@ -58,7 +58,6 @@ static const int32_t DEFAULT_SPACING = 4;
 static const int32_t TEXT_HEIGHT = 8;
 static const int32_t TEXT_HEIGHT = 8;
 static const int32_t SCROLL_AREA_PADDING = 6;
 static const int32_t SCROLL_AREA_PADDING = 6;
 static const int32_t AREA_HEADER = 20;
 static const int32_t AREA_HEADER = 20;
-static const int32_t COLOR_WHEEL_PADDING = 60;
 static const float s_tabStops[4] = {150, 210, 270, 330};
 static const float s_tabStops[4] = {150, 210, 270, 330};
 
 
 static void* imguiMalloc(size_t size, void* /*_userptr*/)
 static void* imguiMalloc(size_t size, void* /*_userptr*/)

+ 9 - 8
src/bgfx.cpp

@@ -507,7 +507,7 @@ namespace bgfx
 				.end();
 				.end();
 
 
 			ShaderHandle vsh = BGFX_INVALID_HANDLE;
 			ShaderHandle vsh = BGFX_INVALID_HANDLE;
-			
+
 			struct Mem
 			struct Mem
 			{
 			{
 				Mem(const void* _data, size_t _size)
 				Mem(const void* _data, size_t _size)
@@ -2245,6 +2245,7 @@ again:
 		_width   = bx::uint32_max(1, _width);
 		_width   = bx::uint32_max(1, _width);
 		_height  = bx::uint32_max(1, _height);
 		_height  = bx::uint32_max(1, _height);
 		_depth   = bx::uint32_max(1, _depth);
 		_depth   = bx::uint32_max(1, _depth);
+		_numMips = bx::uint32_max(1, _numMips);
 
 
 		uint32_t width  = _width;
 		uint32_t width  = _width;
 		uint32_t height = _height;
 		uint32_t height = _height;
@@ -2261,17 +2262,17 @@ again:
 
 
 			size += width*height*depth*bpp/8;
 			size += width*height*depth*bpp/8;
 
 
-			width >>= 1;
+			width  >>= 1;
 			height >>= 1;
 			height >>= 1;
-			depth >>= 1;
+			depth  >>= 1;
 		}
 		}
 
 
-		_info.format = _format;
-		_info.storageSize = size;
-		_info.width = _width;
-		_info.height = _height;
-		_info.depth = _depth;
+		_info.format  = _format;
+		_info.width   = _width;
+		_info.height  = _height;
+		_info.depth   = _depth;
 		_info.numMips = _numMips;
 		_info.numMips = _numMips;
+		_info.storageSize  = size;
 		_info.bitsPerPixel = bpp;
 		_info.bitsPerPixel = bpp;
 	}
 	}