Half float support already exists for desktop GL. Reuse the
ARB_half_float_vertex enable bit and account for the different enum to
enable the extension for ES2.

Signed-off-by: Kevin Strasser <kevin.stras...@intel.com>
---
 src/mesa/main/extensions_table.h | 1 +
 src/mesa/main/varray.c           | 7 +++++--
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/src/mesa/main/extensions_table.h b/src/mesa/main/extensions_table.h
index 977897e..b086fe2 100644
--- a/src/mesa/main/extensions_table.h
+++ b/src/mesa/main/extensions_table.h
@@ -390,6 +390,7 @@ EXT(OES_texture_npot                        , 
ARB_texture_non_power_of_two
 EXT(OES_texture_stencil8                    , ARB_texture_stencil8             
      ,  x ,  x ,  x ,  30, 2014)
 EXT(OES_texture_storage_multisample_2d_array, ARB_texture_multisample          
      ,  x ,  x ,  x ,  31, 2014)
 EXT(OES_vertex_array_object                 , dummy_true                       
      ,  x ,  x , ES1, ES2, 2010)
+EXT(OES_vertex_half_float                   , ARB_half_float_vertex            
      ,  x ,  x ,  x , ES2, 2005)
 
 EXT(S3_s3tc                                 , ANGLE_texture_compression_dxt    
      , GLL, GLC,  x ,  x , 1999)
 
diff --git a/src/mesa/main/varray.c b/src/mesa/main/varray.c
index 027ae7c..d04fd0b 100644
--- a/src/mesa/main/varray.c
+++ b/src/mesa/main/varray.c
@@ -102,6 +102,7 @@ type_to_bit(const struct gl_context *ctx, GLenum type)
    case GL_UNSIGNED_INT:
       return UNSIGNED_INT_BIT;
    case GL_HALF_FLOAT:
+   case GL_HALF_FLOAT_OES:
       if (ctx->Extensions.ARB_half_float_vertex)
          return HALF_BIT;
       else
@@ -235,8 +236,10 @@ get_legal_types_mask(const struct gl_context *ctx)
          legalTypesMask &= ~(UNSIGNED_INT_BIT |
                              INT_BIT |
                              UNSIGNED_INT_2_10_10_10_REV_BIT |
-                             INT_2_10_10_10_REV_BIT |
-                             HALF_BIT);
+                             INT_2_10_10_10_REV_BIT);
+
+         if (!_mesa_has_OES_vertex_half_float(ctx))
+            legalTypesMask &= ~HALF_BIT;
       }
    }
    else {
-- 
2.7.4

_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to