Add shaderincludedirs to fxcompile configuration
This commit is contained in:
parent
00052e182d
commit
983333eab3
@ -39,6 +39,14 @@
|
||||
tokens = true,
|
||||
}
|
||||
|
||||
p.api.register {
|
||||
name = "shaderincludedirs",
|
||||
scope = "config",
|
||||
kind = "list:directory",
|
||||
tokens = true,
|
||||
pathVars = true,
|
||||
}
|
||||
|
||||
p.api.register {
|
||||
name = "shadertype",
|
||||
scope = "config",
|
||||
|
@ -77,6 +77,35 @@
|
||||
]]
|
||||
end
|
||||
|
||||
---
|
||||
-- Test FxCompileAdditionalIncludeDirectories
|
||||
---
|
||||
|
||||
function suite.onFxCompileAdditionalIncludeDirectories()
|
||||
files { "shader.hlsl" }
|
||||
shaderincludedirs { "../includes" }
|
||||
|
||||
prepare()
|
||||
test.capture [[
|
||||
<FxCompile>
|
||||
<AdditionalIncludeDirectories>..\includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</FxCompile>
|
||||
]]
|
||||
end
|
||||
|
||||
|
||||
function suite.onFxCompileAdditionalIncludeDirectories_multipleDefines()
|
||||
files { "shader.hlsl" }
|
||||
shaderincludedirs { "../includes", "otherpath/embedded" }
|
||||
|
||||
prepare()
|
||||
test.capture [[
|
||||
<FxCompile>
|
||||
<AdditionalIncludeDirectories>..\includes;otherpath\embedded;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</FxCompile>
|
||||
]]
|
||||
end
|
||||
|
||||
---
|
||||
-- Test FxCompileShaderType
|
||||
---
|
||||
|
@ -403,6 +403,7 @@
|
||||
m.elements.fxCompile = function(cfg)
|
||||
return {
|
||||
m.fxCompilePreprocessorDefinition,
|
||||
m.fxCompileAdditionalIncludeDirs,
|
||||
m.fxCompileShaderType,
|
||||
m.fxCompileShaderModel,
|
||||
m.fxCompileShaderEntry,
|
||||
@ -806,6 +807,7 @@
|
||||
return {
|
||||
m.excludedFromBuild,
|
||||
m.fxCompilePreprocessorDefinition,
|
||||
m.fxCompileAdditionalIncludeDirs,
|
||||
m.fxCompileShaderType,
|
||||
m.fxCompileShaderModel,
|
||||
m.fxCompileShaderEntry,
|
||||
@ -2692,6 +2694,12 @@
|
||||
end
|
||||
end
|
||||
|
||||
function m.fxCompileAdditionalIncludeDirs(cfg, condition)
|
||||
if cfg.shaderincludedirs and #cfg.shaderincludedirs > 0 then
|
||||
local dirs = vstudio.path(cfg, cfg.shaderincludedirs)
|
||||
m.element('AdditionalIncludeDirectories', condition, "%s;%%(AdditionalIncludeDirectories)", table.concat(dirs, ";"))
|
||||
end
|
||||
end
|
||||
|
||||
function m.fxCompileShaderType(cfg, condition)
|
||||
if cfg.shadertype then
|
||||
|
Loading…
Reference in New Issue
Block a user