vvvv / VL.StandardLibs

A collection of standard libraries for vvvv including VL.Stride, VL.Skia, VL.ImGui, msgpack.org[VL]
https://visualprogramming.net
GNU Lesser General Public License v3.0
35 stars 14 forks source link

Type constraint in ShaderFX prevents arbitrary shader composition #665

Closed tebjan closed 7 months ago

tebjan commented 7 months ago

Describe the bug The type constraint unmanaged prevents arbitrary shader-type compositions.

Which version are you experiencing the bug with? 5.3-preview334

Is there an earlier version where this still works? 5.2

To Reproduce Steps to reproduce the behavior: build a shader graph with a custom shader type, not using known types, like ComputeFloat4 etc.

shader CustomShaderNode_ShaderFX : CustomShaderType
{

};

shader CustomShaderNodeConsumer_ShaderFX : CustomShaderType
{
    compose CustomShaderType MyCostomUpstreamShader;
};

Expected behavior Shader graph works as before, arbitrary shader types can be composed, not only known ones.

Screenshots

image
azeno commented 7 months ago

Thanks, this was not intended of course. Reverted most of that commit except the part which adds the constraint to the T -> Gpu<T> implicit linking.

tebjan commented 7 months ago

There would also be the fix that would change the helper type VoidOrUnknown to struct, I've done that temporarily to get it working. I didn't check whether the HLSL return types must always be blittable types. I never tried to return Texture or Buffer from a HLSL method. If it doesn't work to return resources/objects the managed constraint would probably be ok.