clover/nir: treat UniformConstant as global memory
authorKarol Herbst <kherbst@redhat.com>
Thu, 5 Dec 2019 10:42:14 +0000 (11:42 +0100)
committerKarol Herbst <karolherbst@gmail.com>
Wed, 11 Dec 2019 23:54:39 +0000 (23:54 +0000)
Just like we already do in the llvm backend. The current constant buffer code
seems fundamentally flawed and right now we are thinking on how we want to
reimplement all of that.

But until that happens, just treat is as global memory and go on.

Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
src/gallium/state_trackers/clover/nir/invocation.cpp
src/gallium/state_trackers/clover/spirv/invocation.cpp

index ceeb3a45c5b166daa3b213e8da71f594e7042d7d..75a1d63ba0cca4c8500745aab9ae4629d5095f08 100644 (file)
@@ -68,6 +68,7 @@ module clover::nir::spirv_to_nir(const module &mod, const device &dev,
    spirv_options.caps.int16 = true;
    spirv_options.caps.int64 = true;
    spirv_options.caps.kernel = true;
+   spirv_options.constant_as_global = true;
 
    module m;
    // We only insert one section.
index 620c6b1e0ea57a38bb1bd9382d62772f838bf266..c368e430de532d31d06cc7739e2e5b45ce807021 100644 (file)
@@ -62,7 +62,7 @@ namespace {
       case SpvStorageClassFunction:
          return module::argument::scalar;
       case SpvStorageClassUniformConstant:
-         return module::argument::constant;
+         return module::argument::global;
       case SpvStorageClassWorkgroup:
          return module::argument::local;
       case SpvStorageClassCrossWorkgroup: