Skip to content
  • Eduardo Lima Mitev's avatar
    mesa: Use the effective internal format instead for validation · 5edd9961
    Eduardo Lima Mitev authored
    
    
    When validating format+type+internalFormat for texture pixel operations
    on GLES3, the effective internal format should be used if the one
    specified is an unsized internal format. Page 127, section "3.8 Texturing"
    of the GLES 3.0.4 spec says:
    
        "if internalformat is a base internal format, the effective internal
         format is a sized internal format that is derived from the format and
         type for internal use by the GL. Table 3.12 specifies the mapping of
         format and type to effective internal formats. The effective internal
         format is used by the GL for purposes such as texture completeness or
         type checks for CopyTex* commands. In these cases, the GL is required
         to operate as if the effective internal format was used as the
         internalformat when specifying the texture data."
    
    v2: Per the spec, Luminance8Alpha8, Luminance8 and Alpha8 should not be
    considered sized internal formats. Return the corresponding unsize format
    instead.
    
    v4: * Improved comments in
          _mesa_es3_effective_internal_format_for_format_and_type().
        * Splitted patch to separate chunk about reordering of
          error_check_subtexture_dimensions() error check, which is not directly
          related with this patch.
    v5: Dropped the splitted patch because it was actually a work around 3
        dEQP tests that are buggy:
    
        dEQP-GLES2.functional.negative_api.texture.texsubimage2d_neg_offset
        dEQP-GLES2.functional.negative_api.texture.texsubimage2d_offset_allowed
        dEQP-GLES2.functional.negative_api.texture.texsubimage2d_neg_wdt_hgt
    
    Cc: "11.0" <mesa-stable@lists.freedesktop.org>
    Reviewed-by: default avatarJason Ekstrand <jason.ekstrand@intel.com>
    Tested-by: default avatarMark Janes <mark.a.janes@intel.com>
    5edd9961