Skip to content

Most visited

Recently visited


ProgramFragment | Android Developers

to top
Android APIs
public class


extends Program
   ↳ android.renderscript.BaseObj
     ↳ android.renderscript.Program
       ↳ android.renderscript.ProgramFragment
Known Direct Subclasses

This class was deprecated in API level 16.
in API 16

The Renderscript fragment program, also known as fragment shader is responsible for manipulating pixel data in a user defined way. It's constructed from a GLSL shader string containing the program body, textures inputs, and a Type object that describes the constants used by the program. Similar to the vertex programs, when an allocation with constant input values is bound to the shader, its values are sent to the graphics program automatically.

The values inside the allocation are not explicitly tracked. If they change between two draw calls using the same program object, the runtime needs to be notified of that change by calling rsgAllocationSyncAll so it could send the new values to hardware. Communication between the vertex and fragment programs is handled internally in the GLSL code. For example, if the fragment program is expecting a varying input called varTex0, the GLSL code inside the program vertex must provide it.


Nested Classes
class ProgramFragment.Builder This class was deprecated in API level 16. in API 16  
Inherited Methods
From class android.renderscript.Program
From class android.renderscript.BaseObj
From class java.lang.Object
This site uses cookies to store your preferences for site-specific language and display options.

Get the latest Android developer news and tips that will help you find success on Google Play.

* Required Fields


Browse this site in ?

You requested a page in , but your language preference for this site is .

Would you like to change your language preference and browse this site in ? If you want to change your language preference later, use the language menu at the bottom of each page.

This class requires API level or higher

This doc is hidden because your selected API level for the documentation is . You can change the documentation API level with the selector above the left navigation.

For more information about specifying the API level your app requires, read Supporting Different Platform Versions.

Take a one-minute survey?
Help us improve Android tools and documentation.