浏览代码

1. add ppsspp btn
2. fix ppsspp draw error

ZengGengSen 2 年之前
父节点
当前提交
ce6054396a
共有 1 个文件被更改,包括 21 次插入20 次删除
  1. 21 20
      app/src/main/cpp/gfx/drivers/gl2.c

+ 21 - 20
app/src/main/cpp/gfx/drivers/gl2.c

@@ -2632,6 +2632,26 @@ static bool gl2_frame(void *data, const void *frame,
    if (!gl)
       return false;
 
+   /* Have to reset rendering state which libretro core
+    * could easily have overridden. */
+   if (gl->flags & GL2_FLAG_HW_RENDER_FBO_INIT)
+   {
+      gl2_update_input_size(gl, frame_width, frame_height, pitch, false);
+      if (!(gl->flags & GL2_FLAG_FBO_INITED))
+      {
+         gl2_renderchain_bind_backbuffer();
+         gl2_set_viewport(gl, width, height, false, true);
+      }
+
+      gl2_renderchain_restore_default_state(gl);
+
+      glDisable(GL_STENCIL_TEST);
+      glDisable(GL_BLEND);
+      glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
+      glBlendEquation(GL_FUNC_ADD);
+      glClearColor(0.0f, 0.0f, 0.0f, 1.0f);
+   }
+
      glClear(GL_COLOR_BUFFER_BIT);
      gl2_render_background(gl);
 
@@ -2653,6 +2673,7 @@ static bool gl2_frame(void *data, const void *frame,
    /* Render to texture in first pass. */
    if (gl->flags & GL2_FLAG_FBO_INITED)
    {
+      RARCH_LOG("gl->flags & GL2_FLAG_FBO_INITED");
       gl2_renderchain_recompute_pass_sizes(
             gl, chain,
             frame_width, frame_height,
@@ -2748,26 +2769,6 @@ static bool gl2_frame(void *data, const void *frame,
          glGenerateMipmap(GL_TEXTURE_2D);
    }
 
-   /* Have to reset rendering state which libretro core
-    * could easily have overridden. */
-   if (gl->flags & GL2_FLAG_HW_RENDER_FBO_INIT)
-   {
-      gl2_update_input_size(gl, frame_width, frame_height, pitch, false);
-      if (!(gl->flags & GL2_FLAG_FBO_INITED))
-      {
-         gl2_renderchain_bind_backbuffer();
-         gl2_set_viewport(gl, width, height, false, true);
-      }
-
-      gl2_renderchain_restore_default_state(gl);
-
-      glDisable(GL_STENCIL_TEST);
-      glDisable(GL_BLEND);
-      glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
-      glBlendEquation(GL_FUNC_ADD);
-      glClearColor(0.0f, 0.0f, 0.0f, 1.0f);
-   }
-
    gl->tex_info.tex           = gl->texture[gl->tex_index];
    gl->tex_info.input_size[0] = frame_width;
    gl->tex_info.input_size[1] = frame_height;