diff options
author | Ilia Mirkin <[email protected]> | 2019-02-12 21:32:27 -0500 |
---|---|---|
committer | Ilia Mirkin <[email protected]> | 2019-02-18 12:13:54 -0500 |
commit | 070a5e5d9248a77aa84375f74fe48c5067362ea8 (patch) | |
tree | c24b06fe2bec5e2a636c54fff2bb6640d970c13b /src/mesa/main/draw_validate.c | |
parent | 47616810ed7cfce21d239391131ad9a5ef558b52 (diff) |
mesa: add explicit enable for EXT_float_blend, and error condition
If EXT_float_blend is not supported, error out on blending of FP32
attachments in an ES2 context.
Signed-off-by: Ilia Mirkin <[email protected]>
Reviewed-by: Tapani Pälli <[email protected]>
Reviewed-by: Jason Ekstrand <[email protected]>
Diffstat (limited to 'src/mesa/main/draw_validate.c')
-rw-r--r-- | src/mesa/main/draw_validate.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/mesa/main/draw_validate.c b/src/mesa/main/draw_validate.c index b715a27f8b7..779cd1c12c7 100644 --- a/src/mesa/main/draw_validate.c +++ b/src/mesa/main/draw_validate.c @@ -304,6 +304,25 @@ check_valid_to_render(struct gl_context *ctx, const char *function) "%s(tess ctrl shader is missing)", function); return false; } + + /* From GL_EXT_color_buffer_float: + * + * "Blending applies only if the color buffer has a fixed-point or + * or floating-point format. If the color buffer has an integer + * format, proceed to the next operation. Furthermore, an + * INVALID_OPERATION error is generated by DrawArrays and the other + * drawing commands defined in section 2.8.3 (10.5 in ES 3.1) if + * blending is enabled (see below) and any draw buffer has 32-bit + * floating-point format components." + * + * However GL_EXT_float_blend removes this text. + */ + if (!ctx->Extensions.EXT_float_blend && + (ctx->DrawBuffer->_FP32Buffers & ctx->Color.BlendEnabled)) { + _mesa_error(ctx, GL_INVALID_OPERATION, + "%s(32-bit float output + blending)", function); + return false; + } break; case API_OPENGL_CORE: |