@@ -163,8 +163,8 @@ describe("isProjectiveQuadPlan — projective quad detection", () => {
163163// ---------------------------------------------------------------------------
164164
165165const noDisable = new Set < "b" | "i" | "u" > ( ) ;
166- const desktopEnv = { solidTriangleSupported : true , borderShapeSupported : false } ;
167- const borderShapeEnv = { solidTriangleSupported : true , borderShapeSupported : true } ;
166+ const desktopEnv = { solidTriangleSupported : true , projectiveQuadSupported : true , borderShapeSupported : false } ;
167+ const borderShapeEnv = { solidTriangleSupported : true , projectiveQuadSupported : true , borderShapeSupported : true } ;
168168
169169describe ( "filterAtlasPlans — full-rect solid exclusion" , ( ) => {
170170 it ( "full-rect plan is excluded from atlas when b is enabled" , ( ) => {
@@ -177,7 +177,11 @@ describe("filterAtlasPlans — full-rect solid exclusion", () => {
177177 const plan = computeTextureAtlasPlanPublic ( FLAT_RECT , 0 ) ! ;
178178 const disabled = new Set < "b" | "i" | "u" > ( [ "b" ] ) ;
179179 // When b disabled and no border-shape, rect falls through to atlas
180- const result = filterAtlasPlans ( [ plan ] , "baked" , disabled , { solidTriangleSupported : true , borderShapeSupported : false } ) ;
180+ const result = filterAtlasPlans ( [ plan ] , "baked" , disabled , {
181+ solidTriangleSupported : true ,
182+ projectiveQuadSupported : true ,
183+ borderShapeSupported : false ,
184+ } ) ;
181185 expect ( result [ 0 ] ) . not . toBeNull ( ) ;
182186 } ) ;
183187} ) ;
@@ -193,13 +197,21 @@ describe("filterAtlasPlans — triangle exclusion", () => {
193197 const plan = computeTextureAtlasPlanPublic ( FLAT_TRIANGLE , 0 ) ! ;
194198 const disabled = new Set < "b" | "i" | "u" > ( [ "u" ] ) ;
195199 // u disabled and no border-shape → triangle goes to atlas
196- const result = filterAtlasPlans ( [ plan ] , "baked" , disabled , { solidTriangleSupported : false , borderShapeSupported : false } ) ;
200+ const result = filterAtlasPlans ( [ plan ] , "baked" , disabled , {
201+ solidTriangleSupported : false ,
202+ projectiveQuadSupported : true ,
203+ borderShapeSupported : false ,
204+ } ) ;
197205 expect ( result [ 0 ] ) . not . toBeNull ( ) ;
198206 } ) ;
199207
200208 it ( "triangle plan stays in atlas when solidTriangleSupported is false" , ( ) => {
201209 const plan = computeTextureAtlasPlanPublic ( FLAT_TRIANGLE , 0 ) ! ;
202- const result = filterAtlasPlans ( [ plan ] , "baked" , noDisable , { solidTriangleSupported : false , borderShapeSupported : false } ) ;
210+ const result = filterAtlasPlans ( [ plan ] , "baked" , noDisable , {
211+ solidTriangleSupported : false ,
212+ projectiveQuadSupported : true ,
213+ borderShapeSupported : false ,
214+ } ) ;
203215 expect ( result [ 0 ] ) . not . toBeNull ( ) ;
204216 } ) ;
205217} ) ;
@@ -250,6 +262,30 @@ describe("filterAtlasPlans — border-shape exclusion", () => {
250262 } ) ;
251263} ) ;
252264
265+ describe ( "filterAtlasPlans — projective quad exclusion" , ( ) => {
266+ it ( "non-rect projective quads are excluded when projective b is supported" , ( ) => {
267+ const plan = computeTextureAtlasPlanPublic ( NON_RECT_QUAD , 0 ) ! ;
268+ expect ( isProjectiveQuadPlan ( plan ) ) . toBe ( true ) ;
269+ const result = filterAtlasPlans ( [ plan ] , "baked" , noDisable , {
270+ solidTriangleSupported : true ,
271+ projectiveQuadSupported : true ,
272+ borderShapeSupported : false ,
273+ } ) ;
274+ expect ( result [ 0 ] ) . toBeNull ( ) ;
275+ } ) ;
276+
277+ it ( "non-rect projective quads stay in atlas when projective b is unsupported" , ( ) => {
278+ const plan = computeTextureAtlasPlanPublic ( NON_RECT_QUAD , 0 ) ! ;
279+ expect ( isProjectiveQuadPlan ( plan ) ) . toBe ( true ) ;
280+ const result = filterAtlasPlans ( [ plan ] , "baked" , noDisable , {
281+ solidTriangleSupported : true ,
282+ projectiveQuadSupported : false ,
283+ borderShapeSupported : false ,
284+ } ) ;
285+ expect ( result [ 0 ] ) . toBe ( plan ) ;
286+ } ) ;
287+ } ) ;
288+
253289describe ( "filterAtlasPlans — output array length matches input" , ( ) => {
254290 it ( "length is preserved for mixed null/non-null arrays" , ( ) => {
255291 const plans = [
0 commit comments