Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix integer value for GL_MAX_UNIFORM_BLOCK_SIZE overflowing #80909

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion drivers/gles3/shader_gles3.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -771,7 +771,7 @@ void ShaderGLES3::initialize(const String &p_general_defines, int p_base_texture
print_verbose("Shader '" + name + "' SHA256: " + base_sha256);
}

glGetIntegerv(GL_MAX_TEXTURE_IMAGE_UNITS, &max_image_units);
glGetInteger64v(GL_MAX_TEXTURE_IMAGE_UNITS, &max_image_units);
}

void ShaderGLES3::set_shader_cache_dir(const String &p_dir) {
Expand Down
2 changes: 1 addition & 1 deletion drivers/gles3/shader_gles3.h
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ class ShaderGLES3 {
static bool shader_cache_save_debug;
bool shader_cache_dir_valid = false;

GLint max_image_units = 0;
int64_t max_image_units = 0;

enum StageType {
STAGE_TYPE_VERTEX,
Expand Down
16 changes: 8 additions & 8 deletions drivers/gles3/storage/config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,9 @@ Config::Config() {
singleton = this;

{
GLint max_extensions = 0;
glGetIntegerv(GL_NUM_EXTENSIONS, &max_extensions);
for (int i = 0; i < max_extensions; i++) {
int64_t max_extensions = 0;
glGetInteger64v(GL_NUM_EXTENSIONS, &max_extensions);
for (int64_t i = 0; i < max_extensions; i++) {
const GLubyte *s = glGetStringi(GL_EXTENSIONS, i);
if (!s) {
break;
Expand Down Expand Up @@ -88,11 +88,11 @@ Config::Config() {
rgtc_supported = extensions.has("GL_EXT_texture_compression_rgtc") || extensions.has("GL_ARB_texture_compression_rgtc") || extensions.has("EXT_texture_compression_rgtc");
#endif

glGetIntegerv(GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS, &max_vertex_texture_image_units);
glGetIntegerv(GL_MAX_TEXTURE_IMAGE_UNITS, &max_texture_image_units);
glGetIntegerv(GL_MAX_TEXTURE_SIZE, &max_texture_size);
glGetIntegerv(GL_MAX_UNIFORM_BLOCK_SIZE, &max_uniform_buffer_size);
glGetIntegerv(GL_MAX_VIEWPORT_DIMS, max_viewport_size);
glGetInteger64v(GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS, &max_vertex_texture_image_units);
glGetInteger64v(GL_MAX_TEXTURE_IMAGE_UNITS, &max_texture_image_units);
adamscott marked this conversation as resolved.
Show resolved Hide resolved
glGetInteger64v(GL_MAX_TEXTURE_SIZE, &max_texture_size);
glGetInteger64v(GL_MAX_UNIFORM_BLOCK_SIZE, &max_uniform_buffer_size);
glGetInteger64v(GL_MAX_VIEWPORT_DIMS, max_viewport_size);

support_anisotropic_filter = extensions.has("GL_EXT_texture_filter_anisotropic");
if (support_anisotropic_filter) {
Expand Down
16 changes: 8 additions & 8 deletions drivers/gles3/storage/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,14 +58,14 @@ class Config {
bool use_nearest_mip_filter = false;
bool use_depth_prepass = true;

int max_vertex_texture_image_units = 0;
int max_texture_image_units = 0;
int max_texture_size = 0;
int max_viewport_size[2] = { 0, 0 };
int max_uniform_buffer_size = 0;
int max_renderable_elements = 0;
int max_renderable_lights = 0;
int max_lights_per_object = 0;
int64_t max_vertex_texture_image_units = 0;
int64_t max_texture_image_units = 0;
int64_t max_texture_size = 0;
int64_t max_viewport_size[2] = { 0, 0 };
int64_t max_uniform_buffer_size = 0;
int64_t max_renderable_elements = 0;
int64_t max_renderable_lights = 0;
int64_t max_lights_per_object = 0;

// TODO implement wireframe in OpenGL
// bool generate_wireframes;
Expand Down
Loading