From 813eee213b4aa18aab62e1b88f51309ffee78630 Mon Sep 17 00:00:00 2001 From: Justin Bogner Date: Thu, 6 Mar 2025 21:05:45 -0700 Subject: [PATCH] [DirectX] Use "texture" not "SRV" when pretty printing resources We're printing "SRV" here when DXC would print "texture". Fix this to be consistent. Fixes #130227. --- llvm/lib/Target/DirectX/DXILPrettyPrinter.cpp | 2 +- llvm/test/CodeGen/DirectX/CreateHandle.ll | 8 ++++---- llvm/test/CodeGen/DirectX/CreateHandleFromBinding.ll | 8 ++++---- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/llvm/lib/Target/DirectX/DXILPrettyPrinter.cpp b/llvm/lib/Target/DirectX/DXILPrettyPrinter.cpp index 7255a9be06d51..83ec574bb5870 100644 --- a/llvm/lib/Target/DirectX/DXILPrettyPrinter.cpp +++ b/llvm/lib/Target/DirectX/DXILPrettyPrinter.cpp @@ -23,7 +23,7 @@ using namespace llvm; static StringRef getRCName(dxil::ResourceClass RC) { switch (RC) { case dxil::ResourceClass::SRV: - return "SRV"; + return "texture"; case dxil::ResourceClass::UAV: return "UAV"; case dxil::ResourceClass::CBuffer: diff --git a/llvm/test/CodeGen/DirectX/CreateHandle.ll b/llvm/test/CodeGen/DirectX/CreateHandle.ll index c4e02fb02733d..048e57c091142 100644 --- a/llvm/test/CodeGen/DirectX/CreateHandle.ll +++ b/llvm/test/CodeGen/DirectX/CreateHandle.ll @@ -3,10 +3,10 @@ ; CHECK-PRETTY: Type Format Dim ID HLSL Bind Count ; CHECK-PRETTY: ---------- ------- ----------- ------- -------------- --------- -; CHECK-PRETTY: SRV f32 buf T0 t7 unbounded -; CHECK-PRETTY: SRV byte r/o T1 t8,space1 1 -; CHECK-PRETTY: SRV struct r/o T2 t2,space4 1 -; CHECK-PRETTY: SRV u32 buf T3 t3,space5 24 +; CHECK-PRETTY: texture f32 buf T0 t7 unbounded +; CHECK-PRETTY: texture byte r/o T1 t8,space1 1 +; CHECK-PRETTY: texture struct r/o T2 t2,space4 1 +; CHECK-PRETTY: texture u32 buf T3 t3,space5 24 ; CHECK-PRETTY: UAV i32 buf U0 u7,space2 1 ; CHECK-PRETTY: UAV f32 buf U1 u5,space3 1 diff --git a/llvm/test/CodeGen/DirectX/CreateHandleFromBinding.ll b/llvm/test/CodeGen/DirectX/CreateHandleFromBinding.ll index 9919a3f2dbd25..089b6eaa563ca 100644 --- a/llvm/test/CodeGen/DirectX/CreateHandleFromBinding.ll +++ b/llvm/test/CodeGen/DirectX/CreateHandleFromBinding.ll @@ -3,10 +3,10 @@ ; CHECK-PRETTY: Type Format Dim ID HLSL Bind Count ; CHECK-PRETTY: ---------- ------- ----------- ------- -------------- --------- -; CHECK-PRETTY: SRV f32 buf T0 t7 unbounded -; CHECK-PRETTY: SRV byte r/o T1 t8,space1 1 -; CHECK-PRETTY: SRV struct r/o T2 t2,space4 1 -; CHECK-PRETTY: SRV u32 buf T3 t3,space5 24 +; CHECK-PRETTY: texture f32 buf T0 t7 unbounded +; CHECK-PRETTY: texture byte r/o T1 t8,space1 1 +; CHECK-PRETTY: texture struct r/o T2 t2,space4 1 +; CHECK-PRETTY: texture u32 buf T3 t3,space5 24 ; CHECK-PRETTY: UAV i32 buf U0 u7,space2 1 ; CHECK-PRETTY: UAV f32 buf U1 u5,space3 1 ; CHECK-PRETTY: cbuffer NA NA CB0 cb0 1