Skip to content

Commit a15e34f

Browse files
aichingmRobLoach
authored andcommitted
Fix glfw_opengl4 bindless textures
1 parent a7ea5ba commit a15e34f

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

demo/glfw_opengl4/nuklear_glfw_gl4.h

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,6 @@ static struct nk_glfw {
113113

114114
#define NK_SHADER_VERSION "#version 450 core\n"
115115
#define NK_SHADER_BINDLESS "#extension GL_ARB_bindless_texture : require\n"
116-
#define NK_SHADER_64BIT "#extension GL_ARB_gpu_shader_int64 : require\n"
117116

118117
NK_API void
119118
nk_glfw3_device_create()
@@ -123,7 +122,6 @@ nk_glfw3_device_create()
123122
static const GLchar *vertex_shader =
124123
NK_SHADER_VERSION
125124
NK_SHADER_BINDLESS
126-
NK_SHADER_64BIT
127125
"uniform mat4 ProjMtx;\n"
128126
"in vec2 Position;\n"
129127
"in vec2 TexCoord;\n"
@@ -138,15 +136,13 @@ nk_glfw3_device_create()
138136
static const GLchar *fragment_shader =
139137
NK_SHADER_VERSION
140138
NK_SHADER_BINDLESS
141-
NK_SHADER_64BIT
142139
"precision mediump float;\n"
143-
"uniform uint64_t Texture;\n"
140+
"layout(bindless_sampler) uniform sampler2D Texture;\n"
144141
"in vec2 Frag_UV;\n"
145142
"in vec4 Frag_Color;\n"
146143
"out vec4 Out_Color;\n"
147144
"void main(){\n"
148-
" sampler2D smp = sampler2D(Texture);\n"
149-
" Out_Color = Frag_Color * texture(smp, Frag_UV.st);\n"
145+
" Out_Color = Frag_Color * texture(Texture, Frag_UV.st);\n"
150146
"}\n";
151147

152148
struct nk_glfw_device *dev = &glfw.ogl;

0 commit comments

Comments
 (0)