Skip to content

Commit

Permalink
Fix glBufferData, remove table from README
Browse files Browse the repository at this point in the history
  • Loading branch information
dmaivel committed May 25, 2024
1 parent d894661 commit e0405ce
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 17 deletions.
15 changes: 3 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,18 +78,9 @@ If networking on the server is enabled (using `-n`), the client must be aware of
SGL_NET_OVER_SHARED=HOST_ADDRESS:PORT
```
### Shared memory or network
Starting from `0.5.0`, SharedGL offers the ability to use sockets instead of shared memory for streaming:
| | Shared memory | Network |
|------------------------------------------------------|--------------------|--------------------|
| Requires additional drivers | :white_check_mark: | :x: |
| Requires additional host renderer arguments | :x: | :white_check_mark: |
| Requires additional environment variables for client | :x: | :white_check_mark: |
| Able to run/debug clients on host | :white_check_mark: | :white_check_mark: |
| Able to run clients in VMs | :white_check_mark: | :white_check_mark: |
| Able to run clients over LAN | :x: | :white_check_mark: |
### Network
Starting from version `0.5.0`, network capabilities are offered. If you wish to accelerate graphics over another machine or do not wish to install any kernel drivers, use the network feature.
## Linux
For your OpenGL application to communicate with the server, the client library must be specified in your library path. Upon exporting, any program you run in the terminal where you inputted this command will run with the SGL binary.
Expand Down
12 changes: 7 additions & 5 deletions src/client/glimpl.c
Original file line number Diff line number Diff line change
Expand Up @@ -851,11 +851,13 @@ void glBufferData(GLenum target, GLsizeiptr size, const void *data, GLenum usage
{
glimpl_commit();

pb_push(SGL_CMD_VP_UPLOAD);
pb_push(size / sizeof(int)); /* could be very bad mistake */
int *idata = (int*)data;
for (int i = 0; i < size / sizeof(int); i++)
pb_push(idata[i]);
if (data != NULL) {
pb_push(SGL_CMD_VP_UPLOAD);
pb_push(size / sizeof(int)); /* could be very bad mistake */
int *idata = (int*)data;
for (int i = 0; i < size / sizeof(int); i++)
pb_push(idata[i]);
}

pb_push(SGL_CMD_BUFFERDATA);
pb_push(target);
Expand Down

0 comments on commit e0405ce

Please sign in to comment.