Commit 86d9225d authored by Roland Scheidegger's avatar Roland Scheidegger

gallium: more fixes for bind changes

parent a215ef06
......@@ -71,7 +71,7 @@ dri_drawable_get_format(struct dri_drawable *drawable,
}
/**
* Process __DRIbuffer and convert them into pipe_textures.
* Process __DRIbuffer and convert them into pipe_resources.
*/
static void
dri_drawable_process_buffers(struct dri_drawable *drawable,
......
......@@ -286,13 +286,12 @@ struct st_context {
size = num_verts * num_attribs * 4 * sizeof(float);
vbuf = pipe_buffer_create(screen,
32,
PIPE_BUFFER_USAGE_VERTEX,
PIPE_BIND_VERTEX_BUFFER,
size);
if(!vbuf)
goto error1;
map = pipe_buffer_map(screen, vbuf, PIPE_BUFFER_USAGE_CPU_WRITE);
map = pipe_buffer_map(screen, vbuf, PIPE_TRANSFER_WRITE);
if (!map)
goto error2;
memcpy(map, vertices, size);
......@@ -330,11 +329,11 @@ error1:
struct pipe_surface *_dst = NULL;
struct pipe_surface *_src = NULL;
_dst = st_pipe_surface(dst, PIPE_BUFFER_USAGE_GPU_WRITE);
_dst = st_pipe_surface(dst, PIPE_BIND_BLIT_DESTINATION);
if(!_dst)
SWIG_exception(SWIG_ValueError, "couldn't acquire destination surface for writing");
_src = st_pipe_surface(src, PIPE_BUFFER_USAGE_GPU_READ);
_src = st_pipe_surface(src, PIPE_BIND_BLIT_SOURCE);
if(!_src)
SWIG_exception(SWIG_ValueError, "couldn't acquire source surface for reading");
......@@ -352,7 +351,7 @@ error1:
{
struct pipe_surface *_dst = NULL;
_dst = st_pipe_surface(dst, PIPE_BUFFER_USAGE_GPU_WRITE);
_dst = st_pipe_surface(dst, PIPE_BIND_BLIT_DESTINATION);
if(!_dst)
SWIG_exception(SWIG_ValueError, "couldn't acquire destination surface for writing");
......
......@@ -89,7 +89,7 @@ struct st_device {
unsigned geom_flags ) {
/* We can't really display surfaces with the python statetracker so mask
* out that usage */
tex_usage &= ~PIPE_TEXTURE_USAGE_DISPLAY_TARGET;
tex_usage &= ~PIPE_BIND_DISPLAY_TARGET;
return $self->screen->is_format_supported( $self->screen,
format,
......@@ -117,7 +117,7 @@ struct st_device {
/* We can't really display surfaces with the python statetracker so mask
* out that usage */
tex_usage &= ~PIPE_TEXTURE_USAGE_DISPLAY_TARGET;
tex_usage &= ~PIPE_BIND_DISPLAY_TARGET;
memset(&templat, 0, sizeof(templat));
templat.format = format;
......@@ -126,7 +126,7 @@ struct st_device {
templat.depth0 = depth;
templat.last_level = last_level;
templat.target = target;
templat.tex_usage = tex_usage;
templat.bind = tex_usage;
return $self->screen->texture_create($self->screen, &templat);
}
......
......@@ -114,7 +114,7 @@
SWIG_exception(SWIG_ValueError, "index out of bounds");
if(surface) {
_surface = st_pipe_surface(surface, PIPE_BUFFER_USAGE_GPU_WRITE);
_surface = st_pipe_surface(surface, PIPE_BIND_RENDER_TARGET);
if(!_surface)
SWIG_exception(SWIG_ValueError, "couldn't acquire surface for writing");
}
......@@ -131,7 +131,7 @@
struct pipe_surface *_surface = NULL;
if(surface) {
_surface = st_pipe_surface(surface, PIPE_BUFFER_USAGE_GPU_WRITE);
_surface = st_pipe_surface(surface, PIPE_BIND_DEPTH_STENCIL);
if(!_surface)
SWIG_exception(SWIG_ValueError, "couldn't acquire surface for writing");
}
......
......@@ -98,7 +98,7 @@ CreateOrResizeBackBuffer(struct pipe_video_context *vpipe, unsigned int width, u
return true;
}
memset(&template, 0, sizeof(struct pipe_texture));
memset(&template, 0, sizeof(struct pipe_resource));
template.target = PIPE_TEXTURE_2D;
/* XXX: Needs to match the drawable's format? */
template.format = PIPE_FORMAT_B8G8R8X8_UNORM;
......
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