Implemented "Reading and Copying Pixels" functionality from the OpenGL

4.4 specification, sections 18.2 and 18.3.
This commit is contained in:
Stefanos A. 2013-10-23 18:54:34 +02:00
parent b425bff682
commit 3037baa5ea
5 changed files with 166 additions and 16 deletions

View file

@ -984,6 +984,15 @@
</param>
</function>
<function name="CopyImageSubData" extension="Core">
<param name="srcTarget">
<type>ImageTarget</type>
</param>
<param name="dstTarget">
<type>ImageTarget</type>
</param>
</function>
<function name="FramebufferParameter" extension="Core">
<param name="target">
<type>FramebufferTarget</type>
@ -1129,7 +1138,7 @@
<type>PixelFormat</type>
</param>
<param name="type">
<type>TextureTarget3d</type>
<type>TexImageTarget</type>
</param>
</function>
@ -1138,7 +1147,7 @@
<type>PixelFormat</type>
</param>
<param name="type">
<type>TextureTarget3d</type>
<type>TexImageTarget</type>
</param>
</function>
@ -1970,6 +1979,9 @@
<enum name="ClearBufferCombined">
<use enum="VERSION_3_0" token="DEPTH_STENCIL" />
</enum>
<enum name="ClearBufferMask">
<use enum="VERSION_1_1" token="NONE" />
</enum>
<enum name="ColorPointerType">
<use enum="ARB_half_float_vertex" token="HALF_FLOAT" />
<use enum="VERSION_3_3" token="UNSIGNED_INT_2_10_10_10_REV" />
@ -2588,6 +2600,20 @@
<token name="HISTOGRAM" value="0x8024" />
<token name="PROXY_HISTOGRAM" value="0x8025" />
</enum>
<enum name="ImageTarget">
<use name="VERSION_1_1" token="TEXTURE_1D" />
<use name="VERSION_1_1" token="TEXTURE_2D" />
<use name="VERSION_1_2" token="TEXTURE_3D" />
<use name="VERSION_3_0" token="TEXTURE_1D_ARRAY" />
<use name="VERSION_3_0" token="TEXTURE_2D_ARRAY" />
<use name="VERSION_3_2" token="TEXTURE_2D_MULTISAMPLE" />
<use name="VERSION_3_2" token="TEXTURE_2D_MULTISAMPLE_ARRAY" />
<use name="VERSION_3_1" token="TEXTURE_BUFFER" />
<use name="VERSION_3_1" token="TEXTURE_RECTANGLE" />
<use name="VERSION_1_3" token="TEXTURE_CUBE_MAP" />
<use name="VERSION_4_0" token="TEXTURE_CUBE_MAP_ARRAY" />
<use name="VERSION_3_0" token="RENDERBUFFER" />
</enum>
<enum name="IndexedEnableCap">
<use enum="GetPName" token="BLEND" />
<use enum="VERSION_4_1" token="SCISSOR_TEST" />
@ -3036,6 +3062,7 @@
<use enum="ARB_framebuffer_object" token="COLOR_ATTACHMENT14" />
<use enum="ARB_framebuffer_object" token="COLOR_ATTACHMENT15" />
<use enum="VERSION_1_1" token="NONE" />
<use enum="VERSION_1_1" token="FRONT_AND_BACK" />
</enum>
<enum name="RenderbufferParameterName">
<use enum="ARB_framebuffer_object" token="RENDERBUFFER_SAMPLES" />
@ -3243,7 +3270,7 @@
<use enum="VERSION_4_1" token="SYNC_GPU_COMMANDS_COMPLETE" />
</enum>
<enum name="WaitSyncFlags">
<token name="DEFAULT" value="0" />
<use enum="VERSION_1_1" token="NONE" />
<use enum="VERSION_4_1" token="SYNC_FLUSH_COMMANDS_BIT" />
</enum>
<enum name="WaitSyncStatus">
@ -3258,6 +3285,19 @@
<use token="SYNC_CONDITION" />
<use token="SYNC_FLAGS" />
</enum>
<enum name="TexImageTarget">
<use name="VERSION_1_1" token="TEXTURE_1D" />
<use name="VERSION_1_1" token="TEXTURE_2D" />
<use name="VERSION_1_2" token="TEXTURE_3D" />
<use name="VERSION_3_0" token="TEXTURE_1D_ARRAY" />
<use name="VERSION_3_0" token="TEXTURE_2D_ARRAY" />
<use name="VERSION_3_2" token="TEXTURE_2D_MULTISAMPLE" />
<use name="VERSION_3_2" token="TEXTURE_2D_MULTISAMPLE_ARRAY" />
<use name="VERSION_3_1" token="TEXTURE_BUFFER" />
<use name="VERSION_3_1" token="TEXTURE_RECTANGLE" />
<use name="VERSION_1_3" token="TEXTURE_CUBE_MAP" />
<use name="VERSION_4_0" token="TEXTURE_CUBE_MAP_ARRAY" />
</enum>
<enum name="TextureAccess">
<use enum="VERSION_1_5" token="READ_ONLY" />
<use enum="VERSION_1_5" token="WRITE_ONLY" />

