Shader_Minifier icon indicating copy to clipboard operation
Shader_Minifier copied to clipboard

Online minifier processes generics incorrectly

Open sagacity opened this issue 9 months ago • 1 comments

When trying this shader with the online shader minifier:

struct MyStruct {
   float3 pos;
};
StructuredBuffer<MyStruct> mySB;

This gets shown as 'original':

struct MyStruct {
   float3 pos;
};
StructuredBuffer mySB;

So it seems to be missing the generic argument.

sagacity avatar Jul 15 '25 14:07 sagacity

Thanks for the report. It's probably a printer bug and should be easy to fix.

From a quick look at the code, this line looks suspicious: https://github.com/laurentlb/shader-minifier/blob/master/Minifier/printer.fs#L186 maybe it should append the .template suffix.

laurentlb avatar Jul 15 '25 15:07 laurentlb