- Fix link resolution with proper relative/absolute path handling - Improve link styling with underline decoration - Hide leaf nodes from tree, only show directories - Fix log file path for packaged app
822 B
822 B
RHIDevice::CompileShader
virtual RHIShader* CompileShader(const ShaderCompileDesc& desc) = 0;
编译着色器程序。
参数:
desc- 着色器编译描述符,包含入口点、配置文件、源文件等
返回: 新创建的着色器指针,失败返回 nullptr
复杂度: O(n) - 取决于着色器代码复杂度
示例:
ShaderCompileDesc shaderDesc;
shaderDesc.entryPoint = L"main";
shaderDesc.profile = L"vs_6_0";
shaderDesc.fileName = L"shaders/vertex.hlsl";
shaderDesc.macros = {};
RHIShader* vertexShader = device->CompileShader(shaderDesc);
if (!vertexShader->IsValid()) {
// 处理编译错误
vertexShader->Shutdown();
}
相关文档
- RHIDevice 总览 - 返回类总览
- RHIShader - 着色器类