Commit ccb9fad3 by Martin Radev Committed by Geoff Lang

Initialize ANGLE_multiview in the D3D11 renderer

The patch enables the ANGLE_multiview extension in the D3D11 renderer and determines the maximum number of available views. BUG=angleproject:2062 TEST=angle_end2end_tests Change-Id: I56e434a14c61df3d6ab66c2863ce783fcdcc5a93 Reviewed-on: https://chromium-review.googlesource.com/595507 Commit-Queue: Martin Radev <mradev@nvidia.com> Reviewed-by: 's avatarCorentin Wallez <cwallez@chromium.org> Reviewed-by: 's avatarOlli Etuaho <oetuaho@nvidia.com>
parent 3c76d59f
...@@ -1136,6 +1136,38 @@ gl::Version GetMaximumClientVersion(D3D_FEATURE_LEVEL featureLevel) ...@@ -1136,6 +1136,38 @@ gl::Version GetMaximumClientVersion(D3D_FEATURE_LEVEL featureLevel)
} }
} }
unsigned int GetMaxViewportAndScissorRectanglesPerPipeline(D3D_FEATURE_LEVEL featureLevel)
{
switch (featureLevel)
{
case D3D_FEATURE_LEVEL_11_1:
case D3D_FEATURE_LEVEL_11_0:
return D3D11_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE;
case D3D_FEATURE_LEVEL_10_1:
case D3D_FEATURE_LEVEL_10_0:
case D3D_FEATURE_LEVEL_9_3:
case D3D_FEATURE_LEVEL_9_2:
case D3D_FEATURE_LEVEL_9_1:
return 1;
default:
UNREACHABLE();
return 0;
}
}
bool IsMultiviewSupported(D3D_FEATURE_LEVEL featureLevel)
{
// The ANGLE_multiview extension can always be supported in D3D11 through geometry shaders.
switch (featureLevel)
{
case D3D_FEATURE_LEVEL_11_1:
case D3D_FEATURE_LEVEL_11_0:
return true;
default:
return false;
}
}
void GenerateCaps(ID3D11Device *device, ID3D11DeviceContext *deviceContext, const Renderer11DeviceCaps &renderer11DeviceCaps, gl::Caps *caps, void GenerateCaps(ID3D11Device *device, ID3D11DeviceContext *deviceContext, const Renderer11DeviceCaps &renderer11DeviceCaps, gl::Caps *caps,
gl::TextureCapsMap *textureCapsMap, gl::Extensions *extensions, gl::Limitations *limitations) gl::TextureCapsMap *textureCapsMap, gl::Extensions *extensions, gl::Limitations *limitations)
{ {
...@@ -1326,6 +1358,13 @@ void GenerateCaps(ID3D11Device *device, ID3D11DeviceContext *deviceContext, cons ...@@ -1326,6 +1358,13 @@ void GenerateCaps(ID3D11Device *device, ID3D11DeviceContext *deviceContext, cons
extensions->standardDerivatives = GetDerivativeInstructionSupport(featureLevel); extensions->standardDerivatives = GetDerivativeInstructionSupport(featureLevel);
extensions->shaderTextureLOD = GetShaderTextureLODSupport(featureLevel); extensions->shaderTextureLOD = GetShaderTextureLODSupport(featureLevel);
extensions->fragDepth = true; extensions->fragDepth = true;
extensions->multiview = IsMultiviewSupported(featureLevel);
if (extensions->multiview)
{
extensions->maxViews =
std::min(static_cast<GLuint>(GetMaximum2DTextureArraySize(featureLevel)),
GetMaxViewportAndScissorRectanglesPerPipeline(featureLevel));
}
extensions->textureUsage = true; // This could be false since it has no effect in D3D11 extensions->textureUsage = true; // This could be false since it has no effect in D3D11
extensions->discardFramebuffer = true; extensions->discardFramebuffer = true;
extensions->translatedShaderSource = true; extensions->translatedShaderSource = true;
......
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