Commit 5b2a1760 by Jiawei-Shao Committed by Commit Bot

ES31: Implement glSampleMaski on D3D11

This patch intends to implement glSampleMaski on D3D11 backends. In D3D11 the sample mask word can be set by OMSetRenderState. This function can only accept an UINT as its parameter SampleMask, so the value MAX_SAMPLE_MASK_WORDS in D3D11 backends is set to 1. BUG=angleproject:1592 TEST=dEQP-GLES31.functional.state_query.*.sample_mask* TEST=dEQP-GLES31.functional.texture.multisample.*.sample_mask* Change-Id: I27f509cf81624d95948b06739bb9fe21288d2d31 Reviewed-on: https://chromium-review.googlesource.com/691259 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: 's avatarGeoff Lang <geofflang@chromium.org>
parent 8c5b69cb
......@@ -316,6 +316,11 @@ unsigned int GetBlendSampleMask(const gl::State &glState, int samples)
mask = 0xFFFFFFFF;
}
if (glState.isSampleMaskEnabled())
{
mask &= glState.getSampleMaskWord(0);
}
return mask;
}
......
......@@ -1894,7 +1894,8 @@ gl::Error StateManager11::updateState(const gl::Context *context, GLenum drawMod
invalidateShaders();
}
// TODO(jmadill): This can be recomputed only on framebuffer changes.
// TODO(jiawei.shao@intel.com): This can be recomputed only on framebuffer or multisample mask
// state changes.
RenderTarget11 *firstRT = framebuffer11->getFirstRenderTarget();
int samples = (firstRT ? firstRT->getSamples() : 0);
unsigned int sampleMask = GetBlendSampleMask(glState, samples);
......
......@@ -1206,6 +1206,26 @@ bool IsMultiviewSupported(D3D_FEATURE_LEVEL featureLevel)
}
}
unsigned int GetMaxSampleMaskWords(D3D_FEATURE_LEVEL featureLevel)
{
switch (featureLevel)
{
// D3D10+ only allows 1 sample mask.
case D3D_FEATURE_LEVEL_11_1:
case D3D_FEATURE_LEVEL_11_0:
case D3D_FEATURE_LEVEL_10_1:
case D3D_FEATURE_LEVEL_10_0:
return 1u;
case D3D_FEATURE_LEVEL_9_3:
case D3D_FEATURE_LEVEL_9_2:
case D3D_FEATURE_LEVEL_9_1:
return 0u;
default:
UNREACHABLE();
return 0u;
}
}
void GenerateCaps(ID3D11Device *device, ID3D11DeviceContext *deviceContext, const Renderer11DeviceCaps &renderer11DeviceCaps, gl::Caps *caps,
gl::TextureCapsMap *textureCapsMap, gl::Extensions *extensions, gl::Limitations *limitations)
{
......@@ -1366,6 +1386,9 @@ void GenerateCaps(ID3D11Device *device, ID3D11DeviceContext *deviceContext, cons
caps->maxDepthTextureSamples = std::numeric_limits<GLint>::max();
caps->maxIntegerSamples = std::numeric_limits<GLint>::max();
// Sample mask words limits
caps->maxSampleMaskWords = GetMaxSampleMaskWords(featureLevel);
// Framebuffer limits
caps->maxFramebufferSamples = std::numeric_limits<GLint>::max();
caps->maxFramebufferWidth =
......
......@@ -38,11 +38,6 @@
1442 D3D11 : dEQP-GLES31.functional.texture.gather.* = SKIP
// D3D11 Failing Tests
1442 D3D11 : dEQP-GLES31.functional.state_query.boolean.sample_mask_* = FAIL
1442 D3D11 : dEQP-GLES31.functional.state_query.integer.max_color_texture_samples_* = FAIL
1442 D3D11 : dEQP-GLES31.functional.state_query.integer.max_depth_texture_samples_* = FAIL
1442 D3D11 : dEQP-GLES31.functional.state_query.integer.max_integer_samples_* = FAIL
1442 D3D11 : dEQP-GLES31.functional.state_query.integer.max_sample_mask_words_* = FAIL
1442 D3D11 : dEQP-GLES31.functional.state_query.integer.max_framebuffer_width_* = FAIL
1442 D3D11 : dEQP-GLES31.functional.state_query.integer.max_framebuffer_height_* = FAIL
1442 D3D11 : dEQP-GLES31.functional.state_query.integer.max_framebuffer_samples_* = FAIL
......@@ -64,19 +59,9 @@
1442 D3D11 : dEQP-GLES31.functional.state_query.integer.max_uniform_buffer_bindings_* = FAIL
1442 D3D11 : dEQP-GLES31.functional.state_query.integer.max_combined_texture_image_units_* = FAIL
1729 D3D11 : dEQP-GLES31.functional.state_query.indexed.atomic_counter_buffer_* = FAIL
1442 D3D11 : dEQP-GLES31.functional.state_query.indexed.sample_mask_value_* = FAIL
1951 D3D11 : dEQP-GLES31.functional.state_query.indexed.shader_storage_buffer_* = FAIL
1442 D3D11 : dEQP-GLES31.functional.state_query.internal_format.renderbuffer.* = FAIL
1679 D3D11 : dEQP-GLES31.functional.state_query.texture_level.texture_2d_multisample.* = FAIL
1442 D3D11 : dEQP-GLES31.functional.texture.multisample.samples_1.sample_mask_* = FAIL
1442 D3D11 : dEQP-GLES31.functional.texture.multisample.samples_2.sample_mask_* = FAIL
1442 D3D11 : dEQP-GLES31.functional.texture.multisample.samples_3.sample_mask_* = FAIL
1442 D3D11 : dEQP-GLES31.functional.texture.multisample.samples_4.sample_mask_* = FAIL
1442 D3D11 : dEQP-GLES31.functional.texture.multisample.samples_8.sample_mask_* = FAIL
1442 D3D11 : dEQP-GLES31.functional.texture.multisample.samples_10.sample_mask_* = FAIL
1442 D3D11 : dEQP-GLES31.functional.texture.multisample.samples_12.sample_mask_* = FAIL
1442 D3D11 : dEQP-GLES31.functional.texture.multisample.samples_13.sample_mask_* = FAIL
1442 D3D11 : dEQP-GLES31.functional.texture.multisample.samples_64.sample_mask_* = FAIL
1442 D3D11 : dEQP-GLES31.functional.debug.negative_coverage.callbacks.texture.texparameter* = SKIP
1442 D3D11 : dEQP-GLES31.functional.debug.negative_coverage.get_error.texture.texparameter* = SKIP
1442 D3D11 : dEQP-GLES31.functional.debug.negative_coverage.log.texture.texparameter* = SKIP
......
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