【问题标题】:X3501 'main entrypoint not found'X3501 '未找到主入口点'
【发布时间】:2017-10-29 23:41:25
【问题描述】:

我很难为我正在完成的 Direct X 11 教程编译一些着色器。

出于某种原因,即使我明确更改了“入口点名称”,我仍然会收到此消息。 X3501 '找不到主入口点'

我希望能够在构建时而不是运行时编译着色器。

这是我的顶点着色器的 hlsl 属性的屏幕截图:

这是顶点着色器代码:

 cbuffer cbPerObject : register(b0)
 {
     float4x4 gWorldViewProj; 
 };

 struct VertexIn
 {
     float3 PosL  : SV_POSITION;
     float4 Color : COLOR;
 };

 struct VertexOut
 {
     float4 PosH  : SV_POSITION;
     float4 Color : COLOR;
 };

 VertexOut VS(VertexIn vin)
 {
     VertexOut vout;

     // Transform to homogeneous clip space.
     vout.PosH = mul(float4(vin.PosL, 1.0f), gWorldViewProj);

     // Just pass vertex color into the pixel shader.
     vout.Color = vin.Color;

     return vout;
 }

任何帮助将不胜感激。谢谢!

编辑:

我的像素着色器也有类似的设置

【问题讨论】:

    标签: visual-studio game-engine directx-11 hlsl


    【解决方案1】:

    您应该选择“所有配置”和“所有平台”。否则,您只是为 Debug/x64 正确设置它。

    【讨论】:

    • 这仍然不起作用。我将我的 Visual Studio 更新到 2017 版本,现在着色器似乎正在工作。感谢查克的帮助。
    【解决方案2】:

    只是从你的项目中删除 hlsl 文件而不是删除。Visual Studio 不应该编译 hlsl 文件。主入口点无关紧要,所以编辑入口点的名称是无用的。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2015-03-10
      • 2012-09-15
      • 1970-01-01
      • 2012-09-04
      • 2016-03-28
      • 2020-05-23
      • 1970-01-01
      相关资源
      最近更新 更多