d3d12: Rename UAV -> SSBO to disambiguate with image UAVs
Reviewed-by: Sil Vilerino <sivileri@microsoft.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14342>
This commit is contained in:
parent
aa73203850
commit
6620c342ac
|
@ -1469,18 +1469,18 @@ d3d12_set_stream_output_targets(struct pipe_context *pctx,
|
|||
}
|
||||
|
||||
static void
|
||||
d3d12_decrement_uav_bind_count(struct d3d12_context *ctx,
|
||||
d3d12_decrement_ssbo_bind_count(struct d3d12_context *ctx,
|
||||
enum pipe_shader_type shader,
|
||||
struct d3d12_resource *res) {
|
||||
assert(res->bind_counts[shader][D3D12_RESOURCE_BINDING_TYPE_UAV] > 0);
|
||||
res->bind_counts[shader][D3D12_RESOURCE_BINDING_TYPE_UAV]--;
|
||||
assert(res->bind_counts[shader][D3D12_RESOURCE_BINDING_TYPE_SSBO] > 0);
|
||||
res->bind_counts[shader][D3D12_RESOURCE_BINDING_TYPE_SSBO]--;
|
||||
}
|
||||
|
||||
static void
|
||||
d3d12_increment_uav_bind_count(struct d3d12_context *ctx,
|
||||
d3d12_increment_ssbo_bind_count(struct d3d12_context *ctx,
|
||||
enum pipe_shader_type shader,
|
||||
struct d3d12_resource *res) {
|
||||
res->bind_counts[shader][D3D12_RESOURCE_BINDING_TYPE_UAV]++;
|
||||
res->bind_counts[shader][D3D12_RESOURCE_BINDING_TYPE_SSBO]++;
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -1494,7 +1494,7 @@ d3d12_set_shader_buffers(struct pipe_context *pctx,
|
|||
for (unsigned i = 0; i < count; ++i) {
|
||||
struct pipe_shader_buffer *slot = &ctx->ssbo_views[shader][i + start_slot];
|
||||
if (slot->buffer) {
|
||||
d3d12_decrement_uav_bind_count(ctx, shader, d3d12_resource(slot->buffer));
|
||||
d3d12_decrement_ssbo_bind_count(ctx, shader, d3d12_resource(slot->buffer));
|
||||
pipe_resource_reference(&slot->buffer, NULL);
|
||||
}
|
||||
|
||||
|
@ -1502,7 +1502,7 @@ d3d12_set_shader_buffers(struct pipe_context *pctx,
|
|||
pipe_resource_reference(&slot->buffer, buffers[i].buffer);
|
||||
slot->buffer_offset = buffers[i].buffer_offset;
|
||||
slot->buffer_size = buffers[i].buffer_size;
|
||||
d3d12_increment_uav_bind_count(ctx, shader, d3d12_resource(buffers[i].buffer));
|
||||
d3d12_increment_ssbo_bind_count(ctx, shader, d3d12_resource(buffers[i].buffer));
|
||||
} else
|
||||
memset(slot, 0, sizeof(*slot));
|
||||
}
|
||||
|
@ -1518,7 +1518,7 @@ d3d12_set_shader_buffers(struct pipe_context *pctx,
|
|||
}
|
||||
}
|
||||
}
|
||||
ctx->shader_dirty[shader] |= D3D12_SHADER_DIRTY_UAVS;
|
||||
ctx->shader_dirty[shader] |= D3D12_SHADER_DIRTY_SSBO;
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -1534,8 +1534,8 @@ d3d12_invalidate_context_bindings(struct d3d12_context *ctx, struct d3d12_resour
|
|||
ctx->shader_dirty[i] |= D3D12_SHADER_DIRTY_SAMPLER_VIEWS;
|
||||
}
|
||||
|
||||
if (res->bind_counts[i][D3D12_RESOURCE_BINDING_TYPE_UAV] > 0) {
|
||||
ctx->shader_dirty[i] |= D3D12_SHADER_DIRTY_UAVS;
|
||||
if (res->bind_counts[i][D3D12_RESOURCE_BINDING_TYPE_SSBO] > 0) {
|
||||
ctx->shader_dirty[i] |= D3D12_SHADER_DIRTY_SSBO;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -69,7 +69,7 @@ enum d3d12_shader_dirty_flags
|
|||
D3D12_SHADER_DIRTY_CONSTBUF = (1 << 0),
|
||||
D3D12_SHADER_DIRTY_SAMPLER_VIEWS = (1 << 1),
|
||||
D3D12_SHADER_DIRTY_SAMPLERS = (1 << 2),
|
||||
D3D12_SHADER_DIRTY_UAVS = (1 << 3),
|
||||
D3D12_SHADER_DIRTY_SSBO = (1 << 3),
|
||||
};
|
||||
|
||||
#define D3D12_DIRTY_PSO (D3D12_DIRTY_BLEND | D3D12_DIRTY_RASTERIZER | D3D12_DIRTY_ZSA | \
|
||||
|
@ -79,7 +79,7 @@ enum d3d12_shader_dirty_flags
|
|||
D3D12_DIRTY_STRIP_CUT_VALUE)
|
||||
|
||||
#define D3D12_SHADER_DIRTY_ALL (D3D12_SHADER_DIRTY_CONSTBUF | D3D12_SHADER_DIRTY_SAMPLER_VIEWS | \
|
||||
D3D12_SHADER_DIRTY_SAMPLERS | D3D12_SHADER_DIRTY_UAVS)
|
||||
D3D12_SHADER_DIRTY_SAMPLERS | D3D12_SHADER_DIRTY_SSBO)
|
||||
|
||||
enum d3d12_binding_type {
|
||||
D3D12_BINDING_CONSTANT_BUFFER,
|
||||
|
|
|
@ -139,7 +139,7 @@ fill_srv_descriptors(struct d3d12_context *ctx,
|
|||
}
|
||||
|
||||
static D3D12_GPU_DESCRIPTOR_HANDLE
|
||||
fill_uav_descriptors(struct d3d12_context *ctx,
|
||||
fill_ssbo_descriptors(struct d3d12_context *ctx,
|
||||
const struct d3d12_shader *shader,
|
||||
int stage)
|
||||
{
|
||||
|
@ -341,9 +341,9 @@ update_graphics_root_parameters(struct d3d12_context *ctx,
|
|||
num_params++;
|
||||
}
|
||||
if (shader->nir->info.num_ssbos > 0) {
|
||||
if (dirty & D3D12_SHADER_DIRTY_UAVS) {
|
||||
if (dirty & D3D12_SHADER_DIRTY_SSBO) {
|
||||
assert(num_root_desciptors < MAX_DESCRIPTOR_TABLES);
|
||||
root_desc_tables[num_root_desciptors] = fill_uav_descriptors(ctx, shader, i);
|
||||
root_desc_tables[num_root_desciptors] = fill_ssbo_descriptors(ctx, shader, i);
|
||||
root_desc_indices[num_root_desciptors++] = num_params;
|
||||
}
|
||||
num_params++;
|
||||
|
|
|
@ -35,7 +35,7 @@ struct pipe_screen;
|
|||
enum d3d12_resource_binding_type {
|
||||
D3D12_RESOURCE_BINDING_TYPE_SRV,
|
||||
D3D12_RESOURCE_BINDING_TYPE_CBV,
|
||||
D3D12_RESOURCE_BINDING_TYPE_UAV,
|
||||
D3D12_RESOURCE_BINDING_TYPE_SSBO,
|
||||
D3D12_RESOURCE_BINDING_TYPES
|
||||
};
|
||||
|
||||
|
|
|
@ -144,11 +144,11 @@ create_root_signature(struct d3d12_context *ctx, struct d3d12_root_signature_key
|
|||
num_params++;
|
||||
}
|
||||
|
||||
if (key->stages[i].num_uavs > 0) {
|
||||
if (key->stages[i].num_ssbos > 0) {
|
||||
init_range_root_param(&root_params[num_params],
|
||||
&desc_ranges[num_params],
|
||||
D3D12_DESCRIPTOR_RANGE_TYPE_UAV,
|
||||
key->stages[i].num_uavs,
|
||||
key->stages[i].num_ssbos,
|
||||
visibility,
|
||||
0);
|
||||
num_params++;
|
||||
|
@ -201,7 +201,7 @@ fill_key(struct d3d12_context *ctx, struct d3d12_root_signature_key *key)
|
|||
key->stages[i].begin_srv_binding = shader->begin_srv_binding;
|
||||
key->stages[i].state_vars_size = shader->state_vars_size;
|
||||
key->stages[i].has_default_ubo0 = shader->has_default_ubo0;
|
||||
key->stages[i].num_uavs = shader->nir->info.num_ssbos;
|
||||
key->stages[i].num_ssbos = shader->nir->info.num_ssbos;
|
||||
|
||||
if (ctx->gfx_stages[i]->so_info.num_outputs > 0)
|
||||
key->has_stream_output = true;
|
||||
|
|
|
@ -33,7 +33,7 @@ struct d3d12_root_signature_key {
|
|||
unsigned end_srv_binding;
|
||||
unsigned begin_srv_binding;
|
||||
unsigned state_vars_size;
|
||||
unsigned num_uavs;
|
||||
unsigned num_ssbos;
|
||||
bool has_default_ubo0;
|
||||
} stages[D3D12_GFX_SHADER_STAGES];
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue