Skip to content

Commit

Permalink
Adding GL_ARM_texture_unnormalized_coordinates. (#373)
Browse files Browse the repository at this point in the history
  • Loading branch information
janharaldfredriksen-arm committed Feb 24, 2020
1 parent 5f3fea0 commit c750b85
Show file tree
Hide file tree
Showing 14 changed files with 188 additions and 10 deletions.
22 changes: 22 additions & 0 deletions api/GL/glcorearb.h
Original file line number Diff line number Diff line change
Expand Up @@ -3838,6 +3838,12 @@ GLAPI void APIENTRY glTexBufferARB (GLenum target, GLenum internalformat, GLuint

#ifndef GL_ARB_viewport_array
#define GL_ARB_viewport_array 1
typedef void (APIENTRYP PFNGLDEPTHRANGEARRAYDVNVPROC) (GLuint first, GLsizei count, const GLdouble *v);
typedef void (APIENTRYP PFNGLDEPTHRANGEINDEXEDDNVPROC) (GLuint index, GLdouble n, GLdouble f);
#ifdef GL_GLEXT_PROTOTYPES
GLAPI void APIENTRY glDepthRangeArraydvNV (GLuint first, GLsizei count, const GLdouble *v);
GLAPI void APIENTRY glDepthRangeIndexeddNV (GLuint index, GLdouble n, GLdouble f);
#endif
#endif /* GL_ARB_viewport_array */

#ifndef GL_KHR_blend_equation_advanced
Expand Down Expand Up @@ -5028,6 +5034,22 @@ GLAPI void APIENTRY glConservativeRasterParameteriNV (GLenum pname, GLint param)
#define GL_NV_conservative_raster_underestimation 1
#endif /* GL_NV_conservative_raster_underestimation */

#ifndef GL_NV_depth_buffer_float
#define GL_NV_depth_buffer_float 1
#define GL_DEPTH_COMPONENT32F_NV 0x8DAB
#define GL_DEPTH32F_STENCIL8_NV 0x8DAC
#define GL_FLOAT_32_UNSIGNED_INT_24_8_REV_NV 0x8DAD
#define GL_DEPTH_BUFFER_FLOAT_MODE_NV 0x8DAF
typedef void (APIENTRYP PFNGLDEPTHRANGEDNVPROC) (GLdouble zNear, GLdouble zFar);
typedef void (APIENTRYP PFNGLCLEARDEPTHDNVPROC) (GLdouble depth);
typedef void (APIENTRYP PFNGLDEPTHBOUNDSDNVPROC) (GLdouble zmin, GLdouble zmax);
#ifdef GL_GLEXT_PROTOTYPES
GLAPI void APIENTRY glDepthRangedNV (GLdouble zNear, GLdouble zFar);
GLAPI void APIENTRY glClearDepthdNV (GLdouble depth);
GLAPI void APIENTRY glDepthBoundsdNV (GLdouble zmin, GLdouble zmax);
#endif
#endif /* GL_NV_depth_buffer_float */

#ifndef GL_NV_draw_vulkan_image
#define GL_NV_draw_vulkan_image 1
typedef void (APIENTRY *GLVULKANPROCNV)(void);
Expand Down
8 changes: 7 additions & 1 deletion api/GL/glext.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ extern "C" {
#define GLAPI extern
#endif

#define GL_GLEXT_VERSION 20191206
#define GL_GLEXT_VERSION 20200221

#include <KHR/khrplatform.h>

Expand Down Expand Up @@ -4892,6 +4892,12 @@ GLAPI GLint APIENTRY glGetAttribLocationARB (GLhandleARB programObj, const GLcha

#ifndef GL_ARB_viewport_array
#define GL_ARB_viewport_array 1
typedef void (APIENTRYP PFNGLDEPTHRANGEARRAYDVNVPROC) (GLuint first, GLsizei count, const GLdouble *v);
typedef void (APIENTRYP PFNGLDEPTHRANGEINDEXEDDNVPROC) (GLuint index, GLdouble n, GLdouble f);
#ifdef GL_GLEXT_PROTOTYPES
GLAPI void APIENTRY glDepthRangeArraydvNV (GLuint first, GLsizei count, const GLdouble *v);
GLAPI void APIENTRY glDepthRangeIndexeddNV (GLuint index, GLdouble n, GLdouble f);
#endif
#endif /* GL_ARB_viewport_array */

#ifndef GL_ARB_window_pos
Expand Down
2 changes: 1 addition & 1 deletion api/GL/glxext.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ extern "C" {
** https://github.com/KhronosGroup/OpenGL-Registry
*/

#define GLX_GLXEXT_VERSION 20191029
#define GLX_GLXEXT_VERSION 20200219

/* Generated C header for:
* API: glx
Expand Down
2 changes: 1 addition & 1 deletion api/GL/wgl.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ extern "C" {
#include <windows.h>
#endif

/* Generated on date 20191029 */
/* Generated on date 20200219 */

/* Generated C header for:
* API: wgl
Expand Down
2 changes: 1 addition & 1 deletion api/GL/wglext.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ extern "C" {
#include <windows.h>
#endif

#define WGL_WGLEXT_VERSION 20191029
#define WGL_WGLEXT_VERSION 20200219

/* Generated C header for:
* API: wgl
Expand Down
2 changes: 1 addition & 1 deletion api/GLES/gl.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ extern "C" {

#include <GLES/glplatform.h>

/* Generated on date 20191206 */
/* Generated on date 20200221 */

/* Generated C header for:
* API: gles1
Expand Down
2 changes: 1 addition & 1 deletion api/GLES/glext.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ extern "C" {
#define GL_APIENTRYP GL_APIENTRY*
#endif

/* Generated on date 20191206 */
/* Generated on date 20200221 */

/* Generated C header for:
* API: gles1
Expand Down
2 changes: 1 addition & 1 deletion api/GLES2/gl2.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ extern "C" {
#define GL_GLES_PROTOTYPES 1
#endif

/* Generated on date 20191206 */
/* Generated on date 20200221 */

/* Generated C header for:
* API: gles2
Expand Down
7 changes: 6 additions & 1 deletion api/GLES2/gl2ext.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ extern "C" {
#define GL_APIENTRYP GL_APIENTRY*
#endif

/* Generated on date 20191206 */
/* Generated on date 20200221 */

/* Generated C header for:
* API: gles2
Expand Down Expand Up @@ -1081,6 +1081,11 @@ GL_APICALL void GL_APIENTRY glGetSyncivAPPLE (GLsync sync, GLenum pname, GLsizei
#define GL_ARM_shader_framebuffer_fetch_depth_stencil 1
#endif /* GL_ARM_shader_framebuffer_fetch_depth_stencil */

#ifndef GL_ARM_texture_unnormalized_coordinates
#define GL_ARM_texture_unnormalized_coordinates 1
#define GL_TEXTURE_UNNORMALIZED_COORDINATES_ARM 0x8F6A
#endif /* GL_ARM_texture_unnormalized_coordinates */

#ifndef GL_DMP_program_binary
#define GL_DMP_program_binary 1
#define GL_SMAPHS30_PROGRAM_BINARY_DMP 0x9251
Expand Down
2 changes: 1 addition & 1 deletion api/GLES3/gl3.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ extern "C" {
#define GL_GLES_PROTOTYPES 1
#endif

/* Generated on date 20191206 */
/* Generated on date 20200221 */

/* Generated C header for:
* API: gles2
Expand Down
132 changes: 132 additions & 0 deletions extensions/ARM/ARM_texture_unnormalized_coordinates.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,132 @@
Name
ARM_texture_unnormalized_coordinates

Name Strings

GL_ARM_texture_unnormalized_coordinates

Contact

Jan-Harald Fredriksen ( jan-harald.fredriksen 'at' arm.com)

Contributors

Jan-Harald Fredriksen, ARM

Status

Complete

Version

Last Modified Date: December 17, 2019
Revision: 1

Number

324

Dependencies

OpenGL ES 3.0 is required.
This extension is written against OpenGL ES 3.2, May 14th 2018.

Overview

This extension provides the option to switch to unnormalized
coordinates for texture lookups using a sampler parameter.

Texture lookup in OpenGL ES is done using normalized coordinates. For
certain applications it is convenient to work with non-normalized
coordinates instead. It also beneficial to keep support for bilinear
filtering.

Additional restrictions apply to textures with non-normalized
coordinates that affect texture completeness and the available
texture lookup functions.

IP Status

No known IP claims.

New Procedures and Functions

None

New Tokens

Accepted by the <pname> parameter of TexParameteri, TexParameterf,
TexParameteriv, TexParameterfv, SamplerParameteri, SamplerParameterf,
SamplerParameteriv, SamplerParameterfv, TexParameterIivEXT,
TexParameterIuivEXT, SamplerParameterIivEXT, SamplerParameterIuivEXT,
GetTexParameteriv, GetTexParameterfv, GetTexParameterIivEXT,
GetTexParameterIuivEXT, GetSamplerParameteriv, GetSamplerParameterfv,
GetSamplerParameterIivEXT, and GetSamplerParameterIuivEXT:

TEXTURE_UNNORMALIZED_COORDINATES_ARM 0x8F6A

Additions to Chapter 8 of the OpenGL ES 3.2 Specification (Textures and Samplers)

Add a section after section 8.15 (Texture Magnification)

8.xx Unnormalized coordinates

If the value of TEXTURE_UNNORMALIZED_COORDINATES_ARM is TRUE, then the range
of the coordinates used to lookup the texture value is in the range of zero
to the texture dimensions for x, y and z, rather than in the range of zero
to one.

When the value of TEXTURE_UNNORMALIZED_COORDINATES_ARM is TRUE,
equation 8.9 is not used. Instead, let
u(x; y) = s(x; y)
v(x; y) = t(x; y)
w(x; y) = r(x; y)

When the value of TEXTURE_UNNORMALIZED_COORDINATES_ARM is TRUE, results of
a texture lookup are undefined if any of the following conditions is true:
- the texture access is performed with a lookup functions that supports
texel offsets
- the texture access is performed with a lookup functions with projection


Add to 8.17 Texture Completeness

Add to the conditions for texture completeness below "Using the preceding
definitions, a texture is complete unless any of the following conditions
hold true:":

* The value of TEXTURE_UNNORMALIZED_COORDINATES_ARM is TRUE, and any of
** the texture is not a two-dimensional texture
** the minification filter is not NEAREST
** the magnification is not NEAREST
** the value of TEXTURE_BASE_LEVEL is not 0
** the value of TEXTURE_WRAP_S and TEXTURE_WRAP_T is not CLAMP_TO_EDGE nor CLAMP_TO_BORDER
** the value of TEXTURE_COMPARE_MODE is not NONE

Errors

None.

New State

Modify Table 21.12: Textures (state per sampler object)

Add the following parameter:

Get Value Type Get Command Value Description Sec.
------------------------------------- ----- ------------------- ------- ------------------- ----
TEXTURE_UNNORMALIZED_COORDINATES_ARM B GetSamplerParameter FALSE unnormalized coords 8.xx

New Implementation Dependent State

None

Issues

None

Revision History

Rev. Date Author Changes
---- ---------- -------- -----------------------------------------
1 2019-12-17 jhf initial version
2 changes: 2 additions & 0 deletions extensions/esext.php
Original file line number Diff line number Diff line change
Expand Up @@ -673,4 +673,6 @@
</li>
<li value=323><a href="extensions/INTEL/INTEL_shader_integer_functions2.txt">GL_INTEL_shader_integer_functions2</a>
</li>
<li value=324><a href="extensions/ARM/ARM_texture_unnormalized_coordinates.txt">GL_ARM_texture_unnormalized_coordinates</a>
</li>
</ol>
5 changes: 5 additions & 0 deletions extensions/registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -1414,6 +1414,11 @@
'flags' : { 'public' },
'url' : 'extensions/ARM/ARM_shader_framebuffer_fetch_depth_stencil.txt',
},
'GL_ARM_texture_unnormalized_coordinates' : {
'esnumber' : 324,
'flags' : { 'public' },
'url' : 'extensions/ARM/ARM_texture_unnormalized_coordinates.txt',
},
'GL_ATI_draw_buffers' : {
'number' : 277,
'flags' : { 'public' },
Expand Down
8 changes: 7 additions & 1 deletion xml/gl.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10339,7 +10339,8 @@ typedef unsigned int GLhandleARB;
<enum value="0x8F67" name="GL_MAX_SHADER_PIXEL_LOCAL_STORAGE_SIZE_EXT"/>
<unused start="0x8F68" vendor="ARM"/>
<enum value="0x8F69" name="GL_TEXTURE_ASTC_DECODE_PRECISION_EXT"/>
<unused start="0x8F6A" end="0x8F6F" vendor="ARM"/>
<enum value="0x8F6A" name="GL_TEXTURE_UNNORMALIZED_COORDINATES_ARM" group="SamplerParameterF,SamplerParameterI,GetTextureParameter,TextureParameterName"/>
<unused start="0x8F6B" end="0x8F6F" vendor="ARM"/>
</enums>

<enums namespace="GL" start="0x8F70" end="0x8F7F" vendor="HI" comment="For Mark Callow, Khronos bug 4055. Shared with EGL.">
Expand Down Expand Up @@ -44079,6 +44080,11 @@ typedef unsigned int GLhandleARB;
</require>
</extension>
<extension name="GL_ARM_shader_framebuffer_fetch_depth_stencil" supported="gles2"/>
<extension name="GL_ARM_texture_unnormalized_coordinates" supported="gles2">
<require>
<enum name="GL_TEXTURE_UNNORMALIZED_COORDINATES_ARM"/>
</require>
</extension>
<extension name="GL_ATI_draw_buffers" supported="gl">
<require>
<enum name="GL_MAX_DRAW_BUFFERS_ATI"/>
Expand Down

0 comments on commit c750b85

Please sign in to comment.