--- /dev/null
+<?xml version="1.0"?>
+<!DOCTYPE OpenGLAPI SYSTEM "gl_API.dtd">
+
+<!-- Note: no GLX protocol info yet. -->
+
+<OpenGLAPI>
+
+<category name="GL_NV_viewport_swizzle" number="483">
+
+ <function name="ViewportSwizzleNV" no_error="true" es2="3.1">
+ <param name="index" type="GLuint"/>
+ <param name="swizzlex" type="GLenum"/>
+ <param name="swizzley" type="GLenum"/>
+ <param name="swizzlez" type="GLenum"/>
+ <param name="swizzlew" type="GLenum"/>
+ </function>
+
+ <enum name="VIEWPORT_SWIZZLE_POSITIVE_X_NV" value="0x9350"/>
+ <enum name="VIEWPORT_SWIZZLE_NEGATIVE_X_NV" value="0x9351"/>
+ <enum name="VIEWPORT_SWIZZLE_POSITIVE_Y_NV" value="0x9352"/>
+ <enum name="VIEWPORT_SWIZZLE_NEGATIVE_Y_NV" value="0x9353"/>
+ <enum name="VIEWPORT_SWIZZLE_POSITIVE_Z_NV" value="0x9354"/>
+ <enum name="VIEWPORT_SWIZZLE_NEGATIVE_Z_NV" value="0x9355"/>
+ <enum name="VIEWPORT_SWIZZLE_POSITIVE_W_NV" value="0x9358"/>
+ <enum name="VIEWPORT_SWIZZLE_NEGATIVE_W_NV" value="0x9357"/>
+
+ <enum name="VIEWPORT_SWIZZLE_X_NV" value="0x9358"/>
+ <enum name="VIEWPORT_SWIZZLE_Y_NV" value="0x9359"/>
+ <enum name="VIEWPORT_SWIZZLE_Z_NV" value="0x935A"/>
+ <enum name="VIEWPORT_SWIZZLE_W_NV" value="0x935B"/>
+
+</category>
+
+</OpenGLAPI>
<xi:include href="EXT_external_objects.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
<xi:include href="EXT_external_objects_fd.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
+<xi:include href="NV_viewport_swizzle.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
+
<xi:include href="GL4x.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
</OpenGLAPI>
'NV_primitive_restart.xml',
'NV_texture_barrier.xml',
'NV_vdpau_interop.xml',
+ 'NV_viewport_swizzle.xml',
'OES_EGL_image.xml',
'OES_fixed_point.xml',
'OES_single_precision.xml',
"EGLImageTargetTexStorageEXT" : 1605,
"EGLImageTargetTextureStorageEXT" : 1606,
"CopyImageSubDataNV": 1607,
+ "ViewportSwizzleNV": 1608,
}
functions = [
EXT(NV_texture_env_combine4 , NV_texture_env_combine4 , GLL, x , x , x , 1999)
EXT(NV_texture_rectangle , NV_texture_rectangle , GLL, x , x , x , 2000)
EXT(NV_vdpau_interop , NV_vdpau_interop , GLL, GLC, x , x , 2010)
+EXT(NV_viewport_swizzle , NV_viewport_swizzle , GLL, GLC, x , 31, 2015)
EXT(OES_EGL_image , OES_EGL_image , GLL, GLC, ES1, ES2, 2006) /* FIXME: Mesa expects GL_OES_EGL_image to be available in OpenGL contexts. */
EXT(OES_EGL_image_external , OES_EGL_image_external , x , x , ES1, ES2, 2010)
EXTRA_EXT(ARB_sample_locations);
EXTRA_EXT(AMD_framebuffer_multisample_advanced);
EXTRA_EXT(ARB_spirv_extensions);
+EXTRA_EXT(NV_viewport_swizzle);
static const int
extra_ARB_color_buffer_float_or_glcore[] = {
memcpy(v->value_int_n.ints, ctx->Const.SupportedMultisampleModes,
v->value_int_n.n * sizeof(GLint));
break;
+
+ /* GL_NV_viewport_swizzle */
+ case GL_VIEWPORT_SWIZZLE_X_NV:
+ v->value_enum = ctx->ViewportArray[0].SwizzleX;
+ break;
+ case GL_VIEWPORT_SWIZZLE_Y_NV:
+ v->value_enum = ctx->ViewportArray[0].SwizzleY;
+ break;
+ case GL_VIEWPORT_SWIZZLE_Z_NV:
+ v->value_enum = ctx->ViewportArray[0].SwizzleZ;
+ break;
+ case GL_VIEWPORT_SWIZZLE_W_NV:
+ v->value_enum = ctx->ViewportArray[0].SwizzleW;
+ break;
}
}
goto invalid_enum;
v->value_matrix = ctx->TextureMatrixStack[index].Top;
return TYPE_MATRIX_T;
+ /* GL_NV_viewport_swizzle */
+ case GL_VIEWPORT_SWIZZLE_X_NV:
+ if (!ctx->Extensions.NV_viewport_swizzle)
+ goto invalid_enum;
+ if (index >= ctx->Const.MaxViewports)
+ goto invalid_value;
+ v->value_int = ctx->ViewportArray[index].SwizzleX;
+ return TYPE_INT;
+ case GL_VIEWPORT_SWIZZLE_Y_NV:
+ if (!ctx->Extensions.NV_viewport_swizzle)
+ goto invalid_enum;
+ if (index >= ctx->Const.MaxViewports)
+ goto invalid_value;
+ v->value_int = ctx->ViewportArray[index].SwizzleY;
+ return TYPE_INT;
+ case GL_VIEWPORT_SWIZZLE_Z_NV:
+ if (!ctx->Extensions.NV_viewport_swizzle)
+ goto invalid_enum;
+ if (index >= ctx->Const.MaxViewports)
+ goto invalid_value;
+ v->value_int = ctx->ViewportArray[index].SwizzleZ;
+ return TYPE_INT;
+ case GL_VIEWPORT_SWIZZLE_W_NV:
+ if (!ctx->Extensions.NV_viewport_swizzle)
+ goto invalid_enum;
+ if (index >= ctx->Const.MaxViewports)
+ goto invalid_value;
+ v->value_int = ctx->ViewportArray[index].SwizzleW;
+ return TYPE_INT;
}
invalid_enum:
# INTEL_conservative_rasterization
[ "CONSERVATIVE_RASTERIZATION_INTEL", "CONTEXT_BOOL(IntelConservativeRasterization), extra_INTEL_conservative_rasterization" ],
+
+# GL_NV_viewport_swizzle
+ [ "VIEWPORT_SWIZZLE_X_NV", "LOC_CUSTOM, TYPE_ENUM, 0, extra_NV_viewport_swizzle" ],
+ [ "VIEWPORT_SWIZZLE_Y_NV", "LOC_CUSTOM, TYPE_ENUM, 0, extra_NV_viewport_swizzle" ],
+ [ "VIEWPORT_SWIZZLE_Z_NV", "LOC_CUSTOM, TYPE_ENUM, 0, extra_NV_viewport_swizzle" ],
+ [ "VIEWPORT_SWIZZLE_W_NV", "LOC_CUSTOM, TYPE_ENUM, 0, extra_NV_viewport_swizzle" ],
]},
# Enums in OpenGL and ES 3.2
GLfloat X, Y; /**< position */
GLfloat Width, Height; /**< size */
GLfloat Near, Far; /**< Depth buffer range */
+
+ /**< GL_NV_viewport_swizzle */
+ GLenum16 SwizzleX, SwizzleY, SwizzleZ, SwizzleW;
};
GLboolean NV_conservative_raster_dilate;
GLboolean NV_conservative_raster_pre_snap_triangles;
GLboolean NV_conservative_raster_pre_snap;
+ GLboolean NV_viewport_swizzle;
GLboolean NVX_gpu_memory_info;
GLboolean TDFX_texture_compression_FXT1;
GLboolean OES_EGL_image;
{ "glProgramUniform3ui64vARB", 40, -1 },
{ "glProgramUniform4ui64vARB", 40, -1 },
+ /* GL_NV_viewport_swizzle */
+ { "glViewportSwizzleNV", 11, -1 },
+
{ NULL, 0, -1 }
};
{ "glNamedFramebufferSampleLocationsfvARB", 31, -1 },
{ "glEvaluateDepthValuesARB", 31, -1 },
+ /* GL_NV_viewport_swizzle */
+ { "glViewportSwizzleNV", 31, -1 },
+
{ NULL, 0, -1 },
};
ctx->ViewportArray[i].Height = 0;
ctx->ViewportArray[i].Near = 0.0;
ctx->ViewportArray[i].Far = 1.0;
+ ctx->ViewportArray[i].SwizzleX = GL_VIEWPORT_SWIZZLE_POSITIVE_X_NV;
+ ctx->ViewportArray[i].SwizzleY = GL_VIEWPORT_SWIZZLE_POSITIVE_Y_NV;
+ ctx->ViewportArray[i].SwizzleZ = GL_VIEWPORT_SWIZZLE_POSITIVE_Z_NV;
+ ctx->ViewportArray[i].SwizzleW = GL_VIEWPORT_SWIZZLE_POSITIVE_W_NV;
}
ctx->SubpixelPrecisionBias[0] = 0;
subpixel_precision_bias(ctx, xbits, ybits);
}
+
+static void
+set_viewport_swizzle(struct gl_context *ctx, GLuint index,
+ GLenum swizzlex, GLenum swizzley,
+ GLenum swizzlez, GLenum swizzlew)
+{
+ struct gl_viewport_attrib *viewport = &ctx->ViewportArray[index];
+ if (viewport->SwizzleX == swizzlex &&
+ viewport->SwizzleY == swizzley &&
+ viewport->SwizzleZ == swizzlez &&
+ viewport->SwizzleW == swizzlew)
+ return;
+
+ FLUSH_VERTICES(ctx, _NEW_VIEWPORT);
+ ctx->NewDriverState |= ctx->DriverFlags.NewViewport;
+
+ viewport->SwizzleX = swizzlex;
+ viewport->SwizzleY = swizzley;
+ viewport->SwizzleZ = swizzlez;
+ viewport->SwizzleW = swizzlew;
+}
+
+void GLAPIENTRY
+_mesa_ViewportSwizzleNV_no_error(GLuint index,
+ GLenum swizzlex, GLenum swizzley,
+ GLenum swizzlez, GLenum swizzlew)
+{
+ GET_CURRENT_CONTEXT(ctx);
+
+ if (MESA_VERBOSE & VERBOSE_API)
+ _mesa_debug(ctx, "glViewportSwizzleNV(%x, %x, %x, %x)\n",
+ swizzlex, swizzley, swizzlez, swizzlew);
+
+ set_viewport_swizzle(ctx, index, swizzlex, swizzley, swizzlez, swizzlew);
+}
+
+static bool
+verify_viewport_swizzle(GLenum swizzle)
+{
+ return swizzle >= GL_VIEWPORT_SWIZZLE_POSITIVE_X_NV &&
+ swizzle <= GL_VIEWPORT_SWIZZLE_NEGATIVE_W_NV;
+}
+
+void GLAPIENTRY
+_mesa_ViewportSwizzleNV(GLuint index,
+ GLenum swizzlex, GLenum swizzley,
+ GLenum swizzlez, GLenum swizzlew)
+{
+ GET_CURRENT_CONTEXT(ctx);
+
+ if (MESA_VERBOSE & VERBOSE_API)
+ _mesa_debug(ctx, "glViewportSwizzleNV(%x, %x, %x, %x)\n",
+ swizzlex, swizzley, swizzlez, swizzlew);
+
+ if (!ctx->Extensions.NV_viewport_swizzle) {
+ _mesa_error(ctx, GL_INVALID_OPERATION,
+ "glViewportSwizzleNV not supported");
+ return;
+ }
+
+ if (index >= ctx->Const.MaxViewports) {
+ _mesa_error(ctx, GL_INVALID_VALUE,
+ "glViewportSwizzleNV: index (%d) >= MaxViewports (%d)",
+ index, ctx->Const.MaxViewports);
+ return;
+ }
+
+ if (!verify_viewport_swizzle(swizzlex)) {
+ _mesa_error(ctx, GL_INVALID_ENUM,
+ "glViewportSwizzleNV(swizzlex=%x)", swizzlex);
+ return;
+ }
+
+ if (!verify_viewport_swizzle(swizzley)) {
+ _mesa_error(ctx, GL_INVALID_ENUM,
+ "glViewportSwizzleNV(swizzley=%x)", swizzley);
+ return;
+ }
+
+ if (!verify_viewport_swizzle(swizzlez)) {
+ _mesa_error(ctx, GL_INVALID_ENUM,
+ "glViewportSwizzleNV(swizzlez=%x)", swizzlez);
+ return;
+ }
+
+ if (!verify_viewport_swizzle(swizzlew)) {
+ _mesa_error(ctx, GL_INVALID_ENUM,
+ "glViewportSwizzleNV(swizzlew=%x)", swizzlew);
+ return;
+ }
+
+ set_viewport_swizzle(ctx, index, swizzlex, swizzley, swizzlez, swizzlew);
+}
extern void GLAPIENTRY
_mesa_SubpixelPrecisionBiasNV(GLuint xbits, GLuint ybits);
+extern void GLAPIENTRY
+_mesa_ViewportSwizzleNV_no_error(GLuint index,
+ GLenum swizzlex, GLenum swizzley,
+ GLenum swizzlez, GLenum swizzlew);
+
+extern void GLAPIENTRY
+_mesa_ViewportSwizzleNV(GLuint index,
+ GLenum swizzlex, GLenum swizzley,
+ GLenum swizzlez, GLenum swizzlew);
+
#endif