Changes for OpenGL plugin:
- Render targets should not have an alpha channel - Use correct source rectangle for render-to-texture effects - Use "GL_INTENSITY8" instead of just "GL_INTENSITY" (makes no difference) The background of the "Stage Clear" screen in SSBM is now fixed! git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@3502 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
parent
edf58e1478
commit
4292962ea2
|
@ -330,7 +330,7 @@ bool Renderer::Init()
|
||||||
glGenTextures(1, (GLuint *)&s_RenderTarget);
|
glGenTextures(1, (GLuint *)&s_RenderTarget);
|
||||||
glBindTexture(GL_TEXTURE_RECTANGLE_ARB, s_RenderTarget);
|
glBindTexture(GL_TEXTURE_RECTANGLE_ARB, s_RenderTarget);
|
||||||
// Create our main color render target as a texture rectangle of the desired size.
|
// Create our main color render target as a texture rectangle of the desired size.
|
||||||
glTexImage2D(GL_TEXTURE_RECTANGLE_ARB, 0, 4, s_targetwidth, s_targetheight, 0, GL_RGBA, GL_UNSIGNED_BYTE, NULL);
|
glTexImage2D(GL_TEXTURE_RECTANGLE_ARB, 0, 3, s_targetwidth, s_targetheight, 0, GL_RGB, GL_UNSIGNED_BYTE, NULL);
|
||||||
SetDefaultRectTexParams();
|
SetDefaultRectTexParams();
|
||||||
|
|
||||||
// Create the depth target texture
|
// Create the depth target texture
|
||||||
|
@ -370,9 +370,9 @@ bool Renderer::Init()
|
||||||
glGenRenderbuffersEXT(1, &s_RenderTarget);
|
glGenRenderbuffersEXT(1, &s_RenderTarget);
|
||||||
glBindRenderbufferEXT(GL_RENDERBUFFER_EXT, s_RenderTarget);
|
glBindRenderbufferEXT(GL_RENDERBUFFER_EXT, s_RenderTarget);
|
||||||
if (s_MSAACoverageSamples) {
|
if (s_MSAACoverageSamples) {
|
||||||
glRenderbufferStorageMultisampleCoverageNV(GL_RENDERBUFFER_EXT, s_MSAACoverageSamples, s_MSAASamples, GL_RGBA, s_targetwidth, s_targetheight);
|
glRenderbufferStorageMultisampleCoverageNV(GL_RENDERBUFFER_EXT, s_MSAACoverageSamples, s_MSAASamples, GL_RGB, s_targetwidth, s_targetheight);
|
||||||
} else {
|
} else {
|
||||||
glRenderbufferStorageMultisampleEXT(GL_RENDERBUFFER_EXT, s_MSAASamples, GL_RGBA, s_targetwidth, s_targetheight);
|
glRenderbufferStorageMultisampleEXT(GL_RENDERBUFFER_EXT, s_MSAASamples, GL_RGB, s_targetwidth, s_targetheight);
|
||||||
}
|
}
|
||||||
glGenRenderbuffersEXT(1, &s_DepthTarget);
|
glGenRenderbuffersEXT(1, &s_DepthTarget);
|
||||||
glBindRenderbufferEXT(GL_RENDERBUFFER_EXT, s_DepthTarget);
|
glBindRenderbufferEXT(GL_RENDERBUFFER_EXT, s_DepthTarget);
|
||||||
|
@ -398,12 +398,12 @@ bool Renderer::Init()
|
||||||
// Generate the resolve targets.
|
// Generate the resolve targets.
|
||||||
glGenTextures(1, (GLuint *)&s_ResolvedRenderTarget);
|
glGenTextures(1, (GLuint *)&s_ResolvedRenderTarget);
|
||||||
glBindTexture(GL_TEXTURE_RECTANGLE_ARB, s_ResolvedRenderTarget);
|
glBindTexture(GL_TEXTURE_RECTANGLE_ARB, s_ResolvedRenderTarget);
|
||||||
glTexImage2D(GL_TEXTURE_RECTANGLE_ARB, 0, 4, s_targetwidth, s_targetheight, 0, GL_RGBA, GL_UNSIGNED_BYTE, NULL);
|
glTexImage2D(GL_TEXTURE_RECTANGLE_ARB, 0, 3, s_targetwidth, s_targetheight, 0, GL_RGB, GL_UNSIGNED_BYTE, NULL);
|
||||||
SetDefaultRectTexParams();
|
SetDefaultRectTexParams();
|
||||||
// Generate the resolve targets.
|
// Generate the resolve targets.
|
||||||
glGenTextures(1, (GLuint *)&s_ResolvedDepthTarget);
|
glGenTextures(1, (GLuint *)&s_ResolvedDepthTarget);
|
||||||
glBindTexture(GL_TEXTURE_RECTANGLE_ARB, s_ResolvedDepthTarget);
|
glBindTexture(GL_TEXTURE_RECTANGLE_ARB, s_ResolvedDepthTarget);
|
||||||
glTexImage2D(GL_TEXTURE_RECTANGLE_ARB, 0, GL_DEPTH_COMPONENT, s_targetwidth, s_targetheight, 0, GL_DEPTH_COMPONENT, GL_UNSIGNED_BYTE, NULL);
|
glTexImage2D(GL_TEXTURE_RECTANGLE_ARB, 0, GL_DEPTH_COMPONENT24, s_targetwidth, s_targetheight, 0, GL_DEPTH_COMPONENT, GL_UNSIGNED_BYTE, NULL);
|
||||||
SetDefaultRectTexParams();
|
SetDefaultRectTexParams();
|
||||||
|
|
||||||
// Attach our resolve targets to our resolved FBO.
|
// Attach our resolve targets to our resolved FBO.
|
||||||
|
|
|
@ -250,7 +250,10 @@ void EncodeToRam(u32 address, bool bFromZBuffer, bool bIsIntensityFmt, u32 copyf
|
||||||
|
|
||||||
u8 *dest_ptr = Memory_GetPtr(address);
|
u8 *dest_ptr = Memory_GetPtr(address);
|
||||||
|
|
||||||
u32 source_texture = bFromZBuffer ? Renderer::ResolveAndGetDepthTarget(source) : Renderer::ResolveAndGetRenderTarget(source);
|
TRectangle scaledTargetSource;
|
||||||
|
source.Scale(Renderer::GetTargetScaleX(), Renderer::GetTargetScaleY(), &scaledTargetSource);
|
||||||
|
|
||||||
|
u32 source_texture = bFromZBuffer ? Renderer::ResolveAndGetDepthTarget(scaledTargetSource) : Renderer::ResolveAndGetRenderTarget(scaledTargetSource);
|
||||||
int width = source.right - source.left;
|
int width = source.right - source.left;
|
||||||
int height = source.bottom - source.top;
|
int height = source.bottom - source.top;
|
||||||
|
|
||||||
|
|
|
@ -417,7 +417,7 @@ TextureMngr::TCacheEntry* TextureMngr::Load(int texstage, u32 address, int width
|
||||||
break;
|
break;
|
||||||
case PC_TEX_FMT_I8:
|
case PC_TEX_FMT_I8:
|
||||||
gl_format = GL_LUMINANCE;
|
gl_format = GL_LUMINANCE;
|
||||||
gl_iformat = GL_INTENSITY;
|
gl_iformat = GL_INTENSITY8;
|
||||||
gl_type = GL_UNSIGNED_BYTE;
|
gl_type = GL_UNSIGNED_BYTE;
|
||||||
break;
|
break;
|
||||||
case PC_TEX_FMT_IA8:
|
case PC_TEX_FMT_IA8:
|
||||||
|
|
Loading…
Reference in New Issue