diff --git a/src/backend/d3d12/ShaderModuleD3D12.cpp b/src/backend/d3d12/ShaderModuleD3D12.cpp index ea53b12b55..7efb892df2 100644 --- a/src/backend/d3d12/ShaderModuleD3D12.cpp +++ b/src/backend/d3d12/ShaderModuleD3D12.cpp @@ -23,7 +23,6 @@ namespace backend { namespace d3d12 { spirv_cross::CompilerHLSL compiler(builder->AcquireSpirv()); spirv_cross::CompilerGLSL::Options options_glsl; - options_glsl.vertex.flip_vert_y = false; options_glsl.vertex.fixup_clipspace = true; compiler.spirv_cross::CompilerGLSL::set_options(options_glsl); diff --git a/src/backend/opengl/ShaderModuleGL.cpp b/src/backend/opengl/ShaderModuleGL.cpp index 78ebad4c3e..a7495e1300 100644 --- a/src/backend/opengl/ShaderModuleGL.cpp +++ b/src/backend/opengl/ShaderModuleGL.cpp @@ -56,7 +56,6 @@ namespace backend { namespace opengl { #else options.version = 440; #endif - options.vertex.flip_vert_y = true; compiler.set_options(options); // Rename the push constant block to be prefixed with the shader stage type so that uniform diff --git a/src/tests/end2end/IndexFormatTests.cpp b/src/tests/end2end/IndexFormatTests.cpp index debf15c432..9bab9598ed 100644 --- a/src/tests/end2end/IndexFormatTests.cpp +++ b/src/tests/end2end/IndexFormatTests.cpp @@ -117,7 +117,7 @@ TEST_P(IndexFormatTest, Uint32) { queue.Submit(1, &commands); - EXPECT_PIXEL_RGBA8_EQ(RGBA8(0, 255, 0, 255), renderTarget, 100, 100); + EXPECT_PIXEL_RGBA8_EQ(RGBA8(0, 255, 0, 255), renderTarget, 100, 300); } // Test that the Uint16 index format is correctly interpreted @@ -148,7 +148,7 @@ TEST_P(IndexFormatTest, Uint16) { queue.Submit(1, &commands); - EXPECT_PIXEL_RGBA8_EQ(RGBA8(0, 255, 0, 255), renderTarget, 100, 100); + EXPECT_PIXEL_RGBA8_EQ(RGBA8(0, 255, 0, 255), renderTarget, 100, 300); } // Test for primitive restart use vertices like in the drawing and draw the following @@ -192,9 +192,9 @@ TEST_P(IndexFormatTest, Uint32PrimitiveRestart) { queue.Submit(1, &commands); - EXPECT_PIXEL_RGBA8_EQ(RGBA8(0, 255, 0, 255), renderTarget, 190, 210); // A - EXPECT_PIXEL_RGBA8_EQ(RGBA8(0, 255, 0, 255), renderTarget, 210, 190); // B - EXPECT_PIXEL_RGBA8_EQ(RGBA8(0, 0, 0, 0), renderTarget, 210, 210); // C + EXPECT_PIXEL_RGBA8_EQ(RGBA8(0, 255, 0, 255), renderTarget, 190, 190); // A + EXPECT_PIXEL_RGBA8_EQ(RGBA8(0, 255, 0, 255), renderTarget, 210, 210); // B + EXPECT_PIXEL_RGBA8_EQ(RGBA8(0, 0, 0, 0), renderTarget, 210, 190); // C } // Test use of primitive restart with an Uint16 index format @@ -226,9 +226,9 @@ TEST_P(IndexFormatTest, Uint16PrimitiveRestart) { queue.Submit(1, &commands); - EXPECT_PIXEL_RGBA8_EQ(RGBA8(0, 255, 0, 255), renderTarget, 190, 210); // A - EXPECT_PIXEL_RGBA8_EQ(RGBA8(0, 255, 0, 255), renderTarget, 210, 190); // B - EXPECT_PIXEL_RGBA8_EQ(RGBA8(0, 0, 0, 0), renderTarget, 210, 210); // C + EXPECT_PIXEL_RGBA8_EQ(RGBA8(0, 255, 0, 255), renderTarget, 190, 190); // A + EXPECT_PIXEL_RGBA8_EQ(RGBA8(0, 255, 0, 255), renderTarget, 210, 210); // B + EXPECT_PIXEL_RGBA8_EQ(RGBA8(0, 0, 0, 0), renderTarget, 210, 190); // C } // Test that the index format used is the format of the last set pipeline. This is to @@ -264,7 +264,7 @@ TEST_P(IndexFormatTest, ChangePipelineAfterSetIndexBuffer) { queue.Submit(1, &commands); - EXPECT_PIXEL_RGBA8_EQ(RGBA8(0, 255, 0, 255), renderTarget, 100, 100); + EXPECT_PIXEL_RGBA8_EQ(RGBA8(0, 255, 0, 255), renderTarget, 100, 300); } NXT_INSTANTIATE_TEST(IndexFormatTest, MetalBackend, OpenGLBackend) diff --git a/src/tests/end2end/InputStateTests.cpp b/src/tests/end2end/InputStateTests.cpp index 79a4895b14..66958d29af 100644 --- a/src/tests/end2end/InputStateTests.cpp +++ b/src/tests/end2end/InputStateTests.cpp @@ -101,7 +101,7 @@ class InputStateTest : public NXTTest { // Hard code the triangle in the shader so that we don't have to add a vertex input for it. // Also this places the triangle in the grid based on its VertexID and InstanceID vs << " const vec2 pos[3] = vec2[3](vec2(0.5f, 1.0f), vec2(0.0f, 0.0f), vec2(1.0f, 0.0f));\n"; - vs << " vec2 offset = vec2(float(gl_VertexIndex / 3), 3 - float(gl_InstanceIndex));\n"; + vs << " vec2 offset = vec2(float(gl_VertexIndex / 3), float(gl_InstanceIndex));\n"; vs << " vec2 worldPos = pos[gl_VertexIndex % 3] + offset;\n"; vs << " gl_Position = vec4(worldPos / 2 - vec2(1.0f), 0.0f, 1.0f);\n"; diff --git a/src/tests/end2end/PrimitiveTopologyTests.cpp b/src/tests/end2end/PrimitiveTopologyTests.cpp index c688415d4f..bd98ea9ee4 100644 --- a/src/tests/end2end/PrimitiveTopologyTests.cpp +++ b/src/tests/end2end/PrimitiveTopologyTests.cpp @@ -97,6 +97,7 @@ constexpr TestLocation GetCentroid(const TestLocation& a, const TestLocation& b, return { (a.x + b.x + c.x) / 3, (a.y + b.y + c.y) / 3 }; } +// clang-format off // Offset towards one corner to avoid x or y symmetry false positives constexpr static unsigned int kOffset = kRTSize / 8; @@ -132,13 +133,14 @@ constexpr static TestLocation kTriangleStripTestLocations[] = { constexpr static float kRTSizef = static_cast(kRTSize); constexpr static float kVertices[] = { - 2.f * (kPointTestLocations[0].x + 0.5f) / kRTSizef - 1.f, 1.f - 2.f * (kPointTestLocations[0].y + 0.5f) / kRTSizef, 0.f, 1.f, - 2.f * (kPointTestLocations[1].x + 0.5f) / kRTSizef - 1.f, 1.f - 2.f * (kPointTestLocations[1].y + 0.5f) / kRTSizef, 0.f, 1.f, - 2.f * (kPointTestLocations[2].x + 0.5f) / kRTSizef - 1.f, 1.f - 2.f * (kPointTestLocations[2].y + 0.5f) / kRTSizef, 0.f, 1.f, - 2.f * (kPointTestLocations[3].x + 0.5f) / kRTSizef - 1.f, 1.f - 2.f * (kPointTestLocations[3].y + 0.5f) / kRTSizef, 0.f, 1.f, - 2.f * (kPointTestLocations[4].x + 0.5f) / kRTSizef - 1.f, 1.f - 2.f * (kPointTestLocations[4].y + 0.5f) / kRTSizef, 0.f, 1.f, - 2.f * (kPointTestLocations[5].x + 0.5f) / kRTSizef - 1.f, 1.f - 2.f * (kPointTestLocations[5].y + 0.5f) / kRTSizef, 0.f, 1.f, + 2.f * (kPointTestLocations[0].x + 0.5f) / kRTSizef - 1.f, 2.f * (kPointTestLocations[0].y + 0.5f) / kRTSizef - 1.0f, 0.f, 1.f, + 2.f * (kPointTestLocations[1].x + 0.5f) / kRTSizef - 1.f, 2.f * (kPointTestLocations[1].y + 0.5f) / kRTSizef - 1.0f, 0.f, 1.f, + 2.f * (kPointTestLocations[2].x + 0.5f) / kRTSizef - 1.f, 2.f * (kPointTestLocations[2].y + 0.5f) / kRTSizef - 1.0f, 0.f, 1.f, + 2.f * (kPointTestLocations[3].x + 0.5f) / kRTSizef - 1.f, 2.f * (kPointTestLocations[3].y + 0.5f) / kRTSizef - 1.0f, 0.f, 1.f, + 2.f * (kPointTestLocations[4].x + 0.5f) / kRTSizef - 1.f, 2.f * (kPointTestLocations[4].y + 0.5f) / kRTSizef - 1.0f, 0.f, 1.f, + 2.f * (kPointTestLocations[5].x + 0.5f) / kRTSizef - 1.f, 2.f * (kPointTestLocations[5].y + 0.5f) / kRTSizef - 1.0f, 0.f, 1.f, }; +// clang-format on class PrimitiveTopologyTest : public NXTTest { protected: