summaryrefslogtreecommitdiffstats
path: root/build/visual-studio
diff options
context:
space:
mode:
authorArielG-NV <159081215+ArielG-NV@users.noreply.github.com>2024-04-03 20:43:24 -0400
committerGitHub <noreply@github.com>2024-04-03 17:43:24 -0700
commit94ced35a519294bbfb8e1d6c90aa235dd3878d88 (patch)
tree44749271c6d2e3cfc0eee67d8d8da00015fac7d2 /build/visual-studio
parentf6c49fdb2cc7ead1943d944097220cedd142792f (diff)
Legalization of non-struct when function expects struct, resolves #3840 (#3880)
* Legalization of non-struct when expects struct. `__forceVarIntoStructTemporarily()` solves the issue of passing "non-struct type's" into a parameter that only accepts "struct type's". The intrinsic solves the issue through checking the parameter of the intrinsic: If the parameter is a "struct type" * Return a reference to the parameter else * a "struct type" Temporary variable is made and the "non struct type" parameter is copied to a member of this struct. This struct is then returned by `__forceVarIntoStructTemporarily()`. Optionally if the use location of this call is a argument which can have side effects (out, inout, ref, etc.) the temporary struct variable is copied into the original "non struct type" parameter. Testing code has "addComplexity" functions to avoid optimizations through forcing side effects so we can predict the code output. * Address review comments - ForceInline ray functions - fix testing - adjust how we replace operands in senarios to avoid unexpected side effects of replacing operands without any explicit checks * Adjust nv test slightly and remove .glsl file * Remove implicit LOD sampling & test additions - Implicit LOD sampling is not allowed in a raygen. Implicit LOD sampling requires depth (from a fragment shader) to sample. Raygen does not have the depth, so this function was replaced. - Changed other tests for correctness/clarity * Test if Falcor breaks through use of ForceInline * Add back force inline may need to look at how Falcor wrote its slang shaders. This will be done if ForceInline causes issues since ForceInline should not affect code gen in an impactable way.
Diffstat (limited to 'build/visual-studio')
-rw-r--r--build/visual-studio/slang/slang.vcxproj2
-rw-r--r--build/visual-studio/slang/slang.vcxproj.filters6
2 files changed, 8 insertions, 0 deletions
diff --git a/build/visual-studio/slang/slang.vcxproj b/build/visual-studio/slang/slang.vcxproj
index aca22890b..183f83abc 100644
--- a/build/visual-studio/slang/slang.vcxproj
+++ b/build/visual-studio/slang/slang.vcxproj
@@ -401,6 +401,7 @@ IF EXIST ..\..\..\external\slang-glslang\bin\windows-aarch64\release\slang-glsla
<ClInclude Include="..\..\..\source\slang\slang-ir-generics-lowering-context.h" />
<ClInclude Include="..\..\..\source\slang\slang-ir-glsl-legalize.h" />
<ClInclude Include="..\..\..\source\slang\slang-ir-glsl-liveness.h" />
+ <ClInclude Include="..\..\..\source\slang\slang-ir-hlsl-legalize.h" />
<ClInclude Include="..\..\..\source\slang\slang-ir-init-local-var.h" />
<ClInclude Include="..\..\..\source\slang\slang-ir-inline.h" />
<ClInclude Include="..\..\..\source\slang\slang-ir-insert-debug-value-store.h" />
@@ -628,6 +629,7 @@ IF EXIST ..\..\..\external\slang-glslang\bin\windows-aarch64\release\slang-glsla
<ClCompile Include="..\..\..\source\slang\slang-ir-generics-lowering-context.cpp" />
<ClCompile Include="..\..\..\source\slang\slang-ir-glsl-legalize.cpp" />
<ClCompile Include="..\..\..\source\slang\slang-ir-glsl-liveness.cpp" />
+ <ClCompile Include="..\..\..\source\slang\slang-ir-hlsl-legalize.cpp" />
<ClCompile Include="..\..\..\source\slang\slang-ir-init-local-var.cpp" />
<ClCompile Include="..\..\..\source\slang\slang-ir-inline.cpp" />
<ClCompile Include="..\..\..\source\slang\slang-ir-insert-debug-value-store.cpp" />
diff --git a/build/visual-studio/slang/slang.vcxproj.filters b/build/visual-studio/slang/slang.vcxproj.filters
index 7b6b7de2c..5d5743c16 100644
--- a/build/visual-studio/slang/slang.vcxproj.filters
+++ b/build/visual-studio/slang/slang.vcxproj.filters
@@ -291,6 +291,9 @@
<ClInclude Include="..\..\..\source\slang\slang-ir-glsl-liveness.h">
<Filter>Header Files</Filter>
</ClInclude>
+ <ClInclude Include="..\..\..\source\slang\slang-ir-hlsl-legalize.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
<ClInclude Include="..\..\..\source\slang\slang-ir-init-local-var.h">
<Filter>Header Files</Filter>
</ClInclude>
@@ -968,6 +971,9 @@
<ClCompile Include="..\..\..\source\slang\slang-ir-glsl-liveness.cpp">
<Filter>Source Files</Filter>
</ClCompile>
+ <ClCompile Include="..\..\..\source\slang\slang-ir-hlsl-legalize.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
<ClCompile Include="..\..\..\source\slang\slang-ir-init-local-var.cpp">
<Filter>Source Files</Filter>
</ClCompile>