return GL_FALSE;
}
+ /* From the GL_NV_fill_rectangle spec:
+ *
+ * "An INVALID_OPERATION error is generated by Begin or any Draw command if
+ * only one of the front and back polygon mode is FILL_RECTANGLE_NV."
+ */
+ if ((ctx->Polygon.FrontMode == GL_FILL_RECTANGLE_NV) !=
+ (ctx->Polygon.BackMode == GL_FILL_RECTANGLE_NV)) {
+ _mesa_error(ctx, GL_INVALID_OPERATION,
+ "GL_FILL_RECTANGLE_NV must be used as both front/back "
+ "polygon mode or neither");
+ return GL_FALSE;
+ }
+
#ifdef DEBUG
if (ctx->_Shader->Flags & GLSL_LOG) {
struct gl_program **prog = ctx->_Shader->CurrentProgram;
EXT(NV_depth_clamp , ARB_depth_clamp , GLL, GLC, x , x , 2001)
EXT(NV_draw_buffers , dummy_true , x , x , x , ES2, 2011)
EXT(NV_fbo_color_attachments , dummy_true , x , x , x , ES2, 2010)
+EXT(NV_fill_rectangle , NV_fill_rectangle , GLL, GLC, x , x , 2015)
EXT(NV_fog_distance , NV_fog_distance , GLL, x , x , x , 2001)
EXT(NV_image_formats , ARB_shader_image_load_store , x , x , x , 31, 2014)
EXT(NV_light_max_exponent , dummy_true , GLL, x , x , x , 1999)
GLboolean MESA_shader_integer_functions;
GLboolean MESA_ycbcr_texture;
GLboolean NV_conditional_render;
+ GLboolean NV_fill_rectangle;
GLboolean NV_fog_distance;
GLboolean NV_point_sprite;
GLboolean NV_primitive_restart;
_mesa_enum_to_string(face),
_mesa_enum_to_string(mode));
- if (mode!=GL_POINT && mode!=GL_LINE && mode!=GL_FILL) {
- _mesa_error( ctx, GL_INVALID_ENUM, "glPolygonMode(mode)" );
+ switch (mode) {
+ case GL_POINT:
+ case GL_LINE:
+ case GL_FILL:
+ break;
+ case GL_FILL_RECTANGLE_NV:
+ if (ctx->Extensions.NV_fill_rectangle)
+ break;
+ /* fall-through */
+ default:
+ _mesa_error(ctx, GL_INVALID_ENUM, "glPolygonMode(mode)");
return;
}