Branimir Karadžić 9 ani în urmă
părinte
comite
57d34f557b
3 a modificat fișierele cu 13 adăugiri și 7 ștergeri
  1. 2 2
      src/bgfx.cpp
  2. 7 1
      tools/shaderc/shaderc.cpp
  3. 4 4
      tools/texturec/texturec.cpp

+ 2 - 2
src/bgfx.cpp

@@ -483,7 +483,7 @@ namespace bgfx
 		BGFX_DECLARE_SHADER_EMBEDDED(fs_clear6),
 		BGFX_DECLARE_SHADER_EMBEDDED(fs_clear7),
 
-		{ NULL, { bgfx::RendererType::Count, NULL, 0 } }
+		{ NULL, { { bgfx::RendererType::Count, NULL, 0 } } }
 	};
 
 	static ShaderHandle createEmbeddedShader(RendererType::Enum _type, const char* _name)
@@ -1291,7 +1291,7 @@ namespace bgfx
 			g_caps.formats[fmt] |= 0 == (g_caps.formats[fmt] & BGFX_CAPS_FORMAT_TEXTURE_CUBE) ? BGFX_CAPS_FORMAT_TEXTURE_CUBE_EMULATED : 0;
 		}
 
-		for (uint32_t ii = 0; ii < TextureFormat::Count; ++ii)
+		for (uint32_t ii = 0; ii < TextureFormat::UnknownDepth; ++ii)
 		{
 			bool convertable = imageConvert(TextureFormat::BGRA8, TextureFormat::Enum(ii) );
 			g_caps.formats[ii] |= 0 == (g_caps.formats[ii] & BGFX_CAPS_FORMAT_TEXTURE_2D  ) && convertable ? BGFX_CAPS_FORMAT_TEXTURE_2D_EMULATED   : 0;

+ 7 - 1
tools/shaderc/shaderc.cpp

@@ -138,7 +138,13 @@ namespace bgfx
 
 	const char* getUniformTypeName(UniformType::Enum _enum)
 	{
-		return s_uniformTypeName[_enum];
+		uint32_t idx = _enum & ~(BGFX_UNIFORM_FRAGMENTBIT|BGFX_UNIFORM_SAMPLERBIT);
+		if (idx < UniformType::Count)
+		{
+			return s_uniformTypeName[idx];
+		}
+
+		return "Unknown uniform type?!";
 	}
 
 	UniformType::Enum nameToUniformTypeEnum(const char* _name)

+ 4 - 4
tools/texturec/texturec.cpp

@@ -662,10 +662,10 @@ int main(int _argc, const char* _argv[])
 							{
 								const uint32_t offset = (yy*mip.m_width + xx) * 4;
 								float* inout = &rgba[offset];
-								inout[0] = inout[0] * 2.0f/255.0f - 1.0f;
-								inout[1] = inout[1] * 2.0f/255.0f - 1.0f;
-								inout[2] = inout[2] * 2.0f/255.0f - 1.0f;
-								inout[3] = inout[3] * 2.0f/255.0f - 1.0f;
+								inout[0] = inout[0] * 2.0f - 1.0f;
+								inout[1] = inout[1] * 2.0f - 1.0f;
+								inout[2] = inout[2] * 2.0f - 1.0f;
+								inout[3] = inout[3] * 2.0f - 1.0f;
 							}
 						}
 					}