On Wed, Dec 17, 2008 at 10:51 AM, Henri Verbeet hverbeet@gmail.com wrote:
2008/12/17 Pauli Nieminen suokkos@gmail.com:
+static inline void test_create_vshader_version_check(IDirect3DDevice9
*device_ptr, const D3DCAPS9 *caps,
const DWORD version, const DWORD *shader_code)
+{
- IDirect3DVertexShader9 *vshader_ptr = 0;
- HRESULT hret = 0;
- hret = IDirect3DDevice9_CreateVertexShader(device_ptr, shader_code,
&vshader_ptr);
- if( version <= caps->VertexShaderVersion )
- {
ok(hret == D3D_OK && vshader_ptr != NULL, "Vertex shader (0x%x)
creation failed but d3dcaps claim to support it. hret = 0x%x, vshader_ptr = %p", version, hret, vshader_ptr);
- } else {
ok(hret == D3DERR_INVALIDCALL && vshader_ptr == NULL,"Vertex
shader (0x%x) creation succesed but d3dcaps claim not to support it. hret = 0x%x, vshader_ptr = %p", version, hret, vshader_ptr);
- }
+}
If creation succeeds, you need to Release the shader again. Same goes for the pixel shader version of this function.
I tried to search for example of releasing shaders from the test file but when I couldn't find any. Should others test in that file also include shader release?
Thanks for comments.