Commit a7e1d9aa by Geoff Lang

Only validate that color and alpha blend funcs are non-constant on D3D renderers.

BUG=angleproject:1025 Change-Id: I9c6008cc2f268bda4afa2c67e0b3d3716e77ea31 Reviewed-on: https://chromium-review.googlesource.com/296681Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org> Tested-by: 's avatarGeoff Lang <geofflang@chromium.org>
parent 814a54dd
...@@ -206,7 +206,8 @@ Limitations::Limitations() ...@@ -206,7 +206,8 @@ Limitations::Limitations()
noSampleAlphaToCoverageSupport(false), noSampleAlphaToCoverageSupport(false),
attributeZeroRequiresZeroDivisorInEXT(false), attributeZeroRequiresZeroDivisorInEXT(false),
noSeparateStencilRefsAndMasks(false), noSeparateStencilRefsAndMasks(false),
shadersRequireIndexedLoopValidation(false) shadersRequireIndexedLoopValidation(false),
noSimultaneousConstantColorAndAlphaBlendFunc(false)
{ {
} }
......
...@@ -252,6 +252,10 @@ struct Limitations ...@@ -252,6 +252,10 @@ struct Limitations
// Renderer doesn't support non-constant indexing loops in fragment shader // Renderer doesn't support non-constant indexing loops in fragment shader
bool shadersRequireIndexedLoopValidation; bool shadersRequireIndexedLoopValidation;
// Renderer doesn't support Simultaneous use of GL_CONSTANT_ALPHA/GL_ONE_MINUS_CONSTANT_ALPHA
// and GL_CONSTANT_COLOR/GL_ONE_MINUS_CONSTANT_COLOR blend functions.
bool noSimultaneousConstantColorAndAlphaBlendFunc;
}; };
struct TypePrecision struct TypePrecision
......
...@@ -1185,6 +1185,9 @@ void GenerateCaps(ID3D11Device *device, ID3D11DeviceContext *deviceContext, cons ...@@ -1185,6 +1185,9 @@ void GenerateCaps(ID3D11Device *device, ID3D11DeviceContext *deviceContext, cons
// state. // state.
limitations->noSeparateStencilRefsAndMasks = true; limitations->noSeparateStencilRefsAndMasks = true;
// D3D11 cannot support constant color and alpha blend funcs together
limitations->noSimultaneousConstantColorAndAlphaBlendFunc = true;
#ifdef ANGLE_ENABLE_WINDOWS_STORE #ifdef ANGLE_ENABLE_WINDOWS_STORE
// Setting a non-zero divisor on attribute zero doesn't work on certain Windows Phone 8-era devices. // Setting a non-zero divisor on attribute zero doesn't work on certain Windows Phone 8-era devices.
// We should prevent developers from doing this on ALL Windows Store devices. This will maintain consistency across all Windows devices. // We should prevent developers from doing this on ALL Windows Store devices. This will maintain consistency across all Windows devices.
......
...@@ -572,6 +572,9 @@ void GenerateCaps(IDirect3D9 *d3d9, ...@@ -572,6 +572,9 @@ void GenerateCaps(IDirect3D9 *d3d9,
// index/loop limitations are necessary. Workarounds that are needed to // index/loop limitations are necessary. Workarounds that are needed to
// support dynamic indexing of vectors on HLSL also don't work on D3D9. // support dynamic indexing of vectors on HLSL also don't work on D3D9.
limitations->shadersRequireIndexedLoopValidation = true; limitations->shadersRequireIndexedLoopValidation = true;
// D3D9 cannot support constant color and alpha blend funcs together
limitations->noSimultaneousConstantColorAndAlphaBlendFunc = true;
} }
} }
......
...@@ -444,17 +444,25 @@ void GL_APIENTRY BlendFuncSeparate(GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha ...@@ -444,17 +444,25 @@ void GL_APIENTRY BlendFuncSeparate(GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha
return; return;
} }
bool constantColorUsed = (srcRGB == GL_CONSTANT_COLOR || srcRGB == GL_ONE_MINUS_CONSTANT_COLOR || if (context->getLimitations().noSimultaneousConstantColorAndAlphaBlendFunc)
dstRGB == GL_CONSTANT_COLOR || dstRGB == GL_ONE_MINUS_CONSTANT_COLOR); {
bool constantColorUsed =
(srcRGB == GL_CONSTANT_COLOR || srcRGB == GL_ONE_MINUS_CONSTANT_COLOR ||
dstRGB == GL_CONSTANT_COLOR || dstRGB == GL_ONE_MINUS_CONSTANT_COLOR);
bool constantAlphaUsed = (srcRGB == GL_CONSTANT_ALPHA || srcRGB == GL_ONE_MINUS_CONSTANT_ALPHA || bool constantAlphaUsed =
dstRGB == GL_CONSTANT_ALPHA || dstRGB == GL_ONE_MINUS_CONSTANT_ALPHA); (srcRGB == GL_CONSTANT_ALPHA || srcRGB == GL_ONE_MINUS_CONSTANT_ALPHA ||
dstRGB == GL_CONSTANT_ALPHA || dstRGB == GL_ONE_MINUS_CONSTANT_ALPHA);
if (constantColorUsed && constantAlphaUsed) if (constantColorUsed && constantAlphaUsed)
{ {
ERR("Simultaneous use of GL_CONSTANT_ALPHA/GL_ONE_MINUS_CONSTANT_ALPHA and GL_CONSTANT_COLOR/GL_ONE_MINUS_CONSTANT_COLOR invalid under WebGL"); ERR(
context->recordError(Error(GL_INVALID_OPERATION)); "Simultaneous use of GL_CONSTANT_ALPHA/GL_ONE_MINUS_CONSTANT_ALPHA and "
return; "GL_CONSTANT_COLOR/GL_ONE_MINUS_CONSTANT_COLOR not supported by this "
"implementation.");
context->recordError(Error(GL_INVALID_OPERATION));
return;
}
} }
context->getState().setBlendFactors(srcRGB, dstRGB, srcAlpha, dstAlpha); context->getState().setBlendFactors(srcRGB, dstRGB, srcAlpha, dstAlpha);
......
...@@ -103,6 +103,30 @@ ...@@ -103,6 +103,30 @@
1025 WIN : dEQP-GLES2.functional.fragment_ops.depth_stencil.stencil_ops.* = FAIL 1025 WIN : dEQP-GLES2.functional.fragment_ops.depth_stencil.stencil_ops.* = FAIL
1025 WIN : dEQP-GLES2.functional.fragment_ops.depth_stencil.write_mask.* = FAIL 1025 WIN : dEQP-GLES2.functional.fragment_ops.depth_stencil.write_mask.* = FAIL
1025 WIN : dEQP-GLES2.functional.fragment_ops.depth_stencil.random.* = FAIL 1025 WIN : dEQP-GLES2.functional.fragment_ops.depth_stencil.random.* = FAIL
1025 WIN : dEQP-GLES2.functional.fragment_ops.blend.equation_src_func_dst_func.add_constant_color_constant_alpha = FAIL
1025 WIN : dEQP-GLES2.functional.fragment_ops.blend.equation_src_func_dst_func.add_constant_color_one_minus_constant_alpha = FAIL
1025 WIN : dEQP-GLES2.functional.fragment_ops.blend.equation_src_func_dst_func.add_one_minus_constant_color_constant_alpha = FAIL
1025 WIN : dEQP-GLES2.functional.fragment_ops.blend.equation_src_func_dst_func.add_one_minus_constant_color_one_minus_constant_alpha = FAIL
1025 WIN : dEQP-GLES2.functional.fragment_ops.blend.equation_src_func_dst_func.add_constant_alpha_constant_color = FAIL
1025 WIN : dEQP-GLES2.functional.fragment_ops.blend.equation_src_func_dst_func.add_constant_alpha_one_minus_constant_color = FAIL
1025 WIN : dEQP-GLES2.functional.fragment_ops.blend.equation_src_func_dst_func.add_one_minus_constant_alpha_constant_color = FAIL
1025 WIN : dEQP-GLES2.functional.fragment_ops.blend.equation_src_func_dst_func.add_one_minus_constant_alpha_one_minus_constant_color = FAIL
1025 WIN : dEQP-GLES2.functional.fragment_ops.blend.equation_src_func_dst_func.subtract_constant_color_constant_alpha = FAIL
1025 WIN : dEQP-GLES2.functional.fragment_ops.blend.equation_src_func_dst_func.subtract_constant_color_one_minus_constant_alpha = FAIL
1025 WIN : dEQP-GLES2.functional.fragment_ops.blend.equation_src_func_dst_func.subtract_one_minus_constant_color_constant_alpha = FAIL
1025 WIN : dEQP-GLES2.functional.fragment_ops.blend.equation_src_func_dst_func.subtract_one_minus_constant_color_one_minus_constant_alpha = FAIL
1025 WIN : dEQP-GLES2.functional.fragment_ops.blend.equation_src_func_dst_func.subtract_constant_alpha_constant_color = FAIL
1025 WIN : dEQP-GLES2.functional.fragment_ops.blend.equation_src_func_dst_func.subtract_constant_alpha_one_minus_constant_color = FAIL
1025 WIN : dEQP-GLES2.functional.fragment_ops.blend.equation_src_func_dst_func.subtract_one_minus_constant_alpha_constant_color = FAIL
1025 WIN : dEQP-GLES2.functional.fragment_ops.blend.equation_src_func_dst_func.subtract_one_minus_constant_alpha_one_minus_constant_color = FAIL
1025 WIN : dEQP-GLES2.functional.fragment_ops.blend.equation_src_func_dst_func.reverse_subtract_constant_color_constant_alpha = FAIL
1025 WIN : dEQP-GLES2.functional.fragment_ops.blend.equation_src_func_dst_func.reverse_subtract_constant_color_one_minus_constant_alpha = FAIL
1025 WIN : dEQP-GLES2.functional.fragment_ops.blend.equation_src_func_dst_func.reverse_subtract_one_minus_constant_color_constant_alpha = FAIL
1025 WIN : dEQP-GLES2.functional.fragment_ops.blend.equation_src_func_dst_func.reverse_subtract_one_minus_constant_color_one_minus_constant_alpha = FAIL
1025 WIN : dEQP-GLES2.functional.fragment_ops.blend.equation_src_func_dst_func.reverse_subtract_constant_alpha_constant_color = FAIL
1025 WIN : dEQP-GLES2.functional.fragment_ops.blend.equation_src_func_dst_func.reverse_subtract_constant_alpha_one_minus_constant_color = FAIL
1025 WIN : dEQP-GLES2.functional.fragment_ops.blend.equation_src_func_dst_func.reverse_subtract_one_minus_constant_alpha_constant_color = FAIL
1025 WIN : dEQP-GLES2.functional.fragment_ops.blend.equation_src_func_dst_func.reverse_subtract_one_minus_constant_alpha_one_minus_constant_color = FAIL
504 WIN : dEQP-GLES2.functional.uniform_api.info_query.basic_struct.sampler2D_samplerCube_* = FAIL 504 WIN : dEQP-GLES2.functional.uniform_api.info_query.basic_struct.sampler2D_samplerCube_* = FAIL
504 WIN : dEQP-GLES2.functional.uniform_api.info_query.struct_in_array.sampler2D_samplerCube_* = FAIL 504 WIN : dEQP-GLES2.functional.uniform_api.info_query.struct_in_array.sampler2D_samplerCube_* = FAIL
504 WIN : dEQP-GLES2.functional.uniform_api.info_query.array_in_struct.sampler2D_samplerCube_* = FAIL 504 WIN : dEQP-GLES2.functional.uniform_api.info_query.array_in_struct.sampler2D_samplerCube_* = FAIL
...@@ -228,30 +252,6 @@ ...@@ -228,30 +252,6 @@
1016 WIN LINUX : dEQP-GLES2.functional.shaders.scoping.invalid.redeclare_function_fragment = FAIL 1016 WIN LINUX : dEQP-GLES2.functional.shaders.scoping.invalid.redeclare_function_fragment = FAIL
1020 WIN LINUX : dEQP-GLES2.functional.texture.mipmap.2d.projected.* = FAIL 1020 WIN LINUX : dEQP-GLES2.functional.texture.mipmap.2d.projected.* = FAIL
1020 WIN LINUX : dEQP-GLES2.functional.texture.mipmap.cube.projected.linear_linear = FAIL 1020 WIN LINUX : dEQP-GLES2.functional.texture.mipmap.cube.projected.linear_linear = FAIL
1025 WIN LINUX : dEQP-GLES2.functional.fragment_ops.blend.equation_src_func_dst_func.add_constant_color_constant_alpha = FAIL
1025 WIN LINUX : dEQP-GLES2.functional.fragment_ops.blend.equation_src_func_dst_func.add_constant_color_one_minus_constant_alpha = FAIL
1025 WIN LINUX : dEQP-GLES2.functional.fragment_ops.blend.equation_src_func_dst_func.add_one_minus_constant_color_constant_alpha = FAIL
1025 WIN LINUX : dEQP-GLES2.functional.fragment_ops.blend.equation_src_func_dst_func.add_one_minus_constant_color_one_minus_constant_alpha = FAIL
1025 WIN LINUX : dEQP-GLES2.functional.fragment_ops.blend.equation_src_func_dst_func.add_constant_alpha_constant_color = FAIL
1025 WIN LINUX : dEQP-GLES2.functional.fragment_ops.blend.equation_src_func_dst_func.add_constant_alpha_one_minus_constant_color = FAIL
1025 WIN LINUX : dEQP-GLES2.functional.fragment_ops.blend.equation_src_func_dst_func.add_one_minus_constant_alpha_constant_color = FAIL
1025 WIN LINUX : dEQP-GLES2.functional.fragment_ops.blend.equation_src_func_dst_func.add_one_minus_constant_alpha_one_minus_constant_color = FAIL
1025 WIN LINUX : dEQP-GLES2.functional.fragment_ops.blend.equation_src_func_dst_func.subtract_constant_color_constant_alpha = FAIL
1025 WIN LINUX : dEQP-GLES2.functional.fragment_ops.blend.equation_src_func_dst_func.subtract_constant_color_one_minus_constant_alpha = FAIL
1025 WIN LINUX : dEQP-GLES2.functional.fragment_ops.blend.equation_src_func_dst_func.subtract_one_minus_constant_color_constant_alpha = FAIL
1025 WIN LINUX : dEQP-GLES2.functional.fragment_ops.blend.equation_src_func_dst_func.subtract_one_minus_constant_color_one_minus_constant_alpha = FAIL
1025 WIN LINUX : dEQP-GLES2.functional.fragment_ops.blend.equation_src_func_dst_func.subtract_constant_alpha_constant_color = FAIL
1025 WIN LINUX : dEQP-GLES2.functional.fragment_ops.blend.equation_src_func_dst_func.subtract_constant_alpha_one_minus_constant_color = FAIL
1025 WIN LINUX : dEQP-GLES2.functional.fragment_ops.blend.equation_src_func_dst_func.subtract_one_minus_constant_alpha_constant_color = FAIL
1025 WIN LINUX : dEQP-GLES2.functional.fragment_ops.blend.equation_src_func_dst_func.subtract_one_minus_constant_alpha_one_minus_constant_color = FAIL
1025 WIN LINUX : dEQP-GLES2.functional.fragment_ops.blend.equation_src_func_dst_func.reverse_subtract_constant_color_constant_alpha = FAIL
1025 WIN LINUX : dEQP-GLES2.functional.fragment_ops.blend.equation_src_func_dst_func.reverse_subtract_constant_color_one_minus_constant_alpha = FAIL
1025 WIN LINUX : dEQP-GLES2.functional.fragment_ops.blend.equation_src_func_dst_func.reverse_subtract_one_minus_constant_color_constant_alpha = FAIL
1025 WIN LINUX : dEQP-GLES2.functional.fragment_ops.blend.equation_src_func_dst_func.reverse_subtract_one_minus_constant_color_one_minus_constant_alpha = FAIL
1025 WIN LINUX : dEQP-GLES2.functional.fragment_ops.blend.equation_src_func_dst_func.reverse_subtract_constant_alpha_constant_color = FAIL
1025 WIN LINUX : dEQP-GLES2.functional.fragment_ops.blend.equation_src_func_dst_func.reverse_subtract_constant_alpha_one_minus_constant_color = FAIL
1025 WIN LINUX : dEQP-GLES2.functional.fragment_ops.blend.equation_src_func_dst_func.reverse_subtract_one_minus_constant_alpha_constant_color = FAIL
1025 WIN LINUX : dEQP-GLES2.functional.fragment_ops.blend.equation_src_func_dst_func.reverse_subtract_one_minus_constant_alpha_one_minus_constant_color = FAIL
1025 WIN LINUX : dEQP-GLES2.functional.fragment_ops.random.* = FAIL 1025 WIN LINUX : dEQP-GLES2.functional.fragment_ops.random.* = FAIL
1025 WIN LINUX : dEQP-GLES2.functional.fragment_ops.interaction.basic_shader.* = FAIL 1025 WIN LINUX : dEQP-GLES2.functional.fragment_ops.interaction.basic_shader.* = FAIL
1026 WIN LINUX : dEQP-GLES2.functional.fbo.api.valid_texcube_attachments = FAIL 1026 WIN LINUX : dEQP-GLES2.functional.fbo.api.valid_texcube_attachments = FAIL
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment