[][src]Struct ugli_webgl::WEBGL_draw_buffers

pub struct WEBGL_draw_buffers(_);

Extension

The implementation must support a minimum of 4 color attachments. The value of the MAX_COLOR_ATTACHMENTS_WEBGL parameter must be greater than or equal to that of the MAX_DRAW_BUFFERS_WEBGL parameter. If:

  • A framebuffer's color attachments are all textures allocated with format RGBA and type UNSIGNED_BYTE, and

  • The framebuffer has either:

  • No depth or stencil attachment

  • A valid DEPTH or DEPTH_STENCIL attachment

Then a call to checkFramebufferStatus against this framebuffer must not return FRAMEBUFFER_UNSUPPORTED. (In other words, the implementation must support the use of RGBA/UNSIGNED_BYTE textures as color attachments, plus either a DEPTH or DEPTH_STENCIL attachment.) Attaching n consecutive color attachments starting at COLOR_ATTACHMENT0_WEBGL, where n is between 1 and MAX_DRAW_BUFFERS_WEBGL, must not return FRAMEBUFFER_UNSUPPORTED from a call to checkFramebufferStatus. In other words, if MAX_DRAW_BUFFERS_WEBGL is 4, then the implementation is required to support the following combinations of color attachments:

  • COLOR_ATTACHMENT0_WEBGL = RGBA/UNSIGNED_BYTE
  • COLOR_ATTACHMENT0_WEBGL = RGBA/UNSIGNED_BYTE COLOR_ATTACHMENT1_WEBGL = RGBA/UNSIGNED_BYTE
  • COLOR_ATTACHMENT0_WEBGL = RGBA/UNSIGNED_BYTE COLOR_ATTACHMENT1_WEBGL = RGBA/UNSIGNED_BYTE COLOR_ATTACHMENT2_WEBGL = RGBA/UNSIGNED_BYTE
  • COLOR_ATTACHMENT0_WEBGL = RGBA/UNSIGNED_BYTE COLOR_ATTACHMENT1_WEBGL = RGBA/UNSIGNED_BYTE COLOR_ATTACHMENT2_WEBGL = RGBA/UNSIGNED_BYTE COLOR_ATTACHMENT3_WEBGL = RGBA/UNSIGNED_BYTE

Although the extension name is prefixed with WEBGL the extension must be enabled with the #extension GL_EXT_draw_buffers directive, as shown in the sample code, to use the extension in a shader. Likewise the shading language preprocessor #define GL_EXT_draw_buffers, will be defined to 1 if the extension is supported. The value of gl_MaxDrawBuffers must match MAX_DRAW_BUFFERS_WEBGL from the API if the extension is enabled in a WebGL context; otherwise, the value must be 1. Whether or not the extension is enabled with the #extension GL_EXT_draw_buffers directive in a shader does not affect the value of gl_MaxDrawBuffers. The value of gl_MaxDrawBuffers is a constant in the shader, and is guaranteed to be frozen at program link time. It is implementation-dependent whether it is frozen at shader compile time. (A consequence is that if a program is linked, and later the WEBGL_draw_buffers extension is enabled, the value of gl_MaxDrawBuffers seen by that program will still be 1.) If the WEBGL_draw_buffers extension is enabled, but the fragment shader does not contain the #extension GL_EXT_draw_buffers directive to enable it, then writes to gl_FragColor are only written to COLOR_ATTACHMENT0_WEBGL, and not broadcast to all color attachments. In this scenario, other color attachments are guaranteed to remain untouched. If a fragment shader writes to neither gl_FragColor nor gl_FragData, the values of the fragment colors following shader execution are untouched. If a fragment shader contains the #extension GL_EXT_draw_buffers directive, all gl_FragData variables (from gl_FragData[0] to gl_FragData[MAX_DRAW_BUFFERS_WEBGL - 1]) default to zero if no values are written to them during a shader execution. If an image is attached to more than one color attachment point in a framebuffer, checkFramebufferStatus returns FRAMEBUFFER_UNSUPPORTED. An image can be an individual mip level, or a face of cube map. Adds support for multiple color buffers and color outputs from fragment shaders.

Methods

