mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-03 01:18:06 +02:00
gallium: remove enum st_texture_type
just use GLenum Reviewed-by: Emma Anholt <emma@anholt.net> Reviewed-by: Adam Jackson <ajax@redhat.com> Reviewed-by: Yonggang Luo <luoyonggang@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20027>
This commit is contained in:
parent
59c9e62f48
commit
be8f1d685e
6 changed files with 6 additions and 38 deletions
|
|
@ -726,7 +726,6 @@ static EGLBoolean
|
|||
wgl_bind_tex_image(_EGLDisplay *disp, _EGLSurface *surf, EGLint buffer)
|
||||
{
|
||||
struct wgl_egl_surface *wgl_surf = wgl_egl_surface(surf);
|
||||
enum st_attachment_type target = ST_TEXTURE_2D;
|
||||
|
||||
_EGLContext *ctx = _eglGetCurrentContext();
|
||||
struct wgl_egl_context *wgl_ctx = wgl_egl_context(ctx);
|
||||
|
|
@ -772,7 +771,8 @@ wgl_bind_tex_image(_EGLDisplay *disp, _EGLSurface *surf, EGLint buffer)
|
|||
assert(!"Unexpected texture target in wgl_bind_tex_image()");
|
||||
}
|
||||
|
||||
st_context_teximage(wgl_ctx->ctx->st, target, 0, format, pres, false);
|
||||
st_context_teximage(wgl_ctx->ctx->st, GL_TEXTURE_2D, 0, format, pres,
|
||||
false);
|
||||
|
||||
return EGL_TRUE;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -293,9 +293,7 @@ dri_set_tex_buffer2(__DRIcontext *pDRICtx, GLint target,
|
|||
|
||||
drawable->update_tex_buffer(drawable, ctx, pt);
|
||||
|
||||
st_context_teximage(ctx->st,
|
||||
(target == GL_TEXTURE_2D) ? ST_TEXTURE_2D : ST_TEXTURE_RECT,
|
||||
0, internal_format, pt, false);
|
||||
st_context_teximage(ctx->st, target, 0, internal_format, pt, false);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1524,7 +1524,7 @@ XMesaBindTexImage(Display *dpy, XMesaBuffer drawable, int buffer,
|
|||
|
||||
pipe_texture_unmap(pipe, tex_xfer);
|
||||
|
||||
st_context_teximage(st, ST_TEXTURE_2D, 0 /* level */, internal_format,
|
||||
st_context_teximage(st, GL_TEXTURE_2D, 0 /* level */, internal_format,
|
||||
res, FALSE /* no mipmap */);
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -89,16 +89,6 @@ enum st_context_error {
|
|||
ST_CONTEXT_ERROR_UNKNOWN_FLAG
|
||||
};
|
||||
|
||||
/**
|
||||
* Used in st_context_teximage.
|
||||
*/
|
||||
enum st_texture_type {
|
||||
ST_TEXTURE_1D,
|
||||
ST_TEXTURE_2D,
|
||||
ST_TEXTURE_3D,
|
||||
ST_TEXTURE_RECT
|
||||
};
|
||||
|
||||
/**
|
||||
* Available attachments of framebuffer.
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -422,8 +422,7 @@ st_context_flush(struct st_context *st, unsigned flags,
|
|||
void (*before_flush_cb) (void*), void* args);
|
||||
|
||||
extern bool
|
||||
st_context_teximage(struct st_context *st,
|
||||
enum st_texture_type tex_type,
|
||||
st_context_teximage(struct st_context *st, GLenum target,
|
||||
int level, enum pipe_format pipe_format,
|
||||
struct pipe_resource *tex, bool mipmap);
|
||||
|
||||
|
|
|
|||
|
|
@ -826,8 +826,7 @@ st_context_flush(struct st_context *st, unsigned flags,
|
|||
* in EGL and WGL.
|
||||
*/
|
||||
bool
|
||||
st_context_teximage(struct st_context *st,
|
||||
enum st_texture_type tex_type,
|
||||
st_context_teximage(struct st_context *st, GLenum target,
|
||||
int level, enum pipe_format pipe_format,
|
||||
struct pipe_resource *tex, bool mipmap)
|
||||
{
|
||||
|
|
@ -836,24 +835,6 @@ st_context_teximage(struct st_context *st,
|
|||
struct gl_texture_image *texImage;
|
||||
GLenum internalFormat;
|
||||
GLuint width, height, depth;
|
||||
GLenum target;
|
||||
|
||||
switch (tex_type) {
|
||||
case ST_TEXTURE_1D:
|
||||
target = GL_TEXTURE_1D;
|
||||
break;
|
||||
case ST_TEXTURE_2D:
|
||||
target = GL_TEXTURE_2D;
|
||||
break;
|
||||
case ST_TEXTURE_3D:
|
||||
target = GL_TEXTURE_3D;
|
||||
break;
|
||||
case ST_TEXTURE_RECT:
|
||||
target = GL_TEXTURE_RECTANGLE_ARB;
|
||||
break;
|
||||
default:
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
texObj = _mesa_get_current_tex_object(ctx, target);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue