Skip to content

Commit dc136c5

Browse files
authored
Merge pull request #810 from F0bes/graph-align
make graph_vram_allocate() return an aligned pointer
2 parents 19c09ec + 486e6eb commit dc136c5

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

ee/graph/src/graph_vram.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ int graph_vram_allocate(int width, int height, int psm, int alignment)
1414

1515
graph_vram_pointer += size;
1616

17+
// Align the pointer
18+
graph_vram_pointer = -alignment & (graph_vram_pointer + (alignment-1));
19+
1720
// If the pointer overflows the vram size
1821
if (graph_vram_pointer > GRAPH_VRAM_MAX_WORDS)
1922
{

0 commit comments

Comments
 (0)