mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-07-22 18:39:18 +02:00
fixes for gles mode
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
#include "stdafx.h"
|
||||
#include "query.h"
|
||||
#include "Globals.h"
|
||||
|
||||
gl::query::query(targets target)
|
||||
: target(target)
|
||||
@@ -35,9 +36,13 @@ std::optional<int64_t> gl::query::result()
|
||||
{
|
||||
GLuint ready;
|
||||
glGetQueryObjectuiv(*this, GL_QUERY_RESULT_AVAILABLE, &ready);
|
||||
int64_t value;
|
||||
int64_t value = 0;
|
||||
if (ready) {
|
||||
glGetQueryObjecti64v(*this, GL_QUERY_RESULT, &value);
|
||||
if (!Global.gfx_usegles)
|
||||
glGetQueryObjecti64v(*this, GL_QUERY_RESULT, &value);
|
||||
else
|
||||
glGetQueryObjectuiv(*this, GL_QUERY_RESULT, reinterpret_cast<GLuint*>(&value));
|
||||
|
||||
return std::optional<int64_t>(value);
|
||||
}
|
||||
return std::nullopt;
|
||||
|
||||
@@ -220,11 +220,11 @@ gl::shader::shader(const std::string &filename)
|
||||
}
|
||||
else
|
||||
{
|
||||
if (type == GL_GEOMETRY_SHADER) {
|
||||
if (GLAD_GL_ES_VERSION_3_1) {
|
||||
str += "#version 310 es\n";
|
||||
str += "#extension EXT_geometry_shader : require\n";
|
||||
}
|
||||
else {
|
||||
if (type == GL_GEOMETRY_SHADER)
|
||||
str += "#extension GL_EXT_geometry_shader : require\n";
|
||||
} else {
|
||||
str += "#version 300 es\n";
|
||||
}
|
||||
str += "precision highp float;\n";
|
||||
|
||||
Reference in New Issue
Block a user