tgjones / HlslTools

A Visual Studio extension that provides enhanced support for editing High Level Shading Language (HLSL) files
http://timjones.io/blog/archive/2016/04/25/hlsl-tools-for-visual-studio-v1.0-released
Other
553 stars 95 forks source link

`const` inside of a C style cast seen as invalid expression term. #262

Open zxz41 opened 6 months ago

zxz41 commented 6 months ago

I'm currently working on some pre-existing shaders running on ps_3_0 and lower. Which are known to compile on Microsoft (R) Direct3D Shader Compiler 10.1

Currently I'm experiencing an issue where a C style cast containing const is causing the extension to throw errors saying:

Severity    Code        Description
Error       HLSL0022    Invalid expression term 'const'.    
Error       HLSL0009    Found 'const' but expected '<identifier>'.  
Error       HLSL0009    Found 'const' but expected ')'. 
Error       HLSL0009    Found 'const' but expected ')'. 
Error       HLSL0009    Found 'const' but expected ';'.
...

This is the line throwing the error.

worldNormal = mul3x3( modelNormal, ( const float3x3 )cModel[0] );