diff options
| author | Yong He <yonghe@outlook.com> | 2024-02-20 12:24:00 -0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-02-20 12:24:00 -0800 |
| commit | 4d20fd329956ac89408b1628a8291fea01bc9a6d (patch) | |
| tree | 8e62d9c1ec05142fd25d0b31073fdb56d44691b0 /source/slang/slang-emit-glsl.cpp | |
| parent | 8e9b61e3bac69dbb37a1451b62302e688a017ced (diff) | |
Refactor compiler option representations. (#3598)
* Refactor compiler option representation.
* Fix binary compatibility.
* Add a test for specifying compiler options at link time.
* Fix binary compatibility.
* Fix binary compatibility.
* Fix backward compatibility on matrix layout.
* Fix.
* Fix.
* Fix.
* Fix gfx.
* Fix gfx.
* Fix dynamic dispatch.
* Polish.
Diffstat (limited to 'source/slang/slang-emit-glsl.cpp')
| -rw-r--r-- | source/slang/slang-emit-glsl.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/source/slang/slang-emit-glsl.cpp b/source/slang/slang-emit-glsl.cpp index e394804c7..55f6d140c 100644 --- a/source/slang/slang-emit-glsl.cpp +++ b/source/slang/slang-emit-glsl.cpp @@ -54,7 +54,7 @@ SlangResult GLSLSourceEmitter::init() default: break; } - if (getTargetReq()->getForceGLSLScalarBufferLayout()) + if (getTargetProgram()->getOptionSet().shouldUseScalarLayout()) { m_glslExtensionTracker->requireExtension( UnownedStringSlice::fromLiteral("GL_EXT_scalar_block_layout")); @@ -128,7 +128,7 @@ void GLSLSourceEmitter::_emitGLSLStructuredBuffer(IRGlobalParam* varDecl, IRHLSL switch (layoutTypeOp) { case kIROp_DefaultBufferLayoutType: - m_writer->emit(getTargetReq()->getForceGLSLScalarBufferLayout() ? "scalar" : "std430"); + m_writer->emit(getTargetProgram()->getOptionSet().shouldUseScalarLayout() ? "scalar" : "std430"); break; case kIROp_Std430BufferLayoutType: m_writer->emit("std430"); @@ -241,14 +241,14 @@ void GLSLSourceEmitter::emitSSBOHeader(IRGlobalParam* varDecl, IRType* bufferTyp if (layoutOp == kIROp_DefaultBufferLayoutType) { - m_writer->emit(getTargetReq()->getForceGLSLScalarBufferLayout() ? "scalar" : "std430"); + m_writer->emit(getTargetProgram()->getOptionSet().shouldUseScalarLayout() ? "scalar" : "std430"); } else { switch (layoutOp) { case kIROp_DefaultBufferLayoutType: - m_writer->emit(getTargetReq()->getForceGLSLScalarBufferLayout() ? "scalar" : "std430"); + m_writer->emit(getTargetProgram()->getOptionSet().shouldUseScalarLayout() ? "scalar" : "std430"); break; case kIROp_Std430BufferLayoutType: m_writer->emit("std430"); @@ -391,7 +391,7 @@ void GLSLSourceEmitter::_emitGLSLParameterGroup(IRGlobalParam* varDecl, IRUnifor { // Is writable m_writer->emit("layout("); - m_writer->emit(getTargetReq()->getForceGLSLScalarBufferLayout() ? "scalar" : "std430"); + m_writer->emit(getTargetProgram()->getOptionSet().shouldUseScalarLayout() ? "scalar" : "std430"); m_writer->emit(") buffer "); } // TODO: what to do with HLSL `tbuffer` style buffers? @@ -399,7 +399,7 @@ void GLSLSourceEmitter::_emitGLSLParameterGroup(IRGlobalParam* varDecl, IRUnifor { // uniform is implicitly read only m_writer->emit("layout("); - m_writer->emit(getTargetReq()->getForceGLSLScalarBufferLayout() ? "scalar" : "std140"); + m_writer->emit(getTargetProgram()->getOptionSet().shouldUseScalarLayout() ? "scalar" : "std140"); m_writer->emit(") uniform "); } @@ -2196,7 +2196,7 @@ void GLSLSourceEmitter::emitFrontMatterImpl(TargetRequest* targetReq) // calls them, because what they call "columns" // are what we call "rows." // - switch (targetReq->getDefaultMatrixLayoutMode()) + switch (getTargetProgram()->getOptionSet().getMatrixLayoutMode()) { case kMatrixLayoutMode_RowMajor: default: |
