mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-30 18:18:14 +02:00
Having a list of all enabled/used extensions in meson allows us to get rid of a lot of boilerplate in every bvh build shader. Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io> Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35326>
45 lines
1.2 KiB
Text
45 lines
1.2 KiB
Text
/*
|
|
* Copyright © 2023 Valve Corporation
|
|
*
|
|
* SPDX-License-Identifier: MIT
|
|
*/
|
|
|
|
#version 460
|
|
|
|
layout(local_size_x = 64, local_size_y = 1, local_size_z = 1) in;
|
|
|
|
#include "build_interface.h"
|
|
|
|
layout(push_constant) uniform CONSTS
|
|
{
|
|
header_args args;
|
|
};
|
|
|
|
void
|
|
main(void)
|
|
{
|
|
DEREF(args.dst).update_dispatch_size[0] =
|
|
((DEREF(args.src).dst_node_offset - args.internal_nodes_offset) / SIZEOF(radv_gfx12_box_node) + 1) * 8;
|
|
DEREF(args.dst).update_dispatch_size[1] = 1;
|
|
DEREF(args.dst).update_dispatch_size[2] = 1;
|
|
|
|
uint32_t compacted_size = args.bvh_offset + DEREF(args.src).dst_node_offset;
|
|
|
|
uint32_t serialization_size =
|
|
compacted_size +
|
|
align(SIZEOF(radv_accel_struct_serialization_header) + SIZEOF(uint64_t) * args.instance_count,
|
|
128);
|
|
|
|
uint32_t size = serialization_size - SIZEOF(radv_accel_struct_serialization_header) -
|
|
SIZEOF(uint64_t) * args.instance_count;
|
|
|
|
DEREF(args.dst).compacted_size = compacted_size;
|
|
|
|
DEREF(args.dst).copy_dispatch_size[0] = DIV_ROUND_UP(compacted_size, 16 * 64);
|
|
DEREF(args.dst).copy_dispatch_size[1] = 1;
|
|
DEREF(args.dst).copy_dispatch_size[2] = 1;
|
|
|
|
DEREF(args.dst).serialization_size = serialization_size;
|
|
|
|
DEREF(args.dst).size = size;
|
|
}
|