GLSL Half (floating point) attribute type

后端 未结 2 739
孤街浪徒
孤街浪徒 2021-01-24 20:30

I have been trying to get a 16bit float (half-floating point) as an attribute into my GLSL vertex shader. It won\'t let me compile saying:

error C7506: OpenGL do         


        
2条回答
  •  [愿得一人]
    2021-01-24 21:09

    In the absence of a MCVE demonstrating otherwise I assume you tried something like:

    half float aHalfFloat;
    

    However, "half" is a reserved keyword in #version 410:

    OpenGL Shading Language 4.10 Specification, page 15 (emphasis mine):

    The following are the keywords reserved for future use. Using them will result in an error:

    common partition active asm class union enum typedef template this packed goto inline noinline volatile public static extern external interface long short half fixed unsigned superp input output hvec2 hvec3 hvec4 fvec2 fvec3 fvec4 sampler3DRect filter image1D image2D image3D imageCube iimage1D iimage2D iimage3D iimageCube uimage1D uimage2D uimage3D uimageCube image1DArray image2DArray iimage1DArray iimage2DArray uimage1DArray uimage2DArray image1DShadow image2DShadow image1DArrayShadow image2DArrayShadow imageBuffer iimageBuffer uimageBuffer sizeof cast namespace using row_major In addition, all identifiers

提交回复
热议问题