Unable to pass shader parameters

Started by
2 comments, last by Demirug 18 years, 1 month ago
Hi guys ! We're having a really strange situation running our app on a VAIO computer. It seems we fail to pass shader parameters, although it works fine on other plaforms. When I call ID3DXConstantTable->GetConstantByName , I recieve an invalid handle. Even wierded, I've tried to re-get the constant table from the shader buffer and DirectX debug outputs "D3DX: Unrecognised shader version" I've ran countless of other apps using shaders & constants and they all worked fine so I can't understand why it would fail in out particular case. Is there anybody with a clue as for in which direction to look for ? Thanks Marc
Advertisement
You should use the DirectX Caps Viewer to check if the notebook supports the required shader version. If it didn’t you should improve your hardware checkup at the start of your app.

In the other case do you use precompiled or HLSL shaders?
Yes, the notebook supports pixelshaders 2.0.. so I don't think the problem is there... the shaders actually run.. but they are all running with parameters set to zero.

We compile the shaders on the fly using:

===============
hr = D3DXCompileShader(shader_source_string.c_str(), shader_source_string.size(), NULL, NULL, "main", profile_, D3DXSHADER_DEBUG, &buffer_, &compilationResultBuffer_, &constants_); assert(hr == S_OK);
================

and the try to acquire the variable name using:

===============
handle = constants_->GetConstantByName(NULL, constant->name.c_str());
===============

Thanks for the reply !
Marc
Have you try to disassemble the shader with D3DXDisassembleShader? Normally it contains a list with all constant values as a comment.

This topic is closed to new replies.

Advertisement