-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix pattern attributes vertex layout (#9482)
* Fix vertex layout attribute offset when used with DDS The vertex layout offset for patternAttributes is overriden to be 0, this is incorrect as each component of this layout require a specific offset to be set to appropriately bind the buffers when calling vertexAttribPointer * Fix flow * Cleanup unused param * Add render tests for data driven styling coverage * EOL
- Loading branch information
1 parent
8131815
commit 2faf0ab
Showing
5 changed files
with
105 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,12 @@ | ||
// @flow | ||
import {createLayout} from '../../util/struct_array'; | ||
|
||
export default createLayout([ | ||
const patternAttributes = createLayout([ | ||
// [tl.x, tl.y, br.x, br.y] | ||
{name: 'a_pattern_from', components: 4, type: 'Uint16'}, | ||
{name: 'a_pattern_to', components: 4, type: 'Uint16'}, | ||
{name: 'a_pixel_ratio_from', components: 1, type: 'Uint8'}, | ||
{name: 'a_pixel_ratio_to', components: 1, type: 'Uint8'}, | ||
]); | ||
|
||
export default patternAttributes; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file added
BIN
+29.2 KB
...gration/render-tests/fill-extrusion-pattern/2x-on-1x-add-image-dds/expected.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
97 changes: 97 additions & 0 deletions
97
...tegration/render-tests/fill-extrusion-pattern/2x-on-1x-add-image-dds/style.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
{ | ||
"version": 8, | ||
"metadata": { | ||
"test": { | ||
"height": 256, | ||
"width": 256, | ||
"pixelRatio": 1, | ||
"operations": [ | ||
[ | ||
"wait" | ||
], | ||
[ | ||
"addImage", | ||
"pattern", | ||
"./image/marker.png", | ||
{ | ||
"pixelRatio": 2 | ||
} | ||
], | ||
[ | ||
"wait" | ||
], | ||
[ | ||
"addSource", | ||
"geojson", | ||
{ | ||
"type": "geojson", | ||
"data": { | ||
"type": "FeatureCollection", | ||
"features": [ | ||
{ | ||
"type": "Feature", | ||
"properties": { | ||
"height": 10 | ||
}, | ||
"geometry": { | ||
"type": "Polygon", | ||
"coordinates": [ | ||
[ | ||
[ | ||
-0.0001, | ||
-0.0001 | ||
], | ||
[ | ||
-0.0001, | ||
0.0001 | ||
], | ||
[ | ||
0.0001, | ||
0.0001 | ||
], | ||
[ | ||
0.0001, | ||
-0.0001 | ||
], | ||
[ | ||
-0.0001, | ||
-0.0001 | ||
] | ||
] | ||
] | ||
} | ||
} | ||
] | ||
} | ||
} | ||
], | ||
[ | ||
"wait" | ||
], | ||
[ | ||
"addLayer", | ||
{ | ||
"id": "extrusion", | ||
"type": "fill-extrusion", | ||
"source": "geojson", | ||
"paint": { | ||
"fill-extrusion-pattern": { | ||
"property": "height", | ||
"type": "interval", | ||
"stops": [[0, "pattern"]] | ||
}, | ||
"fill-extrusion-height": 10 | ||
} | ||
} | ||
], | ||
[ | ||
"wait" | ||
] | ||
] | ||
} | ||
}, | ||
"pitch": 60, | ||
"zoom": 19, | ||
"sources": {}, | ||
"layers": [] | ||
} |