How to use owner function in HLSL?


  • I changed HLSL codes in sample "Direct3D tutorial sample\C++\Lesson2.Triangles".

    The new pixel shader is blow:

    struct PixelShaderInput
        float4 pos : SV_POSITION;

    float4 test()
     return float4(1.0f, 1.0f, 0.0f, 1.0f);

    float4 SimplePixelShader(PixelShaderInput input) : SV_TARGET
        // Draw the entire triangle yellow.
        return test();

    The triangle isn't shown, please help. Thanks!

    In Win8 DP, it is good!

    Wednesday, June 6, 2012 10:28 AM

All replies




    We would suggest you to update to WIn8 RP and Visual Studio 2012 RC. There are some bugs fixed in this version.


    Also, there are codes changed in the sample codes



    Best regards,


    Jesse Jiang [MSFT]
    MSDN Community Support | Feedback to us

    Thursday, June 7, 2012 9:18 AM
  • Thanks, Jesse.

    I'm using the Win8 RP and Visual Studio 2012 RC. And I tried on Win8 CP and VS11 beta, it's good, too.

    Are there some issues in FXC of VS2012 RC?

    My VS is Visual Studio Ultimate 2012 RC.

    Friday, June 8, 2012 12:57 AM