From 092337a67e7ef8ec108cab9cb6679e59bb2ff791 Mon Sep 17 00:00:00 2001 From: jsmall-nvidia Date: Tue, 4 Aug 2020 19:34:33 -0400 Subject: Sampler Feedback improvements (#1475) * Add the Feedback texture types. Depreciate SLANG_RESOURCE_EXT_SHAPE_MASK. * Starting point to test sampler feedback. * WIP on FeedbackSampler. * Use __target_intrinsic to override the output of sampler feedback types. * Use newer generic syntax for FeedbackTexture. * Reflects Feedback type. * SLANG_TYPE_KIND_TEXTURE_FEEDBACK -> SLANG_TYPE_KIND_FEEDBACK * Added reflection test. * Reneable issue with generics in sampler-feedback-basic.slang * Add methods to FeedbackTexture2D/Array. Make test cover test cases. * Sampler feedback produces DXC code. * Disabled Sampler feedback test - as requires newer version of DXC. * Fix bug in reflection tool output. * Fix problem with direct-spirv-emit.slang.expected due to update to glslang. * Fix direct-spirv-emit.slang * Use SLANG_RESOURCE_EXT_SHAPE_MASK again * Make Feedback be emitted as a textue type prefix. * Add support for GetDimensions to FeedbackTexture2D * WIP on CPU sampler feedback. Update of target compatibility. * Fix some bugs in C++ feedback sampler. Fix GetDimensions for FeedbackTextures. Run 'Compile' test for CPU compute feedback texture test. Update target-compatability.md * Fix GetDimensions call on feedback sampler. * Small documentation improvements. Co-authored-by: Tim Foley --- source/slang/hlsl.meta.slang | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'source') diff --git a/source/slang/hlsl.meta.slang b/source/slang/hlsl.meta.slang index b2748c50d..01fb17851 100644 --- a/source/slang/hlsl.meta.slang +++ b/source/slang/hlsl.meta.slang @@ -4024,6 +4024,18 @@ __magic_type(Texture, $(feedbackTexture2DFlavor)) __intrinsic_type($(kIROp_TextureType + (feedbackTexture2DFlavor << kIROpMeta_OtherShift))) struct FeedbackTexture2D { + __target_intrinsic(hlsl) + void GetDimensions(out uint width, out uint height); + + __target_intrinsic(hlsl) + void GetDimensions(uint mipLevel, out uint width, out uint height, out uint numberOfLevels); + + __target_intrinsic(hlsl) + void GetDimensions(out float width,out float height); + + __target_intrinsic(hlsl) + void GetDimensions(uint mipLevel, out float width,out float height, out float numberOfLevels); + // With Clamp __target_intrinsic(hlsl, "($0).WriteSamplerFeedback($1, $2, $3, $4)") @@ -4058,6 +4070,15 @@ __magic_type(Texture, $(feedbackTexture2DArrayFlavor)) __intrinsic_type($(kIROp_TextureType + (feedbackTexture2DArrayFlavor << kIROpMeta_OtherShift))) struct FeedbackTexture2DArray { + __target_intrinsic(hlsl) + void GetDimensions(out uint width,out uint height, out uint elements); + __target_intrinsic(hlsl) + void GetDimensions(uint mipLevel, out uint width,out uint height, out uint elements, out uint numberOfLevels); + __target_intrinsic(hlsl) + void GetDimensions(out float width,out float height, out float elements); + __target_intrinsic(hlsl) + void GetDimensions(uint mipLevel, out float width,out float height, out float elements, out float numberOfLevels); + // With Clamp __target_intrinsic(hlsl, "($0).WriteSamplerFeedback($1, $2, $3, $4)") -- cgit v1.2.3