15bd8deadSopenharmony_ciName
25bd8deadSopenharmony_ci
35bd8deadSopenharmony_ci    EXT_protected_textures
45bd8deadSopenharmony_ci
55bd8deadSopenharmony_ciName Strings
65bd8deadSopenharmony_ci
75bd8deadSopenharmony_ci    GL_EXT_protected_textures
85bd8deadSopenharmony_ci
95bd8deadSopenharmony_ciContributors
105bd8deadSopenharmony_ci
115bd8deadSopenharmony_ci    Maurice Ribble
125bd8deadSopenharmony_ci    Mohan Maiya
135bd8deadSopenharmony_ci    Craig Donner
145bd8deadSopenharmony_ci    Alex Wong
155bd8deadSopenharmony_ci    Jan-Harald Fredriksen
165bd8deadSopenharmony_ci    Daniel Koch
175bd8deadSopenharmony_ci    Prabindh Sundareson
185bd8deadSopenharmony_ci    Jesse Hall
195bd8deadSopenharmony_ci    Ray Smith
205bd8deadSopenharmony_ci    Jonathan Putsman
215bd8deadSopenharmony_ci
225bd8deadSopenharmony_ciContact
235bd8deadSopenharmony_ci
245bd8deadSopenharmony_ci    Jeff Leger (jleger 'at' qti.qualcomm.com)
255bd8deadSopenharmony_ci
265bd8deadSopenharmony_ciIP Status
275bd8deadSopenharmony_ci
285bd8deadSopenharmony_ci    No known IP claims.
295bd8deadSopenharmony_ci
305bd8deadSopenharmony_ciStatus
315bd8deadSopenharmony_ci
325bd8deadSopenharmony_ci    Complete
335bd8deadSopenharmony_ci
345bd8deadSopenharmony_ciVersion
355bd8deadSopenharmony_ci
365bd8deadSopenharmony_ci    May 17, 2017
375bd8deadSopenharmony_ci
385bd8deadSopenharmony_ciNumber
395bd8deadSopenharmony_ci
405bd8deadSopenharmony_ci    OpenGL ES Extension #256
415bd8deadSopenharmony_ci
425bd8deadSopenharmony_ciDependencies
435bd8deadSopenharmony_ci
445bd8deadSopenharmony_ci    OpenGL ES 3.0 is required.
455bd8deadSopenharmony_ci
465bd8deadSopenharmony_ci    This extension requires the EGL_EXT_protected_content extension or
475bd8deadSopenharmony_ci    similar.
485bd8deadSopenharmony_ci
495bd8deadSopenharmony_ci    This extension is written against the OpenGL ES 3.2 specification.
505bd8deadSopenharmony_ci    
515bd8deadSopenharmony_ci    Interacts with EXT_sparse_texture.
525bd8deadSopenharmony_ci
535bd8deadSopenharmony_ciOverview
545bd8deadSopenharmony_ci
555bd8deadSopenharmony_ci    This extension requires another extension like EGL_EXT_protected_content to
565bd8deadSopenharmony_ci    have created a protected context.  A protected context enables the
575bd8deadSopenharmony_ci    driver to put the GPU into a protected mode where it is able to operate on
585bd8deadSopenharmony_ci    protected surfaces.
595bd8deadSopenharmony_ci
605bd8deadSopenharmony_ci    This extension enables allocating standard GL textures as protected
615bd8deadSopenharmony_ci    surfaces. Previously these textures would have had to have been created as
625bd8deadSopenharmony_ci    special EGL surfaces.  This allows use-cases such as depth, stencil, or
635bd8deadSopenharmony_ci    mipmapped textures to be supported as destinations for rendering within
645bd8deadSopenharmony_ci    a protected context.
655bd8deadSopenharmony_ci
665bd8deadSopenharmony_ci    An explanation of undefined behavior in this extension:  Several places
675bd8deadSopenharmony_ci    in this extension mention undefined behavior can result, which can
685bd8deadSopenharmony_ci    include program termination.  The reason for this is because one way
695bd8deadSopenharmony_ci    to handle protected content is by using a protected virtual to physical
705bd8deadSopenharmony_ci    memory translation layer.  With this sort of solution a system may generate
715bd8deadSopenharmony_ci    read or write faults when a non-protected context tries to access the
725bd8deadSopenharmony_ci    buffer.  Depending on the system these faults might be ignored or they might
735bd8deadSopenharmony_ci    cause process termination.  This undefined behavior should not include
745bd8deadSopenharmony_ci    actually allowing copying any protected content to a non-protected surface.
755bd8deadSopenharmony_ci
765bd8deadSopenharmony_ci    This extension does not guarantee that the implementation abides by a
775bd8deadSopenharmony_ci    system's digital rights management requirements.  It must be verified beyond
785bd8deadSopenharmony_ci    the existence of this extension that the implementation of this extension is
795bd8deadSopenharmony_ci    trustworthy according to the requirements of a content protection system.
805bd8deadSopenharmony_ci
815bd8deadSopenharmony_ciNew Procedures and Functions
825bd8deadSopenharmony_ci
835bd8deadSopenharmony_ci    None
845bd8deadSopenharmony_ci
855bd8deadSopenharmony_ciNew Tokens
865bd8deadSopenharmony_ci
875bd8deadSopenharmony_ci    Returned by GetIntegerv when <pname> is CONTEXT_FLAGS:
885bd8deadSopenharmony_ci
895bd8deadSopenharmony_ci        GL_CONTEXT_FLAG_PROTECTED_CONTENT_BIT_EXT       0x00000010
905bd8deadSopenharmony_ci
915bd8deadSopenharmony_ci    Accepted as a value for <pname> for the TexParameter{if} and
925bd8deadSopenharmony_ci    TexParameter{if}v commands and for the <value> parameter of
935bd8deadSopenharmony_ci    GetTexParameter{if}v:
945bd8deadSopenharmony_ci
955bd8deadSopenharmony_ci        GL_TEXTURE_PROTECTED_EXT                        0x8BFA
965bd8deadSopenharmony_ci
975bd8deadSopenharmony_ci    Accepted as a value to <param> for the TexParameter{if} and
985bd8deadSopenharmony_ci    to <params> for the TexParameter{if}v commands with a <pname> of
995bd8deadSopenharmony_ci    TEXTURE_PROTECTED_EXT; returned as possible values for <data> when
1005bd8deadSopenharmony_ci    GetTexParameter{if}v is queried with a <value> of TEXTURE_PROTECTED_EXT:
1015bd8deadSopenharmony_ci
1025bd8deadSopenharmony_ci        FALSE                                           0x0
1035bd8deadSopenharmony_ci        TRUE                                            0x1
1045bd8deadSopenharmony_ci
1055bd8deadSopenharmony_ciAdd the following to the end of section 8.18 (Immutable-Format Texture Images)
1065bd8deadSopenharmony_ciin the OpenGL ES 3.2 Specification:
1075bd8deadSopenharmony_ci
1085bd8deadSopenharmony_ci    To use protected textures a context must be a protected context.
1095bd8deadSopenharmony_ci    To check if your context supports protected content you can
1105bd8deadSopenharmony_ci    query the context by calling GetIntegerv with pname CONTEXT_FLAGS, as
1115bd8deadSopenharmony_ci    described in section 20.2.
1125bd8deadSopenharmony_ci
1135bd8deadSopenharmony_ci    Texture usage can be specified via the TEXTURE_PROTECTED_EXT value
1145bd8deadSopenharmony_ci    for the <pname> argument to TexParameter{if}[v]. In order to take effect,
1155bd8deadSopenharmony_ci    the texture usage must be specified before the texture contents are
1165bd8deadSopenharmony_ci    defined by TexStorage*.
1175bd8deadSopenharmony_ci
1185bd8deadSopenharmony_ci    Possible values for <params> when <pname> is TEXTURE_PROTECTED_EXT are:
1195bd8deadSopenharmony_ci
1205bd8deadSopenharmony_ci    FALSE - the default. The texture is not protected.
1215bd8deadSopenharmony_ci
1225bd8deadSopenharmony_ci    TRUE - the texture is protected.
1235bd8deadSopenharmony_ci
1245bd8deadSopenharmony_ci    The definition of protected and non-protected access is up to the
1255bd8deadSopenharmony_ci    implementation and is out of scope of this specification.  To read/write a
1265bd8deadSopenharmony_ci    protected surface, it is required that the context also be protected.
1275bd8deadSopenharmony_ci
1285bd8deadSopenharmony_ci    CONTEXT_FLAG_PROTECTED_CONTENT_BIT_EXT is set when the context is
1295bd8deadSopenharmony_ci    created in protected mode with an extension such as
1305bd8deadSopenharmony_ci    EGL_EXT_protected_context.
1315bd8deadSopenharmony_ci
1325bd8deadSopenharmony_ciAdd a new section "Protected Content" to Chapter 2 "OpenGL ES Operation":
1335bd8deadSopenharmony_ci
1345bd8deadSopenharmony_ci    If the context is protected, the pipeline stages are executed in the
1355bd8deadSopenharmony_ci    following manner:
1365bd8deadSopenharmony_ci    - The fragment stage is always protected
1375bd8deadSopenharmony_ci    - For all other stages, it is implementation defined whether that stage is
1385bd8deadSopenharmony_ci    protected or not protected.
1395bd8deadSopenharmony_ci
1405bd8deadSopenharmony_ci    Permitted operations in protected and not protected mode are out of the
1415bd8deadSopenharmony_ci    scope of this specification. Refer to EGL_EXT_protected_context, if
1425bd8deadSopenharmony_ci    applicable, for more information.
1435bd8deadSopenharmony_ci
1445bd8deadSopenharmony_ciAdd a new row to Table 8.19 (Texture parameters and their values):
1455bd8deadSopenharmony_ci
1465bd8deadSopenharmony_ci    Name                  | Type | Legal Values
1475bd8deadSopenharmony_ci    ------------------------------------------------------------
1485bd8deadSopenharmony_ci    TEXTURE_PROTECTED_EXT | bool | FALSE, TRUE
1495bd8deadSopenharmony_ci
1505bd8deadSopenharmony_ciErrors
1515bd8deadSopenharmony_ci
1525bd8deadSopenharmony_ci    If TexParameter{if} or TexParamter{if}v is called with a <pname>
1535bd8deadSopenharmony_ci    of TEXTURE_PROTECTED_EXT and the value of <param> or <params> is not
1545bd8deadSopenharmony_ci    TRUE or FALSE the error INVALID_VALUE is generated.
1555bd8deadSopenharmony_ci
1565bd8deadSopenharmony_ci    [[ The following is only added if EXT_sparse_texture is supported. ]]
1575bd8deadSopenharmony_ci    
1585bd8deadSopenharmony_ci    Add to the errors that may be generated by TexStorage*:
1595bd8deadSopenharmony_ci
1605bd8deadSopenharmony_ci        An INVALID_OPERATION error is generated if the texture's
1615bd8deadSopenharmony_ci        TEXTURE_SPARSE_EXT parameter is TRUE and the value of its
1625bd8deadSopenharmony_ci        TEXTURE_PROTECTED_EXT parameter is TRUE.  
1635bd8deadSopenharmony_ci
1645bd8deadSopenharmony_ciIssues
1655bd8deadSopenharmony_ci    1) Should this work with all texture functions or only the new texture
1665bd8deadSopenharmony_ci    storage allocations?
1675bd8deadSopenharmony_ci
1685bd8deadSopenharmony_ci    RESOLVED - Only supporting a new texture storage allocation method is much
1695bd8deadSopenharmony_ci    simpler than trying to alter every texture-related entry-point.
1705bd8deadSopenharmony_ci
1715bd8deadSopenharmony_ci
1725bd8deadSopenharmony_ci    2) Some paths like TexSubImage may have GPU and CPU paths.  Should those
1735bd8deadSopenharmony_ci    types of operations be supported in this extension.
1745bd8deadSopenharmony_ci
1755bd8deadSopenharmony_ci    PROPOSED - Yes.  While protected surfaces can't be updated with
1765bd8deadSopenharmony_ci    non-secure GPU/CPU operations, an implementation is expected to either use
1775bd8deadSopenharmony_ci    trusted GPU or CPU operations to accomplish this.
1785bd8deadSopenharmony_ci
1795bd8deadSopenharmony_ci    3) What target should all the texture bind and parameter setting API calls
1805bd8deadSopenharmony_ci    use?
1815bd8deadSopenharmony_ci
1825bd8deadSopenharmony_ci    RESOLVED - They will use the non *_PROTECTED targets.  This was done to
1835bd8deadSopenharmony_ci    reduce the amount of code change in apps.  The only calls using *_PROTECTED
1845bd8deadSopenharmony_ci    targets are the texStorage allocation calls.
1855bd8deadSopenharmony_ci
1865bd8deadSopenharmony_ci    4) What happens if readPixels is performed on a protected surface?
1875bd8deadSopenharmony_ci
1885bd8deadSopenharmony_ci    RESOLVED - Results will not actually get the surface data, but
1895bd8deadSopenharmony_ci    otherwise the results are undefined up to and including app termination.
1905bd8deadSopenharmony_ci
1915bd8deadSopenharmony_ci    5) Can you create an EGLImage from a protected texture?
1925bd8deadSopenharmony_ci
1935bd8deadSopenharmony_ci    RESOLVED - Yes, but only if the EGLImage is created in a protected context.
1945bd8deadSopenharmony_ci
1955bd8deadSopenharmony_ci    6) Should all textures on a protected context be protected by default?
1965bd8deadSopenharmony_ci
1975bd8deadSopenharmony_ci    RESOLVED - No, several implementations have limited amounts of protected
1985bd8deadSopenharmony_ci    memory so the API will require opting into protected memory.
1995bd8deadSopenharmony_ci
2005bd8deadSopenharmony_ci    7) How should protected memory be exposed?
2015bd8deadSopenharmony_ci
2025bd8deadSopenharmony_ci    RESOLVED - Options discussed where target *_PROTECTED, using
2035bd8deadSopenharmony_ci    TexStorage*WithFlags, and adding a new texture parameter.  The group decided
2045bd8deadSopenharmony_ci    to add a new texture parameter.
2055bd8deadSopenharmony_ci
2065bd8deadSopenharmony_ci    8) If an FBO attachment is protected, must all of the attachments be
2075bd8deadSopenharmony_ci    protected?
2085bd8deadSopenharmony_ci
2095bd8deadSopenharmony_ci    RESOLVED - Yes, if any of the FBO attachments are protected then they all
2105bd8deadSopenharmony_ci    must be protected or the results are undefined.  If this is being used
2115bd8deadSopenharmony_ci    in conjunction with the EGL_EXT_protected_content extension that extension
2125bd8deadSopenharmony_ci    states all outputs must be protected for a protected context, and that
2135bd8deadSopenharmony_ci    inputs can be mixed.
2145bd8deadSopenharmony_ci
2155bd8deadSopenharmony_ci    9) Are occlusion, timer, and other types of queries allowed when using the
2165bd8deadSopenharmony_ci    the EGL_EXT_protected_content extension?
2175bd8deadSopenharmony_ci
2185bd8deadSopenharmony_ci    RESOLVED - No, these will result in undefined behavior with this extension.
2195bd8deadSopenharmony_ci    These features require writing to a buffer and a protected context can only
2205bd8deadSopenharmony_ci    write to a protected surface.  There are no protected buffers so this isn't
2215bd8deadSopenharmony_ci    possible.  Even if there were protected buffers that data wouldn't be
2225bd8deadSopenharmony_ci    visible on the CPU.
2235bd8deadSopenharmony_ci
2245bd8deadSopenharmony_ci    10) What is the interaction between EXT_protected_textures and
2255bd8deadSopenharmony_ci    EXT_sparse_texture?
2265bd8deadSopenharmony_ci
2275bd8deadSopenharmony_ci    RESOLVED - It is forbidden to create a texture which is both protected and
2285bd8deadSopenharmony_ci    sparse.   This is problematic on some platforms and there is no known
2295bd8deadSopenharmony_ci    compelling use case.
2305bd8deadSopenharmony_ci
2315bd8deadSopenharmony_ciRevision History
2325bd8deadSopenharmony_ci
2335bd8deadSopenharmony_ci    Rev.    Date     Author    Changes
2345bd8deadSopenharmony_ci    ----  --------  --------  ----------------------------------------------
2355bd8deadSopenharmony_ci     1    03/07/16  mribble   Initial draft.
2365bd8deadSopenharmony_ci     2    03/10/16  mribble   Cleanup.
2375bd8deadSopenharmony_ci     3    03/18/16  mribble   Fix issues brought up by Khronos group.
2385bd8deadSopenharmony_ci     4    03/25/16  mribble   Changed to tex parameter method.  Other cleanup.
2395bd8deadSopenharmony_ci     5    03/30/16  mribble   Added issues 8 and 9.  Other cleanup.
2405bd8deadSopenharmony_ci     6    04/08/16  rsmith    Added section on Protected Content defining the
2415bd8deadSopenharmony_ci                              protection state of each pipeline stage, as
2425bd8deadSopenharmony_ci                              required by EGL_EXT_protected_content.
2435bd8deadSopenharmony_ci     7    04/10/16  mribble   Minor cleanup.
2445bd8deadSopenharmony_ci     8    04/11/16  mribble   Clarify issue 9.
2455bd8deadSopenharmony_ci     9    04/11/16  Jon Leech Add missing _EXT suffix to context flag.
2465bd8deadSopenharmony_ci     10   05/17/17  jleger    Add issue 10 and the corresponding error.
247