diff options
author | Jason Ekstrand <[email protected]> | 2015-10-14 17:02:55 -0700 |
---|---|---|
committer | Jason Ekstrand <[email protected]> | 2015-10-14 18:38:33 -0700 |
commit | 42683e37570bac2b0cb36896cf9a558ae0a24eb4 (patch) | |
tree | 46e9429b666217dc5c41ac40c6f46f0aca1f495e /src/vulkan | |
parent | da994f4b7ecf699ae27cb2236387db4cb099f42d (diff) |
anv: Get rid of backend compiler hacks for descriptor sets
Now that we have anv_nir_apply_pipeline_layout, we can hand the backend
compiler intrinsics and texture instructions that use a flat buffer index
just like it wants. There's no longer any reason for any of these hacks.
Diffstat (limited to 'src/vulkan')
-rw-r--r-- | src/vulkan/anv_compiler.cpp | 36 |
1 files changed, 5 insertions, 31 deletions
diff --git a/src/vulkan/anv_compiler.cpp b/src/vulkan/anv_compiler.cpp index 34023a7369f..a3b8d1cc80c 100644 --- a/src/vulkan/anv_compiler.cpp +++ b/src/vulkan/anv_compiler.cpp @@ -72,41 +72,16 @@ static VkResult set_binding_table_layout(struct brw_stage_prog_data *prog_data, struct anv_pipeline *pipeline, uint32_t stage) { - uint32_t bias, count, k, *map; - struct anv_pipeline_layout *layout = pipeline->layout; - - /* No layout is valid for shaders that don't bind any resources. */ - if (pipeline->layout == NULL) - return VK_SUCCESS; - + unsigned bias; if (stage == VK_SHADER_STAGE_FRAGMENT) bias = MAX_RTS; else bias = 0; - count = layout->stage[stage].surface_count; - prog_data->map_entries = - (uint32_t *) malloc(count * sizeof(prog_data->map_entries[0])); - if (prog_data->map_entries == NULL) - return vk_error(VK_ERROR_OUT_OF_HOST_MEMORY); - - k = bias; - map = prog_data->map_entries; - for (uint32_t set = 0; set < layout->num_sets; set++) { - prog_data->bind_map[set].index = map; - unsigned index_count = 0; - for (uint32_t b = 0; b < layout->set[set].layout->binding_count; b++) { - if (layout->set[set].layout->binding[b].stage[stage].surface_index < 0) - continue; - - unsigned array_size = layout->set[set].layout->binding[b].array_size; - for (uint32_t i = 0; i < array_size; i++) - *map++ = k++; - index_count += array_size; - } - - prog_data->bind_map[set].index_count = index_count; - } + prog_data->binding_table.size_bytes = 0; + prog_data->binding_table.texture_start = bias; + prog_data->binding_table.ubo_start = bias; + prog_data->binding_table.image_start = bias; return VK_SUCCESS; } @@ -1400,7 +1375,6 @@ anv_compiler_free(struct anv_pipeline *pipeline) { for (uint32_t stage = 0; stage < VK_SHADER_STAGE_NUM; stage++) { if (pipeline->prog_data[stage]) { - free(pipeline->prog_data[stage]->map_entries); /* We only ever set up the params array because we don't do * non-UBO pull constants */ |