Inertia's picture

[ES 2.0] Cleanup #3

Project:The Open Toolkit library
Version:1.0-beta-1
Component:Code
Category:task
Priority:normal
Assigned:Unassigned
Status:closed
Description

-------------------------------

enum GetBooleanPName
{
 Shadercompiler = ((int)0X8dfa),
 Samplecoverageinvert = ((int)0X80ab),
 Colorwritemask = ((int)0X0c23),
 Depthwritemask = ((int)0X0b72),
}
 
SVN: void GetBoolean( OpenTK.Graphics.GLES20.All pname,  bool* @params)
New: void GetBoolean( GetBooleanPName pname,  bool* @params)
 
 
-------------------------------
 
enum GetFloatPName
{
 Depthrange = ((int)0X0b70),
 Linewidth = ((int)0X0b21),
 Polygonoffsetunits = ((int)0X2a00),
 Polygonoffsetfactor = ((int)0X8038),
 Aliasedpointsizerange = ((int)0X846d),
 Aliasedlinewidthrange = ((int)0X846e),
 Samplecoveragevalue = ((int)0X80aa),
 Colorclearvalue = ((int)0X0c22),
}
 
SVN: void GetFloat( OpenTK.Graphics.GLES20.All pname,  Single* @params)
SVN: void GetFloat( GetFloatPName pname,  Single* @params)
 
-------------------------------
 
enum GetIntegerPName
{
 Blendequation = ((int)0X8009), // alias for BlendEquationRGB, useful if user did not call BlendEquationSeparate()
 Blendequationrgb = ((int)0X8009),
 Blendequationalpha = ((int)0X883d),
 Implementationcolorreadtype = ((int)0X8b9a),
 Implementationcolorreadformat = ((int)0X8b9b),
 Framebufferbinding = ((int)0X8ca6),
 Renderbufferbinding = ((int)0X8ca7),    
 Arraybufferbinding = ((int)0X8894),
 Elementarraybufferbinding = ((int)0X8895),
 Scissorbox = ((int)0X0c10),
 Viewport = ((int)0X0ba2),
 Texturebinding2D = ((int)0X8069),
 Texturebindingcubemap = ((int)0X8514),
 Activetexture = ((int)0X84e0),
 Frontface = ((int)0X0b46),
 Cullfacemode = ((int)0X0b45),
 Blenddstrgb = ((int)0X80c8),
 Blendsrcrgb = ((int)0X80c9),
 Blenddstalpha = ((int)0X80ca),
 Blendsrcalpha = ((int)0X80cb),
 Stencilfunc = ((int)0X0b92),
 Stencilvaluemask = ((int)0X0b93),
 Stencilfail = ((int)0X0b94),
 Stencilpassdepthfail = ((int)0X0b95),
 Stencilpassdepthpass = ((int)0X0b96),
 Stencilref = ((int)0X0b97),
 Stencilbackfunc = ((int)0X8800),
 Stencilbackfail = ((int)0X8801),
 Stencilbackpassdepthfail = ((int)0X8802),
 Stencilbackpassdepthpass = ((int)0X8803),
 Stencilbackref = ((int)0X8ca3),
 Stencilbackvaluemask = ((int)0X8ca4),
 Stencilwritemask = ((int)0X0b98),
 Stencilbackwritemask = ((int)0X8ca5),
 Depthfunc = ((int)0X0b74),
 Depthclearvalue = ((int)0X0b73),
 Stencilclearvalue = ((int)0X0b91),
 Unpackalignment = ((int)0X0cf5),
 Packalignment = ((int)0X0d05),
 Currentprogram = ((int)0X8b8d),
 Generatemipmaphint = ((int)0X8192),
 Maxtexturesize = ((int)0X0d33),
 Maxviewportdims = ((int)0X0d3a),
 Subpixelbits = ((int)0X0d50),
 Maxcubemaptexturesize = ((int)0X851c),
 Samplebuffers = ((int)0X80a8),
 Samples = ((int)0X80a9),
 Numcompressedtextureformats = ((int)0X86a2),
 Compressedtextureformats = ((int)0X86a3),
 Shaderbinaryformats = ((int)0X8df8),
 Numshaderbinaryformats = ((int)0X8df9),
 Maxvertexattribs = ((int)0X8869),
 Maxtextureimageunits = ((int)0X8872),
 Maxvertextextureimageunits = ((int)0X8b4c),
 Maxcombinedtextureimageunits = ((int)0X8b4d),
 Maxrenderbuffersize = ((int)0X84e8),  
 Maxvertexuniformvectors = ((int)0X8dfb),
 Maxvaryingvectors = ((int)0X8dfc),
 Maxfragmentuniformvectors = ((int)0X8dfd),
 Redbits = ((int)0X0d52),
 Greenbits = ((int)0X0d53),
 Bluebits = ((int)0X0d54),
 Alphabits = ((int)0X0d55),
 Depthbits = ((int)0X0d56),
 Stencilbits = ((int)0X0d57),
}
 
