this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Added CMake options to control VBO upload method. Made SDL_GPU_USE_BUFFER_RESET the new default.

+24 -7
+1 -1
Android.mk
··· 21 21 $(STB_IMAGE_WRITE_DIR)/stb_image_write.c 22 22 23 23 24 - LOCAL_CFLAGS += -DSDL_GPU_DISABLE_OPENGL -DSTBI_FAILURE_USERMSG -O3 24 + LOCAL_CFLAGS += -DSDL_GPU_DISABLE_OPENGL -DSDL_GPU_USE_BUFFER_RESET -DSTBI_FAILURE_USERMSG -O3 25 25 26 26 LOCAL_LDLIBS += -llog -lGLESv1_CM 27 27 LOCAL_LDLIBS += -lGLESv2
+15
CMakeLists.txt
··· 58 58 59 59 option(SDL_gpu_USE_SYSTEM_GLEW "Attempt to use the system GLEW library (may not support GL 3+)" OFF) 60 60 61 + option(SDL_gpu_USE_BUFFER_RESET "Upload VBOs by requesting a new one each time (default). This is often the best for driver optimization)" ON) 62 + option(SDL_gpu_USE_BUFFER_UPDATE "Upload VBOs by updating only the needed portion" OFF) 63 + option(SDL_gpu_USE_BUFFER_MAPPING "Upload VBOs by mapping to client memory" OFF) 64 + 65 + 61 66 if(APPLE) 62 67 if(IOS) 63 68 # iOS 8 may need the framework option ··· 267 272 endif(DOXYGEN_FOUND) 268 273 269 274 add_definitions("-Wall -std=c99 -pedantic") 275 + 276 + if (SDL_gpu_USE_BUFFER_RESET) 277 + add_definitions("-DSDL_GPU_USE_BUFFER_RESET") 278 + endif (SDL_gpu_USE_BUFFER_RESET) 279 + if (SDL_gpu_USE_BUFFER_UPDATE) 280 + add_definitions("-DSDL_GPU_USE_BUFFER_UPDATE") 281 + endif (SDL_gpu_USE_BUFFER_UPDATE) 282 + if (SDL_gpu_USE_BUFFER_MAPPING) 283 + add_definitions("-DSDL_GPU_USE_BUFFER_MAPPING") 284 + endif (SDL_gpu_USE_BUFFER_MAPPING) 270 285 271 286 # Build the SDL_gpu library. 272 287 add_subdirectory(src)
+8 -6
src/renderer_GL_common.inl
··· 4452 4452 static_inline void submit_buffer_data(int bytes, float* values, int bytes_indices, unsigned short* indices) 4453 4453 { 4454 4454 #ifdef SDL_GPU_USE_BUFFER_PIPELINE 4455 - #ifdef SDL_GPU_USE_BUFFER_MAPPING 4455 + #if defined(SDL_GPU_USE_BUFFER_RESET) 4456 + glBufferData(GL_ARRAY_BUFFER, bytes, values, GL_STREAM_DRAW); 4457 + if(indices != NULL) 4458 + glBufferData(GL_ELEMENT_ARRAY_BUFFER, bytes_indices, indices, GL_DYNAMIC_DRAW); 4459 + #elif defined(SDL_GPU_USE_BUFFER_MAPPING) 4456 4460 // NOTE: On the Raspberry Pi, you may have to use GL_DYNAMIC_DRAW instead of GL_STREAM_DRAW for buffers to work with glMapBuffer(). 4457 4461 float* data = (float*)glMapBuffer(GL_ARRAY_BUFFER, GL_WRITE_ONLY); 4458 4462 unsigned short* data_i = (indices == NULL? NULL : (unsigned short*)glMapBuffer(GL_ELEMENT_ARRAY_BUFFER, GL_WRITE_ONLY)); ··· 4466 4470 memcpy(data_i, indices, bytes_indices); 4467 4471 glUnmapBuffer(GL_ELEMENT_ARRAY_BUFFER); 4468 4472 } 4469 - #elif defined(SDL_GPU_USE_BUFFER_RESET) 4470 - glBufferData(GL_ARRAY_BUFFER, bytes, values, GL_STREAM_DRAW); 4471 - if(indices != NULL) 4472 - glBufferData(GL_ELEMENT_ARRAY_BUFFER, bytes_indices, indices, GL_DYNAMIC_DRAW); 4473 - #else 4473 + #elif defined(SDL_GPU_USE_BUFFER_UPDATE) 4474 4474 glBufferSubData(GL_ARRAY_BUFFER, 0, bytes, values); 4475 4475 if(indices != NULL) 4476 4476 glBufferSubData(GL_ELEMENT_ARRAY_BUFFER, 0, bytes_indices, indices); 4477 + #else 4478 + #error SDL_gpu's VBO upload needs to choose SDL_GPU_USE_BUFFER_RESET, SDL_GPU_USE_BUFFER_MAPPING, or SDL_GPU_USE_BUFFER_UPDATE and none is defined! 4477 4479 #endif 4478 4480 #endif 4479 4481 }