Skip to content

Commit

Permalink
Add umd control for allowing forceUniformBuffer and forceUniformSurf…
Browse files Browse the repository at this point in the history
…aceSampler

Add umd control for allowing forceUniformBuffer and forceUniformSurfaceSampler
  • Loading branch information
psroczyn authored and igcbot committed Sep 19, 2023
1 parent 4dafd39 commit 663698b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
10 changes: 7 additions & 3 deletions IGC/Compiler/CISACodeGen/ShaderCodeGen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -924,12 +924,16 @@ void AddLegalizationPasses(CodeGenContext& ctx, IGCPassManager& mpm, PSSignature
mpm.add(createVectorBitCastOptPass());
}

bool csForceUniformSurfaceSampler = ( ctx.type == ShaderType::COMPUTE_SHADER && ctx.getModuleMetaData()->csInfo.forceUniformSurfaceSampler );
bool csForceUniformBuffer = ( ctx.type == ShaderType::COMPUTE_SHADER && ctx.getModuleMetaData()->csInfo.forceUniformBuffer );
if (ctx.m_instrTypes.hasUniformAssumptions ||
IGC_IS_FLAG_ENABLED(ForceUniformSurfaceSampler) ||
IGC_IS_FLAG_ENABLED(ForceUniformBuffer)) {
csForceUniformSurfaceSampler ||
IGC_IS_FLAG_ENABLED(ForceUniformBuffer) ||
csForceUniformBuffer ) {
mpm.add(new UniformAssumptions(
IGC_IS_FLAG_ENABLED(ForceUniformSurfaceSampler),
IGC_IS_FLAG_ENABLED(ForceUniformBuffer))
IGC_IS_FLAG_ENABLED(ForceUniformSurfaceSampler) || csForceUniformSurfaceSampler,
IGC_IS_FLAG_ENABLED(ForceUniformBuffer) || csForceUniformBuffer )
);
}

Expand Down
2 changes: 2 additions & 0 deletions IGC/common/MDFrameWork.h
Original file line number Diff line number Diff line change
Expand Up @@ -470,6 +470,8 @@ namespace IGC
bool disableSimd32Slicing = false;
bool disableSplitOnSpill = false;
bool forcedVISAPreRAScheduler = false;
bool forceUniformBuffer = false;
bool forceUniformSurfaceSampler = false;
// disables dispatch along y and tiled order optimizations
bool disableLocalIdOrderOptimizations = false;
// force disables dispatch along y optimization
Expand Down

0 comments on commit 663698b

Please sign in to comment.