/* V3D 3.x: Packed texture state. */
uint8_t texture_shader_state[32];
/* V3D 4.x: Sampler state struct. */
- struct v3d_bo *bo;
+ struct pipe_resource *sampler_state;
+ uint32_t sampler_state_offset;
};
struct v3d_texture_stateobj {
struct pipe_sampler_state *psampler = texstate->samplers[unit];
struct v3d_sampler_state *sampler = v3d_sampler_state(psampler);
- cl_aligned_reloc(&job->indirect, uniforms, sampler->bo,
+ cl_aligned_reloc(&job->indirect, uniforms,
+ v3d_resource(sampler->sampler_state)->bo,
+ sampler->sampler_state_offset |
v3d_tmu_config_data_get_value(data));
}
cso->min_img_filter == PIPE_TEX_MIPFILTER_NEAREST);
#if V3D_VERSION >= 40
- so->bo = v3d_bo_alloc(v3d->screen, cl_packet_length(SAMPLER_STATE),
- "sampler");
- void *map = v3d_bo_map(so->bo);
+ void *map;
+ u_upload_alloc(v3d->state_uploader, 0,
+ cl_packet_length(SAMPLER_STATE),
+ 32, /* XXX: 8 for unextended samplers. */
+ &so->sampler_state_offset,
+ &so->sampler_state,
+ &map);
v3dx_pack(map, SAMPLER_STATE, sampler) {
sampler.wrap_i_border = false;
struct pipe_sampler_state *psampler = hwcso;
struct v3d_sampler_state *sampler = v3d_sampler_state(psampler);
- v3d_bo_unreference(&sampler->bo);
+ pipe_resource_reference(&sampler->sampler_state, NULL);
free(psampler);
}