Adding --vendor_gl_extensions flag to disable NV stuff.

This commit is contained in:
Ben Vanik 2015-01-03 13:40:20 -08:00
parent 76c41edfd6
commit 70c0c0fea1
4 changed files with 14 additions and 4 deletions

View File

@ -11,6 +11,7 @@
#include <poly/assert.h>
#include <poly/math.h>
#include <xenia/gpu/gl4/gl4_gpu-private.h>
#include <xenia/gpu/gpu-private.h>
namespace xe {
@ -44,7 +45,7 @@ bool CircularBuffer::Initialize() {
return false;
}
if (GLEW_NV_shader_buffer_load) {
if (FLAGS_vendor_gl_extensions && GLEW_NV_shader_buffer_load) {
// To use this bindlessly we must make it resident.
glMakeNamedBufferResidentNV(buffer_, GL_WRITE_ONLY);
glGetNamedBufferParameterui64vNV(buffer_, GL_BUFFER_GPU_ADDRESS_NV,
@ -58,7 +59,7 @@ void CircularBuffer::Shutdown() {
return;
}
glUnmapNamedBuffer(buffer_);
if (GLEW_NV_shader_buffer_load) {
if (FLAGS_vendor_gl_extensions && GLEW_NV_shader_buffer_load) {
glMakeNamedBufferNonResidentNV(buffer_);
}
glDeleteBuffers(1, &buffer_);

View File

@ -181,11 +181,16 @@ bool CommandProcessor::SetupGL() {
glGenVertexArrays(1, &vertex_array_);
glBindVertexArray(vertex_array_);
if (GLEW_NV_vertex_buffer_unified_memory) {
if (FLAGS_vendor_gl_extensions && GLEW_NV_vertex_buffer_unified_memory) {
has_bindless_vbos_ = true;
glEnableClientState(GL_VERTEX_ATTRIB_ARRAY_UNIFIED_NV);
glEnableClientState(GL_ELEMENT_ARRAY_UNIFIED_NV);
}
GLint max_vertex_attribs = 0;
glGetIntegerv(GL_MAX_VERTEX_ATTRIBS, &max_vertex_attribs);
for (GLint i = 0; i < max_vertex_attribs; ++i) {
glEnableVertexAttribArray(i);
}
const std::string geometry_header =
"#version 450\n"
@ -2242,7 +2247,6 @@ CommandProcessor::UpdateStatus CommandProcessor::PopulateVertexBuffers(
assert_unhandled_case(el.format);
break;
}
glEnableVertexAttribArray(el_index);
if (has_bindless_vbos_) {
glVertexAttribFormatNV(el_index, comp_count, comp_type,
el.is_normalized,

View File

@ -20,6 +20,8 @@ DECLARE_bool(thread_safe_gl);
DECLARE_bool(gl_debug_output);
DECLARE_bool(gl_debug_output_synchronous);
DECLARE_bool(vendor_gl_extensions);
DECLARE_bool(disable_textures);
namespace xe {

View File

@ -19,6 +19,9 @@ DEFINE_bool(gl_debug_output, false, "Dump ARB_debug_output to stderr.");
DEFINE_bool(gl_debug_output_synchronous, true,
"ARB_debug_output will synchronize to be thread safe.");
DEFINE_bool(vendor_gl_extensions, true,
"Enable vendor-specific (NV, AMD, etc) GL extensions.");
DEFINE_bool(disable_textures, false, "Disable textures and use colors only.");
namespace xe {