Repaired OpenGL / Dreamcast build

This commit is contained in:
mrq 2024-12-03 19:00:47 -06:00 committed by ecker
parent a521f045ba
commit 6b37b2fa0e
16 changed files with 36 additions and 25 deletions

View File

@ -120,7 +120,7 @@ ifneq (,$(findstring imgui,$(REQ_DEPS)))
INCS += -I./dep/include/imgui/
INCS += -I./dep/include/imgui/backends
endif
ifneq (,$(findstring imgui,$(REQ_DEPS)))
ifneq (,$(findstring cpptrace,$(REQ_DEPS)))
DEPS += -lcpptrace
endif
ifneq (,$(findstring json,$(REQ_DEPS)))

View File

@ -245,19 +245,26 @@
}
},
"opengl": {
"validation": { "enabled": false },
"validation": { "enabled": true },
"framebuffer": { "size": 1, "msaa": 1 },
"experimental": {
"rebuild on tick begin": true
"rebuild on tick begin": false
},
"pipelines": {
"culling": true
"culling": false
},
"experimental": {
"rebuild on tick begin": true
"rebuild on tick begin": false,
"batch queue submissions": true,
"dedicated thread": false,
"memory budget": false,
"register render modes": false
},
"invariant": {
"multithreaded recording": false
"default stage buffers": true,
"default defer buffer destroy": true,
"default command buffer immediate": true,
"multithreaded recording": true
},
"formats": {
"depth": "D32_SFLOAT",

View File

@ -1,8 +1,8 @@
{
"import": "./base_sourceengine.json",
"assets": [
{ "filename": "./models/animal_crossing.glb" },
// { "filename": "./models/animal_crossing/graph.json" },
// { "filename": "./models/animal_crossing.glb" },
{ "filename": "./models/animal_crossing/graph.json" },
// { "filename": "./models/animal_crossing_small.glb" },
// { "filename": "./models/animal_crossing_small/graph.json" },

View File

@ -11,12 +11,12 @@
// exact matches
"worldspawn": {
"physics": { "type": "mesh", "static": true },
"grid": { "size": [16,1,16], "epsilon": 0.001, "cleanup": true, "print": true },
"grid": { "size": [8,1,8], "epsilon": 0.001, "cleanup": true, "print": true },
"optimize meshlets": { "simplify": 0.125, "print": false },
"unwrap mesh": true
},
"worldspawn_skybox": {
"grid": { "size": [16,1,16], "epsilon": 0.001, "cleanup": true, "print": true },
"grid": { "size": [8,1,8], "epsilon": 0.001, "cleanup": true, "print": true },
"optimize meshlets": { "simplify": 0.125, "print": false },
"unwrap mesh": true
},

View File

@ -1,8 +1,8 @@
{
"import": "./base_sourceengine.json",
"assets": [
{ "filename": "./models/ss2_medsci1_small.glb" }
// { "filename": "./models/ss2_medsci1_small/graph.json" }
// { "filename": "./models/ss2_medsci1_smallish.glb" }
{ "filename": "./models/ss2_medsci1_smallish/graph.json" }
],
"metadata": {
"graph": {

View File

@ -5,7 +5,7 @@
"matrix": { "reverseInfinite": true },
"meshes": { "interleaved": false },
"lights": { "enabled": true,
"useLightmaps": false,
"useLightmaps": true,
"max": 1,
"shadows": {
"enabled": false,

View File

@ -65,7 +65,7 @@ namespace ext {
// RAII
~Buffer();
void initialize( Device& device );
void destroy();
void destroy(bool=false);
};
struct UF_API Buffers {
uf::stl::vector<Buffer> buffers;
@ -74,7 +74,7 @@ namespace ext {
// ~Buffers();
//
void initialize( Device& device );
void destroy();
void destroy(bool=false);
//
size_t initializeBuffer( const void*, GLsizeiptr, GLenum, bool = false );

View File

@ -83,4 +83,6 @@
#else
#define GL_MUTEX_LOCK();
#define GL_MUTEX_UNLOCK();
#endif
#endif
#define GL_DEFAULT_DEFER_BUFFER_DESTROY ext::opengl::settings::defaultDeferBufferDestroy

View File

@ -34,6 +34,7 @@ namespace ext {
extern UF_API bool dedicatedThread;
extern UF_API bool rebuildOnTickBegin;
extern UF_API bool batchQueueSubmissions;
extern UF_API bool registerRenderMode;
}
namespace validation {

View File

@ -6,4 +6,4 @@
// include universal
#include "universal.h"
// defines which implementation to use
#include UF_ENV_HEADER
#include UF_ENV_HEADER

View File

@ -6,4 +6,4 @@
// include universal
#include "universal.h"
// defines which implementation to use
#include UF_ENV_HEADER
#include UF_ENV_HEADER

View File

@ -6,4 +6,4 @@
// include universal
#include "universal.h"
// defines which implementation to use
#include UF_ENV_HEADER
#include UF_ENV_HEADER

View File

@ -6,4 +6,4 @@
// include universal
#include "universal.h"
// defines which implementation to use
#include UF_ENV_HEADER
#include UF_ENV_HEADER

View File

@ -112,7 +112,7 @@ ext::opengl::Buffer::~Buffer() {
void ext::opengl::Buffer::initialize( Device& device ) {
this->device = &device;
}
void ext::opengl::Buffer::destroy() {
void ext::opengl::Buffer::destroy( bool defer ) {
if ( device && buffer ) device->destroyBuffer( buffer );
device = NULL;
buffer = NULL;
@ -124,8 +124,8 @@ void ext::opengl::Buffers::initialize( Device& device ) {
this->device = &device;
}
void ext::opengl::Buffers::destroy() {
for ( auto& buffer : buffers ) buffer.destroy();
void ext::opengl::Buffers::destroy( bool defer ) {
for ( auto& buffer : buffers ) buffer.destroy(defer);
buffers.clear();
}

View File

@ -431,10 +431,10 @@ void ext::opengl::Graphic::record( CommandBuffer& commandBuffer, const GraphicDe
drawCommandInfo.descriptor.inputs.vertex.first = drawCommand.vertexID;
drawCommandInfo.descriptor.inputs.vertex.count = drawCommand.vertices;
drawCommandInfo.attributes.instance.pointer = &instance;
drawCommandInfo.attributes.instance.pointer = (uint8_t*) (void*) &instance;
drawCommandInfo.attributes.instance.length = sizeof(instance);
drawCommandInfo.attributes.indirect.pointer = &drawCommand;
drawCommandInfo.attributes.indirect.pointer = (uint8_t*) (void*) &drawCommand;
drawCommandInfo.attributes.indirect.length = sizeof(drawCommand);
drawCommandInfo.matrices.model = &instance.model;

View File

@ -50,6 +50,7 @@ bool ext::opengl::settings::experimental::dedicatedThread = true;
#endif
bool ext::opengl::settings::experimental::rebuildOnTickBegin = false;
bool ext::opengl::settings::experimental::batchQueueSubmissions = false;
bool ext::opengl::settings::experimental::registerRenderMode = true;
// not so experimental
bool ext::opengl::settings::invariant::waitOnRenderEnd = false;