View file

@ -42094,13 +42094,13 @@ namespace OpenTK.Graphics.OpenGL
/// <summary>[requires: v4.3 and ARB_copy_image]</summary>
[AutoGenerated(Category = "ARB_copy_image", Version = "4.3", EntryPoint = "glCopyImageSubData")]
public static
void CopyImageSubData(Int32 srcName, OpenTK.Graphics.OpenGL.ArbCopyImage srcTarget, Int32 srcLevel, Int32 srcX, Int32 srcY, Int32 srcZ, Int32 dstName, OpenTK.Graphics.OpenGL.ArbCopyImage dstTarget, Int32 dstLevel, Int32 dstX, Int32 dstY, Int32 dstZ, Int32 srcWidth, Int32 srcHeight, Int32 srcDepth)
void CopyImageSubData(Int32 srcName, OpenTK.Graphics.OpenGL.ImageTarget srcTarget, Int32 srcLevel, Int32 srcX, Int32 srcY, Int32 srcZ, Int32 dstName, OpenTK.Graphics.OpenGL.ImageTarget dstTarget, Int32 dstLevel, Int32 dstX, Int32 dstY, Int32 dstZ, Int32 srcWidth, Int32 srcHeight, Int32 srcDepth)
{
#if DEBUG
using (new ErrorHelper(GraphicsContext.CurrentContext))
{
#endif
Delegates.glCopyImageSubData((UInt32)srcName, (OpenTK.Graphics.OpenGL.ArbCopyImage)srcTarget, (Int32)srcLevel, (Int32)srcX, (Int32)srcY, (Int32)srcZ, (UInt32)dstName, (OpenTK.Graphics.OpenGL.ArbCopyImage)dstTarget, (Int32)dstLevel, (Int32)dstX, (Int32)dstY, (Int32)dstZ, (Int32)srcWidth, (Int32)srcHeight, (Int32)srcDepth);
Delegates.glCopyImageSubData((UInt32)srcName, (OpenTK.Graphics.OpenGL.ImageTarget)srcTarget, (Int32)srcLevel, (Int32)srcX, (Int32)srcY, (Int32)srcZ, (UInt32)dstName, (OpenTK.Graphics.OpenGL.ImageTarget)dstTarget, (Int32)dstLevel, (Int32)dstX, (Int32)dstY, (Int32)dstZ, (Int32)srcWidth, (Int32)srcHeight, (Int32)srcDepth);
#if DEBUG
}
#endif
@ -42110,13 +42110,13 @@ namespace OpenTK.Graphics.OpenGL
[System.CLSCompliant(false)]
[AutoGenerated(Category = "ARB_copy_image", Version = "4.3", EntryPoint = "glCopyImageSubData")]
public static
void CopyImageSubData(UInt32 srcName, OpenTK.Graphics.OpenGL.ArbCopyImage srcTarget, Int32 srcLevel, Int32 srcX, Int32 srcY, Int32 srcZ, UInt32 dstName, OpenTK.Graphics.OpenGL.ArbCopyImage dstTarget, Int32 dstLevel, Int32 dstX, Int32 dstY, Int32 dstZ, Int32 srcWidth, Int32 srcHeight, Int32 srcDepth)
void CopyImageSubData(UInt32 srcName, OpenTK.Graphics.OpenGL.ImageTarget srcTarget, Int32 srcLevel, Int32 srcX, Int32 srcY, Int32 srcZ, UInt32 dstName, OpenTK.Graphics.OpenGL.ImageTarget dstTarget, Int32 dstLevel, Int32 dstX, Int32 dstY, Int32 dstZ, Int32 srcWidth, Int32 srcHeight, Int32 srcDepth)
{
#if DEBUG
using (new ErrorHelper(GraphicsContext.CurrentContext))
{
#endif
Delegates.glCopyImageSubData((UInt32)srcName, (OpenTK.Graphics.OpenGL.ArbCopyImage)srcTarget, (Int32)srcLevel, (Int32)srcX, (Int32)srcY, (Int32)srcZ, (UInt32)dstName, (OpenTK.Graphics.OpenGL.ArbCopyImage)dstTarget, (Int32)dstLevel, (Int32)dstX, (Int32)dstY, (Int32)dstZ, (Int32)srcWidth, (Int32)srcHeight, (Int32)srcDepth);
Delegates.glCopyImageSubData((UInt32)srcName, (OpenTK.Graphics.OpenGL.ImageTarget)srcTarget, (Int32)srcLevel, (Int32)srcX, (Int32)srcY, (Int32)srcZ, (UInt32)dstName, (OpenTK.Graphics.OpenGL.ImageTarget)dstTarget, (Int32)dstLevel, (Int32)dstX, (Int32)dstY, (Int32)dstZ, (Int32)srcWidth, (Int32)srcHeight, (Int32)srcDepth);
#if DEBUG
}
#endif

View file

@ -914,7 +914,7 @@ namespace OpenTK.Graphics.OpenGL
internal extern static void CopyConvolutionFilter2DEXT(OpenTK.Graphics.OpenGL.ExtConvolution target, OpenTK.Graphics.OpenGL.PixelInternalFormat internalformat, Int32 x, Int32 y, Int32 width, Int32 height);
[System.Security.SuppressUnmanagedCodeSecurity()]
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glCopyImageSubData", ExactSpelling = true)]
internal extern static void CopyImageSubData(UInt32 srcName, OpenTK.Graphics.OpenGL.ArbCopyImage srcTarget, Int32 srcLevel, Int32 srcX, Int32 srcY, Int32 srcZ, UInt32 dstName, OpenTK.Graphics.OpenGL.ArbCopyImage dstTarget, Int32 dstLevel, Int32 dstX, Int32 dstY, Int32 dstZ, Int32 srcWidth, Int32 srcHeight, Int32 srcDepth);
internal extern static void CopyImageSubData(UInt32 srcName, OpenTK.Graphics.OpenGL.ImageTarget srcTarget, Int32 srcLevel, Int32 srcX, Int32 srcY, Int32 srcZ, UInt32 dstName, OpenTK.Graphics.OpenGL.ImageTarget dstTarget, Int32 dstLevel, Int32 dstX, Int32 dstY, Int32 dstZ, Int32 srcWidth, Int32 srcHeight, Int32 srcDepth);
[System.Security.SuppressUnmanagedCodeSecurity()]
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glCopyImageSubDataNV", ExactSpelling = true)]
internal extern static void CopyImageSubDataNV(UInt32 srcName, OpenTK.Graphics.OpenGL.NvCopyImage srcTarget, Int32 srcLevel, Int32 srcX, Int32 srcY, Int32 srcZ, UInt32 dstName, OpenTK.Graphics.OpenGL.NvCopyImage dstTarget, Int32 dstLevel, Int32 dstX, Int32 dstY, Int32 dstZ, Int32 width, Int32 height, Int32 depth);

View file

@ -912,7 +912,7 @@ namespace OpenTK.Graphics.OpenGL
internal delegate void CopyConvolutionFilter2DEXT(OpenTK.Graphics.OpenGL.ExtConvolution target, OpenTK.Graphics.OpenGL.PixelInternalFormat internalformat, Int32 x, Int32 y, Int32 width, Int32 height);
internal static CopyConvolutionFilter2DEXT glCopyConvolutionFilter2DEXT;
[System.Security.SuppressUnmanagedCodeSecurity()]
internal delegate void CopyImageSubData(UInt32 srcName, OpenTK.Graphics.OpenGL.ArbCopyImage srcTarget, Int32 srcLevel, Int32 srcX, Int32 srcY, Int32 srcZ, UInt32 dstName, OpenTK.Graphics.OpenGL.ArbCopyImage dstTarget, Int32 dstLevel, Int32 dstX, Int32 dstY, Int32 dstZ, Int32 srcWidth, Int32 srcHeight, Int32 srcDepth);
internal delegate void CopyImageSubData(UInt32 srcName, OpenTK.Graphics.OpenGL.ImageTarget srcTarget, Int32 srcLevel, Int32 srcX, Int32 srcY, Int32 srcZ, UInt32 dstName, OpenTK.Graphics.OpenGL.ImageTarget dstTarget, Int32 dstLevel, Int32 dstX, Int32 dstY, Int32 dstZ, Int32 srcWidth, Int32 srcHeight, Int32 srcDepth);
internal static CopyImageSubData glCopyImageSubData;
[System.Security.SuppressUnmanagedCodeSecurity()]
internal delegate void CopyImageSubDataNV(UInt32 srcName, OpenTK.Graphics.OpenGL.NvCopyImage srcTarget, Int32 srcLevel, Int32 srcX, Int32 srcY, Int32 srcZ, UInt32 dstName, OpenTK.Graphics.OpenGL.NvCopyImage dstTarget, Int32 dstLevel, Int32 dstX, Int32 dstY, Int32 dstZ, Int32 width, Int32 height, Int32 depth);

View file

@ -740,10 +740,6 @@ namespace OpenTK.Graphics.OpenGL
/// </summary>
public enum All : int
{
/// <summary>
/// Original was GL_DEFAULT = 0
/// </summary>
Default = ((int)0) ,
/// <summary>
/// Original was GL_FALSE = 0
/// </summary>
@ -21421,7 +21417,7 @@ namespace OpenTK.Graphics.OpenGL
}
/// <summary>
/// Used in GL.CopyImageSubData
/// Not used directly.
/// </summary>
public enum ArbCopyImage : int
{
@ -29443,6 +29439,10 @@ namespace OpenTK.Graphics.OpenGL
[Flags]
public enum ClearBufferMask : int
{
/// <summary>
/// Original was GL_NONE = 0
/// </summary>
None = ((int)0) ,
/// <summary>
/// Original was GL_DEPTH_BUFFER_BIT = 0x00000100
/// </summary>
@ -39763,6 +39763,61 @@ namespace OpenTK.Graphics.OpenGL
SecondaryColorArrayListStrideIbm = ((int)103087) ,
}
/// <summary>
/// Used in GL.CopyImageSubData
/// </summary>
public enum ImageTarget : int
{
/// <summary>
/// Original was GL_TEXTURE_1D = 0x0DE0
/// </summary>
Texture1D = ((int)0x0DE0) ,
/// <summary>
/// Original was GL_TEXTURE_2D = 0x0DE1
/// </summary>
Texture2D = ((int)0x0DE1) ,
/// <summary>
/// Original was GL_TEXTURE_3D = 0x806F
/// </summary>
Texture3D = ((int)0x806F) ,
/// <summary>
/// Original was GL_TEXTURE_RECTANGLE = 0x84F5
/// </summary>
TextureRectangle = ((int)0x84F5) ,
/// <summary>
/// Original was GL_TEXTURE_CUBE_MAP = 0x8513
/// </summary>
TextureCubeMap = ((int)0x8513) ,
/// <summary>
/// Original was GL_TEXTURE_1D_ARRAY = 0x8C18
/// </summary>
Texture1DArray = ((int)0x8C18) ,
/// <summary>
/// Original was GL_TEXTURE_2D_ARRAY = 0x8C1A
/// </summary>
Texture2DArray = ((int)0x8C1A) ,
/// <summary>
/// Original was GL_TEXTURE_BUFFER = 0x8C2A
/// </summary>
TextureBuffer = ((int)0x8C2A) ,
/// <summary>
/// Original was GL_RENDERBUFFER = 0x8D41
/// </summary>
Renderbuffer = ((int)0x8D41) ,
/// <summary>
/// Original was GL_TEXTURE_CUBE_MAP_ARRAY = 0x9009
/// </summary>
TextureCubeMapArray = ((int)0x9009) ,
/// <summary>
/// Original was GL_TEXTURE_2D_MULTISAMPLE = 0x9100
/// </summary>
Texture2DMultisample = ((int)0x9100) ,
/// <summary>
/// Original was GL_TEXTURE_2D_MULTISAMPLE_ARRAY = 0x9102
/// </summary>
Texture2DMultisampleArray = ((int)0x9102) ,
}
/// <summary>
/// Not used directly.
/// </summary>
@ -48941,6 +48996,10 @@ namespace OpenTK.Graphics.OpenGL
/// </summary>
Right = ((int)0x0407) ,
/// <summary>
/// Original was GL_FRONT_AND_BACK = 0x0408
/// </summary>
FrontAndBack = ((int)0x0408) ,
/// <summary>
/// Original was GL_AUX0 = 0x0409
/// </summary>
Aux0 = ((int)0x0409) ,
@ -51761,6 +51820,57 @@ namespace OpenTK.Graphics.OpenGL
Int2101010Rev = ((int)0x8D9F) ,
}
/// <summary>
/// Not used directly.
/// </summary>
public enum TexImageTarget : int
{
/// <summary>
/// Original was GL_TEXTURE_1D = 0x0DE0
/// </summary>
Texture1D = ((int)0x0DE0) ,
/// <summary>
/// Original was GL_TEXTURE_2D = 0x0DE1
/// </summary>
Texture2D = ((int)0x0DE1) ,
/// <summary>
/// Original was GL_TEXTURE_3D = 0x806F
/// </summary>
Texture3D = ((int)0x806F) ,
/// <summary>
/// Original was GL_TEXTURE_RECTANGLE = 0x84F5
/// </summary>
TextureRectangle = ((int)0x84F5) ,
/// <summary>
/// Original was GL_TEXTURE_CUBE_MAP = 0x8513
/// </summary>
TextureCubeMap = ((int)0x8513) ,
/// <summary>
/// Original was GL_TEXTURE_1D_ARRAY = 0x8C18
/// </summary>
Texture1DArray = ((int)0x8C18) ,
/// <summary>
/// Original was GL_TEXTURE_2D_ARRAY = 0x8C1A
/// </summary>
Texture2DArray = ((int)0x8C1A) ,
/// <summary>
/// Original was GL_TEXTURE_BUFFER = 0x8C2A
/// </summary>
TextureBuffer = ((int)0x8C2A) ,
/// <summary>
/// Original was GL_TEXTURE_CUBE_MAP_ARRAY = 0x9009
/// </summary>
TextureCubeMapArray = ((int)0x9009) ,
/// <summary>
/// Original was GL_TEXTURE_2D_MULTISAMPLE = 0x9100
/// </summary>
Texture2DMultisample = ((int)0x9100) ,
/// <summary>
/// Original was GL_TEXTURE_2D_MULTISAMPLE_ARRAY = 0x9102
/// </summary>
Texture2DMultisampleArray = ((int)0x9102) ,
}
/// <summary>
/// Used in GL.BindImageTexture
/// </summary>
@ -60725,9 +60835,9 @@ namespace OpenTK.Graphics.OpenGL
public enum WaitSyncFlags : int
{
/// <summary>
/// Original was GL_DEFAULT = 0
/// Original was GL_NONE = 0
/// </summary>
Default = ((int)0) ,
None = ((int)0) ,
/// <summary>
/// Original was GL_SYNC_FLUSH_COMMANDS_BIT = 0x00000001
/// </summary>