规范模型输入以及测试shader

This commit is contained in:
2025-10-09 21:44:59 +08:00
parent 698c1a1099
commit f847154ba2
11 changed files with 436 additions and 78 deletions
+21 -3
View File
@@ -9,13 +9,31 @@ class TestShaderInterface : public davinci::ShaderFileInterface
public:
virtual davinci::VertexShaderInterface* getVertexShader(const char* szName)
{
static TestVertexShader testVertexShader;
return &testVertexShader;
if (strcmp(szName, "standard") == 0)
{
static StandardVertexShader standardVertexShader;
return &standardVertexShader;
}
else if (strcmp(szName, "test") == 0)
{
static TestVertexShader testVertexShader;
return &testVertexShader;
}
return nullptr;
}
virtual davinci::PixelShaderInterface* getPixelShader(const char* szName)
{
static SolidColorPixelShader solidColorPixelShader;
static TestPixelShader testPixelShader;
return &testPixelShader;
if(strcmp(szName, solidColorPixelShader.getName()) == 0)
{
return &solidColorPixelShader;
}
else if (strcmp(szName, testPixelShader.getName()) == 0)
{
return &testPixelShader;
}
return nullptr;
}
};