Commit d1c46228 by Jamie Madill

Revert "Implement EGL_experimental_present_path_angle"

Compile failure on Clang/Win: The reason for reverting is: FAILED: ninja -t msvc -e environment.x86 -- "..\..\third_party/llvm-build/Release+Asserts/bin/clang-cl" -m32 /nologo /showIncludes /FC @obj\third_party\angle\src\tests\egl_tests\angle_end2end_tests.EGLPresentPathD3D11Test.obj.rsp /c ..\..\third_party\angle\src\tests\egl_tests\EGLPresentPathD3D11Test.cpp /Foobj\third_party\angle\src\tests\egl_tests\angle_end2end_tests.EGLPresentPathD3D11Test.obj /Fdobj\gpu\angle_end2end_tests.cc.pdb In file included from ..\..\third_party\angle\src\tests\egl_tests\EGLPresentPathD3D11Test.cpp:7: In file included from ..\..\third_party\angle\src\tests\test_utils/ANGLETest.h:13: ..\..\testing\gtest\include\gtest/gtest.h(1392,16) : error: comparison of integers of different signs: 'const int' and 'const unsigned int' [-Werror,-Wsign-compare] if (expected == actual) { ~~~~~~~~ ^ ~~~~~~ ..\..\testing\gtest\include\gtest/gtest.h(1422,12) : note: in instantiation of function template specialization 'testing::internal::CmpHelperEQ<int, unsigned int>' requested here return CmpHelperEQ(expected_expression, actual_expression, expected, ^ ..\..\third_party\angle\src\tests\egl_tests\EGLPresentPathD3D11Test.cpp(281,9) : note: in instantiation of function template specialization 'testing::internal::EqHelper<false>::Compare<int, unsigned int>' requested here ASSERT_EQ(mWindowWidth * 4, mappedSubresource.RowPitch); ^ ..\..\testing\gtest\include\gtest/gtest.h(1960,32) : note: expanded from macro 'ASSERT_EQ' # define ASSERT_EQ(val1, val2) GTEST_ASSERT_EQ(val1, val2) ^ ..\..\testing\gtest\include\gtest/gtest.h(1943,67) : note: expanded from macro 'GTEST_ASSERT_EQ' EqHelper<GTEST_IS_NULL_LITERAL_(expected)>::Compare, \ ^ BUG=angleproject:1219 This reverts commit 6b3c1db5. Change-Id: Ia67ab82dd13295dc03235d57fa417c73f20a49e6 Reviewed-on: https://chromium-review.googlesource.com/326680Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org>
parent c674abeb
Name Name
ANGLE_experimental_present_path experimental_present_path_angle
Name Strings Name Strings
EGL_ANGLE_experimental_present_path EGL_experimental_present_path_angle
Contributors Contributors
......
...@@ -522,13 +522,6 @@ EGLAPI EGLBoolean EGLAPIENTRY eglQuerySurfacePointerANGLE (EGLDisplay dpy, EGLSu ...@@ -522,13 +522,6 @@ EGLAPI EGLBoolean EGLAPIENTRY eglQuerySurfacePointerANGLE (EGLDisplay dpy, EGLSu
#define EGL_SURFACE_ORIENTATION_INVERT_Y_ANGLE 0x0002 #define EGL_SURFACE_ORIENTATION_INVERT_Y_ANGLE 0x0002
#endif /* EGL_ANGLE_surface_orientation */ #endif /* EGL_ANGLE_surface_orientation */
#ifndef EGL_ANGLE_experimental_present_path
#define EGL_ANGLE_experimental_present_path
#define EGL_EXPERIMENTAL_PRESENT_PATH_ANGLE 0x33A4
#define EGL_EXPERIMENTAL_PRESENT_PATH_FAST_ANGLE 0x33A9
#define EGL_EXPERIMENTAL_PRESENT_PATH_COPY_ANGLE 0x33AA
#endif /* EGL_ANGLE_experimental_present_path */
#ifndef EGL_ARM_pixmap_multisample_discard #ifndef EGL_ARM_pixmap_multisample_discard
#define EGL_ARM_pixmap_multisample_discard 1 #define EGL_ARM_pixmap_multisample_discard 1
#define EGL_DISCARD_SAMPLES_ARM 0x3286 #define EGL_DISCARD_SAMPLES_ARM 0x3286
......
...@@ -505,13 +505,6 @@ void OutputHLSL::header(TInfoSinkBase &out, const BuiltInFunctionEmulator *built ...@@ -505,13 +505,6 @@ void OutputHLSL::header(TInfoSinkBase &out, const BuiltInFunctionEmulator *built
out << " float3 dx_DepthFront : packoffset(c2);\n"; out << " float3 dx_DepthFront : packoffset(c2);\n";
} }
if (mUsesFragCoord)
{
// dx_ViewScale is only used in the fragment shader to correct
// the value for glFragCoord if necessary
out << " float2 dx_ViewScale : packoffset(c3);\n";
}
out << "};\n"; out << "};\n";
} }
else else
...@@ -606,13 +599,11 @@ void OutputHLSL::header(TInfoSinkBase &out, const BuiltInFunctionEmulator *built ...@@ -606,13 +599,11 @@ void OutputHLSL::header(TInfoSinkBase &out, const BuiltInFunctionEmulator *built
out << " float3 dx_DepthRange : packoffset(c0);\n"; out << " float3 dx_DepthRange : packoffset(c0);\n";
} }
// dx_ViewAdjust and dx_ViewCoords will only be used in Feature Level 9 // dx_ViewAdjust and dx_ViewCoords will only be used in Feature Level 9 shaders.
// shaders. However, we declare it for all shaders (including Feature Level 10+). // However, we declare it for all shaders (including Feature Level 10+).
// The bytecode is the same whether we declare it or not, since D3DCompiler removes it // The bytecode is the same whether we declare it or not, since D3DCompiler removes it if it's unused.
// if it's unused.
out << " float4 dx_ViewAdjust : packoffset(c1);\n"; out << " float4 dx_ViewAdjust : packoffset(c1);\n";
out << " float2 dx_ViewCoords : packoffset(c2);\n"; out << " float2 dx_ViewCoords : packoffset(c2);\n";
out << " float2 dx_ViewScale : packoffset(c3);\n";
out << "};\n" out << "};\n"
"\n"; "\n";
......
...@@ -697,7 +697,6 @@ ClientExtensions::ClientExtensions() ...@@ -697,7 +697,6 @@ ClientExtensions::ClientExtensions()
deviceCreation(false), deviceCreation(false),
deviceCreationD3D11(false), deviceCreationD3D11(false),
x11Visual(false), x11Visual(false),
experimentalPresentPath(false),
clientGetAllProcAddresses(false) clientGetAllProcAddresses(false)
{ {
} }
...@@ -717,7 +716,6 @@ std::vector<std::string> ClientExtensions::getStrings() const ...@@ -717,7 +716,6 @@ std::vector<std::string> ClientExtensions::getStrings() const
InsertExtensionString("EGL_ANGLE_device_creation", deviceCreation, &extensionStrings); InsertExtensionString("EGL_ANGLE_device_creation", deviceCreation, &extensionStrings);
InsertExtensionString("EGL_ANGLE_device_creation_d3d11", deviceCreationD3D11, &extensionStrings); InsertExtensionString("EGL_ANGLE_device_creation_d3d11", deviceCreationD3D11, &extensionStrings);
InsertExtensionString("EGL_ANGLE_x11_visual", x11Visual, &extensionStrings); InsertExtensionString("EGL_ANGLE_x11_visual", x11Visual, &extensionStrings);
InsertExtensionString("EGL_ANGLE_experimental_present_path", experimentalPresentPath, &extensionStrings);
InsertExtensionString("EGL_KHR_client_get_all_proc_addresses", clientGetAllProcAddresses, &extensionStrings); InsertExtensionString("EGL_KHR_client_get_all_proc_addresses", clientGetAllProcAddresses, &extensionStrings);
// clang-format on // clang-format on
......
...@@ -529,9 +529,6 @@ struct ClientExtensions ...@@ -529,9 +529,6 @@ struct ClientExtensions
// EGL_ANGLE_x11_visual // EGL_ANGLE_x11_visual
bool x11Visual; bool x11Visual;
// EGL_ANGLE_experimental_present_path
bool experimentalPresentPath;
// EGL_KHR_client_get_all_proc_addresses // EGL_KHR_client_get_all_proc_addresses
bool clientGetAllProcAddresses; bool clientGetAllProcAddresses;
}; };
......
...@@ -882,7 +882,6 @@ static ClientExtensions GenerateClientExtensions() ...@@ -882,7 +882,6 @@ static ClientExtensions GenerateClientExtensions()
#if defined(ANGLE_ENABLE_D3D11) #if defined(ANGLE_ENABLE_D3D11)
extensions.deviceCreation = true; extensions.deviceCreation = true;
extensions.deviceCreationD3D11 = true; extensions.deviceCreationD3D11 = true;
extensions.experimentalPresentPath = true;
#endif #endif
#if defined(ANGLE_USE_X11) #if defined(ANGLE_USE_X11)
......
...@@ -412,9 +412,6 @@ bool DynamicHLSL::generateShaderLinkHLSL(const gl::Data &data, ...@@ -412,9 +412,6 @@ bool DynamicHLSL::generateShaderLinkHLSL(const gl::Data &data,
const ShaderD3D *fragmentShader = GetImplAs<ShaderD3D>(fragmentShaderGL); const ShaderD3D *fragmentShader = GetImplAs<ShaderD3D>(fragmentShaderGL);
const int shaderModel = mRenderer->getMajorShaderModel(); const int shaderModel = mRenderer->getMajorShaderModel();
// usesViewScale() isn't supported in the D3D9 renderer
ASSERT(shaderModel >= 4 || !programMetadata.usesViewScale());
bool useInstancedPointSpriteEmulation = bool useInstancedPointSpriteEmulation =
programMetadata.usesPointSize() && programMetadata.usesPointSize() &&
mRenderer->getWorkarounds().useInstancedPointSpriteEmulation; mRenderer->getWorkarounds().useInstancedPointSpriteEmulation;
...@@ -467,43 +464,18 @@ bool DynamicHLSL::generateShaderLinkHLSL(const gl::Data &data, ...@@ -467,43 +464,18 @@ bool DynamicHLSL::generateShaderLinkHLSL(const gl::Data &data,
// On D3D9 or D3D11 Feature Level 9, we need to emulate large viewports using dx_ViewAdjust. // On D3D9 or D3D11 Feature Level 9, we need to emulate large viewports using dx_ViewAdjust.
if (shaderModel >= 4 && mRenderer->getShaderModelSuffix() == "") if (shaderModel >= 4 && mRenderer->getShaderModelSuffix() == "")
{ {
vertexStream << " output.dx_Position.x = gl_Position.x;\n"; vertexStream << " output.dx_Position.x = gl_Position.x;\n"
<< " output.dx_Position.y = -gl_Position.y;\n"
if (programMetadata.usesViewScale()) << " output.dx_Position.z = (gl_Position.z + gl_Position.w) * 0.5;\n"
{
// This code assumes that dx_ViewScale.y = -1.0f when rendering to texture, and +1.0f
// when rendering to the default framebuffer. No other values are valid.
vertexStream << " output.dx_Position.y = dx_ViewScale.y * gl_Position.y;\n";
}
else
{
vertexStream << " output.dx_Position.y = - gl_Position.y;\n";
}
vertexStream << " output.dx_Position.z = (gl_Position.z + gl_Position.w) * 0.5;\n"
<< " output.dx_Position.w = gl_Position.w;\n"; << " output.dx_Position.w = gl_Position.w;\n";
} }
else else
{ {
vertexStream << " output.dx_Position.x = gl_Position.x * dx_ViewAdjust.z + " vertexStream << " output.dx_Position.x = gl_Position.x * dx_ViewAdjust.z + "
"dx_ViewAdjust.x * gl_Position.w;\n"; "dx_ViewAdjust.x * gl_Position.w;\n"
<< " output.dx_Position.y = -(gl_Position.y * dx_ViewAdjust.w + "
// If usesViewScale() is true and we're using the D3D11 renderer via Feature Level 9_*, "dx_ViewAdjust.y * gl_Position.w);\n"
// then we need to multiply the gl_Position.y by the viewScale. << " output.dx_Position.z = (gl_Position.z + gl_Position.w) * 0.5;\n"
// usesViewScale() isn't supported when using the D3D9 renderer.
if (programMetadata.usesViewScale() &&
(shaderModel >= 4 && mRenderer->getShaderModelSuffix() != ""))
{
vertexStream << " output.dx_Position.y = dx_ViewScale.y * (gl_Position.y * "
"dx_ViewAdjust.w + dx_ViewAdjust.y * gl_Position.w);\n";
}
else
{
vertexStream << " output.dx_Position.y = -(gl_Position.y * dx_ViewAdjust.w + "
"dx_ViewAdjust.y * gl_Position.w);\n";
}
vertexStream << " output.dx_Position.z = (gl_Position.z + gl_Position.w) * 0.5;\n"
<< " output.dx_Position.w = gl_Position.w;\n"; << " output.dx_Position.w = gl_Position.w;\n";
} }
...@@ -551,26 +523,11 @@ bool DynamicHLSL::generateShaderLinkHLSL(const gl::Data &data, ...@@ -551,26 +523,11 @@ bool DynamicHLSL::generateShaderLinkHLSL(const gl::Data &data,
if (useInstancedPointSpriteEmulation) if (useInstancedPointSpriteEmulation)
{ {
vertexStream << "\n" vertexStream << "\n"
<< " gl_PointSize = clamp(gl_PointSize, minPointSize, maxPointSize);\n"; << " gl_PointSize = clamp(gl_PointSize, minPointSize, maxPointSize);\n"
<< " output.dx_Position.xyz += float3(input.spriteVertexPos.x * "
vertexStream << " output.dx_Position.x += (input.spriteVertexPos.x * gl_PointSize / " "gl_PointSize / (dx_ViewCoords.x*2), input.spriteVertexPos.y * "
"(dx_ViewCoords.x*2)) * output.dx_Position.w;"; "gl_PointSize / (dx_ViewCoords.y*2), input.spriteVertexPos.z) * "
"output.dx_Position.w;\n";
if (programMetadata.usesViewScale())
{
// Multiply by ViewScale to invert the rendering when appropriate
vertexStream << " output.dx_Position.y += (-dx_ViewScale.y * "
"input.spriteVertexPos.y * gl_PointSize / (dx_ViewCoords.y*2)) * "
"output.dx_Position.w;";
}
else
{
vertexStream << " output.dx_Position.y += (input.spriteVertexPos.y * gl_PointSize / "
"(dx_ViewCoords.y*2)) * output.dx_Position.w;";
}
vertexStream
<< " output.dx_Position.z += input.spriteVertexPos.z * output.dx_Position.w;\n";
if (programMetadata.usesPointCoord()) if (programMetadata.usesPointCoord())
{ {
...@@ -649,49 +606,6 @@ bool DynamicHLSL::generateShaderLinkHLSL(const gl::Data &data, ...@@ -649,49 +606,6 @@ bool DynamicHLSL::generateShaderLinkHLSL(const gl::Data &data,
"dx_ViewCoords.w;\n"; "dx_ViewCoords.w;\n";
} }
if (programMetadata.usesViewScale())
{
// For Feature Level 9_3 and below, we need to correct gl_FragCoord.y to account
// for dx_ViewScale. On Feature Level 10_0+, gl_FragCoord.y is calculated above using
// dx_ViewCoords and is always correct irrespective of dx_ViewScale's value.
// NOTE: usesViewScale() can only be true on D3D11 (i.e. Shader Model 4.0+).
if (shaderModel >= 4 && mRenderer->getShaderModelSuffix() == "")
{
// Some assumptions:
// - dx_ViewScale.y = -1.0f when rendering to texture
// - dx_ViewScale.y = +1.0f when rendering to the default framebuffer
// - gl_FragCoord.y has been set correctly above.
//
// When rendering to the backbuffer, the code inverts gl_FragCoord's y coordinate.
// This involves subtracting the y coordinate from the height of the area being
// rendered to.
//
// First we calculate the height of the area being rendered to:
// render_area_height = (2.0f / (1.0f - input.gl_FragCoord.y * rhw)) *
// gl_FragCoord.y
//
// Note that when we're rendering to default FB, we want our output to be
// equivalent to:
// "gl_FragCoord.y = render_area_height - gl_FragCoord.y"
//
// When we're rendering to a texture, we want our output to be equivalent to:
// "gl_FragCoord.y = gl_FragCoord.y;"
//
// If we set scale_factor = ((1.0f + dx_ViewScale.y) / 2.0f), then notice that
// - When rendering to default FB: scale_factor = 1.0f
// - When rendering to texture: scale_factor = 0.0f
//
// Therefore, we can get our desired output by setting:
// "gl_FragCoord.y = scale_factor * render_area_height - dx_ViewScale.y *
// gl_FragCoord.y"
//
// Simplifying, this becomes:
pixelStream
<< " gl_FragCoord.y = (1.0f + dx_ViewScale.y) * gl_FragCoord.y /"
"(1.0f - input.gl_FragCoord.y * rhw) - dx_ViewScale.y * gl_FragCoord.y;\n";
}
}
pixelStream << " gl_FragCoord.z = (input.gl_FragCoord.z * rhw) * dx_DepthFront.x + " pixelStream << " gl_FragCoord.z = (input.gl_FragCoord.z * rhw) * dx_DepthFront.x + "
"dx_DepthFront.y;\n" "dx_DepthFront.y;\n"
<< " gl_FragCoord.w = rhw;\n"; << " gl_FragCoord.w = rhw;\n";
...@@ -835,7 +749,6 @@ std::string DynamicHLSL::generateGeometryShaderPreamble(const VaryingPacking &va ...@@ -835,7 +749,6 @@ std::string DynamicHLSL::generateGeometryShaderPreamble(const VaryingPacking &va
std::string DynamicHLSL::generateGeometryShaderHLSL(gl::PrimitiveType primitiveType, std::string DynamicHLSL::generateGeometryShaderHLSL(gl::PrimitiveType primitiveType,
const gl::Data &data, const gl::Data &data,
const gl::Program::Data &programData, const gl::Program::Data &programData,
const bool useViewScale,
const std::string &preambleString) const const std::string &preambleString) const
{ {
ASSERT(mRenderer->getMajorShaderModel() >= 4); ASSERT(mRenderer->getMajorShaderModel() >= 4);
...@@ -886,14 +799,8 @@ std::string DynamicHLSL::generateGeometryShaderHLSL(gl::PrimitiveType primitiveT ...@@ -886,14 +799,8 @@ std::string DynamicHLSL::generateGeometryShaderHLSL(gl::PrimitiveType primitiveT
{ {
shaderStream << "#define ANGLE_POINT_SPRITE_SHADER\n" shaderStream << "#define ANGLE_POINT_SPRITE_SHADER\n"
"\n" "\n"
"uniform float4 dx_ViewCoords : register(c1);\n"; "uniform float4 dx_ViewCoords : register(c1);\n"
"\n"
if (useViewScale)
{
shaderStream << "uniform float2 dx_ViewScale : register(c3);\n";
}
shaderStream << "\n"
"static float2 pointSpriteCorners[] = \n" "static float2 pointSpriteCorners[] = \n"
"{\n" "{\n"
" float2( 0.5f, -0.5f),\n" " float2( 0.5f, -0.5f),\n"
...@@ -963,20 +870,9 @@ std::string DynamicHLSL::generateGeometryShaderHLSL(gl::PrimitiveType primitiveT ...@@ -963,20 +870,9 @@ std::string DynamicHLSL::generateGeometryShaderHLSL(gl::PrimitiveType primitiveT
for (int corner = 0; corner < 4; corner++) for (int corner = 0; corner < 4; corner++)
{ {
if (useViewScale) shaderStream << "\n"
{ " output.dx_Position = dx_Position + float4(pointSpriteCorners["
shaderStream << " \n" << corner << "] * viewportScale * gl_PointSize, 0.0f, 0.0f);\n";
" output.dx_Position = dx_Position + float4(1.0f, "
"-dx_ViewScale.y, 1.0f, 1.0f)"
" * float4(pointSpriteCorners["
<< corner << "] * viewportScale * gl_PointSize, 0.0f, 0.0f);\n";
}
else
{
shaderStream << "\n"
" output.dx_Position = dx_Position + float4(pointSpriteCorners["
<< corner << "] * viewportScale * gl_PointSize, 0.0f, 0.0f);\n";
}
if (usesPointCoord) if (usesPointCoord)
{ {
......
...@@ -74,7 +74,6 @@ class DynamicHLSL : angle::NonCopyable ...@@ -74,7 +74,6 @@ class DynamicHLSL : angle::NonCopyable
std::string generateGeometryShaderHLSL(gl::PrimitiveType primitiveType, std::string generateGeometryShaderHLSL(gl::PrimitiveType primitiveType,
const gl::Data &data, const gl::Data &data,
const gl::Program::Data &programData, const gl::Program::Data &programData,
const bool useViewScale,
const std::string &preambleString) const; const std::string &preambleString) const;
void getPixelShaderOutputKey(const gl::Data &data, void getPixelShaderOutputKey(const gl::Data &data,
......
...@@ -401,13 +401,11 @@ D3DVarying::D3DVarying(const std::string &semanticNameIn, ...@@ -401,13 +401,11 @@ D3DVarying::D3DVarying(const std::string &semanticNameIn,
ProgramD3DMetadata::ProgramD3DMetadata(int rendererMajorShaderModel, ProgramD3DMetadata::ProgramD3DMetadata(int rendererMajorShaderModel,
const std::string &shaderModelSuffix, const std::string &shaderModelSuffix,
bool usesInstancedPointSpriteEmulation, bool usesInstancedPointSpriteEmulation,
bool usesViewScale,
const ShaderD3D *vertexShader, const ShaderD3D *vertexShader,
const ShaderD3D *fragmentShader) const ShaderD3D *fragmentShader)
: mRendererMajorShaderModel(rendererMajorShaderModel), : mRendererMajorShaderModel(rendererMajorShaderModel),
mShaderModelSuffix(shaderModelSuffix), mShaderModelSuffix(shaderModelSuffix),
mUsesInstancedPointSpriteEmulation(usesInstancedPointSpriteEmulation), mUsesInstancedPointSpriteEmulation(usesInstancedPointSpriteEmulation),
mUsesViewScale(usesViewScale),
mVertexShader(vertexShader), mVertexShader(vertexShader),
mFragmentShader(fragmentShader) mFragmentShader(fragmentShader)
{ {
...@@ -448,11 +446,6 @@ bool ProgramD3DMetadata::usesInsertedPointCoordValue() const ...@@ -448,11 +446,6 @@ bool ProgramD3DMetadata::usesInsertedPointCoordValue() const
return !usesPointSize() && usesPointCoord() && mRendererMajorShaderModel >= 4; return !usesPointSize() && usesPointCoord() && mRendererMajorShaderModel >= 4;
} }
bool ProgramD3DMetadata::usesViewScale() const
{
return mUsesViewScale;
}
bool ProgramD3DMetadata::addsPointCoordToVertexShader() const bool ProgramD3DMetadata::addsPointCoordToVertexShader() const
{ {
// Instanced PointSprite emulation requires that gl_PointCoord is present in the vertex shader // Instanced PointSprite emulation requires that gl_PointCoord is present in the vertex shader
...@@ -1266,8 +1259,7 @@ gl::Error ProgramD3D::getGeometryExecutableForPrimitiveType(const gl::Data &data ...@@ -1266,8 +1259,7 @@ gl::Error ProgramD3D::getGeometryExecutableForPrimitiveType(const gl::Data &data
} }
std::string geometryHLSL = mDynamicHLSL->generateGeometryShaderHLSL( std::string geometryHLSL = mDynamicHLSL->generateGeometryShaderHLSL(
geometryShaderType, data, mData, mRenderer->presentPathFastEnabled(), geometryShaderType, data, mData, mGeometryShaderPreamble);
mGeometryShaderPreamble);
gl::InfoLog tempInfoLog; gl::InfoLog tempInfoLog;
gl::InfoLog *currentInfoLog = infoLog ? infoLog : &tempInfoLog; gl::InfoLog *currentInfoLog = infoLog ? infoLog : &tempInfoLog;
...@@ -1395,8 +1387,7 @@ LinkResult ProgramD3D::link(const gl::Data &data, gl::InfoLog &infoLog) ...@@ -1395,8 +1387,7 @@ LinkResult ProgramD3D::link(const gl::Data &data, gl::InfoLog &infoLog)
} }
ProgramD3DMetadata metadata(mRenderer->getMajorShaderModel(), mRenderer->getShaderModelSuffix(), ProgramD3DMetadata metadata(mRenderer->getMajorShaderModel(), mRenderer->getShaderModelSuffix(),
usesInstancedPointSpriteEmulation(), usesInstancedPointSpriteEmulation(), vertexShaderD3D,
mRenderer->presentPathFastEnabled(), vertexShaderD3D,
fragmentShaderD3D); fragmentShaderD3D);
varyingPacking.enableBuiltins(SHADER_VERTEX, metadata); varyingPacking.enableBuiltins(SHADER_VERTEX, metadata);
......
...@@ -103,7 +103,6 @@ class ProgramD3DMetadata : angle::NonCopyable ...@@ -103,7 +103,6 @@ class ProgramD3DMetadata : angle::NonCopyable
ProgramD3DMetadata(int rendererMajorShaderModel, ProgramD3DMetadata(int rendererMajorShaderModel,
const std::string &shaderModelSuffix, const std::string &shaderModelSuffix,
bool usesInstancedPointSpriteEmulation, bool usesInstancedPointSpriteEmulation,
bool usesViewScale,
const ShaderD3D *vertexShader, const ShaderD3D *vertexShader,
const ShaderD3D *fragmentShader); const ShaderD3D *fragmentShader);
...@@ -114,7 +113,6 @@ class ProgramD3DMetadata : angle::NonCopyable ...@@ -114,7 +113,6 @@ class ProgramD3DMetadata : angle::NonCopyable
bool usesFragCoord() const; bool usesFragCoord() const;
bool usesPointSize() const; bool usesPointSize() const;
bool usesInsertedPointCoordValue() const; bool usesInsertedPointCoordValue() const;
bool usesViewScale() const;
bool addsPointCoordToVertexShader() const; bool addsPointCoordToVertexShader() const;
bool usesTransformFeedbackGLPosition() const; bool usesTransformFeedbackGLPosition() const;
bool usesSystemValuePointSize() const; bool usesSystemValuePointSize() const;
...@@ -126,7 +124,6 @@ class ProgramD3DMetadata : angle::NonCopyable ...@@ -126,7 +124,6 @@ class ProgramD3DMetadata : angle::NonCopyable
const int mRendererMajorShaderModel; const int mRendererMajorShaderModel;
const std::string mShaderModelSuffix; const std::string mShaderModelSuffix;
const bool mUsesInstancedPointSpriteEmulation; const bool mUsesInstancedPointSpriteEmulation;
const bool mUsesViewScale;
const ShaderD3D *mVertexShader; const ShaderD3D *mVertexShader;
const ShaderD3D *mFragmentShader; const ShaderD3D *mFragmentShader;
}; };
......
...@@ -43,7 +43,6 @@ RendererD3D::RendererD3D(egl::Display *display) ...@@ -43,7 +43,6 @@ RendererD3D::RendererD3D(egl::Display *display)
: mDisplay(display), : mDisplay(display),
mDeviceLost(false), mDeviceLost(false),
mAnnotator(nullptr), mAnnotator(nullptr),
mPresentPathFastEnabled(false),
mScratchMemoryBufferResetCounter(0), mScratchMemoryBufferResetCounter(0),
mWorkaroundsInitialized(false), mWorkaroundsInitialized(false),
mDisjoint(false) mDisjoint(false)
......
...@@ -253,8 +253,6 @@ class RendererD3D : public Renderer, public BufferFactoryD3D ...@@ -253,8 +253,6 @@ class RendererD3D : public Renderer, public BufferFactoryD3D
virtual egl::Error getEGLDevice(DeviceImpl **device) = 0; virtual egl::Error getEGLDevice(DeviceImpl **device) = 0;
bool presentPathFastEnabled() const { return mPresentPathFastEnabled; }
protected: protected:
virtual bool getLUID(LUID *adapterLuid) const = 0; virtual bool getLUID(LUID *adapterLuid) const = 0;
virtual gl::Error applyShadersImpl(const gl::Data &data, GLenum drawMode) = 0; virtual gl::Error applyShadersImpl(const gl::Data &data, GLenum drawMode) = 0;
...@@ -275,8 +273,6 @@ class RendererD3D : public Renderer, public BufferFactoryD3D ...@@ -275,8 +273,6 @@ class RendererD3D : public Renderer, public BufferFactoryD3D
std::vector<TranslatedAttribute> mTranslatedAttribCache; std::vector<TranslatedAttribute> mTranslatedAttribCache;
bool mPresentPathFastEnabled;
private: private:
gl::Error genericDrawArrays(const gl::Data &data, gl::Error genericDrawArrays(const gl::Data &data,
GLenum mode, GLenum mode,
...@@ -336,6 +332,20 @@ class RendererD3D : public Renderer, public BufferFactoryD3D ...@@ -336,6 +332,20 @@ class RendererD3D : public Renderer, public BufferFactoryD3D
bool mDisjoint; bool mDisjoint;
}; };
struct dx_VertexConstants
{
float depthRange[4];
float viewAdjust[4];
float viewCoords[4];
};
struct dx_PixelConstants
{
float depthRange[4];
float viewCoords[4];
float depthFront[4];
};
} }
#endif // LIBANGLE_RENDERER_D3D_RENDERERD3D_H_ #endif // LIBANGLE_RENDERER_D3D_RENDERERD3D_H_
...@@ -93,27 +93,7 @@ gl::Error Framebuffer11::invalidateSwizzles() const ...@@ -93,27 +93,7 @@ gl::Error Framebuffer11::invalidateSwizzles() const
gl::Error Framebuffer11::clear(const gl::Data &data, const ClearParameters &clearParams) gl::Error Framebuffer11::clear(const gl::Data &data, const ClearParameters &clearParams)
{ {
Clear11 *clearer = mRenderer->getClearer(); Clear11 *clearer = mRenderer->getClearer();
gl::Error error(GL_NO_ERROR); gl::Error error = clearer->clearFramebuffer(clearParams, mData);
const gl::FramebufferAttachment *colorAttachment = mData.getFirstColorAttachment();
if (clearParams.scissorEnabled == true && colorAttachment != nullptr &&
UsePresentPathFast(mRenderer, colorAttachment))
{
// If the current framebuffer is using the default colorbuffer, and present path fast is
// active, and the scissor rect is enabled, then we should invert the scissor rect
// vertically
ClearParameters presentPathFastClearParams = clearParams;
gl::Extents framebufferSize = colorAttachment->getSize();
presentPathFastClearParams.scissor.y = framebufferSize.height -
presentPathFastClearParams.scissor.y -
presentPathFastClearParams.scissor.height;
error = clearer->clearFramebuffer(presentPathFastClearParams, mData);
}
else
{
error = clearer->clearFramebuffer(clearParams, mData);
}
if (error.isError()) if (error.isError())
{ {
return error; return error;
...@@ -348,27 +328,8 @@ gl::Error Framebuffer11::blit(const gl::Rectangle &sourceArea, const gl::Rectang ...@@ -348,27 +328,8 @@ gl::Error Framebuffer11::blit(const gl::Rectangle &sourceArea, const gl::Rectang
} }
ASSERT(drawRenderTarget); ASSERT(drawRenderTarget);
const bool invertColorSource = UsePresentPathFast(mRenderer, readBuffer); error = mRenderer->blitRenderbufferRect(sourceArea, destArea, readRenderTarget, drawRenderTarget,
gl::Rectangle actualSourceArea = sourceArea; filter, scissor, blitRenderTarget, false, false);
if (invertColorSource)
{
RenderTarget11 *readRenderTarget11 = GetAs<RenderTarget11>(readRenderTarget);
actualSourceArea.y = readRenderTarget11->getHeight() - sourceArea.y;
actualSourceArea.height = -sourceArea.height;
}
const bool invertColorDest = UsePresentPathFast(mRenderer, &drawBuffer);
gl::Rectangle actualDestArea = destArea;
if (invertColorDest)
{
RenderTarget11 *drawRenderTarget11 = GetAs<RenderTarget11>(drawRenderTarget);
actualDestArea.y = drawRenderTarget11->getHeight() - destArea.y;
actualDestArea.height = -destArea.height;
}
error = mRenderer->blitRenderbufferRect(actualSourceArea, actualDestArea,
readRenderTarget, drawRenderTarget, filter,
scissor, blitRenderTarget, false, false);
if (error.isError()) if (error.isError())
{ {
return error; return error;
......
...@@ -436,14 +436,14 @@ class Renderer11 : public RendererD3D ...@@ -436,14 +436,14 @@ class Renderer11 : public RendererD3D
uintptr_t mAppliedGeometryShader; uintptr_t mAppliedGeometryShader;
uintptr_t mAppliedPixelShader; uintptr_t mAppliedPixelShader;
dx_VertexConstants11 mAppliedVertexConstants; dx_VertexConstants mAppliedVertexConstants;
ID3D11Buffer *mDriverConstantBufferVS; ID3D11Buffer *mDriverConstantBufferVS;
ID3D11Buffer *mCurrentVertexConstantBuffer; ID3D11Buffer *mCurrentVertexConstantBuffer;
unsigned int mCurrentConstantBufferVS[gl::IMPLEMENTATION_MAX_VERTEX_SHADER_UNIFORM_BUFFERS]; unsigned int mCurrentConstantBufferVS[gl::IMPLEMENTATION_MAX_VERTEX_SHADER_UNIFORM_BUFFERS];
GLintptr mCurrentConstantBufferVSOffset[gl::IMPLEMENTATION_MAX_VERTEX_SHADER_UNIFORM_BUFFERS]; GLintptr mCurrentConstantBufferVSOffset[gl::IMPLEMENTATION_MAX_VERTEX_SHADER_UNIFORM_BUFFERS];
GLsizeiptr mCurrentConstantBufferVSSize[gl::IMPLEMENTATION_MAX_VERTEX_SHADER_UNIFORM_BUFFERS]; GLsizeiptr mCurrentConstantBufferVSSize[gl::IMPLEMENTATION_MAX_VERTEX_SHADER_UNIFORM_BUFFERS];
dx_PixelConstants11 mAppliedPixelConstants; dx_PixelConstants mAppliedPixelConstants;
ID3D11Buffer *mDriverConstantBufferPS; ID3D11Buffer *mDriverConstantBufferPS;
ID3D11Buffer *mCurrentPixelConstantBuffer; ID3D11Buffer *mCurrentPixelConstantBuffer;
unsigned int mCurrentConstantBufferPS[gl::IMPLEMENTATION_MAX_FRAGMENT_SHADER_UNIFORM_BUFFERS]; unsigned int mCurrentConstantBufferPS[gl::IMPLEMENTATION_MAX_FRAGMENT_SHADER_UNIFORM_BUFFERS];
......
...@@ -31,8 +31,6 @@ StateManager11::StateManager11() ...@@ -31,8 +31,6 @@ StateManager11::StateManager11()
mCurNear(0.0f), mCurNear(0.0f),
mCurFar(0.0f), mCurFar(0.0f),
mViewportBounds(), mViewportBounds(),
mCurPresentPathFastEnabled(false),
mCurPresentPathFastColorBufferHeight(0),
mRenderer11DeviceCaps(nullptr), mRenderer11DeviceCaps(nullptr),
mDeviceContext(nullptr), mDeviceContext(nullptr),
mStateCache(nullptr) mStateCache(nullptr)
...@@ -111,23 +109,6 @@ void StateManager11::setViewportBounds(const int width, const int height) ...@@ -111,23 +109,6 @@ void StateManager11::setViewportBounds(const int width, const int height)
} }
} }
void StateManager11::updatePresentPath(bool presentPathFastActive,
const gl::FramebufferAttachment *framebufferAttachment)
{
const int colorBufferHeight =
framebufferAttachment ? framebufferAttachment->getSize().height : 0;
if ((mCurPresentPathFastEnabled != presentPathFastActive) ||
(presentPathFastActive && (colorBufferHeight != mCurPresentPathFastColorBufferHeight)))
{
mCurPresentPathFastEnabled = presentPathFastActive;
mCurPresentPathFastColorBufferHeight = colorBufferHeight;
mViewportStateIsDirty = true; // Viewport may need to be vertically inverted
mScissorStateIsDirty = true; // Scissor rect may need to be vertically inverted
mRasterizerStateIsDirty = true; // Cull Mode may need to be inverted
}
}
void StateManager11::syncState(const gl::State &state, const gl::State::DirtyBits &dirtyBits) void StateManager11::syncState(const gl::State &state, const gl::State::DirtyBits &dirtyBits)
{ {
if (!dirtyBits.any()) if (!dirtyBits.any())
...@@ -483,33 +464,8 @@ gl::Error StateManager11::setRasterizerState(const gl::RasterizerState &rasterSt ...@@ -483,33 +464,8 @@ gl::Error StateManager11::setRasterizerState(const gl::RasterizerState &rasterSt
} }
ID3D11RasterizerState *dxRasterState = nullptr; ID3D11RasterizerState *dxRasterState = nullptr;
gl::Error error(GL_NO_ERROR); gl::Error error =
mStateCache->getRasterizerState(rasterState, mCurScissorEnabled, &dxRasterState);
if (mCurPresentPathFastEnabled)
{
gl::RasterizerState modifiedRasterState = rasterState;
// If prseent path fast is active then we need invert the front face state.
// This ensures that both gl_FrontFacing is correct, and front/back culling
// is performed correctly.
if (modifiedRasterState.frontFace == GL_CCW)
{
modifiedRasterState.frontFace = GL_CW;
}
else
{
ASSERT(modifiedRasterState.frontFace == GL_CW);
modifiedRasterState.frontFace = GL_CCW;
}
error = mStateCache->getRasterizerState(modifiedRasterState, mCurScissorEnabled,
&dxRasterState);
}
else
{
error = mStateCache->getRasterizerState(rasterState, mCurScissorEnabled, &dxRasterState);
}
if (error.isError()) if (error.isError())
{ {
return error; return error;
...@@ -528,19 +484,13 @@ void StateManager11::setScissorRectangle(const gl::Rectangle &scissor, bool enab ...@@ -528,19 +484,13 @@ void StateManager11::setScissorRectangle(const gl::Rectangle &scissor, bool enab
if (!mScissorStateIsDirty) if (!mScissorStateIsDirty)
return; return;
int modifiedScissorY = scissor.y;
if (mCurPresentPathFastEnabled)
{
modifiedScissorY = mCurPresentPathFastColorBufferHeight - scissor.height - scissor.y;
}
if (enabled) if (enabled)
{ {
D3D11_RECT rect; D3D11_RECT rect;
rect.left = std::max(0, scissor.x); rect.left = std::max(0, scissor.x);
rect.top = std::max(0, modifiedScissorY); rect.top = std::max(0, scissor.y);
rect.right = scissor.x + std::max(0, scissor.width); rect.right = scissor.x + std::max(0, scissor.width);
rect.bottom = modifiedScissorY + std::max(0, scissor.height); rect.bottom = scissor.y + std::max(0, scissor.height);
mDeviceContext->RSSetScissorRects(1, &rect); mDeviceContext->RSSetScissorRects(1, &rect);
} }
...@@ -582,22 +532,7 @@ void StateManager11::setViewport(const gl::Caps *caps, ...@@ -582,22 +532,7 @@ void StateManager11::setViewport(const gl::Caps *caps,
D3D11_VIEWPORT dxViewport; D3D11_VIEWPORT dxViewport;
dxViewport.TopLeftX = static_cast<float>(dxViewportTopLeftX); dxViewport.TopLeftX = static_cast<float>(dxViewportTopLeftX);
dxViewport.TopLeftY = static_cast<float>(dxViewportTopLeftY);
if (mCurPresentPathFastEnabled)
{
// When present path fast is active and we're rendering to framebuffer 0, we must invert
// the viewport in Y-axis.
// NOTE: We delay the inversion until right before the call to RSSetViewports, and leave
// dxViewportTopLeftY unchanged. This allows us to calculate viewAdjust below using the
// unaltered dxViewportTopLeftY value.
dxViewport.TopLeftY = static_cast<float>(mCurPresentPathFastColorBufferHeight -
dxViewportTopLeftY - dxViewportHeight);
}
else
{
dxViewport.TopLeftY = static_cast<float>(dxViewportTopLeftY);
}
dxViewport.Width = static_cast<float>(dxViewportWidth); dxViewport.Width = static_cast<float>(dxViewportWidth);
dxViewport.Height = static_cast<float>(dxViewportHeight); dxViewport.Height = static_cast<float>(dxViewportHeight);
dxViewport.MinDepth = actualZNear; dxViewport.MinDepth = actualZNear;
...@@ -646,16 +581,6 @@ void StateManager11::setViewport(const gl::Caps *caps, ...@@ -646,16 +581,6 @@ void StateManager11::setViewport(const gl::Caps *caps,
mPixelConstants.depthRange[1] = actualZFar; mPixelConstants.depthRange[1] = actualZFar;
mPixelConstants.depthRange[2] = actualZFar - actualZNear; mPixelConstants.depthRange[2] = actualZFar - actualZNear;
mPixelConstants.viewScale[0] = 1.0f;
mPixelConstants.viewScale[1] = mCurPresentPathFastEnabled ? 1.0f : -1.0f;
mPixelConstants.viewScale[2] = 1.0f;
mPixelConstants.viewScale[3] = 1.0f;
mVertexConstants.viewScale[0] = mPixelConstants.viewScale[0];
mVertexConstants.viewScale[1] = mPixelConstants.viewScale[1];
mVertexConstants.viewScale[2] = mPixelConstants.viewScale[2];
mVertexConstants.viewScale[3] = mPixelConstants.viewScale[3];
mViewportStateIsDirty = false; mViewportStateIsDirty = false;
} }
......
...@@ -21,22 +21,6 @@ namespace rx ...@@ -21,22 +21,6 @@ namespace rx
struct RenderTargetDesc; struct RenderTargetDesc;
struct Renderer11DeviceCaps; struct Renderer11DeviceCaps;
struct dx_VertexConstants11
{
float depthRange[4];
float viewAdjust[4];
float viewCoords[4];
float viewScale[4];
};
struct dx_PixelConstants11
{
float depthRange[4];
float viewCoords[4];
float depthFront[4];
float viewScale[4];
};
class StateManager11 final : angle::NonCopyable class StateManager11 final : angle::NonCopyable
{ {
public: public:
...@@ -62,9 +46,6 @@ class StateManager11 final : angle::NonCopyable ...@@ -62,9 +46,6 @@ class StateManager11 final : angle::NonCopyable
void setViewport(const gl::Caps *caps, const gl::Rectangle &viewport, float zNear, float zFar); void setViewport(const gl::Caps *caps, const gl::Rectangle &viewport, float zNear, float zFar);
void updatePresentPath(bool presentPathFastActive,
const gl::FramebufferAttachment *framebufferAttachment);
void forceSetBlendState() { mBlendStateIsDirty = true; } void forceSetBlendState() { mBlendStateIsDirty = true; }
void forceSetDepthStencilState() { mDepthStencilStateIsDirty = true; } void forceSetDepthStencilState() { mDepthStencilStateIsDirty = true; }
void forceSetRasterState() { mRasterizerStateIsDirty = true; } void forceSetRasterState() { mRasterizerStateIsDirty = true; }
...@@ -72,8 +53,8 @@ class StateManager11 final : angle::NonCopyable ...@@ -72,8 +53,8 @@ class StateManager11 final : angle::NonCopyable
void forceSetViewportState() { mViewportStateIsDirty = true; } void forceSetViewportState() { mViewportStateIsDirty = true; }
void setViewportBounds(const int width, const int height); void setViewportBounds(const int width, const int height);
const dx_VertexConstants11 &getVertexConstants() const { return mVertexConstants; } const dx_VertexConstants &getVertexConstants() const { return mVertexConstants; }
const dx_PixelConstants11 &getPixelConstants() const { return mPixelConstants; } const dx_PixelConstants &getPixelConstants() const { return mPixelConstants; }
void updateStencilSizeIfChanged(bool depthStencilInitialized, unsigned int stencilSize); void updateStencilSizeIfChanged(bool depthStencilInitialized, unsigned int stencilSize);
...@@ -95,7 +76,7 @@ class StateManager11 final : angle::NonCopyable ...@@ -95,7 +76,7 @@ class StateManager11 final : angle::NonCopyable
Optional<bool> mCurDisableDepth; Optional<bool> mCurDisableDepth;
Optional<bool> mCurDisableStencil; Optional<bool> mCurDisableStencil;
// Currently applied rasterizer state // Currenly applied rasterizer state
bool mRasterizerStateIsDirty; bool mRasterizerStateIsDirty;
gl::RasterizerState mCurRasterState; gl::RasterizerState mCurRasterState;
...@@ -111,16 +92,12 @@ class StateManager11 final : angle::NonCopyable ...@@ -111,16 +92,12 @@ class StateManager11 final : angle::NonCopyable
float mCurFar; float mCurFar;
// Things needed in viewport state // Things needed in viewport state
dx_VertexConstants11 mVertexConstants; dx_VertexConstants mVertexConstants;
dx_PixelConstants11 mPixelConstants; dx_PixelConstants mPixelConstants;
// Render target variables // Render target variables
gl::Extents mViewportBounds; gl::Extents mViewportBounds;
// EGL_ANGLE_experimental_present_path variables
bool mCurPresentPathFastEnabled;
int mCurPresentPathFastColorBufferHeight;
Renderer11DeviceCaps *mRenderer11DeviceCaps; Renderer11DeviceCaps *mRenderer11DeviceCaps;
ID3D11DeviceContext *mDeviceContext; ID3D11DeviceContext *mDeviceContext;
RenderStateCache *mStateCache; RenderStateCache *mStateCache;
......
...@@ -31,17 +31,6 @@ ...@@ -31,17 +31,6 @@
namespace rx namespace rx
{ {
namespace
{
bool NeedsOffscreenTexture(Renderer11 *renderer, NativeWindow nativeWindow, EGLint orientation)
{
// We don't need an offscreen texture if either orientation = INVERT_Y,
// or present path fast is enabled and we're not rendering onto an offscreen surface.
return orientation != EGL_SURFACE_ORIENTATION_INVERT_Y_ANGLE &&
!(renderer->presentPathFastEnabled() && nativeWindow.getNativeWindow());
}
} // anonymous namespace
SwapChain11::SwapChain11(Renderer11 *renderer, SwapChain11::SwapChain11(Renderer11 *renderer,
NativeWindow nativeWindow, NativeWindow nativeWindow,
HANDLE shareHandle, HANDLE shareHandle,
...@@ -63,7 +52,7 @@ SwapChain11::SwapChain11(Renderer11 *renderer, ...@@ -63,7 +52,7 @@ SwapChain11::SwapChain11(Renderer11 *renderer,
mBackBufferTexture(nullptr), mBackBufferTexture(nullptr),
mBackBufferRTView(nullptr), mBackBufferRTView(nullptr),
mBackBufferSRView(nullptr), mBackBufferSRView(nullptr),
mNeedsOffscreenTexture(NeedsOffscreenTexture(renderer, nativeWindow, orientation)), mNeedsOffscreenTexture(orientation != EGL_SURFACE_ORIENTATION_INVERT_Y_ANGLE),
mOffscreenTexture(nullptr), mOffscreenTexture(nullptr),
mOffscreenRTView(nullptr), mOffscreenRTView(nullptr),
mOffscreenSRView(nullptr), mOffscreenSRView(nullptr),
...@@ -79,8 +68,6 @@ SwapChain11::SwapChain11(Renderer11 *renderer, ...@@ -79,8 +68,6 @@ SwapChain11::SwapChain11(Renderer11 *renderer,
mColorRenderTarget(this, renderer, false), mColorRenderTarget(this, renderer, false),
mDepthStencilRenderTarget(this, renderer, true) mDepthStencilRenderTarget(this, renderer, true)
{ {
// Sanity check that if present path fast is active then we're using the default orientation
ASSERT(!mRenderer->presentPathFastEnabled() || orientation == 0);
} }
SwapChain11::~SwapChain11() SwapChain11::~SwapChain11()
......
...@@ -292,7 +292,7 @@ unsigned int GetReservedVertexUniformVectors(D3D_FEATURE_LEVEL featureLevel) ...@@ -292,7 +292,7 @@ unsigned int GetReservedVertexUniformVectors(D3D_FEATURE_LEVEL featureLevel)
case D3D_FEATURE_LEVEL_9_3: case D3D_FEATURE_LEVEL_9_3:
case D3D_FEATURE_LEVEL_9_2: case D3D_FEATURE_LEVEL_9_2:
case D3D_FEATURE_LEVEL_9_1: case D3D_FEATURE_LEVEL_9_1:
return 3; // dx_ViewAdjust, dx_ViewCoords and dx_ViewScale return 2; // dx_ViewAdjust and dx_ViewCoords
default: default:
UNREACHABLE(); UNREACHABLE();
...@@ -313,7 +313,7 @@ unsigned int GetReservedFragmentUniformVectors(D3D_FEATURE_LEVEL featureLevel) ...@@ -313,7 +313,7 @@ unsigned int GetReservedFragmentUniformVectors(D3D_FEATURE_LEVEL featureLevel)
case D3D_FEATURE_LEVEL_9_3: case D3D_FEATURE_LEVEL_9_3:
case D3D_FEATURE_LEVEL_9_2: case D3D_FEATURE_LEVEL_9_2:
case D3D_FEATURE_LEVEL_9_1: case D3D_FEATURE_LEVEL_9_1:
return 3; return 2;
default: default:
UNREACHABLE(); UNREACHABLE();
...@@ -1668,16 +1668,4 @@ gl::ErrorOrResult<TextureHelper11> CreateStagingTexture(GLenum textureType, ...@@ -1668,16 +1668,4 @@ gl::ErrorOrResult<TextureHelper11> CreateStagingTexture(GLenum textureType,
return TextureHelper11::MakeAndPossess3D(stagingTex); return TextureHelper11::MakeAndPossess3D(stagingTex);
} }
bool UsePresentPathFast(const Renderer11 *renderer,
const gl::FramebufferAttachment *framebufferAttachment)
{
if (framebufferAttachment == nullptr)
{
return false;
}
return (framebufferAttachment->type() == GL_FRAMEBUFFER_DEFAULT &&
renderer->presentPathFastEnabled());
}
} // namespace rx } // namespace rx
...@@ -24,7 +24,6 @@ class FramebufferAttachment; ...@@ -24,7 +24,6 @@ class FramebufferAttachment;
namespace rx namespace rx
{ {
class Renderer11;
class RenderTarget11; class RenderTarget11;
struct WorkaroundsD3D; struct WorkaroundsD3D;
struct Renderer11DeviceCaps; struct Renderer11DeviceCaps;
...@@ -375,8 +374,6 @@ gl::ErrorOrResult<TextureHelper11> CreateStagingTexture(GLenum textureType, ...@@ -375,8 +374,6 @@ gl::ErrorOrResult<TextureHelper11> CreateStagingTexture(GLenum textureType,
const gl::Extents &size, const gl::Extents &size,
ID3D11Device *device); ID3D11Device *device);
bool UsePresentPathFast(const Renderer11 *renderer, const gl::FramebufferAttachment *colorbuffer);
} // namespace rx } // namespace rx
#endif // LIBANGLE_RENDERER_D3D_D3D11_RENDERER11_UTILS_H_ #endif // LIBANGLE_RENDERER_D3D_D3D11_RENDERER11_UTILS_H_
...@@ -154,8 +154,7 @@ HRESULT CoreWindowNativeWindow::createSwapChain(ID3D11Device *device, ...@@ -154,8 +154,7 @@ HRESULT CoreWindowNativeWindow::createSwapChain(ID3D11Device *device,
swapChainDesc.Stereo = FALSE; swapChainDesc.Stereo = FALSE;
swapChainDesc.SampleDesc.Count = 1; swapChainDesc.SampleDesc.Count = 1;
swapChainDesc.SampleDesc.Quality = 0; swapChainDesc.SampleDesc.Quality = 0;
swapChainDesc.BufferUsage = swapChainDesc.BufferUsage = DXGI_USAGE_RENDER_TARGET_OUTPUT | DXGI_USAGE_BACK_BUFFER;
DXGI_USAGE_SHADER_INPUT | DXGI_USAGE_RENDER_TARGET_OUTPUT | DXGI_USAGE_BACK_BUFFER;
swapChainDesc.BufferCount = 2; swapChainDesc.BufferCount = 2;
swapChainDesc.SwapEffect = DXGI_SWAP_EFFECT_FLIP_SEQUENTIAL; swapChainDesc.SwapEffect = DXGI_SWAP_EFFECT_FLIP_SEQUENTIAL;
swapChainDesc.Scaling = DXGI_SCALING_STRETCH; swapChainDesc.Scaling = DXGI_SCALING_STRETCH;
......
...@@ -257,8 +257,7 @@ HRESULT SwapChainPanelNativeWindow::createSwapChain(ID3D11Device *device, ...@@ -257,8 +257,7 @@ HRESULT SwapChainPanelNativeWindow::createSwapChain(ID3D11Device *device,
swapChainDesc.Stereo = FALSE; swapChainDesc.Stereo = FALSE;
swapChainDesc.SampleDesc.Count = 1; swapChainDesc.SampleDesc.Count = 1;
swapChainDesc.SampleDesc.Quality = 0; swapChainDesc.SampleDesc.Quality = 0;
swapChainDesc.BufferUsage = swapChainDesc.BufferUsage = DXGI_USAGE_RENDER_TARGET_OUTPUT | DXGI_USAGE_BACK_BUFFER;
DXGI_USAGE_SHADER_INPUT | DXGI_USAGE_RENDER_TARGET_OUTPUT | DXGI_USAGE_BACK_BUFFER;
swapChainDesc.BufferCount = 2; swapChainDesc.BufferCount = 2;
swapChainDesc.SwapEffect = DXGI_SWAP_EFFECT_FLIP_SEQUENTIAL; swapChainDesc.SwapEffect = DXGI_SWAP_EFFECT_FLIP_SEQUENTIAL;
swapChainDesc.Scaling = DXGI_SCALING_STRETCH; swapChainDesc.Scaling = DXGI_SCALING_STRETCH;
......
...@@ -489,8 +489,8 @@ void StateManager9::setViewportState(const gl::Caps *caps, ...@@ -489,8 +489,8 @@ void StateManager9::setViewportState(const gl::Caps *caps,
mCurIgnoreViewport = ignoreViewport; mCurIgnoreViewport = ignoreViewport;
// Setting shader constants // Setting shader constants
dx_VertexConstants9 vc = {}; dx_VertexConstants vc = {};
dx_PixelConstants9 pc = {}; dx_PixelConstants pc = {};
vc.viewAdjust[0] = vc.viewAdjust[0] =
static_cast<float>((actualViewport.width - static_cast<int>(dxViewport.Width)) + static_cast<float>((actualViewport.width - static_cast<int>(dxViewport.Width)) +
...@@ -520,13 +520,13 @@ void StateManager9::setViewportState(const gl::Caps *caps, ...@@ -520,13 +520,13 @@ void StateManager9::setViewportState(const gl::Caps *caps,
pc.depthRange[1] = actualZFar; pc.depthRange[1] = actualZFar;
pc.depthRange[2] = actualZFar - actualZNear; pc.depthRange[2] = actualZFar - actualZNear;
if (memcmp(&vc, &mVertexConstants, sizeof(dx_VertexConstants9)) != 0) if (memcmp(&vc, &mVertexConstants, sizeof(dx_VertexConstants)) != 0)
{ {
mVertexConstants = vc; mVertexConstants = vc;
mDxUniformsDirty = true; mDxUniformsDirty = true;
} }
if (memcmp(&pc, &mPixelConstants, sizeof(dx_PixelConstants9)) != 0) if (memcmp(&pc, &mPixelConstants, sizeof(dx_PixelConstants)) != 0)
{ {
mPixelConstants = pc; mPixelConstants = pc;
mDxUniformsDirty = true; mDxUniformsDirty = true;
...@@ -542,9 +542,9 @@ void StateManager9::setShaderConstants() ...@@ -542,9 +542,9 @@ void StateManager9::setShaderConstants()
IDirect3DDevice9 *device = mRenderer9->getDevice(); IDirect3DDevice9 *device = mRenderer9->getDevice();
device->SetVertexShaderConstantF(0, reinterpret_cast<float *>(&mVertexConstants), device->SetVertexShaderConstantF(0, reinterpret_cast<float *>(&mVertexConstants),
sizeof(dx_VertexConstants9) / sizeof(float[4])); sizeof(dx_VertexConstants) / sizeof(float[4]));
device->SetPixelShaderConstantF(0, reinterpret_cast<float *>(&mPixelConstants), device->SetPixelShaderConstantF(0, reinterpret_cast<float *>(&mPixelConstants),
sizeof(dx_PixelConstants9) / sizeof(float[4])); sizeof(dx_PixelConstants) / sizeof(float[4]));
mDxUniformsDirty = false; mDxUniformsDirty = false;
} }
......
...@@ -19,20 +19,6 @@ namespace rx ...@@ -19,20 +19,6 @@ namespace rx
class Renderer9; class Renderer9;
struct dx_VertexConstants9
{
float depthRange[4];
float viewAdjust[4];
float viewCoords[4];
};
struct dx_PixelConstants9
{
float depthRange[4];
float viewCoords[4];
float depthFront[4];
};
class StateManager9 final : angle::NonCopyable class StateManager9 final : angle::NonCopyable
{ {
public: public:
...@@ -189,8 +175,8 @@ class StateManager9 final : angle::NonCopyable ...@@ -189,8 +175,8 @@ class StateManager9 final : angle::NonCopyable
float mCurDepthFront; float mCurDepthFront;
bool mCurIgnoreViewport; bool mCurIgnoreViewport;
dx_VertexConstants9 mVertexConstants; dx_VertexConstants mVertexConstants;
dx_PixelConstants9 mPixelConstants; dx_PixelConstants mPixelConstants;
bool mDxUniformsDirty; bool mDxUniformsDirty;
// FIXME: Unsupported by D3D9 // FIXME: Unsupported by D3D9
......
...@@ -163,7 +163,6 @@ EGLDisplay EGLAPIENTRY GetPlatformDisplayEXT(EGLenum platform, void *native_disp ...@@ -163,7 +163,6 @@ EGLDisplay EGLAPIENTRY GetPlatformDisplayEXT(EGLenum platform, void *native_disp
bool minorVersionSpecified = false; bool minorVersionSpecified = false;
bool enableAutoTrimSpecified = false; bool enableAutoTrimSpecified = false;
bool deviceTypeSpecified = false; bool deviceTypeSpecified = false;
bool presentPathSpecified = false;
if (attrib_list) if (attrib_list)
{ {
...@@ -229,29 +228,6 @@ EGLDisplay EGLAPIENTRY GetPlatformDisplayEXT(EGLenum platform, void *native_disp ...@@ -229,29 +228,6 @@ EGLDisplay EGLAPIENTRY GetPlatformDisplayEXT(EGLenum platform, void *native_disp
enableAutoTrimSpecified = true; enableAutoTrimSpecified = true;
break; break;
case EGL_EXPERIMENTAL_PRESENT_PATH_ANGLE:
if (!clientExtensions.experimentalPresentPath)
{
SetGlobalError(
Error(EGL_BAD_ATTRIBUTE,
"EGL_ANGLE_experimental_present_path extension not active"));
return EGL_NO_DISPLAY;
}
switch (curAttrib[1])
{
case EGL_EXPERIMENTAL_PRESENT_PATH_FAST_ANGLE:
case EGL_EXPERIMENTAL_PRESENT_PATH_COPY_ANGLE:
break;
default:
SetGlobalError(
Error(EGL_BAD_ATTRIBUTE,
"Invalid value for EGL_EXPERIMENTAL_PRESENT_PATH_ANGLE"));
return EGL_NO_DISPLAY;
}
presentPathSpecified = true;
break;
case EGL_PLATFORM_ANGLE_DEVICE_TYPE_ANGLE: case EGL_PLATFORM_ANGLE_DEVICE_TYPE_ANGLE:
switch (curAttrib[1]) switch (curAttrib[1])
{ {
...@@ -306,14 +282,6 @@ EGLDisplay EGLAPIENTRY GetPlatformDisplayEXT(EGLenum platform, void *native_disp ...@@ -306,14 +282,6 @@ EGLDisplay EGLAPIENTRY GetPlatformDisplayEXT(EGLenum platform, void *native_disp
return EGL_NO_DISPLAY; return EGL_NO_DISPLAY;
} }
if (presentPathSpecified && platformType != EGL_PLATFORM_ANGLE_TYPE_D3D11_ANGLE)
{
SetGlobalError(Error(EGL_BAD_ATTRIBUTE,
"EGL_EXPERIMENTAL_PRESENT_PATH_ANGLE requires a device type of "
"EGL_PLATFORM_ANGLE_TYPE_D3D11_ANGLE."));
return EGL_NO_DISPLAY;
}
if (deviceTypeSpecified && platformType != EGL_PLATFORM_ANGLE_TYPE_D3D9_ANGLE && if (deviceTypeSpecified && platformType != EGL_PLATFORM_ANGLE_TYPE_D3D9_ANGLE &&
platformType != EGL_PLATFORM_ANGLE_TYPE_D3D11_ANGLE) platformType != EGL_PLATFORM_ANGLE_TYPE_D3D11_ANGLE)
{ {
......
...@@ -83,7 +83,6 @@ ...@@ -83,7 +83,6 @@
'<(angle_path)/src/tests/gl_tests/D3D11FormatTablesTest.cpp', '<(angle_path)/src/tests/gl_tests/D3D11FormatTablesTest.cpp',
'<(angle_path)/src/tests/gl_tests/D3D11InputLayoutCacheTest.cpp', '<(angle_path)/src/tests/gl_tests/D3D11InputLayoutCacheTest.cpp',
'<(angle_path)/src/tests/egl_tests/EGLDeviceTest.cpp', '<(angle_path)/src/tests/egl_tests/EGLDeviceTest.cpp',
'<(angle_path)/src/tests/egl_tests/EGLPresentPathD3D11Test.cpp',
# TODO(cwallez) for Linux, requires a portable implementation of threads # TODO(cwallez) for Linux, requires a portable implementation of threads
'<(angle_path)/src/tests/egl_tests/EGLThreadTest.cpp', '<(angle_path)/src/tests/egl_tests/EGLThreadTest.cpp',
], ],
......
...@@ -892,7 +892,4 @@ TEST_P(BlitFramebufferANGLETest, Errors) ...@@ -892,7 +892,4 @@ TEST_P(BlitFramebufferANGLETest, Errors)
// default framebuffer is BGRA to enable the GL and GLES backends. (http://anglebug.com/1289) // default framebuffer is BGRA to enable the GL and GLES backends. (http://anglebug.com/1289)
// Use this to select which configurations (e.g. which renderer, which GLES major version) these tests should be run against. // Use this to select which configurations (e.g. which renderer, which GLES major version) these tests should be run against.
ANGLE_INSTANTIATE_TEST(BlitFramebufferANGLETest, ANGLE_INSTANTIATE_TEST(BlitFramebufferANGLETest, ES2_D3D9(), ES2_D3D11());
ES2_D3D9(),
ES2_D3D11(EGL_EXPERIMENTAL_PRESENT_PATH_COPY_ANGLE),
ES2_D3D11(EGL_EXPERIMENTAL_PRESENT_PATH_FAST_ANGLE));
...@@ -302,8 +302,7 @@ TEST_P(CopyTexImageTest, SubImageRGBToL) ...@@ -302,8 +302,7 @@ TEST_P(CopyTexImageTest, SubImageRGBToL)
// tests should be run against. // tests should be run against.
ANGLE_INSTANTIATE_TEST(CopyTexImageTest, ANGLE_INSTANTIATE_TEST(CopyTexImageTest,
ES2_D3D9(), ES2_D3D9(),
ES2_D3D11(EGL_EXPERIMENTAL_PRESENT_PATH_COPY_ANGLE), ES2_D3D11(),
ES2_D3D11(EGL_EXPERIMENTAL_PRESENT_PATH_FAST_ANGLE),
ES2_OPENGL(), ES2_OPENGL(),
ES2_OPENGL(3, 3), ES2_OPENGL(3, 3),
ES2_OPENGLES()); ES2_OPENGLES());
......
...@@ -928,8 +928,7 @@ TEST_P(MipmapTestES3, MipmapsForTexture3D) ...@@ -928,8 +928,7 @@ TEST_P(MipmapTestES3, MipmapsForTexture3D)
// Note: we run these tests against 9_3 on WARP due to hardware driver issues on Win7 // Note: we run these tests against 9_3 on WARP due to hardware driver issues on Win7
ANGLE_INSTANTIATE_TEST(MipmapTest, ANGLE_INSTANTIATE_TEST(MipmapTest,
ES2_D3D9(), ES2_D3D9(),
ES2_D3D11(EGL_EXPERIMENTAL_PRESENT_PATH_COPY_ANGLE), ES2_D3D11(),
ES2_D3D11(EGL_EXPERIMENTAL_PRESENT_PATH_FAST_ANGLE),
ES2_D3D11_FL9_3_WARP(), ES2_D3D11_FL9_3_WARP(),
ES2_OPENGL(), ES2_OPENGL(),
ES3_OPENGL(), ES3_OPENGL(),
......
...@@ -201,8 +201,7 @@ TEST_P(SimpleOperationTest, BufferSubData) ...@@ -201,8 +201,7 @@ TEST_P(SimpleOperationTest, BufferSubData)
// Use this to select which configurations (e.g. which renderer, which GLES major version) these tests should be run against. // Use this to select which configurations (e.g. which renderer, which GLES major version) these tests should be run against.
ANGLE_INSTANTIATE_TEST(SimpleOperationTest, ANGLE_INSTANTIATE_TEST(SimpleOperationTest,
ES2_D3D9(), ES2_D3D9(),
ES2_D3D11(EGL_EXPERIMENTAL_PRESENT_PATH_COPY_ANGLE), ES2_D3D11(),
ES2_D3D11(EGL_EXPERIMENTAL_PRESENT_PATH_FAST_ANGLE),
ES3_D3D11(), ES3_D3D11(),
ES2_OPENGL(), ES2_OPENGL(),
ES3_OPENGL(), ES3_OPENGL(),
......
...@@ -263,8 +263,7 @@ TEST_P(ViewportTest, TripleWindowOffCenter) ...@@ -263,8 +263,7 @@ TEST_P(ViewportTest, TripleWindowOffCenter)
// D3D11 Feature Level 9 and D3D9 emulate large and negative viewports in the vertex shader. We should test both of these as well as D3D11 Feature Level 10_0+. // D3D11 Feature Level 9 and D3D9 emulate large and negative viewports in the vertex shader. We should test both of these as well as D3D11 Feature Level 10_0+.
ANGLE_INSTANTIATE_TEST(ViewportTest, ANGLE_INSTANTIATE_TEST(ViewportTest,
ES2_D3D9(), ES2_D3D9(),
ES2_D3D11(EGL_EXPERIMENTAL_PRESENT_PATH_COPY_ANGLE), ES2_D3D11(),
ES2_D3D11(EGL_EXPERIMENTAL_PRESENT_PATH_FAST_ANGLE),
ES2_D3D11_FL9_3(), ES2_D3D11_FL9_3(),
ES2_OPENGLES(), ES2_OPENGLES(),
ES3_OPENGLES()); ES3_OPENGLES());
......
...@@ -113,25 +113,6 @@ std::ostream &operator<<(std::ostream& stream, const PlatformParameters &pp) ...@@ -113,25 +113,6 @@ std::ostream &operator<<(std::ostream& stream, const PlatformParameters &pp)
break; break;
} }
switch (pp.eglParameters.presentPath)
{
case EGL_EXPERIMENTAL_PRESENT_PATH_COPY_ANGLE:
stream << "_PRESENT_PATH_COPY";
break;
case EGL_EXPERIMENTAL_PRESENT_PATH_FAST_ANGLE:
stream << "_PRESENT_PATH_FAST";
break;
case EGL_DONT_CARE:
// default
break;
default:
UNREACHABLE();
break;
}
return stream; return stream;
} }
...@@ -184,12 +165,6 @@ EGLPlatformParameters D3D11() ...@@ -184,12 +165,6 @@ EGLPlatformParameters D3D11()
EGL_PLATFORM_ANGLE_DEVICE_TYPE_HARDWARE_ANGLE); EGL_PLATFORM_ANGLE_DEVICE_TYPE_HARDWARE_ANGLE);
} }
EGLPlatformParameters D3D11(EGLenum presentPath)
{
return EGLPlatformParameters(EGL_PLATFORM_ANGLE_TYPE_D3D11_ANGLE, EGL_DONT_CARE, EGL_DONT_CARE,
EGL_PLATFORM_ANGLE_DEVICE_TYPE_HARDWARE_ANGLE, presentPath);
}
EGLPlatformParameters D3D11_FL11_1() EGLPlatformParameters D3D11_FL11_1()
{ {
return EGLPlatformParameters( return EGLPlatformParameters(
...@@ -385,11 +360,6 @@ PlatformParameters ES2_D3D11() ...@@ -385,11 +360,6 @@ PlatformParameters ES2_D3D11()
return PlatformParameters(2, 0, egl_platform::D3D11()); return PlatformParameters(2, 0, egl_platform::D3D11());
} }
PlatformParameters ES2_D3D11(EGLenum presentPath)
{
return PlatformParameters(2, 0, egl_platform::D3D11(presentPath));
}
PlatformParameters ES2_D3D11_FL11_0() PlatformParameters ES2_D3D11_FL11_0()
{ {
return PlatformParameters(2, 0, egl_platform::D3D11_FL11_0()); return PlatformParameters(2, 0, egl_platform::D3D11_FL11_0());
......
...@@ -52,7 +52,6 @@ EGLPlatformParameters D3D9_NULL(); ...@@ -52,7 +52,6 @@ EGLPlatformParameters D3D9_NULL();
EGLPlatformParameters D3D9_REFERENCE(); EGLPlatformParameters D3D9_REFERENCE();
EGLPlatformParameters D3D11(); EGLPlatformParameters D3D11();
EGLPlatformParameters D3D11(EGLenum presentPath);
EGLPlatformParameters D3D11_FL11_1(); EGLPlatformParameters D3D11_FL11_1();
EGLPlatformParameters D3D11_FL11_0(); EGLPlatformParameters D3D11_FL11_0();
EGLPlatformParameters D3D11_FL10_1(); EGLPlatformParameters D3D11_FL10_1();
...@@ -89,7 +88,6 @@ PlatformParameters ES2_D3D9(); ...@@ -89,7 +88,6 @@ PlatformParameters ES2_D3D9();
PlatformParameters ES2_D3D9_REFERENCE(); PlatformParameters ES2_D3D9_REFERENCE();
PlatformParameters ES2_D3D11(); PlatformParameters ES2_D3D11();
PlatformParameters ES2_D3D11(EGLenum presentPath);
PlatformParameters ES2_D3D11_FL11_0(); PlatformParameters ES2_D3D11_FL11_0();
PlatformParameters ES2_D3D11_FL10_1(); PlatformParameters ES2_D3D11_FL10_1();
PlatformParameters ES2_D3D11_FL10_0(); PlatformParameters ES2_D3D11_FL10_0();
......
...@@ -16,8 +16,7 @@ EGLPlatformParameters::EGLPlatformParameters() ...@@ -16,8 +16,7 @@ EGLPlatformParameters::EGLPlatformParameters()
: renderer(EGL_PLATFORM_ANGLE_TYPE_DEFAULT_ANGLE), : renderer(EGL_PLATFORM_ANGLE_TYPE_DEFAULT_ANGLE),
majorVersion(EGL_DONT_CARE), majorVersion(EGL_DONT_CARE),
minorVersion(EGL_DONT_CARE), minorVersion(EGL_DONT_CARE),
deviceType(EGL_DONT_CARE), deviceType(EGL_DONT_CARE)
presentPath(EGL_DONT_CARE)
{ {
} }
...@@ -25,8 +24,7 @@ EGLPlatformParameters::EGLPlatformParameters(EGLint renderer) ...@@ -25,8 +24,7 @@ EGLPlatformParameters::EGLPlatformParameters(EGLint renderer)
: renderer(renderer), : renderer(renderer),
majorVersion(EGL_DONT_CARE), majorVersion(EGL_DONT_CARE),
minorVersion(EGL_DONT_CARE), minorVersion(EGL_DONT_CARE),
deviceType(EGL_DONT_CARE), deviceType(EGL_DONT_CARE)
presentPath(EGL_DONT_CARE)
{ {
if (renderer == EGL_PLATFORM_ANGLE_TYPE_D3D9_ANGLE || if (renderer == EGL_PLATFORM_ANGLE_TYPE_D3D9_ANGLE ||
renderer == EGL_PLATFORM_ANGLE_TYPE_D3D11_ANGLE) renderer == EGL_PLATFORM_ANGLE_TYPE_D3D11_ANGLE)
...@@ -35,28 +33,11 @@ EGLPlatformParameters::EGLPlatformParameters(EGLint renderer) ...@@ -35,28 +33,11 @@ EGLPlatformParameters::EGLPlatformParameters(EGLint renderer)
} }
} }
EGLPlatformParameters::EGLPlatformParameters(EGLint renderer, EGLPlatformParameters::EGLPlatformParameters(EGLint renderer, EGLint majorVersion, EGLint minorVersion, EGLint useWarp)
EGLint majorVersion,
EGLint minorVersion,
EGLint useWarp)
: renderer(renderer), : renderer(renderer),
majorVersion(majorVersion), majorVersion(majorVersion),
minorVersion(minorVersion), minorVersion(minorVersion),
deviceType(useWarp), deviceType(useWarp)
presentPath(EGL_DONT_CARE)
{
}
EGLPlatformParameters::EGLPlatformParameters(EGLint renderer,
EGLint majorVersion,
EGLint minorVersion,
EGLint useWarp,
EGLint presentPath)
: renderer(renderer),
majorVersion(majorVersion),
minorVersion(minorVersion),
deviceType(useWarp),
presentPath(presentPath)
{ {
} }
...@@ -77,19 +58,15 @@ bool operator<(const EGLPlatformParameters &a, const EGLPlatformParameters &b) ...@@ -77,19 +58,15 @@ bool operator<(const EGLPlatformParameters &a, const EGLPlatformParameters &b)
return a.minorVersion < b.minorVersion; return a.minorVersion < b.minorVersion;
} }
if (a.deviceType != b.deviceType) return a.deviceType < b.deviceType;
{
return a.deviceType < b.deviceType;
}
return a.presentPath < b.presentPath;
} }
bool operator==(const EGLPlatformParameters &a, const EGLPlatformParameters &b) bool operator==(const EGLPlatformParameters &a, const EGLPlatformParameters &b)
{ {
return (a.renderer == b.renderer) && (a.majorVersion == b.majorVersion) && return (a.renderer == b.renderer) &&
(a.minorVersion == b.minorVersion) && (a.deviceType == b.deviceType) && (a.majorVersion == b.majorVersion) &&
(a.presentPath == b.presentPath); (a.minorVersion == b.minorVersion) &&
(a.deviceType == b.deviceType);
} }
EGLWindow::EGLWindow(EGLint glesMajorVersion, EGLWindow::EGLWindow(EGLint glesMajorVersion,
...@@ -165,20 +142,6 @@ bool EGLWindow::initializeGL(OSWindow *osWindow) ...@@ -165,20 +142,6 @@ bool EGLWindow::initializeGL(OSWindow *osWindow)
displayAttributes.push_back(EGL_PLATFORM_ANGLE_DEVICE_TYPE_ANGLE); displayAttributes.push_back(EGL_PLATFORM_ANGLE_DEVICE_TYPE_ANGLE);
displayAttributes.push_back(mPlatform.deviceType); displayAttributes.push_back(mPlatform.deviceType);
} }
if (mPlatform.presentPath != EGL_DONT_CARE)
{
const char *extensionString =
static_cast<const char *>(eglQueryString(EGL_NO_DISPLAY, EGL_EXTENSIONS));
if (strstr(extensionString, "EGL_ANGLE_experimental_present_path") == nullptr)
{
destroyGL();
return false;
}
displayAttributes.push_back(EGL_EXPERIMENTAL_PRESENT_PATH_ANGLE);
displayAttributes.push_back(mPlatform.presentPath);
}
displayAttributes.push_back(EGL_NONE); displayAttributes.push_back(EGL_NONE);
mDisplay = eglGetPlatformDisplayEXT(EGL_PLATFORM_ANGLE_ANGLE, mDisplay = eglGetPlatformDisplayEXT(EGL_PLATFORM_ANGLE_ANGLE,
......
...@@ -34,16 +34,10 @@ struct EGLPlatformParameters ...@@ -34,16 +34,10 @@ struct EGLPlatformParameters
EGLint majorVersion; EGLint majorVersion;
EGLint minorVersion; EGLint minorVersion;
EGLint deviceType; EGLint deviceType;
EGLint presentPath;
EGLPlatformParameters(); EGLPlatformParameters();
explicit EGLPlatformParameters(EGLint renderer); explicit EGLPlatformParameters(EGLint renderer);
EGLPlatformParameters(EGLint renderer, EGLint majorVersion, EGLint minorVersion, EGLint deviceType); EGLPlatformParameters(EGLint renderer, EGLint majorVersion, EGLint minorVersion, EGLint deviceType);
EGLPlatformParameters(EGLint renderer,
EGLint majorVersion,
EGLint minorVersion,
EGLint deviceType,
EGLint presentPath);
}; };
bool operator<(const EGLPlatformParameters &a, const EGLPlatformParameters &b); bool operator<(const EGLPlatformParameters &a, const EGLPlatformParameters &b);
......
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