This commit is contained in:
Kovid Goyal 2023-02-10 10:55:41 +05:30
commit a09dda27dc
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
9 changed files with 5415 additions and 794 deletions

View File

@ -9,8 +9,8 @@ import shutil
import subprocess import subprocess
cmdline = ( cmdline = (
'glad --out-path {dest} --api gl:core=3.3 ' 'glad --out-path {dest} --api gl:core=3.1 '
' --extensions GL_ARB_texture_storage,GL_ARB_copy_image,GL_ARB_multisample,GL_ARB_robustness,GL_KHR_debug ' ' --extensions GL_ARB_texture_storage,GL_ARB_copy_image,GL_ARB_multisample,GL_ARB_robustness,GL_ARB_instanced_arrays,GL_KHR_debug '
'c --header-only --debug' 'c --header-only --debug'
) )

View File

@ -1,4 +1,6 @@
#version GLSL_VERSION #version GLSL_VERSION
#extension GL_ARB_explicit_attrib_location : require
#define {WHICH_PROGRAM} #define {WHICH_PROGRAM}
#define NOT_TRANSPARENT #define NOT_TRANSPARENT
#define DECORATION_SHIFT {DECORATION_SHIFT} #define DECORATION_SHIFT {DECORATION_SHIFT}

View File

@ -18,7 +18,8 @@
#include "banned.h" #include "banned.h"
// Required minimum OpenGL version // Required minimum OpenGL version
#define OPENGL_REQUIRED_VERSION_MAJOR 3 #define OPENGL_REQUIRED_VERSION_MAJOR 3
#define OPENGL_REQUIRED_VERSION_MINOR 3 #define OPENGL_REQUIRED_VERSION_MINOR 1
#define GLSL_VERSION 140
#define GLFW_MOD_KITTY (GLFW_MOD_LAST * 2) #define GLFW_MOD_KITTY (GLFW_MOD_LAST * 2)
#define UNUSED __attribute__ ((unused)) #define UNUSED __attribute__ ((unused))
#define PYNOARG PyObject *__a1 UNUSED, PyObject *__a2 UNUSED #define PYNOARG PyObject *__a1 UNUSED, PyObject *__a2 UNUSED

6192
kitty/gl-wrapper.h generated

File diff suppressed because it is too large Load Diff

View File

@ -306,7 +306,7 @@ add_located_attribute_to_vao(ssize_t vao_idx, GLint aloc, GLint size, GLenum dat
break; break;
} }
if (divisor) { if (divisor) {
glVertexAttribDivisor(aloc, divisor); glVertexAttribDivisorARB(aloc, divisor);
} }
unbind_buffer(buf); unbind_buffer(buf);
} }

View File

@ -9,8 +9,6 @@
#include "data-types.h" #include "data-types.h"
#include "gl-wrapper.h" #include "gl-wrapper.h"
#define GLSL_VERSION (OPENGL_REQUIRED_VERSION_MAJOR * 100 + OPENGL_REQUIRED_VERSION_MINOR * 10)
typedef struct { typedef struct {
GLint size, index; GLint size, index;
} UniformBlock; } UniformBlock;

View File

@ -803,7 +803,6 @@ create_os_window(PyObject UNUSED *self, PyObject *args, PyObject *kw) {
if (is_first_window) { if (is_first_window) {
glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, OPENGL_REQUIRED_VERSION_MAJOR); glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, OPENGL_REQUIRED_VERSION_MAJOR);
glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, OPENGL_REQUIRED_VERSION_MINOR); glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, OPENGL_REQUIRED_VERSION_MINOR);
glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE);
glfwWindowHint(GLFW_OPENGL_FORWARD_COMPAT, true); glfwWindowHint(GLFW_OPENGL_FORWARD_COMPAT, true);
// We don't use depth and stencil buffers // We don't use depth and stencil buffers
glfwWindowHint(GLFW_DEPTH_BITS, 0); glfwWindowHint(GLFW_DEPTH_BITS, 0);

View File

@ -1,4 +1,5 @@
#version GLSL_VERSION #version GLSL_VERSION
#extension GL_ARB_explicit_attrib_location : require
// Have to use fixed locations here as all variants of the program share the same VAO // Have to use fixed locations here as all variants of the program share the same VAO
layout(location=0) in vec4 src; layout(location=0) in vec4 src;

View File

@ -814,7 +814,7 @@ draw_cells_interleaved_premult(ssize_t vao_idx, ssize_t gvao_idx, Screen *screen
} }
glBindTexture(GL_TEXTURE_2D, 0); glBindTexture(GL_TEXTURE_2D, 0);
glBindFramebuffer(GL_DRAW_FRAMEBUFFER, os_window->offscreen_framebuffer); glBindFramebuffer(GL_DRAW_FRAMEBUFFER, os_window->offscreen_framebuffer);
glFramebufferTexture(GL_DRAW_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, os_window->offscreen_texture_id, 0); glFramebufferTexture2D(GL_DRAW_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, os_window->offscreen_texture_id, 0);
/* if (glCheckFramebufferStatus(GL_DRAW_FRAMEBUFFER) != GL_FRAMEBUFFER_COMPLETE) fatal("Offscreen framebuffer not complete"); */ /* if (glCheckFramebufferStatus(GL_DRAW_FRAMEBUFFER) != GL_FRAMEBUFFER_COMPLETE) fatal("Offscreen framebuffer not complete"); */
bind_program(CELL_BG_PROGRAM); bind_program(CELL_BG_PROGRAM);
if (!has_bgimage(os_window)) { if (!has_bgimage(os_window)) {