Implement GL_EXT_vulkan_glsl_relaxed option
This commit is contained in:
parent
159b057080
commit
ecc9b9149f
43 changed files with 6707 additions and 111 deletions
|
|
@ -501,6 +501,7 @@ public:
|
|||
noContraction = false;
|
||||
nullInit = false;
|
||||
#endif
|
||||
defaultBlock = false;
|
||||
}
|
||||
|
||||
// drop qualifiers that don't belong in a temporary variable
|
||||
|
|
@ -514,6 +515,7 @@ public:
|
|||
specConstant = false;
|
||||
nonUniform = false;
|
||||
nullInit = false;
|
||||
defaultBlock = false;
|
||||
clearLayout();
|
||||
}
|
||||
|
||||
|
|
@ -572,6 +574,7 @@ public:
|
|||
bool specConstant : 1;
|
||||
bool nonUniform : 1;
|
||||
bool explicitOffset : 1;
|
||||
bool defaultBlock : 1; // default blocks with matching names have structures merged when linking
|
||||
|
||||
#ifdef GLSLANG_WEB
|
||||
bool isWriteOnly() const { return false; }
|
||||
|
|
@ -756,6 +759,46 @@ public:
|
|||
}
|
||||
}
|
||||
|
||||
TBlockStorageClass getBlockStorage() const {
|
||||
if (storage == EvqUniform && !isPushConstant()) {
|
||||
return EbsUniform;
|
||||
}
|
||||
else if (storage == EvqUniform) {
|
||||
return EbsPushConstant;
|
||||
}
|
||||
else if (storage == EvqBuffer) {
|
||||
return EbsStorageBuffer;
|
||||
}
|
||||
return EbsNone;
|
||||
}
|
||||
|
||||
void setBlockStorage(TBlockStorageClass newBacking) {
|
||||
#ifndef GLSLANG_WEB
|
||||
layoutPushConstant = (newBacking == EbsPushConstant);
|
||||
#endif
|
||||
switch (newBacking) {
|
||||
case EbsUniform :
|
||||
if (layoutPacking == ElpStd430) {
|
||||
// std430 would not be valid
|
||||
layoutPacking = ElpStd140;
|
||||
}
|
||||
storage = EvqUniform;
|
||||
break;
|
||||
case EbsStorageBuffer :
|
||||
storage = EvqBuffer;
|
||||
break;
|
||||
#ifndef GLSLANG_WEB
|
||||
case EbsPushConstant :
|
||||
storage = EvqUniform;
|
||||
layoutSet = TQualifier::layoutSetEnd;
|
||||
layoutBinding = TQualifier::layoutBindingEnd;
|
||||
break;
|
||||
#endif
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef GLSLANG_WEB
|
||||
bool isPerView() const { return false; }
|
||||
bool isTaskMemory() const { return false; }
|
||||
|
|
@ -852,6 +895,7 @@ public:
|
|||
return hasNonXfbLayout() ||
|
||||
hasXfb();
|
||||
}
|
||||
|
||||
TLayoutMatrix layoutMatrix : 3;
|
||||
TLayoutPacking layoutPacking : 4;
|
||||
int layoutOffset;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue