Commit 3a86ad38 by Geoff Lang

Only validate that stencil refs and masks are the same on D3D renderers.

BUG=angleproject:1025 Change-Id: If79046f9f81ad20c5f2f7296245b0cb74a4102aa Reviewed-on: https://chromium-review.googlesource.com/296680Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org> Reviewed-by: 's avatarCorentin Wallez <cwallez@chromium.org> Tested-by: 's avatarGeoff Lang <geofflang@chromium.org>
parent 93fc8f3e
......@@ -205,6 +205,7 @@ Limitations::Limitations()
: noFrontFacingSupport(false),
noSampleAlphaToCoverageSupport(false),
attributeZeroRequiresZeroDivisorInEXT(false),
noSeparateStencilRefsAndMasks(false),
shadersRequireIndexedLoopValidation(false)
{
}
......
......@@ -247,7 +247,8 @@ struct Limitations
// In glVertexAttribDivisorANGLE, attribute zero must have a zero divisor
bool attributeZeroRequiresZeroDivisorInEXT;
// TODO: add entry for renderers that don't support separate stencil masks/refs
// Unable to support different values for front and back faces for stencil refs and masks
bool noSeparateStencilRefsAndMasks;
// Renderer doesn't support non-constant indexing loops in fragment shader
bool shadersRequireIndexedLoopValidation;
......
......@@ -1181,6 +1181,10 @@ void GenerateCaps(ID3D11Device *device, ID3D11DeviceContext *deviceContext, cons
limitations->shadersRequireIndexedLoopValidation =
(renderer11DeviceCaps.featureLevel <= D3D_FEATURE_LEVEL_9_3);
// D3D11 has no concept of separate masks and refs for front and back faces in the depth stencil
// state.
limitations->noSeparateStencilRefsAndMasks = true;
#ifdef ANGLE_ENABLE_WINDOWS_STORE
// 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.
......
......@@ -2975,12 +2975,13 @@ GLenum Renderer9::getVertexComponentType(gl::VertexFormatType vertexFormatType)
return d3d9::GetVertexFormatInfo(getCapsDeclTypes(), vertexFormatType).componentType;
}
void Renderer9::generateCaps(gl::Caps *outCaps, gl::TextureCapsMap *outTextureCaps,
void Renderer9::generateCaps(gl::Caps *outCaps,
gl::TextureCapsMap *outTextureCaps,
gl::Extensions *outExtensions,
gl::Limitations * /*outLimitations */) const
gl::Limitations *outLimitations) const
{
d3d9_gl::GenerateCaps(mD3d9, mDevice, mDeviceType, mAdapter, outCaps,
outTextureCaps, outExtensions);
d3d9_gl::GenerateCaps(mD3d9, mDevice, mDeviceType, mAdapter, outCaps, outTextureCaps,
outExtensions, outLimitations);
}
WorkaroundsD3D Renderer9::generateWorkarounds() const
......
......@@ -334,8 +334,14 @@ static gl::TextureCaps GenerateTextureFormatCaps(GLenum internalFormat, IDirect3
return textureCaps;
}
void GenerateCaps(IDirect3D9 *d3d9, IDirect3DDevice9 *device, D3DDEVTYPE deviceType, UINT adapter, gl::Caps *caps,
gl::TextureCapsMap *textureCapsMap, gl::Extensions *extensions)
void GenerateCaps(IDirect3D9 *d3d9,
IDirect3DDevice9 *device,
D3DDEVTYPE deviceType,
UINT adapter,
gl::Caps *caps,
gl::TextureCapsMap *textureCapsMap,
gl::Extensions *extensions,
gl::Limitations *limitations)
{
D3DCAPS9 deviceCaps;
if (FAILED(d3d9->GetDeviceCaps(adapter, deviceType, &deviceCaps)))
......@@ -557,6 +563,10 @@ void GenerateCaps(IDirect3D9 *d3d9, IDirect3DDevice9 *device, D3DDEVTYPE deviceT
extensions->discardFramebuffer = false; // It would be valid to set this to true, since glDiscardFramebufferEXT is just a hint
extensions->colorBufferFloat = false;
extensions->debugMarker = true;
// D3D9 has no concept of separate masks and refs for front and back faces in the depth stencil
// state.
limitations->noSeparateStencilRefsAndMasks = true;
}
}
......
......@@ -51,9 +51,14 @@ GLsizei GetSamplesCount(D3DMULTISAMPLE_TYPE type);
bool IsFormatChannelEquivalent(D3DFORMAT d3dformat, GLenum format);
void GenerateCaps(IDirect3D9 *d3d9, IDirect3DDevice9 *device, D3DDEVTYPE deviceType, UINT adapter, gl::Caps *caps,
gl::TextureCapsMap *textureCapsMap, gl::Extensions *extensions);
void GenerateCaps(IDirect3D9 *d3d9,
IDirect3DDevice9 *device,
D3DDEVTYPE deviceType,
UINT adapter,
gl::Caps *caps,
gl::TextureCapsMap *textureCapsMap,
gl::Extensions *extensions,
gl::Limitations *limitations);
}
namespace d3d9
......
......@@ -1437,17 +1437,21 @@ static bool ValidateDrawBase(Context *context, GLenum mode, GLsizei count, GLsiz
return false;
}
const gl::DepthStencilState &depthStencilState = state.getDepthStencilState();
if (depthStencilState.stencilWritemask != depthStencilState.stencilBackWritemask ||
state.getStencilRef() != state.getStencilBackRef() ||
depthStencilState.stencilMask != depthStencilState.stencilBackMask)
{
// Note: these separate values are not supported in WebGL, due to D3D's limitations.
// See Section 6.10 of the WebGL 1.0 spec
ERR("This ANGLE implementation does not support separate front/back stencil "
"writemasks, reference values, or stencil mask values.");
context->recordError(Error(GL_INVALID_OPERATION));
return false;
if (context->getLimitations().noSeparateStencilRefsAndMasks)
{
const gl::DepthStencilState &depthStencilState = state.getDepthStencilState();
if (depthStencilState.stencilWritemask != depthStencilState.stencilBackWritemask ||
state.getStencilRef() != state.getStencilBackRef() ||
depthStencilState.stencilMask != depthStencilState.stencilBackMask)
{
// Note: these separate values are not supported in WebGL, due to D3D's limitations. See
// Section 6.10 of the WebGL 1.0 spec
ERR(
"This ANGLE implementation does not support separate front/back stencil "
"writemasks, reference values, or stencil mask values.");
context->recordError(Error(GL_INVALID_OPERATION));
return false;
}
}
const gl::Framebuffer *fbo = state.getDrawFramebuffer();
......
......@@ -99,6 +99,10 @@
1021 WIN : dEQP-GLES2.functional.texture.specification.basic_copyteximage2d.cube_luminance = FAIL
1021 WIN : dEQP-GLES2.functional.texture.specification.basic_copyteximage2d.cube_luminance_alpha = FAIL
1021 WIN : dEQP-GLES2.functional.texture.specification.basic_copyteximage2d.cube_rgb = FAIL
1025 WIN : dEQP-GLES2.functional.fragment_ops.depth_stencil.stencil_depth_funcs.stencil_* = 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.random.* = 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.array_in_struct.sampler2D_samplerCube_* = FAIL
......@@ -224,10 +228,6 @@
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.cube.projected.linear_linear = FAIL
1025 WIN LINUX : dEQP-GLES2.functional.fragment_ops.depth_stencil.stencil_depth_funcs.stencil_* = FAIL
1025 WIN LINUX : dEQP-GLES2.functional.fragment_ops.depth_stencil.stencil_ops.* = FAIL
1025 WIN LINUX : dEQP-GLES2.functional.fragment_ops.depth_stencil.write_mask.* = FAIL
1025 WIN LINUX : dEQP-GLES2.functional.fragment_ops.depth_stencil.random.* = 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
......
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