@@ -21,6 +21,7 @@ void CRenderTarget::u_setrt(const ref_rt& _1, const ref_rt& _2, const ref_rt& _3
2121 dwHeight = _1->dwHeight ;
2222 GLuint cnt = 0 ;
2323 GLenum buffers[3 ] = { GL_NONE };
24+ RCache.set_FB (HW.pFB );
2425 if (_1)
2526 {
2627 buffers[cnt++] = GL_COLOR_ATTACHMENT0;
@@ -50,6 +51,7 @@ void CRenderTarget::u_setrt(const ref_rt& _1, const ref_rt& _2, GLuint zb)
5051 dwHeight = _1->dwHeight ;
5152 GLuint cnt = 0 ;
5253 GLenum buffers[2 ] = { GL_NONE };
54+ RCache.set_FB (HW.pFB );
5355 if (_1)
5456 {
5557 buffers[cnt++] = GL_COLOR_ATTACHMENT0;
@@ -73,20 +75,24 @@ void CRenderTarget::u_setrt(u32 W, u32 H, GLuint _1, GLuint _2, GLuint _3, GLuin
7375 dwHeight = H;
7476 GLuint cnt = 0 ;
7577 GLenum buffers[3 ] = { GL_NONE };
76- if (_1 == HW.pBaseRT ) buffers[cnt++] = GL_BACK;
77- else if (_1)
78+ if (_1 == HW.pBaseRT )
79+ {
80+ RCache.set_FB ();
81+ return ;
82+ }
83+
84+ RCache.set_FB (HW.pFB );
85+ if (_1)
7886 {
7987 buffers[cnt++] = GL_COLOR_ATTACHMENT0;
8088 RCache.set_RT (_1, 0 );
8189 }
82- if (_2 == HW.pBaseRT ) buffers[cnt++] = GL_BACK;
83- else if (_2)
90+ if (_2)
8491 {
8592 buffers[cnt++] = GL_COLOR_ATTACHMENT1;
8693 RCache.set_RT (_2, 1 );
8794 }
88- if (_3 == HW.pBaseRT ) buffers[cnt++] = GL_BACK;
89- else if (_3)
95+ if (_3)
9096 {
9197 buffers[cnt++] = GL_COLOR_ATTACHMENT2;
9298 RCache.set_RT (_3, 2 );
@@ -815,7 +821,7 @@ CRenderTarget::CRenderTarget ()
815821 // Autogen mipmaps
816822 glGenTextures (1 , &t_noise_surf_mipped);
817823 CHK_GL (glBindTexture (GL_TEXTURE_2D, t_noise_surf_mipped));
818- CHK_GL (glTexStorage2D (GL_TEXTURE_2D, 0 , GL_RGBA8, TEX_jitter, TEX_jitter));
824+ CHK_GL (glTexStorage2D (GL_TEXTURE_2D, 1 , GL_RGBA8, TEX_jitter, TEX_jitter));
819825 t_noise_mipped = RImplementation.Resources ->_CreateTexture (r2_jitter_mipped);
820826 t_noise_mipped->surface_set (GL_TEXTURE_2D, t_noise_surf_mipped);
821827
0 commit comments