2016-12-01 120 views
0

我開發一個Android應用程序與OpenGL ES 2.0的,我想用GL_EXT_shader_framebuffer_fetch擴展如何在Android上啓用OpenGL擴展GL_EXT_shader_framebuffer_fetch?

根據我的理解,我需要先使用我的片段着色器頂部的#extension指令啓用它,然後我可以使用內置變量gl_LastFragData

因此,這裏是我的片段着色器:

#extension GL_EXT_shader_framebuffer_fetch : require 
// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ <- Enable the extension 

varying highp vec2 textureCoords; 
uniform sampler2D currentTexture; 

void main() 
{ 
    vec4 currentColor = texture2D(currentTexture, textureCoords); 
    gl_FragColor = currentColor; 
} 

然而,當我編譯着色器,我得到以下編譯錯誤:

Couldn't compile shader: Fragment shader compilation failed. 
ERROR: 0:1: '' :  GLSL error: extension 'GL_EXT_shader_framebuffer_fetch' is not supported 
ERROR: 1 compilation errors. No code generated. 

的錯誤是很明確的:這個擴展不支持

我的技術規格:

  • 硬件:三星Galaxy S4
  • Android版本:5.0.1
  • Android的API級別:21
  • 的OpenGL版本glGetString(GL_VERSION)):OpenGL ES 3.0 [email protected] AU @(CL @)

我有幾個問題:

  • 有什麼我可以做安裝這個擴展我的設備上?
  • 如果沒有,我可以安裝/使用它的模擬器
  • 是不是軟件事情還是真的有硬件問題?

回答

2

Is there anything I can do to install this extension on my device?

不; GPU和驅動程序都支持它,或者它們不支持。

If not, can I install it/use it on an emulator?

如果仿真器支持擴展,然後是你可以用它...

Is it a software matter or really a hardware problem?

可能是因爲存在底層硬件的限制,或在驅動程序的限制。從應用程序開發人員的角度來看,這兩者是不可分割的,所以它是無關緊要的,這是真正的限制...

相關問題