Revert "(360) FBO changes"

This reverts commit 77b4b76db480537112cd2f1e06a3f7ec964f4a03.
This commit is contained in:
Twinaphex 2012-04-19 15:59:07 +02:00
parent 808a7cee4a
commit 3492d89147

View File

@ -515,21 +515,20 @@ static bool xdk360_gfx_frame(void *data, const void *frame,
if (vid->last_width != width || vid->last_height != height)
{
D3DLOCKED_RECT d3dlr;
float tex_w, tex_h;
vid->lpTexture->LockRect(0, &d3dlr, NULL, D3DLOCK_NOSYSLOCK);
memset(d3dlr.pBits, 0, 512 * d3dlr.Pitch);
vid->lpTexture->UnlockRect(0);
if(vid->fbo_inited)
ifdef(vid->fbo_inited)
{
tex_w = width / (512.0f * g_settings.video.fbo_scale_x);
tex_h = height / (512.0f * g_settings.video.fbo_scale_y);
float tex_w = width / (512.0f * g_settings.video.fbo_scale_x);
float tex_h = height / (512.0f * g_settings.video.fbo_scale_y);
}
else
{
tex_w = width / (512.0f);
tex_h = height / (512.0f);
float tex_w = width / (512.0f);
float tex_h = height / (512.0f);
}
const DrawVerticeFormats verts[] = {
@ -563,22 +562,6 @@ static bool xdk360_gfx_frame(void *data, const void *frame,
{
vid->d3d_render_device->Resolve( D3DRESOLVE_RENDERTARGET0, NULL, vid->lpTexture,
NULL, 0, 0, NULL, 0, 0, NULL );
hlsl_use(0);
hlsl_set_params(width, height, 512 * g_settings.video.fbo_scale_x, 512 * g_settings.video.fbo_scale_y, vid->d3dpp.BackBufferWidth,
vid->d3dpp.BackBufferHeight, g_frame_count);
vid->d3d_render_device->SetTexture(0, NULL);
D3DLOCKED_RECT d3dlr;
vid->lpTexture->LockRect(0, &d3dlr, NULL, D3DLOCK_NOSYSLOCK);
for (unsigned y = 0; y < height; y++)
{
const uint8_t *in = (const uint8_t*)frame + y * pitch;
uint8_t *out = (uint8_t*)d3dlr.pBits + y * d3dlr.Pitch;
memcpy(out, in, width * sizeof(uint16_t));
}
vid->lpTexture->UnlockRect(0);
// Set the render target back to the back buffer
vid->d3d_render_device->SetRenderTarget( 0, pRenderTarget0 );
@ -588,6 +571,22 @@ static bool xdk360_gfx_frame(void *data, const void *frame,
vid->d3d_render_device->Clear(0, NULL, D3DCLEAR_TARGET,
0xff000000, 1.0f, 0);
hlsl_use(0);
hlsl_set_params(width, height, 512 * g_settings.video.fbo_scale_x, 512 * g_settings.video.fbo_scale_y, vid->d3dpp.BackBufferWidth,
vid->d3dpp.BackBufferHeight, g_frame_count);
vid->d3d_render_device->SetTexture(0, NULL);
D3DLOCKED_RECT d3dlr;
vid->lpTexture->LockRect(0, &d3dlr, NULL, D3DLOCK_NOSYSLOCK);
for (unsigned y = 0; y < height; y++)
{
const uint8_t *in = (const uint8_t*)frame + y * pitch;
uint8_t *out = (uint8_t*)d3dlr.pBits + y * d3dlr.Pitch;
memcpy(out, in, width * sizeof(uint16_t));
}
vid->lpTexture->UnlockRect(0);
vid->d3d_render_device->SetTexture(0, vid->lpTexture);
vid->d3d_render_device->SetSamplerState(0, D3DSAMP_MINFILTER, g_settings.video.smooth ? D3DTEXF_LINEAR : D3DTEXF_POINT);
vid->d3d_render_device->SetSamplerState(0, D3DSAMP_MAGFILTER, g_settings.video.smooth ? D3DTEXF_LINEAR : D3DTEXF_POINT);