mojoshader icon indicating copy to clipboard operation
mojoshader copied to clipboard

[Effects] Struct parameters with nested structs

Open flibitijibibo opened this issue 6 years ago • 2 comments

Issue migrated from https://github.com/FNA-XNA/FNA/issues/255

CC @kg

flibitijibibo avatar May 21 '19 19:05 flibitijibibo

This fixes the matrix assertion failure found in SquaredBitmapShader, but the memory layout may be incorrect:

diff -r 3e07483a681c mojoshader_effects.c
--- a/mojoshader_effects.c      Sat Apr 27 17:03:28 2019 -0400
+++ b/mojoshader_effects.c      Tue May 21 15:33:12 2019 -0400
@@ -373,7 +373,7 @@
 
             // !!! FIXME: Nested structs! -flibit
             assert(mem->info.parameter_class >= MOJOSHADER_SYMCLASS_SCALAR
-                && mem->info.parameter_class <= MOJOSHADER_SYMCLASS_VECTOR);
+                && mem->info.parameter_class <= MOJOSHADER_SYMCLASS_MATRIX_COLUMNS);
             assert(mem->info.parameter_type >= MOJOSHADER_SYMTYPE_BOOL
                 && mem->info.parameter_type <= MOJOSHADER_SYMTYPE_FLOAT);
             mem->info.member_count = 0;

flibitijibibo avatar May 21 '19 19:05 flibitijibibo

The matrices are indeed laid out properly, so nested structs are what's left. Good luck to anyone who actually needs that...

flibitijibibo avatar May 27 '19 07:05 flibitijibibo