Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@abey79
Copy link
Owner

@abey79 abey79 commented Dec 23, 2024

This PR converts change the binding of the vertex data to storage instead of instance buffer. This opens up the possibility for a far better buffer layout, such as:

      1 segment                3 segments                   3 segments,                       
                                                            closed line                       
                                                                                              
                                                               C0,C3                          
A0 ────────────── A1      B0 ───────┐B1                         ╱╲                            
                                    │                          ╱  ╲                           
                                  B2└────────B3               ╱    ╲                          
                                                            C2──────C1                        
                                                                                              
points buffer       │                             │                                           
┌────┬────┬────┬────┼────┬────┬────┬────┬────┬────┼────┬────┬────┬────┬────┬────┐             
│ A0 │ A0 │ A1 │ A1 │ B0 │ B0 │ B1 │ B2 │ B3 │ B3 │ C2 │ C0 │ C1 │ C2 │ C0 │ C1 │             
└────┴────┴────┴────┴────┴────┴────┴────┴────┴────┴────┴────┴────┴────┴────┴────┘             
   ▲                   ▲    ▲    ▲                   ▲    ▲    ▲                              
   │     ┌─────────────┘    │    │                   │    │    │                              
   │     │     ┌────────────┘    │                   │    │    │                              
   │     │     │     ┌───────────┘                   │    │    │                              
   │     │     │     │     ┌─────────────────────────┘    │    │                              
   │     │     │     │     │     ┌────────────────────────┘    │                              
   │     │     │     │     │     │     ┌───────────────────────┘                              
   │     │     │     │     │     │     │                                                      
┌─────┬─────┬─────┬─────┬─────┬─────┬─────┐                                                   
│ A01 │ B01 │ B12 │ B23 │ C01 │ C12 │ C23 │ segments buffer (2 offsets)                       
└─────┴─────┴─────┴─────┴─────┴─────┴─────┘                                                   
   │     │     │     │     │     │     │                                                      
   │     │     │     │     │     │     │                                                      
   │   ┌─┴─────┴─────┘     │     │     │                                                      
   │   │   ┌───────────────┴─────┴─────┘                                                      
   ▼   ▼   ▼                                                                                  
 ┌───┬───┬───┐                                                                                
 │ A │ B │ C │ attribues buffer (color, width)                                                
 └───┴───┴───┘                                                                                

However, this breaks compatibility with WebGL, so I'm going to refrain from using it at least until Safari has built-in support for WebGPU.

@abey79 abey79 marked this pull request as draft December 23, 2024 11:04
@abey79 abey79 added vsvg-viewer Relates to vsvg-viewer enhancement New feature or request feature New feature and removed enhancement New feature or request labels Dec 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature New feature vsvg-viewer Relates to vsvg-viewer

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants