@@ -119,7 +119,6 @@ class PixTest : public ::testing::Test {
119119 TEST_METHOD (AccessTracking_ModificationReport_SM66)
120120
121121 TEST_METHOD (PixStructAnnotation_Lib_DualRaygen)
122- TEST_METHOD (PixStructAnnotation_Lib_RaygenAllocaStructAlignment)
123122
124123 TEST_METHOD (PixStructAnnotation_Simple)
125124 TEST_METHOD (PixStructAnnotation_CopiedStruct)
@@ -1455,100 +1454,6 @@ void Raygen1()
14551454 }
14561455}
14571456
1458- TEST_F (PixTest, PixStructAnnotation_Lib_RaygenAllocaStructAlignment) {
1459- if (m_ver.SkipDxilVersion (1 , 5 ))
1460- return ;
1461-
1462- const char *hlsl = R"(
1463-
1464- RaytracingAccelerationStructure Scene : register(t0, space0);
1465- RWTexture2D<float4> RenderTarget : register(u0);
1466-
1467- struct SceneConstantBuffer
1468- {
1469- float4x4 projectionToWorld;
1470- float4 cameraPosition;
1471- float4 lightPosition;
1472- float4 lightAmbientColor;
1473- float4 lightDiffuseColor;
1474- };
1475-
1476- ConstantBuffer<SceneConstantBuffer> g_sceneCB : register(b0);
1477-
1478- struct RayPayload
1479- {
1480- float4 color;
1481- };
1482-
1483- inline void GenerateCameraRay(uint2 index, out float3 origin, out float3 direction)
1484- {
1485- float2 xy = index + 0.5f; // center in the middle of the pixel.
1486- float2 screenPos = xy;// / DispatchRaysDimensions().xy * 2.0 - 1.0;
1487-
1488- // Invert Y for DirectX-style coordinates.
1489- screenPos.y = -screenPos.y;
1490-
1491- // Unproject the pixel coordinate into a ray.
1492- float4 world = /*mul(*/float4(screenPos, 0, 1)/*, g_sceneCB.projectionToWorld)*/;
1493-
1494- //world.xyz /= world.w;
1495- origin = world.xyz; //g_sceneCB.cameraPosition.xyz;
1496- direction = float3(1,0,0);//normalize(world.xyz - origin);
1497- }
1498-
1499- void RaygenCommon()
1500- {
1501- float3 rayDir;
1502- float3 origin;
1503-
1504- // Generate a ray for a camera pixel corresponding to an index from the dispatched 2D grid.
1505- GenerateCameraRay(DispatchRaysIndex().xy, origin, rayDir);
1506-
1507- // Trace the ray.
1508- // Set the ray's extents.
1509- RayDesc ray;
1510- ray.Origin = origin;
1511- ray.Direction = rayDir;
1512- // Set TMin to a non-zero small value to avoid aliasing issues due to floating - point errors.
1513- // TMin should be kept small to prevent missing geometry at close contact areas.
1514- ray.TMin = 0.001;
1515- ray.TMax = 10000.0;
1516- RayPayload payload = { float4(0, 0, 0, 0) };
1517- TraceRay(Scene, RAY_FLAG_CULL_BACK_FACING_TRIANGLES, ~0, 0, 1, 0, ray, payload);
1518-
1519- // Write the raytraced color to the output texture.
1520- // RenderTarget[DispatchRaysIndex().xy] = payload.color;
1521- }
1522-
1523- [shader("raygeneration")]
1524- void Raygen()
1525- {
1526- RaygenCommon();
1527- }
1528- )" ;
1529-
1530- auto Testables = TestStructAnnotationCase (hlsl, L" -Od" , true , L" lib_6_6" );
1531-
1532- // Built-in type "RayDesc" has this structure: struct { float3 Origin; float
1533- // TMin; float3 Direction; float TMax; } This is 8 floats, with members at
1534- // offsets 0,3,4,7 respectively.
1535-
1536- auto FindAtLeastOneOf = [=](char const *name, uint32_t index) {
1537- VERIFY_IS_TRUE (std::find_if (Testables.AllocaWrites .begin (),
1538- Testables.AllocaWrites .end (),
1539- [&name, &index](AllocaWrite const &aw) {
1540- return 0 == strcmp (aw.memberName .c_str (),
1541- name) &&
1542- aw.index == index;
1543- }) != Testables.AllocaWrites .end ());
1544- };
1545-
1546- FindAtLeastOneOf (" Origin.x" , 0 );
1547- FindAtLeastOneOf (" TMin" , 3 );
1548- FindAtLeastOneOf (" Direction.x" , 4 );
1549- FindAtLeastOneOf (" TMax" , 7 );
1550- }
1551-
15521457TEST_F (PixTest, PixStructAnnotation_Simple) {
15531458 if (m_ver.SkipDxilVersion (1 , 5 ))
15541459 return ;
@@ -3441,7 +3346,6 @@ void RaygenInternalName()
34413346 // check that there are alloca writes that cover all of them. RayPayload
34423347 // has four elements, and RayDesc has eight.
34433348 std::array<bool , 4 > RayPayloadElementCoverage;
3444- std::array<bool , 8 > RayDescElementCoverage;
34453349
34463350 for (auto const &write : metaDataKeyToValue.allocaWrites ) {
34473351 // the whole point of the changes with this test is to separate vector
@@ -3452,14 +3356,10 @@ void RaygenInternalName()
34523356 if (findAlloca != metaDataKeyToValue.allocaDefinitions .end ()) {
34533357 if (findAlloca->second .count == 4 ) {
34543358 RayPayloadElementCoverage[write.second .offset ] = true ;
3455- } else if (findAlloca->second .count == 8 ) {
3456- RayDescElementCoverage[write.second .offset ] = true ;
34573359 }
34583360 }
34593361 }
34603362 // Check that coverage for every element was emitted:
34613363 for (auto const &b : RayPayloadElementCoverage)
34623364 VERIFY_IS_TRUE (b);
3463- for (auto const &b : RayDescElementCoverage)
3464- VERIFY_IS_TRUE (b);
34653365}
0 commit comments