@@ -3801,14 +3801,22 @@ void Direct3DDevice9Ex_LSS<EnableSync>::initImplicitSwapchain(const D3DPRESENT_P
3801
3801
template <bool EnableSync>
3802
3802
void Direct3DDevice9Ex_LSS<EnableSync>::initImplicitRenderTarget () {
3803
3803
IDirect3DSurface9* pRenderTarget = nullptr ;
3804
- CreateRenderTarget (GET_PRES_PARAM ().BackBufferWidth ,
3805
- GET_PRES_PARAM ().BackBufferHeight ,
3806
- GET_PRES_PARAM ().BackBufferFormat ,
3807
- GET_PRES_PARAM ().MultiSampleType ,
3808
- GET_PRES_PARAM ().MultiSampleQuality ,
3809
- false ,
3810
- &pRenderTarget,
3811
- nullptr );
3804
+
3805
+ // Creating a place-holder surface
3806
+ D3DSURFACE_DESC desc;
3807
+ desc.Width = GET_PRES_PARAM ().BackBufferWidth ;
3808
+ desc.Height = GET_PRES_PARAM ().BackBufferHeight ;
3809
+ desc.Format = GET_PRES_PARAM ().BackBufferFormat ;
3810
+ desc.MultiSampleType = GET_PRES_PARAM ().MultiSampleType ;
3811
+ desc.MultiSampleQuality = GET_PRES_PARAM ().MultiSampleQuality ;
3812
+ desc.Usage = D3DUSAGE_RENDERTARGET;
3813
+ desc.Pool = D3DPOOL_DEFAULT;
3814
+ desc.Type = D3DRTYPE_SURFACE;
3815
+
3816
+ // Insert our own IDirect3DSurface9 interface implementation
3817
+ Direct3DSurface9_LSS* pLssSurface = trackWrapper (new Direct3DSurface9_LSS (this , desc));
3818
+ pRenderTarget = (IDirect3DSurface9*) pLssSurface;
3819
+
3812
3820
m_pImplicitRenderTarget = bridge_cast<Direct3DSurface9_LSS*>(pRenderTarget);
3813
3821
{
3814
3822
ClientMessage c (Commands::IDirect3DDevice9Ex_LinkBackBuffer, getId ());
@@ -3822,14 +3830,21 @@ template<bool EnableSync>
3822
3830
void Direct3DDevice9Ex_LSS<EnableSync>::initImplicitDepthStencil () {
3823
3831
assert (GET_PRES_PARAM ().EnableAutoDepthStencil );
3824
3832
IDirect3DSurface9* pShadowDepthBuffer = nullptr ;
3825
- CreateDepthStencilSurface (GET_PRES_PARAM ().BackBufferWidth ,
3826
- GET_PRES_PARAM ().BackBufferHeight ,
3827
- GET_PRES_PARAM ().AutoDepthStencilFormat ,
3828
- GET_PRES_PARAM ().MultiSampleType ,
3829
- GET_PRES_PARAM ().MultiSampleQuality ,
3830
- false ,
3831
- &pShadowDepthBuffer,
3832
- nullptr );
3833
+
3834
+ // Creating a place-holder surface
3835
+ D3DSURFACE_DESC desc;
3836
+ desc.Width = GET_PRES_PARAM ().BackBufferWidth ;
3837
+ desc.Height = GET_PRES_PARAM ().BackBufferHeight ;
3838
+ desc.Format = GET_PRES_PARAM ().AutoDepthStencilFormat ;
3839
+ desc.MultiSampleType = GET_PRES_PARAM ().MultiSampleType ;
3840
+ desc.MultiSampleQuality = GET_PRES_PARAM ().MultiSampleQuality ;
3841
+ desc.Usage = D3DUSAGE_DEPTHSTENCIL;
3842
+ desc.Pool = D3DPOOL_DEFAULT;
3843
+ desc.Type = D3DRTYPE_SURFACE;
3844
+
3845
+ Direct3DSurface9_LSS* pLssSurface = trackWrapper (new Direct3DSurface9_LSS (this , desc));
3846
+ pShadowDepthBuffer = (IDirect3DSurface9*) pLssSurface;
3847
+
3833
3848
m_pImplicitDepthStencil = bridge_cast<Direct3DSurface9_LSS*>(pShadowDepthBuffer);
3834
3849
{
3835
3850
ClientMessage c (Commands::IDirect3DDevice9Ex_LinkAutoDepthStencil, getId ());
0 commit comments