From 6fdc0c110afcc0e2bd6da19ec83ab2f18f746de2 Mon Sep 17 00:00:00 2001 From: Egor Yusov Date: Thu, 4 Jan 2018 22:49:08 -0800 Subject: Added MatrixFromRows() function to shader definitions --- Graphics/GraphicsEngineD3DBase/include/HLSLDefinitions.fxh | 5 +++++ Graphics/GraphicsEngineD3DBase/include/HLSLDefinitions_inc.fxh | 5 +++++ 2 files changed, 10 insertions(+) (limited to 'Graphics/GraphicsEngineD3DBase') diff --git a/Graphics/GraphicsEngineD3DBase/include/HLSLDefinitions.fxh b/Graphics/GraphicsEngineD3DBase/include/HLSLDefinitions.fxh index fd19be08..e5be0b85 100644 --- a/Graphics/GraphicsEngineD3DBase/include/HLSLDefinitions.fxh +++ b/Graphics/GraphicsEngineD3DBase/include/HLSLDefinitions.fxh @@ -58,4 +58,9 @@ float BoolToFloat( bool b ) #define MATRIX_ELEMENT(mat, row, col) mat[row][col] +float4x4 MatrixFromRows(float4 row0, float4 row1, float4 row2, float4 row3) +{ + return float4x4(row0, row1, row2, row3); +} + #endif // _HLSL_DEFINITIONS_ diff --git a/Graphics/GraphicsEngineD3DBase/include/HLSLDefinitions_inc.fxh b/Graphics/GraphicsEngineD3DBase/include/HLSLDefinitions_inc.fxh index 84012ff1..5a441403 100644 --- a/Graphics/GraphicsEngineD3DBase/include/HLSLDefinitions_inc.fxh +++ b/Graphics/GraphicsEngineD3DBase/include/HLSLDefinitions_inc.fxh @@ -58,4 +58,9 @@ "\n" "#define MATRIX_ELEMENT(mat, row, col) mat[row][col]\n" "\n" +"float4x4 MatrixFromRows(float4 row0, float4 row1, float4 row2, float4 row3)\n" +"{\n" +" return float4x4(row0, row1, row2, row3);\n" +"}\n" +"\n" "#endif // _HLSL_DEFINITIONS_\n" -- cgit v1.2.3