Jump to content

  • Log In with Google      Sign In   
  • Create Account

[SlimDX] Setting vertex shader constants


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
1 reply to this topic

#1 Johan Gustafsson   GDNet+   -  Reputation: 298

Like
0Likes
Like

Posted 08 September 2009 - 04:27 AM

Hi, I'm trying to set vertex shader constants in SlimDX, but doing so gives me "D3DERR_INVALIDCALL: Invalid call (-2005530516)". Here is my code:
Renderer.Device.VertexShader = shader.VertexShader;
Renderer.Device.PixelShader = shader.PixelShader;

shader.VertexShader.Function.ConstantTable.SetValue(Renderer.Device, new SlimDX.Direct3D9.EffectHandle("worldViewProj"), worldViewProjection);

Is there something else that I have to do?

Sponsor:

#2 Johan Gustafsson   GDNet+   -  Reputation: 298

Like
0Likes
Like

Posted 15 September 2009 - 12:23 AM

Turns out that there was something wrong with my shaders.
I had to do
float4x4 worldViewProj;
float4x4 world;

void main_vs(


instead of
void main_vs(
uniform float4x4 worldViewProj,
uniform float4x4 world,





Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS