if (op & SI_SAVE_TEXTURES) {
util_blitter_save_fragment_sampler_states(
sctx->blitter, 2,
- (void**)sctx->samplers[PIPE_SHADER_FRAGMENT].views.sampler_states);
+ (void**)sctx->samplers[PIPE_SHADER_FRAGMENT].sampler_states);
util_blitter_save_fragment_sampler_views(sctx->blitter, 2,
- sctx->samplers[PIPE_SHADER_FRAGMENT].views.views);
+ sctx->samplers[PIPE_SHADER_FRAGMENT].views);
}
if (op & SI_DISABLE_RENDER_COND)
i = u_bit_scan(&mask);
- view = textures->views.views[i];
+ view = textures->views[i];
assert(view);
sview = (struct si_sampler_view*)view;
i = u_bit_scan(&mask);
- view = textures->views.views[i];
+ view = textures->views[i];
assert(view);
tex = (struct r600_texture *)view->texture;
static void si_check_render_feedback_textures(struct si_context *sctx,
struct si_samplers *textures)
{
- uint32_t mask = textures->views.enabled_mask;
+ uint32_t mask = textures->enabled_mask;
while (mask) {
const struct pipe_sampler_view *view;
unsigned i = u_bit_scan(&mask);
- view = textures->views.views[i];
+ view = textures->views[i];
if(view->texture->target == PIPE_BUFFER)
continue;
return &sctx->descriptors[si_sampler_and_image_descriptors_idx(shader)];
}
-static void si_release_sampler_views(struct si_sampler_views *views)
+static void si_release_sampler_views(struct si_samplers *samplers)
{
int i;
- for (i = 0; i < ARRAY_SIZE(views->views); i++) {
- pipe_sampler_view_reference(&views->views[i], NULL);
+ for (i = 0; i < ARRAY_SIZE(samplers->views); i++) {
+ pipe_sampler_view_reference(&samplers->views[i], NULL);
}
}
}
static void si_sampler_views_begin_new_cs(struct si_context *sctx,
- struct si_sampler_views *views)
+ struct si_samplers *samplers)
{
- unsigned mask = views->enabled_mask;
+ unsigned mask = samplers->enabled_mask;
/* Add buffers to the CS. */
while (mask) {
int i = u_bit_scan(&mask);
- struct si_sampler_view *sview = (struct si_sampler_view *)views->views[i];
+ struct si_sampler_view *sview = (struct si_sampler_view *)samplers->views[i];
si_sampler_view_add_buffer(sctx, sview->base.texture,
RADEON_USAGE_READ,
bool disallow_early_out)
{
struct si_samplers *samplers = &sctx->samplers[shader];
- struct si_sampler_views *views = &samplers->views;
struct si_sampler_view *rview = (struct si_sampler_view*)view;
struct si_descriptors *descs = si_sampler_and_image_descriptors(sctx, shader);
unsigned desc_slot = si_get_sampler_slot(slot);
uint32_t *desc = descs->list + desc_slot * 16;
- if (views->views[slot] == view && !disallow_early_out)
+ if (samplers->views[slot] == view && !disallow_early_out)
return;
if (view) {
struct r600_texture *rtex = (struct r600_texture *)view->texture;
si_set_sampler_view_desc(sctx, rview,
- views->sampler_states[slot], desc);
+ samplers->sampler_states[slot], desc);
if (rtex->resource.b.b.target == PIPE_BUFFER) {
rtex->resource.bind_history |= PIPE_BIND_SAMPLER_VIEW;
sctx->need_check_render_feedback = true;
}
- pipe_sampler_view_reference(&views->views[slot], view);
- views->enabled_mask |= 1u << slot;
+ pipe_sampler_view_reference(&samplers->views[slot], view);
+ samplers->enabled_mask |= 1u << slot;
/* Since this can flush, it must be done after enabled_mask is
* updated. */
RADEON_USAGE_READ,
rview->is_stencil_sampler, true);
} else {
- pipe_sampler_view_reference(&views->views[slot], NULL);
+ pipe_sampler_view_reference(&samplers->views[slot], NULL);
memcpy(desc, null_texture_descriptor, 8*4);
/* Only clear the lower dwords of FMASK. */
memcpy(desc + 8, null_texture_descriptor, 4*4);
/* Re-set the sampler state if we are transitioning from FMASK. */
- if (views->sampler_states[slot])
- si_set_sampler_state_desc(views->sampler_states[slot], NULL, NULL,
+ if (samplers->sampler_states[slot])
+ si_set_sampler_state_desc(samplers->sampler_states[slot], NULL, NULL,
desc + 12);
- views->enabled_mask &= ~(1u << slot);
+ samplers->enabled_mask &= ~(1u << slot);
samplers->needs_depth_decompress_mask &= ~(1u << slot);
samplers->needs_color_decompress_mask &= ~(1u << slot);
}
static void
si_samplers_update_needs_color_decompress_mask(struct si_samplers *samplers)
{
- unsigned mask = samplers->views.enabled_mask;
+ unsigned mask = samplers->enabled_mask;
while (mask) {
int i = u_bit_scan(&mask);
- struct pipe_resource *res = samplers->views.views[i]->texture;
+ struct pipe_resource *res = samplers->views[i]->texture;
if (res && res->target != PIPE_BUFFER) {
struct r600_texture *rtex = (struct r600_texture *)res;
unsigned desc_slot = si_get_sampler_slot(slot);
if (!sstates[i] ||
- sstates[i] == samplers->views.sampler_states[slot])
+ sstates[i] == samplers->sampler_states[slot])
continue;
#ifdef DEBUG
assert(sstates[i]->magic == SI_SAMPLER_STATE_MAGIC);
#endif
- samplers->views.sampler_states[slot] = sstates[i];
+ samplers->sampler_states[slot] = sstates[i];
/* If FMASK is bound, don't overwrite it.
* The sampler state will be set after FMASK is unbound.
*/
struct si_sampler_view *sview =
- (struct si_sampler_view *)samplers->views.views[slot];
+ (struct si_sampler_view *)samplers->views[slot];
struct r600_texture *tex = NULL;
if (rbuffer->bind_history & PIPE_BIND_SAMPLER_VIEW) {
/* Texture buffers - update bindings. */
for (shader = 0; shader < SI_NUM_SHADERS; shader++) {
- struct si_sampler_views *views = &sctx->samplers[shader].views;
+ struct si_samplers *samplers = &sctx->samplers[shader];
struct si_descriptors *descs =
si_sampler_and_image_descriptors(sctx, shader);
- unsigned mask = views->enabled_mask;
+ unsigned mask = samplers->enabled_mask;
while (mask) {
unsigned i = u_bit_scan(&mask);
- if (views->views[i]->texture == buf) {
+ if (samplers->views[i]->texture == buf) {
unsigned desc_slot = si_get_sampler_slot(i);
si_desc_reset_buffer_offset(ctx,
unsigned shader;
for (shader = 0; shader < SI_NUM_SHADERS; shader++) {
- struct si_sampler_views *samplers = &sctx->samplers[shader].views;
+ struct si_samplers *samplers = &sctx->samplers[shader];
struct si_images *images = &sctx->images[shader];
unsigned mask;
for (i = 0; i < SI_NUM_SHADERS; i++) {
si_release_buffer_resources(&sctx->const_and_shader_buffers[i],
si_const_and_shader_buffer_descriptors(sctx, i));
- si_release_sampler_views(&sctx->samplers[i].views);
+ si_release_sampler_views(&sctx->samplers[i]);
si_release_image_views(&sctx->images[i]);
}
si_release_buffer_resources(&sctx->rw_buffers,
for (i = 0; i < SI_NUM_SHADERS; i++) {
si_buffer_resources_begin_new_cs(sctx, &sctx->const_and_shader_buffers[i]);
- si_sampler_views_begin_new_cs(sctx, &sctx->samplers[i].views);
+ si_sampler_views_begin_new_cs(sctx, &sctx->samplers[i]);
si_image_views_begin_new_cs(sctx, &sctx->images[i]);
}
si_buffer_resources_begin_new_cs(sctx, &sctx->rw_buffers);