X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=src%2Fgallium%2Fdrivers%2Frbug%2Frbug_core.c;h=dedbc14e8d8c5a0d7ba6ec3c57f7c7db160116f5;hb=d794072b3e1f27b96aaf2c476fcd5dcc5fd9d445;hp=f1aab3869b5c24a0bb47c6cd0a3e65bc0a47fa1b;hpb=395e9449ca7c7a953f1a9924d8fedc4e9678ad81;p=mesa.git diff --git a/src/gallium/drivers/rbug/rbug_core.c b/src/gallium/drivers/rbug/rbug_core.c index f1aab3869b5..dedbc14e8d8 100644 --- a/src/gallium/drivers/rbug/rbug_core.c +++ b/src/gallium/drivers/rbug/rbug_core.c @@ -31,7 +31,7 @@ #include "util/u_string.h" #include "util/u_inlines.h" #include "util/u_memory.h" -#include "util/u_simple_list.h" +#include "util/simple_list.h" #include "util/u_network.h" #include "os/os_time.h" @@ -104,7 +104,8 @@ rbug_shader_create_locked(struct pipe_context *pipe, struct tgsi_token *tokens) { void *state = NULL; - struct pipe_shader_state pss = { 0 }; + struct pipe_shader_state pss; + memset(&pss, 0, sizeof(pss)); pss.tokens = tokens; switch(rb_shader->type) { @@ -203,6 +204,7 @@ rbug_texture_info(struct rbug_rbug *tr_rbug, struct rbug_header *header, uint32_ struct rbug_proto_texture_info *gpti = (struct rbug_proto_texture_info *)header; struct rbug_list *ptr; struct pipe_resource *t; + unsigned num_layers; pipe_mutex_lock(rb_screen->list_mutex); foreach(ptr, &rb_screen->resources) { @@ -218,11 +220,13 @@ rbug_texture_info(struct rbug_rbug *tr_rbug, struct rbug_header *header, uint32_ } t = tr_tex->resource; + num_layers = util_max_layer(t, 0) + 1; + rbug_send_texture_info_reply(tr_rbug->con, serial, t->target, t->format, &t->width0, 1, &t->height0, 1, - &t->depth0, 1, + &num_layers, 1, util_format_get_blockwidth(t->format), util_format_get_blockheight(t->format), util_format_get_blocksize(t->format), @@ -265,12 +269,10 @@ rbug_texture_read(struct rbug_rbug *tr_rbug, struct rbug_header *header, uint32_ } tex = tr_tex->resource; - t = pipe_get_transfer(context, tex, - gptr->face, gptr->level, gptr->zslice, - PIPE_TRANSFER_READ, - gptr->x, gptr->y, gptr->w, gptr->h); - - map = context->transfer_map(context, t); + map = pipe_transfer_map(context, tex, + gptr->level, gptr->face + gptr->zslice, + PIPE_TRANSFER_READ, + gptr->x, gptr->y, gptr->w, gptr->h, &t); rbug_send_texture_read_reply(tr_rbug->con, serial, t->resource->format, @@ -279,12 +281,11 @@ rbug_texture_read(struct rbug_rbug *tr_rbug, struct rbug_header *header, uint32_ util_format_get_blocksize(t->resource->format), (uint8_t*)map, t->stride * util_format_get_nblocksy(t->resource->format, - t->box.height), + t->box.height), t->stride, NULL); context->transfer_unmap(context, t); - context->transfer_destroy(context, t); pipe_mutex_unlock(rb_screen->list_mutex); @@ -322,8 +323,8 @@ rbug_context_info(struct rbug_rbug *tr_rbug, struct rbug_header *header, uint32_ struct rbug_screen *rb_screen = tr_rbug->rb_screen; struct rbug_context *rb_context = NULL; rbug_texture_t cbufs[PIPE_MAX_COLOR_BUFS]; - rbug_texture_t texs[PIPE_MAX_SAMPLERS]; - int i; + rbug_texture_t texs[PIPE_MAX_SHADER_SAMPLER_VIEWS]; + unsigned i; pipe_mutex_lock(rb_screen->list_mutex); rb_context = rbug_get_context_locked(rb_screen, info->context); @@ -340,12 +341,13 @@ rbug_context_info(struct rbug_rbug *tr_rbug, struct rbug_header *header, uint32_ for (i = 0; i < rb_context->curr.nr_cbufs; i++) cbufs[i] = VOID2U64(rb_context->curr.cbufs[i]); - for (i = 0; i < rb_context->curr.num_fs_views; i++) - texs[i] = VOID2U64(rb_context->curr.fs_texs[i]); + /* XXX what about vertex/geometry shader texture views? */ + for (i = 0; i < rb_context->curr.num_views[PIPE_SHADER_FRAGMENT]; i++) + texs[i] = VOID2U64(rb_context->curr.texs[PIPE_SHADER_FRAGMENT][i]); rbug_send_context_info_reply(tr_rbug->con, serial, - VOID2U64(rb_context->curr.vs), VOID2U64(rb_context->curr.fs), - texs, rb_context->curr.num_fs_views, + VOID2U64(rb_context->curr.shader[PIPE_SHADER_VERTEX]), VOID2U64(rb_context->curr.shader[PIPE_SHADER_FRAGMENT]), + texs, rb_context->curr.num_views[PIPE_SHADER_FRAGMENT], cbufs, rb_context->curr.nr_cbufs, VOID2U64(rb_context->curr.zsbuf), rb_context->draw_blocker, rb_context->draw_blocked, NULL); @@ -407,9 +409,7 @@ rbug_context_draw_step(struct rbug_rbug *tr_rbug, struct rbug_header *header, ui } pipe_mutex_unlock(rb_context->draw_mutex); -#ifdef PIPE_THREAD_HAVE_CONDVAR pipe_condvar_broadcast(rb_context->draw_cond); -#endif pipe_mutex_unlock(rb_screen->list_mutex); @@ -442,9 +442,7 @@ rbug_context_draw_unblock(struct rbug_rbug *tr_rbug, struct rbug_header *header, rb_context->draw_blocker &= ~unblock->unblock; pipe_mutex_unlock(rb_context->draw_mutex); -#ifdef PIPE_THREAD_HAVE_CONDVAR pipe_condvar_broadcast(rb_context->draw_cond); -#endif pipe_mutex_unlock(rb_screen->list_mutex); @@ -468,17 +466,15 @@ rbug_context_draw_rule(struct rbug_rbug *tr_rbug, struct rbug_header *header, ui } pipe_mutex_lock(rb_context->draw_mutex); - rb_context->draw_rule.vs = U642VOID(rule->vertex); - rb_context->draw_rule.fs = U642VOID(rule->fragment); + rb_context->draw_rule.shader[PIPE_SHADER_VERTEX] = U642VOID(rule->vertex); + rb_context->draw_rule.shader[PIPE_SHADER_FRAGMENT] = U642VOID(rule->fragment); rb_context->draw_rule.texture = U642VOID(rule->texture); rb_context->draw_rule.surf = U642VOID(rule->surface); rb_context->draw_rule.blocker = rule->block; rb_context->draw_blocker |= RBUG_BLOCK_RULE; pipe_mutex_unlock(rb_context->draw_mutex); -#ifdef PIPE_THREAD_HAVE_CONDVAR pipe_condvar_broadcast(rb_context->draw_cond); -#endif pipe_mutex_unlock(rb_screen->list_mutex); @@ -504,7 +500,7 @@ rbug_context_flush(struct rbug_rbug *tr_rbug, struct rbug_header *header, uint32 /* protect the pipe context */ pipe_mutex_lock(rb_context->call_mutex); - rb_context->pipe->flush(rb_context->pipe, flush->flags, NULL); + rb_context->pipe->flush(rb_context->pipe, NULL, 0); pipe_mutex_unlock(rb_context->call_mutex); pipe_mutex_unlock(rb_screen->list_mutex); @@ -670,7 +666,7 @@ rbug_shader_replace(struct rbug_rbug *tr_rbug, struct rbug_header *header) /* remove old replaced shader */ if (tr_shdr->replaced_shader) { /* if this shader is bound rebind the original shader */ - if (rb_context->curr.fs == tr_shdr || rb_context->curr.vs == tr_shdr) + if (rb_context->curr.shader[PIPE_SHADER_FRAGMENT] == tr_shdr || rb_context->curr.shader[PIPE_SHADER_VERTEX] == tr_shdr) rbug_shader_bind_locked(pipe, tr_shdr, tr_shdr->shader); FREE(tr_shdr->replaced_tokens); @@ -692,7 +688,7 @@ rbug_shader_replace(struct rbug_rbug *tr_rbug, struct rbug_header *header) goto err; /* bind new shader if the shader is currently a bound */ - if (rb_context->curr.fs == tr_shdr || rb_context->curr.vs == tr_shdr) + if (rb_context->curr.shader[PIPE_SHADER_FRAGMENT] == tr_shdr || rb_context->curr.shader[PIPE_SHADER_VERTEX] == tr_shdr) rbug_shader_bind_locked(pipe, tr_shdr, state); /* save state */ @@ -817,7 +813,7 @@ PIPE_THREAD_ROUTINE(rbug_thread, void_tr_rbug) if (s < 0) { debug_printf("rbug_rbug - failed to listen\n"); - return NULL; + return 0; } u_socket_block(s, false); @@ -843,7 +839,7 @@ PIPE_THREAD_ROUTINE(rbug_thread, void_tr_rbug) u_socket_stop(); - return NULL; + return 0; } /**********************************************************