Commit bce3da3a authored by H. Verbeet's avatar H. Verbeet Committed by Alexandre Julliard

wined3d: Store the pixelshader version in the pixelshader object.

parent c4b44245
...@@ -752,8 +752,9 @@ static CONST SHADER_OPCODE pshader_ins [] = { ...@@ -752,8 +752,9 @@ static CONST SHADER_OPCODE pshader_ins [] = {
}; };
inline static const SHADER_OPCODE* pshader_program_get_opcode(const DWORD code, const int version) { inline static const SHADER_OPCODE* pshader_program_get_opcode(IWineD3DPixelShaderImpl *This, const DWORD code) {
DWORD i = 0; DWORD i = 0;
DWORD version = This->version;
DWORD hex_version = D3DPS_VERSION(version/10, version%10); DWORD hex_version = D3DPS_VERSION(version/10, version%10);
/** TODO: use dichotomic search */ /** TODO: use dichotomic search */
while (NULL != pshader_ins[i].name) { while (NULL != pshader_ins[i].name) {
...@@ -764,7 +765,7 @@ inline static const SHADER_OPCODE* pshader_program_get_opcode(const DWORD code, ...@@ -764,7 +765,7 @@ inline static const SHADER_OPCODE* pshader_program_get_opcode(const DWORD code,
} }
++i; ++i;
} }
FIXME("Unsupported opcode %lx(%ld) masked %lx version %d\n", code, code, code & D3DSI_OPCODE_MASK, version); FIXME("Unsupported opcode %lx(%ld) masked %lx version %ld\n", code, code, code & D3DSI_OPCODE_MASK, version);
return NULL; return NULL;
} }
...@@ -1096,7 +1097,7 @@ inline static VOID IWineD3DPixelShaderImpl_GenerateProgramArbHW(IWineD3DPixelSha ...@@ -1096,7 +1097,7 @@ inline static VOID IWineD3DPixelShaderImpl_GenerateProgramArbHW(IWineD3DPixelSha
code = *pToken; code = *pToken;
#endif #endif
pInstr = pToken; pInstr = pToken;
curOpcode = pshader_program_get_opcode(*pToken, version); curOpcode = pshader_program_get_opcode(This, *pToken);
++pToken; ++pToken;
if (NULL == curOpcode) { if (NULL == curOpcode) {
/* unknown current opcode ... (shouldn't be any!) */ /* unknown current opcode ... (shouldn't be any!) */
...@@ -1666,13 +1667,12 @@ HRESULT WINAPI IWineD3DPixelShaderImpl_SetFunction(IWineD3DPixelShader *iface, C ...@@ -1666,13 +1667,12 @@ HRESULT WINAPI IWineD3DPixelShaderImpl_SetFunction(IWineD3DPixelShader *iface, C
const SHADER_OPCODE *curOpcode = NULL; const SHADER_OPCODE *curOpcode = NULL;
DWORD len = 0; DWORD len = 0;
DWORD i; DWORD i;
int version = 0;
TRACE("(%p) : Parsing programme\n", This); TRACE("(%p) : Parsing programme\n", This);
if (NULL != pToken) { if (NULL != pToken) {
while (D3DPS_END() != *pToken) { while (D3DPS_END() != *pToken) {
if (pshader_is_version_token(*pToken)) { /** version */ if (pshader_is_version_token(*pToken)) { /** version */
version = (((*pToken >> 8) & 0x0F) * 10) + (*pToken & 0x0F); This->version = (((*pToken >> 8) & 0x0F) * 10) + (*pToken & 0x0F);
TRACE("ps_%lu_%lu\n", (*pToken >> 8) & 0x0F, (*pToken & 0x0F)); TRACE("ps_%lu_%lu\n", (*pToken >> 8) & 0x0F, (*pToken & 0x0F));
++pToken; ++pToken;
++len; ++len;
...@@ -1686,10 +1686,10 @@ HRESULT WINAPI IWineD3DPixelShaderImpl_SetFunction(IWineD3DPixelShader *iface, C ...@@ -1686,10 +1686,10 @@ HRESULT WINAPI IWineD3DPixelShaderImpl_SetFunction(IWineD3DPixelShader *iface, C
len += comment_len + 1; len += comment_len + 1;
continue; continue;
} }
if (!version) { if (!This->version) {
WARN("(%p) : pixel shader doesn't have a valid version identifier\n", This); WARN("(%p) : pixel shader doesn't have a valid version identifier\n", This);
} }
curOpcode = pshader_program_get_opcode(*pToken, version); curOpcode = pshader_program_get_opcode(This, *pToken);
++pToken; ++pToken;
++len; ++len;
if (NULL == curOpcode) { if (NULL == curOpcode) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment