Commit e8000937 authored by Józef Kucia's avatar Józef Kucia Committed by Alexandre Julliard

wined3d: Create dummy buffer textures.

parent 83057194
......@@ -1545,6 +1545,9 @@ void context_bind_dummy_textures(const struct wined3d_device *device, const stru
if (gl_info->supported[EXT_TEXTURE_ARRAY])
gl_info->gl_ops.gl.p_glBindTexture(GL_TEXTURE_2D_ARRAY, device->dummy_textures.tex_2d_array);
if (gl_info->supported[ARB_TEXTURE_BUFFER_OBJECT])
gl_info->gl_ops.gl.p_glBindTexture(GL_TEXTURE_BUFFER, device->dummy_textures.tex_buffer);
checkGLcall("Bind dummy textures");
}
}
......@@ -2443,6 +2446,10 @@ void context_bind_texture(struct wined3d_context *context, GLenum target, GLuint
gl_info->gl_ops.gl.p_glBindTexture(GL_TEXTURE_3D, device->dummy_textures.tex_3d);
checkGLcall("glBindTexture");
break;
case GL_TEXTURE_BUFFER:
gl_info->gl_ops.gl.p_glBindTexture(GL_TEXTURE_BUFFER, device->dummy_textures.tex_buffer);
checkGLcall("glBindTexture");
break;
default:
ERR("Unexpected texture target %#x.\n", old_texture_type);
}
......
......@@ -694,6 +694,29 @@ static void create_dummy_textures(struct wined3d_device *device, struct wined3d_
checkGLcall("glTexImage3D");
}
if (gl_info->supported[ARB_TEXTURE_BUFFER_OBJECT])
{
GLuint buffer;
GL_EXTCALL(glGenBuffers(1, &buffer));
GL_EXTCALL(glBindBuffer(GL_TEXTURE_BUFFER, buffer));
GL_EXTCALL(glBufferData(GL_TEXTURE_BUFFER, sizeof(color), &color, GL_STATIC_DRAW));
GL_EXTCALL(glBindBuffer(GL_TEXTURE_BUFFER, 0));
checkGLcall("Create buffer object");
gl_info->gl_ops.gl.p_glGenTextures(1, &device->dummy_textures.tex_buffer);
checkGLcall("glGenTextures");
TRACE("Dummy buffer texture given name %u.\n", device->dummy_textures.tex_buffer);
gl_info->gl_ops.gl.p_glBindTexture(GL_TEXTURE_BUFFER, device->dummy_textures.tex_buffer);
checkGLcall("glBindTexture");
GL_EXTCALL(glTexBuffer(GL_TEXTURE_BUFFER, GL_RGBA8, buffer));
checkGLcall("glTexBuffer");
GL_EXTCALL(glDeleteBuffers(1, &buffer));
checkGLcall("glDeleteBuffers");
}
context_bind_dummy_textures(device, context);
}
......@@ -702,6 +725,9 @@ static void destroy_dummy_textures(struct wined3d_device *device, struct wined3d
{
const struct wined3d_gl_info *gl_info = context->gl_info;
if (gl_info->supported[ARB_TEXTURE_BUFFER_OBJECT])
gl_info->gl_ops.gl.p_glDeleteTextures(1, &device->dummy_textures.tex_buffer);
if (gl_info->supported[EXT_TEXTURE_ARRAY])
gl_info->gl_ops.gl.p_glDeleteTextures(1, &device->dummy_textures.tex_2d_array);
......
......@@ -2587,6 +2587,7 @@ struct wined3d_device
GLuint tex_3d;
GLuint tex_cube;
GLuint tex_2d_array;
GLuint tex_buffer;
} dummy_textures;
/* Default sampler used to emulate the direct resource access without using wined3d_sampler */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment