This fills out the default constructor for RWBuffer to assign the handle with the result of __builtin_hlsl_create_handle which we can then treat as a pointer to the resource data through the mid-level of the compiler. Depends on D130016 Differential Revision: https://reviews.llvm.org/D130017
10 lines
365 B
HLSL
10 lines
365 B
HLSL
// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.3-library -x hlsl -emit-llvm -disable-llvm-passes -o - %s | FileCheck %s
|
|
|
|
RWBuffer<float> Buf;
|
|
|
|
// CHECK: define linkonce_odr noundef ptr @"??0?$RWBuffer@M@hlsl@@QAA@XZ"
|
|
// CHECK-NEXT: entry:
|
|
|
|
// CHECK: %[[HandleRes:[0-9]+]] = call ptr @llvm.dx.create.handle(i8 1)
|
|
// CHECK: store ptr %[[HandleRes]], ptr %h, align 4
|