From 7dabfa76ccfb396e9d2019e2b6e01259d1661dc5 Mon Sep 17 00:00:00 2001 From: Yong He Date: Thu, 5 Dec 2024 19:33:55 -0800 Subject: Implement explciit binding for metal and wgsl. (#5778) * Respect explicit bindings in wgsl emit. * Implement explciit binding generation for metal and wgsl. * Update toc. * Fix warnings in tests. * Fix tests. --------- Co-authored-by: Ellie Hermaszewska --- tests/bugs/gh-471.slang | 2 +- tests/bugs/gh-775.slang | 2 +- tests/bugs/static-method.slang | 2 +- tests/bugs/static-var.slang | 2 +- tests/bugs/texture2d-gather.hlsl | 5 +++-- tests/bugs/type-legalize-bug-1.slang | 2 +- 6 files changed, 8 insertions(+), 7 deletions(-) (limited to 'tests/bugs') diff --git a/tests/bugs/gh-471.slang b/tests/bugs/gh-471.slang index e7b09760b..d59f97281 100644 --- a/tests/bugs/gh-471.slang +++ b/tests/bugs/gh-471.slang @@ -22,7 +22,7 @@ int test(int inVal) return x * 16; } -RWStructuredBuffer outputBuffer : register(u0); +RWStructuredBuffer outputBuffer; [numthreads(4, 1, 1)] void computeMain(uint3 dispatchThreadID : SV_DispatchThreadID) diff --git a/tests/bugs/gh-775.slang b/tests/bugs/gh-775.slang index d25fa493b..05065e34a 100644 --- a/tests/bugs/gh-775.slang +++ b/tests/bugs/gh-775.slang @@ -18,7 +18,7 @@ int test(int inVal) } //TEST_INPUT:ubuffer(data=[9 9 9 9], stride=4):out,name outputBuffer -RWStructuredBuffer outputBuffer : register(u0); +RWStructuredBuffer outputBuffer; [numthreads(4, 1, 1)] void computeMain(uint3 dispatchThreadID : SV_DispatchThreadID) diff --git a/tests/bugs/static-method.slang b/tests/bugs/static-method.slang index 98e4a3273..4e5785c41 100644 --- a/tests/bugs/static-method.slang +++ b/tests/bugs/static-method.slang @@ -11,7 +11,7 @@ struct S } //TEST_INPUT:ubuffer(data=[0 0 0 0], stride=4):out,name outputBuffer -RWStructuredBuffer outputBuffer : register(u0); +RWStructuredBuffer outputBuffer; int test(int t) { diff --git a/tests/bugs/static-var.slang b/tests/bugs/static-var.slang index 004567466..12ce5cb4d 100644 --- a/tests/bugs/static-var.slang +++ b/tests/bugs/static-var.slang @@ -8,7 +8,7 @@ int test(int inVal) } //TEST_INPUT:ubuffer(data=[9 9 9 9], stride=4):out,name outputBuffer -RWStructuredBuffer outputBuffer : register(u0); +RWStructuredBuffer outputBuffer; [numthreads(4, 1, 1)] void computeMain(uint3 dispatchThreadID : SV_DispatchThreadID) diff --git a/tests/bugs/texture2d-gather.hlsl b/tests/bugs/texture2d-gather.hlsl index 9b0607eae..7344d863d 100644 --- a/tests/bugs/texture2d-gather.hlsl +++ b/tests/bugs/texture2d-gather.hlsl @@ -3,8 +3,9 @@ //TEST_INPUT: Texture2D(size=16, content=chessboard, format=R32_FLOAT):name g_texture //TEST_INPUT: Sampler :name g_sampler -Texture2D g_texture : register(t0); -SamplerState g_sampler : register(s0); +Texture2D g_texture; + +SamplerState g_sampler; cbuffer Uniforms { diff --git a/tests/bugs/type-legalize-bug-1.slang b/tests/bugs/type-legalize-bug-1.slang index 7f1e99d37..c2e2d4565 100644 --- a/tests/bugs/type-legalize-bug-1.slang +++ b/tests/bugs/type-legalize-bug-1.slang @@ -5,7 +5,7 @@ //TEST_INPUT:type_conformance A:IFoo=0 //TEST_INPUT:type_conformance B:IFoo=1 -RWStructuredBuffer outputBuffer : register(u0); +RWStructuredBuffer outputBuffer; interface IFoo { associatedtype T : IFoo; -- cgit v1.2.3