夏普DX:未找到方法 'get_BufferPointer()'
SharpDX: Method not found 'get_BufferPointer()'
我已经从indiedev的教程中构建了一个简单的SharpDX项目(#1,#2,#3)。
现在我遇到了一个错误方法没有找到'IntPtr SharpDX.D3DCompiler.ShaderBytecode.get_BufferPointer()'当我启动应用程序。
我有一个参考下列SharpDX dll的:
- SharpDX。D3DCompiler
- SharpDX。Direct3D11
- SharpDX。DXGI
- SharpDX
以下代码是主循环:
public void Run()
{
//...
Initialize();
LoadContent();
RenderLoop.Run(renderWindow, () =>
{
//....
}
//...
}
public override void LoadContent()
{
ShaderBytecode vertexShaderByteCode = ShaderBytecode.CompileFromFile("shaders.hlsl", "VShader", "vs_4_0");
ShaderBytecode pixelShaderByteCode = ShaderBytecode.CompileFromFile("shaders.hlsl", "PShader", "ps_4_0");
vertexShader = new VertexShader(Device, vertexShaderByteCode); //--> error
pixelShader = new PixelShader(Device, pixelShaderByteCode);
//...
}
shaders.hlsl:
struct VOut
{
float4 position : SV_POSITION;
float4 color : COLOR;
};
VOut VShader(float4 position : POSITION, float4 color : COLOR)
{
VOut output;
output.position = position;
output.color = color;
return output;
}
float4 PShader(float4 position : SV_POSITION, float4 color : COLOR) : SV_TARGET
{
return color;
}
我要添加什么到着色器。hlsl文件?
此问题是程序集版本较旧的原因。正如Chris Mantle所提到的,它有助于通过NuGet更新到最新版本。你可以从这里取。
这是没有问题的着色器。hlsl文件。
相关文章:
- Cpp-Tuple使用带有变量的get
- 通过 get-Method 访问变量在类外不起作用
- 为什么无论你输入什么,这"while(cin.get(str,3))"只运行一次?
- Boost.Asio/OpenSSL HTTPS GET certificate trouble
- C++中是否有任何函数等同于python中字典的get函数?
- 使用istringstearm和get行缓慢读取文件
- 如何将 c++ get 函数代码转换为 opencv 算法中使用的 python
- 使用 cin.get() 初始化字符数组
- std::variant<>::get() 不能使用 Apple LLVM 10.0 编译
- 编写 cin.get() 以接收字符数组时出现问题
- 作用域枚举和标准::get
- Visual Studio 2017 中的 cpprestapi 问题找不到 POST/GET 常量
- 在 C++/C 中使用 CURL 发出带有数据文件的 GET HTTP 请求
- 使用"push_back"作为带有"get"函数C++的向量
- 使用 cin.get 读取字符数组
- 如何使用 fstream 的 .get 字符串?
- std::get like (partial) template specialization
- 从 unique_ptr::get 发送指针作为指针引用进入函数
- addr2line get 行号始终返回 0
- unique_ptr<T>::get() 返回的指针在原始unique_ptr被销毁后不是 nullptr