vrend: pass sub_context directly to draw_bind_images_shader

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Reviewed-by: Reviewed-by: Chia-I Wu <olvaffe@gmail.com>
macos/master
Gert Wollny 4 years ago
parent 8ac253a42e
commit bd7972b403
  1. 18
      src/vrend_renderer.c

@ -4288,7 +4288,7 @@ static void vrend_draw_bind_abo_shader(struct vrend_context *ctx)
} }
} }
static void vrend_draw_bind_images_shader(struct vrend_context *ctx, int shader_type) static void vrend_draw_bind_images_shader(struct vrend_sub_context *sub_ctx, int shader_type)
{ {
GLenum access; GLenum access;
GLboolean layered; GLboolean layered;
@ -4296,22 +4296,22 @@ static void vrend_draw_bind_images_shader(struct vrend_context *ctx, int shader_
uint32_t mask, tex_id, level, first_layer; uint32_t mask, tex_id, level, first_layer;
if (!ctx->sub->images_used_mask[shader_type]) if (!sub_ctx->images_used_mask[shader_type])
return; return;
if (!ctx->sub->prog->img_locs[shader_type]) if (!sub_ctx->prog->img_locs[shader_type])
return; return;
if (!has_feature(feat_images)) if (!has_feature(feat_images))
return; return;
mask = ctx->sub->images_used_mask[shader_type]; mask = sub_ctx->images_used_mask[shader_type];
while (mask) { while (mask) {
unsigned i = u_bit_scan(&mask); unsigned i = u_bit_scan(&mask);
if (!(ctx->sub->prog->images_used_mask[shader_type] & (1 << i))) if (!(sub_ctx->prog->images_used_mask[shader_type] & (1 << i)))
continue; continue;
iview = &ctx->sub->image_views[shader_type][i]; iview = &sub_ctx->image_views[shader_type][i];
tex_id = iview->texture->id; tex_id = iview->texture->id;
if (has_bit(iview->texture->storage_bits, VREND_STORAGE_GL_BUFFER)) { if (has_bit(iview->texture->storage_bits, VREND_STORAGE_GL_BUFFER)) {
if (!iview->texture->tbo_tex_id) if (!iview->texture->tbo_tex_id)
@ -4337,7 +4337,7 @@ static void vrend_draw_bind_images_shader(struct vrend_context *ctx, int shader_
} }
if (!vrend_state.use_gles) if (!vrend_state.use_gles)
glUniform1i(ctx->sub->prog->img_locs[shader_type][i], i); glUniform1i(sub_ctx->prog->img_locs[shader_type][i], i);
switch (iview->access) { switch (iview->access) {
case PIPE_IMAGE_ACCESS_READ: case PIPE_IMAGE_ACCESS_READ:
@ -4366,7 +4366,7 @@ static void vrend_draw_bind_objects(struct vrend_context *ctx, bool new_program)
vrend_draw_bind_const_shader(ctx->sub, shader_type, new_program); vrend_draw_bind_const_shader(ctx->sub, shader_type, new_program);
next_sampler_id = vrend_draw_bind_samplers_shader(ctx->sub, shader_type, next_sampler_id = vrend_draw_bind_samplers_shader(ctx->sub, shader_type,
next_sampler_id); next_sampler_id);
vrend_draw_bind_images_shader(ctx, shader_type); vrend_draw_bind_images_shader(ctx->sub, shader_type);
vrend_draw_bind_ssbo_shader(ctx, shader_type); vrend_draw_bind_ssbo_shader(ctx, shader_type);
} }
@ -4842,7 +4842,7 @@ void vrend_launch_grid(struct vrend_context *ctx,
vrend_draw_bind_ubo_shader(ctx->sub, PIPE_SHADER_COMPUTE, 0); vrend_draw_bind_ubo_shader(ctx->sub, PIPE_SHADER_COMPUTE, 0);
vrend_draw_bind_const_shader(ctx->sub, PIPE_SHADER_COMPUTE, new_program); vrend_draw_bind_const_shader(ctx->sub, PIPE_SHADER_COMPUTE, new_program);
vrend_draw_bind_samplers_shader(ctx->sub, PIPE_SHADER_COMPUTE, 0); vrend_draw_bind_samplers_shader(ctx->sub, PIPE_SHADER_COMPUTE, 0);
vrend_draw_bind_images_shader(ctx, PIPE_SHADER_COMPUTE); vrend_draw_bind_images_shader(ctx->sub, PIPE_SHADER_COMPUTE);
vrend_draw_bind_ssbo_shader(ctx, PIPE_SHADER_COMPUTE); vrend_draw_bind_ssbo_shader(ctx, PIPE_SHADER_COMPUTE);
vrend_draw_bind_abo_shader(ctx); vrend_draw_bind_abo_shader(ctx);

Loading…
Cancel
Save