impl WEBGL_draw_buffers[src]

pub const COLOR_ATTACHMENT0_WEBGL: GLenum[src]

pub const COLOR_ATTACHMENT10_WEBGL: GLenum[src]

pub const COLOR_ATTACHMENT11_WEBGL: GLenum[src]

pub const COLOR_ATTACHMENT12_WEBGL: GLenum[src]

pub const COLOR_ATTACHMENT13_WEBGL: GLenum[src]

pub const COLOR_ATTACHMENT14_WEBGL: GLenum[src]

pub const COLOR_ATTACHMENT15_WEBGL: GLenum[src]

pub const COLOR_ATTACHMENT1_WEBGL: GLenum[src]

pub const COLOR_ATTACHMENT2_WEBGL: GLenum[src]

pub const COLOR_ATTACHMENT3_WEBGL: GLenum[src]

pub const COLOR_ATTACHMENT4_WEBGL: GLenum[src]

pub const COLOR_ATTACHMENT5_WEBGL: GLenum[src]

pub const COLOR_ATTACHMENT6_WEBGL: GLenum[src]

pub const COLOR_ATTACHMENT7_WEBGL: GLenum[src]

pub const COLOR_ATTACHMENT8_WEBGL: GLenum[src]

pub const COLOR_ATTACHMENT9_WEBGL: GLenum[src]

pub const DRAW_BUFFER0_WEBGL: GLenum[src]

pub const DRAW_BUFFER10_WEBGL: GLenum[src]

pub const DRAW_BUFFER11_WEBGL: GLenum[src]

pub const DRAW_BUFFER12_WEBGL: GLenum[src]

pub const DRAW_BUFFER13_WEBGL: GLenum[src]

pub const DRAW_BUFFER14_WEBGL: GLenum[src]

pub const DRAW_BUFFER15_WEBGL: GLenum[src]

pub const DRAW_BUFFER1_WEBGL: GLenum[src]

pub const DRAW_BUFFER2_WEBGL: GLenum[src]

pub const DRAW_BUFFER3_WEBGL: GLenum[src]

pub const DRAW_BUFFER4_WEBGL: GLenum[src]

pub const DRAW_BUFFER5_WEBGL: GLenum[src]

pub const DRAW_BUFFER6_WEBGL: GLenum[src]

pub const DRAW_BUFFER7_WEBGL: GLenum[src]

pub const DRAW_BUFFER8_WEBGL: GLenum[src]

pub const DRAW_BUFFER9_WEBGL: GLenum[src]

pub const MAX_COLOR_ATTACHMENTS_WEBGL: GLenum[src]

pub const MAX_DRAW_BUFFERS_WEBGL: GLenum[src]

pub fn draw_buffers_webgl(&self, buffers: &[GLenum])[src]

Trait Implementations

impl AsRef<Reference> for WEBGL_draw_buffers[src]

impl Clone for WEBGL_draw_buffers[src]

impl Debug for WEBGL_draw_buffers[src]

impl Extension for WEBGL_draw_buffers[src]

impl From<WEBGL_draw_buffers> for Reference[src]

impl InstanceOf for WEBGL_draw_buffers[src]

impl JsSerialize for WEBGL_draw_buffers[src]

impl JsSerializeOwned for WEBGL_draw_buffers[src]

impl<'_r> JsSerializeOwned for &'_r WEBGL_draw_buffers[src]

impl ReferenceType for WEBGL_draw_buffers[src]

impl<'_r> TryFrom<&'_r Reference> for WEBGL_draw_buffers[src]

type Error = ConversionError

The type returned in the event of a conversion error.

impl<'_r> TryFrom<&'_r Value> for WEBGL_draw_buffers[src]

type Error = ConversionError

The type returned in the event of a conversion error.

impl TryFrom<Reference> for WEBGL_draw_buffers[src]

type Error = ConversionError

The type returned in the event of a conversion error.

impl TryFrom<Value> for WEBGL_draw_buffers[src]

type Error = ConversionError

The type returned in the event of a conversion error.

impl TryFrom<WEBGL_draw_buffers> for Reference[src]

type Error = Void

The type returned in the event of a conversion error.

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.