diff --git a/projects/clr/rocclr/runtime/device/gpu/gpukernel.cpp b/projects/clr/rocclr/runtime/device/gpu/gpukernel.cpp index ac51292852..50f82b4161 100644 --- a/projects/clr/rocclr/runtime/device/gpu/gpukernel.cpp +++ b/projects/clr/rocclr/runtime/device/gpu/gpukernel.cpp @@ -4017,7 +4017,7 @@ HSAILKernel::loadArguments( memList.push_back(gpu.hsaQueueMem()); } - if (srdResource) { + if (srdResource || prog().isStaticSampler()) { dev().srds().fillResourceList(memList); } diff --git a/projects/clr/rocclr/runtime/device/gpu/gpuprogram.hpp b/projects/clr/rocclr/runtime/device/gpu/gpuprogram.hpp index 532727e2ca..f5ec739c06 100644 --- a/projects/clr/rocclr/runtime/device/gpu/gpuprogram.hpp +++ b/projects/clr/rocclr/runtime/device/gpu/gpuprogram.hpp @@ -528,6 +528,9 @@ public: //! Returns TRUE if the program just compiled bool isNull() const { return isNull_; } + //! Returns TRUE if the program contains static samplers + bool isStaticSampler() const { return (staticSamplers_.size() != 0); } + protected: //! pre-compile setup for GPU virtual bool initBuild(amd::option::Options* options); diff --git a/projects/clr/rocclr/runtime/device/pal/palkernel.cpp b/projects/clr/rocclr/runtime/device/pal/palkernel.cpp index b0ecebae14..7b0e47baad 100644 --- a/projects/clr/rocclr/runtime/device/pal/palkernel.cpp +++ b/projects/clr/rocclr/runtime/device/pal/palkernel.cpp @@ -1192,7 +1192,7 @@ HSAILKernel::loadArguments( memList.push_back(gpu.hsaQueueMem()); } - if (srdResource) { + if (srdResource || prog().isStaticSampler()) { dev().srds().fillResourceList(memList); } diff --git a/projects/clr/rocclr/runtime/device/pal/palprogram.hpp b/projects/clr/rocclr/runtime/device/pal/palprogram.hpp index 927ec3e7aa..09089723ab 100644 --- a/projects/clr/rocclr/runtime/device/pal/palprogram.hpp +++ b/projects/clr/rocclr/runtime/device/pal/palprogram.hpp @@ -193,6 +193,9 @@ public: //! Returns TRUE if the program just compiled bool isNull() const { return isNull_; } + //! Returns TRUE if the program contains static samplers + bool isStaticSampler() const { return (staticSamplers_.size() != 0); } + protected: //! pre-compile setup for GPU virtual bool initBuild(amd::option::Options* options);