projects
/
mesa.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
st/mesa: only memset sampler when about to use it.
[mesa.git]
/
src
/
mesa
/
state_tracker
/
st_cb_eglimage.c
diff --git
a/src/mesa/state_tracker/st_cb_eglimage.c
b/src/mesa/state_tracker/st_cb_eglimage.c
index 4aaf91d5a19dd6188a7ed5524f98a0b10c130696..dfde821fc19ced24dc53a1ada89e265265e93b46 100644
(file)
--- a/
src/mesa/state_tracker/st_cb_eglimage.c
+++ b/
src/mesa/state_tracker/st_cb_eglimage.c
@@
-26,6
+26,7
@@
* Chia-I Wu <olv@lunarg.com>
*/
* Chia-I Wu <olv@lunarg.com>
*/
+#include "main/mfeatures.h"
#include "main/texobj.h"
#include "main/texfetch.h"
#include "main/teximage.h"
#include "main/texobj.h"
#include "main/texfetch.h"
#include "main/teximage.h"
@@
-33,6
+34,7
@@
#include "util/u_format.h"
#include "st_cb_eglimage.h"
#include "st_cb_fbo.h"
#include "util/u_format.h"
#include "st_cb_eglimage.h"
#include "st_cb_fbo.h"
+#include "st_context.h"
#include "st_texture.h"
#include "st_format.h"
#include "st_manager.h"
#include "st_texture.h"
#include "st_format.h"
#include "st_manager.h"
@@
-70,7
+72,7
@@
st_pipe_format_to_base_format(enum pipe_format format)
}
static void
}
static void
-st_egl_image_target_renderbuffer_storage(
GL
context *ctx,
+st_egl_image_target_renderbuffer_storage(
struct gl_
context *ctx,
struct gl_renderbuffer *rb,
GLeglImageOES image_handle)
{
struct gl_renderbuffer *rb,
GLeglImageOES image_handle)
{
@@
-97,7
+99,7
@@
st_egl_image_target_renderbuffer_storage(GLcontext *ctx,
}
static void
}
static void
-st_bind_surface(
GL
context *ctx, GLenum target,
+st_bind_surface(
struct gl_
context *ctx, GLenum target,
struct gl_texture_object *texObj,
struct gl_texture_image *texImage,
struct pipe_surface *ps)
struct gl_texture_object *texObj,
struct gl_texture_image *texImage,
struct pipe_surface *ps)
@@
-105,6
+107,7
@@
st_bind_surface(GLcontext *ctx, GLenum target,
struct st_texture_object *stObj;
struct st_texture_image *stImage;
GLenum internalFormat;
struct st_texture_object *stObj;
struct st_texture_image *stImage;
GLenum internalFormat;
+ gl_format texFormat;
/* map pipe format to base format */
if (util_format_get_component_bits(ps->format, UTIL_FORMAT_COLORSPACE_RGB, 3) > 0)
/* map pipe format to base format */
if (util_format_get_component_bits(ps->format, UTIL_FORMAT_COLORSPACE_RGB, 3) > 0)
@@
-121,13
+124,16
@@
st_bind_surface(GLcontext *ctx, GLenum target,
stObj->surface_based = GL_TRUE;
}
stObj->surface_based = GL_TRUE;
}
+ texFormat = st_pipe_format_to_mesa_format(ps->format);
+
_mesa_init_teximage_fields(ctx, target, texImage,
_mesa_init_teximage_fields(ctx, target, texImage,
- ps->width, ps->height, 1, 0, internalFormat);
- texImage->TexFormat = st_pipe_format_to_mesa_format(ps->format);
- _mesa_set_fetch_functions(texImage, 2);
+ ps->width, ps->height, 1, 0, internalFormat,
+ texFormat);
/* FIXME create a non-default sampler view from the pipe_surface? */
/* FIXME create a non-default sampler view from the pipe_surface? */
- pipe_resource_reference(&stImage->pt, ps->texture);
+ pipe_resource_reference(&stObj->pt, ps->texture);
+ pipe_sampler_view_reference(&stObj->sampler_view, NULL);
+ pipe_resource_reference(&stImage->pt, stObj->pt);
stObj->width0 = ps->width;
stObj->height0 = ps->height;
stObj->width0 = ps->width;
stObj->height0 = ps->height;
@@
-137,7
+143,7
@@
st_bind_surface(GLcontext *ctx, GLenum target,
}
static void
}
static void
-st_egl_image_target_texture_2d(
GL
context *ctx, GLenum target,
+st_egl_image_target_texture_2d(
struct gl_
context *ctx, GLenum target,
struct gl_texture_object *texObj,
struct gl_texture_image *texImage,
GLeglImageOES image_handle)
struct gl_texture_object *texObj,
struct gl_texture_image *texImage,
GLeglImageOES image_handle)