Thursday, October 13, 2022
HomeGame Developmenthlsl - error X4532 Can not map expression to gs_5_0 instruction set

hlsl – error X4532 Can not map expression to gs_5_0 instruction set


Utilizing DX11 I’ve this line beginning with TC = txDiffuse in a geometry shader that generates the error message. Can somebody clarify me the issue or if it’s not attainable to pattern in geometry shader (gs_5 mannequin).

 [maxvertexcount(6)]
 void GS_Deferred( triangle GS_INPUT enter[3], inout TriangleStream<PS_DEFERRED> CubeMapStream )
 {
     PS_DEFERRED output;
     for( int f = 0; f < 2; ++f )
     {
         output.RTIndex = f;
         for( int v = 0; v < 3; v++ )
         {
             GS_INPUT I = enter[v];
             if ( f==0 )
             {
                 float3 TC = float3(1,1,1);;
    ------>      TC = txDiffuse.SampleLevel(samLinear, I.Tex, 0);//identical with Pattern()
                 output.Colour = float4(I.Col.rgb*TC, 1);
             }
             if ( f==1 )
             {
                float3 NBump = I.Norm;
                if ( Flag & BUMPNORM )
                {
                    float3x3 BTNMatrix = float3x3(I.BiN,  I.Tan, I.Norm);
                    NBump = normalize(mul(txNormal.Pattern(samPoint, I.Tex).rgb*2 - 1,BTNMatrix));
                }
                output.Colour = float4(NBump*0.5+0.5,1);
             }
             output.Pos = I.Pos;
             CubeMapStream.Append( output );
          }
          CubeMapStream.RestartStrip();
      }
  }

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -
Google search engine

Most Popular

Recent Comments