renderer: get return value from draw vbo.

For now we return 0, as I'm not sure what will happen if we start
to throw some errors

Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
macos/master
Dave Airlie 6 years ago
parent 31049f6c0d
commit c8269aeab1
  1. 3
      src/vrend_decode.c
  2. 27
      src/vrend_renderer.c
  3. 6
      src/vrend_renderer.h

@ -392,8 +392,7 @@ static int vrend_decode_draw_vbo(struct vrend_decode_ctx *ctx, int length)
cso = get_buf_entry(ctx, VIRGL_DRAW_VBO_COUNT_FROM_SO); cso = get_buf_entry(ctx, VIRGL_DRAW_VBO_COUNT_FROM_SO);
vrend_draw_vbo(ctx->grctx, &info, cso, handle, indirect_draw_count_handle); return vrend_draw_vbo(ctx->grctx, &info, cso, handle, indirect_draw_count_handle);
return 0;
} }
static int vrend_decode_create_blend(struct vrend_decode_ctx *ctx, uint32_t handle, uint16_t length) static int vrend_decode_create_blend(struct vrend_decode_ctx *ctx, uint32_t handle, uint16_t length)

@ -3326,30 +3326,30 @@ static void vrend_draw_bind_objects(struct vrend_context *ctx, bool new_program)
ctx->sub->sampler_state_dirty = false; ctx->sub->sampler_state_dirty = false;
} }
void vrend_draw_vbo(struct vrend_context *ctx, int vrend_draw_vbo(struct vrend_context *ctx,
const struct pipe_draw_info *info, const struct pipe_draw_info *info,
uint32_t cso, uint32_t indirect_handle, uint32_t cso, uint32_t indirect_handle,
uint32_t indirect_draw_count_handle) uint32_t indirect_draw_count_handle)
{ {
int i; int i;
bool new_program = false; bool new_program = false;
struct vrend_resource *indirect_res = NULL; struct vrend_resource *indirect_res = NULL;
if (ctx->in_error) if (ctx->in_error)
return; return 0;
if (indirect_handle) { if (indirect_handle) {
indirect_res = vrend_renderer_ctx_res_lookup(ctx, indirect_handle); indirect_res = vrend_renderer_ctx_res_lookup(ctx, indirect_handle);
if (!indirect_res) { if (!indirect_res) {
report_context_error(ctx, VIRGL_ERROR_CTX_ILLEGAL_RESOURCE, indirect_handle); report_context_error(ctx, VIRGL_ERROR_CTX_ILLEGAL_RESOURCE, indirect_handle);
return; return 0;
} }
} }
/* this must be zero until we support the feature */ /* this must be zero until we support the feature */
if (indirect_draw_count_handle) { if (indirect_draw_count_handle) {
report_context_error(ctx, VIRGL_ERROR_CTX_ILLEGAL_RESOURCE, indirect_handle); report_context_error(ctx, VIRGL_ERROR_CTX_ILLEGAL_RESOURCE, indirect_handle);
return; return 0;
} }
if (ctx->ctx_switch_pending) if (ctx->ctx_switch_pending)
@ -3373,7 +3373,7 @@ void vrend_draw_vbo(struct vrend_context *ctx,
bool same_prog; bool same_prog;
if (!ctx->sub->shaders[PIPE_SHADER_VERTEX] || !ctx->sub->shaders[PIPE_SHADER_FRAGMENT]) { if (!ctx->sub->shaders[PIPE_SHADER_VERTEX] || !ctx->sub->shaders[PIPE_SHADER_FRAGMENT]) {
fprintf(stderr,"dropping rendering due to missing shaders: %s\n", ctx->debug_name); fprintf(stderr,"dropping rendering due to missing shaders: %s\n", ctx->debug_name);
return; return 0;
} }
vrend_shader_select(ctx, ctx->sub->shaders[PIPE_SHADER_FRAGMENT], &fs_dirty); vrend_shader_select(ctx, ctx->sub->shaders[PIPE_SHADER_FRAGMENT], &fs_dirty);
@ -3391,7 +3391,7 @@ void vrend_draw_vbo(struct vrend_context *ctx,
(ctx->sub->shaders[PIPE_SHADER_TESS_CTRL] && !ctx->sub->shaders[PIPE_SHADER_TESS_CTRL]->current) || (ctx->sub->shaders[PIPE_SHADER_TESS_CTRL] && !ctx->sub->shaders[PIPE_SHADER_TESS_CTRL]->current) ||
(ctx->sub->shaders[PIPE_SHADER_TESS_EVAL] && !ctx->sub->shaders[PIPE_SHADER_TESS_EVAL]->current)) { (ctx->sub->shaders[PIPE_SHADER_TESS_EVAL] && !ctx->sub->shaders[PIPE_SHADER_TESS_EVAL]->current)) {
fprintf(stderr, "failure to compile shader variants: %s\n", ctx->debug_name); fprintf(stderr, "failure to compile shader variants: %s\n", ctx->debug_name);
return; return 0;
} }
same_prog = true; same_prog = true;
if (ctx->sub->shaders[PIPE_SHADER_VERTEX]->current->id != (GLuint)ctx->sub->prog_ids[PIPE_SHADER_VERTEX]) if (ctx->sub->shaders[PIPE_SHADER_VERTEX]->current->id != (GLuint)ctx->sub->prog_ids[PIPE_SHADER_VERTEX])
@ -3423,7 +3423,7 @@ void vrend_draw_vbo(struct vrend_context *ctx,
ctx->sub->shaders[PIPE_SHADER_TESS_CTRL] ? ctx->sub->shaders[PIPE_SHADER_TESS_CTRL]->current : NULL, ctx->sub->shaders[PIPE_SHADER_TESS_CTRL] ? ctx->sub->shaders[PIPE_SHADER_TESS_CTRL]->current : NULL,
ctx->sub->shaders[PIPE_SHADER_TESS_EVAL] ? ctx->sub->shaders[PIPE_SHADER_TESS_EVAL]->current : NULL); ctx->sub->shaders[PIPE_SHADER_TESS_EVAL] ? ctx->sub->shaders[PIPE_SHADER_TESS_EVAL]->current : NULL);
if (!prog) if (!prog)
return; return 0;
} }
ctx->sub->last_shader_idx = ctx->sub->shaders[PIPE_SHADER_TESS_EVAL] ? PIPE_SHADER_TESS_EVAL : (ctx->sub->shaders[PIPE_SHADER_GEOMETRY] ? PIPE_SHADER_GEOMETRY : PIPE_SHADER_FRAGMENT); ctx->sub->last_shader_idx = ctx->sub->shaders[PIPE_SHADER_TESS_EVAL] ? PIPE_SHADER_TESS_EVAL : (ctx->sub->shaders[PIPE_SHADER_GEOMETRY] ? PIPE_SHADER_GEOMETRY : PIPE_SHADER_FRAGMENT);
@ -3444,7 +3444,7 @@ void vrend_draw_vbo(struct vrend_context *ctx,
} }
if (!ctx->sub->prog) { if (!ctx->sub->prog) {
fprintf(stderr,"dropping rendering due to missing shaders: %s\n", ctx->debug_name); fprintf(stderr,"dropping rendering due to missing shaders: %s\n", ctx->debug_name);
return; return 0;
} }
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, ctx->sub->fb_id); glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, ctx->sub->fb_id);
@ -3454,7 +3454,7 @@ void vrend_draw_vbo(struct vrend_context *ctx,
if (!ctx->sub->ve) { if (!ctx->sub->ve) {
fprintf(stderr,"illegal VE setup - skipping renderering\n"); fprintf(stderr,"illegal VE setup - skipping renderering\n");
return; return 0;
} }
glUniform1f(ctx->sub->prog->vs_ws_adjust_loc, ctx->sub->viewport_is_negative ? -1.0 : 1.0); glUniform1f(ctx->sub->prog->vs_ws_adjust_loc, ctx->sub->viewport_is_negative ? -1.0 : 1.0);
@ -3475,7 +3475,7 @@ void vrend_draw_vbo(struct vrend_context *ctx,
int vbo_index = ve->base.vertex_buffer_index; int vbo_index = ve->base.vertex_buffer_index;
if (!ctx->sub->vbo[vbo_index].buffer) { if (!ctx->sub->vbo[vbo_index].buffer) {
fprintf(stderr, "VBO missing vertex buffer\n"); fprintf(stderr, "VBO missing vertex buffer\n");
return; return 0;
} }
} }
@ -3584,6 +3584,7 @@ void vrend_draw_vbo(struct vrend_context *ctx,
ctx->sub->current_so->xfb_state = XFB_STATE_PAUSED; ctx->sub->current_so->xfb_state = XFB_STATE_PAUSED;
} }
} }
return 0;
} }
static GLenum translate_blend_func(uint32_t pipe_blend) static GLenum translate_blend_func(uint32_t pipe_blend)

@ -131,9 +131,9 @@ void vrend_clear(struct vrend_context *ctx,
const union pipe_color_union *color, const union pipe_color_union *color,
double depth, unsigned stencil); double depth, unsigned stencil);
void vrend_draw_vbo(struct vrend_context *ctx, int vrend_draw_vbo(struct vrend_context *ctx,
const struct pipe_draw_info *info, const struct pipe_draw_info *info,
uint32_t cso, uint32_t indirect_handle, uint32_t indirect_draw_count_handle); uint32_t cso, uint32_t indirect_handle, uint32_t indirect_draw_count_handle);
void vrend_set_framebuffer_state(struct vrend_context *ctx, void vrend_set_framebuffer_state(struct vrend_context *ctx,
uint32_t nr_cbufs, uint32_t surf_handle[PIPE_MAX_COLOR_BUFS], uint32_t nr_cbufs, uint32_t surf_handle[PIPE_MAX_COLOR_BUFS],

Loading…
Cancel
Save