Using SharpDX - trying to use precompiled Shader bytes held by ShaderBytes as:
public byte[] spriteVSBytes = { ... tons of numbers ... }
Tried compiled shader bytes for versions: 2, 3, 4/4 lev 9_1 (not 5 yet) - compiled with fxc.exe and all these work in my DX11 c++ version
VS = new VertexShader(dev, shaderData.SpriteVSBytes); // <-- says SpriteVSBytes is invalid.
[source]
// GET DEFAULT SHADERS (from pre-compiled) - create vertex layout
ShaderBytes shaderData = new ShaderBytes(); // an object I made which holds precompiled shader bytes
ShaderSignature signature = new ShaderSignature(shaderData.SpriteVSBytes);
VS = new VertexShader(dev, shaderData.SpriteVSBytes);
PS = new PixelShader(dev, shaderData.SpritePSBytes);
var elements = new[] {
new InputElement(name: "SV_Position", index: 0, format: Format.R32G32B32_Float, offset: InputElement.AppendAligned, slot: 0, slotClass: InputClassification.PerVertexData, stepRate: 0),
new InputElement(name: "COLOR0", index: 0, format: Format.R32G32B32A32_Float, offset: InputElement.AppendAligned, slot: 0, slotClass: InputClassification.PerVertexData, stepRate: 0),
new InputElement(name: "TEXCOORD0", index: 0, format: Format.R32G32_Float, offset: InputElement.AppendAligned, slot: 0, slotClass: InputClassification.PerInstanceData, stepRate: 0),
};
vertLayout = new InputLayout(dev, signature, elements);
[/source]
An unhandled exception of type 'SharpDX.SharpDXException' occurred in SharpDX.dll
Additional information: HRESULT: [0x80070057], Module: [General], ApiCode: [E_INVALIDARG/Invalid Arguments], Message: The parameter is incorrect.
... but the parameter should be correct. (O_O)
Honestly I want to like SharpDX but with lack of documentation and headache after headache, I'm almost ready the throw in the towel on making a SharpDX version.