Skip to content

Commit

Permalink
Revert "Cherry-pick bce91c8033e3. rdar://126944294"
Browse files Browse the repository at this point in the history
  • Loading branch information
Dan Robson committed Apr 24, 2024
1 parent 08f0de8 commit 4e7e6f9
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 62 deletions.
6 changes: 5 additions & 1 deletion Source/ThirdParty/ANGLE/src/compiler/translator/msl/Name.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -96,10 +96,14 @@ void Name::emitImpl(T &out) const
{
out << mRawName;
}
else
else if (mRawName[0] != '_')
{
out << kAngleInternalPrefix << '_' << mRawName;
}
else
{
out << kAngleInternalPrefix << mRawName;
}
break;

case SymbolType::Empty:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -527,7 +527,7 @@ void AddFragDepthEXTDeclaration(TCompiler &compiler, TIntermBlock &root, TSymbol
// EXT_blend_func_extended usage, the exact variable may be unknown until the
// program is linked.
TVariable *alpha0 =
new TVariable(&symbolTable, sh::ImmutableString("ALPHA0"),
new TVariable(&symbolTable, sh::ImmutableString("_ALPHA0"),
StaticType::Get<EbtFloat, EbpUndefined, EvqSpecConst, 1, 1>(),
SymbolType::AngleInternal);

Expand Down
60 changes: 0 additions & 60 deletions Source/ThirdParty/ANGLE/src/tests/gl_tests/GLSLTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18874,66 +18874,6 @@ void main()
EXPECT_PIXEL_COLOR_EQ(0, 0, GLColor::green);
}

// Test that underscores in array names work with out arrays.
TEST_P(GLSLTest_ES3, UnderscoresWorkWithOutArrays)
{
GLuint fbo;
glGenFramebuffers(1, &fbo);
glBindFramebuffer(GL_DRAW_FRAMEBUFFER, fbo);

GLuint textures[4];
glGenTextures(4, textures);

for (size_t texIndex = 0; texIndex < ArraySize(textures); texIndex++)
{
glBindTexture(GL_TEXTURE_2D, textures[texIndex]);
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, getWindowWidth(), getWindowHeight(), 0, GL_RGBA,
GL_UNSIGNED_BYTE, nullptr);
}

GLint maxDrawBuffers;
glGetIntegerv(GL_MAX_DRAW_BUFFERS, &maxDrawBuffers);
ASSERT_GE(maxDrawBuffers, 4);

GLuint readFramebuffer;
glGenFramebuffers(1, &readFramebuffer);
glBindFramebuffer(GL_READ_FRAMEBUFFER, readFramebuffer);

constexpr char kFS[] = R"(#version 300 es
precision highp float;
out vec4 _e[4];
void main()
{
_e[0] = vec4(1.0, 0.0, 0.0, 1.0);
_e[1] = vec4(0.0, 1.0, 0.0, 1.0);
_e[2] = vec4(0.0, 0.0, 1.0, 1.0);
_e[3] = vec4(1.0, 1.0, 1.0, 1.0);
}
)";
ANGLE_GL_PROGRAM(program, essl3_shaders::vs::Simple(), kFS);
GLenum allBufs[4] = {GL_COLOR_ATTACHMENT0, GL_COLOR_ATTACHMENT1, GL_COLOR_ATTACHMENT2,
GL_COLOR_ATTACHMENT3};
constexpr GLuint kMaxBuffers = 4;
// Enable all draw buffers.
for (GLuint texIndex = 0; texIndex < kMaxBuffers; texIndex++)
{
glBindTexture(GL_TEXTURE_2D, textures[texIndex]);
glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0 + texIndex, GL_TEXTURE_2D,
textures[texIndex], 0);
glFramebufferTexture2D(GL_READ_FRAMEBUFFER, GL_COLOR_ATTACHMENT0 + texIndex, GL_TEXTURE_2D,
textures[texIndex], 0);
}
glDrawBuffers(kMaxBuffers, allBufs);

// Draw with simple program.
drawQuad(program, essl3_shaders::PositionAttrib(), 0.5f, 1.0f, true);
ASSERT_GL_NO_ERROR();
verifyAttachment2DColor(0, textures[0], GL_TEXTURE_2D, 0, GLColor::red);
verifyAttachment2DColor(1, textures[1], GL_TEXTURE_2D, 0, GLColor::green);
verifyAttachment2DColor(2, textures[2], GL_TEXTURE_2D, 0, GLColor::blue);
verifyAttachment2DColor(3, textures[3], GL_TEXTURE_2D, 0, GLColor::white);
}

} // anonymous namespace

ANGLE_INSTANTIATE_TEST_ES2_AND_ES3_AND(
Expand Down

0 comments on commit 4e7e6f9

Please sign in to comment.