support nvidia prime gpu offloading
This commit is contained in:
parent
5b55adfa6e
commit
4b8f28f70e
|
@ -0,0 +1,12 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
executable="$1"
|
||||||
|
prime="prime-run"
|
||||||
|
|
||||||
|
if command -v $prime &> /dev/null
|
||||||
|
then
|
||||||
|
echo "launching $executable with nvidia prime offloading"
|
||||||
|
$prime $executable
|
||||||
|
else
|
||||||
|
$executable
|
||||||
|
fi
|
3
makefile
3
makefile
|
@ -17,6 +17,7 @@ SHADER_INCLUDES = $(shell find $(SHADER_INCLUDE_DIR) -name *.glsl)
|
||||||
SHADER_TARGETS = $(SHADERS:$(SHADER_ROOT_DIR)/%.glsl=$(SHADER_TARGET_DIR)/%.compute)
|
SHADER_TARGETS = $(SHADERS:$(SHADER_ROOT_DIR)/%.glsl=$(SHADER_TARGET_DIR)/%.compute)
|
||||||
|
|
||||||
TARGET = $(BIN_DIR)/oglc
|
TARGET = $(BIN_DIR)/oglc
|
||||||
|
LAUNCH = "./launch"
|
||||||
|
|
||||||
CC = gcc
|
CC = gcc
|
||||||
LIBS = `pkg-config --static --libs glew sdl2 cglm`
|
LIBS = `pkg-config --static --libs glew sdl2 cglm`
|
||||||
|
@ -47,6 +48,6 @@ clean:
|
||||||
-rm */*.o
|
-rm */*.o
|
||||||
|
|
||||||
run: $(TARGET)
|
run: $(TARGET)
|
||||||
$(TARGET)
|
$(LAUNCH) $(TARGET)
|
||||||
|
|
||||||
.PHONY: run clean
|
.PHONY: run clean
|
||||||
|
|
|
@ -48,9 +48,11 @@ SDL_Window* gfxInit(int width, int height)
|
||||||
|
|
||||||
// intiliased opengl
|
// intiliased opengl
|
||||||
|
|
||||||
|
printf("%s\n", glGetString(GL_RENDERER));
|
||||||
|
|
||||||
int availableAttributes;
|
int availableAttributes;
|
||||||
glGetIntegerv(GL_MAX_VERTEX_ATTRIBS, &availableAttributes);
|
glGetIntegerv(GL_MAX_VERTEX_ATTRIBS, &availableAttributes);
|
||||||
//printf("max vertex attributes %d\n", availableAttributes);
|
printf("max vertex attributes %d\n", availableAttributes);
|
||||||
|
|
||||||
return sdlWindow;
|
return sdlWindow;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue