vk/pipeline_layout: Move surface/sampler start from SoA to AoS
This makes more sense to me and it's more consistent with anv_descriptor_set_layout.
This commit is contained in:
@@ -449,7 +449,7 @@ anv_cmd_buffer_emit_binding_table(struct anv_cmd_buffer *cmd_buffer,
|
|||||||
struct anv_descriptor_slot *surface_slots =
|
struct anv_descriptor_slot *surface_slots =
|
||||||
set_layout->stage[stage].surface_start;
|
set_layout->stage[stage].surface_start;
|
||||||
|
|
||||||
uint32_t start = bias + layout->set[set].surface_start[stage];
|
uint32_t start = bias + layout->set[set].stage[stage].surface_start;
|
||||||
|
|
||||||
for (uint32_t b = 0; b < set_layout->stage[stage].surface_count; b++) {
|
for (uint32_t b = 0; b < set_layout->stage[stage].surface_count; b++) {
|
||||||
struct anv_surface_view *view =
|
struct anv_surface_view *view =
|
||||||
@@ -515,7 +515,7 @@ anv_cmd_buffer_emit_samplers(struct anv_cmd_buffer *cmd_buffer,
|
|||||||
struct anv_descriptor_slot *sampler_slots =
|
struct anv_descriptor_slot *sampler_slots =
|
||||||
set_layout->stage[stage].sampler_start;
|
set_layout->stage[stage].sampler_start;
|
||||||
|
|
||||||
uint32_t start = layout->set[set].sampler_start[stage];
|
uint32_t start = layout->set[set].stage[stage].sampler_start;
|
||||||
|
|
||||||
for (uint32_t b = 0; b < set_layout->stage[stage].sampler_count; b++) {
|
for (uint32_t b = 0; b < set_layout->stage[stage].sampler_count; b++) {
|
||||||
struct anv_sampler *sampler =
|
struct anv_sampler *sampler =
|
||||||
|
@@ -395,9 +395,9 @@ VkResult anv_CreatePipelineLayout(
|
|||||||
|
|
||||||
layout->set[i].layout = set_layout;
|
layout->set[i].layout = set_layout;
|
||||||
for (uint32_t s = 0; s < VK_SHADER_STAGE_NUM; s++) {
|
for (uint32_t s = 0; s < VK_SHADER_STAGE_NUM; s++) {
|
||||||
layout->set[i].surface_start[s] = surface_start[s];
|
layout->set[i].stage[s].surface_start = surface_start[s];
|
||||||
surface_start[s] += set_layout->stage[s].surface_count;
|
surface_start[s] += set_layout->stage[s].surface_count;
|
||||||
layout->set[i].sampler_start[s] = sampler_start[s];
|
layout->set[i].stage[s].sampler_start = sampler_start[s];
|
||||||
sampler_start[s] += set_layout->stage[s].sampler_count;
|
sampler_start[s] += set_layout->stage[s].sampler_count;
|
||||||
|
|
||||||
layout->stage[s].surface_count += set_layout->stage[s].surface_count;
|
layout->stage[s].surface_count += set_layout->stage[s].surface_count;
|
||||||
|
@@ -664,8 +664,10 @@ anv_descriptor_set_destroy(struct anv_device *device,
|
|||||||
struct anv_pipeline_layout {
|
struct anv_pipeline_layout {
|
||||||
struct {
|
struct {
|
||||||
struct anv_descriptor_set_layout *layout;
|
struct anv_descriptor_set_layout *layout;
|
||||||
uint32_t surface_start[VK_SHADER_STAGE_NUM];
|
struct {
|
||||||
uint32_t sampler_start[VK_SHADER_STAGE_NUM];
|
uint32_t surface_start;
|
||||||
|
uint32_t sampler_start;
|
||||||
|
} stage[VK_SHADER_STAGE_NUM];
|
||||||
} set[MAX_SETS];
|
} set[MAX_SETS];
|
||||||
|
|
||||||
uint32_t num_sets;
|
uint32_t num_sets;
|
||||||
|
Reference in New Issue
Block a user