我做了一個樣本JNI android應用程序。Adreno220 framebuffer對象
它在Galaxy Note(Mali 400MP)上運行良好,但不適用於SGS2LTE(Adreno 220)。
我認爲它在製作FBO的問題。
CPP代碼如下
// Create Depth Buffer;
GL_CMD(glGenFramebuffers(1, &m_depthBuffer))
GL_CMD(glBindRenderbuffer(GL_RENDERBUFFER, m_depthBuffer))
GL_CMD(glRenderbufferStorage(GL_RENDERBUFFER, GL_DEPTH_COMPONENT16, m_width, m_height))
GL_CMD(glBindRenderbuffer(GL_RENDERBUFFER, 0))
// Create Stencil Buffer;
GL_CMD(glGenFramebuffers(1, &m_stencilBuffer))
GL_CMD(glBindRenderbuffer(GL_RENDERBUFFER, m_stencilBuffer))
GL_CMD(glRenderbufferStorage(GL_RENDERBUFFER, GL_STENCIL_INDEX8, m_width, m_height))
GL_CMD(glBindRenderbuffer(GL_RENDERBUFFER, 0))
// Construct FBO
GL_CMD(glGenFramebuffers(1, &m_fbo))
GL_CMD(glBindFramebuffer(GL_FRAMEBUFFER, m_fbo))
GL_CMD(glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, textureId, 0))
GL_CMD(glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_RENDERBUFFER, m_depthBuffer))
GL_CMD(glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_STENCIL_ATTACHMENT, GL_RENDERBUFFER, m_stencilBuffer))
GLenum status = glCheckFramebufferStatus(GL_FRAMEBUFFER);
if (status != GL_FRAMEBUFFER_COMPLETE) {
LOGE("Check Frame Buffer Status Failed : %x", status);
return;
}
GL_CMD(glClear(GL_STENCIL_BUFFER_BIT | GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT))
狀態表示0x8CDD(GL_FRAMEBUFFER_UNSUPPORTED_EXT)。
我附上了Logcat。
01-03 03:59:32.829: D/libEGL(24851): loaded /system/lib/egl/libGLES_android.so
01-03 03:59:32.829: D/libEGL(24851): loaded /system/lib/egl/libEGL_adreno200.so
01-03 03:59:32.839: D/libEGL(24851): loaded /system/lib/egl/libGLESv1_CM_adreno200.so
01-03 03:59:32.839: D/libEGL(24851): loaded /system/lib/egl/libGLESv2_adreno200.so
01-03 03:59:32.849: W/EglHelper(24851): createContext [email protected] tid=1
01-03 03:59:32.869: D/Surface(24851): Surface is full screen
01-03 03:59:32.899: D/Surface(24851): Surface is full screen
01-03 03:59:32.899: W/EglHelper(24851): start() tid=1
01-03 03:59:32.909: W/EglHelper(24851): createContext [email protected] tid=1
01-03 03:59:32.909: W/EglHelper(24851): createSurface() tid=1
01-03 03:59:32.939: D/dalvikvm(24851): Note: class Landroid/opengl/GLWrapperBase; has 211 unimplemented (abstract) methods
01-03 03:59:32.939: I/EGLUtils(24851): GL Version = OpenGL ES 2.0 1566933
01-03 03:59:32.939: I/EGLUtils(24851): GL Vendor = Qualcomm
01-03 03:59:32.949: I/EGLUtils(24851): GL Renderer = Adreno (TM) 220
01-03 03:59:32.949: I/EGLUtils(24851): GL Extensions = GL_AMD_compressed_ATC_texture GL_AMD_performance_monitor GL_AMD_program_binary_Z400 GL_EXT_texture_filter_anisotropic GL_EXT_texture_format_BGRA8888 GL_EXT_texture_type_2_10_10_10_REV GL_NV_fence GL_OES_compressed_ETC1_RGB8_texture GL_OES_depth_texture GL_OES_depth24 GL_OES_EGL_image GL_OES_EGL_image_external GL_OES_element_index_uint GL_OES_fbo_render_mipmap GL_OES_fragment_precision_high GL_OES_get_program_binary GL_OES_packed_depth_stencil GL_OES_rgb8_rgba8 GL_OES_standard_derivatives GL_OES_texture_3D GL_OES_texture_float GL_OES_texture_half_float GL_OES_texture_half_float_linear GL_OES_texture_npot GL_OES_vertex_half_float GL_OES_vertex_type_10_10_10_2 GL_QCOM_alpha_test GL_QCOM_binning_control GL_QCOM_driver_control GL_QCOM_perfmon_global_mode GL_QCOM_extended_get GL_QCOM_extended_get2 GL_QCOM_tiled_rendering GL_QCOM_writeonly_rendering GL_QCOM_memory_monitor GL_AMD_compressed_3DC_texture
01-03 03:59:32.979: I/GLUtils(24851): EGL Extensions : EGL_KHR_image EGL_KHR_image_base EGL_KHR_image_pixmap EGL_ANDROID_image_native_buffer EGL_ANDROID_swap_rectangle EGL_ANDROID_get_render_buffer
01-03 03:59:32.989: I/GLUtils(24851): GL Extensions : GL_AMD_compressed_ATC_texture GL_AMD_performance_monitor GL_AMD_program_binary_Z400 GL_EXT_texture_filter_anisotropic GL_EXT_texture_format_BGRA8888 GL_EXT_texture_type_2_10_10_10_REV GL_NV_fence GL_OES_compressed_ETC1_RGB8_texture GL_OES_depth_texture GL_OES_depth24 GL_OES_EGL_image GL_OES_EGL_image_external GL_OES_element_index_uint GL_OES_fbo_render_mipmap GL_OES_fragment_precision_high GL_OES_get_program_binary GL_OES_packed_depth_stencil GL_OES_rgb8_rgba8 GL_OES_standard_derivatives GL_OES_texture_3D GL_OES_texture_float GL_OES_texture_half_float GL_OES_texture_half_float_linear GL_OES_texture_npot GL_OES_vertex_half_float GL_OES_vertex_type_10_10_10_2 GL_QCOM_alpha_test GL_QCOM_binning_control GL_QCOM_driver_control GL_QCOM_perfmon_global_mode GL_QCOM_extended_get GL_QCOM_extended_get2 GL_QCOM_tiled_rendering GL_QCOM_writeonly_rendering GL_QCOM_memory_monitor GL_AMD_compressed_3DC_texture
01-03 03:59:32.989: I/SharedTexture(24851): imageEGL: 0 syncKHR: 0
01-03 03:59:33.009: D/CLIPBOARD(24851): Hide Clipboard dialog at Starting input: finished by someone else... !
**01-03 03:59:33.039: E/AGRE(24851): Check Frame Buffer Status Failed : 8cdd**
它如何在Adreno 220上工作?