support texture file with mipmaps data.

This commit is contained in:
2020-10-25 21:29:18 +08:00
parent 7f71b50316
commit e13d442ee1
11 changed files with 247 additions and 102 deletions

View File

@@ -9,10 +9,6 @@
using namespace hgl;
using namespace hgl::graph;
VK_NAMESPACE_BEGIN
Texture2D *CreateTextureFromFile(GPUDevice *device,const OSString &filename);
VK_NAMESPACE_END
constexpr uint32_t SCREEN_SIZE=512;
constexpr uint32_t VERTEX_COUNT=4;
@@ -79,7 +75,6 @@ public:
SAFE_CLEAR(vertex_buffer);
SAFE_CLEAR(sampler_nearest);
SAFE_CLEAR(sampler_linear);
SAFE_CLEAR(texture);
}
private:
@@ -135,7 +130,7 @@ private:
bool InitTexture()
{
texture=CreateTextureFromFile(device,OS_TEXT("res/image/heightmap.Tex2D"));
texture=db->LoadTexture2D(OS_TEXT("res/image/heightmap.Tex2D"));
return texture;
}