Yet the application (NFS:MW) page faults right at startup at the address of pDecl + 4 so something's amiss ... maybe this will get fixed automatically in one of the next patches or is due to some other weird thing that affects my sources (eh?) ... as long as no one else complains, lets leave it at this.
Just look again at the SetPixelShader function, this is how it looks in my current GIT (I didn't touch this one) :
3758 /* Handle recording of state blocks */ 3759 if (This->isRecordingState) { 3760 TRACE("Recording... not performing anything\n"); 3761 } 3762 3763 if (NULL != pShader) { 3764 IWineD3DPixelShader_AddRef(pShader); 3765 } 3766 if (NULL != oldShader) { 3767 IWineD3DPixelShader_Release(oldShader); 3768 } 3769 3770 if (This->isRecordingState) { 3771 TRACE("Recording... not performing anything\n"); 3772 return WINED3D_OK; 3773 } 3774 3775 if(pShader == oldShader) { 3776 TRACE("App is setting the old pixel shader over, nothing to do\n"); 3777 return WINED3D_OK; 3778 }
On 04/01/07, Christoph Bumiller e0425955@stud3.tuwien.ac.at wrote:
Yet the application (NFS:MW) page faults right at startup at the address of pDecl + 4 so something's amiss ... maybe this will get fixed automatically in one of the next patches or is due to some other weird thing that affects my sources (eh?) ... as long as no one else complains, lets leave it at this.
Nah, it's correct that the refcounts are broken at the moment. What Stefan probbly meant was that we might as well remove refcounting completely from that fucntion.
Just look again at the SetPixelShader function, this is how it looks in my current GIT (I didn't touch this one) :
3758 /* Handle recording of state blocks */ 3759 if (This->isRecordingState) { 3760 TRACE("Recording... not performing anything\n"); 3761 }
...
3769 3770 if (This->isRecordingState) { 3771 TRACE("Recording... not performing anything\n"); 3772 return WINED3D_OK; 3773 }
That doesn't look quite correct either, actually. One of those two if blocks should go, I'd say the first one.
Zitat von "H. Verbeet" hverbeet@gmail.com:
Nah, it's correct that the refcounts are broken at the moment. What Stefan probbly meant was that we might as well remove refcounting completely from that fucntion.
Then so should the AddRef/Release be removed from the StateBlock's Capture function as well.
If you set p.e. vertex declaration to 0, then you start recording, set vertex declaration to some object (ref still 1), then stop recording and get the stateblock, and then let this block Capture the device stateblock, the refcount of object would be decreased to 0 since the capturing stateblock's value of vertex declaration is &object, the device's is 0, and so stateblock would Release the object it holds.