XShaderCompiler icon indicating copy to clipboard operation
XShaderCompiler copied to clipboard

Regression: conversion of Half4x3

Open cybik opened this issue 7 years ago • 1 comments

Before, half4x3 name = {name2[0*2 + 1], name2[1*2 + 1], name2[2*2 + 1], name2[3*2 + 1]}; was translated to mat4x3 name = mat4x3(name2[0 * 2 + 1], name2[1 * 2 + 1], name2[2 * 2 + 1], name2[3 * 2 + 1]);

Now it translates to

context error (somefile.psh:109:22) : invalid number of elements in initializer expression for type 'half4x3' (expected 12, but got 4)
	half4x3 name = {name2[0*2 + 1], name2[1*2 + 1], name2[2*2 + 1], name2[3*2 + 1]};
                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
analyzing input code failed
compilation failed

cybik avatar Mar 23 '17 02:03 cybik

Ah yes, the analysis of initializers is still incomplete. I'll fix this ~~next week~~. For now, initializers that are used to initialize variables of basic types (which are scalar, vector, and matrix) can only initialize them with scalar values, i.e. a 4x3 matrix needs an initializer with 4*3=12 elements.

LukasBanana avatar Mar 23 '17 09:03 LukasBanana