mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-10-22 10:49:05 +02:00
Add enable/disable dithering. Respect chosen framebuffer color depth.
This commit is contained in:
1 parent
cb7f803866
commit
b1bbbc44fc
4 files changed
+21
-3
No files matched your search
@@ -376,7 +376,7 @@ void GLES_GPU::SetRenderFrameBuffer() {
|
||||
VirtualFramebuffer *vfb = 0;
|
||||
for (auto iter = vfbs_.begin(); iter != vfbs_.end(); ++iter) {
|
||||
VirtualFramebuffer *v = *iter;
|
||||
if (v->fb_address == fb_address && v->width == drawing_width && v->height == drawing_height) {
|
||||
if (v->fb_address == fb_address && v->width == drawing_width && v->height == drawing_height && v->format == fmt) {
|
||||
// Let's not be so picky for now. Let's say this is the one.
|
||||
vfb = v;
|
||||
// Update fb stride in case it changed
|
||||
@@ -397,10 +397,24 @@ void GLES_GPU::SetRenderFrameBuffer() {
|
||||
vfb->width = drawing_width;
|
||||
vfb->height = drawing_height;
|
||||
vfb->format = fmt;
|
||||
vfb->fbo = fbo_create(vfb->width * renderWidthFactor_, vfb->height * renderHeightFactor_, 1, true);
|
||||
|
||||
//vfb->colorDepth = FBO_8888;
|
||||
switch (gstate.framebufpixformat & 0x3) {
|
||||
case GE_FORMAT_4444: vfb->colorDepth = FBO_4444;
|
||||
case GE_FORMAT_5551: vfb->colorDepth = FBO_5551;
|
||||
case GE_FORMAT_565: vfb->colorDepth = FBO_565;
|
||||
case GE_FORMAT_8888: vfb->colorDepth = FBO_8888;
|
||||
}
|
||||
//#ifdef ANDROID
|
||||
// vfb->colorDepth = FBO_5551;
|
||||
//#endif
|
||||
|
||||
vfb->fbo = fbo_create(vfb->width * renderWidthFactor_, vfb->height * renderHeightFactor_, 1, true, vfb->colorDepth);
|
||||
|
||||
vfb->last_frame_used = gpuStats.numFrames;
|
||||
vfbs_.push_back(vfb);
|
||||
fbo_bind_as_render_target(vfb->fbo);
|
||||
glEnable(GL_DITHER);
|
||||
glstate.viewport.set(0, 0, renderWidth_, renderHeight_);
|
||||
currentRenderVfb_ = vfb;
|
||||
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT);
|
||||
|
||||
@@ -103,6 +103,7 @@ private:
|
||||
int height;
|
||||
|
||||
int format; // virtual, right now they are all RGBA8888
|
||||
FBOColorDepth colorDepth;
|
||||
FBO *fbo;
|
||||
};
|
||||
|
||||
|
||||
@@ -202,6 +202,9 @@ void ApplyDrawState(int prim) {
|
||||
glstate.stencilTest.disable();
|
||||
}
|
||||
|
||||
// Dither
|
||||
glstate.dither.set(gstate.ditherEnable & 1);
|
||||
|
||||
bool wantDepthWrite = gstate.isModeClear() || gstate.isDepthWriteEnabled();
|
||||
glstate.depthWrite.set(wantDepthWrite ? GL_TRUE : GL_FALSE);
|
||||
|
||||
|
||||
+1
-1
Submodule native updated: 464240f703...f315424c42.
Reference in new issue
Block a user