EmitSPIRVOptions.cpp 1.0 KB

1234567891011121314151617181920212223242526272829
  1. //===-- EmitSPIRVOptions.cpp - Options for SPIR-V CodeGen -------*- C++ -*-===//
  2. //
  3. // The LLVM Compiler Infrastructure
  4. //
  5. // This file is distributed under the University of Illinois Open Source
  6. // License. See LICENSE.TXT for details.
  7. //
  8. //===----------------------------------------------------------------------===//
  9. #include "clang/SPIRV/EmitSPIRVOptions.h"
  10. namespace clang {
  11. void EmitSPIRVOptions::Initialize() {
  12. if (useDxLayout) {
  13. cBufferLayoutRule = spirv::LayoutRule::FxcCTBuffer;
  14. tBufferLayoutRule = spirv::LayoutRule::FxcCTBuffer;
  15. sBufferLayoutRule = spirv::LayoutRule::FxcSBuffer;
  16. } else if (useGlLayout) {
  17. cBufferLayoutRule = spirv::LayoutRule::GLSLStd140;
  18. tBufferLayoutRule = spirv::LayoutRule::GLSLStd430;
  19. sBufferLayoutRule = spirv::LayoutRule::GLSLStd430;
  20. } else {
  21. cBufferLayoutRule = spirv::LayoutRule::RelaxedGLSLStd140;
  22. tBufferLayoutRule = spirv::LayoutRule::RelaxedGLSLStd430;
  23. sBufferLayoutRule = spirv::LayoutRule::RelaxedGLSLStd430;
  24. }
  25. }
  26. } // end namespace clang