Matteo Bruni (@Mystral) commented about dlls/d3dcompiler_43/tests/hlsl_d3d9.c:
- if (ps_code)
- {
hr = pD3DXGetShaderConstantTable(ID3D10Blob_GetBufferPointer(ps_code), &constants);
ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr);
hr = ID3DXConstantTable_SetMatrix(constants, device, "r", &matrix);
ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr);
hr = ID3DXConstantTable_SetMatrix(constants, device, "c", &matrix);
ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr);
ID3DXConstantTable_Release(constants);
h = ID3DXConstantTable_GetConstantByName(constants, NULL, "m1");
ok(!!h, "Failed to find a constant.\n");
count = 1;
hr = ID3DXConstantTable_GetConstantDesc(constants, h, &desc, &count);
ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr);
hr = IDirect3DDevice9_SetPixelShaderConstantF(test_context.device, desc.RegisterIndex,
data, desc.RegisterCount);
It might make sense to add a comment somewhere explaining why we're using SetPixelShaderCosntantF() instead of SetMatrix() and discouraging attempts to revert the change at some point in the future...