From 187ebecc3a3d6953815ee23764bb79b0a171a10f Mon Sep 17 00:00:00 2001
From: JN Mo <115294419+EpicJeanNoeMorissette@users.noreply.github.com>
Date: Fri, 17 May 2024 13:31:39 -0400
Subject: [PATCH] Allow for implicit texture sampling from compute

Allow for implicit texture sampling from compute since we support DerivativeGroupLinearNV (SPIRV-Tools issue #5674)
---
 source/opt/replace_invalid_opc.cpp | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/source/opt/replace_invalid_opc.cpp b/source/opt/replace_invalid_opc.cpp
index 1b97c0e84f..63b3c0fe37 100644
--- a/source/opt/replace_invalid_opc.cpp
+++ b/source/opt/replace_invalid_opc.cpp
@@ -81,6 +81,9 @@ bool ReplaceInvalidOpcodePass::RewriteFunction(Function* function,
 
         bool replace = false;
         if (model != spv::ExecutionModel::Fragment &&
+// UE Change Begin: Allow for implicit texture sampling from compute since we support DerivativeGroupLinearNV (SPIRV-Tools issue #5674)
+            model != spv::ExecutionModel::GLCompute &&
+// UE Change End: Allow for implicit texture sampling from compute since we support DerivativeGroupLinearNV (SPIRV-Tools issue #5674)
             IsFragmentShaderOnlyInstruction(inst)) {
           replace = true;
         }