SVN: void GetInteger( OpenTK.Graphics.GLES20.All pname,  Int32* @params)
New: void GetInteger( GetIntegerPName pname,  Int32* @params)
 
-------------------------------
 
Homeless tokens:
 
Belongs to OES_texture_env_crossbar extension:
 Texture = ((int)0X1702), // different value than Texture2D. There is TextureBinding2D to query the name/handle
 
abstract base internal formats (invalid parameters to any ***TexImage*** commands):
 Stencilindex = ((int)0X1901), 
 Depthcomponent = ((int)0X1902)

Edit: Moved BlendEquation tokens to GetInteger enum, due to http://www.khronos.org/registry/gles/specs/1.1/opengles_spec_1_1_extensi... (page 12)

Edit2: Found home for BlendColor (GetFloat enum) http://www.khronos.org/opengles/sdk/docs/man/


Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
the Fiddler's picture

#1

Status:in progress» confirmed
Inertia's picture

#2

<enum name="GetBooleanPName">
  <token name="ShaderCompiler" value="0X8dfa" />
  <token name="SampleCoverageInvert" value="0X80ab" />
  <token name="ColorWritemask" value="0X0c23" />
  <token name="DepthWritemask" value="0X0b72" />
</enum>
 
According to http://www.khronos.org/opengles/sdk/docs/man/ the GetBooleanPName enum should also contain:
GL_BLEND
GL_CULL_FACE
GL_DEPTH_TEST
GL_DITHER
GL_POLYGON_OFFSET_FILL
 
<function name="GetBoolean" extension="Core">
  <param name="pname"><type>GetBooleanPName</type></param>
</function>
 
<enum name="GetFloatPName">
  <token name="BlendColor" value="0X8005" />
  <token name="DepthRange" value="0X0b70" />
  <token name="LineWidth" value="0X0b21" />
  <token name="PolygonOffsetUnits" value="0X2a00" />
  <token name="PolygonOffsetFactor" value="0X8038" />
  <token name="AliasedPointSizeRange" value="0X846d" />
  <token name="AliasedLineWidthRange" value="0X846e" />
  <token name="SampleCoverageValue" value="0X80aa" />
  <token name="ColorClearValue" value="0X0c22" />
</enum>
 
<function name="GetFloat" extension="Core">
  <param name="pname"><type>GetFloatPName</type></param>
</function>
 
<enum name="GetIntegerPName">
 <token name="BlendEquation" value="0X8009" />
  <token name="BlendEquationRgb" value="0X8009" />
  <token name="BlendEquationAlpha" value="0X883d" />
  <token name="ImplementationColorReadType" value="0X8b9a" />
  <token name="ImplementationColorReadFormat" value="0X8b9b" />
  <token name="FramebufferBinding" value="0X8ca6" />
  <token name="RenderbufferBinding" value="0X8ca7" />
  <token name="ArrayBufferBinding" value="0X8894" />
  <token name="ElementArrayBufferBinding" value="0X8895" />
  <token name="ScissorBox" value="0X0c10" />
  <token name="Viewport" value="0X0ba2" />
  <token name="TextureBinding2D" value="0X8069" />
  <token name="TextureBindingCubeMap" value="0X8514" />
  <token name="ActiveTexture" value="0X84e0" />
  <token name="FrontFace" value="0X0b46" />
  <token name="CullFaceMode" value="0X0b45" />
  <token name="BlendDstRgb" value="0X80c8" />
  <token name="BlendSrcRgb" value="0X80c9" />
  <token name="BlendDstAlpha" value="0X80ca" />
  <token name="BlendSrcAlpha" value="0X80cb" />
  <token name="StencilFunc" value="0X0b92" />
  <token name="StencilValueMask" value="0X0b93" />
  <token name="StencilFail" value="0X0b94" />
  <token name="StencilPassDepthFail" value="0X0b95" />
  <token name="StencilPassDepthPass" value="0X0b96" />
  <token name="StencilRef" value="0X0b97" />
  <token name="StencilBackFunc" value="0X8800" />
  <token name="StencilBackFail" value="0X8801" />
  <token name="StencilBackPassDepthFail" value="0X8802" />
  <token name="StencilBackPassDepthPass" value="0X8803" />
  <token name="StencilBackRef" value="0X8ca3" />
  <token name="StencilBackValueMask" value="0X8ca4" />
  <token name="StencilWritemask" value="0X0b98" />
  <token name="StencilBackWritemask" value="0X8ca5" />
  <token name="DepthFunc" value="0X0b74" />
  <token name="DepthClearValue" value="0X0b73" />
  <token name="StencilClearValue" value="0X0b91" />
  <token name="UnpackAlignment" value="0X0cf5" />
  <token name="PackAlignment" value="0X0d05" />
  <token name="CurrentProgram" value="0X8b8d" />
  <token name="GenerateMipmapHint" value="0X8192" />
  <token name="MaxTextureSize" value="0X0d33" />
  <token name="MaxViewportDims" value="0X0d3a" />
  <token name="SubpixelBits" value="0X0d50" />
  <token name="MaxCubeMapTextureSize" value="0X851c" />
  <token name="SampleBuffers" value="0X80a8" />
  <token name="Samples" value="0X80a9" />
  <token name="NumCompressedTextureFormats" value="0X86a2" />
  <token name="CompressedTextureFormats" value="0X86a3" />
  <token name="ShaderBinaryFormats" value="0X8df8" />
  <token name="NumShaderBinaryFormats" value="0X8df9" />
  <token name="MaxVertexAttribs" value="0X8869" />
  <token name="MaxTextureImageUnits" value="0X8872" />
  <token name="MaxVertexTextureImageUnits" value="0X8b4c" />
  <token name="MaxCombinedTextureImageUnits" value="0X8b4d" />
  <token name="MaxRenderbufferSize" value="0X84e8" />
  <token name="MaxVertexUniformVectors" value="0X8dfb" />
  <token name="MaxVaryingVectors" value="0X8dfc" />
  <token name="MaxFragmentUniformVectors" value="0X8dfd" />
  <token name="RedBits" value="0X0d52" />
  <token name="GreenBits" value="0X0d53" />
  <token name="BlueBits" value="0X0d54" />
  <token name="AlphaBits" value="0X0d55" />
  <token name="DepthBits" value="0X0d56" />
  <token name="StencilBits" value="0X0d57" />
</enum>
 
<function name="GetInteger" extension="Core">
  <param name="pname"><type>GetIntegerPName</type></param>
</function>
Inertia's picture

#3

Title:ES 2.0 Cleanup #3» [ES 2.0] Cleanup #3

Is this satisfactory? The biggest issue is correcting the all-lowercase token names, changing the formating with replace, c&p and manual editing is not that bad.

Note to self: According to the man pages it appears that ES.IsEnabled and ES.GetBoolean accept the same tokens to query whether state is enabled. I have not made those additions to the boolean enum, yet.

Before proceeding with the bigger parts of the cleanup, some questions:

1. Shouldn't we change the extension="Core" to something like "Core 2.0" for future updates? (l heavily assume that future updates will use the existing XML as a base and add new functions to it. It would help if you can easily identify what went to core in what version so it can be assumed to be correct/tested/safe pinning/etc.)
2. How about inline documentation?
3. I wouldn't mind some optional comment field where one can do extra remarks about a token, e.g. when it's an alias. Low priority but it would certainly be good to be able to add some extra information besides auto-generated inline docu.

the Fiddler's picture

#4

There is no formal schema for the XML file yet, but the generator recognizes the following attributes for function definitions:

  • extension - "Core", "ARB", etc.
  • version - 1.0, 1.1, 2.0, etc.
  • category - the extension category, if availabable (e.g. "ARB_vertex_buffer_object").
  • profile - OpenGL|ES 1.1 defines a "full" and a smaller, "lite" profile. Set, but not used right now.

We can add additional attributes or elements or XML comments - the generator will simply ignore them.

Documentation is added automatically: the generator looks for a file named "{prefix}{function name}.xml" and uses it if available. It only recognizes files in the OpenGL XML reference format (which is similar to docbook), but this can be improved as necessary. The main issue is getting the documentation in the first place (preferably not writing it by hand!) - once we have that, we can hack the generator to recognize it.

The XML is looking good.

Inertia's picture

#5

so this would be correct?

<token name="BlendEquation" value="0X8009" remark="This token is an alias for GetIntegerPName.BlendEquationRgb." />
 
<function name="GetFloat" extension="Core" version="2.0">

I don't really want to do the documentation itself by hand, thus the question ;) The ES man pages look very much like the GL ones, most likely there is an easy way to do this in a similar fashion.

the Fiddler's picture

#6

I didn't know ES man pages existed! In that case, yes, we can use the same process for ES documentation as for GL - we only need the "master" xml files from Khronos.

The XML snippet would work fine - the remark attribute will be simply ignored.

Inertia's picture

#7

Last time I checked the website the pages did not exist either, the cleanup was done using only the generated All enum and the manual. I've now used the man pages to correct spelling of the tokens, maybe this double-checking will shed some light on other homeless tokens.

Thanks for the confirmation, will see to get it done this weekend so you can add it to the next release.

Without a doubt Khronos will be cooperative regarding the documentation, but it's low priority at this point to me.

the Fiddler's picture

#8

Khronos did release the GL XML docs when we asked last year, so I hope they can do that for the ES docs, too. I'll log a request to their bugtracker and see what comes out.

the Fiddler's picture

#9

Status:confirmed» in progress (commit)

Ok, merged to es20 branch, rev. 2735.

the Fiddler's picture

#10

Status:in progress (commit)» fixed

Bindings regenerated (rev. 2382).