struct cso_context *cso = st->cso_context;
struct pipe_context *pipe = st->pipe;
bool success = false;
+ void *fs;
- /* Create fragment shader */
- if (!st->pbo.upload_fs) {
- st->pbo.upload_fs = st_pbo_create_upload_fs(st);
- if (!st->pbo.upload_fs)
- return false;
- }
+ fs = st_pbo_get_upload_fs(st);
+ if (!fs)
+ return false;
cso_save_state(cso, (CSO_BIT_FRAGMENT_SAMPLER_VIEWS |
CSO_BIT_FRAGMENT_SAMPLERS |
}
/* Set up the fragment shader */
- cso_set_fragment_shader_handle(cso, st->pbo.upload_fs);
+ cso_set_fragment_shader_handle(cso, fs);
success = st_pbo_draw(st, addr, surface->width, surface->height);
}
void *
-st_pbo_create_upload_fs(struct st_context *st)
+st_pbo_get_upload_fs(struct st_context *st)
{
- return create_fs(st, false, 0);
+ if (!st->pbo.upload_fs)
+ st->pbo.upload_fs = create_fs(st, false, 0);
+
+ return st->pbo.upload_fs;
}
void *
st_pbo_create_gs(struct st_context *st);
void *
-st_pbo_create_upload_fs(struct st_context *st);
+st_pbo_get_upload_fs(struct st_context *st);
void *
st_pbo_get_download_fs(struct st_context *st, enum pipe_texture_target target);