在NVIDIA的Tegra2的Andr​​oid GLSL片段着色器 [英] Android GLSL fragment shader on NVIDIA tegra2

查看:172
本文介绍了在NVIDIA的Tegra2的Andr​​oid GLSL片段着色器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发针对Android的Galaxy Tab 10.1拥有Tegra的250 T20的应用程序。我写在GLSL着色器,有一个for()循环。我要为()循环在一定条件下提前终止。

I'm developing an app for the android galaxy tab 10.1 which has the Tegra 250 T20. I am writing a shader in GLSL that has a for() loop. I want the for() loop to terminate early under some conditions.

我所看到的是,着色器编译器解开循环和整个展开code正在执行,它可以杀死的性能。

What I'm seeing is that the shader compiler has unwound the loop and the entire unwound code is being executed, which kills the performance.

这里的问题:是否是Tegra T20 250支持执行流的指令呢?如果是这样,我怎么能告诉编译器实际使用它们。

Here's the question: Does the Tegra 250 T20 support the execution flow instructions at all? And if so, how can I tell the compiler to actually make use of them.

非常感谢任何及所有答复。

Thanks very much for any and all replies.

ETA:glGetString(GLES20.GL_SHADING_LANGUAGE_VERSION)返回的OpenGL ES GLSL 1.00

ETA: glGetString(GLES20.GL_SHADING_LANGUAGE_VERSION) returns "OpenGL ES GLSL 1.00".

此外,如果GLSL不能处理它,我怎么能写在ARB汇编语言做我自己?

Also if the GLSL can't handle it, how can I write in the ARB assembly language to do it myself?

ETA2:GL_EXTENSIONS具有这样的:
GL_NV_platform_binary
GL_OES_rgb8_rgba8
GL_OES_EGL_sync
GL_OES_fbo_render_mipmap
GL_NV_depth_nonlinear
GL_NV_draw_path
GL_NV_texture_npot_2D_mipmap
GL_OES_EGL_image
GL_OES_EGL_image_external
GL_OES_vertex_half_float
GL_NV_framebuffer_vertex_attrib_array
GL_NV_coverage_sample
GL_OES_mapbuffer
GL_ARB_draw_buffers
GL_EXT_Cg_shader
GL_EXT_packed_float
GL_OES_texture_half_float
GL_OES_texture_float
GL_EXT_texture_array
GL_OES_com pressed_ETC1_RGB8_texture
GL_EXT_texture_com pression_latc
GL_EXT_texture_com pression_dxt1
GL_EXT_texture_com pression_s3tc
GL_EXT_texture_filter_anisotropic
GL_NV_get_tex_image
GL_NV_read_buffer
GL_NV_shader_framebuffer_fetch
GL_NV_fbo_color_attachments
GL_EXT_bgra
GL_EXT_texture_format_BGRA8888
GL_EXT_unpack_subimage
GL_NV_texture_com pression_s3tc_update

ETA2: GL_EXTENSIONS has this: GL_NV_platform_binary GL_OES_rgb8_rgba8 GL_OES_EGL_sync GL_OES_fbo_render_mipmap GL_NV_depth_nonlinear GL_NV_draw_path GL_NV_texture_npot_2D_mipmap GL_OES_EGL_image GL_OES_EGL_image_external GL_OES_vertex_half_float GL_NV_framebuffer_vertex_attrib_array GL_NV_coverage_sample GL_OES_mapbuffer GL_ARB_draw_buffers GL_EXT_Cg_shader GL_EXT_packed_float GL_OES_texture_half_float GL_OES_texture_float GL_EXT_texture_array GL_OES_compressed_ETC1_RGB8_texture GL_EXT_texture_compression_latc GL_EXT_texture_compression_dxt1 GL_EXT_texture_compression_s3tc GL_EXT_texture_filter_anisotropic GL_NV_get_tex_image GL_NV_read_buffer GL_NV_shader_framebuffer_fetch GL_NV_fbo_color_attachments GL_EXT_bgra GL_EXT_texture_format_BGRA8888 GL_EXT_unpack_subimage GL_NV_texture_compression_s3tc_update

推荐答案

Neigher Tegra的顶点,也不片段着色单元,支持动态控制流;你需要环路,可以在编译时展开。大多数其他的OpenGL ES 2.0的实现支持动态控制流,但该标准并不需要它。

Neigher the Tegra vertex nor fragment shader units supports dynamic control-flow; you need loops to be possible to unroll at compile time. Most other OpenGL ES 2.0 implementations supports dynamic control-flow, but the standard does not require it.

这篇关于在NVIDIA的Tegra2的Andr​​oid GLSL片段着色器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