瀏覽代碼

mesa: Add and use foreach_list_typed_safe.

Acked-by: Ian Romanick <ian.d.romanick@intel.com>
tags/10.3-branchpoint
Matt Turner 11 年之前
父節點
當前提交
d6bb8bb7ce
共有 2 個檔案被更改,包括 10 行新增3 行删除
  1. 9
    0
      src/glsl/list.h
  2. 1
    3
      src/mesa/drivers/dri/i965/intel_mipmap_tree.c

+ 9
- 0
src/glsl/list.h 查看文件

@@ -630,4 +630,13 @@ inline void exec_node::insert_before(exec_list *before)
(__node)->__field.next != NULL; \
(__node) = exec_node_data(__type, (__node)->__field.next, __field))

#define foreach_list_typed_safe(__type, __node, __field, __list) \
for (__type * __node = \
exec_node_data(__type, (__list)->head, __field), \
* __next = \
exec_node_data(__type, (__node)->__field.next, __field); \
__next != NULL; \
__node = __next, __next = \
exec_node_data(__type, (__next)->__field.next, __field))

#endif /* LIST_CONTAINER_H */

+ 1
- 3
src/mesa/drivers/dri/i965/intel_mipmap_tree.c 查看文件

@@ -1506,9 +1506,7 @@ intel_miptree_all_slices_resolve(struct brw_context *brw,
{
bool did_resolve = false;

foreach_list_safe(node, &mt->hiz_map) {
struct intel_resolve_map *map = (struct intel_resolve_map *)node;

foreach_list_typed_safe(struct intel_resolve_map, map, link, &mt->hiz_map) {
if (map->need != need)
continue;


Loading…
取消
儲存